import type * as React from 'react'; import type { PrimitivePropsWithRef } from '../utils/primitive.cjs'; /** Props for the split button root — pass `aria-label` or `aria-labelledby` to name the group. */ export interface SplitButtonProps extends Omit, 'onSelect'> { /** * Text of the derived primary `SplitButtonAction` button. * @default undefined — no action is derived. */ label?: React.ReactNode | undefined; /** * The menu entries behind the derived `SplitButtonTrigger`, rendered into a `Menu`; ignored when `children` is given. * @default undefined — no menu is derived. */ items?: SplitButtonItem[] | undefined; /** * Fires when the derived primary `SplitButtonAction` is pressed. * @default undefined — no-op if omitted. */ onActionClick?: ((event: React.MouseEvent) => void) | undefined; /** * Fires with the menu entry that was activated. * @default undefined — no-op if omitted. */ onSelect?: ((item: SplitButtonItem) => void) | undefined; /** * Accessible name for the derived `SplitButtonTrigger`, a bare chevron with no text of its own. * @default 'More options' */ menuLabel?: string | undefined; /** * Size rung the skin scales both buttons by, mirrored to `data-size`. * @default undefined — the skin's own default size. */ size?: 'sm' | 'md' | 'lg' | (string & {}) | undefined; /** * Visual weight rung the skin gives both buttons, mirrored to `data-variant`. * @default undefined — the skin's own default weight. */ variant?: 'secondary' | 'primary' | 'danger' | 'outline' | 'ghost' | (string & {}) | undefined; } /** One entry of {@link SplitButtonProps.items} — a single menu action. */ export interface SplitButtonItem { /** Unique identifier for this entry, reported back through `onSelect`. */ value: string; /** Text rendered inside the derived menu item. */ label: string; /** * Marks the entry `aria-disabled` and blocks selection, leaving it focusable. * @default false */ disabled?: boolean | undefined; } /** * Props for the split button's primary action button. */ export interface SplitButtonActionProps extends PrimitivePropsWithRef<'button'> { /** * Disables the primary action independently of the trigger half; disable the whole control via `
` or one boolean bound to both halves. * @default false */ disabled?: boolean | undefined; } /** Props for {@link SplitButtonTrigger}, the small button that opens an attached menu. */ export interface SplitButtonTriggerProps extends PrimitivePropsWithRef<'button'> { /** * Disables opening the menu independently of the action half. * @default false */ disabled?: boolean | undefined; /** * Accessible name for the trigger, a bare chevron with no text of its own. * @default undefined */ 'aria-label'?: string | undefined; }