use-scroll-animate 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/chunks/{base-ZARFccur.js → base-BPG5zvex.js} +2 -2
  3. package/dist/chunks/{base-ZARFccur.js.map → base-BPG5zvex.js.map} +1 -1
  4. package/dist/chunks/{core-DXqZm5Il.cjs → core-CLu8ZrC-.cjs} +52 -10
  5. package/dist/chunks/core-CLu8ZrC-.cjs.map +1 -0
  6. package/dist/chunks/{core-Co-6AL0h.js → core-QTFk4kgO.js} +53 -12
  7. package/dist/chunks/core-QTFk4kgO.js.map +1 -0
  8. package/dist/chunks/{core-DKY-fVzR.js → core-eXX8rB_b.js} +2 -2
  9. package/dist/chunks/{core-DKY-fVzR.js.map → core-eXX8rB_b.js.map} +1 -1
  10. package/dist/chunks/{spring-E2ickYNI.js → spring-BziPsW3r.js} +2 -2
  11. package/dist/chunks/{spring-E2ickYNI.js.map → spring-BziPsW3r.js.map} +1 -1
  12. package/dist/chunks/{variants-DvnxvRCM.js → variants-BVYMcxRv.js} +2 -2
  13. package/dist/chunks/{variants-DvnxvRCM.js.map → variants-BVYMcxRv.js.map} +1 -1
  14. package/dist/components/angular.cjs +1 -1
  15. package/dist/components/angular.d.cts +29 -5
  16. package/dist/components/angular.d.ts +29 -5
  17. package/dist/components/angular.js +5 -5
  18. package/dist/components/background.js +3 -3
  19. package/dist/components/cards.js +3 -3
  20. package/dist/components/click.js +3 -3
  21. package/dist/components/depth.js +4 -4
  22. package/dist/components/feedback.js +2 -2
  23. package/dist/components/gesture.js +5 -5
  24. package/dist/components/interaction.js +2 -2
  25. package/dist/components/layout.js +2 -2
  26. package/dist/components/packs.js +2 -2
  27. package/dist/components/page.js +3 -3
  28. package/dist/components/physics.js +4 -4
  29. package/dist/components/reveal.js +2 -2
  30. package/dist/components/solid.cjs +20 -5
  31. package/dist/components/solid.cjs.map +1 -1
  32. package/dist/components/solid.d.cts +33 -23
  33. package/dist/components/solid.d.ts +33 -23
  34. package/dist/components/solid.js +24 -9
  35. package/dist/components/solid.js.map +1 -1
  36. package/dist/components/svelte.cjs +1 -1
  37. package/dist/components/svelte.d.cts +29 -5
  38. package/dist/components/svelte.d.ts +29 -5
  39. package/dist/components/svelte.js +5 -5
  40. package/dist/components/svg.cjs +16 -10
  41. package/dist/components/svg.cjs.map +1 -1
  42. package/dist/components/svg.css +1 -1
  43. package/dist/components/svg.js +18 -12
  44. package/dist/components/svg.js.map +1 -1
  45. package/dist/components/text.cjs +1 -1
  46. package/dist/components/text.css +1 -1
  47. package/dist/components/text.js +3 -3
  48. package/dist/components/timeline.cjs +25 -5
  49. package/dist/components/timeline.cjs.map +1 -1
  50. package/dist/components/timeline.d.cts +33 -7
  51. package/dist/components/timeline.d.ts +33 -7
  52. package/dist/components/timeline.js +27 -8
  53. package/dist/components/timeline.js.map +1 -1
  54. package/dist/components/transitions.js +2 -2
  55. package/dist/components/ui.js +5 -5
  56. package/dist/components/vue.cjs +1 -1
  57. package/dist/components/vue.d.cts +29 -5
  58. package/dist/components/vue.d.ts +29 -5
  59. package/dist/components/vue.js +5 -5
  60. package/dist/components/webgl.cjs +10 -0
  61. package/dist/components/webgl.cjs.map +1 -1
  62. package/dist/components/webgl.js +12 -2
  63. package/dist/components/webgl.js.map +1 -1
  64. package/dist/components.cjs +2 -1
  65. package/dist/components.cjs.map +1 -1
  66. package/dist/components.css +2 -2
  67. package/dist/components.d.cts +34 -8
  68. package/dist/components.d.ts +34 -8
  69. package/dist/components.js +7 -7
  70. package/dist/components.umd.js +2 -2
  71. package/dist/components.umd.js.map +1 -1
  72. package/dist/index.cjs +2 -1
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +30 -6
  75. package/dist/index.d.ts +30 -6
  76. package/dist/index.js +2 -2
  77. package/dist/index.js.map +1 -1
  78. package/dist/index.umd.js +2 -2
  79. package/dist/index.umd.js.map +1 -1
  80. package/dist/solid.cjs +38 -8
  81. package/dist/solid.cjs.map +1 -1
  82. package/dist/solid.d.cts +6 -1
  83. package/dist/solid.d.ts +6 -1
  84. package/dist/solid.js +39 -9
  85. package/dist/solid.js.map +1 -1
  86. package/docs/API.md +3 -1
  87. package/docs/ROADMAP.md +1 -1
  88. package/package.json +1 -1
  89. package/dist/chunks/core-Co-6AL0h.js.map +0 -1
  90. package/dist/chunks/core-DXqZm5Il.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"spring-E2ickYNI.js","sources":["../../src/components/physics/spring.ts"],"sourcesContent":["import { prefersReducedMotion, motionScale, raf, caf, now, applyFrame, EASE_SPRING } from '../base';\n\n/**\n * Spring physics core (v2.3). A damped harmonic oscillator integrated in\n * 1 ms steps: `stiffness` (k, N/m), `damping` (c) and `mass` (m). Used by\n * the `<usa-spring>`, `<usa-draggable>` and `<usa-overscroll>` elements and\n * exported for your own animations:\n *\n * - `springEasing()` turns a spring into a CSS `linear()` easing + duration\n * for WAAPI / CSS (falls back to a cubic-bezier overshoot where `linear()`\n * is unsupported);\n * - `spring(el, keyframes, cfg)` animates with it;\n * - `createSpring()` is an interruptible, velocity-preserving value for\n * gestures (drag, inertia, snap).\n */\nexport interface SpringConfig {\n /** Spring stiffness (default 170). Higher = faster, snappier. */\n stiffness?: number;\n /** Damping / friction (default 26). Lower = more bounces. */\n damping?: number;\n /** Mass (default 1). Higher = slower, heavier. */\n mass?: number;\n /** Initial velocity in progress units per second (default 0). */\n velocity?: number;\n /** Rest threshold (default 0.001). */\n precision?: number;\n}\n\nexport type SpringPreset = 'default' | 'gentle' | 'wobbly' | 'stiff' | 'bouncy' | 'slow' | 'molasses';\n\nexport const SPRING_PRESETS: Record<SpringPreset, Required<Pick<SpringConfig, 'stiffness' | 'damping' | 'mass'>>> = {\n default: { stiffness: 170, damping: 26, mass: 1 },\n gentle: { stiffness: 120, damping: 14, mass: 1 },\n wobbly: { stiffness: 180, damping: 12, mass: 1 },\n stiff: { stiffness: 210, damping: 20, mass: 1 },\n bouncy: { stiffness: 300, damping: 10, mass: 1 },\n slow: { stiffness: 280, damping: 60, mass: 1 },\n molasses: { stiffness: 280, damping: 120, mass: 1 },\n};\n\nexport type SpringInput = SpringPreset | SpringConfig | string | undefined;\n\n/** Resolve a preset name or a partial config to a full config. */\nexport function resolveSpring(input?: SpringInput): Required<SpringConfig> {\n const base = typeof input === 'string' ? SPRING_PRESETS[input as SpringPreset] || SPRING_PRESETS.default : { ...SPRING_PRESETS.default, ...(input || {}) };\n const pos = (v: unknown, d: number) => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : d);\n const o = (typeof input === 'object' && input) || {};\n return {\n stiffness: pos(base.stiffness, 170),\n damping: Math.max(0, Number.isFinite(base.damping) ? base.damping : 26),\n mass: pos(base.mass, 1),\n velocity: Number.isFinite(o.velocity) ? (o.velocity as number) : 0,\n precision: pos(o.precision, 0.001),\n };\n}\n\n/** One integration step (semi-implicit Euler) towards `to`. Returns [x, v]. */\nexport function stepSpring(cfg: Required<SpringConfig>, x: number, v: number, to: number, dt: number): [number, number] {\n const a = (-cfg.stiffness * (x - to) - cfg.damping * v) / cfg.mass;\n const nv = v + a * dt;\n return [x + nv * dt, nv];\n}\n\nconst cache = new Map<string, { values: number[]; duration: number }>();\n\n/**\n * Sample the spring from 0 to 1 at `fps` (default 60). `values` may exceed 1\n * (overshoot); `duration` is the time to rest, in ms (max 10 s).\n */\nexport function springSamples(input?: SpringInput, fps = 60): { values: number[]; duration: number } {\n const cfg = resolveSpring(input);\n const key = `${cfg.stiffness}|${cfg.damping}|${cfg.mass}|${cfg.velocity}|${cfg.precision}|${fps}`;\n const hit = cache.get(key);\n if (hit) return hit;\n const values = [0];\n let x = 0;\n let v = cfg.velocity;\n const frame = 1000 / fps;\n let t = 0;\n let next = frame;\n while (t < 10000) {\n [x, v] = stepSpring(cfg, x, v, 1, 0.001);\n t += 1;\n if (t >= next) {\n values.push(x);\n next += frame;\n if (Math.abs(1 - x) < cfg.precision && Math.abs(v) < cfg.precision * 10) break;\n }\n }\n values[values.length - 1] = 1;\n const out = { values, duration: Math.round(t) };\n if (cache.size > 64) cache.clear();\n cache.set(key, out);\n return out;\n}\n\n/** `true` when CSS `linear()` easing is supported. */\nexport function supportsLinearEasing(): boolean {\n return typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('animation-timing-function', 'linear(0, 1)');\n}\n\n/**\n * The spring as `{ easing, duration }` for `el.animate()` / CSS. `easing` is\n * a `linear(…)` function with at most `points` stops (default 48), or a\n * cubic-bezier overshoot where `linear()` is unsupported.\n */\nexport function springEasing(input?: SpringInput, points = 48): { easing: string; duration: number } {\n const { values, duration } = springSamples(input);\n if (!supportsLinearEasing()) return { easing: EASE_SPRING, duration: Math.min(duration, 1200) };\n return { easing: linearEasing(values, points), duration };\n}\n\n/** Build a CSS `linear()` easing from samples (down-sampled to `points`). */\nexport function linearEasing(values: number[], points = 48): string {\n const n = values.length;\n const step = Math.max(1, Math.ceil((n - 1) / Math.max(2, points - 1)));\n const out: string[] = [];\n for (let i = 0; i < n - 1; i += step) out.push(String(Math.round(values[i] * 1000) / 1000));\n out.push('1');\n return `linear(${out.join(', ')})`;\n}\n\n/**\n * Animate `el` between keyframes with spring timing (WAAPI). Under reduced\n * motion the final frame is applied immediately. Returns the Animation (or\n * `null` without WAAPI / under reduced motion).\n */\nexport function spring(el: Element, keyframes: Keyframe[], input?: SpringInput, options: KeyframeAnimationOptions = {}): Animation | null {\n const target = el as HTMLElement;\n if (prefersReducedMotion() || typeof target.animate !== 'function') {\n applyFrame(target, keyframes[keyframes.length - 1]);\n return null;\n }\n const { easing, duration } = springEasing(input);\n return target.animate(keyframes, { duration: duration * motionScale(), easing, fill: 'both', ...options });\n}\n\n/* ------------------------------------------------------------------ */\n/* Interactive springs */\n/* ------------------------------------------------------------------ */\n\nexport interface SpringValueOptions {\n /** Start value (default 0). */\n value?: number;\n /** Spring config or preset (default `'default'`). */\n spring?: SpringInput;\n /** Called with the value every frame (and on `jump()`). */\n onUpdate?: (value: number, velocity: number) => void;\n /** Called when the value comes to rest at its target. */\n onRest?: (value: number) => void;\n}\n\nexport interface SpringValue {\n readonly value: number;\n /** Units per second. */\n readonly velocity: number;\n readonly target: number;\n readonly animating: boolean;\n /** Animate to `target`, optionally with a new initial velocity (units/s). */\n set(target: number, velocity?: number): void;\n /** Jump to `value` with no animation. */\n jump(value: number): void;\n /** Stop where it is. */\n stop(): void;\n /** Change the spring config. */\n configure(spring: SpringInput): void;\n}\n\n/**\n * An interruptible spring-animated number: call `set()` as often as you like,\n * the motion keeps its velocity (like iOS / Framer springs). Reduced motion\n * jumps straight to the target.\n */\nexport function createSpring(opts: SpringValueOptions = {}): SpringValue {\n let cfg = resolveSpring(opts.spring);\n let x = opts.value ?? 0;\n let v = 0;\n let to = x;\n let id = 0;\n let last = 0;\n let running = false;\n const stop = () => {\n if (running) caf(id);\n running = false;\n };\n const loop = () => {\n const t = now();\n let dt = Math.min(64, Math.max(1, t - last));\n last = t;\n while (dt > 0) {\n const s = Math.min(dt, 4);\n [x, v] = stepSpring(cfg, x, v, to, s / 1000);\n dt -= s;\n }\n const scale = Math.max(1, Math.abs(to) * 0.0005);\n if (Math.abs(to - x) < cfg.precision * scale * 10 && Math.abs(v) < cfg.precision * scale * 100) {\n x = to;\n v = 0;\n running = false;\n opts.onUpdate?.(x, 0);\n opts.onRest?.(x);\n return;\n }\n opts.onUpdate?.(x, v);\n id = raf(loop);\n };\n const api: SpringValue = {\n get value() {\n return x;\n },\n get velocity() {\n return v;\n },\n get target() {\n return to;\n },\n get animating() {\n return running;\n },\n set(target, velocity) {\n to = target;\n if (velocity !== undefined && Number.isFinite(velocity)) v = velocity;\n if (prefersReducedMotion()) {\n api.jump(target);\n opts.onRest?.(target);\n return;\n }\n if (!running) {\n running = true;\n last = now();\n id = raf(loop);\n }\n },\n jump(value) {\n stop();\n x = to = value;\n v = 0;\n opts.onUpdate?.(x, 0);\n },\n stop() {\n stop();\n v = 0;\n to = x;\n },\n configure(input) {\n cfg = resolveSpring(input);\n },\n };\n return api;\n}\n\n/* ------------------------------------------------------------------ */\n/* Inertia + snapping */\n/* ------------------------------------------------------------------ */\n\n/**\n * Where a flick at `velocity` (units/s) comes to rest with exponential\n * decay: `value + velocity · timeConstant` (default 0.325 s, iOS-like).\n */\nexport function projectInertia(value: number, velocity: number, timeConstant = 0.325): number {\n return value + velocity * timeConstant;\n}\n\n/** Snap to a grid (`number`) or the nearest of a list of points. */\nexport function snapTo(value: number, to: number | number[] | null | undefined): number {\n if (Array.isArray(to)) {\n if (!to.length) return value;\n return to.reduce((best, p) => (Math.abs(p - value) < Math.abs(best - value) ? p : best), to[0]);\n }\n if (typeof to === 'number' && to > 0) return Math.round(value / to) * to;\n return value;\n}\n\n/** iOS-style rubber-band resistance: how far content moves when pulled `distance` past an edge. */\nexport function rubberBand(distance: number, dimension: number, constant = 0.55): number {\n if (dimension <= 0) return 0;\n const sign = distance < 0 ? -1 : 1;\n const d = Math.abs(distance);\n return sign * (1 - 1 / ((d * constant) / dimension + 1)) * dimension;\n}\n"],"names":[],"mappings":";;AA8BO,MAAM,cAAc,GAAyF;AAClH,IAAA,OAAO,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AACjD,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAChD,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAChD,IAAA,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAC/C,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE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,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;IAClC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS;AACtE;;;;"}
