import { useEffect, useRef, type PropsWithChildren, type ReactElement, } from "react"; import type { BaseProps, ComponentVariant, HTMLProps, } from "../../shared/types"; import { cn } from "../../shared/utils/cn"; import { buttonStyles, useAndApplyBoldTextWidth } from "./utils"; import { cloneIcon } from "../../shared/utils/clone-icon"; import "./index.css"; export type ButtonProps = Omit, "aria-disabled"> & { size?: "small" | "large"; variant?: ComponentVariant; start?: ReactElement>; end?: ReactElement>; } & BaseProps; export const Button = ({ size = "small", variant = "primary", className, children, start, end, testId, ...props }: PropsWithChildren) => { const buttonClassNames = buttonStyles[variant]; const iconCss = "w-6 h-6"; const hasIcons = start || end; const textRef = useAndApplyBoldTextWidth(children, "text-increase-size"); return ( ); };