@pibit.ai/cure-design-system 0.3.8 → 0.3.11
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/applications/loading-indicator/loading-indicator.d.ts +19 -0
- package/dist/applications/loading-indicator/loading-indicator.d.ts.map +1 -0
- package/dist/applications/loading-indicator/loading-indicator.js +172 -0
- package/dist/hooks/use-resize-observer.d.ts +25 -0
- package/dist/hooks/use-resize-observer.d.ts.map +1 -0
- package/dist/hooks/use-resize-observer.js +25 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -42
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.js +442 -0
- package/dist/node_modules/@react-aria/i18n/dist/context.js +10 -0
- package/dist/node_modules/@react-aria/i18n/dist/useCollator.js +11 -0
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.js +36 -0
- package/dist/node_modules/@react-aria/i18n/dist/useFilter.js +35 -0
- package/dist/node_modules/@react-aria/i18n/dist/utils.js +44 -0
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.js +18 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +62 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +5 -0
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.js +49 -0
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +27 -0
- package/dist/node_modules/@react-aria/utils/dist/ShadowTreeWalker.js +130 -0
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
- package/dist/node_modules/@react-aria/utils/dist/isElementVisible.js +25 -0
- package/dist/node_modules/@react-aria/utils/dist/isFocusable.js +37 -0
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
- package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
- package/dist/node_modules/@react-aria/utils/dist/runAfterTransition.js +35 -0
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
- package/dist/node_modules/@react-stately/data/dist/useListData.js +212 -0
- package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +59 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +47 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +12 -0
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +277 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +22 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +67 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +28 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +131 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +43 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +23 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +27 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +39 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +60 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +14 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +44 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +63 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +22 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +66 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +52 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +38 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +18 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +16 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +20 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +24 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +27 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +22 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +28 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +106 -0
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +133 -0
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +109 -0
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +30 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.js +52 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.js +98 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +46 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +49 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +30 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +69 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +75 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +31 -0
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +24 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +41 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +24 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +33 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +52 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +36 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +18 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +623 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +60 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +19 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +247 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +28 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +65 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/render/store.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +141 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +42 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +51 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/value/index.js +215 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +19 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +18 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +24 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +49 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +24 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +31 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +11 -0
- package/dist/node_modules/motion-utils/dist/es/clamp.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +9 -0
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +8 -0
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +18 -0
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +32 -0
- package/dist/node_modules/motion-utils/dist/es/errors.js +15 -0
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
- package/dist/node_modules/motion-utils/dist/es/global-config.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/is-object.js +6 -0
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/memo.js +8 -0
- package/dist/node_modules/motion-utils/dist/es/noop.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/pipe.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/progress.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +29 -0
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +6 -0
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +8 -0
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +77 -67
- package/dist/patterns/table/table.d.ts +9 -9
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +146 -73
- package/dist/patterns/tree-view/tree-view.d.ts.map +1 -1
- package/dist/patterns/tree-view/tree-view.js +32 -38
- package/dist/primitives/button/button-utility.d.ts +43 -0
- package/dist/primitives/button/button-utility.d.ts.map +1 -0
- package/dist/primitives/button/button-utility.js +79 -0
- package/dist/primitives/button/index.d.ts +2 -1
- package/dist/primitives/button/index.d.ts.map +1 -1
- package/dist/primitives/custom-icon/custom-icon.d.ts +14 -0
- package/dist/primitives/custom-icon/custom-icon.d.ts.map +1 -0
- package/dist/primitives/custom-icon/custom-icon.js +29 -0
- package/dist/primitives/custom-icon/icons/Placeholder.d.ts +10 -0
- package/dist/primitives/custom-icon/icons/Placeholder.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/Placeholder.js +39 -0
- package/dist/primitives/custom-icon/icons/activity-outline.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/activity-outline.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/activity-outline.js +34 -0
- package/dist/primitives/custom-icon/icons/activity-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/activity-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/activity-solid.js +43 -0
- package/dist/primitives/custom-icon/icons/ai-extraction.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/ai-extraction.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/ai-extraction.js +42 -0
- package/dist/primitives/custom-icon/icons/apps.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/apps.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/apps.js +54 -0
- package/dist/primitives/custom-icon/icons/arrows-rl.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/arrows-rl.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/arrows-rl.js +34 -0
- package/dist/primitives/custom-icon/icons/auto-number.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/auto-number.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/auto-number.js +34 -0
- package/dist/primitives/custom-icon/icons/branch-01.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/branch-01.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/branch-01.js +34 -0
- package/dist/primitives/custom-icon/icons/branch-02.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/branch-02.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/branch-02.js +34 -0
- package/dist/primitives/custom-icon/icons/branch.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/branch.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/branch.js +31 -0
- package/dist/primitives/custom-icon/icons/calendar.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/calendar.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/calendar.js +42 -0
- package/dist/primitives/custom-icon/icons/callable.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/callable.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/callable.js +31 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-outline.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-outline.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-outline.js +46 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid.js +31 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid1.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid1.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/check-circle-broken-solid1.js +43 -0
- package/dist/primitives/custom-icon/icons/clear-cure.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/clear-cure.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/clear-cure.js +44 -0
- package/dist/primitives/custom-icon/icons/code-node.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/code-node.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/code-node.js +33 -0
- package/dist/primitives/custom-icon/icons/collapse-left.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/collapse-left.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/collapse-left.js +34 -0
- package/dist/primitives/custom-icon/icons/collapse-right.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/collapse-right.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/collapse-right.js +34 -0
- package/dist/primitives/custom-icon/icons/file-04-outline.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/file-04-outline.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/file-04-outline.js +34 -0
- package/dist/primitives/custom-icon/icons/file-04-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/file-04-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/file-04-solid.js +33 -0
- package/dist/primitives/custom-icon/icons/file-edit.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/file-edit.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/file-edit.js +34 -0
- package/dist/primitives/custom-icon/icons/file-manager.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/file-manager.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/file-manager.js +31 -0
- package/dist/primitives/custom-icon/icons/formula.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/formula.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/formula.js +34 -0
- package/dist/primitives/custom-icon/icons/grid-plus.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/grid-plus.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/grid-plus.js +34 -0
- package/dist/primitives/custom-icon/icons/high.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/high.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/high.js +34 -0
- package/dist/primitives/custom-icon/icons/http-endpoint.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/http-endpoint.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/http-endpoint.js +31 -0
- package/dist/primitives/custom-icon/icons/if-else.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/if-else.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/if-else.js +31 -0
- package/dist/primitives/custom-icon/icons/integer.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/integer.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/integer.js +34 -0
- package/dist/primitives/custom-icon/icons/loop.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/loop.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/loop.js +56 -0
- package/dist/primitives/custom-icon/icons/low.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/low.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/low.js +34 -0
- package/dist/primitives/custom-icon/icons/mail-01-outline.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/mail-01-outline.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/mail-01-outline.js +34 -0
- package/dist/primitives/custom-icon/icons/mail-01-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/mail-01-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/mail-01-solid.js +40 -0
- package/dist/primitives/custom-icon/icons/medium.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/medium.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/medium.js +34 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-outline.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-outline.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-outline.js +34 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/message-dots-square-solid.js +36 -0
- package/dist/primitives/custom-icon/icons/navigate.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/navigate.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/navigate.js +34 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-closed.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-closed.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-closed.js +31 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-open.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-open.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/nesting-arrow-open.js +31 -0
- package/dist/primitives/custom-icon/icons/object-manager.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/object-manager.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/object-manager.js +56 -0
- package/dist/primitives/custom-icon/icons/pibit-ai-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/pibit-ai-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/pibit-ai-solid.js +36 -0
- package/dist/primitives/custom-icon/icons/plus-circle-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/plus-circle-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/plus-circle-solid.js +36 -0
- package/dist/primitives/custom-icon/icons/radio.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/radio.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/radio.js +47 -0
- package/dist/primitives/custom-icon/icons/resize.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/resize.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/resize.js +34 -0
- package/dist/primitives/custom-icon/icons/stop-circle.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/stop-circle.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/stop-circle.js +42 -0
- package/dist/primitives/custom-icon/icons/submission.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/submission.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/submission.js +31 -0
- package/dist/primitives/custom-icon/icons/swap.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/swap.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/swap.js +34 -0
- package/dist/primitives/custom-icon/icons/thumbs-down-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/thumbs-down-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/thumbs-down-solid.js +40 -0
- package/dist/primitives/custom-icon/icons/thumbs-down.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/thumbs-down.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/thumbs-down.js +34 -0
- package/dist/primitives/custom-icon/icons/thumbs-up-solid.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/thumbs-up-solid.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/thumbs-up-solid.js +40 -0
- package/dist/primitives/custom-icon/icons/thumbs-up.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/thumbs-up.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/thumbs-up.js +34 -0
- package/dist/primitives/custom-icon/icons/variable-node.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/variable-node.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/variable-node.js +42 -0
- package/dist/primitives/custom-icon/icons/webhook.d.ts +6 -0
- package/dist/primitives/custom-icon/icons/webhook.d.ts.map +1 -0
- package/dist/primitives/custom-icon/icons/webhook.js +47 -0
- package/dist/primitives/custom-icon/index.d.ts +3 -0
- package/dist/primitives/custom-icon/index.d.ts.map +1 -0
- package/dist/primitives/custom-icon/registry.d.ts +110 -0
- package/dist/primitives/custom-icon/registry.d.ts.map +1 -0
- package/dist/primitives/custom-icon/registry.js +111 -0
- package/dist/primitives/heading/heading.d.ts +1 -1
- package/dist/primitives/input/hint-text.d.ts +15 -0
- package/dist/primitives/input/hint-text.d.ts.map +1 -0
- package/dist/primitives/input/hint-text.js +31 -0
- package/dist/primitives/input/input.d.ts +72 -27
- package/dist/primitives/input/input.d.ts.map +1 -1
- package/dist/primitives/input/input.js +385 -74
- package/dist/primitives/input/label.d.ts +15 -0
- package/dist/primitives/input/label.d.ts.map +1 -0
- package/dist/primitives/input/label.js +56 -0
- package/dist/primitives/select/ExpandableSearchInput.d.ts +15 -0
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -0
- package/dist/primitives/select/ExpandableSearchInput.js +115 -0
- package/dist/primitives/select/SearchInput.d.ts +26 -0
- package/dist/primitives/select/SearchInput.d.ts.map +1 -0
- package/dist/primitives/select/SearchInput.js +136 -0
- package/dist/primitives/select/combobox.d.ts +14 -0
- package/dist/primitives/select/combobox.d.ts.map +1 -0
- package/dist/primitives/select/combobox.js +231 -0
- package/dist/primitives/select/index.d.ts +6 -0
- package/dist/primitives/select/index.d.ts.map +1 -0
- package/dist/primitives/select/multi-select.d.ts +46 -0
- package/dist/primitives/select/multi-select.d.ts.map +1 -0
- package/dist/primitives/select/multi-select.js +306 -0
- package/dist/primitives/select/popover.d.ts +7 -0
- package/dist/primitives/select/popover.d.ts.map +1 -0
- package/dist/primitives/select/popover.js +23 -0
- package/dist/primitives/select/searchable-select.d.ts +35 -0
- package/dist/primitives/select/searchable-select.d.ts.map +1 -0
- package/dist/primitives/select/searchable-select.js +239 -0
- package/dist/primitives/select/select-item.d.ts +8 -0
- package/dist/primitives/select/select-item.d.ts.map +1 -0
- package/dist/primitives/select/select-item.js +108 -0
- package/dist/primitives/select/select-native.d.ts +14 -0
- package/dist/primitives/select/select-native.d.ts.map +1 -0
- package/dist/primitives/select/select.d.ts +61 -0
- package/dist/primitives/select/select.d.ts.map +1 -0
- package/dist/primitives/select/select.js +208 -0
- package/dist/primitives/tags/base-components/tag-close-x.d.ts +9 -0
- package/dist/primitives/tags/base-components/tag-close-x.d.ts.map +1 -0
- package/dist/primitives/tags/base-components/tag-close-x.js +35 -0
- package/dist/primitives/text/text.d.ts +1 -1
- package/dist/primitives/tooltip/index.d.ts +2 -0
- package/dist/primitives/tooltip/index.d.ts.map +1 -0
- package/dist/primitives/tooltip/tooltip.d.ts +35 -0
- package/dist/primitives/tooltip/tooltip.d.ts.map +1 -0
- package/dist/primitives/tooltip/tooltip.js +104 -0
- package/dist/styles/components.css +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useId as H, useRef as l, useContext as y, useInsertionEffect as I } from "react";
|
|
4
|
+
import { MotionConfigContext as M } from "../../context/MotionConfigContext.js";
|
|
5
|
+
import { useComposedRefs as W } from "../../utils/use-composed-ref.js";
|
|
6
|
+
import { isHTMLElement as u } from "../../../../../motion-dom/dist/es/utils/is-html-element.js";
|
|
7
|
+
class B extends g.Component {
|
|
8
|
+
getSnapshotBeforeUpdate(i) {
|
|
9
|
+
const e = this.props.childRef.current;
|
|
10
|
+
if (e && i.isPresent && !this.props.isPresent) {
|
|
11
|
+
const n = e.offsetParent, p = u(n) && n.offsetWidth || 0, r = u(n) && n.offsetHeight || 0, t = this.props.sizeRef.current;
|
|
12
|
+
t.height = e.offsetHeight || 0, t.width = e.offsetWidth || 0, t.top = e.offsetTop, t.left = e.offsetLeft, t.right = p - t.width - t.left, t.bottom = r - t.height - t.top;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
18
|
+
*/
|
|
19
|
+
componentDidUpdate() {
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return this.props.children;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function D({ children: o, isPresent: i, anchorX: e, anchorY: n, root: p }) {
|
|
26
|
+
var c;
|
|
27
|
+
const r = H(), t = l(null), h = l({
|
|
28
|
+
width: 0,
|
|
29
|
+
height: 0,
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
right: 0,
|
|
33
|
+
bottom: 0
|
|
34
|
+
}), { nonce: m } = y(M), $ = ((c = o.props) == null ? void 0 : c.ref) ?? (o == null ? void 0 : o.ref), x = W(t, $);
|
|
35
|
+
return I(() => {
|
|
36
|
+
const { width: d, height: a, top: C, left: R, right: b, bottom: w } = h.current;
|
|
37
|
+
if (i || !t.current || !d || !a)
|
|
38
|
+
return;
|
|
39
|
+
const P = e === "left" ? `left: ${R}` : `right: ${b}`, z = n === "bottom" ? `bottom: ${w}` : `top: ${C}`;
|
|
40
|
+
t.current.dataset.motionPopId = r;
|
|
41
|
+
const s = document.createElement("style");
|
|
42
|
+
m && (s.nonce = m);
|
|
43
|
+
const f = p ?? document.head;
|
|
44
|
+
return f.appendChild(s), s.sheet && s.sheet.insertRule(`
|
|
45
|
+
[data-motion-pop-id="${r}"] {
|
|
46
|
+
position: absolute !important;
|
|
47
|
+
width: ${d}px !important;
|
|
48
|
+
height: ${a}px !important;
|
|
49
|
+
${P}px !important;
|
|
50
|
+
${z}px !important;
|
|
51
|
+
}
|
|
52
|
+
`), () => {
|
|
53
|
+
f.contains(s) && f.removeChild(s);
|
|
54
|
+
};
|
|
55
|
+
}, [i]), E(B, { isPresent: i, childRef: t, sizeRef: h, children: g.cloneElement(o, { ref: x }) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
D as PopChild
|
|
59
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as M from "react";
|
|
3
|
+
import { useId as g, useMemo as c } from "react";
|
|
4
|
+
import { PresenceContext as w } from "../../context/PresenceContext.js";
|
|
5
|
+
import { useConstant as x } from "../../utils/use-constant.js";
|
|
6
|
+
import { PopChild as $ } from "./PopChild.js";
|
|
7
|
+
const X = ({ children: f, initial: i, isPresent: r, onExitComplete: o, custom: m, presenceAffectsLayout: p, mode: l, anchorX: d, anchorY: h, root: C }) => {
|
|
8
|
+
const e = x(j), v = g();
|
|
9
|
+
let u = !0, n = c(() => (u = !1, {
|
|
10
|
+
id: v,
|
|
11
|
+
initial: i,
|
|
12
|
+
isPresent: r,
|
|
13
|
+
custom: m,
|
|
14
|
+
onExitComplete: (t) => {
|
|
15
|
+
e.set(t, !0);
|
|
16
|
+
for (const s of e.values())
|
|
17
|
+
if (!s)
|
|
18
|
+
return;
|
|
19
|
+
o && o();
|
|
20
|
+
},
|
|
21
|
+
register: (t) => (e.set(t, !1), () => e.delete(t))
|
|
22
|
+
}), [r, e, o]);
|
|
23
|
+
return p && u && (n = { ...n }), c(() => {
|
|
24
|
+
e.forEach((t, s) => e.set(s, !1));
|
|
25
|
+
}, [r]), M.useEffect(() => {
|
|
26
|
+
!r && !e.size && o && o();
|
|
27
|
+
}, [r]), l === "popLayout" && (f = a($, { isPresent: r, anchorX: d, anchorY: h, root: C, children: f })), a(w.Provider, { value: n, children: f });
|
|
28
|
+
};
|
|
29
|
+
function j() {
|
|
30
|
+
return /* @__PURE__ */ new Map();
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
X as PresenceChild
|
|
34
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as k, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useRef as p, useState as v, useContext as G } from "react";
|
|
3
|
+
import { LayoutGroupContext as O } from "../../context/LayoutGroupContext.js";
|
|
4
|
+
import { useConstant as R } from "../../utils/use-constant.js";
|
|
5
|
+
import { useIsomorphicLayoutEffect as V } from "../../utils/use-isomorphic-effect.js";
|
|
6
|
+
import { PresenceChild as X } from "./PresenceChild.js";
|
|
7
|
+
import { usePresence as _ } from "./use-presence.js";
|
|
8
|
+
import { onlyElements as A, getChildKey as c } from "./utils.js";
|
|
9
|
+
const W = ({ children: C, custom: L, initial: b = !0, onExitComplete: y, presenceAffectsLayout: j = !0, mode: u = "sync", propagate: l = !1, anchorX: D = "left", anchorY: I = "top", root: K }) => {
|
|
10
|
+
const [x, f] = _(l), n = F(() => A(C), [C]), o = l && !x ? [] : n.map(c), g = p(!0), P = p(n), i = R(() => /* @__PURE__ */ new Map()), d = p(/* @__PURE__ */ new Set()), [M, N] = v(n), [r, w] = v(n);
|
|
11
|
+
V(() => {
|
|
12
|
+
g.current = !1, P.current = n;
|
|
13
|
+
for (let t = 0; t < r.length; t++) {
|
|
14
|
+
const e = c(r[t]);
|
|
15
|
+
o.includes(e) ? (i.delete(e), d.current.delete(e)) : i.get(e) !== !0 && i.set(e, !1);
|
|
16
|
+
}
|
|
17
|
+
}, [r, o.length, o.join("-")]);
|
|
18
|
+
const m = [];
|
|
19
|
+
if (n !== M) {
|
|
20
|
+
let t = [...n];
|
|
21
|
+
for (let e = 0; e < r.length; e++) {
|
|
22
|
+
const s = r[e], h = c(s);
|
|
23
|
+
o.includes(h) || (t.splice(e, 0, s), m.push(s));
|
|
24
|
+
}
|
|
25
|
+
return u === "wait" && m.length && (t = m), w(A(t)), N(n), null;
|
|
26
|
+
}
|
|
27
|
+
process.env.NODE_ENV !== "production" && u === "wait" && r.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
28
|
+
const { forceRender: a } = G(O);
|
|
29
|
+
return k(Y, { children: r.map((t) => {
|
|
30
|
+
const e = c(t), s = l && !x ? !1 : n === r || o.includes(e), h = () => {
|
|
31
|
+
if (d.current.has(e))
|
|
32
|
+
return;
|
|
33
|
+
if (d.current.add(e), i.has(e))
|
|
34
|
+
i.set(e, !0);
|
|
35
|
+
else
|
|
36
|
+
return;
|
|
37
|
+
let E = !0;
|
|
38
|
+
i.forEach((S) => {
|
|
39
|
+
S || (E = !1);
|
|
40
|
+
}), E && (a == null || a(), w(P.current), l && (f == null || f()), y && y());
|
|
41
|
+
};
|
|
42
|
+
return k(X, { isPresent: s, initial: !g.current || b ? void 0 : !1, custom: L, presenceAffectsLayout: j, mode: u, root: K, onExitComplete: s ? void 0 : h, anchorX: D, anchorY: I, children: t }, e);
|
|
43
|
+
}) });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
W as AnimatePresence
|
|
47
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useContext as f, useId as l, useEffect as c, useCallback as i } from "react";
|
|
2
|
+
import { PresenceContext as m } from "../../context/PresenceContext.js";
|
|
3
|
+
function p(e = !0) {
|
|
4
|
+
const o = f(m);
|
|
5
|
+
if (o === null)
|
|
6
|
+
return [!0, null];
|
|
7
|
+
const { isPresent: r, onExitComplete: t, register: u } = o, n = l();
|
|
8
|
+
c(() => {
|
|
9
|
+
if (e)
|
|
10
|
+
return u(n);
|
|
11
|
+
}, [e]);
|
|
12
|
+
const s = i(() => e && t && t(n), [n, t, e]);
|
|
13
|
+
return !r && t ? [!1, s] : [!0];
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
p as usePresence
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext as o, useMemo as i } from "react";
|
|
2
|
+
import { MotionContext as a } from "./index.js";
|
|
3
|
+
import { getCurrentTreeVariants as m } from "./utils.js";
|
|
4
|
+
function C(t) {
|
|
5
|
+
const { initial: e, animate: n } = m(t, o(a));
|
|
6
|
+
return i(() => ({ initial: e, animate: n }), [r(e), r(n)]);
|
|
7
|
+
}
|
|
8
|
+
function r(t) {
|
|
9
|
+
return Array.isArray(t) ? t.join(" ") : t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
C as useCreateMotionContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isControllingVariants as r } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
|
|
2
|
+
import { isVariantLabel as e } from "../../../../../motion-dom/dist/es/render/utils/is-variant-label.js";
|
|
3
|
+
function o(i, a) {
|
|
4
|
+
if (r(i)) {
|
|
5
|
+
const { initial: n, animate: t } = i;
|
|
6
|
+
return {
|
|
7
|
+
initial: n === !1 || e(n) ? n : void 0,
|
|
8
|
+
animate: e(t) ? t : void 0
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return i.inherit !== !1 ? a : {};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
o as getCurrentTreeVariants
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isPrimaryPointer as t } from "../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
|
|
2
|
+
function n(r) {
|
|
3
|
+
return {
|
|
4
|
+
point: {
|
|
5
|
+
x: r.pageX,
|
|
6
|
+
y: r.pageY
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
const a = (r) => (o) => t(o) && r(o, n(o));
|
|
11
|
+
export {
|
|
12
|
+
a as addPointerInfo,
|
|
13
|
+
n as extractEventInfo
|
|
14
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { addPointerEvent as M } from "../../events/add-pointer-event.js";
|
|
2
|
+
import { extractEventInfo as S } from "../../events/event-info.js";
|
|
3
|
+
import { getContextWindow as k } from "../../utils/get-context-window.js";
|
|
4
|
+
import { isRefObject as D } from "../../utils/is-ref-object.js";
|
|
5
|
+
import { PanSession as B } from "../pan/PanSession.js";
|
|
6
|
+
import { applyConstraints as j, calcRelativeConstraints as b, resolveDragElastic as T, calcViewportConstraints as w, defaultElastic as I, rebaseAxisConstraints as R, calcOrigin as W } from "./utils/constraints.js";
|
|
7
|
+
import { createBox as O } from "../../../../../motion-dom/dist/es/projection/geometry/models.js";
|
|
8
|
+
import { eachAxis as h } from "../../../../../motion-dom/dist/es/projection/utils/each-axis.js";
|
|
9
|
+
import { frame as y } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
10
|
+
import { invariant as K } from "../../../../../motion-utils/dist/es/errors.js";
|
|
11
|
+
import { measurePageBox as U } from "../../../../../motion-dom/dist/es/projection/utils/measure.js";
|
|
12
|
+
import { convertBoxToBoundingBox as z, convertBoundingBoxToBox as _ } from "../../../../../motion-dom/dist/es/projection/geometry/conversion.js";
|
|
13
|
+
import { addValueToWillChange as x } from "../../../../../motion-dom/dist/es/value/will-change/add-will-change.js";
|
|
14
|
+
import { animateMotionValue as F } from "../../../../../motion-dom/dist/es/animation/interfaces/motion-value.js";
|
|
15
|
+
import { addDomEvent as N } from "../../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
16
|
+
import { setDragLock as $ } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
|
|
17
|
+
import { percent as q } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
|
|
18
|
+
import { calcLength as G } from "../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
19
|
+
import { mixNumber as L } from "../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
20
|
+
import { isElementKeyboardAccessible as H } from "../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js";
|
|
21
|
+
const J = /* @__PURE__ */ new WeakMap();
|
|
22
|
+
class Et {
|
|
23
|
+
constructor(t) {
|
|
24
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = O(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = t;
|
|
25
|
+
}
|
|
26
|
+
start(t, { snapToCursor: s = !1, distanceThreshold: n } = {}) {
|
|
27
|
+
const { presenceContext: i } = this.visualElement;
|
|
28
|
+
if (i && i.isPresent === !1)
|
|
29
|
+
return;
|
|
30
|
+
const r = (o) => {
|
|
31
|
+
s ? (this.stopAnimation(), this.snapToCursor(S(o).point)) : this.pauseAnimation();
|
|
32
|
+
}, e = (o, c) => {
|
|
33
|
+
this.stopAnimation();
|
|
34
|
+
const { drag: f, dragPropagation: d, onDragStart: v } = this.getProps();
|
|
35
|
+
if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = $(f), !this.openDragLock))
|
|
36
|
+
return;
|
|
37
|
+
this.latestPointerEvent = o, this.latestPanInfo = c, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), h((g) => {
|
|
38
|
+
let P = this.getAxisMotionValue(g).get() || 0;
|
|
39
|
+
if (q.test(P)) {
|
|
40
|
+
const { projection: C } = this.visualElement;
|
|
41
|
+
if (C && C.layout) {
|
|
42
|
+
const V = C.layout.layoutBox[g];
|
|
43
|
+
V && (P = G(V) * (parseFloat(P) / 100));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
this.originPoint[g] = P;
|
|
47
|
+
}), v && y.postRender(() => v(o, c)), x(this.visualElement, "transform");
|
|
48
|
+
const { animationState: E } = this.visualElement;
|
|
49
|
+
E && E.setActive("whileDrag", !0);
|
|
50
|
+
}, a = (o, c) => {
|
|
51
|
+
this.latestPointerEvent = o, this.latestPanInfo = c;
|
|
52
|
+
const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: v, onDrag: E } = this.getProps();
|
|
53
|
+
if (!f && !this.openDragLock)
|
|
54
|
+
return;
|
|
55
|
+
const { offset: g } = c;
|
|
56
|
+
if (d && this.currentDirection === null) {
|
|
57
|
+
this.currentDirection = Q(g), this.currentDirection !== null && v && v(this.currentDirection);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.updateAxis("x", c.point, g), this.updateAxis("y", c.point, g), this.visualElement.render(), E && E(o, c);
|
|
61
|
+
}, l = (o, c) => {
|
|
62
|
+
this.latestPointerEvent = o, this.latestPanInfo = c, this.stop(o, c), this.latestPointerEvent = null, this.latestPanInfo = null;
|
|
63
|
+
}, m = () => h((o) => {
|
|
64
|
+
var c;
|
|
65
|
+
return this.getAnimationState(o) === "paused" && ((c = this.getAxisMotionValue(o).animation) == null ? void 0 : c.play());
|
|
66
|
+
}), { dragSnapToOrigin: u } = this.getProps();
|
|
67
|
+
this.panSession = new B(t, {
|
|
68
|
+
onSessionStart: r,
|
|
69
|
+
onStart: e,
|
|
70
|
+
onMove: a,
|
|
71
|
+
onSessionEnd: l,
|
|
72
|
+
resumeAnimation: m
|
|
73
|
+
}, {
|
|
74
|
+
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
75
|
+
dragSnapToOrigin: u,
|
|
76
|
+
distanceThreshold: n,
|
|
77
|
+
contextWindow: k(this.visualElement),
|
|
78
|
+
element: this.visualElement.current
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
stop(t, s) {
|
|
85
|
+
const n = t || this.latestPointerEvent, i = s || this.latestPanInfo, r = this.isDragging;
|
|
86
|
+
if (this.cancel(), !r || !i || !n)
|
|
87
|
+
return;
|
|
88
|
+
const { velocity: e } = i;
|
|
89
|
+
this.startAnimation(e);
|
|
90
|
+
const { onDragEnd: a } = this.getProps();
|
|
91
|
+
a && y.postRender(() => a(n, i));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
cancel() {
|
|
97
|
+
this.isDragging = !1;
|
|
98
|
+
const { projection: t, animationState: s } = this.visualElement;
|
|
99
|
+
t && (t.isAnimationBlocked = !1), this.endPanSession();
|
|
100
|
+
const { dragPropagation: n } = this.getProps();
|
|
101
|
+
!n && this.openDragLock && (this.openDragLock(), this.openDragLock = null), s && s.setActive("whileDrag", !1);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Clean up the pan session without modifying other drag state.
|
|
105
|
+
* This is used during unmount to ensure event listeners are removed
|
|
106
|
+
* without affecting projection animations or drag locks.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
endPanSession() {
|
|
110
|
+
this.panSession && this.panSession.end(), this.panSession = void 0;
|
|
111
|
+
}
|
|
112
|
+
updateAxis(t, s, n) {
|
|
113
|
+
const { drag: i } = this.getProps();
|
|
114
|
+
if (!n || !A(t, i, this.currentDirection))
|
|
115
|
+
return;
|
|
116
|
+
const r = this.getAxisMotionValue(t);
|
|
117
|
+
let e = this.originPoint[t] + n[t];
|
|
118
|
+
this.constraints && this.constraints[t] && (e = j(e, this.constraints[t], this.elastic[t])), r.set(e);
|
|
119
|
+
}
|
|
120
|
+
resolveConstraints() {
|
|
121
|
+
var r;
|
|
122
|
+
const { dragConstraints: t, dragElastic: s } = this.getProps(), n = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (r = this.visualElement.projection) == null ? void 0 : r.layout, i = this.constraints;
|
|
123
|
+
t && D(t) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : t && n ? this.constraints = b(n.layoutBox, t) : this.constraints = !1, this.elastic = T(s), i !== this.constraints && n && this.constraints && !this.hasMutatedConstraints && h((e) => {
|
|
124
|
+
this.constraints !== !1 && this.getAxisMotionValue(e) && (this.constraints[e] = R(n.layoutBox[e], this.constraints[e]));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
resolveRefConstraints() {
|
|
128
|
+
const { dragConstraints: t, onMeasureDragConstraints: s } = this.getProps();
|
|
129
|
+
if (!t || !D(t))
|
|
130
|
+
return !1;
|
|
131
|
+
const n = t.current;
|
|
132
|
+
K(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
133
|
+
const { projection: i } = this.visualElement;
|
|
134
|
+
if (!i || !i.layout)
|
|
135
|
+
return !1;
|
|
136
|
+
const r = U(n, i.root, this.visualElement.getTransformPagePoint());
|
|
137
|
+
let e = w(i.layout.layoutBox, r);
|
|
138
|
+
if (s) {
|
|
139
|
+
const a = s(z(e));
|
|
140
|
+
this.hasMutatedConstraints = !!a, a && (e = _(a));
|
|
141
|
+
}
|
|
142
|
+
return e;
|
|
143
|
+
}
|
|
144
|
+
startAnimation(t) {
|
|
145
|
+
const { drag: s, dragMomentum: n, dragElastic: i, dragTransition: r, dragSnapToOrigin: e, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, m = h((u) => {
|
|
146
|
+
if (!A(u, s, this.currentDirection))
|
|
147
|
+
return;
|
|
148
|
+
let o = l && l[u] || {};
|
|
149
|
+
e && (o = { min: 0, max: 0 });
|
|
150
|
+
const c = i ? 200 : 1e6, f = i ? 40 : 1e7, d = {
|
|
151
|
+
type: "inertia",
|
|
152
|
+
velocity: n ? t[u] : 0,
|
|
153
|
+
bounceStiffness: c,
|
|
154
|
+
bounceDamping: f,
|
|
155
|
+
timeConstant: 750,
|
|
156
|
+
restDelta: 1,
|
|
157
|
+
restSpeed: 10,
|
|
158
|
+
...r,
|
|
159
|
+
...o
|
|
160
|
+
};
|
|
161
|
+
return this.startAxisValueAnimation(u, d);
|
|
162
|
+
});
|
|
163
|
+
return Promise.all(m).then(a);
|
|
164
|
+
}
|
|
165
|
+
startAxisValueAnimation(t, s) {
|
|
166
|
+
const n = this.getAxisMotionValue(t);
|
|
167
|
+
return x(this.visualElement, t), n.start(F(t, n, 0, s, this.visualElement, !1));
|
|
168
|
+
}
|
|
169
|
+
stopAnimation() {
|
|
170
|
+
h((t) => this.getAxisMotionValue(t).stop());
|
|
171
|
+
}
|
|
172
|
+
pauseAnimation() {
|
|
173
|
+
h((t) => {
|
|
174
|
+
var s;
|
|
175
|
+
return (s = this.getAxisMotionValue(t).animation) == null ? void 0 : s.pause();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
getAnimationState(t) {
|
|
179
|
+
var s;
|
|
180
|
+
return (s = this.getAxisMotionValue(t).animation) == null ? void 0 : s.state;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Drag works differently depending on which props are provided.
|
|
184
|
+
*
|
|
185
|
+
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
186
|
+
* - Otherwise, we apply the delta to the x/y motion values.
|
|
187
|
+
*/
|
|
188
|
+
getAxisMotionValue(t) {
|
|
189
|
+
const s = `_drag${t.toUpperCase()}`, n = this.visualElement.getProps(), i = n[s];
|
|
190
|
+
return i || this.visualElement.getValue(t, (n.initial ? n.initial[t] : void 0) || 0);
|
|
191
|
+
}
|
|
192
|
+
snapToCursor(t) {
|
|
193
|
+
h((s) => {
|
|
194
|
+
const { drag: n } = this.getProps();
|
|
195
|
+
if (!A(s, n, this.currentDirection))
|
|
196
|
+
return;
|
|
197
|
+
const { projection: i } = this.visualElement, r = this.getAxisMotionValue(s);
|
|
198
|
+
if (i && i.layout) {
|
|
199
|
+
const { min: e, max: a } = i.layout.layoutBox[s], l = r.get() || 0;
|
|
200
|
+
r.set(t[s] - L(e, a, 0.5) + l);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* When the viewport resizes we want to check if the measured constraints
|
|
206
|
+
* have changed and, if so, reposition the element within those new constraints
|
|
207
|
+
* relative to where it was before the resize.
|
|
208
|
+
*/
|
|
209
|
+
scalePositionWithinConstraints() {
|
|
210
|
+
if (!this.visualElement.current)
|
|
211
|
+
return;
|
|
212
|
+
const { drag: t, dragConstraints: s } = this.getProps(), { projection: n } = this.visualElement;
|
|
213
|
+
if (!D(s) || !n || !this.constraints)
|
|
214
|
+
return;
|
|
215
|
+
this.stopAnimation();
|
|
216
|
+
const i = { x: 0, y: 0 };
|
|
217
|
+
h((e) => {
|
|
218
|
+
const a = this.getAxisMotionValue(e);
|
|
219
|
+
if (a && this.constraints !== !1) {
|
|
220
|
+
const l = a.get();
|
|
221
|
+
i[e] = W({ min: l, max: l }, this.constraints[e]);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const { transformTemplate: r } = this.visualElement.getProps();
|
|
225
|
+
this.visualElement.current.style.transform = r ? r({}, "") : "none", n.root && n.root.updateScroll(), n.updateLayout(), this.resolveConstraints(), h((e) => {
|
|
226
|
+
if (!A(e, t, null))
|
|
227
|
+
return;
|
|
228
|
+
const a = this.getAxisMotionValue(e), { min: l, max: m } = this.constraints[e];
|
|
229
|
+
a.set(L(l, m, i[e]));
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
addListeners() {
|
|
233
|
+
if (!this.visualElement.current)
|
|
234
|
+
return;
|
|
235
|
+
J.set(this.visualElement, this);
|
|
236
|
+
const t = this.visualElement.current, s = M(t, "pointerdown", (l) => {
|
|
237
|
+
const { drag: m, dragListener: u = !0 } = this.getProps(), o = l.target, c = o !== t && H(o);
|
|
238
|
+
m && u && !c && this.start(l);
|
|
239
|
+
}), n = () => {
|
|
240
|
+
const { dragConstraints: l } = this.getProps();
|
|
241
|
+
D(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
242
|
+
}, { projection: i } = this.visualElement, r = i.addEventListener("measure", n);
|
|
243
|
+
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), y.read(n);
|
|
244
|
+
const e = N(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: m }) => {
|
|
245
|
+
this.isDragging && m && (h((u) => {
|
|
246
|
+
const o = this.getAxisMotionValue(u);
|
|
247
|
+
o && (this.originPoint[u] += l[u].translate, o.set(o.get() + l[u].translate));
|
|
248
|
+
}), this.visualElement.render());
|
|
249
|
+
}));
|
|
250
|
+
return () => {
|
|
251
|
+
e(), s(), r(), a && a();
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
getProps() {
|
|
255
|
+
const t = this.visualElement.getProps(), { drag: s = !1, dragDirectionLock: n = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: e = I, dragMomentum: a = !0 } = t;
|
|
256
|
+
return {
|
|
257
|
+
...t,
|
|
258
|
+
drag: s,
|
|
259
|
+
dragDirectionLock: n,
|
|
260
|
+
dragPropagation: i,
|
|
261
|
+
dragConstraints: r,
|
|
262
|
+
dragElastic: e,
|
|
263
|
+
dragMomentum: a
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function A(p, t, s) {
|
|
268
|
+
return (t === !0 || t === p) && (s === null || s === p);
|
|
269
|
+
}
|
|
270
|
+
function Q(p, t = 10) {
|
|
271
|
+
let s = null;
|
|
272
|
+
return Math.abs(p.y) > t ? s = "y" : Math.abs(p.x) > t && (s = "x"), s;
|
|
273
|
+
}
|
|
274
|
+
export {
|
|
275
|
+
Et as VisualElementDragControls,
|
|
276
|
+
J as elementDragControls
|
|
277
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VisualElementDragControls as t } from "./VisualElementDragControls.js";
|
|
2
|
+
import { Feature as e } from "../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
+
import { noop as s } from "../../../../../motion-utils/dist/es/noop.js";
|
|
4
|
+
class m extends e {
|
|
5
|
+
constructor(o) {
|
|
6
|
+
super(o), this.removeGroupControls = s, this.removeListeners = s, this.controls = new t(o);
|
|
7
|
+
}
|
|
8
|
+
mount() {
|
|
9
|
+
const { dragControls: o } = this.node.getProps();
|
|
10
|
+
o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || s;
|
|
11
|
+
}
|
|
12
|
+
update() {
|
|
13
|
+
const { dragControls: o } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
|
|
14
|
+
o !== r && (this.removeGroupControls(), o && (this.removeGroupControls = o.subscribe(this.controls)));
|
|
15
|
+
}
|
|
16
|
+
unmount() {
|
|
17
|
+
this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
m as DragGesture
|
|
22
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { mixNumber as r } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
2
|
+
import { calcLength as t } from "../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
3
|
+
import { progress as u } from "../../../../../../motion-utils/dist/es/progress.js";
|
|
4
|
+
import { clamp as C } from "../../../../../../motion-utils/dist/es/clamp.js";
|
|
5
|
+
function a(n, { min: e, max: m }, i) {
|
|
6
|
+
return e !== void 0 && n < e ? n = i ? r(e, n, i.min) : Math.max(n, e) : m !== void 0 && n > m && (n = i ? r(m, n, i.max) : Math.min(n, m)), n;
|
|
7
|
+
}
|
|
8
|
+
function o(n, e, m) {
|
|
9
|
+
return {
|
|
10
|
+
min: e !== void 0 ? n.min + e : void 0,
|
|
11
|
+
max: m !== void 0 ? n.max + m - (n.max - n.min) : void 0
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function L(n, { top: e, left: m, bottom: i, right: f }) {
|
|
15
|
+
return {
|
|
16
|
+
x: o(n.x, m, f),
|
|
17
|
+
y: o(n.y, e, i)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function x(n, e) {
|
|
21
|
+
let m = e.min - n.min, i = e.max - n.max;
|
|
22
|
+
return e.max - e.min < n.max - n.min && ([m, i] = [i, m]), { min: m, max: i };
|
|
23
|
+
}
|
|
24
|
+
function w(n, e) {
|
|
25
|
+
return {
|
|
26
|
+
x: x(n.x, e.x),
|
|
27
|
+
y: x(n.y, e.y)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function y(n, e) {
|
|
31
|
+
let m = 0.5;
|
|
32
|
+
const i = t(n), f = t(e);
|
|
33
|
+
return f > i ? m = u(e.min, e.max - i, n.min) : i > f && (m = u(n.min, n.max - f, e.min)), C(0, 1, m);
|
|
34
|
+
}
|
|
35
|
+
function M(n, e) {
|
|
36
|
+
const m = {};
|
|
37
|
+
return e.min !== void 0 && (m.min = e.min - n.min), e.max !== void 0 && (m.max = e.max - n.min), m;
|
|
38
|
+
}
|
|
39
|
+
const c = 0.35;
|
|
40
|
+
function R(n = c) {
|
|
41
|
+
return n === !1 ? n = 0 : n === !0 && (n = c), {
|
|
42
|
+
x: l(n, "left", "right"),
|
|
43
|
+
y: l(n, "top", "bottom")
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function l(n, e, m) {
|
|
47
|
+
return {
|
|
48
|
+
min: d(n, e),
|
|
49
|
+
max: d(n, m)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function d(n, e) {
|
|
53
|
+
return typeof n == "number" ? n : n[e] || 0;
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
a as applyConstraints,
|
|
57
|
+
y as calcOrigin,
|
|
58
|
+
o as calcRelativeAxisConstraints,
|
|
59
|
+
L as calcRelativeConstraints,
|
|
60
|
+
x as calcViewportAxisConstraints,
|
|
61
|
+
w as calcViewportConstraints,
|
|
62
|
+
c as defaultElastic,
|
|
63
|
+
M as rebaseAxisConstraints,
|
|
64
|
+
l as resolveAxisElastic,
|
|
65
|
+
R as resolveDragElastic,
|
|
66
|
+
d as resolvePointElastic
|
|
67
|
+
};
|