1
+ {"version":3,"file":"spring-BziPsW3r.js","sources":["../../src/components/physics/spring.ts"],"sourcesContent":["import { prefersReducedMotion, motionScale, raf, caf, now, applyFrame, EASE_SPRING } from '../base';\n\n/**\n * Spring physics core (v2.3). A damped harmonic oscillator integrated in\n * 1 ms steps: `stiffness` (k, N/m), `damping` (c) and `mass` (m). Used by\n * the `<usa-spring>`, `<usa-draggable>` and `<usa-overscroll>` elements and\n * exported for your own animations:\n *\n * - `springEasing()` turns a spring into a CSS `linear()` easing + duration\n * for WAAPI / CSS (falls back to a cubic-bezier overshoot where `linear()`\n * is unsupported);\n * - `spring(el, keyframes, cfg)` animates with it;\n * - `createSpring()` is an interruptible, velocity-preserving value for\n * gestures (drag, inertia, snap).\n */\nexport interface SpringConfig {\n /** Spring stiffness (default 170). Higher = faster, snappier. */\n stiffness?: number;\n /** Damping / friction (default 26). Lower = more bounces. */\n damping?: number;\n /** Mass (default 1). Higher = slower, heavier. */\n mass?: number;\n /** Initial velocity in progress units per second (default 0). */\n velocity?: number;\n /** Rest threshold (default 0.001). */\n precision?: number;\n}\n\nexport type SpringPreset = 'default' | 'gentle' | 'wobbly' | 'stiff' | 'bouncy' | 'slow' | 'molasses';\n\nexport const SPRING_PRESETS: Record<SpringPreset, Required<Pick<SpringConfig, 'stiffness' | 'damping' | 'mass'>>> = {\n default: { stiffness: 170, damping: 26, mass: 1 },\n gentle: { stiffness: 120, damping: 14, mass: 1 },\n wobbly: { stiffness: 180, damping: 12, mass: 1 },\n stiff: { stiffness: 210, damping: 20, mass: 1 },\n bouncy: { stiffness: 300, damping: 10, mass: 1 },\n slow: { stiffness: 280, damping: 60, mass: 1 },\n molasses: { stiffness: 280, damping: 120, mass: 1 },\n};\n\nexport type SpringInput = SpringPreset | SpringConfig | string | undefined;\n\n/** Resolve a preset name or a partial config to a full config. */\nexport function resolveSpring(input?: SpringInput): Required<SpringConfig> {\n const base = typeof input === 'string' ? SPRING_PRESETS[input as SpringPreset] || SPRING_PRESETS.default : { ...SPRING_PRESETS.default, ...(input || {}) };\n const pos = (v: unknown, d: number) => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : d);\n const o = (typeof input === 'object' && input) || {};\n return {\n stiffness: pos(base.stiffness, 170),\n damping: Math.max(0, Number.isFinite(base.damping) ? base.damping : 26),\n mass: pos(base.mass, 1),\n velocity: Number.isFinite(o.velocity) ? (o.velocity as number) : 0,\n precision: pos(o.precision, 0.001),\n };\n}\n\n/** One integration step (semi-implicit Euler) towards `to`. Returns [x, v]. */\nexport function stepSpring(cfg: Required<SpringConfig>, x: number, v: number, to: number, dt: number): [number, number] {\n const a = (-cfg.stiffness * (x - to) - cfg.damping * v) / cfg.mass;\n const nv = v + a * dt;\n return [x + nv * dt, nv];\n}\n\nconst cache = new Map<string, { values: number[]; duration: number }>();\n\n/**\n * Sample the spring from 0 to 1 at `fps` (default 60). `values` may exceed 1\n * (overshoot); `duration` is the time to rest, in ms (max 10 s).\n */\nexport function springSamples(input?: SpringInput, fps = 60): { values: number[]; duration: number } {\n const cfg = resolveSpring(input);\n const key = `${cfg.stiffness}|${cfg.damping}|${cfg.mass}|${cfg.velocity}|${cfg.precision}|${fps}`;\n const hit = cache.get(key);\n if (hit) return hit;\n const values = [0];\n let x = 0;\n let v = cfg.velocity;\n const frame = 1000 / fps;\n let t = 0;\n let next = frame;\n while (t < 10000) {\n [x, v] = stepSpring(cfg, x, v, 1, 0.001);\n t += 1;\n if (t >= next) {\n values.push(x);\n next += frame;\n if (Math.abs(1 - x) < cfg.precision && Math.abs(v) < cfg.precision * 10) break;\n }\n }\n values[values.length - 1] = 1;\n const out = { values, duration: Math.round(t) };\n if (cache.size > 64) cache.clear();\n cache.set(key, out);\n return out;\n}\n\n/** `true` when CSS `linear()` easing is supported. */\nexport function supportsLinearEasing(): boolean {\n return typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('animation-timing-function', 'linear(0, 1)');\n}\n\n/**\n * The spring as `{ easing, duration }` for `el.animate()` / CSS. `easing` is\n * a `linear(…)` function with at most `points` stops (default 48), or a\n * cubic-bezier overshoot where `linear()` is unsupported.\n */\nexport function springEasing(input?: SpringInput, points = 48): { easing: string; duration: number } {\n const { values, duration } = springSamples(input);\n if (!supportsLinearEasing()) return { easing: EASE_SPRING, duration: Math.min(duration, 1200) };\n return { easing: linearEasing(values, points), duration };\n}\n\n/** Build a CSS `linear()` easing from samples (down-sampled to `points`). */\nexport function linearEasing(values: number[], points = 48): string {\n const n = values.length;\n const step = Math.max(1, Math.ceil((n - 1) / Math.max(2, points - 1)));\n const out: string[] = [];\n for (let i = 0; i < n - 1; i += step) out.push(String(Math.round(values[i] * 1000) / 1000));\n out.push('1');\n return `linear(${out.join(', ')})`;\n}\n\n/**\n * Animate `el` between keyframes with spring timing (WAAPI). Under reduced\n * motion the final frame is applied immediately. Returns the Animation (or\n * `null` without WAAPI / under reduced motion).\n */\nexport function spring(el: Element, keyframes: Keyframe[], input?: SpringInput, options: KeyframeAnimationOptions = {}): Animation | null {\n const target = el as HTMLElement;\n if (prefersReducedMotion() || typeof target.animate !== 'function') {\n applyFrame(target, keyframes[keyframes.length - 1]);\n return null;\n }\n const { easing, duration } = springEasing(input);\n return target.animate(keyframes, { duration: duration * motionScale(), easing, fill: 'both', ...options });\n}\n\n/* ------------------------------------------------------------------ */\n/* Interactive springs */\n/* ------------------------------------------------------------------ */\n\nexport interface SpringValueOptions {\n /** Start value (default 0). */\n value?: number;\n /** Spring config or preset (default `'default'`). */\n spring?: SpringInput;\n /** Called with the value every frame (and on `jump()`). */\n onUpdate?: (value: number, velocity: number) => void;\n /** Called when the value comes to rest at its target. */\n onRest?: (value: number) => void;\n}\n\nexport interface SpringValue {\n readonly value: number;\n /** Units per second. */\n readonly velocity: number;\n readonly target: number;\n readonly animating: boolean;\n /** Animate to `target`, optionally with a new initial velocity (units/s). */\n set(target: number, velocity?: number): void;\n /** Jump to `value` with no animation. */\n jump(value: number): void;\n /** Stop where it is. */\n stop(): void;\n /** Change the spring config. */\n configure(spring: SpringInput): void;\n}\n\n/**\n * An interruptible spring-animated number: call `set()` as often as you like,\n * the motion keeps its velocity (like iOS / Framer springs). Reduced motion\n * jumps straight to the target.\n */\nexport function createSpring(opts: SpringValueOptions = {}): SpringValue {\n let cfg = resolveSpring(opts.spring);\n let x = opts.value ?? 0;\n let v = 0;\n let to = x;\n let id = 0;\n let last = 0;\n let running = false;\n const stop = () => {\n if (running) caf(id);\n running = false;\n };\n const loop = () => {\n const t = now();\n let dt = Math.min(64, Math.max(1, t - last));\n last = t;\n while (dt > 0) {\n const s = Math.min(dt, 4);\n [x, v] = stepSpring(cfg, x, v, to, s / 1000);\n dt -= s;\n }\n const scale = Math.max(1, Math.abs(to) * 0.0005);\n if (Math.abs(to - x) < cfg.precision * scale * 10 && Math.abs(v) < cfg.precision * scale * 100) {\n x = to;\n v = 0;\n running = false;\n opts.onUpdate?.(x, 0);\n opts.onRest?.(x);\n return;\n }\n opts.onUpdate?.(x, v);\n id = raf(loop);\n };\n const api: SpringValue = {\n get value() {\n return x;\n },\n get velocity() {\n return v;\n },\n get target() {\n return to;\n },\n get animating() {\n return running;\n },\n set(target, velocity) {\n to = target;\n if (velocity !== undefined && Number.isFinite(velocity)) v = velocity;\n if (prefersReducedMotion()) {\n api.jump(target);\n opts.onRest?.(target);\n return;\n }\n if (!running) {\n running = true;\n last = now();\n id = raf(loop);\n }\n },\n jump(value) {\n stop();\n x = to = value;\n v = 0;\n opts.onUpdate?.(x, 0);\n },\n stop() {\n stop();\n v = 0;\n to = x;\n },\n configure(input) {\n cfg = resolveSpring(input);\n },\n };\n return api;\n}\n\n/* ------------------------------------------------------------------ */\n/* Inertia + snapping */\n/* ------------------------------------------------------------------ */\n\n/**\n * Where a flick at `velocity` (units/s) comes to rest with exponential\n * decay: `value + velocity · timeConstant` (default 0.325 s, iOS-like).\n */\nexport function projectInertia(value: number, velocity: number, timeConstant = 0.325): number {\n return value + velocity * timeConstant;\n}\n\n/** Snap to a grid (`number`) or the nearest of a list of points. */\nexport function snapTo(value: number, to: number | number[] | null | undefined): number {\n if (Array.isArray(to)) {\n if (!to.length) return value;\n return to.reduce((best, p) => (Math.abs(p - value) < Math.abs(best - value) ? p : best), to[0]);\n }\n if (typeof to === 'number' && to > 0) return Math.round(value / to) * to;\n return value;\n}\n\n/** iOS-style rubber-band resistance: how far content moves when pulled `distance` past an edge. */\nexport function rubberBand(distance: number, dimension: number, constant = 0.55): number {\n if (dimension <= 0) return 0;\n const sign = distance < 0 ? -1 : 1;\n const d = Math.abs(distance);\n return sign * (1 - 1 / ((d * constant) / dimension + 1)) * dimension;\n}\n"],"names":[],"mappings":";;AA8BO,MAAM,cAAc,GAAyF;AAClH,IAAA,OAAO,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AACjD,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAChD,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAChD,IAAA,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAC/C,IAAA,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAChD,IAAA,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE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,CAAC,QAAQ,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS;AACtE;;;;"}
@@ -1,4 +1,4 @@
1
- import { f as adoptStyles } from './base-ZARFccur.js';
1
+ import { f as adoptStyles } from './base-BPG5zvex.js';
2
2
 
