@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,120 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import { Orientation, Radius, Size } from '../../../types/common';
|
|
3
|
-
/**
|
|
4
|
-
* Thumb color. `neutral` is a raised surface thumb on the sunken track;
|
|
5
|
-
* `primary` is a solid brand thumb with on-primary text. Other tones are not
|
|
6
|
-
* offered: their solid fills are for status, not for a selection indicator.
|
|
7
|
-
*/
|
|
8
|
-
export type SegmentedControlTone = "neutral" | "primary";
|
|
9
|
-
/** A segment with a visible label; `aria-label` optionally overrides its name. */
|
|
10
|
-
interface LabelledOption {
|
|
11
|
-
/** Visible segment text. */
|
|
12
|
-
label: NonNullable<ReactNode>;
|
|
13
|
-
/** Overrides the accessible name (rarely needed when `label` is text). */
|
|
14
|
-
"aria-label"?: string;
|
|
15
|
-
}
|
|
16
|
-
/** An icon-only segment: `aria-label` is required so it has an accessible name. */
|
|
17
|
-
interface IconOnlyOption {
|
|
18
|
-
label?: undefined;
|
|
19
|
-
/** The icon that stands in for the label. */
|
|
20
|
-
icon: NonNullable<ReactNode>;
|
|
21
|
-
/** Accessible name for the icon-only segment (required). */
|
|
22
|
-
"aria-label": string;
|
|
23
|
-
}
|
|
24
|
-
/** One entry of `SegmentedControl`'s `options`. */
|
|
25
|
-
export type SegmentedControlOption = {
|
|
26
|
-
/** Value submitted with the form and reported by `onValueChange`. */
|
|
27
|
-
value: string;
|
|
28
|
-
/** Decorative icon before the label (e.g. `<Icon name="calendar" />`). */
|
|
29
|
-
icon?: ReactNode;
|
|
30
|
-
/** Disables this segment. Arrow keys skip it. */
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
} & (LabelledOption | IconOnlyOption);
|
|
33
|
-
type NativeRadioProps = Omit<ComponentPropsWithRef<"input">, "type" | "size" | "value" | "children" | "checked" | "defaultChecked" | "name" | "aria-label">;
|
|
34
|
-
interface SegmentedControlItemBaseProps extends NativeRadioProps {
|
|
35
|
-
/** Value submitted with the form and reported by `onValueChange`. */
|
|
36
|
-
value: string;
|
|
37
|
-
/** Decorative icon before the label (e.g. `<Icon name="calendar" />`). */
|
|
38
|
-
icon?: ReactNode;
|
|
39
|
-
/** Disables this segment (the control's `disabled` also applies). Arrow keys skip it. */
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
/** Class for the segment (label) element. The `ref` and other native props go to the input. */
|
|
42
|
-
className?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Props for `SegmentedControl.Item`. Pass the visible label as `children`,
|
|
46
|
-
* or, for an icon-only segment, pass `icon` and a required `aria-label`.
|
|
47
|
-
*/
|
|
48
|
-
export type SegmentedControlItemProps = SegmentedControlItemBaseProps & ({
|
|
49
|
-
/** Visible segment label. */
|
|
50
|
-
children: NonNullable<ReactNode>;
|
|
51
|
-
/** Overrides the accessible name (rarely needed). */
|
|
52
|
-
"aria-label"?: string;
|
|
53
|
-
} | {
|
|
54
|
-
children?: undefined;
|
|
55
|
-
/** The icon that stands in for the label. */
|
|
56
|
-
icon: NonNullable<ReactNode>;
|
|
57
|
-
/** Accessible name for the icon-only segment (required). */
|
|
58
|
-
"aria-label": string;
|
|
59
|
-
});
|
|
60
|
-
/**
|
|
61
|
-
* One segment of a `SegmentedControl`: a native radio (invisible but
|
|
62
|
-
* focusable, covering the segment) inside a `<label>`. `ref` points at the
|
|
63
|
-
* `<input>`. Must be a direct child of `SegmentedControl`.
|
|
64
|
-
*/
|
|
65
|
-
declare function SegmentedControlItem({ value, icon, disabled: disabledProp, className, style, children, onChange, required, id: idProp, ...rest }: SegmentedControlItemProps): import("react").JSX.Element;
|
|
66
|
-
export interface SegmentedControlProps extends Omit<ComponentPropsWithRef<"div">, "defaultValue" | "onChange" | "children" | "dir"> {
|
|
67
|
-
/** Segments as data. Use this or `SegmentedControl.Item` children. */
|
|
68
|
-
options?: SegmentedControlOption[];
|
|
69
|
-
/** `SegmentedControl.Item` segments, as direct children. Ignored when `options` is set. */
|
|
70
|
-
children?: ReactNode;
|
|
71
|
-
/** Selected value (controlled). Use with `onValueChange`. */
|
|
72
|
-
value?: string;
|
|
73
|
-
/** Initially selected value (uncontrolled). Leave unset for no initial selection (no thumb). */
|
|
74
|
-
defaultValue?: string;
|
|
75
|
-
/** Called with the newly selected segment's `value`. */
|
|
76
|
-
onValueChange?: (value: string) => void;
|
|
77
|
-
/** Shared `name` for the native radios (used in form submission). Generated with `useId` when omitted. */
|
|
78
|
-
name?: string;
|
|
79
|
-
/** Height and text size. Falls back to a surrounding Field's size. @default "md" */
|
|
80
|
-
size?: Size;
|
|
81
|
-
/** Thumb color: raised neutral surface, or solid primary with on-primary text. @default "neutral" */
|
|
82
|
-
tone?: SegmentedControlTone;
|
|
83
|
-
/** Corner rounding of the track; the thumb and segments follow it. @default "pill" */
|
|
84
|
-
radius?: Radius;
|
|
85
|
-
/** Stretch to the container's width with equal-width segments. */
|
|
86
|
-
fullWidth?: boolean;
|
|
87
|
-
/** Lay segments out in a row or a column. Arrow keys work in both directions either way. @default "horizontal" */
|
|
88
|
-
orientation?: Orientation;
|
|
89
|
-
/** Disables every segment. Falls back to a surrounding Field's state. */
|
|
90
|
-
disabled?: boolean;
|
|
91
|
-
/** Invalid styling and `aria-invalid`. Falls back to a surrounding Field's state. */
|
|
92
|
-
invalid?: boolean;
|
|
93
|
-
/** A selection is required: native `required` on the radios, `aria-required` on the group. */
|
|
94
|
-
required?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Visible group label, shown above the track when the control stands alone.
|
|
97
|
-
* Ignored inside a `Field`/`Fieldset`, whose label or legend already names
|
|
98
|
-
* the group. Without a label, pass `aria-label` or `aria-labelledby`.
|
|
99
|
-
*/
|
|
100
|
-
label?: ReactNode;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* A single-choice control drawn as a pill track with a thumb that slides
|
|
104
|
-
* behind the selected segment (Day / Week / Month, Offense / Defense).
|
|
105
|
-
*
|
|
106
|
-
* Semantically a radio group: `role="radiogroup"` around native
|
|
107
|
-
* `<input type="radio">` elements that share a `name`, so Tab lands on the
|
|
108
|
-
* selected segment, arrow keys move and select, and the value submits with a
|
|
109
|
-
* form. Inside a `Fieldset` the fieldset and legend name the group instead.
|
|
110
|
-
*
|
|
111
|
-
* Use `Tabs` when the choice switches between panels of content, and
|
|
112
|
-
* `ToggleGroup` for pressed-state buttons or multi-select.
|
|
113
|
-
*/
|
|
114
|
-
declare function SegmentedControlRoot({ options, children, value: valueProp, defaultValue, onValueChange, name, size: sizeProp, tone, radius, fullWidth, orientation, disabled: disabledProp, invalid: invalidProp, required: requiredProp, label, className, id: idProp, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...rest }: SegmentedControlProps): import("react").JSX.Element;
|
|
115
|
-
/** Single-choice segmented control. See `SegmentedControlProps`; segments via `options` or `SegmentedControl.Item`. */
|
|
116
|
-
export declare const SegmentedControl: typeof SegmentedControlRoot & {
|
|
117
|
-
/** One segment (a native radio). */
|
|
118
|
-
Item: typeof SegmentedControlItem;
|
|
119
|
-
};
|
|
120
|
-
export { SegmentedControlItem };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_sm_1pa3h_23`,t=`_md_1pa3h_31`,n=`_lg_1pa3h_39`,r=`_radiusNone_1pa3h_49`,i=`_radiusXs_1pa3h_52`,a=`_radiusSm_1pa3h_55`,o=`_radiusMd_1pa3h_58`,s=`_radiusLg_1pa3h_61`,c=`_radiusXl_1pa3h_64`,l=`_radius2xl_1pa3h_67`,u=`_radiusPill_1pa3h_70`,d=`_toneNeutral_1pa3h_75`,f=`_tonePrimary_1pa3h_80`,p=`_root_1pa3h_90`,m=`_fullWidth_1pa3h_99`,h=`_groupLabel_1pa3h_104`,g=`_requiredMark_1pa3h_112`,_=`_track_1pa3h_124`,v=`_horizontal_1pa3h_139`,y=`_vertical_1pa3h_144`,b=`_segment_1pa3h_156`,x=`_thumb_1pa3h_172`,S=`_iconOnly_1pa3h_244`,C=`_input_1pa3h_258`,w=`_content_1pa3h_270`,T=`_icon_1pa3h_244`,E=`_labelStack_1pa3h_290`,D=`_labelSizer_1pa3h_297`,O={sm:e,md:t,lg:n,radiusNone:r,radiusXs:i,radiusSm:a,radiusMd:o,radiusLg:s,radiusXl:c,radius2xl:l,radiusPill:u,toneNeutral:d,tonePrimary:f,root:p,fullWidth:m,groupLabel:h,requiredMark:g,track:_,horizontal:v,vertical:y,segment:b,thumb:x,iconOnly:S,input:C,content:w,icon:T,labelStack:E,labelSizer:D};exports.content=w,exports.default=O,exports.fullWidth=m,exports.groupLabel=h,exports.horizontal=v,exports.icon=T,exports.iconOnly=S,exports.input=C,exports.labelSizer=D,exports.labelStack=E,exports.lg=n,exports.md=t,exports.radius2xl=l,exports.radiusLg=s,exports.radiusMd=o,exports.radiusNone=r,exports.radiusPill=u,exports.radiusSm=a,exports.radiusXl=c,exports.radiusXs=i,exports.requiredMark=g,exports.root=p,exports.segment=b,exports.sm=e,exports.thumb=x,exports.toneNeutral=d,exports.tonePrimary=f,exports.track=_,exports.vertical=y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../primitives/Icon/icons.cjs.js"),i=require("../Field/FieldContext.cjs.js"),a=require("./Select.module.css.cjs.js");let o=require("react/jsx-runtime");var s={sm:a.default.sm,md:a.default.md,lg:a.default.lg},c={outline:a.default.outline,filled:a.default.filled},l={none:a.default.radiusNone,xs:a.default.radiusXs,sm:a.default.radiusSm,md:a.default.radiusMd,lg:a.default.radiusLg,xl:a.default.radiusXl,"2xl":a.default.radius2xl,pill:a.default.radiusPill},u=e=>`options`in e;function d(e){for(let t of e??[])if(u(t)){if(t.disabled)continue;let e=d(t.options);if(e!==void 0)return e}else if(!t.disabled)return t.value}var f=e=>(0,o.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value);function p({size:p,variant:m=`outline`,radius:h,invalid:g,readOnly:_,placeholder:v,options:y,children:b,startIcon:x,multiple:S=!1,htmlSize:C,value:w,defaultValue:T,onValueChange:E,fullWidth:D=!0,className:O,selectClassName:k,style:A,id:j,required:M,disabled:N,onChange:P,"aria-describedby":F,...I}){let L=i.useFieldControl({id:j,invalid:g,required:M,disabled:N,readOnly:_,size:p,"aria-describedby":F}),R=L.size??`md`,[z,B]=e.useControllableState({value:w,defaultValue:T??(S?[]:v===void 0?d(y)??``:``),onChange:E});t.useFormReset(()=>L.id?document.getElementById(L.id):null,()=>B(T??(S?[]:``)),w===void 0);let V=S||C!==void 0&&C>1,H=v!==void 0&&!S,U=H&&(z===``||z===void 0),W=x!=null&&!V,G=e=>{if(L.readOnly)return;P?.(e);let t=e.currentTarget;B(S?Array.from(t.selectedOptions,e=>e.value):t.value)};return(0,o.jsxs)(`div`,{className:n.cx(a.default.root,s[R],c[m],h&&l[h],D&&a.default.fullWidth,V&&a.default.list,W&&a.default.hasStartIcon,L.invalid&&a.default.invalid,L.disabled&&a.default.disabled,O),style:A,children:[W&&(0,o.jsx)(`span`,{className:a.default.startIcon,"aria-hidden":`true`,children:x}),(0,o.jsxs)(`select`,{...L.ariaProps,...I,id:L.id,required:L.required,disabled:L.disabled,multiple:S,size:C,value:z,onChange:G,"aria-readonly":L.readOnly||void 0,"data-readonly":L.readOnly||void 0,onMouseDown:e=>{I.onMouseDown?.(e),L.readOnly&&e.preventDefault()},onKeyDown:e=>{I.onKeyDown?.(e),L.readOnly&&e.key!==`Tab`&&e.preventDefault()},"data-placeholder-shown":U||void 0,className:n.cx(a.default.select,k),children:[H&&(0,o.jsx)(`option`,{value:``,disabled:!0,hidden:!0,children:v}),y?y.map(e=>u(e)?(0,o.jsx)(`optgroup`,{label:e.label,disabled:e.disabled,children:e.options.map(f)},`group:${e.label}`):f(e)):b]}),!V&&(0,o.jsx)(r.ChevronDownIcon,{className:a.default.chevron,size:R===`sm`?`sm`:`md`})]})}exports.Select=p;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import { Radius, Size } from '../../../types/common';
|
|
3
|
-
/** Visual style of a Select. `filled` uses a sunken background with no border until hover or focus. */
|
|
4
|
-
export type SelectVariant = "outline" | "filled";
|
|
5
|
-
/** A single choice in the `options` shortcut. */
|
|
6
|
-
export interface SelectOption {
|
|
7
|
-
/** Submitted value. */
|
|
8
|
-
value: string;
|
|
9
|
-
/** Visible text. Native `<option>` elements can only render plain text. */
|
|
10
|
-
label: string;
|
|
11
|
-
/** Show the option but prevent choosing it. */
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/** A labeled group of choices in the `options` shortcut (renders an `<optgroup>`). */
|
|
15
|
-
export interface SelectOptionGroup {
|
|
16
|
-
/** Group heading, announced by screen readers with each option in the group. */
|
|
17
|
-
label: string;
|
|
18
|
-
/** Choices in the group. */
|
|
19
|
-
options: SelectOption[];
|
|
20
|
-
/** Disable every option in the group. */
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/** One entry in the `options` shortcut: an option or an option group. */
|
|
24
|
-
export type SelectItem = SelectOption | SelectOptionGroup;
|
|
25
|
-
/** Value of a Select: a string, or an array of strings when `multiple`. */
|
|
26
|
-
export type SelectValue = string | string[];
|
|
27
|
-
interface SelectOwnProps {
|
|
28
|
-
/** Control height and text size. Defaults to the surrounding Field's size, then `md`. */
|
|
29
|
-
size?: Size;
|
|
30
|
-
/** Visual style. */
|
|
31
|
-
variant?: SelectVariant;
|
|
32
|
-
/** Corner rounding. Defaults to the shared text-field radius (`--field-radius`). */
|
|
33
|
-
radius?: Radius;
|
|
34
|
-
/** Show danger styling and set `aria-invalid`. Inherited from a surrounding Field. Pair with visible error text, since color alone is not enough. */
|
|
35
|
-
invalid?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Shows the value without allowing changes (`<select>` has no native
|
|
38
|
-
* read-only): the list doesn't open and `aria-readonly` is set. Inherited
|
|
39
|
-
* from a surrounding Field.
|
|
40
|
-
*/
|
|
41
|
-
readOnly?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Prompt shown while no value is chosen. Renders a disabled first option
|
|
44
|
-
* with an empty value that is hidden from the open list. Combine with
|
|
45
|
-
* `required` to make native validation reject the empty choice.
|
|
46
|
-
* Ignored when `multiple` is set.
|
|
47
|
-
*/
|
|
48
|
-
placeholder?: string;
|
|
49
|
-
/** Shortcut for the choices. Takes precedence over `children`. Entries with `options` render as `<optgroup>`. */
|
|
50
|
-
options?: SelectItem[];
|
|
51
|
-
/** `<option>` and `<optgroup>` elements, used when `options` is not set. */
|
|
52
|
-
children?: ReactNode;
|
|
53
|
-
/** Decorative icon at the inline start (hidden from assistive technology). Not shown in list mode (`multiple` or `htmlSize` > 1). */
|
|
54
|
-
startIcon?: ReactNode;
|
|
55
|
-
/** Allow choosing several options. Renders an always-open list box with no chevron. */
|
|
56
|
-
multiple?: boolean;
|
|
57
|
-
/** Native `size` attribute: the number of visible rows in list mode. Named `htmlSize` so it doesn't clash with `size`. */
|
|
58
|
-
htmlSize?: number;
|
|
59
|
-
/** Controlled value (`string[]` when `multiple`). */
|
|
60
|
-
value?: SelectValue;
|
|
61
|
-
/** Initial value when uncontrolled. Defaults to `""` (or `[]` when `multiple`). */
|
|
62
|
-
defaultValue?: SelectValue;
|
|
63
|
-
/** Called with the new value (`string[]` when `multiple`) whenever the choice changes. */
|
|
64
|
-
onValueChange?: (value: SelectValue) => void;
|
|
65
|
-
/** Stretch to the full inline size of the container. */
|
|
66
|
-
fullWidth?: boolean;
|
|
67
|
-
/** Class for the outer wrapper. Use `selectClassName` to target the `<select>` itself. */
|
|
68
|
-
className?: string;
|
|
69
|
-
/** Class for the native `<select>` element. */
|
|
70
|
-
selectClassName?: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Props for `Select`. All native `<select>` props are supported and spread
|
|
74
|
-
* onto the `<select>` (which also receives `ref`), except `className` and
|
|
75
|
-
* `style`, which go on the wrapper.
|
|
76
|
-
*/
|
|
77
|
-
export interface SelectProps extends SelectOwnProps, Omit<ComponentPropsWithRef<"select">, keyof SelectOwnProps> {
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Styled native `<select>`. Keeps the browser's keyboard model, mobile
|
|
81
|
-
* pickers, autofill, and form submission, and matches the Input and Textarea
|
|
82
|
-
* look. Works standalone or inside a `Field`, which wires its id, label,
|
|
83
|
-
* description, error, required, disabled, and size.
|
|
84
|
-
*/
|
|
85
|
-
export declare function Select({ size: sizeProp, variant, radius, invalid: invalidProp, readOnly: readOnlyProp, placeholder, options, children, startIcon, multiple, htmlSize, value: valueProp, defaultValue, onValueChange, fullWidth, className, selectClassName, style, id: idProp, required: requiredProp, disabled: disabledProp, onChange, "aria-describedby": describedBy, ...rest }: SelectProps): import("react").JSX.Element;
|
|
86
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_root_18qoz_5`,t=`_fullWidth_18qoz_39`,n=`_sm_18qoz_51`,r=`_md_18qoz_65`,i=`_lg_18qoz_75`,a=`_radiusNone_18qoz_87`,o=`_radiusXs_18qoz_89`,s=`_radiusSm_18qoz_91`,c=`_radiusMd_18qoz_93`,l=`_radiusLg_18qoz_95`,u=`_radiusXl_18qoz_97`,d=`_radius2xl_18qoz_99`,f=`_radiusPill_18qoz_101`,p=`_select_18qoz_107`,m=`_outline_18qoz_231`,h=`_filled_18qoz_241`,g=`_invalid_18qoz_291`,_=`_disabled_18qoz_309`,v=`_chevron_18qoz_335`,y=`_startIcon_18qoz_337`,b=`_hasStartIcon_18qoz_391`,x=`_list_18qoz_419`,S={root:e,fullWidth:t,sm:n,md:r,lg:i,radiusNone:a,radiusXs:o,radiusSm:s,radiusMd:c,radiusLg:l,radiusXl:u,radius2xl:d,radiusPill:f,select:p,outline:m,filled:h,invalid:g,disabled:_,chevron:v,startIcon:y,hasStartIcon:b,list:x};exports.chevron=v,exports.default=S,exports.disabled=_,exports.filled=h,exports.fullWidth=t,exports.hasStartIcon=b,exports.invalid=g,exports.lg=i,exports.list=x,exports.md=r,exports.outline=m,exports.radius2xl=d,exports.radiusLg=l,exports.radiusMd=c,exports.radiusNone=a,exports.radiusPill=f,exports.radiusSm=s,exports.radiusXl=u,exports.radiusXs=o,exports.root=e,exports.select=p,exports.sm=n,exports.startIcon=y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../Field/FieldContext.cjs.js"),i=require("./Slider.module.css.cjs.js");let a=require("react"),o=require("react/jsx-runtime");var ee={sm:i.default.sizeSm,md:i.default.sizeMd,lg:i.default.sizeLg},te={neutral:i.default.toneNeutral,primary:i.default.tonePrimary,accent:i.default.toneAccent,success:i.default.toneSuccess,warning:i.default.toneWarning,danger:i.default.toneDanger,info:i.default.toneInfo},ne=100,s=(e,t,n)=>Math.min(n,Math.max(t,e)),c=e=>{let t=String(e);if(t.includes(`e-`))return Number(t.split(`e-`)[1]);let n=t.indexOf(`.`);return n===-1?0:t.length-n-1};function re(e,t,n,r){let i=t+Math.round((e-t)/n)*n;return Number(i.toFixed(r))}var ie=(e,t,n)=>n>t?(s(e,t,n)-t)/(n-t)*100:0;function l(l){let{value:u,defaultValue:d,onValueChange:ae,onValueCommit:f,min:p=0,max:m=100,step:h=1,largeStep:g,orientation:_=`horizontal`,size:oe,tone:se=`primary`,disabled:ce,readOnly:le,invalid:ue,inverted:v=!1,minStepsBetweenThumbs:de=0,marks:y,showValue:b=`never`,formatValue:x,getAriaValueText:S,name:C,thumbLabels:fe,"aria-label":pe,"aria-labelledby":me,"aria-describedby":he,id:ge,className:_e,style:ve,onPointerEnter:ye,...be}=l,xe=r.useFieldContext(),w=r.useFieldControl({id:ge,invalid:ue,disabled:ce,readOnly:le,size:oe,"aria-describedby":he},{nativeRequired:!1}),{disabled:T,readOnly:E,invalid:D}=w,Se=w.size??`md`,O=!T&&!E,k=h>0?h:1,A=g&&g>0?g:k*10,j=c(k)+Math.max(0,c(p)-c(k)),M=Math.max(0,de)*k,[N,P]=e.useControllableState({value:u,defaultValue:d??p,onChange:ae});t.useFormReset(()=>R.current,()=>P(d??p),u===void 0);let F=Array.isArray(N),I=F?[s(N[0],p,m),s(N[1],p,m)]:[s(N,p,m)],L=(0,a.useRef)(I);L.current=I;let R=(0,a.useRef)(null),Ce=(0,a.useRef)(null),we=(0,a.useRef)([]),[z,B]=(0,a.useState)(null),[V,Te]=(0,a.useState)(!1),[Ee,H]=(0,a.useState)(!1),U=(0,a.useRef)(!1),De=(0,a.useId)(),Oe=e=>e===0&&w.id?w.id:`${De}-thumb-${e}`,W=(0,a.useCallback)((e,t)=>t.length<2?[p,m]:e===0?[p,Math.max(p,t[1]-M)]:[Math.min(m,t[0]+M),m],[p,m,M]),G=e=>e.length===2?[e[0],e[1]]:e[0],K=(0,a.useCallback)((e,t)=>{let n=L.current,[r,i]=W(e,n),a=s(re(s(t,p,m),p,k,j),r,i);if(a===n[e])return;let o=[...n];o[e]=a,L.current=o,H(!1),P(G(o))},[W,p,m,k,j,P]),ke=()=>_===`horizontal`&&!!R.current&&getComputedStyle(R.current).direction===`rtl`,Ae=(e,t)=>{let n=Ce.current;if(!n)return p;let r=n.getBoundingClientRect(),i=_===`horizontal`?r.width>0?(e-r.left)/r.width:0:r.height>0?(r.bottom-t)/r.height:0;return ke()&&(i=1-i),v&&(i=1-i),p+s(i,0,1)*(m-p)},je=e=>{let t=L.current;if(t.length<2)return 0;let n=Math.abs(e-t[0]),r=Math.abs(e-t[1]);return n===r?+(e>t[0]):n<r?0:1},Me=e=>{if(!O||e.button!==0)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`)?.dataset.markValue,n=t===void 0?Ae(e.clientX,e.clientY):Number(t),r=je(n);B(r),Te(!0),e.currentTarget.setPointerCapture(e.pointerId),we.current[r]?.focus({preventScroll:!0}),K(r,n)},Ne=e=>{V&&z!==null&&K(z,Ae(e.clientX,e.clientY))},q=e=>{V&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Te(!1),B(null),f?.(G(L.current)))},Pe=e=>t=>{if(t.key===`Escape`&&b===`hover`){H(!0);return}if(!O)return;let n=L.current[e],r=t.shiftKey?A:k,i=_===`horizontal`&&ke()!==v,a=_===`vertical`&&v,o=null;switch(t.key){case`ArrowRight`:o=n+(i?-r:r);break;case`ArrowLeft`:o=n-(i?-r:r);break;case`ArrowUp`:o=n+(a?-r:r);break;case`ArrowDown`:o=n-(a?-r:r);break;case`PageUp`:o=n+A;break;case`PageDown`:o=n-A;break;case`Home`:o=p;break;case`End`:o=m;break;default:return}t.preventDefault(),U.current=!0,K(e,o)},Fe=()=>{U.current&&(U.current=!1,f?.(G(L.current)))},J=(0,a.useMemo)(()=>{if(!y)return[];if(Array.isArray(y))return y.filter(e=>e.value>=p&&e.value<=m);let e=Math.floor((m-p)/k);return e>ne?[]:Array.from({length:e+1},(e,t)=>({value:Number((p+t*k).toFixed(j))}))},[y,p,m,k,j]),Ie=J.some(e=>e.label),Y=e=>{let t=ie(e,p,m);return v?100-t:t},X=_===`horizontal`?`insetInlineStart`:`insetBlockEnd`,Le=_===`horizontal`?`inlineSize`:`blockSize`,Re=Y(F?I[0]:p),ze=Y(F?I[1]:I[0]),Z=Math.min(Re,ze),Q=Math.max(Re,ze),Be=e=>{let t=Y(e);return t>=Z&&t<=Q},Ve={[X]:`${Z}%`,[Le]:`${Q-Z}%`},$=me??xe?.labelId,He=e=>x?x(e):String(e),Ue=(e,t)=>S?S(e,t):x?x(e):void 0,We=D?`danger`:se;return(0,o.jsxs)(`div`,{...be,ref:e=>{R.current=e;let{ref:t}=l;if(typeof t==`function`)return t(e);t&&(t.current=e)},role:F?`group`:void 0,"aria-labelledby":F?$:void 0,"aria-label":F&&!$?pe:void 0,className:n.cx(i.default.root,ee[Se],te[We],_===`vertical`?i.default.vertical:i.default.horizontal,_e),style:ve,"data-orientation":_,"data-disabled":T||void 0,"aria-disabled":T||void 0,"data-readonly":E||void 0,"data-invalid":D||void 0,"data-dragging":V||void 0,"data-show-value":b,"data-bubble-dismissed":Ee||void 0,onPointerEnter:e=>{H(!1),ye?.(e)},children:[(0,o.jsxs)(`div`,{className:i.default.control,onPointerDown:Me,onPointerMove:Ne,onPointerUp:q,onPointerCancel:q,onLostPointerCapture:e=>{V&&q(e)},children:[(0,o.jsxs)(`div`,{ref:Ce,className:i.default.rail,children:[(0,o.jsx)(`div`,{className:i.default.track,"aria-hidden":`true`,children:(0,o.jsx)(`div`,{className:i.default.range,style:Ve})}),J.map(e=>(0,o.jsx)(`span`,{className:i.default.tick,"data-in-range":Be(e.value)||void 0,style:{[X]:`${Y(e.value)}%`},"aria-hidden":`true`},`tick-${e.value}`)),I.map((e,t)=>{let[n,r]=W(t,I),a=fe?.[t];return(0,o.jsxs)(`span`,{ref:e=>{we.current[t]=e},id:Oe(t),role:`slider`,tabIndex:T?-1:0,className:i.default.thumb,style:{[X]:`${Y(e)}%`},"data-active":z===t||void 0,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":e,"aria-valuetext":Ue(e,t),"aria-orientation":_,"aria-disabled":T||void 0,"aria-readonly":E||void 0,"aria-label":a??($?void 0:pe),"aria-labelledby":a?void 0:$,...w.ariaProps,"aria-required":void 0,onKeyDown:Pe(t),onKeyUp:Fe,onFocus:()=>H(!1),children:[(0,o.jsx)(`span`,{className:i.default.knob,"aria-hidden":`true`}),b!==`never`&&(0,o.jsx)(`span`,{className:i.default.bubble,"aria-hidden":`true`,children:He(e)})]},t)})]}),Ie&&(0,o.jsx)(`div`,{className:i.default.marks,"aria-hidden":`true`,children:J.filter(e=>e.label).map(e=>(0,o.jsx)(`span`,{className:i.default.markAnchor,style:{[X]:`${Y(e.value)}%`},children:(0,o.jsx)(`span`,{className:i.default.markLabel,"data-mark-value":e.value,children:e.label})},`label-${e.value}`))})]}),C&&I.map((e,t)=>(0,o.jsx)(`input`,{type:`hidden`,name:C,value:e,disabled:T},t))]})}exports.Slider=l;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import { Orientation, Size, Tone } from '../../../types/common';
|
|
3
|
-
/** A single value, or a `[start, end]` pair for a range slider. */
|
|
4
|
-
export type SliderValue = number | [number, number];
|
|
5
|
-
/** A labelled (or unlabelled) tick rendered under the track. */
|
|
6
|
-
export interface SliderMark {
|
|
7
|
-
/** Position of the mark, between `min` and `max`. */
|
|
8
|
-
value: number;
|
|
9
|
-
/** Optional visible label, rendered under the track in muted text. */
|
|
10
|
-
label?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* When the value bubble above each thumb is visible.
|
|
14
|
-
* - `never`: no bubble (default).
|
|
15
|
-
* - `hover`: while the thumb is hovered, focused, or dragged. Press Escape to hide it.
|
|
16
|
-
* - `always`: always visible.
|
|
17
|
-
*/
|
|
18
|
-
export type SliderShowValue = "never" | "hover" | "always";
|
|
19
|
-
type SliderOwnProps<T extends SliderValue> = {
|
|
20
|
-
/** Controlled value. A number for one thumb, or `[start, end]` for a range. */
|
|
21
|
-
value?: T;
|
|
22
|
-
/** Initial value when uncontrolled. Pass a `[start, end]` pair for a range. Defaults to `min`. */
|
|
23
|
-
defaultValue?: T;
|
|
24
|
-
/** Called with the next value on every change (drag, click, key press). */
|
|
25
|
-
onValueChange?: (value: T) => void;
|
|
26
|
-
/** Called once an interaction ends: on pointer up and on key up. Use it for expensive work (fetching, saving). */
|
|
27
|
-
onValueCommit?: (value: T) => void;
|
|
28
|
-
/** Lowest value. Default `0`. */
|
|
29
|
-
min?: number;
|
|
30
|
-
/** Highest value. Default `100`. */
|
|
31
|
-
max?: number;
|
|
32
|
-
/** Granularity of the value. Every value snaps to `min + n * step`. Default `1`. */
|
|
33
|
-
step?: number;
|
|
34
|
-
/** Jump used by PageUp / PageDown and Shift + Arrow. Defaults to `10 * step`. */
|
|
35
|
-
largeStep?: number;
|
|
36
|
-
/** Horizontal (default) or vertical. A vertical slider fills its height; give it one with `style` or a parent (default 12rem). */
|
|
37
|
-
orientation?: Orientation;
|
|
38
|
-
/** Track thickness and thumb size. Every size keeps a 24px pointer target. Default `md` (or the Field's size). */
|
|
39
|
-
size?: Size;
|
|
40
|
-
/** Semantic color of the fill and thumb border. Default `primary`. Ignored while `invalid` (danger is used). */
|
|
41
|
-
tone?: Tone;
|
|
42
|
-
/** Disables every thumb. Picked up from a surrounding Field. */
|
|
43
|
-
disabled?: boolean;
|
|
44
|
-
/** Thumbs stay focusable and announce their value, but the value can't change. */
|
|
45
|
-
readOnly?: boolean;
|
|
46
|
-
/** Marks the slider invalid: danger styling and `aria-invalid`. Picked up from a surrounding Field. */
|
|
47
|
-
invalid?: boolean;
|
|
48
|
-
/** Flips the direction: max sits at the inline start (horizontal) or the bottom (vertical). Arrow keys follow what you see. */
|
|
49
|
-
inverted?: boolean;
|
|
50
|
-
/** Range only: the minimum number of steps kept between the two thumbs. Default `0` (thumbs may meet but never cross). */
|
|
51
|
-
minStepsBetweenThumbs?: number;
|
|
52
|
-
/** Ticks under the track: `true` for one per step, or a list of `{ value, label? }`. */
|
|
53
|
-
marks?: boolean | SliderMark[];
|
|
54
|
-
/** When to show the value bubble above each thumb. Default `never`. */
|
|
55
|
-
showValue?: SliderShowValue;
|
|
56
|
-
/** Formats a value for the bubble and for `aria-valuetext` (e.g. currency or percent). */
|
|
57
|
-
formatValue?: (value: number) => string;
|
|
58
|
-
/** Custom `aria-valuetext` per thumb. Wins over `formatValue` for assistive tech. */
|
|
59
|
-
getAriaValueText?: (value: number, thumbIndex: number) => string;
|
|
60
|
-
/** Form field name. Renders one `<input type="hidden">` per thumb (a range submits the name twice; read it with `FormData.getAll`). */
|
|
61
|
-
name?: string;
|
|
62
|
-
/** Accessible names for each thumb, e.g. `["Minimum price", "Maximum price"]`. Recommended for ranges. */
|
|
63
|
-
thumbLabels?: string[];
|
|
64
|
-
/** Accessible name for the thumb(s) when there is no visible label. Applied to the thumbs, not the wrapper. */
|
|
65
|
-
"aria-label"?: string;
|
|
66
|
-
/** id(s) of the visible label. Applied to the thumbs (and the range group). Inside a Field, the Field's label is used. */
|
|
67
|
-
"aria-labelledby"?: string;
|
|
68
|
-
};
|
|
69
|
-
/** Props for `Slider`. Other props are spread onto the root `div`. */
|
|
70
|
-
export type SliderProps<T extends SliderValue = number> = SliderOwnProps<T> & Omit<ComponentPropsWithRef<"div">, keyof SliderOwnProps<T> | "onChange" | "children">;
|
|
71
|
-
/**
|
|
72
|
-
* Pick a number, or a `[start, end]` range, on a pill track. Follows the
|
|
73
|
-
* WAI-ARIA APG Slider and Multi-Thumb Slider patterns: every thumb is a
|
|
74
|
-
* focusable `role="slider"` with `aria-valuemin/max/now/text`.
|
|
75
|
-
*
|
|
76
|
-
* Operable without dragging (WCAG 2.5.7): click or tap anywhere on the track
|
|
77
|
-
* to move the nearest thumb there, or use the keyboard (Arrows, PageUp /
|
|
78
|
-
* PageDown, Home / End). Dragging with a mouse, pen, or finger also works.
|
|
79
|
-
*
|
|
80
|
-
* Inside a `Field`, the Field's label names the thumb, and its hint, error,
|
|
81
|
-
* invalid, and disabled state are wired automatically.
|
|
82
|
-
*/
|
|
83
|
-
export declare function Slider<T extends SliderValue = number>(props: SliderProps<T>): import("react").JSX.Element;
|
|
84
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_tonePrimary_dj5ma_27`,t=`_toneNeutral_dj5ma_37`,n=`_toneAccent_dj5ma_47`,r=`_toneSuccess_dj5ma_57`,i=`_toneWarning_dj5ma_67`,a=`_toneDanger_dj5ma_77`,o=`_toneInfo_dj5ma_87`,s=`_sizeSm_dj5ma_101`,c=`_sizeMd_dj5ma_113`,l=`_sizeLg_dj5ma_125`,u=`_root_dj5ma_145`,d=`_horizontal_dj5ma_159`,f=`_vertical_dj5ma_169`,p=`_control_dj5ma_179`,m=`_rail_dj5ma_219`,h=`_track_dj5ma_245`,g=`_range_dj5ma_287`,_=`_tick_dj5ma_319`,v=`_thumb_dj5ma_373`,y=`_knob_dj5ma_461`,b=`_bubble_dj5ma_521`,x=`_marks_dj5ma_687`,S=`_markAnchor_dj5ma_725`,C=`_markLabel_dj5ma_745`,w={tonePrimary:e,toneNeutral:t,toneAccent:n,toneSuccess:r,toneWarning:i,toneDanger:a,toneInfo:o,sizeSm:s,sizeMd:c,sizeLg:l,root:u,horizontal:d,vertical:f,control:p,rail:m,track:h,range:g,tick:_,thumb:v,knob:y,bubble:b,marks:x,markAnchor:S,markLabel:C};exports.bubble=b,exports.control=p,exports.default=w,exports.horizontal=d,exports.knob=y,exports.markAnchor=S,exports.markLabel=C,exports.marks=x,exports.rail=m,exports.range=g,exports.root=u,exports.sizeLg=l,exports.sizeMd=c,exports.sizeSm=s,exports.thumb=v,exports.tick=_,exports.toneAccent=n,exports.toneDanger=a,exports.toneInfo=o,exports.toneNeutral=t,exports.tonePrimary=e,exports.toneSuccess=r,exports.toneWarning=i,exports.track=h,exports.vertical=f;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),ee=require("../../primitives/Icon/icons.cjs.js"),i=require("../Field/FieldContext.cjs.js"),a=require("./Switch.module.css.cjs.js"),o=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let s=require("react"),c=require("react/jsx-runtime");var l={sm:a.default.sm,md:a.default.md,lg:a.default.lg},u={neutral:a.default.neutral,primary:a.default.primary,accent:a.default.accent,success:a.default.success,warning:a.default.warning,danger:a.default.danger,info:a.default.info},d={start:a.default.start,end:a.default.end,between:a.default.between};function f({checked:f,defaultChecked:p=!1,onCheckedChange:m,label:h,description:g,labelPosition:_=`end`,size:v,tone:y=`primary`,invalid:b,disabled:x,required:S,readOnly:C,thumbIcon:w,showStateLabels:T=!1,stateLabels:te,loading:E=!1,loadingLabel:D,className:O,style:k,id:A,onChange:j,"aria-describedby":M,"aria-labelledby":N,"aria-label":P,ref:F,...I}){let L=o.useMessages(),R=te??{on:L.switch.on,off:L.switch.off},z=D??L.switch.saving,B=(0,s.useId)(),V=`${B}-label`,H=`${B}-description`,U=`${B}-loading`,W=h!=null&&h!==!1,G=g!=null&&g!==!1,K=i.useFieldControl({id:A,invalid:b,required:S,disabled:x,readOnly:C,size:v,"aria-describedby":[M,G&&H,E&&U].filter(Boolean).join(` `)||void 0}),q=K.size??`md`,J=i.useFieldContext(),Y=N??(W?V:P===void 0&&J&&!J.isGroup?J.labelId:void 0),[X,Z]=e.useControllableState({value:f,defaultValue:p,onChange:m});t.useFormReset(()=>K.id?document.getElementById(K.id):null,()=>Z(p??!1),f===void 0);let ne=K.readOnly||E,re=e=>{ne||(Z(e.target.checked),j?.(e))},ie=(0,c.jsxs)(`span`,{className:a.default.control,children:[(0,c.jsx)(`input`,{...I,...K.ariaProps,ref:F,id:K.id,type:`checkbox`,role:`switch`,className:a.default.input,checked:X,onChange:re,disabled:K.disabled,required:K.required,"aria-label":P,"aria-labelledby":Y,"aria-readonly":K.readOnly||void 0,"aria-busy":E||void 0}),(0,c.jsx)(`span`,{className:a.default.track,"aria-hidden":`true`,children:(0,c.jsx)(`span`,{className:a.default.thumb,children:E?(0,c.jsx)(ee.LoaderIcon,{spin:!0,className:a.default.thumbIcon}):w&&(0,c.jsx)(`span`,{className:a.default.thumbIcon,children:X?w.on:w.off})})}),T&&(0,c.jsxs)(`span`,{className:a.default.stateLabels,"aria-hidden":`true`,children:[(0,c.jsx)(`span`,{className:a.default.stateOn,children:R.on}),(0,c.jsx)(`span`,{className:a.default.stateOff,children:R.off})]})]}),Q=W||G?(0,c.jsxs)(`span`,{className:a.default.text,children:[W&&(0,c.jsx)(`span`,{id:V,className:a.default.label,children:h}),G&&(0,c.jsx)(`span`,{id:H,className:a.default.description,children:g})]}):null,$=_!==`end`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`label`,{className:n.cx(a.default.root,l[q],u[y],d[_],O),style:k,"data-checked":X||void 0,"data-disabled":K.disabled||void 0,"data-invalid":K.invalid||void 0,"data-readonly":K.readOnly||void 0,"data-loading":E||void 0,children:[$&&Q,ie,!$&&Q,E&&(0,c.jsx)(`span`,{id:U,hidden:!0,children:z})]}),(0,c.jsx)(r.VisuallyHidden,{role:`status`,children:E?z:``})]})}exports.Switch=f;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import { Size, Tone } from '../../../types/common';
|
|
3
|
-
/**
|
|
4
|
-
* Where the label sits relative to the switch.
|
|
5
|
-
* - `end`: switch first, label after it (default).
|
|
6
|
-
* - `start`: label first, switch after it.
|
|
7
|
-
* - `between`: label at the start and switch at the end of a full-width row (settings lists).
|
|
8
|
-
*/
|
|
9
|
-
export type SwitchLabelPosition = "start" | "end" | "between";
|
|
10
|
-
/** Content for the on and off states (thumb icons, state labels). */
|
|
11
|
-
export interface SwitchStateContent {
|
|
12
|
-
/** Shown while the switch is on. */
|
|
13
|
-
on: ReactNode;
|
|
14
|
-
/** Shown while the switch is off. */
|
|
15
|
-
off: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export interface SwitchProps extends Omit<ComponentPropsWithRef<"input">, "type" | "size" | "role" | "checked" | "defaultChecked" | "children"> {
|
|
18
|
-
/** Whether the switch is on (controlled). */
|
|
19
|
-
checked?: boolean;
|
|
20
|
-
/** Initial on state when uncontrolled. */
|
|
21
|
-
defaultChecked?: boolean;
|
|
22
|
-
/** Called with the next on state whenever the user toggles the switch. */
|
|
23
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Visible label. The whole label is clickable. When omitted, give the switch
|
|
26
|
-
* a name with `aria-label`, `aria-labelledby`, or a surrounding `Field`.
|
|
27
|
-
*/
|
|
28
|
-
label?: ReactNode;
|
|
29
|
-
/** Supporting text under the label, linked with `aria-describedby`. */
|
|
30
|
-
description?: ReactNode;
|
|
31
|
-
/** Where the label sits relative to the switch. `between` fills the row and pushes them apart. */
|
|
32
|
-
labelPosition?: SwitchLabelPosition;
|
|
33
|
-
/** Track, thumb, and label size. Defaults to the surrounding Field's size, then `md`. */
|
|
34
|
-
size?: Size;
|
|
35
|
-
/** Track color while on. */
|
|
36
|
-
tone?: Tone;
|
|
37
|
-
/** Marks the switch invalid (`aria-invalid` and a danger border). Inherited from Field. */
|
|
38
|
-
invalid?: boolean;
|
|
39
|
-
/** Disables the switch. Inherited from Field. */
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
/** Marks the switch as required for form submission. Inherited from Field. */
|
|
42
|
-
required?: boolean;
|
|
43
|
-
/** Keeps the switch focusable and announced, but blocks toggling (`aria-readonly`). Inherited from Field. */
|
|
44
|
-
readOnly?: boolean;
|
|
45
|
-
/** Decorative icons shown inside the thumb for each state, e.g. `{ on: <CheckIcon />, off: <CloseIcon /> }`. */
|
|
46
|
-
thumbIcon?: Partial<SwitchStateContent>;
|
|
47
|
-
/** Shows visible state text next to the track, so the state doesn't rely on color or position alone. */
|
|
48
|
-
showStateLabels?: boolean;
|
|
49
|
-
/** Text for `showStateLabels`. Defaults to "On" and "Off". */
|
|
50
|
-
stateLabels?: SwitchStateContent;
|
|
51
|
-
/** Shows a spinner in the thumb, sets `aria-busy`, and blocks toggling while a change is saved. */
|
|
52
|
-
loading?: boolean;
|
|
53
|
-
/** Screen-reader text added to the description while `loading`. Defaults to "Saving". */
|
|
54
|
-
loadingLabel?: string;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* An on/off toggle for settings that take effect immediately. Renders a
|
|
58
|
-
* native `<input type="checkbox" role="switch">` under a pill track, so Space
|
|
59
|
-
* toggles it, forms submit it, and screen readers announce "on" or "off".
|
|
60
|
-
* Works standalone or inside a `Field`.
|
|
61
|
-
*/
|
|
62
|
-
export declare function Switch({ checked: checkedProp, defaultChecked, onCheckedChange, label, description, labelPosition, size: sizeProp, tone, invalid: invalidProp, disabled: disabledProp, required: requiredProp, readOnly: readOnlyProp, thumbIcon, showStateLabels, stateLabels: stateLabelsProp, loading, loadingLabel: loadingLabelProp, className, style, id: idProp, onChange, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, ref, ...inputProps }: SwitchProps): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_root_1lkta_29`,t=`_sm_1lkta_113`,n=`_md_1lkta_129`,r=`_lg_1lkta_145`,i=`_neutral_1lkta_169`,a=`_primary_1lkta_185`,o=`_accent_1lkta_201`,s=`_success_1lkta_217`,c=`_warning_1lkta_233`,l=`_danger_1lkta_249`,u=`_info_1lkta_265`,d=`_end_1lkta_303`,f=`_start_1lkta_305`,p=`_between_1lkta_315`,m=`_control_1lkta_333`,h=`_input_1lkta_353`,g=`_track_1lkta_379`,_=`_thumb_1lkta_409`,v=`_thumbIcon_1lkta_473`,y=`_stateLabels_1lkta_501`,b=`_stateOn_1lkta_523`,x=`_stateOff_1lkta_525`,S=`_text_1lkta_555`,C=`_label_1lkta_579`,w=`_description_1lkta_589`,T={root:e,sm:t,md:n,lg:r,neutral:i,primary:a,accent:o,success:s,warning:c,danger:l,info:u,end:d,start:f,between:p,control:m,input:h,track:g,thumb:_,thumbIcon:v,stateLabels:y,stateOn:b,stateOff:x,text:S,label:C,description:w};exports.accent=o,exports.between=p,exports.control=m,exports.danger=l,exports.default=T,exports.description=w,exports.end=d,exports.info=u,exports.input=h,exports.label=C,exports.lg=r,exports.md=n,exports.neutral=i,exports.primary=a,exports.root=e,exports.sm=t,exports.start=f,exports.stateLabels=y,exports.stateOff=x,exports.stateOn=b,exports.success=s,exports.text=S,exports.thumb=_,exports.thumbIcon=v,exports.track=g,exports.warning=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../utils/cx.cjs.js"),n=require("../../../utils/refs.cjs.js"),r=require("../../data-display/Chip/Chip.cjs.js"),i=require("../../primitives/Icon/icons.cjs.js"),a=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),o=require("../Field/FieldContext.cjs.js"),s=require("./TagInput.module.css.cjs.js"),c=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let l=require("react"),u=require("react/jsx-runtime");var ee={sm:`sm`,md:`md`,lg:`lg`},te={sm:s.default.sm,md:s.default.md,lg:s.default.lg},d=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function f(e,t){return{",":t.comma,";":t.semicolon," ":t.space,"|":t.pipe," ":t.tab}[e]??t.other(e)}function ne(e,t,n,r){let i=[n.keys.enter,...t?[n.keys.tab]:[],...e.map(e=>f(e,n.keys))],a=Intl.ListFormat,o=a?new a(r,{type:`disjunction`}).format(i):i.join(`, `);return n.instructions(o)}var p=({value:f,defaultValue:p,onValueChange:re,inputValue:ie,defaultInputValue:m,onInputValueChange:ae,delimiters:h=[`,`],addOnTab:g=!1,addOnBlur:oe=!1,allowDuplicates:se=!1,maxTags:_,validate:ce,transform:le,size:ue,disabled:de,readOnly:fe,invalid:pe,required:me,placeholder:he,name:ge,chipVariant:_e,chipTone:ve,removeLabel:ye,tagListLabel:be,instructions:xe,messages:Se,className:Ce,inputClassName:we,style:Te,ref:v,id:Ee,onChange:De,onKeyDown:Oe,onPaste:ke,onBlur:Ae,form:y,"aria-describedby":je,"aria-labelledby":b,...x})=>{let{messages:S,locale:Me}=c.useLocale(),Ne=ye??S.tagInput.remove,C={...S.tagInput,...Se},w=(0,l.useId)(),T=`${w}-instructions`,E=`${w}-error`,D=`${w}-max`,O=o.useFieldContext(),[k,A]=e.useControllableState({value:f,defaultValue:p??[],onChange:re}),[j,M]=e.useControllableState({value:ie,defaultValue:m??``,onChange:ae}),[N,P]=(0,l.useState)(null),[Pe,F]=(0,l.useState)(null),[I,L]=(0,l.useState)(null),[R,Fe]=(0,l.useState)({text:``,n:0}),z=_!==void 0&&k.length>=_,Ie=[je,T,z?D:void 0,N?E:void 0].filter(Boolean).join(` `)||void 0,B=o.useFieldControl({id:Ee,invalid:pe,required:me,disabled:de,readOnly:fe,size:ue,"aria-describedby":Ie},{nativeRequired:!1}),V=B.size??`md`,Le=B.invalid||N!==null,H=!B.disabled&&!B.readOnly,U=(0,l.useRef)(null),W=(0,l.useRef)(null),Re=(0,l.useRef)([]),G=(0,l.useRef)(null),K=(0,l.useRef)(void 0),ze=(0,l.useCallback)(e=>{U.current=e,n.assignRef(v,e)},[v]);(0,l.useEffect)(()=>()=>window.clearTimeout(K.current),[]);let Be=e=>{e&&Fe(t=>({text:e,n:t.n+1}))},[Ve,He]=(0,l.useState)(0),q=()=>U.current?.focus(),J=e=>{let t=Re.current[e]?.querySelector(`button:not(:disabled)`);return t?(t.focus(),!0):!1};(0,l.useLayoutEffect)(()=>{let e=G.current;e!==null&&(G.current=null,e<k.length&&J(e)||q())}),(0,l.useEffect)(()=>{let e=U.current;e&&e.setCustomValidity(B.required&&k.length===0?C.required:``)});let Ue=(0,l.useRef)(p??[]),We=(0,l.useRef)(m??``);(0,l.useEffect)(()=>{let e=U.current?.form??W.current?.closest(`form`);if(!e)return;let t=()=>{A(Ue.current),M(We.current),P(null)};return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[A,M]);let Y=h.length>0?new RegExp(h.map(d).join(`|`)):null,Ge=new RegExp([...h.map(d),`\\r?\\n`,`\\t`].join(`|`)),X=e=>{let t=[...k],n=[],r=[],i=[],a=null,o=!1;for(let s of e){let e=s.trim();if(!e)continue;let c=(le?le(e):e).trim();if(c){if(_!==void 0&&t.length>=_)o=!0;else if(!se&&t.includes(c))r.push(c);else{if(ce){let t=ce(c);if(t!==!0){a??=typeof t==`string`&&t?t:C.invalid(c),i.push(e);continue}}t.push(c),n.push(c)}}}n.length>0&&A(t),P(a),r.length>0&&(window.clearTimeout(K.current),F(r[0]),L(C.duplicate(r[0])),K.current=window.setTimeout(()=>F(null),1200));let s=_!==void 0&&t.length>=_&&n.length>0,c=[n.length>0?C.added(n):null,...r.map(C.duplicate),a,o||s?C.maxReached(_):null].filter(Boolean);return Be(c.join(`. `)),{rejected:i,added:n.length>0}},Ke=e=>{let t=k[e];t!==void 0&&H&&(G.current=e,A(k.filter((t,n)=>n!==e)),P(null),Be(C.removed(t)))},Z=(e,t=``)=>{let n=h[0],r=n===void 0||n.trim()===``?` `:`${n} `;return[...e,t].filter(Boolean).join(r)},Q=()=>{let e=X([j]);return M(e.rejected.length>0?j:``),e},qe=e=>{De?.(e),I&&L(null);let t=e.target.value;if(Y&&Y.test(t)){let e=t.split(Y),n=e.pop()??``,r=X(e);M(Z(r.rejected,n))}else N&&P(null),M(t)},Je=e=>{if(ke?.(e),e.defaultPrevented)return;let t=e.clipboardData.getData(`text`);if(!Ge.test(t))return;e.preventDefault();let n=e.currentTarget,r=n.selectionStart??j.length,i=n.selectionEnd??j.length,a=j.slice(0,r)+t+j.slice(i),o=X(a.split(Ge));M(Z(o.rejected))},Ye=()=>W.current?getComputedStyle(W.current).direction===`rtl`:!1,Xe=e=>{if(Oe?.(e),e.defaultPrevented||e.nativeEvent.isComposing)return;let t=e.currentTarget,n=t.selectionStart===0&&t.selectionEnd===0,r=Ye()?`ArrowRight`:`ArrowLeft`;switch(e.key){case`Enter`:if(e.repeat){e.preventDefault();return}if(!j.trim())return;e.preventDefault(),Q();return;case`Tab`:{if(!g||e.shiftKey||!j.trim())return;let t=Q();t.added&&t.rejected.length===0&&e.preventDefault();return}case`Backspace`:if(e.repeat||j!==``||k.length===0)return;J(k.length-1)&&e.preventDefault();return;case r:if(!n||k.length===0||e.shiftKey)return;J(k.length-1)&&e.preventDefault();return;default:return}},Ze=e=>{Ae?.(e),oe&&j.trim()&&Q()},Qe=(e,t)=>{let n=Ye(),r=n?`ArrowRight`:`ArrowLeft`,i=n?`ArrowLeft`:`ArrowRight`,a=!0;switch(e.key){case r:t>0&&J(t-1);break;case i:t<k.length-1&&J(t+1)||q();break;case`Home`:J(0);break;case`End`:q();break;default:a=!1}a&&e.preventDefault()},$e=e=>{let t=U.current;if(!t||B.disabled)return;let n=e.target;n===t||n.closest(`button, a, input, [tabindex]`)||(e.preventDefault(),t.focus())},$=be===void 0?b??(O&&!O.isGroup?O.labelId:void 0):void 0,et=be??($?void 0:S.tagInput.list),tt=xe??ne(h,g,S.tagInput,Me),nt=k.length===0&&!z;return(0,u.jsxs)(`div`,{ref:W,className:t.cx(s.default.root,Ce),style:Te,"data-size":V,children:[(0,u.jsxs)(`div`,{className:t.cx(s.default.box,te[V],k.length>0&&s.default.hasTags,Le&&s.default.invalid,B.disabled&&s.default.disabled,B.readOnly&&!B.disabled&&s.default.readOnly),onPointerDown:$e,children:[k.length>0&&(0,u.jsx)(`ul`,{className:s.default.list,"aria-labelledby":$,"aria-label":et,"aria-describedby":B.readOnly?B.ariaProps[`aria-describedby`]:void 0,children:k.map((e,t)=>(0,u.jsx)(`li`,{ref:e=>{Re.current[t]=e},className:s.default.item,"data-highlighted":Pe===e||void 0,onKeyDown:e=>Qe(e,t),onFocus:()=>He(t),children:(0,u.jsx)(r.Chip,{size:ee[V],variant:_e,tone:ve,disabled:B.disabled,onRemove:H?()=>Ke(t):void 0,removeLabel:H?Ne(e):void 0,removeTabIndex:t===Math.min(Ve,k.length-1)?0:-1,children:e})},`${e}-${t}`))}),B.readOnly&&!B.disabled?k.length===0&&(0,u.jsx)(`span`,{className:s.default.empty,children:C.empty}):(0,u.jsx)(`input`,{...x,ref:ze,id:B.id,type:`text`,form:y,value:j,placeholder:nt?he:void 0,disabled:B.disabled,readOnly:z,autoComplete:x.autoComplete??`off`,...B.ariaProps,"aria-labelledby":b,"aria-invalid":Le||void 0,"aria-errormessage":N?E:B.ariaProps[`aria-errormessage`],className:t.cx(s.default.input,we),onChange:qe,onKeyDown:Xe,onPaste:Je,onBlur:Ze})]}),N&&(0,u.jsxs)(`p`,{id:E,className:s.default.error,children:[(0,u.jsx)(i.ErrorIcon,{size:`sm`,className:s.default.errorIcon}),(0,u.jsx)(`span`,{children:N})]}),(0,u.jsx)(a.VisuallyHidden,{id:T,children:tt}),I&&(0,u.jsx)(`p`,{className:s.default.limit,children:I}),z&&(0,u.jsx)(`p`,{id:D,className:s.default.limit,children:C.maxReached(_)}),(0,u.jsxs)(a.VisuallyHidden,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[R.text,R.n%2==1?`\xA0`:``]}),ge!==void 0&&k.map((e,t)=>(0,u.jsx)(`input`,{type:`hidden`,name:ge,value:e,form:y,disabled:B.disabled},`${e}-${t}`))]})};exports.TagInput=p;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, Ref } from 'react';
|
|
2
|
-
import { Size, Tone } from '../../../types/common';
|
|
3
|
-
import { ChipVariant } from '../../data-display/Chip';
|
|
4
|
-
/**
|
|
5
|
-
* Text used for announcements and fallbacks. Override any of them to
|
|
6
|
-
* localize the component.
|
|
7
|
-
*/
|
|
8
|
-
export interface TagInputMessages {
|
|
9
|
-
/** Announced after one or more tags are added. @default "Added {tag}" / "Added 3 tags: a, b, c" */
|
|
10
|
-
added: (tags: string[]) => string;
|
|
11
|
-
/** Announced after a tag is removed. @default "Removed {tag}" */
|
|
12
|
-
removed: (tag: string) => string;
|
|
13
|
-
/** Announced (and shown as a brief highlight) when a duplicate is entered. @default "{tag} is already added" */
|
|
14
|
-
duplicate: (tag: string) => string;
|
|
15
|
-
/** Error shown when `validate` returns `false`. @default "\"{tag}\" is not valid" */
|
|
16
|
-
invalid: (tag: string) => string;
|
|
17
|
-
/** Announced and added to the input's description when `maxTags` is reached. @default "Maximum of {max} tags reached" */
|
|
18
|
-
maxReached: (max: number) => string;
|
|
19
|
-
/** Native validation message when `required` and there are no tags. @default "Add at least one tag." */
|
|
20
|
-
required: string;
|
|
21
|
-
/** Shown in read-only mode when there are no tags. @default "None" */
|
|
22
|
-
empty: string;
|
|
23
|
-
}
|
|
24
|
-
export interface TagInputProps extends Omit<ComponentPropsWithRef<"input">, "size" | "value" | "defaultValue" | "type" | "children"> {
|
|
25
|
-
/** The tags (controlled). */
|
|
26
|
-
value?: string[];
|
|
27
|
-
/** Initial tags when uncontrolled. @default [] */
|
|
28
|
-
defaultValue?: string[];
|
|
29
|
-
/** Called with the full array of tags after any add or remove. */
|
|
30
|
-
onValueChange?: (value: string[]) => void;
|
|
31
|
-
/** The text being typed (controlled). */
|
|
32
|
-
inputValue?: string;
|
|
33
|
-
/** Initial text when uncontrolled. @default "" */
|
|
34
|
-
defaultInputValue?: string;
|
|
35
|
-
/** Called with the text in the input whenever it changes. */
|
|
36
|
-
onInputValueChange?: (inputValue: string) => void;
|
|
37
|
-
/**
|
|
38
|
-
* Strings that end a tag as they are typed, in addition to Enter. Pasted
|
|
39
|
-
* text is also split on them (and on line breaks). @default [","]
|
|
40
|
-
*/
|
|
41
|
-
delimiters?: string[];
|
|
42
|
-
/**
|
|
43
|
-
* Tab adds the typed text as a tag (focus stays in the input). Tab still
|
|
44
|
-
* moves focus normally when the input is empty or the text is rejected,
|
|
45
|
-
* so it never traps the keyboard. @default false
|
|
46
|
-
*/
|
|
47
|
-
addOnTab?: boolean;
|
|
48
|
-
/** Add the typed text as a tag when the input loses focus. @default false */
|
|
49
|
-
addOnBlur?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Allow the same tag more than once. When `false`, entering an existing
|
|
52
|
-
* tag highlights it briefly and announces "{tag} is already added".
|
|
53
|
-
* Comparison is exact after `transform` (use `transform` to lowercase for
|
|
54
|
-
* case-insensitive tags). @default false
|
|
55
|
-
*/
|
|
56
|
-
allowDuplicates?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Maximum number of tags. When reached, the input becomes read-only, the
|
|
59
|
-
* placeholder hides, and "Maximum of N tags reached" is announced and
|
|
60
|
-
* added to the input's description.
|
|
61
|
-
*/
|
|
62
|
-
maxTags?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Checks a tag before it is added (after trimming and `transform`).
|
|
65
|
-
* Return `true` to accept, `false` to reject with a generic message, or a
|
|
66
|
-
* string to reject with that message. The message is shown under the
|
|
67
|
-
* field, linked with `aria-describedby`, and announced; the rejected text
|
|
68
|
-
* stays in the input so it can be fixed.
|
|
69
|
-
*/
|
|
70
|
-
validate?: (tag: string) => boolean | string;
|
|
71
|
-
/** Normalizes a tag before validation and duplicate checks (e.g. `(t) => t.toLowerCase()`). */
|
|
72
|
-
transform?: (tag: string) => string;
|
|
73
|
-
/** Field height, padding, and chip size. Inherits from a surrounding `Field`. @default "md" */
|
|
74
|
-
size?: Size;
|
|
75
|
-
/** Disables the input and every chip (no remove buttons). Inherits from a surrounding `Field`. @default false */
|
|
76
|
-
disabled?: boolean;
|
|
77
|
-
/** Shows the tags without remove buttons or a text input. Inherits from a surrounding `Field`. @default false */
|
|
78
|
-
readOnly?: boolean;
|
|
79
|
-
/** Danger border and `aria-invalid`. Inherits from a surrounding `Field`. @default false */
|
|
80
|
-
invalid?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Requires at least one tag. Sets `aria-required` on the input and a
|
|
83
|
-
* native validation message (`messages.required`) while there are no
|
|
84
|
-
* tags, so form submission is blocked. Inherits from a surrounding `Field`.
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
required?: boolean;
|
|
88
|
-
/** Placeholder for the text input, shown only while there are no tags. */
|
|
89
|
-
placeholder?: string;
|
|
90
|
-
/**
|
|
91
|
-
* Form field name. Renders one `<input type="hidden" name={name}>` per
|
|
92
|
-
* tag, so `formData.getAll(name)` returns the tags as an array.
|
|
93
|
-
*/
|
|
94
|
-
name?: string;
|
|
95
|
-
/** Chip variant for every tag. @default "soft" */
|
|
96
|
-
chipVariant?: ChipVariant;
|
|
97
|
-
/** Chip tone for every tag. @default "neutral" */
|
|
98
|
-
chipTone?: Tone;
|
|
99
|
-
/** Accessible name of each tag's remove button. @default (tag) => `Remove ${tag}` */
|
|
100
|
-
removeLabel?: (tag: string) => string;
|
|
101
|
-
/**
|
|
102
|
-
* Accessible name of the tag list. Defaults to the surrounding `Field`'s
|
|
103
|
-
* label (or the input's `aria-labelledby`), else "Tags".
|
|
104
|
-
*/
|
|
105
|
-
tagListLabel?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Visually hidden keyboard instructions, linked to the input with
|
|
108
|
-
* `aria-describedby`. Generated from `delimiters` and `addOnTab` by default.
|
|
109
|
-
*/
|
|
110
|
-
instructions?: string;
|
|
111
|
-
/** Override announcement and fallback text (for localization). */
|
|
112
|
-
messages?: Partial<TagInputMessages>;
|
|
113
|
-
/** Class name for the `<input>` element. `className` goes to the outer wrapper. */
|
|
114
|
-
inputClassName?: string;
|
|
115
|
-
/** Ref to the text `<input>` (null in read-only mode). */
|
|
116
|
-
ref?: Ref<HTMLInputElement>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* A text field that turns entries into removable tags (chips). Type and
|
|
120
|
-
* press Enter (or a delimiter such as a comma) to add; paste "a, b, c" to
|
|
121
|
-
* add several at once.
|
|
122
|
-
*
|
|
123
|
-
* Keyboard:
|
|
124
|
-
* - Enter / delimiters (and Tab with `addOnTab`): add the typed text.
|
|
125
|
-
* - Backspace in an empty input, or Left Arrow with the caret at the
|
|
126
|
-
* start: move focus to the last tag's remove button. A second Backspace
|
|
127
|
-
* (or Delete) removes that tag and focus returns to the next tag, or the
|
|
128
|
-
* input. This two-step pattern avoids deleting a tag by accident and
|
|
129
|
-
* lets screen readers announce which tag is about to be removed.
|
|
130
|
-
* - On a tag: Left / Right Arrow move between tags and back to the input;
|
|
131
|
-
* Home / End jump to the first tag / the input; Backspace or Delete removes.
|
|
132
|
-
*
|
|
133
|
-
* Inside a `Field`, the label, hint, error, required, disabled, read-only,
|
|
134
|
-
* and size are wired automatically. `ref` points at the `<input>`;
|
|
135
|
-
* native input props are spread onto it, while `className` and `style` go
|
|
136
|
-
* to the outer wrapper.
|
|
137
|
-
*
|
|
138
|
-
* ```tsx
|
|
139
|
-
* <Field label="Skills">
|
|
140
|
-
* <TagInput defaultValue={["Defense"]} placeholder="Add a skill" />
|
|
141
|
-
* </Field>
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
|
-
export declare const TagInput: ({ value, defaultValue, onValueChange, inputValue: inputValueProp, defaultInputValue, onInputValueChange, delimiters, addOnTab, addOnBlur, allowDuplicates, maxTags, validate, transform, size, disabled, readOnly, invalid, required, placeholder, name, chipVariant, chipTone, removeLabel: removeLabelProp, tagListLabel, instructions, messages: messagesProp, className, inputClassName, style, ref, id, onChange, onKeyDown, onPaste, onBlur, form, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...rest }: TagInputProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`_root_y83d4_15`,t=`_box_y83d4_31`,n=`_hasTags_y83d4_103`,r=`_sm_y83d4_115`,i=`_md_y83d4_131`,a=`_lg_y83d4_147`,o=`_disabled_y83d4_167`,s=`_readOnly_y83d4_167`,c=`_invalid_y83d4_167`,l=`_list_y83d4_229`,u=`_item_y83d4_255`,d=`_input_y83d4_313`,f=`_empty_y83d4_397`,p=`_error_y83d4_409`,m=`_limit_y83d4_431`,h=`_errorIcon_y83d4_445`,g={root:e,box:t,hasTags:n,sm:r,md:i,lg:a,disabled:o,readOnly:s,invalid:c,list:l,item:u,"tag-input-pulse":`_tag-input-pulse_y83d4_1`,input:d,empty:f,error:p,limit:m,errorIcon:h};exports.box=t,exports.default=g,exports.disabled=o,exports.empty=f,exports.error=p,exports.errorIcon=h,exports.hasTags=n,exports.input=d,exports.invalid=c,exports.item=u,exports.lg=a,exports.limit=m,exports.list=l,exports.md=i,exports.readOnly=s,exports.root=e,exports.sm=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),i=require("../Field/FieldContext.cjs.js"),a=require("./Textarea.module.css.cjs.js"),ee=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let o=require("react"),s=require("react/jsx-runtime");var c={sm:a.default.sm,md:a.default.md,lg:a.default.lg},l={outline:a.default.outline,filled:a.default.filled},u={none:a.default.radiusNone,xs:a.default.radiusXs,sm:a.default.radiusSm,md:a.default.radiusMd,lg:a.default.radiusLg,xl:a.default.radiusXl,"2xl":a.default.radius2xl},d={none:a.default.resizeNone,vertical:a.default.resizeVertical,both:a.default.resizeBoth},te=.9,ne=600,f;function p(){return f===void 0&&(f=typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`field-sizing`,`content`)),f}var m=typeof window<`u`?o.useLayoutEffect:o.useEffect,h=({size:f,variant:h=`outline`,radius:g,invalid:_,value:v,defaultValue:y,onValueChange:b,onChange:x,rows:S=3,autoResize:C=!1,minRows:w,maxRows:T,resize:E=`vertical`,showCount:D=!1,maxLength:O,fullWidth:re=!0,className:ie,textareaClassName:ae,style:oe,cols:k,id:A,required:j,disabled:M,readOnly:N,"aria-describedby":P,ref:F,...I})=>{let L=ee.useMessages(),R=(0,o.useId)(),z=D&&O!==void 0&&O>0,B=i.useFieldControl({id:A,invalid:_,required:j,disabled:M,readOnly:N,size:f,"aria-describedby":[P,z?R:void 0].filter(Boolean).join(` `)||void 0}),V=B.size??`md`,H=v!==void 0,[U,W]=e.useControllableState({value:v,defaultValue:y??``,onChange:b});t.useFormReset(()=>B.id?document.getElementById(B.id):null,()=>W(y??``),v===void 0);let G=e=>{x?.(e),W(e.target.value)},K=(0,o.useRef)(null),se=(0,o.useCallback)(e=>{K.current=e;let t;return typeof F==`function`?t=F(e):F&&(F.current=e),()=>{K.current=null,typeof F==`function`?typeof t==`function`?t():F(null):F&&(F.current=null)}},[F]),q=Math.max(1,w??S),J=T===void 0?void 0:Math.max(q,T),Y=(0,o.useCallback)(()=>{let e=K.current;if(!e)return;e.style.height=`auto`;let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);e.style.height=`${e.scrollHeight+n}px`},[]);m(()=>{C&&!p()&&Y()},[C,Y,U,q,J,V]),(0,o.useEffect)(()=>{let e=K.current;if(!C||p()||!e||typeof ResizeObserver>`u`)return;let t=e.offsetWidth,n=new ResizeObserver(()=>{e.offsetWidth!==t&&(t=e.offsetWidth,Y())});return n.observe(e),()=>{n.disconnect(),e.style.height=``}},[C,Y]);let X=U.length,ce=z?X/O:0,Z=z&&ce>=te,le=z&&X>=O,Q=z?Math.max(0,O-X):0,[ue,$]=(0,o.useState)(``);(0,o.useEffect)(()=>{if(!z)return;if(!Z){$(``);return}let e=window.setTimeout(()=>{$(Q===0?L.textarea.limitReached:L.textarea.remaining(Q))},ne);return()=>window.clearTimeout(e)},[z,Z,Q,L]);let de={...C?{"--textarea-min-rows":q,"--textarea-max-rows":J,"--textarea-cols":k}:null};return(0,s.jsxs)(`div`,{className:n.cx(a.default.root,re?a.default.fullWidth:a.default.inline,ie),style:oe,children:[(0,s.jsx)(`textarea`,{...I,...B.ariaProps,ref:se,id:B.id,required:B.required,disabled:B.disabled,readOnly:B.readOnly,maxLength:O,cols:k,rows:C?q:S,...H?{value:U}:{defaultValue:y??``},onChange:G,style:de,className:n.cx(a.default.textarea,c[V],l[h],g&&u[g],d[C?`none`:E],C&&a.default.autoResize,C&&J!==void 0&&a.default.hasMaxRows,B.invalid&&a.default.invalid,ae)}),z&&(0,s.jsxs)(`div`,{id:R,className:n.cx(a.default.counter,c[V],Z&&a.default.counterNear,le&&a.default.counterAtLimit),children:[(0,s.jsxs)(`span`,{"aria-hidden":`true`,children:[X,` / `,O]}),(0,s.jsxs)(r.VisuallyHidden,{children:[X,` of `,O,` characters used`]})]}),z&&(0,s.jsx)(r.VisuallyHidden,{"aria-live":`polite`,"aria-atomic":`true`,children:ue})]})};exports.Textarea=h;
|