import * as _redsift_design_system from '@redsift/design-system'; import { ContainerProps, ContainerTransientProps, Comp, ValueOf, TextProps, Theme, FlexboxProps, ListboxContextProps, PillProps, ItemProps, ButtonColor, ButtonVariant, TextFieldVariant } from '@redsift/design-system'; export { ItemProps } from '@redsift/design-system'; import React, { ComponentProps, RefObject, ReactElement, ReactNode } from 'react'; import { PopoverProps, PopoverContentProps, PopoverTriggerProps } from '@redsift/popovers'; /** * Component props. */ interface ComboboxContentFooterProps extends ComponentProps<'div'>, ContainerProps { } interface StyledComboboxContentFooterProps extends ComponentProps<'div'>, ContainerTransientProps { } /** * The ComboboxContentFooter component. */ declare const ComboboxContentFooter: Comp; /** * Component props. */ interface ComboboxContentHeaderProps extends ComponentProps<'div'>, ContainerProps { } interface StyledComboboxContentHeaderProps extends ComponentProps<'div'>, ContainerTransientProps { } /** * The ComboboxContentHeader component. */ declare const ComboboxContentHeader: Comp; /** * Component variant. */ declare const ComboboxSelectionMode: { readonly single: "single"; readonly multiple: "multiple"; }; type ComboboxSelectionMode = ValueOf; declare const ComboboxVariant: { readonly options: "options"; readonly suggestions: "suggestions"; }; type ComboboxVariant = ValueOf; type ComboboxValue = string | string[]; /** * Context props. */ type ComboboxState = { /** Filtering parameters. */ readonly filter?: { type: 'startsWith' | 'contains' | 'endsWith'; caseSensitive?: boolean; }; /** Whether the combobox is disabled or not. */ readonly isDisabled: boolean; /** Whether the combobox is invalid or not. */ readonly isInvalid: boolean; /** Sets the selected value. */ setValue(value: ComboboxValue): void; /** Current selected value. */ readonly value: ComboboxValue; /** Sets the input value. */ setInputValue(inputValue: string): void; /** Current input value. */ readonly inputValue: string; /** Whether the Combobox allow multiple selection or not. */ selectionMode?: ComboboxSelectionMode; /** If 'options', the input field cannot have free text, the selection has to be made within the options. If 'suggestions', then choosing from the list isn't mandatory and the user can write free text within the input. */ variant?: ComboboxVariant; /** Ref to the first item used to create values. */ freeTextItemRef?: RefObject; /** Id of the first item used to create values. */ freeTextItemId?: string; /** Class name to append to the trigger. */ readonly triggerClassName?: string; /** Ref to the form, if any. */ formRef?: RefObject; /** Ref to the submit button, if any. */ submitRef?: RefObject; }; /** * Component props. */ interface ComboboxProps extends PopoverProps { /** * If 'options', the input field cannot have free text, the selection has to be made within the options. If 'suggestions', then choosing from the list isn't mandatory and the user can write free text within the input. * @default 'options' */ variant?: ComboboxVariant; /** * Default selected value. * Used for uncontrolled version. */ defaultValue?: ComboboxValue; /** Description of the combobox. */ description?: string | ReactElement; /** Additional description properties. */ descriptionProps?: Omit; /** Filtering parameters. */ filter?: { type: 'startsWith' | 'contains' | 'endsWith'; caseSensitive?: boolean; }; /** Ref to the form, if any. */ formRef?: RefObject; /** Ref to the submit button, if any. */ submitRef?: RefObject; /** Whether the component is disabled or not. */ isDisabled?: boolean; /** Whether the component is invalid or not. */ isInvalid?: boolean; /** Maximum number of options displayed. Useful when too many options are displayed. */ maxOptionsLength?: number; /** Method to handle selection change. */ onChange?(value: ComboboxValue): void; /** Method to handle input change. */ onInputChange?(value: string): void; /** * Currently selected value. * Used for controlled version. */ value?: ComboboxValue; /** Input value. */ inputValue?: string; /** Whether the Combobox allow multiple selection or not. */ selectionMode?: ComboboxSelectionMode; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; /** Props to forward to the wrapper. */ wrapperProps?: Omit; } type StyledComboboxProps = ComboboxProps; /** * Component props. */ interface ComboboxContentListboxProps extends FlexboxProps { renderFreeTextItem?: ReactNode | ((value?: string, comboboxState?: ComboboxState | null, listboxState?: ListboxContextProps) => ReactNode); } /** * The ComboboxContentListbox component. */ declare const ComboboxContentListbox: Comp; /** * Component props. */ interface ComboboxContentProps extends PopoverContentProps { /** Whether the popover should stay open even if there is no result after filter. */ shouldStayOpenEvenIfEmpty?: boolean; } /** * The ComboboxContent component. */ declare const BaseComboboxContent: Comp; declare const ComboboxContent: Comp & { Header: Comp; Listbox: Comp; Footer: Comp; }; /** * Component props. */ interface ComboboxTriggerProps extends Omit { /** Children */ children: ReactElement | ((state: { value?: ComboboxValue; isOpen?: boolean; }) => ReactElement); /** Whether the clear button should be hiding (not recommended) */ hideClearButton?: boolean; /** Whether or not the expand/collapse icon button should be displayed or not. */ hideExpandButton?: boolean; /** Whether the popover should open on focus. */ openOnFocus?: boolean; /** Props to forward to the Pills. */ pillProps?: Omit; /** Method used to customize the content of the Pills. */ renderPillContent?: (value: string) => ReactNode; } /** * The ComboboxTrigger component. */ declare const ComboboxTrigger: Comp; /** * Combobox combines a text input with a filterable dropdown list. * Supports single or multiple selection with type-ahead filtering. * * Variants: * - `options`: Shows predefined options only (default) * - `freeform`: Allows custom values not in the list * * Selection modes: `single`, `multiple` * * @example * // Basic single-select combobox * setCountry(value)}> * * * United States * United Kingdom * Canada * * * * @example * // Multi-select combobox * * * * Urgent * Bug * Feature * * * * @example * // Open dropdown on focus (for autocomplete fields) * * * ... * * * @example * // With Header and Footer * * * * * Recent contacts * * * Alice * Bob * * * * * * * * @example * // Freeform variant (allows custom entries) * * * * {suggestions.map(email => {email})} * * * * @example * // Multi-select with custom pill content * * ( * * * {value} * * )} * > * * * * Cat * Dog * * */ declare const BaseCombobox: React.FC & { displayName?: string; className?: string; }; declare const Combobox: React.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp & { Header: _redsift_design_system.Comp; Listbox: _redsift_design_system.Comp; Footer: _redsift_design_system.Comp; }; }; /** * The Item component. */ declare const Item: Comp; /** * Component props. */ interface MenuButtonContentFooterProps extends ComponentProps<'div'>, ContainerProps { } interface StyledMenuButtonContentFooterProps extends ComponentProps<'div'>, ContainerTransientProps { } /** * The MenuButtonContentFooter component. */ declare const MenuButtonContentFooter: Comp; /** * Component props. */ interface MenuButtonContentHeaderProps extends ComponentProps<'div'>, ContainerProps { } interface StyledMenuButtonContentHeaderProps extends ComponentProps<'div'>, ContainerTransientProps { } /** * The MenuButtonContentHeader component. */ declare const MenuButtonContentHeader: Comp; /** * Component props. */ interface MenuButtonContentMenuProps extends FlexboxProps { } /** * The MenuButtonContentMenu component. */ declare const MenuButtonContentMenu: Comp; /** * Component props. */ interface MenuButtonContentProps extends PopoverContentProps { } /** * The MenuButtonContent component. */ declare const BaseMenuButtonContent: Comp; declare const MenuButtonContent: Comp & { Header: Comp; Menu: Comp; Footer: Comp; }; /** * Component props. */ interface MenuButtonTriggerProps extends Omit { /** Children */ children: ReactElement | ((state: { value?: string; isOpen?: boolean; }) => ReactElement); } /** * The MenuButtonTrigger component. */ declare const MenuButtonTrigger: Comp; /** * Context props. */ type MenuButtonState = { /** Button color that will be forward to the trigger. */ readonly color?: ButtonColor; /** Whether the trigger is disabled or not. */ readonly isDisabled: boolean; /** Class name to append to the trigger. */ readonly triggerClassName?: string; /** Button variant that will be forward to the trigger. */ readonly variant?: ButtonVariant; }; /** * Component props. */ interface MenuButtonProps extends PopoverProps { /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** Description of the menu button. */ description?: string | ReactElement; /** Additional description properties. */ descriptionProps?: Omit; /** Whether the component is disabled or not. */ isDisabled?: boolean; /** Label of the menu button. */ label?: string | ReactElement; /** Additional label properties. */ labelProps?: Omit; /** Class name to append to the trigger. */ triggerClassName?: string; /** Button variant that will be forward to the trigger. */ variant?: ButtonVariant; /** Theme. */ theme?: Theme; /** Props to forward to the wrapper. */ wrapperProps?: Omit; } type StyledMenuButtonProps = MenuButtonProps; /** * MenuButton displays a button that opens a menu of actions. * Unlike Select (for choosing values), MenuButton triggers actions. * * Built on Popover with keyboard navigation and proper ARIA roles. * * @example * // Basic menu button * * Options * * handleEdit()}>Edit * handleDuplicate()}>Duplicate * handleDelete()}>Delete * * * * @example * // Three-dot icon menu (common pattern) * * * * * * Share * Export * * * * @example * // Button with dynamic chevron indicator * * * {({ isOpen }) => ( * * )} * * ... * * * @example * // Items with icons * * Actions * * * * Edit * * * * Delete * * * * * @example * // With links instead of actions * * Navigate * * Dashboard * Settings * * */ declare const BaseMenuButton: React.FC & { displayName?: string; className?: string; }; declare const MenuButton: React.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp & { Header: _redsift_design_system.Comp; Menu: _redsift_design_system.Comp; Footer: _redsift_design_system.Comp; }; }; /** * Component props. */ interface SelectContentProps extends PopoverContentProps { } /** * The SelectContent component. */ declare const SelectContent: Comp; /** * Component props. */ interface SelectTriggerProps extends Omit { /** Children */ children: ReactElement | ((state: { value?: string; isOpen?: boolean; }) => ReactElement); /** Whether or not the expand/collapse icon button should be displayed or not. */ hideExpandButton?: boolean; } /** * The SelectTrigger component. */ declare const SelectTrigger: Comp; /** * Context props. */ type SelectState = { /** Button color that will be forward to the trigger. */ readonly color?: ButtonColor; /** Whether the select is disabled or not. */ readonly isDisabled: boolean; /** Whether the select is invalid or not. */ readonly isInvalid: boolean; /** Sets the selected value. */ setValue(value: string): void; /** Current selected value. */ readonly value: string; /** Class name to append to the trigger. */ readonly triggerClassName?: string; /** Button variant that will be forward to the trigger. */ readonly variant?: ButtonVariant | TextFieldVariant; }; /** * Component props. */ interface SelectProps extends PopoverProps { /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** * Default selected value. * Used for uncontrolled version. */ defaultValue?: string; /** Description of the select. */ description?: string | ReactElement; /** Additional description properties. */ descriptionProps?: Omit; /** Whether the component is disabled or not. */ isDisabled?: boolean; /** Whether the component is invalid or not. */ isInvalid?: boolean; /** Method to handle component change. */ onChange?(value: string): void; /** * Currently selected value. * Used for controlled version. */ value?: string; /** * Button variant that will be forward to the trigger. * @default 'secondary' */ variant?: ButtonVariant | TextFieldVariant; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; /** Props to forward to the wrapper. */ wrapperProps?: Omit; } type StyledSelectProps = SelectProps; /** * Select allows users to choose a single option from a dropdown list. * Built on Floating UI with keyboard navigation and screen reader support. * * Composed of `Select.Trigger` and `Select.Content` sub-components. * Use the `Item` component for options. * * For searchable/filterable lists, use Combobox instead. * * @example * // Basic select with TextField trigger (default) * * * @example * // Button trigger variant * * * @example * // Controlled select with default value * * * @example * // Render function for custom trigger content * * * @example * // With validation * */ declare const BaseSelect: React.FC & { displayName?: string; className?: string; }; declare const Select: React.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp; }; export { BaseCombobox, BaseComboboxContent, BaseMenuButton, BaseMenuButtonContent, BaseSelect, Combobox, ComboboxContent, ComboboxContentFooter, ComboboxContentFooterProps, ComboboxContentHeader, ComboboxContentHeaderProps, ComboboxContentListbox, ComboboxContentListboxProps, ComboboxContentProps, ComboboxProps, ComboboxSelectionMode, ComboboxState, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxVariant, Item, MenuButton, MenuButtonContent, MenuButtonContentFooter, MenuButtonContentFooterProps, MenuButtonContentHeader, MenuButtonContentHeaderProps, MenuButtonContentMenu, MenuButtonContentMenuProps, MenuButtonContentProps, MenuButtonProps, MenuButtonState, MenuButtonTrigger, MenuButtonTriggerProps, Select, SelectContent, SelectContentProps, SelectProps, SelectState, SelectTrigger, SelectTriggerProps, StyledComboboxContentFooterProps, StyledComboboxContentHeaderProps, StyledComboboxProps, StyledMenuButtonContentFooterProps, StyledMenuButtonContentHeaderProps, StyledMenuButtonProps, StyledSelectProps };