import { default as React } from 'react'; import { InputProps } from '../input/input.types.js'; import { TextareaProps } from '../textarea/textarea.types.js'; import { NumberInputProps } from '../numberInput/numberInput.types.js'; import { DropdownProps } from '../dropdown/dropdown.types.js'; import { InputDropdownProps } from '../inputDropdown/inputDropdown.types.js'; import { CheckboxProps } from '../checkbox/checkbox.types.js'; import { SwitchProps } from '../switch/switch.types.js'; import { RadioGroupProps } from '../radioGroup/radioGroup.types.js'; import { DatePickerProps } from '../datePicker/datePicker.types.js'; import { ColorPickerLabels } from '../colorPicker/colorPicker.types.js'; import { EmptyStateLabels } from '../emptyState/emptyState.types.js'; import { KlipyPickerLabels } from '../klipyPicker/klipyPicker.types.js'; import { SearchInputLabels } from '../searchInput/searchInput.types.js'; import { TooltipLabels } from '../tooltip/tooltip.types.js'; import { VirtualListLabels } from '../virtualList/virtualList.types.js'; import { ButtonProps } from '../button/button.types.js'; import { CalendarDefaults } from '../calendar/calendar.types.js'; import { CopyButtonProps } from '../copyButton/copyButton.types.js'; import { CommandPaletteProps } from '../commandPalette/commandPalette.types.js'; import { WeatherIconProps } from '../weatherIcon/weatherIcon.types.js'; import { ActionButtonsProps } from '../actionButtons/actionButtons.types.js'; import { ConfirmModalProps } from '../confirmModal/confirmModal.types.js'; import { BadgeProps } from '../badge/badge.types.js'; import { ChipProps } from '../chip/chip.types.js'; import { CardProps } from '../card/card.types.js'; import { SectionHeaderProps } from '../sectionHeader/sectionHeader.types.js'; import { SkeletonProps } from '../skeleton/skeleton.types.js'; import { LoaderProps } from '../loader/loader.types.js'; import { LoadingOverlayProps } from '../loadingOverlay/loadingOverlay.types.js'; import { AccordionProps } from '../accordion/accordion.types.js'; import { DividerProps } from '../divider/divider.types.js'; import { AlertProps } from '../alert/alert.types.js'; import { CarouselProps } from '../carousel/carousel.types.js'; import { BreadcrumbProps } from '../breadcrumb/breadcrumb.types.js'; import { RatingProps } from '../rating/rating.types.js'; import { SplitButtonProps } from '../splitButton/splitButton.types.js'; import { RevealLensProps } from '../revealLens/revealLens.types.js'; import { PanZoomProps } from '../panZoom/panZoom.types.js'; import { LightboxProps } from '../lightbox/lightbox.types.js'; import { ImageProps } from '../image/image.types.js'; import { TiltProps } from '../tilt/tilt.types.js'; import { FlipProps } from '../flip/flip.types.js'; import { OptionPickerProps } from '../optionPicker/optionPicker.types.js'; import { TimerProps } from '../timer/timer.types.js'; import { OtpInputProps } from '../otpInput/otpInput.types.js'; import { MultiSelectProps } from '../multiSelect/multiSelect.types.js'; import { PaginationProps } from '../pagination/pagination.types.js'; import { TreeProps } from '../tree/tree.types.js'; import { RoomDrawerProps } from '../roomDrawer/roomDrawer.types.js'; import { RoomViewerProps } from '../roomViewer/roomViewer.types.js'; import { PopoverProps } from '../popover/popover.types.js'; import { ModalProps } from '../modal/modal.types.js'; import { StepperProps } from '../stepper/stepper.types.js'; import { ChatMessageProps } from '../chatMessage/chatMessage.types.js'; import { ChatMessageListProps } from '../chatMessageList/chatMessageList.types.js'; import { ChatComposerProps } from '../chatComposer/chatComposer.types.js'; import { Presentation } from '../configProvider/presentation.types.js'; import { TemplateEditorProps } from '../templateEditor/templateEditor.types.js'; /** * Global default props keyed by component name. * * Each entry is merged **under** a component's explicitly-passed props: * an explicit prop always wins, a global default fills in only the props the * caller omitted, and the component's own built-in default applies when * neither is set. * * Add a key here whenever a new component adopts `useComponentDefaults`. * * Note: `Textarea`, `NumberInput`, and `DatePicker` are built on top of `Input`, * so they also inherit `Input` defaults for the props they forward to it — their * own component-keyed defaults take precedence for props they handle themselves. */ export interface ComponentDefaults { /** * Labels only. These components take no other global defaults: `ColorPicker` * and `Toast` are configured elsewhere, and `VirtualList`'s props are generic, * which a per-key default map can't express. */ ColorPicker?: { labels?: ColorPickerLabels; }; EmptyState?: { labels?: EmptyStateLabels; }; KlipyPicker?: { labels?: KlipyPickerLabels; }; SearchInput?: { labels?: SearchInputLabels; }; Tooltip?: { labels?: TooltipLabels; }; VirtualList?: { labels?: VirtualListLabels; }; /** Not `Partial`: the rest of its props depend on the event type. */ Calendar?: CalendarDefaults; Input?: Partial; Textarea?: Partial; NumberInput?: Partial; Dropdown?: Partial; InputDropdown?: Partial; Checkbox?: Partial; Switch?: Partial; RadioGroup?: Partial; DatePicker?: Partial>; Button?: Partial; CopyButton?: Partial; ActionButtons?: Partial; ConfirmModal?: Partial; Badge?: Partial; Chip?: Partial; Card?: Partial; SectionHeader?: Partial; Skeleton?: Partial; Loader?: Partial; LoadingOverlay?: Partial; Accordion?: Partial; Divider?: Partial; Alert?: Partial; Carousel?: Partial; Breadcrumb?: Partial; Rating?: Partial; SplitButton?: Partial; RevealLens?: Partial; PanZoom?: Partial; Lightbox?: Partial; Image?: Partial; Tilt?: Partial; Flip?: Partial; OptionPicker?: Partial; Timer?: Partial; OtpInput?: Partial; MultiSelect?: Partial; Pagination?: Partial; Tree?: Partial; RoomDrawer?: Partial; RoomViewer?: Partial; Popover?: Partial; Modal?: Partial; CommandPalette?: Partial; WeatherIcon?: Partial; Stepper?: Partial; ChatMessage?: Partial; ChatMessageList?: Partial; ChatComposer?: Partial; TemplateEditor?: Partial; } export interface ConfigProviderProps { children: React.ReactNode; /** Global default props, keyed by component name. */ defaultProps?: ComponentDefaults; /** * How every sheet-capable component presents by default: anchored to its trigger, always a * bottom sheet, or a sheet only on a small touch screen. One switch for `Popover`, * `Dropdown`, `Popover` and `Modal` at once (and so for everything built on them). A * component-keyed entry in `defaultProps` overrides it, and an explicit prop overrides both. */ presentation?: Presentation; /** * The app's router, for the links components render: Button and ListItem with an `href`, and * Breadcrumb, Menu and CommandPalette entries. A plain click on a link within the app calls it * with the path (`/clients/7?tab=projects`) instead of loading the page. Ctrl/⌘-click, a middle * click, `target`, `download` and links to anywhere else stay with the browser. Unset, every * link loads its page. A nested provider that does not set it keeps the outer one's. */ navigate?: (path: string) => void; /** * BCP 47 tag (`'de-AT'`) for the dates, week start and sort order components produce: Calendar, * DatePicker and VirtualList's sorting. Unset, or a tag Intl cannot read, the browser's locale. * A component's own `locale` prop overrides it, and a nested provider that does not set it keeps * the outer one's. Not a `defaultProps` key, so an outer default cannot outrank an inner provider. */ locale?: string; }