3
3
  var css = ":root{--usa-accent:#7c5cff;--usa-accent-text:#fff;--usa-surface:#1b1e27;--usa-text:inherit;--usa-radius:14px;--usa-border:1px solid rgb(127 127 127 / 0.25);--usa-shadow:0 10px 30px -12px rgb(0 0 0 / 0.45);--usa-blur:0px;--usa-font:inherit}:where([variant=\"minimal\"],[data-usa-variant=\"minimal\"]){--usa-accent:currentColor;--usa-accent-text:Canvas;--usa-surface:transparent;--usa-radius:6px;--usa-border:1px solid color-mix(in srgb,currentColor 22%,transparent);--usa-shadow:none;--usa-blur:0px}:where([variant=\"neon\"],[data-usa-variant=\"neon\"]){--usa-accent:#00f0ff;--usa-accent-text:#04121a;--usa-surface:#0a0b14;--usa-text:#e6fbff;--usa-radius:10px;--usa-border:1px solid #00f0ff;--usa-shadow:0 0 6px #00f0ff,0 0 22px rgb(0 240 255 / 0.45);--usa-blur:0px}:where([variant=\"glass\"],[data-usa-variant=\"glass\"]){--usa-accent:#a78bfa;--usa-accent-text:#fff;--usa-surface:rgb(255 255 255 / 0.12);--usa-radius:18px;--usa-border:1px solid rgb(255 255 255 / 0.28);--usa-shadow:0 12px 40px -12px rgb(0 0 0 / 0.35);--usa-blur:16px}:where([variant=\"brutalist\"],[data-usa-variant=\"brutalist\"]){--usa-accent:#ff3d00;--usa-accent-text:#000;--usa-surface:#fff;--usa-text:#000;--usa-radius:0px;--usa-border:3px solid #000;--usa-shadow:5px 5px 0 #000;--usa-blur:0px;--usa-font:ui-monospace,\"SFMono-Regular\",Menlo,monospace}:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#0067c0;--usa-accent-text:#fff;--usa-surface:rgb(249 249 249 / 0.82);--usa-text:#1a1a1a;--usa-radius:8px;--usa-border:1px solid rgb(0 0 0 / 0.08);--usa-shadow:0 2px 4px rgb(0 0 0 / 0.14),0 0 2px rgb(0 0 0 / 0.12);--usa-blur:30px;--usa-font:\"Segoe UI Variable\",\"Segoe UI\",system-ui,sans-serif}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#6750a4;--usa-accent-text:#fff;--usa-surface:#fffbfe;--usa-text:#1c1b1f;--usa-radius:20px;--usa-border:0 solid transparent;--usa-shadow:0 1px 3px rgb(0 0 0 / 0.3),0 4px 8px 3px rgb(0 0 0 / 0.15);--usa-blur:0px;--usa-font:Roboto,system-ui,sans-serif}@media (prefers-color-scheme:dark){:where([variant=\"fluent\"],[data-usa-variant=\"fluent\"]){--usa-accent:#4cc2ff;--usa-accent-text:#000;--usa-surface:rgb(44 44 44 / 0.8);--usa-text:#fff;--usa-border:1px solid rgb(255 255 255 / 0.08)}:where([variant=\"material\"],[data-usa-variant=\"material\"]){--usa-accent:#d0bcff;--usa-accent-text:#381e72;--usa-surface:#1c1b1f;--usa-text:#e6e1e5}}.usa-surface{background:var(--usa-surface);color:var(--usa-text);border:var(--usa-border);border-radius:var(--usa-radius);box-shadow:var(--usa-shadow);font-family:var(--usa-font);-webkit-backdrop-filter:blur(var(--usa-blur));backdrop-filter:blur(var(--usa-blur))}@media (prefers-reduced-transparency:reduce){.usa-surface{-webkit-backdrop-filter:none;backdrop-filter:none}}";
