import type { PropsWithChildren, ReactElement } from "react"; import type { ComponentVariant, HTMLProps } from "../../shared/types"; import { cn } from "../../shared/utils/cn"; import { invariant } from "../../shared/utils/invariant"; import { buttonStyles } from "./utils"; import { Typography } from "../typography/Typography"; import { cloneIcon } from "../../shared/utils/clone-icon"; export type ButtonProps = Omit, "aria-disabled"> & { size?: "small" | "large"; variant?: ComponentVariant; start?: ReactElement>; end?: ReactElement>; }; export const Button = ({ size = "small", variant = "primary", className, children, start, end, ...props }: PropsWithChildren) => { invariant(typeof children === "string", "Children must be string"); const buttonClassNames = buttonStyles[variant]; const iconCss = "w-6 h-6"; const hasIcons = start || end; return ( ); };