@gridui/motion 1.0.1 → 1.0.2

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.
Files changed (38) hide show
  1. package/dist/{chunk-MMMTUJVS.js → chunk-JV6HKGMG.js} +1 -1
  2. package/dist/chunk-JV6HKGMG.js.map +7 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +2 -2
  6. package/dist/layout-motion/layout-motion.d.ts +6 -0
  7. package/dist/motion-config/context.d.ts +6 -0
  8. package/dist/motion-config/motion-config.d.ts +6 -0
  9. package/dist/motion-config/types.d.ts +6 -0
  10. package/dist/motion-config/validate-transition.d.ts +6 -0
  11. package/dist/motion-layout-group/context.d.ts +6 -0
  12. package/dist/motion-layout-group/motion-layout-group.d.ts +6 -0
  13. package/dist/motion-reveal/motion-reveal.d.ts +6 -0
  14. package/dist/motion-scope/motion-scope.d.ts +6 -0
  15. package/dist/motion-sequence/controller.d.ts +6 -0
  16. package/dist/motion-sequence/use-motion-sequence.d.ts +6 -0
  17. package/dist/motion-size/motion-size.d.ts +6 -0
  18. package/dist/policy.d.ts +6 -0
  19. package/dist/policy.js +1 -1
  20. package/dist/presence/presence.d.ts +6 -0
  21. package/dist/shared/dom-policy.d.ts +6 -0
  22. package/dist/shared/outcome.d.ts +6 -0
  23. package/dist/shared/resolve-transition.d.ts +6 -0
  24. package/dist/shared/state.d.ts +6 -0
  25. package/dist/shared/use-motion-policy.d.ts +6 -0
  26. package/dist/shared/use-motion-style.d.ts +6 -0
  27. package/dist/spring-value/controller.d.ts +6 -0
  28. package/dist/spring-value/use-spring-value.d.ts +6 -0
  29. package/docs/catalog.json +7 -2
  30. package/docs/reference/layout-motion.md +1 -1
  31. package/docs/reference/motion-config.md +1 -1
  32. package/docs/reference/motion-layout-group.md +2 -0
  33. package/docs/reference/motion-reveal.md +1 -1
  34. package/docs/reference/motion-scope.md +2 -0
  35. package/docs/reference/motion-size.md +2 -2
  36. package/docs/reference/presence.md +3 -1
  37. package/package.json +4 -4
  38. package/dist/chunk-MMMTUJVS.js.map +0 -7
@@ -103,4 +103,4 @@ export {
103
103
  useMotionPolicy,
104
104
  useMotionStyle
105
105
  };
106
- //# sourceMappingURL=chunk-MMMTUJVS.js.map
106
+ //# sourceMappingURL=chunk-JV6HKGMG.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/shared/dom-policy.ts", "../src/shared/use-motion-policy.ts", "../src/motion-config/context.ts", "../src/shared/use-motion-style.ts"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Dom Policy\n */\n\nexport type DOMMotionPolicy = { readonly immediate: boolean; readonly tempo: number };\nconst query = \"(prefers-reduced-motion: reduce)\";\n\n/** Read base time tokens without applying tempo. CSS calc()/var() resolve in the browser. */\nexport const readMotionDuration = (element: Element, token = \"--gridui-motion-duration-normal\", fallback = 180): number => {\n const value = element.ownerDocument.defaultView!.getComputedStyle(element).getPropertyValue(token).trim();\n const parse = (time: string): number | undefined => {\n if (!/^(?:\\d*\\.)?\\d+(?:ms|s)$/.test(time)) { return undefined; }\n return Number.parseFloat(time) * (time.endsWith(\"ms\") ? 1 : 1000);\n };\n const direct = parse(value);\n if (direct !== undefined) { return direct; }\n if (!value || !element.ownerDocument.defaultView!.CSS.supports(\"transition-duration\", value)) { return fallback; }\n const probe = element.ownerDocument.createElement(\"span\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none\";\n probe.style.transitionDuration = value;\n element.ownerDocument.body.append(probe);\n const result = parse(element.ownerDocument.defaultView!.getComputedStyle(probe).transitionDuration);\n probe.remove();\n return result ?? fallback;\n};\n\nexport const readMotionPolicy = (element: Element): DOMMotionPolicy => {\n const style = element.ownerDocument.defaultView!.getComputedStyle(element);\n const factor = Number.parseFloat(style.getPropertyValue(\"--gridui-motion-tempo\"));\n return {\n immediate: element.ownerDocument.defaultView!.matchMedia(query).matches\n || style.getPropertyValue(\"--gridui-motion-disabled\").trim() === \"1\",\n tempo: Number.isFinite(factor) && factor > 0 ? factor : 1,\n };\n};\n\n/**\n * Observe the current ancestor chain and document preference. Re-subscribe after\n * reparenting; stylesheet-only changes are read on the next explicit read/update.\n * Resource lifecycle stays independent. This observer never scans descendants.\n */\nexport const observeMotionPolicy = (element: Element, changed: (policy: DOMMotionPolicy) => void): (() => void) => {\n let previous = readMotionPolicy(element);\n const update = () => {\n const next = readMotionPolicy(element);\n if (next.immediate !== previous.immediate || next.tempo !== previous.tempo) {\n previous = next;\n changed(next);\n }\n };\n const observer = new element.ownerDocument.defaultView!.MutationObserver(update);\n for (let node: Element | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"style\", \"class\"] });\n }\n const media = element.ownerDocument.defaultView!.matchMedia(query);\n media.addEventListener(\"change\", update);\n return () => {\n observer.disconnect();\n media.removeEventListener(\"change\", update);\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Policy\n */\n\nimport { useContext, useSyncExternalStore } from \"react\";\nimport { MotionContext } from \"../motion-config/context\";\n\nconst query = \"(prefers-reduced-motion: reduce)\";\nconst subscribe = (notify: () => void): (() => void) => {\n const preference = window.matchMedia(query);\n preference.addEventListener(\"change\", notify);\n return () => void preference.removeEventListener(\"change\", notify);\n};\nconst snapshot = (): boolean => window.matchMedia(query).matches;\nconst serverSnapshot = (): undefined => undefined;\n\n/** Unknown server preference is visually immediate but must not advance domain state. */\nexport const useMotionPolicy = () => {\n const settings = useContext(MotionContext);\n const systemReduced = useSyncExternalStore<boolean | undefined>(subscribe, snapshot, serverSnapshot);\n const ready = systemReduced !== undefined;\n const reason = settings.disabled ? \"disabled\" : settings.reducedMotion === \"always\" || systemReduced\n ? \"reduced-motion\" : !ready ? \"pending\" : undefined;\n return { ...settings, ready, reason, immediate: reason !== undefined };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Context\n */\n\nimport { createContext } from \"react\";\nimport type { MotionSettings } from \"./types\";\n\nexport const MotionContext = createContext<MotionSettings>({\n tempo: 1,\n reducedMotion: \"user\",\n disabled: false,\n transition: undefined,\n});\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Style\n */\n\nimport type { CSSProperties } from \"react\";\nimport { useMotionPolicy } from \"./use-motion-policy\";\n\n/** Bridge React policy to owned CSS, including nodes rendered through a portal. */\nexport const useMotionStyle = (style?: CSSProperties): CSSProperties => {\n const policy = useMotionPolicy();\n return {\n ...style,\n \"--gridui-motion-tempo\": policy.tempo,\n \"--gridui-motion-factor\": policy.immediate ? 0 : policy.tempo,\n \"--gridui-motion-disabled\": policy.immediate ? 1 : 0,\n \"--gridui-motion-animation\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transition\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transform\": policy.immediate ? \"none\" : \"initial\",\n } as CSSProperties;\n};\n"],
5
+ "mappings": ";AAQA,IAAM,QAAQ;AAGP,IAAM,qBAAqB,CAAC,SAAkB,QAAQ,mCAAmC,WAAW,QAAgB;AACvH,QAAM,QAAQ,QAAQ,cAAc,YAAa,iBAAiB,OAAO,EAAE,iBAAiB,KAAK,EAAE,KAAK;AACxG,QAAM,QAAQ,CAAC,SAAqC;AAChD,QAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAAE,aAAO;AAAA,IAAW;AAC/D,WAAO,OAAO,WAAW,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,IAAI;AAAA,EAChE;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,WAAW,QAAW;AAAE,WAAO;AAAA,EAAQ;AAC3C,MAAI,CAAC,SAAS,CAAC,QAAQ,cAAc,YAAa,IAAI,SAAS,uBAAuB,KAAK,GAAG;AAAE,WAAO;AAAA,EAAU;AACjH,QAAM,QAAQ,QAAQ,cAAc,cAAc,MAAM;AACxD,QAA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A,EACvD,OAAO;AAAA,EACP,eAAe;AAAA,EACf,UAAU;AAAA,EACV,YAAY;AAChB,CAAC;;;ADLD,IAAMA,SAAQ;AACd,IAAM,YAAY,CAAC,WAAqC;AACpD,QAAM,aAAa,OAAO,WAAWA,MAAK;AAC1C,aAAW,iBAAiB,UAAU,MAAM;AAC5C,SAAO,MAAM,KAAK,WAAW,oBAAoB,UAAU,MAAM;AACrE;AACA,IAAM,WAAW,MAAe,OAAO,WAAWA,MAAK,EAAE;AACzD,IAAM,iBAAiB,MAAiB;AAGjC,IAAM,kBAAkB,MAAM;AACjC,QAAM,WAAW,WAAW,aAAa;AACzC,QAAM,gBAAgB,qBAA0C,WAAW,UAAU,cAAc;AACnG,QAAM,QAAQ,kBAAkB;AAChC,QAAM,SAAS,SAAS,WAAW,aAAa,SAAS,kBAAkB,YAAY,gBACjF,mBAAmB,CAAC,QAAQ,YAAY;AAC9C,SAAO,EAAE,GAAG,UAAU,OAAO,QAAQ,WAAW,WAAW,OAAU;AACzE;;;AEhBO,IAAM,iBAAiB,CAAC,UAAyC;AACpE,QAAM,SAAS,gBAAgB;AAC/B,SAAO;AAAA,IACH,GAAG;AAAA,IACH,yBAAyB,OAAO;AAAA,IAChC,0BAA0B,OAAO,YAAY,IAAI,OAAO;AAAA,IACxD,4BAA4B,OAAO,YAAY,IAAI;AAAA,IACnD,6BAA6B,OAAO,YAAY,SAAS;AAAA,IACzD,8BAA8B,OAAO,YAAY,SAAS;AAAA,IAC1D,6BAA6B,OAAO,YAAY,SAAS;AAAA,EAC7D;AACJ;",
6
+ "names": ["query"]
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Root
5
+ * @description Index
6
+ */
1
7
  export { MotionConfig } from "./motion-config/motion-config";
2
8
  export type { MotionConfigProps, MotionEase, MotionTransition } from "./motion-config/types";
3
9
  export { Presence } from "./presence/presence";
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  readMotionPolicy,
6
6
  useMotionPolicy,
7
7
  useMotionStyle
8
- } from "./chunk-MMMTUJVS.js";
8
+ } from "./chunk-JV6HKGMG.js";
9
9
 
10
10
  // src/motion-config/motion-config.tsx
