@hina-ui/vue 1.7.12 → 1.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +25634 -9251
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/thumbhash.ts +12 -0
- package/dist/shared/lib/tour-engine.ts +721 -0
- package/dist/shared/lib/tour.ts +439 -0
- package/dist/shared/locale/en-US.ts +9 -0
- package/dist/shared/locale/index.ts +1 -0
- package/dist/shared/locale/ja-JP.ts +10 -0
- package/dist/shared/locale/types.ts +9 -0
- package/dist/shared/locale/zh-CN.ts +9 -0
- package/dist/shared/primitives/combobox/LICENSE +44 -0
- package/dist/shared/primitives/combobox/index.ts +49 -0
- package/dist/shared/primitives/date/LICENSE +21 -0
- package/dist/shared/primitives/date/calendar-view.ts +264 -0
- package/dist/shared/primitives/date/calendar.ts +126 -0
- package/dist/shared/primitives/date/comparators.ts +144 -0
- package/dist/shared/primitives/date/field.ts +551 -0
- package/dist/shared/primitives/date/formatter.ts +110 -0
- package/dist/shared/primitives/date/parser.ts +182 -0
- package/dist/shared/primitives/date/parts.ts +16 -0
- package/dist/shared/primitives/date/picker-view.ts +186 -0
- package/dist/shared/primitives/date/placeholders.ts +485 -0
- package/dist/shared/primitives/date/range-calendar-view.ts +181 -0
- package/dist/shared/primitives/date/segment.ts +44 -0
- package/dist/shared/primitives/date/utils.ts +169 -0
- package/dist/shared/primitives/dialog/LICENSE +21 -0
- package/dist/shared/primitives/dialog/index.ts +73 -0
- package/dist/shared/primitives/dismissable-layer/index.ts +48 -1
- package/dist/shared/primitives/focus-scope/index.ts +5 -3
- package/dist/shared/primitives/grace-area/LICENSE +21 -0
- package/dist/shared/primitives/grace-area/index.ts +112 -0
- package/dist/shared/primitives/listbox/LICENSE +21 -0
- package/dist/shared/primitives/listbox/index.ts +213 -0
- package/dist/shared/primitives/menu/LICENSE +21 -0
- package/dist/shared/primitives/menu/index.ts +66 -0
- package/dist/shared/primitives/navigation-menu/LICENSE +44 -0
- package/dist/shared/primitives/navigation-menu/index.ts +125 -0
- package/dist/shared/primitives/popper/LICENSE +21 -0
- package/dist/shared/primitives/popper/index.ts +246 -0
- package/dist/shared/primitives/select/index.ts +98 -0
- package/dist/shared/primitives/tags-input/LICENSE +21 -0
- package/dist/shared/primitives/tags-input/index.ts +113 -0
- package/dist/shared/primitives/toast/LICENSE +44 -0
- package/dist/shared/primitives/toast/index.ts +106 -0
- package/dist/shared/primitives/tree/LICENSE +21 -0
- package/dist/shared/primitives/tree/index.ts +248 -0
- package/dist/shared/styles/semantic.css +1 -0
- package/dist/shared/styles/tokens.css +1 -0
- package/dist/shared/styles/tour.css +134 -0
- package/dist/shared/variants/image.ts +28 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/tour.ts +47 -0
- package/dist/types/shared/src/lib/thumbhash.d.ts +2 -0
- package/dist/types/shared/src/lib/thumbhash.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tour-engine.d.ts +47 -0
- package/dist/types/shared/src/lib/tour-engine.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tour.d.ts +137 -0
- package/dist/types/shared/src/lib/tour.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts +6 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts.map +1 -0
- package/dist/types/shared/src/locale/en-US.d.ts.map +1 -1
- package/dist/types/shared/src/locale/index.d.ts.map +1 -1
- package/dist/types/shared/src/locale/ja-JP.d.ts.map +1 -1
- package/dist/types/shared/src/locale/types.d.ts +9 -0
- package/dist/types/shared/src/locale/types.d.ts.map +1 -1
- package/dist/types/shared/src/locale/zh-CN.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts +1 -1
- package/dist/types/shared/src/primitives/combobox/index.d.ts +9 -0
- package/dist/types/shared/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts +53 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts +39 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts +31 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/field.d.ts +46 -0
- package/dist/types/shared/src/primitives/date/field.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts +20 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts +49 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts +10 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts +34 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts +2 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts +67 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts +6 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts +37 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts +32 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts +1 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts +2 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/focus-scope/index.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/grace-area/index.d.ts +13 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts +55 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts +35 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts +23 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts +83 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/select/index.d.ts +24 -0
- package/dist/types/shared/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts +36 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts +42 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts +72 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/shared/src/variants/image.d.ts +35 -0
- package/dist/types/shared/src/variants/image.d.ts.map +1 -1
- package/dist/types/shared/src/variants/nav-link.d.ts +2 -1
- package/dist/types/shared/src/variants/nav-link.d.ts.map +1 -1
- package/dist/types/shared/src/variants/tour.d.ts +15 -0
- package/dist/types/shared/src/variants/tour.d.ts.map +1 -0
- package/dist/types/vue/src/components/app-shell/AppShell.vue.d.ts +6 -6
- package/dist/types/vue/src/components/button/Button.vue.d.ts +1 -1
- package/dist/types/vue/src/components/button/Button.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/carousel/composables/useCarousel.d.ts +1 -1
- package/dist/types/vue/src/components/combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts +20 -0
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts +10 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts +2 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts.map +1 -0
- package/dist/types/vue/src/components/date-range-field/DateRangeField.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/Dialog.vue.d.ts +3 -0
- package/dist/types/vue/src/components/dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/ModalContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/drawer/Drawer.vue.d.ts +3 -0
- package/dist/types/vue/src/components/drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts +20 -8
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts +1 -1
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts +2 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/composables/useImage.d.ts +2 -0
- package/dist/types/vue/src/components/image/composables/useImage.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarSub.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/month-grid/MonthGrid.vue.d.ts +1 -1
- package/dist/types/vue/src/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts +5 -10
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts +8 -0
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts +2 -2
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuContent.vue.d.ts +6 -6
- package/dist/types/vue/src/components/overlay-branch/OverlayBranch.vue.d.ts +17 -0
- package/dist/types/vue/src/components/overlay-branch/OverlayBranch.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/pagination/composables/usePaginationWindow.d.ts +6 -6
- package/dist/types/vue/src/components/popconfirm/Popconfirm.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-slider/RangeSlider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts +1 -1
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/select/Select.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts +4 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/Slider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/split-button/SplitButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/Toolbar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarControl.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts +43 -0
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts +2 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/types.d.ts +39 -0
- package/dist/types/vue/src/components/tour/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +7 -7
- package/dist/types/vue/src/index.d.ts +6 -0
- package/dist/types/vue/src/index.d.ts.map +1 -1
- package/dist/types/vue/src/lib/anchored-overlay.d.ts +11 -5
- package/dist/types/vue/src/lib/anchored-overlay.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts +6 -6
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts.map +1 -1
- package/dist/types/vue/src/lib/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts +133 -0
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts +227 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts +140 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts +313 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts +48 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts +65 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts +273 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts +166 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts +376 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts +68 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts +949 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts +26 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts +36 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts +32 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts +51 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts +221 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts +31 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts +54 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts +65 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts +40 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts +49 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts +62 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts +85 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts +8 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts +76 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts +26 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts +1033 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts +72 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts +442 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts +30 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts +67 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts +82 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts +58 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts +156 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts +49 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts +394 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts +396 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts +746 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts +74 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts +14 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts +1036 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts +101 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts +165 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts +187 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts +40 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts +247 -0
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts +414 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts +257 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts +183 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts +13 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts +67 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts +40 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts +61 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts +370 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts +4 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts +17 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts +252 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts +345 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts +64 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts +3 -3
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts +265 -0
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts +107 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts +275 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/context.d.ts +73 -0
- package/dist/types/vue/src/primitives/select/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts +61 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts +76 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts +196 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts +30 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts +49 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts +220 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts +25 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts +177 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts +267 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts +162 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts +32 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts +40 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts +29 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts +14 -1
- package/dist/types/vue/src/primitives/utils/config.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/defu.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/defu.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts +5 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/components/alert-dialog/AlertDialog.vue +1 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/calendar/Calendar.vue +1 -1
- package/src/components/calendar/CalendarLevels.vue +1 -1
- package/src/components/combobox/Combobox.vue +6 -1
- package/src/components/combobox/ComboboxList.vue +1 -1
- package/src/components/command-palette/CommandPalette.vue +2 -2
- package/src/components/command-palette/CommandPaletteInput.vue +1 -1
- package/src/components/command-palette/CommandPaletteItem.vue +1 -1
- package/src/components/command-palette/CommandPalettePanel.vue +6 -1
- package/src/components/config-provider/ConfigProvider.vue +24 -0
- package/src/components/config-provider/types.ts +11 -0
- package/src/components/config-provider/useConfig.ts +5 -0
- package/src/components/context-menu/ContextMenu.vue +1 -1
- package/src/components/context-menu/ContextMenuCheckboxItem.vue +1 -1
- package/src/components/context-menu/ContextMenuGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuItem.vue +1 -1
- package/src/components/context-menu/ContextMenuLabel.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioItem.vue +1 -1
- package/src/components/context-menu/ContextMenuSeparator.vue +1 -1
- package/src/components/context-menu/ContextMenuSub.vue +1 -1
- package/src/components/data-table/DataTableDragPreview.vue +1 -1
- package/src/components/date-field/DateField.vue +1 -1
- package/src/components/date-picker/DatePicker.vue +1 -1
- package/src/components/date-range-field/DateRangeField.vue +5 -1
- package/src/components/date-range-picker/DateRangePicker.vue +1 -1
- package/src/components/date-time-picker/DateTimePicker.vue +1 -1
- package/src/components/dialog/Dialog.vue +15 -2
- package/src/components/dialog/ModalContent.vue +2 -1
- package/src/components/drawer/Drawer.vue +15 -2
- package/src/components/dropdown-menu/DropdownMenu.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue +4 -1
- package/src/components/dropdown-menu/DropdownMenuGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuLabel.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSeparator.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSub.vue +1 -1
- package/src/components/hover-card/HoverCard.vue +6 -1
- package/src/components/hover-card/composables/useHoverCardAnchor.ts +1 -1
- package/src/components/icon-button/IconButton.vue +1 -1
- package/src/components/image/Image.vue +58 -24
- package/src/components/image/composables/useImage.ts +46 -21
- package/src/components/lightbox/Lightbox.vue +2 -1
- package/src/components/lightbox/LightboxChrome.vue +1 -1
- package/src/components/listbox/Listbox.vue +1 -1
- package/src/components/listbox/ListboxOptionContent.vue +1 -1
- package/src/components/menubar/Menubar.vue +1 -1
- package/src/components/menubar/MenubarCheckboxItem.vue +1 -1
- package/src/components/menubar/MenubarGroup.vue +1 -1
- package/src/components/menubar/MenubarItem.vue +1 -1
- package/src/components/menubar/MenubarLabel.vue +1 -1
- package/src/components/menubar/MenubarMenu.vue +6 -1
- package/src/components/menubar/MenubarRadioGroup.vue +1 -1
- package/src/components/menubar/MenubarRadioItem.vue +1 -1
- package/src/components/menubar/MenubarSeparator.vue +1 -1
- package/src/components/menubar/MenubarSub.vue +6 -1
- package/src/components/multi-combobox/MultiCombobox.vue +6 -1
- package/src/components/multi-select/MultiSelect.vue +1 -1
- package/src/components/nav-link/NavLink.vue +21 -2
- package/src/components/nav-link/NavLinkChild.ts +2 -0
- package/src/components/navigation-menu/NavigationMenu.vue +5 -1
- package/src/components/navigation-menu/NavigationMenuContent.vue +2 -2
- package/src/components/navigation-menu/NavigationMenuItem.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuTrigger.vue +1 -1
- package/src/components/number-input/NumberInput.vue +1 -1
- package/src/components/overlay-branch/OverlayBranch.vue +14 -0
- package/src/components/pagination/PaginationPopup.vue +1 -1
- package/src/components/popconfirm/Popconfirm.vue +6 -1
- package/src/components/popover/Popover.vue +6 -1
- package/src/components/popover/PopoverContent.vue +2 -2
- package/src/components/popover/composables/usePopoverCloseFocus.ts +1 -1
- package/src/components/range-calendar/RangeCalendar.vue +1 -1
- package/src/components/select/Select.vue +2 -1
- package/src/components/select/SelectList.vue +1 -1
- package/src/components/sheet/Sheet.vue +15 -2
- package/src/components/slider/SliderHandle.vue +1 -1
- package/src/components/tags-input/TagsInput.vue +1 -1
- package/src/components/tags-input/TagsInputChip.vue +1 -1
- package/src/components/time/Time.vue +1 -1
- package/src/components/time-field/TimeField.vue +1 -1
- package/src/components/toast/Toaster.vue +1 -1
- package/src/components/toggle/Toggle.vue +1 -1
- package/src/components/toolbar/ToolbarControl.vue +1 -1
- package/src/components/tooltip/Tooltip.vue +1 -1
- package/src/components/tooltip/TooltipBubble.vue +1 -1
- package/src/components/tooltip/TooltipDirectiveRoot.ts +1 -1
- package/src/components/tooltip/TooltipProvider.vue +1 -1
- package/src/components/tooltip/composables/useTooltipTarget.ts +1 -1
- package/src/components/tour/Tour.vue +608 -0
- package/src/components/tour/tour.variants.ts +1 -0
- package/src/components/tour/types.ts +74 -0
- package/src/components/tree/Tree.vue +1 -1
- package/src/components/tree/TreeRows.vue +1 -1
- package/src/components/tree/VirtualTreeWindow.vue +1 -1
- package/src/components/tree-select/TreeSelect.vue +2 -3
- package/src/components/tree-select/composables/useTreeSelect.ts +2 -2
- package/src/index.ts +26 -0
- package/src/lib/anchored-overlay.ts +2 -1
- package/src/lib/dialog-focus.ts +1 -1
- package/src/lib/reka/useVirtualChoices.ts +7 -8
- package/src/lib/reka/useVirtualTree.ts +1 -1
- package/src/primitives/alert-dialog/LICENSE +44 -0
- package/src/primitives/alert-dialog/index.ts +166 -0
- package/src/primitives/calendar/CalendarCellTrigger.ts +190 -0
- package/src/primitives/calendar/CalendarGrid.ts +101 -0
- package/src/primitives/calendar/CalendarNav.ts +88 -0
- package/src/primitives/calendar/CalendarRoot.ts +324 -0
- package/src/primitives/calendar/LICENSE +44 -0
- package/src/primitives/calendar/context.ts +55 -0
- package/src/primitives/calendar/index.ts +12 -0
- package/src/primitives/calendar/useCalendar.ts +164 -0
- package/src/primitives/combobox/ComboboxContent.ts +199 -0
- package/src/primitives/combobox/ComboboxItem.ts +209 -0
- package/src/primitives/combobox/ComboboxRoot.ts +489 -0
- package/src/primitives/combobox/LICENSE +44 -0
- package/src/primitives/combobox/context.ts +47 -0
- package/src/primitives/combobox/index.ts +23 -0
- package/src/primitives/context-menu/LICENSE +44 -0
- package/src/primitives/context-menu/index.ts +388 -0
- package/src/primitives/date-field/DateFieldInput.ts +29 -0
- package/src/primitives/date-field/DateFieldRoot.ts +343 -0
- package/src/primitives/date-field/LICENSE +44 -0
- package/src/primitives/date-field/context.ts +29 -0
- package/src/primitives/date-field/index.ts +3 -0
- package/src/primitives/date-field/segmentInput.ts +96 -0
- package/src/primitives/date-field/useDateFieldSegment.ts +63 -0
- package/src/primitives/date-range-field/DateRangeFieldInput.ts +42 -0
- package/src/primitives/date-range-field/DateRangeFieldRoot.ts +389 -0
- package/src/primitives/date-range-field/LICENSE +44 -0
- package/src/primitives/date-range-field/context.ts +36 -0
- package/src/primitives/date-range-field/index.ts +12 -0
- package/src/primitives/dialog/DialogContent.ts +193 -0
- package/src/primitives/dialog/DialogContentImpl.ts +114 -0
- package/src/primitives/dialog/DialogOverlay.ts +99 -0
- package/src/primitives/dialog/DialogPortal.ts +33 -0
- package/src/primitives/dialog/DialogRoot.ts +61 -0
- package/src/primitives/dialog/DialogText.ts +59 -0
- package/src/primitives/dialog/DialogTrigger.ts +46 -0
- package/src/primitives/dialog/LICENSE +44 -0
- package/src/primitives/dialog/context.ts +19 -0
- package/src/primitives/dialog/index.ts +7 -0
- package/src/primitives/dismissable-layer/DismissableLayer.ts +212 -0
- package/src/primitives/dismissable-layer/DismissableLayerBranch.ts +27 -0
- package/src/primitives/dismissable-layer/LICENSE +44 -0
- package/src/primitives/dismissable-layer/index.ts +11 -0
- package/src/primitives/dropdown-menu/LICENSE +44 -0
- package/src/primitives/dropdown-menu/index.ts +344 -0
- package/src/primitives/focus-scope/FocusScope.ts +118 -0
- package/src/primitives/focus-scope/LICENSE +44 -0
- package/src/primitives/focus-scope/index.ts +1 -0
- package/src/primitives/hover-card/LICENSE +44 -0
- package/src/primitives/hover-card/index.ts +357 -0
- package/src/primitives/listbox/LICENSE +44 -0
- package/src/primitives/listbox/ListboxContent.ts +80 -0
- package/src/primitives/listbox/ListboxFilter.ts +130 -0
- package/src/primitives/listbox/ListboxGroup.ts +67 -0
- package/src/primitives/listbox/ListboxItem.ts +125 -0
- package/src/primitives/listbox/ListboxRoot.ts +376 -0
- package/src/primitives/listbox/context.ts +62 -0
- package/src/primitives/listbox/index.ts +17 -0
- package/src/primitives/menu/LICENSE +44 -0
- package/src/primitives/menu/MenuContentImpl.ts +304 -0
- package/src/primitives/menu/MenuItem.ts +495 -0
- package/src/primitives/menu/MenuRoot.ts +295 -0
- package/src/primitives/menu/context.ts +72 -0
- package/src/primitives/menu/index.ts +26 -0
- package/src/primitives/menu/wrap.ts +53 -0
- package/src/primitives/menubar/index.ts +494 -0
- package/src/primitives/navigation-menu/LICENSE +44 -0
- package/src/primitives/navigation-menu/NavigationMenuContent.ts +375 -0
- package/src/primitives/navigation-menu/NavigationMenuParts.ts +432 -0
- package/src/primitives/navigation-menu/NavigationMenuRoot.ts +260 -0
- package/src/primitives/navigation-menu/context.ts +50 -0
- package/src/primitives/navigation-menu/index.ts +20 -0
- package/src/primitives/number-field/__snapshots__/NumberField.test.ts.snap +288 -0
- package/src/primitives/picker/LICENSE +44 -0
- package/src/primitives/picker/createPicker.ts +618 -0
- package/src/primitives/picker/index.ts +26 -0
- package/src/primitives/popover/LICENSE +44 -0
- package/src/primitives/popover/PopoverContent.ts +243 -0
- package/src/primitives/popover/PopoverParts.ts +143 -0
- package/src/primitives/popover/PopoverRoot.ts +58 -0
- package/src/primitives/popover/context.ts +16 -0
- package/src/primitives/popover/index.ts +14 -0
- package/src/primitives/popper/Arrow.ts +49 -0
- package/src/primitives/popper/LICENSE +44 -0
- package/src/primitives/popper/PopperAnchor.ts +33 -0
- package/src/primitives/popper/PopperArrow.ts +77 -0
- package/src/primitives/popper/PopperContent.ts +262 -0
- package/src/primitives/popper/PopperRoot.ts +16 -0
- package/src/primitives/popper/context.ts +23 -0
- package/src/primitives/popper/index.ts +11 -0
- package/src/primitives/range-calendar/LICENSE +44 -0
- package/src/primitives/range-calendar/RangeCalendarCellTrigger.ts +241 -0
- package/src/primitives/range-calendar/RangeCalendarGrid.ts +90 -0
- package/src/primitives/range-calendar/RangeCalendarRoot.ts +413 -0
- package/src/primitives/range-calendar/context.ts +71 -0
- package/src/primitives/range-calendar/index.ts +21 -0
- package/src/primitives/select/LICENSE +44 -0
- package/src/primitives/select/SelectContent.ts +330 -0
- package/src/primitives/select/SelectItem.ts +204 -0
- package/src/primitives/select/SelectRoot.ts +408 -0
- package/src/primitives/select/context.ts +74 -0
- package/src/primitives/select/index.ts +17 -0
- package/src/primitives/tags-input/LICENSE +44 -0
- package/src/primitives/tags-input/TagsInputInput.ts +148 -0
- package/src/primitives/tags-input/TagsInputItem.ts +105 -0
- package/src/primitives/tags-input/TagsInputRoot.ts +215 -0
- package/src/primitives/tags-input/context.ts +36 -0
- package/src/primitives/tags-input/index.ts +9 -0
- package/src/primitives/teleport/LICENSE +44 -0
- package/src/primitives/teleport/Teleport.ts +41 -0
- package/src/primitives/teleport/index.ts +1 -0
- package/src/primitives/time-field/LICENSE +44 -0
- package/src/primitives/time-field/TimeFieldInput.ts +29 -0
- package/src/primitives/time-field/TimeFieldRoot.ts +379 -0
- package/src/primitives/time-field/context.ts +28 -0
- package/src/primitives/time-field/index.ts +4 -0
- package/src/primitives/toast/LICENSE +44 -0
- package/src/primitives/toast/ToastProvider.ts +311 -0
- package/src/primitives/toast/ToastRoot.ts +518 -0
- package/src/primitives/toast/index.ts +16 -0
- package/src/primitives/tooltip/LICENSE +44 -0
- package/src/primitives/tooltip/TooltipParts.ts +351 -0
- package/src/primitives/tooltip/TooltipRoot.ts +170 -0
- package/src/primitives/tooltip/context.ts +39 -0
- package/src/primitives/tooltip/index.ts +9 -0
- package/src/primitives/tree/LICENSE +44 -0
- package/src/primitives/tree/TreeItem.ts +256 -0
- package/src/primitives/tree/TreeRoot.ts +273 -0
- package/src/primitives/tree/context.ts +34 -0
- package/src/primitives/tree/index.ts +4 -0
- package/src/primitives/utils/config.ts +19 -1
- package/src/primitives/utils/defu.ts +26 -0
- package/src/primitives/utils/env.ts +5 -0
- package/src/primitives/utils/layers.ts +4 -0
- package/src/primitives/utils/propsWithoutDefaults.ts +8 -0
- package/src/primitives/utils/useBodyScrollLock.ts +29 -0
- package/src/primitives/utils/useFocusGuards.ts +10 -0
- package/src/primitives/utils/useGraceArea.ts +85 -0
- package/src/primitives/utils/useHideOthers.ts +18 -0
- package/src/primitives/utils/useIsUsingKeyboard.ts +25 -0
- package/src/primitives/utils/useLocale.ts +7 -0
- package/src/primitives/utils/useVModel.ts +8 -3
- package/src/singletons.ts +1 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
createCommentVNode,
|
|
4
|
+
defineComponent,
|
|
5
|
+
Fragment,
|
|
6
|
+
guardReactiveProps,
|
|
7
|
+
h,
|
|
8
|
+
mergeProps,
|
|
9
|
+
normalizeProps,
|
|
10
|
+
onMounted,
|
|
11
|
+
onUnmounted,
|
|
12
|
+
ref,
|
|
13
|
+
renderSlot,
|
|
14
|
+
toRefs,
|
|
15
|
+
watch,
|
|
16
|
+
withCtx,
|
|
17
|
+
withModifiers,
|
|
18
|
+
type Component,
|
|
19
|
+
type PropType,
|
|
20
|
+
type Ref,
|
|
21
|
+
} from 'vue'
|
|
22
|
+
import {
|
|
23
|
+
createTypeahead,
|
|
24
|
+
valueComparator,
|
|
25
|
+
type Comparator,
|
|
26
|
+
} from '../../../../shared/src/primitives/listbox'
|
|
27
|
+
import {
|
|
28
|
+
isNullish,
|
|
29
|
+
OPEN_KEYS,
|
|
30
|
+
shouldShowPlaceholder,
|
|
31
|
+
toggleSelectValue,
|
|
32
|
+
} from '../../../../shared/src/primitives/select'
|
|
33
|
+
import { useCollection } from '../collection'
|
|
34
|
+
import { PopperAnchor, PopperRoot } from '../popper'
|
|
35
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
36
|
+
import { Teleport } from '../teleport'
|
|
37
|
+
import { VisuallyHidden } from '../visually-hidden'
|
|
38
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
39
|
+
import { useFormControl } from '../utils/useFormControl'
|
|
40
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
41
|
+
import { useId } from '../utils/useId'
|
|
42
|
+
import { useVModel } from '../utils/useVModel'
|
|
43
|
+
import {
|
|
44
|
+
injectSelectGroupContext,
|
|
45
|
+
injectSelectRootContext,
|
|
46
|
+
provideSelectGroupContext,
|
|
47
|
+
provideSelectRootContext,
|
|
48
|
+
type SelectOptionRecord,
|
|
49
|
+
} from './context'
|
|
50
|
+
|
|
51
|
+
export const primitive = (as?: string) =>
|
|
52
|
+
({
|
|
53
|
+
asChild: { type: Boolean, required: false },
|
|
54
|
+
as: {
|
|
55
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
56
|
+
required: false,
|
|
57
|
+
...(as ? { default: as } : {}),
|
|
58
|
+
},
|
|
59
|
+
}) as const
|
|
60
|
+
|
|
61
|
+
const BubbleSelect = defineComponent({
|
|
62
|
+
name: 'BubbleSelect',
|
|
63
|
+
props: {
|
|
64
|
+
autocomplete: { type: String, required: false },
|
|
65
|
+
autofocus: { type: Boolean, required: false },
|
|
66
|
+
disabled: { type: Boolean, required: false },
|
|
67
|
+
form: { type: String, required: false },
|
|
68
|
+
multiple: { type: Boolean, required: false },
|
|
69
|
+
name: { type: String, required: false },
|
|
70
|
+
required: { type: Boolean, required: false },
|
|
71
|
+
size: { type: Number, required: false },
|
|
72
|
+
value: { type: null, required: false },
|
|
73
|
+
},
|
|
74
|
+
setup(props, { slots }) {
|
|
75
|
+
const selectElement = ref<HTMLSelectElement>()
|
|
76
|
+
const rootContext = injectSelectRootContext()
|
|
77
|
+
|
|
78
|
+
watch(
|
|
79
|
+
() => props.value,
|
|
80
|
+
(cur, prev) => {
|
|
81
|
+
const selectProto = window.HTMLSelectElement.prototype
|
|
82
|
+
const descriptor = Object.getOwnPropertyDescriptor(selectProto, 'value')!
|
|
83
|
+
const setValue = descriptor.set
|
|
84
|
+
if (cur !== prev && setValue && selectElement.value) {
|
|
85
|
+
const event = new Event('change', { bubbles: true })
|
|
86
|
+
setValue.call(selectElement.value, cur)
|
|
87
|
+
selectElement.value.dispatchEvent(event)
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
function handleInput(event: Event) {
|
|
93
|
+
rootContext.onValueChange((event.target as HTMLSelectElement).value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return () =>
|
|
97
|
+
h(
|
|
98
|
+
VisuallyHidden as Component,
|
|
99
|
+
{ 'as-child': '' },
|
|
100
|
+
{
|
|
101
|
+
default: withCtx(() => [
|
|
102
|
+
h('select', mergeProps({ ref: selectElement }, props, { onInput: handleInput }), [
|
|
103
|
+
renderSlot(slots, 'default'),
|
|
104
|
+
]),
|
|
105
|
+
]),
|
|
106
|
+
},
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
export const SelectRoot = defineComponent({
|
|
112
|
+
name: 'SelectRoot',
|
|
113
|
+
inheritAttrs: false,
|
|
114
|
+
props: {
|
|
115
|
+
open: { type: Boolean, required: false, default: undefined },
|
|
116
|
+
defaultOpen: { type: Boolean, required: false },
|
|
117
|
+
defaultValue: { type: null, required: false },
|
|
118
|
+
modelValue: { type: null, required: false, default: undefined },
|
|
119
|
+
nullableValue: { type: String, required: false, default: '' },
|
|
120
|
+
by: { type: [String, Function] as PropType<Comparator>, required: false },
|
|
121
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
122
|
+
multiple: { type: Boolean, required: false },
|
|
123
|
+
autocomplete: { type: String, required: false },
|
|
124
|
+
disabled: { type: Boolean, required: false },
|
|
125
|
+
name: { type: String, required: false },
|
|
126
|
+
required: { type: Boolean, required: false },
|
|
127
|
+
},
|
|
128
|
+
emits: ['update:modelValue', 'update:open'],
|
|
129
|
+
setup(props, { emit, slots }) {
|
|
130
|
+
const { required, disabled, multiple, dir: propDir } = toRefs(props)
|
|
131
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
132
|
+
defaultValue: props.defaultValue ?? (multiple.value ? [] : undefined),
|
|
133
|
+
passive: props.modelValue === undefined,
|
|
134
|
+
deep: true,
|
|
135
|
+
}) as Ref<unknown>
|
|
136
|
+
const open = useVModel(props, 'open', emit, {
|
|
137
|
+
defaultValue: props.defaultOpen,
|
|
138
|
+
passive: props.open === undefined,
|
|
139
|
+
}) as Ref<boolean>
|
|
140
|
+
const triggerElement = ref<HTMLElement>()
|
|
141
|
+
const valueElement = ref<HTMLElement>()
|
|
142
|
+
const triggerPointerDownPosRef = ref<{ x: number; y: number } | null>({ x: 0, y: 0 })
|
|
143
|
+
const isEmptyModelValue = computed(() => {
|
|
144
|
+
if (multiple.value && Array.isArray(modelValue.value)) return modelValue.value?.length === 0
|
|
145
|
+
return isNullish(modelValue.value)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
useCollection({ isProvider: true })
|
|
149
|
+
const dir = useDirection(propDir)
|
|
150
|
+
const isFormControl = useFormControl(triggerElement)
|
|
151
|
+
const optionsSet = ref(new Set<SelectOptionRecord>()) as Ref<Set<SelectOptionRecord>>
|
|
152
|
+
const nativeSelectKey = computed(() =>
|
|
153
|
+
Array.from(optionsSet.value)
|
|
154
|
+
.map(option => option.value)
|
|
155
|
+
.join(';'),
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
function handleValueChange(value: unknown) {
|
|
159
|
+
if (multiple.value) modelValue.value = toggleSelectValue(modelValue.value, value, props.by)
|
|
160
|
+
else modelValue.value = value
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function getOption(value: unknown) {
|
|
164
|
+
return Array.from(optionsSet.value).find(option =>
|
|
165
|
+
valueComparator(value, option.value, props.by),
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
provideSelectRootContext({
|
|
170
|
+
triggerElement,
|
|
171
|
+
onTriggerChange: node => {
|
|
172
|
+
triggerElement.value = node
|
|
173
|
+
},
|
|
174
|
+
valueElement,
|
|
175
|
+
onValueElementChange: node => {
|
|
176
|
+
valueElement.value = node
|
|
177
|
+
},
|
|
178
|
+
contentId: '',
|
|
179
|
+
modelValue,
|
|
180
|
+
onValueChange: handleValueChange,
|
|
181
|
+
by: props.by,
|
|
182
|
+
open,
|
|
183
|
+
multiple,
|
|
184
|
+
required,
|
|
185
|
+
onOpenChange: value => {
|
|
186
|
+
open.value = value
|
|
187
|
+
},
|
|
188
|
+
dir,
|
|
189
|
+
triggerPointerDownPosRef,
|
|
190
|
+
disabled,
|
|
191
|
+
isEmptyModelValue,
|
|
192
|
+
optionsSet,
|
|
193
|
+
onOptionAdd: option => {
|
|
194
|
+
const existingOption = getOption(option.value)
|
|
195
|
+
if (existingOption) optionsSet.value.delete(existingOption)
|
|
196
|
+
optionsSet.value.add(option)
|
|
197
|
+
},
|
|
198
|
+
onOptionRemove: option => {
|
|
199
|
+
const existingOption = getOption(option.value)
|
|
200
|
+
if (existingOption) optionsSet.value.delete(existingOption)
|
|
201
|
+
},
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
return () =>
|
|
205
|
+
h(PopperRoot, null, {
|
|
206
|
+
default: withCtx(() => [
|
|
207
|
+
renderSlot(slots, 'default', { modelValue: modelValue.value, open: open.value }),
|
|
208
|
+
isFormControl.value && props.name
|
|
209
|
+
? h(
|
|
210
|
+
BubbleSelect,
|
|
211
|
+
{
|
|
212
|
+
key: nativeSelectKey.value,
|
|
213
|
+
'aria-hidden': 'true',
|
|
214
|
+
tabindex: '-1',
|
|
215
|
+
multiple: multiple.value,
|
|
216
|
+
required: required.value,
|
|
217
|
+
name: props.name,
|
|
218
|
+
autocomplete: props.autocomplete,
|
|
219
|
+
disabled: disabled.value,
|
|
220
|
+
value: modelValue.value,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
default: withCtx(() => [
|
|
224
|
+
isNullish(modelValue.value)
|
|
225
|
+
? h('option', { key: 0, value: props.nullableValue })
|
|
226
|
+
: createCommentVNode('v-if', true),
|
|
227
|
+
h(
|
|
228
|
+
Fragment,
|
|
229
|
+
null,
|
|
230
|
+
Array.from(optionsSet.value).map(option =>
|
|
231
|
+
h(
|
|
232
|
+
'option',
|
|
233
|
+
mergeProps(
|
|
234
|
+
{ key: (option.value ?? '') as string },
|
|
235
|
+
option as unknown as Record<string, unknown>,
|
|
236
|
+
),
|
|
237
|
+
),
|
|
238
|
+
),
|
|
239
|
+
),
|
|
240
|
+
]),
|
|
241
|
+
},
|
|
242
|
+
)
|
|
243
|
+
: createCommentVNode('v-if', true),
|
|
244
|
+
]),
|
|
245
|
+
})
|
|
246
|
+
},
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
export const SelectTrigger = defineComponent({
|
|
250
|
+
name: 'SelectTrigger',
|
|
251
|
+
props: {
|
|
252
|
+
disabled: { type: Boolean, required: false },
|
|
253
|
+
reference: { type: null, required: false },
|
|
254
|
+
...primitive('button'),
|
|
255
|
+
},
|
|
256
|
+
setup(props, { slots }) {
|
|
257
|
+
const rootContext = injectSelectRootContext()
|
|
258
|
+
const { forwardRef, currentElement: triggerElement } = useForwardExpose()
|
|
259
|
+
const isDisabled = computed(() => rootContext.disabled?.value || props.disabled)
|
|
260
|
+
rootContext.contentId ||= useId(undefined, 'reka-select-content')
|
|
261
|
+
|
|
262
|
+
onMounted(() => {
|
|
263
|
+
rootContext.onTriggerChange(triggerElement.value)
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
const { getItems } = useCollection()
|
|
267
|
+
const typeahead = createTypeahead()
|
|
268
|
+
onUnmounted(() => typeahead.dispose())
|
|
269
|
+
|
|
270
|
+
function handleOpen() {
|
|
271
|
+
if (!isDisabled.value) {
|
|
272
|
+
rootContext.onOpenChange(true)
|
|
273
|
+
typeahead.reset()
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function handlePointerOpen(event: PointerEvent) {
|
|
278
|
+
handleOpen()
|
|
279
|
+
rootContext.triggerPointerDownPosRef.value = {
|
|
280
|
+
x: Math.round(event.pageX),
|
|
281
|
+
y: Math.round(event.pageY),
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function isPlainLeftClick(event: PointerEvent | MouseEvent) {
|
|
286
|
+
return event.button === 0 && event.ctrlKey === false
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
let openedFromPointerDown = false
|
|
290
|
+
|
|
291
|
+
function onTriggerPointerDown(event: PointerEvent) {
|
|
292
|
+
if (event.pointerType === 'touch') return event.preventDefault()
|
|
293
|
+
const target = event.target as HTMLElement
|
|
294
|
+
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId)
|
|
295
|
+
if (isPlainLeftClick(event)) {
|
|
296
|
+
handlePointerOpen(event)
|
|
297
|
+
openedFromPointerDown = true
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function onTriggerMouseDown(event: MouseEvent) {
|
|
302
|
+
if (isPlainLeftClick(event)) event.preventDefault()
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function onTriggerClick(event: MouseEvent) {
|
|
306
|
+
if (!openedFromPointerDown) (event.currentTarget as HTMLElement | null)?.focus()
|
|
307
|
+
openedFromPointerDown = false
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const onPointerup = withModifiers(
|
|
311
|
+
((event: PointerEvent) => {
|
|
312
|
+
if (event.pointerType === 'touch') handlePointerOpen(event)
|
|
313
|
+
}) as (event: Event) => void,
|
|
314
|
+
['prevent'],
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
function onKeydown(event: KeyboardEvent) {
|
|
318
|
+
const isTypingAhead = typeahead.search !== ''
|
|
319
|
+
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey
|
|
320
|
+
if (!isModifierKey && event.key.length === 1) {
|
|
321
|
+
if (isTypingAhead && event.key === ' ') return
|
|
322
|
+
}
|
|
323
|
+
typeahead.handle(event.key, getItems())
|
|
324
|
+
if (OPEN_KEYS.includes(event.key)) {
|
|
325
|
+
handleOpen()
|
|
326
|
+
event.preventDefault()
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return () =>
|
|
331
|
+
h(
|
|
332
|
+
PopperAnchor as Component,
|
|
333
|
+
{ 'as-child': '', reference: props.reference },
|
|
334
|
+
{
|
|
335
|
+
default: withCtx(() => [
|
|
336
|
+
h(
|
|
337
|
+
Primitive,
|
|
338
|
+
{
|
|
339
|
+
ref: forwardRef,
|
|
340
|
+
role: 'combobox',
|
|
341
|
+
type: props.as === 'button' ? 'button' : undefined,
|
|
342
|
+
'aria-controls': rootContext.open.value ? rootContext.contentId : undefined,
|
|
343
|
+
'aria-expanded': rootContext.open.value || false,
|
|
344
|
+
'aria-required': rootContext.required?.value,
|
|
345
|
+
'aria-autocomplete': 'none',
|
|
346
|
+
disabled: isDisabled.value,
|
|
347
|
+
dir: rootContext?.dir.value,
|
|
348
|
+
'data-state': rootContext?.open.value ? 'open' : 'closed',
|
|
349
|
+
'data-disabled': isDisabled.value ? '' : undefined,
|
|
350
|
+
'data-placeholder': shouldShowPlaceholder(rootContext.modelValue?.value)
|
|
351
|
+
? ''
|
|
352
|
+
: undefined,
|
|
353
|
+
'as-child': props.asChild,
|
|
354
|
+
as: props.as,
|
|
355
|
+
onClick: onTriggerClick,
|
|
356
|
+
onPointerdown: onTriggerPointerDown,
|
|
357
|
+
onMousedown: onTriggerMouseDown,
|
|
358
|
+
onPointerup,
|
|
359
|
+
onKeydown,
|
|
360
|
+
},
|
|
361
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
362
|
+
),
|
|
363
|
+
]),
|
|
364
|
+
},
|
|
365
|
+
)
|
|
366
|
+
},
|
|
367
|
+
})
|
|
368
|
+
|
|
369
|
+
export const SelectPortal = defineComponent({
|
|
370
|
+
name: 'SelectPortal',
|
|
371
|
+
props: {
|
|
372
|
+
to: { type: null as unknown as PropType<string | HTMLElement>, required: false },
|
|
373
|
+
disabled: { type: Boolean, required: false },
|
|
374
|
+
defer: { type: Boolean, required: false },
|
|
375
|
+
forceMount: { type: Boolean, required: false },
|
|
376
|
+
},
|
|
377
|
+
setup(props, { slots }) {
|
|
378
|
+
return () =>
|
|
379
|
+
h(Teleport as Component, normalizeProps(guardReactiveProps(props)), {
|
|
380
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
381
|
+
})
|
|
382
|
+
},
|
|
383
|
+
})
|
|
384
|
+
|
|
385
|
+
export const SelectGroup = defineComponent({
|
|
386
|
+
name: 'SelectGroup',
|
|
387
|
+
props: primitive(),
|
|
388
|
+
setup(props, { slots }) {
|
|
389
|
+
const id = useId(undefined, 'reka-select-group')
|
|
390
|
+
provideSelectGroupContext({ id })
|
|
391
|
+
return () =>
|
|
392
|
+
h(Primitive, mergeProps({ role: 'group' }, props, { 'aria-labelledby': id }), {
|
|
393
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
394
|
+
})
|
|
395
|
+
},
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
export const SelectLabel = defineComponent({
|
|
399
|
+
name: 'SelectLabel',
|
|
400
|
+
props: { for: { type: String, required: false }, ...primitive('div') },
|
|
401
|
+
setup(props, { slots }) {
|
|
402
|
+
const groupContext = injectSelectGroupContext({ id: '' })
|
|
403
|
+
return () =>
|
|
404
|
+
h(Primitive, mergeProps(props, { id: groupContext.id }), {
|
|
405
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
406
|
+
})
|
|
407
|
+
},
|
|
408
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import type { Comparator } from '../../../../shared/src/primitives/listbox'
|
|
3
|
+
import { createContext } from '../utils/createContext'
|
|
4
|
+
import type { Direction } from '../utils/useDirection'
|
|
5
|
+
|
|
6
|
+
export interface SelectOptionRecord {
|
|
7
|
+
value: unknown
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
textContent: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SelectRootContext {
|
|
13
|
+
triggerElement: Ref<HTMLElement | undefined>
|
|
14
|
+
onTriggerChange: (node: HTMLElement | undefined) => void
|
|
15
|
+
valueElement: Ref<HTMLElement | undefined>
|
|
16
|
+
onValueElementChange: (node: HTMLElement) => void
|
|
17
|
+
contentId: string
|
|
18
|
+
modelValue: Ref<unknown>
|
|
19
|
+
onValueChange: (value: unknown) => void
|
|
20
|
+
by?: Comparator
|
|
21
|
+
open: Ref<boolean>
|
|
22
|
+
multiple: Ref<boolean>
|
|
23
|
+
required?: Ref<boolean>
|
|
24
|
+
onOpenChange: (open: boolean) => void
|
|
25
|
+
dir: Ref<Direction>
|
|
26
|
+
triggerPointerDownPosRef: Ref<{ x: number; y: number } | null>
|
|
27
|
+
disabled?: Ref<boolean>
|
|
28
|
+
isEmptyModelValue: Ref<boolean>
|
|
29
|
+
optionsSet: Ref<Set<SelectOptionRecord>>
|
|
30
|
+
onOptionAdd: (option: SelectOptionRecord) => void
|
|
31
|
+
onOptionRemove: (option: SelectOptionRecord) => void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface SelectContentContext {
|
|
35
|
+
content?: Ref<HTMLElement | undefined>
|
|
36
|
+
viewport?: Ref<HTMLElement | undefined>
|
|
37
|
+
onViewportChange: (node: HTMLElement | undefined) => void
|
|
38
|
+
itemRefCallback: (node: HTMLElement | undefined, value: unknown, disabled?: boolean) => void
|
|
39
|
+
selectedItem?: Ref<HTMLElement | undefined>
|
|
40
|
+
onItemLeave?: () => void
|
|
41
|
+
itemTextRefCallback: (node: HTMLElement | undefined, value: unknown, disabled?: boolean) => void
|
|
42
|
+
focusSelectedItem?: () => void
|
|
43
|
+
selectedItemText?: Ref<HTMLElement | undefined>
|
|
44
|
+
position?: 'item-aligned' | 'popper'
|
|
45
|
+
isPositioned?: Ref<boolean>
|
|
46
|
+
searchRef?: { readonly search: string }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SelectItemContext {
|
|
50
|
+
value: unknown
|
|
51
|
+
disabled: Ref<boolean>
|
|
52
|
+
textId: string
|
|
53
|
+
isSelected: Ref<boolean>
|
|
54
|
+
onItemTextChange: (node: HTMLElement | undefined) => void
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const SelectContentDefaultContextValue: SelectContentContext = {
|
|
58
|
+
onViewportChange: () => {},
|
|
59
|
+
itemTextRefCallback: () => {},
|
|
60
|
+
itemRefCallback: () => {},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const [injectSelectRootContext, provideSelectRootContext] =
|
|
64
|
+
createContext<SelectRootContext>('SelectRoot')
|
|
65
|
+
|
|
66
|
+
export const [injectSelectContentContext, provideSelectContentContext] =
|
|
67
|
+
createContext<SelectContentContext>('SelectContent')
|
|
68
|
+
|
|
69
|
+
export const [injectSelectItemContext, provideSelectItemContext] =
|
|
70
|
+
createContext<SelectItemContext>('SelectItem')
|
|
71
|
+
|
|
72
|
+
export const [injectSelectGroupContext, provideSelectGroupContext] = createContext<{
|
|
73
|
+
id: string
|
|
74
|
+
}>('SelectGroup')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
injectSelectContentContext,
|
|
3
|
+
injectSelectItemContext,
|
|
4
|
+
injectSelectRootContext,
|
|
5
|
+
type SelectContentContext,
|
|
6
|
+
type SelectItemContext,
|
|
7
|
+
type SelectOptionRecord,
|
|
8
|
+
type SelectRootContext,
|
|
9
|
+
} from './context'
|
|
10
|
+
export { SelectContent } from './SelectContent'
|
|
11
|
+
export {
|
|
12
|
+
SelectItem,
|
|
13
|
+
SelectItemIndicator,
|
|
14
|
+
SelectItemText,
|
|
15
|
+
type SelectItemSelectEvent,
|
|
16
|
+
} from './SelectItem'
|
|
17
|
+
export { SelectGroup, SelectLabel, SelectPortal, SelectRoot, SelectTrigger } from './SelectRoot'
|
|
@@ -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,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
nextTick,
|
|
5
|
+
onMounted,
|
|
6
|
+
renderSlot,
|
|
7
|
+
withCtx,
|
|
8
|
+
withKeys,
|
|
9
|
+
type PropType,
|
|
10
|
+
} from 'vue'
|
|
11
|
+
import {
|
|
12
|
+
matchesTagsInputDelimiter,
|
|
13
|
+
splitTagsInputPaste,
|
|
14
|
+
} from '../../../../shared/src/primitives/tags-input'
|
|
15
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
16
|
+
import { useComposing } from '../utils/useComposing'
|
|
17
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
18
|
+
import { injectTagsInputRootContext } from './context'
|
|
19
|
+
|
|
20
|
+
export interface TagsInputInputProps {
|
|
21
|
+
placeholder?: string
|
|
22
|
+
autoFocus?: boolean
|
|
23
|
+
maxLength?: number
|
|
24
|
+
asChild?: boolean
|
|
25
|
+
as?: PrimitiveProps['as']
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const TagsInputInput = defineComponent({
|
|
29
|
+
name: 'TagsInputInput',
|
|
30
|
+
props: {
|
|
31
|
+
placeholder: { type: String, required: false },
|
|
32
|
+
autoFocus: { type: Boolean, required: false },
|
|
33
|
+
maxLength: { type: Number, required: false },
|
|
34
|
+
asChild: { type: Boolean, required: false },
|
|
35
|
+
as: {
|
|
36
|
+
type: null as unknown as PropType<PrimitiveProps['as']>,
|
|
37
|
+
required: false,
|
|
38
|
+
default: 'input',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
setup(props, { slots }) {
|
|
42
|
+
const context = injectTagsInputRootContext()
|
|
43
|
+
const { forwardRef, currentElement } = useForwardExpose()
|
|
44
|
+
|
|
45
|
+
function handleBlur(event: FocusEvent) {
|
|
46
|
+
context.selectedElement.value = undefined
|
|
47
|
+
if (!context.addOnBlur.value) return
|
|
48
|
+
const target = event.target as HTMLInputElement
|
|
49
|
+
const relatedTarget = event.relatedTarget as HTMLElement | null
|
|
50
|
+
const controlledId = target.getAttribute('aria-controls')
|
|
51
|
+
if (controlledId && relatedTarget?.closest(`#${CSS.escape(controlledId)}`)) return
|
|
52
|
+
if (!target.value) return
|
|
53
|
+
if (context.onAddValue(target.value)) target.value = ''
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function handleTab(event: Event) {
|
|
57
|
+
if (!context.addOnTab.value) return
|
|
58
|
+
void handleCustomKeydown(event)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing()
|
|
62
|
+
|
|
63
|
+
async function handleCustomKeydown(event: Event) {
|
|
64
|
+
if (isComposing.value) return
|
|
65
|
+
await nextTick()
|
|
66
|
+
if (event.defaultPrevented) return
|
|
67
|
+
const target = event.target as HTMLInputElement
|
|
68
|
+
if (!target.value) return
|
|
69
|
+
if (context.onAddValue(target.value)) target.value = ''
|
|
70
|
+
event.preventDefault()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function handleInput(event: Event) {
|
|
74
|
+
if (isComposing.value) return
|
|
75
|
+
context.isInvalidInput.value = false
|
|
76
|
+
const data = (event as InputEvent).data
|
|
77
|
+
if (data === null) return
|
|
78
|
+
const delimiter = context.delimiter.value
|
|
79
|
+
if (matchesTagsInputDelimiter(delimiter, data)) {
|
|
80
|
+
const target = event.target as HTMLInputElement
|
|
81
|
+
target.value = target.value.replace(delimiter, '')
|
|
82
|
+
if (target.value.trim() === '') {
|
|
83
|
+
target.value = ''
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
if (context.onAddValue(target.value)) target.value = ''
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function handleInputKeydown(event: KeyboardEvent) {
|
|
91
|
+
if (isComposing.value) return
|
|
92
|
+
context.onInputKeydown(event)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function handlePaste(event: ClipboardEvent) {
|
|
96
|
+
if (!context.addOnPaste.value) return
|
|
97
|
+
event.preventDefault()
|
|
98
|
+
const clipboardData = event.clipboardData
|
|
99
|
+
if (!clipboardData) return
|
|
100
|
+
for (const part of splitTagsInputPaste(
|
|
101
|
+
clipboardData.getData('text'),
|
|
102
|
+
context.delimiter.value,
|
|
103
|
+
))
|
|
104
|
+
context.onAddValue(part)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
onMounted(() => {
|
|
108
|
+
const input =
|
|
109
|
+
currentElement.value.nodeName === 'INPUT'
|
|
110
|
+
? currentElement.value
|
|
111
|
+
: currentElement.value.querySelector('input')
|
|
112
|
+
if (!input) return
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
if (props.autoFocus) input?.focus()
|
|
115
|
+
}, 1)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
return () =>
|
|
119
|
+
h(
|
|
120
|
+
Primitive,
|
|
121
|
+
{
|
|
122
|
+
id: context.id?.value,
|
|
123
|
+
ref: forwardRef,
|
|
124
|
+
type: 'text',
|
|
125
|
+
autocomplete: 'off',
|
|
126
|
+
autocorrect: 'off',
|
|
127
|
+
autocapitalize: 'off',
|
|
128
|
+
as: props.as,
|
|
129
|
+
'as-child': props.asChild,
|
|
130
|
+
maxlength: props.maxLength,
|
|
131
|
+
placeholder: props.placeholder,
|
|
132
|
+
disabled: context.disabled.value,
|
|
133
|
+
'data-invalid': context.isInvalidInput.value ? '' : undefined,
|
|
134
|
+
onInput: handleInput,
|
|
135
|
+
onKeydown: [
|
|
136
|
+
withKeys(handleCustomKeydown, ['enter']),
|
|
137
|
+
withKeys(handleTab, ['tab']),
|
|
138
|
+
handleInputKeydown,
|
|
139
|
+
],
|
|
140
|
+
onBlur: handleBlur,
|
|
141
|
+
onCompositionstart: handleCompositionStart,
|
|
142
|
+
onCompositionend: handleCompositionEnd,
|
|
143
|
+
onPaste: handlePaste,
|
|
144
|
+
},
|
|
145
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
146
|
+
)
|
|
147
|
+
},
|
|
148
|
+
})
|