@hina-ui/vue 1.7.12 → 1.7.14
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 +1 -1
- package/dist/index.js +25634 -9251
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/thumbhash.ts +12 -0
- package/dist/shared/lib/tour-engine.ts +721 -0
- package/dist/shared/lib/tour.ts +439 -0
- package/dist/shared/locale/en-US.ts +9 -0
- package/dist/shared/locale/index.ts +1 -0
- package/dist/shared/locale/ja-JP.ts +10 -0
- package/dist/shared/locale/types.ts +9 -0
- package/dist/shared/locale/zh-CN.ts +9 -0
- package/dist/shared/primitives/combobox/LICENSE +44 -0
- package/dist/shared/primitives/combobox/index.ts +49 -0
- package/dist/shared/primitives/date/LICENSE +21 -0
- package/dist/shared/primitives/date/calendar-view.ts +264 -0
- package/dist/shared/primitives/date/calendar.ts +126 -0
- package/dist/shared/primitives/date/comparators.ts +144 -0
- package/dist/shared/primitives/date/field.ts +551 -0
- package/dist/shared/primitives/date/formatter.ts +110 -0
- package/dist/shared/primitives/date/parser.ts +182 -0
- package/dist/shared/primitives/date/parts.ts +16 -0
- package/dist/shared/primitives/date/picker-view.ts +186 -0
- package/dist/shared/primitives/date/placeholders.ts +485 -0
- package/dist/shared/primitives/date/range-calendar-view.ts +181 -0
- package/dist/shared/primitives/date/segment.ts +44 -0
- package/dist/shared/primitives/date/utils.ts +169 -0
- package/dist/shared/primitives/dialog/LICENSE +21 -0
- package/dist/shared/primitives/dialog/index.ts +73 -0
- package/dist/shared/primitives/dismissable-layer/index.ts +48 -1
- package/dist/shared/primitives/focus-scope/index.ts +5 -3
- package/dist/shared/primitives/grace-area/LICENSE +21 -0
- package/dist/shared/primitives/grace-area/index.ts +112 -0
- package/dist/shared/primitives/listbox/LICENSE +21 -0
- package/dist/shared/primitives/listbox/index.ts +213 -0
- package/dist/shared/primitives/menu/LICENSE +21 -0
- package/dist/shared/primitives/menu/index.ts +66 -0
- package/dist/shared/primitives/navigation-menu/LICENSE +44 -0
- package/dist/shared/primitives/navigation-menu/index.ts +125 -0
- package/dist/shared/primitives/popper/LICENSE +21 -0
- package/dist/shared/primitives/popper/index.ts +246 -0
- package/dist/shared/primitives/select/index.ts +98 -0
- package/dist/shared/primitives/tags-input/LICENSE +21 -0
- package/dist/shared/primitives/tags-input/index.ts +113 -0
- package/dist/shared/primitives/toast/LICENSE +44 -0
- package/dist/shared/primitives/toast/index.ts +106 -0
- package/dist/shared/primitives/tree/LICENSE +21 -0
- package/dist/shared/primitives/tree/index.ts +248 -0
- package/dist/shared/styles/semantic.css +1 -0
- package/dist/shared/styles/tokens.css +1 -0
- package/dist/shared/styles/tour.css +134 -0
- package/dist/shared/variants/image.ts +28 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/tour.ts +47 -0
- package/dist/types/shared/src/lib/thumbhash.d.ts +2 -0
- package/dist/types/shared/src/lib/thumbhash.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tour-engine.d.ts +47 -0
- package/dist/types/shared/src/lib/tour-engine.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tour.d.ts +137 -0
- package/dist/types/shared/src/lib/tour.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts +6 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts.map +1 -0
- package/dist/types/shared/src/locale/en-US.d.ts.map +1 -1
- package/dist/types/shared/src/locale/index.d.ts.map +1 -1
- package/dist/types/shared/src/locale/ja-JP.d.ts.map +1 -1
- package/dist/types/shared/src/locale/types.d.ts +9 -0
- package/dist/types/shared/src/locale/types.d.ts.map +1 -1
- package/dist/types/shared/src/locale/zh-CN.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts +1 -1
- package/dist/types/shared/src/primitives/combobox/index.d.ts +9 -0
- package/dist/types/shared/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts +53 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts +39 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts +31 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/field.d.ts +46 -0
- package/dist/types/shared/src/primitives/date/field.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts +20 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts +49 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts +10 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts +34 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts +2 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts +67 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts +6 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts +37 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts +32 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts +1 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts +2 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/focus-scope/index.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/grace-area/index.d.ts +13 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts +55 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts +35 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts +23 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts +83 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/select/index.d.ts +24 -0
- package/dist/types/shared/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts +36 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts +42 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts +72 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/shared/src/variants/image.d.ts +35 -0
- package/dist/types/shared/src/variants/image.d.ts.map +1 -1
- package/dist/types/shared/src/variants/nav-link.d.ts +2 -1
- package/dist/types/shared/src/variants/nav-link.d.ts.map +1 -1
- package/dist/types/shared/src/variants/tour.d.ts +15 -0
- package/dist/types/shared/src/variants/tour.d.ts.map +1 -0
- package/dist/types/vue/src/components/app-shell/AppShell.vue.d.ts +6 -6
- package/dist/types/vue/src/components/button/Button.vue.d.ts +1 -1
- package/dist/types/vue/src/components/button/Button.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/carousel/composables/useCarousel.d.ts +1 -1
- package/dist/types/vue/src/components/combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts +20 -0
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts +10 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts +2 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts.map +1 -0
- package/dist/types/vue/src/components/date-range-field/DateRangeField.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/Dialog.vue.d.ts +3 -0
- package/dist/types/vue/src/components/dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/ModalContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/drawer/Drawer.vue.d.ts +3 -0
- package/dist/types/vue/src/components/drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts +20 -8
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts +1 -1
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts +2 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/composables/useImage.d.ts +2 -0
- package/dist/types/vue/src/components/image/composables/useImage.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarSub.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/month-grid/MonthGrid.vue.d.ts +1 -1
- package/dist/types/vue/src/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts +5 -10
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts +8 -0
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts +2 -2
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuContent.vue.d.ts +6 -6
- package/dist/types/vue/src/components/overlay-branch/OverlayBranch.vue.d.ts +17 -0
- package/dist/types/vue/src/components/overlay-branch/OverlayBranch.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/pagination/composables/usePaginationWindow.d.ts +6 -6
- package/dist/types/vue/src/components/popconfirm/Popconfirm.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-slider/RangeSlider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts +1 -1
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/select/Select.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts +4 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/Slider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/split-button/SplitButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/Toolbar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarControl.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts +43 -0
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts +2 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/types.d.ts +39 -0
- package/dist/types/vue/src/components/tour/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +7 -7
- package/dist/types/vue/src/index.d.ts +6 -0
- package/dist/types/vue/src/index.d.ts.map +1 -1
- package/dist/types/vue/src/lib/anchored-overlay.d.ts +11 -5
- package/dist/types/vue/src/lib/anchored-overlay.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts +6 -6
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts.map +1 -1
- package/dist/types/vue/src/lib/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts +133 -0
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts +227 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts +140 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts +313 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts +48 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts +65 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts +273 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts +166 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts +376 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts +68 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts +949 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts +26 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts +36 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts +32 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts +51 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts +221 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts +31 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts +54 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts +65 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts +40 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts +49 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts +62 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts +85 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts +8 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts +76 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts +26 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts +1033 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts +72 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts +442 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts +30 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts +67 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts +82 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts +58 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts +156 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts +49 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts +394 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts +396 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts +746 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts +74 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts +14 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts +1036 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts +101 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts +165 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts +187 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts +40 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts +247 -0
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts +414 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts +257 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts +183 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts +13 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts +67 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts +40 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts +61 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts +370 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts +4 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts +17 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts +252 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts +345 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts +64 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts +3 -3
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts +265 -0
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts +107 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts +275 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/context.d.ts +73 -0
- package/dist/types/vue/src/primitives/select/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts +61 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts +76 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts +196 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts +30 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts +49 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts +220 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts +25 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts +177 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts +267 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts +162 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts +32 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts +40 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts +29 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts +14 -1
- package/dist/types/vue/src/primitives/utils/config.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/defu.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/defu.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts +5 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/components/alert-dialog/AlertDialog.vue +1 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/calendar/Calendar.vue +1 -1
- package/src/components/calendar/CalendarLevels.vue +1 -1
- package/src/components/combobox/Combobox.vue +6 -1
- package/src/components/combobox/ComboboxList.vue +1 -1
- package/src/components/command-palette/CommandPalette.vue +2 -2
- package/src/components/command-palette/CommandPaletteInput.vue +1 -1
- package/src/components/command-palette/CommandPaletteItem.vue +1 -1
- package/src/components/command-palette/CommandPalettePanel.vue +6 -1
- package/src/components/config-provider/ConfigProvider.vue +24 -0
- package/src/components/config-provider/types.ts +11 -0
- package/src/components/config-provider/useConfig.ts +5 -0
- package/src/components/context-menu/ContextMenu.vue +1 -1
- package/src/components/context-menu/ContextMenuCheckboxItem.vue +1 -1
- package/src/components/context-menu/ContextMenuGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuItem.vue +1 -1
- package/src/components/context-menu/ContextMenuLabel.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioItem.vue +1 -1
- package/src/components/context-menu/ContextMenuSeparator.vue +1 -1
- package/src/components/context-menu/ContextMenuSub.vue +1 -1
- package/src/components/data-table/DataTableDragPreview.vue +1 -1
- package/src/components/date-field/DateField.vue +1 -1
- package/src/components/date-picker/DatePicker.vue +1 -1
- package/src/components/date-range-field/DateRangeField.vue +5 -1
- package/src/components/date-range-picker/DateRangePicker.vue +1 -1
- package/src/components/date-time-picker/DateTimePicker.vue +1 -1
- package/src/components/dialog/Dialog.vue +15 -2
- package/src/components/dialog/ModalContent.vue +2 -1
- package/src/components/drawer/Drawer.vue +15 -2
- package/src/components/dropdown-menu/DropdownMenu.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue +4 -1
- package/src/components/dropdown-menu/DropdownMenuGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuLabel.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSeparator.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSub.vue +1 -1
- package/src/components/hover-card/HoverCard.vue +6 -1
- package/src/components/hover-card/composables/useHoverCardAnchor.ts +1 -1
- package/src/components/icon-button/IconButton.vue +1 -1
- package/src/components/image/Image.vue +58 -24
- package/src/components/image/composables/useImage.ts +46 -21
- package/src/components/lightbox/Lightbox.vue +2 -1
- package/src/components/lightbox/LightboxChrome.vue +1 -1
- package/src/components/listbox/Listbox.vue +1 -1
- package/src/components/listbox/ListboxOptionContent.vue +1 -1
- package/src/components/menubar/Menubar.vue +1 -1
- package/src/components/menubar/MenubarCheckboxItem.vue +1 -1
- package/src/components/menubar/MenubarGroup.vue +1 -1
- package/src/components/menubar/MenubarItem.vue +1 -1
- package/src/components/menubar/MenubarLabel.vue +1 -1
- package/src/components/menubar/MenubarMenu.vue +6 -1
- package/src/components/menubar/MenubarRadioGroup.vue +1 -1
- package/src/components/menubar/MenubarRadioItem.vue +1 -1
- package/src/components/menubar/MenubarSeparator.vue +1 -1
- package/src/components/menubar/MenubarSub.vue +6 -1
- package/src/components/multi-combobox/MultiCombobox.vue +6 -1
- package/src/components/multi-select/MultiSelect.vue +1 -1
- package/src/components/nav-link/NavLink.vue +21 -2
- package/src/components/nav-link/NavLinkChild.ts +2 -0
- package/src/components/navigation-menu/NavigationMenu.vue +5 -1
- package/src/components/navigation-menu/NavigationMenuContent.vue +2 -2
- package/src/components/navigation-menu/NavigationMenuItem.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuTrigger.vue +1 -1
- package/src/components/number-input/NumberInput.vue +1 -1
- package/src/components/overlay-branch/OverlayBranch.vue +14 -0
- package/src/components/pagination/PaginationPopup.vue +1 -1
- package/src/components/popconfirm/Popconfirm.vue +6 -1
- package/src/components/popover/Popover.vue +6 -1
- package/src/components/popover/PopoverContent.vue +2 -2
- package/src/components/popover/composables/usePopoverCloseFocus.ts +1 -1
- package/src/components/range-calendar/RangeCalendar.vue +1 -1
- package/src/components/select/Select.vue +2 -1
- package/src/components/select/SelectList.vue +1 -1
- package/src/components/sheet/Sheet.vue +15 -2
- package/src/components/slider/SliderHandle.vue +1 -1
- package/src/components/tags-input/TagsInput.vue +1 -1
- package/src/components/tags-input/TagsInputChip.vue +1 -1
- package/src/components/time/Time.vue +1 -1
- package/src/components/time-field/TimeField.vue +1 -1
- package/src/components/toast/Toaster.vue +1 -1
- package/src/components/toggle/Toggle.vue +1 -1
- package/src/components/toolbar/ToolbarControl.vue +1 -1
- package/src/components/tooltip/Tooltip.vue +1 -1
- package/src/components/tooltip/TooltipBubble.vue +1 -1
- package/src/components/tooltip/TooltipDirectiveRoot.ts +1 -1
- package/src/components/tooltip/TooltipProvider.vue +1 -1
- package/src/components/tooltip/composables/useTooltipTarget.ts +1 -1
- package/src/components/tour/Tour.vue +608 -0
- package/src/components/tour/tour.variants.ts +1 -0
- package/src/components/tour/types.ts +74 -0
- package/src/components/tree/Tree.vue +1 -1
- package/src/components/tree/TreeRows.vue +1 -1
- package/src/components/tree/VirtualTreeWindow.vue +1 -1
- package/src/components/tree-select/TreeSelect.vue +2 -3
- package/src/components/tree-select/composables/useTreeSelect.ts +2 -2
- package/src/index.ts +26 -0
- package/src/lib/anchored-overlay.ts +2 -1
- package/src/lib/dialog-focus.ts +1 -1
- package/src/lib/reka/useVirtualChoices.ts +7 -8
- package/src/lib/reka/useVirtualTree.ts +1 -1
- package/src/primitives/alert-dialog/LICENSE +44 -0
- package/src/primitives/alert-dialog/index.ts +166 -0
- package/src/primitives/calendar/CalendarCellTrigger.ts +190 -0
- package/src/primitives/calendar/CalendarGrid.ts +101 -0
- package/src/primitives/calendar/CalendarNav.ts +88 -0
- package/src/primitives/calendar/CalendarRoot.ts +324 -0
- package/src/primitives/calendar/LICENSE +44 -0
- package/src/primitives/calendar/context.ts +55 -0
- package/src/primitives/calendar/index.ts +12 -0
- package/src/primitives/calendar/useCalendar.ts +164 -0
- package/src/primitives/combobox/ComboboxContent.ts +199 -0
- package/src/primitives/combobox/ComboboxItem.ts +209 -0
- package/src/primitives/combobox/ComboboxRoot.ts +489 -0
- package/src/primitives/combobox/LICENSE +44 -0
- package/src/primitives/combobox/context.ts +47 -0
- package/src/primitives/combobox/index.ts +23 -0
- package/src/primitives/context-menu/LICENSE +44 -0
- package/src/primitives/context-menu/index.ts +388 -0
- package/src/primitives/date-field/DateFieldInput.ts +29 -0
- package/src/primitives/date-field/DateFieldRoot.ts +343 -0
- package/src/primitives/date-field/LICENSE +44 -0
- package/src/primitives/date-field/context.ts +29 -0
- package/src/primitives/date-field/index.ts +3 -0
- package/src/primitives/date-field/segmentInput.ts +96 -0
- package/src/primitives/date-field/useDateFieldSegment.ts +63 -0
- package/src/primitives/date-range-field/DateRangeFieldInput.ts +42 -0
- package/src/primitives/date-range-field/DateRangeFieldRoot.ts +389 -0
- package/src/primitives/date-range-field/LICENSE +44 -0
- package/src/primitives/date-range-field/context.ts +36 -0
- package/src/primitives/date-range-field/index.ts +12 -0
- package/src/primitives/dialog/DialogContent.ts +193 -0
- package/src/primitives/dialog/DialogContentImpl.ts +114 -0
- package/src/primitives/dialog/DialogOverlay.ts +99 -0
- package/src/primitives/dialog/DialogPortal.ts +33 -0
- package/src/primitives/dialog/DialogRoot.ts +61 -0
- package/src/primitives/dialog/DialogText.ts +59 -0
- package/src/primitives/dialog/DialogTrigger.ts +46 -0
- package/src/primitives/dialog/LICENSE +44 -0
- package/src/primitives/dialog/context.ts +19 -0
- package/src/primitives/dialog/index.ts +7 -0
- package/src/primitives/dismissable-layer/DismissableLayer.ts +212 -0
- package/src/primitives/dismissable-layer/DismissableLayerBranch.ts +27 -0
- package/src/primitives/dismissable-layer/LICENSE +44 -0
- package/src/primitives/dismissable-layer/index.ts +11 -0
- package/src/primitives/dropdown-menu/LICENSE +44 -0
- package/src/primitives/dropdown-menu/index.ts +344 -0
- package/src/primitives/focus-scope/FocusScope.ts +118 -0
- package/src/primitives/focus-scope/LICENSE +44 -0
- package/src/primitives/focus-scope/index.ts +1 -0
- package/src/primitives/hover-card/LICENSE +44 -0
- package/src/primitives/hover-card/index.ts +357 -0
- package/src/primitives/listbox/LICENSE +44 -0
- package/src/primitives/listbox/ListboxContent.ts +80 -0
- package/src/primitives/listbox/ListboxFilter.ts +130 -0
- package/src/primitives/listbox/ListboxGroup.ts +67 -0
- package/src/primitives/listbox/ListboxItem.ts +125 -0
- package/src/primitives/listbox/ListboxRoot.ts +376 -0
- package/src/primitives/listbox/context.ts +62 -0
- package/src/primitives/listbox/index.ts +17 -0
- package/src/primitives/menu/LICENSE +44 -0
- package/src/primitives/menu/MenuContentImpl.ts +304 -0
- package/src/primitives/menu/MenuItem.ts +495 -0
- package/src/primitives/menu/MenuRoot.ts +295 -0
- package/src/primitives/menu/context.ts +72 -0
- package/src/primitives/menu/index.ts +26 -0
- package/src/primitives/menu/wrap.ts +53 -0
- package/src/primitives/menubar/index.ts +494 -0
- package/src/primitives/navigation-menu/LICENSE +44 -0
- package/src/primitives/navigation-menu/NavigationMenuContent.ts +375 -0
- package/src/primitives/navigation-menu/NavigationMenuParts.ts +432 -0
- package/src/primitives/navigation-menu/NavigationMenuRoot.ts +260 -0
- package/src/primitives/navigation-menu/context.ts +50 -0
- package/src/primitives/navigation-menu/index.ts +20 -0
- package/src/primitives/number-field/__snapshots__/NumberField.test.ts.snap +288 -0
- package/src/primitives/picker/LICENSE +44 -0
- package/src/primitives/picker/createPicker.ts +618 -0
- package/src/primitives/picker/index.ts +26 -0
- package/src/primitives/popover/LICENSE +44 -0
- package/src/primitives/popover/PopoverContent.ts +243 -0
- package/src/primitives/popover/PopoverParts.ts +143 -0
- package/src/primitives/popover/PopoverRoot.ts +58 -0
- package/src/primitives/popover/context.ts +16 -0
- package/src/primitives/popover/index.ts +14 -0
- package/src/primitives/popper/Arrow.ts +49 -0
- package/src/primitives/popper/LICENSE +44 -0
- package/src/primitives/popper/PopperAnchor.ts +33 -0
- package/src/primitives/popper/PopperArrow.ts +77 -0
- package/src/primitives/popper/PopperContent.ts +262 -0
- package/src/primitives/popper/PopperRoot.ts +16 -0
- package/src/primitives/popper/context.ts +23 -0
- package/src/primitives/popper/index.ts +11 -0
- package/src/primitives/range-calendar/LICENSE +44 -0
- package/src/primitives/range-calendar/RangeCalendarCellTrigger.ts +241 -0
- package/src/primitives/range-calendar/RangeCalendarGrid.ts +90 -0
- package/src/primitives/range-calendar/RangeCalendarRoot.ts +413 -0
- package/src/primitives/range-calendar/context.ts +71 -0
- package/src/primitives/range-calendar/index.ts +21 -0
- package/src/primitives/select/LICENSE +44 -0
- package/src/primitives/select/SelectContent.ts +330 -0
- package/src/primitives/select/SelectItem.ts +204 -0
- package/src/primitives/select/SelectRoot.ts +408 -0
- package/src/primitives/select/context.ts +74 -0
- package/src/primitives/select/index.ts +17 -0
- package/src/primitives/tags-input/LICENSE +44 -0
- package/src/primitives/tags-input/TagsInputInput.ts +148 -0
- package/src/primitives/tags-input/TagsInputItem.ts +105 -0
- package/src/primitives/tags-input/TagsInputRoot.ts +215 -0
- package/src/primitives/tags-input/context.ts +36 -0
- package/src/primitives/tags-input/index.ts +9 -0
- package/src/primitives/teleport/LICENSE +44 -0
- package/src/primitives/teleport/Teleport.ts +41 -0
- package/src/primitives/teleport/index.ts +1 -0
- package/src/primitives/time-field/LICENSE +44 -0
- package/src/primitives/time-field/TimeFieldInput.ts +29 -0
- package/src/primitives/time-field/TimeFieldRoot.ts +379 -0
- package/src/primitives/time-field/context.ts +28 -0
- package/src/primitives/time-field/index.ts +4 -0
- package/src/primitives/toast/LICENSE +44 -0
- package/src/primitives/toast/ToastProvider.ts +311 -0
- package/src/primitives/toast/ToastRoot.ts +518 -0
- package/src/primitives/toast/index.ts +16 -0
- package/src/primitives/tooltip/LICENSE +44 -0
- package/src/primitives/tooltip/TooltipParts.ts +351 -0
- package/src/primitives/tooltip/TooltipRoot.ts +170 -0
- package/src/primitives/tooltip/context.ts +39 -0
- package/src/primitives/tooltip/index.ts +9 -0
- package/src/primitives/tree/LICENSE +44 -0
- package/src/primitives/tree/TreeItem.ts +256 -0
- package/src/primitives/tree/TreeRoot.ts +273 -0
- package/src/primitives/tree/context.ts +34 -0
- package/src/primitives/tree/index.ts +4 -0
- package/src/primitives/utils/config.ts +19 -1
- package/src/primitives/utils/defu.ts +26 -0
- package/src/primitives/utils/env.ts +5 -0
- package/src/primitives/utils/layers.ts +4 -0
- package/src/primitives/utils/propsWithoutDefaults.ts +8 -0
- package/src/primitives/utils/useBodyScrollLock.ts +29 -0
- package/src/primitives/utils/useFocusGuards.ts +10 -0
- package/src/primitives/utils/useGraceArea.ts +85 -0
- package/src/primitives/utils/useHideOthers.ts +18 -0
- package/src/primitives/utils/useIsUsingKeyboard.ts +25 -0
- package/src/primitives/utils/useLocale.ts +7 -0
- package/src/primitives/utils/useVModel.ts +8 -3
- package/src/singletons.ts +1 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
mergeProps,
|
|
6
|
+
nextTick,
|
|
7
|
+
onMounted,
|
|
8
|
+
ref,
|
|
9
|
+
renderSlot,
|
|
10
|
+
toRefs,
|
|
11
|
+
watch,
|
|
12
|
+
withCtx,
|
|
13
|
+
withKeys,
|
|
14
|
+
type PropType,
|
|
15
|
+
type Ref,
|
|
16
|
+
} from 'vue'
|
|
17
|
+
import type { DateValue } from '@internationalized/date'
|
|
18
|
+
import {
|
|
19
|
+
areAllDaysBetweenValid,
|
|
20
|
+
getDefaultDate,
|
|
21
|
+
hasTime,
|
|
22
|
+
isBefore,
|
|
23
|
+
isBeforeOrSame,
|
|
24
|
+
type Granularity,
|
|
25
|
+
type HourCycle,
|
|
26
|
+
} from '../../../../shared/src/primitives/date/comparators'
|
|
27
|
+
import { createDateFormatter } from '../../../../shared/src/primitives/date/formatter'
|
|
28
|
+
import {
|
|
29
|
+
createContent,
|
|
30
|
+
initializeSegmentValues,
|
|
31
|
+
syncSegmentValues,
|
|
32
|
+
type SegmentValueObj,
|
|
33
|
+
} from '../../../../shared/src/primitives/date/parser'
|
|
34
|
+
import {
|
|
35
|
+
getSegmentElements,
|
|
36
|
+
isSegmentNavigationKey,
|
|
37
|
+
} from '../../../../shared/src/primitives/date/segment'
|
|
38
|
+
import {
|
|
39
|
+
kbd,
|
|
40
|
+
normalizeDateStep,
|
|
41
|
+
normalizeHourCycle,
|
|
42
|
+
type DateStep,
|
|
43
|
+
} from '../../../../shared/src/primitives/date/utils'
|
|
44
|
+
import { DATE_FIELD_SEGMENT } from '../date-field/DateFieldRoot'
|
|
45
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
46
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
47
|
+
import { useLocale } from '../utils/useLocale'
|
|
48
|
+
import { usePrimitiveElement } from '../utils/usePrimitiveElement'
|
|
49
|
+
import { useVModel } from '../utils/useVModel'
|
|
50
|
+
import { VisuallyHidden } from '../visually-hidden'
|
|
51
|
+
import { provideDateRangeFieldRootContext, type DateRange } from './context'
|
|
52
|
+
import { DATE_RANGE_FIELD_SEGMENT_TYPE } from './DateRangeFieldInput'
|
|
53
|
+
|
|
54
|
+
export interface DateRangeFieldRootProps {
|
|
55
|
+
defaultValue?: DateRange
|
|
56
|
+
defaultPlaceholder?: DateValue
|
|
57
|
+
placeholder?: DateValue
|
|
58
|
+
modelValue?: DateRange | null
|
|
59
|
+
hourCycle?: HourCycle
|
|
60
|
+
step?: DateStep
|
|
61
|
+
granularity?: Granularity
|
|
62
|
+
hideTimeZone?: boolean
|
|
63
|
+
maxValue?: DateValue
|
|
64
|
+
minValue?: DateValue
|
|
65
|
+
locale?: string
|
|
66
|
+
disabled?: boolean
|
|
67
|
+
readonly?: boolean
|
|
68
|
+
isDateUnavailable?: (date: DateValue) => boolean
|
|
69
|
+
id?: string
|
|
70
|
+
dir?: Direction
|
|
71
|
+
asChild?: boolean
|
|
72
|
+
as?: PrimitiveProps['as']
|
|
73
|
+
name?: string
|
|
74
|
+
required?: boolean
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type DateRangeFieldRootEmits = {
|
|
78
|
+
'update:modelValue': [value: DateRange]
|
|
79
|
+
'update:placeholder': [date: DateValue]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const DateRangeFieldRoot = defineComponent({
|
|
83
|
+
name: 'DateRangeFieldRoot',
|
|
84
|
+
inheritAttrs: false,
|
|
85
|
+
props: {
|
|
86
|
+
defaultValue: { type: Object as PropType<DateRange>, required: false, default: undefined },
|
|
87
|
+
defaultPlaceholder: { type: null as unknown as PropType<DateValue>, required: false },
|
|
88
|
+
placeholder: {
|
|
89
|
+
type: null as unknown as PropType<DateValue>,
|
|
90
|
+
required: false,
|
|
91
|
+
default: undefined,
|
|
92
|
+
},
|
|
93
|
+
modelValue: { type: [Object, null] as PropType<DateRange | null>, required: false },
|
|
94
|
+
hourCycle: { type: null as unknown as PropType<HourCycle>, required: false },
|
|
95
|
+
step: { type: Object as PropType<DateStep>, required: false },
|
|
96
|
+
granularity: { type: String as PropType<Granularity>, required: false },
|
|
97
|
+
hideTimeZone: { type: Boolean, required: false },
|
|
98
|
+
maxValue: { type: null as unknown as PropType<DateValue>, required: false },
|
|
99
|
+
minValue: { type: null as unknown as PropType<DateValue>, required: false },
|
|
100
|
+
locale: { type: String, required: false },
|
|
101
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
102
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
103
|
+
isDateUnavailable: {
|
|
104
|
+
type: Function as PropType<(date: DateValue) => boolean>,
|
|
105
|
+
required: false,
|
|
106
|
+
default: undefined,
|
|
107
|
+
},
|
|
108
|
+
id: { type: String, required: false },
|
|
109
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
110
|
+
asChild: { type: Boolean, required: false },
|
|
111
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
112
|
+
name: { type: String, required: false },
|
|
113
|
+
required: { type: Boolean, required: false },
|
|
114
|
+
},
|
|
115
|
+
emits: ['update:modelValue', 'update:placeholder'],
|
|
116
|
+
setup(props, { emit, expose, slots, attrs }) {
|
|
117
|
+
const {
|
|
118
|
+
disabled,
|
|
119
|
+
readonly,
|
|
120
|
+
isDateUnavailable: propsIsDateUnavailable,
|
|
121
|
+
dir: propDir,
|
|
122
|
+
locale: propLocale,
|
|
123
|
+
} = toRefs(props)
|
|
124
|
+
const locale = useLocale(propLocale)
|
|
125
|
+
const dir = useDirection(propDir)
|
|
126
|
+
|
|
127
|
+
const formatter = createDateFormatter(locale.value, {
|
|
128
|
+
hourCycle: normalizeHourCycle(props.hourCycle),
|
|
129
|
+
})
|
|
130
|
+
const { primitiveElement, currentElement: parentElement } = usePrimitiveElement()
|
|
131
|
+
const segmentElements = ref<Set<HTMLElement>>(new Set())
|
|
132
|
+
|
|
133
|
+
function collectSegments() {
|
|
134
|
+
getSegmentElements(parentElement.value, DATE_FIELD_SEGMENT).forEach(item =>
|
|
135
|
+
segmentElements.value.add(item),
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
onMounted(collectSegments)
|
|
140
|
+
|
|
141
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
142
|
+
defaultValue: props.defaultValue ?? { start: undefined, end: undefined },
|
|
143
|
+
passive: props.modelValue === undefined,
|
|
144
|
+
}) as Ref<DateRange | null>
|
|
145
|
+
|
|
146
|
+
const defaultDate = getDefaultDate({
|
|
147
|
+
defaultPlaceholder: props.placeholder,
|
|
148
|
+
granularity: props.granularity,
|
|
149
|
+
defaultValue: modelValue.value?.start,
|
|
150
|
+
locale: props.locale,
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
const placeholder = useVModel(props, 'placeholder', emit, {
|
|
154
|
+
defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
|
|
155
|
+
passive: props.placeholder === undefined,
|
|
156
|
+
}) as Ref<DateValue>
|
|
157
|
+
|
|
158
|
+
const step = computed(() => normalizeDateStep(props.step))
|
|
159
|
+
|
|
160
|
+
const inferredGranularity = computed<Granularity>(() => {
|
|
161
|
+
if (props.granularity) return !hasTime(placeholder.value) ? 'day' : props.granularity
|
|
162
|
+
return hasTime(placeholder.value) ? 'minute' : 'day'
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
function isDateInvalid(date: DateValue | undefined) {
|
|
166
|
+
if (!date) return false
|
|
167
|
+
if (propsIsDateUnavailable.value?.(date)) return true
|
|
168
|
+
if (props.minValue && isBefore(date, props.minValue)) return true
|
|
169
|
+
if (props.maxValue && isBefore(props.maxValue, date)) return true
|
|
170
|
+
return false
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const isStartInvalid = computed(() => isDateInvalid(modelValue.value?.start))
|
|
174
|
+
const isEndInvalid = computed(() => isDateInvalid(modelValue.value?.end))
|
|
175
|
+
|
|
176
|
+
const isInvalid = computed(() => {
|
|
177
|
+
if (isStartInvalid.value || isEndInvalid.value) return true
|
|
178
|
+
if (!modelValue.value?.start || !modelValue.value?.end) return false
|
|
179
|
+
if (!isBeforeOrSame(modelValue.value.start, modelValue.value.end)) return true
|
|
180
|
+
if (propsIsDateUnavailable.value !== undefined) {
|
|
181
|
+
const allValid = areAllDaysBetweenValid(
|
|
182
|
+
modelValue.value.start,
|
|
183
|
+
modelValue.value.end,
|
|
184
|
+
propsIsDateUnavailable.value,
|
|
185
|
+
undefined,
|
|
186
|
+
)
|
|
187
|
+
if (!allValid) return true
|
|
188
|
+
}
|
|
189
|
+
return false
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
const initialSegments = initializeSegmentValues(inferredGranularity.value)
|
|
193
|
+
|
|
194
|
+
const startSegmentValues = ref<SegmentValueObj>(
|
|
195
|
+
modelValue.value?.start
|
|
196
|
+
? { ...syncSegmentValues({ value: modelValue.value.start, formatter }) }
|
|
197
|
+
: { ...initialSegments },
|
|
198
|
+
)
|
|
199
|
+
const endSegmentValues = ref<SegmentValueObj>(
|
|
200
|
+
modelValue.value?.end
|
|
201
|
+
? { ...syncSegmentValues({ value: modelValue.value.end, formatter }) }
|
|
202
|
+
: { ...initialSegments },
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
function segmentContent(values: SegmentValueObj) {
|
|
206
|
+
return createContent({
|
|
207
|
+
granularity: inferredGranularity.value,
|
|
208
|
+
dateRef: placeholder.value,
|
|
209
|
+
formatter,
|
|
210
|
+
hideTimeZone: props.hideTimeZone,
|
|
211
|
+
hourCycle: props.hourCycle,
|
|
212
|
+
segmentValues: values,
|
|
213
|
+
locale: locale.value,
|
|
214
|
+
})
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const startSegmentContent = computed(() => segmentContent(startSegmentValues.value))
|
|
218
|
+
const endSegmentContent = computed(() => segmentContent(endSegmentValues.value))
|
|
219
|
+
|
|
220
|
+
const segmentContents = computed(() => ({
|
|
221
|
+
start: startSegmentContent.value.arr,
|
|
222
|
+
end: endSegmentContent.value.arr,
|
|
223
|
+
}))
|
|
224
|
+
|
|
225
|
+
const editableSegmentContents = computed(() => ({
|
|
226
|
+
start: segmentContents.value.start.filter(({ part }) => part !== 'literal'),
|
|
227
|
+
end: segmentContents.value.end.filter(({ part }) => part !== 'literal'),
|
|
228
|
+
}))
|
|
229
|
+
|
|
230
|
+
const startValue = ref(modelValue.value?.start?.copy()) as Ref<DateValue | undefined>
|
|
231
|
+
const endValue = ref(modelValue.value?.end?.copy()) as Ref<DateValue | undefined>
|
|
232
|
+
|
|
233
|
+
watch([startValue, endValue], ([start, end]) => {
|
|
234
|
+
modelValue.value = { start: start?.copy(), end: end?.copy() }
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
watch(modelValue, value => {
|
|
238
|
+
const isStartChanged =
|
|
239
|
+
value?.start && startValue.value
|
|
240
|
+
? value.start.compare(startValue.value) !== 0
|
|
241
|
+
: value?.start !== startValue.value
|
|
242
|
+
if (isStartChanged) startValue.value = value?.start?.copy()
|
|
243
|
+
const isEndChanged =
|
|
244
|
+
value?.end && endValue.value
|
|
245
|
+
? value.end.compare(endValue.value) !== 0
|
|
246
|
+
: value?.end !== endValue.value
|
|
247
|
+
if (isEndChanged) endValue.value = value?.end?.copy()
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
watch([startValue, locale], ([start]) => {
|
|
251
|
+
if (start !== undefined)
|
|
252
|
+
startSegmentValues.value = { ...syncSegmentValues({ value: start, formatter }) }
|
|
253
|
+
else if (
|
|
254
|
+
Object.values(startSegmentValues.value).every(item => item !== null) &&
|
|
255
|
+
start === undefined
|
|
256
|
+
)
|
|
257
|
+
startSegmentValues.value = { ...initialSegments }
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
watch(locale, value => {
|
|
261
|
+
if (formatter.getLocale() !== value) {
|
|
262
|
+
formatter.setLocale(value)
|
|
263
|
+
void nextTick(() => {
|
|
264
|
+
segmentElements.value.clear()
|
|
265
|
+
collectSegments()
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
watch(modelValue, value => {
|
|
271
|
+
if (value && value.start !== undefined && placeholder.value.compare(value.start) !== 0)
|
|
272
|
+
placeholder.value = value.start.copy()
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
watch([endValue, locale], ([end]) => {
|
|
276
|
+
if (end !== undefined)
|
|
277
|
+
endSegmentValues.value = { ...syncSegmentValues({ value: end, formatter }) }
|
|
278
|
+
else if (
|
|
279
|
+
Object.values(endSegmentValues.value).every(item => item !== null) &&
|
|
280
|
+
end === undefined
|
|
281
|
+
)
|
|
282
|
+
endSegmentValues.value = { ...initialSegments }
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
const currentFocusedElement = ref<HTMLElement | null>(null)
|
|
286
|
+
|
|
287
|
+
const currentSegmentIndex = computed(() =>
|
|
288
|
+
Array.from(segmentElements.value).findIndex(
|
|
289
|
+
element =>
|
|
290
|
+
element.getAttribute(DATE_FIELD_SEGMENT) ===
|
|
291
|
+
currentFocusedElement.value?.getAttribute(DATE_FIELD_SEGMENT) &&
|
|
292
|
+
element.getAttribute(DATE_RANGE_FIELD_SEGMENT_TYPE) ===
|
|
293
|
+
currentFocusedElement.value?.getAttribute(DATE_RANGE_FIELD_SEGMENT_TYPE),
|
|
294
|
+
),
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
const nextFocusableSegment = computed(() => {
|
|
298
|
+
const sign = dir.value === 'rtl' ? -1 : 1
|
|
299
|
+
const nextCondition =
|
|
300
|
+
sign < 0
|
|
301
|
+
? currentSegmentIndex.value < 0
|
|
302
|
+
: currentSegmentIndex.value > segmentElements.value.size - 1
|
|
303
|
+
if (nextCondition) return null
|
|
304
|
+
return Array.from(segmentElements.value)[currentSegmentIndex.value + sign]
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
const prevFocusableSegment = computed(() => {
|
|
308
|
+
const sign = dir.value === 'rtl' ? -1 : 1
|
|
309
|
+
const prevCondition =
|
|
310
|
+
sign > 0
|
|
311
|
+
? currentSegmentIndex.value < 0
|
|
312
|
+
: currentSegmentIndex.value > segmentElements.value.size - 1
|
|
313
|
+
if (prevCondition) return null
|
|
314
|
+
return Array.from(segmentElements.value)[currentSegmentIndex.value - sign]
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
318
|
+
if (event.isComposing) return
|
|
319
|
+
if (!isSegmentNavigationKey(event.key)) return
|
|
320
|
+
if (event.key === kbd.ARROW_LEFT) prevFocusableSegment.value?.focus()
|
|
321
|
+
if (event.key === kbd.ARROW_RIGHT) nextFocusableSegment.value?.focus()
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function setFocusedElement(element: HTMLElement) {
|
|
325
|
+
currentFocusedElement.value = element
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
provideDateRangeFieldRootContext({
|
|
329
|
+
isDateUnavailable: propsIsDateUnavailable.value,
|
|
330
|
+
locale,
|
|
331
|
+
startValue,
|
|
332
|
+
endValue,
|
|
333
|
+
placeholder,
|
|
334
|
+
disabled,
|
|
335
|
+
formatter,
|
|
336
|
+
hourCycle: props.hourCycle,
|
|
337
|
+
step,
|
|
338
|
+
readonly,
|
|
339
|
+
segmentValues: { start: startSegmentValues, end: endSegmentValues },
|
|
340
|
+
isInvalid,
|
|
341
|
+
segmentContents: editableSegmentContents,
|
|
342
|
+
elements: segmentElements,
|
|
343
|
+
setFocusedElement,
|
|
344
|
+
focusNext() {
|
|
345
|
+
Array.from(segmentElements.value)[currentSegmentIndex.value + 1]?.focus()
|
|
346
|
+
},
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
expose({ setFocusedElement })
|
|
350
|
+
|
|
351
|
+
const onKeydown = withKeys(handleKeydown as (event: Event) => void, ['left', 'right'])
|
|
352
|
+
const focusFirst = () => Array.from(segmentElements.value)?.[0]?.focus()
|
|
353
|
+
|
|
354
|
+
return () =>
|
|
355
|
+
h(
|
|
356
|
+
Primitive,
|
|
357
|
+
mergeProps(attrs, {
|
|
358
|
+
ref: primitiveElement,
|
|
359
|
+
role: 'group',
|
|
360
|
+
'aria-disabled': disabled.value ? true : undefined,
|
|
361
|
+
'data-disabled': disabled.value ? '' : undefined,
|
|
362
|
+
'data-readonly': readonly.value ? '' : undefined,
|
|
363
|
+
'data-invalid': isInvalid.value ? '' : undefined,
|
|
364
|
+
dir: dir.value,
|
|
365
|
+
onKeydown,
|
|
366
|
+
}),
|
|
367
|
+
{
|
|
368
|
+
default: withCtx(() => [
|
|
369
|
+
renderSlot(slots, 'default', {
|
|
370
|
+
modelValue: modelValue.value,
|
|
371
|
+
segments: segmentContents.value,
|
|
372
|
+
isInvalid: isInvalid.value,
|
|
373
|
+
}),
|
|
374
|
+
h(VisuallyHidden, {
|
|
375
|
+
id: props.id,
|
|
376
|
+
as: 'input',
|
|
377
|
+
feature: 'focusable',
|
|
378
|
+
tabindex: '-1',
|
|
379
|
+
value: `${modelValue.value?.start?.toString()} - ${modelValue.value?.end?.toString()}`,
|
|
380
|
+
name: props.name,
|
|
381
|
+
disabled: disabled.value,
|
|
382
|
+
required: props.required,
|
|
383
|
+
onFocus: focusFirst,
|
|
384
|
+
}),
|
|
385
|
+
]),
|
|
386
|
+
},
|
|
387
|
+
)
|
|
388
|
+
},
|
|
389
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 UnoVue <https://github.com/unovue>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Portions adapted from VueUse:
|
|
24
|
+
MIT License
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
30
|
+
in the Software without restriction, including without limitation the rights
|
|
31
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
33
|
+
furnished to do so, subject to the following conditions:
|
|
34
|
+
|
|
35
|
+
The above copyright notice and this permission notice shall be included in all
|
|
36
|
+
copies or substantial portions of the Software.
|
|
37
|
+
|
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
44
|
+
SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue'
|
|
2
|
+
import type { DateValue } from '@internationalized/date'
|
|
3
|
+
import type { HourCycle } from '../../../../shared/src/primitives/date/comparators'
|
|
4
|
+
import type { Formatter } from '../../../../shared/src/primitives/date/formatter'
|
|
5
|
+
import type { SegmentContent, SegmentValueObj } from '../../../../shared/src/primitives/date/parser'
|
|
6
|
+
import type { DateStep } from '../../../../shared/src/primitives/date/utils'
|
|
7
|
+
import { createContext } from '../utils/createContext'
|
|
8
|
+
|
|
9
|
+
export interface DateRange {
|
|
10
|
+
start: DateValue | undefined
|
|
11
|
+
end: DateValue | undefined
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type DateRangeType = 'start' | 'end'
|
|
15
|
+
|
|
16
|
+
export interface DateRangeFieldRootContext {
|
|
17
|
+
locale: Ref<string>
|
|
18
|
+
startValue: Ref<DateValue | undefined>
|
|
19
|
+
endValue: Ref<DateValue | undefined>
|
|
20
|
+
placeholder: Ref<DateValue>
|
|
21
|
+
isDateUnavailable?: (date: DateValue) => boolean
|
|
22
|
+
isInvalid: Ref<boolean>
|
|
23
|
+
disabled: Ref<boolean>
|
|
24
|
+
readonly: Ref<boolean>
|
|
25
|
+
formatter: Formatter
|
|
26
|
+
hourCycle: HourCycle
|
|
27
|
+
step: ComputedRef<DateStep>
|
|
28
|
+
segmentValues: Record<DateRangeType, Ref<SegmentValueObj>>
|
|
29
|
+
segmentContents: Ref<Record<DateRangeType, SegmentContent[]>>
|
|
30
|
+
elements: Ref<Set<HTMLElement>>
|
|
31
|
+
focusNext: () => void
|
|
32
|
+
setFocusedElement: (element: HTMLElement) => void
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const [injectDateRangeFieldRootContext, provideDateRangeFieldRootContext] =
|
|
36
|
+
createContext<DateRangeFieldRootContext>('DateRangeFieldRoot')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export {
|
|
2
|
+
injectDateRangeFieldRootContext,
|
|
3
|
+
type DateRange,
|
|
4
|
+
type DateRangeFieldRootContext,
|
|
5
|
+
type DateRangeType,
|
|
6
|
+
} from './context'
|
|
7
|
+
export { DateRangeFieldInput, type DateRangeFieldInputProps } from './DateRangeFieldInput'
|
|
8
|
+
export {
|
|
9
|
+
DateRangeFieldRoot,
|
|
10
|
+
type DateRangeFieldRootEmits,
|
|
11
|
+
type DateRangeFieldRootProps,
|
|
12
|
+
} from './DateRangeFieldRoot'
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
mergeProps,
|
|
6
|
+
renderSlot,
|
|
7
|
+
vShow,
|
|
8
|
+
watch,
|
|
9
|
+
withCtx,
|
|
10
|
+
withDirectives,
|
|
11
|
+
type PropType,
|
|
12
|
+
type Component,
|
|
13
|
+
} from 'vue'
|
|
14
|
+
import {
|
|
15
|
+
createNonModalOutsideTracker,
|
|
16
|
+
isContextPointerDown,
|
|
17
|
+
} from '../../../../shared/src/primitives/dialog'
|
|
18
|
+
import { Presence } from '../presence'
|
|
19
|
+
import type { PrimitiveProps } from '../primitive'
|
|
20
|
+
import { useEmitAsProps } from '../utils/useEmitAsProps'
|
|
21
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
22
|
+
import { useHideOthers } from '../utils/useHideOthers'
|
|
23
|
+
import { injectDialogRootContext } from './context'
|
|
24
|
+
import { DialogContentImpl, dialogContentEmits } from './DialogContentImpl'
|
|
25
|
+
|
|
26
|
+
type OutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>
|
|
27
|
+
|
|
28
|
+
const variantProps = {
|
|
29
|
+
forceMount: { type: Boolean, required: false },
|
|
30
|
+
trapFocus: { type: Boolean, required: false },
|
|
31
|
+
asChild: { type: Boolean, required: false },
|
|
32
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
33
|
+
present: { type: Boolean, required: true },
|
|
34
|
+
} as const
|
|
35
|
+
|
|
36
|
+
function omitPresent<T extends { present: boolean }>(props: T) {
|
|
37
|
+
const { present: _, ...rest } = props
|
|
38
|
+
return rest
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const DialogContentModal = defineComponent({
|
|
42
|
+
name: 'DialogContentModal',
|
|
43
|
+
props: {
|
|
44
|
+
...variantProps,
|
|
45
|
+
disableOutsidePointerEvents: { type: Boolean, required: false, default: true },
|
|
46
|
+
},
|
|
47
|
+
emits: dialogContentEmits,
|
|
48
|
+
setup(props, { emit, slots }) {
|
|
49
|
+
const rootContext = injectDialogRootContext()
|
|
50
|
+
const emitsAsProps = useEmitAsProps(emit as (name: string) => void)
|
|
51
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
52
|
+
useHideOthers(computed(() => (props.present ? currentElement.value : undefined)))
|
|
53
|
+
const forwardedProps = computed(() => omitPresent(props))
|
|
54
|
+
|
|
55
|
+
watch(
|
|
56
|
+
() => props.present,
|
|
57
|
+
(isPresent, wasPresent) => {
|
|
58
|
+
if (!isPresent && wasPresent) rootContext.triggerElement.value?.focus()
|
|
59
|
+
},
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
const onCloseAutoFocus = (event: Event) => {
|
|
63
|
+
if (event.defaultPrevented) return
|
|
64
|
+
event.preventDefault()
|
|
65
|
+
rootContext.triggerElement.value?.focus()
|
|
66
|
+
}
|
|
67
|
+
const onPointerDownOutside = (event: OutsideEvent) => {
|
|
68
|
+
if (isContextPointerDown(event.detail.originalEvent)) event.preventDefault()
|
|
69
|
+
}
|
|
70
|
+
const onFocusOutside = (event: Event) => event.preventDefault()
|
|
71
|
+
|
|
72
|
+
return () =>
|
|
73
|
+
h(
|
|
74
|
+
DialogContentImpl as Component,
|
|
75
|
+
mergeProps(
|
|
76
|
+
{ ...forwardedProps.value, ...emitsAsProps },
|
|
77
|
+
{
|
|
78
|
+
ref: forwardRef,
|
|
79
|
+
present: props.present,
|
|
80
|
+
'trap-focus': rootContext.open.value,
|
|
81
|
+
'disable-outside-pointer-events': props.disableOutsidePointerEvents,
|
|
82
|
+
onCloseAutoFocus,
|
|
83
|
+
onPointerDownOutside,
|
|
84
|
+
onFocusOutside,
|
|
85
|
+
},
|
|
86
|
+
),
|
|
87
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
88
|
+
)
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const DialogContentNonModal = defineComponent({
|
|
93
|
+
name: 'DialogContentNonModal',
|
|
94
|
+
props: {
|
|
95
|
+
...variantProps,
|
|
96
|
+
disableOutsidePointerEvents: { type: Boolean, required: false },
|
|
97
|
+
},
|
|
98
|
+
emits: dialogContentEmits,
|
|
99
|
+
setup(props, { emit, slots }) {
|
|
100
|
+
const emitsAsProps = useEmitAsProps(emit as (name: string) => void)
|
|
101
|
+
useForwardExpose()
|
|
102
|
+
const rootContext = injectDialogRootContext()
|
|
103
|
+
const outside = createNonModalOutsideTracker()
|
|
104
|
+
const forwardedProps = computed(() => omitPresent(props))
|
|
105
|
+
|
|
106
|
+
watch(
|
|
107
|
+
() => props.present,
|
|
108
|
+
(isPresent, wasPresent) => {
|
|
109
|
+
if (!isPresent && wasPresent) {
|
|
110
|
+
if (!outside.interacted) rootContext.triggerElement.value?.focus()
|
|
111
|
+
outside.reset()
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
const onCloseAutoFocus = (event: Event) => {
|
|
117
|
+
if (!event.defaultPrevented) {
|
|
118
|
+
if (!outside.interacted) rootContext.triggerElement.value?.focus()
|
|
119
|
+
event.preventDefault()
|
|
120
|
+
}
|
|
121
|
+
outside.reset()
|
|
122
|
+
}
|
|
123
|
+
const onInteractOutside = (event: OutsideEvent) =>
|
|
124
|
+
outside.interact(event, rootContext.triggerElement.value)
|
|
125
|
+
|
|
126
|
+
return () =>
|
|
127
|
+
h(
|
|
128
|
+
DialogContentImpl as Component,
|
|
129
|
+
mergeProps(
|
|
130
|
+
{ ...forwardedProps.value, ...emitsAsProps },
|
|
131
|
+
{
|
|
132
|
+
present: props.present,
|
|
133
|
+
'trap-focus': false,
|
|
134
|
+
'disable-outside-pointer-events': false,
|
|
135
|
+
onCloseAutoFocus,
|
|
136
|
+
onInteractOutside,
|
|
137
|
+
},
|
|
138
|
+
),
|
|
139
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
140
|
+
)
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
export interface DialogContentProps {
|
|
145
|
+
forceMount?: boolean
|
|
146
|
+
disableOutsidePointerEvents?: boolean
|
|
147
|
+
asChild?: boolean
|
|
148
|
+
as?: PrimitiveProps['as']
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const DialogContent = defineComponent({
|
|
152
|
+
name: 'DialogContent',
|
|
153
|
+
props: {
|
|
154
|
+
forceMount: { type: Boolean, required: false },
|
|
155
|
+
disableOutsidePointerEvents: { type: Boolean, required: false, default: undefined },
|
|
156
|
+
asChild: { type: Boolean, required: false },
|
|
157
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
158
|
+
},
|
|
159
|
+
emits: dialogContentEmits,
|
|
160
|
+
setup(props, { emit, attrs, slots }) {
|
|
161
|
+
const rootContext = injectDialogRootContext()
|
|
162
|
+
const emitsAsProps = useEmitAsProps(emit as (name: string) => void)
|
|
163
|
+
const { forwardRef } = useForwardExpose()
|
|
164
|
+
|
|
165
|
+
return () =>
|
|
166
|
+
h(
|
|
167
|
+
Presence,
|
|
168
|
+
{
|
|
169
|
+
present: props.forceMount || rootContext.open.value,
|
|
170
|
+
forceMount: props.forceMount || !rootContext.unmountOnHide.value,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
default: withCtx(({ present }: { present: boolean }) => {
|
|
174
|
+
const shown = rootContext.unmountOnHide.value || present
|
|
175
|
+
const variant = rootContext.modal.value ? DialogContentModal : DialogContentNonModal
|
|
176
|
+
return [
|
|
177
|
+
withDirectives(
|
|
178
|
+
h(
|
|
179
|
+
variant as Component,
|
|
180
|
+
mergeProps(
|
|
181
|
+
{ key: rootContext.modal.value ? 0 : 1, ref: forwardRef, present: shown },
|
|
182
|
+
{ ...props, ...emitsAsProps, ...attrs },
|
|
183
|
+
),
|
|
184
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
185
|
+
),
|
|
186
|
+
[[vShow, shown]],
|
|
187
|
+
),
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
)
|
|
192
|
+
},
|
|
193
|
+
})
|