11
11
  import { useContext, useMemo } from "react";
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/motion-config/motion-config.tsx", "../src/motion-config/validate-transition.ts", "../src/motion-layout-group/context.ts", "../src/presence/presence.tsx", "../src/layout-motion/layout-motion.tsx", "../src/shared/resolve-transition.ts", "../src/motion-scope/motion-scope.tsx", "../src/motion-layout-group/motion-layout-group.tsx", "../src/spring-value/use-spring-value.ts", "../src/spring-value/controller.ts", "../src/motion-size/motion-size.tsx", "../src/motion-sequence/use-motion-sequence.ts", "../src/motion-sequence/controller.ts", "../src/motion-reveal/motion-reveal.tsx"],
4
- "sourcesContent": ["import { useContext, useMemo } from \"react\";\nimport { MotionContext } from \"./context\";\nimport type { MotionConfigProps } from \"./types\";\nimport { validateTransition } from \"./validate-transition\";\n\nexport const MotionConfig = ({ children, tempo, reducedMotion, disabled, transition }: MotionConfigProps) => {\n const parent = useContext(MotionContext);\n if (tempo !== undefined && (!Number.isFinite(tempo) || tempo <= 0)) {\n throw new RangeError(\"MotionConfig tempo must be finite and positive.\");\n }\n if (transition) {validateTransition(transition);}\n const value = useMemo(() => ({\n tempo: tempo ?? parent.tempo,\n reducedMotion: parent.reducedMotion === \"always\" ? \"always\" : reducedMotion ?? parent.reducedMotion,\n disabled: parent.disabled || disabled === true,\n transition: transition ?? parent.transition,\n }), [parent, tempo, reducedMotion, disabled, transition]);\n return <MotionContext.Provider value={value}>{children}</MotionContext.Provider>;\n};\n", "import type { MotionTransition } from \"./types\";\n\nexport const validateTransition = (transition: MotionTransition): void => {\n if (transition.type === \"spring\") {\n for (const value of [transition.stiffness, transition.damping, transition.mass]) {\n if (value !== undefined && (!Number.isFinite(value) || value <= 0)) {\n throw new RangeError(\"Motion spring parameters must be finite and positive.\");\n }\n }\n } else if (transition.duration !== undefined && (!Number.isFinite(transition.duration) || transition.duration < 0)) {\n throw new RangeError(\"Motion duration must be finite and nonnegative.\");\n }\n};\n\n", "import { createContext } from \"react\";\n\nexport const LayoutGroupContext = createContext(false);\n", "import { LayoutGroupContext } from \"../motion-layout-group/context\";\nimport { AnimatePresence, LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useContext, useId } from \"react\";\n\nexport type PresenceProps = {\n readonly children: ReactNode;\n readonly mode?: \"sync\" | \"wait\" | \"popLayout\";\n readonly initial?: boolean;\n readonly onExitComplete?: () => void;\n};\n\n/** Keep this boundary mounted. Direct children need stable keys and forwarded refs for popLayout. */\nexport const Presence = ({ children, mode = \"sync\", initial = false, onExitComplete }: PresenceProps) => {\n const id = useId();\n const grouped = useContext(LayoutGroupContext);\n const presence = <AnimatePresence mode={mode} initial={initial} {...(onExitComplete ? { onExitComplete } : {})}>\n {children}\n </AnimatePresence>;\n return grouped ? presence : <LayoutGroup id={id}>{presence}</LayoutGroup>;\n};\n", "import type { MotionState } from \"../shared/state\";\nimport { animate as animateValue, motion, useMotionValue, usePresence, type MotionStyle, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { fallbackTransition, readThemeTransition, resolveTransition } from \"../shared/resolve-transition\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type LayoutMotionProps = Omit<ComponentPropsWithRef<\"div\">,\n \"onAnimationStart\" | \"onDrag\" | \"onDragStart\" | \"onDragEnd\" | \"style\"> & {\n readonly style?: Omit<CSSProperties, \"transform\" | \"opacity\" | \"scale\" | \"translate\" | \"rotate\">;\n readonly layout?: boolean | \"position\" | \"size\";\n readonly layoutId?: string;\n /** Mark the scrolling element used by descendant layout measurements. */\n readonly layoutScroll?: boolean;\n /** Mark a fixed-position root used by descendant layout measurements. */\n readonly layoutRoot?: boolean;\n readonly enter?: MotionState;\n readonly animate?: MotionState;\n readonly exit?: MotionState;\n readonly transition?: MotionTransition;\n readonly exitTransition?: MotionTransition;\n readonly onAnimationComplete?: () => void;\n readonly onLayoutAnimationComplete?: () => void;\n};\n\nexport const LayoutMotion = ({\n layout = true, layoutId, layoutScroll, layoutRoot, enter, animate, exit,\n transition, exitTransition, ref, inert, style, onAnimationComplete,\n \"aria-hidden\": ariaHidden, ...props\n}: LayoutMotionProps) => {\n const policy = useMotionPolicy();\n const [present, safeToRemove] = usePresence();\n const node = useRef<HTMLDivElement>(null);\n const running = useRef<AnimationPlaybackControlsWithThen[]>([]);\n const [theme, setTheme] = useState(fallbackTransition);\n useImperativeHandle(ref, () => node.current!, []);\n useLayoutEffect(() => {\n const next = readThemeTransition(node.current!);\n setTheme(previous => next.duration === previous.duration && String(next.ease) === String(previous.ease)\n ? previous : next);\n }, [style, props.className, policy.transition, transition]);\n const opacity = animate?.opacity ?? 1;\n const x = animate?.x ?? 0;\n const y = animate?.y ?? 0;\n const scale = animate?.scale ?? 1;\n const opacityValue = useMotionValue(opacity);\n const xValue = useMotionValue(x);\n const yValue = useMotionValue(y);\n const scaleValue = useMotionValue(scale);\n const values = useMemo(() => ({ opacity: opacityValue, x: xValue, y: yValue, scale: scaleValue }),\n [opacityValue, xValue, yValue, scaleValue]);\n const exitOpacity = exit?.opacity;\n const exitX = exit?.x;\n const exitY = exit?.y;\n const exitScale = exit?.scale;\n const hasExit = exit !== undefined;\n // Timing is captured at each target change. Tempo changes update playback speed\n // independently, so a live configuration update never replays an entrance.\n const settings = useEffectEvent(() => ({\n timing: resolveTransition((!present ? exitTransition : undefined) ?? transition ?? policy.transition,\n readThemeTransition(node.current!), 1, policy.immediate),\n immediate: policy.immediate,\n tempo: policy.tempo,\n }));\n const complete = useEffectEvent(() => onAnimationComplete?.());\n useEffect(() => {\n const { timing, immediate, tempo } = settings();\n const target = present ? { opacity, x, y, scale } : {\n opacity: exitOpacity, x: exitX, y: exitY, scale: exitScale,\n };\n let active = true;\n const playback: AnimationPlaybackControlsWithThen[] = [];\n for (const key of [\"opacity\", \"x\", \"y\", \"scale\"] as const) {\n const next = target[key];\n if (next === undefined || next === values[key].get()) { continue; }\n if (immediate) { values[key].jump(next); continue; }\n const animation = animateValue(values[key], next, timing);\n animation.speed = 1 / tempo;\n playback.push(animation);\n }\n running.current = playback;\n if (playback.length) {\n void Promise.all(playback).then(() => {\n if (!active) { return; }\n running.current = [];\n complete();\n if (!present) { safeToRemove(); }\n });\n } else if (!present) {\n safeToRemove();\n }\n return () => {\n active = false;\n for (const animation of playback) { animation.stop(); }\n running.current = [];\n };\n }, [present, hasExit, safeToRemove, values, opacity, x, y, scale, exitOpacity, exitX, exitY, exitScale]);\n useLayoutEffect(() => {\n for (const animation of running.current) {\n if (policy.immediate) { animation.complete(); }\n else { animation.speed = 1 / policy.tempo; }\n }\n }, [policy.immediate, policy.tempo]);\n return <motion.div\n {...props}\n ref={node}\n style={{ ...style, ...values } as MotionStyle}\n inert={!present || inert || undefined}\n aria-hidden={!present ? true : ariaHidden}\n data-motion-present={present ? \"true\" : \"false\"}\n layout={policy.immediate ? false : layout}\n {...(layoutScroll === undefined ? {} : { layoutScroll })}\n {...(layoutRoot === undefined ? {} : { layoutRoot })}\n // Motion 14 can retain an in-flight projection after layout is disabled.\n // Suppress only that projection; MotionValues still own the base transform.\n {...(policy.immediate ? { transformTemplate: () => {\n return x === 0 && y === 0 && scale === 1 ? \"none\" : `translate(${x}px, ${y}px) scale(${scale})`;\n } } : {})}\n {...(layoutId === undefined ? {} : { layoutId })}\n initial={policy.immediate ? false : (enter ?? false)}\n transition={resolveTransition(transition ?? policy.transition, theme, policy.tempo, policy.immediate)}\n />;\n};\n", "import { validateTransition } from \"../motion-config/validate-transition\";\nimport { readMotionDuration } from \"./dom-policy\";\nimport type { Transition } from \"motion/react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\n\nexport type ThemeTransition = { duration: number; ease: MotionEase };\nexport const fallbackTransition: ThemeTransition = { duration: 180, ease: [0.2, 0.8, 0.2, 1] };\n\nexport const readThemeTransition = (element: HTMLElement): ThemeTransition => {\n const style = getComputedStyle(element);\n const duration = readMotionDuration(element);\n const rawEase = style.getPropertyValue(\"--gridui-motion-ease-out\").trim();\n const values = /^cubic-bezier\\(([^)]+)\\)$/.exec(rawEase)?.[1]?.split(\",\").map(Number);\n let ease = fallbackTransition.ease;\n if (values?.length === 4 && values.every(Number.isFinite)\n && values[0]! >= 0 && values[0]! <= 1 && values[2]! >= 0 && values[2]! <= 1) {\n ease = [values[0]!, values[1]!, values[2]!, values[3]!];\n } else if (rawEase === \"linear\") {\n ease = \"linear\";\n } else if (rawEase === \"ease-in\") {\n ease = \"easeIn\";\n } else if (rawEase === \"ease-out\") {\n ease = \"easeOut\";\n } else if (rawEase === \"ease-in-out\") {\n ease = \"easeInOut\";\n }\n return { duration, ease };\n};\n\nexport const resolveTransition = (\n transition: MotionTransition | undefined, theme: ThemeTransition, tempo: number, immediate: boolean,\n): Transition => {\n if (transition) {validateTransition(transition);}\n if (immediate) {return { type: \"tween\", duration: 0 };}\n if (transition?.type === \"spring\") {\n return {\n type: \"spring\",\n stiffness: (transition.stiffness ?? 170) / (tempo * tempo),\n damping: (transition.damping ?? 26) / tempo,\n mass: transition.mass ?? 1,\n };\n }\n return {\n type: \"tween\",\n duration: (transition?.duration ?? theme.duration) * tempo / 1000,\n ease: transition?.ease ?? theme.ease,\n };\n};\n", "import { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { useMotionStyle } from \"../shared/use-motion-style\";\n\nexport type MotionScopeProps = ComponentPropsWithRef<\"div\"> & { readonly asChild?: boolean };\n\n/** CSS policy boundary. asChild preserves the child's DOM, ref, and semantics. */\nexport const MotionScope = ({ asChild = false, style, ...props }: MotionScopeProps) => {\n const motionStyle = useMotionStyle(style);\n const Component = asChild ? Slot : \"div\";\n return <Component {...props} style={motionStyle} />;\n};\n", "import { LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useId } from \"react\";\nimport { LayoutGroupContext } from \"./context\";\n\nexport type MotionLayoutGroupProps = { readonly children: ReactNode };\n\n/** Deliberately share layout identities across nested Presence boundaries. No DOM. */\nexport const MotionLayoutGroup = ({ children }: MotionLayoutGroupProps) => {\n const id = useId();\n return <LayoutGroupContext.Provider value={true}>\n <LayoutGroup id={id}>{children}</LayoutGroup>\n </LayoutGroupContext.Provider>;\n};\n", "import { useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSpringValue, type SpringValue, type SpringValueOptions } from \"./controller\";\n\n/** Initial value is captured once. Subscriptions update DOM without React frame renders. */\nexport const useSpringValue = (initial: number, options?: SpringValueOptions): SpringValue => {\n const policy = useMotionPolicy();\n const { tempo, immediate } = policy;\n const [controller] = useState(() => createSpringValue(initial));\n const spring: SpringValueOptions | undefined = options ?? (policy.transition?.type === \"spring\" ? policy.transition : undefined);\n const { stiffness, damping, mass, precision } = spring ?? {};\n useLayoutEffect(() => {\n controller.configure({ ...(stiffness === undefined ? {} : { stiffness }),\n ...(damping === undefined ? {} : { damping }), ...(mass === undefined ? {} : { mass }), ...(precision === undefined ? {} : { precision }) }, { tempo, immediate });\n }, [controller, stiffness, damping, mass, precision, tempo, immediate]);\n useLayoutEffect(() => () => void controller.stop(), [controller]);\n return controller;\n};\n", "import { animate, motionValue, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport type { MotionOutcome } from \"../shared/outcome\";\n\nexport type SpringValueOptions = Omit<Extract<MotionTransition, { type: \"spring\" }>, \"type\"> & {\n /** Rest distance and speed tolerance in value units and units per second. */\n readonly precision?: number;\n};\nexport type SpringValuePolicy = { readonly tempo: number; readonly immediate: boolean };\nexport type SpringValue = {\n readonly get: () => number;\n /** Units per real second, independent of tempo. */\n readonly getVelocity: () => number;\n readonly set: (target: number, velocity?: number) => Promise<MotionOutcome>;\n readonly jump: (target: number) => void;\n readonly stop: () => void;\n readonly subscribe: (changed: (value: number) => void) => () => void;\n};\nexport type SpringValueController = SpringValue & {\n readonly configure: (options: SpringValueOptions, policy: SpringValuePolicy) => void;\n readonly dispose: () => void;\n};\nconst finite = (value: number): void => {\n if (!Number.isFinite(value)) { throw new RangeError(\"Spring values and velocities must be finite.\"); }\n};\n\nexport const createSpringValue = (initial: number, initialOptions: SpringValueOptions = {},\n initialPolicy: SpringValuePolicy = { tempo: 1, immediate: false }): SpringValueController => {\n finite(initial);\n const value = motionValue(initial);\n let disposed = false;\n const assertActive = () => {\n if (disposed) { throw new Error(\"Cannot use a disposed spring value.\"); }\n };\n let options: SpringValueOptions = {};\n let tempo = 1;\n let immediate = true;\n let target = initial;\n let pending: Promise<MotionOutcome> | undefined;\n let run: { animation: AnimationPlaybackControlsWithThen; initialVelocity: number; startTempo: number; resolve: (result: MotionOutcome) => void } | undefined;\n // Before the first engine sample, MotionValue has no velocity history.\n const getVelocity = () => !run ? 0 : run.animation.time === 0\n ? run.initialVelocity * run.startTempo / tempo : value.getVelocity();\n const stop = () => {\n const previous = run;\n run = undefined;\n previous?.animation.stop();\n previous?.resolve(\"cancelled\");\n };\n const jump = (next: number) => {\n assertActive();\n finite(next);\n stop();\n target = next;\n value.jump(next);\n };\n const api: SpringValue = {\n get: () => value.get(),\n getVelocity,\n subscribe: changed => { assertActive(); return value.on(\"change\", changed); },\n stop, jump,\n set: (next, velocity) => {\n assertActive();\n finite(next);\n if (run && next === target && velocity === undefined) { return pending!; }\n const releaseVelocity = velocity ?? getVelocity();\n finite(releaseVelocity);\n stop();\n target = next;\n if (immediate || (value.get() === next && releaseVelocity === 0)) {\n value.jump(next);\n return Promise.resolve(\"finished\");\n }\n const { precision, ...spring } = options;\n const animation = animate(value, next, { type: \"spring\", stiffness: 170, damping: 26, mass: 1,\n ...spring, velocity: releaseVelocity * tempo,\n ...(precision === undefined ? {} : { restDelta: precision, restSpeed: precision * tempo }) });\n animation.speed = 1 / tempo;\n pending = new Promise<MotionOutcome>(resolve => {\n const current = { animation, initialVelocity: releaseVelocity, startTempo: tempo, resolve };\n run = current;\n void animation.then(() => {\n if (run !== current) { return; }\n run = undefined;\n resolve(\"finished\");\n });\n });\n return pending;\n },\n };\n const configure = (next: SpringValueOptions, policy: SpringValuePolicy) => {\n assertActive();\n validateTransition({ type: \"spring\", ...next });\n if (!Number.isFinite(policy.tempo) || policy.tempo <= 0\n || (next.precision !== undefined && (!Number.isFinite(next.precision) || next.precision <= 0))) {\n throw new RangeError(\"Spring tempo and precision must be finite and positive.\");\n }\n options = next;\n tempo = policy.tempo;\n immediate = policy.immediate;\n if (run) {\n if (immediate) {\n const previous = run;\n run = undefined;\n previous.animation.stop();\n value.jump(target);\n previous.resolve(\"finished\");\n } else { run.animation.speed = 1 / tempo; }\n }\n };\n configure(initialOptions, initialPolicy);\n return { ...api, configure, dispose: () => {\n if (disposed) { return; }\n disposed = true;\n stop();\n value.destroy();\n } };\n};\n", "import { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useLayoutEffect, useRef } from \"react\";\nimport { useSpringValue } from \"../spring-value/use-spring-value\";\nimport type { SpringValueOptions } from \"../spring-value/controller\";\n\nexport type MotionSizeProps = Omit<ComponentPropsWithRef<\"div\">, \"style\"> & {\n readonly style?: Omit<CSSProperties, \"height\" | \"overflow\" | \"overflowY\">;\n readonly spring?: SpringValueOptions;\n};\n\n/** Animate intrinsic content height. Width and content semantics stay with the caller. */\nexport const MotionSize = ({ children, spring, ref, style, ...props }: MotionSizeProps) => {\n const outer = useRef<HTMLDivElement>(null);\n const inner = useRef<HTMLDivElement>(null);\n const height = useSpringValue(0, spring);\n useImperativeHandle(ref, () => outer.current!, []);\n useLayoutEffect(() => {\n const node = outer.current!;\n const content = inner.current!;\n let revision = 0;\n height.jump(content.offsetHeight);\n let requested = height.get();\n const unsubscribe = height.subscribe(value => { node.style.height = `${Math.max(0, value)}px`; });\n const observer = new ResizeObserver(([entry]) => {\n const target = entry?.borderBoxSize[0]?.blockSize ?? content.offsetHeight;\n if (target === requested) { return; }\n requested = target;\n const run = ++revision;\n node.style.height = `${height.get()}px`;\n node.style.overflow = \"clip\";\n void height.set(target).then(result => {\n if (result === \"finished\" && run === revision) { node.style.height = \"auto\"; node.style.removeProperty(\"overflow\"); }\n });\n });\n observer.observe(content);\n return () => { revision++; observer.disconnect(); unsubscribe(); height.stop(); node.style.removeProperty(\"height\"); node.style.removeProperty(\"overflow\"); };\n }, [height]);\n return <div {...props} ref={outer} style={style}>\n <div ref={inner} style={{ display: \"flow-root\" }}>{children}</div>\n </div>;\n};\n", "import { type RefObject, useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSequenceController, type MotionSequence } from \"./controller\";\n\n/** Explicit element targets within one mounted scope. This hook owns their animated styles. */\nexport const useMotionSequence = (scope: RefObject<HTMLElement | null>): MotionSequence => {\n const { tempo, immediate, transition } = useMotionPolicy();\n const [controller] = useState(() => createSequenceController(scope));\n useLayoutEffect(() => void controller.configure({ tempo, immediate, transition }), [controller, tempo, immediate, transition]);\n useLayoutEffect(() => () => void controller.dispose(), [controller]);\n return controller.api;\n};\n", "import type { RefObject } from \"react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\nimport type { MotionOutcome } from \"../shared/outcome\";\nimport type { MotionState } from \"../shared/state\";\nimport { readThemeTransition } from \"../shared/resolve-transition\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\n\nexport type MotionStep = {\n readonly element: HTMLElement;\n readonly from?: MotionState;\n readonly to: MotionState;\n readonly duration?: number;\n readonly ease?: MotionEase;\n};\nexport type MotionSequenceOptions = {\n readonly order?: \"sequence\" | \"parallel\";\n /** Milliseconds between starts in parallel, or between steps in sequence. */\n readonly stagger?: number;\n};\nexport type MotionRun = {\n readonly finished: Promise<MotionOutcome>;\n readonly cancel: () => void;\n readonly finish: () => void;\n};\nexport type MotionSequence = {\n readonly play: (steps: readonly MotionStep[], options?: MotionSequenceOptions) => MotionRun;\n};\ntype Policy = { tempo: number; immediate: boolean; transition: MotionTransition | undefined };\ntype Property = \"opacity\" | \"transform\";\nconst frames = (state: MotionState): Partial<Record<Property, string>> => ({\n ...(state.opacity === undefined ? {} : { opacity: String(state.opacity) }),\n ...(state.x === undefined && state.y === undefined && state.scale === undefined ? {} : {\n transform: `translate(${state.x ?? 0}px, ${state.y ?? 0}px) scale(${state.scale ?? 1})`,\n }),\n});\nconst easing = (ease: MotionEase): string => Array.isArray(ease) ? `cubic-bezier(${ease.join(\",\")})`\n : ({ linear: \"linear\", easeIn: \"ease-in\", easeOut: \"ease-out\", easeInOut: \"ease-in-out\" })[ease];\n\nexport const createSequenceController = (scope: RefObject<HTMLElement | null>) => {\n let policy: Policy = { tempo: 1, immediate: true, transition: undefined };\n let active: { run: MotionRun; animations: Animation[] } | undefined;\n const originals = new Map<HTMLElement, Map<Property, { value: string; priority: string }>>();\n const play: MotionSequence[\"play\"] = (steps, options = {}) => {\n const stagger = options.stagger ?? 0;\n if (!Number.isFinite(stagger) || stagger < 0) { throw new RangeError(\"Stagger must be finite and nonnegative.\"); }\n const root = scope.current;\n let offset = 0;\n const previous = new Map<HTMLElement, Map<Property, { end: number; value: string }>>();\n const plan = steps.map((step, index) => {\n if (!root?.contains(step.element)) { throw new RangeError(\"Sequence targets must belong to the mounted scope.\"); }\n const theme = readThemeTransition(step.element);\n const base = policy.transition?.type === \"spring\" ? undefined : policy.transition;\n const duration = step.duration ?? base?.duration ?? theme.duration;\n const ease = step.ease ?? base?.ease ?? theme.ease;\n validateTransition({ duration, ease });\n const to = frames(step.to);\n const requestedFrom = step.from ? frames(step.from) : {};\n const from: Partial<Record<Property, string>> = {};\n const delay = options.order === \"parallel\" ? index * stagger : offset;\n offset += duration + stagger;\n const properties = previous.get(step.element) ?? new Map();\n const backwards = (Object.keys(to) as Property[]).every(property => !properties.has(property));\n for (const property of Object.keys(to) as Property[]) {\n const last = properties.get(property);\n if (last && delay < last.end) { throw new RangeError(\"Parallel steps cannot own the same element property at the same time.\"); }\n const start = requestedFrom[property] ?? last?.value;\n if (start !== undefined) { from[property] = start; }\n properties.set(property, { end: delay + duration, value: to[property]! });\n }\n previous.set(step.element, properties);\n return { element: step.element, to, from, duration, ease: easing(ease), delay, backwards };\n });\n active?.run.cancel();\n let resolve!: (result: MotionOutcome) => void;\n const finished = new Promise<MotionOutcome>(done => { resolve = done; });\n const animations: Animation[] = [];\n let settled = false;\n const settle = (result: MotionOutcome) => {\n if (settled) { return; }\n settled = true;\n if (result === \"finished\") {\n for (const step of plan) {\n for (const property of Object.keys(step.to) as Property[]) {\n step.element.style.setProperty(property, step.to[property]!);\n }\n }\n } else {\n // Freeze only properties this scope owns before cancelling WAAPI fills.\n const current = new Map<HTMLElement, Partial<Record<Property, string>>>();\n for (const step of plan) {\n const style = step.element.ownerDocument.defaultView!.getComputedStyle(step.element);\n const values = current.get(step.element) ?? {};\n for (const property of Object.keys(step.to) as Property[]) { values[property] = style.getPropertyValue(property); }\n current.set(step.element, values);\n }\n for (const [element, values] of current) {\n for (const property of Object.keys(values) as Property[]) { element.style.setProperty(property, values[property]!); }\n }\n }\n for (const animation of animations) { animation.cancel(); }\n if (active?.run === run) { active = undefined; }\n resolve(result);\n };\n const run: MotionRun = { finished, cancel: () => void settle(\"cancelled\"), finish: () => void settle(\"finished\") };\n active = { run, animations };\n try {\n for (const step of plan) {\n const saved = originals.get(step.element) ?? new Map();\n for (const property of Object.keys(step.to) as Property[]) {\n if (!saved.has(property)) { saved.set(property, { value: step.element.style.getPropertyValue(property), priority: step.element.style.getPropertyPriority(property) }); }\n }\n originals.set(step.element, saved);\n if (policy.immediate) { continue; }\n // Later steps must not cover earlier steps during their delay.\n const animation = step.element.animate([step.from, step.to], {\n duration: step.duration, delay: step.delay, easing: step.ease, fill: step.backwards ? \"both\" : \"forwards\",\n });\n animation.playbackRate = 1 / policy.tempo;\n animations.push(animation);\n }\n void Promise.all(animations.map(animation => animation.finished)).then(() => void run.finish(), () => void run.cancel());\n if (policy.immediate || !plan.length) { run.finish(); }\n } catch (error) {\n run.cancel();\n throw error;\n }\n return run;\n };\n return {\n api: { play },\n configure: (next: Policy) => {\n policy = next;\n if (next.immediate) { active?.run.finish(); }\n else { for (const animation of active?.animations ?? []) { animation.updatePlaybackRate(1 / next.tempo); } }\n },\n dispose: () => {\n active?.run.cancel();\n for (const [element, properties] of originals) {\n for (const [property, original] of properties) { element.style.setProperty(property, original.value, original.priority); }\n }\n originals.clear();\n },\n };\n};\n", "import { type RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\";\nimport { LayoutMotion, type LayoutMotionProps } from \"../layout-motion/layout-motion\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type MotionRevealProps = Omit<LayoutMotionProps, \"animate\" | \"exit\" | \"layout\" | \"layoutId\" | \"layoutScroll\" | \"layoutRoot\"> & {\n readonly once?: boolean;\n readonly amount?: number;\n readonly root?: Element | null;\n readonly rootMargin?: string;\n};\n\n/** Offscreen decoration only. Initial visible content and keyboard access stay usable. */\nexport const MotionReveal = ({ once = true, amount = 0, root = null, rootMargin = \"0px\",\n enter = { opacity: 0, y: 12 }, transition, ref, onFocusCapture, ...props }: MotionRevealProps) => {\n if (!Number.isFinite(amount) || amount < 0 || amount > 1) { throw new RangeError(\"Reveal amount must be between zero and one.\"); }\n const node: RefObject<HTMLDivElement | null> = useRef(null);\n const seen = useRef(false);\n const [visible, setVisible] = useState<boolean | null>(null);\n const [focused, setFocused] = useState(false);\n const { immediate } = useMotionPolicy();\n useImperativeHandle(ref, () => node.current!, []);\n useEffect(() => {\n const element = node.current!;\n const Observer = element.ownerDocument.defaultView!.IntersectionObserver;\n if (immediate || focused || (once && seen.current)) { return; }\n const observer = new Observer(([entry]) => {\n if (!entry) { return; }\n const inside = entry.isIntersecting && entry.intersectionRatio >= amount;\n setVisible(inside);\n if (inside) {\n seen.current = true;\n if (once) { observer.disconnect(); }\n }\n }, { root, rootMargin, threshold: amount });\n observer.observe(element);\n return () => void observer.disconnect();\n }, [immediate, focused, once, amount, root, rootMargin]);\n const show = immediate || focused || visible !== false;\n return <LayoutMotion {...props} ref={node} layout={false}\n animate={show ? { opacity: 1, x: 0, y: 0, scale: 1 } : enter}\n {...((!show || focused) ? { transition: { duration: 0 } } : transition ? { transition } : {})}\n onFocusCapture={event => { setFocused(true); onFocusCapture?.(event); }} />;\n};\n"],
5
- "mappings": ";;;;;;;;;;AAAA,SAAS,YAAY,eAAe;;;ACE7B,IAAM,qBAAqB,CAAC,eAAuC;AACtE,MAAI,WAAW,SAAS,UAAU;AAC9B,eAAW,SAAS,CAAC,WAAW,WAAW,WAAW,SAAS,WAAW,IAAI,GAAG;AAC7E,UAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,cAAM,IAAI,WAAW,uDAAuD;AAAA,MAChF;AAAA,IACJ;AAAA,EACJ,WAAW,WAAW,aAAa,WAAc,CAAC,OAAO,SAAS,WAAW,QAAQ,KAAK,WAAW,WAAW,IAAI;AAChH,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACJ;;;ADKW;AAZJ,IAAM,eAAe,CAAC,EAAE,UAAU,OAAO,eAAe,UAAU,WAAW,MAAyB;AACzG,QAAM,SAAS,WAAW,aAAa;AACvC,MAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACA,MAAI,YAAY;AAAC,uBAAmB,UAAU;AAAA,EAAE;AAChD,QAAM,QAAQ,QAAQ,OAAO;AAAA,IACzB,OAAO,SAAS,OAAO;AAAA,IACvB,eAAe,OAAO,kBAAkB,WAAW,WAAW,iBAAiB,OAAO;AAAA,IACtF,UAAU,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a,WAAY,QAAQ,KAAK,SAAU;AAAE;AAAA,IAAQ;AAC9D,UAAM,WAAW,IAAI,SAAS,CAAC,CAAC,KAAK,MAAM;AACvC,UAAI,CAAC,OAAO;AAAE;AAAA,MAAQ;AACtB,YAAM,SAAS,MAAM,kBAAkB,MAAM,qBAAqB;AAClE,iBAAW,MAAM;AACjB,UAAI,QAAQ;AACR,aAAK,UAAU;AACf,YAAI,MAAM;AAAE,mBAAS,WAAW;AAAA,QAAG;AAAA,MACvC;AAAA,IACJ,GAAG,EAAE,MAAM,YAAY,WAAW,OAAO,CAAC;AAC1C,aAAS,QAAQ,OAAO;AACxB,WAAO,MAAM,KAAK,SAAS,WAAW;AAAA,EAC1C,GAAG,CAAC,WAAW,SAAS,MAAM,QAAQ,MAAM,UAAU,CAAC;AACvD,QAAM,OAAO,aAAa,WAAW,YAAY;AACjD,SAAO,gBAAAJ;AAAA,IAAC;AAAA;AAAA,MAAc,GAAG;AAAA,MAAO,KAAK;AAAA,MAAM,QAAQ;AAAA,MAC/C,SAAS,OAAO,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI;AAAA,MACtD,GAAK,CAAC,QAAQ,UAAW,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,aAAa,EAAE,WAAW,IAAI,CAAC;AAAA,MAC3F,gBAAgB,WAAS;AAAE,mBAAW,IAAI;AAAG,yBAAiB,KAAK;AAAA,MAAG;AAAA;AAAA,EAAG;AACjF;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Motion Config\n */\n\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \"./context\";\nimport type { MotionConfigProps } from \"./types\";\nimport { validateTransition } from \"./validate-transition\";\n\nexport const MotionConfig = ({ children, tempo, reducedMotion, disabled, transition }: MotionConfigProps) => {\n const parent = useContext(MotionContext);\n if (tempo !== undefined && (!Number.isFinite(tempo) || tempo <= 0)) {\n throw new RangeError(\"MotionConfig tempo must be finite and positive.\");\n }\n if (transition) {validateTransition(transition);}\n const value = useMemo(() => ({\n tempo: tempo ?? parent.tempo,\n reducedMotion: parent.reducedMotion === \"always\" ? \"always\" : reducedMotion ?? parent.reducedMotion,\n disabled: parent.disabled || disabled === true,\n transition: transition ?? parent.transition,\n }), [parent, tempo, reducedMotion, disabled, transition]);\n return <MotionContext.Provider value={value}>{children}</MotionContext.Provider>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Validate Transition\n */\n\nimport type { MotionTransition } from \"./types\";\n\nexport const validateTransition = (transition: MotionTransition): void => {\n if (transition.type === \"spring\") {\n for (const value of [transition.stiffness, transition.damping, transition.mass]) {\n if (value !== undefined && (!Number.isFinite(value) || value <= 0)) {\n throw new RangeError(\"Motion spring parameters must be finite and positive.\");\n }\n }\n } else if (transition.duration !== undefined && (!Number.isFinite(transition.duration) || transition.duration < 0)) {\n throw new RangeError(\"Motion duration must be finite and nonnegative.\");\n }\n};\n\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport const LayoutGroupContext = createContext(false);\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Presence\n * @description Presence\n */\n\nimport { LayoutGroupContext } from \"../motion-layout-group/context\";\nimport { AnimatePresence, LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useContext, useId } from \"react\";\n\nexport type PresenceProps = {\n readonly children: ReactNode;\n readonly mode?: \"sync\" | \"wait\" | \"popLayout\";\n readonly initial?: boolean;\n readonly onExitComplete?: () => void;\n};\n\n/** Keep this boundary mounted. Direct children need stable keys and forwarded refs for popLayout. */\nexport const Presence = ({ children, mode = \"sync\", initial = false, onExitComplete }: PresenceProps) => {\n const id = useId();\n const grouped = useContext(LayoutGroupContext);\n const presence = <AnimatePresence mode={mode} initial={initial} {...(onExitComplete ? { onExitComplete } : {})}>\n {children}\n </AnimatePresence>;\n return grouped ? presence : <LayoutGroup id={id}>{presence}</LayoutGroup>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace LayoutMotion\n * @description Layout Motion\n */\n\nimport type { MotionState } from \"../shared/state\";\nimport { animate as animateValue, motion, useMotionValue, usePresence, type MotionStyle, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { fallbackTransition, readThemeTransition, resolveTransition } from \"../shared/resolve-transition\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type LayoutMotionProps = Omit<ComponentPropsWithRef<\"div\">,\n \"onAnimationStart\" | \"onDrag\" | \"onDragStart\" | \"onDragEnd\" | \"style\"> & {\n readonly style?: Omit<CSSProperties, \"transform\" | \"opacity\" | \"scale\" | \"translate\" | \"rotate\">;\n readonly layout?: boolean | \"position\" | \"size\";\n readonly layoutId?: string;\n /** Mark the scrolling element used by descendant layout measurements. */\n readonly layoutScroll?: boolean;\n /** Mark a fixed-position root used by descendant layout measurements. */\n readonly layoutRoot?: boolean;\n readonly enter?: MotionState;\n readonly animate?: MotionState;\n readonly exit?: MotionState;\n readonly transition?: MotionTransition;\n readonly exitTransition?: MotionTransition;\n readonly onAnimationComplete?: () => void;\n readonly onLayoutAnimationComplete?: () => void;\n};\n\nexport const LayoutMotion = ({\n layout = true, layoutId, layoutScroll, layoutRoot, enter, animate, exit,\n transition, exitTransition, ref, inert, style, onAnimationComplete,\n \"aria-hidden\": ariaHidden, ...props\n}: LayoutMotionProps) => {\n const policy = useMotionPolicy();\n const [present, safeToRemove] = usePresence();\n const node = useRef<HTMLDivElement>(null);\n const running = useRef<AnimationPlaybackControlsWithThen[]>([]);\n const [theme, setTheme] = useState(fallbackTransition);\n useImperativeHandle(ref, () => node.current!, []);\n useLayoutEffect(() => {\n const next = readThemeTransition(node.current!);\n setTheme(previous => next.duration === previous.duration && String(next.ease) === String(previous.ease)\n ? previous : next);\n }, [style, props.className, policy.transition, transition]);\n const opacity = animate?.opacity ?? 1;\n const x = animate?.x ?? 0;\n const y = animate?.y ?? 0;\n const scale = animate?.scale ?? 1;\n const opacityValue = useMotionValue(opacity);\n const xValue = useMotionValue(x);\n const yValue = useMotionValue(y);\n const scaleValue = useMotionValue(scale);\n const values = useMemo(() => ({ opacity: opacityValue, x: xValue, y: yValue, scale: scaleValue }),\n [opacityValue, xValue, yValue, scaleValue]);\n const exitOpacity = exit?.opacity;\n const exitX = exit?.x;\n const exitY = exit?.y;\n const exitScale = exit?.scale;\n const hasExit = exit !== undefined;\n // Timing is captured at each target change. Tempo changes update playback speed\n // independently, so a live configuration update never replays an entrance.\n const settings = useEffectEvent(() => ({\n timing: resolveTransition((!present ? exitTransition : undefined) ?? transition ?? policy.transition,\n readThemeTransition(node.current!), 1, policy.immediate),\n immediate: policy.immediate,\n tempo: policy.tempo,\n }));\n const complete = useEffectEvent(() => onAnimationComplete?.());\n useEffect(() => {\n const { timing, immediate, tempo } = settings();\n const target = present ? { opacity, x, y, scale } : {\n opacity: exitOpacity, x: exitX, y: exitY, scale: exitScale,\n };\n let active = true;\n const playback: AnimationPlaybackControlsWithThen[] = [];\n for (const key of [\"opacity\", \"x\", \"y\", \"scale\"] as const) {\n const next = target[key];\n if (next === undefined || next === values[key].get()) { continue; }\n if (immediate) { values[key].jump(next); continue; }\n const animation = animateValue(values[key], next, timing);\n animation.speed = 1 / tempo;\n playback.push(animation);\n }\n running.current = playback;\n if (playback.length) {\n void Promise.all(playback).then(() => {\n if (!active) { return; }\n running.current = [];\n complete();\n if (!present) { safeToRemove(); }\n });\n } else if (!present) {\n safeToRemove();\n }\n return () => {\n active = false;\n for (const animation of playback) { animation.stop(); }\n running.current = [];\n };\n }, [present, hasExit, safeToRemove, values, opacity, x, y, scale, exitOpacity, exitX, exitY, exitScale]);\n useLayoutEffect(() => {\n for (const animation of running.current) {\n if (policy.immediate) { animation.complete(); }\n else { animation.speed = 1 / policy.tempo; }\n }\n }, [policy.immediate, policy.tempo]);\n return <motion.div\n {...props}\n ref={node}\n style={{ ...style, ...values } as MotionStyle}\n inert={!present || inert || undefined}\n aria-hidden={!present ? true : ariaHidden}\n data-motion-present={present ? \"true\" : \"false\"}\n layout={policy.immediate ? false : layout}\n {...(layoutScroll === undefined ? {} : { layoutScroll })}\n {...(layoutRoot === undefined ? {} : { layoutRoot })}\n // Motion 14 can retain an in-flight projection after layout is disabled.\n // Suppress only that projection; MotionValues still own the base transform.\n {...(policy.immediate ? { transformTemplate: () => {\n return x === 0 && y === 0 && scale === 1 ? \"none\" : `translate(${x}px, ${y}px) scale(${scale})`;\n } } : {})}\n {...(layoutId === undefined ? {} : { layoutId })}\n initial={policy.immediate ? false : (enter ?? false)}\n transition={resolveTransition(transition ?? policy.transition, theme, policy.tempo, policy.immediate)}\n />;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Resolve Transition\n */\n\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport { readMotionDuration } from \"./dom-policy\";\nimport type { Transition } from \"motion/react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\n\nexport type ThemeTransition = { duration: number; ease: MotionEase };\nexport const fallbackTransition: ThemeTransition = { duration: 180, ease: [0.2, 0.8, 0.2, 1] };\n\nexport const readThemeTransition = (element: HTMLElement): ThemeTransition => {\n const style = getComputedStyle(element);\n const duration = readMotionDuration(element);\n const rawEase = style.getPropertyValue(\"--gridui-motion-ease-out\").trim();\n const values = /^cubic-bezier\\(([^)]+)\\)$/.exec(rawEase)?.[1]?.split(\",\").map(Number);\n let ease = fallbackTransition.ease;\n if (values?.length === 4 && values.every(Number.isFinite)\n && values[0]! >= 0 && values[0]! <= 1 && values[2]! >= 0 && values[2]! <= 1) {\n ease = [values[0]!, values[1]!, values[2]!, values[3]!];\n } else if (rawEase === \"linear\") {\n ease = \"linear\";\n } else if (rawEase === \"ease-in\") {\n ease = \"easeIn\";\n } else if (rawEase === \"ease-out\") {\n ease = \"easeOut\";\n } else if (rawEase === \"ease-in-out\") {\n ease = \"easeInOut\";\n }\n return { duration, ease };\n};\n\nexport const resolveTransition = (\n transition: MotionTransition | undefined, theme: ThemeTransition, tempo: number, immediate: boolean,\n): Transition => {\n if (transition) {validateTransition(transition);}\n if (immediate) {return { type: \"tween\", duration: 0 };}\n if (transition?.type === \"spring\") {\n return {\n type: \"spring\",\n stiffness: (transition.stiffness ?? 170) / (tempo * tempo),\n damping: (transition.damping ?? 26) / tempo,\n mass: transition.mass ?? 1,\n };\n }\n return {\n type: \"tween\",\n duration: (transition?.duration ?? theme.duration) * tempo / 1000,\n ease: transition?.ease ?? theme.ease,\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionScope\n * @description Motion Scope\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { useMotionStyle } from \"../shared/use-motion-style\";\n\nexport type MotionScopeProps = ComponentPropsWithRef<\"div\"> & { readonly asChild?: boolean };\n\n/** CSS policy boundary. asChild preserves the child's DOM, ref, and semantics. */\nexport const MotionScope = ({ asChild = false, style, ...props }: MotionScopeProps) => {\n const motionStyle = useMotionStyle(style);\n const Component = asChild ? Slot : \"div\";\n return <Component {...props} style={motionStyle} />;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Motion Layout Group\n */\n\nimport { LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useId } from \"react\";\nimport { LayoutGroupContext } from \"./context\";\n\nexport type MotionLayoutGroupProps = { readonly children: ReactNode };\n\n/** Deliberately share layout identities across nested Presence boundaries. No DOM. */\nexport const MotionLayoutGroup = ({ children }: MotionLayoutGroupProps) => {\n const id = useId();\n return <LayoutGroupContext.Provider value={true}>\n <LayoutGroup id={id}>{children}</LayoutGroup>\n </LayoutGroupContext.Provider>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Use Spring Value\n */\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSpringValue, type SpringValue, type SpringValueOptions } from \"./controller\";\n\n/** Initial value is captured once. Subscriptions update DOM without React frame renders. */\nexport const useSpringValue = (initial: number, options?: SpringValueOptions): SpringValue => {\n const policy = useMotionPolicy();\n const { tempo, immediate } = policy;\n const [controller] = useState(() => createSpringValue(initial));\n const spring: SpringValueOptions | undefined = options ?? (policy.transition?.type === \"spring\" ? policy.transition : undefined);\n const { stiffness, damping, mass, precision } = spring ?? {};\n useLayoutEffect(() => {\n controller.configure({ ...(stiffness === undefined ? {} : { stiffness }),\n ...(damping === undefined ? {} : { damping }), ...(mass === undefined ? {} : { mass }), ...(precision === undefined ? {} : { precision }) }, { tempo, immediate });\n }, [controller, stiffness, damping, mass, precision, tempo, immediate]);\n useLayoutEffect(() => () => void controller.stop(), [controller]);\n return controller;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Controller\n */\n\nimport { animate, motionValue, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport type { MotionOutcome } from \"../shared/outcome\";\n\nexport type SpringValueOptions = Omit<Extract<MotionTransition, { type: \"spring\" }>, \"type\"> & {\n /** Rest distance and speed tolerance in value units and units per second. */\n readonly precision?: number;\n};\nexport type SpringValuePolicy = { readonly tempo: number; readonly immediate: boolean };\nexport type SpringValue = {\n readonly get: () => number;\n /** Units per real second, independent of tempo. */\n readonly getVelocity: () => number;\n readonly set: (target: number, velocity?: number) => Promise<MotionOutcome>;\n readonly jump: (target: number) => void;\n readonly stop: () => void;\n readonly subscribe: (changed: (value: number) => void) => () => void;\n};\nexport type SpringValueController = SpringValue & {\n readonly configure: (options: SpringValueOptions, policy: SpringValuePolicy) => void;\n readonly dispose: () => void;\n};\nconst finite = (value: number): void => {\n if (!Number.isFinite(value)) { throw new RangeError(\"Spring values and velocities must be finite.\"); }\n};\n\nexport const createSpringValue = (initial: number, initialOptions: SpringValueOptions = {},\n initialPolicy: SpringValuePolicy = { tempo: 1, immediate: false }): SpringValueController => {\n finite(initial);\n const value = motionValue(initial);\n let disposed = false;\n const assertActive = () => {\n if (disposed) { throw new Error(\"Cannot use a disposed spring value.\"); }\n };\n let options: SpringValueOptions = {};\n let tempo = 1;\n let immediate = true;\n let target = initial;\n let pending: Promise<MotionOutcome> | undefined;\n let run: { animation: AnimationPlaybackControlsWithThen; initialVelocity: number; startTempo: number; resolve: (result: MotionOutcome) => void } | undefined;\n // Before the first engine sample, MotionValue has no velocity history.\n const getVelocity = () => !run ? 0 : run.animation.time === 0\n ? run.initialVelocity * run.startTempo / tempo : value.getVelocity();\n const stop = () => {\n const previous = run;\n run = undefined;\n previous?.animation.stop();\n previous?.resolve(\"cancelled\");\n };\n const jump = (next: number) => {\n assertActive();\n finite(next);\n stop();\n target = next;\n value.jump(next);\n };\n const api: SpringValue = {\n get: () => value.get(),\n getVelocity,\n subscribe: changed => { assertActive(); return value.on(\"change\", changed); },\n stop, jump,\n set: (next, velocity) => {\n assertActive();\n finite(next);\n if (run && next === target && velocity === undefined) { return pending!; }\n const releaseVelocity = velocity ?? getVelocity();\n finite(releaseVelocity);\n stop();\n target = next;\n if (immediate || (value.get() === next && releaseVelocity === 0)) {\n value.jump(next);\n return Promise.resolve(\"finished\");\n }\n const { precision, ...spring } = options;\n const animation = animate(value, next, { type: \"spring\", stiffness: 170, damping: 26, mass: 1,\n ...spring, velocity: releaseVelocity * tempo,\n ...(precision === undefined ? {} : { restDelta: precision, restSpeed: precision * tempo }) });\n animation.speed = 1 / tempo;\n pending = new Promise<MotionOutcome>(resolve => {\n const current = { animation, initialVelocity: releaseVelocity, startTempo: tempo, resolve };\n run = current;\n void animation.then(() => {\n if (run !== current) { return; }\n run = undefined;\n resolve(\"finished\");\n });\n });\n return pending;\n },\n };\n const configure = (next: SpringValueOptions, policy: SpringValuePolicy) => {\n assertActive();\n validateTransition({ type: \"spring\", ...next });\n if (!Number.isFinite(policy.tempo) || policy.tempo <= 0\n || (next.precision !== undefined && (!Number.isFinite(next.precision) || next.precision <= 0))) {\n throw new RangeError(\"Spring tempo and precision must be finite and positive.\");\n }\n options = next;\n tempo = policy.tempo;\n immediate = policy.immediate;\n if (run) {\n if (immediate) {\n const previous = run;\n run = undefined;\n previous.animation.stop();\n value.jump(target);\n previous.resolve(\"finished\");\n } else { run.animation.speed = 1 / tempo; }\n }\n };\n configure(initialOptions, initialPolicy);\n return { ...api, configure, dispose: () => {\n if (disposed) { return; }\n disposed = true;\n stop();\n value.destroy();\n } };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSize\n * @description Motion Size\n */\n\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useLayoutEffect, useRef } from \"react\";\nimport { useSpringValue } from \"../spring-value/use-spring-value\";\nimport type { SpringValueOptions } from \"../spring-value/controller\";\n\nexport type MotionSizeProps = Omit<ComponentPropsWithRef<\"div\">, \"style\"> & {\n readonly style?: Omit<CSSProperties, \"height\" | \"overflow\" | \"overflowY\">;\n readonly spring?: SpringValueOptions;\n};\n\n/** Animate intrinsic content height. Width and content semantics stay with the caller. */\nexport const MotionSize = ({ children, spring, ref, style, ...props }: MotionSizeProps) => {\n const outer = useRef<HTMLDivElement>(null);\n const inner = useRef<HTMLDivElement>(null);\n const height = useSpringValue(0, spring);\n useImperativeHandle(ref, () => outer.current!, []);\n useLayoutEffect(() => {\n const node = outer.current!;\n const content = inner.current!;\n let revision = 0;\n height.jump(content.offsetHeight);\n let requested = height.get();\n const unsubscribe = height.subscribe(value => { node.style.height = `${Math.max(0, value)}px`; });\n const observer = new ResizeObserver(([entry]) => {\n const target = entry?.borderBoxSize[0]?.blockSize ?? content.offsetHeight;\n if (target === requested) { return; }\n requested = target;\n const run = ++revision;\n node.style.height = `${height.get()}px`;\n node.style.overflow = \"clip\";\n void height.set(target).then(result => {\n if (result === \"finished\" && run === revision) { node.style.height = \"auto\"; node.style.removeProperty(\"overflow\"); }\n });\n });\n observer.observe(content);\n return () => { revision++; observer.disconnect(); unsubscribe(); height.stop(); node.style.removeProperty(\"height\"); node.style.removeProperty(\"overflow\"); };\n }, [height]);\n return <div {...props} ref={outer} style={style}>\n <div ref={inner} style={{ display: \"flow-root\" }}>{children}</div>\n </div>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Use Motion Sequence\n */\n\nimport { type RefObject, useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSequenceController, type MotionSequence } from \"./controller\";\n\n/** Explicit element targets within one mounted scope. This hook owns their animated styles. */\nexport const useMotionSequence = (scope: RefObject<HTMLElement | null>): MotionSequence => {\n const { tempo, immediate, transition } = useMotionPolicy();\n const [controller] = useState(() => createSequenceController(scope));\n useLayoutEffect(() => void controller.configure({ tempo, immediate, transition }), [controller, tempo, immediate, transition]);\n useLayoutEffect(() => () => void controller.dispose(), [controller]);\n return controller.api;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Controller\n */\n\nimport type { RefObject } from \"react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\nimport type { MotionOutcome } from \"../shared/outcome\";\nimport type { MotionState } from \"../shared/state\";\nimport { readThemeTransition } from \"../shared/resolve-transition\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\n\nexport type MotionStep = {\n readonly element: HTMLElement;\n readonly from?: MotionState;\n readonly to: MotionState;\n readonly duration?: number;\n readonly ease?: MotionEase;\n};\nexport type MotionSequenceOptions = {\n readonly order?: \"sequence\" | \"parallel\";\n /** Milliseconds between starts in parallel, or between steps in sequence. */\n readonly stagger?: number;\n};\nexport type MotionRun = {\n readonly finished: Promise<MotionOutcome>;\n readonly cancel: () => void;\n readonly finish: () => void;\n};\nexport type MotionSequence = {\n readonly play: (steps: readonly MotionStep[], options?: MotionSequenceOptions) => MotionRun;\n};\ntype Policy = { tempo: number; immediate: boolean; transition: MotionTransition | undefined };\ntype Property = \"opacity\" | \"transform\";\nconst frames = (state: MotionState): Partial<Record<Property, string>> => ({\n ...(state.opacity === undefined ? {} : { opacity: String(state.opacity) }),\n ...(state.x === undefined && state.y === undefined && state.scale === undefined ? {} : {\n transform: `translate(${state.x ?? 0}px, ${state.y ?? 0}px) scale(${state.scale ?? 1})`,\n }),\n});\nconst easing = (ease: MotionEase): string => Array.isArray(ease) ? `cubic-bezier(${ease.join(\",\")})`\n : ({ linear: \"linear\", easeIn: \"ease-in\", easeOut: \"ease-out\", easeInOut: \"ease-in-out\" })[ease];\n\nexport const createSequenceController = (scope: RefObject<HTMLElement | null>) => {\n let policy: Policy = { tempo: 1, immediate: true, transition: undefined };\n let active: { run: MotionRun; animations: Animation[] } | undefined;\n const originals = new Map<HTMLElement, Map<Property, { value: string; priority: string }>>();\n const play: MotionSequence[\"play\"] = (steps, options = {}) => {\n const stagger = options.stagger ?? 0;\n if (!Number.isFinite(stagger) || stagger < 0) { throw new RangeError(\"Stagger must be finite and nonnegative.\"); }\n const root = scope.current;\n let offset = 0;\n const previous = new Map<HTMLElement, Map<Property, { end: number; value: string }>>();\n const plan = steps.map((step, index) => {\n if (!root?.contains(step.element)) { throw new RangeError(\"Sequence targets must belong to the mounted scope.\"); }\n const theme = readThemeTransition(step.element);\n const base = policy.transition?.type === \"spring\" ? undefined : policy.transition;\n const duration = step.duration ?? base?.duration ?? theme.duration;\n const ease = step.ease ?? base?.ease ?? theme.ease;\n validateTransition({ duration, ease });\n const to = frames(step.to);\n const requestedFrom = step.from ? frames(step.from) : {};\n const from: Partial<Record<Property, string>> = {};\n const delay = options.order === \"parallel\" ? index * stagger : offset;\n offset += duration + stagger;\n const properties = previous.get(step.element) ?? new Map();\n const backwards = (Object.keys(to) as Property[]).every(property => !properties.has(property));\n for (const property of Object.keys(to) as Property[]) {\n const last = properties.get(property);\n if (last && delay < last.end) { throw new RangeError(\"Parallel steps cannot own the same element property at the same time.\"); }\n const start = requestedFrom[property] ?? last?.value;\n if (start !== undefined) { from[property] = start; }\n properties.set(property, { end: delay + duration, value: to[property]! });\n }\n previous.set(step.element, properties);\n return { element: step.element, to, from, duration, ease: easing(ease), delay, backwards };\n });\n active?.run.cancel();\n let resolve!: (result: MotionOutcome) => void;\n const finished = new Promise<MotionOutcome>(done => { resolve = done; });\n const animations: Animation[] = [];\n let settled = false;\n const settle = (result: MotionOutcome) => {\n if (settled) { return; }\n settled = true;\n if (result === \"finished\") {\n for (const step of plan) {\n for (const property of Object.keys(step.to) as Property[]) {\n step.element.style.setProperty(property, step.to[property]!);\n }\n }\n } else {\n // Freeze only properties this scope owns before cancelling WAAPI fills.\n const current = new Map<HTMLElement, Partial<Record<Property, string>>>();\n for (const step of plan) {\n const style = step.element.ownerDocument.defaultView!.getComputedStyle(step.element);\n const values = current.get(step.element) ?? {};\n for (const property of Object.keys(step.to) as Property[]) { values[property] = style.getPropertyValue(property); }\n current.set(step.element, values);\n }\n for (const [element, values] of current) {\n for (const property of Object.keys(values) as Property[]) { element.style.setProperty(property, values[property]!); }\n }\n }\n for (const animation of animations) { animation.cancel(); }\n if (active?.run === run) { active = undefined; }\n resolve(result);\n };\n const run: MotionRun = { finished, cancel: () => void settle(\"cancelled\"), finish: () => void settle(\"finished\") };\n active = { run, animations };\n try {\n for (const step of plan) {\n const saved = originals.get(step.element) ?? new Map();\n for (const property of Object.keys(step.to) as Property[]) {\n if (!saved.has(property)) { saved.set(property, { value: step.element.style.getPropertyValue(property), priority: step.element.style.getPropertyPriority(property) }); }\n }\n originals.set(step.element, saved);\n if (policy.immediate) { continue; }\n // Later steps must not cover earlier steps during their delay.\n const animation = step.element.animate([step.from, step.to], {\n duration: step.duration, delay: step.delay, easing: step.ease, fill: step.backwards ? \"both\" : \"forwards\",\n });\n animation.playbackRate = 1 / policy.tempo;\n animations.push(animation);\n }\n void Promise.all(animations.map(animation => animation.finished)).then(() => void run.finish(), () => void run.cancel());\n if (policy.immediate || !plan.length) { run.finish(); }\n } catch (error) {\n run.cancel();\n throw error;\n }\n return run;\n };\n return {\n api: { play },\n configure: (next: Policy) => {\n policy = next;\n if (next.immediate) { active?.run.finish(); }\n else { for (const animation of active?.animations ?? []) { animation.updatePlaybackRate(1 / next.tempo); } }\n },\n dispose: () => {\n active?.run.cancel();\n for (const [element, properties] of originals) {\n for (const [property, original] of properties) { element.style.setProperty(property, original.value, original.priority); }\n }\n originals.clear();\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionReveal\n * @description Motion Reveal\n */\n\nimport { type RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\";\nimport { LayoutMotion, type LayoutMotionProps } from \"../layout-motion/layout-motion\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type MotionRevealProps = Omit<LayoutMotionProps, \"animate\" | \"exit\" | \"layout\" | \"layoutId\" | \"layoutScroll\" | \"layoutRoot\"> & {\n readonly once?: boolean;\n readonly amount?: number;\n readonly root?: Element | null;\n readonly rootMargin?: string;\n};\n\n/** Offscreen decoration only. Initial visible content and keyboard access stay usable. */\nexport const MotionReveal = ({ once = true, amount = 0, root = null, rootMargin = \"0px\",\n enter = { opacity: 0, y: 12 }, transition, ref, onFocusCapture, ...props }: MotionRevealProps) => {\n if (!Number.isFinite(amount) || amount < 0 || amount > 1) { throw new RangeError(\"Reveal amount must be between zero and one.\"); }\n const node: RefObject<HTMLDivElement | null> = useRef(null);\n const seen = useRef(false);\n const [visible, setVisible] = useState<boolean | null>(null);\n const [focused, setFocused] = useState(false);\n const { immediate } = useMotionPolicy();\n useImperativeHandle(ref, () => node.current!, []);\n useEffect(() => {\n const element = node.current!;\n const Observer = element.ownerDocument.defaultView!.IntersectionObserver;\n if (immediate || focused || (once && seen.current)) { return; }\n const observer = new Observer(([entry]) => {\n if (!entry) { return; }\n const inside = entry.isIntersecting && entry.intersectionRatio >= amount;\n setVisible(inside);\n if (inside) {\n seen.current = true;\n if (once) { observer.disconnect(); }\n }\n }, { root, rootMargin, threshold: amount });\n observer.observe(element);\n return () => void observer.disconnect();\n }, [immediate, focused, once, amount, root, rootMargin]);\n const show = immediate || focused || visible !== false;\n return <LayoutMotion {...props} ref={node} layout={false}\n animate={show ? { opacity: 1, x: 0, y: 0, scale: 1 } : enter}\n {...((!show || focused) ? { transition: { duration: 0 } } : transition ? { transition } : {})}\n onFocusCapture={event => { setFocused(true); onFocusCapture?.(event); }} />;\n};\n"],
5
+ "mappings": ";;;;;;;;;;AAOA,SAAS,YAAY,eAAe;;;ACE7B,IAAM,qBAAqB,CAAC,eAAuC;AACtE,MAAI,WAAW,SAAS,UAAU;AAC9B,eAAW,SAAS,CAAC,WAAW,WAAW,WAAW,SAAS,WAAW,IAAI,GAAG;AAC7E,UAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,cAAM,IAAI,WAAW,uDAAuD;AAAA,MAChF;AAAA,IACJ;AAAA,EACJ,WAAW,WAAW,aAAa,WAAc,CAAC,OAAO,SAAS,WAAW,QAAQ,KAAK,WAAW,WAAW,IAAI;AAChH,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACJ;;;ADKW;AAZJ,IAAM,eAAe,CAAC,EAAE,UAAU,OAAO,eAAe,UAAU,WAAW,MAAyB;AACzG,QAAM,SAAS,WAAW,aAAa;AACvC,MAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACA,MAAI,YAAY;AAAC,uBAAmB,UAAU;AAAA,EAAE;AAChD,QAAM,QAAQ,QAAQ,OAAO;AAAA,IACzB,OAAO,SAAS,OAAO;AAAA,IACvB,eAAe,OAAO,kBAAkB,WAAW,WAAW,iBAAiB,OAAO;AAAA,IACtF,UAA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AAa,WAAY,QAAQ,KAAK,SAAU;AAAE;AAAA,IAAQ;AAC9D,UAAM,WAAW,IAAI,SAAS,CAAC,CAAC,KAAK,MAAM;AACvC,UAAI,CAAC,OAAO;AAAE;AAAA,MAAQ;AACtB,YAAM,SAAS,MAAM,kBAAkB,MAAM,qBAAqB;AAClE,iBAAW,MAAM;AACjB,UAAI,QAAQ;AACR,aAAK,UAAU;AACf,YAAI,MAAM;AAAE,mBAAS,WAAW;AAAA,QAAG;AAAA,MACvC;AAAA,IACJ,GAAG,EAAE,MAAM,YAAY,WAAW,OAAO,CAAC;AAC1C,aAAS,QAAQ,OAAO;AACxB,WAAO,MAAM,KAAK,SAAS,WAAW;AAAA,EAC1C,GAAG,CAAC,WAAW,SAAS,MAAM,QAAQ,MAAM,UAAU,CAAC;AACvD,QAAM,OAAO,aAAa,WAAW,YAAY;AACjD,SAAO,gBAAAJ;AAAA,IAAC;AAAA;AAAA,MAAc,GAAG;AAAA,MAAO,KAAK;AAAA,MAAM,QAAQ;AAAA,MAC/C,SAAS,OAAO,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI;AAAA,MACtD,GAAK,CAAC,QAAQ,UAAW,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,aAAa,EAAE,WAAW,IAAI,CAAC;AAAA,MAC3F,gBAAgB,WAAS;AAAE,mBAAW,IAAI;AAAG,yBAAiB,KAAK;AAAA,MAAG;AAAA;AAAA,EAAG;AACjF;",
6
6
  "names": ["useContext", "jsx", "useMemo", "jsx", "animate", "useMemo", "jsx", "LayoutGroup", "useId", "jsx", "useId", "LayoutGroup", "useLayoutEffect", "useState", "useState", "useLayoutEffect", "useImperativeHandle", "useLayoutEffect", "useRef", "jsx", "useRef", "useImperativeHandle", "useLayoutEffect", "useLayoutEffect", "useState", "useState", "useLayoutEffect", "useEffect", "useImperativeHandle", "useRef", "useState", "jsx", "useRef", "useState", "useImperativeHandle", "useEffect"]
