@hina-ui/vue 1.7.6 → 1.7.7
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/dist/index.js +6723 -198
- package/dist/index.js.map +1 -1
- package/dist/shared/lib/float-button.ts +14 -0
- package/dist/shared/primitives/accordion/LICENSE +21 -0
- package/dist/shared/primitives/accordion/index.ts +34 -0
- package/dist/shared/primitives/arrow-navigation/LICENSE +21 -0
- package/dist/shared/primitives/arrow-navigation/index.ts +90 -0
- package/dist/shared/primitives/body-scroll-lock/LICENSE +21 -0
- package/dist/shared/primitives/body-scroll-lock/index.ts +115 -0
- package/dist/shared/primitives/checkbox/LICENSE +21 -0
- package/dist/shared/primitives/checkbox/index.ts +23 -0
- package/dist/shared/primitives/collapsible/LICENSE +21 -0
- package/dist/shared/primitives/collapsible/index.ts +31 -0
- package/dist/shared/primitives/collection/LICENSE +21 -0
- package/dist/shared/primitives/collection/index.ts +19 -0
- package/dist/shared/primitives/dismissable-layer/LICENSE +21 -0
- package/dist/shared/primitives/dismissable-layer/index.ts +203 -0
- package/dist/shared/primitives/focus-guards/LICENSE +21 -0
- package/dist/shared/primitives/focus-guards/index.ts +24 -0
- package/dist/shared/primitives/focus-scope/LICENSE +21 -0
- package/dist/shared/primitives/focus-scope/index.ts +216 -0
- package/dist/shared/primitives/label/LICENSE +21 -0
- package/dist/shared/primitives/label/index.ts +4 -0
- package/dist/shared/primitives/pagination/LICENSE +21 -0
- package/dist/shared/primitives/pagination/index.ts +99 -0
- package/dist/shared/primitives/pin-input/LICENSE +21 -0
- package/dist/shared/primitives/pin-input/index.ts +126 -0
- package/dist/shared/primitives/presence/LICENSE +21 -0
- package/dist/shared/primitives/presence/index.ts +135 -0
- package/dist/shared/primitives/progress/LICENSE +21 -0
- package/dist/shared/primitives/progress/index.ts +41 -0
- package/dist/shared/primitives/radio-group/LICENSE +21 -0
- package/dist/shared/primitives/radio-group/index.ts +46 -0
- package/dist/shared/primitives/rating/LICENSE +21 -0
- package/dist/shared/primitives/rating/index.ts +37 -0
- package/dist/shared/primitives/roving-focus/LICENSE +21 -0
- package/dist/shared/primitives/roving-focus/index.ts +44 -0
- package/dist/shared/primitives/separator/LICENSE +21 -0
- package/dist/shared/primitives/separator/index.ts +14 -0
- package/dist/shared/primitives/size/LICENSE +21 -0
- package/dist/shared/primitives/size/index.ts +19 -0
- package/dist/shared/primitives/slider/LICENSE +21 -0
- package/dist/shared/primitives/slider/index.ts +183 -0
- package/dist/shared/primitives/splitter/LICENSE +21 -0
- package/dist/shared/primitives/splitter/arrays.ts +6 -0
- package/dist/shared/primitives/splitter/assert.ts +9 -0
- package/dist/shared/primitives/splitter/calculate.ts +139 -0
- package/dist/shared/primitives/splitter/callPanelCallbacks.ts +40 -0
- package/dist/shared/primitives/splitter/compare.ts +13 -0
- package/dist/shared/primitives/splitter/constants.ts +1 -0
- package/dist/shared/primitives/splitter/debounce.ts +10 -0
- package/dist/shared/primitives/splitter/dom.ts +64 -0
- package/dist/shared/primitives/splitter/events.ts +29 -0
- package/dist/shared/primitives/splitter/flags.ts +4 -0
- package/dist/shared/primitives/splitter/layout.ts +153 -0
- package/dist/shared/primitives/splitter/pivot.ts +10 -0
- package/dist/shared/primitives/splitter/rects.ts +24 -0
- package/dist/shared/primitives/splitter/registry.ts +231 -0
- package/dist/shared/primitives/splitter/resizePanel.ts +30 -0
- package/dist/shared/primitives/splitter/stackingOrder.ts +88 -0
- package/dist/shared/primitives/splitter/storage.ts +95 -0
- package/dist/shared/primitives/splitter/style.ts +95 -0
- package/dist/shared/primitives/splitter/types.ts +48 -0
- package/dist/shared/primitives/splitter/units.ts +123 -0
- package/dist/shared/primitives/splitter/validation.ts +55 -0
- package/dist/shared/primitives/stepper/LICENSE +21 -0
- package/dist/shared/primitives/stepper/index.ts +58 -0
- package/dist/shared/primitives/tabs/LICENSE +21 -0
- package/dist/shared/primitives/tabs/index.ts +18 -0
- package/dist/shared/primitives/toggle/LICENSE +21 -0
- package/dist/shared/primitives/toggle/index.ts +5 -0
- package/dist/shared/primitives/value/LICENSE +21 -0
- package/dist/shared/primitives/value/index.ts +80 -0
- package/dist/shared/primitives/visually-hidden/LICENSE +21 -0
- package/dist/shared/primitives/visually-hidden/index.ts +25 -0
- package/dist/shared/styles/float-button.css +20 -6
- package/dist/shared/variants/panel.ts +5 -0
- package/dist/types/shared/src/lib/float-button.d.ts +15 -0
- package/dist/types/shared/src/lib/float-button.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/accordion/index.d.ts +9 -0
- package/dist/types/shared/src/primitives/accordion/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/arrow-navigation/index.d.ts +12 -0
- package/dist/types/shared/src/primitives/arrow-navigation/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/checkbox/index.d.ts +6 -0
- package/dist/types/shared/src/primitives/checkbox/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts +12 -0
- package/dist/types/shared/src/primitives/collapsible/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/collection/index.d.ts +6 -0
- package/dist/types/shared/src/primitives/collection/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts +41 -0
- package/dist/types/shared/src/primitives/dismissable-layer/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/focus-scope/index.d.ts +51 -0
- package/dist/types/shared/src/primitives/focus-scope/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/label/index.d.ts +2 -0
- package/dist/types/shared/src/primitives/label/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/pagination/index.d.ts +17 -0
- package/dist/types/shared/src/primitives/pagination/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/pin-input/index.d.ts +31 -0
- package/dist/types/shared/src/primitives/pin-input/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/presence/index.d.ts +14 -0
- package/dist/types/shared/src/primitives/presence/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/progress/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/progress/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/radio-group/index.d.ts +12 -0
- package/dist/types/shared/src/primitives/radio-group/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/rating/index.d.ts +8 -0
- package/dist/types/shared/src/primitives/rating/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/roving-focus/index.d.ts +13 -0
- package/dist/types/shared/src/primitives/roving-focus/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/separator/index.d.ts +10 -0
- package/dist/types/shared/src/primitives/separator/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/size/index.d.ts +7 -0
- package/dist/types/shared/src/primitives/size/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/slider/index.d.ts +60 -0
- package/dist/types/shared/src/primitives/slider/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/arrays.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/arrays.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/assert.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/assert.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/calculate.d.ts +15 -0
- package/dist/types/shared/src/primitives/splitter/calculate.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/callPanelCallbacks.d.ts +3 -0
- package/dist/types/shared/src/primitives/splitter/callPanelCallbacks.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/compare.d.ts +3 -0
- package/dist/types/shared/src/primitives/splitter/compare.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/constants.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/constants.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/debounce.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/debounce.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/dom.d.ts +8 -0
- package/dist/types/shared/src/primitives/splitter/dom.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/events.d.ts +10 -0
- package/dist/types/shared/src/primitives/splitter/events.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/flags.d.ts +5 -0
- package/dist/types/shared/src/primitives/splitter/flags.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/layout.d.ts +10 -0
- package/dist/types/shared/src/primitives/splitter/layout.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/pivot.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/pivot.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/rects.d.ts +8 -0
- package/dist/types/shared/src/primitives/splitter/rects.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/registry.d.ts +5 -0
- package/dist/types/shared/src/primitives/splitter/registry.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/resizePanel.d.ts +7 -0
- package/dist/types/shared/src/primitives/splitter/resizePanel.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/stackingOrder.d.ts +2 -0
- package/dist/types/shared/src/primitives/splitter/stackingOrder.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/storage.d.ts +9 -0
- package/dist/types/shared/src/primitives/splitter/storage.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/style.d.ts +21 -0
- package/dist/types/shared/src/primitives/splitter/style.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/types.d.ts +42 -0
- package/dist/types/shared/src/primitives/splitter/types.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/units.d.ts +13 -0
- package/dist/types/shared/src/primitives/splitter/units.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/splitter/validation.d.ts +6 -0
- package/dist/types/shared/src/primitives/splitter/validation.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/stepper/index.d.ts +21 -0
- package/dist/types/shared/src/primitives/stepper/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/tabs/index.d.ts +7 -0
- package/dist/types/shared/src/primitives/tabs/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/toggle/index.d.ts +3 -0
- package/dist/types/shared/src/primitives/toggle/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/value/index.d.ts +15 -0
- package/dist/types/shared/src/primitives/value/index.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/visually-hidden/index.d.ts +19 -0
- package/dist/types/shared/src/primitives/visually-hidden/index.d.ts.map +1 -0
- package/dist/types/shared/src/variants/panel.d.ts +13 -1
- package/dist/types/shared/src/variants/panel.d.ts.map +1 -1
- package/dist/types/vue/src/components/accordion/Accordion.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/breadcrumb/BreadcrumbItem.vue.d.ts +2 -2
- package/dist/types/vue/src/components/breadcrumb/BreadcrumbItem.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/button/Button.vue.d.ts +2 -2
- package/dist/types/vue/src/components/button/Button.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/card/Card.vue.d.ts +2 -2
- package/dist/types/vue/src/components/card/Card.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/chip/Chip.vue.d.ts +1 -1
- package/dist/types/vue/src/components/chip/Chip.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/chip/composables/useChipRoot.d.ts +2 -2
- package/dist/types/vue/src/components/chip/composables/useChipRoot.d.ts.map +1 -1
- package/dist/types/vue/src/components/collapsible/Collapsible.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-list/DataList.vue.d.ts +2 -2
- package/dist/types/vue/src/components/data-table/DataTable.vue.d.ts +2 -2
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/float-button/FloatButton.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/types.d.ts +3 -2
- package/dist/types/vue/src/components/float-button/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/heading/Heading.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.map +1 -1
- package/dist/types/vue/src/components/indicator/Indicator.vue.d.ts +2 -2
- package/dist/types/vue/src/components/indicator/Indicator.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/link/Link.vue.d.ts +2 -2
- package/dist/types/vue/src/components/link/Link.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/multi-select/MultiSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/nav-link/NavLink.vue.d.ts +9 -5
- 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 +27 -0
- package/dist/types/vue/src/components/nav-link/NavLinkChild.d.ts.map +1 -0
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuLink.vue.d.ts +2 -2
- package/dist/types/vue/src/components/navigation-menu/NavigationMenuLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/pagination/PaginationControl.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/prev-next/PrevNextLink.vue.d.ts +2 -2
- package/dist/types/vue/src/components/prev-next/PrevNextLink.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/prose/Prose.vue.d.ts +2 -2
- package/dist/types/vue/src/components/prose/Prose.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/section/Section.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/segmented-control/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/sidebar/context.d.ts +2 -0
- package/dist/types/vue/src/components/sidebar/context.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/SliderHandle.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/split-button/SplitButton.vue.d.ts +1 -1
- package/dist/types/vue/src/components/split-button/types.d.ts +1 -1
- package/dist/types/vue/src/components/split-button/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/tag/Tag.vue.d.ts +2 -2
- package/dist/types/vue/src/components/tag/Tag.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/text/Text.vue.d.ts +2 -2
- package/dist/types/vue/src/components/text/Text.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/time/Time.vue.d.ts +2 -0
- package/dist/types/vue/src/components/time/Time.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toast/Toaster.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toggle/Toggle.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarControl.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarLink.vue.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/ToolbarToggleGroup.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/toolbar/types.d.ts +1 -1
- package/dist/types/vue/src/components/toolbar/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +1 -1
- package/dist/types/vue/src/components/visually-hidden/VisuallyHidden.vue.d.ts +2 -2
- package/dist/types/vue/src/components/visually-hidden/VisuallyHidden.vue.d.ts.map +1 -1
- package/dist/types/vue/src/lib/useDirection.d.ts +2 -2
- package/dist/types/vue/src/lib/useDirection.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/accordion/AccordionContent.d.ts +40 -0
- package/dist/types/vue/src/primitives/accordion/AccordionContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/AccordionHeader.d.ts +33 -0
- package/dist/types/vue/src/primitives/accordion/AccordionHeader.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/AccordionItem.d.ts +61 -0
- package/dist/types/vue/src/primitives/accordion/AccordionItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/AccordionRoot.d.ts +122 -0
- package/dist/types/vue/src/primitives/accordion/AccordionRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/AccordionTrigger.d.ts +30 -0
- package/dist/types/vue/src/primitives/accordion/AccordionTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/context.d.ts +27 -0
- package/dist/types/vue/src/primitives/accordion/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/accordion/index.d.ts +7 -0
- package/dist/types/vue/src/primitives/accordion/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/aspect-ratio/AspectRatio.d.ts +42 -0
- package/dist/types/vue/src/primitives/aspect-ratio/AspectRatio.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/aspect-ratio/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/aspect-ratio/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/checkbox/CheckboxGroupRoot.d.ts +121 -0
- package/dist/types/vue/src/primitives/checkbox/CheckboxGroupRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/checkbox/CheckboxRoot.d.ts +127 -0
- package/dist/types/vue/src/primitives/checkbox/CheckboxRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/checkbox/context.d.ts +14 -0
- package/dist/types/vue/src/primitives/checkbox/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/checkbox/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/checkbox/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleContent.d.ts +45 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleRoot.d.ts +81 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/collapsible/CollapsibleTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collapsible/context.d.ts +10 -0
- package/dist/types/vue/src/primitives/collapsible/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collapsible/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/collapsible/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/collection/index.d.ts +28 -0
- package/dist/types/vue/src/primitives/collection/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldDecrement.vue.d.ts +2 -2
- package/dist/types/vue/src/primitives/number-field/NumberFieldDecrement.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldIncrement.vue.d.ts +2 -2
- package/dist/types/vue/src/primitives/number-field/NumberFieldIncrement.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldInput.vue.d.ts +2 -2
- package/dist/types/vue/src/primitives/number-field/NumberFieldInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +2 -2
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/pagination/PaginationEdge.d.ts +111 -0
- package/dist/types/vue/src/primitives/pagination/PaginationEdge.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pagination/PaginationList.d.ts +30 -0
- package/dist/types/vue/src/primitives/pagination/PaginationList.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pagination/PaginationListItem.d.ts +42 -0
- package/dist/types/vue/src/primitives/pagination/PaginationListItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pagination/PaginationRoot.d.ts +114 -0
- package/dist/types/vue/src/primitives/pagination/PaginationRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pagination/context.d.ts +11 -0
- package/dist/types/vue/src/primitives/pagination/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pagination/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/pagination/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pin-input/PinInputInput.d.ts +52 -0
- package/dist/types/vue/src/primitives/pin-input/PinInputInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pin-input/PinInputRoot.d.ts +149 -0
- package/dist/types/vue/src/primitives/pin-input/PinInputRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pin-input/context.d.ts +20 -0
- package/dist/types/vue/src/primitives/pin-input/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/pin-input/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/pin-input/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/presence/Presence.d.ts +31 -0
- package/dist/types/vue/src/primitives/presence/Presence.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/presence/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/presence/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/presence/usePresence.d.ts +5 -0
- package/dist/types/vue/src/primitives/presence/usePresence.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/primitive/Primitive.d.ts +31 -0
- package/dist/types/vue/src/primitives/primitive/Primitive.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/primitive/Slot.d.ts +6 -0
- package/dist/types/vue/src/primitives/primitive/Slot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/primitive/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/primitive/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/progress/ProgressIndicator.vue.d.ts +14 -0
- package/dist/types/vue/src/primitives/progress/ProgressIndicator.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/progress/ProgressRoot.vue.d.ts +33 -0
- package/dist/types/vue/src/primitives/progress/ProgressRoot.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/progress/context.d.ts +9 -0
- package/dist/types/vue/src/primitives/progress/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/progress/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/progress/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/Radio.d.ts +88 -0
- package/dist/types/vue/src/primitives/radio-group/Radio.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupIndicator.d.ts +43 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupIndicator.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupItem.d.ts +85 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts +119 -0
- package/dist/types/vue/src/primitives/radio-group/RadioGroupRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/context.d.ts +19 -0
- package/dist/types/vue/src/primitives/radio-group/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/radio-group/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/radio-group/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingItem.d.ts +42 -0
- package/dist/types/vue/src/primitives/rating/RatingItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingItemIndicator.d.ts +39 -0
- package/dist/types/vue/src/primitives/rating/RatingItemIndicator.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts +159 -0
- package/dist/types/vue/src/primitives/rating/RatingRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/rating/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/rating/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/rating/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts +38 -0
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusGroup.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusItem.vue.d.ts +21 -0
- package/dist/types/vue/src/primitives/roving-focus/RovingFocusItem.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/roving-focus/context.d.ts +15 -0
- package/dist/types/vue/src/primitives/roving-focus/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/roving-focus/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/roving-focus/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/separator/Separator.vue.d.ts +19 -0
- package/dist/types/vue/src/primitives/separator/Separator.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/separator/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/separator/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderImpl.d.ts +36 -0
- package/dist/types/vue/src/primitives/slider/SliderImpl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderOrientation.d.ts +91 -0
- package/dist/types/vue/src/primitives/slider/SliderOrientation.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts +187 -0
- package/dist/types/vue/src/primitives/slider/SliderRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderThumb.d.ts +33 -0
- package/dist/types/vue/src/primitives/slider/SliderThumb.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/SliderTrack.d.ts +33 -0
- package/dist/types/vue/src/primitives/slider/SliderTrack.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/context.d.ts +22 -0
- package/dist/types/vue/src/primitives/slider/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/slider/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/slider/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/SplitterGroup.d.ts +90 -0
- package/dist/types/vue/src/primitives/splitter/SplitterGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/SplitterPanel.d.ts +113 -0
- package/dist/types/vue/src/primitives/splitter/SplitterPanel.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/SplitterResizeHandle.d.ts +85 -0
- package/dist/types/vue/src/primitives/splitter/SplitterResizeHandle.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/behaviors.d.ts +22 -0
- package/dist/types/vue/src/primitives/splitter/behaviors.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/context.d.ts +23 -0
- package/dist/types/vue/src/primitives/splitter/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/splitter/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/splitter/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/StepperItem.d.ts +63 -0
- package/dist/types/vue/src/primitives/stepper/StepperItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/StepperParts.d.ts +130 -0
- package/dist/types/vue/src/primitives/stepper/StepperParts.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts +91 -0
- package/dist/types/vue/src/primitives/stepper/StepperRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/StepperTrigger.d.ts +33 -0
- package/dist/types/vue/src/primitives/stepper/StepperTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/context.d.ts +23 -0
- package/dist/types/vue/src/primitives/stepper/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/stepper/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/stepper/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/switch/SwitchRoot.d.ts +133 -0
- package/dist/types/vue/src/primitives/switch/SwitchRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/switch/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/switch/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/TabsContent.d.ts +50 -0
- package/dist/types/vue/src/primitives/tabs/TabsContent.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/TabsList.d.ts +42 -0
- package/dist/types/vue/src/primitives/tabs/TabsList.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/TabsRoot.d.ts +101 -0
- package/dist/types/vue/src/primitives/tabs/TabsRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/TabsTrigger.d.ts +55 -0
- package/dist/types/vue/src/primitives/tabs/TabsTrigger.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/context.d.ts +19 -0
- package/dist/types/vue/src/primitives/tabs/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/tabs/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/tabs/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle/Toggle.d.ts +91 -0
- package/dist/types/vue/src/primitives/toggle/Toggle.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle/index.d.ts +2 -0
- package/dist/types/vue/src/primitives/toggle/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle-group/ToggleGroupItem.d.ts +53 -0
- package/dist/types/vue/src/primitives/toggle-group/ToggleGroupItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle-group/ToggleGroupRoot.d.ts +141 -0
- package/dist/types/vue/src/primitives/toggle-group/ToggleGroupRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle-group/context.d.ts +16 -0
- package/dist/types/vue/src/primitives/toggle-group/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toggle-group/index.d.ts +4 -0
- package/dist/types/vue/src/primitives/toggle-group/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarButton.d.ts +43 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarButton.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts +63 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarRoot.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarToggleGroup.d.ts +135 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarToggleGroup.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarToggleItem.d.ts +50 -0
- package/dist/types/vue/src/primitives/toolbar/ToolbarToggleItem.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/context.d.ts +9 -0
- package/dist/types/vue/src/primitives/toolbar/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/toolbar/index.d.ts +6 -0
- package/dist/types/vue/src/primitives/toolbar/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/config.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/createContext.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/createContext.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/renderSlotFragments.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/renderSlotFragments.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/types.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/types.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useComposing.d.ts +8 -0
- package/dist/types/vue/src/primitives/utils/useComposing.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useDirection.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useEmitAsProps.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useEmitAsProps.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useFormControl.d.ts +4 -0
- package/dist/types/vue/src/primitives/utils/useFormControl.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useForwardExpose.d.ts +7 -0
- package/dist/types/vue/src/primitives/utils/useForwardExpose.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useForwardProps.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useForwardProps.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useForwardPropsEmits.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useForwardPropsEmits.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useForwardScopeId.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useForwardScopeId.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useId.d.ts +2 -0
- package/dist/types/vue/src/primitives/utils/useId.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useNonce.d.ts +3 -0
- package/dist/types/vue/src/primitives/utils/useNonce.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useSingleOrMultipleValue.d.ts +12 -0
- package/dist/types/vue/src/primitives/utils/useSingleOrMultipleValue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useSize.d.ts +7 -0
- package/dist/types/vue/src/primitives/utils/useSize.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHidden.vue.d.ts +19 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHidden.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +2 -2
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue.d.ts +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/visually-hidden/index.d.ts +3 -0
- package/dist/types/vue/src/primitives/visually-hidden/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/accordion/Accordion.vue +2 -1
- package/src/components/accordion/AccordionContent.vue +1 -1
- package/src/components/accordion/AccordionItem.vue +1 -1
- package/src/components/accordion/AccordionTrigger.vue +3 -3
- package/src/components/aspect-ratio/AspectRatio.vue +1 -1
- package/src/components/breadcrumb/BreadcrumbItem.vue +2 -1
- package/src/components/button/Button.vue +2 -1
- package/src/components/card/Card.vue +2 -1
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/checkbox-group/CheckboxGroup.vue +1 -1
- package/src/components/chip/Chip.vue +2 -1
- package/src/components/chip/composables/useChipRoot.ts +1 -1
- package/src/components/collapsible/Collapsible.vue +2 -1
- package/src/components/collapsible/CollapsibleContent.vue +1 -1
- package/src/components/collapsible/CollapsibleTrigger.vue +2 -2
- package/src/components/divider/Divider.vue +1 -1
- package/src/components/float-button/FloatButton.vue +4 -11
- package/src/components/float-button/types.ts +3 -2
- package/src/components/heading/Heading.vue +1 -1
- package/src/components/icon-button/IconButton.vue +2 -1
- package/src/components/image/Image.vue +1 -1
- package/src/components/indicator/Indicator.vue +2 -1
- package/src/components/input/InputAction.vue +1 -1
- package/src/components/link/Link.vue +2 -1
- package/src/components/multi-select/MultiSelect.vue +4 -1
- package/src/components/nav-link/NavLink.vue +33 -4
- package/src/components/nav-link/NavLinkChild.ts +57 -0
- package/src/components/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/pagination/Pagination.vue +1 -1
- package/src/components/pagination/PaginationContent.vue +1 -1
- package/src/components/pagination/PaginationControl.vue +6 -1
- package/src/components/pagination/PaginationPage.vue +1 -1
- package/src/components/panel/Panel.vue +1 -1
- package/src/components/pin-input/PinInput.vue +1 -1
- package/src/components/prev-next/PrevNextLink.vue +2 -1
- package/src/components/progress/Progress.vue +1 -1
- package/src/components/prose/Prose.vue +2 -1
- package/src/components/radio-group/RadioGroup.vue +1 -1
- package/src/components/range-slider/RangeSlider.vue +1 -1
- package/src/components/rating/Rating.vue +1 -1
- package/src/components/ring-progress/RingProgress.vue +1 -1
- package/src/components/section/Section.vue +13 -2
- package/src/components/segmented-control/SegmentedControl.vue +2 -1
- package/src/components/sidebar/Sidebar.vue +2 -1
- package/src/components/sidebar/context.ts +9 -0
- package/src/components/slider/Slider.vue +1 -1
- package/src/components/slider/SliderHandle.vue +2 -1
- package/src/components/split-button/types.ts +1 -1
- package/src/components/splitter/Splitter.vue +1 -1
- package/src/components/splitter/SplitterHandle.vue +1 -1
- package/src/components/splitter/SplitterPanel.vue +1 -1
- package/src/components/statistic/Statistic.vue +2 -2
- package/src/components/stepper/Stepper.vue +1 -1
- package/src/components/stepper/StepperStep.vue +1 -1
- package/src/components/switch/Switch.vue +1 -1
- package/src/components/tabs/Tabs.vue +1 -1
- package/src/components/tabs/TabsContent.vue +1 -1
- package/src/components/tabs/TabsList.vue +1 -1
- package/src/components/tabs/TabsTrigger.vue +1 -1
- package/src/components/tag/Tag.vue +2 -1
- package/src/components/text/Text.vue +2 -1
- package/src/components/time/Time.vue +22 -5
- package/src/components/toast/Toaster.vue +1 -0
- package/src/components/toggle/Toggle.vue +2 -1
- package/src/components/toolbar/Toolbar.vue +1 -1
- package/src/components/toolbar/ToolbarButton.vue +1 -1
- package/src/components/toolbar/ToolbarLink.vue +1 -1
- package/src/components/toolbar/ToolbarSeparator.vue +1 -1
- package/src/components/toolbar/ToolbarToggleGroup.vue +2 -1
- package/src/components/toolbar/ToolbarToggleItem.vue +1 -1
- package/src/components/toolbar/types.ts +1 -1
- package/src/components/visually-hidden/VisuallyHidden.vue +4 -18
- package/src/lib/useDirection.ts +2 -1
- package/src/primitives/accordion/AccordionContent.ts +47 -0
- package/src/primitives/accordion/AccordionHeader.ts +35 -0
- package/src/primitives/accordion/AccordionItem.ts +83 -0
- package/src/primitives/accordion/AccordionRoot.ts +75 -0
- package/src/primitives/accordion/AccordionTrigger.ts +55 -0
- package/src/primitives/accordion/LICENSE +44 -0
- package/src/primitives/accordion/context.ts +34 -0
- package/src/primitives/accordion/index.ts +11 -0
- package/src/primitives/aspect-ratio/AspectRatio.ts +47 -0
- package/src/primitives/aspect-ratio/LICENSE +44 -0
- package/src/primitives/aspect-ratio/index.ts +1 -0
- package/src/primitives/checkbox/CheckboxGroupRoot.ts +93 -0
- package/src/primitives/checkbox/CheckboxRoot.ts +170 -0
- package/src/primitives/checkbox/LICENSE +44 -0
- package/src/primitives/checkbox/context.ts +20 -0
- package/src/primitives/checkbox/index.ts +8 -0
- package/src/primitives/collapsible/CollapsibleContent.ts +124 -0
- package/src/primitives/collapsible/CollapsibleRoot.ts +63 -0
- package/src/primitives/collapsible/CollapsibleTrigger.ts +43 -0
- package/src/primitives/collapsible/LICENSE +44 -0
- package/src/primitives/collapsible/context.ts +13 -0
- package/src/primitives/collapsible/index.ts +12 -0
- package/src/primitives/collection/LICENSE +44 -0
- package/src/primitives/collection/index.ts +82 -0
- package/src/primitives/number-field/NumberFieldDecrement.vue +2 -3
- package/src/primitives/number-field/NumberFieldIncrement.vue +2 -3
- package/src/primitives/number-field/NumberFieldInput.vue +2 -3
- package/src/primitives/number-field/NumberFieldRoot.vue +3 -3
- package/src/primitives/pagination/LICENSE +44 -0
- package/src/primitives/pagination/PaginationEdge.ts +77 -0
- package/src/primitives/pagination/PaginationList.ts +46 -0
- package/src/primitives/pagination/PaginationListItem.ts +61 -0
- package/src/primitives/pagination/PaginationRoot.ts +73 -0
- package/src/primitives/pagination/context.ts +14 -0
- package/src/primitives/pagination/index.ts +15 -0
- package/src/primitives/pin-input/LICENSE +44 -0
- package/src/primitives/pin-input/PinInputInput.ts +218 -0
- package/src/primitives/pin-input/PinInputRoot.ts +136 -0
- package/src/primitives/pin-input/context.ts +24 -0
- package/src/primitives/pin-input/index.ts +3 -0
- package/src/primitives/presence/LICENSE +44 -0
- package/src/primitives/presence/Presence.ts +70 -0
- package/src/primitives/presence/index.ts +2 -0
- package/src/primitives/presence/usePresence.ts +28 -0
- package/src/primitives/primitive/LICENSE +44 -0
- package/src/primitives/primitive/Primitive.ts +45 -0
- package/src/primitives/primitive/Slot.ts +22 -0
- package/src/primitives/primitive/index.ts +2 -0
- package/src/primitives/progress/LICENSE +44 -0
- package/src/primitives/progress/ProgressIndicator.vue +24 -0
- package/src/primitives/progress/ProgressRoot.vue +95 -0
- package/src/primitives/progress/context.ts +12 -0
- package/src/primitives/progress/index.ts +7 -0
- package/src/primitives/radio-group/LICENSE +44 -0
- package/src/primitives/radio-group/Radio.ts +110 -0
- package/src/primitives/radio-group/RadioGroupIndicator.ts +54 -0
- package/src/primitives/radio-group/RadioGroupItem.ts +116 -0
- package/src/primitives/radio-group/RadioGroupRoot.ts +108 -0
- package/src/primitives/radio-group/context.ts +25 -0
- package/src/primitives/radio-group/index.ts +9 -0
- package/src/primitives/rating/LICENSE +44 -0
- package/src/primitives/rating/RatingItem.ts +35 -0
- package/src/primitives/rating/RatingItemIndicator.ts +87 -0
- package/src/primitives/rating/RatingRoot.ts +111 -0
- package/src/primitives/rating/context.ts +22 -0
- package/src/primitives/rating/index.ts +9 -0
- package/src/primitives/roving-focus/LICENSE +44 -0
- package/src/primitives/roving-focus/RovingFocusGroup.vue +125 -0
- package/src/primitives/roving-focus/RovingFocusItem.vue +99 -0
- package/src/primitives/roving-focus/context.ts +18 -0
- package/src/primitives/roving-focus/index.ts +7 -0
- package/src/primitives/separator/LICENSE +44 -0
- package/src/primitives/separator/Separator.vue +26 -0
- package/src/primitives/separator/index.ts +1 -0
- package/src/primitives/slider/LICENSE +44 -0
- package/src/primitives/slider/SliderImpl.ts +66 -0
- package/src/primitives/slider/SliderOrientation.ts +100 -0
- package/src/primitives/slider/SliderRoot.ts +214 -0
- package/src/primitives/slider/SliderThumb.ts +139 -0
- package/src/primitives/slider/SliderTrack.ts +37 -0
- package/src/primitives/slider/context.ts +31 -0
- package/src/primitives/slider/index.ts +8 -0
- package/src/primitives/splitter/LICENSE +44 -0
- package/src/primitives/splitter/SplitterGroup.ts +642 -0
- package/src/primitives/splitter/SplitterPanel.ts +170 -0
- package/src/primitives/splitter/SplitterResizeHandle.ts +170 -0
- package/src/primitives/splitter/behaviors.ts +173 -0
- package/src/primitives/splitter/context.ts +33 -0
- package/src/primitives/splitter/index.ts +13 -0
- package/src/primitives/stepper/LICENSE +44 -0
- package/src/primitives/stepper/StepperItem.ts +68 -0
- package/src/primitives/stepper/StepperParts.ts +103 -0
- package/src/primitives/stepper/StepperRoot.ts +171 -0
- package/src/primitives/stepper/StepperTrigger.ts +119 -0
- package/src/primitives/stepper/context.ts +29 -0
- package/src/primitives/stepper/index.ts +17 -0
- package/src/primitives/switch/LICENSE +44 -0
- package/src/primitives/switch/SwitchRoot.ts +151 -0
- package/src/primitives/switch/index.ts +6 -0
- package/src/primitives/tabs/LICENSE +44 -0
- package/src/primitives/tabs/TabsContent.ts +94 -0
- package/src/primitives/tabs/TabsList.ts +52 -0
- package/src/primitives/tabs/TabsRoot.ts +99 -0
- package/src/primitives/tabs/TabsTrigger.ts +97 -0
- package/src/primitives/tabs/context.ts +22 -0
- package/src/primitives/tabs/index.ts +5 -0
- package/src/primitives/toggle/LICENSE +44 -0
- package/src/primitives/toggle/Toggle.ts +116 -0
- package/src/primitives/toggle/index.ts +1 -0
- package/src/primitives/toggle-group/LICENSE +44 -0
- package/src/primitives/toggle-group/ToggleGroupItem.ts +80 -0
- package/src/primitives/toggle-group/ToggleGroupRoot.ts +113 -0
- package/src/primitives/toggle-group/context.ts +19 -0
- package/src/primitives/toggle-group/index.ts +7 -0
- package/src/primitives/toolbar/LICENSE +44 -0
- package/src/primitives/toolbar/ToolbarButton.ts +44 -0
- package/src/primitives/toolbar/ToolbarRoot.ts +53 -0
- package/src/primitives/toolbar/ToolbarToggleGroup.ts +69 -0
- package/src/primitives/toolbar/ToolbarToggleItem.ts +43 -0
- package/src/primitives/toolbar/context.ts +12 -0
- package/src/primitives/toolbar/index.ts +9 -0
- package/src/primitives/utils/config.ts +1 -0
- package/src/primitives/utils/createContext.ts +34 -0
- package/src/primitives/utils/renderSlotFragments.ts +8 -0
- package/src/primitives/utils/types.ts +1 -0
- package/src/primitives/utils/useComposing.ts +44 -0
- package/src/primitives/utils/useDirection.ts +9 -0
- package/src/primitives/utils/useEmitAsProps.ts +13 -0
- package/src/primitives/utils/useFormControl.ts +6 -0
- package/src/primitives/utils/useForwardExpose.ts +78 -0
- package/src/primitives/utils/useForwardProps.ts +29 -0
- package/src/primitives/utils/useForwardPropsEmits.ts +12 -0
- package/src/primitives/utils/useForwardScopeId.ts +6 -0
- package/src/primitives/utils/useId.ts +9 -0
- package/src/primitives/utils/useNonce.ts +7 -0
- package/src/primitives/utils/useSingleOrMultipleValue.ts +36 -0
- package/src/primitives/utils/useSize.ts +25 -0
- package/src/primitives/visually-hidden/VisuallyHidden.vue +30 -0
- package/src/primitives/visually-hidden/VisuallyHiddenInput.ts +1 -1
- package/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue +2 -2
- package/src/primitives/visually-hidden/index.ts +2 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export type PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>
|
|
2
|
+
export type FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>
|
|
3
|
+
|
|
4
|
+
export const POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside'
|
|
5
|
+
export const FOCUS_OUTSIDE = 'dismissableLayer.focusOutside'
|
|
6
|
+
|
|
7
|
+
const layers = new Set<HTMLElement>()
|
|
8
|
+
const blocking = new Set<HTMLElement>()
|
|
9
|
+
const branches = new Set<HTMLElement>()
|
|
10
|
+
const listeners = new Set<() => void>()
|
|
11
|
+
let originalBodyPointerEvents: string | undefined
|
|
12
|
+
let version = 0
|
|
13
|
+
|
|
14
|
+
function changed() {
|
|
15
|
+
version += 1
|
|
16
|
+
for (const listener of listeners) listener()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function subscribeLayers(listener: () => void) {
|
|
20
|
+
listeners.add(listener)
|
|
21
|
+
return () => {
|
|
22
|
+
listeners.delete(listener)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function layersVersion() {
|
|
27
|
+
return version
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function addLayer(element: HTMLElement) {
|
|
31
|
+
layers.add(element)
|
|
32
|
+
changed()
|
|
33
|
+
return () => {
|
|
34
|
+
if (layers.delete(element)) changed()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function addBranch(element: HTMLElement) {
|
|
39
|
+
branches.add(element)
|
|
40
|
+
changed()
|
|
41
|
+
return () => {
|
|
42
|
+
if (branches.delete(element)) changed()
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function blockOutsidePointerEvents(element: HTMLElement) {
|
|
47
|
+
const body = element.ownerDocument.body
|
|
48
|
+
if (blocking.size === 0) {
|
|
49
|
+
originalBodyPointerEvents = body.style.pointerEvents
|
|
50
|
+
body.style.pointerEvents = 'none'
|
|
51
|
+
}
|
|
52
|
+
blocking.add(element)
|
|
53
|
+
changed()
|
|
54
|
+
return () => {
|
|
55
|
+
if (!blocking.delete(element)) return
|
|
56
|
+
if (blocking.size === 0 && originalBodyPointerEvents != null)
|
|
57
|
+
body.style.pointerEvents = originalBodyPointerEvents
|
|
58
|
+
changed()
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function releaseLayer(element: HTMLElement) {
|
|
63
|
+
const removed = layers.delete(element)
|
|
64
|
+
const unblocked = blocking.delete(element)
|
|
65
|
+
if (removed || unblocked) changed()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function blockingLayerCount() {
|
|
69
|
+
return blocking.size
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function layerIndex(element: HTMLElement | null | undefined) {
|
|
73
|
+
return element ? [...layers].indexOf(element) : -1
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function isHighestLayer(element: HTMLElement | null | undefined) {
|
|
77
|
+
return layerIndex(element) === layers.size - 1
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function bodyPointerEventsDisabled() {
|
|
81
|
+
return blocking.size > 0
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function pointerEventsEnabled(element: HTMLElement | null | undefined) {
|
|
85
|
+
const highest = [...blocking].at(-1)
|
|
86
|
+
return layerIndex(element) >= (highest ? [...layers].indexOf(highest) : -1)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function layerPointerEvents(element: HTMLElement | null | undefined) {
|
|
90
|
+
if (!bodyPointerEventsDisabled()) return undefined
|
|
91
|
+
return pointerEventsEnabled(element) ? 'auto' : 'none'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function inBranch(target: EventTarget | null) {
|
|
95
|
+
return [...branches].some(branch => branch.contains(target as Node | null))
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function isLayerExist(layer: HTMLElement, target: EventTarget | null) {
|
|
99
|
+
if (!(target instanceof Element)) return false
|
|
100
|
+
const targetLayer = target.closest('[data-dismissable-layer]')
|
|
101
|
+
const mainLayer =
|
|
102
|
+
layer.dataset.dismissableLayer === ''
|
|
103
|
+
? layer
|
|
104
|
+
: layer.querySelector<HTMLElement>('[data-dismissable-layer]')
|
|
105
|
+
const all = Array.from(layer.ownerDocument.querySelectorAll('[data-dismissable-layer]'))
|
|
106
|
+
return (
|
|
107
|
+
!!targetLayer &&
|
|
108
|
+
!!mainLayer &&
|
|
109
|
+
(mainLayer === targetLayer || all.indexOf(mainLayer) < all.indexOf(targetLayer))
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function handleAndDispatchCustomEvent<E extends CustomEvent<{ originalEvent: Event }>>(
|
|
114
|
+
name: string,
|
|
115
|
+
handler: ((event: E) => void) | undefined,
|
|
116
|
+
detail: E['detail'],
|
|
117
|
+
) {
|
|
118
|
+
const target = detail.originalEvent.target as EventTarget
|
|
119
|
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail })
|
|
120
|
+
if (handler) target.addEventListener(name, handler as EventListener, { once: true })
|
|
121
|
+
target.dispatchEvent(event)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface OutsideWatcher<E> {
|
|
125
|
+
element: () => HTMLElement | null | undefined
|
|
126
|
+
onOutside: (event: E) => void
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function watchPointerDownOutside({
|
|
130
|
+
element,
|
|
131
|
+
onOutside,
|
|
132
|
+
}: OutsideWatcher<PointerDownOutsideEvent>) {
|
|
133
|
+
const ownerDocument = element()?.ownerDocument ?? globalThis.document
|
|
134
|
+
let inside = false
|
|
135
|
+
let pendingClick: () => void = () => {}
|
|
136
|
+
|
|
137
|
+
const handlePointerDown = (event: PointerEvent) => {
|
|
138
|
+
const layer = element()
|
|
139
|
+
const target = event.target as HTMLElement | null
|
|
140
|
+
if (!layer || !target) return
|
|
141
|
+
if (isLayerExist(layer, target)) {
|
|
142
|
+
inside = false
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
if (!inside) {
|
|
146
|
+
const dispatch = () =>
|
|
147
|
+
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, onOutside, { originalEvent: event })
|
|
148
|
+
if (event.pointerType === 'touch') {
|
|
149
|
+
ownerDocument.removeEventListener('click', pendingClick)
|
|
150
|
+
pendingClick = dispatch
|
|
151
|
+
ownerDocument.addEventListener('click', pendingClick, { once: true })
|
|
152
|
+
} else dispatch()
|
|
153
|
+
} else ownerDocument.removeEventListener('click', pendingClick)
|
|
154
|
+
inside = false
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const timer = window.setTimeout(() => {
|
|
158
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown)
|
|
159
|
+
}, 0)
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
onPointerDownCapture() {
|
|
163
|
+
inside = true
|
|
164
|
+
},
|
|
165
|
+
stop() {
|
|
166
|
+
window.clearTimeout(timer)
|
|
167
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown)
|
|
168
|
+
ownerDocument.removeEventListener('click', pendingClick)
|
|
169
|
+
},
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function watchFocusOutside({
|
|
174
|
+
element,
|
|
175
|
+
onOutside,
|
|
176
|
+
settle,
|
|
177
|
+
}: OutsideWatcher<FocusOutsideEvent> & { settle?: () => Promise<void> }) {
|
|
178
|
+
const ownerDocument = element()?.ownerDocument ?? globalThis.document
|
|
179
|
+
let inside = false
|
|
180
|
+
|
|
181
|
+
const handleFocus = async (event: FocusEvent) => {
|
|
182
|
+
if (!element()) return
|
|
183
|
+
if (settle) await settle()
|
|
184
|
+
const layer = element()
|
|
185
|
+
const target = event.target as HTMLElement | null
|
|
186
|
+
if (!layer || !target || isLayerExist(layer, target)) return
|
|
187
|
+
if (!inside) handleAndDispatchCustomEvent(FOCUS_OUTSIDE, onOutside, { originalEvent: event })
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
ownerDocument.addEventListener('focusin', handleFocus)
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
onFocusCapture() {
|
|
194
|
+
inside = true
|
|
195
|
+
},
|
|
196
|
+
onBlurCapture() {
|
|
197
|
+
inside = false
|
|
198
|
+
},
|
|
199
|
+
stop() {
|
|
200
|
+
ownerDocument.removeEventListener('focusin', handleFocus)
|
|
201
|
+
},
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -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,24 @@
|
|
|
1
|
+
const GUARD = 'data-reka-focus-guard'
|
|
2
|
+
let count = 0
|
|
3
|
+
|
|
4
|
+
function createFocusGuard() {
|
|
5
|
+
const element = document.createElement('span')
|
|
6
|
+
element.setAttribute(GUARD, '')
|
|
7
|
+
element.tabIndex = 0
|
|
8
|
+
element.style.outline = 'none'
|
|
9
|
+
element.style.opacity = '0'
|
|
10
|
+
element.style.position = 'fixed'
|
|
11
|
+
element.style.pointerEvents = 'none'
|
|
12
|
+
return element
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function installFocusGuards() {
|
|
16
|
+
const edges = document.querySelectorAll(`[${GUARD}]`)
|
|
17
|
+
document.body.insertAdjacentElement('afterbegin', edges[0] ?? createFocusGuard())
|
|
18
|
+
document.body.insertAdjacentElement('beforeend', edges[1] ?? createFocusGuard())
|
|
19
|
+
count += 1
|
|
20
|
+
return () => {
|
|
21
|
+
if (count === 1) for (const node of document.querySelectorAll(`[${GUARD}]`)) node.remove()
|
|
22
|
+
count -= 1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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,216 @@
|
|
|
1
|
+
export const AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount'
|
|
2
|
+
export const AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount'
|
|
3
|
+
const EVENT_OPTIONS = { bubbles: false, cancelable: true }
|
|
4
|
+
|
|
5
|
+
type FocusableTarget = HTMLElement | { focus: (options?: FocusOptions) => void }
|
|
6
|
+
|
|
7
|
+
export interface FocusScopeAPI {
|
|
8
|
+
paused: boolean
|
|
9
|
+
pause: () => void
|
|
10
|
+
resume: () => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createFocusScopeAPI(onChange?: () => void): FocusScopeAPI {
|
|
14
|
+
return {
|
|
15
|
+
paused: false,
|
|
16
|
+
pause() {
|
|
17
|
+
this.paused = true
|
|
18
|
+
onChange?.()
|
|
19
|
+
},
|
|
20
|
+
resume() {
|
|
21
|
+
this.paused = false
|
|
22
|
+
onChange?.()
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let stack: FocusScopeAPI[] = []
|
|
28
|
+
|
|
29
|
+
function without<T>(array: T[], item: T) {
|
|
30
|
+
return array.filter(entry => entry !== item)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const focusScopesStack = {
|
|
34
|
+
add(scope: FocusScopeAPI) {
|
|
35
|
+
const active = stack[0]
|
|
36
|
+
if (scope !== active) active?.pause()
|
|
37
|
+
stack = without(stack, scope)
|
|
38
|
+
stack.unshift(scope)
|
|
39
|
+
},
|
|
40
|
+
remove(scope: FocusScopeAPI) {
|
|
41
|
+
stack = without(stack, scope)
|
|
42
|
+
stack[0]?.resume()
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function getActiveElement(): Element | null {
|
|
47
|
+
let active = document.activeElement
|
|
48
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement
|
|
49
|
+
return active ?? null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function isSelectableInput(
|
|
53
|
+
element: unknown,
|
|
54
|
+
): element is HTMLInputElement & { select: () => void } {
|
|
55
|
+
return element instanceof HTMLInputElement && 'select' in element
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function focus(element?: FocusableTarget | null, { select = false } = {}) {
|
|
59
|
+
if (!element?.focus) return
|
|
60
|
+
const previous = getActiveElement()
|
|
61
|
+
element.focus({ preventScroll: true })
|
|
62
|
+
if (element !== previous && isSelectableInput(element) && select) element.select()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function focusFirst(candidates: HTMLElement[], { select = false } = {}) {
|
|
66
|
+
const previous = getActiveElement()
|
|
67
|
+
for (const candidate of candidates) {
|
|
68
|
+
focus(candidate, { select })
|
|
69
|
+
if (getActiveElement() !== previous) return true
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getTabbableCandidates(container: HTMLElement) {
|
|
74
|
+
const nodes: HTMLElement[] = []
|
|
75
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
76
|
+
acceptNode: node => {
|
|
77
|
+
const element = node as HTMLInputElement
|
|
78
|
+
const hiddenInput = element.tagName === 'INPUT' && element.type === 'hidden'
|
|
79
|
+
if (element.disabled || element.hidden || hiddenInput) return NodeFilter.FILTER_SKIP
|
|
80
|
+
return element.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement)
|
|
84
|
+
return nodes
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {
|
|
88
|
+
if (getComputedStyle(node).visibility === 'hidden') return true
|
|
89
|
+
let current: HTMLElement | null = node
|
|
90
|
+
while (current) {
|
|
91
|
+
if (upTo !== undefined && current === upTo) return false
|
|
92
|
+
if (getComputedStyle(current).display === 'none') return true
|
|
93
|
+
current = current.parentElement
|
|
94
|
+
}
|
|
95
|
+
return false
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function findVisible(elements: HTMLElement[], container: HTMLElement) {
|
|
99
|
+
return elements.find(element => !isHidden(element, { upTo: container }))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function getTabbableEdges(container: HTMLElement) {
|
|
103
|
+
const candidates = getTabbableCandidates(container)
|
|
104
|
+
return [
|
|
105
|
+
findVisible(candidates, container),
|
|
106
|
+
findVisible([...candidates].reverse(), container),
|
|
107
|
+
] as const
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function removeLinks(items: HTMLElement[]) {
|
|
111
|
+
return items.filter(item => item.tagName !== 'A')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function trapFocus(container: HTMLElement, scope: FocusScopeAPI) {
|
|
115
|
+
let lastFocused: HTMLElement | null = null
|
|
116
|
+
|
|
117
|
+
const handleFocusIn = (event: FocusEvent) => {
|
|
118
|
+
if (scope.paused) return
|
|
119
|
+
const target = event.target as HTMLElement | null
|
|
120
|
+
if (container.contains(target)) lastFocused = target
|
|
121
|
+
else focus(lastFocused, { select: true })
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const handleFocusOut = (event: FocusEvent) => {
|
|
125
|
+
if (scope.paused) return
|
|
126
|
+
const related = event.relatedTarget as HTMLElement | null
|
|
127
|
+
if (related === null) return
|
|
128
|
+
if (!container.contains(related)) focus(lastFocused, { select: true })
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const handleMutations = (mutations: MutationRecord[]) => {
|
|
132
|
+
if (lastFocused === null) return
|
|
133
|
+
if (!mutations.some(mutation => mutation.removedNodes.length > 0)) return
|
|
134
|
+
const active = getActiveElement()
|
|
135
|
+
if (active && container.contains(active)) return
|
|
136
|
+
if (!container.contains(lastFocused)) focus(container)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
document.addEventListener('focusin', handleFocusIn)
|
|
140
|
+
document.addEventListener('focusout', handleFocusOut)
|
|
141
|
+
const observer = new MutationObserver(handleMutations)
|
|
142
|
+
observer.observe(container, { childList: true, subtree: true })
|
|
143
|
+
|
|
144
|
+
return () => {
|
|
145
|
+
document.removeEventListener('focusin', handleFocusIn)
|
|
146
|
+
document.removeEventListener('focusout', handleFocusOut)
|
|
147
|
+
observer.disconnect()
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function dispatchMountAutoFocus(
|
|
152
|
+
container: HTMLElement,
|
|
153
|
+
previous: Element | null,
|
|
154
|
+
onMountAutoFocus?: (event: Event) => void,
|
|
155
|
+
) {
|
|
156
|
+
const event = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS)
|
|
157
|
+
const handler = (mountEvent: Event) => onMountAutoFocus?.(mountEvent)
|
|
158
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, handler)
|
|
159
|
+
container.dispatchEvent(event)
|
|
160
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, handler)
|
|
161
|
+
if (!event.defaultPrevented) {
|
|
162
|
+
focusFirst(getTabbableCandidates(container), { select: true })
|
|
163
|
+
if (getActiveElement() === previous) focus(container)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function dispatchUnmountAutoFocus(
|
|
168
|
+
container: HTMLElement,
|
|
169
|
+
previous: Element | null,
|
|
170
|
+
scope: FocusScopeAPI,
|
|
171
|
+
onUnmountAutoFocus?: (event: Event) => void,
|
|
172
|
+
) {
|
|
173
|
+
const event = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS)
|
|
174
|
+
const handler = (unmountEvent: Event) => onUnmountAutoFocus?.(unmountEvent)
|
|
175
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, handler)
|
|
176
|
+
container.dispatchEvent(event)
|
|
177
|
+
container.setAttribute('data-focus-scope-unmounting', '')
|
|
178
|
+
setTimeout(() => {
|
|
179
|
+
if (!event.defaultPrevented)
|
|
180
|
+
focus((previous as HTMLElement | null) ?? document.body, { select: true })
|
|
181
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, handler)
|
|
182
|
+
focusScopesStack.remove(scope)
|
|
183
|
+
container.removeAttribute('data-focus-scope-unmounting')
|
|
184
|
+
}, 0)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface FocusScopeKeyEvent {
|
|
188
|
+
key: string
|
|
189
|
+
altKey: boolean
|
|
190
|
+
ctrlKey: boolean
|
|
191
|
+
metaKey: boolean
|
|
192
|
+
shiftKey: boolean
|
|
193
|
+
currentTarget: EventTarget | null
|
|
194
|
+
preventDefault: () => void
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function handleFocusScopeKeyDown(
|
|
198
|
+
event: FocusScopeKeyEvent,
|
|
199
|
+
{ loop, trapped, scope }: { loop: boolean; trapped: boolean; scope: FocusScopeAPI },
|
|
200
|
+
) {
|
|
201
|
+
if ((!loop && !trapped) || scope.paused) return
|
|
202
|
+
const tab = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey
|
|
203
|
+
const focused = getActiveElement()
|
|
204
|
+
if (!tab || !focused) return
|
|
205
|
+
const container = event.currentTarget as HTMLElement
|
|
206
|
+
const [first, last] = getTabbableEdges(container)
|
|
207
|
+
if (!first || !last) {
|
|
208
|
+
if (focused === container) event.preventDefault()
|
|
209
|
+
} else if (!event.shiftKey && focused === last) {
|
|
210
|
+
event.preventDefault()
|
|
211
|
+
if (loop) focus(first, { select: true })
|
|
212
|
+
} else if (event.shiftKey && focused === first) {
|
|
213
|
+
event.preventDefault()
|
|
214
|
+
if (loop) focus(last, { select: true })
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -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,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,99 @@
|
|
|
1
|
+
export type PaginationItems = Array<{ type: 'ellipsis' } | { type: 'page'; value: number }>
|
|
2
|
+
|
|
3
|
+
function range(start: number, end: number) {
|
|
4
|
+
const length = end - start + 1
|
|
5
|
+
return Array.from({ length }, (_, idx) => idx + start)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function transform(items: (string | number)[]): PaginationItems {
|
|
9
|
+
return items.map(value => {
|
|
10
|
+
if (typeof value === 'number') return { type: 'page', value }
|
|
11
|
+
return { type: 'ellipsis' }
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ELLIPSIS = 'ellipsis'
|
|
16
|
+
|
|
17
|
+
export function getRange(
|
|
18
|
+
currentPage: number,
|
|
19
|
+
pageCount: number,
|
|
20
|
+
siblingCount: number,
|
|
21
|
+
showEdges: boolean,
|
|
22
|
+
) {
|
|
23
|
+
const firstPageIndex = 1
|
|
24
|
+
const lastPageIndex = pageCount
|
|
25
|
+
|
|
26
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, firstPageIndex)
|
|
27
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, lastPageIndex)
|
|
28
|
+
|
|
29
|
+
if (showEdges) {
|
|
30
|
+
const totalPageNumbers = Math.min(2 * siblingCount + 5, pageCount)
|
|
31
|
+
|
|
32
|
+
const itemCount = totalPageNumbers - 2
|
|
33
|
+
|
|
34
|
+
const showLeftEllipsis =
|
|
35
|
+
leftSiblingIndex > firstPageIndex + 2 &&
|
|
36
|
+
Math.abs(lastPageIndex - itemCount - firstPageIndex + 1) > 2 &&
|
|
37
|
+
Math.abs(leftSiblingIndex - firstPageIndex) > 2
|
|
38
|
+
|
|
39
|
+
const showRightEllipsis =
|
|
40
|
+
rightSiblingIndex < lastPageIndex - 2 &&
|
|
41
|
+
Math.abs(lastPageIndex - itemCount) > 2 &&
|
|
42
|
+
Math.abs(lastPageIndex - rightSiblingIndex) > 2
|
|
43
|
+
|
|
44
|
+
if (!showLeftEllipsis && showRightEllipsis) {
|
|
45
|
+
const leftRange = range(1, itemCount)
|
|
46
|
+
|
|
47
|
+
return [...leftRange, ELLIPSIS, lastPageIndex]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (showLeftEllipsis && !showRightEllipsis) {
|
|
51
|
+
const rightRange = range(lastPageIndex - itemCount + 1, lastPageIndex)
|
|
52
|
+
|
|
53
|
+
return [firstPageIndex, ELLIPSIS, ...rightRange]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (showLeftEllipsis && showRightEllipsis) {
|
|
57
|
+
const middleRange = range(leftSiblingIndex, rightSiblingIndex)
|
|
58
|
+
|
|
59
|
+
return [firstPageIndex, ELLIPSIS, ...middleRange, ELLIPSIS, lastPageIndex]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const fullRange = range(firstPageIndex, lastPageIndex)
|
|
63
|
+
return fullRange
|
|
64
|
+
} else {
|
|
65
|
+
const itemCount = siblingCount * 2 + 1
|
|
66
|
+
|
|
67
|
+
if (pageCount < itemCount) return range(1, lastPageIndex)
|
|
68
|
+
else if (currentPage <= siblingCount + 1) return range(firstPageIndex, itemCount)
|
|
69
|
+
else if (pageCount - currentPage <= siblingCount)
|
|
70
|
+
return range(pageCount - itemCount + 1, lastPageIndex)
|
|
71
|
+
else return range(leftSiblingIndex, rightSiblingIndex)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type PaginationEdge = 'first' | 'prev' | 'next' | 'last'
|
|
76
|
+
|
|
77
|
+
export function paginationPageCount(total: number, itemsPerPage: number) {
|
|
78
|
+
return Math.max(1, Math.ceil(total / (itemsPerPage || 1)))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function paginationEdgeDisabled(
|
|
82
|
+
edge: PaginationEdge,
|
|
83
|
+
page: number,
|
|
84
|
+
pageCount: number,
|
|
85
|
+
disabled: boolean,
|
|
86
|
+
) {
|
|
87
|
+
return (edge === 'first' || edge === 'prev' ? page === 1 : page === pageCount) || disabled
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function paginationEdgeTarget(edge: PaginationEdge, page: number, pageCount: number) {
|
|
91
|
+
return edge === 'first' ? 1 : edge === 'prev' ? page - 1 : edge === 'next' ? page + 1 : pageCount
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const PAGINATION_EDGES: Record<PaginationEdge, { label: string; fallback: string }> = {
|
|
95
|
+
first: { label: 'First Page', fallback: 'First page' },
|
|
96
|
+
prev: { label: 'Previous Page', fallback: 'Prev page' },
|
|
97
|
+
next: { label: 'Next Page', fallback: 'Next page' },
|
|
98
|
+
last: { label: 'Last Page', fallback: 'Last page' },
|
|
99
|
+
}
|
|
@@ -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.
|