@hina-ui/vue 1.7.12 → 1.7.13
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 +23318 -7947
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/tour.ts +261 -0
- package/dist/shared/locale/en-US.ts +8 -0
- package/dist/shared/locale/index.ts +1 -0
- package/dist/shared/locale/ja-JP.ts +9 -0
- package/dist/shared/locale/types.ts +8 -0
- package/dist/shared/locale/zh-CN.ts +8 -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/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/tokens.css +1 -0
- package/dist/shared/styles/tour.css +29 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/tour.ts +29 -0
- package/dist/types/shared/src/lib/tour.d.ts +81 -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 +8 -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/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/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/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 +10 -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/ModalContent.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 +1 -1
- package/dist/types/vue/src/components/image/Image.vue.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/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 +1 -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 +34 -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 +33 -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 +5 -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 +5 -5
- package/src/components/alert-dialog/AlertDialog.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 +1 -1
- package/src/components/dialog/ModalContent.vue +2 -1
- package/src/components/drawer/Drawer.vue +1 -1
- 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/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/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 +1 -1
- 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 +447 -0
- package/src/components/tour/tour.variants.ts +1 -0
- package/src/components/tour/types.ts +43 -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 +15 -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 +36 -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,432 @@
|
|
|
1
|
+
import { refAutoReset, unrefElement, useResizeObserver } from '@vueuse/core'
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
createCommentVNode,
|
|
5
|
+
defineComponent,
|
|
6
|
+
Fragment,
|
|
7
|
+
h,
|
|
8
|
+
mergeProps,
|
|
9
|
+
onMounted,
|
|
10
|
+
ref,
|
|
11
|
+
renderSlot,
|
|
12
|
+
Teleport,
|
|
13
|
+
watchEffect,
|
|
14
|
+
withCtx,
|
|
15
|
+
withKeys,
|
|
16
|
+
type Component,
|
|
17
|
+
type ComponentPublicInstance,
|
|
18
|
+
type PropType,
|
|
19
|
+
type Ref,
|
|
20
|
+
} from 'vue'
|
|
21
|
+
import { arrowNavigation } from '../../../../shared/src/primitives/arrow-navigation'
|
|
22
|
+
import { getActiveElement } from '../../../../shared/src/primitives/focus-scope'
|
|
23
|
+
import {
|
|
24
|
+
EVENT_ROOT_CONTENT_DISMISS,
|
|
25
|
+
focusFirst,
|
|
26
|
+
getOpenState,
|
|
27
|
+
getTabbableCandidates,
|
|
28
|
+
LINK_SELECT,
|
|
29
|
+
makeContentId,
|
|
30
|
+
makeTriggerId,
|
|
31
|
+
removeFromTabOrder,
|
|
32
|
+
} from '../../../../shared/src/primitives/navigation-menu'
|
|
33
|
+
import { useCollection } from '../collection'
|
|
34
|
+
import { Presence } from '../presence'
|
|
35
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
36
|
+
import { VisuallyHidden } from '../visually-hidden'
|
|
37
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
38
|
+
import { useId } from '../utils/useId'
|
|
39
|
+
import {
|
|
40
|
+
injectNavigationMenuContext,
|
|
41
|
+
injectNavigationMenuItemContext,
|
|
42
|
+
provideNavigationMenuItemContext,
|
|
43
|
+
} from './context'
|
|
44
|
+
|
|
45
|
+
const primitive = (as?: string) =>
|
|
46
|
+
({
|
|
47
|
+
asChild: { type: Boolean, required: false },
|
|
48
|
+
as: {
|
|
49
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
50
|
+
required: false,
|
|
51
|
+
...(as ? { default: as } : {}),
|
|
52
|
+
},
|
|
53
|
+
}) as const
|
|
54
|
+
|
|
55
|
+
export const NavigationMenuList = defineComponent({
|
|
56
|
+
name: 'NavigationMenuList',
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
props: primitive('ul'),
|
|
59
|
+
setup(props, { attrs, slots }) {
|
|
60
|
+
const menuContext = injectNavigationMenuContext()
|
|
61
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
62
|
+
onMounted(() => {
|
|
63
|
+
menuContext.onIndicatorTrackChange(currentElement.value)
|
|
64
|
+
})
|
|
65
|
+
return () =>
|
|
66
|
+
h(
|
|
67
|
+
Primitive,
|
|
68
|
+
{ ref: forwardRef, style: { position: 'relative' } },
|
|
69
|
+
{
|
|
70
|
+
default: withCtx(() => [
|
|
71
|
+
h(
|
|
72
|
+
Primitive,
|
|
73
|
+
mergeProps(attrs, {
|
|
74
|
+
'as-child': props.asChild,
|
|
75
|
+
as: props.as,
|
|
76
|
+
'data-orientation': menuContext.orientation,
|
|
77
|
+
}),
|
|
78
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
79
|
+
),
|
|
80
|
+
]),
|
|
81
|
+
},
|
|
82
|
+
)
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
export const NavigationMenuItem = defineComponent({
|
|
87
|
+
name: 'NavigationMenuItem',
|
|
88
|
+
props: { value: { type: String, required: false }, ...primitive('li') },
|
|
89
|
+
setup(props, { slots }) {
|
|
90
|
+
useForwardExpose()
|
|
91
|
+
const { getItems } = useCollection({ key: 'NavigationMenu' })
|
|
92
|
+
const context = injectNavigationMenuContext()
|
|
93
|
+
const value = useId(props.value)
|
|
94
|
+
const triggerRef = ref<HTMLElement>()
|
|
95
|
+
const focusProxyRef = ref<HTMLElement>()
|
|
96
|
+
const contentId = makeContentId(context.baseId, value)
|
|
97
|
+
let restoreContentTabOrderRef: () => unknown = () => ({})
|
|
98
|
+
const wasEscapeCloseRef = ref(false)
|
|
99
|
+
|
|
100
|
+
async function handleContentEntry(side: 'start' | 'end' = 'start') {
|
|
101
|
+
const element = document.getElementById(contentId)
|
|
102
|
+
if (element) {
|
|
103
|
+
restoreContentTabOrderRef()
|
|
104
|
+
const candidates = getTabbableCandidates(element)
|
|
105
|
+
if (candidates.length) focusFirst(side === 'start' ? candidates : candidates.reverse())
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function handleContentExit() {
|
|
110
|
+
const element = document.getElementById(contentId)
|
|
111
|
+
if (element) {
|
|
112
|
+
const candidates = getTabbableCandidates(element)
|
|
113
|
+
if (candidates.length) restoreContentTabOrderRef = removeFromTabOrder(candidates)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
provideNavigationMenuItemContext({
|
|
118
|
+
value,
|
|
119
|
+
contentId,
|
|
120
|
+
triggerRef,
|
|
121
|
+
focusProxyRef,
|
|
122
|
+
wasEscapeCloseRef,
|
|
123
|
+
onEntryKeyDown: handleContentEntry,
|
|
124
|
+
onFocusProxyEnter: handleContentEntry,
|
|
125
|
+
onContentFocusOutside: handleContentExit,
|
|
126
|
+
onRootContentClose: handleContentExit,
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
function handleClose() {
|
|
130
|
+
context.onItemDismiss()
|
|
131
|
+
triggerRef.value?.focus()
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
135
|
+
const currentFocus = getActiveElement() as HTMLElement | null
|
|
136
|
+
if (event.keyCode === 32 || event.key === 'Enter') {
|
|
137
|
+
if (context.modelValue.value === value) {
|
|
138
|
+
handleClose()
|
|
139
|
+
event.preventDefault()
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
;(event.target as HTMLElement).click()
|
|
143
|
+
event.preventDefault()
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
const itemsArray = getItems()
|
|
147
|
+
.filter(item => item.ref.parentElement?.hasAttribute('data-menu-item'))
|
|
148
|
+
.map(item => item.ref)
|
|
149
|
+
if (!currentFocus || !itemsArray.includes(currentFocus)) return
|
|
150
|
+
const newSelectedElement = arrowNavigation(event, currentFocus, undefined, {
|
|
151
|
+
itemsArray,
|
|
152
|
+
loop: false,
|
|
153
|
+
})
|
|
154
|
+
if (newSelectedElement) newSelectedElement?.focus()
|
|
155
|
+
event.preventDefault()
|
|
156
|
+
event.stopPropagation()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return () =>
|
|
160
|
+
h(
|
|
161
|
+
Primitive,
|
|
162
|
+
{
|
|
163
|
+
'as-child': props.asChild,
|
|
164
|
+
as: props.as,
|
|
165
|
+
'data-menu-item': '',
|
|
166
|
+
onKeydown: withKeys(handleKeydown as (event: Event) => void, [
|
|
167
|
+
'up',
|
|
168
|
+
'down',
|
|
169
|
+
'left',
|
|
170
|
+
'right',
|
|
171
|
+
'home',
|
|
172
|
+
'end',
|
|
173
|
+
'space',
|
|
174
|
+
]),
|
|
175
|
+
},
|
|
176
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
177
|
+
)
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
export const NavigationMenuTrigger = defineComponent({
|
|
182
|
+
name: 'NavigationMenuTrigger',
|
|
183
|
+
inheritAttrs: false,
|
|
184
|
+
props: { disabled: { type: Boolean, required: false }, ...primitive('button') },
|
|
185
|
+
setup(props, { attrs, slots }) {
|
|
186
|
+
const menuContext = injectNavigationMenuContext()
|
|
187
|
+
const itemContext = injectNavigationMenuItemContext()
|
|
188
|
+
const { CollectionItem } = useCollection({ key: 'NavigationMenu' })
|
|
189
|
+
const { forwardRef, currentElement: triggerElement } = useForwardExpose()
|
|
190
|
+
const triggerId = ref('')
|
|
191
|
+
const contentId = ref('')
|
|
192
|
+
const hasPointerMoveOpenedRef = refAutoReset(false, 300)
|
|
193
|
+
const wasClickCloseRef = ref(false)
|
|
194
|
+
const open = computed(() => itemContext.value === menuContext.modelValue.value)
|
|
195
|
+
|
|
196
|
+
onMounted(() => {
|
|
197
|
+
itemContext.triggerRef = triggerElement as Ref<HTMLElement | undefined>
|
|
198
|
+
triggerId.value = makeTriggerId(menuContext.baseId, itemContext.value)
|
|
199
|
+
contentId.value = makeContentId(menuContext.baseId, itemContext.value)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
function handlePointerEnter() {
|
|
203
|
+
if (menuContext.disableHoverTrigger.value) return
|
|
204
|
+
wasClickCloseRef.value = false
|
|
205
|
+
itemContext.wasEscapeCloseRef.value = false
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function handlePointerMove(event: PointerEvent) {
|
|
209
|
+
if (menuContext.disableHoverTrigger.value) return
|
|
210
|
+
if (event.pointerType === 'mouse') {
|
|
211
|
+
if (
|
|
212
|
+
props.disabled ||
|
|
213
|
+
wasClickCloseRef.value ||
|
|
214
|
+
itemContext.wasEscapeCloseRef.value ||
|
|
215
|
+
hasPointerMoveOpenedRef.value
|
|
216
|
+
)
|
|
217
|
+
return
|
|
218
|
+
menuContext.onTriggerEnter(itemContext.value)
|
|
219
|
+
hasPointerMoveOpenedRef.value = true
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function handlePointerLeave(event: PointerEvent) {
|
|
224
|
+
if (menuContext.disableHoverTrigger.value) return
|
|
225
|
+
if (event.pointerType === 'mouse') {
|
|
226
|
+
if (props.disabled) return
|
|
227
|
+
menuContext.onTriggerLeave()
|
|
228
|
+
hasPointerMoveOpenedRef.value = false
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function handleClick(event: MouseEvent | PointerEvent) {
|
|
233
|
+
if (
|
|
234
|
+
(!('pointerType' in event) || event.pointerType === 'mouse') &&
|
|
235
|
+
menuContext.disableClickTrigger.value
|
|
236
|
+
)
|
|
237
|
+
return
|
|
238
|
+
if (hasPointerMoveOpenedRef.value) return
|
|
239
|
+
if (open.value) menuContext.onItemSelect('')
|
|
240
|
+
else menuContext.onItemSelect(itemContext.value)
|
|
241
|
+
wasClickCloseRef.value = open.value
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
245
|
+
const verticalEntryKey = menuContext.dir.value === 'rtl' ? 'ArrowLeft' : 'ArrowRight'
|
|
246
|
+
const entryKey = { horizontal: 'ArrowDown', vertical: verticalEntryKey }[
|
|
247
|
+
menuContext.orientation
|
|
248
|
+
]
|
|
249
|
+
if (open.value && event.key === entryKey) {
|
|
250
|
+
itemContext.onEntryKeyDown()
|
|
251
|
+
event.preventDefault()
|
|
252
|
+
event.stopPropagation()
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function setFocusProxyRef(node: Element | ComponentPublicInstance | null) {
|
|
257
|
+
if (!node) return undefined
|
|
258
|
+
itemContext.focusProxyRef.value = unrefElement(node as HTMLElement) as HTMLElement
|
|
259
|
+
return undefined
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function handleVisuallyHiddenFocus(event: FocusEvent) {
|
|
263
|
+
const content = document.getElementById(itemContext.contentId)
|
|
264
|
+
const prevFocusedElement = event.relatedTarget as HTMLElement | null
|
|
265
|
+
const wasTriggerFocused = prevFocusedElement === triggerElement.value
|
|
266
|
+
const wasFocusFromContent = content?.contains(prevFocusedElement)
|
|
267
|
+
if (wasTriggerFocused || !wasFocusFromContent)
|
|
268
|
+
itemContext.onFocusProxyEnter(wasTriggerFocused ? 'start' : 'end')
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return () =>
|
|
272
|
+
h(Fragment, null, [
|
|
273
|
+
h(CollectionItem, null, {
|
|
274
|
+
default: withCtx(() => [
|
|
275
|
+
h(
|
|
276
|
+
Primitive,
|
|
277
|
+
mergeProps(
|
|
278
|
+
{
|
|
279
|
+
id: triggerId.value,
|
|
280
|
+
ref: forwardRef,
|
|
281
|
+
disabled: props.disabled,
|
|
282
|
+
'data-disabled': props.disabled ? '' : undefined,
|
|
283
|
+
'data-state': getOpenState(open.value),
|
|
284
|
+
'data-navigation-menu-trigger': '',
|
|
285
|
+
'aria-expanded': open.value,
|
|
286
|
+
'aria-controls': contentId.value,
|
|
287
|
+
'as-child': props.asChild,
|
|
288
|
+
as: props.as,
|
|
289
|
+
},
|
|
290
|
+
attrs,
|
|
291
|
+
{
|
|
292
|
+
onPointerenter: handlePointerEnter,
|
|
293
|
+
onPointermove: handlePointerMove,
|
|
294
|
+
onPointerleave: handlePointerLeave,
|
|
295
|
+
onClick: handleClick,
|
|
296
|
+
onKeydown: handleKeydown,
|
|
297
|
+
},
|
|
298
|
+
),
|
|
299
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
300
|
+
),
|
|
301
|
+
]),
|
|
302
|
+
}),
|
|
303
|
+
open.value
|
|
304
|
+
? h(Fragment, { key: 0 }, [
|
|
305
|
+
h(VisuallyHidden as Component, {
|
|
306
|
+
ref: setFocusProxyRef,
|
|
307
|
+
'aria-hidden': 'true',
|
|
308
|
+
tabindex: 0,
|
|
309
|
+
onFocus: handleVisuallyHiddenFocus,
|
|
310
|
+
}),
|
|
311
|
+
menuContext.viewport
|
|
312
|
+
? h('span', { key: 0, 'aria-owns': contentId.value })
|
|
313
|
+
: createCommentVNode('v-if', true),
|
|
314
|
+
])
|
|
315
|
+
: createCommentVNode('v-if', true),
|
|
316
|
+
])
|
|
317
|
+
},
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
export const NavigationMenuLink = defineComponent({
|
|
321
|
+
name: 'NavigationMenuLink',
|
|
322
|
+
props: { active: { type: Boolean, required: false }, ...primitive('a') },
|
|
323
|
+
emits: ['select'],
|
|
324
|
+
setup(props, { emit, slots }) {
|
|
325
|
+
const { CollectionItem } = useCollection({ key: 'NavigationMenu' })
|
|
326
|
+
useForwardExpose()
|
|
327
|
+
|
|
328
|
+
async function handleClick(event: MouseEvent) {
|
|
329
|
+
const linkSelectEvent = new CustomEvent(LINK_SELECT, {
|
|
330
|
+
bubbles: true,
|
|
331
|
+
cancelable: true,
|
|
332
|
+
detail: { originalEvent: event },
|
|
333
|
+
})
|
|
334
|
+
emit('select', linkSelectEvent)
|
|
335
|
+
if (!linkSelectEvent.defaultPrevented && !event.metaKey) {
|
|
336
|
+
const rootContentDismissEvent = new CustomEvent(EVENT_ROOT_CONTENT_DISMISS, {
|
|
337
|
+
bubbles: true,
|
|
338
|
+
cancelable: true,
|
|
339
|
+
})
|
|
340
|
+
event.target?.dispatchEvent(rootContentDismissEvent)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return () =>
|
|
345
|
+
h(CollectionItem, null, {
|
|
346
|
+
default: withCtx(() => [
|
|
347
|
+
h(
|
|
348
|
+
Primitive,
|
|
349
|
+
{
|
|
350
|
+
as: props.as,
|
|
351
|
+
'data-active': props.active ? '' : undefined,
|
|
352
|
+
'aria-current': props.active ? 'page' : undefined,
|
|
353
|
+
'as-child': props.asChild,
|
|
354
|
+
onClick: handleClick,
|
|
355
|
+
},
|
|
356
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
357
|
+
),
|
|
358
|
+
]),
|
|
359
|
+
})
|
|
360
|
+
},
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
export const NavigationMenuIndicator = defineComponent({
|
|
364
|
+
name: 'NavigationMenuIndicator',
|
|
365
|
+
inheritAttrs: false,
|
|
366
|
+
props: { forceMount: { type: Boolean, required: false }, ...primitive() },
|
|
367
|
+
setup(props, { attrs, slots }) {
|
|
368
|
+
const { forwardRef } = useForwardExpose()
|
|
369
|
+
const menuContext = injectNavigationMenuContext()
|
|
370
|
+
const indicatorStyle = ref<{ size: number; position: number }>()
|
|
371
|
+
const isHorizontal = computed(() => menuContext.orientation === 'horizontal')
|
|
372
|
+
const isVisible = computed(() => !!menuContext.modelValue.value)
|
|
373
|
+
const { activeTrigger } = menuContext
|
|
374
|
+
|
|
375
|
+
function handlePositionChange() {
|
|
376
|
+
if (!activeTrigger.value) return
|
|
377
|
+
indicatorStyle.value = {
|
|
378
|
+
size: isHorizontal.value
|
|
379
|
+
? activeTrigger.value.offsetWidth
|
|
380
|
+
: activeTrigger.value.offsetHeight,
|
|
381
|
+
position: isHorizontal.value
|
|
382
|
+
? activeTrigger.value.offsetLeft
|
|
383
|
+
: activeTrigger.value.offsetTop,
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
watchEffect(() => {
|
|
388
|
+
if (!menuContext.modelValue.value) return
|
|
389
|
+
handlePositionChange()
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
useResizeObserver(activeTrigger, handlePositionChange)
|
|
393
|
+
useResizeObserver(menuContext.indicatorTrack, handlePositionChange)
|
|
394
|
+
|
|
395
|
+
return () =>
|
|
396
|
+
menuContext.indicatorTrack.value
|
|
397
|
+
? h(Teleport, { key: 0, to: menuContext.indicatorTrack.value }, [
|
|
398
|
+
h(
|
|
399
|
+
Presence,
|
|
400
|
+
{ present: props.forceMount || isVisible.value },
|
|
401
|
+
{
|
|
402
|
+
default: withCtx(() => [
|
|
403
|
+
h(
|
|
404
|
+
Primitive,
|
|
405
|
+
mergeProps(
|
|
406
|
+
{
|
|
407
|
+
ref: forwardRef,
|
|
408
|
+
'aria-hidden': 'true',
|
|
409
|
+
'data-state': isVisible.value ? 'visible' : 'hidden',
|
|
410
|
+
'data-orientation': menuContext.orientation,
|
|
411
|
+
'as-child': props.asChild,
|
|
412
|
+
as: props.as,
|
|
413
|
+
style: {
|
|
414
|
+
...(indicatorStyle.value
|
|
415
|
+
? {
|
|
416
|
+
'--reka-navigation-menu-indicator-size': `${indicatorStyle.value.size}px`,
|
|
417
|
+
'--reka-navigation-menu-indicator-position': `${indicatorStyle.value.position}px`,
|
|
418
|
+
}
|
|
419
|
+
: {}),
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
attrs,
|
|
423
|
+
),
|
|
424
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
425
|
+
),
|
|
426
|
+
]),
|
|
427
|
+
},
|
|
428
|
+
),
|
|
429
|
+
])
|
|
430
|
+
: createCommentVNode('v-if', true)
|
|
431
|
+
},
|
|
432
|
+
})
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { refAutoReset, useDebounceFn, useEventListener } from '@vueuse/core'
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
defineComponent,
|
|
5
|
+
h,
|
|
6
|
+
ref,
|
|
7
|
+
renderSlot,
|
|
8
|
+
toRefs,
|
|
9
|
+
watchEffect,
|
|
10
|
+
withCtx,
|
|
11
|
+
type PropType,
|
|
12
|
+
type Ref,
|
|
13
|
+
} from 'vue'
|
|
14
|
+
import { EVENT_ROOT_CONTENT_DISMISS } from '../../../../shared/src/primitives/navigation-menu'
|
|
15
|
+
import { useCollection } from '../collection'
|
|
16
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
17
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
18
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
19
|
+
import { useId } from '../utils/useId'
|
|
20
|
+
import { useVModel } from '../utils/useVModel'
|
|
21
|
+
import {
|
|
22
|
+
injectNavigationMenuContext,
|
|
23
|
+
provideNavigationMenuContext,
|
|
24
|
+
type Orientation,
|
|
25
|
+
} from './context'
|
|
26
|
+
|
|
27
|
+
export const NavigationMenuRoot = defineComponent({
|
|
28
|
+
name: 'NavigationMenuRoot',
|
|
29
|
+
props: {
|
|
30
|
+
modelValue: { type: String, required: false, default: undefined },
|
|
31
|
+
defaultValue: { type: String, required: false },
|
|
32
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
33
|
+
orientation: {
|
|
34
|
+
type: String as PropType<Orientation>,
|
|
35
|
+
required: false,
|
|
36
|
+
default: 'horizontal',
|
|
37
|
+
},
|
|
38
|
+
delayDuration: { type: Number, required: false, default: 200 },
|
|
39
|
+
skipDelayDuration: { type: Number, required: false, default: 300 },
|
|
40
|
+
disableClickTrigger: { type: Boolean, required: false, default: false },
|
|
41
|
+
disableHoverTrigger: { type: Boolean, required: false, default: false },
|
|
42
|
+
disablePointerLeaveClose: { type: Boolean, required: false },
|
|
43
|
+
unmountOnHide: { type: Boolean, required: false, default: true },
|
|
44
|
+
asChild: { type: Boolean, required: false },
|
|
45
|
+
as: {
|
|
46
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
47
|
+
required: false,
|
|
48
|
+
default: 'nav',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
emits: ['update:modelValue'],
|
|
52
|
+
setup(props, { emit, slots }) {
|
|
53
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
54
|
+
defaultValue: props.defaultValue ?? '',
|
|
55
|
+
passive: props.modelValue === undefined,
|
|
56
|
+
}) as Ref<string>
|
|
57
|
+
const previousValue = ref('')
|
|
58
|
+
const { forwardRef, currentElement: rootNavigationMenu } = useForwardExpose()
|
|
59
|
+
const indicatorTrack = ref<HTMLElement>()
|
|
60
|
+
const viewport = ref<HTMLElement>()
|
|
61
|
+
const activeTrigger = ref<HTMLElement>()
|
|
62
|
+
const { getItems, CollectionSlot } = useCollection({ key: 'NavigationMenu', isProvider: true })
|
|
63
|
+
const {
|
|
64
|
+
delayDuration,
|
|
65
|
+
skipDelayDuration,
|
|
66
|
+
dir: propDir,
|
|
67
|
+
disableClickTrigger,
|
|
68
|
+
disableHoverTrigger,
|
|
69
|
+
unmountOnHide,
|
|
70
|
+
} = toRefs(props)
|
|
71
|
+
const dir = useDirection(propDir)
|
|
72
|
+
const isDelaySkipped = refAutoReset(false, skipDelayDuration)
|
|
73
|
+
const skipNextClose = ref(false)
|
|
74
|
+
const computedDelay = computed(() => {
|
|
75
|
+
const isOpen = modelValue.value !== ''
|
|
76
|
+
if (isOpen || isDelaySkipped.value) return 150
|
|
77
|
+
return delayDuration.value
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const debouncedFn = useDebounceFn((value?: string) => {
|
|
81
|
+
if (typeof value === 'string') {
|
|
82
|
+
if (value === '' && skipNextClose.value) {
|
|
83
|
+
skipNextClose.value = false
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
previousValue.value = modelValue.value
|
|
87
|
+
modelValue.value = value
|
|
88
|
+
if (value === '') isDelaySkipped.value = true
|
|
89
|
+
}
|
|
90
|
+
}, computedDelay)
|
|
91
|
+
|
|
92
|
+
watchEffect(() => {
|
|
93
|
+
if (!modelValue.value) return
|
|
94
|
+
const items = getItems().map(item => item.ref)
|
|
95
|
+
activeTrigger.value = items.find(item => item.id.includes(modelValue.value))
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
useEventListener(rootNavigationMenu, EVENT_ROOT_CONTENT_DISMISS, onItemDismiss)
|
|
99
|
+
|
|
100
|
+
provideNavigationMenuContext({
|
|
101
|
+
isRootMenu: true,
|
|
102
|
+
modelValue,
|
|
103
|
+
previousValue,
|
|
104
|
+
baseId: useId(undefined, 'reka-navigation-menu'),
|
|
105
|
+
disableClickTrigger,
|
|
106
|
+
disableHoverTrigger,
|
|
107
|
+
dir,
|
|
108
|
+
unmountOnHide,
|
|
109
|
+
orientation: props.orientation,
|
|
110
|
+
rootNavigationMenu: rootNavigationMenu as Ref<HTMLElement | undefined>,
|
|
111
|
+
indicatorTrack,
|
|
112
|
+
activeTrigger,
|
|
113
|
+
onIndicatorTrackChange: value => {
|
|
114
|
+
indicatorTrack.value = value
|
|
115
|
+
},
|
|
116
|
+
viewport,
|
|
117
|
+
onViewportChange: value => {
|
|
118
|
+
viewport.value = value
|
|
119
|
+
},
|
|
120
|
+
onTriggerEnter: value => {
|
|
121
|
+
if (modelValue.value !== '') {
|
|
122
|
+
skipNextClose.value = true
|
|
123
|
+
previousValue.value = modelValue.value
|
|
124
|
+
modelValue.value = value
|
|
125
|
+
} else debouncedFn(value)
|
|
126
|
+
},
|
|
127
|
+
onTriggerLeave: () => {
|
|
128
|
+
skipNextClose.value = false
|
|
129
|
+
debouncedFn('')
|
|
130
|
+
},
|
|
131
|
+
onContentEnter: () => {
|
|
132
|
+
debouncedFn()
|
|
133
|
+
},
|
|
134
|
+
onContentLeave: () => {
|
|
135
|
+
if (!props.disablePointerLeaveClose) {
|
|
136
|
+
skipNextClose.value = false
|
|
137
|
+
debouncedFn('')
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
onItemSelect: value => {
|
|
141
|
+
previousValue.value = modelValue.value
|
|
142
|
+
modelValue.value = value
|
|
143
|
+
},
|
|
144
|
+
onItemDismiss,
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
function onItemDismiss() {
|
|
148
|
+
previousValue.value = modelValue.value
|
|
149
|
+
modelValue.value = ''
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return () =>
|
|
153
|
+
h(CollectionSlot, null, {
|
|
154
|
+
default: withCtx(() => [
|
|
155
|
+
h(
|
|
156
|
+
Primitive,
|
|
157
|
+
{
|
|
158
|
+
ref: forwardRef,
|
|
159
|
+
as: props.as,
|
|
160
|
+
'as-child': props.asChild,
|
|
161
|
+
'data-orientation': props.orientation,
|
|
162
|
+
dir: dir.value,
|
|
163
|
+
'data-reka-navigation-menu': '',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
default: withCtx(() => [
|
|
167
|
+
renderSlot(slots, 'default', { modelValue: modelValue.value }),
|
|
168
|
+
]),
|
|
169
|
+
},
|
|
170
|
+
),
|
|
171
|
+
]),
|
|
172
|
+
})
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
export const NavigationMenuSub = defineComponent({
|
|
177
|
+
name: 'NavigationMenuSub',
|
|
178
|
+
props: {
|
|
179
|
+
modelValue: { type: String, required: false },
|
|
180
|
+
defaultValue: { type: String, required: false },
|
|
181
|
+
orientation: {
|
|
182
|
+
type: String as PropType<Orientation>,
|
|
183
|
+
required: false,
|
|
184
|
+
default: 'horizontal',
|
|
185
|
+
},
|
|
186
|
+
asChild: { type: Boolean, required: false },
|
|
187
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
188
|
+
},
|
|
189
|
+
emits: ['update:modelValue'],
|
|
190
|
+
setup(props, { emit, slots }) {
|
|
191
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
192
|
+
defaultValue: props.defaultValue ?? '',
|
|
193
|
+
passive: props.modelValue === undefined,
|
|
194
|
+
}) as Ref<string>
|
|
195
|
+
const previousValue = ref('')
|
|
196
|
+
const menuContext = injectNavigationMenuContext()
|
|
197
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
198
|
+
const indicatorTrack = ref<HTMLElement>()
|
|
199
|
+
const viewport = ref<HTMLElement>()
|
|
200
|
+
const activeTrigger = ref<HTMLElement>()
|
|
201
|
+
const { getItems, CollectionSlot } = useCollection({ key: 'NavigationMenu', isProvider: true })
|
|
202
|
+
|
|
203
|
+
watchEffect(() => {
|
|
204
|
+
if (!modelValue.value) return
|
|
205
|
+
const items = getItems().map(item => item.ref)
|
|
206
|
+
activeTrigger.value = items.find(item => item.id.includes(modelValue.value))
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
provideNavigationMenuContext({
|
|
210
|
+
...menuContext,
|
|
211
|
+
isRootMenu: false,
|
|
212
|
+
modelValue,
|
|
213
|
+
previousValue,
|
|
214
|
+
activeTrigger,
|
|
215
|
+
orientation: props.orientation,
|
|
216
|
+
rootNavigationMenu: currentElement as Ref<HTMLElement | undefined>,
|
|
217
|
+
indicatorTrack,
|
|
218
|
+
onIndicatorTrackChange: value => {
|
|
219
|
+
indicatorTrack.value = value
|
|
220
|
+
},
|
|
221
|
+
viewport,
|
|
222
|
+
onViewportChange: value => {
|
|
223
|
+
viewport.value = value
|
|
224
|
+
},
|
|
225
|
+
onTriggerEnter: value => {
|
|
226
|
+
modelValue.value = value
|
|
227
|
+
},
|
|
228
|
+
onTriggerLeave: () => {},
|
|
229
|
+
onContentEnter: () => {},
|
|
230
|
+
onContentLeave: () => {},
|
|
231
|
+
onItemSelect: value => {
|
|
232
|
+
modelValue.value = value
|
|
233
|
+
},
|
|
234
|
+
onItemDismiss: () => {
|
|
235
|
+
modelValue.value = ''
|
|
236
|
+
},
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
return () =>
|
|
240
|
+
h(CollectionSlot, null, {
|
|
241
|
+
default: withCtx(() => [
|
|
242
|
+
h(
|
|
243
|
+
Primitive,
|
|
244
|
+
{
|
|
245
|
+
ref: forwardRef,
|
|
246
|
+
'data-orientation': props.orientation,
|
|
247
|
+
'as-child': props.asChild,
|
|
248
|
+
as: props.as,
|
|
249
|
+
'data-reka-navigation-menu': '',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
default: withCtx(() => [
|
|
253
|
+
renderSlot(slots, 'default', { modelValue: modelValue.value }),
|
|
254
|
+
]),
|
|
255
|
+
},
|
|
256
|
+
),
|
|
257
|
+
]),
|
|
258
|
+
})
|
|
259
|
+
},
|
|
260
|
+
})
|