@vjdesigns/vjdesigns-ui 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/README.md +854 -873
- package/dist/components/data-display/Accordion/Accordion.mjs +97 -166
- package/dist/components/data-display/Chat/Chat.d.ts +13 -2
- package/dist/components/data-display/Collapsible/Collapsible.d.ts +70 -0
- package/dist/components/data-display/Collapsible/Collapsible.mjs +102 -0
- package/dist/components/data-display/Collapsible/Collapsible.module.css.mjs +8 -0
- package/dist/components/data-display/Collapsible/index.d.ts +1 -0
- package/dist/components/feedback/Progress/Progress.d.ts +32 -2
- package/dist/components/feedback/Progress/Progress.mjs +78 -74
- package/dist/components/feedback/Progress/Progress.module.css.mjs +1 -1
- package/dist/components/forms/Radio/Radio.mjs +12 -10
- package/dist/components/forms/ToggleGroup/ToggleGroup.mjs +133 -131
- package/dist/components/navigation/Toolbar/Toolbar.mjs +106 -0
- package/dist/components/navigation/Toolbar/Toolbar.module.css.mjs +11 -0
- package/dist/components/navigation/Toolbar/ToolbarContext.mjs +4 -0
- package/dist/components/navigation/Toolbar/index.d.ts +1 -0
- package/dist/components/primitives/CopyButton/CopyButton.d.ts +39 -0
- package/dist/components/primitives/CopyButton/CopyButton.mjs +49 -0
- package/dist/components/primitives/CopyButton/index.d.ts +1 -0
- package/dist/hooks/useCollapsePresence.mjs +83 -0
- package/dist/i18n/en.mjs +5 -0
- package/dist/index.mjs +104 -101
- package/dist/locales/ar.mjs +5 -0
- package/dist/locales/bn.mjs +5 -0
- package/dist/locales/cs.mjs +5 -0
- package/dist/locales/da.mjs +5 -0
- package/dist/locales/de.mjs +5 -0
- package/dist/locales/el.mjs +5 -0
- package/dist/locales/es.mjs +5 -0
- package/dist/locales/fa.mjs +5 -0
- package/dist/locales/fi.mjs +5 -0
- package/dist/locales/fr.mjs +5 -0
- package/dist/locales/he.mjs +5 -0
- package/dist/locales/hi.mjs +5 -0
- package/dist/locales/hu.mjs +5 -0
- package/dist/locales/id.mjs +5 -0
- package/dist/locales/it.mjs +5 -0
- package/dist/locales/ja.mjs +5 -0
- package/dist/locales/ko.mjs +5 -0
- package/dist/locales/nb.mjs +5 -0
- package/dist/locales/nl.mjs +5 -0
- package/dist/locales/pl.mjs +5 -0
- package/dist/locales/pt-BR.mjs +5 -0
- package/dist/locales/ro.mjs +5 -0
- package/dist/locales/ru.mjs +5 -0
- package/dist/locales/sv.mjs +5 -0
- package/dist/locales/th.mjs +5 -0
- package/dist/locales/tr.mjs +5 -0
- package/dist/locales/uk.mjs +5 -0
- package/dist/locales/ur.mjs +5 -0
- package/dist/locales/vi.mjs +5 -0
- package/dist/locales/zh-Hans.mjs +5 -0
- package/dist/locales/zh-Hant.mjs +5 -0
- package/dist/vjdesigns-ui.css +1 -1
- package/package.json +7 -5
- package/dist/ai/llms-full.txt +0 -8500
- package/dist/ai/llms.txt +0 -198
- package/dist/ai/mcp-server.mjs +0 -212
- package/dist/ai/registry.json +0 -21058
- package/dist/components/data-display/Accordion/Accordion.cjs.js +0 -1
- package/dist/components/data-display/Accordion/Accordion.module.css.cjs.js +0 -1
- package/dist/components/data-display/Avatar/Avatar.cjs.js +0 -1
- package/dist/components/data-display/Avatar/Avatar.module.css.cjs.js +0 -1
- package/dist/components/data-display/Badge/Badge.cjs.js +0 -1
- package/dist/components/data-display/Badge/Badge.module.css.cjs.js +0 -1
- package/dist/components/data-display/Card/Card.cjs.js +0 -1
- package/dist/components/data-display/Card/Card.module.css.cjs.js +0 -1
- package/dist/components/data-display/Carousel/Carousel.cjs.js +0 -1
- package/dist/components/data-display/Carousel/Carousel.module.css.cjs.js +0 -1
- package/dist/components/data-display/Chat/Chat.cjs.js +0 -1
- package/dist/components/data-display/Chat/Chat.module.css.cjs.js +0 -1
- package/dist/components/data-display/Chat/streams.cjs.js +0 -4
- package/dist/components/data-display/Chip/Chip.cjs.js +0 -1
- package/dist/components/data-display/Chip/Chip.module.css.cjs.js +0 -1
- package/dist/components/data-display/CodeBlock/CodeBlock.cjs.js +0 -6
- package/dist/components/data-display/CodeBlock/CodeBlock.module.css.cjs.js +0 -1
- package/dist/components/data-display/CodeBlock/tokenize.cjs.js +0 -13
- package/dist/components/data-display/CodeBlock/tokenize.d.ts +0 -26
- package/dist/components/data-display/Countdown/Countdown.cjs.js +0 -1
- package/dist/components/data-display/Countdown/Countdown.module.css.cjs.js +0 -1
- package/dist/components/data-display/DataGrid/DataGrid.cjs.js +0 -1
- package/dist/components/data-display/DataGrid/DataGrid.module.css.cjs.js +0 -1
- package/dist/components/data-display/DataGrid/dataGridUtils.cjs.js +0 -1
- package/dist/components/data-display/DataGrid/dataGridUtils.d.ts +0 -46
- package/dist/components/data-display/EmptyState/EmptyState.cjs.js +0 -1
- package/dist/components/data-display/EmptyState/EmptyState.module.css.cjs.js +0 -1
- package/dist/components/data-display/Image/Image.cjs.js +0 -1
- package/dist/components/data-display/Image/Image.module.css.cjs.js +0 -1
- package/dist/components/data-display/List/List.cjs.js +0 -1
- package/dist/components/data-display/List/List.module.css.cjs.js +0 -1
- package/dist/components/data-display/Stat/Stat.cjs.js +0 -1
- package/dist/components/data-display/Stat/Stat.module.css.cjs.js +0 -1
- package/dist/components/data-display/Table/Table.cjs.js +0 -1
- package/dist/components/data-display/Table/Table.module.css.cjs.js +0 -1
- package/dist/components/data-display/Table/useTable.cjs.js +0 -1
- package/dist/components/data-display/Table/useTable.d.ts +0 -118
- package/dist/components/data-display/Timeline/Timeline.cjs.js +0 -1
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs.js +0 -1
- package/dist/components/data-display/TreeView/TreeView.cjs.js +0 -1
- package/dist/components/data-display/TreeView/TreeView.module.css.cjs.js +0 -1
- package/dist/components/data-display/TreeView/treeUtils.cjs.js +0 -1
- package/dist/components/data-display/TreeView/treeUtils.d.ts +0 -82
- package/dist/components/data-display/VirtualList/VirtualList.cjs.js +0 -1
- package/dist/components/data-display/VirtualList/VirtualList.module.css.cjs.js +0 -1
- package/dist/components/feedback/Alert/Alert.cjs.js +0 -1
- package/dist/components/feedback/Alert/Alert.module.css.cjs.js +0 -1
- package/dist/components/feedback/Banner/Banner.cjs.js +0 -1
- package/dist/components/feedback/Banner/Banner.module.css.cjs.js +0 -1
- package/dist/components/feedback/ErrorSummary/ErrorSummary.cjs.js +0 -1
- package/dist/components/feedback/ErrorSummary/ErrorSummary.module.css.cjs.js +0 -1
- package/dist/components/feedback/Progress/Progress.cjs.js +0 -1
- package/dist/components/feedback/Progress/Progress.module.css.cjs.js +0 -1
- package/dist/components/feedback/Skeleton/Skeleton.cjs.js +0 -1
- package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs.js +0 -1
- package/dist/components/feedback/Spinner/Spinner.cjs.js +0 -1
- package/dist/components/feedback/Spinner/Spinner.module.css.cjs.js +0 -1
- package/dist/components/feedback/Toast/Toast.cjs.js +0 -1
- package/dist/components/feedback/Toast/Toast.module.css.cjs.js +0 -1
- package/dist/components/feedback/Toast/Toast.storyHelpers.d.ts +0 -21
- package/dist/components/feedback/Toast/ToastItem.cjs.js +0 -1
- package/dist/components/feedback/Toast/ToastItem.d.ts +0 -18
- package/dist/components/feedback/Toast/ToastProvider.cjs.js +0 -1
- package/dist/components/feedback/Toast/ToastViewport.cjs.js +0 -1
- package/dist/components/feedback/Toast/ToastViewport.d.ts +0 -25
- package/dist/components/feedback/Toast/toastStore.cjs.js +0 -1
- package/dist/components/feedback/Toast/toastTiming.cjs.js +0 -1
- package/dist/components/feedback/Toast/toastTypes.d.ts +0 -136
- package/dist/components/feedback/Toast/useToast.cjs.js +0 -1
- package/dist/components/feedback/Toast/useToastAnnouncer.cjs.js +0 -1
- package/dist/components/feedback/Toast/useToastAnnouncer.d.ts +0 -15
- package/dist/components/forms/CheckBox/CheckBox.cjs.js +0 -1
- package/dist/components/forms/CheckBox/CheckBox.d.ts +0 -87
- package/dist/components/forms/CheckBox/CheckBox.module.css.cjs.js +0 -1
- package/dist/components/forms/ColorPicker/ColorInput.cjs.js +0 -1
- package/dist/components/forms/ColorPicker/ColorInput.d.ts +0 -38
- package/dist/components/forms/ColorPicker/ColorPicker.cjs.js +0 -1
- package/dist/components/forms/ColorPicker/ColorPicker.d.ts +0 -129
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs.js +0 -1
- package/dist/components/forms/ColorPicker/colorUtils.cjs.js +0 -1
- package/dist/components/forms/ColorPicker/colorUtils.d.ts +0 -86
- package/dist/components/forms/Combobox/Combobox.cjs.js +0 -1
- package/dist/components/forms/Combobox/Combobox.d.ts +0 -172
- package/dist/components/forms/Combobox/Combobox.module.css.cjs.js +0 -1
- package/dist/components/forms/Combobox/ComboboxPopup.cjs.js +0 -1
- package/dist/components/forms/Combobox/ComboboxPopup.d.ts +0 -40
- package/dist/components/forms/Combobox/comboboxUtils.cjs.js +0 -1
- package/dist/components/forms/Combobox/comboboxUtils.d.ts +0 -73
- package/dist/components/forms/DatePicker/Calendar.cjs.js +0 -1
- package/dist/components/forms/DatePicker/Calendar.d.ts +0 -98
- package/dist/components/forms/DatePicker/Calendar.module.css.cjs.js +0 -1
- package/dist/components/forms/DatePicker/DatePicker.cjs.js +0 -1
- package/dist/components/forms/DatePicker/DatePicker.d.ts +0 -100
- package/dist/components/forms/DatePicker/DatePicker.module.css.cjs.js +0 -1
- package/dist/components/forms/DatePicker/DateRangePicker.cjs.js +0 -1
- package/dist/components/forms/DatePicker/DateRangePicker.d.ts +0 -124
- package/dist/components/forms/DatePicker/DateRangePicker.module.css.cjs.js +0 -1
- package/dist/components/forms/DatePicker/dateUtils.cjs.js +0 -1
- package/dist/components/forms/DatePicker/dateUtils.d.ts +0 -88
- package/dist/components/forms/DateTimePicker/DateTimePicker.cjs.js +0 -1
- package/dist/components/forms/DateTimePicker/DateTimePicker.d.ts +0 -101
- package/dist/components/forms/DateTimePicker/DateTimePicker.module.css.cjs.js +0 -1
- package/dist/components/forms/Field/Field.cjs.js +0 -1
- package/dist/components/forms/Field/Field.d.ts +0 -171
- package/dist/components/forms/Field/Field.module.css.cjs.js +0 -1
- package/dist/components/forms/Field/FieldContext.cjs.js +0 -1
- package/dist/components/forms/Field/FieldContext.d.ts +0 -74
- package/dist/components/forms/FileUpload/FileUpload.cjs.js +0 -1
- package/dist/components/forms/FileUpload/FileUpload.d.ts +0 -153
- package/dist/components/forms/FileUpload/FileUpload.module.css.cjs.js +0 -1
- package/dist/components/forms/Input/Input.cjs.js +0 -1
- package/dist/components/forms/Input/Input.d.ts +0 -98
- package/dist/components/forms/Input/Input.module.css.cjs.js +0 -1
- package/dist/components/forms/NumberInput/NumberInput.cjs.js +0 -1
- package/dist/components/forms/NumberInput/NumberInput.d.ts +0 -87
- package/dist/components/forms/NumberInput/NumberInput.module.css.cjs.js +0 -1
- package/dist/components/forms/PasswordInput/PasswordInput.cjs.js +0 -1
- package/dist/components/forms/PasswordInput/PasswordInput.d.ts +0 -117
- package/dist/components/forms/PasswordInput/PasswordInput.module.css.cjs.js +0 -1
- package/dist/components/forms/PinInput/PinInput.cjs.js +0 -1
- package/dist/components/forms/PinInput/PinInput.d.ts +0 -92
- package/dist/components/forms/PinInput/PinInput.module.css.cjs.js +0 -1
- package/dist/components/forms/Radio/Radio.cjs.js +0 -1
- package/dist/components/forms/Radio/Radio.d.ts +0 -119
- package/dist/components/forms/Radio/Radio.module.css.cjs.js +0 -1
- package/dist/components/forms/Rating/Rating.cjs.js +0 -1
- package/dist/components/forms/Rating/Rating.d.ts +0 -128
- package/dist/components/forms/Rating/Rating.module.css.cjs.js +0 -1
- package/dist/components/forms/SearchInput/SearchInput.cjs.js +0 -1
- package/dist/components/forms/SearchInput/SearchInput.d.ts +0 -124
- package/dist/components/forms/SearchInput/SearchInput.module.css.cjs.js +0 -1
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.js +0 -1
- package/dist/components/forms/SegmentedControl/SegmentedControl.d.ts +0 -120
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.js +0 -1
- package/dist/components/forms/Select/Select.cjs.js +0 -1
- package/dist/components/forms/Select/Select.d.ts +0 -86
- package/dist/components/forms/Select/Select.module.css.cjs.js +0 -1
- package/dist/components/forms/Slider/Slider.cjs.js +0 -1
- package/dist/components/forms/Slider/Slider.d.ts +0 -84
- package/dist/components/forms/Slider/Slider.module.css.cjs.js +0 -1
- package/dist/components/forms/Switch/Switch.cjs.js +0 -1
- package/dist/components/forms/Switch/Switch.d.ts +0 -62
- package/dist/components/forms/Switch/Switch.module.css.cjs.js +0 -1
- package/dist/components/forms/TagInput/TagInput.cjs.js +0 -1
- package/dist/components/forms/TagInput/TagInput.d.ts +0 -144
- package/dist/components/forms/TagInput/TagInput.module.css.cjs.js +0 -1
- package/dist/components/forms/Textarea/Textarea.cjs.js +0 -1
- package/dist/components/forms/Textarea/Textarea.d.ts +0 -62
- package/dist/components/forms/Textarea/Textarea.module.css.cjs.js +0 -1
- package/dist/components/forms/TimePicker/TimePicker.cjs.js +0 -1
- package/dist/components/forms/TimePicker/TimePicker.d.ts +0 -116
- package/dist/components/forms/TimePicker/TimePicker.module.css.cjs.js +0 -1
- package/dist/components/forms/TimePicker/timeUtils.cjs.js +0 -1
- package/dist/components/forms/TimePicker/timeUtils.d.ts +0 -26
- package/dist/components/forms/ToggleGroup/ToggleGroup.cjs.js +0 -1
- package/dist/components/forms/ToggleGroup/ToggleGroup.d.ts +0 -153
- package/dist/components/forms/ToggleGroup/ToggleGroup.module.css.cjs.js +0 -1
- package/dist/components/layout/Box/Box.cjs.js +0 -1
- package/dist/components/layout/Box/Box.module.css.cjs.js +0 -1
- package/dist/components/layout/Container/Container.cjs.js +0 -1
- package/dist/components/layout/Container/Container.module.css.cjs.js +0 -1
- package/dist/components/layout/Divider/Divider.cjs.js +0 -1
- package/dist/components/layout/Divider/Divider.module.css.cjs.js +0 -1
- package/dist/components/layout/Flex/Flex.cjs.js +0 -1
- package/dist/components/layout/Flex/Flex.module.css.cjs.js +0 -1
- package/dist/components/layout/Grid/Grid.cjs.js +0 -1
- package/dist/components/layout/Grid/Grid.module.css.cjs.js +0 -1
- package/dist/components/layout/ResizablePanels/ResizablePanels.cjs.js +0 -1
- package/dist/components/layout/ResizablePanels/ResizablePanels.module.css.cjs.js +0 -1
- package/dist/components/layout/ScrollArea/ScrollArea.cjs.js +0 -1
- package/dist/components/layout/ScrollArea/ScrollArea.module.css.cjs.js +0 -1
- package/dist/components/layout/Stack/Stack.cjs.js +0 -1
- package/dist/components/layout/Stack/Stack.module.css.cjs.js +0 -1
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.cjs.js +0 -1
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.module.css.cjs.js +0 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.cjs.js +0 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.module.css.cjs.js +0 -1
- package/dist/components/navigation/Link/Link.cjs.js +0 -1
- package/dist/components/navigation/Link/Link.module.css.cjs.js +0 -1
- package/dist/components/navigation/Menu/Menu.cjs.js +0 -1
- package/dist/components/navigation/Menu/Menu.module.css.cjs.js +0 -1
- package/dist/components/navigation/Menu/MenuContent.cjs.js +0 -1
- package/dist/components/navigation/Menu/MenuContent.d.ts +0 -46
- package/dist/components/navigation/Menu/MenuContext.cjs.js +0 -1
- package/dist/components/navigation/Menu/MenuContext.d.ts +0 -84
- package/dist/components/navigation/Menu/MenuItem.cjs.js +0 -1
- package/dist/components/navigation/Menu/MenuItem.d.ts +0 -133
- package/dist/components/navigation/Menu/MenuSub.cjs.js +0 -1
- package/dist/components/navigation/Menu/MenuSub.d.ts +0 -28
- package/dist/components/navigation/Menu/useMenuRoot.cjs.js +0 -1
- package/dist/components/navigation/Menu/useMenuRoot.d.ts +0 -14
- package/dist/components/navigation/Navbar/Navbar.cjs.js +0 -1
- package/dist/components/navigation/Navbar/Navbar.module.css.cjs.js +0 -1
- package/dist/components/navigation/Pagination/Pagination.cjs.js +0 -1
- package/dist/components/navigation/Pagination/Pagination.d.ts +0 -97
- package/dist/components/navigation/Pagination/Pagination.module.css.cjs.js +0 -1
- package/dist/components/navigation/Sidebar/Sidebar.cjs.js +0 -1
- package/dist/components/navigation/Sidebar/Sidebar.module.css.cjs.js +0 -1
- package/dist/components/navigation/Sidebar/Sidebar.storyHelpers.d.ts +0 -27
- package/dist/components/navigation/Sidebar/SidebarContext.cjs.js +0 -1
- package/dist/components/navigation/Sidebar/SidebarContext.d.ts +0 -45
- package/dist/components/navigation/Sidebar/SidebarParts.cjs.js +0 -1
- package/dist/components/navigation/Sidebar/SidebarParts.d.ts +0 -179
- package/dist/components/navigation/SkipLink/SkipLink.cjs.js +0 -1
- package/dist/components/navigation/SkipLink/SkipLink.d.ts +0 -41
- package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs.js +0 -1
- package/dist/components/navigation/Stepper/Stepper.cjs.js +0 -1
- package/dist/components/navigation/Stepper/Stepper.module.css.cjs.js +0 -1
- package/dist/components/navigation/Tabs/Tabs.cjs.js +0 -1
- package/dist/components/navigation/Tabs/Tabs.d.ts +0 -132
- package/dist/components/navigation/Tabs/Tabs.module.css.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/CommandPalette.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/CommandPalette.module.css.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/CommandPaletteContext.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/CommandPaletteContext.d.ts +0 -96
- package/dist/components/overlays/CommandPalette/CommandPaletteParts.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/CommandPaletteParts.d.ts +0 -115
- package/dist/components/overlays/CommandPalette/commandPaletteUtils.cjs.js +0 -1
- package/dist/components/overlays/CommandPalette/commandPaletteUtils.d.ts +0 -50
- package/dist/components/overlays/Drawer/Drawer.cjs.js +0 -1
- package/dist/components/overlays/Drawer/Drawer.module.css.cjs.js +0 -1
- package/dist/components/overlays/Drawer/Drawer.storyHelpers.d.ts +0 -16
- package/dist/components/overlays/Drawer/DrawerContent.cjs.js +0 -1
- package/dist/components/overlays/Drawer/DrawerContent.d.ts +0 -27
- package/dist/components/overlays/Drawer/DrawerContext.cjs.js +0 -1
- package/dist/components/overlays/Drawer/DrawerContext.d.ts +0 -39
- package/dist/components/overlays/Drawer/DrawerParts.cjs.js +0 -1
- package/dist/components/overlays/Drawer/DrawerParts.d.ts +0 -65
- package/dist/components/overlays/Drawer/internal.cjs.js +0 -1
- package/dist/components/overlays/Drawer/internal.d.ts +0 -1
- package/dist/components/overlays/Drawer/useDragToClose.cjs.js +0 -1
- package/dist/components/overlays/Drawer/useDragToClose.d.ts +0 -28
- package/dist/components/overlays/HoverCard/HoverCard.cjs.js +0 -1
- package/dist/components/overlays/HoverCard/HoverCard.module.css.cjs.js +0 -1
- package/dist/components/overlays/Modal/ConfirmModal.cjs.js +0 -1
- package/dist/components/overlays/Modal/Modal.cjs.js +0 -1
- package/dist/components/overlays/Modal/Modal.module.css.cjs.js +0 -1
- package/dist/components/overlays/Modal/ModalContent.cjs.js +0 -1
- package/dist/components/overlays/Modal/ModalContent.d.ts +0 -12
- package/dist/components/overlays/Modal/ModalContext.cjs.js +0 -1
- package/dist/components/overlays/Modal/ModalContext.d.ts +0 -56
- package/dist/components/overlays/Modal/useScrollRegion.cjs.js +0 -1
- package/dist/components/overlays/Modal/useScrollRegion.d.ts +0 -7
- package/dist/components/overlays/Popover/Popover.cjs.js +0 -1
- package/dist/components/overlays/Popover/Popover.module.css.cjs.js +0 -1
- package/dist/components/overlays/Popover/PopoverContent.cjs.js +0 -1
- package/dist/components/overlays/Popover/PopoverContent.d.ts +0 -41
- package/dist/components/overlays/Popover/PopoverContext.cjs.js +0 -1
- package/dist/components/overlays/Popover/PopoverContext.d.ts +0 -38
- package/dist/components/overlays/Tooltip/Tooltip.cjs.js +0 -1
- package/dist/components/overlays/Tooltip/Tooltip.module.css.cjs.js +0 -1
- package/dist/components/primitives/Button/Button.cjs.js +0 -1
- package/dist/components/primitives/Button/Button.module.css.cjs.js +0 -1
- package/dist/components/primitives/Icon/Icon.cjs.js +0 -1
- package/dist/components/primitives/Icon/Icon.module.css.cjs.js +0 -1
- package/dist/components/primitives/Icon/IconSvg.cjs.js +0 -1
- package/dist/components/primitives/Icon/IconSvg.d.ts +0 -31
- package/dist/components/primitives/Icon/icons.cjs.js +0 -1
- package/dist/components/primitives/Kbd/Kbd.cjs.js +0 -1
- package/dist/components/primitives/Kbd/Kbd.module.css.cjs.js +0 -1
- package/dist/components/primitives/Typography/Typography.cjs.js +0 -1
- package/dist/components/primitives/Typography/Typography.module.css.cjs.js +0 -1
- package/dist/components/utilities/LocaleProvider/LocaleProvider.cjs.js +0 -1
- package/dist/components/utilities/LocaleProvider/LocaleProvider.module.css.cjs.js +0 -1
- package/dist/components/utilities/Portal/Portal.cjs.js +0 -1
- package/dist/components/utilities/Theme/Theme.cjs.js +0 -1
- package/dist/components/utilities/Theme/Theme.module.css.cjs.js +0 -1
- package/dist/components/utilities/VisuallyHidden/VisuallyHidden.cjs.js +0 -1
- package/dist/components/utilities/VisuallyHidden/VisuallyHidden.module.css.cjs.js +0 -1
- package/dist/hooks/elementSource.cjs.js +0 -1
- package/dist/hooks/elementSource.d.ts +0 -16
- package/dist/hooks/index.d.ts +0 -21
- package/dist/hooks/useClipboard.cjs.js +0 -1
- package/dist/hooks/useClipboard.d.ts +0 -24
- package/dist/hooks/useControllableState.cjs.js +0 -1
- package/dist/hooks/useControllableState.d.ts +0 -15
- package/dist/hooks/useDisclosure.cjs.js +0 -1
- package/dist/hooks/useDisclosure.d.ts +0 -35
- package/dist/hooks/useDismiss.cjs.js +0 -1
- package/dist/hooks/useDismiss.d.ts +0 -33
- package/dist/hooks/useElementObservers.cjs.js +0 -1
- package/dist/hooks/useElementObservers.d.ts +0 -70
- package/dist/hooks/useEnvironment.cjs.js +0 -1
- package/dist/hooks/useEnvironment.d.ts +0 -42
- package/dist/hooks/useFloatingPosition.cjs.js +0 -1
- package/dist/hooks/useFloatingPosition.d.ts +0 -55
- package/dist/hooks/useFocusTrap.cjs.js +0 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -52
- package/dist/hooks/useFormReset.cjs.js +0 -1
- package/dist/hooks/useFormReset.d.ts +0 -17
- package/dist/hooks/useFormValidation.cjs.js +0 -1
- package/dist/hooks/useFormValidation.d.ts +0 -101
- package/dist/hooks/useHotkeys.cjs.js +0 -1
- package/dist/hooks/useHotkeys.d.ts +0 -50
- package/dist/hooks/useInertOutside.cjs.js +0 -1
- package/dist/hooks/useInertOutside.d.ts +0 -23
- package/dist/hooks/useMediaQuery.cjs.js +0 -1
- package/dist/hooks/useMediaQuery.d.ts +0 -11
- package/dist/hooks/useMergedRef.cjs.js +0 -1
- package/dist/hooks/useMergedRef.d.ts +0 -7
- package/dist/hooks/useOverlayLayer.cjs.js +0 -1
- package/dist/hooks/useOverlayLayer.d.ts +0 -92
- package/dist/hooks/useResponsiveValue.cjs.js +0 -1
- package/dist/hooks/useResponsiveValue.d.ts +0 -10
- package/dist/hooks/useScrollLock.cjs.js +0 -1
- package/dist/hooks/useScrollLock.d.ts +0 -4
- package/dist/hooks/useStorage.cjs.js +0 -1
- package/dist/hooks/useStorage.d.ts +0 -21
- package/dist/hooks/useTiming.cjs.js +0 -1
- package/dist/hooks/useTiming.d.ts +0 -78
- package/dist/hooks/useVirtualizer.cjs.js +0 -1
- package/dist/hooks/useVirtualizer.d.ts +0 -90
- package/dist/i18n/en.cjs.js +0 -1
- package/dist/i18n/en.d.ts +0 -3
- package/dist/i18n/index.d.ts +0 -4
- package/dist/i18n/locales/ar.d.ts +0 -3
- package/dist/i18n/locales/bn.d.ts +0 -3
- package/dist/i18n/locales/cs.d.ts +0 -3
- package/dist/i18n/locales/da.d.ts +0 -3
- package/dist/i18n/locales/de.d.ts +0 -3
- package/dist/i18n/locales/el.d.ts +0 -3
- package/dist/i18n/locales/es.d.ts +0 -3
- package/dist/i18n/locales/fa.d.ts +0 -3
- package/dist/i18n/locales/fi.d.ts +0 -3
- package/dist/i18n/locales/fr.d.ts +0 -3
- package/dist/i18n/locales/he.d.ts +0 -3
- package/dist/i18n/locales/hi.d.ts +0 -3
- package/dist/i18n/locales/hu.d.ts +0 -3
- package/dist/i18n/locales/id.d.ts +0 -3
- package/dist/i18n/locales/it.d.ts +0 -3
- package/dist/i18n/locales/ja.d.ts +0 -3
- package/dist/i18n/locales/ko.d.ts +0 -3
- package/dist/i18n/locales/nb.d.ts +0 -3
- package/dist/i18n/locales/nl.d.ts +0 -3
- package/dist/i18n/locales/pl.d.ts +0 -3
- package/dist/i18n/locales/pt-BR.d.ts +0 -3
- package/dist/i18n/locales/ro.d.ts +0 -3
- package/dist/i18n/locales/ru.d.ts +0 -3
- package/dist/i18n/locales/sv.d.ts +0 -3
- package/dist/i18n/locales/th.d.ts +0 -3
- package/dist/i18n/locales/tr.d.ts +0 -3
- package/dist/i18n/locales/uk.d.ts +0 -3
- package/dist/i18n/locales/ur.d.ts +0 -3
- package/dist/i18n/locales/vi.d.ts +0 -3
- package/dist/i18n/locales/zh-Hans.d.ts +0 -3
- package/dist/i18n/locales/zh-Hant.d.ts +0 -3
- package/dist/i18n/merge.cjs.js +0 -1
- package/dist/i18n/merge.d.ts +0 -6
- package/dist/i18n/plural.cjs.js +0 -1
- package/dist/i18n/plural.d.ts +0 -45
- package/dist/i18n/types.d.ts +0 -1160
- package/dist/index.cjs.js +0 -1
- package/dist/index.d.ts +0 -83
- package/dist/locales/ar.cjs.js +0 -1
- package/dist/locales/ar.d.ts +0 -6
- package/dist/locales/bn.cjs.js +0 -1
- package/dist/locales/bn.d.ts +0 -6
- package/dist/locales/cs.cjs.js +0 -1
- package/dist/locales/cs.d.ts +0 -6
- package/dist/locales/da.cjs.js +0 -1
- package/dist/locales/da.d.ts +0 -6
- package/dist/locales/de.cjs.js +0 -1
- package/dist/locales/de.d.ts +0 -6
- package/dist/locales/el.cjs.js +0 -1
- package/dist/locales/el.d.ts +0 -6
- package/dist/locales/es.cjs.js +0 -1
- package/dist/locales/es.d.ts +0 -6
- package/dist/locales/fa.cjs.js +0 -1
- package/dist/locales/fa.d.ts +0 -6
- package/dist/locales/fi.cjs.js +0 -1
- package/dist/locales/fi.d.ts +0 -6
- package/dist/locales/fr.cjs.js +0 -1
- package/dist/locales/fr.d.ts +0 -6
- package/dist/locales/he.cjs.js +0 -1
- package/dist/locales/he.d.ts +0 -6
- package/dist/locales/hi.cjs.js +0 -1
- package/dist/locales/hi.d.ts +0 -6
- package/dist/locales/hu.cjs.js +0 -1
- package/dist/locales/hu.d.ts +0 -6
- package/dist/locales/id.cjs.js +0 -1
- package/dist/locales/id.d.ts +0 -6
- package/dist/locales/it.cjs.js +0 -1
- package/dist/locales/it.d.ts +0 -6
- package/dist/locales/ja.cjs.js +0 -1
- package/dist/locales/ja.d.ts +0 -6
- package/dist/locales/ko.cjs.js +0 -1
- package/dist/locales/ko.d.ts +0 -6
- package/dist/locales/nb.cjs.js +0 -1
- package/dist/locales/nb.d.ts +0 -6
- package/dist/locales/nl.cjs.js +0 -1
- package/dist/locales/nl.d.ts +0 -6
- package/dist/locales/pl.cjs.js +0 -1
- package/dist/locales/pl.d.ts +0 -6
- package/dist/locales/pt-BR.cjs.js +0 -1
- package/dist/locales/pt-BR.d.ts +0 -6
- package/dist/locales/ro.cjs.js +0 -1
- package/dist/locales/ro.d.ts +0 -6
- package/dist/locales/ru.cjs.js +0 -1
- package/dist/locales/ru.d.ts +0 -6
- package/dist/locales/sv.cjs.js +0 -1
- package/dist/locales/sv.d.ts +0 -6
- package/dist/locales/th.cjs.js +0 -1
- package/dist/locales/th.d.ts +0 -6
- package/dist/locales/tr.cjs.js +0 -1
- package/dist/locales/tr.d.ts +0 -6
- package/dist/locales/uk.cjs.js +0 -1
- package/dist/locales/uk.d.ts +0 -6
- package/dist/locales/ur.cjs.js +0 -1
- package/dist/locales/ur.d.ts +0 -6
- package/dist/locales/vi.cjs.js +0 -1
- package/dist/locales/vi.d.ts +0 -6
- package/dist/locales/zh-Hans.cjs.js +0 -1
- package/dist/locales/zh-Hans.d.ts +0 -6
- package/dist/locales/zh-Hant.cjs.js +0 -1
- package/dist/locales/zh-Hant.d.ts +0 -6
- package/dist/types/common.cjs.js +0 -1
- package/dist/types/common.d.ts +0 -31
- package/dist/types/style.d.ts +0 -7
- package/dist/utils/announce.cjs.js +0 -1
- package/dist/utils/announce.d.ts +0 -1
- package/dist/utils/brandPalette.cjs.js +0 -3
- package/dist/utils/brandPalette.d.ts +0 -146
- package/dist/utils/clipboard.cjs.js +0 -1
- package/dist/utils/clipboard.d.ts +0 -6
- package/dist/utils/cx.cjs.js +0 -1
- package/dist/utils/cx.d.ts +0 -2
- package/dist/utils/fillSlot.cjs.js +0 -1
- package/dist/utils/fillSlot.d.ts +0 -9
- package/dist/utils/flattenChildren.cjs.js +0 -1
- package/dist/utils/flattenChildren.d.ts +0 -8
- package/dist/utils/hotkeys.cjs.js +0 -1
- package/dist/utils/hotkeys.d.ts +0 -27
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/intl.cjs.js +0 -1
- package/dist/utils/intl.d.ts +0 -10
- package/dist/utils/refs.cjs.js +0 -1
- package/dist/utils/refs.d.ts +0 -15
- package/dist/utils/responsive.cjs.js +0 -1
- package/dist/utils/responsive.d.ts +0 -43
- package/dist/utils/slot.cjs.js +0 -1
- package/dist/utils/slot.d.ts +0 -11
- package/dist/utils/validators.cjs.js +0 -1
- package/dist/utils/validators.d.ts +0 -72
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { Placement, Size } from '../../../types/common';
|
|
3
|
-
import { DateRange, WeekDay } from './Calendar';
|
|
4
|
-
import { DateInputErrorReason } from './DatePicker';
|
|
5
|
-
import { ISODate } from './dateUtils';
|
|
6
|
-
/** Which of the two fields. */
|
|
7
|
-
export type DateRangePart = "start" | "end";
|
|
8
|
-
/** Why typed text was rejected: DatePicker's reasons, plus an end before the start. */
|
|
9
|
-
export type DateRangeInputErrorReason = DateInputErrorReason | "order";
|
|
10
|
-
/** Details passed to `onInvalidInput` and a function `invalidMessage`. */
|
|
11
|
-
export interface DateRangeInputError {
|
|
12
|
-
/** The field the text was typed in. */
|
|
13
|
-
part: DateRangePart;
|
|
14
|
-
/** The text the user typed. */
|
|
15
|
-
text: string;
|
|
16
|
-
/** Why it was rejected. */
|
|
17
|
-
reason: DateRangeInputErrorReason;
|
|
18
|
-
/** The parsed date, when the text was a real date that isn't allowed. */
|
|
19
|
-
date?: ISODate;
|
|
20
|
-
/** The expected format, e.g. "MM/DD/YYYY". */
|
|
21
|
-
pattern: string;
|
|
22
|
-
}
|
|
23
|
-
export interface DateRangePickerProps {
|
|
24
|
-
/** Selected range (controlled). `null` (or empty ends) for none. */
|
|
25
|
-
value?: DateRange | null;
|
|
26
|
-
/** Initially selected range when uncontrolled. */
|
|
27
|
-
defaultValue?: DateRange | null;
|
|
28
|
-
/**
|
|
29
|
-
* Called with the new range when the user completes a pick in the
|
|
30
|
-
* calendar, or types a date in either field and leaves it. Typed text that
|
|
31
|
-
* isn't a valid, allowed date clears that end.
|
|
32
|
-
*/
|
|
33
|
-
onValueChange?: (value: DateRange) => void;
|
|
34
|
-
/** Earliest allowed date, "YYYY-MM-DD". */
|
|
35
|
-
min?: ISODate;
|
|
36
|
-
/** Latest allowed date, "YYYY-MM-DD". */
|
|
37
|
-
max?: ISODate;
|
|
38
|
-
/** Marks individual dates unavailable. Receives the ISO date and a local `Date`. */
|
|
39
|
-
isDateDisabled?: (date: ISODate, dateObject: Date) => boolean;
|
|
40
|
-
/** BCP 47 locale for the typed format, the calendar, and labels. Defaults to the browser locale. */
|
|
41
|
-
locale?: string;
|
|
42
|
-
/** First day of the week in the calendar. Defaults to the locale's. */
|
|
43
|
-
weekStartsOn?: WeekDay;
|
|
44
|
-
/** Where the calendar popup opens. Flips when there isn't room. @default "bottom-start" */
|
|
45
|
-
placement?: Placement;
|
|
46
|
-
/** Field and calendar size. Inherits from a surrounding `Field`. @default "md" */
|
|
47
|
-
size?: Size;
|
|
48
|
-
/** Name of a hidden input that submits the start date ("YYYY-MM-DD") with a form. */
|
|
49
|
-
startName?: string;
|
|
50
|
-
/** Name of a hidden input that submits the end date ("YYYY-MM-DD") with a form. */
|
|
51
|
-
endName?: string;
|
|
52
|
-
/** Controlled open state of the calendar popup. */
|
|
53
|
-
open?: boolean;
|
|
54
|
-
/** Initial open state of the calendar popup when uncontrolled. @default false */
|
|
55
|
-
defaultOpen?: boolean;
|
|
56
|
-
/** Called when the calendar popup opens or closes. */
|
|
57
|
-
onOpenChange?: (open: boolean) => void;
|
|
58
|
-
/** Called when the user leaves a field with text that isn't a valid, allowed date. */
|
|
59
|
-
onInvalidInput?: (error: DateRangeInputError) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Message shown under the fields when typed text is rejected. Pass a
|
|
62
|
-
* function to word it per reason, or `null` to show none.
|
|
63
|
-
*/
|
|
64
|
-
invalidMessage?: ReactNode | ((error: DateRangeInputError) => ReactNode);
|
|
65
|
-
/** Visible label of the start field (read after the Field label). @default "Start date" */
|
|
66
|
-
startLabel?: string;
|
|
67
|
-
/** Visible label of the end field (read after the Field label). @default "End date" */
|
|
68
|
-
endLabel?: string;
|
|
69
|
-
/** Accessible name of the calendar button while no range is set. @default "Choose dates" */
|
|
70
|
-
chooseRangeLabel?: string;
|
|
71
|
-
/** Accessible name of the calendar button while a range is set. @default (range) => `Change dates, ${range}` */
|
|
72
|
-
changeRangeLabel?: (formattedRange: string) => string;
|
|
73
|
-
/** Accessible name of the calendar popup dialog. @default "Choose dates" */
|
|
74
|
-
dialogLabel?: string;
|
|
75
|
-
/** Screen-reader description of the expected format. @default (pattern) => `Format: ${pattern}` */
|
|
76
|
-
formatDescription?: (pattern: string) => string;
|
|
77
|
-
/** Override "today" ("YYYY-MM-DD") in the calendar, e.g. for tests. */
|
|
78
|
-
today?: ISODate;
|
|
79
|
-
/** Months shown in the popup. @default 2 */
|
|
80
|
-
numberOfMonths?: 1 | 2;
|
|
81
|
-
/** Marks the fields invalid. Inherits from a surrounding `Field`. */
|
|
82
|
-
invalid?: boolean;
|
|
83
|
-
/** Both dates are required. Inherits from a surrounding `Field`. */
|
|
84
|
-
required?: boolean;
|
|
85
|
-
/** Disables both fields and the calendar button. Inherits from a surrounding `Field`. */
|
|
86
|
-
disabled?: boolean;
|
|
87
|
-
/** Read-only fields, no calendar button. Inherits from a surrounding `Field`. */
|
|
88
|
-
readOnly?: boolean;
|
|
89
|
-
/** Stretch to the container's width. @default true */
|
|
90
|
-
fullWidth?: boolean;
|
|
91
|
-
/** Accessible name of the pair when there is no surrounding `Field` label. */
|
|
92
|
-
"aria-label"?: string;
|
|
93
|
-
/** Extra description ids for both fields. */
|
|
94
|
-
"aria-describedby"?: string;
|
|
95
|
-
/** Class name for the outer root. */
|
|
96
|
-
className?: string;
|
|
97
|
-
/** Style for the outer root. */
|
|
98
|
-
style?: CSSProperties;
|
|
99
|
-
/** id of the start field (the Field label points here). */
|
|
100
|
-
id?: string;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* A date range field: two text fields (start and end) typed in the locale's
|
|
104
|
-
* short format, plus a calendar button that opens a range `Calendar` (two
|
|
105
|
-
* months by default) in a modal popup.
|
|
106
|
-
*
|
|
107
|
-
* The value is `{ start, end }` with ISO dates ("YYYY-MM-DD"). In the
|
|
108
|
-
* calendar, the first pick sets the start and the second the end; the range
|
|
109
|
-
* is committed (and the popup closes) only when both are picked, so Escape
|
|
110
|
-
* after one pick changes nothing. Typed dates are validated like
|
|
111
|
-
* `DatePicker`'s, plus an end before the start is rejected.
|
|
112
|
-
*
|
|
113
|
-
* Accessibility: the pair is a `role="group"` named by the `Field` label
|
|
114
|
-
* (or `aria-label`); each field is named by that label plus its own
|
|
115
|
-
* visible label ("Season dates, Start date"). Field hint, error, required, disabled, and
|
|
116
|
-
* invalid state reach both fields. Errors are announced politely.
|
|
117
|
-
*
|
|
118
|
-
* ```tsx
|
|
119
|
-
* <Field label="Season dates">
|
|
120
|
-
* <DateRangePicker startName="from" endName="to" onValueChange={setRange} />
|
|
121
|
-
* </Field>
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
export declare const DateRangePicker: ({ value: valueProp, defaultValue, onValueChange, min, max, isDateDisabled, locale: localeProp, weekStartsOn, placement, size, startName, endName, open: openProp, defaultOpen, onOpenChange, onInvalidInput, invalidMessage, startLabel: startLabelProp, endLabel: endLabelProp, chooseRangeLabel: chooseRangeLabelProp, changeRangeLabel: changeRangeLabelProp, dialogLabel: dialogLabelProp, formatDescription: formatDescriptionProp, today, numberOfMonths, invalid, required, disabled, readOnly, fullWidth, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, className, style, id, }: DateRangePickerProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_root_pyvlh_13`,t=`_fullWidth_pyvlh_25`,n=`_anchor_pyvlh_35`,r=`_fields_pyvlh_49`,i=`_part_pyvlh_63`,a=`_partLabel_pyvlh_81`,o=`_separator_pyvlh_97`,s=`_popup_pyvlh_115`,c=`_error_pyvlh_123`,l=`_errorIcon_pyvlh_147`,u={root:e,fullWidth:t,anchor:n,fields:r,part:i,partLabel:a,separator:o,popup:s,error:c,errorIcon:l};exports.anchor=n,exports.default=u,exports.error=c,exports.errorIcon=l,exports.fields=r,exports.fullWidth=t,exports.part=i,exports.partLabel=a,exports.popup=s,exports.root=e,exports.separator=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e,t=2)=>String(e).padStart(t,`0`);function t(e,t,n){let r=new Date(2e3,0,1);return r.setFullYear(e,t,n),r.setHours(0,0,0,0),r}function n(t){return`${e(t.getFullYear(),4)}-${e(t.getMonth()+1)}-${e(t.getDate())}`}function r(e,n){return t(e,n+1,0).getDate()}function i(e){if(!e)return null;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!n)return null;let i=Number(n[1]),a=Number(n[2]),o=Number(n[3]);return a<1||a>12||o<1||o>r(i,a-1)?null:t(i,a-1,o)}function a(e){return i(e)!==null}function o(e){return(typeof e==`string`?e:n(e)).slice(0,7)}function s(e){if(!e)return null;let t=/^(\d{4})-(\d{1,2})/.exec(e.trim());if(!t)return null;let n=Number(t[2]);return n<1||n>12?null:[Number(t[1]),n-1]}function c(e,r){let a=i(e);return n(t(a.getFullYear(),a.getMonth(),a.getDate()+r))}function l(e,a){let o=i(e),s=t(o.getFullYear(),o.getMonth()+a,1),c=Math.min(o.getDate(),r(s.getFullYear(),s.getMonth()));return n(t(s.getFullYear(),s.getMonth(),c))}function u(e,n){let[r,i]=s(e);return o(t(r,i+n,1))}function d(e){return i(e).getDay()}function f(e,t){return c(e,-((d(e)-t+7)%7))}function p(e,t){return c(f(e,t),6)}function m(e){return`${e}-01`}function h(e){let[i,a]=s(e);return n(t(i,a,r(i,a)))}function g(e,t){let n=f(m(e),t),r=[];for(let e=0;e<6;e+=1){let e=[];for(let t=0;t<7;t+=1)e.push(n),n=c(n,1);r.push(e)}return r}function _(e,t,n){return t&&e<t?t:n&&e>n?n:e}function v(){return n(new Date)}function y(e){try{let t=e??new Intl.DateTimeFormat().resolvedOptions().locale,n=new Intl.Locale(t),r=n.getWeekInfo?.()??n.weekInfo;if(r?.firstDay)return r.firstDay%7}catch{}return 0}var b=t(2026,10,23);function x(e,t){return e.replace(/YYYY|MM|DD/g,e=>e===`YYYY`?t.year:e===`MM`?t.month:t.day)}var S=new Map,C=/[]/g,w={year:`numeric`,month:`2-digit`,day:`2-digit`,calendar:`gregory`,numberingSystem:`latn`};function T(e){let t=e??``,n=S.get(t);if(n)return n;let r;try{r=new Intl.DateTimeFormat(e,w)}catch{r=new Intl.DateTimeFormat(void 0,w)}let a=(e,t)=>{let n=e.findIndex(e=>e.type===`day`||e.type===`month`||e.type===`year`),r=-1;e.forEach((e,t)=>{(e.type===`day`||e.type===`month`||e.type===`year`)&&(r=t)});let i=``;return e.forEach((e,a)=>{e.type===`day`||e.type===`month`||e.type===`year`?i+=t(e):e.type===`literal`&&a>n&&a<r&&(i+=e.value.replace(C,``))}),i},o=r.formatToParts(b),s=[],c=[],l=!1;o.forEach((e,t)=>{if(e.type===`day`||e.type===`month`||e.type===`year`)s.push(e.type),l=!0;else if(e.type===`literal`){let n=!l||!o.slice(t+1).some(e=>e.type===`day`||e.type===`month`||e.type===`year`),r=e.value.replace(C,``).trim();n&&r&&c.push(r)}});let u=a(o,e=>e.type===`day`?`DD`:e.type===`month`?`MM`:`YYYY`);s.length!==3&&(s.splice(0,s.length,`year`,`month`,`day`),u=`YYYY-MM-DD`);let d={order:s,pattern:u.trim(),affixes:c,format:e=>{let t=i(e);return t?s.length===3&&u!==`YYYY-MM-DD`?a(r.formatToParts(t),e=>e.value):e:``}};return S.set(t,d),d}var E=[1632,1776,2406,2534,3664,4160,65296];function D(e){return e.replace(/\p{Nd}/gu,e=>{let t=e.codePointAt(0);if(t>=48&&t<=57)return e;let n=E.find(e=>t>=e&&t<=e+9);return n===void 0?e:String(t-n)})}function O(e,a){let{order:o,affixes:s}=T(a),c=D(e).replace(C,``).trim();for(let e of s)c=c.split(e).join(` `);if(c=c.trim(),!c)return null;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(c)){let[e,t,r]=c.split(`-`),a=i(`${e}-${t.padStart(2,`0`)}-${r.padStart(2,`0`)}`);return a?n(a):null}if(/^\d{6}$|^\d{8}$/.test(c)){let e=c.length===8?4:2,t=0;return O(o.map(n=>{let r=n===`year`?e:2,i=c.slice(t,t+r);return t+=r,i}).join(`/`),a)}let l=c.match(/\d+/g);if(!l||l.length!==3||/\p{L}/u.test(c))return null;let u={};if(o.forEach((e,t)=>{u[e]=l[t]}),u.year.length!==4&&u.year.length!==2)return null;let d=u.year.length===2?2e3+Number(u.year):Number(u.year),f=Number(u.month),p=Number(u.day);return f<1||f>12||p<1||p>r(d,f-1)?null:n(t(d,f-1,p))}var k=new Map;function A(e,t){let n=`${e??``}|${JSON.stringify(t)}`,r=k.get(n);if(!r){try{r=new Intl.DateTimeFormat(e,t)}catch{r=new Intl.DateTimeFormat(void 0,t)}k.set(n,r)}return r}function j(e,t){let n=i(e);return n?A(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}).format(n):``}function M(e,n){let r=s(e);return r?A(n,{year:`numeric`,month:`long`}).format(t(r[0],r[1],1)):``}exports.addDays=c,exports.addMonths=l,exports.addMonthsToMonth=u,exports.clampDate=_,exports.dayOfWeek=d,exports.daysInMonth=r,exports.endOfWeek=p,exports.firstOfMonth=m,exports.formatFullDate=j,exports.formatMonthYear=M,exports.getDateFormatInfo=T,exports.getFormatter=A,exports.getLocaleWeekStart=y,exports.isISODate=a,exports.lastOfMonth=h,exports.localizeDatePattern=x,exports.makeDate=t,exports.monthGrid=g,exports.parseDateText=O,exports.parseISODate=i,exports.parseISOMonth=s,exports.startOfWeek=f,exports.toISODate=n,exports.toISOMonth=o,exports.todayISO=v;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/** A calendar date as an ISO string, "YYYY-MM-DD" (e.g. "2026-10-04"). */
|
|
2
|
-
export type ISODate = string;
|
|
3
|
-
/** A calendar month as "YYYY-MM" (e.g. "2026-10"). */
|
|
4
|
-
export type ISOMonth = string;
|
|
5
|
-
/** Builds a local Date for a calendar date (years 0 to 99 stay literal). */
|
|
6
|
-
export declare function makeDate(year: number, monthIndex: number, day: number): Date;
|
|
7
|
-
/** Formats a Date's local date parts as "YYYY-MM-DD". */
|
|
8
|
-
export declare function toISODate(date: Date): ISODate;
|
|
9
|
-
/** Number of days in a month (monthIndex is 0-based). */
|
|
10
|
-
export declare function daysInMonth(year: number, monthIndex: number): number;
|
|
11
|
-
/**
|
|
12
|
-
* Parses "YYYY-MM-DD" into a local Date at midnight. Returns null for
|
|
13
|
-
* anything else, including impossible dates such as "2026-02-30".
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseISODate(value: string | null | undefined): Date | null;
|
|
16
|
-
/** True when `value` is a valid "YYYY-MM-DD" date. */
|
|
17
|
-
export declare function isISODate(value: string | null | undefined): value is ISODate;
|
|
18
|
-
/** "YYYY-MM" of an ISO date or a Date. */
|
|
19
|
-
export declare function toISOMonth(value: ISODate | Date): ISOMonth;
|
|
20
|
-
/** Parses "YYYY-MM" (or a full ISO date) into [year, monthIndex]. */
|
|
21
|
-
export declare function parseISOMonth(value: string | null | undefined): [number, number] | null;
|
|
22
|
-
/** Adds (or subtracts) days. */
|
|
23
|
-
export declare function addDays(iso: ISODate, amount: number): ISODate;
|
|
24
|
-
/** Adds months, clamping the day to the target month's length (Jan 31 + 1 month = Feb 28). */
|
|
25
|
-
export declare function addMonths(iso: ISODate, amount: number): ISODate;
|
|
26
|
-
/** Adds months to a "YYYY-MM" month. */
|
|
27
|
-
export declare function addMonthsToMonth(month: ISOMonth, amount: number): ISOMonth;
|
|
28
|
-
/** Whole months from month `a` to month `b` (b - a). */
|
|
29
|
-
export declare function monthDiff(a: ISOMonth, b: ISOMonth): number;
|
|
30
|
-
/** Day of week, 0 (Sunday) to 6 (Saturday). */
|
|
31
|
-
export declare function dayOfWeek(iso: ISODate): number;
|
|
32
|
-
/** The first day of the week containing `iso`. */
|
|
33
|
-
export declare function startOfWeek(iso: ISODate, weekStartsOn: number): ISODate;
|
|
34
|
-
/** The last day of the week containing `iso`. */
|
|
35
|
-
export declare function endOfWeek(iso: ISODate, weekStartsOn: number): ISODate;
|
|
36
|
-
/** The first day of a "YYYY-MM" month. */
|
|
37
|
-
export declare function firstOfMonth(month: ISOMonth): ISODate;
|
|
38
|
-
/** The last day of a "YYYY-MM" month. */
|
|
39
|
-
export declare function lastOfMonth(month: ISOMonth): ISODate;
|
|
40
|
-
/** Six weeks of ISO dates (42 days) covering `month`, starting on `weekStartsOn`. */
|
|
41
|
-
export declare function monthGrid(month: ISOMonth, weekStartsOn: number): ISODate[][];
|
|
42
|
-
/** ISO strings compare correctly as plain strings (four-digit years). */
|
|
43
|
-
export declare const isBefore: (a: ISODate, b: ISODate) => boolean;
|
|
44
|
-
/** Clamps `iso` into [min, max] (either bound optional). */
|
|
45
|
-
export declare function clampDate(iso: ISODate, min?: ISODate | null, max?: ISODate | null): ISODate;
|
|
46
|
-
/** Today's local date as ISO. */
|
|
47
|
-
export declare function todayISO(): ISODate;
|
|
48
|
-
/**
|
|
49
|
-
* The locale's first day of the week (0 = Sunday ... 6 = Saturday), from
|
|
50
|
-
* `Intl.Locale` week info where the browser supports it; otherwise 0.
|
|
51
|
-
*/
|
|
52
|
-
export declare function getLocaleWeekStart(locale?: string): number;
|
|
53
|
-
/**
|
|
54
|
-
* Swaps the English pattern letters ("DD", "MM", "YYYY") for a language's,
|
|
55
|
-
* e.g. "TT.MM.JJJJ" in German.
|
|
56
|
-
*/
|
|
57
|
-
export declare function localizeDatePattern(pattern: string, letters: {
|
|
58
|
-
day: string;
|
|
59
|
-
month: string;
|
|
60
|
-
year: string;
|
|
61
|
-
}): string;
|
|
62
|
-
/** The numeric short date format of a locale: field order, separators, and a pattern like "MM/DD/YYYY". */
|
|
63
|
-
export interface DateFormatInfo {
|
|
64
|
-
/** Field order in the locale's short format. */
|
|
65
|
-
order: Array<"day" | "month" | "year">;
|
|
66
|
-
/** Human-readable pattern, e.g. "MM/DD/YYYY" or "DD.MM.YYYY". */
|
|
67
|
-
pattern: string;
|
|
68
|
-
/** Formats an ISO date in the locale's numeric short format. */
|
|
69
|
-
format: (iso: ISODate) => string;
|
|
70
|
-
/**
|
|
71
|
-
* Text the locale puts before the first or after the last field (e.g.
|
|
72
|
-
* " г." in bg). Dropped when formatting and stripped from typed text.
|
|
73
|
-
*/
|
|
74
|
-
affixes: string[];
|
|
75
|
-
}
|
|
76
|
-
export declare function getDateFormatInfo(locale?: string): DateFormatInfo;
|
|
77
|
-
/**
|
|
78
|
-
* Parses typed text as a date: ISO ("2026-10-04") or the locale's numeric
|
|
79
|
-
* short format in its own field order ("10/4/2026" in en-US, "4.10.2026"
|
|
80
|
-
* in de-DE). Any non-digit separators are accepted, and two-digit years
|
|
81
|
-
* mean 20xx. Returns an ISO date, or null when the text isn't a real date.
|
|
82
|
-
*/
|
|
83
|
-
export declare function parseDateText(text: string, locale?: string): ISODate | null;
|
|
84
|
-
export declare function getFormatter(locale: string | undefined, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
85
|
-
/** Full spoken date, e.g. "Sunday, October 4, 2026". */
|
|
86
|
-
export declare function formatFullDate(iso: ISODate, locale?: string): string;
|
|
87
|
-
/** Month heading, e.g. "October 2026". */
|
|
88
|
-
export declare function formatMonthYear(month: ISOMonth, locale?: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../utils/cx.cjs.js"),n=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),r=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),i=require("../DatePicker/DatePicker.cjs.js"),a=require("../DatePicker/dateUtils.cjs.js"),o=require("../Field/FieldContext.cjs.js"),s=require("../TimePicker/TimePicker.cjs.js"),c=require("../TimePicker/timeUtils.cjs.js"),l=require("./DateTimePicker.module.css.cjs.js");let u=require("react"),d=require("react/jsx-runtime");function f(e){return!e||e.length<16||e[10]!==`T`?!1:a.isISODate(e.slice(0,10))&&c.isISOTime(e.slice(11,16))}function p(e){return f(e)?{date:e.slice(0,10),time:e.slice(11,16)}:null}var m=({value:a,defaultValue:c,onValueChange:f,min:m,max:h,isDateDisabled:g,step:_=30,hourCycle:v,defaultTime:y,locale:b,weekStartsOn:x,today:S,size:C,name:w,clearable:T=!1,invalid:E,required:ee,disabled:te,readOnly:ne,placement:re=`bottom-start`,dateLabel:ie,timeLabel:ae,onInvalidDate:oe,onInvalidTime:se,fullWidth:ce=!0,id:D,"aria-label":O,"aria-describedby":k,className:A,style:j})=>{let{messages:M}=n.useLocale(),N=ie??M.timePicker.date,P=ae??M.timePicker.time,F=o.useFieldContext(),I=o.useFieldControl({id:D,disabled:te,readOnly:ne,size:C,invalid:E,required:ee}),[L,R]=e.useControllableState({value:a,defaultValue:c??null,onChange:f}),[z,B]=(0,u.useState)(()=>p(L)?.date??null),[V,H]=(0,u.useState)(()=>p(L)?.time??null),U=(0,u.useRef)(L);(0,u.useEffect)(()=>{if(U.current===L)return;U.current=L;let e=p(L);B(e?.date??null),H(e?.time??null)},[L]);let W=(e,t)=>{B(e),H(t);let n=e&&t?`${e}T${t}`:null;n!==L&&(U.current=n,R(n))},G=p(m),K=p(h),le=G&&z===G.date?G.time:void 0,ue=K&&z===K.date?K.time:void 0,q=(0,u.useId)(),J=`${q}-name`,Y=`${q}-date`,X=`${q}-time`,Z=F?.labelId??(O?J:void 0),Q=e=>[Z,e].filter(Boolean).join(` `),$={locale:b,size:C,clearable:T,placement:re,invalid:I.invalid||void 0,required:I.required,disabled:I.disabled,readOnly:I.readOnly,fullWidth:!0,"aria-describedby":k};return(0,d.jsxs)(`div`,{className:t.cx(l.default.root,ce&&l.default.fullWidth,A),style:j,"data-size":I.size??`md`,children:[(0,d.jsxs)(`div`,{role:`group`,"aria-labelledby":Z,className:l.default.fields,children:[(0,d.jsxs)(`div`,{className:t.cx(l.default.part,l.default.datePart),children:[(0,d.jsx)(`span`,{id:Y,className:l.default.partLabel,children:N}),(0,d.jsx)(i.DatePicker,{...$,id:I.id??`${q}-date-input`,"aria-labelledby":Q(Y),value:z,onValueChange:e=>W(e,e&&!V&&y?y:V),min:G?.date,max:K?.date,isDateDisabled:g,weekStartsOn:x,today:S,onInvalidInput:oe})]}),(0,d.jsxs)(`div`,{className:t.cx(l.default.part,l.default.timePart),children:[(0,d.jsx)(`span`,{id:X,className:l.default.partLabel,children:P}),(0,d.jsx)(s.TimePicker,{...$,id:`${q}-time-input`,"aria-labelledby":Q(X),value:V,onValueChange:e=>W(z,e),min:le,max:ue,step:_,hourCycle:v,onInvalidInput:se})]})]}),O&&!F?.labelId&&(0,d.jsx)(r.VisuallyHidden,{id:J,children:O}),w!==void 0&&(0,d.jsx)(`input`,{type:`hidden`,name:w,value:L??``,disabled:I.disabled})]})};exports.DateTimePicker=m,exports.isISODateTime=f;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { Placement, Size } from '../../../types/common';
|
|
3
|
-
import { DateInputError, WeekDay } from '../DatePicker';
|
|
4
|
-
import { ISODate } from '../DatePicker/dateUtils';
|
|
5
|
-
import { HourCycle, ISOTime, TimeInputError } from '../TimePicker';
|
|
6
|
-
/** A local date and wall-clock time, "YYYY-MM-DDTHH:mm" (the format of `<input type="datetime-local">`). */
|
|
7
|
-
export type ISODateTime = string;
|
|
8
|
-
/** True when `value` is a valid "YYYY-MM-DDTHH:mm" date and time. */
|
|
9
|
-
export declare function isISODateTime(value: string | null | undefined): value is ISODateTime;
|
|
10
|
-
export interface DateTimePickerProps {
|
|
11
|
-
/** Selected date and time, "YYYY-MM-DDTHH:mm", or null (controlled). */
|
|
12
|
-
value?: ISODateTime | null;
|
|
13
|
-
/** Initial value when uncontrolled. */
|
|
14
|
-
defaultValue?: ISODateTime | null;
|
|
15
|
-
/**
|
|
16
|
-
* Called with "YYYY-MM-DDTHH:mm" once both a date and a time are set, and
|
|
17
|
-
* with null when either is cleared or invalid.
|
|
18
|
-
*/
|
|
19
|
-
onValueChange?: (value: ISODateTime | null) => void;
|
|
20
|
-
/** Earliest allowed moment, "YYYY-MM-DDTHH:mm". Its time applies on its own date only. */
|
|
21
|
-
min?: ISODateTime;
|
|
22
|
-
/** Latest allowed moment, "YYYY-MM-DDTHH:mm". Its time applies on its own date only. */
|
|
23
|
-
max?: ISODateTime;
|
|
24
|
-
/** Marks individual dates unavailable. */
|
|
25
|
-
isDateDisabled?: (date: ISODate, dateObject: Date) => boolean;
|
|
26
|
-
/** Minutes between the times in the time list. @default 30 */
|
|
27
|
-
step?: number;
|
|
28
|
-
/** 12-hour (AM/PM) or 24-hour clock. Defaults to the locale's. */
|
|
29
|
-
hourCycle?: HourCycle;
|
|
30
|
-
/**
|
|
31
|
-
* Time filled in when a date is picked while the time is empty (e.g.
|
|
32
|
-
* "09:00"), so one pick gives a complete value. Without it, the value
|
|
33
|
-
* stays null until a time is set.
|
|
34
|
-
*/
|
|
35
|
-
defaultTime?: ISOTime;
|
|
36
|
-
/** BCP 47 locale for formats and labels. Defaults to the `LocaleProvider` locale. */
|
|
37
|
-
locale?: string;
|
|
38
|
-
/** First day of the week in the calendar. Defaults to the locale's. */
|
|
39
|
-
weekStartsOn?: WeekDay;
|
|
40
|
-
/** Override "today" ("YYYY-MM-DD") in the calendar, e.g. for tests. */
|
|
41
|
-
today?: ISODate;
|
|
42
|
-
/** Field size. Inherits from a surrounding `Field`. @default "md" */
|
|
43
|
-
size?: Size;
|
|
44
|
-
/** Name of a hidden input that submits "YYYY-MM-DDTHH:mm" with a form. */
|
|
45
|
-
name?: string;
|
|
46
|
-
/** Shows clear buttons in both fields. @default false */
|
|
47
|
-
clearable?: boolean;
|
|
48
|
-
/** Danger styling and `aria-invalid`. Inherits from a surrounding `Field`. */
|
|
49
|
-
invalid?: boolean;
|
|
50
|
-
/** Requires both a date and a time. Inherits from a surrounding `Field`. */
|
|
51
|
-
required?: boolean;
|
|
52
|
-
/** Disables both fields. Inherits from a surrounding `Field`. */
|
|
53
|
-
disabled?: boolean;
|
|
54
|
-
/** Shows the value without allowing changes. Inherits from a surrounding `Field`. */
|
|
55
|
-
readOnly?: boolean;
|
|
56
|
-
/** Where the calendar and the time list open. @default "bottom-start" */
|
|
57
|
-
placement?: Placement;
|
|
58
|
-
/** Visible label of the date field. @default "Date" */
|
|
59
|
-
dateLabel?: string;
|
|
60
|
-
/** Visible label of the time field. @default "Time" */
|
|
61
|
-
timeLabel?: string;
|
|
62
|
-
/** Called when the date field rejects typed text. */
|
|
63
|
-
onInvalidDate?: (error: DateInputError) => void;
|
|
64
|
-
/** Called when the time field rejects typed text. */
|
|
65
|
-
onInvalidTime?: (error: TimeInputError) => void;
|
|
66
|
-
/** Stretches the fields to fill the container. @default true */
|
|
67
|
-
fullWidth?: boolean;
|
|
68
|
-
/** Id for the date input. Inside a `Field`, the Field's id is used, so its label points there. */
|
|
69
|
-
id?: string;
|
|
70
|
-
/** Accessible name of the pair, when there is no `Field` label. */
|
|
71
|
-
"aria-label"?: string;
|
|
72
|
-
/** Ids of elements that describe both fields. */
|
|
73
|
-
"aria-describedby"?: string;
|
|
74
|
-
/** Class name for the outer root. */
|
|
75
|
-
className?: string;
|
|
76
|
-
/** Style for the outer root. */
|
|
77
|
-
style?: CSSProperties;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* A date and a time together: a `DatePicker` and a `TimePicker` side by
|
|
81
|
-
* side, with one value, "YYYY-MM-DDTHH:mm" (the format of a native
|
|
82
|
-
* `datetime-local` input, with no time zone). Each half keeps its full
|
|
83
|
-
* behavior: typed dates in the locale's format or the calendar popup, typed
|
|
84
|
-
* times in any common form or the list of times.
|
|
85
|
-
*
|
|
86
|
-
* `min` and `max` limit the calendar by their dates, and the time list by
|
|
87
|
-
* their times on those boundary dates. `defaultTime` fills the time when a
|
|
88
|
-
* date is picked first.
|
|
89
|
-
*
|
|
90
|
-
* Accessibility: the pair is a `role="group"` named by the `Field` label
|
|
91
|
-
* (or `aria-label`); each field is named by that label plus its own
|
|
92
|
-
* visible label ("Tip-off, Date", "Tip-off, Time"). Field hint, error,
|
|
93
|
-
* required, disabled, and invalid state reach both.
|
|
94
|
-
*
|
|
95
|
-
* ```tsx
|
|
96
|
-
* <Field label="Tip-off">
|
|
97
|
-
* <DateTimePicker name="tipoff" defaultTime="19:00" step={15} />
|
|
98
|
-
* </Field>
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
export declare const DateTimePicker: ({ value: valueProp, defaultValue, onValueChange, min, max, isDateDisabled, step, hourCycle, defaultTime, locale, weekStartsOn, today, size, name, clearable, invalid, required, disabled, readOnly, placement, dateLabel: dateLabelProp, timeLabel: timeLabelProp, onInvalidDate, onInvalidTime, fullWidth, id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, className, style, }: DateTimePickerProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_root_tmjqy_6`,t=`_fullWidth_tmjqy_12`,n=`_fields_tmjqy_17`,r=`_part_tmjqy_24`,i=`_datePart_tmjqy_32`,a=`_timePart_tmjqy_36`,o=`_partLabel_tmjqy_41`,s={root:e,fullWidth:t,fields:n,part:r,datePart:i,timePart:a,partLabel:o};exports.datePart=i,exports.default=s,exports.fields=n,exports.fullWidth=t,exports.part=r,exports.partLabel=o,exports.root=e,exports.timePart=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../utils/cx.cjs.js"),t=require("../../primitives/Icon/icons.cjs.js"),n=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),r=require("./FieldContext.cjs.js"),i=require("./Field.module.css.cjs.js");let a=require("react"),o=require("react/jsx-runtime");var s=(0,a.createContext)(null),c=e=>e!=null&&e!==!1&&e!==``;function l(e){let[t,n]=(0,a.useState)({hint:0,error:0}),r=(0,a.useCallback)(e=>(n(t=>({...t,[e]:t[e]+1})),()=>n(t=>({...t,[e]:t[e]-1}))),[]);return{parts:(0,a.useMemo)(()=>({hintId:`${e}-hint`,errorId:`${e}-error`,register:r}),[e,r]),counts:t}}function u(e,t){let n=(0,a.useContext)(s)?.register;(0,a.useLayoutEffect)(()=>{if(t&&n)return n(e)},[t,e,n])}var d={sm:i.default.sizeSm,md:i.default.sizeMd,lg:i.default.sizeLg};function f({required:e,requiredIndicator:t,optionalIndicator:n}){return e?t===!1||t===null?null:(0,o.jsx)(`span`,{className:i.default.requiredIndicator,"aria-hidden":`true`,children:t===void 0||t===!0?`*`:t}):c(n)?(0,o.jsx)(`span`,{className:i.default.optionalIndicator,children:n===!0?`(optional)`:n}):null}var p=`input:not([type="hidden"]), select, textarea, button, meter, output, progress`;function m({required:t,requiredIndicator:n,optionalIndicator:s,size:c,className:l,children:u,...m}){let h=r.useFieldContext(),g=t??h?.required??!1,_=c??h?.size??`md`,v=h&&!h.isGroup?h.controlId:void 0,[y,b]=(0,a.useState)(!0);return(0,a.useLayoutEffect)(()=>{let e=v?document.getElementById(v):null;b(!e||e.matches(p))},[v]),(0,o.jsxs)(`label`,{htmlFor:y?v:void 0,id:h?.labelId,...m,className:e.cx(i.default.label,d[_],h?.disabled&&i.default.labelDisabled,l),children:[u,(0,o.jsx)(f,{required:g,requiredIndicator:n,optionalIndicator:s})]})}function h({className:t,children:n,...r}){let l=(0,a.useContext)(s),d=c(n);return u(`hint`,d),d?(0,o.jsx)(`p`,{id:l?.hintId,...r,className:e.cx(i.default.hint,t),children:n}):null}function g({announce:n=!1,className:r,children:l,...d}){let f=(0,a.useContext)(s),p=c(l);u(`error`,p);let m=p?(0,o.jsxs)(`p`,{id:f?.errorId,...d,className:e.cx(i.default.error,r),children:[(0,o.jsx)(t.ErrorIcon,{size:`sm`,className:i.default.errorIcon}),(0,o.jsx)(`span`,{children:l})]}):null;return n?(0,o.jsx)(`div`,{role:`alert`,className:i.default.alertRegion,children:m}):m}function _({label:t,labelVisuallyHidden:u=!1,hint:f,error:p,invalid:_,required:v=!1,disabled:y=!1,readOnly:b=!1,size:x,id:S,requiredIndicator:C,optionalIndicator:w,announceError:T=!1,orientation:E=`vertical`,labelAction:D,counter:O,className:k,children:A,...j}){let M=(0,a.useId)(),{parts:N,counts:P}=l(M),F=c(p),I=_??F,L=F&&I,R=c(f),z=c(O),B=R||P.hint>0,V=L||P.error>0,H=(0,a.useMemo)(()=>({controlId:S??`${M}-control`,labelId:`${M}-label`,hintId:B?N.hintId:void 0,errorId:V?N.errorId:void 0,invalid:I,required:v,disabled:y,readOnly:b,size:x,isGroup:!1}),[S,M,B,V,N,I,v,y,b,x]),U=(0,o.jsx)(m,{requiredIndicator:C,optionalIndicator:w,children:t}),W=c(D);return(0,o.jsx)(r.FieldContext.Provider,{value:H,children:(0,o.jsx)(s.Provider,{value:N,children:(0,o.jsx)(`div`,{...j,"data-orientation":E,"data-invalid":I||void 0,"data-disabled":y||void 0,className:e.cx(i.default.field,E===`horizontal`&&i.default.horizontal,x&&d[x],k),children:(0,o.jsxs)(`div`,{className:i.default.layout,children:[u?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.VisuallyHidden,{children:U}),W&&(0,o.jsx)(`div`,{className:e.cx(i.default.labelRow,i.default.labelRowActionOnly),children:(0,o.jsx)(`span`,{className:i.default.labelAction,children:D})})]}):(0,o.jsxs)(`div`,{className:i.default.labelRow,children:[U,W&&(0,o.jsx)(`span`,{className:i.default.labelAction,children:D})]}),(0,o.jsxs)(`div`,{className:i.default.body,children:[A,(R||z)&&(0,o.jsxs)(`div`,{className:i.default.hintRow,children:[R&&(0,o.jsx)(h,{children:f}),z&&(0,o.jsx)(`span`,{className:i.default.counter,children:O})]}),(L||T)&&(0,o.jsx)(g,{announce:T,children:L?p:null})]})]})})})})}function v({id:e,invalid:t=!1,required:n=!1,disabled:i=!1,readOnly:c=!1,size:u,children:d}){let f=(0,a.useId)(),{parts:p,counts:m}=l(f),h=(0,a.useMemo)(()=>({controlId:e??`${f}-control`,labelId:`${f}-label`,hintId:m.hint>0?p.hintId:void 0,errorId:m.error>0?p.errorId:void 0,invalid:t,required:n,disabled:i,readOnly:c,size:u,isGroup:!1}),[e,f,m.hint,m.error,p,t,n,i,c,u]);return(0,o.jsx)(r.FieldContext.Provider,{value:h,children:(0,o.jsx)(s.Provider,{value:p,children:d})})}function y({label:t,labelVisuallyHidden:u=!1,hint:p,error:m,invalid:_,required:v=!1,disabled:y=!1,readOnly:b=!1,size:x,requiredIndicator:S,optionalIndicator:C,requiredText:w=`required`,announceError:T=!1,className:E,children:D,"aria-describedby":O,...k}){let A=(0,a.useId)(),{parts:j,counts:M}=l(A),N=c(m),P=_??N,F=N&&P,I=c(p),L=I||M.hint>0,R=F||M.error>0,z=`${A}-label`,B=(0,a.useMemo)(()=>({controlId:`${A}-control`,labelId:z,hintId:L?j.hintId:void 0,errorId:R?j.errorId:void 0,invalid:P,required:v,disabled:y,readOnly:b,size:x,isGroup:!0}),[A,z,L,R,j,P,v,y,b,x]),V=[O,L?j.hintId:void 0,P&&R?j.errorId:void 0].filter(Boolean).join(` `)||void 0,H=(0,o.jsxs)(o.Fragment,{children:[t,(0,o.jsx)(f,{required:v,requiredIndicator:S,optionalIndicator:C}),v&&(0,o.jsxs)(n.VisuallyHidden,{children:[` (`,w,`)`]})]});return(0,o.jsx)(r.FieldContext.Provider,{value:B,children:(0,o.jsx)(s.Provider,{value:j,children:(0,o.jsxs)(`fieldset`,{...k,disabled:y,"aria-describedby":V,"data-invalid":P||void 0,"data-disabled":y||void 0,className:e.cx(i.default.fieldset,x&&d[x],E),children:[(0,o.jsx)(`legend`,{id:z,className:e.cx(i.default.label,i.default.legend,d[x??`md`],y&&i.default.labelDisabled,u&&i.default.legendHidden),children:u?(0,o.jsx)(n.VisuallyHidden,{children:H}):H}),(0,o.jsxs)(`div`,{className:i.default.groupBody,children:[I&&(0,o.jsx)(h,{children:p}),D,(F||T)&&(0,o.jsx)(g,{announce:T,children:F?m:null})]})]})})})}exports.Field=_,exports.FieldError=g,exports.FieldHint=h,exports.FieldLabel=m,exports.FieldProvider=v,exports.Fieldset=y;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import { Orientation, Size } from '../../../types/common';
|
|
3
|
-
/** Props shared by `Field` and `Fieldset`. */
|
|
4
|
-
interface FieldCommonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Visible label (a `<legend>` in `Fieldset`). Always required so every
|
|
7
|
-
* control has an accessible name; use `labelVisuallyHidden` when the design
|
|
8
|
-
* has no visible label.
|
|
9
|
-
*/
|
|
10
|
-
label: ReactNode;
|
|
11
|
-
/** Keep the label for screen readers but hide it visually (e.g. a search box next to a visible heading). */
|
|
12
|
-
labelVisuallyHidden?: boolean;
|
|
13
|
-
/** Help text, wired to the control with `aria-describedby`. */
|
|
14
|
-
hint?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Error message. When present the field is invalid (unless `invalid={false}`),
|
|
17
|
-
* and the message is wired with `aria-describedby` and `aria-errormessage`.
|
|
18
|
-
* It renders with a leading error icon so the state isn't conveyed by color alone.
|
|
19
|
-
* With `invalid={false}` the message is not rendered.
|
|
20
|
-
*/
|
|
21
|
-
error?: ReactNode;
|
|
22
|
-
/** Invalid state. Defaults to `true` when `error` is present, otherwise `false`. */
|
|
23
|
-
invalid?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Required. Controls set native `required` (or `aria-required` for custom
|
|
26
|
-
* controls), which is what assistive tech announces; the label shows
|
|
27
|
-
* `requiredIndicator`.
|
|
28
|
-
*/
|
|
29
|
-
required?: boolean;
|
|
30
|
-
/** Disabled. Passed to controls through context; `Fieldset` also sets native `disabled`, which disables every descendant control. */
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
/** Read-only. Passed to controls through context. */
|
|
33
|
-
readOnly?: boolean;
|
|
34
|
-
/** Size shared with controls that don't set their own. Also scales the label. */
|
|
35
|
-
size?: Size;
|
|
36
|
-
/**
|
|
37
|
-
* Visual marker shown after the label when `required`. Defaults to a `*`
|
|
38
|
-
* that is `aria-hidden` (the control's native `required` carries the
|
|
39
|
-
* meaning for assistive tech). Pass `false` or `null` to hide it, or any node to customize.
|
|
40
|
-
*/
|
|
41
|
-
requiredIndicator?: ReactNode;
|
|
42
|
-
/**
|
|
43
|
-
* Show a marker after the label when the field is *not* required. `true`
|
|
44
|
-
* shows "(optional)"; pass a node to customize or localize it. Off by default.
|
|
45
|
-
* Use it in forms where most fields are required.
|
|
46
|
-
*/
|
|
47
|
-
optionalIndicator?: ReactNode;
|
|
48
|
-
/**
|
|
49
|
-
* Put the error message in a `role="alert"` live region, so it is announced
|
|
50
|
-
* when it appears. Off by default: announcing every inline validation
|
|
51
|
-
* message is noisy. Turn it on for errors that appear after submit or an
|
|
52
|
-
* async check. The live region stays mounted while `announceError` is on,
|
|
53
|
-
* so the message is announced reliably when it is added.
|
|
54
|
-
*/
|
|
55
|
-
announceError?: boolean;
|
|
56
|
-
}
|
|
57
|
-
/** Props for `FieldLabel`. */
|
|
58
|
-
export interface FieldLabelProps extends ComponentPropsWithRef<"label"> {
|
|
59
|
-
/** Show `requiredIndicator` or `optionalIndicator`. Defaults to the surrounding Field's `required`. */
|
|
60
|
-
required?: boolean;
|
|
61
|
-
/** Marker shown when required. Defaults to an `aria-hidden` `*`. `false` or `null` hides it. */
|
|
62
|
-
requiredIndicator?: ReactNode;
|
|
63
|
-
/** Marker shown when not required. `true` shows "(optional)". Off by default. */
|
|
64
|
-
optionalIndicator?: ReactNode;
|
|
65
|
-
/** Label size. Defaults to the surrounding Field's size, then `md`. */
|
|
66
|
-
size?: Size;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The label of a Field. Reads `htmlFor` and `id` from the surrounding Field;
|
|
70
|
-
* use it standalone for custom layouts (pass `htmlFor` outside a Field).
|
|
71
|
-
*/
|
|
72
|
-
export declare function FieldLabel({ required, requiredIndicator, optionalIndicator, size, className, children, ...props }: FieldLabelProps): import("react").JSX.Element;
|
|
73
|
-
/** Props for `FieldHint`. */
|
|
74
|
-
export type FieldHintProps = ComponentPropsWithRef<"p">;
|
|
75
|
-
/**
|
|
76
|
-
* Help text for a Field. Takes the Field's hint id and registers itself, so
|
|
77
|
-
* controls reference it with `aria-describedby`. Renders nothing when empty.
|
|
78
|
-
*/
|
|
79
|
-
export declare function FieldHint({ className, children, ...props }: FieldHintProps): import("react").JSX.Element | null;
|
|
80
|
-
/** Props for `FieldError`. */
|
|
81
|
-
export interface FieldErrorProps extends ComponentPropsWithRef<"p"> {
|
|
82
|
-
/**
|
|
83
|
-
* Wrap the message in a persistent `role="alert"` live region so it is
|
|
84
|
-
* announced when it appears. Off by default (see `Field`'s `announceError`).
|
|
85
|
-
*/
|
|
86
|
-
announce?: boolean;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Error message for a Field, with a leading decorative error icon so the
|
|
90
|
-
* state isn't conveyed by color alone. Takes the Field's error id and
|
|
91
|
-
* registers itself; controls reference it only while the Field is invalid.
|
|
92
|
-
* Renders nothing when empty (except the live region when `announce` is on).
|
|
93
|
-
*/
|
|
94
|
-
export declare function FieldError({ announce, className, children, ...props }: FieldErrorProps): import("react").JSX.Element | null;
|
|
95
|
-
/** Props for `Field`. */
|
|
96
|
-
export interface FieldProps extends FieldCommonProps, Omit<ComponentPropsWithRef<"div">, "id"> {
|
|
97
|
-
/**
|
|
98
|
-
* id for the control. The label's `htmlFor` points here, and controls read
|
|
99
|
-
* it from context. Generated with `useId` when omitted. (The wrapper `div`
|
|
100
|
-
* gets no id.)
|
|
101
|
-
*/
|
|
102
|
-
id?: string;
|
|
103
|
-
/**
|
|
104
|
-
* `vertical` (default): label above the control. `horizontal`: label to the
|
|
105
|
-
* left, falling back to vertical when the Field is narrower than 30rem
|
|
106
|
-
* (a container query, so it adapts to its column, not the viewport).
|
|
107
|
-
*/
|
|
108
|
-
orientation?: Orientation;
|
|
109
|
-
/** Content at the end of the label row, e.g. a "Forgot password?" link. */
|
|
110
|
-
labelAction?: ReactNode;
|
|
111
|
-
/**
|
|
112
|
-
* Content at the end of the hint row, e.g. a character counter "12/280".
|
|
113
|
-
* It is not wired to the control; if it must be announced, give it its own
|
|
114
|
-
* polite live region or mention the limit in `hint`.
|
|
115
|
-
*/
|
|
116
|
-
counter?: ReactNode;
|
|
117
|
-
/** The control (Input, Select, ...). It reads ids and state with `useFieldControl`. */
|
|
118
|
-
children?: ReactNode;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Wraps one form control with a label, hint, and error message, and wires
|
|
122
|
-
* them together: `<label for>`, `aria-describedby`, `aria-invalid`,
|
|
123
|
-
* `aria-errormessage`, `required`, and `disabled` all flow to the control
|
|
124
|
-
* through `FieldContext`.
|
|
125
|
-
*/
|
|
126
|
-
export declare function Field({ label, labelVisuallyHidden, hint, error, invalid: invalidProp, required, disabled, readOnly, size, id, requiredIndicator, optionalIndicator, announceError, orientation, labelAction, counter, className, children, ...rest }: FieldProps): import("react").JSX.Element;
|
|
127
|
-
/** Props for `FieldProvider`. */
|
|
128
|
-
export interface FieldProviderProps {
|
|
129
|
-
/** id for the control. Generated when omitted. */
|
|
130
|
-
id?: string;
|
|
131
|
-
/** Invalid state. Controls set `aria-invalid` and reference a mounted `FieldError`. */
|
|
132
|
-
invalid?: boolean;
|
|
133
|
-
/** Required. */
|
|
134
|
-
required?: boolean;
|
|
135
|
-
/** Disabled. */
|
|
136
|
-
disabled?: boolean;
|
|
137
|
-
/** Read-only. */
|
|
138
|
-
readOnly?: boolean;
|
|
139
|
-
/** Size shared with controls. */
|
|
140
|
-
size?: Size;
|
|
141
|
-
/** Your own layout: `FieldLabel`, the control, `FieldHint`, `FieldError`, anywhere inside. */
|
|
142
|
-
children?: ReactNode;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Provides `FieldContext` without rendering any markup, for fully custom
|
|
146
|
-
* layouts built from `FieldLabel`, `FieldHint`, and `FieldError`. The hint
|
|
147
|
-
* and error register themselves, so the control's `aria-describedby` and
|
|
148
|
-
* `aria-errormessage` stay correct wherever they are placed.
|
|
149
|
-
*/
|
|
150
|
-
export declare function FieldProvider({ id, invalid, required, disabled, readOnly, size, children, }: FieldProviderProps): import("react").JSX.Element;
|
|
151
|
-
/** Props for `Fieldset`. */
|
|
152
|
-
export interface FieldsetProps extends FieldCommonProps, ComponentPropsWithRef<"fieldset"> {
|
|
153
|
-
/**
|
|
154
|
-
* Visually hidden text added to the legend when `required`, because a group
|
|
155
|
-
* has no native `required` that screen readers announce for the legend.
|
|
156
|
-
* Localize it here.
|
|
157
|
-
*/
|
|
158
|
-
requiredText?: string;
|
|
159
|
-
/** The group of controls (native radios / checkboxes, RadioGroup, CheckBoxGroup). */
|
|
160
|
-
children?: ReactNode;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Group mode of Field: a `<fieldset>` with a `<legend>`, for a set of related
|
|
164
|
-
* controls (RadioGroup, CheckBoxGroup, or native radios and checkboxes).
|
|
165
|
-
* Provides `FieldContext` with `isGroup: true`, so group controls label
|
|
166
|
-
* themselves with the legend's id. Native `disabled` on the fieldset disables
|
|
167
|
-
* every descendant control. The hint sits under the legend (read before the
|
|
168
|
-
* options); the error sits after the controls.
|
|
169
|
-
*/
|
|
170
|
-
export declare function Fieldset({ label, labelVisuallyHidden, hint, error, invalid: invalidProp, required, disabled, readOnly, size, requiredIndicator, optionalIndicator, requiredText, announceError, className, children, "aria-describedby": describedByProp, ...rest }: FieldsetProps): import("react").JSX.Element;
|
|
171
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_sizeSm_ygpyp_19`,t=`_sizeMd_ygpyp_27`,n=`_sizeLg_ygpyp_35`,r=`_field_ygpyp_47`,i=`_layout_ygpyp_61`,a=`_labelRow_ygpyp_77`,o=`_labelRowActionOnly_ygpyp_97`,s=`_label_ygpyp_77`,c=`_labelDisabled_ygpyp_123`,l=`_requiredIndicator_ygpyp_133`,u=`_optionalIndicator_ygpyp_143`,d=`_labelAction_ygpyp_167`,f=`_body_ygpyp_179`,p=`_hintRow_ygpyp_193`,m=`_hint_ygpyp_193`,h=`_counter_ygpyp_225`,g=`_error_ygpyp_247`,_=`_errorIcon_ygpyp_271`,v=`_alertRegion_ygpyp_285`,y=`_groupBody_ygpyp_291`,b=`_horizontal_ygpyp_305`,x=`_fieldset_ygpyp_363`,S=`_legend_ygpyp_383`,C=`_legendHidden_ygpyp_393`,w={sizeSm:e,sizeMd:t,sizeLg:n,field:r,layout:i,labelRow:a,labelRowActionOnly:o,label:s,labelDisabled:c,requiredIndicator:l,optionalIndicator:u,labelAction:d,body:f,hintRow:p,hint:m,counter:h,error:g,errorIcon:_,alertRegion:v,groupBody:y,horizontal:b,fieldset:x,legend:S,legendHidden:C};exports.alertRegion=v,exports.body=f,exports.counter=h,exports.default=w,exports.error=g,exports.errorIcon=_,exports.field=r,exports.fieldset=x,exports.groupBody=y,exports.hint=m,exports.hintRow=p,exports.horizontal=b,exports.label=s,exports.labelAction=d,exports.labelDisabled=c,exports.labelRow=a,exports.labelRowActionOnly=o,exports.layout=i,exports.legend=S,exports.legendHidden=C,exports.optionalIndicator=u,exports.requiredIndicator=l,exports.sizeLg=n,exports.sizeMd=t,exports.sizeSm=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";let e=require("react");var t=(0,e.createContext)(null);function n(){return(0,e.useContext)(t)}function r(e={},{nativeRequired:t=!0}={}){let r=n(),i=e.invalid??r?.invalid??!1,a=e.required??r?.required??!1,o=e.disabled??r?.disabled??!1,s=e.readOnly??r?.readOnly??!1,c=e.id??(r&&!r.isGroup?r.controlId:void 0),l=[e[`aria-describedby`],r?.hintId,i?r?.errorId:void 0].filter(Boolean).join(` `)||void 0;return{id:c,invalid:i,required:a,disabled:o,readOnly:s,size:e.size??r?.size,ariaProps:{...l?{"aria-describedby":l}:null,...i?{"aria-invalid":!0}:null,...i&&r?.errorId?{"aria-errormessage":r.errorId}:null,...a&&!t?{"aria-required":!0}:null}}}exports.FieldContext=t,exports.useFieldContext=n,exports.useFieldControl=r;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Size } from '../../../types/common';
|
|
2
|
-
/**
|
|
3
|
-
* The contract between `Field` (label, hint, error wrapper) and the form
|
|
4
|
-
* controls inside it (Input, Textarea, Select, CheckBox, RadioGroup, Switch,
|
|
5
|
-
* Slider, ...). `Field` provides this; controls read it with
|
|
6
|
-
* `useFieldControl` so labels, descriptions, and error state are wired
|
|
7
|
-
* automatically. Controls must also work standalone, with no Field around them.
|
|
8
|
-
*/
|
|
9
|
-
export interface FieldContextValue {
|
|
10
|
-
/** id for the control element (the label's htmlFor points here). */
|
|
11
|
-
controlId: string;
|
|
12
|
-
/** id of the visible label (or legend, for groups). */
|
|
13
|
-
labelId: string;
|
|
14
|
-
/** id of the hint text, when a hint is rendered. */
|
|
15
|
-
hintId?: string;
|
|
16
|
-
/** id of the error message, when an error is rendered. */
|
|
17
|
-
errorId?: string;
|
|
18
|
-
/** The field is invalid: controls set aria-invalid and use danger styling. */
|
|
19
|
-
invalid: boolean;
|
|
20
|
-
required: boolean;
|
|
21
|
-
disabled: boolean;
|
|
22
|
-
readOnly: boolean;
|
|
23
|
-
/** Size shared with controls that don't set their own. */
|
|
24
|
-
size?: Size;
|
|
25
|
-
/**
|
|
26
|
-
* True when Field renders a fieldset + legend around a group of controls
|
|
27
|
-
* (RadioGroup, CheckBoxGroup). Group controls then label themselves with
|
|
28
|
-
* `labelId` instead of taking `controlId`.
|
|
29
|
-
*/
|
|
30
|
-
isGroup: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare const FieldContext: import('react').Context<FieldContextValue | null>;
|
|
33
|
-
/** Returns the surrounding Field's context, or null outside a Field. */
|
|
34
|
-
export declare function useFieldContext(): FieldContextValue | null;
|
|
35
|
-
/** Props a control may receive directly; explicit props win over the Field's. */
|
|
36
|
-
export interface FieldControlOverrides {
|
|
37
|
-
id?: string;
|
|
38
|
-
invalid?: boolean;
|
|
39
|
-
required?: boolean;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
readOnly?: boolean;
|
|
42
|
-
size?: Size;
|
|
43
|
-
"aria-describedby"?: string;
|
|
44
|
-
}
|
|
45
|
-
/** Everything a control needs to spread or read after merging with Field. */
|
|
46
|
-
export interface FieldControlProps {
|
|
47
|
-
id: string | undefined;
|
|
48
|
-
invalid: boolean;
|
|
49
|
-
required: boolean;
|
|
50
|
-
disabled: boolean;
|
|
51
|
-
readOnly: boolean;
|
|
52
|
-
size: Size | undefined;
|
|
53
|
-
/** Spread onto the focusable control element. */
|
|
54
|
-
ariaProps: {
|
|
55
|
-
"aria-describedby"?: string;
|
|
56
|
-
"aria-invalid"?: true;
|
|
57
|
-
"aria-errormessage"?: string;
|
|
58
|
-
"aria-required"?: true;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Merges a control's own props with the surrounding Field (if any).
|
|
63
|
-
*
|
|
64
|
-
* ```tsx
|
|
65
|
-
* const field = useFieldControl({ id, invalid, required, disabled, readOnly, size, "aria-describedby": describedBy });
|
|
66
|
-
* <input id={field.id} required={field.required} disabled={field.disabled} {...field.ariaProps} />
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* Use native `required` on native inputs; `ariaProps["aria-required"]` is
|
|
70
|
-
* only set for custom (non-native) controls via `{ nativeRequired: false }`.
|
|
71
|
-
*/
|
|
72
|
-
export declare function useFieldControl(own?: FieldControlOverrides, { nativeRequired }?: {
|
|
73
|
-
nativeRequired?: boolean;
|
|
74
|
-
}): FieldControlProps;
|