@hina-ui/vue 1.7.12 → 1.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +23318 -7947
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/tour.ts +261 -0
- package/dist/shared/locale/en-US.ts +8 -0
- package/dist/shared/locale/index.ts +1 -0
- package/dist/shared/locale/ja-JP.ts +9 -0
- package/dist/shared/locale/types.ts +8 -0
- package/dist/shared/locale/zh-CN.ts +8 -0
- package/dist/shared/primitives/combobox/LICENSE +44 -0
- package/dist/shared/primitives/combobox/index.ts +49 -0
- package/dist/shared/primitives/date/LICENSE +21 -0
- package/dist/shared/primitives/date/calendar-view.ts +264 -0
- package/dist/shared/primitives/date/calendar.ts +126 -0
- package/dist/shared/primitives/date/comparators.ts +144 -0
- package/dist/shared/primitives/date/field.ts +551 -0
- package/dist/shared/primitives/date/formatter.ts +110 -0
- package/dist/shared/primitives/date/parser.ts +182 -0
- package/dist/shared/primitives/date/parts.ts +16 -0
- package/dist/shared/primitives/date/picker-view.ts +186 -0
- package/dist/shared/primitives/date/placeholders.ts +485 -0
- package/dist/shared/primitives/date/range-calendar-view.ts +181 -0
- package/dist/shared/primitives/date/segment.ts +44 -0
- package/dist/shared/primitives/date/utils.ts +169 -0
- package/dist/shared/primitives/dialog/LICENSE +21 -0
- package/dist/shared/primitives/dialog/index.ts +73 -0
- package/dist/shared/primitives/grace-area/LICENSE +21 -0
- package/dist/shared/primitives/grace-area/index.ts +112 -0
- package/dist/shared/primitives/listbox/LICENSE +21 -0
- package/dist/shared/primitives/listbox/index.ts +213 -0
- package/dist/shared/primitives/menu/LICENSE +21 -0
- package/dist/shared/primitives/menu/index.ts +66 -0
- package/dist/shared/primitives/navigation-menu/LICENSE +44 -0
- package/dist/shared/primitives/navigation-menu/index.ts +125 -0
- package/dist/shared/primitives/popper/LICENSE +21 -0
- package/dist/shared/primitives/popper/index.ts +246 -0
- package/dist/shared/primitives/select/index.ts +98 -0
- package/dist/shared/primitives/tags-input/LICENSE +21 -0
- package/dist/shared/primitives/tags-input/index.ts +113 -0
- package/dist/shared/primitives/toast/LICENSE +44 -0
- package/dist/shared/primitives/toast/index.ts +106 -0
- package/dist/shared/primitives/tree/LICENSE +21 -0
- package/dist/shared/primitives/tree/index.ts +248 -0
- package/dist/shared/styles/tokens.css +1 -0
- package/dist/shared/styles/tour.css +29 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/tour.ts +29 -0
- package/dist/types/shared/src/lib/tour.d.ts +81 -0
- package/dist/types/shared/src/lib/tour.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts +6 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts.map +1 -0
- package/dist/types/shared/src/locale/en-US.d.ts.map +1 -1
- package/dist/types/shared/src/locale/index.d.ts.map +1 -1
- package/dist/types/shared/src/locale/ja-JP.d.ts.map +1 -1
- package/dist/types/shared/src/locale/types.d.ts +8 -0
- package/dist/types/shared/src/locale/types.d.ts.map +1 -1
- package/dist/types/shared/src/locale/zh-CN.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts +1 -1
- package/dist/types/shared/src/primitives/combobox/index.d.ts +9 -0
- package/dist/types/shared/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts +53 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts +39 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts +31 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/field.d.ts +46 -0
- package/dist/types/shared/src/primitives/date/field.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts +20 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts +49 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts +10 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts +34 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts +2 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts +67 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts +6 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts +37 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts +32 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts +2 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts +13 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts +55 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts +35 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts +23 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts +83 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/select/index.d.ts +24 -0
- package/dist/types/shared/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts +36 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts +42 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts +72 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/shared/src/variants/nav-link.d.ts +2 -1
- package/dist/types/shared/src/variants/nav-link.d.ts.map +1 -1
- package/dist/types/shared/src/variants/tour.d.ts +10 -0
- package/dist/types/shared/src/variants/tour.d.ts.map +1 -0
- package/dist/types/vue/src/components/app-shell/AppShell.vue.d.ts +6 -6
- package/dist/types/vue/src/components/button/Button.vue.d.ts +1 -1
- package/dist/types/vue/src/components/button/Button.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/carousel/composables/useCarousel.d.ts +1 -1
- package/dist/types/vue/src/components/combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts +20 -0
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts +10 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts +2 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts.map +1 -0
- package/dist/types/vue/src/components/date-range-field/DateRangeField.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/ModalContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts +20 -8
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts +1 -1
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarSub.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/month-grid/MonthGrid.vue.d.ts +1 -1
- package/dist/types/vue/src/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts +5 -10
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts +8 -0
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts +2 -2
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuContent.vue.d.ts +6 -6
- package/dist/types/vue/src/components/pagination/composables/usePaginationWindow.d.ts +6 -6
- package/dist/types/vue/src/components/popconfirm/Popconfirm.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-slider/RangeSlider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts +1 -1
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/select/Select.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/Slider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/split-button/SplitButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/Toolbar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarControl.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts +34 -0
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts +2 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/types.d.ts +33 -0
- package/dist/types/vue/src/components/tour/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +7 -7
- package/dist/types/vue/src/index.d.ts +5 -0
- package/dist/types/vue/src/index.d.ts.map +1 -1
- package/dist/types/vue/src/lib/anchored-overlay.d.ts +11 -5
- package/dist/types/vue/src/lib/anchored-overlay.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts +6 -6
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts.map +1 -1
- package/dist/types/vue/src/lib/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts +133 -0
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts +227 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts +140 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts +313 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts +48 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts +65 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts +273 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts +166 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts +376 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts +68 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts +949 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts +26 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts +36 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts +32 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts +51 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts +221 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts +31 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts +54 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts +65 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts +40 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts +49 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts +62 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts +85 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts +8 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts +76 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts +26 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts +1033 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts +72 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts +442 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts +30 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts +67 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts +82 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts +58 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts +156 -0
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts +49 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts +394 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts +396 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts +746 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts +74 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts +14 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts +1036 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts +101 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts +165 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts +187 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts +40 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts +247 -0
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts +414 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts +257 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts +183 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts +13 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts +67 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts +40 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts +61 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts +370 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts +4 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts +17 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts +252 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts +345 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts +64 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts +3 -3
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts +265 -0
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts +107 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts +275 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/context.d.ts +73 -0
- package/dist/types/vue/src/primitives/select/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts +61 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts +76 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts +196 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts +30 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts +49 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts +220 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts +25 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts +177 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts +267 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts +162 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts +32 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts +40 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts +29 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts +14 -1
- package/dist/types/vue/src/primitives/utils/config.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/defu.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/defu.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts +5 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/alert-dialog/AlertDialog.vue +1 -1
- package/src/components/calendar/Calendar.vue +1 -1
- package/src/components/calendar/CalendarLevels.vue +1 -1
- package/src/components/combobox/Combobox.vue +6 -1
- package/src/components/combobox/ComboboxList.vue +1 -1
- package/src/components/command-palette/CommandPalette.vue +2 -2
- package/src/components/command-palette/CommandPaletteInput.vue +1 -1
- package/src/components/command-palette/CommandPaletteItem.vue +1 -1
- package/src/components/command-palette/CommandPalettePanel.vue +6 -1
- package/src/components/config-provider/ConfigProvider.vue +24 -0
- package/src/components/config-provider/types.ts +11 -0
- package/src/components/config-provider/useConfig.ts +5 -0
- package/src/components/context-menu/ContextMenu.vue +1 -1
- package/src/components/context-menu/ContextMenuCheckboxItem.vue +1 -1
- package/src/components/context-menu/ContextMenuGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuItem.vue +1 -1
- package/src/components/context-menu/ContextMenuLabel.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioItem.vue +1 -1
- package/src/components/context-menu/ContextMenuSeparator.vue +1 -1
- package/src/components/context-menu/ContextMenuSub.vue +1 -1
- package/src/components/data-table/DataTableDragPreview.vue +1 -1
- package/src/components/date-field/DateField.vue +1 -1
- package/src/components/date-picker/DatePicker.vue +1 -1
- package/src/components/date-range-field/DateRangeField.vue +5 -1
- package/src/components/date-range-picker/DateRangePicker.vue +1 -1
- package/src/components/date-time-picker/DateTimePicker.vue +1 -1
- package/src/components/dialog/Dialog.vue +1 -1
- package/src/components/dialog/ModalContent.vue +2 -1
- package/src/components/drawer/Drawer.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenu.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue +4 -1
- package/src/components/dropdown-menu/DropdownMenuGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuLabel.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSeparator.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSub.vue +1 -1
- package/src/components/hover-card/HoverCard.vue +6 -1
- package/src/components/hover-card/composables/useHoverCardAnchor.ts +1 -1
- package/src/components/icon-button/IconButton.vue +1 -1
- package/src/components/lightbox/Lightbox.vue +2 -1
- package/src/components/lightbox/LightboxChrome.vue +1 -1
- package/src/components/listbox/Listbox.vue +1 -1
- package/src/components/listbox/ListboxOptionContent.vue +1 -1
- package/src/components/menubar/Menubar.vue +1 -1
- package/src/components/menubar/MenubarCheckboxItem.vue +1 -1
- package/src/components/menubar/MenubarGroup.vue +1 -1
- package/src/components/menubar/MenubarItem.vue +1 -1
- package/src/components/menubar/MenubarLabel.vue +1 -1
- package/src/components/menubar/MenubarMenu.vue +6 -1
- package/src/components/menubar/MenubarRadioGroup.vue +1 -1
- package/src/components/menubar/MenubarRadioItem.vue +1 -1
- package/src/components/menubar/MenubarSeparator.vue +1 -1
- package/src/components/menubar/MenubarSub.vue +6 -1
- package/src/components/multi-combobox/MultiCombobox.vue +6 -1
- package/src/components/multi-select/MultiSelect.vue +1 -1
- package/src/components/nav-link/NavLink.vue +21 -2
- package/src/components/nav-link/NavLinkChild.ts +2 -0
- package/src/components/navigation-menu/NavigationMenu.vue +5 -1
- package/src/components/navigation-menu/NavigationMenuContent.vue +2 -2
- package/src/components/navigation-menu/NavigationMenuItem.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuTrigger.vue +1 -1
- package/src/components/number-input/NumberInput.vue +1 -1
- package/src/components/pagination/PaginationPopup.vue +1 -1
- package/src/components/popconfirm/Popconfirm.vue +6 -1
- package/src/components/popover/Popover.vue +6 -1
- package/src/components/popover/PopoverContent.vue +2 -2
- package/src/components/popover/composables/usePopoverCloseFocus.ts +1 -1
- package/src/components/range-calendar/RangeCalendar.vue +1 -1
- package/src/components/select/Select.vue +2 -1
- package/src/components/select/SelectList.vue +1 -1
- package/src/components/sheet/Sheet.vue +1 -1
- package/src/components/slider/SliderHandle.vue +1 -1
- package/src/components/tags-input/TagsInput.vue +1 -1
- package/src/components/tags-input/TagsInputChip.vue +1 -1
- package/src/components/time/Time.vue +1 -1
- package/src/components/time-field/TimeField.vue +1 -1
- package/src/components/toast/Toaster.vue +1 -1
- package/src/components/toggle/Toggle.vue +1 -1
- package/src/components/toolbar/ToolbarControl.vue +1 -1
- package/src/components/tooltip/Tooltip.vue +1 -1
- package/src/components/tooltip/TooltipBubble.vue +1 -1
- package/src/components/tooltip/TooltipDirectiveRoot.ts +1 -1
- package/src/components/tooltip/TooltipProvider.vue +1 -1
- package/src/components/tooltip/composables/useTooltipTarget.ts +1 -1
- package/src/components/tour/Tour.vue +447 -0
- package/src/components/tour/tour.variants.ts +1 -0
- package/src/components/tour/types.ts +43 -0
- package/src/components/tree/Tree.vue +1 -1
- package/src/components/tree/TreeRows.vue +1 -1
- package/src/components/tree/VirtualTreeWindow.vue +1 -1
- package/src/components/tree-select/TreeSelect.vue +2 -3
- package/src/components/tree-select/composables/useTreeSelect.ts +2 -2
- package/src/index.ts +15 -0
- package/src/lib/anchored-overlay.ts +2 -1
- package/src/lib/dialog-focus.ts +1 -1
- package/src/lib/reka/useVirtualChoices.ts +7 -8
- package/src/lib/reka/useVirtualTree.ts +1 -1
- package/src/primitives/alert-dialog/LICENSE +44 -0
- package/src/primitives/alert-dialog/index.ts +166 -0
- package/src/primitives/calendar/CalendarCellTrigger.ts +190 -0
- package/src/primitives/calendar/CalendarGrid.ts +101 -0
- package/src/primitives/calendar/CalendarNav.ts +88 -0
- package/src/primitives/calendar/CalendarRoot.ts +324 -0
- package/src/primitives/calendar/LICENSE +44 -0
- package/src/primitives/calendar/context.ts +55 -0
- package/src/primitives/calendar/index.ts +12 -0
- package/src/primitives/calendar/useCalendar.ts +164 -0
- package/src/primitives/combobox/ComboboxContent.ts +199 -0
- package/src/primitives/combobox/ComboboxItem.ts +209 -0
- package/src/primitives/combobox/ComboboxRoot.ts +489 -0
- package/src/primitives/combobox/LICENSE +44 -0
- package/src/primitives/combobox/context.ts +47 -0
- package/src/primitives/combobox/index.ts +23 -0
- package/src/primitives/context-menu/LICENSE +44 -0
- package/src/primitives/context-menu/index.ts +388 -0
- package/src/primitives/date-field/DateFieldInput.ts +29 -0
- package/src/primitives/date-field/DateFieldRoot.ts +343 -0
- package/src/primitives/date-field/LICENSE +44 -0
- package/src/primitives/date-field/context.ts +29 -0
- package/src/primitives/date-field/index.ts +3 -0
- package/src/primitives/date-field/segmentInput.ts +96 -0
- package/src/primitives/date-field/useDateFieldSegment.ts +63 -0
- package/src/primitives/date-range-field/DateRangeFieldInput.ts +42 -0
- package/src/primitives/date-range-field/DateRangeFieldRoot.ts +389 -0
- package/src/primitives/date-range-field/LICENSE +44 -0
- package/src/primitives/date-range-field/context.ts +36 -0
- package/src/primitives/date-range-field/index.ts +12 -0
- package/src/primitives/dialog/DialogContent.ts +193 -0
- package/src/primitives/dialog/DialogContentImpl.ts +114 -0
- package/src/primitives/dialog/DialogOverlay.ts +99 -0
- package/src/primitives/dialog/DialogPortal.ts +33 -0
- package/src/primitives/dialog/DialogRoot.ts +61 -0
- package/src/primitives/dialog/DialogText.ts +59 -0
- package/src/primitives/dialog/DialogTrigger.ts +46 -0
- package/src/primitives/dialog/LICENSE +44 -0
- package/src/primitives/dialog/context.ts +19 -0
- package/src/primitives/dialog/index.ts +7 -0
- package/src/primitives/dismissable-layer/DismissableLayer.ts +212 -0
- package/src/primitives/dismissable-layer/DismissableLayerBranch.ts +36 -0
- package/src/primitives/dismissable-layer/LICENSE +44 -0
- package/src/primitives/dismissable-layer/index.ts +11 -0
- package/src/primitives/dropdown-menu/LICENSE +44 -0
- package/src/primitives/dropdown-menu/index.ts +344 -0
- package/src/primitives/focus-scope/FocusScope.ts +118 -0
- package/src/primitives/focus-scope/LICENSE +44 -0
- package/src/primitives/focus-scope/index.ts +1 -0
- package/src/primitives/hover-card/LICENSE +44 -0
- package/src/primitives/hover-card/index.ts +357 -0
- package/src/primitives/listbox/LICENSE +44 -0
- package/src/primitives/listbox/ListboxContent.ts +80 -0
- package/src/primitives/listbox/ListboxFilter.ts +130 -0
- package/src/primitives/listbox/ListboxGroup.ts +67 -0
- package/src/primitives/listbox/ListboxItem.ts +125 -0
- package/src/primitives/listbox/ListboxRoot.ts +376 -0
- package/src/primitives/listbox/context.ts +62 -0
- package/src/primitives/listbox/index.ts +17 -0
- package/src/primitives/menu/LICENSE +44 -0
- package/src/primitives/menu/MenuContentImpl.ts +304 -0
- package/src/primitives/menu/MenuItem.ts +495 -0
- package/src/primitives/menu/MenuRoot.ts +295 -0
- package/src/primitives/menu/context.ts +72 -0
- package/src/primitives/menu/index.ts +26 -0
- package/src/primitives/menu/wrap.ts +53 -0
- package/src/primitives/menubar/index.ts +494 -0
- package/src/primitives/navigation-menu/LICENSE +44 -0
- package/src/primitives/navigation-menu/NavigationMenuContent.ts +375 -0
- package/src/primitives/navigation-menu/NavigationMenuParts.ts +432 -0
- package/src/primitives/navigation-menu/NavigationMenuRoot.ts +260 -0
- package/src/primitives/navigation-menu/context.ts +50 -0
- package/src/primitives/navigation-menu/index.ts +20 -0
- package/src/primitives/number-field/__snapshots__/NumberField.test.ts.snap +288 -0
- package/src/primitives/picker/LICENSE +44 -0
- package/src/primitives/picker/createPicker.ts +618 -0
- package/src/primitives/picker/index.ts +26 -0
- package/src/primitives/popover/LICENSE +44 -0
- package/src/primitives/popover/PopoverContent.ts +243 -0
- package/src/primitives/popover/PopoverParts.ts +143 -0
- package/src/primitives/popover/PopoverRoot.ts +58 -0
- package/src/primitives/popover/context.ts +16 -0
- package/src/primitives/popover/index.ts +14 -0
- package/src/primitives/popper/Arrow.ts +49 -0
- package/src/primitives/popper/LICENSE +44 -0
- package/src/primitives/popper/PopperAnchor.ts +33 -0
- package/src/primitives/popper/PopperArrow.ts +77 -0
- package/src/primitives/popper/PopperContent.ts +262 -0
- package/src/primitives/popper/PopperRoot.ts +16 -0
- package/src/primitives/popper/context.ts +23 -0
- package/src/primitives/popper/index.ts +11 -0
- package/src/primitives/range-calendar/LICENSE +44 -0
- package/src/primitives/range-calendar/RangeCalendarCellTrigger.ts +241 -0
- package/src/primitives/range-calendar/RangeCalendarGrid.ts +90 -0
- package/src/primitives/range-calendar/RangeCalendarRoot.ts +413 -0
- package/src/primitives/range-calendar/context.ts +71 -0
- package/src/primitives/range-calendar/index.ts +21 -0
- package/src/primitives/select/LICENSE +44 -0
- package/src/primitives/select/SelectContent.ts +330 -0
- package/src/primitives/select/SelectItem.ts +204 -0
- package/src/primitives/select/SelectRoot.ts +408 -0
- package/src/primitives/select/context.ts +74 -0
- package/src/primitives/select/index.ts +17 -0
- package/src/primitives/tags-input/LICENSE +44 -0
- package/src/primitives/tags-input/TagsInputInput.ts +148 -0
- package/src/primitives/tags-input/TagsInputItem.ts +105 -0
- package/src/primitives/tags-input/TagsInputRoot.ts +215 -0
- package/src/primitives/tags-input/context.ts +36 -0
- package/src/primitives/tags-input/index.ts +9 -0
- package/src/primitives/teleport/LICENSE +44 -0
- package/src/primitives/teleport/Teleport.ts +41 -0
- package/src/primitives/teleport/index.ts +1 -0
- package/src/primitives/time-field/LICENSE +44 -0
- package/src/primitives/time-field/TimeFieldInput.ts +29 -0
- package/src/primitives/time-field/TimeFieldRoot.ts +379 -0
- package/src/primitives/time-field/context.ts +28 -0
- package/src/primitives/time-field/index.ts +4 -0
- package/src/primitives/toast/LICENSE +44 -0
- package/src/primitives/toast/ToastProvider.ts +311 -0
- package/src/primitives/toast/ToastRoot.ts +518 -0
- package/src/primitives/toast/index.ts +16 -0
- package/src/primitives/tooltip/LICENSE +44 -0
- package/src/primitives/tooltip/TooltipParts.ts +351 -0
- package/src/primitives/tooltip/TooltipRoot.ts +170 -0
- package/src/primitives/tooltip/context.ts +39 -0
- package/src/primitives/tooltip/index.ts +9 -0
- package/src/primitives/tree/LICENSE +44 -0
- package/src/primitives/tree/TreeItem.ts +256 -0
- package/src/primitives/tree/TreeRoot.ts +273 -0
- package/src/primitives/tree/context.ts +34 -0
- package/src/primitives/tree/index.ts +4 -0
- package/src/primitives/utils/config.ts +19 -1
- package/src/primitives/utils/defu.ts +26 -0
- package/src/primitives/utils/env.ts +5 -0
- package/src/primitives/utils/layers.ts +4 -0
- package/src/primitives/utils/propsWithoutDefaults.ts +8 -0
- package/src/primitives/utils/useBodyScrollLock.ts +29 -0
- package/src/primitives/utils/useFocusGuards.ts +10 -0
- package/src/primitives/utils/useGraceArea.ts +85 -0
- package/src/primitives/utils/useHideOthers.ts +18 -0
- package/src/primitives/utils/useIsUsingKeyboard.ts +25 -0
- package/src/primitives/utils/useLocale.ts +7 -0
- package/src/primitives/utils/useVModel.ts +8 -3
- package/src/singletons.ts +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { isPointInPolygon, type Polygon } from '../grace-area'
|
|
2
|
+
|
|
3
|
+
export type CheckedState = boolean | 'indeterminate'
|
|
4
|
+
export type MenuDirection = 'ltr' | 'rtl'
|
|
5
|
+
export type GraceSide = 'left' | 'right'
|
|
6
|
+
|
|
7
|
+
export interface GraceIntent {
|
|
8
|
+
area: Polygon
|
|
9
|
+
side: GraceSide
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ITEM_SELECT = 'menu.itemSelect'
|
|
13
|
+
export const SELECTION_KEYS = ['Enter', ' ']
|
|
14
|
+
export const FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home']
|
|
15
|
+
export const LAST_KEYS = ['ArrowUp', 'PageDown', 'End']
|
|
16
|
+
export const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]
|
|
17
|
+
export const SUB_OPEN_KEYS: Record<MenuDirection, string[]> = {
|
|
18
|
+
ltr: [...SELECTION_KEYS, 'ArrowRight'],
|
|
19
|
+
rtl: [...SELECTION_KEYS, 'ArrowLeft'],
|
|
20
|
+
}
|
|
21
|
+
export const SUB_CLOSE_KEYS: Record<MenuDirection, string[]> = {
|
|
22
|
+
ltr: ['ArrowLeft'],
|
|
23
|
+
rtl: ['ArrowRight'],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getOpenState(open: boolean) {
|
|
27
|
+
return open ? 'open' : 'closed'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {
|
|
31
|
+
return checked === 'indeterminate'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function getCheckedState(checked: CheckedState) {
|
|
35
|
+
return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function isPointerInGraceArea(event: { clientX: number; clientY: number }, area?: Polygon) {
|
|
39
|
+
if (!area) return false
|
|
40
|
+
return isPointInPolygon({ x: event.clientX, y: event.clientY }, area)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isMouseEvent(event: { pointerType: string }) {
|
|
44
|
+
return event.pointerType === 'mouse'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function submenuGraceIntent(
|
|
48
|
+
event: { clientX: number; clientY: number },
|
|
49
|
+
contentRect: { left: number; right: number; top: number; bottom: number },
|
|
50
|
+
side: GraceSide,
|
|
51
|
+
): GraceIntent {
|
|
52
|
+
const rightSide = side === 'right'
|
|
53
|
+
const bleed = rightSide ? -5 : +5
|
|
54
|
+
const contentNearEdge = contentRect[rightSide ? 'left' : 'right']
|
|
55
|
+
const contentFarEdge = contentRect[rightSide ? 'right' : 'left']
|
|
56
|
+
return {
|
|
57
|
+
area: [
|
|
58
|
+
{ x: event.clientX + bleed, y: event.clientY },
|
|
59
|
+
{ x: contentNearEdge, y: contentRect.top },
|
|
60
|
+
{ x: contentFarEdge, y: contentRect.top },
|
|
61
|
+
{ x: contentFarEdge, y: contentRect.bottom },
|
|
62
|
+
{ x: contentNearEdge, y: contentRect.bottom },
|
|
63
|
+
],
|
|
64
|
+
side,
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -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 Radix UI:
|
|
24
|
+
MIT License
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2022 WorkOS
|
|
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,125 @@
|
|
|
1
|
+
import { getActiveElement } from '../focus-scope'
|
|
2
|
+
|
|
3
|
+
export type NavigationMenuAlign = 'start' | 'center' | 'end'
|
|
4
|
+
|
|
5
|
+
export function getOpenState(open: boolean) {
|
|
6
|
+
return open ? 'open' : 'closed'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function makeTriggerId(baseId: string, value: string) {
|
|
10
|
+
return `${baseId}-trigger-${value}`
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function makeContentId(baseId: string, value: string) {
|
|
14
|
+
return `${baseId}-content-${value}`
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const LINK_SELECT = 'navigationMenu.linkSelect'
|
|
18
|
+
export const EVENT_ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss'
|
|
19
|
+
|
|
20
|
+
export function getTabbableCandidates(container: HTMLElement) {
|
|
21
|
+
const nodes: HTMLElement[] = []
|
|
22
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
23
|
+
acceptNode: node => {
|
|
24
|
+
const element = node as HTMLElement & { disabled?: boolean; type?: string }
|
|
25
|
+
const isHiddenInput = element.tagName === 'INPUT' && element.type === 'hidden'
|
|
26
|
+
if (element.disabled || element.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP
|
|
27
|
+
return element.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement)
|
|
31
|
+
return nodes
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function focusFirst(candidates: HTMLElement[]) {
|
|
35
|
+
const previouslyFocusedElement = getActiveElement()
|
|
36
|
+
return candidates.some(candidate => {
|
|
37
|
+
if (candidate === previouslyFocusedElement) return true
|
|
38
|
+
candidate.focus()
|
|
39
|
+
return getActiveElement() !== previouslyFocusedElement
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function removeFromTabOrder(candidates: HTMLElement[]) {
|
|
44
|
+
candidates.forEach(candidate => {
|
|
45
|
+
candidate.dataset.tabindex = candidate.getAttribute('tabindex') || ''
|
|
46
|
+
candidate.setAttribute('tabindex', '-1')
|
|
47
|
+
})
|
|
48
|
+
return () => {
|
|
49
|
+
candidates.forEach(candidate => {
|
|
50
|
+
const prevTabIndex = candidate.dataset.tabindex
|
|
51
|
+
candidate.setAttribute('tabindex', prevTabIndex!)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function whenMouse<E extends PointerEvent>(handler: (event: E) => void) {
|
|
57
|
+
return (event: E) => (event.pointerType === 'mouse' ? handler(event) : undefined)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface MotionState {
|
|
61
|
+
triggers: HTMLElement[]
|
|
62
|
+
dir: 'ltr' | 'rtl'
|
|
63
|
+
modelValue: string
|
|
64
|
+
previousValue: string
|
|
65
|
+
value: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getMotionAttribute(state: MotionState) {
|
|
69
|
+
const values = state.triggers.map(node => node.id.split('trigger-')[1])
|
|
70
|
+
if (state.dir === 'rtl') values.reverse()
|
|
71
|
+
const index = values.indexOf(state.modelValue)
|
|
72
|
+
const prevIndex = values.indexOf(state.previousValue)
|
|
73
|
+
const isSelected = state.value === state.modelValue
|
|
74
|
+
const wasSelected = prevIndex === values.indexOf(state.value)
|
|
75
|
+
if (!isSelected && !wasSelected) return undefined
|
|
76
|
+
if (index !== prevIndex) {
|
|
77
|
+
if (isSelected && prevIndex !== -1) return index > prevIndex ? 'from-end' : 'from-start'
|
|
78
|
+
if (wasSelected && index !== -1) return index > prevIndex ? 'to-start' : 'to-end'
|
|
79
|
+
}
|
|
80
|
+
return null
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function getViewportPosition(
|
|
84
|
+
root: HTMLElement,
|
|
85
|
+
trigger: HTMLElement,
|
|
86
|
+
content: HTMLElement,
|
|
87
|
+
align: NavigationMenuAlign | string | undefined,
|
|
88
|
+
) {
|
|
89
|
+
const bodyWidth = document.documentElement.offsetWidth
|
|
90
|
+
const bodyHeight = document.documentElement.offsetHeight
|
|
91
|
+
const rootRect = root.getBoundingClientRect()
|
|
92
|
+
const rect = trigger.getBoundingClientRect()
|
|
93
|
+
const { offsetWidth, offsetHeight } = content
|
|
94
|
+
const startPositionLeft = rect.left - rootRect.left
|
|
95
|
+
const startPositionTop = rect.top - rootRect.top
|
|
96
|
+
let posLeft: number
|
|
97
|
+
let posTop: number
|
|
98
|
+
switch (align) {
|
|
99
|
+
case 'start':
|
|
100
|
+
posLeft = startPositionLeft
|
|
101
|
+
posTop = startPositionTop
|
|
102
|
+
break
|
|
103
|
+
case 'end':
|
|
104
|
+
posLeft = startPositionLeft - offsetWidth + rect.width
|
|
105
|
+
posTop = startPositionTop - offsetHeight + rect.height
|
|
106
|
+
break
|
|
107
|
+
default:
|
|
108
|
+
posLeft = startPositionLeft - offsetWidth / 2 + rect.width / 2
|
|
109
|
+
posTop = startPositionTop - offsetHeight / 2 + rect.height / 2
|
|
110
|
+
}
|
|
111
|
+
const screenOffset = 10
|
|
112
|
+
if (posLeft + rootRect.left < screenOffset) posLeft = screenOffset - rootRect.left
|
|
113
|
+
const rightOffset = posLeft + rootRect.left + offsetWidth
|
|
114
|
+
if (rightOffset > bodyWidth - screenOffset) {
|
|
115
|
+
posLeft -= rightOffset - bodyWidth + screenOffset
|
|
116
|
+
if (posLeft < screenOffset - rootRect.left) posLeft = screenOffset - rootRect.left
|
|
117
|
+
}
|
|
118
|
+
if (posTop + rootRect.top < screenOffset) posTop = screenOffset - rootRect.top
|
|
119
|
+
const bottomOffset = posTop + rootRect.top + offsetHeight
|
|
120
|
+
if (bottomOffset > bodyHeight - screenOffset) {
|
|
121
|
+
posTop -= bottomOffset - bodyHeight + screenOffset
|
|
122
|
+
if (posTop < screenOffset - rootRect.top) posTop = screenOffset - rootRect.top
|
|
123
|
+
}
|
|
124
|
+
return { left: Math.round(posLeft), top: Math.round(posTop) }
|
|
125
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrow,
|
|
3
|
+
flip,
|
|
4
|
+
hide,
|
|
5
|
+
limitShift,
|
|
6
|
+
offset,
|
|
7
|
+
shift,
|
|
8
|
+
size,
|
|
9
|
+
type Boundary,
|
|
10
|
+
type Middleware,
|
|
11
|
+
type MiddlewareData,
|
|
12
|
+
type Padding,
|
|
13
|
+
type Placement,
|
|
14
|
+
} from '@floating-ui/dom'
|
|
15
|
+
|
|
16
|
+
const SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const
|
|
17
|
+
const ALIGN_OPTIONS = ['start', 'center', 'end'] as const
|
|
18
|
+
|
|
19
|
+
export type Side = (typeof SIDE_OPTIONS)[number]
|
|
20
|
+
export type Align = (typeof ALIGN_OPTIONS)[number]
|
|
21
|
+
export type Direction = 'ltr' | 'rtl'
|
|
22
|
+
|
|
23
|
+
export function isNotNull<T>(value: T | null): value is T {
|
|
24
|
+
return value !== null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function transformOrigin(options: {
|
|
28
|
+
arrowWidth: number
|
|
29
|
+
arrowHeight: number
|
|
30
|
+
dir?: Direction
|
|
31
|
+
}): Middleware {
|
|
32
|
+
return {
|
|
33
|
+
name: 'transformOrigin',
|
|
34
|
+
options,
|
|
35
|
+
fn(data) {
|
|
36
|
+
const { placement, rects, middlewareData } = data
|
|
37
|
+
|
|
38
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0
|
|
39
|
+
const isArrowHidden = cannotCenterArrow
|
|
40
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth
|
|
41
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight
|
|
42
|
+
|
|
43
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement)
|
|
44
|
+
const noArrowAlignX = {
|
|
45
|
+
start: options.dir === 'rtl' ? '100%' : '0%',
|
|
46
|
+
center: '50%',
|
|
47
|
+
end: options.dir === 'rtl' ? '0%' : '100%',
|
|
48
|
+
}[placedAlign]
|
|
49
|
+
|
|
50
|
+
const noArrowAlignY = {
|
|
51
|
+
start: '0%',
|
|
52
|
+
center: '50%',
|
|
53
|
+
end: '100%',
|
|
54
|
+
}[placedAlign]
|
|
55
|
+
|
|
56
|
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2
|
|
57
|
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2
|
|
58
|
+
|
|
59
|
+
let x = ''
|
|
60
|
+
let y = ''
|
|
61
|
+
|
|
62
|
+
if (placedSide === 'bottom') {
|
|
63
|
+
x = isArrowHidden ? noArrowAlignX : `${arrowXCenter}px`
|
|
64
|
+
y = `${-arrowHeight}px`
|
|
65
|
+
} else if (placedSide === 'top') {
|
|
66
|
+
x = isArrowHidden ? noArrowAlignX : `${arrowXCenter}px`
|
|
67
|
+
y = `${rects.floating.height + arrowHeight}px`
|
|
68
|
+
} else if (placedSide === 'right') {
|
|
69
|
+
x = `${-arrowHeight}px`
|
|
70
|
+
y = isArrowHidden ? noArrowAlignY : `${arrowYCenter}px`
|
|
71
|
+
} else if (placedSide === 'left') {
|
|
72
|
+
x = `${rects.floating.width + arrowHeight}px`
|
|
73
|
+
y = isArrowHidden ? noArrowAlignY : `${arrowYCenter}px`
|
|
74
|
+
}
|
|
75
|
+
return { data: { x, y } }
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function getSideAndAlignFromPlacement(placement: Placement) {
|
|
81
|
+
const [side, align = 'center'] = placement.split('-')
|
|
82
|
+
return [side as Side, align as Align] as const
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type PopperSticky = 'partial' | 'always'
|
|
86
|
+
export type PopperStrategy = 'absolute' | 'fixed'
|
|
87
|
+
export type PopperUpdateStrategy = 'optimized' | 'always'
|
|
88
|
+
|
|
89
|
+
export const POPPER_CONTENT_DEFAULTS = {
|
|
90
|
+
side: 'bottom' as Side,
|
|
91
|
+
sideOffset: 0,
|
|
92
|
+
sideFlip: true,
|
|
93
|
+
align: 'center' as Align,
|
|
94
|
+
alignOffset: 0,
|
|
95
|
+
alignFlip: true,
|
|
96
|
+
arrowPadding: 0,
|
|
97
|
+
hideShiftedArrow: true,
|
|
98
|
+
avoidCollisions: true,
|
|
99
|
+
collisionBoundary: () => [] as Element[],
|
|
100
|
+
collisionPadding: 0,
|
|
101
|
+
sticky: 'partial' as PopperSticky,
|
|
102
|
+
hideWhenDetached: false,
|
|
103
|
+
positionStrategy: 'fixed' as PopperStrategy,
|
|
104
|
+
updatePositionStrategy: 'optimized' as PopperUpdateStrategy,
|
|
105
|
+
prioritizePosition: false,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function popperPlacement(side: Side, align: Align) {
|
|
109
|
+
return (side + (align !== 'center' ? `-${align}` : '')) as Placement
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface PopperMiddlewareOptions {
|
|
113
|
+
sideOffset: number
|
|
114
|
+
alignOffset: number
|
|
115
|
+
sideFlip: boolean
|
|
116
|
+
alignFlip: boolean
|
|
117
|
+
avoidCollisions: boolean
|
|
118
|
+
prioritizePosition: boolean
|
|
119
|
+
sticky: PopperSticky
|
|
120
|
+
collisionPadding: number | Partial<Record<Side, number>>
|
|
121
|
+
collisionBoundary: Element | null | Array<Element | null>
|
|
122
|
+
arrow: HTMLElement | null | undefined
|
|
123
|
+
arrowWidth: number
|
|
124
|
+
arrowHeight: number
|
|
125
|
+
arrowPadding: number
|
|
126
|
+
hideWhenDetached: boolean
|
|
127
|
+
dir: Direction
|
|
128
|
+
prefix: 'reka' | 'radix'
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function popperMiddleware(options: PopperMiddlewareOptions) {
|
|
132
|
+
const padding: Padding =
|
|
133
|
+
typeof options.collisionPadding === 'number'
|
|
134
|
+
? options.collisionPadding
|
|
135
|
+
: { top: 0, right: 0, bottom: 0, left: 0, ...options.collisionPadding }
|
|
136
|
+
const boundary = Array.isArray(options.collisionBoundary)
|
|
137
|
+
? options.collisionBoundary
|
|
138
|
+
: [options.collisionBoundary]
|
|
139
|
+
const detectOverflowOptions = {
|
|
140
|
+
padding,
|
|
141
|
+
boundary: boundary.filter(isNotNull) as Boundary,
|
|
142
|
+
altBoundary: boundary.length > 0,
|
|
143
|
+
}
|
|
144
|
+
const flipOptions = { mainAxis: options.sideFlip, crossAxis: options.alignFlip }
|
|
145
|
+
const { prefix } = options
|
|
146
|
+
return [
|
|
147
|
+
offset({
|
|
148
|
+
mainAxis: options.sideOffset + options.arrowHeight,
|
|
149
|
+
alignmentAxis: options.alignOffset,
|
|
150
|
+
}),
|
|
151
|
+
options.prioritizePosition &&
|
|
152
|
+
options.avoidCollisions &&
|
|
153
|
+
flip({ ...detectOverflowOptions, ...flipOptions }),
|
|
154
|
+
options.avoidCollisions &&
|
|
155
|
+
shift({
|
|
156
|
+
mainAxis: true,
|
|
157
|
+
crossAxis: !!options.prioritizePosition,
|
|
158
|
+
limiter: options.sticky === 'partial' ? limitShift() : undefined,
|
|
159
|
+
...detectOverflowOptions,
|
|
160
|
+
}),
|
|
161
|
+
!options.prioritizePosition &&
|
|
162
|
+
options.avoidCollisions &&
|
|
163
|
+
flip({ ...detectOverflowOptions, ...flipOptions }),
|
|
164
|
+
size({
|
|
165
|
+
...detectOverflowOptions,
|
|
166
|
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
167
|
+
const { width: anchorWidth, height: anchorHeight } = rects.reference
|
|
168
|
+
const contentStyle = elements.floating.style
|
|
169
|
+
contentStyle.setProperty(`--${prefix}-popper-available-width`, `${availableWidth}px`)
|
|
170
|
+
contentStyle.setProperty(`--${prefix}-popper-available-height`, `${availableHeight}px`)
|
|
171
|
+
contentStyle.setProperty(`--${prefix}-popper-anchor-width`, `${anchorWidth}px`)
|
|
172
|
+
contentStyle.setProperty(`--${prefix}-popper-anchor-height`, `${anchorHeight}px`)
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
options.arrow && arrow({ element: options.arrow, padding: options.arrowPadding }),
|
|
176
|
+
transformOrigin({
|
|
177
|
+
arrowWidth: options.arrowWidth,
|
|
178
|
+
arrowHeight: options.arrowHeight,
|
|
179
|
+
dir: options.dir,
|
|
180
|
+
}),
|
|
181
|
+
options.hideWhenDetached && hide({ strategy: 'referenceHidden', ...detectOverflowOptions }),
|
|
182
|
+
] as Middleware[]
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function popperWrapperStyle(
|
|
186
|
+
floatingStyles: object & { transform?: unknown },
|
|
187
|
+
options: {
|
|
188
|
+
isPositioned: boolean
|
|
189
|
+
zIndex: string
|
|
190
|
+
middlewareData: MiddlewareData
|
|
191
|
+
prefix: 'reka' | 'radix'
|
|
192
|
+
},
|
|
193
|
+
) {
|
|
194
|
+
const { isPositioned, zIndex, middlewareData, prefix } = options
|
|
195
|
+
return {
|
|
196
|
+
...floatingStyles,
|
|
197
|
+
transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)',
|
|
198
|
+
minWidth: 'max-content',
|
|
199
|
+
zIndex,
|
|
200
|
+
[`--${prefix}-popper-transform-origin`]: [
|
|
201
|
+
middlewareData.transformOrigin?.x,
|
|
202
|
+
middlewareData.transformOrigin?.y,
|
|
203
|
+
].join(' '),
|
|
204
|
+
...(middlewareData.hide?.referenceHidden && {
|
|
205
|
+
visibility: 'hidden',
|
|
206
|
+
pointerEvents: 'none',
|
|
207
|
+
}),
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function shouldHidePopperArrow(hideShiftedArrow: boolean, middlewareData: MiddlewareData) {
|
|
212
|
+
return hideShiftedArrow && middlewareData.arrow?.centerOffset !== 0
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export const OPPOSITE_SIDE: Record<Side, Side> = {
|
|
216
|
+
top: 'bottom',
|
|
217
|
+
right: 'left',
|
|
218
|
+
bottom: 'top',
|
|
219
|
+
left: 'right',
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export const ARROW_PATH = 'M0 0L6 6L12 0'
|
|
223
|
+
export const ROUNDED_ARROW_PATH =
|
|
224
|
+
'M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0'
|
|
225
|
+
|
|
226
|
+
export function popperArrowStyle(
|
|
227
|
+
placedSide: Side,
|
|
228
|
+
arrowX: number | undefined,
|
|
229
|
+
arrowY: number | undefined,
|
|
230
|
+
hidden: boolean,
|
|
231
|
+
) {
|
|
232
|
+
return {
|
|
233
|
+
position: 'absolute',
|
|
234
|
+
left: arrowX ? `${arrowX}px` : undefined,
|
|
235
|
+
top: arrowY ? `${arrowY}px` : undefined,
|
|
236
|
+
[OPPOSITE_SIDE[placedSide]]: 0,
|
|
237
|
+
transformOrigin: { top: '', right: '0 0', bottom: 'center 0', left: '100% 0' }[placedSide],
|
|
238
|
+
transform: {
|
|
239
|
+
top: 'translateY(100%)',
|
|
240
|
+
right: 'translateY(50%) rotate(90deg) translateX(-50%)',
|
|
241
|
+
bottom: 'rotate(180deg)',
|
|
242
|
+
left: 'translateY(50%) rotate(-90deg) translateX(50%)',
|
|
243
|
+
}[placedSide],
|
|
244
|
+
visibility: hidden ? 'hidden' : undefined,
|
|
245
|
+
} as const
|
|
246
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { compare, type Comparator } from '../listbox'
|
|
2
|
+
|
|
3
|
+
export const OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown']
|
|
4
|
+
export const SELECTION_KEYS = [' ', 'Enter']
|
|
5
|
+
export const CONTENT_MARGIN = 10
|
|
6
|
+
export const SELECT_SELECT = 'select.select'
|
|
7
|
+
|
|
8
|
+
export function isNullish(value: unknown): value is null | undefined {
|
|
9
|
+
return value === null || value === undefined
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function shouldShowPlaceholder(value: unknown) {
|
|
13
|
+
return (
|
|
14
|
+
value === undefined ||
|
|
15
|
+
value === null ||
|
|
16
|
+
value === '' ||
|
|
17
|
+
(Array.isArray(value) && value.length === 0)
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function toggleSelectValue<T>(current: unknown, value: T, by?: Comparator<T>) {
|
|
22
|
+
const array = Array.isArray(current) ? [...(current as T[])] : []
|
|
23
|
+
const index = array.findIndex(item => compare(item, value, by))
|
|
24
|
+
if (index === -1) array.push(value)
|
|
25
|
+
else array.splice(index, 1)
|
|
26
|
+
return [...array]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function selectNavigationCandidates(
|
|
30
|
+
items: HTMLElement[],
|
|
31
|
+
key: string,
|
|
32
|
+
target: EventTarget | null,
|
|
33
|
+
) {
|
|
34
|
+
if (!['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(key)) return null
|
|
35
|
+
let candidateNodes = [...items]
|
|
36
|
+
if (['ArrowUp', 'End'].includes(key)) candidateNodes = candidateNodes.slice().reverse()
|
|
37
|
+
if (['ArrowUp', 'ArrowDown'].includes(key)) {
|
|
38
|
+
const currentIndex = candidateNodes.indexOf(target as HTMLElement)
|
|
39
|
+
candidateNodes = candidateNodes.slice(currentIndex + 1)
|
|
40
|
+
}
|
|
41
|
+
return candidateNodes
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface TriggerReleaseOptions {
|
|
45
|
+
content: HTMLElement
|
|
46
|
+
origin: () => { x: number; y: number } | null | undefined
|
|
47
|
+
onOutsideRelease: () => void
|
|
48
|
+
onRelease: () => void
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function trackTriggerRelease(options: TriggerReleaseOptions) {
|
|
52
|
+
let pointerMoveDelta = { x: 0, y: 0 }
|
|
53
|
+
const handlePointerMove = (event: PointerEvent) => {
|
|
54
|
+
const origin = options.origin()
|
|
55
|
+
pointerMoveDelta = {
|
|
56
|
+
x: Math.abs(Math.round(event.pageX) - (origin?.x ?? 0)),
|
|
57
|
+
y: Math.abs(Math.round(event.pageY) - (origin?.y ?? 0)),
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const handlePointerUp = (event: PointerEvent) => {
|
|
61
|
+
if (event.pointerType === 'touch') return
|
|
62
|
+
if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) event.preventDefault()
|
|
63
|
+
else if (!options.content.contains(event.target as Node)) options.onOutsideRelease()
|
|
64
|
+
document.removeEventListener('pointermove', handlePointerMove)
|
|
65
|
+
options.onRelease()
|
|
66
|
+
}
|
|
67
|
+
if (options.origin() !== null) {
|
|
68
|
+
document.addEventListener('pointermove', handlePointerMove)
|
|
69
|
+
document.addEventListener('pointerup', handlePointerUp, { capture: true, once: true })
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
document.removeEventListener('pointermove', handlePointerMove)
|
|
73
|
+
document.removeEventListener('pointerup', handlePointerUp, { capture: true })
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function createSelectedItemTracker() {
|
|
78
|
+
let firstValidItemFound = false
|
|
79
|
+
let firstSelectedItemInArrayFound = false
|
|
80
|
+
return {
|
|
81
|
+
item(isSelected: boolean, disabled: boolean | undefined, multiple: boolean) {
|
|
82
|
+
const isFirstValidItem = !firstValidItemFound && !disabled
|
|
83
|
+
let picked = false
|
|
84
|
+
if (multiple) {
|
|
85
|
+
if (firstSelectedItemInArrayFound) return false
|
|
86
|
+
if (isSelected || isFirstValidItem) {
|
|
87
|
+
picked = true
|
|
88
|
+
if (isSelected) firstSelectedItemInArrayFound = true
|
|
89
|
+
}
|
|
90
|
+
} else if (isSelected || isFirstValidItem) picked = true
|
|
91
|
+
if (isFirstValidItem) firstValidItemFound = true
|
|
92
|
+
return picked
|
|
93
|
+
},
|
|
94
|
+
text(isSelected: boolean, disabled: boolean | undefined) {
|
|
95
|
+
return isSelected || (!firstValidItemFound && !disabled)
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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.
|