@youcan/celeste 0.15.0 → 0.17.0
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/ai/README.md +1 -1
- package/ai/component-registry.json +922 -78
- package/ai/icons.json +2 -2
- package/ai/tokens.json +2 -2
- package/dist/celeste.css +406 -121
- package/dist/cjs/chunks/BubbleSelect.cjs +3 -3
- package/dist/cjs/chunks/CollapsibleRoot.cjs +1 -1
- package/dist/cjs/chunks/Collection.cjs +7 -1
- package/dist/cjs/chunks/ComboboxContent.cjs +9 -5
- package/dist/cjs/chunks/ComboboxGroup.cjs +2 -2
- package/dist/cjs/chunks/ComboboxInput.cjs +10 -6
- package/dist/cjs/chunks/ComboboxItem.cjs +4 -3
- package/dist/cjs/chunks/ComboboxLabel.cjs +1 -1
- package/dist/cjs/chunks/ComboboxRoot.cjs +69 -14
- package/dist/cjs/chunks/ComboboxSeparator.cjs +1 -1
- package/dist/cjs/chunks/ConfigProvider.cjs +1 -1
- package/dist/cjs/chunks/DialogClose.cjs +1 -1
- package/dist/cjs/chunks/DialogDescription.cjs +1 -1
- package/dist/cjs/chunks/DialogPortal.cjs +22 -19
- package/dist/cjs/chunks/DialogRoot.cjs +1 -1
- package/dist/cjs/chunks/DialogTitle.cjs +1 -1
- package/dist/cjs/chunks/DialogTrigger.cjs +1 -1
- package/dist/cjs/chunks/DismissableLayer.cjs +19 -9
- package/dist/cjs/chunks/DrawerClose.cjs +40 -0
- package/dist/cjs/chunks/DrawerDescription.cjs +37 -0
- package/dist/cjs/chunks/DrawerRoot.cjs +366 -0
- package/dist/cjs/chunks/DrawerTitle.cjs +37 -0
- package/dist/cjs/chunks/DropdownMenuPortal.cjs +2 -2
- package/dist/cjs/chunks/DropdownMenuRoot.cjs +1 -1
- package/dist/cjs/chunks/FocusScope.cjs +18 -9
- package/dist/cjs/chunks/Label.cjs +1 -1
- package/dist/cjs/chunks/MenuAnchor.cjs +1 -1
- package/dist/cjs/chunks/MenuContentImpl.cjs +2 -2
- package/dist/cjs/chunks/MenuGroup.cjs +1 -1
- package/dist/cjs/chunks/MenuItemImpl.cjs +3 -2
- package/dist/cjs/chunks/MenuRoot.cjs +2 -2
- package/dist/cjs/chunks/MenuSub.cjs +1 -1
- package/dist/cjs/chunks/PaginationRoot.cjs +1 -1
- package/dist/cjs/chunks/PinInputRoot.cjs +1 -1
- package/dist/cjs/chunks/PopoverRoot.cjs +1 -1
- package/dist/cjs/chunks/PopperAnchor.cjs +1 -1
- package/dist/cjs/chunks/PopperArrow.cjs +2 -2
- package/dist/cjs/chunks/PopperContent.cjs +2 -2
- package/dist/cjs/chunks/PopperRoot.cjs +1 -1
- package/dist/cjs/chunks/Presence.cjs +6 -5
- package/dist/cjs/chunks/Primitive.cjs +3 -3
- package/dist/cjs/chunks/ProgressIndicator.cjs +2 -2
- package/dist/cjs/chunks/RadioGroupRoot.cjs +1 -1
- package/dist/cjs/chunks/RovingFocusGroup.cjs +1 -1
- package/dist/cjs/chunks/RovingFocusItem.cjs +1 -1
- package/dist/cjs/chunks/SelectGroup.cjs +1 -1
- package/dist/cjs/chunks/SelectItemAlignedPosition.cjs +8 -4
- package/dist/cjs/chunks/TabsRoot.cjs +1 -1
- package/dist/cjs/chunks/Teleport.cjs +1 -1
- package/dist/cjs/chunks/ToggleGroupRoot.cjs +2 -2
- package/dist/cjs/chunks/TooltipProvider.cjs +1 -1
- package/dist/cjs/chunks/TooltipRoot.cjs +2 -2
- package/dist/cjs/chunks/VisuallyHidden.cjs +1 -1
- package/dist/cjs/chunks/VisuallyHiddenInput.cjs +2 -2
- package/dist/cjs/chunks/calendar.cjs +11 -11
- package/dist/cjs/chunks/checkbox.cjs +4 -4
- package/dist/cjs/chunks/clamp.cjs +1 -1
- package/dist/cjs/chunks/collapsible-content.cjs +1 -1
- package/dist/cjs/chunks/collapsible-trigger.cjs +1 -1
- package/dist/cjs/chunks/combobox-anchor.cjs +1 -1
- package/dist/cjs/chunks/combobox-empty.cjs +1 -1
- package/dist/cjs/chunks/combobox-list.cjs +2 -2
- package/dist/cjs/chunks/combobox-trigger.cjs +1 -1
- package/dist/cjs/chunks/components.cjs +43 -7
- package/dist/cjs/chunks/content-divider.cjs +2 -2
- package/dist/cjs/chunks/counter-input.cjs +67 -23
- package/dist/cjs/chunks/createContext.cjs +1 -1
- package/dist/cjs/chunks/dialog-body.cjs +46 -0
- package/dist/cjs/chunks/dialog-close.cjs +31 -0
- package/dist/cjs/chunks/dialog-content.cjs +39 -0
- package/dist/cjs/chunks/dialog-description.cjs +37 -0
- package/dist/cjs/chunks/dialog-footer.cjs +46 -0
- package/dist/cjs/chunks/dialog-header.cjs +39 -0
- package/dist/cjs/chunks/dialog-title.cjs +37 -0
- package/dist/cjs/chunks/dialog-trigger.cjs +31 -0
- package/dist/cjs/chunks/dialog.cjs +76 -0
- package/dist/cjs/chunks/digit-input-slot.cjs +28 -7
- package/dist/cjs/chunks/drawer-body.cjs +73 -0
- package/dist/cjs/chunks/drawer-close.cjs +27 -0
- package/dist/cjs/chunks/drawer-content.cjs +1201 -0
- package/dist/cjs/chunks/drawer-description.cjs +40 -0
- package/dist/cjs/chunks/drawer-footer.cjs +30 -0
- package/dist/cjs/chunks/drawer-header.cjs +75 -0
- package/dist/cjs/chunks/drawer-title.cjs +40 -0
- package/dist/cjs/chunks/drawer-trigger.cjs +75 -0
- package/dist/cjs/chunks/drawer.cjs +54 -0
- package/dist/cjs/chunks/dropdown-menu-content.cjs +4 -4
- package/dist/cjs/chunks/dropdown-menu-group.cjs +1 -1
- package/dist/cjs/chunks/dropdown-menu-item.cjs +2 -2
- package/dist/cjs/chunks/dropdown-menu-label.cjs +2 -2
- package/dist/cjs/chunks/dropdown-menu-separator.cjs +2 -2
- package/dist/cjs/chunks/dropdown-menu-sub-content.cjs +2 -2
- package/dist/cjs/chunks/dropdown-menu-sub-trigger.cjs +2 -2
- package/dist/cjs/chunks/dropdown-menu-sub.cjs +1 -1
- package/dist/cjs/chunks/dropdown-menu-trigger.cjs +1 -1
- package/dist/cjs/chunks/getActiveElement.cjs +1 -1
- package/dist/cjs/chunks/handleAndDispatchCustomEvent.cjs +1 -1
- package/dist/cjs/chunks/isValueEqualOrExist.cjs +1 -1
- package/dist/cjs/chunks/modal-content.cjs +11 -6
- package/dist/cjs/chunks/nullish.cjs +1 -1
- package/dist/cjs/chunks/pagination-content.cjs +2 -2
- package/dist/cjs/chunks/pagination-ellipsis.cjs +1 -1
- package/dist/cjs/chunks/pagination-first.cjs +1 -1
- package/dist/cjs/chunks/pagination-item.cjs +1 -1
- package/dist/cjs/chunks/pagination-last.cjs +1 -1
- package/dist/cjs/chunks/pagination-next.cjs +1 -1
- package/dist/cjs/chunks/pagination-previous.cjs +1 -1
- package/dist/cjs/chunks/popover-content.cjs +8 -8
- package/dist/cjs/chunks/popover-trigger.cjs +3 -2
- package/dist/cjs/chunks/radio-group-item.cjs +5 -5
- package/dist/cjs/chunks/range-calendar.cjs +11 -11
- package/dist/cjs/chunks/scroll-area.cjs +3 -3
- package/dist/cjs/chunks/scroll-bar.cjs +12 -12
- package/dist/cjs/chunks/segmented-control-item.cjs +2 -2
- package/dist/cjs/chunks/select-content.cjs +4 -4
- package/dist/cjs/chunks/select-item.cjs +3 -3
- package/dist/cjs/chunks/select-label.cjs +1 -1
- package/dist/cjs/chunks/select-separator.cjs +1 -1
- package/dist/cjs/chunks/select-trigger.cjs +3 -3
- package/dist/cjs/chunks/select-value.cjs +1 -1
- package/dist/cjs/chunks/slider.cjs +9 -9
- package/dist/cjs/chunks/switch.cjs +2 -2
- package/dist/cjs/chunks/tab-menu-content.cjs +1 -1
- package/dist/cjs/chunks/tab-menu-item.cjs +1 -1
- package/dist/cjs/chunks/tab-menu-list.cjs +1 -1
- package/dist/cjs/chunks/tooltip-content.cjs +28 -16
- package/dist/cjs/chunks/tooltip-trigger.cjs +5 -5
- package/dist/cjs/chunks/useArrowNavigation.cjs +1 -1
- package/dist/cjs/chunks/useCalendar.cjs +34 -11
- package/dist/cjs/chunks/useComposing.cjs +20 -1
- package/dist/cjs/chunks/useDirection.cjs +1 -1
- package/dist/cjs/chunks/useEmitAsProps.cjs +1 -1
- package/dist/cjs/chunks/useFocusGuards.cjs +1 -1
- package/dist/cjs/chunks/useFormControl.cjs +1 -1
- package/dist/cjs/chunks/useForwardExpose.cjs +1 -1
- package/dist/cjs/chunks/useForwardProps.cjs +1 -1
- package/dist/cjs/chunks/useForwardPropsEmits.cjs +1 -1
- package/dist/cjs/chunks/useForwardScopeId.cjs +1 -1
- package/dist/cjs/chunks/useHideOthers.cjs +1 -1
- package/dist/cjs/chunks/useId.cjs +1 -1
- package/dist/cjs/chunks/useKbd.cjs +1 -1
- package/dist/cjs/chunks/useLocale.cjs +1 -1
- package/dist/cjs/chunks/useNonce.cjs +1 -1
- package/dist/cjs/chunks/usePrimitiveElement.cjs +1 -1
- package/dist/cjs/chunks/useSize.cjs +1 -1
- package/dist/cjs/chunks/useTypeahead.cjs +1 -1
- package/dist/cjs/chunks/utils.cjs +1 -1
- package/dist/cjs/chunks/utils2.cjs +1 -1
- package/dist/cjs/chunks/utils3.cjs +1 -1
- package/dist/cjs/context.cjs +6 -0
- package/dist/cjs/dialog-body.cjs +2 -0
- package/dist/cjs/dialog-close.cjs +2 -0
- package/dist/cjs/dialog-content.cjs +2 -0
- package/dist/cjs/dialog-description.cjs +2 -0
- package/dist/cjs/dialog-footer.cjs +2 -0
- package/dist/cjs/dialog-header.cjs +2 -0
- package/dist/cjs/dialog-title.cjs +2 -0
- package/dist/cjs/dialog-trigger.cjs +2 -0
- package/dist/cjs/dialog.cjs +2 -0
- package/dist/cjs/drawer-body.cjs +2 -0
- package/dist/cjs/drawer-close.cjs +2 -0
- package/dist/cjs/drawer-content.cjs +2 -0
- package/dist/cjs/drawer-description.cjs +2 -0
- package/dist/cjs/drawer-footer.cjs +2 -0
- package/dist/cjs/drawer-header.cjs +2 -0
- package/dist/cjs/drawer-title.cjs +2 -0
- package/dist/cjs/drawer-trigger.cjs +2 -0
- package/dist/cjs/drawer.cjs +2 -0
- package/dist/cjs/index.cjs +43 -7
- package/dist/components/dialog/context.d.ts +14 -0
- package/dist/components/dialog/dialog-body.d.ts +19 -0
- package/dist/components/dialog/dialog-close.d.ts +15 -0
- package/dist/components/dialog/dialog-content.d.ts +19 -0
- package/dist/components/dialog/dialog-description.d.ts +17 -0
- package/dist/components/dialog/dialog-footer.d.ts +19 -0
- package/dist/components/dialog/dialog-header.d.ts +13 -0
- package/dist/components/dialog/dialog-title.d.ts +17 -0
- package/dist/components/dialog/dialog-trigger.d.ts +15 -0
- package/dist/components/dialog/dialog.d.ts +28 -0
- package/dist/components/dialog/index.d.ts +18 -0
- package/dist/components/digit-input/digit-input.d.ts +3 -3
- package/dist/components/drawer/drawer-body.d.ts +18 -0
- package/dist/components/drawer/drawer-close.d.ts +16 -0
- package/dist/components/drawer/drawer-content.d.ts +32 -0
- package/dist/components/drawer/drawer-description.d.ts +18 -0
- package/dist/components/drawer/drawer-footer.d.ts +17 -0
- package/dist/components/drawer/drawer-header.d.ts +24 -0
- package/dist/components/drawer/drawer-title.d.ts +18 -0
- package/dist/components/drawer/drawer-trigger.d.ts +16 -0
- package/dist/components/drawer/drawer.d.ts +30 -0
- package/dist/components/drawer/index.d.ts +18 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/modal/modal-content.d.ts +2 -2
- package/dist/es/chunks/BubbleSelect.js +3 -3
- package/dist/es/chunks/CollapsibleRoot.js +1 -1
- package/dist/es/chunks/Collection.js +7 -1
- package/dist/es/chunks/ComboboxContent.js +11 -7
- package/dist/es/chunks/ComboboxGroup.js +2 -2
- package/dist/es/chunks/ComboboxInput.js +10 -6
- package/dist/es/chunks/ComboboxItem.js +4 -3
- package/dist/es/chunks/ComboboxLabel.js +1 -1
- package/dist/es/chunks/ComboboxRoot.js +69 -14
- package/dist/es/chunks/ComboboxSeparator.js +1 -1
- package/dist/es/chunks/ConfigProvider.js +1 -1
- package/dist/es/chunks/DialogClose.js +1 -1
- package/dist/es/chunks/DialogDescription.js +1 -1
- package/dist/es/chunks/DialogPortal.js +23 -20
- package/dist/es/chunks/DialogRoot.js +1 -1
- package/dist/es/chunks/DialogTitle.js +1 -1
- package/dist/es/chunks/DialogTrigger.js +1 -1
- package/dist/es/chunks/DismissableLayer.js +14 -10
- package/dist/es/chunks/DrawerClose.js +35 -0
- package/dist/es/chunks/DrawerDescription.js +32 -0
- package/dist/es/chunks/DrawerRoot.js +325 -0
- package/dist/es/chunks/DrawerTitle.js +32 -0
- package/dist/es/chunks/DropdownMenuPortal.js +2 -2
- package/dist/es/chunks/DropdownMenuRoot.js +1 -1
- package/dist/es/chunks/FocusScope.js +13 -10
- package/dist/es/chunks/Label.js +1 -1
- package/dist/es/chunks/MenuAnchor.js +1 -1
- package/dist/es/chunks/MenuContentImpl.js +3 -3
- package/dist/es/chunks/MenuGroup.js +1 -1
- package/dist/es/chunks/MenuItemImpl.js +3 -2
- package/dist/es/chunks/MenuRoot.js +2 -2
- package/dist/es/chunks/MenuSub.js +1 -1
- package/dist/es/chunks/PaginationRoot.js +1 -1
- package/dist/es/chunks/PinInputRoot.js +1 -1
- package/dist/es/chunks/PopoverRoot.js +1 -1
- package/dist/es/chunks/PopperAnchor.js +1 -1
- package/dist/es/chunks/PopperArrow.js +2 -2
- package/dist/es/chunks/PopperContent.js +2 -2
- package/dist/es/chunks/PopperRoot.js +1 -1
- package/dist/es/chunks/Presence.js +6 -5
- package/dist/es/chunks/Primitive.js +3 -3
- package/dist/es/chunks/ProgressIndicator.js +2 -2
- package/dist/es/chunks/RadioGroupRoot.js +1 -1
- package/dist/es/chunks/RovingFocusGroup.js +1 -1
- package/dist/es/chunks/RovingFocusItem.js +1 -1
- package/dist/es/chunks/SelectGroup.js +1 -1
- package/dist/es/chunks/SelectItemAlignedPosition.js +9 -5
- package/dist/es/chunks/TabsRoot.js +1 -1
- package/dist/es/chunks/Teleport.js +1 -1
- package/dist/es/chunks/ToggleGroupRoot.js +2 -2
- package/dist/es/chunks/TooltipProvider.js +1 -1
- package/dist/es/chunks/TooltipRoot.js +2 -2
- package/dist/es/chunks/VisuallyHidden.js +1 -1
- package/dist/es/chunks/VisuallyHiddenInput.js +2 -2
- package/dist/es/chunks/calendar.js +11 -11
- package/dist/es/chunks/checkbox.js +4 -4
- package/dist/es/chunks/clamp.js +1 -1
- package/dist/es/chunks/collapsible-content.js +1 -1
- package/dist/es/chunks/collapsible-trigger.js +1 -1
- package/dist/es/chunks/combobox-anchor.js +1 -1
- package/dist/es/chunks/combobox-empty.js +1 -1
- package/dist/es/chunks/combobox-list.js +2 -2
- package/dist/es/chunks/combobox-trigger.js +1 -1
- package/dist/es/chunks/components.js +43 -7
- package/dist/es/chunks/content-divider.js +2 -2
- package/dist/es/chunks/counter-input.js +68 -24
- package/dist/es/chunks/createContext.js +1 -1
- package/dist/es/chunks/dialog-body.js +39 -0
- package/dist/es/chunks/dialog-close.js +26 -0
- package/dist/es/chunks/dialog-content.js +34 -0
- package/dist/es/chunks/dialog-description.js +30 -0
- package/dist/es/chunks/dialog-footer.js +39 -0
- package/dist/es/chunks/dialog-header.js +34 -0
- package/dist/es/chunks/dialog-title.js +30 -0
- package/dist/es/chunks/dialog-trigger.js +26 -0
- package/dist/es/chunks/dialog.js +71 -0
- package/dist/es/chunks/digit-input-slot.js +28 -7
- package/dist/es/chunks/drawer-body.js +65 -0
- package/dist/es/chunks/drawer-close.js +22 -0
- package/dist/es/chunks/drawer-content.js +1193 -0
- package/dist/es/chunks/drawer-description.js +33 -0
- package/dist/es/chunks/drawer-footer.js +23 -0
- package/dist/es/chunks/drawer-header.js +69 -0
- package/dist/es/chunks/drawer-title.js +33 -0
- package/dist/es/chunks/drawer-trigger.js +70 -0
- package/dist/es/chunks/drawer.js +49 -0
- package/dist/es/chunks/dropdown-menu-content.js +4 -4
- package/dist/es/chunks/dropdown-menu-group.js +1 -1
- package/dist/es/chunks/dropdown-menu-item.js +2 -2
- package/dist/es/chunks/dropdown-menu-label.js +2 -2
- package/dist/es/chunks/dropdown-menu-separator.js +2 -2
- package/dist/es/chunks/dropdown-menu-sub-content.js +2 -2
- package/dist/es/chunks/dropdown-menu-sub-trigger.js +2 -2
- package/dist/es/chunks/dropdown-menu-sub.js +1 -1
- package/dist/es/chunks/dropdown-menu-trigger.js +1 -1
- package/dist/es/chunks/getActiveElement.js +1 -1
- package/dist/es/chunks/handleAndDispatchCustomEvent.js +1 -1
- package/dist/es/chunks/isValueEqualOrExist.js +1 -1
- package/dist/es/chunks/modal-content.js +12 -7
- package/dist/es/chunks/nullish.js +1 -1
- package/dist/es/chunks/pagination-content.js +2 -2
- package/dist/es/chunks/pagination-ellipsis.js +1 -1
- package/dist/es/chunks/pagination-first.js +1 -1
- package/dist/es/chunks/pagination-item.js +1 -1
- package/dist/es/chunks/pagination-last.js +1 -1
- package/dist/es/chunks/pagination-next.js +1 -1
- package/dist/es/chunks/pagination-previous.js +1 -1
- package/dist/es/chunks/popover-content.js +9 -9
- package/dist/es/chunks/popover-trigger.js +3 -2
- package/dist/es/chunks/radio-group-item.js +5 -5
- package/dist/es/chunks/range-calendar.js +11 -11
- package/dist/es/chunks/scroll-area.js +3 -3
- package/dist/es/chunks/scroll-bar.js +12 -12
- package/dist/es/chunks/segmented-control-item.js +2 -2
- package/dist/es/chunks/select-content.js +4 -4
- package/dist/es/chunks/select-item.js +3 -3
- package/dist/es/chunks/select-label.js +1 -1
- package/dist/es/chunks/select-separator.js +1 -1
- package/dist/es/chunks/select-trigger.js +3 -3
- package/dist/es/chunks/select-value.js +1 -1
- package/dist/es/chunks/slider.js +9 -9
- package/dist/es/chunks/switch.js +2 -2
- package/dist/es/chunks/tab-menu-content.js +1 -1
- package/dist/es/chunks/tab-menu-item.js +1 -1
- package/dist/es/chunks/tab-menu-list.js +1 -1
- package/dist/es/chunks/tooltip-content.js +28 -16
- package/dist/es/chunks/tooltip-trigger.js +6 -6
- package/dist/es/chunks/useArrowNavigation.js +1 -1
- package/dist/es/chunks/useCalendar.js +34 -11
- package/dist/es/chunks/useComposing.js +21 -2
- package/dist/es/chunks/useDirection.js +1 -1
- package/dist/es/chunks/useEmitAsProps.js +1 -1
- package/dist/es/chunks/useFocusGuards.js +1 -1
- package/dist/es/chunks/useFormControl.js +1 -1
- package/dist/es/chunks/useForwardExpose.js +1 -1
- package/dist/es/chunks/useForwardProps.js +1 -1
- package/dist/es/chunks/useForwardPropsEmits.js +1 -1
- package/dist/es/chunks/useForwardScopeId.js +1 -1
- package/dist/es/chunks/useHideOthers.js +1 -1
- package/dist/es/chunks/useId.js +1 -1
- package/dist/es/chunks/useKbd.js +1 -1
- package/dist/es/chunks/useLocale.js +1 -1
- package/dist/es/chunks/useNonce.js +1 -1
- package/dist/es/chunks/usePrimitiveElement.js +1 -1
- package/dist/es/chunks/useSize.js +1 -1
- package/dist/es/chunks/useTypeahead.js +1 -1
- package/dist/es/chunks/utils.js +1 -1
- package/dist/es/chunks/utils2.js +1 -1
- package/dist/es/chunks/utils3.js +1 -1
- package/dist/es/context.js +5 -0
- package/dist/es/dialog-body.js +2 -0
- package/dist/es/dialog-close.js +2 -0
- package/dist/es/dialog-content.js +2 -0
- package/dist/es/dialog-description.js +2 -0
- package/dist/es/dialog-footer.js +2 -0
- package/dist/es/dialog-header.js +2 -0
- package/dist/es/dialog-title.js +2 -0
- package/dist/es/dialog-trigger.js +2 -0
- package/dist/es/dialog.js +2 -0
- package/dist/es/drawer-body.js +2 -0
- package/dist/es/drawer-close.js +2 -0
- package/dist/es/drawer-content.js +2 -0
- package/dist/es/drawer-description.js +2 -0
- package/dist/es/drawer-footer.js +2 -0
- package/dist/es/drawer-header.js +2 -0
- package/dist/es/drawer-title.js +2 -0
- package/dist/es/drawer-trigger.js +2 -0
- package/dist/es/drawer.js +2 -0
- package/dist/es/index.js +26 -8
- package/package.json +4 -4
- package/src/components/dialog/context.ts +4 -0
- package/src/components/dialog/dialog-body.vue +30 -0
- package/src/components/dialog/dialog-close.vue +16 -0
- package/src/components/dialog/dialog-content.vue +23 -0
- package/src/components/dialog/dialog-description.vue +28 -0
- package/src/components/dialog/dialog-footer.vue +32 -0
- package/src/components/dialog/dialog-header.vue +29 -0
- package/src/components/dialog/dialog-title.vue +28 -0
- package/src/components/dialog/dialog-trigger.vue +16 -0
- package/src/components/dialog/dialog.vue +38 -0
- package/src/components/dialog/index.ts +18 -0
- package/src/components/dialog/stories/dialog.stories.ts +74 -0
- package/src/components/drawer/drawer-body.vue +30 -0
- package/src/components/drawer/drawer-close.vue +14 -0
- package/src/components/drawer/drawer-content.vue +259 -0
- package/src/components/drawer/drawer-description.vue +29 -0
- package/src/components/drawer/drawer-footer.vue +27 -0
- package/src/components/drawer/drawer-header.vue +95 -0
- package/src/components/drawer/drawer-title.vue +29 -0
- package/src/components/drawer/drawer-trigger.vue +14 -0
- package/src/components/drawer/drawer.vue +29 -0
- package/src/components/drawer/index.ts +18 -0
- package/src/components/drawer/stories/drawer.stories.ts +78 -0
- package/src/components/index.ts +2 -0
- package/src/components/modal/modal-content.vue +41 -17
|
@@ -0,0 +1,1193 @@
|
|
|
1
|
+
import { t as clsx } from "./clsx.js";
|
|
2
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
3
|
+
import { f as reactiveOmit } from "./dist.js";
|
|
4
|
+
import { d as useResizeObserver, s as useEventListener } from "./dist2.js";
|
|
5
|
+
import { t as Primitive } from "./Primitive.js";
|
|
6
|
+
import { t as DismissableLayer_default } from "./DismissableLayer.js";
|
|
7
|
+
import { n as focus, r as useBodyScrollLock, t as FocusScope_default } from "./FocusScope.js";
|
|
8
|
+
import { t as useEmitAsProps } from "./useEmitAsProps.js";
|
|
9
|
+
import { t as useForwardExpose } from "./useForwardExpose.js";
|
|
10
|
+
import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
|
|
11
|
+
import { t as useHideOthers } from "./useHideOthers.js";
|
|
12
|
+
import { t as Presence_default } from "./Presence.js";
|
|
13
|
+
import { t as Teleport_default } from "./Teleport.js";
|
|
14
|
+
import { a as getDisplacement, i as computeSwipeReleaseScalar, n as injectDrawerRootContext, o as getElementTransform, r as DRAWER_CSS_VARS, s as registerDrawerCssProperties } from "./DrawerRoot.js";
|
|
15
|
+
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onMounted, onUnmounted, openBlock, ref, renderSlot, toValue, unref, watch, withCtx } from "vue";
|
|
16
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/composables/useDrawerSnapPoints.js
|
|
17
|
+
var SNAP_VELOCITY_THRESHOLD = .5;
|
|
18
|
+
var SNAP_VELOCITY_MULTIPLIER = 300;
|
|
19
|
+
var MAX_SNAP_VELOCITY = 4;
|
|
20
|
+
var FAST_SWIPE_VELOCITY = .5;
|
|
21
|
+
function parseSnapPoint(value, viewportHeight, rootFontSize) {
|
|
22
|
+
let result = null;
|
|
23
|
+
if (typeof value === "number") result = value >= 0 && value <= 1 ? value * viewportHeight : value;
|
|
24
|
+
else if (value.endsWith("rem")) result = Number.parseFloat(value) * rootFontSize;
|
|
25
|
+
else if (value.endsWith("px")) result = Number.parseFloat(value);
|
|
26
|
+
if (result == null || !Number.isFinite(result) || result < 0) return null;
|
|
27
|
+
return Math.round(result);
|
|
28
|
+
}
|
|
29
|
+
function useDrawerSnapPoints(options) {
|
|
30
|
+
const { snapPoints, activeSnapPoint, popupHeight, viewportRef, onSnapPointChange } = options;
|
|
31
|
+
const viewportHeight = ref(typeof window !== "undefined" ? window.innerHeight : 0);
|
|
32
|
+
const rootFontSize = ref(typeof document !== "undefined" ? Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16 : 16);
|
|
33
|
+
if (typeof window !== "undefined") useEventListener(window, "resize", () => {
|
|
34
|
+
viewportHeight.value = window.innerHeight;
|
|
35
|
+
});
|
|
36
|
+
const resolvedSnapPoints = computed(() => {
|
|
37
|
+
const points = snapPoints.value;
|
|
38
|
+
if (!points || points.length === 0) return [];
|
|
39
|
+
const vh = viewportHeight.value;
|
|
40
|
+
const fs = rootFontSize.value;
|
|
41
|
+
const ph = popupHeight.value;
|
|
42
|
+
const resolved = [];
|
|
43
|
+
for (const pt of points) {
|
|
44
|
+
const height = parseSnapPoint(pt, vh, fs);
|
|
45
|
+
if (height == null) continue;
|
|
46
|
+
if (resolved.some((r) => Math.abs(r.height - height) <= 1)) continue;
|
|
47
|
+
const clampedHeight = Math.min(height, Math.min(ph, vh));
|
|
48
|
+
resolved.push({
|
|
49
|
+
value: pt,
|
|
50
|
+
height: clampedHeight,
|
|
51
|
+
offset: Math.max(0, ph - clampedHeight)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return resolved.sort((a, b) => a.height - b.height);
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the currently-active snap point to its resolved entry, matching by
|
|
58
|
+
* raw value OR by parsed-height equivalence. This lets a controlled drawer use
|
|
59
|
+
* interchangeable representations (`'16rem'` vs `256`, `0.5` vs `400`) without
|
|
60
|
+
* the release math falling back to offset `0` and jumping to the wrong target.
|
|
61
|
+
*/
|
|
62
|
+
function findActiveResolvedPoint() {
|
|
63
|
+
if (!activeSnapPoint.value || resolvedSnapPoints.value.length === 0) return void 0;
|
|
64
|
+
const activeHeight = parseSnapPoint(activeSnapPoint.value, viewportHeight.value, rootFontSize.value);
|
|
65
|
+
return resolvedSnapPoints.value.find((r) => r.value === activeSnapPoint.value || activeHeight != null && Math.abs(r.height - activeHeight) <= 1);
|
|
66
|
+
}
|
|
67
|
+
const activeSnapPointOffset = computed(() => findActiveResolvedPoint()?.offset ?? null);
|
|
68
|
+
/**
|
|
69
|
+
* BaseUI-parity snap release math (ported from `DrawerViewport.tsx` lines ~577-714).
|
|
70
|
+
*
|
|
71
|
+
* Takes a **dismiss-signed** drag delta (positive = dismiss direction, negative =
|
|
72
|
+
* open direction) and the raw velocity vector. Computes a velocity-boosted target
|
|
73
|
+
* offset, then either dismisses, snaps to the closest point, or (in sequential
|
|
74
|
+
* mode) advances one step based on physical crossing + fast-swipe velocity.
|
|
75
|
+
*/
|
|
76
|
+
function snapToNearest(dragDelta, velocity, direction, sequential) {
|
|
77
|
+
const points = resolvedSnapPoints.value;
|
|
78
|
+
if (points.length === 0) return;
|
|
79
|
+
const ph = popupHeight.value;
|
|
80
|
+
const axisVel = direction === "up" || direction === "down" ? velocity.y : velocity.x;
|
|
81
|
+
const velSigned = direction === "up" || direction === "left" ? -axisVel : axisVel;
|
|
82
|
+
const activePoint = findActiveResolvedPoint();
|
|
83
|
+
const currentOffset = activePoint?.offset ?? 0;
|
|
84
|
+
const dragTargetOffset = Math.max(0, Math.min(ph, currentOffset + dragDelta));
|
|
85
|
+
let targetOffset = dragTargetOffset;
|
|
86
|
+
if (Math.abs(velSigned) >= SNAP_VELOCITY_THRESHOLD) targetOffset = dragTargetOffset + Math.max(-4, Math.min(MAX_SNAP_VELOCITY, velSigned)) * SNAP_VELOCITY_MULTIPLIER;
|
|
87
|
+
let closest = points[0];
|
|
88
|
+
let closestDist = Math.abs(targetOffset - closest.offset);
|
|
89
|
+
for (const p of points) {
|
|
90
|
+
const d = Math.abs(targetOffset - p.offset);
|
|
91
|
+
if (d < closestDist) {
|
|
92
|
+
closest = p;
|
|
93
|
+
closestDist = d;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (Math.abs(targetOffset - ph) < closestDist) {
|
|
97
|
+
onSnapPointChange(null);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (sequential) {
|
|
101
|
+
const sorted = [...points].sort((a, b) => a.offset - b.offset);
|
|
102
|
+
const currentIdx = activePoint ? sorted.indexOf(activePoint) : -1;
|
|
103
|
+
if (currentIdx < 0) {
|
|
104
|
+
onSnapPointChange(closest.value);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const dragDir = Math.sign(dragDelta);
|
|
108
|
+
const shouldAdvance = Math.sign(velSigned) === dragDir && Math.abs(velSigned) >= FAST_SWIPE_VELOCITY;
|
|
109
|
+
const adjacent = sorted[Math.max(0, Math.min(sorted.length - 1, currentIdx + dragDir))];
|
|
110
|
+
if (shouldAdvance) {
|
|
111
|
+
onSnapPointChange(adjacent.value);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const crossed = dragDir > 0 ? targetOffset > adjacent.offset : targetOffset < adjacent.offset;
|
|
115
|
+
onSnapPointChange(crossed ? adjacent.value : activeSnapPoint.value ?? closest.value);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
onSnapPointChange(closest.value);
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
resolvedSnapPoints,
|
|
122
|
+
activeSnapPointOffset,
|
|
123
|
+
viewportHeight,
|
|
124
|
+
snapToNearest
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/composables/useSwipeDismiss.js
|
|
129
|
+
var DEFAULT_SWIPE_THRESHOLD = 40;
|
|
130
|
+
var REVERSE_CANCEL_THRESHOLD = 10;
|
|
131
|
+
var MIN_DRAG_THRESHOLD = 1;
|
|
132
|
+
var AXIS_LOCK_SLOP = 6;
|
|
133
|
+
var AXIS_LOCK_BIAS = 2;
|
|
134
|
+
var MIN_RELEASE_VELOCITY_DURATION_MS = 16;
|
|
135
|
+
var MAX_RELEASE_VELOCITY_AGE_MS = 80;
|
|
136
|
+
var DEFAULT_IGNORE_SELECTOR = "button,a,input,select,textarea,label,[role=\"button\"]";
|
|
137
|
+
function findScrollableAncestor(el, axis) {
|
|
138
|
+
if (!el || el === document.body) return null;
|
|
139
|
+
const style = window.getComputedStyle(el);
|
|
140
|
+
const overflow = axis === "vertical" ? style.overflowY : style.overflowX;
|
|
141
|
+
if ((overflow === "auto" || overflow === "scroll") && (axis === "vertical" ? el.scrollHeight > el.clientHeight : el.scrollWidth > el.clientWidth)) return el;
|
|
142
|
+
return findScrollableAncestor(el.parentElement, axis);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Returns whether the user can start a swipe dismiss from a scrollable element
|
|
146
|
+
* based on the scroll position and drag direction.
|
|
147
|
+
* Ported from BaseUI `useSwipeDismiss.ts:canSwipeFromScrollEdgeOnPendingMove`.
|
|
148
|
+
*
|
|
149
|
+
* Returns:
|
|
150
|
+
* true → swipe is allowed (scroll is at the relevant edge)
|
|
151
|
+
* false → swipe is blocked (user is scrolling, not dismissing)
|
|
152
|
+
* null → the drag is not along a recognized axis; caller should fall through
|
|
153
|
+
*/
|
|
154
|
+
function canSwipeFromScrollEdge(scrollTarget, deltaX, deltaY, flags) {
|
|
155
|
+
const absDx = Math.abs(deltaX);
|
|
156
|
+
const absDy = Math.abs(deltaY);
|
|
157
|
+
if (flags.hasVertical && deltaY !== 0 && (!flags.hasHorizontal || absDy >= absDx)) {
|
|
158
|
+
const maxScrollTop = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);
|
|
159
|
+
const atTop = scrollTarget.scrollTop <= 0;
|
|
160
|
+
const atBottom = scrollTarget.scrollTop >= maxScrollTop;
|
|
161
|
+
const movingDown = deltaY > 0;
|
|
162
|
+
const movingUp = deltaY < 0;
|
|
163
|
+
const canSwipeDown = movingDown && atTop && flags.allowDown;
|
|
164
|
+
const canSwipeUp = movingUp && atBottom && flags.allowUp;
|
|
165
|
+
return canSwipeDown || canSwipeUp;
|
|
166
|
+
}
|
|
167
|
+
if (flags.hasHorizontal && deltaX !== 0 && (!flags.hasVertical || absDx > absDy)) {
|
|
168
|
+
const maxScrollLeft = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);
|
|
169
|
+
const atLeft = scrollTarget.scrollLeft <= 0;
|
|
170
|
+
const atRight = scrollTarget.scrollLeft >= maxScrollLeft;
|
|
171
|
+
const movingRight = deltaX > 0;
|
|
172
|
+
const movingLeft = deltaX < 0;
|
|
173
|
+
const canSwipeRight = movingRight && atLeft && flags.allowRight;
|
|
174
|
+
const canSwipeLeft = movingLeft && atRight && flags.allowLeft;
|
|
175
|
+
return canSwipeRight || canSwipeLeft;
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
function useSwipeDismiss(options) {
|
|
180
|
+
const { elementRef, directions, movementCssVars, swipeThreshold: swipeThresholdProp, canStart, onDismiss, onProgress, onCancel, onSwipeStart, onRelease, onSwipingChange } = options;
|
|
181
|
+
const hasVertical = computed(() => toValue(directions).includes("up") || toValue(directions).includes("down"));
|
|
182
|
+
const hasHorizontal = computed(() => toValue(directions).includes("left") || toValue(directions).includes("right"));
|
|
183
|
+
const allowUp = computed(() => toValue(directions).includes("up"));
|
|
184
|
+
const allowDown = computed(() => toValue(directions).includes("down"));
|
|
185
|
+
const allowLeft = computed(() => toValue(directions).includes("left"));
|
|
186
|
+
const allowRight = computed(() => toValue(directions).includes("right"));
|
|
187
|
+
const drawerAxis = computed(() => {
|
|
188
|
+
if (hasVertical.value === hasHorizontal.value) return null;
|
|
189
|
+
return hasVertical.value ? "vertical" : "horizontal";
|
|
190
|
+
});
|
|
191
|
+
const isSwiping = ref(false);
|
|
192
|
+
const swipeDirection = ref(void 0);
|
|
193
|
+
const dragOffset = ref({
|
|
194
|
+
x: 0,
|
|
195
|
+
y: 0
|
|
196
|
+
});
|
|
197
|
+
let dragStartPos = {
|
|
198
|
+
x: 0,
|
|
199
|
+
y: 0
|
|
200
|
+
};
|
|
201
|
+
let intendedDirection;
|
|
202
|
+
let maxDisplacement = 0;
|
|
203
|
+
let cancelledSwipe = false;
|
|
204
|
+
let isFirstMove = false;
|
|
205
|
+
let pendingSwipe = false;
|
|
206
|
+
let pendingSwipeStartPos = null;
|
|
207
|
+
let swipeFromScrollable = false;
|
|
208
|
+
let scrollableAncestor = null;
|
|
209
|
+
let crossAxisScrollable = null;
|
|
210
|
+
let drawerAxisAttributed = false;
|
|
211
|
+
let preserveNativeCrossAxisScroll = false;
|
|
212
|
+
let elementSize = {
|
|
213
|
+
width: 0,
|
|
214
|
+
height: 0
|
|
215
|
+
};
|
|
216
|
+
let swipeProgress = 0;
|
|
217
|
+
let lastDragSample = null;
|
|
218
|
+
let lastVelocity = {
|
|
219
|
+
x: 0,
|
|
220
|
+
y: 0
|
|
221
|
+
};
|
|
222
|
+
let lockedAxis = null;
|
|
223
|
+
let activePointerId = null;
|
|
224
|
+
let pointerStarted = false;
|
|
225
|
+
function getThreshold(el, dir) {
|
|
226
|
+
if (typeof swipeThresholdProp === "function") return Math.max(0, swipeThresholdProp({
|
|
227
|
+
element: el,
|
|
228
|
+
direction: dir
|
|
229
|
+
}));
|
|
230
|
+
return typeof swipeThresholdProp === "number" ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD;
|
|
231
|
+
}
|
|
232
|
+
function setSwiping(next) {
|
|
233
|
+
if (isSwiping.value === next) return;
|
|
234
|
+
isSwiping.value = next;
|
|
235
|
+
onSwipingChange?.(next);
|
|
236
|
+
}
|
|
237
|
+
function recordSample(offset, time) {
|
|
238
|
+
if (lastDragSample && time > lastDragSample.time) {
|
|
239
|
+
const dt = Math.max(time - lastDragSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);
|
|
240
|
+
lastVelocity = {
|
|
241
|
+
x: (offset.x - lastDragSample.x) / dt,
|
|
242
|
+
y: (offset.y - lastDragSample.y) / dt
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
lastDragSample = {
|
|
246
|
+
x: offset.x,
|
|
247
|
+
y: offset.y,
|
|
248
|
+
time
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function setCssVars(el, x, y) {
|
|
252
|
+
el.style.setProperty(movementCssVars.x, `${x}px`);
|
|
253
|
+
el.style.setProperty(movementCssVars.y, `${y}px`);
|
|
254
|
+
}
|
|
255
|
+
function clearCssVars(el) {
|
|
256
|
+
el.style.setProperty(movementCssVars.x, "0px");
|
|
257
|
+
el.style.setProperty(movementCssVars.y, "0px");
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Clears the per-gesture tracking state. Deliberately leaves the pointer
|
|
261
|
+
* identity and the touch scroll-guard flags alone, so it is safe to call at
|
|
262
|
+
* the start of a gesture as well as at the end of one.
|
|
263
|
+
*/
|
|
264
|
+
function resetGestureState() {
|
|
265
|
+
setSwiping(false);
|
|
266
|
+
swipeDirection.value = void 0;
|
|
267
|
+
dragOffset.value = {
|
|
268
|
+
x: 0,
|
|
269
|
+
y: 0
|
|
270
|
+
};
|
|
271
|
+
dragStartPos = {
|
|
272
|
+
x: 0,
|
|
273
|
+
y: 0
|
|
274
|
+
};
|
|
275
|
+
intendedDirection = void 0;
|
|
276
|
+
maxDisplacement = 0;
|
|
277
|
+
cancelledSwipe = false;
|
|
278
|
+
isFirstMove = false;
|
|
279
|
+
pendingSwipe = false;
|
|
280
|
+
pendingSwipeStartPos = null;
|
|
281
|
+
elementSize = {
|
|
282
|
+
width: 0,
|
|
283
|
+
height: 0
|
|
284
|
+
};
|
|
285
|
+
swipeProgress = 0;
|
|
286
|
+
lastDragSample = null;
|
|
287
|
+
lastVelocity = {
|
|
288
|
+
x: 0,
|
|
289
|
+
y: 0
|
|
290
|
+
};
|
|
291
|
+
lockedAxis = null;
|
|
292
|
+
}
|
|
293
|
+
function reset() {
|
|
294
|
+
resetGestureState();
|
|
295
|
+
swipeFromScrollable = false;
|
|
296
|
+
scrollableAncestor = null;
|
|
297
|
+
crossAxisScrollable = null;
|
|
298
|
+
drawerAxisAttributed = false;
|
|
299
|
+
preserveNativeCrossAxisScroll = false;
|
|
300
|
+
activePointerId = null;
|
|
301
|
+
pointerStarted = false;
|
|
302
|
+
}
|
|
303
|
+
function startSwipe(el, pos) {
|
|
304
|
+
resetGestureState();
|
|
305
|
+
getElementTransform(el);
|
|
306
|
+
dragStartPos = pos;
|
|
307
|
+
pendingSwipeStartPos = pos;
|
|
308
|
+
elementSize = {
|
|
309
|
+
width: el.offsetWidth,
|
|
310
|
+
height: el.offsetHeight
|
|
311
|
+
};
|
|
312
|
+
isFirstMove = true;
|
|
313
|
+
pendingSwipe = true;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Applies sqrt-damping to any axis moving in a disallowed direction.
|
|
317
|
+
* Axes moving in an allowed direction pass through linearly.
|
|
318
|
+
* Ported from BaseUI `useSwipeDismiss.ts:applyDirectionalDamping`.
|
|
319
|
+
*/
|
|
320
|
+
function applyDirectionalDamping(deltaX, deltaY) {
|
|
321
|
+
const exponent = (value) => value >= 0 ? value ** .5 : -(Math.abs(value) ** .5);
|
|
322
|
+
const dampAxis = (delta, allowNegative, allowPositive) => {
|
|
323
|
+
if (!allowNegative && delta < 0) return exponent(delta);
|
|
324
|
+
if (!allowPositive && delta > 0) return exponent(delta);
|
|
325
|
+
return delta;
|
|
326
|
+
};
|
|
327
|
+
return {
|
|
328
|
+
x: hasHorizontal.value ? dampAxis(deltaX, allowLeft.value, allowRight.value) : exponent(deltaX),
|
|
329
|
+
y: hasVertical.value ? dampAxis(deltaY, allowUp.value, allowDown.value) : exponent(deltaY)
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Arbitrates a touchmove between the drawer swipe and a native scroll on the
|
|
334
|
+
* cross axis. Returns `true` when the move must be left alone — the cross axis
|
|
335
|
+
* already won the gesture, or neither axis has passed the slop yet.
|
|
336
|
+
*/
|
|
337
|
+
function shouldYieldTouchMove(e, pos) {
|
|
338
|
+
if (preserveNativeCrossAxisScroll) return true;
|
|
339
|
+
if (drawerAxisAttributed || !crossAxisScrollable || !drawerAxis.value) return false;
|
|
340
|
+
if (!e.cancelable) {
|
|
341
|
+
preserveNativeCrossAxisScroll = true;
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
const isVerticalDrawerAxis = drawerAxis.value === "vertical";
|
|
345
|
+
const drawerAxisDelta = isVerticalDrawerAxis ? pos.y - dragStartPos.y : pos.x - dragStartPos.x;
|
|
346
|
+
const crossAxisDelta = isVerticalDrawerAxis ? pos.x - dragStartPos.x : pos.y - dragStartPos.y;
|
|
347
|
+
const absDrawerAxisDelta = Math.abs(drawerAxisDelta);
|
|
348
|
+
const absCrossAxisDelta = Math.abs(crossAxisDelta);
|
|
349
|
+
if (absCrossAxisDelta >= AXIS_LOCK_SLOP && absCrossAxisDelta > absDrawerAxisDelta + AXIS_LOCK_BIAS) {
|
|
350
|
+
preserveNativeCrossAxisScroll = true;
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
if (absDrawerAxisDelta >= AXIS_LOCK_SLOP) {
|
|
354
|
+
drawerAxisAttributed = true;
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
function processMove(el, pos, time) {
|
|
360
|
+
const rawDx = pos.x - dragStartPos.x;
|
|
361
|
+
const rawDy = pos.y - dragStartPos.y;
|
|
362
|
+
if (isFirstMove) {
|
|
363
|
+
isFirstMove = false;
|
|
364
|
+
const absX = Math.abs(rawDx);
|
|
365
|
+
const absY = Math.abs(rawDy);
|
|
366
|
+
if (hasVertical.value && hasHorizontal.value) lockedAxis = absX > absY ? "horizontal" : "vertical";
|
|
367
|
+
else if (hasVertical.value) lockedAxis = "vertical";
|
|
368
|
+
else lockedAxis = "horizontal";
|
|
369
|
+
}
|
|
370
|
+
const dx = lockedAxis === "vertical" ? 0 : rawDx;
|
|
371
|
+
const dy = lockedAxis === "horizontal" ? 0 : rawDy;
|
|
372
|
+
const dir = toValue(directions).find((d) => getDisplacement(d, dx, dy) > 0);
|
|
373
|
+
if (pendingSwipe && pendingSwipeStartPos) {
|
|
374
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) < MIN_DRAG_THRESHOLD) return;
|
|
375
|
+
pendingSwipe = false;
|
|
376
|
+
setSwiping(true);
|
|
377
|
+
onSwipeStart?.();
|
|
378
|
+
}
|
|
379
|
+
if (!isSwiping.value) return;
|
|
380
|
+
if (!intendedDirection && dir) {
|
|
381
|
+
intendedDirection = dir;
|
|
382
|
+
swipeDirection.value = dir;
|
|
383
|
+
maxDisplacement = getDisplacement(dir, dx, dy);
|
|
384
|
+
}
|
|
385
|
+
const currentDir = intendedDirection;
|
|
386
|
+
if (currentDir && !cancelledSwipe) {
|
|
387
|
+
const displacement = getDisplacement(currentDir, dx, dy);
|
|
388
|
+
maxDisplacement = Math.max(maxDisplacement, displacement);
|
|
389
|
+
if (maxDisplacement > DEFAULT_SWIPE_THRESHOLD / 2 && maxDisplacement - displacement > REVERSE_CANCEL_THRESHOLD) cancelledSwipe = true;
|
|
390
|
+
}
|
|
391
|
+
const damped = applyDirectionalDamping(dx, dy);
|
|
392
|
+
dragOffset.value = {
|
|
393
|
+
x: damped.x,
|
|
394
|
+
y: damped.y
|
|
395
|
+
};
|
|
396
|
+
setCssVars(el, damped.x, damped.y);
|
|
397
|
+
recordSample({
|
|
398
|
+
x: damped.x,
|
|
399
|
+
y: damped.y
|
|
400
|
+
}, time);
|
|
401
|
+
const currentEl = elementRef.value;
|
|
402
|
+
const progressDir = currentDir ?? toValue(directions)[0];
|
|
403
|
+
if (currentEl && progressDir) {
|
|
404
|
+
const dim = progressDir === "up" || progressDir === "down" ? elementSize.height || currentEl.offsetHeight : elementSize.width || currentEl.offsetWidth;
|
|
405
|
+
const threshold = getThreshold(currentEl, progressDir);
|
|
406
|
+
const p = Math.min(1, Math.max(0, getDisplacement(progressDir, dx, dy) / (dim + threshold)));
|
|
407
|
+
if (p !== swipeProgress) {
|
|
408
|
+
swipeProgress = p;
|
|
409
|
+
onProgress?.(p, {
|
|
410
|
+
deltaX: damped.x,
|
|
411
|
+
deltaY: damped.y,
|
|
412
|
+
direction: currentDir
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function finishSwipe(el) {
|
|
418
|
+
if (!isSwiping.value) {
|
|
419
|
+
reset();
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const displacement = getDisplacement(intendedDirection ?? toValue(directions)[0], dragOffset.value.x, dragOffset.value.y);
|
|
423
|
+
const threshold = getThreshold(el, intendedDirection ?? toValue(directions)[0]);
|
|
424
|
+
const now = performance.now();
|
|
425
|
+
const velocity = (lastDragSample ? now - lastDragSample.time : Infinity) > MAX_RELEASE_VELOCITY_AGE_MS ? {
|
|
426
|
+
x: 0,
|
|
427
|
+
y: 0
|
|
428
|
+
} : lastVelocity;
|
|
429
|
+
if (!(onRelease?.(velocity) === true)) {
|
|
430
|
+
const velInDirection = getDisplacement(intendedDirection ?? toValue(directions)[0], velocity.x, velocity.y);
|
|
431
|
+
if (!cancelledSwipe && (displacement >= threshold || velInDirection > .3)) {
|
|
432
|
+
el.setAttribute("data-swipe-dismissed", "");
|
|
433
|
+
onDismiss?.();
|
|
434
|
+
} else {
|
|
435
|
+
clearCssVars(el);
|
|
436
|
+
onCancel?.();
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
reset();
|
|
440
|
+
}
|
|
441
|
+
function onPointerDown(e) {
|
|
442
|
+
if (!toValue(options.enabled)) return;
|
|
443
|
+
if (e.pointerType === "touch") return;
|
|
444
|
+
if (e.button !== 0) return;
|
|
445
|
+
if (canStart && !canStart()) return;
|
|
446
|
+
if (e.target?.closest(DEFAULT_IGNORE_SELECTOR)) return;
|
|
447
|
+
const el = elementRef.value;
|
|
448
|
+
if (!el) return;
|
|
449
|
+
startSwipe(el, {
|
|
450
|
+
x: e.clientX,
|
|
451
|
+
y: e.clientY
|
|
452
|
+
});
|
|
453
|
+
activePointerId = e.pointerId;
|
|
454
|
+
pointerStarted = true;
|
|
455
|
+
try {
|
|
456
|
+
el.setPointerCapture(e.pointerId);
|
|
457
|
+
} catch {}
|
|
458
|
+
}
|
|
459
|
+
function onPointerMove(e) {
|
|
460
|
+
if (!pointerStarted || e.pointerId !== activePointerId) return;
|
|
461
|
+
const el = elementRef.value;
|
|
462
|
+
if (!el) return;
|
|
463
|
+
if ((e.buttons & 1) === 0) {
|
|
464
|
+
finishSwipe(el);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
processMove(el, {
|
|
468
|
+
x: e.clientX,
|
|
469
|
+
y: e.clientY
|
|
470
|
+
}, e.timeStamp);
|
|
471
|
+
}
|
|
472
|
+
function onPointerUp(e) {
|
|
473
|
+
if (!pointerStarted || e.pointerId !== activePointerId) return;
|
|
474
|
+
const el = elementRef.value;
|
|
475
|
+
if (!el) {
|
|
476
|
+
reset();
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
finishSwipe(el);
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Ends an in-flight pointer drag that can no longer be tracked — pointer
|
|
483
|
+
* capture was lost, or the window lost focus mid-drag (which is what happens
|
|
484
|
+
* when the release lands over another application). The drawer settles from
|
|
485
|
+
* wherever it was last dragged to.
|
|
486
|
+
*/
|
|
487
|
+
function onPointerInterrupted() {
|
|
488
|
+
if (!pointerStarted) return;
|
|
489
|
+
const el = elementRef.value;
|
|
490
|
+
if (!el) {
|
|
491
|
+
reset();
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
finishSwipe(el);
|
|
495
|
+
}
|
|
496
|
+
function onTouchStart(e) {
|
|
497
|
+
if (!toValue(options.enabled)) return;
|
|
498
|
+
if (canStart && !canStart()) return;
|
|
499
|
+
const target = e.target;
|
|
500
|
+
if (target?.closest(DEFAULT_IGNORE_SELECTOR)) return;
|
|
501
|
+
const el = elementRef.value;
|
|
502
|
+
if (!el) return;
|
|
503
|
+
crossAxisScrollable = null;
|
|
504
|
+
drawerAxisAttributed = false;
|
|
505
|
+
preserveNativeCrossAxisScroll = false;
|
|
506
|
+
if (!options.ignoreScrollableAncestors) {
|
|
507
|
+
const scrollable = findScrollableAncestor(target, hasVertical.value ? "vertical" : "horizontal");
|
|
508
|
+
if (scrollable) {
|
|
509
|
+
swipeFromScrollable = true;
|
|
510
|
+
scrollableAncestor = scrollable;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (drawerAxis.value) crossAxisScrollable = findScrollableAncestor(target, drawerAxis.value === "vertical" ? "horizontal" : "vertical");
|
|
514
|
+
const t = e.touches[0];
|
|
515
|
+
if (!t) return;
|
|
516
|
+
startSwipe(el, {
|
|
517
|
+
x: t.clientX,
|
|
518
|
+
y: t.clientY
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function onTouchMove(e) {
|
|
522
|
+
const el = elementRef.value;
|
|
523
|
+
if (!el || !pendingSwipe && !isSwiping.value) return;
|
|
524
|
+
const t = e.touches[0];
|
|
525
|
+
if (!t) return;
|
|
526
|
+
const pos = {
|
|
527
|
+
x: t.clientX,
|
|
528
|
+
y: t.clientY
|
|
529
|
+
};
|
|
530
|
+
if (shouldYieldTouchMove(e, pos)) return;
|
|
531
|
+
if (swipeFromScrollable && pendingSwipe && scrollableAncestor) {
|
|
532
|
+
const dx = pos.x - dragStartPos.x;
|
|
533
|
+
const dy = pos.y - dragStartPos.y;
|
|
534
|
+
const allowed = canSwipeFromScrollEdge(scrollableAncestor, dx, dy, {
|
|
535
|
+
hasVertical: hasVertical.value,
|
|
536
|
+
hasHorizontal: hasHorizontal.value,
|
|
537
|
+
allowUp: allowUp.value,
|
|
538
|
+
allowDown: allowDown.value,
|
|
539
|
+
allowLeft: allowLeft.value,
|
|
540
|
+
allowRight: allowRight.value
|
|
541
|
+
});
|
|
542
|
+
if (allowed === false) {
|
|
543
|
+
reset();
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (allowed === true) {
|
|
547
|
+
swipeFromScrollable = false;
|
|
548
|
+
scrollableAncestor = null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const wasSwiping = isSwiping.value;
|
|
552
|
+
processMove(el, pos, e.timeStamp);
|
|
553
|
+
if (wasSwiping || isSwiping.value) e.preventDefault();
|
|
554
|
+
}
|
|
555
|
+
function onTouchEnd() {
|
|
556
|
+
const el = elementRef.value;
|
|
557
|
+
if (!el) return;
|
|
558
|
+
finishSwipe(el);
|
|
559
|
+
}
|
|
560
|
+
const cleanups = [];
|
|
561
|
+
watch(() => elementRef.value, (el) => {
|
|
562
|
+
cleanups.forEach((fn) => fn());
|
|
563
|
+
cleanups.length = 0;
|
|
564
|
+
if (!el) return;
|
|
565
|
+
const doc = el.ownerDocument;
|
|
566
|
+
const win = doc.defaultView;
|
|
567
|
+
cleanups.push(useEventListener(el, "pointerdown", onPointerDown), useEventListener(el, "pointermove", onPointerMove), useEventListener(el, "pointerup", onPointerUp), useEventListener(el, "pointercancel", onPointerUp), useEventListener(el, "lostpointercapture", onPointerInterrupted), useEventListener(doc, "pointerup", onPointerUp), useEventListener(doc, "pointercancel", onPointerUp), useEventListener(el, "touchstart", onTouchStart, { passive: true }), useEventListener(el, "touchmove", onTouchMove, { passive: false }), useEventListener(el, "touchend", onTouchEnd), useEventListener(el, "touchcancel", onTouchEnd));
|
|
568
|
+
if (win) cleanups.push(useEventListener(win, "blur", onPointerInterrupted));
|
|
569
|
+
}, { immediate: true });
|
|
570
|
+
onUnmounted(() => {
|
|
571
|
+
cleanups.forEach((fn) => fn());
|
|
572
|
+
cleanups.length = 0;
|
|
573
|
+
reset();
|
|
574
|
+
});
|
|
575
|
+
return {
|
|
576
|
+
isSwiping,
|
|
577
|
+
swipeDirection,
|
|
578
|
+
dragOffset
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerContentImpl.js
|
|
583
|
+
var DrawerContentImpl_default = /* @__PURE__ */ defineComponent({
|
|
584
|
+
__name: "DrawerContentImpl",
|
|
585
|
+
props: {
|
|
586
|
+
trapFocus: {
|
|
587
|
+
type: Boolean,
|
|
588
|
+
required: false
|
|
589
|
+
},
|
|
590
|
+
initialFocus: {
|
|
591
|
+
type: [Boolean, null],
|
|
592
|
+
required: false,
|
|
593
|
+
skipCheck: true,
|
|
594
|
+
default: true
|
|
595
|
+
},
|
|
596
|
+
finalFocus: {
|
|
597
|
+
type: [Boolean, null],
|
|
598
|
+
required: false,
|
|
599
|
+
skipCheck: true,
|
|
600
|
+
default: true
|
|
601
|
+
},
|
|
602
|
+
disableOutsidePointerEvents: {
|
|
603
|
+
type: Boolean,
|
|
604
|
+
required: false
|
|
605
|
+
},
|
|
606
|
+
asChild: {
|
|
607
|
+
type: Boolean,
|
|
608
|
+
required: false
|
|
609
|
+
},
|
|
610
|
+
as: {
|
|
611
|
+
type: null,
|
|
612
|
+
required: false
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
emits: [
|
|
616
|
+
"escapeKeyDown",
|
|
617
|
+
"pointerDownOutside",
|
|
618
|
+
"focusOutside",
|
|
619
|
+
"interactOutside",
|
|
620
|
+
"openAutoFocus",
|
|
621
|
+
"closeAutoFocus"
|
|
622
|
+
],
|
|
623
|
+
setup(__props, { emit: __emit }) {
|
|
624
|
+
const props = __props;
|
|
625
|
+
const emits = __emit;
|
|
626
|
+
const rootContext = injectDrawerRootContext();
|
|
627
|
+
const { forwardRef, currentElement } = useForwardExpose();
|
|
628
|
+
registerDrawerCssProperties();
|
|
629
|
+
const { activeSnapPointOffset, snapToNearest } = useDrawerSnapPoints({
|
|
630
|
+
snapPoints: rootContext.snapPoints,
|
|
631
|
+
activeSnapPoint: rootContext.activeSnapPoint,
|
|
632
|
+
popupHeight: rootContext.popupHeight,
|
|
633
|
+
viewportRef: currentElement,
|
|
634
|
+
onSnapPointChange: (point) => {
|
|
635
|
+
if (point === null) rootContext.onOpenChange(false);
|
|
636
|
+
else rootContext.setActiveSnapPoint(point);
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
function writeSnapPointOffset() {
|
|
640
|
+
const el = currentElement.value;
|
|
641
|
+
if (!el) return;
|
|
642
|
+
const offset = activeSnapPointOffset.value;
|
|
643
|
+
if (offset != null) {
|
|
644
|
+
const dir = rootContext.swipeDirection.value;
|
|
645
|
+
const signedOffset = dir === "up" || dir === "left" ? -offset : offset;
|
|
646
|
+
el.style.setProperty(DRAWER_CSS_VARS.snapPointOffset, `${signedOffset}px`);
|
|
647
|
+
} else el.style.setProperty(DRAWER_CSS_VARS.snapPointOffset, "0px");
|
|
648
|
+
}
|
|
649
|
+
watch(activeSnapPointOffset, writeSnapPointOffset);
|
|
650
|
+
useResizeObserver(currentElement, ([entry]) => {
|
|
651
|
+
if (!entry) return;
|
|
652
|
+
if (rootContext.hasNestedDrawer.value && rootContext.popupHeight.value > 0) return;
|
|
653
|
+
const h$1 = entry.contentRect.height;
|
|
654
|
+
rootContext.onPopupHeightChange(h$1);
|
|
655
|
+
currentElement.value?.style.setProperty(DRAWER_CSS_VARS.height, `${h$1}px`);
|
|
656
|
+
});
|
|
657
|
+
watch(() => rootContext.frontmostHeight.value, (h$1) => {
|
|
658
|
+
currentElement.value?.style.setProperty(DRAWER_CSS_VARS.frontmostHeight, `${h$1}px`);
|
|
659
|
+
});
|
|
660
|
+
const hasSnapPoints = computed(() => (rootContext.snapPoints.value?.length ?? 0) > 0);
|
|
661
|
+
const swipeDirections = computed(() => {
|
|
662
|
+
const dismiss = rootContext.swipeDirection.value;
|
|
663
|
+
if (!hasSnapPoints.value) return [dismiss];
|
|
664
|
+
return [dismiss, {
|
|
665
|
+
up: "down",
|
|
666
|
+
down: "up",
|
|
667
|
+
left: "right",
|
|
668
|
+
right: "left"
|
|
669
|
+
}[dismiss]];
|
|
670
|
+
});
|
|
671
|
+
let lastRawDelta = {
|
|
672
|
+
x: 0,
|
|
673
|
+
y: 0
|
|
674
|
+
};
|
|
675
|
+
const { isSwiping, dragOffset } = useSwipeDismiss({
|
|
676
|
+
enabled: computed(() => rootContext.open.value),
|
|
677
|
+
elementRef: currentElement,
|
|
678
|
+
directions: swipeDirections,
|
|
679
|
+
movementCssVars: {
|
|
680
|
+
x: DRAWER_CSS_VARS.swipeMovementX,
|
|
681
|
+
y: DRAWER_CSS_VARS.swipeMovementY
|
|
682
|
+
},
|
|
683
|
+
canStart: () => !rootContext.nestedSwiping.value,
|
|
684
|
+
onDismiss() {
|
|
685
|
+
if (!hasSnapPoints.value) rootContext.onOpenChange(false, "swipe");
|
|
686
|
+
},
|
|
687
|
+
onRelease(velocity) {
|
|
688
|
+
const el = currentElement.value;
|
|
689
|
+
if (el) {
|
|
690
|
+
const dir = rootContext.swipeDirection.value;
|
|
691
|
+
const size = dir === "left" || dir === "right" ? el.offsetWidth : el.offsetHeight;
|
|
692
|
+
const axisDelta = dir === "left" || dir === "right" ? lastRawDelta.x : lastRawDelta.y;
|
|
693
|
+
const releaseVelocity = dir === "left" || dir === "right" ? velocity.x : velocity.y;
|
|
694
|
+
const scalar = computeSwipeReleaseScalar({
|
|
695
|
+
direction: dir,
|
|
696
|
+
size,
|
|
697
|
+
axisDelta,
|
|
698
|
+
snapPointOffset: activeSnapPointOffset.value ?? 0,
|
|
699
|
+
releaseVelocity
|
|
700
|
+
});
|
|
701
|
+
if (scalar != null) el.style.setProperty(DRAWER_CSS_VARS.swipeStrength, `${scalar}`);
|
|
702
|
+
else el.style.setProperty(DRAWER_CSS_VARS.swipeStrength, "1");
|
|
703
|
+
}
|
|
704
|
+
if (hasSnapPoints.value) {
|
|
705
|
+
const dir = rootContext.swipeDirection.value;
|
|
706
|
+
const dragDelta = getDisplacement(dir, lastRawDelta.x, lastRawDelta.y);
|
|
707
|
+
snapToNearest(dragDelta, velocity, dir, rootContext.snapToSequentialPoints.value);
|
|
708
|
+
if (el) {
|
|
709
|
+
writeSnapPointOffset();
|
|
710
|
+
el.style.setProperty(DRAWER_CSS_VARS.swipeMovementX, "0px");
|
|
711
|
+
el.style.setProperty(DRAWER_CSS_VARS.swipeMovementY, "0px");
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return hasSnapPoints.value;
|
|
715
|
+
},
|
|
716
|
+
onSwipingChange(swiping) {
|
|
717
|
+
rootContext.onSwipingChange(swiping);
|
|
718
|
+
rootContext.onNestedSwipingChange(swiping);
|
|
719
|
+
},
|
|
720
|
+
onProgress(progress, details) {
|
|
721
|
+
if (details) lastRawDelta = {
|
|
722
|
+
x: details.deltaX,
|
|
723
|
+
y: details.deltaY
|
|
724
|
+
};
|
|
725
|
+
rootContext.onNestedSwipeProgressChange(progress);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
let pendingDismissReason;
|
|
729
|
+
function onDismiss() {
|
|
730
|
+
if (isSwiping.value) return;
|
|
731
|
+
rootContext.onOpenChange(false, pendingDismissReason ?? "outside-press");
|
|
732
|
+
pendingDismissReason = void 0;
|
|
733
|
+
}
|
|
734
|
+
function onEscapeKeyDown(event) {
|
|
735
|
+
pendingDismissReason = "escape-key";
|
|
736
|
+
emits("escapeKeyDown", event);
|
|
737
|
+
}
|
|
738
|
+
function onPointerDownOutside(event) {
|
|
739
|
+
if (isSwiping.value) {
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
pendingDismissReason = "outside-press";
|
|
744
|
+
emits("pointerDownOutside", event);
|
|
745
|
+
}
|
|
746
|
+
function onFocusOutside(event) {
|
|
747
|
+
if (isSwiping.value) {
|
|
748
|
+
event.preventDefault();
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
emits("focusOutside", event);
|
|
752
|
+
}
|
|
753
|
+
function onInteractOutside(event) {
|
|
754
|
+
if (isSwiping.value) {
|
|
755
|
+
event.preventDefault();
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
emits("interactOutside", event);
|
|
759
|
+
}
|
|
760
|
+
function onMountAutoFocus(event) {
|
|
761
|
+
emits("openAutoFocus", event);
|
|
762
|
+
if (event.defaultPrevented) return;
|
|
763
|
+
if (props.initialFocus === false) event.preventDefault();
|
|
764
|
+
else if (props.initialFocus instanceof HTMLElement) {
|
|
765
|
+
event.preventDefault();
|
|
766
|
+
focus(props.initialFocus, { select: true });
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
let openCompleteCleanup;
|
|
770
|
+
function clearOpenCompleteListener() {
|
|
771
|
+
openCompleteCleanup?.();
|
|
772
|
+
openCompleteCleanup = void 0;
|
|
773
|
+
}
|
|
774
|
+
watch(() => rootContext.open.value, (isOpen) => {
|
|
775
|
+
clearOpenCompleteListener();
|
|
776
|
+
const el = currentElement.value;
|
|
777
|
+
if (!el) {
|
|
778
|
+
rootContext.notifyOpenComplete(isOpen);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
const handler = (event) => {
|
|
782
|
+
if (event.target !== el) return;
|
|
783
|
+
clearOpenCompleteListener();
|
|
784
|
+
rootContext.notifyOpenComplete(isOpen);
|
|
785
|
+
};
|
|
786
|
+
el.addEventListener("transitionend", handler);
|
|
787
|
+
el.addEventListener("animationend", handler);
|
|
788
|
+
openCompleteCleanup = () => {
|
|
789
|
+
el.removeEventListener("transitionend", handler);
|
|
790
|
+
el.removeEventListener("animationend", handler);
|
|
791
|
+
};
|
|
792
|
+
});
|
|
793
|
+
const dataAttributes = computed(() => {
|
|
794
|
+
const attrs = {
|
|
795
|
+
"data-state": rootContext.open.value ? "open" : "closed",
|
|
796
|
+
"data-swipe-direction": rootContext.swipeDirection.value
|
|
797
|
+
};
|
|
798
|
+
if (isSwiping.value) attrs["data-swiping"] = "";
|
|
799
|
+
if (rootContext.hasNestedDrawer.value) attrs["data-nested-drawer-open"] = "";
|
|
800
|
+
return attrs;
|
|
801
|
+
});
|
|
802
|
+
watch(() => rootContext.nestedOpenDrawerCount.value, (n) => {
|
|
803
|
+
currentElement.value?.style.setProperty(DRAWER_CSS_VARS.nestedDrawers, `${n}`);
|
|
804
|
+
});
|
|
805
|
+
let unsubscribeNestedProgress;
|
|
806
|
+
onMounted(() => {
|
|
807
|
+
rootContext.contentElement.value = currentElement.value;
|
|
808
|
+
rootContext.notifyParentHasNestedDrawer?.(true);
|
|
809
|
+
currentElement.value?.style.setProperty(DRAWER_CSS_VARS.nestedDrawers, `${rootContext.nestedOpenDrawerCount.value}`);
|
|
810
|
+
writeSnapPointOffset();
|
|
811
|
+
unsubscribeNestedProgress = rootContext.nestedSwipeProgressStore.subscribe(() => {
|
|
812
|
+
const progress = rootContext.nestedSwipeProgressStore.getSnapshot();
|
|
813
|
+
currentElement.value?.style.setProperty(DRAWER_CSS_VARS.swipeProgress, `${progress}`);
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
onUnmounted(() => {
|
|
817
|
+
rootContext.notifyParentHasNestedDrawer?.(false);
|
|
818
|
+
unsubscribeNestedProgress?.();
|
|
819
|
+
clearOpenCompleteListener();
|
|
820
|
+
});
|
|
821
|
+
if (process.env.NODE_ENV !== "production") onMounted(() => {
|
|
822
|
+
if (!document.getElementById(rootContext.titleId)) console.warn(`Warning: \`DrawerContent\` requires a \`DrawerTitle\` for accessibility.`);
|
|
823
|
+
});
|
|
824
|
+
return (_ctx, _cache) => {
|
|
825
|
+
return openBlock(), createBlock(unref(FocusScope_default), {
|
|
826
|
+
"as-child": "",
|
|
827
|
+
loop: "",
|
|
828
|
+
trapped: props.trapFocus,
|
|
829
|
+
onMountAutoFocus,
|
|
830
|
+
onUnmountAutoFocus: _cache[0] || (_cache[0] = ($event) => emits("closeAutoFocus", $event))
|
|
831
|
+
}, {
|
|
832
|
+
default: withCtx(() => [createVNode(unref(DismissableLayer_default), mergeProps({
|
|
833
|
+
id: unref(rootContext).contentId,
|
|
834
|
+
ref: unref(forwardRef),
|
|
835
|
+
as: _ctx.as,
|
|
836
|
+
"as-child": _ctx.asChild,
|
|
837
|
+
"disable-outside-pointer-events": _ctx.disableOutsidePointerEvents,
|
|
838
|
+
role: "dialog",
|
|
839
|
+
"aria-describedby": unref(rootContext).descriptionId,
|
|
840
|
+
"aria-labelledby": unref(rootContext).titleId
|
|
841
|
+
}, {
|
|
842
|
+
...dataAttributes.value,
|
|
843
|
+
..._ctx.$attrs
|
|
844
|
+
}, {
|
|
845
|
+
onDismiss,
|
|
846
|
+
onEscapeKeyDown,
|
|
847
|
+
onFocusOutside,
|
|
848
|
+
onInteractOutside,
|
|
849
|
+
onPointerDownOutside
|
|
850
|
+
}), {
|
|
851
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
852
|
+
_: 3
|
|
853
|
+
}, 16, [
|
|
854
|
+
"id",
|
|
855
|
+
"as",
|
|
856
|
+
"as-child",
|
|
857
|
+
"disable-outside-pointer-events",
|
|
858
|
+
"aria-describedby",
|
|
859
|
+
"aria-labelledby"
|
|
860
|
+
])]),
|
|
861
|
+
_: 3
|
|
862
|
+
}, 8, ["trapped"]);
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerContent.js
|
|
868
|
+
var DrawerContent_default = /* @__PURE__ */ defineComponent({
|
|
869
|
+
__name: "DrawerContent",
|
|
870
|
+
props: {
|
|
871
|
+
forceMount: {
|
|
872
|
+
type: Boolean,
|
|
873
|
+
required: false
|
|
874
|
+
},
|
|
875
|
+
initialFocus: {
|
|
876
|
+
type: [Boolean, null],
|
|
877
|
+
required: false,
|
|
878
|
+
skipCheck: true,
|
|
879
|
+
default: true
|
|
880
|
+
},
|
|
881
|
+
finalFocus: {
|
|
882
|
+
type: [Boolean, null],
|
|
883
|
+
required: false,
|
|
884
|
+
skipCheck: true,
|
|
885
|
+
default: true
|
|
886
|
+
},
|
|
887
|
+
disableOutsidePointerEvents: {
|
|
888
|
+
type: Boolean,
|
|
889
|
+
required: false
|
|
890
|
+
},
|
|
891
|
+
asChild: {
|
|
892
|
+
type: Boolean,
|
|
893
|
+
required: false
|
|
894
|
+
},
|
|
895
|
+
as: {
|
|
896
|
+
type: null,
|
|
897
|
+
required: false
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
emits: [
|
|
901
|
+
"escapeKeyDown",
|
|
902
|
+
"pointerDownOutside",
|
|
903
|
+
"focusOutside",
|
|
904
|
+
"interactOutside",
|
|
905
|
+
"openAutoFocus",
|
|
906
|
+
"closeAutoFocus"
|
|
907
|
+
],
|
|
908
|
+
setup(__props, { emit: __emit }) {
|
|
909
|
+
const props = __props;
|
|
910
|
+
const emits = __emit;
|
|
911
|
+
const rootContext = injectDrawerRootContext();
|
|
912
|
+
const emitsAsProps = useEmitAsProps(emits);
|
|
913
|
+
const { forwardRef, currentElement } = useForwardExpose();
|
|
914
|
+
const hasInteractedOutside = ref(false);
|
|
915
|
+
const hasPointerDownOutside = ref(false);
|
|
916
|
+
const isFullModal = computed(() => rootContext.modal.value === true);
|
|
917
|
+
const isTrapFocusOnly = computed(() => rootContext.modal.value === "trap-focus");
|
|
918
|
+
const shouldTrapFocus = computed(() => (isFullModal.value || isTrapFocusOnly.value) && rootContext.open.value);
|
|
919
|
+
const shouldHideOthers = computed(() => isFullModal.value ? currentElement.value : void 0);
|
|
920
|
+
useHideOthers(shouldHideOthers);
|
|
921
|
+
function finalFocusElement() {
|
|
922
|
+
if (props.finalFocus === false) return void 0;
|
|
923
|
+
if (props.finalFocus instanceof HTMLElement) return props.finalFocus;
|
|
924
|
+
return rootContext.triggerElement.value;
|
|
925
|
+
}
|
|
926
|
+
function onCloseAutoFocusNonModal(e) {
|
|
927
|
+
if (!e.defaultPrevented) {
|
|
928
|
+
if (!hasInteractedOutside.value) finalFocusElement()?.focus();
|
|
929
|
+
e.preventDefault();
|
|
930
|
+
}
|
|
931
|
+
hasInteractedOutside.value = false;
|
|
932
|
+
hasPointerDownOutside.value = false;
|
|
933
|
+
}
|
|
934
|
+
function onInteractOutsideNonModal(e) {
|
|
935
|
+
if (!e.defaultPrevented) {
|
|
936
|
+
hasInteractedOutside.value = true;
|
|
937
|
+
if (e.detail.originalEvent.type === "pointerdown") hasPointerDownOutside.value = true;
|
|
938
|
+
}
|
|
939
|
+
const target = e.target;
|
|
940
|
+
if (rootContext.triggerElement.value?.contains(target)) e.preventDefault();
|
|
941
|
+
if (e.detail.originalEvent.type === "focusin" && hasPointerDownOutside.value) e.preventDefault();
|
|
942
|
+
}
|
|
943
|
+
return (_ctx, _cache) => {
|
|
944
|
+
return openBlock(), createBlock(unref(Presence_default), { present: _ctx.forceMount || unref(rootContext).open.value }, {
|
|
945
|
+
default: withCtx(() => [isFullModal.value ? (openBlock(), createBlock(DrawerContentImpl_default, mergeProps({
|
|
946
|
+
key: 0,
|
|
947
|
+
ref: unref(forwardRef)
|
|
948
|
+
}, {
|
|
949
|
+
...props,
|
|
950
|
+
...unref(emitsAsProps),
|
|
951
|
+
..._ctx.$attrs
|
|
952
|
+
}, {
|
|
953
|
+
"trap-focus": shouldTrapFocus.value,
|
|
954
|
+
"disable-outside-pointer-events": true,
|
|
955
|
+
onCloseAutoFocus: _cache[0] || (_cache[0] = (e) => {
|
|
956
|
+
if (!e.defaultPrevented) {
|
|
957
|
+
e.preventDefault();
|
|
958
|
+
finalFocusElement()?.focus();
|
|
959
|
+
}
|
|
960
|
+
}),
|
|
961
|
+
onPointerDownOutside: _cache[1] || (_cache[1] = (e) => {
|
|
962
|
+
const orig = e.detail.originalEvent;
|
|
963
|
+
if (orig.button === 2 || orig.button === 0 && orig.ctrlKey) e.preventDefault();
|
|
964
|
+
}),
|
|
965
|
+
onFocusOutside: _cache[2] || (_cache[2] = (e) => e.preventDefault())
|
|
966
|
+
}), {
|
|
967
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
968
|
+
_: 3
|
|
969
|
+
}, 16, ["trap-focus"])) : (openBlock(), createBlock(DrawerContentImpl_default, mergeProps({
|
|
970
|
+
key: 1,
|
|
971
|
+
ref: unref(forwardRef)
|
|
972
|
+
}, {
|
|
973
|
+
...props,
|
|
974
|
+
...unref(emitsAsProps),
|
|
975
|
+
..._ctx.$attrs
|
|
976
|
+
}, {
|
|
977
|
+
"trap-focus": shouldTrapFocus.value,
|
|
978
|
+
"disable-outside-pointer-events": false,
|
|
979
|
+
onCloseAutoFocus: onCloseAutoFocusNonModal,
|
|
980
|
+
onInteractOutside: onInteractOutsideNonModal
|
|
981
|
+
}), {
|
|
982
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
983
|
+
_: 3
|
|
984
|
+
}, 16, ["trap-focus"]))]),
|
|
985
|
+
_: 3
|
|
986
|
+
}, 8, ["present"]);
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerHandle.js
|
|
992
|
+
var DrawerHandle_default = /* @__PURE__ */ defineComponent({
|
|
993
|
+
__name: "DrawerHandle",
|
|
994
|
+
props: {
|
|
995
|
+
asChild: {
|
|
996
|
+
type: Boolean,
|
|
997
|
+
required: false
|
|
998
|
+
},
|
|
999
|
+
as: {
|
|
1000
|
+
type: null,
|
|
1001
|
+
required: false,
|
|
1002
|
+
default: "div"
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
setup(__props) {
|
|
1006
|
+
const props = __props;
|
|
1007
|
+
useForwardExpose();
|
|
1008
|
+
const rootContext = injectDrawerRootContext();
|
|
1009
|
+
return (_ctx, _cache) => {
|
|
1010
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
1011
|
+
"aria-hidden": "true",
|
|
1012
|
+
"data-state": unref(rootContext).open.value ? "open" : "closed"
|
|
1013
|
+
}), {
|
|
1014
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1015
|
+
_: 3
|
|
1016
|
+
}, 16, ["data-state"]);
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerOverlayImpl.js
|
|
1022
|
+
var DrawerOverlayImpl_default = /* @__PURE__ */ defineComponent({
|
|
1023
|
+
__name: "DrawerOverlayImpl",
|
|
1024
|
+
props: {
|
|
1025
|
+
asChild: {
|
|
1026
|
+
type: Boolean,
|
|
1027
|
+
required: false
|
|
1028
|
+
},
|
|
1029
|
+
as: {
|
|
1030
|
+
type: null,
|
|
1031
|
+
required: false
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
setup(__props) {
|
|
1035
|
+
const rootContext = injectDrawerRootContext();
|
|
1036
|
+
const locked = useBodyScrollLock(rootContext.open.value);
|
|
1037
|
+
watch(() => rootContext.open.value, (open) => {
|
|
1038
|
+
locked.value = open;
|
|
1039
|
+
}, { immediate: true });
|
|
1040
|
+
useForwardExpose();
|
|
1041
|
+
const dataAttributes = computed(() => {
|
|
1042
|
+
const attrs = {
|
|
1043
|
+
"data-state": rootContext.open.value ? "open" : "closed",
|
|
1044
|
+
"data-swipe-direction": rootContext.swipeDirection.value
|
|
1045
|
+
};
|
|
1046
|
+
if (rootContext.isSwiping.value) attrs["data-swiping"] = "";
|
|
1047
|
+
return attrs;
|
|
1048
|
+
});
|
|
1049
|
+
return (_ctx, _cache) => {
|
|
1050
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps({
|
|
1051
|
+
as: _ctx.as,
|
|
1052
|
+
"as-child": _ctx.asChild
|
|
1053
|
+
}, dataAttributes.value, { style: {
|
|
1054
|
+
pointerEvents: "auto",
|
|
1055
|
+
userSelect: "none",
|
|
1056
|
+
[unref(DRAWER_CSS_VARS).swipeProgress]: "0",
|
|
1057
|
+
[unref(DRAWER_CSS_VARS).swipeStrength]: "1"
|
|
1058
|
+
} }), {
|
|
1059
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1060
|
+
_: 3
|
|
1061
|
+
}, 16, [
|
|
1062
|
+
"as",
|
|
1063
|
+
"as-child",
|
|
1064
|
+
"style"
|
|
1065
|
+
]);
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerOverlay.js
|
|
1071
|
+
var DrawerOverlay_default = /* @__PURE__ */ defineComponent({
|
|
1072
|
+
__name: "DrawerOverlay",
|
|
1073
|
+
props: {
|
|
1074
|
+
forceMount: {
|
|
1075
|
+
type: Boolean,
|
|
1076
|
+
required: false,
|
|
1077
|
+
default: false
|
|
1078
|
+
},
|
|
1079
|
+
forceRender: {
|
|
1080
|
+
type: Boolean,
|
|
1081
|
+
required: false,
|
|
1082
|
+
default: false
|
|
1083
|
+
},
|
|
1084
|
+
asChild: {
|
|
1085
|
+
type: Boolean,
|
|
1086
|
+
required: false
|
|
1087
|
+
},
|
|
1088
|
+
as: {
|
|
1089
|
+
type: null,
|
|
1090
|
+
required: false
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1093
|
+
setup(__props) {
|
|
1094
|
+
const rootContext = injectDrawerRootContext();
|
|
1095
|
+
const isNested = !!rootContext.notifyParentHasNestedDrawer;
|
|
1096
|
+
const { forwardRef } = useForwardExpose();
|
|
1097
|
+
return (_ctx, _cache) => {
|
|
1098
|
+
return unref(rootContext).modal.value && (!isNested || _ctx.forceRender) ? (openBlock(), createBlock(unref(Presence_default), {
|
|
1099
|
+
key: 0,
|
|
1100
|
+
present: _ctx.forceMount || unref(rootContext).open.value
|
|
1101
|
+
}, {
|
|
1102
|
+
default: withCtx(() => [createVNode(DrawerOverlayImpl_default, mergeProps(_ctx.$attrs, {
|
|
1103
|
+
ref: unref(forwardRef),
|
|
1104
|
+
as: _ctx.as,
|
|
1105
|
+
"as-child": _ctx.asChild
|
|
1106
|
+
}), {
|
|
1107
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1108
|
+
_: 3
|
|
1109
|
+
}, 16, ["as", "as-child"])]),
|
|
1110
|
+
_: 3
|
|
1111
|
+
}, 8, ["present"])) : createCommentVNode("v-if", true);
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.41_typescript@6.0.3_/node_modules/reka-ui/dist/Drawer/DrawerPortal.js
|
|
1117
|
+
var DrawerPortal_default = /* @__PURE__ */ defineComponent({
|
|
1118
|
+
__name: "DrawerPortal",
|
|
1119
|
+
props: {
|
|
1120
|
+
to: {
|
|
1121
|
+
type: null,
|
|
1122
|
+
required: false
|
|
1123
|
+
},
|
|
1124
|
+
disabled: {
|
|
1125
|
+
type: Boolean,
|
|
1126
|
+
required: false
|
|
1127
|
+
},
|
|
1128
|
+
defer: {
|
|
1129
|
+
type: Boolean,
|
|
1130
|
+
required: false
|
|
1131
|
+
},
|
|
1132
|
+
forceMount: {
|
|
1133
|
+
type: Boolean,
|
|
1134
|
+
required: false
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
setup(__props) {
|
|
1138
|
+
return (_ctx, _cache) => {
|
|
1139
|
+
return openBlock(), createBlock(unref(Teleport_default), normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
1140
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1141
|
+
_: 3
|
|
1142
|
+
}, 16);
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
//#endregion
|
|
1147
|
+
//#region src/components/drawer/drawer-content.vue
|
|
1148
|
+
var drawer_content_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1149
|
+
inheritAttrs: false,
|
|
1150
|
+
__name: "drawer-content",
|
|
1151
|
+
props: {
|
|
1152
|
+
class: { type: [
|
|
1153
|
+
Boolean,
|
|
1154
|
+
null,
|
|
1155
|
+
String,
|
|
1156
|
+
Object,
|
|
1157
|
+
Array
|
|
1158
|
+
] },
|
|
1159
|
+
forceMount: { type: Boolean },
|
|
1160
|
+
initialFocus: { type: [Boolean, null] },
|
|
1161
|
+
finalFocus: { type: [Boolean, null] },
|
|
1162
|
+
disableOutsidePointerEvents: { type: Boolean },
|
|
1163
|
+
asChild: { type: Boolean },
|
|
1164
|
+
as: {}
|
|
1165
|
+
},
|
|
1166
|
+
emits: [
|
|
1167
|
+
"escapeKeyDown",
|
|
1168
|
+
"pointerDownOutside",
|
|
1169
|
+
"focusOutside",
|
|
1170
|
+
"interactOutside",
|
|
1171
|
+
"openAutoFocus",
|
|
1172
|
+
"closeAutoFocus"
|
|
1173
|
+
],
|
|
1174
|
+
setup(__props, { emit: __emit }) {
|
|
1175
|
+
const props = __props;
|
|
1176
|
+
const emits = __emit;
|
|
1177
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class"), emits);
|
|
1178
|
+
return (_ctx, _cache) => {
|
|
1179
|
+
return openBlock(), createBlock(unref(DrawerPortal_default), null, {
|
|
1180
|
+
default: withCtx(() => [createVNode(unref(DrawerOverlay_default), { class: "celeste-drawer-overlay" }), createVNode(unref(DrawerContent_default), mergeProps({ class: unref(clsx)("celeste-drawer-content", props.class) }, {
|
|
1181
|
+
...unref(forwarded),
|
|
1182
|
+
..._ctx.$attrs
|
|
1183
|
+
}), {
|
|
1184
|
+
default: withCtx(() => [createVNode(unref(DrawerHandle_default), { class: "celeste-drawer-handle" }), renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
1185
|
+
_: 3
|
|
1186
|
+
}, 16, ["class"])]),
|
|
1187
|
+
_: 3
|
|
1188
|
+
});
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
}), [["__scopeId", "data-v-3dfcd198"]]);
|
|
1192
|
+
//#endregion
|
|
1193
|
+
export { drawer_content_default as t };
|