Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:

committed by
GitHub

parent
8fa6cb5e03
commit
4c0a31d38b
@@ -1,3 +1,4 @@
|
||||
import type { CSSProperties } from 'react'
|
||||
import React from 'react'
|
||||
import { type VariantProps, cva } from 'class-variance-authority'
|
||||
import classNames from 'classnames'
|
||||
@@ -29,15 +30,17 @@ const buttonVariants = cva(
|
||||
|
||||
export type ButtonProps = {
|
||||
loading?: boolean
|
||||
styleCss?: CSSProperties
|
||||
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, loading, children, ...props }, ref) => {
|
||||
({ className, variant, size, loading, styleCss, children, ...props }, ref) => {
|
||||
return (
|
||||
<button
|
||||
type='button'
|
||||
className={classNames(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
style={styleCss}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
|
Reference in New Issue
Block a user