@hina-ui/vue 1.7.11 → 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 +25614 -10189
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/css-time.ts +6 -0
- package/dist/shared/lib/line-clamp.ts +8 -8
- 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/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/pin-input/index.ts +394 -97
- 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/interaction.css +6 -2
- package/dist/shared/styles/line-clamp.css +6 -2
- package/dist/shared/styles/pin-input.css +84 -0
- package/dist/shared/styles/tokens.css +2 -0
- package/dist/shared/styles/tour.css +29 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/pin-input.ts +26 -7
- package/dist/shared/variants/tour.ts +29 -0
- package/dist/types/shared/src/lib/css-time.d.ts +2 -0
- package/dist/types/shared/src/lib/css-time.d.ts.map +1 -0
- package/dist/types/shared/src/lib/line-clamp.d.ts.map +1 -1
- 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/pin-input/index.d.ts +35 -27
- package/dist/types/shared/src/primitives/pin-input/index.d.ts.map +1 -1
- 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/pin-input.d.ts +30 -10
- package/dist/types/shared/src/variants/pin-input.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/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/pagination/composables/usePaginationWindow.d.ts +6 -6
- package/dist/types/vue/src/components/pin-input/PinInput.vue.d.ts +2 -0
- package/dist/types/vue/src/components/pin-input/PinInput.vue.d.ts.map +1 -1
- 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/{pin-input/PinInputRoot.d.ts → listbox/ListboxRoot.d.ts} +60 -53
- 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/{pin-input/PinInputInput.d.ts → tags-input/TagsInputInput.d.ts} +23 -14
- 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/image/composables/useImage.ts +2 -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/pin-input/PinInput.vue +103 -33
- 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/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
- package/dist/types/vue/src/primitives/pin-input/PinInputInput.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/PinInputRoot.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/context.d.ts +0 -20
- package/dist/types/vue/src/primitives/pin-input/context.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/index.d.ts +0 -4
- package/dist/types/vue/src/primitives/pin-input/index.d.ts.map +0 -1
- package/src/primitives/pin-input/PinInputInput.ts +0 -218
- package/src/primitives/pin-input/PinInputRoot.ts +0 -136
- package/src/primitives/pin-input/context.ts +0 -24
- package/src/primitives/pin-input/index.ts +0 -3
- /package/dist/shared/primitives/{pin-input → date}/LICENSE +0 -0
- /package/src/primitives/{pin-input → alert-dialog}/LICENSE +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
onMounted,
|
|
6
|
+
onUnmounted,
|
|
7
|
+
ref,
|
|
8
|
+
renderSlot,
|
|
9
|
+
watchSyncEffect,
|
|
10
|
+
withCtx,
|
|
11
|
+
withKeys,
|
|
12
|
+
type PropType,
|
|
13
|
+
} from 'vue'
|
|
14
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
15
|
+
import { useComposing } from '../utils/useComposing'
|
|
16
|
+
import { usePrimitiveElement } from '../utils/usePrimitiveElement'
|
|
17
|
+
import { useVModel } from '../utils/useVModel'
|
|
18
|
+
import { injectListboxRootContext } from './context'
|
|
19
|
+
|
|
20
|
+
export interface ListboxFilterProps {
|
|
21
|
+
modelValue?: string
|
|
22
|
+
autoFocus?: boolean
|
|
23
|
+
disabled?: boolean
|
|
24
|
+
asChild?: boolean
|
|
25
|
+
as?: PrimitiveProps['as']
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type ListboxFilterEmits = {
|
|
29
|
+
'update:modelValue': [value: string]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const ListboxFilter = defineComponent({
|
|
33
|
+
name: 'ListboxFilter',
|
|
34
|
+
props: {
|
|
35
|
+
modelValue: { type: String, required: false },
|
|
36
|
+
autoFocus: { type: Boolean, required: false },
|
|
37
|
+
disabled: { type: Boolean, required: false },
|
|
38
|
+
asChild: { type: Boolean, required: false },
|
|
39
|
+
as: {
|
|
40
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
41
|
+
required: false,
|
|
42
|
+
default: 'input',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
emits: ['update:modelValue'],
|
|
46
|
+
setup(props, { emit, slots }) {
|
|
47
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
48
|
+
defaultValue: '',
|
|
49
|
+
passive: props.modelValue === undefined,
|
|
50
|
+
})
|
|
51
|
+
const rootContext = injectListboxRootContext()
|
|
52
|
+
const { primitiveElement, currentElement } = usePrimitiveElement()
|
|
53
|
+
const disabled = computed(() => props.disabled || rootContext.disabled.value || false)
|
|
54
|
+
|
|
55
|
+
const activedescendant = ref<string | undefined>()
|
|
56
|
+
watchSyncEffect(() => (activedescendant.value = rootContext.highlightedElement.value?.id))
|
|
57
|
+
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
rootContext.focusable.value = false
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
if (props.autoFocus) currentElement.value?.focus()
|
|
62
|
+
}, 1)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
onUnmounted(() => {
|
|
66
|
+
rootContext.focusable.value = true
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
isComposing,
|
|
71
|
+
shouldDeferInput,
|
|
72
|
+
handleCompositionStart,
|
|
73
|
+
handleCompositionUpdate,
|
|
74
|
+
handleCompositionEnd,
|
|
75
|
+
} = useComposing(event => {
|
|
76
|
+
modelValue.value = (event.target as HTMLInputElement).value
|
|
77
|
+
rootContext.onCompositionEnd()
|
|
78
|
+
rootContext.highlightFirstItem()
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
function onCompositionStart() {
|
|
82
|
+
rootContext.onCompositionStart()
|
|
83
|
+
handleCompositionStart()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function handleInput(event: Event) {
|
|
87
|
+
if (shouldDeferInput.value) return
|
|
88
|
+
modelValue.value = (event.target as HTMLInputElement).value
|
|
89
|
+
rootContext.highlightFirstItem()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function handleKeydownNavigation(event: KeyboardEvent) {
|
|
93
|
+
if (isComposing.value) return
|
|
94
|
+
event.preventDefault()
|
|
95
|
+
rootContext.onKeydownNavigation(event)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function handleKeydownEnter(event: KeyboardEvent) {
|
|
99
|
+
if (isComposing.value) return
|
|
100
|
+
rootContext.onKeydownEnter(event)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return () =>
|
|
104
|
+
h(
|
|
105
|
+
Primitive,
|
|
106
|
+
{
|
|
107
|
+
ref: primitiveElement,
|
|
108
|
+
as: props.as,
|
|
109
|
+
'as-child': props.asChild,
|
|
110
|
+
value: modelValue.value,
|
|
111
|
+
disabled: disabled.value ? '' : undefined,
|
|
112
|
+
'data-disabled': disabled.value ? '' : undefined,
|
|
113
|
+
'aria-disabled': disabled.value ?? undefined,
|
|
114
|
+
'aria-activedescendant': activedescendant.value,
|
|
115
|
+
type: 'text',
|
|
116
|
+
onKeydown: [
|
|
117
|
+
withKeys(handleKeydownNavigation, ['down', 'up', 'home', 'end']),
|
|
118
|
+
withKeys(handleKeydownEnter, ['enter']),
|
|
119
|
+
],
|
|
120
|
+
onInput: handleInput,
|
|
121
|
+
onCompositionstart: onCompositionStart,
|
|
122
|
+
onCompositionupdate: handleCompositionUpdate,
|
|
123
|
+
onCompositionend: handleCompositionEnd,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
default: withCtx(() => [renderSlot(slots, 'default', { modelValue: modelValue.value })]),
|
|
127
|
+
},
|
|
128
|
+
)
|
|
129
|
+
},
|
|
130
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCommentVNode,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
mergeProps,
|
|
6
|
+
renderSlot,
|
|
7
|
+
withCtx,
|
|
8
|
+
type PropType,
|
|
9
|
+
} from 'vue'
|
|
10
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
11
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
12
|
+
import { useId } from '../utils/useId'
|
|
13
|
+
import {
|
|
14
|
+
injectListboxGroupContext,
|
|
15
|
+
injectListboxItemContext,
|
|
16
|
+
provideListboxGroupContext,
|
|
17
|
+
} from './context'
|
|
18
|
+
|
|
19
|
+
export interface ListboxGroupProps {
|
|
20
|
+
asChild?: boolean
|
|
21
|
+
as?: PrimitiveProps['as']
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const primitiveProps = {
|
|
25
|
+
asChild: { type: Boolean, required: false },
|
|
26
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
27
|
+
} as const
|
|
28
|
+
|
|
29
|
+
export const ListboxGroup = defineComponent({
|
|
30
|
+
name: 'ListboxGroup',
|
|
31
|
+
props: primitiveProps,
|
|
32
|
+
setup(props, { slots }) {
|
|
33
|
+
const id = useId(undefined, 'reka-listbox-group')
|
|
34
|
+
provideListboxGroupContext({ id })
|
|
35
|
+
return () =>
|
|
36
|
+
h(Primitive, mergeProps({ role: 'group' }, props, { 'aria-labelledby': id }), {
|
|
37
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const ListboxGroupLabel = defineComponent({
|
|
43
|
+
name: 'ListboxGroupLabel',
|
|
44
|
+
props: { ...primitiveProps, as: { ...primitiveProps.as, default: 'div' } },
|
|
45
|
+
setup(props, { slots }) {
|
|
46
|
+
const groupContext = injectListboxGroupContext({ id: '' })
|
|
47
|
+
return () =>
|
|
48
|
+
h(Primitive, mergeProps(props, { id: groupContext.id }), {
|
|
49
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
export const ListboxItemIndicator = defineComponent({
|
|
55
|
+
name: 'ListboxItemIndicator',
|
|
56
|
+
props: { ...primitiveProps, as: { ...primitiveProps.as, default: 'span' } },
|
|
57
|
+
setup(props, { slots }) {
|
|
58
|
+
useForwardExpose()
|
|
59
|
+
const itemContext = injectListboxItemContext()
|
|
60
|
+
return () =>
|
|
61
|
+
itemContext.isSelected.value
|
|
62
|
+
? h(Primitive, mergeProps({ key: 0, 'aria-hidden': 'true' }, props), {
|
|
63
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
64
|
+
})
|
|
65
|
+
: createCommentVNode('v-if', true)
|
|
66
|
+
},
|
|
67
|
+
})
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
mergeProps,
|
|
6
|
+
renderSlot,
|
|
7
|
+
withCtx,
|
|
8
|
+
withKeys,
|
|
9
|
+
withMemo,
|
|
10
|
+
withModifiers,
|
|
11
|
+
type PropType,
|
|
12
|
+
type VNode,
|
|
13
|
+
} from 'vue'
|
|
14
|
+
import {
|
|
15
|
+
dispatchListboxSelect,
|
|
16
|
+
listboxItemTabIndex,
|
|
17
|
+
valueComparator,
|
|
18
|
+
type ListboxSelectEvent,
|
|
19
|
+
} from '../../../../shared/src/primitives/listbox'
|
|
20
|
+
import { useCollection } from '../collection'
|
|
21
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
22
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
23
|
+
import { useId } from '../utils/useId'
|
|
24
|
+
import { injectListboxRootContext, provideListboxItemContext } from './context'
|
|
25
|
+
|
|
26
|
+
export interface ListboxItemProps<T = unknown> {
|
|
27
|
+
value: T
|
|
28
|
+
disabled?: boolean
|
|
29
|
+
asChild?: boolean
|
|
30
|
+
as?: PrimitiveProps['as']
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ListboxItemEmits<T = unknown> = {
|
|
34
|
+
select: [event: ListboxSelectEvent<T>]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ListboxItem = defineComponent({
|
|
38
|
+
name: 'ListboxItem',
|
|
39
|
+
props: {
|
|
40
|
+
value: { type: null, required: true },
|
|
41
|
+
disabled: { type: Boolean, required: false },
|
|
42
|
+
asChild: { type: Boolean, required: false },
|
|
43
|
+
as: {
|
|
44
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
45
|
+
required: false,
|
|
46
|
+
default: 'div',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
emits: ['select'],
|
|
50
|
+
setup(props, { emit, slots, attrs }) {
|
|
51
|
+
const id = useId(undefined, 'reka-listbox-item')
|
|
52
|
+
const { CollectionItem } = useCollection()
|
|
53
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
54
|
+
const rootContext = injectListboxRootContext()
|
|
55
|
+
|
|
56
|
+
const isHighlighted = computed(
|
|
57
|
+
() =>
|
|
58
|
+
currentElement.value != null &&
|
|
59
|
+
currentElement.value === rootContext.highlightedElement.value,
|
|
60
|
+
)
|
|
61
|
+
const isSelected = computed(() =>
|
|
62
|
+
valueComparator(rootContext.modelValue.value, props.value, rootContext.by),
|
|
63
|
+
)
|
|
64
|
+
const disabled = computed(() => rootContext.disabled.value || props.disabled)
|
|
65
|
+
|
|
66
|
+
function handleSelect(event: ListboxSelectEvent) {
|
|
67
|
+
emit('select', event)
|
|
68
|
+
if (event?.defaultPrevented) return
|
|
69
|
+
if (!disabled.value && event) {
|
|
70
|
+
rootContext.onValueChange(props.value)
|
|
71
|
+
rootContext.changeHighlight(currentElement.value)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function handleSelectCustomEvent(event: Event) {
|
|
76
|
+
dispatchListboxSelect(event, props.value, handleSelect)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const onKeydown = withKeys(withModifiers(handleSelectCustomEvent, ['prevent']), ['space'])
|
|
80
|
+
const onPointermove = () => {
|
|
81
|
+
if (rootContext.highlightedElement.value === currentElement.value) return
|
|
82
|
+
if (rootContext.highlightOnHover.value)
|
|
83
|
+
rootContext.changeHighlight(currentElement.value, false, false)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
provideListboxItemContext({ isSelected })
|
|
87
|
+
|
|
88
|
+
const cache: VNode[] = []
|
|
89
|
+
|
|
90
|
+
return () =>
|
|
91
|
+
h(
|
|
92
|
+
CollectionItem,
|
|
93
|
+
{ value: props.value },
|
|
94
|
+
{
|
|
95
|
+
default: withCtx(() => [
|
|
96
|
+
withMemo(
|
|
97
|
+
[isHighlighted.value, isSelected.value, disabled.value, rootContext.focusable.value],
|
|
98
|
+
() =>
|
|
99
|
+
h(
|
|
100
|
+
Primitive,
|
|
101
|
+
mergeProps({ id }, attrs, {
|
|
102
|
+
ref: forwardRef,
|
|
103
|
+
role: 'option',
|
|
104
|
+
tabindex: listboxItemTabIndex(rootContext.focusable.value, isHighlighted.value),
|
|
105
|
+
'aria-selected': isSelected.value,
|
|
106
|
+
as: props.as,
|
|
107
|
+
'as-child': props.asChild,
|
|
108
|
+
disabled: disabled.value ? '' : undefined,
|
|
109
|
+
'data-disabled': disabled.value ? '' : undefined,
|
|
110
|
+
'data-highlighted': isHighlighted.value ? '' : undefined,
|
|
111
|
+
'data-state': isSelected.value ? 'checked' : 'unchecked',
|
|
112
|
+
onClick: handleSelectCustomEvent,
|
|
113
|
+
onKeydown,
|
|
114
|
+
onPointermove,
|
|
115
|
+
}),
|
|
116
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
117
|
+
),
|
|
118
|
+
cache,
|
|
119
|
+
1,
|
|
120
|
+
),
|
|
121
|
+
]),
|
|
122
|
+
},
|
|
123
|
+
)
|
|
124
|
+
},
|
|
125
|
+
})
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCommentVNode,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
nextTick,
|
|
6
|
+
onScopeDispose,
|
|
7
|
+
ref,
|
|
8
|
+
renderSlot,
|
|
9
|
+
toRefs,
|
|
10
|
+
watch,
|
|
11
|
+
withCtx,
|
|
12
|
+
type PropType,
|
|
13
|
+
type Ref,
|
|
14
|
+
} from 'vue'
|
|
15
|
+
import { isClient } from '@vueuse/core'
|
|
16
|
+
import {
|
|
17
|
+
compare,
|
|
18
|
+
createEventHook,
|
|
19
|
+
createTypeahead,
|
|
20
|
+
enabledListboxItems,
|
|
21
|
+
listboxNavigation,
|
|
22
|
+
listboxRangeValues,
|
|
23
|
+
nextListboxValue,
|
|
24
|
+
type Comparator,
|
|
25
|
+
type ListboxSelectionBehavior,
|
|
26
|
+
} from '../../../../shared/src/primitives/listbox'
|
|
27
|
+
import { getFocusIntent, type Orientation } from '../../../../shared/src/primitives/roving-focus'
|
|
28
|
+
import { useCollection } from '../collection'
|
|
29
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
30
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
31
|
+
import { useFormControl } from '../utils/useFormControl'
|
|
32
|
+
import { usePrimitiveElement } from '../utils/usePrimitiveElement'
|
|
33
|
+
import { useVModel } from '../utils/useVModel'
|
|
34
|
+
import { VisuallyHiddenInput } from '../visually-hidden'
|
|
35
|
+
import {
|
|
36
|
+
injectListboxHighlightScrollContext,
|
|
37
|
+
provideListboxHighlightScrollContext,
|
|
38
|
+
provideListboxRootContext,
|
|
39
|
+
} from './context'
|
|
40
|
+
|
|
41
|
+
export interface ListboxRootProps<T = unknown> {
|
|
42
|
+
modelValue?: T | T[]
|
|
43
|
+
defaultValue?: T | T[]
|
|
44
|
+
multiple?: boolean
|
|
45
|
+
orientation?: Orientation
|
|
46
|
+
dir?: Direction
|
|
47
|
+
disabled?: boolean
|
|
48
|
+
selectionBehavior?: ListboxSelectionBehavior
|
|
49
|
+
highlightOnHover?: boolean
|
|
50
|
+
by?: Comparator<T>
|
|
51
|
+
asChild?: boolean
|
|
52
|
+
as?: PrimitiveProps['as']
|
|
53
|
+
name?: string
|
|
54
|
+
required?: boolean
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ListboxRootEmits<T = unknown> = {
|
|
58
|
+
'update:modelValue': [value: T]
|
|
59
|
+
highlight: [payload: { ref: HTMLElement; value: T } | undefined]
|
|
60
|
+
entryFocus: [event: CustomEvent]
|
|
61
|
+
leave: [event: Event]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const ListboxRoot = defineComponent({
|
|
65
|
+
name: 'ListboxRoot',
|
|
66
|
+
props: {
|
|
67
|
+
modelValue: { type: null, required: false },
|
|
68
|
+
defaultValue: { type: null, required: false },
|
|
69
|
+
multiple: { type: Boolean, required: false },
|
|
70
|
+
orientation: { type: String as PropType<Orientation>, required: false, default: 'vertical' },
|
|
71
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
72
|
+
disabled: { type: Boolean, required: false },
|
|
73
|
+
selectionBehavior: {
|
|
74
|
+
type: String as PropType<ListboxSelectionBehavior>,
|
|
75
|
+
required: false,
|
|
76
|
+
default: 'toggle',
|
|
77
|
+
},
|
|
78
|
+
highlightOnHover: { type: Boolean, required: false },
|
|
79
|
+
by: { type: [String, Function] as PropType<Comparator>, required: false },
|
|
80
|
+
asChild: { type: Boolean, required: false },
|
|
81
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
82
|
+
name: { type: String, required: false },
|
|
83
|
+
required: { type: Boolean, required: false },
|
|
84
|
+
},
|
|
85
|
+
emits: ['update:modelValue', 'highlight', 'entryFocus', 'leave'],
|
|
86
|
+
setup(props, { emit, expose, slots }) {
|
|
87
|
+
const {
|
|
88
|
+
multiple,
|
|
89
|
+
highlightOnHover,
|
|
90
|
+
orientation,
|
|
91
|
+
disabled,
|
|
92
|
+
selectionBehavior,
|
|
93
|
+
dir: propDir,
|
|
94
|
+
} = toRefs(props)
|
|
95
|
+
const { getItems } = useCollection({ isProvider: true })
|
|
96
|
+
const typeahead = createTypeahead()
|
|
97
|
+
onScopeDispose(() => typeahead.dispose())
|
|
98
|
+
const { primitiveElement, currentElement } = usePrimitiveElement()
|
|
99
|
+
const dir = useDirection(propDir)
|
|
100
|
+
const highlightScrollContext = injectListboxHighlightScrollContext(null)
|
|
101
|
+
|
|
102
|
+
provideListboxHighlightScrollContext({
|
|
103
|
+
suppressHighlightScroll: ref(false),
|
|
104
|
+
onHighlightScrollRequest: () => {},
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const isFormControl = useFormControl(currentElement)
|
|
108
|
+
|
|
109
|
+
const firstValue = ref<unknown>()
|
|
110
|
+
const isUserAction = ref(false)
|
|
111
|
+
const focusable = ref(true)
|
|
112
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
113
|
+
defaultValue: props.defaultValue ?? (multiple.value ? [] : undefined),
|
|
114
|
+
passive: props.modelValue === undefined,
|
|
115
|
+
}) as Ref<unknown>
|
|
116
|
+
|
|
117
|
+
function releaseUserAction() {
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
isUserAction.value = false
|
|
120
|
+
}, 1)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function onValueChange(value: unknown) {
|
|
124
|
+
isUserAction.value = true
|
|
125
|
+
const next = nextListboxValue(modelValue.value, value, {
|
|
126
|
+
multiple: props.multiple,
|
|
127
|
+
selectionBehavior: props.selectionBehavior,
|
|
128
|
+
by: props.by,
|
|
129
|
+
})
|
|
130
|
+
modelValue.value = next.value
|
|
131
|
+
if (next.anchor) firstValue.value = value
|
|
132
|
+
releaseUserAction()
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const highlightedElement = ref<HTMLElement | null>(null)
|
|
136
|
+
const previousElement = ref<HTMLElement | null>(null)
|
|
137
|
+
const isVirtual = ref(false)
|
|
138
|
+
const isComposing = ref(false)
|
|
139
|
+
const virtualFocusHook = createEventHook<{ event?: Event; scroll: boolean }>()
|
|
140
|
+
const virtualKeydownHook = createEventHook<KeyboardEvent>()
|
|
141
|
+
const virtualHighlightHook = createEventHook<unknown>()
|
|
142
|
+
|
|
143
|
+
function getCollectionItem() {
|
|
144
|
+
return enabledListboxItems(getItems().map(item => item.ref))
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function changeHighlight(element: HTMLElement, scrollIntoView = true, focus?: boolean) {
|
|
148
|
+
if (!element) return
|
|
149
|
+
|
|
150
|
+
highlightedElement.value = element
|
|
151
|
+
const suppressHighlightScroll = highlightScrollContext?.suppressHighlightScroll.value ?? false
|
|
152
|
+
if (focus ?? focusable.value) {
|
|
153
|
+
if (suppressHighlightScroll) element.focus({ preventScroll: true })
|
|
154
|
+
else element.focus()
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (suppressHighlightScroll) {
|
|
158
|
+
highlightScrollContext?.onHighlightScrollRequest(
|
|
159
|
+
scrollIntoView
|
|
160
|
+
? () => {
|
|
161
|
+
const current = highlightedElement.value
|
|
162
|
+
if (current?.isConnected) current.scrollIntoView({ block: 'nearest' })
|
|
163
|
+
}
|
|
164
|
+
: undefined,
|
|
165
|
+
)
|
|
166
|
+
} else if (scrollIntoView) element.scrollIntoView({ block: 'nearest' })
|
|
167
|
+
|
|
168
|
+
emit(
|
|
169
|
+
'highlight',
|
|
170
|
+
getItems().find(item => item.ref === element),
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function highlightItem(value: unknown) {
|
|
175
|
+
if (isVirtual.value) virtualHighlightHook.trigger(value)
|
|
176
|
+
else {
|
|
177
|
+
const item = getItems().find(entry => compare(entry.value, value, props.by))
|
|
178
|
+
if (item) {
|
|
179
|
+
highlightedElement.value = item.ref
|
|
180
|
+
changeHighlight(item.ref)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function onKeydownEnter(event: KeyboardEvent) {
|
|
186
|
+
const current = highlightedElement.value
|
|
187
|
+
if (current && current.isConnected) {
|
|
188
|
+
if (event.ctrlKey || event.metaKey || event.altKey) return
|
|
189
|
+
event.preventDefault()
|
|
190
|
+
event.stopPropagation()
|
|
191
|
+
if (!isComposing.value) current.click()
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function onKeydownTypeAhead(event: KeyboardEvent) {
|
|
196
|
+
if (!focusable.value) return
|
|
197
|
+
isUserAction.value = true
|
|
198
|
+
if (isVirtual.value) virtualKeydownHook.trigger(event)
|
|
199
|
+
else {
|
|
200
|
+
const isMetaKey = event.altKey || event.ctrlKey || event.metaKey
|
|
201
|
+
if (isMetaKey && event.key === 'a' && multiple.value) {
|
|
202
|
+
const collection = getItems()
|
|
203
|
+
modelValue.value = collection.map(item => item.value)
|
|
204
|
+
event.preventDefault()
|
|
205
|
+
const lastItem = collection.at(-1)
|
|
206
|
+
if (lastItem) changeHighlight(lastItem.ref)
|
|
207
|
+
} else if (!isMetaKey) {
|
|
208
|
+
const element = typeahead.handle(event.key, getItems())
|
|
209
|
+
if (element) changeHighlight(element)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
releaseUserAction()
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function onCompositionStart() {
|
|
216
|
+
isComposing.value = true
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function onCompositionEnd() {
|
|
220
|
+
void nextTick(() => {
|
|
221
|
+
isComposing.value = false
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function highlightFirstItem() {
|
|
226
|
+
void nextTick(() => {
|
|
227
|
+
onKeydownNavigation(new KeyboardEvent('keydown', { key: 'PageUp' }))
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function onLeave(event: Event) {
|
|
232
|
+
const element = highlightedElement.value
|
|
233
|
+
if (element?.isConnected) previousElement.value = element
|
|
234
|
+
highlightedElement.value = null
|
|
235
|
+
emit('leave', event)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function onEnter(event: Event) {
|
|
239
|
+
const entryFocusEvent = new CustomEvent('listbox.entryFocus', {
|
|
240
|
+
bubbles: false,
|
|
241
|
+
cancelable: true,
|
|
242
|
+
})
|
|
243
|
+
event.currentTarget?.dispatchEvent(entryFocusEvent)
|
|
244
|
+
emit('entryFocus', entryFocusEvent)
|
|
245
|
+
if (entryFocusEvent.defaultPrevented) return
|
|
246
|
+
if (previousElement.value) changeHighlight(previousElement.value)
|
|
247
|
+
else changeHighlight(getCollectionItem()[0]!)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function onKeydownNavigation(event: KeyboardEvent) {
|
|
251
|
+
const intent = getFocusIntent(event, orientation.value, dir.value)
|
|
252
|
+
if (!intent) return
|
|
253
|
+
|
|
254
|
+
const navigation = listboxNavigation(getCollectionItem(), highlightedElement.value, intent)
|
|
255
|
+
if (navigation.extendsRange) handleMultipleReplace(event, navigation.rangeTarget)
|
|
256
|
+
if (navigation.target) changeHighlight(navigation.target)
|
|
257
|
+
if (isVirtual.value) virtualKeydownHook.trigger(event)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function handleMultipleReplace(event: KeyboardEvent, target: HTMLElement | undefined) {
|
|
261
|
+
if (
|
|
262
|
+
isVirtual.value ||
|
|
263
|
+
props.selectionBehavior !== 'replace' ||
|
|
264
|
+
!multiple.value ||
|
|
265
|
+
!Array.isArray(modelValue.value)
|
|
266
|
+
)
|
|
267
|
+
return
|
|
268
|
+
const values = listboxRangeValues(event, getItems(), target, firstValue.value)
|
|
269
|
+
if (values) modelValue.value = values
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async function highlightSelected(event?: Event, scroll = true) {
|
|
273
|
+
if (!isClient) return
|
|
274
|
+
await nextTick()
|
|
275
|
+
if (isVirtual.value) virtualFocusHook.trigger({ event, scroll })
|
|
276
|
+
else {
|
|
277
|
+
const collection = getCollectionItem()
|
|
278
|
+
const item = collection.find(element => element.dataset.state === 'checked')
|
|
279
|
+
const focus = scroll ? undefined : false
|
|
280
|
+
if (item) changeHighlight(item, scroll, focus)
|
|
281
|
+
else if (collection.length) changeHighlight(collection[0]!, scroll, focus)
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
let hasHighlightedOnMount = false
|
|
286
|
+
|
|
287
|
+
watch(
|
|
288
|
+
modelValue,
|
|
289
|
+
() => {
|
|
290
|
+
if (!isUserAction.value) {
|
|
291
|
+
const scroll = hasHighlightedOnMount
|
|
292
|
+
hasHighlightedOnMount = true
|
|
293
|
+
void nextTick(() => {
|
|
294
|
+
void highlightSelected(undefined, scroll)
|
|
295
|
+
})
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
{ immediate: true, deep: true },
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
expose({
|
|
302
|
+
highlightedElement,
|
|
303
|
+
highlightItem,
|
|
304
|
+
highlightFirstItem,
|
|
305
|
+
highlightSelected,
|
|
306
|
+
getItems,
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
provideListboxRootContext({
|
|
310
|
+
modelValue,
|
|
311
|
+
onValueChange,
|
|
312
|
+
multiple,
|
|
313
|
+
orientation,
|
|
314
|
+
dir,
|
|
315
|
+
disabled,
|
|
316
|
+
highlightOnHover,
|
|
317
|
+
highlightedElement,
|
|
318
|
+
isVirtual,
|
|
319
|
+
virtualFocusHook,
|
|
320
|
+
virtualKeydownHook,
|
|
321
|
+
virtualHighlightHook,
|
|
322
|
+
by: props.by,
|
|
323
|
+
firstValue,
|
|
324
|
+
selectionBehavior,
|
|
325
|
+
focusable,
|
|
326
|
+
onLeave,
|
|
327
|
+
onEnter,
|
|
328
|
+
changeHighlight,
|
|
329
|
+
onKeydownEnter,
|
|
330
|
+
onKeydownNavigation,
|
|
331
|
+
onKeydownTypeAhead,
|
|
332
|
+
onCompositionStart,
|
|
333
|
+
onCompositionEnd,
|
|
334
|
+
highlightFirstItem,
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
const onFocusout = async (event: FocusEvent) => {
|
|
338
|
+
const target = (event.relatedTarget || event.target) as HTMLElement | null
|
|
339
|
+
await nextTick()
|
|
340
|
+
if (
|
|
341
|
+
highlightedElement.value &&
|
|
342
|
+
currentElement.value &&
|
|
343
|
+
!currentElement.value.contains(target)
|
|
344
|
+
)
|
|
345
|
+
onLeave(event)
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return () =>
|
|
349
|
+
h(
|
|
350
|
+
Primitive,
|
|
351
|
+
{
|
|
352
|
+
ref: primitiveElement,
|
|
353
|
+
as: props.as,
|
|
354
|
+
'as-child': props.asChild,
|
|
355
|
+
dir: dir.value,
|
|
356
|
+
'data-disabled': disabled.value ? '' : undefined,
|
|
357
|
+
onPointerleave: onLeave,
|
|
358
|
+
onFocusout,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
default: withCtx(() => [
|
|
362
|
+
renderSlot(slots, 'default', { modelValue: modelValue.value }),
|
|
363
|
+
isFormControl.value && props.name
|
|
364
|
+
? h(VisuallyHiddenInput, {
|
|
365
|
+
key: 0,
|
|
366
|
+
name: props.name,
|
|
367
|
+
value: modelValue.value,
|
|
368
|
+
disabled: disabled.value,
|
|
369
|
+
required: props.required,
|
|
370
|
+
})
|
|
371
|
+
: createCommentVNode('v-if', true),
|
|
372
|
+
]),
|
|
373
|
+
},
|
|
374
|
+
)
|
|
375
|
+
},
|
|
376
|
+
})
|