@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,489 @@
|
|
|
1
|
+
import { createEventHook } from '@vueuse/core'
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
defineComponent,
|
|
5
|
+
getCurrentInstance,
|
|
6
|
+
guardReactiveProps,
|
|
7
|
+
h,
|
|
8
|
+
mergeProps,
|
|
9
|
+
nextTick,
|
|
10
|
+
normalizeProps,
|
|
11
|
+
onMounted,
|
|
12
|
+
ref,
|
|
13
|
+
renderSlot,
|
|
14
|
+
toRefs,
|
|
15
|
+
watch,
|
|
16
|
+
withCtx,
|
|
17
|
+
withKeys,
|
|
18
|
+
type Component,
|
|
19
|
+
type ComponentPublicInstance,
|
|
20
|
+
type PropType,
|
|
21
|
+
type Ref,
|
|
22
|
+
} from 'vue'
|
|
23
|
+
import { createCollatorFilter } from '../../../../shared/src/lib/virtual/filter'
|
|
24
|
+
import {
|
|
25
|
+
comboboxSearchText,
|
|
26
|
+
filterComboboxItems,
|
|
27
|
+
type ComboboxFilterState,
|
|
28
|
+
} from '../../../../shared/src/primitives/combobox'
|
|
29
|
+
import type { Comparator } from '../../../../shared/src/primitives/listbox'
|
|
30
|
+
import {
|
|
31
|
+
injectListboxRootContext,
|
|
32
|
+
ListboxFilter,
|
|
33
|
+
ListboxRoot,
|
|
34
|
+
provideListboxHighlightScrollContext,
|
|
35
|
+
} from '../listbox'
|
|
36
|
+
import { PopperAnchor, PopperRoot } from '../popper'
|
|
37
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
38
|
+
import { Teleport } from '../teleport'
|
|
39
|
+
import { useComposing } from '../utils/useComposing'
|
|
40
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
41
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
42
|
+
import { usePrimitiveElement } from '../utils/usePrimitiveElement'
|
|
43
|
+
import { useVModel } from '../utils/useVModel'
|
|
44
|
+
import {
|
|
45
|
+
injectComboboxRootContext,
|
|
46
|
+
provideComboboxRootContext,
|
|
47
|
+
type ComboboxContentPosition,
|
|
48
|
+
} from './context'
|
|
49
|
+
|
|
50
|
+
export const primitive = (as?: string) =>
|
|
51
|
+
({
|
|
52
|
+
asChild: { type: Boolean, required: false },
|
|
53
|
+
as: {
|
|
54
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
55
|
+
required: false,
|
|
56
|
+
...(as ? { default: as } : {}),
|
|
57
|
+
},
|
|
58
|
+
}) as const
|
|
59
|
+
|
|
60
|
+
interface ListboxRootExpose extends ComponentPublicInstance {
|
|
61
|
+
highlightedElement?: HTMLElement | null
|
|
62
|
+
highlightItem?: (value: unknown) => void
|
|
63
|
+
highlightFirstItem?: () => void
|
|
64
|
+
highlightSelected?: (event?: Event) => void
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function useComboboxContentPositioning(open: Ref<boolean>) {
|
|
68
|
+
const contentPosition = ref<ComboboxContentPosition>('inline')
|
|
69
|
+
const contentPlaced = ref(false)
|
|
70
|
+
const currentContent = ref<symbol>()
|
|
71
|
+
const suppressHighlightScroll = computed(
|
|
72
|
+
() => contentPosition.value === 'popper' && !contentPlaced.value,
|
|
73
|
+
)
|
|
74
|
+
let pendingHighlightScroll: (() => void) | undefined
|
|
75
|
+
|
|
76
|
+
provideListboxHighlightScrollContext({
|
|
77
|
+
suppressHighlightScroll,
|
|
78
|
+
onHighlightScrollRequest(scroll) {
|
|
79
|
+
pendingHighlightScroll = scroll
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
function onContentPositionChange(content: symbol, position: ComboboxContentPosition) {
|
|
84
|
+
if (currentContent.value !== content || contentPosition.value !== position) {
|
|
85
|
+
contentPlaced.value = false
|
|
86
|
+
pendingHighlightScroll = undefined
|
|
87
|
+
}
|
|
88
|
+
currentContent.value = content
|
|
89
|
+
contentPosition.value = position
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function onContentPlaced(content: symbol) {
|
|
93
|
+
if (
|
|
94
|
+
currentContent.value !== content ||
|
|
95
|
+
contentPosition.value !== 'popper' ||
|
|
96
|
+
contentPlaced.value
|
|
97
|
+
)
|
|
98
|
+
return
|
|
99
|
+
contentPlaced.value = true
|
|
100
|
+
const scroll = pendingHighlightScroll
|
|
101
|
+
pendingHighlightScroll = undefined
|
|
102
|
+
if (open.value) scroll?.()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function onContentUnmount(content: symbol) {
|
|
106
|
+
if (currentContent.value !== content) return
|
|
107
|
+
currentContent.value = undefined
|
|
108
|
+
contentPosition.value = 'inline'
|
|
109
|
+
contentPlaced.value = false
|
|
110
|
+
pendingHighlightScroll = undefined
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return { onContentPositionChange, onContentPlaced, onContentUnmount }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const ComboboxRoot = defineComponent({
|
|
117
|
+
name: 'ComboboxRoot',
|
|
118
|
+
props: {
|
|
119
|
+
open: { type: Boolean, required: false, default: undefined },
|
|
120
|
+
defaultOpen: { type: Boolean, required: false },
|
|
121
|
+
resetSearchTermOnBlur: { type: Boolean, required: false, default: true },
|
|
122
|
+
resetSearchTermOnSelect: { type: Boolean, required: false, default: true },
|
|
123
|
+
openOnFocus: { type: Boolean, required: false, default: false },
|
|
124
|
+
openOnClick: { type: Boolean, required: false, default: false },
|
|
125
|
+
ignoreFilter: { type: Boolean, required: false },
|
|
126
|
+
resetModelValueOnClear: { type: Boolean, required: false, default: false },
|
|
127
|
+
modelValue: { type: null, required: false },
|
|
128
|
+
defaultValue: { type: null, required: false },
|
|
129
|
+
multiple: { type: Boolean, required: false },
|
|
130
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
131
|
+
disabled: { type: Boolean, required: false },
|
|
132
|
+
highlightOnHover: { type: Boolean, required: false, default: true },
|
|
133
|
+
by: { type: [String, Function] as PropType<Comparator>, required: false },
|
|
134
|
+
...primitive(),
|
|
135
|
+
name: { type: String, required: false },
|
|
136
|
+
required: { type: Boolean, required: false },
|
|
137
|
+
},
|
|
138
|
+
emits: ['update:modelValue', 'highlight', 'update:open'],
|
|
139
|
+
setup(props, { attrs, emit, expose, slots }) {
|
|
140
|
+
const { primitiveElement, currentElement: parentElement } =
|
|
141
|
+
usePrimitiveElement<ListboxRootExpose>()
|
|
142
|
+
const {
|
|
143
|
+
multiple,
|
|
144
|
+
disabled,
|
|
145
|
+
ignoreFilter,
|
|
146
|
+
resetSearchTermOnSelect,
|
|
147
|
+
openOnFocus,
|
|
148
|
+
openOnClick,
|
|
149
|
+
dir: propDir,
|
|
150
|
+
resetModelValueOnClear,
|
|
151
|
+
highlightOnHover,
|
|
152
|
+
} = toRefs(props)
|
|
153
|
+
const dir = useDirection(propDir)
|
|
154
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
155
|
+
defaultValue: props.defaultValue ?? (multiple.value ? [] : undefined),
|
|
156
|
+
passive: props.modelValue === undefined,
|
|
157
|
+
deep: true,
|
|
158
|
+
}) as Ref<unknown>
|
|
159
|
+
const open = useVModel(props, 'open', emit, {
|
|
160
|
+
defaultValue: props.defaultOpen,
|
|
161
|
+
passive: props.open === undefined,
|
|
162
|
+
}) as Ref<boolean>
|
|
163
|
+
|
|
164
|
+
async function onOpenChange(value: boolean) {
|
|
165
|
+
open.value = value
|
|
166
|
+
filterSearch.value = ''
|
|
167
|
+
if (value) {
|
|
168
|
+
await nextTick()
|
|
169
|
+
primitiveElement.value?.highlightSelected?.()
|
|
170
|
+
isUserInputted.value = true
|
|
171
|
+
inputElement.value?.focus()
|
|
172
|
+
} else {
|
|
173
|
+
isUserInputted.value = false
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
if (!value && props.resetSearchTermOnBlur) resetSearchTerm.trigger()
|
|
176
|
+
}, 1)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const resetSearchTerm = createEventHook<void>()
|
|
181
|
+
const isUserInputted = ref(false)
|
|
182
|
+
const isVirtual = ref(false)
|
|
183
|
+
const inputElement = ref<HTMLInputElement>()
|
|
184
|
+
const triggerElement = ref<HTMLElement>()
|
|
185
|
+
const highlightedElement = computed(
|
|
186
|
+
() => primitiveElement.value?.highlightedElement ?? undefined,
|
|
187
|
+
)
|
|
188
|
+
const contentPositioning = useComboboxContentPositioning(open)
|
|
189
|
+
const allItems = ref(new Map<string, string>())
|
|
190
|
+
const allGroups = ref(new Map<string, Set<string>>())
|
|
191
|
+
const { contains } = createCollatorFilter({ sensitivity: 'base' })
|
|
192
|
+
const filterSearch = ref('')
|
|
193
|
+
const filterState = computed<ComboboxFilterState>(oldValue => {
|
|
194
|
+
if (!filterSearch.value || props.ignoreFilter || isVirtual.value)
|
|
195
|
+
return {
|
|
196
|
+
count: allItems.value.size,
|
|
197
|
+
items: oldValue?.items ?? new Map(),
|
|
198
|
+
groups: oldValue?.groups ?? new Set(allGroups.value.keys()),
|
|
199
|
+
}
|
|
200
|
+
return filterComboboxItems(allItems.value, allGroups.value, filterSearch.value, contains)
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
const instance = getCurrentInstance()
|
|
204
|
+
onMounted(() => {
|
|
205
|
+
if (instance?.exposed) {
|
|
206
|
+
instance.exposed.highlightItem = primitiveElement.value?.highlightItem
|
|
207
|
+
instance.exposed.highlightFirstItem = primitiveElement.value?.highlightFirstItem
|
|
208
|
+
instance.exposed.highlightSelected = primitiveElement.value?.highlightSelected
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
expose({
|
|
213
|
+
filtered: filterState,
|
|
214
|
+
highlightedElement,
|
|
215
|
+
highlightItem: primitiveElement.value?.highlightItem,
|
|
216
|
+
highlightFirstItem: primitiveElement.value?.highlightFirstItem,
|
|
217
|
+
highlightSelected: primitiveElement.value?.highlightSelected,
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
provideComboboxRootContext({
|
|
221
|
+
modelValue,
|
|
222
|
+
multiple,
|
|
223
|
+
disabled,
|
|
224
|
+
open,
|
|
225
|
+
onOpenChange,
|
|
226
|
+
...contentPositioning,
|
|
227
|
+
contentId: '',
|
|
228
|
+
isUserInputted,
|
|
229
|
+
isVirtual,
|
|
230
|
+
inputElement,
|
|
231
|
+
highlightedElement,
|
|
232
|
+
onInputElementChange: value => (inputElement.value = value),
|
|
233
|
+
triggerElement,
|
|
234
|
+
onTriggerElementChange: value => (triggerElement.value = value),
|
|
235
|
+
parentElement,
|
|
236
|
+
resetSearchTermOnSelect,
|
|
237
|
+
onResetSearchTerm: resetSearchTerm.on,
|
|
238
|
+
allItems,
|
|
239
|
+
allGroups,
|
|
240
|
+
filterSearch,
|
|
241
|
+
filterState,
|
|
242
|
+
ignoreFilter,
|
|
243
|
+
openOnFocus,
|
|
244
|
+
openOnClick,
|
|
245
|
+
resetModelValueOnClear,
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
return () =>
|
|
249
|
+
h(PopperRoot, null, {
|
|
250
|
+
default: withCtx(() => [
|
|
251
|
+
h(
|
|
252
|
+
ListboxRoot as Component,
|
|
253
|
+
mergeProps({ ref: primitiveElement }, attrs, {
|
|
254
|
+
modelValue: modelValue.value,
|
|
255
|
+
'onUpdate:modelValue': (value: unknown) => (modelValue.value = value),
|
|
256
|
+
style: { pointerEvents: open.value ? 'auto' : undefined },
|
|
257
|
+
as: props.as,
|
|
258
|
+
'as-child': props.asChild,
|
|
259
|
+
dir: dir.value,
|
|
260
|
+
multiple: multiple.value,
|
|
261
|
+
name: props.name,
|
|
262
|
+
required: props.required,
|
|
263
|
+
disabled: disabled.value,
|
|
264
|
+
'highlight-on-hover': highlightOnHover.value,
|
|
265
|
+
by: props.by,
|
|
266
|
+
onHighlight: (payload: unknown) => emit('highlight', payload),
|
|
267
|
+
}),
|
|
268
|
+
{
|
|
269
|
+
default: withCtx(() => [
|
|
270
|
+
renderSlot(slots, 'default', { open: open.value, modelValue: modelValue.value }),
|
|
271
|
+
]),
|
|
272
|
+
},
|
|
273
|
+
),
|
|
274
|
+
]),
|
|
275
|
+
})
|
|
276
|
+
},
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
export const ComboboxAnchor = defineComponent({
|
|
280
|
+
name: 'ComboboxAnchor',
|
|
281
|
+
props: { reference: { type: null, required: false }, ...primitive() },
|
|
282
|
+
setup(props, { attrs, slots }) {
|
|
283
|
+
const { forwardRef } = useForwardExpose()
|
|
284
|
+
return () =>
|
|
285
|
+
h(
|
|
286
|
+
PopperAnchor as Component,
|
|
287
|
+
{ 'as-child': '', reference: props.reference },
|
|
288
|
+
{
|
|
289
|
+
default: withCtx(() => [
|
|
290
|
+
h(
|
|
291
|
+
Primitive,
|
|
292
|
+
mergeProps({ ref: forwardRef, 'as-child': props.asChild, as: props.as }, attrs),
|
|
293
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
294
|
+
),
|
|
295
|
+
]),
|
|
296
|
+
},
|
|
297
|
+
)
|
|
298
|
+
},
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
export const ComboboxInput = defineComponent({
|
|
302
|
+
name: 'ComboboxInput',
|
|
303
|
+
props: {
|
|
304
|
+
displayValue: { type: Function as PropType<(value: never) => string>, required: false },
|
|
305
|
+
modelValue: { type: String, required: false },
|
|
306
|
+
autoFocus: { type: Boolean, required: false },
|
|
307
|
+
disabled: { type: Boolean, required: false },
|
|
308
|
+
...primitive('input'),
|
|
309
|
+
},
|
|
310
|
+
emits: ['update:modelValue'],
|
|
311
|
+
setup(props, { emit, slots }) {
|
|
312
|
+
const rootContext = injectComboboxRootContext()
|
|
313
|
+
const listboxContext = injectListboxRootContext()
|
|
314
|
+
const { primitiveElement, currentElement } = usePrimitiveElement()
|
|
315
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
316
|
+
passive: props.modelValue === undefined,
|
|
317
|
+
}) as Ref<string | undefined>
|
|
318
|
+
|
|
319
|
+
onMounted(() => {
|
|
320
|
+
if (currentElement.value)
|
|
321
|
+
rootContext.onInputElementChange(currentElement.value as HTMLInputElement)
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
const {
|
|
325
|
+
isComposing,
|
|
326
|
+
shouldDeferInput,
|
|
327
|
+
handleCompositionStart,
|
|
328
|
+
handleCompositionUpdate,
|
|
329
|
+
handleCompositionEnd,
|
|
330
|
+
} = useComposing(event => {
|
|
331
|
+
const element = event.target as HTMLInputElement | null
|
|
332
|
+
if (element) processInputValue(element.value)
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
function handleKeyDown(event: KeyboardEvent) {
|
|
336
|
+
if (isComposing.value) return
|
|
337
|
+
event.preventDefault()
|
|
338
|
+
if (!rootContext.open.value) rootContext.onOpenChange(true)
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function processInputValue(value: string) {
|
|
342
|
+
if (!rootContext.open.value) {
|
|
343
|
+
rootContext.onOpenChange(true)
|
|
344
|
+
nextTick(() => {
|
|
345
|
+
if (value) {
|
|
346
|
+
rootContext.filterSearch.value = value
|
|
347
|
+
listboxContext.highlightFirstItem()
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
} else rootContext.filterSearch.value = value
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function handleInput(event: Event) {
|
|
354
|
+
if (shouldDeferInput.value) return
|
|
355
|
+
processInputValue((event.target as HTMLInputElement).value)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function handleFocus() {
|
|
359
|
+
if (rootContext.openOnFocus.value && !rootContext.open.value) rootContext.onOpenChange(true)
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function handleBlur(event: FocusEvent) {
|
|
363
|
+
if (!rootContext.open.value) return
|
|
364
|
+
const nextFocus = event.relatedTarget as Node | null
|
|
365
|
+
if (!nextFocus) return
|
|
366
|
+
const isInsideRoot = rootContext.parentElement.value?.contains(nextFocus)
|
|
367
|
+
const isInsideContent = document.getElementById(rootContext.contentId)?.contains(nextFocus)
|
|
368
|
+
if (!isInsideRoot && !isInsideContent)
|
|
369
|
+
requestAnimationFrame(() => {
|
|
370
|
+
if (!rootContext.open.value) return
|
|
371
|
+
const active = document.activeElement
|
|
372
|
+
const isStillOutside =
|
|
373
|
+
!rootContext.parentElement.value?.contains(active) &&
|
|
374
|
+
!document.getElementById(rootContext.contentId)?.contains(active)
|
|
375
|
+
if (isStillOutside) rootContext.onOpenChange(false)
|
|
376
|
+
})
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function handleClick() {
|
|
380
|
+
if (rootContext.openOnClick.value && !rootContext.open.value) rootContext.onOpenChange(true)
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function resetSearchTerm() {
|
|
384
|
+
modelValue.value = comboboxSearchText(
|
|
385
|
+
rootContext.modelValue.value,
|
|
386
|
+
rootContext.multiple.value,
|
|
387
|
+
props.displayValue as ((value: unknown) => string) | undefined,
|
|
388
|
+
)
|
|
389
|
+
nextTick(() => {
|
|
390
|
+
modelValue.value = modelValue.value
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
rootContext.onResetSearchTerm(() => {
|
|
395
|
+
resetSearchTerm()
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
watch(
|
|
399
|
+
rootContext.modelValue,
|
|
400
|
+
async () => {
|
|
401
|
+
if (!rootContext.isUserInputted.value && rootContext.resetSearchTermOnSelect.value)
|
|
402
|
+
resetSearchTerm()
|
|
403
|
+
},
|
|
404
|
+
{ immediate: true, deep: true },
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
watch(rootContext.filterState, (_newValue, oldValue) => {
|
|
408
|
+
if (!rootContext.isVirtual.value && oldValue.count === 0) listboxContext.highlightFirstItem()
|
|
409
|
+
})
|
|
410
|
+
|
|
411
|
+
return () =>
|
|
412
|
+
h(
|
|
413
|
+
ListboxFilter as Component,
|
|
414
|
+
{
|
|
415
|
+
ref: primitiveElement,
|
|
416
|
+
modelValue: modelValue.value,
|
|
417
|
+
'onUpdate:modelValue': (value: string) => (modelValue.value = value),
|
|
418
|
+
as: props.as,
|
|
419
|
+
'as-child': props.asChild,
|
|
420
|
+
'auto-focus': props.autoFocus,
|
|
421
|
+
disabled: props.disabled,
|
|
422
|
+
'aria-expanded': rootContext.open.value,
|
|
423
|
+
'aria-controls': rootContext.contentId,
|
|
424
|
+
'aria-autocomplete': 'list',
|
|
425
|
+
role: 'combobox',
|
|
426
|
+
autocomplete: 'off',
|
|
427
|
+
onClick: handleClick,
|
|
428
|
+
onInput: handleInput,
|
|
429
|
+
onKeydown: withKeys(handleKeyDown as (event: Event) => void, ['down', 'up']),
|
|
430
|
+
onFocus: handleFocus,
|
|
431
|
+
onBlur: handleBlur,
|
|
432
|
+
onCompositionstart: handleCompositionStart,
|
|
433
|
+
onCompositionupdate: handleCompositionUpdate,
|
|
434
|
+
onCompositionend: handleCompositionEnd,
|
|
435
|
+
},
|
|
436
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
437
|
+
)
|
|
438
|
+
},
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
export const ComboboxTrigger = defineComponent({
|
|
442
|
+
name: 'ComboboxTrigger',
|
|
443
|
+
props: { disabled: { type: Boolean, required: false }, ...primitive('button') },
|
|
444
|
+
setup(props, { slots }) {
|
|
445
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
446
|
+
const rootContext = injectComboboxRootContext()
|
|
447
|
+
const disabled = computed(() => props.disabled || rootContext.disabled.value || false)
|
|
448
|
+
|
|
449
|
+
onMounted(() => {
|
|
450
|
+
if (currentElement.value) rootContext.onTriggerElementChange(currentElement.value)
|
|
451
|
+
})
|
|
452
|
+
|
|
453
|
+
return () =>
|
|
454
|
+
h(
|
|
455
|
+
Primitive,
|
|
456
|
+
mergeProps(props, {
|
|
457
|
+
ref: forwardRef,
|
|
458
|
+
type: props.as === 'button' ? 'button' : undefined,
|
|
459
|
+
tabindex: '-1',
|
|
460
|
+
'aria-label': 'Show popup',
|
|
461
|
+
'aria-haspopup': 'listbox',
|
|
462
|
+
'aria-expanded': rootContext.open.value,
|
|
463
|
+
'aria-controls': rootContext.contentId,
|
|
464
|
+
'data-state': rootContext.open.value ? 'open' : 'closed',
|
|
465
|
+
disabled: disabled.value,
|
|
466
|
+
'data-disabled': disabled.value ? '' : undefined,
|
|
467
|
+
'aria-disabled': disabled.value ?? undefined,
|
|
468
|
+
onClick: () => rootContext.onOpenChange(!rootContext.open.value),
|
|
469
|
+
}),
|
|
470
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
471
|
+
)
|
|
472
|
+
},
|
|
473
|
+
})
|
|
474
|
+
|
|
475
|
+
export const ComboboxPortal = defineComponent({
|
|
476
|
+
name: 'ComboboxPortal',
|
|
477
|
+
props: {
|
|
478
|
+
to: { type: null as unknown as PropType<string | HTMLElement>, required: false },
|
|
479
|
+
disabled: { type: Boolean, required: false },
|
|
480
|
+
defer: { type: Boolean, required: false },
|
|
481
|
+
forceMount: { type: Boolean, required: false },
|
|
482
|
+
},
|
|
483
|
+
setup(props, { slots }) {
|
|
484
|
+
return () =>
|
|
485
|
+
h(Teleport as Component, normalizeProps(guardReactiveProps(props)), {
|
|
486
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
487
|
+
})
|
|
488
|
+
},
|
|
489
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 UnoVue <https://github.com/unovue>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Portions adapted from VueUse:
|
|
24
|
+
MIT License
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
30
|
+
in the Software without restriction, including without limitation the rights
|
|
31
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
33
|
+
furnished to do so, subject to the following conditions:
|
|
34
|
+
|
|
35
|
+
The above copyright notice and this permission notice shall be included in all
|
|
36
|
+
copies or substantial portions of the Software.
|
|
37
|
+
|
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
44
|
+
SOFTWARE.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import type { ComboboxFilterState } from '../../../../shared/src/primitives/combobox'
|
|
3
|
+
import { createContext } from '../utils/createContext'
|
|
4
|
+
|
|
5
|
+
export type ComboboxContentPosition = 'inline' | 'popper'
|
|
6
|
+
|
|
7
|
+
export interface ComboboxRootContext {
|
|
8
|
+
modelValue: Ref<unknown>
|
|
9
|
+
multiple: Ref<boolean>
|
|
10
|
+
disabled: Ref<boolean>
|
|
11
|
+
open: Ref<boolean>
|
|
12
|
+
onOpenChange: (open: boolean) => void
|
|
13
|
+
onContentPositionChange: (content: symbol, position: ComboboxContentPosition) => void
|
|
14
|
+
onContentPlaced: (content: symbol) => void
|
|
15
|
+
onContentUnmount: (content: symbol) => void
|
|
16
|
+
contentId: string
|
|
17
|
+
isUserInputted: Ref<boolean>
|
|
18
|
+
isVirtual: Ref<boolean>
|
|
19
|
+
inputElement: Ref<HTMLInputElement | undefined>
|
|
20
|
+
highlightedElement: Ref<HTMLElement | undefined>
|
|
21
|
+
onInputElementChange: (element: HTMLInputElement) => void
|
|
22
|
+
triggerElement: Ref<HTMLElement | undefined>
|
|
23
|
+
onTriggerElementChange: (element: HTMLElement) => void
|
|
24
|
+
parentElement: Ref<HTMLElement | undefined>
|
|
25
|
+
resetSearchTermOnSelect: Ref<boolean>
|
|
26
|
+
onResetSearchTerm: (listener: () => void) => { off: () => void }
|
|
27
|
+
allItems: Ref<Map<string, string>>
|
|
28
|
+
allGroups: Ref<Map<string, Set<string>>>
|
|
29
|
+
filterSearch: Ref<string>
|
|
30
|
+
filterState: Ref<ComboboxFilterState>
|
|
31
|
+
ignoreFilter: Ref<boolean>
|
|
32
|
+
openOnFocus: Ref<boolean>
|
|
33
|
+
openOnClick: Ref<boolean>
|
|
34
|
+
resetModelValueOnClear: Ref<boolean>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const [injectComboboxRootContext, provideComboboxRootContext] =
|
|
38
|
+
createContext<ComboboxRootContext>('ComboboxRoot')
|
|
39
|
+
|
|
40
|
+
export const [injectComboboxContentContext, provideComboboxContentContext] = createContext<{
|
|
41
|
+
position: Ref<ComboboxContentPosition>
|
|
42
|
+
}>('ComboboxContent')
|
|
43
|
+
|
|
44
|
+
export const [injectComboboxGroupContext, provideComboboxGroupContext] = createContext<{
|
|
45
|
+
id: string
|
|
46
|
+
labelId: string
|
|
47
|
+
}>('ComboboxGroup')
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export {
|
|
2
|
+
injectComboboxContentContext,
|
|
3
|
+
injectComboboxGroupContext,
|
|
4
|
+
injectComboboxRootContext,
|
|
5
|
+
type ComboboxContentPosition,
|
|
6
|
+
type ComboboxRootContext,
|
|
7
|
+
} from './context'
|
|
8
|
+
export { ComboboxContent } from './ComboboxContent'
|
|
9
|
+
export {
|
|
10
|
+
ComboboxEmpty,
|
|
11
|
+
ComboboxGroup,
|
|
12
|
+
ComboboxItem,
|
|
13
|
+
ComboboxItemIndicator,
|
|
14
|
+
ComboboxLabel,
|
|
15
|
+
type ComboboxItemSelectEvent,
|
|
16
|
+
} from './ComboboxItem'
|
|
17
|
+
export {
|
|
18
|
+
ComboboxAnchor,
|
|
19
|
+
ComboboxInput,
|
|
20
|
+
ComboboxPortal,
|
|
21
|
+
ComboboxRoot,
|
|
22
|
+
ComboboxTrigger,
|
|
23
|
+
} from './ComboboxRoot'
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 UnoVue <https://github.com/unovue>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Portions adapted from VueUse:
|
|
24
|
+
MIT License
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
30
|
+
in the Software without restriction, including without limitation the rights
|
|
31
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
33
|
+
furnished to do so, subject to the following conditions:
|
|
34
|
+
|
|
35
|
+
The above copyright notice and this permission notice shall be included in all
|
|
36
|
+
copies or substantial portions of the Software.
|
|
37
|
+
|
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
44
|
+
SOFTWARE.
|