@mortenbrudvik/waveui 0.4.0 → 0.7.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/README.md +1221 -173
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/button/Button.cjs +2 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.mjs +50 -0
- package/dist/components/button/Button.mjs.map +1 -0
- package/dist/components/button/Button.semantics.cjs +2 -0
- package/dist/components/button/Button.semantics.cjs.map +1 -0
- package/dist/components/button/Button.semantics.mjs +61 -0
- package/dist/components/button/Button.semantics.mjs.map +1 -0
- package/dist/components/button/Button.slots.cjs +2 -0
- package/dist/components/button/Button.slots.cjs.map +1 -0
- package/dist/components/button/Button.slots.mjs +47 -0
- package/dist/components/button/Button.slots.mjs.map +1 -0
- package/dist/components/button/CompoundButton.cjs +2 -0
- package/dist/components/button/CompoundButton.cjs.map +1 -0
- package/dist/components/button/CompoundButton.mjs +53 -0
- package/dist/components/button/CompoundButton.mjs.map +1 -0
- package/dist/components/button/Link.cjs +2 -0
- package/dist/components/button/Link.cjs.map +1 -0
- package/dist/components/button/Link.mjs +37 -0
- package/dist/components/button/Link.mjs.map +1 -0
- package/dist/components/button/MenuButton.cjs +2 -0
- package/dist/components/button/MenuButton.cjs.map +1 -0
- package/dist/components/button/MenuButton.mjs +45 -0
- package/dist/components/button/MenuButton.mjs.map +1 -0
- package/dist/components/button/SplitButton.cjs +2 -0
- package/dist/components/button/SplitButton.cjs.map +1 -0
- package/dist/components/button/SplitButton.mjs +66 -0
- package/dist/components/button/SplitButton.mjs.map +1 -0
- package/dist/components/button/ToggleButton.cjs +2 -0
- package/dist/components/button/ToggleButton.cjs.map +1 -0
- package/dist/components/button/ToggleButton.mjs +65 -0
- package/dist/components/button/ToggleButton.mjs.map +1 -0
- package/dist/components/button/Toolbar.cjs +2 -0
- package/dist/components/button/Toolbar.cjs.map +1 -0
- package/dist/components/button/Toolbar.context.cjs +2 -0
- package/dist/components/button/Toolbar.context.cjs.map +1 -0
- package/dist/components/button/Toolbar.context.mjs +31 -0
- package/dist/components/button/Toolbar.context.mjs.map +1 -0
- package/dist/components/button/Toolbar.mjs +63 -0
- package/dist/components/button/Toolbar.mjs.map +1 -0
- package/dist/components/button/Toolbar.parts.cjs +2 -0
- package/dist/components/button/Toolbar.parts.cjs.map +1 -0
- package/dist/components/button/Toolbar.parts.mjs +131 -0
- package/dist/components/button/Toolbar.parts.mjs.map +1 -0
- package/dist/components/button/buttonStyles.cjs +2 -0
- package/dist/components/button/buttonStyles.cjs.map +1 -0
- package/dist/components/button/buttonStyles.mjs +39 -0
- package/dist/components/button/buttonStyles.mjs.map +1 -0
- package/dist/components/data-display/Avatar.cjs +2 -0
- package/dist/components/data-display/Avatar.cjs.map +1 -0
- package/dist/components/data-display/Avatar.mjs +157 -0
- package/dist/components/data-display/Avatar.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.mjs +134 -0
- package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
- package/dist/components/data-display/Badge.cjs +2 -0
- package/dist/components/data-display/Badge.cjs.map +1 -0
- package/dist/components/data-display/Badge.colors.cjs +2 -0
- package/dist/components/data-display/Badge.colors.cjs.map +1 -0
- package/dist/components/data-display/Badge.colors.mjs +58 -0
- package/dist/components/data-display/Badge.colors.mjs.map +1 -0
- package/dist/components/data-display/Badge.mjs +32 -0
- package/dist/components/data-display/Badge.mjs.map +1 -0
- package/dist/components/data-display/CounterBadge.cjs +2 -0
- package/dist/components/data-display/CounterBadge.cjs.map +1 -0
- package/dist/components/data-display/CounterBadge.mjs +28 -0
- package/dist/components/data-display/CounterBadge.mjs.map +1 -0
- package/dist/components/data-display/Divider.cjs +2 -0
- package/dist/components/data-display/Divider.cjs.map +1 -0
- package/dist/components/data-display/Divider.mjs +52 -0
- package/dist/components/data-display/Divider.mjs.map +1 -0
- package/dist/components/data-display/Image.cjs +2 -0
- package/dist/components/data-display/Image.cjs.map +1 -0
- package/dist/components/data-display/Image.mjs +32 -0
- package/dist/components/data-display/Image.mjs.map +1 -0
- package/dist/components/data-display/InfoLabel.cjs +2 -0
- package/dist/components/data-display/InfoLabel.cjs.map +1 -0
- package/dist/components/data-display/InfoLabel.mjs +104 -0
- package/dist/components/data-display/InfoLabel.mjs.map +1 -0
- package/dist/components/data-display/List.cjs +2 -0
- package/dist/components/data-display/List.cjs.map +1 -0
- package/dist/components/data-display/List.mjs +381 -0
- package/dist/components/data-display/List.mjs.map +1 -0
- package/dist/components/data-display/List.registry.cjs +2 -0
- package/dist/components/data-display/List.registry.cjs.map +1 -0
- package/dist/components/data-display/List.registry.mjs +101 -0
- package/dist/components/data-display/List.registry.mjs.map +1 -0
- package/dist/components/data-display/Persona.cjs +2 -0
- package/dist/components/data-display/Persona.cjs.map +1 -0
- package/dist/components/data-display/Persona.mjs +48 -0
- package/dist/components/data-display/Persona.mjs.map +1 -0
- package/dist/components/data-display/PresenceBadge.cjs +2 -0
- package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
- package/dist/components/data-display/PresenceBadge.mjs +71 -0
- package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
- package/dist/components/data-display/Tag.cjs +2 -0
- package/dist/components/data-display/Tag.cjs.map +1 -0
- package/dist/components/data-display/Tag.mjs +147 -0
- package/dist/components/data-display/Tag.mjs.map +1 -0
- package/dist/components/feedback/MessageBar.cjs +2 -0
- package/dist/components/feedback/MessageBar.cjs.map +1 -0
- package/dist/components/feedback/MessageBar.mjs +144 -0
- package/dist/components/feedback/MessageBar.mjs.map +1 -0
- package/dist/components/feedback/MessageBar.status.cjs +2 -0
- package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
- package/dist/components/feedback/MessageBar.status.mjs +45 -0
- package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
- package/dist/components/feedback/ProgressBar.cjs +2 -0
- package/dist/components/feedback/ProgressBar.cjs.map +1 -0
- package/dist/components/feedback/ProgressBar.mjs +72 -0
- package/dist/components/feedback/ProgressBar.mjs.map +1 -0
- package/dist/components/feedback/Skeleton.cjs +2 -0
- package/dist/components/feedback/Skeleton.cjs.map +1 -0
- package/dist/components/feedback/Skeleton.mjs +47 -0
- package/dist/components/feedback/Skeleton.mjs.map +1 -0
- package/dist/components/feedback/Spinner.cjs +2 -0
- package/dist/components/feedback/Spinner.cjs.map +1 -0
- package/dist/components/feedback/Spinner.mjs +60 -0
- package/dist/components/feedback/Spinner.mjs.map +1 -0
- package/dist/components/feedback/Toast.cjs +2 -0
- package/dist/components/feedback/Toast.cjs.map +1 -0
- package/dist/components/feedback/Toast.mjs +347 -0
- package/dist/components/feedback/Toast.mjs.map +1 -0
- package/dist/components/input/Checkbox.cjs +2 -0
- package/dist/components/input/Checkbox.cjs.map +1 -0
- package/dist/components/input/Checkbox.mjs +96 -0
- package/dist/components/input/Checkbox.mjs.map +1 -0
- package/dist/components/input/ColorPicker.cjs +6 -0
- package/dist/components/input/ColorPicker.cjs.map +1 -0
- package/dist/components/input/ColorPicker.mjs +236 -0
- package/dist/components/input/ColorPicker.mjs.map +1 -0
- package/dist/components/input/Combobox.cjs +2 -0
- package/dist/components/input/Combobox.cjs.map +1 -0
- package/dist/components/input/Combobox.expand.cjs +2 -0
- package/dist/components/input/Combobox.expand.cjs.map +1 -0
- package/dist/components/input/Combobox.expand.mjs +38 -0
- package/dist/components/input/Combobox.expand.mjs.map +1 -0
- package/dist/components/input/Combobox.mjs +187 -0
- package/dist/components/input/Combobox.mjs.map +1 -0
- package/dist/components/input/DatePicker.cjs +2 -0
- package/dist/components/input/DatePicker.cjs.map +1 -0
- package/dist/components/input/DatePicker.mjs +340 -0
- package/dist/components/input/DatePicker.mjs.map +1 -0
- package/dist/components/input/Dropdown.cjs +2 -0
- package/dist/components/input/Dropdown.cjs.map +1 -0
- package/dist/components/input/Dropdown.mjs +128 -0
- package/dist/components/input/Dropdown.mjs.map +1 -0
- package/dist/components/input/Field.cjs +2 -0
- package/dist/components/input/Field.cjs.map +1 -0
- package/dist/components/input/Field.mjs +200 -0
- package/dist/components/input/Field.mjs.map +1 -0
- package/dist/components/input/Input.cjs +2 -0
- package/dist/components/input/Input.cjs.map +1 -0
- package/dist/components/input/Input.mjs +81 -0
- package/dist/components/input/Input.mjs.map +1 -0
- package/dist/components/input/Label.cjs +2 -0
- package/dist/components/input/Label.cjs.map +1 -0
- package/dist/components/input/Label.mjs +28 -0
- package/dist/components/input/Label.mjs.map +1 -0
- package/dist/components/input/Option.cjs +2 -0
- package/dist/components/input/Option.cjs.map +1 -0
- package/dist/components/input/Option.mjs +169 -0
- package/dist/components/input/Option.mjs.map +1 -0
- package/dist/components/input/RadioGroup.cjs +2 -0
- package/dist/components/input/RadioGroup.cjs.map +1 -0
- package/dist/components/input/RadioGroup.mjs +139 -0
- package/dist/components/input/RadioGroup.mjs.map +1 -0
- package/dist/components/input/Rating.cjs +2 -0
- package/dist/components/input/Rating.cjs.map +1 -0
- package/dist/components/input/Rating.mjs +196 -0
- package/dist/components/input/Rating.mjs.map +1 -0
- package/dist/components/input/SearchBox.cjs +2 -0
- package/dist/components/input/SearchBox.cjs.map +1 -0
- package/dist/components/input/SearchBox.mjs +205 -0
- package/dist/components/input/SearchBox.mjs.map +1 -0
- package/dist/components/input/Select.cjs +2 -0
- package/dist/components/input/Select.cjs.map +1 -0
- package/dist/components/input/Select.mjs +33 -0
- package/dist/components/input/Select.mjs.map +1 -0
- package/dist/components/input/Slider.cjs +2 -0
- package/dist/components/input/Slider.cjs.map +1 -0
- package/dist/components/input/Slider.mjs +79 -0
- package/dist/components/input/Slider.mjs.map +1 -0
- package/dist/components/input/SpinButton.cjs +2 -0
- package/dist/components/input/SpinButton.cjs.map +1 -0
- package/dist/components/input/SpinButton.mjs +157 -0
- package/dist/components/input/SpinButton.mjs.map +1 -0
- package/dist/components/input/SwatchPicker.cjs +2 -0
- package/dist/components/input/SwatchPicker.cjs.map +1 -0
- package/dist/components/input/SwatchPicker.mjs +113 -0
- package/dist/components/input/SwatchPicker.mjs.map +1 -0
- package/dist/components/input/Switch.cjs +2 -0
- package/dist/components/input/Switch.cjs.map +1 -0
- package/dist/components/input/Switch.mjs +92 -0
- package/dist/components/input/Switch.mjs.map +1 -0
- package/dist/components/input/TagPicker.cjs +2 -0
- package/dist/components/input/TagPicker.cjs.map +1 -0
- package/dist/components/input/TagPicker.mjs +249 -0
- package/dist/components/input/TagPicker.mjs.map +1 -0
- package/dist/components/input/Textarea.cjs +2 -0
- package/dist/components/input/Textarea.cjs.map +1 -0
- package/dist/components/input/Textarea.mjs +32 -0
- package/dist/components/input/Textarea.mjs.map +1 -0
- package/dist/components/input/TimePicker.cjs +2 -0
- package/dist/components/input/TimePicker.cjs.map +1 -0
- package/dist/components/input/TimePicker.mjs +292 -0
- package/dist/components/input/TimePicker.mjs.map +1 -0
- package/dist/components/input/colorUtils.cjs +2 -0
- package/dist/components/input/colorUtils.cjs.map +1 -0
- package/dist/components/input/colorUtils.mjs +96 -0
- package/dist/components/input/colorUtils.mjs.map +1 -0
- package/dist/components/input/dateUtils.cjs +2 -0
- package/dist/components/input/dateUtils.cjs.map +1 -0
- package/dist/components/input/dateUtils.mjs +250 -0
- package/dist/components/input/dateUtils.mjs.map +1 -0
- package/dist/components/input/pickerStyles.cjs +2 -0
- package/dist/components/input/pickerStyles.cjs.map +1 -0
- package/dist/components/input/pickerStyles.mjs +10 -0
- package/dist/components/input/pickerStyles.mjs.map +1 -0
- package/dist/components/internal/HiddenInput.cjs +2 -0
- package/dist/components/internal/HiddenInput.cjs.map +1 -0
- package/dist/components/internal/HiddenInput.mjs +88 -0
- package/dist/components/internal/HiddenInput.mjs.map +1 -0
- package/dist/components/layout/Accordion.cjs +2 -0
- package/dist/components/layout/Accordion.cjs.map +1 -0
- package/dist/components/layout/Accordion.mjs +236 -0
- package/dist/components/layout/Accordion.mjs.map +1 -0
- package/dist/components/layout/Card.cjs +2 -0
- package/dist/components/layout/Card.cjs.map +1 -0
- package/dist/components/layout/Card.mjs +121 -0
- package/dist/components/layout/Card.mjs.map +1 -0
- package/dist/components/layout/Carousel.cjs +2 -0
- package/dist/components/layout/Carousel.cjs.map +1 -0
- package/dist/components/layout/Carousel.mjs +205 -0
- package/dist/components/layout/Carousel.mjs.map +1 -0
- package/dist/components/layout/Flex.cjs +2 -0
- package/dist/components/layout/Flex.cjs.map +1 -0
- package/dist/components/layout/Flex.mjs +54 -0
- package/dist/components/layout/Flex.mjs.map +1 -0
- package/dist/components/layout/Grid.cjs +2 -0
- package/dist/components/layout/Grid.cjs.map +1 -0
- package/dist/components/layout/Grid.mjs +62 -0
- package/dist/components/layout/Grid.mjs.map +1 -0
- package/dist/components/layout/Overflow.cjs +2 -0
- package/dist/components/layout/Overflow.cjs.map +1 -0
- package/dist/components/layout/Overflow.mjs +269 -0
- package/dist/components/layout/Overflow.mjs.map +1 -0
- package/dist/components/layout/Stack.cjs +2 -0
- package/dist/components/layout/Stack.cjs.map +1 -0
- package/dist/components/layout/Stack.mjs +39 -0
- package/dist/components/layout/Stack.mjs.map +1 -0
- package/dist/components/layout/TabList.cjs +2 -0
- package/dist/components/layout/TabList.cjs.map +1 -0
- package/dist/components/layout/TabList.mjs +238 -0
- package/dist/components/layout/TabList.mjs.map +1 -0
- package/dist/components/layout/Tree.cjs +2 -0
- package/dist/components/layout/Tree.cjs.map +1 -0
- package/dist/components/layout/Tree.mjs +220 -0
- package/dist/components/layout/Tree.mjs.map +1 -0
- package/dist/components/layout/disclosureIds.cjs +2 -0
- package/dist/components/layout/disclosureIds.cjs.map +1 -0
- package/dist/components/layout/disclosureIds.mjs +12 -0
- package/dist/components/layout/disclosureIds.mjs.map +1 -0
- package/dist/components/motion/Presence.cjs +2 -0
- package/dist/components/motion/Presence.cjs.map +1 -0
- package/dist/components/motion/Presence.mjs +35 -0
- package/dist/components/motion/Presence.mjs.map +1 -0
- package/dist/components/navigation/Breadcrumb.cjs +2 -0
- package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
- package/dist/components/navigation/Breadcrumb.mjs +144 -0
- package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
- package/dist/components/navigation/Menu.cjs +2 -0
- package/dist/components/navigation/Menu.cjs.map +1 -0
- package/dist/components/navigation/Menu.context.cjs +2 -0
- package/dist/components/navigation/Menu.context.cjs.map +1 -0
- package/dist/components/navigation/Menu.context.mjs +82 -0
- package/dist/components/navigation/Menu.context.mjs.map +1 -0
- package/dist/components/navigation/Menu.group.cjs +2 -0
- package/dist/components/navigation/Menu.group.cjs.map +1 -0
- package/dist/components/navigation/Menu.group.mjs +58 -0
- package/dist/components/navigation/Menu.group.mjs.map +1 -0
- package/dist/components/navigation/Menu.items.cjs +2 -0
- package/dist/components/navigation/Menu.items.cjs.map +1 -0
- package/dist/components/navigation/Menu.items.mjs +127 -0
- package/dist/components/navigation/Menu.items.mjs.map +1 -0
- package/dist/components/navigation/Menu.link.cjs +2 -0
- package/dist/components/navigation/Menu.link.cjs.map +1 -0
- package/dist/components/navigation/Menu.link.mjs +41 -0
- package/dist/components/navigation/Menu.link.mjs.map +1 -0
- package/dist/components/navigation/Menu.mjs +27 -0
- package/dist/components/navigation/Menu.mjs.map +1 -0
- package/dist/components/navigation/Menu.popover.cjs +2 -0
- package/dist/components/navigation/Menu.popover.cjs.map +1 -0
- package/dist/components/navigation/Menu.popover.mjs +231 -0
- package/dist/components/navigation/Menu.popover.mjs.map +1 -0
- package/dist/components/navigation/Menu.root.cjs +2 -0
- package/dist/components/navigation/Menu.root.cjs.map +1 -0
- package/dist/components/navigation/Menu.root.mjs +308 -0
- package/dist/components/navigation/Menu.root.mjs.map +1 -0
- package/dist/components/navigation/Menu.selectable.cjs +2 -0
- package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
- package/dist/components/navigation/Menu.selectable.mjs +89 -0
- package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
- package/dist/components/navigation/Menu.shared.cjs +2 -0
- package/dist/components/navigation/Menu.shared.cjs.map +1 -0
- package/dist/components/navigation/Menu.shared.mjs +23 -0
- package/dist/components/navigation/Menu.shared.mjs.map +1 -0
- package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
- package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
- package/dist/components/navigation/Menu.splitGroup.mjs +51 -0
- package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
- package/dist/components/navigation/Menu.trigger.cjs +2 -0
- package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
- package/dist/components/navigation/Menu.trigger.mjs +79 -0
- package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
- package/dist/components/navigation/Nav.cjs +2 -0
- package/dist/components/navigation/Nav.cjs.map +1 -0
- package/dist/components/navigation/Nav.mjs +276 -0
- package/dist/components/navigation/Nav.mjs.map +1 -0
- package/dist/components/navigation/Pagination.cjs +2 -0
- package/dist/components/navigation/Pagination.cjs.map +1 -0
- package/dist/components/navigation/Pagination.mjs +110 -0
- package/dist/components/navigation/Pagination.mjs.map +1 -0
- package/dist/components/navigation/Stepper.cjs +2 -0
- package/dist/components/navigation/Stepper.cjs.map +1 -0
- package/dist/components/navigation/Stepper.mjs +204 -0
- package/dist/components/navigation/Stepper.mjs.map +1 -0
- package/dist/components/overlays/Dialog.cjs +2 -0
- package/dist/components/overlays/Dialog.cjs.map +1 -0
- package/dist/components/overlays/Dialog.mjs +180 -0
- package/dist/components/overlays/Dialog.mjs.map +1 -0
- package/dist/components/overlays/Dialog.shared.cjs +2 -0
- package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
- package/dist/components/overlays/Dialog.shared.mjs +227 -0
- package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
- package/dist/components/overlays/Drawer.cjs +2 -0
- package/dist/components/overlays/Drawer.cjs.map +1 -0
- package/dist/components/overlays/Drawer.mjs +192 -0
- package/dist/components/overlays/Drawer.mjs.map +1 -0
- package/dist/components/overlays/Popover.cjs +2 -0
- package/dist/components/overlays/Popover.cjs.map +1 -0
- package/dist/components/overlays/Popover.mjs +365 -0
- package/dist/components/overlays/Popover.mjs.map +1 -0
- package/dist/components/overlays/Popover.shared.cjs +2 -0
- package/dist/components/overlays/Popover.shared.cjs.map +1 -0
- package/dist/components/overlays/Popover.shared.mjs +182 -0
- package/dist/components/overlays/Popover.shared.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.mjs +181 -0
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
- package/dist/components/overlays/Tooltip.cjs +2 -0
- package/dist/components/overlays/Tooltip.cjs.map +1 -0
- package/dist/components/overlays/Tooltip.mjs +160 -0
- package/dist/components/overlays/Tooltip.mjs.map +1 -0
- package/dist/components/portal/Portal.cjs +2 -0
- package/dist/components/portal/Portal.cjs.map +1 -0
- package/dist/components/portal/Portal.mjs +45 -0
- package/dist/components/portal/Portal.mjs.map +1 -0
- package/dist/components/provider/WaveProvider.cjs +2 -0
- package/dist/components/provider/WaveProvider.cjs.map +1 -0
- package/dist/components/provider/WaveProvider.mjs +51 -0
- package/dist/components/provider/WaveProvider.mjs.map +1 -0
- package/dist/components/table/DataGrid.cjs +2 -0
- package/dist/components/table/DataGrid.cjs.map +1 -0
- package/dist/components/table/DataGrid.mjs +489 -0
- package/dist/components/table/DataGrid.mjs.map +1 -0
- package/dist/components/table/Table.cjs +2 -0
- package/dist/components/table/Table.cjs.map +1 -0
- package/dist/components/table/Table.mjs +99 -0
- package/dist/components/table/Table.mjs.map +1 -0
- package/dist/components/table/useGridNavigation.cjs +2 -0
- package/dist/components/table/useGridNavigation.cjs.map +1 -0
- package/dist/components/table/useGridNavigation.mjs +336 -0
- package/dist/components/table/useGridNavigation.mjs.map +1 -0
- package/dist/components/typography/Text.cjs +2 -0
- package/dist/components/typography/Text.cjs.map +1 -0
- package/dist/components/typography/Text.mjs +38 -0
- package/dist/components/typography/Text.mjs.map +1 -0
- package/dist/hooks/useAnnounce.cjs +2 -0
- package/dist/hooks/useAnnounce.cjs.map +1 -0
- package/dist/hooks/useAnnounce.mjs +88 -0
- package/dist/hooks/useAnnounce.mjs.map +1 -0
- package/dist/hooks/useCheckedValues.cjs +2 -0
- package/dist/hooks/useCheckedValues.cjs.map +1 -0
- package/dist/hooks/useCheckedValues.mjs +102 -0
- package/dist/hooks/useCheckedValues.mjs.map +1 -0
- package/dist/hooks/useContextMenuAnchor.cjs +2 -0
- package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
- package/dist/hooks/useContextMenuAnchor.mjs +132 -0
- package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
- package/dist/hooks/useControllable.cjs +2 -0
- package/dist/hooks/useControllable.cjs.map +1 -0
- package/dist/hooks/useControllable.mjs +37 -0
- package/dist/hooks/useControllable.mjs.map +1 -0
- package/dist/hooks/useDirection.cjs +2 -0
- package/dist/hooks/useDirection.cjs.map +1 -0
- package/dist/hooks/useDirection.mjs +57 -0
- package/dist/hooks/useDirection.mjs.map +1 -0
- package/dist/hooks/useDismiss.cjs +2 -0
- package/dist/hooks/useDismiss.cjs.map +1 -0
- package/dist/hooks/useDismiss.mjs +57 -0
- package/dist/hooks/useDismiss.mjs.map +1 -0
- package/dist/hooks/useEventCallback.cjs +2 -0
- package/dist/hooks/useEventCallback.cjs.map +1 -0
- package/dist/hooks/useEventCallback.mjs +16 -0
- package/dist/hooks/useEventCallback.mjs.map +1 -0
- package/dist/hooks/useFieldControl.cjs +2 -0
- package/dist/hooks/useFieldControl.cjs.map +1 -0
- package/dist/hooks/useFieldControl.mjs +62 -0
- package/dist/hooks/useFieldControl.mjs.map +1 -0
- package/dist/hooks/useFocusTrap.cjs +2 -0
- package/dist/hooks/useFocusTrap.cjs.map +1 -0
- package/dist/hooks/useFocusTrap.mjs +266 -0
- package/dist/hooks/useFocusTrap.mjs.map +1 -0
- package/dist/hooks/useFormReset.cjs +2 -0
- package/dist/hooks/useFormReset.cjs.map +1 -0
- package/dist/hooks/useFormReset.mjs +33 -0
- package/dist/hooks/useFormReset.mjs.map +1 -0
- package/dist/hooks/useHoverIntent.cjs +2 -0
- package/dist/hooks/useHoverIntent.cjs.map +1 -0
- package/dist/hooks/useHoverIntent.mjs +201 -0
- package/dist/hooks/useHoverIntent.mjs.map +1 -0
- package/dist/hooks/useId.cjs +2 -0
- package/dist/hooks/useId.cjs.map +1 -0
- package/dist/hooks/useId.mjs +11 -0
- package/dist/hooks/useId.mjs.map +1 -0
- package/dist/hooks/useIsClient.cjs +2 -0
- package/dist/hooks/useIsClient.cjs.map +1 -0
- package/dist/hooks/useIsClient.mjs +19 -0
- package/dist/hooks/useIsClient.mjs.map +1 -0
- package/dist/hooks/useListbox.cjs +2 -0
- package/dist/hooks/useListbox.cjs.map +1 -0
- package/dist/hooks/useListbox.mjs +492 -0
- package/dist/hooks/useListbox.mjs.map +1 -0
- package/dist/hooks/useMergedRefs.cjs +2 -0
- package/dist/hooks/useMergedRefs.cjs.map +1 -0
- package/dist/hooks/useMergedRefs.mjs +57 -0
- package/dist/hooks/useMergedRefs.mjs.map +1 -0
- package/dist/hooks/useModalIsolation.cjs +2 -0
- package/dist/hooks/useModalIsolation.cjs.map +1 -0
- package/dist/hooks/useModalIsolation.mjs +87 -0
- package/dist/hooks/useModalIsolation.mjs.map +1 -0
- package/dist/hooks/useModalLayer.cjs +2 -0
- package/dist/hooks/useModalLayer.cjs.map +1 -0
- package/dist/hooks/useModalLayer.mjs +30 -0
- package/dist/hooks/useModalLayer.mjs.map +1 -0
- package/dist/hooks/usePopupPosition.cjs +2 -0
- package/dist/hooks/usePopupPosition.cjs.map +1 -0
- package/dist/hooks/usePopupPosition.mjs +117 -0
- package/dist/hooks/usePopupPosition.mjs.map +1 -0
- package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
- package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
- package/dist/hooks/usePrefersReducedMotion.mjs +24 -0
- package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
- package/dist/hooks/usePresence.cjs +2 -0
- package/dist/hooks/usePresence.cjs.map +1 -0
- package/dist/hooks/usePresence.mjs +136 -0
- package/dist/hooks/usePresence.mjs.map +1 -0
- package/dist/hooks/usePreserveFocus.cjs +2 -0
- package/dist/hooks/usePreserveFocus.cjs.map +1 -0
- package/dist/hooks/usePreserveFocus.mjs +50 -0
- package/dist/hooks/usePreserveFocus.mjs.map +1 -0
- package/dist/hooks/useRestoreFocus.cjs +2 -0
- package/dist/hooks/useRestoreFocus.cjs.map +1 -0
- package/dist/hooks/useRestoreFocus.mjs +271 -0
- package/dist/hooks/useRestoreFocus.mjs.map +1 -0
- package/dist/hooks/useRovingTabIndex.cjs +2 -0
- package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
- package/dist/hooks/useRovingTabIndex.mjs +389 -0
- package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
- package/dist/hooks/useScrollLock.cjs +2 -0
- package/dist/hooks/useScrollLock.cjs.map +1 -0
- package/dist/hooks/useScrollLock.mjs +71 -0
- package/dist/hooks/useScrollLock.mjs.map +1 -0
- package/dist/hooks/useTriggerElement.cjs +2 -0
- package/dist/hooks/useTriggerElement.cjs.map +1 -0
- package/dist/hooks/useTriggerElement.mjs +126 -0
- package/dist/hooks/useTriggerElement.mjs.map +1 -0
- package/dist/hooks/useTypeahead.cjs +2 -0
- package/dist/hooks/useTypeahead.cjs.map +1 -0
- package/dist/hooks/useTypeahead.mjs +38 -0
- package/dist/hooks/useTypeahead.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9099 -0
- package/dist/index.d.ts +7688 -1027
- package/dist/index.mjs +91 -5695
- package/dist/lib/aria.cjs +2 -0
- package/dist/lib/aria.cjs.map +1 -0
- package/dist/lib/aria.mjs +29 -0
- package/dist/lib/aria.mjs.map +1 -0
- package/dist/lib/children.cjs +2 -0
- package/dist/lib/children.cjs.map +1 -0
- package/dist/lib/children.mjs +37 -0
- package/dist/lib/children.mjs.map +1 -0
- package/dist/lib/cn.cjs +2 -0
- package/dist/lib/cn.cjs.map +1 -0
- package/dist/lib/cn.mjs +64 -0
- package/dist/lib/cn.mjs.map +1 -0
- package/dist/lib/composeEventHandlers.cjs +2 -0
- package/dist/lib/composeEventHandlers.cjs.map +1 -0
- package/dist/lib/composeEventHandlers.mjs +11 -0
- package/dist/lib/composeEventHandlers.mjs.map +1 -0
- package/dist/lib/dev.cjs +2 -0
- package/dist/lib/dev.cjs.map +1 -0
- package/dist/lib/dev.mjs +42 -0
- package/dist/lib/dev.mjs.map +1 -0
- package/dist/lib/direction.cjs +2 -0
- package/dist/lib/direction.cjs.map +1 -0
- package/dist/lib/direction.mjs +35 -0
- package/dist/lib/direction.mjs.map +1 -0
- package/dist/lib/events.cjs +2 -0
- package/dist/lib/events.cjs.map +1 -0
- package/dist/lib/events.mjs +31 -0
- package/dist/lib/events.mjs.map +1 -0
- package/dist/lib/focus.cjs +2 -0
- package/dist/lib/focus.cjs.map +1 -0
- package/dist/lib/focus.mjs +119 -0
- package/dist/lib/focus.mjs.map +1 -0
- package/dist/lib/globalRegistry.cjs +2 -0
- package/dist/lib/globalRegistry.cjs.map +1 -0
- package/dist/lib/globalRegistry.mjs +13 -0
- package/dist/lib/globalRegistry.mjs.map +1 -0
- package/dist/lib/icons.cjs +2 -0
- package/dist/lib/icons.cjs.map +1 -0
- package/dist/lib/icons.mjs +254 -0
- package/dist/lib/icons.mjs.map +1 -0
- package/dist/lib/labelInName.cjs +2 -0
- package/dist/lib/labelInName.cjs.map +1 -0
- package/dist/lib/labelInName.mjs +54 -0
- package/dist/lib/labelInName.mjs.map +1 -0
- package/dist/lib/layers.cjs +2 -0
- package/dist/lib/layers.cjs.map +1 -0
- package/dist/lib/layers.mjs +224 -0
- package/dist/lib/layers.mjs.map +1 -0
- package/dist/lib/mergeProps.cjs +2 -0
- package/dist/lib/mergeProps.cjs.map +1 -0
- package/dist/lib/mergeProps.mjs +21 -0
- package/dist/lib/mergeProps.mjs.map +1 -0
- package/dist/lib/mergeRefs.cjs +2 -0
- package/dist/lib/mergeRefs.cjs.map +1 -0
- package/dist/lib/mergeRefs.mjs +29 -0
- package/dist/lib/mergeRefs.mjs.map +1 -0
- package/dist/lib/renderTrigger.cjs +2 -0
- package/dist/lib/renderTrigger.cjs.map +1 -0
- package/dist/lib/renderTrigger.mjs +29 -0
- package/dist/lib/renderTrigger.mjs.map +1 -0
- package/dist/lib/slot.cjs +2 -0
- package/dist/lib/slot.cjs.map +1 -0
- package/dist/lib/slot.mjs +122 -0
- package/dist/lib/slot.mjs.map +1 -0
- package/dist/lib/styles.cjs +2 -0
- package/dist/lib/styles.cjs.map +1 -0
- package/dist/lib/styles.mjs +16 -0
- package/dist/lib/styles.mjs.map +1 -0
- package/dist/lib/theme.cjs +2 -0
- package/dist/lib/theme.cjs.map +1 -0
- package/dist/lib/theme.mjs +16 -0
- package/dist/lib/theme.mjs.map +1 -0
- package/dist/preflight.css +2 -0
- package/dist/styles.css +2 -0
- package/package.json +149 -100
- package/src/styles/animations.css +7 -39
- package/src/styles/base.css +103 -0
- package/src/styles/globals.css +10 -22
- package/src/styles/legacy-tokens.css +184 -0
- package/src/styles/preflight.css +7 -0
- package/src/styles/styles.css +32 -0
- package/src/styles/tailwind.css +17 -0
- package/src/styles/tokens.css +561 -221
- package/src/styles/variants.css +29 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/cn.mjs";
|
|
3
|
+
import { warnDeprecated as t } from "../../lib/dev.mjs";
|
|
4
|
+
import { composeEventHandlers as n } from "../../lib/composeEventHandlers.mjs";
|
|
5
|
+
import { useControllable as r } from "../../hooks/useControllable.mjs";
|
|
6
|
+
import { useMergedRefs as i } from "../../hooks/useMergedRefs.mjs";
|
|
7
|
+
import { useFieldContext as ee, useFieldControl as te } from "../../hooks/useFieldControl.mjs";
|
|
8
|
+
import { disabledStyles as ne, inputBase as re, inputFocus as ie } from "../../lib/styles.mjs";
|
|
9
|
+
import { DismissIcon as ae } from "../../lib/icons.mjs";
|
|
10
|
+
import { isInvalidLook as oe } from "./Input.mjs";
|
|
11
|
+
import { useFormReset as se } from "../../hooks/useFormReset.mjs";
|
|
12
|
+
import { HiddenInput as ce } from "../internal/HiddenInput.mjs";
|
|
13
|
+
import { collectOptionLabels as le, useListbox as ue } from "../../hooks/useListbox.mjs";
|
|
14
|
+
import { pickerEndPadding as de } from "./pickerStyles.mjs";
|
|
15
|
+
import { PickerExpandButton as fe, showsExpandButton as pe } from "./Combobox.expand.mjs";
|
|
16
|
+
import { ListboxSurface as me, Option as a, OptionGroup as o, useListboxPopup as he } from "./Option.mjs";
|
|
17
|
+
import * as s from "react";
|
|
18
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
19
|
+
//#region src/components/input/Combobox.tsx
|
|
20
|
+
function ge(e, t) {
|
|
21
|
+
return (e.textValue ?? e.label).toLowerCase().includes(t.toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
var u = (a) => {
|
|
24
|
+
let { value: o, defaultValue: u, onValueChange: d, onOptionSelect: f, open: p, defaultOpen: _e, onOpenChange: ve, placeholder: ye, disabled: m = !1, freeform: h = !1, name: be, form: g, required: _, autoComplete: xe = "off", autoCapitalize: Se, autoCorrect: Ce, maxLength: we, readOnly: v, clearable: Te = !1, expandIcon: y, labels: b, inputMode: Ee, spellCheck: De, enterKeyHint: x, autoFocus: S, tabIndex: C, id: w, "aria-label": T, "aria-labelledby": E, "aria-describedby": Oe, "aria-invalid": ke, "aria-required": Ae, "aria-errormessage": je, "aria-details": Me, onFocus: Ne, onBlur: Pe, onKeyDown: Fe, onKeyUp: Ie, controlRef: Le, className: Re, children: D, ref: ze, ...Be } = a;
|
|
25
|
+
f !== void 0 && t("Combobox", "onOptionSelect", "onValueChange");
|
|
26
|
+
let O = ee(), Ve = (_ ?? O?.required ?? !1) && !v, k = te({
|
|
27
|
+
id: w,
|
|
28
|
+
"aria-label": T,
|
|
29
|
+
"aria-labelledby": E,
|
|
30
|
+
"aria-describedby": Oe,
|
|
31
|
+
"aria-invalid": ke,
|
|
32
|
+
"aria-required": Ae ?? _
|
|
33
|
+
}), He = oe(!1, k["aria-invalid"]), [A, j] = r(o, u ?? "", d), M = !m && !v, [N, P] = r(p, (_e ?? !1) && M, ve), F = N && M, [I, L] = s.useState(null), [Ue, We] = s.useState(M);
|
|
34
|
+
Ue !== M && (We(M), M || L(null));
|
|
35
|
+
let R = !M && N;
|
|
36
|
+
s.useEffect(() => {
|
|
37
|
+
R && P(!1);
|
|
38
|
+
}, [R, P]);
|
|
39
|
+
let [Ge, z] = s.useState(null), B = s.useRef(null), V = s.useRef(null), Ke = s.useMemo(() => le(D), [D]), qe = s.useMemo(() => I ? (e) => ge(e, I) : void 0, [I]), H = (e) => {
|
|
40
|
+
z(e), j(e), f?.(e);
|
|
41
|
+
}, U = () => {
|
|
42
|
+
P(!1), L(null);
|
|
43
|
+
}, W;
|
|
44
|
+
h ? W = () => {
|
|
45
|
+
L(null), H("");
|
|
46
|
+
} : I && (W = () => L(null));
|
|
47
|
+
let G = ue({
|
|
48
|
+
open: F,
|
|
49
|
+
onOpenChange: (e) => {
|
|
50
|
+
e ? P(!0) : U();
|
|
51
|
+
},
|
|
52
|
+
mode: "editable",
|
|
53
|
+
selectedValues: A ? [A] : [],
|
|
54
|
+
onSelect: (e) => {
|
|
55
|
+
j(e), f?.(e), L(null), z(null);
|
|
56
|
+
},
|
|
57
|
+
filter: qe,
|
|
58
|
+
autoHighlight: !h && I ? "first" : !1,
|
|
59
|
+
idPrefix: "combobox-listbox",
|
|
60
|
+
onClearDraft: W
|
|
61
|
+
}), K = A ? G.getItem(A)?.label ?? Ke.get(A) : void 0, q;
|
|
62
|
+
q = h ? A === Ge ? A : K ?? A : I ?? K ?? "", h && I !== null && I !== q && L(q);
|
|
63
|
+
let J = F && G.items.length > 0, Y = b?.noMatches ?? "No matches", X = F && (J || !!I), Je = X && !J, { layerId: Ye, setReference: Xe, surfaceRef: Ze, floatingProps: Qe } = he({
|
|
64
|
+
open: F,
|
|
65
|
+
surfaceOpen: X,
|
|
66
|
+
onDismiss: U,
|
|
67
|
+
rootRef: B,
|
|
68
|
+
anchorRef: V
|
|
69
|
+
}), $e = i(B, ze), Z = i(V, Le, Xe);
|
|
70
|
+
se(V, () => {
|
|
71
|
+
j(u ?? ""), L(null), z(null);
|
|
72
|
+
}, g);
|
|
73
|
+
let et = (e) => {
|
|
74
|
+
if (e.key === "Escape" && F && !X && !e.nativeEvent.isComposing) {
|
|
75
|
+
U(), W && e.currentTarget.value !== "" && (e.preventDefault(), W());
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
G.onKeyDown(e);
|
|
79
|
+
}, tt = (e) => {
|
|
80
|
+
let t = e.target.value;
|
|
81
|
+
L(t), F || P(!0), h && H(t);
|
|
82
|
+
}, nt = () => {
|
|
83
|
+
M && (F ? U() : P(!0), V.current?.focus());
|
|
84
|
+
}, rt = () => {
|
|
85
|
+
j(""), z(null), L(null), P(!1), V.current?.focus();
|
|
86
|
+
}, Q = pe(y), $ = Te && A !== "" && !v, it = k["aria-label"] === void 0 ? k["aria-labelledby"] ?? O?.labelId : k["aria-labelledby"];
|
|
87
|
+
return /* @__PURE__ */ l("div", {
|
|
88
|
+
...Be,
|
|
89
|
+
ref: $e,
|
|
90
|
+
className: e("relative inline-flex flex-col", Re),
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ l("div", {
|
|
93
|
+
className: "relative flex items-center",
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ c("input", {
|
|
96
|
+
type: "text",
|
|
97
|
+
autoComplete: xe,
|
|
98
|
+
...k,
|
|
99
|
+
...G.getComboboxProps(),
|
|
100
|
+
"aria-expanded": J,
|
|
101
|
+
"aria-errormessage": je,
|
|
102
|
+
"aria-details": Me,
|
|
103
|
+
ref: Z,
|
|
104
|
+
disabled: m,
|
|
105
|
+
readOnly: v,
|
|
106
|
+
placeholder: ye,
|
|
107
|
+
autoCapitalize: Se,
|
|
108
|
+
autoCorrect: Ce,
|
|
109
|
+
maxLength: we,
|
|
110
|
+
inputMode: Ee,
|
|
111
|
+
spellCheck: De,
|
|
112
|
+
enterKeyHint: x,
|
|
113
|
+
autoFocus: S,
|
|
114
|
+
tabIndex: C,
|
|
115
|
+
value: q,
|
|
116
|
+
onChange: tt,
|
|
117
|
+
onClick: () => {
|
|
118
|
+
!F && M && P(!0);
|
|
119
|
+
},
|
|
120
|
+
onKeyDown: n(Fe, v ? void 0 : et),
|
|
121
|
+
onKeyUp: n(Ie, G.onKeyUp),
|
|
122
|
+
onFocus: Ne,
|
|
123
|
+
onBlur: n(Pe, () => L(null), { checkDefaultPrevented: !1 }),
|
|
124
|
+
className: e(re, "border-b-stroke-accessible", ie, ne, He && "border-destructive focus:border-b-destructive", de(Number($) + Number(Q)))
|
|
125
|
+
}),
|
|
126
|
+
$ && /* @__PURE__ */ c("button", {
|
|
127
|
+
type: "button",
|
|
128
|
+
"aria-label": b?.clear ?? "Clear selection",
|
|
129
|
+
disabled: m,
|
|
130
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
131
|
+
onClick: rt,
|
|
132
|
+
className: e("absolute flex h-6 w-6 items-center justify-center rounded bg-transparent p-0 text-muted-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground", Q ? "end-7" : "end-1", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100"),
|
|
133
|
+
children: /* @__PURE__ */ c(ae, {})
|
|
134
|
+
}),
|
|
135
|
+
Q && /* @__PURE__ */ c(fe, {
|
|
136
|
+
component: "Combobox",
|
|
137
|
+
expandIcon: y,
|
|
138
|
+
label: b?.expand ?? "Show options",
|
|
139
|
+
expanded: J,
|
|
140
|
+
listboxId: G.listboxId,
|
|
141
|
+
disabled: m || !!v,
|
|
142
|
+
onToggle: nt
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ c("span", {
|
|
147
|
+
role: "status",
|
|
148
|
+
className: "sr-only",
|
|
149
|
+
children: Je && Y
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ c(me, {
|
|
152
|
+
listbox: G,
|
|
153
|
+
layerId: Ye,
|
|
154
|
+
surfaceRef: Ze,
|
|
155
|
+
floatingProps: Qe,
|
|
156
|
+
open: F,
|
|
157
|
+
expanded: J,
|
|
158
|
+
emptyContent: I ? /* @__PURE__ */ c("div", {
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
className: "px-3 py-1.5 text-body-1 text-muted-foreground",
|
|
161
|
+
children: Y
|
|
162
|
+
}) : void 0,
|
|
163
|
+
"aria-label": k["aria-label"],
|
|
164
|
+
"aria-labelledby": it,
|
|
165
|
+
children: D
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ c(ce, {
|
|
168
|
+
name: be,
|
|
169
|
+
form: g,
|
|
170
|
+
disabled: m,
|
|
171
|
+
value: A,
|
|
172
|
+
type: "text",
|
|
173
|
+
required: Ve,
|
|
174
|
+
onInvalid: () => V.current?.focus()
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
u.displayName = "Combobox";
|
|
180
|
+
var d = a, f = o, p = /* @__PURE__ */ Object.assign(u, {
|
|
181
|
+
Option: a,
|
|
182
|
+
OptionGroup: o
|
|
183
|
+
});
|
|
184
|
+
//#endregion
|
|
185
|
+
export { p as Combobox, d as ComboboxOption, f as ComboboxOptionGroup, a as Option, o as OptionGroup };
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=Combobox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Combobox.mjs","names":["React","matchesText","item","text","ComboboxRoot","valueProp","openProp","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaInvalid","ariaRequired","ariaErrorMessage","ariaDetails","rest","props","onOptionSelect","warnDeprecated","field","useFieldContext","validates","required","readOnly","fieldProps","useFieldControl","invalidLook","isInvalidLook","value","setValue","useControllable","defaultValue","onValueChange","interactive","disabled","openState","setOpen","defaultOpen","onOpenChange","open","draft","setDraft","wasInteractive","setWasInteractive","lockedOpen","typedValue","setTypedValue","rootRef","inputRef","optionLabels","collectOptionLabels","children","filter","commitText","close","clearDraft","freeform","listbox","useListbox","next","optionLabel","inputText","expanded","noMatchesText","labels","surfaceOpen","noMatches","useListboxPopup","rootMergedRef","useMergedRefs","ref","inputMergedRef","controlRef","setReference","form","handleKeyDown","event","handleChange","handleExpandClick","handleClear","showExpand","showsExpandButton","expandIcon","showClear","clearable","listLabelledBy","cn","className","composeEventHandlers","onKeyDown","onKeyUp","onBlur","inputBase","inputFocus","disabledStyles","pickerEndPadding","DismissIcon","PickerExpandButton","ListboxSurface","HiddenInput","ComboboxOption","Option","ComboboxOptionGroup","OptionGroup","Combobox"],"sources":["../../../src/components/input/Combobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnDeprecated } from '../../lib/dev';\nimport { DismissIcon } from '../../lib/icons';\nimport type { Slot } from '../../lib/slot';\nimport { disabledStyles, focusRing, inputBase, inputFocus, inputInvalid } from '../../lib/styles';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useFieldContext, useFieldControl } from '../../hooks/useFieldControl';\nimport { useFormReset } from '../../hooks/useFormReset';\nimport { collectOptionLabels, useListbox, type ListboxItem } from '../../hooks/useListbox';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { HiddenInput } from '../internal/HiddenInput';\nimport { PickerExpandButton, showsExpandButton } from './Combobox.expand';\nimport { isInvalidLook } from './Input';\nimport { ListboxSurface, Option, OptionGroup, useListboxPopup } from './Option';\nimport { PICKER_ICON_BUTTON_CLASSES, pickerEndPadding } from './pickerStyles';\nimport type { RoutedHandlers } from './routedHandlers';\n\nexport { Option, OptionGroup } from './Option';\nexport type { OptionProps, OptionGroupProps } from './Option';\n\n/* ------------------------------------------------------------------ */\n/* Combobox */\n/* ------------------------------------------------------------------ */\n\n/**\n * The Combobox's built-in texts, for localization. Each member is optional and falls back to its\n * English default.\n */\nexport interface ComboboxLabels {\n /** Status text (announced, and shown in the popup) when the typed text matches no option.\n * @default 'No matches'\n */\n noMatches?: string;\n /** Name of the clear button (`clearable`).\n * @default 'Clear selection'\n */\n clear?: string;\n /** Name of the expand button at the end of the input.\n * @default 'Show options'\n */\n expand?: string;\n}\n\n/** Properties for the Combobox component. */\nexport interface ComboboxProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue' | RoutedHandlers\n> {\n /** Controlled selected value (`''` for none). */\n value?: string;\n /**\n * Initial selected value for uncontrolled usage.\n * @default ''\n */\n defaultValue?: string;\n /**\n * Called with the new value when it changes: an option is selected, or (with `freeform`) the\n * text changes. Not called when the current option is selected again.\n */\n onValueChange?: (value: string) => void;\n /**\n * Called on every option activation, also when the current option is selected again (and, with\n * `freeform`, on every text change).\n * @deprecated Use `onValueChange`.\n */\n onOptionSelect?: (value: string) => void;\n /**\n * Controlled open state of the listbox. The list renders only in the browser: an open combobox\n * is closed in the server HTML and opens once it has hydrated.\n */\n open?: boolean;\n /**\n * Initial open state for uncontrolled usage. A combobox that starts disabled or read-only\n * starts closed. The list renders only in the browser: it is closed in the server HTML and opens\n * once the combobox has hydrated.\n * @default false\n */\n defaultOpen?: boolean;\n /** Called when the listbox opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Placeholder text shown when no value is selected. */\n placeholder?: string;\n /**\n * Whether the combobox is disabled and non-interactive.\n * @default false\n */\n disabled?: boolean;\n /**\n * Whether the typed text is itself the value. Without it, typing only filters the options (the\n * first match becomes active, so Enter selects it) and the input shows the selected option's\n * label again when the listbox closes or loses focus. With it, the input shows typed text as\n * typed (also when it equals an option's value), a selected option's label, and a controlled\n * `value` as soon as the parent sets it (a parent that normalizes or rejects the text).\n * @default false\n */\n freeform?: boolean;\n /** Name of the value in form submissions (renders a hidden input). */\n name?: string;\n /** Id of the form the value belongs to, when the Combobox is outside it. */\n form?: string;\n /**\n * A value is required to submit the form (native constraint validation). Like a native readonly\n * input, a `readOnly` Combobox does not block submission.\n */\n required?: boolean;\n /**\n * The `autocomplete` attribute of the `<input role=\"combobox\">`. Browser autofill is off unless\n * you set it (for example `'on'`).\n * @default 'off'\n */\n autoComplete?: string;\n /** The maximum length of the typed text (`maxlength` of the `<input role=\"combobox\">`). */\n maxLength?: number;\n /**\n * The value cannot be changed: the input is read-only and the listbox neither opens (click,\n * keyboard, a controlled `open`) nor commits; Escape is left to the page. Turning it (or\n * `disabled`) on while the listbox is open closes it (`onOpenChange(false)`).\n */\n readOnly?: boolean;\n /**\n * Shows a clear button while a value is selected (not while `readOnly`; while `disabled` it is\n * shown disabled, as in DatePicker and TimePicker). It clears the value\n * (`onValueChange('')`), drops typed text, closes the list and moves focus to the input. It is\n * a tab stop after the input.\n * @default false\n */\n clearable?: boolean;\n /**\n * The glyph of the expand button at the end of the input (default: a chevron). The button\n * opens and closes the list without moving focus out of the input and is not a tab stop\n * (Alt+ArrowDown opens the list from the keyboard). `null` or `undefined` keep the chevron;\n * `false`, or a value that renders nothing, hides the button. Decorative content rendered\n * inside the built-in button: a `<button>` or `Button` passed here is not nested (its children\n * become the glyph, with a development warning).\n */\n expandIcon?: Slot<'span'>;\n /**\n * The built-in texts (the \"No matches\" status and the names of the clear and expand buttons),\n * for localization. Unset members keep their English defaults.\n */\n labels?: ComboboxLabels;\n /** Called when the `<input role=\"combobox\">` receives focus (the root keeps other handlers). */\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n /** Called when the `<input role=\"combobox\">` loses focus. */\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n /**\n * Called on a key press in the `<input role=\"combobox\">`, before the built-in listbox keys;\n * `event.preventDefault()` skips them.\n */\n onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;\n /** Called when a key is released in the `<input role=\"combobox\">`. */\n onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;\n /** Ref to the `<input role=\"combobox\">` (the focusable element). */\n controlRef?: React.Ref<HTMLInputElement>;\n /** Ref to the root `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nfunction matchesText(item: ListboxItem, text: string): boolean {\n return (item.textValue ?? item.label).toLowerCase().includes(text.toLowerCase());\n}\n\nconst ComboboxRoot = (props: ComboboxProps) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange,\n onOptionSelect,\n open: openProp,\n defaultOpen,\n onOpenChange,\n placeholder,\n disabled = false,\n freeform = false,\n name,\n form,\n required,\n autoComplete = 'off',\n autoCapitalize,\n autoCorrect,\n maxLength,\n readOnly,\n clearable = false,\n expandIcon,\n labels,\n inputMode,\n spellCheck,\n enterKeyHint,\n autoFocus,\n tabIndex,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-errormessage': ariaErrorMessage,\n 'aria-details': ariaDetails,\n onFocus,\n onBlur,\n onKeyDown,\n onKeyUp,\n controlRef,\n className,\n children,\n ref,\n ...rest\n } = props;\n\n if (onOptionSelect !== undefined) warnDeprecated('Combobox', 'onOptionSelect', 'onValueChange');\n\n const field = useFieldContext();\n const isRequired = required ?? field?.required ?? false;\n const validates = isRequired && !readOnly;\n const fieldProps = useFieldControl({\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n // An explicit `required={false}` wins over a required Field, so aria-required matches\n // `isRequired`.\n 'aria-required': ariaRequired ?? required,\n });\n // The error look follows the resolved state: the consumer's `aria-invalid` or the Field's.\n const invalidLook = isInvalidLook(false, fieldProps['aria-invalid']);\n\n const [value, setValue] = useControllable(valueProp, defaultValue ?? '', onValueChange);\n const interactive = !disabled && !readOnly;\n // A combobox that starts disabled or read-only never shows its list, so it starts closed (no\n // close to report later).\n const [openState, setOpen] = useControllable(\n openProp,\n (defaultOpen ?? false) && interactive,\n onOpenChange,\n );\n const open = openState && interactive;\n // Text typed since the last commit, the filter; `null` shows the committed value's label\n // (input-pickers#7). Freeform: the input shows the value, and the draft follows that text.\n const [draft, setDraft] = React.useState<string | null>(null);\n // Locking the control (readOnly/disabled) while typing drops the draft, so the input shows the\n // committed value again (adjust-during-render pattern, C-HOOKS).\n const [wasInteractive, setWasInteractive] = React.useState(interactive);\n if (wasInteractive !== interactive) {\n setWasInteractive(interactive);\n if (!interactive) setDraft(null);\n }\n // Locking also closes the list itself, not only the derived `open`, so unlocking does not reopen\n // it without a user action. The close is reported through onOpenChange (a consumer callback from\n // an effect, C-HOOKS); a controlled `open` that stays true is still not shown while locked.\n const lockedOpen = !interactive && openState;\n React.useEffect(() => {\n if (lockedOpen) setOpen(false);\n }, [lockedOpen, setOpen]);\n\n // Freeform: the value the user typed last. While the value still equals it, the input shows it\n // as typed, even when it equals an option's value (not that option's label).\n const [typedValue, setTypedValue] = React.useState<string | null>(null);\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n\n const optionLabels = React.useMemo(() => collectOptionLabels(children), [children]);\n const filter = React.useMemo(\n () => (draft ? (item: ListboxItem) => matchesText(item, draft) : undefined),\n [draft],\n );\n\n const commitText = (text: string) => {\n setTypedValue(text);\n setValue(text);\n onOptionSelect?.(text);\n };\n\n const close = () => {\n setOpen(false);\n setDraft(null);\n };\n\n // APG: Escape on a closed listbox clears the textbox. Freeform: the text is the value, so it is\n // cleared. Otherwise only a typed filter is dropped (the input shows the selected label again);\n // without one there is nothing to clear and Escape is left to the page.\n let clearDraft: (() => void) | undefined;\n if (freeform) {\n clearDraft = () => {\n setDraft(null);\n commitText('');\n };\n } else if (draft) {\n clearDraft = () => setDraft(null);\n }\n\n const listbox = useListbox({\n open,\n onOpenChange: (next) => {\n if (next) setOpen(true);\n else close();\n },\n mode: 'editable',\n selectedValues: value ? [value] : [],\n onSelect: (next) => {\n setValue(next);\n onOptionSelect?.(next);\n setDraft(null);\n setTypedValue(null);\n },\n filter,\n // Typing a filter makes its first match active (like Fluent's Combobox), so Enter selects what\n // the list shows instead of submitting the form. Nothing is active on open or with the text\n // cleared. Freeform: the text is the value, so Enter keeps it unless the user moved to an\n // option.\n autoHighlight: !freeform && draft ? 'first' : false,\n idPrefix: 'combobox-listbox',\n onClearDraft: clearDraft,\n });\n\n // The input text. Freeform: the value as typed while it is the value the user typed last, else\n // the label of the option with that value, else the value itself — so the text follows a\n // controlled parent that normalizes or rejects what was typed while the input still has focus.\n // Otherwise: the typed filter, else the selected option's label.\n const optionLabel = value\n ? (listbox.getItem(value)?.label ?? optionLabels.get(value))\n : undefined;\n let inputText: string;\n if (freeform) inputText = value === typedValue ? value : (optionLabel ?? value);\n else inputText = draft ?? optionLabel ?? '';\n // Freeform: the filter follows the text (adjust-during-render pattern, C-HOOKS; the text does not\n // depend on the filter, so this settles in one pass).\n if (freeform && draft !== null && draft !== inputText) setDraft(inputText);\n\n const expanded = open && listbox.items.length > 0;\n const noMatchesText = labels?.noMatches ?? 'No matches';\n // The popup shows the list, or \"No matches\" for a draft.\n const surfaceOpen = open && (expanded || !!draft);\n const noMatches = surfaceOpen && !expanded;\n const { layerId, setReference, surfaceRef, floatingProps } = useListboxPopup({\n open,\n surfaceOpen,\n onDismiss: close,\n rootRef,\n anchorRef: inputRef,\n });\n\n const rootMergedRef = useMergedRefs<HTMLDivElement>(rootRef, ref);\n const inputMergedRef = useMergedRefs<HTMLInputElement>(inputRef, controlRef, setReference);\n\n useFormReset(\n inputRef,\n () => {\n setValue(defaultValue ?? '');\n setDraft(null);\n setTypedValue(null);\n },\n form,\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Escape' && open && !surfaceOpen && !event.nativeEvent.isComposing) {\n // Open with nothing shown (no options): close as a closed list would handle Escape — clear\n // the text if there is any, otherwise leave the key to an enclosing layer (overlays#1).\n close();\n if (clearDraft && event.currentTarget.value !== '') {\n event.preventDefault();\n clearDraft();\n }\n return;\n }\n listbox.onKeyDown(event);\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const text = event.target.value;\n setDraft(text);\n if (!open) setOpen(true);\n if (freeform) commitText(text);\n };\n\n // The expand button opens and closes the list like the input's own keys; focus stays in (or\n // returns to) the input.\n const handleExpandClick = () => {\n if (!interactive) return;\n if (open) close();\n else setOpen(true);\n inputRef.current?.focus();\n };\n\n // Clearing is not an option activation: the state is set directly, not through `commitText`\n // (which calls the deprecated `onOptionSelect` in freeform mode). The button disappears with the\n // value, so focus moves to the input explicitly (C-DISABLED).\n const handleClear = () => {\n setValue('');\n setTypedValue(null);\n setDraft(null);\n setOpen(false);\n inputRef.current?.focus();\n };\n\n const showExpand = showsExpandButton(expandIcon);\n // Read-only comboboxes offer no clear action (the value cannot change).\n const showClear = clearable && value !== '' && !readOnly;\n\n const listLabelledBy =\n fieldProps['aria-label'] === undefined\n ? (fieldProps['aria-labelledby'] ?? field?.labelId)\n : fieldProps['aria-labelledby'];\n\n return (\n <div {...rest} ref={rootMergedRef} className={cn('relative inline-flex flex-col', className)}>\n <div className=\"relative flex items-center\">\n <input\n type=\"text\"\n autoComplete={autoComplete}\n {...fieldProps}\n {...listbox.getComboboxProps()}\n aria-expanded={expanded}\n aria-errormessage={ariaErrorMessage}\n aria-details={ariaDetails}\n ref={inputMergedRef}\n disabled={disabled}\n readOnly={readOnly}\n placeholder={placeholder}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n maxLength={maxLength}\n inputMode={inputMode}\n spellCheck={spellCheck}\n enterKeyHint={enterKeyHint}\n autoFocus={autoFocus}\n tabIndex={tabIndex}\n value={inputText}\n onChange={handleChange}\n onClick={() => {\n if (!open && interactive) setOpen(true);\n }}\n // Read-only: no listbox keys at all (they would open, commit or clear the value).\n onKeyDown={composeEventHandlers(onKeyDown, readOnly ? undefined : handleKeyDown)}\n onKeyUp={composeEventHandlers(onKeyUp, listbox.onKeyUp)}\n onFocus={onFocus}\n onBlur={composeEventHandlers(onBlur, () => setDraft(null), {\n checkDefaultPrevented: false,\n })}\n className={cn(\n inputBase,\n 'border-b-stroke-accessible',\n inputFocus,\n disabledStyles,\n invalidLook && inputInvalid,\n pickerEndPadding(Number(showClear) + Number(showExpand)),\n )}\n />\n {showClear && (\n <button\n type=\"button\"\n aria-label={labels?.clear ?? 'Clear selection'}\n disabled={disabled}\n // Keeps focus in the input, so its blur does not act on a draft before the clear.\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleClear}\n className={cn(\n PICKER_ICON_BUTTON_CLASSES,\n showExpand ? 'end-7' : 'end-1',\n focusRing,\n disabledStyles,\n )}\n >\n <DismissIcon />\n </button>\n )}\n {showExpand && (\n <PickerExpandButton\n component=\"Combobox\"\n expandIcon={expandIcon}\n label={labels?.expand ?? 'Show options'}\n expanded={expanded}\n listboxId={listbox.listboxId}\n disabled={disabled || !!readOnly}\n onToggle={handleExpandClick}\n />\n )}\n </div>\n {/* Mounted before its text: a live region added together with its text is not announced by\n every screen reader. The row in the popup is the visible copy. */}\n <span role=\"status\" className=\"sr-only\">\n {noMatches && noMatchesText}\n </span>\n <ListboxSurface\n listbox={listbox}\n layerId={layerId}\n surfaceRef={surfaceRef}\n floatingProps={floatingProps}\n open={open}\n expanded={expanded}\n emptyContent={\n draft ? (\n <div aria-hidden=\"true\" className=\"px-3 py-1.5 text-body-1 text-muted-foreground\">\n {noMatchesText}\n </div>\n ) : undefined\n }\n aria-label={fieldProps['aria-label']}\n aria-labelledby={listLabelledBy}\n >\n {children}\n </ListboxSurface>\n <HiddenInput\n name={name}\n form={form}\n disabled={disabled}\n value={value}\n type=\"text\"\n // Like a native readonly input, a read-only Combobox is barred from constraint validation\n // (the user could not fix it); its value is still submitted.\n required={validates}\n onInvalid={() => inputRef.current?.focus()}\n />\n </div>\n );\n};\nComboboxRoot.displayName = 'Combobox';\n\n/** Flat name of `Combobox.Option` for React Server Components. */\nexport const ComboboxOption = Option;\n/** Flat name of `Combobox.OptionGroup` for React Server Components. */\nexport const ComboboxOptionGroup = OptionGroup;\n\n/**\n * An editable combobox: a text input with a filterable listbox of `Option`s (APG combobox with\n * list autocomplete). Typing filters the options; ArrowDown/ArrowUp move the highlight\n * (`aria-activedescendant`), Enter selects, Escape closes. Without `freeform` the text is only a\n * filter: its first match becomes active while typing, and the input shows the selected option's\n * label again when the listbox closes. With `freeform` the text itself is the value. Text that\n * matches no option shows \"No matches\" (`labels.noMatches`), announced through a status region.\n * The expand button at the end of the input (a chevron, see `expandIcon`) opens and closes the\n * list without taking focus from the input and is not a tab stop; `clearable` adds a clear button,\n * a tab stop after the input. Both sit with the input in a wrapper `<div>` inside the root.\n *\n * The `<input>` receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,\n * `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`, `autoFocus`,\n * `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes `autoComplete`,\n * `autoCapitalize`, `autoCorrect`, `maxLength`, `inputMode`, `spellCheck` and `enterKeyHint`.\n * `ref`, `className`, `style`, other `aria-*` attributes and the remaining props stay on the root\n * `<div>`. Inside a `Field` the input is labelled and described by it. It shows the error look\n * whenever it ends up `aria-invalid` (its own `aria-invalid` or a `Field` error). With\n * `name`/`required` the value takes part in form submission, validation and reset. The open\n * listbox renders in a portal; while closed it stays in the DOM, hidden.\n *\n * Sub-components: `Combobox.Option`, `Combobox.OptionGroup`. React Server Components import the\n * flat names `ComboboxOption` / `ComboboxOptionGroup` (dotted access needs a client file).\n */\nexport const Combobox = /* @__PURE__ */ Object.assign(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IAC3B,UAAAZ,MAAaH;GACV,CAAA;GACN,kBAACmC,IAAD;IACW;IACA;IACG;IACG;IACT;IACI;IACV,cACE1D,IACE,kBAAC,OAAD;KAAK,eAAY;KAAO,WAAU;KAC/B,UAAAuB;IACE,CAAA,IACH,KAAA;IAEN,cAAYvC,EAAW;IACvB,mBAAiB6D;IAEhB;GACa,CAAA;GAChB,kBAACc,IAAD;IACQ;IACA;IACI;IACH;IACP,MAAK;IAGL,UAAU9E;IACV,iBAAiB2B,EAAS,SAAS,MAAM;GAC1C,CAAA;EACE;;AAET;AACA,EAAa,cAAc;AAG3B,IAAaoD,IAAiBC,GAEjBC,IAAsBC,GA0BtBC,IAA2B,uBAAO,OAAOnG,GAAc;CAClE;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/composeEventHandlers.cjs"),i=require("../../hooks/useControllable.cjs"),a=require("../../hooks/useId.cjs"),o=require("../../lib/direction.cjs"),ee=require("../../lib/focus.cjs"),te=require("../../hooks/useMergedRefs.cjs"),ne=require("../../hooks/useIsClient.cjs"),s=require("../../lib/aria.cjs"),re=require("../../hooks/useFieldControl.cjs"),ie=require("../../hooks/useDismiss.cjs"),ae=require("../portal/Portal.cjs"),c=require("../../lib/styles.cjs"),l=require("../../lib/icons.cjs"),oe=require("./Input.cjs"),se=require("../../hooks/useFormReset.cjs"),ce=require("../internal/HiddenInput.cjs"),le=require("../../hooks/usePopupPosition.cjs"),u=require("./dateUtils.cjs"),ue=require("../../hooks/useFocusTrap.cjs"),de=require("../../hooks/useRestoreFocus.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("react/jsx-runtime"),fe=require("react-dom");var pe=e=>e?`Enter a date in the format ${e}.`:`Enter a valid date.`,me=(e,t)=>e!==void 0&&t!==void 0?`Enter a date between ${e} and ${t}.`:e===void 0?`Enter a date on or before ${t}.`:`Enter a date on or after ${e}.`,he=`absolute flex h-6 w-6 items-center justify-center rounded bg-transparent p-0 text-muted-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground`,ge=`flex h-8 w-8 items-center justify-center rounded bg-transparent p-0 text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover`,_e=`flex h-8 w-8 items-center justify-center rounded bg-transparent p-0 text-caption-1 text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover data-[outside]:text-muted-foreground data-[today]:border data-[today]:border-primary data-[today]:font-semibold data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-primary-foreground not-disabled:not-aria-disabled:data-[selected]:hover:bg-primary-hover aria-disabled:line-through`;function ve(e){let t=[];for(let n=0;n<e.length;n+=7)t.push(e.slice(n,n+7));return t}var p=e=>{let{value:p,defaultValue:ye,onValueChange:be,onChange:xe,formatDate:m,parseDate:Se,locale:h,minDate:g,maxDate:_,disabledDates:Ce,placeholder:we=`Select a date`,disabled:v=!1,readOnly:y,clearable:Te=!1,firstDayOfWeek:b=0,open:Ee,defaultOpen:De,onOpenChange:Oe,onInvalidInput:ke,labels:x,name:Ae,form:je,required:Me,autoComplete:Ne=`off`,autoCapitalize:Pe,autoCorrect:Fe,enterKeyHint:Ie,inputMode:Le,spellCheck:Re,autoFocus:ze,tabIndex:Be,id:Ve,"aria-label":He,"aria-labelledby":Ue,"aria-describedby":We,"aria-invalid":Ge,"aria-required":Ke,"aria-errormessage":qe,"aria-details":Je,onFocus:Ye,onBlur:Xe,onKeyDown:Ze,onKeyUp:Qe,controlRef:$e,className:et,ref:tt,...nt}=e;xe!==void 0&&n.warnDeprecated(`DatePicker`,`onChange`,`onValueChange`);let rt=m!==void 0,S=Se!==void 0;d.useEffect(()=>{rt&&!S&&n.warnOnce(`DatePicker:formatDate-without-parseDate`,"DatePicker: `formatDate` is set without `parseDate`. Typed dates are parsed with the default parser for `locale` (its numeric format or yyyy-mm-dd), which may not read your format; pass `parseDate` as the inverse of `formatDate`.")},[rt,S]),d.useEffect(()=>{h!==void 0&&!u.isValidLocaleTag(h)&&n.warnOnce(`DatePicker:invalid-locale:${h}`,`DatePicker: \`locale\` "${h}" is not a valid BCP 47 language tag (use hyphens, as in "en-US"). The runtime default locale formats and parses the dates instead, so the server and the browser may render different text.`)},[h]);let[C,it]=i.useControllable(p,ye??null,e=>{be?.(e),xe?.(e)}),w=!v&&!y,[T,E]=i.useControllable(Ee,(De??!1)&&w,Oe),at=ne.useIsClient(),D=T&&w&&at,ot=Ee!==void 0;d.useEffect(()=>{!w&&T&&!ot&&E(!1)},[w,T,ot,E]);let O=e=>m?m(e):u.formatDate(e,h),st=e=>Se?Se(e):u.parseDate(e,h),[k,A]=d.useState(null),[j,M]=d.useState(null),[ct,lt]=d.useState(w);ct!==w&&(lt(w),w||(A(null),M(null)));let N=C?u.formatISODate(C):``,[ut,dt]=d.useState(N);ut!==N&&(dt(N),j!==null&&(A(null),M(null)));let ft=e=>!u.isDateInRange(e,g,_)||!!Ce?.(u.startOfDay(e)),P=e=>{let t=e?u.startOfDay(e):null;(t?u.isSameDay(t,C):C===null)||it(t),A(null),M(null)},F=e=>{if(!e.trim())return P(null),!0;let t=st(e),n=null;if(!t||Number.isNaN(t.getTime())?n=`unparseable`:u.isDateInRange(t,g,_)?Ce?.(u.startOfDay(t))&&(n=`disabled`):n=`out-of-range`,n||!t){let t=n??`unparseable`;return M(t),ke?.(e,t),!1}return P(t),!0},I=u.startOfDay(new Date),pt=()=>u.startOfMonth(u.clampDate(C??I,g,_)),[L,R]=d.useState(pt),[mt,z]=d.useState(null),[B,V]=d.useState(!1),[ht,gt]=d.useState(D);ht!==D&&(gt(D),D&&(R(pt()),z(null))),B&&!D&&V(!1);let H=d.useMemo(()=>ve(u.getCalendarDays(L,b)),[L,b]),U=e=>!!e&&u.isSameMonth(e,L),_t=e=>!!e&&e>=H[0][0]&&e<=H[H.length-1][6],vt=u.clampDate(I,g,_),yt=u.clampDate(L,g,_),W=_t(mt)?mt:U(C)?u.startOfDay(C):U(vt)?vt:U(yt)?yt:L,G=u.formatISODate(W),bt=e=>{let t=u.clampDate(e,g,_);z(t),u.isSameMonth(t,L)||R(u.startOfMonth(t))},xt=e=>{let t=u.addMonths(L,e),n=u.clampDate(u.addMonths(W,e),g,_);R(t),z(u.isSameMonth(n,t)?n:null)},St=e=>{u.isSameDay(e,W)||z(e)},Ct=!!g&&u.addDays(L,-1)<u.startOfDay(g),wt=!!_&&u.addMonths(L,1)>u.startOfDay(_),Tt=d.useMemo(()=>u.getWeekdayNames(h,b),[h,b]),K=d.useRef(null),q=d.useRef(null),J=d.useRef(null),Et=d.useRef(null),Y=d.useRef(null),[Dt,Ot]=d.useState(null),kt=te.useMergedRefs($e,K),At=a.useId(`datepicker-dialog`),X=a.useId(`datepicker-heading`),Z=a.useId(`datepicker-grid`),jt=a.useId(`datepicker-error`),Mt=e=>{Y.current=e,E(!1)},{layerId:Nt}=ie.useDismiss({open:D,onDismiss:(e,t)=>{let n=e===`outside-press`&&t.target instanceof Element?t.target.closest(ee.FOCUSABLE_SELECTOR):null;Mt(n??(B?K.current:null))},refs:[Et,q],anchorRef:q,kind:`modal`}),{setReference:Pt,setFloating:Ft,floatingProps:It}=le.usePopupPosition({open:D,side:`bottom`,align:`start`}),Lt=te.useMergedRefs(Et,Ot,Ft);ue.useFocusTrap(Dt,{enabled:D,layerId:Nt,initialFocus:()=>J.current?.querySelector(`button[tabindex="0"]`)??null}),de.useRestoreFocus({enabled:D,container:Dt,triggerRef:q,finalFocusRef:Y,onlyIfFocusInside:!0}),d.useLayoutEffect(()=>{D&&(Y.current=null)},[D]),d.useLayoutEffect(()=>{let e=J.current;if(!e)return;let t=e.ownerDocument.activeElement;if(!t||!e.contains(t))return;let n=e.querySelector(`button[data-date="${G}"]`);n&&n!==t&&n.focus()},[G]);let Rt=re.useFieldContext(),zt=(Me??Rt?.required??!1)&&!y,Bt=j!==null&&!Rt?.hasErrorMessage,Vt=re.useFieldControl({id:Ve,"aria-label":He,"aria-labelledby":Ue,"aria-describedby":s.joinIds(We,Bt?jt:void 0),"aria-invalid":j!==null||Ge,"aria-required":Ke??Me}),Ht=oe.isInvalidLook(!1,Vt[`aria-invalid`]);se.useFormReset(K,()=>P(ye??null),je);let Q=Te&&!y&&C!==null,Ut=e=>{w&&(A(e.target.value),M(null))},Wt=r.composeEventHandlers(Ze,e=>{w&&!e.nativeEvent.isComposing&&(e.key===`Enter`&&k!==null?(e.preventDefault(),F(k)):e.key===`Tab`&&!e.shiftKey&&Q&&k!==null&&!k.trim()?(0,fe.flushSync)(()=>F(k)):e.key===`ArrowDown`&&e.altKey&&!D&&(e.preventDefault(),k!==null&&j===null&&F(k),V(!0),E(!0)))}),Gt=r.composeEventHandlers(Xe,()=>{w&&k!==null&&j===null&&F(k)}),Kt=()=>{w&&(Y.current=null,V(!1),E(!D))},qt=()=>{w&&(P(null),K.current?.focus())},Jt=e=>{e.preventDefault()},Yt=e=>{w&&!ft(e)&&(P(e),Mt(K.current))},Xt=e=>{e.key!==`Escape`||e.defaultPrevented||e.nativeEvent.isComposing||(e.preventDefault(),Mt(B?K.current:null))},Zt=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;let t=(W.getDay()-b+7)%7,n;switch(e.key){case`ArrowLeft`:case`ArrowRight`:{let t=o.getArrowIntent(e.key,{orientation:`horizontal`,dir:o.getDirection(e.currentTarget)});n=u.addDays(W,t===`next`?1:-1);break}case`ArrowDown`:n=u.addDays(W,7);break;case`ArrowUp`:n=u.addDays(W,-7);break;case`PageDown`:n=u.addMonths(W,e.shiftKey?12:1);break;case`PageUp`:n=u.addMonths(W,e.shiftKey?-12:-1);break;case`Home`:n=u.addDays(W,-t);break;case`End`:n=u.addDays(W,6-t);break;default:return}e.preventDefault(),bt(n)},Qt=k??(C?O(C):``),$=``;return j===`unparseable`?$=(x?.invalidDate??pe)(S?void 0:u.getLocaleDateFormat(h).pattern):j===`out-of-range`&&(g||_)?$=(x?.outOfRange??me)(g?O(u.startOfDay(g)):void 0,_?O(u.startOfDay(_)):void 0):j===`disabled`&&($=x?.unavailableDate??`This date is not available.`),(0,f.jsxs)(`div`,{...nt,ref:tt,className:t.cn(`relative inline-flex flex-col`,et),children:[(0,f.jsxs)(`div`,{ref:Pt,className:`relative flex items-center`,children:[(0,f.jsx)(`input`,{ref:kt,type:`text`,...Vt,"aria-errormessage":qe,"aria-details":Je,value:Qt,onChange:Ut,onFocus:Ye,onBlur:Gt,onKeyDown:Wt,onKeyUp:Qe,placeholder:we,disabled:v,readOnly:y,autoComplete:Ne,autoCapitalize:Pe,autoCorrect:Fe,enterKeyHint:Ie,inputMode:Le,spellCheck:Re,autoFocus:ze,tabIndex:Be,className:t.cn(c.inputBase,`border-b-stroke-accessible`,c.inputFocus,c.disabledStyles,Ht&&`border-destructive focus:border-b-destructive`,Q?`pe-14`:`pe-8`)}),Q&&(0,f.jsx)(`button`,{type:`button`,"aria-label":x?.clear??`Clear date`,disabled:v,onMouseDown:Jt,onClick:qt,className:t.cn(he,`end-7`,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`),children:(0,f.jsx)(l.DismissIcon,{})}),(0,f.jsx)(`button`,{ref:q,type:`button`,"aria-label":x?.openCalendar??`Open calendar`,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":D?At:void 0,disabled:v||y,onClick:Kt,className:t.cn(he,`end-1`,c.focusRing,c.disabledStyles),children:(0,f.jsx)(l.CalendarIcon,{})})]}),Bt&&(0,f.jsx)(`p`,{id:jt,role:`alert`,className:`mt-1 text-caption-1 text-error`,children:$}),(0,f.jsx)(ce.HiddenInput,{name:Ae,form:je,disabled:v,value:C?u.formatISODate(C):``,type:`text`,required:zt,onInvalid:()=>K.current?.focus()}),D&&(0,f.jsx)(ae.Portal,{layerId:Nt,children:(0,f.jsxs)(`div`,{ref:Lt,id:At,role:`dialog`,"aria-modal":`true`,"aria-labelledby":X,...It,"data-state":`open`,onKeyDown:Xt,className:`rounded-md border border-border bg-background p-3 text-foreground shadow-16`,children:[(0,f.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,f.jsx)(`button`,{type:`button`,"aria-label":x?.previousMonth??`Previous month`,"aria-controls":Z,...s.focusableDisabledProps(Ct),onClick:s.preventIfDisabled(Ct,()=>xt(-1)),className:t.cn(ge,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`),children:(0,f.jsx)(l.ChevronLeftIcon,{className:`wave-rtl:-scale-x-100`})}),(0,f.jsx)(`h2`,{id:X,"aria-live":`polite`,className:`text-body-1 font-semibold`,children:u.formatMonthYear(L,h)}),(0,f.jsx)(`button`,{type:`button`,"aria-label":x?.nextMonth??`Next month`,"aria-controls":Z,...s.focusableDisabledProps(wt),onClick:s.preventIfDisabled(wt,()=>xt(1)),className:t.cn(ge,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`),children:(0,f.jsx)(l.ChevronRightIcon,{className:`wave-rtl:-scale-x-100`})})]}),(0,f.jsxs)(`table`,{ref:J,id:Z,role:`grid`,"aria-labelledby":X,onKeyDown:Zt,className:`border-collapse`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsx)(`tr`,{children:Tt.map(e=>(0,f.jsxs)(`th`,{scope:`col`,abbr:e.long,"aria-label":e.long,className:`h-8 w-8 text-center text-caption-1 font-normal text-muted-foreground`,children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:e.short}),(0,f.jsx)(`span`,{className:`sr-only`,children:e.long})]},e.long))})}),(0,f.jsx)(`tbody`,{children:H.map((e,n)=>(0,f.jsx)(`tr`,{children:e.map((e,n)=>{let r=u.formatISODate(e),i=u.isSameDay(e,C),a=u.isSameDay(e,I),o=r===G,ee=ft(e);return(0,f.jsx)(`td`,{role:`gridcell`,"aria-selected":i,className:`p-0`,children:(0,f.jsx)(`button`,{type:`button`,tabIndex:o?0:-1,"aria-label":u.formatDayLabel(e,h),"aria-pressed":i||void 0,"aria-current":a?`date`:void 0,...s.focusableDisabledProps(ee),"data-date":r,"data-selected":i?``:void 0,"data-today":a?``:void 0,"data-outside":u.isSameMonth(e,L)?void 0:``,onFocus:()=>St(e),onClick:()=>Yt(e),className:t.cn(_e,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,`disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100`,i&&c.forcedColors.selectedLeaf),children:u.formatDayNumber(e,h)})},n)})},n))})]})]})})]})};p.displayName=`DatePicker`,exports.DatePicker=p;
|
|
2
|
+
//# sourceMappingURL=DatePicker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.cjs","names":["isValidLocaleTag","useControllable","useIsClient","formatLocaleDate","parseLocaleDate","React","formatISODate","isDateInRange","startOfDay","isSameDay","startOfMonth","clampDate","getCalendarDays","isSameMonth","addMonths","addDays","getWeekdayNames","useMergedRefs","useId","useDismiss","FOCUSABLE_SELECTOR","usePopupPosition","useFieldContext","useFieldControl","joinIds","isInvalidLook","composeEventHandlers","getArrowIntent","getDirection","getLocaleDateFormat","cn","inputBase","inputFocus","disabledStyles","DismissIcon","focusRing","CalendarIcon","HiddenInput","Portal","focusableDisabledProps","preventIfDisabled","ChevronLeftIcon","formatMonthYear","ChevronRightIcon","formatDayLabel","forcedColors","formatDayNumber","require_runtime","require_cn","require_dev","require_composeEventHandlers","require_useControllable","require_useId","require_direction","require_focus","require_useMergedRefs","require_useIsClient","require_aria","require_useFieldControl","require_useDismiss","require_Portal","require_styles","require_icons","require_Input","require_useFormReset","require_HiddenInput","require_usePopupPosition","require_dateUtils","require_useFocusTrap","require_useRestoreFocus","react","react_jsx_runtime","react_dom","defaultInvalidDateLabel","pattern","defaultOutOfRangeLabel","min","max","ICON_BUTTON_CLASSES","NAV_BUTTON_CLASSES","DAY_CLASSES","toWeeks","weeks","i","days","DatePicker","valueProp","formatDateProp","parseDateProp","openProp","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaInvalid","ariaRequired","ariaErrorMessage","ariaDetails","rest","props","onChange","hasCustomFormat","hasCustomParse","locale","selectedDate","setSelectedDate","defaultValue","onValueChange","next","interactive","disabled","readOnly","openState","setOpen","defaultOpen","onOpenChange","isClient","isOpen","openControlled","format","date","parse","text","draft","setDraft","invalid","setInvalid","wasInteractive","setWasInteractive","selectedDay","seenDay","setSeenDay","isUnavailable","minDate","maxDate","disabledDates","commitDate","normalized","commitDraft","parsed","reason","rejected","onInvalidInput","today","initialView","viewMonth","setViewMonth","focusedDay","setFocusedDay","openedFromInput","setOpenedFromInput","openSeen","setOpenSeen","firstDayOfWeek","inView","inGrid","clampedToday","firstInRange","focusTarget","focusIso","moveFocus","target","navigateMonth","nextView","delta","moved","handleDayFocus","day","previousDisabled","nextDisabled","weekdays","inputRef","toggleRef","gridRef","surfaceRef","restoreTargetRef","surface","setSurface","inputRefs","controlRef","dialogId","headingId","gridId","errorId","close","restoreTo","event","surfaceRefs","setFloating","grid","active","button","field","validates","required","showOwnError","fieldProps","invalidLook","form","showClear","clearable","handleInputChange","handleInputKeyDown","onKeyDown","handleInputBlur","onBlur","handleToggle","handleClear","handleClearMouseDown","selectDate","handleDialogKeyDown","handleGridKeyDown","weekOffset","intent","inputText","errorMessage","labels","className","setReference","floatingProps","weekday","week","iso","isSelected","isToday","isFocused","unavailable","column","row"],"sources":["../../../src/components/input/DatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport { cn } from '../../lib/cn';\nimport { focusableDisabledProps, joinIds, preventIfDisabled } from '../../lib/aria';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnDeprecated, warnOnce } from '../../lib/dev';\nimport { getArrowIntent, getDirection } from '../../lib/direction';\nimport { FOCUSABLE_SELECTOR } from '../../lib/focus';\nimport { CalendarIcon, ChevronLeftIcon, ChevronRightIcon, DismissIcon } from '../../lib/icons';\nimport {\n disabledStyles,\n focusRing,\n forcedColors,\n inputBase,\n inputFocus,\n inputInvalid,\n} from '../../lib/styles';\nimport { useControllable } from '../../hooks/useControllable';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useFieldContext, useFieldControl } from '../../hooks/useFieldControl';\nimport { useFocusTrap } from '../../hooks/useFocusTrap';\nimport { useFormReset } from '../../hooks/useFormReset';\nimport { useId } from '../../hooks/useId';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { useRestoreFocus } from '../../hooks/useRestoreFocus';\nimport { HiddenInput } from '../internal/HiddenInput';\nimport { Portal } from '../portal/Portal';\nimport {\n addDays,\n addMonths,\n clampDate,\n formatDate as formatLocaleDate,\n formatDayLabel,\n formatDayNumber,\n formatISODate,\n formatMonthYear,\n getCalendarDays,\n getLocaleDateFormat,\n getWeekdayNames,\n isDateInRange,\n isSameDay,\n isSameMonth,\n isValidLocaleTag,\n parseDate as parseLocaleDate,\n startOfDay,\n startOfMonth,\n} from './dateUtils';\nimport { isInvalidLook } from './Input';\nimport type { RoutedHandlers } from './routedHandlers';\n\n/** Why typed text was not accepted (see {@link DatePickerProps.onInvalidInput}). */\nexport type DatePickerInvalidReason = 'unparseable' | 'out-of-range' | 'disabled';\n\n/**\n * The DatePicker's built-in button names and error texts, for localization. Each member is\n * optional and falls back to its English default. Month and weekday names and the day labels\n * follow `locale`.\n */\nexport interface DatePickerLabels {\n /** Name of the clear button.\n * @default 'Clear date'\n */\n clear?: string;\n /** Name of the button that opens the calendar.\n * @default 'Open calendar'\n */\n openCalendar?: string;\n /** Name of the calendar's previous-month button.\n * @default 'Previous month'\n */\n previousMonth?: string;\n /** Name of the calendar's next-month button.\n * @default 'Next month'\n */\n nextMonth?: string;\n /**\n * Error text for typed text that is not a date. `pattern` is the default format of `locale`\n * written with English field letters (`'MM/DD/YYYY'`, `'DD.MM.YYYY'`), or `undefined` with a\n * custom `parseDate` (its format is unknown to the picker).\n * @default (pattern) => pattern ? `Enter a date in the format ${pattern}.` : 'Enter a valid date.'\n */\n invalidDate?: (pattern: string | undefined) => string;\n /**\n * Error text for a typed date outside `minDate`/`maxDate`. The bounds are passed as the input\n * shows dates (`formatDate`); a bound that is not set is `undefined`.\n * @default (min, max) => `Enter a date between ${min} and ${max}.` (only `min`: `Enter a date on\n * or after ${min}.`; only `max`: `Enter a date on or before ${max}.`)\n */\n outOfRange?: (min: string | undefined, max: string | undefined) => string;\n /** Error text for a typed date that `disabledDates` excludes.\n * @default 'This date is not available.'\n */\n unavailableDate?: string;\n}\n\nconst defaultInvalidDateLabel = (pattern: string | undefined) =>\n pattern ? `Enter a date in the format ${pattern}.` : 'Enter a valid date.';\n\nconst defaultOutOfRangeLabel = (min: string | undefined, max: string | undefined) => {\n if (min !== undefined && max !== undefined) return `Enter a date between ${min} and ${max}.`;\n if (min !== undefined) return `Enter a date on or after ${min}.`;\n return `Enter a date on or before ${max}.`;\n};\n\n/** Properties for the DatePicker component. */\nexport interface DatePickerProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue' | 'placeholder' | RoutedHandlers\n> {\n /** Controlled selected date (`null` for none). Emitted dates are always local midnight. */\n value?: Date | null;\n /**\n * Initial date for uncontrolled usage.\n * @default null\n */\n defaultValue?: Date | null;\n /** Called with the new date (local midnight) or `null` whenever the selected day changes. */\n onValueChange?: (date: Date | null) => void;\n /**\n * @deprecated Use `onValueChange`. Still called with the new date (warns once in development).\n */\n onChange?: (date: Date | null) => void;\n /**\n * Formats the selected date for the input. Supply `parseDate` as its inverse: without it, typed\n * text is parsed with the default parser for `locale` (development warning).\n * @default Intl.DateTimeFormat(locale, { year: 'numeric', month: '2-digit', day: '2-digit' }),\n * in the Gregorian calendar when the locale's own has other months (see `locale`)\n */\n formatDate?: (date: Date) => string;\n /**\n * Parses typed text into a date (`null` when it is not one); the result is normalized to local\n * midnight. The default is the exact inverse of the default format for `locale` and also\n * accepts ISO `yyyy-mm-dd`.\n */\n parseDate?: (text: string) => Date | null;\n /**\n * BCP 47 locale of the default format/parse, the month and weekday names and the day labels\n * (runtime default when omitted). Pass it explicitly when rendering on the server, so the server\n * and the browser format the same text. The grid is Gregorian: a locale calendar with other\n * months or eras (the Persian default of `fa-IR`, `-u-ca-islamic`, `-u-ca-japanese`) is replaced\n * by the Gregorian one in the locale's language and digits; the Buddhist years of `th-TH` stay.\n * A tag `Intl` rejects (the POSIX `de_DE`, a typo) falls back to the runtime default locale\n * (development warning).\n */\n locale?: string;\n /** Earliest selectable day (the whole day is included). */\n minDate?: Date;\n /** Latest selectable day (the whole day is included). */\n maxDate?: Date;\n /** Returns `true` for days that cannot be selected (called with local-midnight dates). */\n disabledDates?: (date: Date) => boolean;\n /**\n * Placeholder text shown when no date is selected.\n * @default 'Select a date'\n */\n placeholder?: string;\n /**\n * Whether the date picker is disabled and non-interactive (the calendar is not shown).\n * @default false\n */\n disabled?: boolean;\n /**\n * Makes the input read-only: the calendar does not open and the value cannot change. Turning it\n * (or `disabled`) on while the user is typing drops the typed text.\n */\n readOnly?: boolean;\n /**\n * Whether to show a clear button when a date is selected (not shown while `readOnly`). Tab from\n * erased text clears the value before focus moves, so focus goes on to the calendar button, past\n * the clear button that disappears with it.\n * @default false\n */\n clearable?: boolean;\n /**\n * First day of the week (0 = Sunday, 1 = Monday, etc.).\n * @default 0\n */\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * Controlled open state of the calendar. The calendar renders only in the browser: an open\n * picker is closed in the server HTML and opens once it has hydrated.\n */\n open?: boolean;\n /**\n * Initial open state for uncontrolled usage. A picker that starts disabled or read-only starts\n * closed. The calendar renders only in the browser: it is closed in the server HTML and opens\n * once the picker has hydrated.\n * @default false\n */\n defaultOpen?: boolean;\n /** Called when the calendar opens or closes (only when the state changes). */\n onOpenChange?: (open: boolean) => void;\n /**\n * Called when typed text is not accepted on Enter, Alt+ArrowDown or blur (once per edit): it\n * cannot be parsed (`'unparseable'`), lies outside `minDate`/`maxDate` (`'out-of-range'`) or is\n * excluded by `disabledDates` (`'disabled'`). The text stays in the input, which is marked\n * `aria-invalid` and described by an error message (left to the surrounding `Field` when it\n * shows an error). Enter reports it again when pressed again.\n */\n onInvalidInput?: (text: string, reason: DatePickerInvalidReason) => void;\n /**\n * Names of the clear, calendar and month buttons and the error texts of rejected typed text, for\n * localization. Unset members keep their English defaults.\n */\n labels?: DatePickerLabels;\n /** Form field name: the date is submitted as ISO `yyyy-mm-dd` (hidden input). */\n name?: string;\n /** Id of the `<form>` the value belongs to, when the picker is outside it. */\n form?: string;\n /**\n * Blocks form submission while no date is selected; sets `aria-required` on the input. Like a\n * native readonly input, a `readOnly` DatePicker does not block submission.\n */\n required?: boolean;\n /** Native `autocomplete` of the input. @default 'off' */\n autoComplete?: string;\n /** Focus handler of the text input (the root keeps the other handlers). */\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n /** Blur handler of the text input. */\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n /** Key handler of the text input; `preventDefault()` skips the picker's own keys. */\n onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;\n /** Key handler of the text input. */\n onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;\n /** Ref to the text input; `ref` stays on the root. */\n controlRef?: React.Ref<HTMLInputElement>;\n /** Ref to the root element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// Every button sets its own padding and background (C-NATIVE): an app-wide `button` rule would\n// otherwise pad and fill them.\nconst ICON_BUTTON_CLASSES =\n 'absolute flex h-6 w-6 items-center justify-center rounded bg-transparent p-0 text-muted-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground';\n\nconst NAV_BUTTON_CLASSES =\n 'flex h-8 w-8 items-center justify-center rounded bg-transparent p-0 text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover';\n\n// An unavailable day stays focusable in the roving grid (`aria-disabled`); the day button adds\n// `disabledStyles`, whose dimmed look lifts while the focus ring shows (opacity would dim the ring).\nconst DAY_CLASSES =\n 'flex h-8 w-8 items-center justify-center rounded bg-transparent p-0 text-caption-1 text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover data-[outside]:text-muted-foreground data-[today]:border data-[today]:border-primary data-[today]:font-semibold data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-primary-foreground not-disabled:not-aria-disabled:data-[selected]:hover:bg-primary-hover aria-disabled:line-through';\n\n/** The 42 grid days as 6 weeks. */\nfunction toWeeks(days: Date[]): Date[][] {\n const weeks: Date[][] = [];\n for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7));\n return weeks;\n}\n\n/**\n * A date input with a calendar dialog (APG date picker dialog).\n *\n * - **Typing**: the input accepts the default display format of `locale` (`Intl` numeric\n * year/month/day, e.g. `03/04/2025` for `en-GB`, `04/03/2025` for `en-US`) and ISO\n * `yyyy-mm-dd`. Text is committed on Enter, on Alt+ArrowDown (before the calendar opens) or when\n * the field loses focus — only when it was edited, and only when it names a different day. Text\n * that is not an available date is kept, the input is marked invalid and an error message\n * describes it (`onInvalidInput`, reported once per edit) until the text is edited or replaced\n * (a day picked in the calendar, the clear button, a form reset, a new day from the parent).\n * - **Calendar**: the toggle (`aria-haspopup=\"dialog\"`) or Alt+ArrowDown in the input opens a\n * modal dialog labelled by the month heading. Focus moves to the selected day (else today, else\n * the first available day of the month) and Tab stays inside. Arrow keys move by day/week\n * (mirrored in RTL), PageUp/PageDown by month, Shift+PageUp/PageDown by year (the day is clamped\n * to the month), Home/End to the start/end of the week, Enter/Space select. Escape closes and\n * returns focus to where the calendar was opened from (the toggle, or the input after\n * Alt+ArrowDown); a press outside closes it too. Unavailable days stay focusable\n * (`aria-disabled`); a day focused by pointer becomes the starting point of the arrow keys. The\n * selected day is `aria-selected` on its gridcell and `aria-pressed` on its focusable button, so\n * the state is announced when focus lands on it; today is `aria-current=\"date\"`.\n * - The calendar closes when the picker becomes disabled or read-only (uncontrolled `open`: it\n * stays closed when the picker is enabled again), and the text typed until then is dropped.\n * - `clearable` shows a clear button while a date is selected (not while read-only). Tab from\n * erased text clears the value first, so focus moves on to the calendar button instead of to the\n * clear button that disappears.\n * - Every emitted date is local midnight. The calendar opens on the month of the selected date or\n * today, clamped into `minDate`/`maxDate`.\n * - The input (`controlRef`) receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,\n * `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`,\n * `autoFocus`, `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes\n * `autoComplete`, `autoCapitalize`, `autoCorrect`, `inputMode`, `spellCheck` and\n * `enterKeyHint`. `ref`, `className`, `style`, other `aria-*` attributes and the remaining props\n * stay on the root `<div>`. Inside a `Field`, the input is labelled and described by it.\n * - `name`/`required` add a hidden input for native forms (ISO `yyyy-mm-dd`); the value resets\n * with its form.\n * - The built-in button names and error texts are English; `labels` localizes them.\n * - Pass `locale` explicitly when rendering on the server (see `locale`). The calendar renders only\n * in the browser: an open calendar (`defaultOpen`, `open`) is closed in the server HTML and opens\n * once the picker has hydrated.\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange,\n onChange,\n formatDate: formatDateProp,\n parseDate: parseDateProp,\n locale,\n minDate,\n maxDate,\n disabledDates,\n placeholder = 'Select a date',\n disabled = false,\n readOnly,\n clearable = false,\n firstDayOfWeek = 0,\n open: openProp,\n defaultOpen,\n onOpenChange,\n onInvalidInput,\n labels,\n name,\n form,\n required,\n autoComplete = 'off',\n autoCapitalize,\n autoCorrect,\n enterKeyHint,\n inputMode,\n spellCheck,\n autoFocus,\n tabIndex,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-errormessage': ariaErrorMessage,\n 'aria-details': ariaDetails,\n onFocus,\n onBlur,\n onKeyDown,\n onKeyUp,\n controlRef,\n className,\n ref,\n ...rest\n } = props;\n\n if (onChange !== undefined) warnDeprecated('DatePicker', 'onChange', 'onValueChange');\n\n const hasCustomFormat = formatDateProp !== undefined;\n const hasCustomParse = parseDateProp !== undefined;\n React.useEffect(() => {\n if (hasCustomFormat && !hasCustomParse) {\n warnOnce(\n 'DatePicker:formatDate-without-parseDate',\n 'DatePicker: `formatDate` is set without `parseDate`. Typed dates are parsed with the ' +\n 'default parser for `locale` (its numeric format or yyyy-mm-dd), which may not read ' +\n 'your format; pass `parseDate` as the inverse of `formatDate`.',\n );\n }\n }, [hasCustomFormat, hasCustomParse]);\n React.useEffect(() => {\n if (locale !== undefined && !isValidLocaleTag(locale)) {\n warnOnce(\n `DatePicker:invalid-locale:${locale}`,\n `DatePicker: \\`locale\\` \"${locale}\" is not a valid BCP 47 language tag (use hyphens, as ` +\n 'in \"en-US\"). The runtime default locale formats and parses the dates instead, so the ' +\n 'server and the browser may render different text.',\n );\n }\n }, [locale]);\n\n const [selectedDate, setSelectedDate] = useControllable<Date | null>(\n valueProp,\n defaultValue ?? null,\n (next) => {\n onValueChange?.(next);\n onChange?.(next);\n },\n );\n const interactive = !disabled && !readOnly;\n const [openState, setOpen] = useControllable<boolean>(\n openProp,\n // A picker that starts disabled or read-only never shows its calendar, so it starts closed\n // (no close to report later).\n (defaultOpen ?? false) && interactive,\n onOpenChange,\n );\n // The calendar lives in a portal, which renders only in the browser: until then (the server\n // HTML, hydration) the picker reports it closed, so no reference names a missing element.\n const isClient = useIsClient();\n const isOpen = openState && interactive && isClient;\n const openControlled = openProp !== undefined;\n\n // A calendar hidden because the picker became disabled or read-only is closed for good\n // (uncontrolled), so enabling the picker again does not bring it back and take focus.\n // onOpenChange(false) reports it; a controlled `open` stays the parent's.\n React.useEffect(() => {\n if (!interactive && openState && !openControlled) setOpen(false);\n }, [interactive, openState, openControlled, setOpen]);\n\n const format = (date: Date) =>\n formatDateProp ? formatDateProp(date) : formatLocaleDate(date, locale);\n const parse = (text: string) =>\n parseDateProp ? parseDateProp(text) : parseLocaleDate(text, locale);\n\n /* ---- draft text and validation ---------------------------------- */\n\n /** Typed text; `null` shows the formatted selected date (draft model). */\n const [draft, setDraft] = React.useState<string | null>(null);\n const [invalid, setInvalid] = React.useState<DatePickerInvalidReason | null>(null);\n\n // Adjusted during render (C-HOOKS). Locking the picker (readOnly/disabled) while the user types\n // drops the typed text and its error, so no later blur commits it (the value cannot change).\n const [wasInteractive, setWasInteractive] = React.useState(interactive);\n if (wasInteractive !== interactive) {\n setWasInteractive(interactive);\n if (!interactive) {\n setDraft(null);\n setInvalid(null);\n }\n }\n // A selected day the parent changes replaces rejected text (commits clear it themselves), so the\n // input never shows an error next to a valid value. Text the user is still typing stays.\n const selectedDay = selectedDate ? formatISODate(selectedDate) : '';\n const [seenDay, setSeenDay] = React.useState(selectedDay);\n if (seenDay !== selectedDay) {\n setSeenDay(selectedDay);\n if (invalid !== null) {\n setDraft(null);\n setInvalid(null);\n }\n }\n\n const isUnavailable = (date: Date) =>\n !isDateInRange(date, minDate, maxDate) || !!disabledDates?.(startOfDay(date));\n\n /** Commits a day (or `null`); nothing is emitted when it is the same day. */\n const commitDate = (next: Date | null) => {\n const normalized = next ? startOfDay(next) : null;\n const unchanged = normalized ? isSameDay(normalized, selectedDate) : selectedDate === null;\n if (!unchanged) setSelectedDate(normalized);\n setDraft(null);\n setInvalid(null);\n };\n\n /** Validates and commits the typed text; `false` when it was rejected (the text is kept). */\n const commitDraft = (text: string): boolean => {\n if (!text.trim()) {\n commitDate(null);\n return true;\n }\n const parsed = parse(text);\n let reason: DatePickerInvalidReason | null = null;\n if (!parsed || Number.isNaN(parsed.getTime())) reason = 'unparseable';\n else if (!isDateInRange(parsed, minDate, maxDate)) reason = 'out-of-range';\n else if (disabledDates?.(startOfDay(parsed))) reason = 'disabled';\n if (reason || !parsed) {\n const rejected = reason ?? 'unparseable';\n setInvalid(rejected);\n onInvalidInput?.(text, rejected);\n return false;\n }\n commitDate(parsed);\n return true;\n };\n\n /* ---- calendar view and focused day ------------------------------- */\n\n const today = startOfDay(new Date());\n const initialView = () => startOfMonth(clampDate(selectedDate ?? today, minDate, maxDate));\n const [viewMonth, setViewMonth] = React.useState<Date>(initialView);\n const [focusedDay, setFocusedDay] = React.useState<Date | null>(null);\n\n /** Opened with Alt+ArrowDown in the input: Escape returns focus there instead of the toggle. */\n const [openedFromInput, setOpenedFromInput] = React.useState(false);\n\n // Every opening shows the selected (or current) month again: adjusted during render (C-HOOKS).\n const [openSeen, setOpenSeen] = React.useState(isOpen);\n if (openSeen !== isOpen) {\n setOpenSeen(isOpen);\n if (isOpen) {\n setViewMonth(initialView());\n setFocusedDay(null);\n }\n }\n // A closed calendar forgets where it was opened from. This also drops an Alt+ArrowDown whose\n // opening a controlled parent declined (it renders in the same update, still closed), so a later\n // opening by the parent returns focus to the toggle, not the input.\n if (openedFromInput && !isOpen) setOpenedFromInput(false);\n\n const weeks = React.useMemo(\n () => toWeeks(getCalendarDays(viewMonth, firstDayOfWeek)),\n [viewMonth, firstDayOfWeek],\n );\n\n // The focused day is derived: the day moved to while it is shown (a pointer-focused day of the\n // previous/next month counts too), else the selected day of the month, else today (clamped into\n // the range), else the first available day of the month.\n const inView = (date: Date | null | undefined): date is Date =>\n !!date && isSameMonth(date, viewMonth);\n const inGrid = (date: Date | null | undefined): date is Date =>\n !!date && date >= weeks[0][0] && date <= weeks[weeks.length - 1][6];\n const clampedToday = clampDate(today, minDate, maxDate);\n const firstInRange = clampDate(viewMonth, minDate, maxDate);\n const focusTarget = inGrid(focusedDay)\n ? focusedDay\n : inView(selectedDate)\n ? startOfDay(selectedDate)\n : inView(clampedToday)\n ? clampedToday\n : inView(firstInRange)\n ? firstInRange\n : viewMonth;\n const focusIso = formatISODate(focusTarget);\n\n const moveFocus = (next: Date) => {\n const target = clampDate(next, minDate, maxDate);\n setFocusedDay(target);\n if (!isSameMonth(target, viewMonth)) setViewMonth(startOfMonth(target));\n };\n\n const navigateMonth = (delta: number) => {\n const nextView = addMonths(viewMonth, delta);\n const moved = clampDate(addMonths(focusTarget, delta), minDate, maxDate);\n setViewMonth(nextView);\n // From a day of the previous/next month the moved day may fall outside the new month: the\n // focused day is then derived again (selected, today or the first day of the month).\n setFocusedDay(isSameMonth(moved, nextView) ? moved : null);\n };\n\n /** Pointer (or assistive technology) focus on a day makes it the roving day; the month stays. */\n const handleDayFocus = (day: Date) => {\n if (!isSameDay(day, focusTarget)) setFocusedDay(day);\n };\n\n const previousDisabled = !!minDate && addDays(viewMonth, -1) < startOfDay(minDate);\n const nextDisabled = !!maxDate && addMonths(viewMonth, 1) > startOfDay(maxDate);\n\n const weekdays = React.useMemo(\n () => getWeekdayNames(locale, firstDayOfWeek),\n [locale, firstDayOfWeek],\n );\n\n /* ---- elements, popup primitives ---------------------------------- */\n\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const toggleRef = React.useRef<HTMLButtonElement | null>(null);\n const gridRef = React.useRef<HTMLTableElement | null>(null);\n const surfaceRef = React.useRef<HTMLDivElement | null>(null);\n /** Where focus goes when the calendar closes (`null`: back to the toggle). */\n const restoreTargetRef = React.useRef<HTMLElement | null>(null);\n const [surface, setSurface] = React.useState<HTMLDivElement | null>(null);\n const inputRefs = useMergedRefs<HTMLInputElement>(controlRef, inputRef);\n\n const dialogId = useId('datepicker-dialog');\n const headingId = useId('datepicker-heading');\n const gridId = useId('datepicker-grid');\n const errorId = useId('datepicker-error');\n\n const close = (restoreTo: HTMLElement | null) => {\n restoreTargetRef.current = restoreTo;\n setOpen(false);\n };\n\n const { layerId } = useDismiss({\n open: isOpen,\n onDismiss: (reason, event) => {\n // An outside press on another control hands focus to it (the trap held it until now);\n // otherwise focus returns to where the calendar was opened from.\n const target =\n reason === 'outside-press' && event.target instanceof Element\n ? event.target.closest<HTMLElement>(FOCUSABLE_SELECTOR)\n : null;\n close(target ?? (openedFromInput ? inputRef.current : null));\n },\n refs: [surfaceRef, toggleRef],\n anchorRef: toggleRef,\n kind: 'modal',\n });\n\n const { setReference, setFloating, floatingProps } = usePopupPosition({\n open: isOpen,\n side: 'bottom',\n align: 'start',\n });\n const surfaceRefs = useMergedRefs<HTMLDivElement>(surfaceRef, setSurface, setFloating);\n\n useFocusTrap(surface, {\n enabled: isOpen,\n layerId,\n initialFocus: () => gridRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]') ?? null,\n });\n\n useRestoreFocus({\n enabled: isOpen,\n container: surface,\n triggerRef: toggleRef,\n finalFocusRef: restoreTargetRef,\n onlyIfFocusInside: true,\n });\n\n // A new opening starts without a restore target (the toggle returns focus to itself, Escape to\n // where the calendar was opened from).\n React.useLayoutEffect(() => {\n if (isOpen) restoreTargetRef.current = null;\n }, [isOpen]);\n\n // Roving focus: while the grid holds focus, focus follows the focused day.\n React.useLayoutEffect(() => {\n const grid = gridRef.current;\n if (!grid) return;\n const active = grid.ownerDocument.activeElement;\n if (!active || !grid.contains(active)) return;\n const button = grid.querySelector<HTMLElement>(`button[data-date=\"${focusIso}\"]`);\n if (button && button !== active) button.focus();\n }, [focusIso]);\n\n /* ---- forms and Field --------------------------------------------- */\n\n const field = useFieldContext();\n const isRequired = required ?? field?.required ?? false;\n // Like a native readonly input, a read-only picker is barred from constraint validation (the\n // user could not fix it); its value is still submitted.\n const validates = isRequired && !readOnly;\n const showOwnError = invalid !== null && !field?.hasErrorMessage;\n const fieldProps = useFieldControl({\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': joinIds(ariaDescribedBy, showOwnError ? errorId : undefined),\n 'aria-invalid': invalid !== null ? true : ariaInvalid,\n // An explicit `required={false}` wins over a required Field, so aria-required matches\n // `isRequired`.\n 'aria-required': ariaRequired ?? required,\n });\n const invalidLook = isInvalidLook(false, fieldProps['aria-invalid']);\n\n // Through the commit path: the default is emitted as local midnight, and only when it names\n // another day; the typed text and its error are dropped.\n useFormReset(inputRef, () => commitDate(defaultValue ?? null), form);\n\n // Read-only pickers offer no clear action (the value cannot change).\n const showClear = clearable && !readOnly && selectedDate !== null;\n\n /* ---- handlers ---------------------------------------------------- */\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (!interactive) return;\n setDraft(event.target.value);\n setInvalid(null);\n };\n\n const handleInputKeyDown = composeEventHandlers(\n onKeyDown,\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // Keys that belong to an IME composition (its confirming Enter) are left to the IME.\n if (!interactive || event.nativeEvent.isComposing) return;\n if (event.key === 'Enter' && draft !== null) {\n // An edit is committed instead of submitting the form; untouched text lets Enter submit.\n event.preventDefault();\n commitDraft(draft);\n } else if (\n event.key === 'Tab' &&\n !event.shiftKey &&\n showClear &&\n draft !== null &&\n !draft.trim()\n ) {\n // Erased text clears the value, and with it the clear button, the next tab stop. It is\n // settled before Tab moves focus (the blur would settle it while focus moves to that\n // button), so focus moves on to the calendar button instead of dropping to <body> with\n // the clear button (C-DISABLED).\n flushSync(() => commitDraft(draft));\n } else if (event.key === 'ArrowDown' && event.altKey && !isOpen) {\n event.preventDefault();\n // The edit is committed first, so the calendar opens on the typed month; rejected text is\n // kept and reported once (the blur that follows does not report it again).\n if (draft !== null && invalid === null) commitDraft(draft);\n setOpenedFromInput(true);\n setOpen(true);\n }\n },\n );\n\n const handleInputBlur = composeEventHandlers(onBlur, () => {\n // Text already rejected (Enter, Alt+ArrowDown) is kept without being reported again.\n if (interactive && draft !== null && invalid === null) commitDraft(draft);\n });\n\n const handleToggle = () => {\n if (!interactive) return;\n restoreTargetRef.current = null;\n setOpenedFromInput(false);\n setOpen(!isOpen);\n };\n\n const handleClear = () => {\n if (!interactive) return;\n commitDate(null);\n inputRef.current?.focus();\n };\n\n // The clear button keeps focus on the input: its blur would otherwise commit (or reject) the\n // edited text just before the clear, emitting twice for one click.\n const handleClearMouseDown = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n };\n\n const selectDate = (day: Date) => {\n if (!interactive || isUnavailable(day)) return;\n commitDate(day);\n close(inputRef.current);\n };\n\n const handleDialogKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Escape' || event.defaultPrevented || event.nativeEvent.isComposing) return;\n // Consumed here, so enclosing layers (a Dialog around the picker) ignore it.\n event.preventDefault();\n close(openedFromInput ? inputRef.current : null);\n };\n\n const handleGridKeyDown = (event: React.KeyboardEvent<HTMLTableElement>) => {\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const weekOffset = (focusTarget.getDay() - firstDayOfWeek + 7) % 7;\n let next: Date;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowRight': {\n const intent = getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(event.currentTarget),\n });\n next = addDays(focusTarget, intent === 'next' ? 1 : -1);\n break;\n }\n case 'ArrowDown':\n next = addDays(focusTarget, 7);\n break;\n case 'ArrowUp':\n next = addDays(focusTarget, -7);\n break;\n case 'PageDown':\n next = addMonths(focusTarget, event.shiftKey ? 12 : 1);\n break;\n case 'PageUp':\n next = addMonths(focusTarget, event.shiftKey ? -12 : -1);\n break;\n case 'Home':\n next = addDays(focusTarget, -weekOffset);\n break;\n case 'End':\n next = addDays(focusTarget, 6 - weekOffset);\n break;\n default:\n // Enter and Space activate the focused day button natively (click).\n return;\n }\n event.preventDefault();\n moveFocus(next);\n };\n\n /* ---- render ------------------------------------------------------ */\n\n const inputText = draft ?? (selectedDate ? format(selectedDate) : '');\n\n let errorMessage = '';\n if (invalid === 'unparseable') {\n errorMessage = (labels?.invalidDate ?? defaultInvalidDateLabel)(\n hasCustomParse ? undefined : getLocaleDateFormat(locale).pattern,\n );\n } else if (invalid === 'out-of-range' && (minDate || maxDate)) {\n errorMessage = (labels?.outOfRange ?? defaultOutOfRangeLabel)(\n minDate ? format(startOfDay(minDate)) : undefined,\n maxDate ? format(startOfDay(maxDate)) : undefined,\n );\n } else if (invalid === 'disabled') {\n errorMessage = labels?.unavailableDate ?? 'This date is not available.';\n }\n\n return (\n <div {...rest} ref={ref} className={cn('relative inline-flex flex-col', className)}>\n <div ref={setReference} className=\"relative flex items-center\">\n <input\n ref={inputRefs}\n type=\"text\"\n {...fieldProps}\n aria-errormessage={ariaErrorMessage}\n aria-details={ariaDetails}\n value={inputText}\n onChange={handleInputChange}\n onFocus={onFocus}\n onBlur={handleInputBlur}\n onKeyDown={handleInputKeyDown}\n onKeyUp={onKeyUp}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoComplete={autoComplete}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n enterKeyHint={enterKeyHint}\n inputMode={inputMode}\n spellCheck={spellCheck}\n autoFocus={autoFocus}\n tabIndex={tabIndex}\n className={cn(\n inputBase,\n 'border-b-stroke-accessible',\n inputFocus,\n disabledStyles,\n invalidLook && inputInvalid,\n showClear ? 'pe-14' : 'pe-8',\n )}\n />\n {showClear && (\n <button\n type=\"button\"\n aria-label={labels?.clear ?? 'Clear date'}\n disabled={disabled}\n onMouseDown={handleClearMouseDown}\n onClick={handleClear}\n className={cn(ICON_BUTTON_CLASSES, 'end-7', focusRing, disabledStyles)}\n >\n <DismissIcon />\n </button>\n )}\n <button\n ref={toggleRef}\n type=\"button\"\n aria-label={labels?.openCalendar ?? 'Open calendar'}\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? dialogId : undefined}\n disabled={disabled || readOnly}\n onClick={handleToggle}\n className={cn(ICON_BUTTON_CLASSES, 'end-1', focusRing, disabledStyles)}\n >\n <CalendarIcon />\n </button>\n </div>\n {showOwnError && (\n <p id={errorId} role=\"alert\" className=\"mt-1 text-caption-1 text-error\">\n {errorMessage}\n </p>\n )}\n <HiddenInput\n name={name}\n form={form}\n disabled={disabled}\n value={selectedDate ? formatISODate(selectedDate) : ''}\n type=\"text\"\n required={validates}\n onInvalid={() => inputRef.current?.focus()}\n />\n {isOpen && (\n <Portal layerId={layerId}>\n <div\n ref={surfaceRefs}\n id={dialogId}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={headingId}\n {...floatingProps}\n data-state=\"open\"\n onKeyDown={handleDialogKeyDown}\n className=\"rounded-md border border-border bg-background p-3 text-foreground shadow-16\"\n >\n <div className=\"mb-2 flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n aria-label={labels?.previousMonth ?? 'Previous month'}\n aria-controls={gridId}\n {...focusableDisabledProps(previousDisabled)}\n onClick={preventIfDisabled(previousDisabled, () => navigateMonth(-1))}\n className={cn(NAV_BUTTON_CLASSES, focusRing, disabledStyles)}\n >\n <ChevronLeftIcon className=\"wave-rtl:-scale-x-100\" />\n </button>\n <h2 id={headingId} aria-live=\"polite\" className=\"text-body-1 font-semibold\">\n {formatMonthYear(viewMonth, locale)}\n </h2>\n <button\n type=\"button\"\n aria-label={labels?.nextMonth ?? 'Next month'}\n aria-controls={gridId}\n {...focusableDisabledProps(nextDisabled)}\n onClick={preventIfDisabled(nextDisabled, () => navigateMonth(1))}\n className={cn(NAV_BUTTON_CLASSES, focusRing, disabledStyles)}\n >\n <ChevronRightIcon className=\"wave-rtl:-scale-x-100\" />\n </button>\n </div>\n <table\n ref={gridRef}\n id={gridId}\n role=\"grid\"\n aria-labelledby={headingId}\n onKeyDown={handleGridKeyDown}\n className=\"border-collapse\"\n >\n <thead>\n <tr>\n {weekdays.map((weekday) => (\n <th\n key={weekday.long}\n scope=\"col\"\n abbr={weekday.long}\n aria-label={weekday.long}\n className=\"h-8 w-8 text-center text-caption-1 font-normal text-muted-foreground\"\n >\n <span aria-hidden=\"true\">{weekday.short}</span>\n <span className=\"sr-only\">{weekday.long}</span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week, row) => (\n // Rows and cells are keyed by position, so the focused button survives a\n // month change and focus stays in the grid while it moves to the new day.\n <tr key={row}>\n {week.map((day, column) => {\n const iso = formatISODate(day);\n const isSelected = isSameDay(day, selectedDate);\n const isToday = isSameDay(day, today);\n const isFocused = iso === focusIso;\n const unavailable = isUnavailable(day);\n return (\n <td key={column} role=\"gridcell\" aria-selected={isSelected} className=\"p-0\">\n {/* Focus rests on the button, and screen readers do not reliably\n announce the gridcell's aria-selected from inside it: the selected\n day's button is also pressed. */}\n <button\n type=\"button\"\n tabIndex={isFocused ? 0 : -1}\n aria-label={formatDayLabel(day, locale)}\n aria-pressed={isSelected || undefined}\n aria-current={isToday ? 'date' : undefined}\n {...focusableDisabledProps(unavailable)}\n data-date={iso}\n data-selected={isSelected ? '' : undefined}\n data-today={isToday ? '' : undefined}\n data-outside={isSameMonth(day, viewMonth) ? undefined : ''}\n onFocus={() => handleDayFocus(day)}\n onClick={() => selectDate(day)}\n className={cn(\n DAY_CLASSES,\n focusRing,\n disabledStyles,\n isSelected && forcedColors.selectedLeaf,\n )}\n >\n {formatDayNumber(day, locale)}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Portal>\n )}\n </div>\n );\n};\n\nDatePicker.displayName = 'DatePicker';\n"],"mappings":"m/BAiGA,IAAMyE,GAA2B,GAC/BC,EAAU,8BAA8BA,EAAQ,GAAK,sBAEjDC,IAA0B,EAAyB,IACnDC,IAAQ,IAAA,IAAaC,IAAQ,IAAA,GAAkB,wBAAwBD,EAAI,OAAOC,EAAI,GACtFD,IAAQ,IAAA,GACL,6BAA6BC,EAAI,GADV,4BAA4BD,EAAI,GAoI1DE,GACJ,+MAEIC,GACJ,2IAIIC,GACJ,4cAGF,SAASC,GAAQ,EAAwB,CACvC,I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