@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,10 @@
|
|
|
1
|
+
import { getResizeHandleElementIndex } from './dom'
|
|
2
|
+
|
|
3
|
+
export function determinePivotIndices(
|
|
4
|
+
groupId: string,
|
|
5
|
+
dragHandleId: string,
|
|
6
|
+
panelGroupElement: ParentNode,
|
|
7
|
+
): [number, number] {
|
|
8
|
+
const index = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement)
|
|
9
|
+
return index != null ? [index, index + 1] : [-1, -1]
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface Rectangle {
|
|
2
|
+
x: number
|
|
3
|
+
y: number
|
|
4
|
+
width: number
|
|
5
|
+
height: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function intersects(rectOne: Rectangle, rectTwo: Rectangle, strict: boolean): boolean {
|
|
9
|
+
if (strict) {
|
|
10
|
+
return (
|
|
11
|
+
rectOne.x < rectTwo.x + rectTwo.width &&
|
|
12
|
+
rectOne.x + rectOne.width > rectTwo.x &&
|
|
13
|
+
rectOne.y < rectTwo.y + rectTwo.height &&
|
|
14
|
+
rectOne.y + rectOne.height > rectTwo.y
|
|
15
|
+
)
|
|
16
|
+
} else {
|
|
17
|
+
return (
|
|
18
|
+
rectOne.x <= rectTwo.x + rectTwo.width &&
|
|
19
|
+
rectOne.x + rectOne.width >= rectTwo.x &&
|
|
20
|
+
rectOne.y <= rectTwo.y + rectTwo.height &&
|
|
21
|
+
rectOne.y + rectOne.height >= rectTwo.y
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { getResizeEventCoordinates } from './events'
|
|
2
|
+
import { intersects } from './rects'
|
|
3
|
+
import { compare } from './stackingOrder'
|
|
4
|
+
import { resetGlobalCursorStyle, setGlobalCursorStyle } from './style'
|
|
5
|
+
import type {
|
|
6
|
+
Direction,
|
|
7
|
+
PointerHitAreaMargins,
|
|
8
|
+
ResizeEvent,
|
|
9
|
+
ResizeHandlerAction,
|
|
10
|
+
SetResizeHandlerState,
|
|
11
|
+
} from './types'
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
EXCEEDED_HORIZONTAL_MAX,
|
|
15
|
+
EXCEEDED_HORIZONTAL_MIN,
|
|
16
|
+
EXCEEDED_VERTICAL_MAX,
|
|
17
|
+
EXCEEDED_VERTICAL_MIN,
|
|
18
|
+
} from './flags'
|
|
19
|
+
|
|
20
|
+
interface ResizeHandlerData {
|
|
21
|
+
direction: () => Direction
|
|
22
|
+
element: HTMLElement
|
|
23
|
+
hitAreaMargins: PointerHitAreaMargins
|
|
24
|
+
nonce: () => string | undefined
|
|
25
|
+
setResizeHandlerState: SetResizeHandlerState
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getInputType() {
|
|
29
|
+
if (typeof matchMedia === 'function')
|
|
30
|
+
return matchMedia('(pointer:coarse)').matches ? 'coarse' : 'fine'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const isCoarsePointer = getInputType() === 'coarse'
|
|
34
|
+
const intersectingHandles: ResizeHandlerData[] = []
|
|
35
|
+
let isPointerDown = false
|
|
36
|
+
const ownerDocumentCounts = new Map<Document, number>()
|
|
37
|
+
const panelConstraintFlags = new Map<string, number>()
|
|
38
|
+
const registeredResizeHandlers = new Set<ResizeHandlerData>()
|
|
39
|
+
|
|
40
|
+
export function registerResizeHandle(
|
|
41
|
+
resizeHandleId: string,
|
|
42
|
+
element: HTMLElement,
|
|
43
|
+
direction: () => Direction,
|
|
44
|
+
hitAreaMargins: PointerHitAreaMargins,
|
|
45
|
+
nonce: () => string | undefined,
|
|
46
|
+
setResizeHandlerState: SetResizeHandlerState,
|
|
47
|
+
) {
|
|
48
|
+
const { ownerDocument } = element
|
|
49
|
+
const data: ResizeHandlerData = {
|
|
50
|
+
direction,
|
|
51
|
+
element,
|
|
52
|
+
hitAreaMargins,
|
|
53
|
+
nonce,
|
|
54
|
+
setResizeHandlerState,
|
|
55
|
+
}
|
|
56
|
+
const count = ownerDocumentCounts.get(ownerDocument) ?? 0
|
|
57
|
+
ownerDocumentCounts.set(ownerDocument, count + 1)
|
|
58
|
+
registeredResizeHandlers.add(data)
|
|
59
|
+
updateListeners()
|
|
60
|
+
return function unregisterResizeHandle() {
|
|
61
|
+
panelConstraintFlags.delete(resizeHandleId)
|
|
62
|
+
registeredResizeHandlers.delete(data)
|
|
63
|
+
const count = ownerDocumentCounts.get(ownerDocument) ?? 1
|
|
64
|
+
ownerDocumentCounts.set(ownerDocument, count - 1)
|
|
65
|
+
updateListeners()
|
|
66
|
+
resetGlobalCursorStyle()
|
|
67
|
+
if (count === 1) ownerDocumentCounts.delete(ownerDocument)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function handlePointerDown(event: ResizeEvent) {
|
|
72
|
+
const { target } = event
|
|
73
|
+
const { x, y } = getResizeEventCoordinates(event)
|
|
74
|
+
isPointerDown = true
|
|
75
|
+
recalculateIntersectingHandles({ target, x, y })
|
|
76
|
+
updateListeners()
|
|
77
|
+
if (intersectingHandles.length > 0) {
|
|
78
|
+
updateResizeHandlerStates('down', event)
|
|
79
|
+
event.preventDefault()
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handlePointerMove(event: ResizeEvent) {
|
|
84
|
+
const { x, y } = getResizeEventCoordinates(event)
|
|
85
|
+
if (!isPointerDown) {
|
|
86
|
+
const { target } = event
|
|
87
|
+
recalculateIntersectingHandles({ target, x, y })
|
|
88
|
+
}
|
|
89
|
+
updateResizeHandlerStates('move', event)
|
|
90
|
+
updateCursor()
|
|
91
|
+
if (intersectingHandles.length > 0) event.preventDefault()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function handlePointerUp(event: ResizeEvent) {
|
|
95
|
+
const { target } = event
|
|
96
|
+
const { x, y } = getResizeEventCoordinates(event)
|
|
97
|
+
panelConstraintFlags.clear()
|
|
98
|
+
isPointerDown = false
|
|
99
|
+
if (intersectingHandles.length > 0) event.preventDefault()
|
|
100
|
+
updateResizeHandlerStates('up', event)
|
|
101
|
+
recalculateIntersectingHandles({ target, x, y })
|
|
102
|
+
updateCursor()
|
|
103
|
+
updateListeners()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function recalculateIntersectingHandles({
|
|
107
|
+
target,
|
|
108
|
+
x,
|
|
109
|
+
y,
|
|
110
|
+
}: {
|
|
111
|
+
target: EventTarget | null
|
|
112
|
+
x: number
|
|
113
|
+
y: number
|
|
114
|
+
}) {
|
|
115
|
+
intersectingHandles.splice(0)
|
|
116
|
+
let targetElement: HTMLElement | null = null
|
|
117
|
+
if (target instanceof HTMLElement) targetElement = target
|
|
118
|
+
registeredResizeHandlers.forEach(data => {
|
|
119
|
+
const { element: dragHandleElement, hitAreaMargins } = data
|
|
120
|
+
const dragHandleRect = dragHandleElement.getBoundingClientRect()
|
|
121
|
+
const { bottom, left, right, top } = dragHandleRect
|
|
122
|
+
const margin = isCoarsePointer ? hitAreaMargins.coarse : hitAreaMargins.fine
|
|
123
|
+
const eventIntersects =
|
|
124
|
+
x >= left - margin && x <= right + margin && y >= top - margin && y <= bottom + margin
|
|
125
|
+
if (eventIntersects) {
|
|
126
|
+
if (
|
|
127
|
+
targetElement !== null &&
|
|
128
|
+
dragHandleElement !== targetElement &&
|
|
129
|
+
!dragHandleElement.contains(targetElement) &&
|
|
130
|
+
!targetElement.contains(dragHandleElement) &&
|
|
131
|
+
compare(targetElement, dragHandleElement) > 0
|
|
132
|
+
) {
|
|
133
|
+
let currentElement: HTMLElement | null = targetElement
|
|
134
|
+
let didIntersect = false
|
|
135
|
+
while (currentElement) {
|
|
136
|
+
if (currentElement.contains(dragHandleElement)) {
|
|
137
|
+
break
|
|
138
|
+
} else if (intersects(currentElement.getBoundingClientRect(), dragHandleRect, true)) {
|
|
139
|
+
didIntersect = true
|
|
140
|
+
break
|
|
141
|
+
}
|
|
142
|
+
currentElement = currentElement.parentElement
|
|
143
|
+
}
|
|
144
|
+
if (didIntersect) return
|
|
145
|
+
}
|
|
146
|
+
intersectingHandles.push(data)
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function reportConstraintsViolation(resizeHandleId: string, flag: number) {
|
|
152
|
+
panelConstraintFlags.set(resizeHandleId, flag)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function updateCursor() {
|
|
156
|
+
let intersectsHorizontal = false
|
|
157
|
+
let intersectsVertical = false
|
|
158
|
+
let nonce: string | undefined
|
|
159
|
+
intersectingHandles.forEach(data => {
|
|
160
|
+
const { direction, nonce: getNonce } = data
|
|
161
|
+
if (direction() === 'horizontal') intersectsHorizontal = true
|
|
162
|
+
else intersectsVertical = true
|
|
163
|
+
nonce = getNonce()
|
|
164
|
+
})
|
|
165
|
+
let constraintFlags = 0
|
|
166
|
+
panelConstraintFlags.forEach(flag => {
|
|
167
|
+
constraintFlags |= flag
|
|
168
|
+
})
|
|
169
|
+
if (intersectsHorizontal && intersectsVertical)
|
|
170
|
+
setGlobalCursorStyle('intersection', constraintFlags, nonce)
|
|
171
|
+
else if (intersectsHorizontal) setGlobalCursorStyle('horizontal', constraintFlags, nonce)
|
|
172
|
+
else if (intersectsVertical) setGlobalCursorStyle('vertical', constraintFlags, nonce)
|
|
173
|
+
else resetGlobalCursorStyle()
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const listener = {
|
|
177
|
+
down: handlePointerDown as EventListener,
|
|
178
|
+
move: handlePointerMove as EventListener,
|
|
179
|
+
up: handlePointerUp as EventListener,
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function updateListeners() {
|
|
183
|
+
ownerDocumentCounts.forEach((_, ownerDocument) => {
|
|
184
|
+
const { body } = ownerDocument
|
|
185
|
+
body.removeEventListener('contextmenu', listener.up)
|
|
186
|
+
body.removeEventListener('mousedown', listener.down)
|
|
187
|
+
body.removeEventListener('mouseleave', listener.move)
|
|
188
|
+
body.removeEventListener('mousemove', listener.move)
|
|
189
|
+
body.removeEventListener('touchmove', listener.move)
|
|
190
|
+
body.removeEventListener('touchstart', listener.down)
|
|
191
|
+
})
|
|
192
|
+
window.removeEventListener('mouseup', listener.up)
|
|
193
|
+
window.removeEventListener('touchcancel', listener.up)
|
|
194
|
+
window.removeEventListener('touchend', listener.up)
|
|
195
|
+
if (registeredResizeHandlers.size > 0) {
|
|
196
|
+
if (isPointerDown) {
|
|
197
|
+
if (intersectingHandles.length > 0) {
|
|
198
|
+
ownerDocumentCounts.forEach((count, ownerDocument) => {
|
|
199
|
+
const { body } = ownerDocument
|
|
200
|
+
if (count > 0) {
|
|
201
|
+
body.addEventListener('contextmenu', listener.up)
|
|
202
|
+
body.addEventListener('mouseleave', listener.move)
|
|
203
|
+
body.addEventListener('mousemove', listener.move)
|
|
204
|
+
body.addEventListener('touchmove', listener.move, { passive: false })
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
window.addEventListener('mouseup', listener.up)
|
|
209
|
+
window.addEventListener('touchcancel', listener.up)
|
|
210
|
+
window.addEventListener('touchend', listener.up)
|
|
211
|
+
} else {
|
|
212
|
+
ownerDocumentCounts.forEach((count, ownerDocument) => {
|
|
213
|
+
const { body } = ownerDocument
|
|
214
|
+
if (count > 0) {
|
|
215
|
+
body.addEventListener('mousedown', listener.down)
|
|
216
|
+
body.addEventListener('mousemove', listener.move)
|
|
217
|
+
body.addEventListener('touchmove', listener.move, { passive: false })
|
|
218
|
+
body.addEventListener('touchstart', listener.down)
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function updateResizeHandlerStates(action: ResizeHandlerAction, event: ResizeEvent) {
|
|
226
|
+
registeredResizeHandlers.forEach(data => {
|
|
227
|
+
const { setResizeHandlerState } = data
|
|
228
|
+
const isActive = intersectingHandles.includes(data)
|
|
229
|
+
setResizeHandlerState(action, isActive, event)
|
|
230
|
+
})
|
|
231
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { assert } from './assert'
|
|
2
|
+
import { PRECISION } from './constants'
|
|
3
|
+
import { fuzzyCompareNumbers } from './compare'
|
|
4
|
+
import type { PanelConstraints } from './types'
|
|
5
|
+
|
|
6
|
+
export function resizePanel({
|
|
7
|
+
panelConstraints: panelConstraintsArray,
|
|
8
|
+
panelIndex,
|
|
9
|
+
size,
|
|
10
|
+
}: {
|
|
11
|
+
panelConstraints: PanelConstraints[]
|
|
12
|
+
panelIndex: number
|
|
13
|
+
size: number
|
|
14
|
+
}) {
|
|
15
|
+
const panelConstraints = panelConstraintsArray[panelIndex]
|
|
16
|
+
assert(panelConstraints != null)
|
|
17
|
+
const { collapsedSize = 0, collapsible, maxSize = 100, minSize = 0 } = panelConstraints
|
|
18
|
+
if (fuzzyCompareNumbers(size, minSize) < 0) {
|
|
19
|
+
if (collapsible) {
|
|
20
|
+
const halfwayPoint = (collapsedSize + minSize) / 2
|
|
21
|
+
if (fuzzyCompareNumbers(size, halfwayPoint) < 0) size = collapsedSize
|
|
22
|
+
else size = minSize
|
|
23
|
+
} else {
|
|
24
|
+
size = minSize
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
size = Math.min(maxSize, size)
|
|
28
|
+
size = Number.parseFloat(size.toFixed(PRECISION))
|
|
29
|
+
return size
|
|
30
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { assert } from './assert'
|
|
2
|
+
|
|
3
|
+
export function compare(a: HTMLElement, b: HTMLElement): number {
|
|
4
|
+
if (a === b) throw new Error('Cannot compare node with itself')
|
|
5
|
+
const ancestors = {
|
|
6
|
+
a: getAncestors(a),
|
|
7
|
+
b: getAncestors(b),
|
|
8
|
+
}
|
|
9
|
+
let commonAncestor: HTMLElement | undefined
|
|
10
|
+
while (ancestors.a.at(-1) === ancestors.b.at(-1)) {
|
|
11
|
+
a = ancestors.a.pop() as HTMLElement
|
|
12
|
+
b = ancestors.b.pop() as HTMLElement
|
|
13
|
+
commonAncestor = a
|
|
14
|
+
}
|
|
15
|
+
assert(commonAncestor)
|
|
16
|
+
const zIndexes = {
|
|
17
|
+
a: getZIndex(findStackingContext(ancestors.a)),
|
|
18
|
+
b: getZIndex(findStackingContext(ancestors.b)),
|
|
19
|
+
}
|
|
20
|
+
if (zIndexes.a === zIndexes.b) {
|
|
21
|
+
const children = commonAncestor.childNodes
|
|
22
|
+
const furthestAncestors = {
|
|
23
|
+
a: ancestors.a.at(-1),
|
|
24
|
+
b: ancestors.b.at(-1),
|
|
25
|
+
}
|
|
26
|
+
let i = children.length
|
|
27
|
+
while (i--) {
|
|
28
|
+
const child = children[i]
|
|
29
|
+
if (child === furthestAncestors.a) return 1
|
|
30
|
+
if (child === furthestAncestors.b) return -1
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return Math.sign(zIndexes.a - zIndexes.b)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const props =
|
|
37
|
+
/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/
|
|
38
|
+
|
|
39
|
+
function isFlexItem(node: HTMLElement) {
|
|
40
|
+
const display = getComputedStyle(getParent(node) as HTMLElement).display
|
|
41
|
+
return display === 'flex' || display === 'inline-flex'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function createsStackingContext(node: HTMLElement) {
|
|
45
|
+
const style = getComputedStyle(node)
|
|
46
|
+
if (style.position === 'fixed') return true
|
|
47
|
+
if (style.zIndex !== 'auto' && (style.position !== 'static' || isFlexItem(node))) return true
|
|
48
|
+
if (+style.opacity < 1) return true
|
|
49
|
+
if ('transform' in style && style.transform !== 'none') return true
|
|
50
|
+
if ('webkitTransform' in style && style.webkitTransform !== 'none') return true
|
|
51
|
+
if ('mixBlendMode' in style && style.mixBlendMode !== 'normal') return true
|
|
52
|
+
if ('filter' in style && style.filter !== 'none') return true
|
|
53
|
+
if ('webkitFilter' in style && (style as { webkitFilter?: string }).webkitFilter !== 'none')
|
|
54
|
+
return true
|
|
55
|
+
if ('isolation' in style && style.isolation === 'isolate') return true
|
|
56
|
+
if (props.test(style.willChange)) return true
|
|
57
|
+
if ((style as { webkitOverflowScrolling?: string }).webkitOverflowScrolling === 'touch')
|
|
58
|
+
return true
|
|
59
|
+
return false
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function findStackingContext(nodes: HTMLElement[]) {
|
|
63
|
+
let i = nodes.length
|
|
64
|
+
while (i--) {
|
|
65
|
+
const node = nodes[i]
|
|
66
|
+
assert(node)
|
|
67
|
+
if (createsStackingContext(node)) return node
|
|
68
|
+
}
|
|
69
|
+
return null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getZIndex(node: HTMLElement | null) {
|
|
73
|
+
return (node && Number(getComputedStyle(node).zIndex)) || 0
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getAncestors(node: HTMLElement | null) {
|
|
77
|
+
const ancestors: HTMLElement[] = []
|
|
78
|
+
while (node) {
|
|
79
|
+
ancestors.push(node)
|
|
80
|
+
node = getParent(node)
|
|
81
|
+
}
|
|
82
|
+
return ancestors
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getParent(node: HTMLElement) {
|
|
86
|
+
return ((node.parentNode instanceof DocumentFragment && (node.parentNode as ShadowRoot)?.host) ||
|
|
87
|
+
node.parentNode) as HTMLElement | null
|
|
88
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { PanelData, PanelGroupStorage } from './types'
|
|
2
|
+
|
|
3
|
+
interface SerializedPanelGroupState {
|
|
4
|
+
[panelKey: string]: {
|
|
5
|
+
expandToSizes: Record<string, number>
|
|
6
|
+
layout: number[]
|
|
7
|
+
sizeUnits?: Record<number, 'px'>
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function initializeDefaultStorage(storageObject: PanelGroupStorage) {
|
|
12
|
+
try {
|
|
13
|
+
if (typeof localStorage !== 'undefined') {
|
|
14
|
+
storageObject.getItem = (name: string) => {
|
|
15
|
+
return localStorage.getItem(name)
|
|
16
|
+
}
|
|
17
|
+
storageObject.setItem = (name: string, value: string) => {
|
|
18
|
+
localStorage.setItem(name, value)
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
throw new TypeError('localStorage not supported in this environment')
|
|
22
|
+
}
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error(error)
|
|
25
|
+
storageObject.getItem = () => null
|
|
26
|
+
storageObject.setItem = () => {}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getPanelGroupKey(autoSaveId: string): string {
|
|
31
|
+
return `reka:${autoSaveId}`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getPanelKey(panels: PanelData[]): string {
|
|
35
|
+
return panels
|
|
36
|
+
.map(panel => {
|
|
37
|
+
const { constraints, id, idIsFromProps, order } = panel
|
|
38
|
+
if (idIsFromProps) return id
|
|
39
|
+
else return order ? `${order}:${JSON.stringify(constraints)}` : JSON.stringify(constraints)
|
|
40
|
+
})
|
|
41
|
+
.sort((a, b) => a.localeCompare(b))
|
|
42
|
+
.join(',')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function loadSerializedPanelGroupState(
|
|
46
|
+
autoSaveId: string,
|
|
47
|
+
storage: PanelGroupStorage,
|
|
48
|
+
): SerializedPanelGroupState | null {
|
|
49
|
+
try {
|
|
50
|
+
const panelGroupKey = getPanelGroupKey(autoSaveId)
|
|
51
|
+
const serialized = storage.getItem(panelGroupKey)
|
|
52
|
+
if (serialized) {
|
|
53
|
+
const parsed = JSON.parse(serialized)
|
|
54
|
+
if (typeof parsed === 'object' && parsed != null) return parsed as SerializedPanelGroupState
|
|
55
|
+
}
|
|
56
|
+
} catch {}
|
|
57
|
+
return null
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function loadPanelGroupState(
|
|
61
|
+
autoSaveId: string,
|
|
62
|
+
panels: PanelData[],
|
|
63
|
+
storage: PanelGroupStorage,
|
|
64
|
+
) {
|
|
65
|
+
const state = loadSerializedPanelGroupState(autoSaveId, storage) ?? {}
|
|
66
|
+
const panelKey = getPanelKey(panels)
|
|
67
|
+
return state[panelKey] ?? null
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function savePanelGroupState(
|
|
71
|
+
autoSaveId: string,
|
|
72
|
+
panels: PanelData[],
|
|
73
|
+
panelSizesBeforeCollapse: Map<string, number>,
|
|
74
|
+
sizes: number[],
|
|
75
|
+
storage: PanelGroupStorage,
|
|
76
|
+
): void {
|
|
77
|
+
const panelGroupKey = getPanelGroupKey(autoSaveId)
|
|
78
|
+
const panelKey = getPanelKey(panels)
|
|
79
|
+
const state = loadSerializedPanelGroupState(autoSaveId, storage) ?? {}
|
|
80
|
+
const sizeUnits: Record<number, 'px'> = {}
|
|
81
|
+
panels.forEach((panel, index) => {
|
|
82
|
+
const unit = panel.constraints.sizeUnit ?? '%'
|
|
83
|
+
if (unit === 'px') sizeUnits[index] = 'px'
|
|
84
|
+
})
|
|
85
|
+
state[panelKey] = {
|
|
86
|
+
expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
|
|
87
|
+
layout: sizes,
|
|
88
|
+
...(Object.keys(sizeUnits).length > 0 && { sizeUnits }),
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
storage.setItem(panelGroupKey, JSON.stringify(state))
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error(error)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EXCEEDED_HORIZONTAL_MAX,
|
|
3
|
+
EXCEEDED_HORIZONTAL_MIN,
|
|
4
|
+
EXCEEDED_VERTICAL_MAX,
|
|
5
|
+
EXCEEDED_VERTICAL_MIN,
|
|
6
|
+
} from './flags'
|
|
7
|
+
import type { DragState, PanelData } from './types'
|
|
8
|
+
|
|
9
|
+
type CursorState = 'horizontal' | 'intersection' | 'vertical'
|
|
10
|
+
|
|
11
|
+
let currentCursorStyle: string | null = null
|
|
12
|
+
let styleElement: HTMLStyleElement | null = null
|
|
13
|
+
|
|
14
|
+
export function getCursorStyle(state: CursorState, constraintFlags: number): string {
|
|
15
|
+
if (constraintFlags) {
|
|
16
|
+
const horizontalMin = (constraintFlags & EXCEEDED_HORIZONTAL_MIN) !== 0
|
|
17
|
+
const horizontalMax = (constraintFlags & EXCEEDED_HORIZONTAL_MAX) !== 0
|
|
18
|
+
const verticalMin = (constraintFlags & EXCEEDED_VERTICAL_MIN) !== 0
|
|
19
|
+
const verticalMax = (constraintFlags & EXCEEDED_VERTICAL_MAX) !== 0
|
|
20
|
+
if (horizontalMin) {
|
|
21
|
+
if (verticalMin) return 'se-resize'
|
|
22
|
+
else if (verticalMax) return 'ne-resize'
|
|
23
|
+
else return 'e-resize'
|
|
24
|
+
} else if (horizontalMax) {
|
|
25
|
+
if (verticalMin) return 'sw-resize'
|
|
26
|
+
else if (verticalMax) return 'nw-resize'
|
|
27
|
+
else return 'w-resize'
|
|
28
|
+
} else if (verticalMin) {
|
|
29
|
+
return 's-resize'
|
|
30
|
+
} else if (verticalMax) {
|
|
31
|
+
return 'n-resize'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
switch (state) {
|
|
35
|
+
case 'horizontal':
|
|
36
|
+
return 'ew-resize'
|
|
37
|
+
case 'intersection':
|
|
38
|
+
return 'move'
|
|
39
|
+
case 'vertical':
|
|
40
|
+
return 'ns-resize'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function resetGlobalCursorStyle() {
|
|
45
|
+
if (styleElement !== null) {
|
|
46
|
+
document.head.removeChild(styleElement)
|
|
47
|
+
currentCursorStyle = null
|
|
48
|
+
styleElement = null
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function setGlobalCursorStyle(
|
|
53
|
+
state: CursorState,
|
|
54
|
+
constraintFlags: number,
|
|
55
|
+
nonce: string | undefined,
|
|
56
|
+
) {
|
|
57
|
+
const style = getCursorStyle(state, constraintFlags)
|
|
58
|
+
if (currentCursorStyle === style) return
|
|
59
|
+
currentCursorStyle = style
|
|
60
|
+
if (styleElement === null) {
|
|
61
|
+
styleElement = document.createElement('style')
|
|
62
|
+
if (nonce) styleElement.nonce = nonce
|
|
63
|
+
document.head.appendChild(styleElement)
|
|
64
|
+
}
|
|
65
|
+
styleElement.textContent = `*{cursor: ${style}!important;}`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function computePanelFlexBoxStyle({
|
|
69
|
+
defaultSize,
|
|
70
|
+
dragState,
|
|
71
|
+
layout,
|
|
72
|
+
panelData,
|
|
73
|
+
panelIndex,
|
|
74
|
+
precision = 3,
|
|
75
|
+
}: {
|
|
76
|
+
defaultSize: number | undefined
|
|
77
|
+
dragState: DragState | null
|
|
78
|
+
layout: number[]
|
|
79
|
+
panelData: PanelData[]
|
|
80
|
+
panelIndex: number
|
|
81
|
+
precision?: number
|
|
82
|
+
}) {
|
|
83
|
+
const size = layout[panelIndex]
|
|
84
|
+
let flexGrow: string
|
|
85
|
+
if (size == null) flexGrow = defaultSize !== undefined ? defaultSize.toPrecision(precision) : '1'
|
|
86
|
+
else if (panelData.length === 1) flexGrow = '1'
|
|
87
|
+
else flexGrow = size.toPrecision(precision)
|
|
88
|
+
return {
|
|
89
|
+
flexBasis: 0,
|
|
90
|
+
flexGrow,
|
|
91
|
+
flexShrink: 1,
|
|
92
|
+
overflow: 'hidden',
|
|
93
|
+
pointerEvents: dragState !== null ? 'none' : undefined,
|
|
94
|
+
} as const
|
|
95
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type Direction = 'horizontal' | 'vertical'
|
|
2
|
+
export type SizeUnit = '%' | 'px'
|
|
3
|
+
|
|
4
|
+
export interface PanelConstraints {
|
|
5
|
+
collapsedSize?: number
|
|
6
|
+
collapsible?: boolean
|
|
7
|
+
defaultSize?: number
|
|
8
|
+
maxSize?: number
|
|
9
|
+
minSize?: number
|
|
10
|
+
sizeUnit?: SizeUnit
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PanelCallbacks {
|
|
14
|
+
onCollapse?: () => void
|
|
15
|
+
onExpand?: () => void
|
|
16
|
+
onResize?: (size: number, prevSize: number | undefined) => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PanelData {
|
|
20
|
+
callbacks: PanelCallbacks
|
|
21
|
+
constraints: PanelConstraints
|
|
22
|
+
id: string
|
|
23
|
+
idIsFromProps: boolean
|
|
24
|
+
order: number | undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DragState {
|
|
28
|
+
dragHandleId: string
|
|
29
|
+
dragHandleRect: DOMRect
|
|
30
|
+
initialCursorPosition: number
|
|
31
|
+
initialLayout: number[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ResizeEvent = KeyboardEvent | MouseEvent | TouchEvent
|
|
35
|
+
export type ResizeHandler = (event: ResizeEvent) => void
|
|
36
|
+
export type ResizeHandlerAction = 'down' | 'move' | 'up'
|
|
37
|
+
export type ResizeHandlerState = 'drag' | 'hover' | 'inactive'
|
|
38
|
+
export type SetResizeHandlerState = (
|
|
39
|
+
action: ResizeHandlerAction,
|
|
40
|
+
isActive: boolean,
|
|
41
|
+
event: ResizeEvent,
|
|
42
|
+
) => void
|
|
43
|
+
export type PointerHitAreaMargins = { coarse: number; fine: number }
|
|
44
|
+
|
|
45
|
+
export interface PanelGroupStorage {
|
|
46
|
+
getItem: (name: string) => string | null
|
|
47
|
+
setItem: (name: string, value: string) => void
|
|
48
|
+
}
|