4
4
 
@@ -32,4 +32,4 @@ function setVariant(variant, root = typeof document !== 'undefined' ? document.d
32
32
  }
33
33
 
34
34
  export { VARIANTS as V, adoptVariants as a, setVariant as s };
35
- //# sourceMappingURL=variants-DvnxvRCM.js.map
35
+ //# sourceMappingURL=variants-BVYMcxRv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"variants-DvnxvRCM.js","sources":["../../src/components/ui/variants.ts"],"sourcesContent":["import { adoptStyles } from '../base';\nimport css from './variants.css?raw';\n\n/**\n * Style variants (v2.6): `variant=\"minimal | neon | glass | brutalist |\n * fluent | material\"` on any `<usa-*>` element — or on any ancestor as\n * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared\n * design tokens every component reads:\n *\n * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,\n * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.\n *\n * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`\n * for their kind; the token names never clash with those values except\n * `fluent`, which means the same thing there.)\n */\nexport const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'] as const;\nexport type Variant = (typeof VARIANTS)[number];\n\n/** Inject the variant token sheet (done automatically by every `ui` component). */\nexport function adoptVariants(): void {\n adoptStyles('variants', css);\n}\n\n/** Apply a variant to the whole page (or `root`); `null` removes it. */\nexport function setVariant(variant: Variant | null, root: Element | null = typeof document !== 'undefined' ? document.documentElement : null): void {\n if (!root) return;\n adoptVariants();\n if (variant) root.setAttribute('data-usa-variant', variant);\n else root.removeAttribute('data-usa-variant');\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU;AAGtF;SACgB,aAAa,GAAA;AAC3B,IAAA,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B;AAEA;SACgB,UAAU,CAAC,OAAuB,EAAE,IAAA,GAAuB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AAC1I,IAAA,IAAI,CAAC,IAAI;QAAE;AACX,IAAA,aAAa,EAAE;AACf,IAAA,IAAI,OAAO;AAAE,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;;AACtD,QAAA,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;AAC/C;;;;"}
1
+ {"version":3,"file":"variants-BVYMcxRv.js","sources":["../../src/components/ui/variants.ts"],"sourcesContent":["import { adoptStyles } from '../base';\nimport css from './variants.css?raw';\n\n/**\n * Style variants (v2.6): `variant=\"minimal | neon | glass | brutalist |\n * fluent | material\"` on any `<usa-*>` element — or on any ancestor as\n * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared\n * design tokens every component reads:\n *\n * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,\n * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.\n *\n * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`\n * for their kind; the token names never clash with those values except\n * `fluent`, which means the same thing there.)\n */\nexport const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'] as const;\nexport type Variant = (typeof VARIANTS)[number];\n\n/** Inject the variant token sheet (done automatically by every `ui` component). */\nexport function adoptVariants(): void {\n adoptStyles('variants', css);\n}\n\n/** Apply a variant to the whole page (or `root`); `null` removes it. */\nexport function setVariant(variant: Variant | null, root: Element | null = typeof document !== 'undefined' ? document.documentElement : null): void {\n if (!root) return;\n adoptVariants();\n if (variant) root.setAttribute('data-usa-variant', variant);\n else root.removeAttribute('data-usa-variant');\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU;AAGtF;SACgB,aAAa,GAAA;AAC3B,IAAA,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B;AAEA;SACgB,UAAU,CAAC,OAAuB,EAAE,IAAA,GAAuB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,EAAA;AAC1I,IAAA,IAAI,CAAC,IAAI;QAAE;AACX,IAAA,aAAa,EAAE;AACf,IAAA,IAAI,OAAO;AAAE,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC;;AACtD,QAAA,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;AAC/C;;;;"}
@@ -17,7 +17,7 @@ require('./click.cjs');
17
17
  require('./ui.cjs');
18
18
  require('./page.cjs');
19
19
  require('./timeline.cjs');
20
- require('../chunks/core-DXqZm5Il.cjs');
20
+ require('../chunks/core-CLu8ZrC-.cjs');
21
21
  require('./gesture.cjs');
22
22
  require('../chunks/core-IaorbTdu.cjs');
23
23
  require('./svg.cjs');
@@ -1295,10 +1295,26 @@ interface TimelineStepOptions {
1295
1295
  stagger?: number;
1296
1296
  }
1297
1297
  interface ScrubOptions {
1298
- /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts. */
1298
+ /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts (JS engine only). */
1299
1299
  offset?: number;
1300
- /** Smoothing 0–1 (0 = immediate, default 0). */
1300
+ /** Smoothing 0–1 (0 = immediate, default 0). Smoothing needs the JS engine. */
1301
1301
  smooth?: number;
1302
+ /**
1303
+ * 4.1: which progress source drives the timeline.
1304
+ * - `'view'` (default): `source` moving through the viewport (CSS `ViewTimeline`, range `cover`).
1305
+ * - `'scroll'`: the scroll position of `source` itself (a scroll container; CSS `ScrollTimeline`).
1306
+ */
1307
+ source?: 'view' | 'scroll';
1308
+ /** 4.1: `'auto'` (default) uses the browser's native scroll-driven animations when available, `'js'` forces the fallback. */
1309
+ engine?: 'auto' | 'native' | 'js';
1310
+ /** 4.1: scroll axis, `'block'` (default) · `'inline'` · `'x'` · `'y'`. */
1311
+ axis?: 'block' | 'inline' | 'x' | 'y';
1312
+ }
1313
+ /** The function `scrub()` returns: call it to stop. `native` tells which engine runs it. */
1314
+ interface ScrubHandle {
1315
+ (): void;
1316
+ /** `true` when the browser's ScrollTimeline / ViewTimeline drives it (compositor, no JS per frame). */
1317
+ readonly native: boolean;
1302
1318
  }
1303
1319
  interface Timeline {
1304
1320
  /** Total length in ms. */
@@ -1322,8 +1338,14 @@ interface Timeline {
1322
1338
  seek(to: TimelinePosition): Timeline;
1323
1339
  /** Get or set progress 0–1. */
1324
1340
  progress(p?: number): number;
1325
- /** Tie progress to the scroll position of `source` (it moves through the viewport). Returns a stop function. */
1326
- scrub(source: Element, options?: ScrubOptions): () => void;
1341
+ /**
1342
+ * Tie progress to scroll: `source` moving through the viewport (or, with
1343
+ * `{ source: 'scroll' }`, a scroll container's own position). Runs on native
1344
+ * ScrollTimeline / ViewTimeline when available (and no `smooth`, `offset`,
1345
+ * `call()` cues or `onUpdate` need JS), else on a rAF-throttled listener.
1346
+ * Returns a stop function with a `native` flag.
1347
+ */
1348
+ scrub(source: Element, options?: ScrubOptions): ScrubHandle;
1327
1349
  /** Stop and drop every animation (elements keep their last frame). */
1328
1350
  cancel(): void;
1329
1351
  }
@@ -1337,7 +1359,9 @@ interface Timeline {
1337
1359
  * Attributes: `trigger` (`view` default · `click` · `manual`), `scrub`
1338
1360
  * (progress follows scroll instead of playing), `overlap` (ms each step
1339
1361
  * overlaps the previous, default 0), `duration` (600), `stagger` (ms),
1340
- * `repeat` (replay every time it enters the viewport). Methods: `play()`,
1362
+ * `repeat` (replay every time it enters the viewport). 4.1: `scrub` runs on native
1363
+ * ScrollTimeline / ViewTimeline when supported (`data-native` is set); `scrub="js"`,
1364
+ * `scrub="scroll"` and `smooth` tune it. Methods: `play()`,
1341
1365
  * `reverse()`, `seek(t)`; property `timeline`. Event `usa:complete`.
1342
1366
  * Reduced motion: steps appear in their final state.
1343
1367
  */
@@ -1295,10 +1295,26 @@ interface TimelineStepOptions {
1295
1295
  stagger?: number;
1296
1296
  }
1297
1297
  interface ScrubOptions {
1298
- /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts. */
1298
+ /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts (JS engine only). */
1299
1299
  offset?: number;
1300
- /** Smoothing 0–1 (0 = immediate, default 0). */
1300
+ /** Smoothing 0–1 (0 = immediate, default 0). Smoothing needs the JS engine. */
1301
1301
  smooth?: number;
1302
+ /**
1303
+ * 4.1: which progress source drives the timeline.
1304
+ * - `'view'` (default): `source` moving through the viewport (CSS `ViewTimeline`, range `cover`).
1305
+ * - `'scroll'`: the scroll position of `source` itself (a scroll container; CSS `ScrollTimeline`).
1306
+ */
1307
+ source?: 'view' | 'scroll';
1308
+ /** 4.1: `'auto'` (default) uses the browser's native scroll-driven animations when available, `'js'` forces the fallback. */
1309
+ engine?: 'auto' | 'native' | 'js';
1310
+ /** 4.1: scroll axis, `'block'` (default) · `'inline'` · `'x'` · `'y'`. */
1311
+ axis?: 'block' | 'inline' | 'x' | 'y';
1312
+ }
1313
+ /** The function `scrub()` returns: call it to stop. `native` tells which engine runs it. */
1314
+ interface ScrubHandle {
1315
+ (): void;
1316
+ /** `true` when the browser's ScrollTimeline / ViewTimeline drives it (compositor, no JS per frame). */
1317
+ readonly native: boolean;
1302
1318
  }
1303
1319
  interface Timeline {
1304
1320
  /** Total length in ms. */
@@ -1322,8 +1338,14 @@ interface Timeline {
1322
1338
  seek(to: TimelinePosition): Timeline;
1323
1339
  /** Get or set progress 0–1. */
1324
1340
  progress(p?: number): number;
1325
- /** Tie progress to the scroll position of `source` (it moves through the viewport). Returns a stop function. */
1326
- scrub(source: Element, options?: ScrubOptions): () => void;
1341
+ /**
1342
+ * Tie progress to scroll: `source` moving through the viewport (or, with
1343
+ * `{ source: 'scroll' }`, a scroll container's own position). Runs on native
1344
+ * ScrollTimeline / ViewTimeline when available (and no `smooth`, `offset`,
1345
+ * `call()` cues or `onUpdate` need JS), else on a rAF-throttled listener.
1346
+ * Returns a stop function with a `native` flag.
1347
+ */
1348
+ scrub(source: Element, options?: ScrubOptions): ScrubHandle;
1327
1349
  /** Stop and drop every animation (elements keep their last frame). */
1328
1350
  cancel(): void;
1329
1351
  }
@@ -1337,7 +1359,9 @@ interface Timeline {
1337
1359
  * Attributes: `trigger` (`view` default · `click` · `manual`), `scrub`
1338
1360
  * (progress follows scroll instead of playing), `overlap` (ms each step
1339
1361
  * overlaps the previous, default 0), `duration` (600), `stagger` (ms),
1340
- * `repeat` (replay every time it enters the viewport). Methods: `play()`,
1362
+ * `repeat` (replay every time it enters the viewport). 4.1: `scrub` runs on native
1363
+ * ScrollTimeline / ViewTimeline when supported (`data-native` is set); `scrub="js"`,
1364
+ * `scrub="scroll"` and `smooth` tune it. Methods: `play()`,
1341
1365
  * `reverse()`, `seek(t)`; property `timeline`. Event `usa:complete`.
1342
1366
  * Reduced motion: steps appear in their final state.
1343
1367
  */
@@ -1,23 +1,23 @@
1
1
  import { defineComponents } from '../components.js';
2
2
  export { b as bindUsa, u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
3
3
  import './reveal.js';
4
- import '../chunks/base-ZARFccur.js';
4
+ import '../chunks/base-BPG5zvex.js';
5
5
  import './text.js';
6
6
  import './interaction.js';
7
7
  import './feedback.js';
8
8
  import './background.js';
9
- import '../chunks/variants-DvnxvRCM.js';
9
+ import '../chunks/variants-BVYMcxRv.js';
10
10
  import './transitions.js';
11
11
  import './physics.js';
12
- import '../chunks/spring-E2ickYNI.js';
12
+ import '../chunks/spring-BziPsW3r.js';
13
13
  import './cards.js';
14
14
  import './click.js';
15
15
  import './ui.js';
16
16
  import './page.js';
17
17
  import './timeline.js';
18
- import '../chunks/core-Co-6AL0h.js';
18
+ import '../chunks/core-QTFk4kgO.js';
19
19
  import './gesture.js';
20
- import '../chunks/core-DKY-fVzR.js';
20
+ import '../chunks/core-eXX8rB_b.js';
21
21
  import './svg.js';
22
22
  import './webgl.js';
23
23
  import './depth.js';
@@ -1,6 +1,6 @@
1
- import { h as defineElement, b as caf, r as raf, f as adoptStyles, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents } from '../chunks/base-ZARFccur.js';
3
- import { s as setVariant } from '../chunks/variants-DvnxvRCM.js';
1
+ import { h as defineElement, d as caf, r as raf, f as adoptStyles, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents } from '../chunks/base-BPG5zvex.js';
3
+ import { s as setVariant } from '../chunks/variants-BVYMcxRv.js';
4
4
 
5
5
  var css$6 = "usa-aurora{position:relative;display:block;isolation:isolate;overflow:hidden}usa-aurora .usa-aurora-layer{position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:var(--usa-aurora-opacity,0.7);overflow:hidden;contain:strict}usa-aurora .usa-aurora-layer i{position:absolute;display:block;width:70%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,var(--c),transparent);will-change:transform;animation:usa-aurora-a var(--usa-aurora-speed,18s) ease-in-out infinite alternate}usa-aurora .usa-aurora-layer i:nth-child(1){left:-15%;top:-30%}usa-aurora .usa-aurora-layer i:nth-child(2){right:-20%;top:-10%;animation-name:usa-aurora-b;animation-duration:calc(var(--usa-aurora-speed,18s) * 1.3)}usa-aurora .usa-aurora-layer i:nth-child(3){left:10%;bottom:-45%;animation-name:usa-aurora-c;animation-duration:calc(var(--usa-aurora-speed,18s) * 0.9)}usa-aurora .usa-aurora-layer i:nth-child(4){right:0;bottom:-30%;width:50%;animation-name:usa-aurora-b;animation-direction:alternate-reverse}usa-aurora[paused] .usa-aurora-layer i,usa-aurora[data-offscreen] .usa-aurora-layer i{animation-play-state:paused}@keyframes usa-aurora-a{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(30%,20%,0) scale(1.25)}}@keyframes usa-aurora-b{from{transform:translate3d(0,0,0) scale(1.1)}to{transform:translate3d(-35%,25%,0) scale(0.85)}}@keyframes usa-aurora-c{from{transform:translate3d(0,0,0) rotate(0deg) scale(1)}to{transform:translate3d(25%,-30%,0) rotate(40deg) scale(1.2)}}@media (prefers-reduced-motion:reduce){usa-aurora .usa-aurora-layer i,usa-grain .usa-grain-layer,usa-acrylic::after{animation:none !important}}";
6
6
 
@@ -1,6 +1,6 @@
1
- import { h as defineElement, r as raf, b as caf, i as EASE_OUT, d as clamp } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
- import { d as springEasing, c as createSpring } from '../chunks/spring-E2ickYNI.js';
1
+ import { h as defineElement, r as raf, d as caf, i as EASE_OUT, b as clamp } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
+ import { d as springEasing, c as createSpring } from '../chunks/spring-BziPsW3r.js';
4
4
 
5
5
  var css$3 = "usa-card{--usa-card-radius:18px;--usa-card-bg:var(--usa-surface,#1b1e27);--usa-card-glow:var(--usa-accent,#7c5cff);--usa-card-x:50%;--usa-card-y:50%;--usa-card-nx:0;--usa-card-ny:0;position:relative;display:block;border-radius:var(--usa-card-radius);isolation:isolate;-webkit-tap-highlight-color:transparent}usa-card:focus-visible{outline:2px solid var(--usa-card-glow);outline-offset:3px}usa-card[effect~=\"lift\"]{transition:transform 0.45s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.45s ease}usa-card[effect~=\"lift\"][data-hover],usa-card[effect~=\"lift\"]:focus-visible{transform:translateY(-6px) perspective(900px) rotateX(calc(var(--usa-card-ny) * -4deg)) rotateY(calc(var(--usa-card-nx) * 4deg));box-shadow:0 22px 44px -18px rgb(0 0 0 / 0.55)}usa-card[effect~=\"glass\"]{background:color-mix(in srgb,var(--usa-card-bg) 45%,transparent);border:1px solid rgb(255 255 255 / 0.16);-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5)}usa-card[effect~=\"spotlight\"]::before,usa-card[effect~=\"border-glow\"]::after{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-card[effect~=\"spotlight\"]::before{z-index:-1;background:radial-gradient(260px circle at var(--usa-card-x) var(--usa-card-y),color-mix(in srgb,var(--usa-card-glow) 28%,transparent),transparent 70%)}usa-card[effect~=\"border-glow\"]::after{padding:1.5px;background:radial-gradient(180px circle at var(--usa-card-x) var(--usa-card-y),var(--usa-card-glow),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}usa-card[data-hover]::before,usa-card[data-hover]::after{opacity:1}@property --usa-card-angle{syntax:\"<angle>\";inherits:false;initial-value:0deg}usa-card[effect~=\"conic-border\"]{border:2px solid transparent;background:linear-gradient(var(--usa-card-bg),var(--usa-card-bg)) padding-box,conic-gradient(from var(--usa-card-angle),var(--usa-card-glow),#22d3ee,#f472b6,var(--usa-card-glow)) border-box;animation:usa-card-spin 4s linear infinite}@keyframes usa-card-spin{to{--usa-card-angle:360deg}}usa-card .usa-card-sheen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}usa-card .usa-card-sheen::before{content:\"\";position:absolute;top:0;bottom:0;width:45%;left:-60%;transform:skewX(-20deg);background:linear-gradient(90deg,transparent,rgb(255 255 255 / 0.35),transparent)}usa-card[effect~=\"sheen\"]:hover .usa-card-sheen::before,usa-card[effect~=\"sheen\"]:focus-visible .usa-card-sheen::before{left:130%;transition:left 0.8s cubic-bezier(0.22,1,0.36,1)}usa-card .usa-card-holo{position:absolute;inset:0;border-radius:inherit;pointer-events:none;mix-blend-mode:color-dodge;opacity:0.35;background:linear-gradient(115deg,transparent 20%,#ff7ad9 35%,#7af0ff 45%,#ffe27a 55%,transparent 70%) calc(var(--usa-card-x) * 1.4 - 20%) calc(var(--usa-card-y) * 1.4 - 20%) / 220% 220%;transition:opacity 0.3s ease}usa-card[data-hover] .usa-card-holo{opacity:0.7}usa-card[effect~=\"parallax-layers\"] [data-depth]{transition:transform 0.25s ease-out;will-change:transform}usa-card[effect~=\"flip\"]{perspective:1000px;display:grid}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{grid-area:1 / 1;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:inherit;transition:transform 0.7s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease}usa-card[effect~=\"flip\"]>[data-back]{transform:rotateY(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"]>[data-back]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateY(-180deg)}usa-card[effect~=\"flip\"][flipped]>[data-back],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateY(0deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-front],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-back],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateX(0deg)}usa-card[effect~=\"flip\"][trigger=\"click\"]{cursor:pointer}usa-card[effect~=\"expand\"]{cursor:zoom-in}usa-card[effect~=\"expand\"]:not([expanded]) [data-detail]{display:none}usa-card[expanded]{position:fixed;inset:6vh max(4vw,calc(50vw - 420px));z-index:1000;overflow:auto;cursor:default;background:var(--usa-card-bg);box-shadow:0 30px 80px -20px rgb(0 0 0 / 0.6)}.usa-card-backdrop{position:fixed;inset:0;z-index:999;background:rgb(0 0 0 / 0.45)}@media (prefers-reduced-motion:reduce){usa-card,usa-card *,usa-card .usa-card-sheen::before{transition-duration:0.01ms !important;animation:none !important}usa-card[effect~=\"lift\"][data-hover]{transform:none}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{transform:none !important}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([flipped])>[data-back]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{opacity:1;visibility:visible}}@media (prefers-reduced-transparency:reduce),(forced-colors:active){usa-card[effect~=\"glass\"]{background:var(--usa-card-bg);-webkit-backdrop-filter:none;backdrop-filter:none}}";
6
6
 
@@ -1,6 +1,6 @@
1
- import { p as prefersReducedMotion, h as defineElement, i as EASE_OUT, d as clamp, b as caf, n as now, r as raf } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents } from '../chunks/base-ZARFccur.js';
3
- import { d as springEasing, c as createSpring } from '../chunks/spring-E2ickYNI.js';
1
+ import { p as prefersReducedMotion, h as defineElement, i as EASE_OUT, b as clamp, d as caf, n as now, r as raf } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents } from '../chunks/base-BPG5zvex.js';
3
+ import { d as springEasing, c as createSpring } from '../chunks/spring-BziPsW3r.js';
4
4
 
5
5
  /**
6
6
  * Click-effect helpers (v2.5): `burst()`, `confetti()`, `shake()`, `haptic()`.
@@ -1,7 +1,7 @@
1
- import { h as defineElement, d as clamp, r as raf, b as caf } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
- import { c as createSpring } from '../chunks/spring-E2ickYNI.js';
4
- import { g as gesture } from '../chunks/core-DKY-fVzR.js';
1
+ import { h as defineElement, b as clamp, r as raf, d as caf } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
+ import { c as createSpring } from '../chunks/spring-BziPsW3r.js';
4
+ import { g as gesture } from '../chunks/core-eXX8rB_b.js';
5
5
 
6
6
  var css = "usa-cube{--usa-cube-size:200px;display:block;width:var(--usa-cube-size);height:var(--usa-cube-size);perspective:var(--usa-cube-perspective,900px);touch-action:pan-y;user-select:none;-webkit-user-select:none;position:relative}usa-cube>[data-face]{position:absolute;inset:0;backface-visibility:hidden;transform:translateZ(calc(var(--usa-cube-size) / -2)) rotateX(var(--usa-cube-rx,0deg)) rotateY(var(--usa-cube-ry,0deg)) var(--usa-face) translateZ(calc(var(--usa-cube-size) / 2));transform-origin:50% 50%}usa-cube>[data-face=\"front\"]{--usa-face:rotateY(0deg)}usa-cube>[data-face=\"right\"]{--usa-face:rotateY(90deg)}usa-cube>[data-face=\"back\"]{--usa-face:rotateY(180deg)}usa-cube>[data-face=\"left\"]{--usa-face:rotateY(-90deg)}usa-cube>[data-face=\"top\"]{--usa-face:rotateX(90deg)}usa-cube>[data-face=\"bottom\"]{--usa-face:rotateX(-90deg)}usa-cube:focus-visible{outline:2px solid currentColor;outline-offset:6px}usa-depth{display:block;position:relative;perspective:1000px}usa-depth>*{transform:var(--usa-depth-rot,none);transform-style:preserve-3d}usa-depth [data-depth]{will-change:transform;transition:transform 0.12s linear}@media (prefers-reduced-motion:reduce){usa-depth [data-depth]{transform:none !important}}";
7
7
 
@@ -1,5 +1,5 @@
1
- import { h as defineElement, k as kindOf, i as EASE_OUT, d as clamp, F as FLUENT_DECELERATE, E as EASE_SPRING } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
1
+ import { h as defineElement, k as kindOf, i as EASE_OUT, b as clamp, F as FLUENT_DECELERATE, E as EASE_SPRING } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
3
 
4
4
  var css$4 = "usa-spinner{--usa-spinner-size:32px;--usa-spinner-color:currentColor;position:relative;display:inline-block;vertical-align:middle;flex:none;width:var(--usa-spinner-size);height:var(--usa-spinner-size);color:var(--usa-spinner-color)}usa-spinner i{position:absolute;display:block}usa-spinner[paused] *,usa-spinner[paused] *::after{animation-play-state:paused !important}usa-spinner svg{width:100%;height:100%;animation:usa-spin 2s linear infinite;overflow:visible}usa-spinner svg circle{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-dasharray:0.5 100;stroke-dashoffset:0;animation:usa-ring-arc 1.6s ease-in-out infinite}@keyframes usa-spin{to{transform:rotate(360deg)}}@keyframes usa-ring-arc{0%{stroke-dasharray:0.5 100;stroke-dashoffset:0}50%{stroke-dasharray:62 100;stroke-dashoffset:-20}100%{stroke-dasharray:0.5 100;stroke-dashoffset:-99}}usa-spinner[data-kind=\"windows\"] i{inset:0;opacity:0;animation:usa-orbit 5.5s infinite}usa-spinner[data-kind=\"windows\"] i::after{content:\"\";position:absolute;left:50%;top:0;width:12%;height:12%;margin-left:-6%;border-radius:50%;background:currentColor}usa-spinner[data-kind=\"windows\"] i:nth-child(2){animation-delay:240ms;--n:1}usa-spinner[data-kind=\"windows\"] i:nth-child(3){animation-delay:480ms;--n:2}usa-spinner[data-kind=\"windows\"] i:nth-child(4){animation-delay:720ms;--n:3}usa-spinner[data-kind=\"windows\"] i:nth-child(5){animation-delay:960ms;--n:4}@keyframes usa-orbit{0%{transform:rotate(225deg);opacity:1;animation-timing-function:ease-out}7%{transform:rotate(345deg);animation-timing-function:linear}30%{transform:rotate(455deg);animation-timing-function:ease-in-out}39%{transform:rotate(690deg);animation-timing-function:linear}70%{transform:rotate(815deg);opacity:1;animation-timing-function:ease-out}75%{transform:rotate(945deg);animation-timing-function:ease-out}76%,100%{transform:rotate(945deg);opacity:0}}usa-spinner[data-kind=\"ring\"] i{inset:0;border-radius:50%;border:calc(var(--usa-spinner-size) / 9) solid color-mix(in srgb,currentColor 20%,transparent);border-top-color:currentColor;animation:usa-spin 0.8s linear infinite}usa-spinner[data-kind=\"dots\"]{display:inline-flex;align-items:center;justify-content:space-between;height:calc(var(--usa-spinner-size) / 2.5)}usa-spinner[data-kind=\"dots\"] i{position:static;width:22%;aspect-ratio:1;border-radius:50%;background:currentColor;animation:usa-dot 1.2s ease-in-out infinite}usa-spinner[data-kind=\"dots\"] i:nth-child(2){animation-delay:0.15s}usa-spinner[data-kind=\"dots\"] i:nth-child(3){animation-delay:0.3s}@keyframes usa-dot{0%,60%,100%{transform:translateY(0);opacity:0.35}30%{transform:translateY(-70%);opacity:1}}usa-spinner[data-kind=\"pulse\"] i{inset:0;border-radius:50%;background:currentColor;opacity:0;animation:usa-pulse 1.6s cubic-bezier(0.22,1,0.36,1) infinite}usa-spinner[data-kind=\"pulse\"] i:nth-child(2){animation-delay:0.8s}@keyframes usa-pulse{from{transform:scale(0.1);opacity:0.8}to{transform:scale(1);opacity:0}}usa-spinner[data-kind=\"bars\"]{display:inline-flex;align-items:center;justify-content:space-between}usa-spinner[data-kind=\"bars\"] i{position:static;width:16%;height:100%;border-radius:2px;background:currentColor;transform:scaleY(0.35);animation:usa-bar 1s ease-in-out infinite}usa-spinner[data-kind=\"bars\"] i:nth-child(2){animation-delay:0.12s}usa-spinner[data-kind=\"bars\"] i:nth-child(3){animation-delay:0.24s}usa-spinner[data-kind=\"bars\"] i:nth-child(4){animation-delay:0.36s}@keyframes usa-bar{0%,100%{transform:scaleY(0.35)}40%{transform:scaleY(1)}}@media (prefers-reduced-motion:reduce){usa-spinner svg,usa-spinner i,usa-spinner i::after{animation:usa-calm 2.4s ease-in-out infinite !important}usa-spinner[data-kind=\"windows\"] i{transform:rotate(calc(var(--n,0) * 72deg))}usa-spinner svg circle{animation:none;stroke-dasharray:30 100}}@keyframes usa-calm{0%,100%{opacity:1}50%{opacity:0.4}}";
5
5
 
@@ -1,8 +1,8 @@
1
- import { h as defineElement, d as clamp } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
- import { c as createSpring } from '../chunks/spring-E2ickYNI.js';
4
- import { g as gesture } from '../chunks/core-DKY-fVzR.js';
5
- export { p as pinchScale, s as swipeDirection } from '../chunks/core-DKY-fVzR.js';
1
+ import { h as defineElement, b as clamp } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
+ import { c as createSpring } from '../chunks/spring-BziPsW3r.js';
4
+ import { g as gesture } from '../chunks/core-eXX8rB_b.js';
5
+ export { p as pinchScale, s as swipeDirection } from '../chunks/core-eXX8rB_b.js';
6
6
 
7
7
  var css = "usa-swipeable{display:block;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-swipeable[axis=\"y\"]{touch-action:pan-x}usa-swipeable>*{transform:translate3d(var(--usa-swipe,0px),0,0);opacity:calc(1 - var(--usa-swipe-p,0) * 0.5)}usa-swipeable[axis=\"y\"]>*{transform:translate3d(0,var(--usa-swipe,0px),0)}usa-swipeable:focus-visible{outline:2px solid currentColor;outline-offset:2px}usa-pinch-zoom{display:block;overflow:hidden;touch-action:none;position:relative}usa-pinch-zoom>*{transform:translate3d(var(--usa-zoom-x,0px),var(--usa-zoom-y,0px),0) scale(var(--usa-zoom,1));transform-origin:50% 50%}usa-pinch-zoom[data-zoomed]{cursor:grab}usa-pinch-zoom:focus-visible{outline:2px solid currentColor;outline-offset:2px}";
8
8
 
@@ -1,5 +1,5 @@
1
- import { h as defineElement, i as EASE_OUT, r as raf, b as caf, d as clamp, E as EASE_SPRING } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
1
+ import { h as defineElement, i as EASE_OUT, r as raf, d as caf, b as clamp, E as EASE_SPRING } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
3
 
4
4
  var css$5 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
5
5
 
@@ -1,5 +1,5 @@
1
- import { p as prefersReducedMotion, i as EASE_OUT, m as motionScale, h as defineElement } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents } from '../chunks/base-ZARFccur.js';
1
+ import { p as prefersReducedMotion, i as EASE_OUT, m as motionScale, h as defineElement } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents } from '../chunks/base-BPG5zvex.js';
3
3
 
4
4
  /** FLIP keyframes from a previous box to the current one (pure). */
5
5
  function flipFrames(from, to, scale = true) {
@@ -1,5 +1,5 @@
1
- import { p as prefersReducedMotion, n as now, m as motionScale, r as raf, i as EASE_OUT, d as clamp, E as EASE_SPRING, h as defineElement } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents } from '../chunks/base-ZARFccur.js';
1
+ import { p as prefersReducedMotion, n as now, m as motionScale, r as raf, i as EASE_OUT, b as clamp, E as EASE_SPRING, h as defineElement } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents } from '../chunks/base-BPG5zvex.js';
3
3
 
4
4
  const anim = (el, frames, o) => {
5
5
  if (typeof el.animate !== 'function')
@@ -1,6 +1,6 @@
1
- import { h as defineElement, b as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, f as adoptStyles } from '../chunks/base-ZARFccur.js';
2
- export { M as MOTION_SCALE } from '../chunks/base-ZARFccur.js';
3
- import { e as springSamples } from '../chunks/spring-E2ickYNI.js';
1
+ import { h as defineElement, d as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, f as adoptStyles } from '../chunks/base-BPG5zvex.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-BPG5zvex.js';
3
+ import { e as springSamples } from '../chunks/spring-BziPsW3r.js';
4
4
 
5
5
  var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[mode=\"trail\"] .usa-cursor-ring{border:0;background:var(--usa-cursor-color);width:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));height:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));margin:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2) 0 0 calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2);opacity:calc(1 - var(--i) * 0.11)}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
6
6
 
@@ -1,7 +1,7 @@
1
- import { h as defineElement, d as clamp } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
3
- import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-E2ickYNI.js';
4
- export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-E2ickYNI.js';
1
+ import { h as defineElement, b as clamp } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
+ import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-BziPsW3r.js';
4
+ export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-BziPsW3r.js';
5
5
 
6
6
  var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
7
7
 
@@ -1,5 +1,5 @@
1
- import { h as defineElement, i as EASE_OUT, d as clamp, b as caf, r as raf } from '../chunks/base-ZARFccur.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-ZARFccur.js';
1
+ import { h as defineElement, i as EASE_OUT, b as clamp, d as caf, r as raf } from '../chunks/base-BPG5zvex.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-BPG5zvex.js';
3
3
 
4
4
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
5
5
  const REVEAL_EFFECTS = [
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var solidJs = require('solid-js');
3
4
  var components = require('../components.cjs');
4
5
  var bind = require('../chunks/bind-Ui43-n2d.cjs');
5
6
  require('./reveal.cjs');
@@ -17,7 +18,7 @@ require('./click.cjs');
17
18
  require('./ui.cjs');
18
19
  require('./page.cjs');
19
20
  require('./timeline.cjs');
20
- require('../chunks/core-DXqZm5Il.cjs');
21
+ require('../chunks/core-CLu8ZrC-.cjs');
21
22
  require('./gesture.cjs');
22
23
  require('../chunks/core-IaorbTdu.cjs');
23
24
  require('./svg.cjs');
@@ -44,12 +45,26 @@ require('../chunks/index-tags-BQh_uGqH.cjs');
44
45
  */
45
46
  /**
46
47
  * Solid directive (`use:usa`). Solid calls it with the element and an
47
- * accessor; the binding is read once on mount and re-read whenever
48
- * `refresh()` on the returned handle is called (or wrap it in `createEffect`).
48
+ * accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
49
+ * signals read inside `{{ props, on }}` update the element automatically and
50
+ * the listeners are removed on cleanup. `refresh()` is kept for code that
51
+ * calls the directive outside a reactive owner.
49
52
  */
50
53
  function usa(el, accessor) {
51
- const b = bind.bindUsa(el, accessor() || {});
52
- return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };
54
+ let b = null;
55
+ const run = () => {
56
+ const v = accessor() || {};
57
+ if (b)
58
+ b.update(v);
59
+ else
60
+ b = bind.bindUsa(el, v);
61
+ };
62
+ solidJs.createRenderEffect(run);
63
+ if (!b)
64
+ run();
65
+ const destroy = () => b?.destroy();
66
+ solidJs.onCleanup(destroy);
67
+ return { refresh: run, destroy };
53
68
  }
54
69
  /** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */
55
70
  function defineUsa(categories) {
@@ -1 +1 @@
1
- {"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; the binding is read once on mount and re-read whenever\n * `refresh()` on the returned handle is called (or wrap it in `createEffect`).\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n const b = bindUsa(el, accessor() || {});\n return { refresh: () => b.update(accessor() || {}), destroy: b.destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":["bindUsa","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAQH;;;;AAIG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,MAAM,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;AAC1E;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
1
+ {"version":3,"file":"solid.cjs","sources":["../../src/components/frameworks/solid.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/solid — Solid integration (v3.8).\n * Solid renders custom elements natively: set properties with `prop:` and\n * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).\n * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`\n * directive for `use:usa={{ props, on }}`, and JSX types.\n *\n * ```tsx\n * import { defineUsa, usa } from 'use-scroll-animate/components/solid';\n * import type {} from 'use-scroll-animate/components/solid'; // JSX types\n * onMount(() => defineUsa());\n * false && usa; // keep the directive import (Solid convention)\n * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect=\"flip\">…</usa-card>\n * ```\n */\nimport { createRenderEffect, onCleanup } from 'solid-js';\nimport { defineComponents, type ComponentCategory } from '../index';\nimport { bindUsa, type UsaBinding } from './bind';\nimport type { UsaIntrinsicElements } from './jsx';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/**\n * Solid directive (`use:usa`). Solid calls it with the element and an\n * accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so\n * signals read inside `{{ props, on }}` update the element automatically and\n * the listeners are removed on cleanup. `refresh()` is kept for code that\n * calls the directive outside a reactive owner.\n */\nexport function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): { refresh(): void; destroy(): void } {\n let b: ReturnType<typeof bindUsa> | null = null;\n const run = () => {\n const v = accessor() || {};\n if (b) b.update(v);\n else b = bindUsa(el, v);\n };\n createRenderEffect(run);\n if (!b) run();\n const destroy = () => b?.destroy();\n onCleanup(destroy);\n return { refresh: run, destroy };\n}\n\n/** Register the elements (all, or some categories) — call from `onMount` in SSR apps. */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** JSX intrinsic elements for Solid (same attribute types as the React/Preact ones). */\nexport type SolidUsaIntrinsicElements = UsaIntrinsicElements;\n"],"names":["bindUsa","createRenderEffect","onCleanup","defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AASH;;;;;;AAMG;AACG,SAAU,GAAG,CAAC,EAAe,EAAE,QAAsC,EAAA;IACzE,IAAI,CAAC,GAAsC,IAAI;IAC/C,MAAM,GAAG,GAAG,MAAK;AACf,QAAA,MAAM,CAAC,GAAG,QAAQ,EAAE,IAAI,EAAE;AAC1B,QAAA,IAAI,CAAC;AAAE,YAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;;AACb,YAAA,CAAC,GAAGA,YAAO,CAAC,EAAE,EAAE,CAAC,CAAC;AACzB,IAAA,CAAC;IACDC,0BAAkB,CAAC,GAAG,CAAC;AACvB,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,GAAG,EAAE;IACb,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE;IAClCC,iBAAS,CAAC,OAAO,CAAC;AAClB,IAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEC,2BAAgB,CAAC,UAAU,CAAC;AACjE;;;;;;;"}
@@ -1295,10 +1295,26 @@ interface TimelineStepOptions {
1295
1295
  stagger?: number;
1296
1296
  }
1297
1297
  interface ScrubOptions {
1298
- /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts. */
1298
+ /** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts (JS engine only). */
1299
1299
  offset?: number;
1300
- /** Smoothing 0–1 (0 = immediate, default 0). */
1300
+ /** Smoothing 0–1 (0 = immediate, default 0). Smoothing needs the JS engine. */
1301
1301
  smooth?: number;
1302
+ /**
1303
+ * 4.1: which progress source drives the timeline.
1304
+ * - `'view'` (default): `source` moving through the viewport (CSS `ViewTimeline`, range `cover`).
1305
+ * - `'scroll'`: the scroll position of `source` itself (a scroll container; CSS `ScrollTimeline`).
1306
+ */
1307
+ source?: 'view' | 'scroll';
1308
+ /** 4.1: `'auto'` (default) uses the browser's native scroll-driven animations when available, `'js'` forces the fallback. */
1309
+ engine?: 'auto' | 'native' | 'js';
1310
+ /** 4.1: scroll axis, `'block'` (default) · `'inline'` · `'x'` · `'y'`. */
1311
+ axis?: 'block' | 'inline' | 'x' | 'y';
1312
+ }
1313
+ /** The function `scrub()` returns: call it to stop. `native` tells which engine runs it. */
1314
+ interface ScrubHandle {
1315
+ (): void;
1316
+ /** `true` when the browser's ScrollTimeline / ViewTimeline drives it (compositor, no JS per frame). */
1317
+ readonly native: boolean;
1302
1318
  }
1303
1319
  interface Timeline {
1304
1320
  /** Total length in ms. */
@@ -1322,8 +1338,14 @@ interface Timeline {
1322
1338
  seek(to: TimelinePosition): Timeline;
1323
1339
  /** Get or set progress 0–1. */
1324
1340
  progress(p?: number): number;
1325
- /** Tie progress to the scroll position of `source` (it moves through the viewport). Returns a stop function. */
1326
- scrub(source: Element, options?: ScrubOptions): () => void;
1341
+ /**
1342
+ * Tie progress to scroll: `source` moving through the viewport (or, with
1343
+ * `{ source: 'scroll' }`, a scroll container's own position). Runs on native
1344
+ * ScrollTimeline / ViewTimeline when available (and no `smooth`, `offset`,
1345
+ * `call()` cues or `onUpdate` need JS), else on a rAF-throttled listener.
1346
+ * Returns a stop function with a `native` flag.
1347
+ */
1348
+ scrub(source: Element, options?: ScrubOptions): ScrubHandle;
1327
1349
  /** Stop and drop every animation (elements keep their last frame). */
1328
1350
  cancel(): void;
1329
1351
  }
@@ -1337,7 +1359,9 @@ interface Timeline {
1337
1359
  * Attributes: `trigger` (`view` default · `click` · `manual`), `scrub`
1338
1360
  * (progress follows scroll instead of playing), `overlap` (ms each step
1339
1361
  * overlaps the previous, default 0), `duration` (600), `stagger` (ms),
1340
- * `repeat` (replay every time it enters the viewport). Methods: `play()`,
1362
+ * `repeat` (replay every time it enters the viewport). 4.1: `scrub` runs on native
1363
+ * ScrollTimeline / ViewTimeline when supported (`data-native` is set); `scrub="js"`,
1364
+ * `scrub="scroll"` and `smooth` tune it. Methods: `play()`,
1341
1365
  * `reverse()`, `seek(t)`; property `timeline`. Event `usa:complete`.
1342
1366
  * Reduced motion: steps appear in their final state.
1343
1367
  */
@@ -1671,26 +1695,12 @@ type UsaIntrinsicElements = {
1671
1695
  [K in Tags]: UsaAttributes;
1672
1696
  };
1673
1697
 
1674
- /**
1675
- * use-scroll-animate/components/solid — Solid integration (v3.8).
1676
- * Solid renders custom elements natively: set properties with `prop:` and
1677
- * listen with `on:` (`<usa-toggle prop:checked={on()} on:usa:change={…}>`).
1678
- * This entry adds `defineUsa()` (client only, SolidStart-safe), a `usa`
1679
- * directive for `use:usa={{ props, on }}`, and JSX types.
1680
- *
1681
- * ```tsx
1682
- * import { defineUsa, usa } from 'use-scroll-animate/components/solid';
1683
- * import type {} from 'use-scroll-animate/components/solid'; // JSX types
1684
- * onMount(() => defineUsa());
1685
- * false && usa; // keep the directive import (Solid convention)
1686
- * <usa-card use:usa={{ on: { flip: (e) => console.log(e.detail) } }} effect="flip">…</usa-card>
1687
- * ```
1688
- */
1689
-
1690
1698
  /**
1691
1699
  * Solid directive (`use:usa`). Solid calls it with the element and an
1692
- * accessor; the binding is read once on mount and re-read whenever
1693
- * `refresh()` on the returned handle is called (or wrap it in `createEffect`).
1700
+ * accessor; since 4.0.1 the binding is tracked with `createRenderEffect`, so
1701
+ * signals read inside `{{ props, on }}` update the element automatically and
1702
+ * the listeners are removed on cleanup. `refresh()` is kept for code that
1703
+ * calls the directive outside a reactive owner.
1694
1704
  */
1695
1705
  declare function usa(el: HTMLElement, accessor: () => UsaBinding | undefined): {
1696
1706
  refresh(): void;