import { ElementType, ReactNode, Ref, CSSProperties, ComponentPropsWithoutRef } from 'react'; import { Color } from '../types.js'; import { SurfaceVariant } from './Surface.js'; export type ButtonSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; type ButtonSurface = 'surface' | 'cut'; interface ButtonOwnProps { /** Button content (label, icons, etc.). */ children?: ReactNode; /** Extra classes for the button surface root. */ className?: string; /** Visually dim the button (40% opacity) and disable pointer events. */ disabled?: boolean; /** Block clicks while keeping the button visually enabled - useful for "selected" segmented buttons. */ readOnly?: boolean; /** When `true`, applies fully rounded corners (`rounded-full`, or matching pill radius for `multiline`). * * Default size-specific corner radii are used when `false`. */ rounded?: boolean; /** Button size token. Drives height, padding, font size, and corner radius. Default `'md'`. */ size?: ButtonSize; /** Polymorphic element to render. Defaults to `'button'`. Pass `'a'` for links (cursor switches to pointer automatically), or any custom component to retain Button styling on a different DOM node. The component's own props become valid here. */ as?: C; /** Underlying `Surface` variant - see `SurfaceVariant`. Defaults to `'gradient'`. */ variant?: SurfaceVariant; /** Accent color token. Sets the button's `cladd-color-{name}` class - drives text and ring colors. */ color?: Color; /** Render the surface outline ring. Defaults to `true`. */ outline?: boolean; /** Extra classes for the inner content row. */ contentClassName?: string; /** Native `style` forwarded to the surface root. */ style?: CSSProperties; /** Force the focus ring on, regardless of actual keyboard focus. */ focused?: boolean; /** Render the focus ring flush against the element (`inset-0`) instead of offset outside it (`-inset-1.5`). Use when the button sits at the edge of an `overflow` container, where the offset ring would add unwanted scroll overflow. Default `false`. */ tightFocusRing?: boolean; /** Force the pressed visual state, regardless of pointer activity. */ pressed?: boolean; /** Allow text to wrap onto multiple lines, switching height to `min-h-*` and using pill radii compatible with multi-line content. */ multiline?: boolean; /** Render as an icon-only square button: forces `aspect-square` and drops horizontal padding. */ square?: boolean; /** * Which surface primitive to wrap with: * * - `'surface'` (default) - uses `Surface` (standard tinted/outlined panel). * - `'cut'` - uses `SurfaceCut` (inset/recessed look - for buttons that sit inside another surface). */ surface?: ButtonSurface; /** Forwarded to the underlying surface. Defaults to `true`. Suppressed automatically when `disabled` or `readOnly`. */ clickable?: boolean; /** Forwarded to the underlying surface. Defaults to `true`. Suppressed automatically when `disabled` or `readOnly`. */ hoverable?: boolean; /** Renders a `FocusableLayer` ring on keyboard focus. Defaults to `true`. Suppressed automatically when `disabled` or `readOnly`. */ focusable?: boolean; /** Forwarded to the underlying `Surface` as `level` - see `SurfaceProps.level` for the relative-offset (`"+1"`/`"-1"`) syntax. */ surfaceLevel?: string | number; /** Show a centered `Spinner` overlay and fade the button's content out. Also sets `data-loading` for styling hooks. */ loading?: boolean; /** Forwarded to the polymorphic root element. */ ref?: Ref; } export type ButtonProps = ButtonOwnProps & Omit, keyof ButtonOwnProps>; /** * Shape of `Button` defaults that can be supplied via `CladdProvider`'s * `defaults={{ Button: { ... } }}` prop. Polymorphic (`as`, `ref`) and * per-instance (`children`) props are intentionally excluded. */ export type ButtonDefaultProps = Partial>; export declare const buttonIconSizes: Record; export declare const Button: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=Button.d.ts.map