7
7
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace LayoutMotion
5
+ * @description Layout Motion
6
+ */
1
7
  import type { MotionState } from "../shared/state";
2
8
  import { type ComponentPropsWithRef, type CSSProperties } from "react";
3
9
  import type { MotionTransition } from "../motion-config/types";
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionConfig
5
+ * @description Context
6
+ */
1
7
  import type { MotionSettings } from "./types";
2
8
  export declare const MotionContext: import("react").Context<MotionSettings>;
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionConfig
5
+ * @description Motion Config
6
+ */
1
7
  import type { MotionConfigProps } from "./types";
2
8
  export declare const MotionConfig: ({ children, tempo, reducedMotion, disabled, transition }: MotionConfigProps) => import("react").JSX.Element;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionConfig
5
+ * @description Types
6
+ */
1
7
  import type { ReactNode } from "react";
2
8
  export type MotionEase = "linear" | "easeIn" | "easeOut" | "easeInOut" | [number, number, number, number];
3
9
  /** Durations are milliseconds. Spring parameters describe a physical spring. */
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionConfig
5
+ * @description Validate Transition
6
+ */
1
7
  import type { MotionTransition } from "./types";
2
8
  export declare const validateTransition: (transition: MotionTransition) => void;
@@ -1 +1,7 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionLayoutGroup
5
+ * @description Context
6
+ */
1
7
  export declare const LayoutGroupContext: import("react").Context<boolean>;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionLayoutGroup
