@hina-ui/vue 1.7.11 → 1.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +25614 -10189
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/css-time.ts +6 -0
- package/dist/shared/lib/line-clamp.ts +8 -8
- package/dist/shared/lib/tour.ts +261 -0
- package/dist/shared/locale/en-US.ts +8 -0
- package/dist/shared/locale/index.ts +1 -0
- package/dist/shared/locale/ja-JP.ts +9 -0
- package/dist/shared/locale/types.ts +8 -0
- package/dist/shared/locale/zh-CN.ts +8 -0
- package/dist/shared/primitives/combobox/LICENSE +44 -0
- package/dist/shared/primitives/combobox/index.ts +49 -0
- package/dist/shared/primitives/date/calendar-view.ts +264 -0
- package/dist/shared/primitives/date/calendar.ts +126 -0
- package/dist/shared/primitives/date/comparators.ts +144 -0
- package/dist/shared/primitives/date/field.ts +551 -0
- package/dist/shared/primitives/date/formatter.ts +110 -0
- package/dist/shared/primitives/date/parser.ts +182 -0
- package/dist/shared/primitives/date/parts.ts +16 -0
- package/dist/shared/primitives/date/picker-view.ts +186 -0
- package/dist/shared/primitives/date/placeholders.ts +485 -0
- package/dist/shared/primitives/date/range-calendar-view.ts +181 -0
- package/dist/shared/primitives/date/segment.ts +44 -0
- package/dist/shared/primitives/date/utils.ts +169 -0
- package/dist/shared/primitives/dialog/LICENSE +21 -0
- package/dist/shared/primitives/dialog/index.ts +73 -0
- package/dist/shared/primitives/grace-area/LICENSE +21 -0
- package/dist/shared/primitives/grace-area/index.ts +112 -0
- package/dist/shared/primitives/listbox/LICENSE +21 -0
- package/dist/shared/primitives/listbox/index.ts +213 -0
- package/dist/shared/primitives/menu/LICENSE +21 -0
- package/dist/shared/primitives/menu/index.ts +66 -0
- package/dist/shared/primitives/navigation-menu/LICENSE +44 -0
- package/dist/shared/primitives/navigation-menu/index.ts +125 -0
- package/dist/shared/primitives/pin-input/index.ts +394 -97
- package/dist/shared/primitives/popper/LICENSE +21 -0
- package/dist/shared/primitives/popper/index.ts +246 -0
- package/dist/shared/primitives/select/index.ts +98 -0
- package/dist/shared/primitives/tags-input/LICENSE +21 -0
- package/dist/shared/primitives/tags-input/index.ts +113 -0
- package/dist/shared/primitives/toast/LICENSE +44 -0
- package/dist/shared/primitives/toast/index.ts +106 -0
- package/dist/shared/primitives/tree/LICENSE +21 -0
- package/dist/shared/primitives/tree/index.ts +248 -0
- package/dist/shared/styles/interaction.css +6 -2
- package/dist/shared/styles/line-clamp.css +6 -2
- package/dist/shared/styles/pin-input.css +84 -0
- package/dist/shared/styles/tokens.css +2 -0
- package/dist/shared/styles/tour.css +29 -0
- package/dist/shared/variants/nav-link.ts +6 -2
- package/dist/shared/variants/pin-input.ts +26 -7
- package/dist/shared/variants/tour.ts +29 -0
- package/dist/types/shared/src/lib/css-time.d.ts +2 -0
- package/dist/types/shared/src/lib/css-time.d.ts.map +1 -0
- package/dist/types/shared/src/lib/line-clamp.d.ts.map +1 -1
- package/dist/types/shared/src/lib/tour.d.ts +81 -0
- package/dist/types/shared/src/lib/tour.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts +6 -0
- package/dist/types/shared/src/lib/virtual/filter.d.ts.map +1 -0
- package/dist/types/shared/src/locale/en-US.d.ts.map +1 -1
- package/dist/types/shared/src/locale/index.d.ts.map +1 -1
- package/dist/types/shared/src/locale/ja-JP.d.ts.map +1 -1
- package/dist/types/shared/src/locale/types.d.ts +8 -0
- package/dist/types/shared/src/locale/types.d.ts.map +1 -1
- package/dist/types/shared/src/locale/zh-CN.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/body-scroll-lock/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts +1 -1
- package/dist/types/shared/src/primitives/combobox/index.d.ts +9 -0
- package/dist/types/shared/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts +53 -0
- package/dist/types/shared/src/primitives/date/calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts +39 -0
- package/dist/types/shared/src/primitives/date/calendar.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts +31 -0
- package/dist/types/shared/src/primitives/date/comparators.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/field.d.ts +46 -0
- package/dist/types/shared/src/primitives/date/field.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts +20 -0
- package/dist/types/shared/src/primitives/date/formatter.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts +49 -0
- package/dist/types/shared/src/primitives/date/parser.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts +10 -0
- package/dist/types/shared/src/primitives/date/parts.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts +34 -0
- package/dist/types/shared/src/primitives/date/picker-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts +2 -0
- package/dist/types/shared/src/primitives/date/placeholders.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts +67 -0
- package/dist/types/shared/src/primitives/date/range-calendar-view.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts +6 -0
- package/dist/types/shared/src/primitives/date/segment.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts +37 -0
- package/dist/types/shared/src/primitives/date/utils.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts +32 -0
- package/dist/types/shared/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts +2 -0
- package/dist/types/shared/src/primitives/focus-guards/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts +13 -0
- package/dist/types/shared/src/primitives/grace-area/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts +55 -0
- package/dist/types/shared/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts +35 -0
- package/dist/types/shared/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts +23 -0
- package/dist/types/shared/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/pin-input/index.d.ts +35 -27
- package/dist/types/shared/src/primitives/pin-input/index.d.ts.map +1 -1
- package/dist/types/shared/src/primitives/popper/index.d.ts +83 -0
- package/dist/types/shared/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/select/index.d.ts +24 -0
- package/dist/types/shared/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts +36 -0
- package/dist/types/shared/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts +42 -0
- package/dist/types/shared/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts +72 -0
- package/dist/types/shared/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/shared/src/variants/nav-link.d.ts +2 -1
- package/dist/types/shared/src/variants/nav-link.d.ts.map +1 -1
- package/dist/types/shared/src/variants/pin-input.d.ts +30 -10
- package/dist/types/shared/src/variants/pin-input.d.ts.map +1 -1
- package/dist/types/shared/src/variants/tour.d.ts +10 -0
- package/dist/types/shared/src/variants/tour.d.ts.map +1 -0
- package/dist/types/vue/src/components/app-shell/AppShell.vue.d.ts +6 -6
- package/dist/types/vue/src/components/button/Button.vue.d.ts +1 -1
- package/dist/types/vue/src/components/button/Button.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/calendar/Calendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/carousel/composables/useCarousel.d.ts +1 -1
- package/dist/types/vue/src/components/combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts +20 -0
- package/dist/types/vue/src/components/config-provider/ConfigProvider.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts +10 -0
- package/dist/types/vue/src/components/config-provider/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts +2 -0
- package/dist/types/vue/src/components/config-provider/useConfig.d.ts.map +1 -0
- package/dist/types/vue/src/components/date-range-field/DateRangeField.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts +1 -1
- package/dist/types/vue/src/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dialog/ModalContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts +20 -8
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts +1 -1
- package/dist/types/vue/src/components/hover-card/HoverCard.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts +2 -2
- package/dist/types/vue/src/components/icon-button/IconButton.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts +1 -1
- package/dist/types/vue/src/components/image/Image.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/image/composables/useImage.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/menubar/MenubarSub.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/month-grid/MonthGrid.vue.d.ts +1 -1
- package/dist/types/vue/src/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts +5 -10
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts +8 -0
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts +2 -2
- package/dist/types/vue/src/components/navigation-menu/NavigationMenu.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuContent.vue.d.ts +6 -6
- package/dist/types/vue/src/components/pagination/composables/usePaginationWindow.d.ts +6 -6
- package/dist/types/vue/src/components/pin-input/PinInput.vue.d.ts +2 -0
- package/dist/types/vue/src/components/pin-input/PinInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popconfirm/Popconfirm.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/Popover.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts +9 -9
- package/dist/types/vue/src/components/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/range-calendar/RangeCalendar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-slider/RangeSlider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts +1 -1
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/select/Select.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts +1 -1
- package/dist/types/vue/src/components/sheet/Sheet.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/Slider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/split-button/SplitButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tags-input/TagsInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/Toolbar.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarControl.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts +34 -0
- package/dist/types/vue/src/components/tour/Tour.vue.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts +2 -0
- package/dist/types/vue/src/components/tour/tour.variants.d.ts.map +1 -0
- package/dist/types/vue/src/components/tour/types.d.ts +33 -0
- package/dist/types/vue/src/components/tour/types.d.ts.map +1 -0
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/TreeRows.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts +1 -1
- package/dist/types/vue/src/components/tree/VirtualTreeWindow.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +7 -7
- package/dist/types/vue/src/index.d.ts +5 -0
- package/dist/types/vue/src/index.d.ts.map +1 -1
- package/dist/types/vue/src/lib/anchored-overlay.d.ts +11 -5
- package/dist/types/vue/src/lib/anchored-overlay.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts +6 -6
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts.map +1 -1
- package/dist/types/vue/src/lib/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts +133 -0
- package/dist/types/vue/src/primitives/alert-dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/calendar/CalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts +227 -0
- package/dist/types/vue/src/primitives/calendar/CalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts +140 -0
- package/dist/types/vue/src/primitives/calendar/CalendarNav.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts +313 -0
- package/dist/types/vue/src/primitives/calendar/CalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts +48 -0
- package/dist/types/vue/src/primitives/calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts +65 -0
- package/dist/types/vue/src/primitives/calendar/useCalendar.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts +273 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts +166 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts +376 -0
- package/dist/types/vue/src/primitives/combobox/ComboboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts +68 -0
- package/dist/types/vue/src/primitives/combobox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/combobox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts +949 -0
- package/dist/types/vue/src/primitives/context-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/date-field/DateFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts +26 -0
- package/dist/types/vue/src/primitives/date-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts +36 -0
- package/dist/types/vue/src/primitives/date-field/segmentInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts +32 -0
- package/dist/types/vue/src/primitives/date-field/useDateFieldSegment.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts +51 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts +221 -0
- package/dist/types/vue/src/primitives/date-range-field/DateRangeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts +31 -0
- package/dist/types/vue/src/primitives/date-range-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/date-range-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts +54 -0
- package/dist/types/vue/src/primitives/dialog/DialogContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts +65 -0
- package/dist/types/vue/src/primitives/dialog/DialogContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts +40 -0
- package/dist/types/vue/src/primitives/dialog/DialogOverlay.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts +49 -0
- package/dist/types/vue/src/primitives/dialog/DialogPortal.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts +62 -0
- package/dist/types/vue/src/primitives/dialog/DialogRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts +85 -0
- package/dist/types/vue/src/primitives/dialog/DialogText.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/dialog/DialogTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/dialog/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts +8 -0
- package/dist/types/vue/src/primitives/dialog/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts +76 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayer.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts +26 -0
- package/dist/types/vue/src/primitives/dismissable-layer/DismissableLayerBranch.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/dismissable-layer/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts +1033 -0
- package/dist/types/vue/src/primitives/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts +72 -0
- package/dist/types/vue/src/primitives/focus-scope/FocusScope.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/focus-scope/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts +442 -0
- package/dist/types/vue/src/primitives/hover-card/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts +30 -0
- package/dist/types/vue/src/primitives/listbox/ListboxContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts +67 -0
- package/dist/types/vue/src/primitives/listbox/ListboxFilter.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts +82 -0
- package/dist/types/vue/src/primitives/listbox/ListboxGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts +58 -0
- package/dist/types/vue/src/primitives/listbox/ListboxItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/{pin-input/PinInputRoot.d.ts → listbox/ListboxRoot.d.ts} +60 -53
- package/dist/types/vue/src/primitives/listbox/ListboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts +49 -0
- package/dist/types/vue/src/primitives/listbox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/listbox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts +394 -0
- package/dist/types/vue/src/primitives/menu/MenuContentImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts +396 -0
- package/dist/types/vue/src/primitives/menu/MenuItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts +746 -0
- package/dist/types/vue/src/primitives/menu/MenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts +74 -0
- package/dist/types/vue/src/primitives/menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts +14 -0
- package/dist/types/vue/src/primitives/menu/wrap.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts +1036 -0
- package/dist/types/vue/src/primitives/menubar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts +101 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts +165 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts +187 -0
- package/dist/types/vue/src/primitives/navigation-menu/NavigationMenuRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts +40 -0
- package/dist/types/vue/src/primitives/navigation-menu/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/navigation-menu/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts +247 -0
- package/dist/types/vue/src/primitives/picker/createPicker.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts +414 -0
- package/dist/types/vue/src/primitives/picker/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts +257 -0
- package/dist/types/vue/src/primitives/popover/PopoverContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts +183 -0
- package/dist/types/vue/src/primitives/popover/PopoverParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/popover/PopoverRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts +13 -0
- package/dist/types/vue/src/primitives/popover/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/popover/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts +67 -0
- package/dist/types/vue/src/primitives/popper/Arrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts +40 -0
- package/dist/types/vue/src/primitives/popper/PopperAnchor.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts +61 -0
- package/dist/types/vue/src/primitives/popper/PopperArrow.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts +370 -0
- package/dist/types/vue/src/primitives/popper/PopperContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts +4 -0
- package/dist/types/vue/src/primitives/popper/PopperRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts +17 -0
- package/dist/types/vue/src/primitives/popper/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/popper/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts +52 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarCellTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts +252 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarGrid.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts +345 -0
- package/dist/types/vue/src/primitives/range-calendar/RangeCalendarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts +64 -0
- package/dist/types/vue/src/primitives/range-calendar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/range-calendar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts +3 -3
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts +265 -0
- package/dist/types/vue/src/primitives/select/SelectContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts +107 -0
- package/dist/types/vue/src/primitives/select/SelectItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts +275 -0
- package/dist/types/vue/src/primitives/select/SelectRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/context.d.ts +73 -0
- package/dist/types/vue/src/primitives/select/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/select/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/select/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/{pin-input/PinInputInput.d.ts → tags-input/TagsInputInput.d.ts} +23 -14
- package/dist/types/vue/src/primitives/tags-input/TagsInputInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts +76 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts +196 -0
- package/dist/types/vue/src/primitives/tags-input/TagsInputRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts +30 -0
- package/dist/types/vue/src/primitives/tags-input/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tags-input/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts +49 -0
- package/dist/types/vue/src/primitives/teleport/Teleport.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/teleport/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts +40 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts +220 -0
- package/dist/types/vue/src/primitives/time-field/TimeFieldRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts +25 -0
- package/dist/types/vue/src/primitives/time-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/time-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts +177 -0
- package/dist/types/vue/src/primitives/toast/ToastProvider.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts +233 -0
- package/dist/types/vue/src/primitives/toast/ToastRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts +1 -1
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts +267 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts +162 -0
- package/dist/types/vue/src/primitives/tooltip/TooltipRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts +32 -0
- package/dist/types/vue/src/primitives/tooltip/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/tooltip/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts +40 -0
- package/dist/types/vue/src/primitives/tree/TreeItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts +50 -0
- package/dist/types/vue/src/primitives/tree/TreeRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts +29 -0
- package/dist/types/vue/src/primitives/tree/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/tree/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts +14 -1
- package/dist/types/vue/src/primitives/utils/config.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/defu.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/defu.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/env.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts +5 -0
- package/dist/types/vue/src/primitives/utils/layers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/propsWithoutDefaults.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useBodyScrollLock.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts +1 -1
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useFocusGuards.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/useGraceArea.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useHideOthers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useIsUsingKeyboard.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useLocale.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts +1 -1
- package/dist/types/vue/src/singletons.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/alert-dialog/AlertDialog.vue +1 -1
- package/src/components/calendar/Calendar.vue +1 -1
- package/src/components/calendar/CalendarLevels.vue +1 -1
- package/src/components/combobox/Combobox.vue +6 -1
- package/src/components/combobox/ComboboxList.vue +1 -1
- package/src/components/command-palette/CommandPalette.vue +2 -2
- package/src/components/command-palette/CommandPaletteInput.vue +1 -1
- package/src/components/command-palette/CommandPaletteItem.vue +1 -1
- package/src/components/command-palette/CommandPalettePanel.vue +6 -1
- package/src/components/config-provider/ConfigProvider.vue +24 -0
- package/src/components/config-provider/types.ts +11 -0
- package/src/components/config-provider/useConfig.ts +5 -0
- package/src/components/context-menu/ContextMenu.vue +1 -1
- package/src/components/context-menu/ContextMenuCheckboxItem.vue +1 -1
- package/src/components/context-menu/ContextMenuGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuItem.vue +1 -1
- package/src/components/context-menu/ContextMenuLabel.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioGroup.vue +1 -1
- package/src/components/context-menu/ContextMenuRadioItem.vue +1 -1
- package/src/components/context-menu/ContextMenuSeparator.vue +1 -1
- package/src/components/context-menu/ContextMenuSub.vue +1 -1
- package/src/components/data-table/DataTableDragPreview.vue +1 -1
- package/src/components/date-field/DateField.vue +1 -1
- package/src/components/date-picker/DatePicker.vue +1 -1
- package/src/components/date-range-field/DateRangeField.vue +5 -1
- package/src/components/date-range-picker/DateRangePicker.vue +1 -1
- package/src/components/date-time-picker/DateTimePicker.vue +1 -1
- package/src/components/dialog/Dialog.vue +1 -1
- package/src/components/dialog/ModalContent.vue +2 -1
- package/src/components/drawer/Drawer.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenu.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue +4 -1
- package/src/components/dropdown-menu/DropdownMenuGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuLabel.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSeparator.vue +1 -1
- package/src/components/dropdown-menu/DropdownMenuSub.vue +1 -1
- package/src/components/hover-card/HoverCard.vue +6 -1
- package/src/components/hover-card/composables/useHoverCardAnchor.ts +1 -1
- package/src/components/icon-button/IconButton.vue +1 -1
- package/src/components/image/composables/useImage.ts +2 -1
- package/src/components/lightbox/Lightbox.vue +2 -1
- package/src/components/lightbox/LightboxChrome.vue +1 -1
- package/src/components/listbox/Listbox.vue +1 -1
- package/src/components/listbox/ListboxOptionContent.vue +1 -1
- package/src/components/menubar/Menubar.vue +1 -1
- package/src/components/menubar/MenubarCheckboxItem.vue +1 -1
- package/src/components/menubar/MenubarGroup.vue +1 -1
- package/src/components/menubar/MenubarItem.vue +1 -1
- package/src/components/menubar/MenubarLabel.vue +1 -1
- package/src/components/menubar/MenubarMenu.vue +6 -1
- package/src/components/menubar/MenubarRadioGroup.vue +1 -1
- package/src/components/menubar/MenubarRadioItem.vue +1 -1
- package/src/components/menubar/MenubarSeparator.vue +1 -1
- package/src/components/menubar/MenubarSub.vue +6 -1
- package/src/components/multi-combobox/MultiCombobox.vue +6 -1
- package/src/components/multi-select/MultiSelect.vue +1 -1
- package/src/components/nav-link/NavLink.vue +21 -2
- package/src/components/nav-link/NavLinkChild.ts +2 -0
- package/src/components/navigation-menu/NavigationMenu.vue +5 -1
- package/src/components/navigation-menu/NavigationMenuContent.vue +2 -2
- package/src/components/navigation-menu/NavigationMenuItem.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/navigation-menu/NavigationMenuTrigger.vue +1 -1
- package/src/components/number-input/NumberInput.vue +1 -1
- package/src/components/pagination/PaginationPopup.vue +1 -1
- package/src/components/pin-input/PinInput.vue +103 -33
- package/src/components/popconfirm/Popconfirm.vue +6 -1
- package/src/components/popover/Popover.vue +6 -1
- package/src/components/popover/PopoverContent.vue +2 -2
- package/src/components/popover/composables/usePopoverCloseFocus.ts +1 -1
- package/src/components/range-calendar/RangeCalendar.vue +1 -1
- package/src/components/select/Select.vue +2 -1
- package/src/components/select/SelectList.vue +1 -1
- package/src/components/sheet/Sheet.vue +1 -1
- package/src/components/slider/SliderHandle.vue +1 -1
- package/src/components/tags-input/TagsInput.vue +1 -1
- package/src/components/tags-input/TagsInputChip.vue +1 -1
- package/src/components/time/Time.vue +1 -1
- package/src/components/time-field/TimeField.vue +1 -1
- package/src/components/toast/Toaster.vue +1 -1
- package/src/components/toggle/Toggle.vue +1 -1
- package/src/components/toolbar/ToolbarControl.vue +1 -1
- package/src/components/tooltip/Tooltip.vue +1 -1
- package/src/components/tooltip/TooltipBubble.vue +1 -1
- package/src/components/tooltip/TooltipDirectiveRoot.ts +1 -1
- package/src/components/tooltip/TooltipProvider.vue +1 -1
- package/src/components/tooltip/composables/useTooltipTarget.ts +1 -1
- package/src/components/tour/Tour.vue +447 -0
- package/src/components/tour/tour.variants.ts +1 -0
- package/src/components/tour/types.ts +43 -0
- package/src/components/tree/Tree.vue +1 -1
- package/src/components/tree/TreeRows.vue +1 -1
- package/src/components/tree/VirtualTreeWindow.vue +1 -1
- package/src/components/tree-select/TreeSelect.vue +2 -3
- package/src/components/tree-select/composables/useTreeSelect.ts +2 -2
- package/src/index.ts +15 -0
- package/src/lib/anchored-overlay.ts +2 -1
- package/src/lib/dialog-focus.ts +1 -1
- package/src/lib/reka/useVirtualChoices.ts +7 -8
- package/src/lib/reka/useVirtualTree.ts +1 -1
- package/src/primitives/alert-dialog/index.ts +166 -0
- package/src/primitives/calendar/CalendarCellTrigger.ts +190 -0
- package/src/primitives/calendar/CalendarGrid.ts +101 -0
- package/src/primitives/calendar/CalendarNav.ts +88 -0
- package/src/primitives/calendar/CalendarRoot.ts +324 -0
- package/src/primitives/calendar/LICENSE +44 -0
- package/src/primitives/calendar/context.ts +55 -0
- package/src/primitives/calendar/index.ts +12 -0
- package/src/primitives/calendar/useCalendar.ts +164 -0
- package/src/primitives/combobox/ComboboxContent.ts +199 -0
- package/src/primitives/combobox/ComboboxItem.ts +209 -0
- package/src/primitives/combobox/ComboboxRoot.ts +489 -0
- package/src/primitives/combobox/LICENSE +44 -0
- package/src/primitives/combobox/context.ts +47 -0
- package/src/primitives/combobox/index.ts +23 -0
- package/src/primitives/context-menu/LICENSE +44 -0
- package/src/primitives/context-menu/index.ts +388 -0
- package/src/primitives/date-field/DateFieldInput.ts +29 -0
- package/src/primitives/date-field/DateFieldRoot.ts +343 -0
- package/src/primitives/date-field/LICENSE +44 -0
- package/src/primitives/date-field/context.ts +29 -0
- package/src/primitives/date-field/index.ts +3 -0
- package/src/primitives/date-field/segmentInput.ts +96 -0
- package/src/primitives/date-field/useDateFieldSegment.ts +63 -0
- package/src/primitives/date-range-field/DateRangeFieldInput.ts +42 -0
- package/src/primitives/date-range-field/DateRangeFieldRoot.ts +389 -0
- package/src/primitives/date-range-field/LICENSE +44 -0
- package/src/primitives/date-range-field/context.ts +36 -0
- package/src/primitives/date-range-field/index.ts +12 -0
- package/src/primitives/dialog/DialogContent.ts +193 -0
- package/src/primitives/dialog/DialogContentImpl.ts +114 -0
- package/src/primitives/dialog/DialogOverlay.ts +99 -0
- package/src/primitives/dialog/DialogPortal.ts +33 -0
- package/src/primitives/dialog/DialogRoot.ts +61 -0
- package/src/primitives/dialog/DialogText.ts +59 -0
- package/src/primitives/dialog/DialogTrigger.ts +46 -0
- package/src/primitives/dialog/LICENSE +44 -0
- package/src/primitives/dialog/context.ts +19 -0
- package/src/primitives/dialog/index.ts +7 -0
- package/src/primitives/dismissable-layer/DismissableLayer.ts +212 -0
- package/src/primitives/dismissable-layer/DismissableLayerBranch.ts +36 -0
- package/src/primitives/dismissable-layer/LICENSE +44 -0
- package/src/primitives/dismissable-layer/index.ts +11 -0
- package/src/primitives/dropdown-menu/LICENSE +44 -0
- package/src/primitives/dropdown-menu/index.ts +344 -0
- package/src/primitives/focus-scope/FocusScope.ts +118 -0
- package/src/primitives/focus-scope/LICENSE +44 -0
- package/src/primitives/focus-scope/index.ts +1 -0
- package/src/primitives/hover-card/LICENSE +44 -0
- package/src/primitives/hover-card/index.ts +357 -0
- package/src/primitives/listbox/LICENSE +44 -0
- package/src/primitives/listbox/ListboxContent.ts +80 -0
- package/src/primitives/listbox/ListboxFilter.ts +130 -0
- package/src/primitives/listbox/ListboxGroup.ts +67 -0
- package/src/primitives/listbox/ListboxItem.ts +125 -0
- package/src/primitives/listbox/ListboxRoot.ts +376 -0
- package/src/primitives/listbox/context.ts +62 -0
- package/src/primitives/listbox/index.ts +17 -0
- package/src/primitives/menu/LICENSE +44 -0
- package/src/primitives/menu/MenuContentImpl.ts +304 -0
- package/src/primitives/menu/MenuItem.ts +495 -0
- package/src/primitives/menu/MenuRoot.ts +295 -0
- package/src/primitives/menu/context.ts +72 -0
- package/src/primitives/menu/index.ts +26 -0
- package/src/primitives/menu/wrap.ts +53 -0
- package/src/primitives/menubar/index.ts +494 -0
- package/src/primitives/navigation-menu/LICENSE +44 -0
- package/src/primitives/navigation-menu/NavigationMenuContent.ts +375 -0
- package/src/primitives/navigation-menu/NavigationMenuParts.ts +432 -0
- package/src/primitives/navigation-menu/NavigationMenuRoot.ts +260 -0
- package/src/primitives/navigation-menu/context.ts +50 -0
- package/src/primitives/navigation-menu/index.ts +20 -0
- package/src/primitives/number-field/__snapshots__/NumberField.test.ts.snap +288 -0
- package/src/primitives/picker/LICENSE +44 -0
- package/src/primitives/picker/createPicker.ts +618 -0
- package/src/primitives/picker/index.ts +26 -0
- package/src/primitives/popover/LICENSE +44 -0
- package/src/primitives/popover/PopoverContent.ts +243 -0
- package/src/primitives/popover/PopoverParts.ts +143 -0
- package/src/primitives/popover/PopoverRoot.ts +58 -0
- package/src/primitives/popover/context.ts +16 -0
- package/src/primitives/popover/index.ts +14 -0
- package/src/primitives/popper/Arrow.ts +49 -0
- package/src/primitives/popper/LICENSE +44 -0
- package/src/primitives/popper/PopperAnchor.ts +33 -0
- package/src/primitives/popper/PopperArrow.ts +77 -0
- package/src/primitives/popper/PopperContent.ts +262 -0
- package/src/primitives/popper/PopperRoot.ts +16 -0
- package/src/primitives/popper/context.ts +23 -0
- package/src/primitives/popper/index.ts +11 -0
- package/src/primitives/range-calendar/LICENSE +44 -0
- package/src/primitives/range-calendar/RangeCalendarCellTrigger.ts +241 -0
- package/src/primitives/range-calendar/RangeCalendarGrid.ts +90 -0
- package/src/primitives/range-calendar/RangeCalendarRoot.ts +413 -0
- package/src/primitives/range-calendar/context.ts +71 -0
- package/src/primitives/range-calendar/index.ts +21 -0
- package/src/primitives/select/LICENSE +44 -0
- package/src/primitives/select/SelectContent.ts +330 -0
- package/src/primitives/select/SelectItem.ts +204 -0
- package/src/primitives/select/SelectRoot.ts +408 -0
- package/src/primitives/select/context.ts +74 -0
- package/src/primitives/select/index.ts +17 -0
- package/src/primitives/tags-input/LICENSE +44 -0
- package/src/primitives/tags-input/TagsInputInput.ts +148 -0
- package/src/primitives/tags-input/TagsInputItem.ts +105 -0
- package/src/primitives/tags-input/TagsInputRoot.ts +215 -0
- package/src/primitives/tags-input/context.ts +36 -0
- package/src/primitives/tags-input/index.ts +9 -0
- package/src/primitives/teleport/LICENSE +44 -0
- package/src/primitives/teleport/Teleport.ts +41 -0
- package/src/primitives/teleport/index.ts +1 -0
- package/src/primitives/time-field/LICENSE +44 -0
- package/src/primitives/time-field/TimeFieldInput.ts +29 -0
- package/src/primitives/time-field/TimeFieldRoot.ts +379 -0
- package/src/primitives/time-field/context.ts +28 -0
- package/src/primitives/time-field/index.ts +4 -0
- package/src/primitives/toast/LICENSE +44 -0
- package/src/primitives/toast/ToastProvider.ts +311 -0
- package/src/primitives/toast/ToastRoot.ts +518 -0
- package/src/primitives/toast/index.ts +16 -0
- package/src/primitives/tooltip/LICENSE +44 -0
- package/src/primitives/tooltip/TooltipParts.ts +351 -0
- package/src/primitives/tooltip/TooltipRoot.ts +170 -0
- package/src/primitives/tooltip/context.ts +39 -0
- package/src/primitives/tooltip/index.ts +9 -0
- package/src/primitives/tree/LICENSE +44 -0
- package/src/primitives/tree/TreeItem.ts +256 -0
- package/src/primitives/tree/TreeRoot.ts +273 -0
- package/src/primitives/tree/context.ts +34 -0
- package/src/primitives/tree/index.ts +4 -0
- package/src/primitives/utils/config.ts +19 -1
- package/src/primitives/utils/defu.ts +26 -0
- package/src/primitives/utils/env.ts +5 -0
- package/src/primitives/utils/layers.ts +4 -0
- package/src/primitives/utils/propsWithoutDefaults.ts +8 -0
- package/src/primitives/utils/useBodyScrollLock.ts +29 -0
- package/src/primitives/utils/useFocusGuards.ts +10 -0
- package/src/primitives/utils/useGraceArea.ts +85 -0
- package/src/primitives/utils/useHideOthers.ts +18 -0
- package/src/primitives/utils/useIsUsingKeyboard.ts +25 -0
- package/src/primitives/utils/useLocale.ts +7 -0
- package/src/primitives/utils/useVModel.ts +8 -3
- package/src/singletons.ts +1 -1
- package/dist/types/vue/src/primitives/pin-input/PinInputInput.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/PinInputRoot.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/context.d.ts +0 -20
- package/dist/types/vue/src/primitives/pin-input/context.d.ts.map +0 -1
- package/dist/types/vue/src/primitives/pin-input/index.d.ts +0 -4
- package/dist/types/vue/src/primitives/pin-input/index.d.ts.map +0 -1
- package/src/primitives/pin-input/PinInputInput.ts +0 -218
- package/src/primitives/pin-input/PinInputRoot.ts +0 -136
- package/src/primitives/pin-input/context.ts +0 -24
- package/src/primitives/pin-input/index.ts +0 -3
- /package/dist/shared/primitives/{pin-input → date}/LICENSE +0 -0
- /package/src/primitives/{pin-input → alert-dialog}/LICENSE +0 -0
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
createTextVNode,
|
|
4
|
+
defineComponent,
|
|
5
|
+
guardReactiveProps,
|
|
6
|
+
h,
|
|
7
|
+
mergeProps,
|
|
8
|
+
nextTick,
|
|
9
|
+
normalizeProps,
|
|
10
|
+
onMounted,
|
|
11
|
+
ref,
|
|
12
|
+
renderSlot,
|
|
13
|
+
toDisplayString,
|
|
14
|
+
toRefs,
|
|
15
|
+
watch,
|
|
16
|
+
withCtx,
|
|
17
|
+
withKeys,
|
|
18
|
+
type PropType,
|
|
19
|
+
type Ref,
|
|
20
|
+
} from 'vue'
|
|
21
|
+
import { getLocalTimeZone, toCalendar, today, type DateValue } from '@internationalized/date'
|
|
22
|
+
import type { Grid } from '../../../../shared/src/primitives/date/calendar'
|
|
23
|
+
import {
|
|
24
|
+
calendarHeadingOptions,
|
|
25
|
+
isCalendarSelectionInvalid,
|
|
26
|
+
type Matcher,
|
|
27
|
+
type PageFunction,
|
|
28
|
+
} from '../../../../shared/src/primitives/date/calendar-view'
|
|
29
|
+
import { getDefaultDate, toDate } from '../../../../shared/src/primitives/date/comparators'
|
|
30
|
+
import {
|
|
31
|
+
createDateFormatter,
|
|
32
|
+
type Formatter,
|
|
33
|
+
} from '../../../../shared/src/primitives/date/formatter'
|
|
34
|
+
import {
|
|
35
|
+
buildPickerGrid,
|
|
36
|
+
isPickerDateDisabled,
|
|
37
|
+
isPickerDateSelected,
|
|
38
|
+
isPickerNextDisabled,
|
|
39
|
+
isPickerPrevDisabled,
|
|
40
|
+
isSamePickerPeriod,
|
|
41
|
+
nextPickerSelection,
|
|
42
|
+
pickerGridContains,
|
|
43
|
+
pickerHeading,
|
|
44
|
+
pickerLabel,
|
|
45
|
+
pickerShiftCandidate,
|
|
46
|
+
turnPickerPage,
|
|
47
|
+
type PickerKind,
|
|
48
|
+
} from '../../../../shared/src/primitives/date/picker-view'
|
|
49
|
+
import { handleCalendarInitialFocus, kbd } from '../../../../shared/src/primitives/date/utils'
|
|
50
|
+
import { VISUALLY_HIDDEN_HEADING_STYLE } from '../calendar/CalendarRoot'
|
|
51
|
+
import { createPagingButton } from '../calendar/CalendarNav'
|
|
52
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
53
|
+
import { createContext } from '../utils/createContext'
|
|
54
|
+
import { useDirection, type Direction } from '../utils/useDirection'
|
|
55
|
+
import { useId } from '../utils/useId'
|
|
56
|
+
import { useLocale } from '../utils/useLocale'
|
|
57
|
+
import { usePrimitiveElement } from '../utils/usePrimitiveElement'
|
|
58
|
+
import { useVModel } from '../utils/useVModel'
|
|
59
|
+
|
|
60
|
+
export interface PickerRootContext {
|
|
61
|
+
locale: Ref<string>
|
|
62
|
+
modelValue: Ref<DateValue | DateValue[] | undefined>
|
|
63
|
+
placeholder: Ref<DateValue>
|
|
64
|
+
grid: Ref<Grid<DateValue>>
|
|
65
|
+
multiple: Ref<boolean>
|
|
66
|
+
disabled: Ref<boolean>
|
|
67
|
+
readonly: Ref<boolean>
|
|
68
|
+
initialFocus: Ref<boolean>
|
|
69
|
+
preventDeselect: Ref<boolean>
|
|
70
|
+
yearsPerPage: Ref<number>
|
|
71
|
+
fullCalendarLabel: Ref<string>
|
|
72
|
+
headingValue: Ref<string>
|
|
73
|
+
headingId: string
|
|
74
|
+
isInvalid: Ref<boolean>
|
|
75
|
+
isDisabled: Matcher
|
|
76
|
+
isUnavailable: Matcher
|
|
77
|
+
isSelected: Matcher
|
|
78
|
+
isNextButtonDisabled: (page?: PageFunction) => boolean
|
|
79
|
+
isPrevButtonDisabled: (page?: PageFunction) => boolean
|
|
80
|
+
nextPage: (page?: PageFunction) => void
|
|
81
|
+
prevPage: (page?: PageFunction) => void
|
|
82
|
+
parentElement: Ref<HTMLElement | undefined>
|
|
83
|
+
onPlaceholderChange: (date: DateValue) => void
|
|
84
|
+
onChange: (date: DateValue) => void
|
|
85
|
+
formatter: Formatter
|
|
86
|
+
dir: Ref<Direction>
|
|
87
|
+
minValue: Ref<DateValue | undefined>
|
|
88
|
+
maxValue: Ref<DateValue | undefined>
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const primitive = (as: string) =>
|
|
92
|
+
({
|
|
93
|
+
asChild: { type: Boolean, required: false },
|
|
94
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false, default: as },
|
|
95
|
+
}) as const
|
|
96
|
+
|
|
97
|
+
const NAMES = {
|
|
98
|
+
month: { name: 'Month', label: 'year', unit: 'month' },
|
|
99
|
+
year: { name: 'Year', label: 'page', unit: 'year' },
|
|
100
|
+
} as const
|
|
101
|
+
|
|
102
|
+
export function createPicker(kind: PickerKind) {
|
|
103
|
+
const { name } = NAMES[kind]
|
|
104
|
+
const [injectRootContext, provideRootContext] = createContext<PickerRootContext>(
|
|
105
|
+
`${name}PickerRoot`,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
const Root = defineComponent({
|
|
109
|
+
name: `${name}PickerRoot`,
|
|
110
|
+
props: {
|
|
111
|
+
defaultValue: {
|
|
112
|
+
type: null as unknown as PropType<DateValue>,
|
|
113
|
+
required: false,
|
|
114
|
+
default: undefined,
|
|
115
|
+
},
|
|
116
|
+
defaultPlaceholder: { type: null as unknown as PropType<DateValue>, required: false },
|
|
117
|
+
placeholder: {
|
|
118
|
+
type: null as unknown as PropType<DateValue>,
|
|
119
|
+
required: false,
|
|
120
|
+
default: undefined,
|
|
121
|
+
},
|
|
122
|
+
preventDeselect: { type: Boolean, required: false, default: false },
|
|
123
|
+
calendarLabel: { type: String, required: false },
|
|
124
|
+
maxValue: { type: null as unknown as PropType<DateValue>, required: false },
|
|
125
|
+
minValue: { type: null as unknown as PropType<DateValue>, required: false },
|
|
126
|
+
locale: { type: String, required: false },
|
|
127
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
128
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
129
|
+
initialFocus: { type: Boolean, required: false, default: false },
|
|
130
|
+
[`is${name}Disabled`]: {
|
|
131
|
+
type: Function as PropType<Matcher>,
|
|
132
|
+
required: false,
|
|
133
|
+
default: undefined,
|
|
134
|
+
},
|
|
135
|
+
[`is${name}Unavailable`]: {
|
|
136
|
+
type: Function as PropType<Matcher>,
|
|
137
|
+
required: false,
|
|
138
|
+
default: undefined,
|
|
139
|
+
},
|
|
140
|
+
dir: { type: String as PropType<Direction>, required: false },
|
|
141
|
+
nextPage: { type: Function as PropType<PageFunction>, required: false },
|
|
142
|
+
prevPage: { type: Function as PropType<PageFunction>, required: false },
|
|
143
|
+
modelValue: {
|
|
144
|
+
type: null as unknown as PropType<DateValue | DateValue[] | undefined>,
|
|
145
|
+
required: false,
|
|
146
|
+
},
|
|
147
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
148
|
+
...(kind === 'year' ? { yearsPerPage: { type: Number, required: false, default: 12 } } : {}),
|
|
149
|
+
...primitive('div'),
|
|
150
|
+
} as Record<string, object>,
|
|
151
|
+
emits: ['update:modelValue', 'update:placeholder'],
|
|
152
|
+
setup(rawProps, { emit, slots }) {
|
|
153
|
+
const props = rawProps as Record<string, any>
|
|
154
|
+
const {
|
|
155
|
+
disabled,
|
|
156
|
+
readonly,
|
|
157
|
+
initialFocus,
|
|
158
|
+
multiple,
|
|
159
|
+
minValue,
|
|
160
|
+
maxValue,
|
|
161
|
+
preventDeselect,
|
|
162
|
+
calendarLabel,
|
|
163
|
+
defaultValue,
|
|
164
|
+
nextPage: propsNextPage,
|
|
165
|
+
prevPage: propsPrevPage,
|
|
166
|
+
dir: propDir,
|
|
167
|
+
locale: propLocale,
|
|
168
|
+
} = toRefs(props) as Record<string, Ref<any>>
|
|
169
|
+
const matcherDisabled = computed<Matcher | undefined>(() => props[`is${name}Disabled`])
|
|
170
|
+
const matcherUnavailable = computed<Matcher | undefined>(() => props[`is${name}Unavailable`])
|
|
171
|
+
const yearsPerPage = computed<number>(() => props.yearsPerPage ?? 12)
|
|
172
|
+
|
|
173
|
+
const { primitiveElement, currentElement: parentElement } = usePrimitiveElement()
|
|
174
|
+
const locale = useLocale(propLocale)
|
|
175
|
+
const dir = useDirection(propDir)
|
|
176
|
+
const headingId = useId(undefined, `reka-${kind}-picker-heading`)
|
|
177
|
+
|
|
178
|
+
const modelValue = useVModel(props, 'modelValue', emit, {
|
|
179
|
+
defaultValue: defaultValue!.value,
|
|
180
|
+
passive: props.modelValue === undefined,
|
|
181
|
+
}) as Ref<DateValue | DateValue[] | undefined>
|
|
182
|
+
|
|
183
|
+
const defaultDate = getDefaultDate({
|
|
184
|
+
defaultPlaceholder: props.placeholder,
|
|
185
|
+
defaultValue: modelValue.value,
|
|
186
|
+
locale: props.locale,
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
const placeholder = useVModel(props, 'placeholder', emit, {
|
|
190
|
+
defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
|
|
191
|
+
passive: props.placeholder === undefined,
|
|
192
|
+
}) as Ref<DateValue>
|
|
193
|
+
|
|
194
|
+
function onPlaceholderChange(value: DateValue) {
|
|
195
|
+
placeholder.value = value.copy()
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const formatter = createDateFormatter(locale.value)
|
|
199
|
+
const headingFormatOptions = computed(() => calendarHeadingOptions(placeholder.value))
|
|
200
|
+
const grid = ref(
|
|
201
|
+
buildPickerGrid(kind, placeholder.value, kind === 'year' ? yearsPerPage.value : undefined),
|
|
202
|
+
) as Ref<Grid<DateValue>>
|
|
203
|
+
|
|
204
|
+
const bounds = () => ({
|
|
205
|
+
minValue: minValue!.value,
|
|
206
|
+
maxValue: maxValue!.value,
|
|
207
|
+
disabled: disabled!.value,
|
|
208
|
+
})
|
|
209
|
+
const isDisabled = (date: DateValue) =>
|
|
210
|
+
isPickerDateDisabled(kind, date, bounds(), matcherDisabled.value)
|
|
211
|
+
const isUnavailable = (date: DateValue) => !!matcherUnavailable.value?.(date)
|
|
212
|
+
const isNextButtonDisabled = (page?: PageFunction) =>
|
|
213
|
+
isPickerNextDisabled(kind, grid.value, bounds(), propsNextPage!.value, page)
|
|
214
|
+
const isPrevButtonDisabled = (page?: PageFunction) =>
|
|
215
|
+
isPickerPrevDisabled(kind, grid.value, bounds(), propsPrevPage!.value, page)
|
|
216
|
+
|
|
217
|
+
function turn(direction: 1 | -1, page?: PageFunction) {
|
|
218
|
+
const next = turnPickerPage(
|
|
219
|
+
kind,
|
|
220
|
+
direction,
|
|
221
|
+
grid.value,
|
|
222
|
+
placeholder.value,
|
|
223
|
+
{
|
|
224
|
+
page: direction > 0 ? propsNextPage!.value : propsPrevPage!.value,
|
|
225
|
+
yearsPerPage: yearsPerPage.value,
|
|
226
|
+
},
|
|
227
|
+
page,
|
|
228
|
+
)
|
|
229
|
+
grid.value = next.grid
|
|
230
|
+
placeholder.value = next.placeholder
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
watch(placeholder, value => {
|
|
234
|
+
if (pickerGridContains(kind, grid.value, value)) return
|
|
235
|
+
grid.value = buildPickerGrid(kind, value, kind === 'year' ? yearsPerPage.value : undefined)
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
watch(kind === 'year' ? [locale, yearsPerPage] : locale, () => {
|
|
239
|
+
formatter.setLocale(locale.value)
|
|
240
|
+
grid.value = buildPickerGrid(
|
|
241
|
+
kind,
|
|
242
|
+
placeholder.value,
|
|
243
|
+
kind === 'year' ? yearsPerPage.value : undefined,
|
|
244
|
+
)
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
const headingValue = computed(() =>
|
|
248
|
+
pickerHeading(kind, grid.value, formatter, locale.value, headingFormatOptions.value),
|
|
249
|
+
)
|
|
250
|
+
const fullCalendarLabel = computed(() =>
|
|
251
|
+
pickerLabel(kind, calendarLabel!.value, headingValue.value),
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
const isInvalid = computed(() =>
|
|
255
|
+
isCalendarSelectionInvalid(modelValue.value, isDisabled, isUnavailable),
|
|
256
|
+
)
|
|
257
|
+
const isSelected = (date: DateValue) => isPickerDateSelected(kind, modelValue.value, date)
|
|
258
|
+
|
|
259
|
+
watch(modelValue, value => {
|
|
260
|
+
if (Array.isArray(value) && value.length) {
|
|
261
|
+
const lastValue = value.at(-1)
|
|
262
|
+
if (lastValue && !isSamePickerPeriod(kind, placeholder.value, lastValue))
|
|
263
|
+
onPlaceholderChange(lastValue)
|
|
264
|
+
} else if (
|
|
265
|
+
!Array.isArray(value) &&
|
|
266
|
+
value &&
|
|
267
|
+
!isSamePickerPeriod(kind, placeholder.value, value)
|
|
268
|
+
)
|
|
269
|
+
onPlaceholderChange(value)
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
function onChange(value: DateValue) {
|
|
273
|
+
const next = nextPickerSelection(kind, modelValue.value, value, placeholder.value, {
|
|
274
|
+
multiple: multiple!.value,
|
|
275
|
+
preventDeselect: preventDeselect!.value,
|
|
276
|
+
})
|
|
277
|
+
if (!next) return
|
|
278
|
+
if (next.placeholder) placeholder.value = next.placeholder
|
|
279
|
+
modelValue.value = next.value
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
onMounted(() => {
|
|
283
|
+
if (initialFocus!.value) handleCalendarInitialFocus(parentElement.value ?? null)
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
provideRootContext({
|
|
287
|
+
isUnavailable,
|
|
288
|
+
dir,
|
|
289
|
+
isDisabled,
|
|
290
|
+
locale,
|
|
291
|
+
formatter,
|
|
292
|
+
modelValue,
|
|
293
|
+
placeholder,
|
|
294
|
+
disabled: disabled!,
|
|
295
|
+
initialFocus: initialFocus!,
|
|
296
|
+
grid,
|
|
297
|
+
multiple: multiple!,
|
|
298
|
+
readonly: readonly!,
|
|
299
|
+
preventDeselect: preventDeselect!,
|
|
300
|
+
yearsPerPage,
|
|
301
|
+
fullCalendarLabel,
|
|
302
|
+
headingValue,
|
|
303
|
+
headingId,
|
|
304
|
+
isInvalid,
|
|
305
|
+
isSelected,
|
|
306
|
+
isNextButtonDisabled,
|
|
307
|
+
isPrevButtonDisabled,
|
|
308
|
+
nextPage: page => turn(1, page),
|
|
309
|
+
prevPage: page => turn(-1, page),
|
|
310
|
+
parentElement,
|
|
311
|
+
onPlaceholderChange,
|
|
312
|
+
onChange,
|
|
313
|
+
minValue: minValue!,
|
|
314
|
+
maxValue: maxValue!,
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
return () =>
|
|
318
|
+
h(
|
|
319
|
+
Primitive,
|
|
320
|
+
{
|
|
321
|
+
ref: primitiveElement,
|
|
322
|
+
as: props.as,
|
|
323
|
+
'as-child': props.asChild,
|
|
324
|
+
'aria-label': fullCalendarLabel.value,
|
|
325
|
+
'data-readonly': readonly!.value ? '' : undefined,
|
|
326
|
+
'data-disabled': disabled!.value ? '' : undefined,
|
|
327
|
+
'data-invalid': isInvalid.value ? '' : undefined,
|
|
328
|
+
dir: dir.value,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
default: withCtx(() => [
|
|
332
|
+
renderSlot(slots, 'default', {
|
|
333
|
+
date: placeholder.value,
|
|
334
|
+
grid: grid.value,
|
|
335
|
+
locale: locale.value,
|
|
336
|
+
modelValue: modelValue.value,
|
|
337
|
+
}),
|
|
338
|
+
h('div', { style: VISUALLY_HIDDEN_HEADING_STYLE }, [
|
|
339
|
+
h(
|
|
340
|
+
'div',
|
|
341
|
+
{ role: 'heading', 'aria-level': '2' },
|
|
342
|
+
toDisplayString(fullCalendarLabel.value),
|
|
343
|
+
),
|
|
344
|
+
]),
|
|
345
|
+
]),
|
|
346
|
+
},
|
|
347
|
+
)
|
|
348
|
+
},
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
const Grid = defineComponent({
|
|
352
|
+
name: `${name}PickerGrid`,
|
|
353
|
+
props: primitive('table'),
|
|
354
|
+
setup(props, { slots }) {
|
|
355
|
+
const rootContext = injectRootContext()
|
|
356
|
+
const disabled = computed(() => (rootContext.disabled.value ? true : undefined))
|
|
357
|
+
const readonly = computed(() => (rootContext.readonly.value ? true : undefined))
|
|
358
|
+
return () =>
|
|
359
|
+
h(
|
|
360
|
+
Primitive,
|
|
361
|
+
mergeProps(props, {
|
|
362
|
+
tabindex: '-1',
|
|
363
|
+
role: 'application',
|
|
364
|
+
'aria-labelledby': rootContext.headingId,
|
|
365
|
+
'aria-readonly': readonly.value,
|
|
366
|
+
'aria-disabled': disabled.value,
|
|
367
|
+
'data-readonly': readonly.value && '',
|
|
368
|
+
'data-disabled': disabled.value && '',
|
|
369
|
+
}),
|
|
370
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
371
|
+
)
|
|
372
|
+
},
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
const GridBody = defineComponent({
|
|
376
|
+
name: `${name}PickerGridBody`,
|
|
377
|
+
props: primitive('tbody'),
|
|
378
|
+
setup(props, { slots }) {
|
|
379
|
+
return () =>
|
|
380
|
+
h(Primitive, normalizeProps(guardReactiveProps(props)), {
|
|
381
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
382
|
+
})
|
|
383
|
+
},
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
const GridRow = defineComponent({
|
|
387
|
+
name: `${name}PickerGridRow`,
|
|
388
|
+
props: primitive('tr'),
|
|
389
|
+
setup(props, { slots }) {
|
|
390
|
+
return () =>
|
|
391
|
+
h(Primitive, mergeProps(props, { role: 'row' }), {
|
|
392
|
+
default: withCtx(() => [renderSlot(slots, 'default')]),
|
|
393
|
+
})
|
|
394
|
+
},
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
const Cell = defineComponent({
|
|
398
|
+
name: `${name}PickerCell`,
|
|
399
|
+
props: {
|
|
400
|
+
date: { type: null as unknown as PropType<DateValue>, required: true },
|
|
401
|
+
...primitive('td'),
|
|
402
|
+
},
|
|
403
|
+
setup(props, { slots }) {
|
|
404
|
+
const rootContext = injectRootContext()
|
|
405
|
+
return () =>
|
|
406
|
+
h(
|
|
407
|
+
Primitive,
|
|
408
|
+
{
|
|
409
|
+
as: props.as,
|
|
410
|
+
'as-child': props.asChild,
|
|
411
|
+
role: 'gridcell',
|
|
412
|
+
'aria-selected': rootContext.isSelected(props.date) ? true : undefined,
|
|
413
|
+
'aria-disabled':
|
|
414
|
+
rootContext.isDisabled(props.date) || rootContext.isUnavailable?.(props.date),
|
|
415
|
+
'data-disabled': rootContext.isDisabled(props.date) ? '' : undefined,
|
|
416
|
+
},
|
|
417
|
+
{ default: withCtx(() => [renderSlot(slots, 'default')]) },
|
|
418
|
+
)
|
|
419
|
+
},
|
|
420
|
+
})
|
|
421
|
+
|
|
422
|
+
const CellTrigger = defineComponent({
|
|
423
|
+
name: `${name}PickerCellTrigger`,
|
|
424
|
+
props: {
|
|
425
|
+
[kind]: { type: null as unknown as PropType<DateValue>, required: true },
|
|
426
|
+
...primitive('div'),
|
|
427
|
+
} as Record<string, object>,
|
|
428
|
+
setup(rawProps, { slots }) {
|
|
429
|
+
const props = rawProps as Record<string, any>
|
|
430
|
+
const rootContext = injectRootContext()
|
|
431
|
+
const { primitiveElement } = usePrimitiveElement()
|
|
432
|
+
const value = () => props[kind] as DateValue
|
|
433
|
+
|
|
434
|
+
const displayValue = computed(() => {
|
|
435
|
+
void rootContext.locale.value
|
|
436
|
+
return kind === 'month'
|
|
437
|
+
? rootContext.formatter.custom(toDate(value()), { month: 'short' })
|
|
438
|
+
: rootContext.formatter.fullYear(toDate(value()))
|
|
439
|
+
})
|
|
440
|
+
const labelText = computed(() => {
|
|
441
|
+
void rootContext.locale.value
|
|
442
|
+
return rootContext.formatter.custom(
|
|
443
|
+
toDate(value()),
|
|
444
|
+
kind === 'month' ? { month: 'long', year: 'numeric' } : { year: 'numeric' },
|
|
445
|
+
)
|
|
446
|
+
})
|
|
447
|
+
const isUnavailableCell = computed(() => rootContext.isUnavailable?.(value()) ?? false)
|
|
448
|
+
const isCurrent = computed(() =>
|
|
449
|
+
isSamePickerPeriod(kind, value(), toCalendar(today(getLocalTimeZone()), value().calendar)),
|
|
450
|
+
)
|
|
451
|
+
const isDisabledCell = computed(() => rootContext.isDisabled(value()))
|
|
452
|
+
const isFocused = computed(
|
|
453
|
+
() =>
|
|
454
|
+
!rootContext.disabled.value &&
|
|
455
|
+
isSamePickerPeriod(kind, value(), rootContext.placeholder.value),
|
|
456
|
+
)
|
|
457
|
+
const isSelectedCell = computed(() => rootContext.isSelected(value()))
|
|
458
|
+
|
|
459
|
+
function change(date: DateValue) {
|
|
460
|
+
if (rootContext.readonly.value) return
|
|
461
|
+
if (rootContext.isDisabled(date) || rootContext.isUnavailable?.(date)) return
|
|
462
|
+
rootContext.onChange(date)
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function handleClick() {
|
|
466
|
+
if (isDisabledCell.value) return
|
|
467
|
+
change(value())
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function candidate(current: DateValue, add: number, unit: 'cell' | 'page') {
|
|
471
|
+
return pickerShiftCandidate(kind, current, add, unit, {
|
|
472
|
+
minValue: rootContext.minValue.value,
|
|
473
|
+
maxValue: rootContext.maxValue.value,
|
|
474
|
+
yearsPerPage: rootContext.yearsPerPage.value,
|
|
475
|
+
})
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function query(date: DateValue) {
|
|
479
|
+
return rootContext.parentElement.value!.querySelector<HTMLElement>(
|
|
480
|
+
`[data-value='${date.toString()}']`,
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function shiftFocus(current: DateValue, add: number, depth = 0) {
|
|
485
|
+
if (depth > 48) return
|
|
486
|
+
const target = candidate(current, add, 'cell')
|
|
487
|
+
if (!target) return
|
|
488
|
+
const element = query(target)
|
|
489
|
+
if (!element) {
|
|
490
|
+
if (add > 0) {
|
|
491
|
+
if (rootContext.isNextButtonDisabled()) return
|
|
492
|
+
rootContext.nextPage()
|
|
493
|
+
} else {
|
|
494
|
+
if (rootContext.isPrevButtonDisabled()) return
|
|
495
|
+
rootContext.prevPage()
|
|
496
|
+
}
|
|
497
|
+
void nextTick(() => shiftFocus(current, add, depth + 1))
|
|
498
|
+
return
|
|
499
|
+
}
|
|
500
|
+
if (element.hasAttribute('data-disabled')) return shiftFocus(target, add, depth + 1)
|
|
501
|
+
rootContext.onPlaceholderChange(target)
|
|
502
|
+
element.focus()
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function shiftFocusPage(direction: number) {
|
|
506
|
+
const target = candidate(value(), direction, 'page')
|
|
507
|
+
if (!target) return
|
|
508
|
+
if (direction > 0) {
|
|
509
|
+
if (rootContext.isNextButtonDisabled()) return
|
|
510
|
+
rootContext.nextPage()
|
|
511
|
+
} else {
|
|
512
|
+
if (rootContext.isPrevButtonDisabled()) return
|
|
513
|
+
rootContext.prevPage()
|
|
514
|
+
}
|
|
515
|
+
void nextTick(() => {
|
|
516
|
+
const element = query(target)
|
|
517
|
+
if (element && !element.hasAttribute('data-disabled')) {
|
|
518
|
+
rootContext.onPlaceholderChange(target)
|
|
519
|
+
element.focus()
|
|
520
|
+
return
|
|
521
|
+
}
|
|
522
|
+
if (kind === 'year' && (!element || element.hasAttribute('data-disabled')))
|
|
523
|
+
shiftFocus(target, direction > 0 ? 1 : -1, 1)
|
|
524
|
+
})
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function handleArrowKey(event: KeyboardEvent) {
|
|
528
|
+
if (isDisabledCell.value) return
|
|
529
|
+
if (
|
|
530
|
+
(event.code === kbd.ENTER || event.code === kbd.SPACE_CODE) &&
|
|
531
|
+
(event.ctrlKey || event.metaKey || event.altKey)
|
|
532
|
+
)
|
|
533
|
+
return
|
|
534
|
+
event.preventDefault()
|
|
535
|
+
event.stopPropagation()
|
|
536
|
+
const sign = rootContext.dir.value === 'rtl' ? -1 : 1
|
|
537
|
+
switch (event.code) {
|
|
538
|
+
case kbd.ARROW_RIGHT:
|
|
539
|
+
shiftFocus(value(), sign)
|
|
540
|
+
break
|
|
541
|
+
case kbd.ARROW_LEFT:
|
|
542
|
+
shiftFocus(value(), -sign)
|
|
543
|
+
break
|
|
544
|
+
case kbd.ARROW_UP:
|
|
545
|
+
shiftFocus(value(), -4)
|
|
546
|
+
break
|
|
547
|
+
case kbd.ARROW_DOWN:
|
|
548
|
+
shiftFocus(value(), 4)
|
|
549
|
+
break
|
|
550
|
+
case kbd.PAGE_UP:
|
|
551
|
+
shiftFocusPage(-1)
|
|
552
|
+
break
|
|
553
|
+
case kbd.PAGE_DOWN:
|
|
554
|
+
shiftFocusPage(1)
|
|
555
|
+
break
|
|
556
|
+
case kbd.ENTER:
|
|
557
|
+
case kbd.SPACE_CODE:
|
|
558
|
+
change(value())
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const onKeydown = withKeys(handleArrowKey as (event: Event) => void, [
|
|
563
|
+
'up',
|
|
564
|
+
'down',
|
|
565
|
+
'left',
|
|
566
|
+
'right',
|
|
567
|
+
'space',
|
|
568
|
+
'enter',
|
|
569
|
+
'page-up',
|
|
570
|
+
'page-down',
|
|
571
|
+
])
|
|
572
|
+
|
|
573
|
+
return () =>
|
|
574
|
+
h(
|
|
575
|
+
Primitive,
|
|
576
|
+
{
|
|
577
|
+
ref: primitiveElement,
|
|
578
|
+
as: props.as,
|
|
579
|
+
'as-child': props.asChild,
|
|
580
|
+
role: 'button',
|
|
581
|
+
'aria-label': labelText.value,
|
|
582
|
+
[`data-reka-${kind}-picker-cell-trigger`]: '',
|
|
583
|
+
'aria-disabled': isDisabledCell.value || isUnavailableCell.value ? true : undefined,
|
|
584
|
+
'data-selected': isSelectedCell.value ? (kind === 'month' ? true : '') : undefined,
|
|
585
|
+
'data-value': value().toString(),
|
|
586
|
+
'data-disabled': isDisabledCell.value ? '' : undefined,
|
|
587
|
+
'data-unavailable': isUnavailableCell.value ? '' : undefined,
|
|
588
|
+
'data-today': isCurrent.value ? '' : undefined,
|
|
589
|
+
'data-focused': isFocused.value ? '' : undefined,
|
|
590
|
+
tabindex: isFocused.value ? 0 : isDisabledCell.value ? undefined : -1,
|
|
591
|
+
onClick: handleClick,
|
|
592
|
+
onKeydown,
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
default: withCtx(() => [
|
|
596
|
+
renderSlot(
|
|
597
|
+
slots,
|
|
598
|
+
'default',
|
|
599
|
+
{
|
|
600
|
+
[`${kind}Value`]: displayValue.value,
|
|
601
|
+
disabled: isDisabledCell.value,
|
|
602
|
+
today: isCurrent.value,
|
|
603
|
+
selected: isSelectedCell.value,
|
|
604
|
+
unavailable: isUnavailableCell.value,
|
|
605
|
+
},
|
|
606
|
+
() => [createTextVNode(toDisplayString(displayValue.value), 1)],
|
|
607
|
+
),
|
|
608
|
+
]),
|
|
609
|
+
},
|
|
610
|
+
)
|
|
611
|
+
},
|
|
612
|
+
})
|
|
613
|
+
|
|
614
|
+
const Next = createPagingButton(`${name}PickerNext`, 'next', injectRootContext, NAMES[kind].label)
|
|
615
|
+
const Prev = createPagingButton(`${name}PickerPrev`, 'prev', injectRootContext, NAMES[kind].label)
|
|
616
|
+
|
|
617
|
+
return { Root, Grid, GridBody, GridRow, Cell, CellTrigger, Next, Prev, injectRootContext }
|
|
618
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createPicker } from './createPicker'
|
|
2
|
+
|
|
3
|
+
const month = createPicker('month')
|
|
4
|
+
const year = createPicker('year')
|
|
5
|
+
|
|
6
|
+
export type { PickerRootContext } from './createPicker'
|
|
7
|
+
|
|
8
|
+
export const MonthPickerRoot = month.Root
|
|
9
|
+
export const MonthPickerGrid = month.Grid
|
|
10
|
+
export const MonthPickerGridBody = month.GridBody
|
|
11
|
+
export const MonthPickerGridRow = month.GridRow
|
|
12
|
+
export const MonthPickerCell = month.Cell
|
|
13
|
+
export const MonthPickerCellTrigger = month.CellTrigger
|
|
14
|
+
export const MonthPickerNext = month.Next
|
|
15
|
+
export const MonthPickerPrev = month.Prev
|
|
16
|
+
export const injectMonthPickerRootContext = month.injectRootContext
|
|
17
|
+
|
|
18
|
+
export const YearPickerRoot = year.Root
|
|
19
|
+
export const YearPickerGrid = year.Grid
|
|
20
|
+
export const YearPickerGridBody = year.GridBody
|
|
21
|
+
export const YearPickerGridRow = year.GridRow
|
|
22
|
+
export const YearPickerCell = year.Cell
|
|
23
|
+
export const YearPickerCellTrigger = year.CellTrigger
|
|
24
|
+
export const YearPickerNext = year.Next
|
|
25
|
+
export const YearPickerPrev = year.Prev
|
|
26
|
+
export const injectYearPickerRootContext = year.injectRootContext
|
|
@@ -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.
|