26 lines
528 B
TypeScript
26 lines
528 B
TypeScript
import type { ButtonHTMLAttributes } from "react";
|
|
import {
|
|
buttonClassName,
|
|
type ButtonStyleOptions,
|
|
} from "./button-variants";
|
|
|
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &
|
|
ButtonStyleOptions;
|
|
|
|
/** 按钮组件:渲染原生 <button>,样式由 buttonVariants 统一管理 */
|
|
export function Button({
|
|
className,
|
|
variant,
|
|
size,
|
|
type = "button",
|
|
...props
|
|
}: ButtonProps) {
|
|
return (
|
|
<button
|
|
type={type}
|
|
className={buttonClassName({ className, variant, size })}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|