5
+ * @description Motion Layout Group
6
+ */
1
7
  import { type ReactNode } from "react";
2
8
  export type MotionLayoutGroupProps = {
3
9
  readonly children: ReactNode;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionReveal
5
+ * @description Motion Reveal
6
+ */
1
7
  import { type LayoutMotionProps } from "../layout-motion/layout-motion";
2
8
  export type MotionRevealProps = Omit<LayoutMotionProps, "animate" | "exit" | "layout" | "layoutId" | "layoutScroll" | "layoutRoot"> & {
3
9
  readonly once?: boolean;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionScope
5
+ * @description Motion Scope
6
+ */
1
7
  import type { ComponentPropsWithRef } from "react";
2
8
  export type MotionScopeProps = ComponentPropsWithRef<"div"> & {
3
9
  readonly asChild?: boolean;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionSequence
5
+ * @description Controller
6
+ */
1
7
  import type { RefObject } from "react";
2
8
  import type { MotionEase, MotionTransition } from "../motion-config/types";
3
9
  import type { MotionOutcome } from "../shared/outcome";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionSequence
5
+ * @description Use Motion Sequence
6
+ */
1
7
  import { type RefObject } from "react";
2
8
  import { type MotionSequence } from "./controller";
3
9
  /** Explicit element targets within one mounted scope. This hook owns their animated styles. */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace MotionSize
5
+ * @description Motion Size
6
+ */
1
7
  import { type ComponentPropsWithRef, type CSSProperties } from "react";
2
8
  import type { SpringValueOptions } from "../spring-value/controller";
3
9
  export type MotionSizeProps = Omit<ComponentPropsWithRef<"div">, "style"> & {
package/dist/policy.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Root
5
+ * @description Policy
6
+ */
1
7
  export { useMotionPolicy } from "./shared/use-motion-policy";
2
8
  export { useMotionStyle } from "./shared/use-motion-style";
3
9
  export { readMotionDuration, readMotionPolicy, observeMotionPolicy } from "./shared/dom-policy";
package/dist/policy.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  readMotionPolicy,
5
5
  useMotionPolicy,
6
6
  useMotionStyle
7
- } from "./chunk-MMMTUJVS.js";
7
+ } from "./chunk-JV6HKGMG.js";
8
8
  export {
9
9
  observeMotionPolicy,
10
10
  readMotionDuration,
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Presence
5
+ * @description Presence
6
+ */
1
7
  import { type ReactNode } from "react";
2
8
  export type PresenceProps = {
3
9
  readonly children: ReactNode;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description Dom Policy
6
+ */
1
7
  export type DOMMotionPolicy = {
2
8
  readonly immediate: boolean;
3
9
  readonly tempo: number;
@@ -1 +1,7 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description Outcome
6
+ */
1
7
  export type MotionOutcome = "finished" | "cancelled";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description Resolve Transition
6
+ */
1
7
  import type { Transition } from "motion/react";
2
8
  import type { MotionEase, MotionTransition } from "../motion-config/types";
3
9
  export type ThemeTransition = {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description State
6
+ */
1
7
  export type MotionState = {
2
8
  readonly opacity?: number;
3
9
  readonly x?: number;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description Use Motion Policy
6
+ */
1
7
  /** Unknown server preference is visually immediate but must not advance domain state. */
2
8
  export declare const useMotionPolicy: () => {
3
9
  ready: boolean;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace Shared
5
+ * @description Use Motion Style
6
+ */
1
7
  import type { CSSProperties } from "react";
2
8
  /** Bridge React policy to owned CSS, including nodes rendered through a portal. */
3
9
  export declare const useMotionStyle: (style?: CSSProperties) => CSSProperties;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace SpringValue
5
+ * @description Controller
6
+ */
1
7
  import type { MotionTransition } from "../motion-config/types";
2
8
  import type { MotionOutcome } from "../shared/outcome";
3
9
  export type SpringValueOptions = Omit<Extract<MotionTransition, {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package GridUI
4
+ * @namespace SpringValue
5
+ * @description Use Spring Value
6
+ */
1
7
  import { type SpringValue, type SpringValueOptions } from "./controller";
2
8
  /** Initial value is captured once. Subscriptions update DOM without React frame renders. */
3
9
  export declare const useSpringValue: (initial: number, options?: SpringValueOptions) => SpringValue;
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/motion",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "category": "core",
6
6
  "description": "Shared GridUI motion policy, layout, springs, and scoped animation",
7
7
  "usage": "Shared React motion policy, presence/layout transitions, spring values, scoped sequences, intrinsic sizing, and visibility-triggered decoration. Import `MotionConfig`, `Presence`, and `LayoutMotion` from `@gridui/motion`. Load `@gridui/theme/styles.css`; Motion has no component stylesheet. The package uses Motion internally. Consumers do not need to import its engine directly.",
@@ -228,6 +228,11 @@
228
228
  ],
229
229
  "examples": [
230
230
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/getting-started.mdx",
231
- "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/motion.stories.tsx"
231
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx",
232
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/motion.stories.tsx",
233
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/policy.stories.tsx",
234
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/reveal.stories.tsx",
235
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/sequences.stories.tsx",
236
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/springs.stories.tsx"
232
237
  ]
233
238
  }
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
- The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout-motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
16
 
17
17
  ## API
18
18
 
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
- The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout-motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
16
 
17
17
  ## API
18
18
 
@@ -12,6 +12,8 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
+
15
17
  ## API
16
18
 
17
19
  The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
- The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/reveal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
16
 
17
17
  ## API
18
18
 
@@ -12,6 +12,8 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
+
15
17
  ## API
16
18
 
17
19
  The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
@@ -1,7 +1,7 @@
1
1
  <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
2
  # MotionSize
3
3
 
4
- Compose MotionSize with Tabs inside the same @gridui/motion component family.
4
+ Public MotionSize component from @gridui/motion. See the package guide for its composition contract.
5
5
 
6
6
  Import from ``@gridui/motion`` and load Theme before this family's stylesheet.
7
7
 
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
- The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
16
 
17
17
  ## API
18
18
 
@@ -1,7 +1,7 @@
1
1
  <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
2
  # Presence
3
3
 
4
- Public Presence component from @gridui/motion. See the package guide for its composition contract.
4
+ Shared configuration, presence, and layout transitions with system motion preferences.
5
5
 
6
6
  Import from ``@gridui/motion`` and load Theme before this family's stylesheet.
7
7
 
@@ -12,6 +12,8 @@ import "@gridui/theme/styles.css";
12
12
 
13
13
  Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/README.md) for shared behavior and stylesheet dependencies.
14
14
 
15
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/motion/stories/motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
+
15
17
  ## API
16
18
 
17
19
  The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/motion",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Shared GridUI motion policy, layout, springs, and scoped animation",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -24,9 +24,9 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@gridui/theme": "^3.0.0",
28
- "motion": "14.13.0",
29
- "@radix-ui/react-slot": "1.5.0"
27
+ "@gridui/theme": "^4.0.0",
28
+ "@radix-ui/react-slot": "1.5.0",
29
+ "motion": "14.14.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@gridui-internal/configuration": "0.0.0-internal",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/shared/dom-policy.ts", "../src/shared/use-motion-policy.ts", "../src/motion-config/context.ts", "../src/shared/use-motion-style.ts"],
4
- "sourcesContent": ["export type DOMMotionPolicy = { readonly immediate: boolean; readonly tempo: number };\nconst query = \"(prefers-reduced-motion: reduce)\";\n\n/** Read base time tokens without applying tempo. CSS calc()/var() resolve in the browser. */\nexport const readMotionDuration = (element: Element, token = \"--gridui-motion-duration-normal\", fallback = 180): number => {\n const value = element.ownerDocument.defaultView!.getComputedStyle(element).getPropertyValue(token).trim();\n const parse = (time: string): number | undefined => {\n if (!/^(?:\\d*\\.)?\\d+(?:ms|s)$/.test(time)) { return undefined; }\n return Number.parseFloat(time) * (time.endsWith(\"ms\") ? 1 : 1000);\n };\n const direct = parse(value);\n if (direct !== undefined) { return direct; }\n if (!value || !element.ownerDocument.defaultView!.CSS.supports(\"transition-duration\", value)) { return fallback; }\n const probe = element.ownerDocument.createElement(\"span\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none\";\n probe.style.transitionDuration = value;\n element.ownerDocument.body.append(probe);\n const result = parse(element.ownerDocument.defaultView!.getComputedStyle(probe).transitionDuration);\n probe.remove();\n return result ?? fallback;\n};\n\nexport const readMotionPolicy = (element: Element): DOMMotionPolicy => {\n const style = element.ownerDocument.defaultView!.getComputedStyle(element);\n const factor = Number.parseFloat(style.getPropertyValue(\"--gridui-motion-tempo\"));\n return {\n immediate: element.ownerDocument.defaultView!.matchMedia(query).matches\n || style.getPropertyValue(\"--gridui-motion-disabled\").trim() === \"1\",\n tempo: Number.isFinite(factor) && factor > 0 ? factor : 1,\n };\n};\n\n/**\n * Observe the current ancestor chain and document preference. Re-subscribe after\n * reparenting; stylesheet-only changes are read on the next explicit read/update.\n * Resource lifecycle stays independent. This observer never scans descendants.\n */\nexport const observeMotionPolicy = (element: Element, changed: (policy: DOMMotionPolicy) => void): (() => void) => {\n let previous = readMotionPolicy(element);\n const update = () => {\n const next = readMotionPolicy(element);\n if (next.immediate !== previous.immediate || next.tempo !== previous.tempo) {\n previous = next;\n changed(next);\n }\n };\n const observer = new element.ownerDocument.defaultView!.MutationObserver(update);\n for (let node: Element | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"style\", \"class\"] });\n }\n const media = element.ownerDocument.defaultView!.matchMedia(query);\n media.addEventListener(\"change\", update);\n return () => {\n observer.disconnect();\n media.removeEventListener(\"change\", update);\n };\n};\n", "import { useContext, useSyncExternalStore } from \"react\";\nimport { MotionContext } from \"../motion-config/context\";\n\nconst query = \"(prefers-reduced-motion: reduce)\";\nconst subscribe = (notify: () => void): (() => void) => {\n const preference = window.matchMedia(query);\n preference.addEventListener(\"change\", notify);\n return () => void preference.removeEventListener(\"change\", notify);\n};\nconst snapshot = (): boolean => window.matchMedia(query).matches;\nconst serverSnapshot = (): undefined => undefined;\n\n/** Unknown server preference is visually immediate but must not advance domain state. */\nexport const useMotionPolicy = () => {\n const settings = useContext(MotionContext);\n const systemReduced = useSyncExternalStore<boolean | undefined>(subscribe, snapshot, serverSnapshot);\n const ready = systemReduced !== undefined;\n const reason = settings.disabled ? \"disabled\" : settings.reducedMotion === \"always\" || systemReduced\n ? \"reduced-motion\" : !ready ? \"pending\" : undefined;\n return { ...settings, ready, reason, immediate: reason !== undefined };\n};\n", "import { createContext } from \"react\";\nimport type { MotionSettings } from \"./types\";\n\nexport const MotionContext = createContext<MotionSettings>({\n tempo: 1,\n reducedMotion: \"user\",\n disabled: false,\n transition: undefined,\n});\n", "import type { CSSProperties } from \"react\";\nimport { useMotionPolicy } from \"./use-motion-policy\";\n\n/** Bridge React policy to owned CSS, including nodes rendered through a portal. */\nexport const useMotionStyle = (style?: CSSProperties): CSSProperties => {\n const policy = useMotionPolicy();\n return {\n ...style,\n \"--gridui-motion-tempo\": policy.tempo,\n \"--gridui-motion-factor\": policy.immediate ? 0 : policy.tempo,\n \"--gridui-motion-disabled\": policy.immediate ? 1 : 0,\n \"--gridui-motion-animation\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transition\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transform\": policy.immediate ? \"none\" : \"initial\",\n } as CSSProperties;\n};\n"],
5
- "mappings": ";AACA,IAAM,QAAQ;AAGP,IAAM,qBAAqB,CAAC,SAAkB,QAAQ,mCAAmC,WAAW,QAAgB;AACvH,QAAM,QAAQ,QAAQ,cAAc,YAAa,iBAAiB,OAAO,EAAE,iBAAiB,KAAK,EAAE,KAAK;AACxG,QAAM,QAAQ,CAAC,SAAqC;AAChD,QAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAAE,aAAO;AAAA,IAAW;AAC/D,WAAO,OAAO,WAAW,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,IAAI;AAAA,EAChE;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,WAAW,QAAW;AAAE,WAAO;AAAA,EAAQ;AAC3C,MAAI,CAAC,SAAS,CAAC,QAAQ,cAAc,YAAa,IAAI,SAAS,uBAAuB,KAAK,GAAG;AAAE,WAAO;AAAA,EAAU;AACjH,QAAM,QAAQ,QAAQ,cAAc,cAAc,MAAM;AACxD,QAAM,MAAM,UAAU;AACtB,QAAM,MAAM,qBAAqB;AACjC,UAAQ,cAAc,KAAK,OAAO,KAAK;AACvC,QAAM,SAAS,MAAM,QAAQ,cAAc,YAAa,iBAAiB,KAAK,EAAE,kBAAkB;AAClG,QAAM,OAAO;AACb,SAAO,UAAU;AACrB;AAEO,IAAM,mBAAmB,CAAC,YAAsC;AACnE,QA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