import type { ComponentType, CSSProperties, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref, RefObject } from "react"; export declare const DESIGN_SYSTEM_CONTRACT_VERSION: 1; export type DesignSystemIntent = "primary" | "neutral" | "danger"; export type DesignSystemEmphasis = "solid" | "outline" | "ghost"; export type DesignSystemSize = "compact" | "default" | "large"; export type DesignSystemTone = "neutral" | "info" | "success" | "warning" | "danger"; export type DesignSystemPlacement = "top" | "right" | "bottom" | "left"; export type DesignSystemAlign = "start" | "center" | "end"; export type DesignSystemKey = string | number; export type DesignSystemPressEvent = ReactMouseEvent | ReactKeyboardEvent; /** * Styling hooks are optional interoperability affordances. Adapters must not * rely on either hook being present, and Toolkit views must not pass * framework-specific utility classes through this contract. */ export interface DesignSystemStyleProps { className?: string; style?: CSSProperties; } export interface DesignSystemAccessibleProps { id?: string; title?: string; "aria-label"?: string; "aria-labelledby"?: string; "aria-describedby"?: string; "aria-controls"?: string; "aria-expanded"?: boolean; "aria-haspopup"?: boolean | "dialog" | "grid" | "listbox" | "menu" | "tree"; "aria-pressed"?: boolean | "mixed"; } export interface DesignSystemOverlayProps extends DesignSystemStyleProps { portalContainer?: Element | null; placement?: DesignSystemPlacement; align?: DesignSystemAlign; collisionPadding?: number; } export interface ActionButtonProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { children?: ReactNode; intent?: DesignSystemIntent; emphasis?: DesignSystemEmphasis; size?: DesignSystemSize; pending?: boolean; disabled?: boolean; type?: "button" | "submit" | "reset"; leadingIcon?: ReactNode; trailingIcon?: ReactNode; onPress?: (event?: DesignSystemPressEvent) => void; /** Native click interoperability for Radix `asChild` composition. */ onClick?: (event: ReactMouseEvent) => void; elementRef?: Ref; } export interface IconButtonProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { label: string; icon: ReactNode; intent?: DesignSystemIntent; emphasis?: DesignSystemEmphasis; size?: DesignSystemSize; pending?: boolean; disabled?: boolean; type?: "button" | "submit" | "reset"; onPress?: (event?: DesignSystemPressEvent) => void; /** Native click interoperability for Radix `asChild` composition. */ onClick?: (event: ReactMouseEvent) => void; elementRef?: Ref; } export type DesignSystemTextInputType = "text" | "email" | "password" | "search" | "tel" | "url"; export interface TextFieldProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { value: string; onChange: (value: string) => void; label?: ReactNode; description?: ReactNode; errorMessage?: ReactNode; placeholder?: string; /** Optional native datalist id for editable fields with suggestions. */ list?: string; name?: string; type?: DesignSystemTextInputType; inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; autoComplete?: string; autoFocus?: boolean; required?: boolean; readOnly?: boolean; disabled?: boolean; invalid?: boolean; leadingContent?: ReactNode; trailingContent?: ReactNode; onBlur?: () => void; onFocus?: () => void; onKeyDown?: (event: ReactKeyboardEvent) => void; inputRef?: Ref; } export interface TextAreaProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { value: string; onChange: (value: string) => void; label?: ReactNode; description?: ReactNode; errorMessage?: ReactNode; placeholder?: string; name?: string; rows?: number; maxLength?: number; autoFocus?: boolean; required?: boolean; readOnly?: boolean; disabled?: boolean; invalid?: boolean; onBlur?: () => void; onFocus?: () => void; onKeyDown?: (event: ReactKeyboardEvent) => void; textAreaRef?: Ref; } export interface SpinnerProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { label?: string; size?: DesignSystemSize; } export interface SkeletonProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { width?: string | number; height?: string | number; shape?: "line" | "rectangle" | "circle"; } export interface StatusProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { children: ReactNode; tone?: DesignSystemTone; icon?: ReactNode; size?: DesignSystemSize; } export interface SurfaceProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { children: ReactNode; as?: "div" | "section" | "article" | "aside"; elevation?: "none" | "low" | "medium"; padding?: "none" | "compact" | "default" | "spacious"; interactive?: boolean; onPress?: (event?: DesignSystemPressEvent) => void; } export interface AvatarProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { name: string; src?: string | null; fallback?: ReactNode; size?: DesignSystemSize; status?: "online" | "offline" | "busy" | "away"; imageRef?: Ref; } export interface TooltipProps extends DesignSystemOverlayProps { trigger: ReactElement; content: ReactNode; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; delayMs?: number; disabled?: boolean; } export interface MenuItem { id: DesignSystemKey; label: ReactNode; description?: ReactNode; icon?: ReactNode; shortcut?: ReactNode; disabled?: boolean; intent?: Extract; selected?: boolean; children?: readonly MenuItem[]; } export interface MenuSection { id: DesignSystemKey; label?: ReactNode; items: readonly MenuItem[]; } export interface MenuProps extends DesignSystemOverlayProps { trigger: ReactElement; items?: readonly MenuItem[]; sections?: readonly MenuSection[]; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; onAction: (id: DesignSystemKey) => void; closeOnAction?: boolean; } export interface PopoverProps extends DesignSystemOverlayProps { trigger: ReactElement; children: ReactNode; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; modal?: boolean; dismissible?: boolean; initialFocusRef?: RefObject; restoreFocusRef?: RefObject; } export interface DialogProps extends DesignSystemOverlayProps { open: boolean; onOpenChange: (open: boolean) => void; title: ReactNode; children: ReactNode; description?: ReactNode; footer?: ReactNode; trigger?: ReactElement; size?: "small" | "medium" | "large" | "fullscreen"; dismissible?: boolean; closeLabel?: string; initialFocusRef?: RefObject; restoreFocusRef?: RefObject; } export interface PickerOption { value: Value; label: ReactNode; textValue?: string; description?: ReactNode; icon?: ReactNode; disabled?: boolean; keywords?: readonly string[]; } export interface PickerProps extends DesignSystemOverlayProps, DesignSystemAccessibleProps { mode: "select" | "combobox"; options: readonly PickerOption[]; value: Value | null; onChange: (value: Value | null) => void; label?: ReactNode; description?: ReactNode; errorMessage?: ReactNode; placeholder?: string; searchValue?: string; onSearchChange?: (value: string) => void; open?: boolean; onOpenChange?: (open: boolean) => void; emptyContent?: ReactNode; loadingContent?: ReactNode; loading?: boolean; required?: boolean; disabled?: boolean; invalid?: boolean; pickerRef?: Ref; } export interface CheckboxProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { checked: boolean; onChange: (checked: boolean) => void; label?: ReactNode; description?: ReactNode; indeterminate?: boolean; required?: boolean; disabled?: boolean; invalid?: boolean; inputRef?: Ref; } export interface SwitchProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { checked: boolean; onChange: (checked: boolean) => void; label?: ReactNode; description?: ReactNode; disabled?: boolean; inputRef?: Ref; } export interface TabItem { value: Value; label: ReactNode; content: ReactNode; disabled?: boolean; icon?: ReactNode; } export interface TabsProps extends DesignSystemStyleProps, DesignSystemAccessibleProps { items: readonly TabItem[]; value: Value; onChange: (value: Value) => void; orientation?: "horizontal" | "vertical"; activationMode?: "automatic" | "manual"; } export interface PickerComponent { (props: PickerProps): ReactNode; } export interface TabsComponent { (props: TabsProps): ReactNode; } export interface DesignSystemComponents { ActionButton: ComponentType; IconButton: ComponentType; TextField: ComponentType; TextArea: ComponentType; Spinner: ComponentType; Skeleton: ComponentType; Status: ComponentType; Surface: ComponentType; Avatar: ComponentType; Tooltip: ComponentType; Menu: ComponentType; Popover: ComponentType; Dialog: ComponentType; Picker: PickerComponent; Checkbox: ComponentType; Switch: ComponentType; Tabs: TabsComponent; } export type DesignSystemComponentName = keyof DesignSystemComponents; //# sourceMappingURL=types.d.ts.map