@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,642 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
normalizeStyle,
|
|
6
|
+
ref,
|
|
7
|
+
renderSlot,
|
|
8
|
+
toRefs,
|
|
9
|
+
watch,
|
|
10
|
+
watchEffect,
|
|
11
|
+
withCtx,
|
|
12
|
+
type PropType,
|
|
13
|
+
} from 'vue'
|
|
14
|
+
import { areEqual } from '../../../../shared/src/primitives/splitter/arrays'
|
|
15
|
+
import { assert } from '../../../../shared/src/primitives/splitter/assert'
|
|
16
|
+
import {
|
|
17
|
+
calculateDeltaPercentage,
|
|
18
|
+
calculateUnsafeDefaultLayout,
|
|
19
|
+
} from '../../../../shared/src/primitives/splitter/calculate'
|
|
20
|
+
import { callPanelCallbacks } from '../../../../shared/src/primitives/splitter/callPanelCallbacks'
|
|
21
|
+
import { fuzzyCompareNumbers } from '../../../../shared/src/primitives/splitter/compare'
|
|
22
|
+
import { debounce } from '../../../../shared/src/primitives/splitter/debounce'
|
|
23
|
+
import { getResizeHandleElement } from '../../../../shared/src/primitives/splitter/dom'
|
|
24
|
+
import {
|
|
25
|
+
getResizeEventCursorPosition,
|
|
26
|
+
isKeyDown,
|
|
27
|
+
isMouseEvent,
|
|
28
|
+
isTouchEvent,
|
|
29
|
+
} from '../../../../shared/src/primitives/splitter/events'
|
|
30
|
+
import {
|
|
31
|
+
EXCEEDED_HORIZONTAL_MAX,
|
|
32
|
+
EXCEEDED_HORIZONTAL_MIN,
|
|
33
|
+
EXCEEDED_VERTICAL_MAX,
|
|
34
|
+
EXCEEDED_VERTICAL_MIN,
|
|
35
|
+
} from '../../../../shared/src/primitives/splitter/flags'
|
|
36
|
+
import {
|
|
37
|
+
adjustLayoutByDelta,
|
|
38
|
+
compareLayouts,
|
|
39
|
+
} from '../../../../shared/src/primitives/splitter/layout'
|
|
40
|
+
import { determinePivotIndices } from '../../../../shared/src/primitives/splitter/pivot'
|
|
41
|
+
import { reportConstraintsViolation } from '../../../../shared/src/primitives/splitter/registry'
|
|
42
|
+
import {
|
|
43
|
+
initializeDefaultStorage,
|
|
44
|
+
loadPanelGroupState,
|
|
45
|
+
savePanelGroupState,
|
|
46
|
+
} from '../../../../shared/src/primitives/splitter/storage'
|
|
47
|
+
import { computePanelFlexBoxStyle } from '../../../../shared/src/primitives/splitter/style'
|
|
48
|
+
import type {
|
|
49
|
+
Direction,
|
|
50
|
+
DragState,
|
|
51
|
+
PanelConstraints,
|
|
52
|
+
PanelData,
|
|
53
|
+
PanelGroupStorage,
|
|
54
|
+
ResizeEvent,
|
|
55
|
+
} from '../../../../shared/src/primitives/splitter/types'
|
|
56
|
+
import {
|
|
57
|
+
convertPanelConstraintsToPercent,
|
|
58
|
+
hasPixelSizedPanel,
|
|
59
|
+
recalculateLayoutForPixelPanels,
|
|
60
|
+
} from '../../../../shared/src/primitives/splitter/units'
|
|
61
|
+
import { validatePanelGroupLayout } from '../../../../shared/src/primitives/splitter/validation'
|
|
62
|
+
import { Primitive, type PrimitiveProps } from '../primitive'
|
|
63
|
+
import { useDirection } from '../utils/useDirection'
|
|
64
|
+
import { useForwardExpose } from '../utils/useForwardExpose'
|
|
65
|
+
import { useId } from '../utils/useId'
|
|
66
|
+
import { useWindowSplitterPanelGroupBehavior, type EagerValues } from './behaviors'
|
|
67
|
+
import { providePanelGroupContext } from './context'
|
|
68
|
+
|
|
69
|
+
const LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100
|
|
70
|
+
|
|
71
|
+
const defaultStorage: PanelGroupStorage = {
|
|
72
|
+
getItem: name => {
|
|
73
|
+
initializeDefaultStorage(defaultStorage)
|
|
74
|
+
return defaultStorage.getItem(name)
|
|
75
|
+
},
|
|
76
|
+
setItem: (name, value) => {
|
|
77
|
+
initializeDefaultStorage(defaultStorage)
|
|
78
|
+
defaultStorage.setItem(name, value)
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface SplitterGroupProps {
|
|
83
|
+
id?: string | null
|
|
84
|
+
autoSaveId?: string | null
|
|
85
|
+
direction: Direction
|
|
86
|
+
keyboardResizeBy?: number | null
|
|
87
|
+
storage?: PanelGroupStorage
|
|
88
|
+
asChild?: boolean
|
|
89
|
+
as?: PrimitiveProps['as']
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type SplitterGroupEmits = {
|
|
93
|
+
layout: [value: number[]]
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const SplitterGroup = defineComponent({
|
|
97
|
+
name: 'SplitterGroup',
|
|
98
|
+
props: {
|
|
99
|
+
id: { type: [String, null] as PropType<string | null>, required: false },
|
|
100
|
+
autoSaveId: { type: [String, null] as PropType<string | null>, required: false, default: null },
|
|
101
|
+
direction: { type: String as PropType<Direction>, required: true },
|
|
102
|
+
keyboardResizeBy: {
|
|
103
|
+
type: [Number, null] as PropType<number | null>,
|
|
104
|
+
required: false,
|
|
105
|
+
default: 10,
|
|
106
|
+
},
|
|
107
|
+
storage: {
|
|
108
|
+
type: Object as PropType<PanelGroupStorage>,
|
|
109
|
+
required: false,
|
|
110
|
+
default: () => defaultStorage,
|
|
111
|
+
},
|
|
112
|
+
asChild: { type: Boolean, required: false },
|
|
113
|
+
as: { type: null as unknown as PropType<PrimitiveProps['as']>, required: false },
|
|
114
|
+
},
|
|
115
|
+
emits: ['layout'],
|
|
116
|
+
setup(props, { emit, slots }) {
|
|
117
|
+
const debounceMap: Record<string, (...args: Parameters<typeof savePanelGroupState>) => void> =
|
|
118
|
+
{}
|
|
119
|
+
const { direction } = toRefs(props)
|
|
120
|
+
const groupId = useId(props.id, 'reka-splitter-group')
|
|
121
|
+
const dir = useDirection()
|
|
122
|
+
const { forwardRef, currentElement: panelGroupElementRef } = useForwardExpose()
|
|
123
|
+
const dragState = ref<DragState | null>(null)
|
|
124
|
+
const groupSizeInPixels = ref<number | null>(null)
|
|
125
|
+
const groupSizeAtLastLayoutInit = ref<number | null>(null)
|
|
126
|
+
const layout = ref<number[]>([])
|
|
127
|
+
const panelIdToLastNotifiedSizeMapRef = ref<Record<string, number>>({})
|
|
128
|
+
const panelSizeBeforeCollapseRef = ref(new Map<string, number>())
|
|
129
|
+
const prevDeltaRef = ref(0)
|
|
130
|
+
|
|
131
|
+
const committedValuesRef = computed(() => ({
|
|
132
|
+
autoSaveId: props.autoSaveId,
|
|
133
|
+
direction: props.direction,
|
|
134
|
+
dragState: dragState.value,
|
|
135
|
+
id: groupId,
|
|
136
|
+
keyboardResizeBy: props.keyboardResizeBy,
|
|
137
|
+
storage: props.storage,
|
|
138
|
+
}))
|
|
139
|
+
|
|
140
|
+
const eagerValuesRef = ref<EagerValues>({
|
|
141
|
+
layout: layout.value,
|
|
142
|
+
panelDataArray: [],
|
|
143
|
+
panelDataArrayChanged: false,
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
function getGroupSizeInPixels() {
|
|
147
|
+
if (groupSizeInPixels.value != null) return groupSizeInPixels.value
|
|
148
|
+
const element = panelGroupElementRef.value
|
|
149
|
+
if (element && element instanceof HTMLElement) {
|
|
150
|
+
const rect = element.getBoundingClientRect()
|
|
151
|
+
const size = direction.value === 'horizontal' ? rect.width : rect.height
|
|
152
|
+
if (!Number.isNaN(size)) {
|
|
153
|
+
groupSizeInPixels.value = size
|
|
154
|
+
return size
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return null
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getPanelConstraintsInPercent(groupSizeOverride?: number | null) {
|
|
161
|
+
const groupSize = groupSizeOverride ?? getGroupSizeInPixels()
|
|
162
|
+
return convertPanelConstraintsToPercent({
|
|
163
|
+
panelDataArray: eagerValuesRef.value.panelDataArray,
|
|
164
|
+
groupSizeInPixels: groupSize,
|
|
165
|
+
})
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function getPanelDataWithPercentConstraints(groupSizeOverride?: number | null) {
|
|
169
|
+
const percentConstraints = getPanelConstraintsInPercent(groupSizeOverride)
|
|
170
|
+
if (!percentConstraints) return null
|
|
171
|
+
return eagerValuesRef.value.panelDataArray.map((panelData, index) => ({
|
|
172
|
+
...panelData,
|
|
173
|
+
constraints: percentConstraints[index]!,
|
|
174
|
+
}))
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const setLayout = (value: number[]) => (layout.value = value)
|
|
178
|
+
|
|
179
|
+
function convertLayoutToNativeUnits(internalLayout: number[]) {
|
|
180
|
+
const { panelDataArray } = eagerValuesRef.value
|
|
181
|
+
const groupSize = getGroupSizeInPixels()
|
|
182
|
+
return internalLayout.map((size, index) => {
|
|
183
|
+
const panelData = panelDataArray[index]
|
|
184
|
+
if (panelData && (panelData.constraints.sizeUnit ?? '%') === 'px' && groupSize != null)
|
|
185
|
+
return (size / 100) * groupSize
|
|
186
|
+
return size
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function commitLayout(nextLayout: number[], panelDataArray: PanelData[]) {
|
|
191
|
+
setLayout(nextLayout)
|
|
192
|
+
eagerValuesRef.value.layout = nextLayout
|
|
193
|
+
emit('layout', convertLayoutToNativeUnits(nextLayout))
|
|
194
|
+
callPanelCallbacks(
|
|
195
|
+
panelDataArray,
|
|
196
|
+
nextLayout,
|
|
197
|
+
panelIdToLastNotifiedSizeMapRef.value,
|
|
198
|
+
getGroupSizeInPixels(),
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
useWindowSplitterPanelGroupBehavior({
|
|
203
|
+
eagerValuesRef,
|
|
204
|
+
groupId,
|
|
205
|
+
layout,
|
|
206
|
+
panelGroupElement: panelGroupElementRef,
|
|
207
|
+
setLayout,
|
|
208
|
+
getPanelDataWithPercentConstraints,
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
watchEffect(onCleanup => {
|
|
212
|
+
const element = panelGroupElementRef.value
|
|
213
|
+
if (!element) return
|
|
214
|
+
if (typeof ResizeObserver !== 'function') return
|
|
215
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
216
|
+
const entry = entries[0]
|
|
217
|
+
if (!entry) return
|
|
218
|
+
const { height, width } = entry.contentRect
|
|
219
|
+
const nextSize = direction.value === 'horizontal' ? width : height
|
|
220
|
+
if (!Number.isNaN(nextSize)) groupSizeInPixels.value = nextSize
|
|
221
|
+
})
|
|
222
|
+
if (element instanceof HTMLElement) resizeObserver.observe(element)
|
|
223
|
+
onCleanup(() => resizeObserver.disconnect())
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
watchEffect(() => {
|
|
227
|
+
const { panelDataArray } = eagerValuesRef.value
|
|
228
|
+
const { autoSaveId } = props
|
|
229
|
+
if (!autoSaveId) return
|
|
230
|
+
if (layout.value.length === 0 || layout.value.length !== panelDataArray.length) return
|
|
231
|
+
let debouncedSave = debounceMap[autoSaveId]
|
|
232
|
+
if (!debouncedSave) {
|
|
233
|
+
debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL)
|
|
234
|
+
debounceMap[autoSaveId] = debouncedSave
|
|
235
|
+
}
|
|
236
|
+
debouncedSave(
|
|
237
|
+
autoSaveId,
|
|
238
|
+
[...panelDataArray],
|
|
239
|
+
new Map(panelSizeBeforeCollapseRef.value),
|
|
240
|
+
layout.value,
|
|
241
|
+
props.storage,
|
|
242
|
+
)
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
function getPanelStyle(panelData: PanelData, defaultSize: number | undefined) {
|
|
246
|
+
const { panelDataArray } = eagerValuesRef.value
|
|
247
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData)
|
|
248
|
+
return computePanelFlexBoxStyle({
|
|
249
|
+
defaultSize,
|
|
250
|
+
dragState: dragState.value,
|
|
251
|
+
layout: layout.value,
|
|
252
|
+
panelData: panelDataArray,
|
|
253
|
+
panelIndex,
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function registerPanel(panelData: PanelData) {
|
|
258
|
+
const { panelDataArray } = eagerValuesRef.value
|
|
259
|
+
panelDataArray.push(panelData)
|
|
260
|
+
panelDataArray.sort((panelA, panelB) => {
|
|
261
|
+
const orderA = panelA.order
|
|
262
|
+
const orderB = panelB.order
|
|
263
|
+
if (orderA == null && orderB == null) return 0
|
|
264
|
+
if (orderA == null) return -1
|
|
265
|
+
if (orderB == null) return 1
|
|
266
|
+
return orderA - orderB
|
|
267
|
+
})
|
|
268
|
+
eagerValuesRef.value.panelDataArrayChanged = true
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
watch(
|
|
272
|
+
() => eagerValuesRef.value.panelDataArrayChanged,
|
|
273
|
+
() => {
|
|
274
|
+
if (!eagerValuesRef.value.panelDataArrayChanged) return
|
|
275
|
+
eagerValuesRef.value.panelDataArrayChanged = false
|
|
276
|
+
const { autoSaveId, storage } = committedValuesRef.value
|
|
277
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
278
|
+
let unsafeLayout: number[] | null = null
|
|
279
|
+
if (autoSaveId) {
|
|
280
|
+
const state = loadPanelGroupState(autoSaveId, panelDataArray, storage)
|
|
281
|
+
if (state) {
|
|
282
|
+
panelSizeBeforeCollapseRef.value = new Map(Object.entries(state.expandToSizes))
|
|
283
|
+
unsafeLayout = state.layout
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (unsafeLayout === null) {
|
|
287
|
+
const panels = getPanelDataWithPercentConstraints()
|
|
288
|
+
if (!panels) return
|
|
289
|
+
unsafeLayout = calculateUnsafeDefaultLayout({ panelDataArray: panels })
|
|
290
|
+
}
|
|
291
|
+
const panelConstraints = getPanelConstraintsInPercent()
|
|
292
|
+
if (!panelConstraints) return
|
|
293
|
+
const nextLayout = validatePanelGroupLayout({ layout: unsafeLayout, panelConstraints })
|
|
294
|
+
groupSizeAtLastLayoutInit.value = getGroupSizeInPixels()
|
|
295
|
+
if (!areEqual(prevLayout, nextLayout)) commitLayout(nextLayout, panelDataArray)
|
|
296
|
+
},
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
watch(groupSizeInPixels, (nextSize, prevSize) => {
|
|
300
|
+
if (prevSize == null || nextSize == null) return
|
|
301
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
302
|
+
if (prevLayout.length === 0) return
|
|
303
|
+
if (!hasPixelSizedPanel(panelDataArray)) return
|
|
304
|
+
const initSize = groupSizeAtLastLayoutInit.value
|
|
305
|
+
if (initSize != null && initSize > 0 && initSize < 50 && nextSize > initSize * 10) {
|
|
306
|
+
eagerValuesRef.value.panelDataArrayChanged = true
|
|
307
|
+
return
|
|
308
|
+
}
|
|
309
|
+
const recalculatedLayout = recalculateLayoutForPixelPanels({
|
|
310
|
+
layout: prevLayout,
|
|
311
|
+
panelDataArray,
|
|
312
|
+
prevGroupSize: prevSize,
|
|
313
|
+
nextGroupSize: nextSize,
|
|
314
|
+
})
|
|
315
|
+
if (!recalculatedLayout) return
|
|
316
|
+
const panelConstraints = getPanelConstraintsInPercent(nextSize)
|
|
317
|
+
if (!panelConstraints) return
|
|
318
|
+
const nextLayout = validatePanelGroupLayout({ layout: recalculatedLayout, panelConstraints })
|
|
319
|
+
if (!compareLayouts(prevLayout, nextLayout)) commitLayout(nextLayout, panelDataArray)
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
function registerResizeHandle(dragHandleId: string) {
|
|
323
|
+
return function resizeHandler(event: ResizeEvent) {
|
|
324
|
+
event.preventDefault()
|
|
325
|
+
const panelGroupElement = panelGroupElementRef.value
|
|
326
|
+
if (!panelGroupElement) return
|
|
327
|
+
const {
|
|
328
|
+
direction: currentDirection,
|
|
329
|
+
dragState: currentDragState,
|
|
330
|
+
id: currentGroupId,
|
|
331
|
+
keyboardResizeBy,
|
|
332
|
+
} = committedValuesRef.value
|
|
333
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
334
|
+
const { initialLayout } = currentDragState ?? {}
|
|
335
|
+
const pivotIndices = determinePivotIndices(currentGroupId, dragHandleId, panelGroupElement)
|
|
336
|
+
let delta = calculateDeltaPercentage(
|
|
337
|
+
event,
|
|
338
|
+
dragHandleId,
|
|
339
|
+
currentDirection,
|
|
340
|
+
currentDragState,
|
|
341
|
+
keyboardResizeBy,
|
|
342
|
+
panelGroupElement,
|
|
343
|
+
)
|
|
344
|
+
if (delta === 0) return
|
|
345
|
+
const isHorizontal = currentDirection === 'horizontal'
|
|
346
|
+
if (dir.value === 'rtl' && isHorizontal) delta = -delta
|
|
347
|
+
const panelConstraints = getPanelConstraintsInPercent()
|
|
348
|
+
if (!panelConstraints) return
|
|
349
|
+
const nextLayout = adjustLayoutByDelta({
|
|
350
|
+
delta,
|
|
351
|
+
layout: initialLayout ?? prevLayout,
|
|
352
|
+
panelConstraints,
|
|
353
|
+
pivotIndices,
|
|
354
|
+
trigger: isKeyDown(event) ? 'keyboard' : 'mouse-or-touch',
|
|
355
|
+
})
|
|
356
|
+
const layoutChanged = !compareLayouts(prevLayout, nextLayout)
|
|
357
|
+
if ((isMouseEvent(event) || isTouchEvent(event)) && prevDeltaRef.value !== delta) {
|
|
358
|
+
prevDeltaRef.value = delta
|
|
359
|
+
if (!layoutChanged) {
|
|
360
|
+
if (isHorizontal)
|
|
361
|
+
reportConstraintsViolation(
|
|
362
|
+
dragHandleId,
|
|
363
|
+
delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX,
|
|
364
|
+
)
|
|
365
|
+
else
|
|
366
|
+
reportConstraintsViolation(
|
|
367
|
+
dragHandleId,
|
|
368
|
+
delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX,
|
|
369
|
+
)
|
|
370
|
+
} else reportConstraintsViolation(dragHandleId, 0)
|
|
371
|
+
}
|
|
372
|
+
if (layoutChanged) commitLayout(nextLayout, panelDataArray)
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function resizePanel(panelData: PanelData, unsafePanelSize: number) {
|
|
377
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
378
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
379
|
+
if (!panelConstraintsArray) return
|
|
380
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData)
|
|
381
|
+
const panelUnit = panelData.constraints.sizeUnit ?? '%'
|
|
382
|
+
let sizeInPercent = unsafePanelSize
|
|
383
|
+
if (panelUnit === 'px') {
|
|
384
|
+
const groupSize = getGroupSizeInPixels()
|
|
385
|
+
if (groupSize != null) sizeInPercent = (unsafePanelSize / groupSize) * 100
|
|
386
|
+
}
|
|
387
|
+
const { panelSize, pivotIndices } = panelDataHelper(
|
|
388
|
+
panelDataArray,
|
|
389
|
+
panelData,
|
|
390
|
+
prevLayout,
|
|
391
|
+
panelConstraintsArray,
|
|
392
|
+
)
|
|
393
|
+
assert(panelSize != null)
|
|
394
|
+
const isLastPanel = panelIndex === panelDataArray.length - 1
|
|
395
|
+
const delta = isLastPanel ? panelSize - sizeInPercent : sizeInPercent - panelSize
|
|
396
|
+
const nextLayout = adjustLayoutByDelta({
|
|
397
|
+
delta,
|
|
398
|
+
layout: prevLayout,
|
|
399
|
+
panelConstraints: panelConstraintsArray,
|
|
400
|
+
pivotIndices,
|
|
401
|
+
trigger: 'imperative-api',
|
|
402
|
+
})
|
|
403
|
+
if (!compareLayouts(prevLayout, nextLayout)) commitLayout(nextLayout, panelDataArray)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function reevaluatePanelConstraints(panelData: PanelData, _prevConstraints: PanelConstraints) {
|
|
407
|
+
const { layout: currentLayout, panelDataArray } = eagerValuesRef.value
|
|
408
|
+
const index = findPanelDataIndex(panelDataArray, panelData)
|
|
409
|
+
panelDataArray[index] = panelData
|
|
410
|
+
eagerValuesRef.value.panelDataArrayChanged = true
|
|
411
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
412
|
+
if (!panelConstraintsArray) return
|
|
413
|
+
const nextConstraints = panelConstraintsArray[index]
|
|
414
|
+
const { panelSize: prevPanelSize } = panelDataHelper(
|
|
415
|
+
panelDataArray,
|
|
416
|
+
panelData,
|
|
417
|
+
currentLayout,
|
|
418
|
+
panelConstraintsArray,
|
|
419
|
+
)
|
|
420
|
+
if (prevPanelSize === null) return
|
|
421
|
+
const nextCollapsedSize = nextConstraints?.collapsedSize ?? 0
|
|
422
|
+
const nextMaxSize = nextConstraints?.maxSize ?? 100
|
|
423
|
+
const nextMinSize = nextConstraints?.minSize ?? 0
|
|
424
|
+
if (nextConstraints?.collapsible && isPanelCollapsed(panelData)) {
|
|
425
|
+
if (prevPanelSize !== nextCollapsedSize) resizePanel(panelData, nextCollapsedSize)
|
|
426
|
+
} else if (prevPanelSize! < nextMinSize) resizePanel(panelData, nextMinSize)
|
|
427
|
+
else if (prevPanelSize! > nextMaxSize) resizePanel(panelData, nextMaxSize)
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function startDragging(dragHandleId: string, event: ResizeEvent) {
|
|
431
|
+
const { direction: currentDirection } = committedValuesRef.value
|
|
432
|
+
const { layout: currentLayout } = eagerValuesRef.value
|
|
433
|
+
if (!panelGroupElementRef.value) return
|
|
434
|
+
const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.value)
|
|
435
|
+
assert(handleElement)
|
|
436
|
+
const initialCursorPosition = getResizeEventCursorPosition(currentDirection, event)
|
|
437
|
+
dragState.value = {
|
|
438
|
+
dragHandleId,
|
|
439
|
+
dragHandleRect: handleElement.getBoundingClientRect(),
|
|
440
|
+
initialCursorPosition,
|
|
441
|
+
initialLayout: currentLayout,
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function stopDragging() {
|
|
446
|
+
dragState.value = null
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function unregisterPanel(panelData: PanelData) {
|
|
450
|
+
const { panelDataArray } = eagerValuesRef.value
|
|
451
|
+
const index = findPanelDataIndex(panelDataArray, panelData)
|
|
452
|
+
if (index >= 0) {
|
|
453
|
+
panelDataArray.splice(index, 1)
|
|
454
|
+
delete panelIdToLastNotifiedSizeMapRef.value[panelData.id]
|
|
455
|
+
eagerValuesRef.value.panelDataArrayChanged = true
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function collapsePanel(panelData: PanelData) {
|
|
460
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
461
|
+
if (!panelData.constraints.collapsible) return
|
|
462
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
463
|
+
if (!panelConstraintsArray) return
|
|
464
|
+
const {
|
|
465
|
+
collapsedSize = 0,
|
|
466
|
+
panelSize,
|
|
467
|
+
pivotIndices,
|
|
468
|
+
} = panelDataHelper(panelDataArray, panelData, prevLayout, panelConstraintsArray)
|
|
469
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`)
|
|
470
|
+
if (panelSize === collapsedSize) return
|
|
471
|
+
const sizeUnit = panelData.constraints.sizeUnit ?? '%'
|
|
472
|
+
const groupSize = groupSizeInPixels.value ?? getGroupSizeInPixels()
|
|
473
|
+
const sizeBeforeCollapse =
|
|
474
|
+
sizeUnit === 'px' && groupSize ? (panelSize / 100) * groupSize : panelSize
|
|
475
|
+
panelSizeBeforeCollapseRef.value.set(panelData.id, sizeBeforeCollapse)
|
|
476
|
+
const isLastPanel =
|
|
477
|
+
findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1
|
|
478
|
+
const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize
|
|
479
|
+
const nextLayout = adjustLayoutByDelta({
|
|
480
|
+
delta,
|
|
481
|
+
layout: prevLayout,
|
|
482
|
+
panelConstraints: panelConstraintsArray,
|
|
483
|
+
pivotIndices,
|
|
484
|
+
trigger: 'imperative-api',
|
|
485
|
+
})
|
|
486
|
+
if (!compareLayouts(prevLayout, nextLayout)) commitLayout(nextLayout, panelDataArray)
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function expandPanel(panelData: PanelData) {
|
|
490
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.value
|
|
491
|
+
if (!panelData.constraints.collapsible) return
|
|
492
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
493
|
+
if (!panelConstraintsArray) return
|
|
494
|
+
const {
|
|
495
|
+
collapsedSize = 0,
|
|
496
|
+
panelSize = 0,
|
|
497
|
+
minSize = 0,
|
|
498
|
+
pivotIndices,
|
|
499
|
+
} = panelDataHelper(panelDataArray, panelData, prevLayout, panelConstraintsArray)
|
|
500
|
+
if (fuzzyCompareNumbers(panelSize, collapsedSize) > 0) return
|
|
501
|
+
const prevPanelSize = panelSizeBeforeCollapseRef.value.get(panelData.id)
|
|
502
|
+
const sizeUnit = panelData.constraints.sizeUnit ?? '%'
|
|
503
|
+
const groupSize = groupSizeInPixels.value ?? getGroupSizeInPixels()
|
|
504
|
+
const restoredSize =
|
|
505
|
+
sizeUnit === 'px' && groupSize
|
|
506
|
+
? prevPanelSize != null
|
|
507
|
+
? (prevPanelSize / groupSize) * 100
|
|
508
|
+
: null
|
|
509
|
+
: prevPanelSize
|
|
510
|
+
const baseSize = restoredSize != null && restoredSize >= minSize ? restoredSize : minSize
|
|
511
|
+
const isLastPanel =
|
|
512
|
+
findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1
|
|
513
|
+
const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize
|
|
514
|
+
const nextLayout = adjustLayoutByDelta({
|
|
515
|
+
delta,
|
|
516
|
+
layout: prevLayout,
|
|
517
|
+
panelConstraints: panelConstraintsArray,
|
|
518
|
+
pivotIndices,
|
|
519
|
+
trigger: 'imperative-api',
|
|
520
|
+
})
|
|
521
|
+
if (!compareLayouts(prevLayout, nextLayout)) commitLayout(nextLayout, panelDataArray)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function getPanelSize(panelData: PanelData) {
|
|
525
|
+
const { layout: currentLayout, panelDataArray } = eagerValuesRef.value
|
|
526
|
+
const { panelSize } = panelDataHelper(panelDataArray, panelData, currentLayout)
|
|
527
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`)
|
|
528
|
+
if ((panelData.constraints.sizeUnit ?? '%') === 'px') {
|
|
529
|
+
const groupSize = getGroupSizeInPixels()
|
|
530
|
+
if (groupSize != null) return (panelSize / 100) * groupSize
|
|
531
|
+
}
|
|
532
|
+
return panelSize
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function isPanelCollapsed(panelData: PanelData) {
|
|
536
|
+
const { layout: currentLayout, panelDataArray } = eagerValuesRef.value
|
|
537
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
538
|
+
const {
|
|
539
|
+
collapsedSize = 0,
|
|
540
|
+
collapsible,
|
|
541
|
+
panelSize,
|
|
542
|
+
} = panelDataHelper(
|
|
543
|
+
panelDataArray,
|
|
544
|
+
panelData,
|
|
545
|
+
currentLayout,
|
|
546
|
+
panelConstraintsArray ?? undefined,
|
|
547
|
+
)
|
|
548
|
+
if (!collapsible) return false
|
|
549
|
+
if (panelSize === undefined) {
|
|
550
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData)
|
|
551
|
+
const constraints = panelConstraintsArray?.[panelIndex] ?? panelData.constraints
|
|
552
|
+
return constraints.defaultSize === constraints.collapsedSize
|
|
553
|
+
}
|
|
554
|
+
return fuzzyCompareNumbers(panelSize, collapsedSize) <= 0
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function isPanelExpanded(panelData: PanelData) {
|
|
558
|
+
const { layout: currentLayout, panelDataArray } = eagerValuesRef.value
|
|
559
|
+
const panelConstraintsArray = getPanelConstraintsInPercent()
|
|
560
|
+
const {
|
|
561
|
+
collapsedSize = 0,
|
|
562
|
+
collapsible,
|
|
563
|
+
panelSize,
|
|
564
|
+
} = panelDataHelper(
|
|
565
|
+
panelDataArray,
|
|
566
|
+
panelData,
|
|
567
|
+
currentLayout,
|
|
568
|
+
panelConstraintsArray ?? undefined,
|
|
569
|
+
)
|
|
570
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`)
|
|
571
|
+
return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
providePanelGroupContext({
|
|
575
|
+
direction,
|
|
576
|
+
dragState: dragState.value,
|
|
577
|
+
groupId,
|
|
578
|
+
reevaluatePanelConstraints,
|
|
579
|
+
registerPanel,
|
|
580
|
+
registerResizeHandle,
|
|
581
|
+
resizePanel,
|
|
582
|
+
startDragging,
|
|
583
|
+
stopDragging,
|
|
584
|
+
unregisterPanel,
|
|
585
|
+
panelGroupElement: panelGroupElementRef,
|
|
586
|
+
collapsePanel,
|
|
587
|
+
expandPanel,
|
|
588
|
+
isPanelCollapsed,
|
|
589
|
+
isPanelExpanded,
|
|
590
|
+
getPanelSize,
|
|
591
|
+
getPanelStyle,
|
|
592
|
+
})
|
|
593
|
+
|
|
594
|
+
function findPanelDataIndex(panelDataArray: PanelData[], panelData: PanelData) {
|
|
595
|
+
return panelDataArray.findIndex(
|
|
596
|
+
prevPanelData => prevPanelData === panelData || prevPanelData.id === panelData.id,
|
|
597
|
+
)
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function panelDataHelper(
|
|
601
|
+
panelDataArray: PanelData[],
|
|
602
|
+
panelData: PanelData,
|
|
603
|
+
currentLayout: number[],
|
|
604
|
+
panelConstraints?: PanelConstraints[] | null,
|
|
605
|
+
) {
|
|
606
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData)
|
|
607
|
+
const isLastPanel = panelIndex === panelDataArray.length - 1
|
|
608
|
+
const pivotIndices: [number, number] = isLastPanel
|
|
609
|
+
? [panelIndex - 1, panelIndex]
|
|
610
|
+
: [panelIndex, panelIndex + 1]
|
|
611
|
+
const constraints = panelConstraints ?? getPanelConstraintsInPercent()
|
|
612
|
+
const panelConstraintsFromGroup = constraints?.[panelIndex]
|
|
613
|
+
const panelSize = currentLayout[panelIndex]
|
|
614
|
+
return {
|
|
615
|
+
...(panelConstraintsFromGroup ?? panelData.constraints),
|
|
616
|
+
panelSize,
|
|
617
|
+
pivotIndices,
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
return () =>
|
|
622
|
+
h(
|
|
623
|
+
Primitive,
|
|
624
|
+
{
|
|
625
|
+
ref: forwardRef,
|
|
626
|
+
as: props.as,
|
|
627
|
+
'as-child': props.asChild,
|
|
628
|
+
style: normalizeStyle({
|
|
629
|
+
display: 'flex',
|
|
630
|
+
flexDirection: direction.value === 'horizontal' ? 'row' : 'column',
|
|
631
|
+
height: '100%',
|
|
632
|
+
overflow: 'hidden',
|
|
633
|
+
width: '100%',
|
|
634
|
+
}),
|
|
635
|
+
'data-panel-group': '',
|
|
636
|
+
'data-orientation': direction.value,
|
|
637
|
+
'data-panel-group-id': groupId,
|
|
638
|
+
},
|
|
639
|
+
{ default: withCtx(() => [renderSlot(slots, 'default', { layout: layout.value })]) },
|
|
640
|
+
)
|
|
641
|
+
},
|
|
642
|
+
})
|