motionary 9.6.0 → 9.8.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 (214) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/chunks/{audio-cgWbDkoY.cjs → audio-BpU-A1m1.cjs} +3 -3
  3. package/dist/chunks/{audio-cgWbDkoY.cjs.map → audio-BpU-A1m1.cjs.map} +1 -1
  4. package/dist/chunks/{audio-CynhhWDi.js → audio-D95jwlOh.js} +3 -3
  5. package/dist/chunks/{audio-CynhhWDi.js.map → audio-D95jwlOh.js.map} +1 -1
  6. package/dist/chunks/{base-CLuqlLfG.js → base-BnRyfuyM.js} +2 -2
  7. package/dist/chunks/base-BnRyfuyM.js.map +1 -0
  8. package/dist/chunks/{base-DoRUZBy-.cjs → base-DBheNxJu.cjs} +2 -2
  9. package/dist/chunks/base-DBheNxJu.cjs.map +1 -0
  10. package/dist/chunks/{builtins-ClXshqj-.cjs → builtins-CKKZNR95.cjs} +3 -3
  11. package/dist/chunks/{builtins-ClXshqj-.cjs.map → builtins-CKKZNR95.cjs.map} +1 -1
  12. package/dist/chunks/{builtins-Bs4smevg.js → builtins-CqIq1zBv.js} +3 -3
  13. package/dist/chunks/{builtins-Bs4smevg.js.map → builtins-CqIq1zBv.js.map} +1 -1
  14. package/dist/chunks/{core-O4grKHSa.cjs → core-D74Fz-dL.cjs} +2 -2
  15. package/dist/chunks/{core-O4grKHSa.cjs.map → core-D74Fz-dL.cjs.map} +1 -1
  16. package/dist/chunks/{core-CiN5sqxB.js → core-DsGoL9EY.js} +2 -2
  17. package/dist/chunks/{core-CiN5sqxB.js.map → core-DsGoL9EY.js.map} +1 -1
  18. package/dist/chunks/{core-CwO835Wm.cjs → core-MQlXZKUG.cjs} +2 -2
  19. package/dist/chunks/{core-CwO835Wm.cjs.map → core-MQlXZKUG.cjs.map} +1 -1
  20. package/dist/chunks/{core-C3Taz-ew.js → core-XA2yhn1b.js} +2 -2
  21. package/dist/chunks/{core-C3Taz-ew.js.map → core-XA2yhn1b.js.map} +1 -1
  22. package/dist/chunks/{fx-C-XjLOTc.cjs → fx-B_pbhpDp.cjs} +2 -2
  23. package/dist/chunks/{fx-C-XjLOTc.cjs.map → fx-B_pbhpDp.cjs.map} +1 -1
  24. package/dist/chunks/{fx-CQv3IxMf.js → fx-CtnrFEg9.js} +2 -2
  25. package/dist/chunks/{fx-CQv3IxMf.js.map → fx-CtnrFEg9.js.map} +1 -1
  26. package/dist/chunks/{gpu-CB8frFOD.js → gpu-CDcXiNA8.js} +2 -2
  27. package/dist/chunks/{gpu-CB8frFOD.js.map → gpu-CDcXiNA8.js.map} +1 -1
  28. package/dist/chunks/{gpu-CcdA2D2i.cjs → gpu-cUixt7kT.cjs} +2 -2
  29. package/dist/chunks/{gpu-CcdA2D2i.cjs.map → gpu-cUixt7kT.cjs.map} +1 -1
  30. package/dist/chunks/{manifest-PJ0h8RS_.js → manifest-D58HXVY-.js} +2 -2
  31. package/dist/chunks/{manifest-PJ0h8RS_.js.map → manifest-D58HXVY-.js.map} +1 -1
  32. package/dist/chunks/{manifest-B08-vo9G.cjs → manifest-PaF9B8Vt.cjs} +2 -2
  33. package/dist/chunks/{manifest-B08-vo9G.cjs.map → manifest-PaF9B8Vt.cjs.map} +1 -1
  34. package/dist/chunks/{player-YzQGkKaW.js → player-48Zy_NBG.js} +4 -4
  35. package/dist/chunks/{player-YzQGkKaW.js.map → player-48Zy_NBG.js.map} +1 -1
  36. package/dist/chunks/{player-C2n17sdH.cjs → player-C4y4jXSv.cjs} +4 -4
  37. package/dist/chunks/{player-C2n17sdH.cjs.map → player-C4y4jXSv.cjs.map} +1 -1
  38. package/dist/chunks/{registry-CnO7ZVPK.js → registry-gFJRpPES.js} +2 -2
  39. package/dist/chunks/{registry-CnO7ZVPK.js.map → registry-gFJRpPES.js.map} +1 -1
  40. package/dist/chunks/{registry-BVklOepd.cjs → registry-xQZnSqqV.cjs} +2 -2
  41. package/dist/chunks/{registry-BVklOepd.cjs.map → registry-xQZnSqqV.cjs.map} +1 -1
  42. package/dist/chunks/{spring-uQMVJTj9.cjs → spring-BlTQD2AV.cjs} +2 -2
  43. package/dist/chunks/{spring-uQMVJTj9.cjs.map → spring-BlTQD2AV.cjs.map} +1 -1
  44. package/dist/chunks/{spring-BFKNHmfl.js → spring-CZDNyqWp.js} +2 -2
  45. package/dist/chunks/{spring-BFKNHmfl.js.map → spring-CZDNyqWp.js.map} +1 -1
  46. package/dist/chunks/{variants-DagykrKH.cjs → variants-CrDDJoYK.cjs} +2 -2
  47. package/dist/chunks/{variants-DagykrKH.cjs.map → variants-CrDDJoYK.cjs.map} +1 -1
  48. package/dist/chunks/{variants-B-zKORvt.js → variants-GU3yIL4F.js} +2 -2
  49. package/dist/chunks/{variants-B-zKORvt.js.map → variants-GU3yIL4F.js.map} +1 -1
  50. package/dist/components/a11y.cjs +1 -1
  51. package/dist/components/a11y.js +2 -2
  52. package/dist/components/angular.cjs +8 -8
  53. package/dist/components/angular.js +8 -8
  54. package/dist/components/background.cjs +2 -2
  55. package/dist/components/background.js +2 -2
  56. package/dist/components/bridge.cjs +1 -1
  57. package/dist/components/bridge.js +1 -1
  58. package/dist/components/cards.cjs +2 -2
  59. package/dist/components/cards.js +2 -2
  60. package/dist/components/click.cjs +3 -3
  61. package/dist/components/click.js +3 -3
  62. package/dist/components/depth.cjs +3 -3
  63. package/dist/components/depth.js +3 -3
  64. package/dist/components/design.cjs +117 -0
  65. package/dist/components/design.cjs.map +1 -0
  66. package/dist/components/design.d.cts +82 -0
  67. package/dist/components/design.d.ts +82 -0
  68. package/dist/components/design.js +112 -0
  69. package/dist/components/design.js.map +1 -0
  70. package/dist/components/dsl.cjs +2 -2
  71. package/dist/components/dsl.js +2 -2
  72. package/dist/components/effects.cjs +7 -7
  73. package/dist/components/effects.js +9 -9
  74. package/dist/components/engine.cjs +1 -1
  75. package/dist/components/engine.js +2 -2
  76. package/dist/components/feedback.cjs +1 -1
  77. package/dist/components/feedback.js +1 -1
  78. package/dist/components/fx-3d.cjs +2 -2
  79. package/dist/components/fx-3d.js +2 -2
  80. package/dist/components/fx-ai.cjs +2 -2
  81. package/dist/components/fx-ai.js +2 -2
  82. package/dist/components/fx-chart.cjs +2 -2
  83. package/dist/components/fx-chart.js +2 -2
  84. package/dist/components/fx-cinema.cjs +2 -2
  85. package/dist/components/fx-cinema.js +2 -2
  86. package/dist/components/fx-cyber.cjs +2 -2
  87. package/dist/components/fx-cyber.js +2 -2
  88. package/dist/components/fx-festival.cjs +2 -2
  89. package/dist/components/fx-festival.js +2 -2
  90. package/dist/components/fx-focus.cjs +2 -2
  91. package/dist/components/fx-focus.js +2 -2
  92. package/dist/components/fx-form.cjs +2 -2
  93. package/dist/components/fx-form.js +2 -2
  94. package/dist/components/fx-game.cjs +2 -2
  95. package/dist/components/fx-game.js +2 -2
  96. package/dist/components/fx-genart.cjs +2 -2
  97. package/dist/components/fx-genart.js +2 -2
  98. package/dist/components/fx-geo.cjs +2 -2
  99. package/dist/components/fx-geo.js +2 -2
  100. package/dist/components/fx-gesture.cjs +2 -2
  101. package/dist/components/fx-gesture.js +2 -2
  102. package/dist/components/fx-gpu.cjs +3 -3
  103. package/dist/components/fx-gpu.js +3 -3
  104. package/dist/components/fx-light.cjs +2 -2
  105. package/dist/components/fx-light.js +2 -2
  106. package/dist/components/fx-lottie.cjs +2 -2
  107. package/dist/components/fx-lottie.js +2 -2
  108. package/dist/components/fx-morph.cjs +2 -2
  109. package/dist/components/fx-morph.js +2 -2
  110. package/dist/components/fx-music.cjs +3 -3
  111. package/dist/components/fx-music.js +3 -3
  112. package/dist/components/fx-organic.cjs +2 -2
  113. package/dist/components/fx-organic.js +2 -2
  114. package/dist/components/fx-paper.cjs +2 -2
  115. package/dist/components/fx-paper.js +2 -2
  116. package/dist/components/fx-perf.cjs +2 -2
  117. package/dist/components/fx-perf.js +2 -2
  118. package/dist/components/fx-physics.cjs +2 -2
  119. package/dist/components/fx-physics.js +2 -2
  120. package/dist/components/fx-retro.cjs +2 -2
  121. package/dist/components/fx-retro.js +2 -2
  122. package/dist/components/fx-safe.cjs +2 -2
  123. package/dist/components/fx-safe.js +2 -2
  124. package/dist/components/fx-shop.cjs +2 -2
  125. package/dist/components/fx-shop.js +2 -2
  126. package/dist/components/fx-social.cjs +2 -2
  127. package/dist/components/fx-social.js +2 -2
  128. package/dist/components/fx-spatial.cjs +2 -2
  129. package/dist/components/fx-spatial.js +2 -2
  130. package/dist/components/fx-surface.cjs +2 -2
  131. package/dist/components/fx-surface.js +2 -2
  132. package/dist/components/fx-text.cjs +2 -2
  133. package/dist/components/fx-text.js +2 -2
  134. package/dist/components/fx-transitions.cjs +3 -3
  135. package/dist/components/fx-transitions.js +3 -3
  136. package/dist/components/fx-video.cjs +2 -2
  137. package/dist/components/fx-video.js +2 -2
  138. package/dist/components/fx-weather.cjs +2 -2
  139. package/dist/components/fx-weather.js +2 -2
  140. package/dist/components/fx.cjs +5 -5
  141. package/dist/components/fx.js +6 -6
  142. package/dist/components/fx2.cjs +5 -5
  143. package/dist/components/fx2.js +6 -6
  144. package/dist/components/gesture.cjs +3 -3
  145. package/dist/components/gesture.js +4 -4
  146. package/dist/components/interaction.cjs +1 -1
  147. package/dist/components/interaction.js +1 -1
  148. package/dist/components/layout.cjs +1 -1
  149. package/dist/components/layout.js +1 -1
  150. package/dist/components/lite.cjs +1 -1
  151. package/dist/components/lite.cjs.map +1 -1
  152. package/dist/components/lite.js +1 -1
  153. package/dist/components/lite.js.map +1 -1
  154. package/dist/components/marketplace.cjs +3 -3
  155. package/dist/components/marketplace.js +4 -4
  156. package/dist/components/native.cjs +148 -0
  157. package/dist/components/native.cjs.map +1 -0
  158. package/dist/components/native.d.cts +94 -0
  159. package/dist/components/native.d.ts +94 -0
  160. package/dist/components/native.js +142 -0
  161. package/dist/components/native.js.map +1 -0
  162. package/dist/components/packs.cjs +1 -1
  163. package/dist/components/packs.js +1 -1
  164. package/dist/components/page.cjs +2 -2
  165. package/dist/components/page.js +3 -3
  166. package/dist/components/perf.cjs +1 -1
  167. package/dist/components/perf.js +2 -2
  168. package/dist/components/physics.cjs +2 -2
  169. package/dist/components/physics.js +3 -3
  170. package/dist/components/reveal.cjs +1 -1
  171. package/dist/components/reveal.js +1 -1
  172. package/dist/components/solid.cjs +8 -8
  173. package/dist/components/solid.js +8 -8
  174. package/dist/components/svelte.cjs +8 -8
  175. package/dist/components/svelte.js +8 -8
  176. package/dist/components/svg.cjs +1 -1
  177. package/dist/components/svg.js +1 -1
  178. package/dist/components/text.cjs +2 -2
  179. package/dist/components/text.js +2 -2
  180. package/dist/components/timeline.cjs +2 -2
  181. package/dist/components/timeline.js +3 -3
  182. package/dist/components/transitions.cjs +1 -1
  183. package/dist/components/transitions.js +1 -1
  184. package/dist/components/ui.cjs +3 -3
  185. package/dist/components/ui.js +4 -4
  186. package/dist/components/vue.cjs +8 -8
  187. package/dist/components/vue.js +8 -8
  188. package/dist/components/webgl.cjs +1 -1
  189. package/dist/components/webgl.js +1 -1
  190. package/dist/components/widgets.cjs +375 -239
  191. package/dist/components/widgets.cjs.map +1 -1
  192. package/dist/components/widgets.d.cts +33 -2
  193. package/dist/components/widgets.d.ts +33 -2
  194. package/dist/components/widgets.js +374 -240
  195. package/dist/components/widgets.js.map +1 -1
  196. package/dist/components.cjs +8 -8
  197. package/dist/components.js +10 -10
  198. package/dist/components.umd.js +1 -1
  199. package/dist/components.umd.js.map +1 -1
  200. package/dist/index.cjs +2 -2
  201. package/dist/index.js +2 -2
  202. package/dist/index.umd.js +1 -1
  203. package/dist/index.umd.js.map +1 -1
  204. package/dist/widgets.umd.js +1 -1
  205. package/dist/widgets.umd.js.map +1 -1
  206. package/docs/ROADMAP.md +2 -2
  207. package/docs/components.md +29 -0
  208. package/figma-plugin/README.md +9 -0
  209. package/figma-plugin/code.js +26 -0
  210. package/figma-plugin/manifest.json +9 -0
  211. package/figma-plugin/ui.html +10 -0
  212. package/package.json +43 -2
  213. package/dist/chunks/base-CLuqlLfG.js.map +0 -1
  214. package/dist/chunks/base-DoRUZBy-.cjs.map +0 -1
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ var components_dsl = require('./dsl.cjs');
4
+ var core = require('../chunks/core-MQlXZKUG.cjs');
5
+ require('../chunks/registry-xQZnSqqV.cjs');
6
+ require('../chunks/base-DBheNxJu.cjs');
7
+ require('./tokens.cjs');
8
+
9
+ /**
10
+ * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool
11
+ * integration.
12
+ *
13
+ * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API
14
+ * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with
15
+ * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE
16
+ * transitions, easing and duration) → a Motionary DSL string for
17
+ * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.
18
+ * - `framerComponent(desc, { name })` — a Framer code component (React,
19
+ * property controls for every attribute) from the 8.9 component JSON.
20
+ * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the
21
+ * entrance rules of a motion string (timeline presets), for hand-off to
22
+ * teams without JS.
23
+ * - `easingPoints(easing)` — the cubic-bezier control points of a CSS
24
+ * easing (named or `cubic-bezier(…)`), for spec sheets.
25
+ */
26
+ const EASE = {
27
+ linear: [0, 0, 1, 1],
28
+ ease: [0.25, 0.1, 0.25, 1],
29
+ 'ease-in': [0.42, 0, 1, 1],
30
+ 'ease-out': [0, 0, 0.58, 1],
31
+ 'ease-in-out': [0.42, 0, 0.58, 1],
32
+ };
33
+ /** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */
34
+ function easingPoints(easing = 'ease') {
35
+ const m = easing.match(/cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)/);
36
+ if (m)
37
+ return [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])];
38
+ return EASE[easing] || EASE.ease;
39
+ }
40
+ const FIGMA_EASE = { LINEAR: 'linear', EASE_IN: 'ease-in', EASE_OUT: 'ease-out', EASE_IN_AND_OUT: 'ease-in-out', EASE_IN_BACK: 'cubic-bezier(0.36, 0, 0.66, -0.56)', EASE_OUT_BACK: 'spring', EASE_IN_AND_OUT_BACK: 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', GENTLE: 'smooth', QUICK: 'ease-out', BOUNCY: 'spring', SLOW: 'ease-in-out' };
41
+ const FIGMA_TRIGGER = { ON_CLICK: 'click', ON_PRESS: 'click', ON_HOVER: 'hover', MOUSE_ENTER: 'hover', AFTER_TIMEOUT: 'load', ON_DRAG: 'click' };
42
+ const dirFx = (d, base) => {
43
+ const m = { LEFT: 'left', RIGHT: 'right', TOP: 'down', BOTTOM: 'up' };
44
+ return `fade-${m[d || 'BOTTOM'] || 'up'}` ;
45
+ };
46
+ /** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */
47
+ function figmaToMotion(reactions) {
48
+ const rules = [];
49
+ for (const r of reactions || []) {
50
+ const trig = FIGMA_TRIGGER[r?.trigger?.type];
51
+ const tr = r?.action?.transition ?? r?.actions?.[0]?.transition;
52
+ if (!trig || !tr)
53
+ continue;
54
+ const effect = tr.type === 'DISSOLVE' ? 'fade' : tr.type === 'SMART_ANIMATE' || tr.type === 'SCROLL_ANIMATE' ? 'scale' : tr.type === 'MOVE_IN' || tr.type === 'PUSH' ? dirFx(tr.direction) : tr.type === 'SLIDE_IN' ? dirFx(tr.direction) : 'fade';
55
+ const rule = { trigger: (r.trigger.type === 'AFTER_TIMEOUT' ? 'load' : trig), effect, options: {} };
56
+ if (typeof tr.duration === 'number')
57
+ rule.duration = Math.round(tr.duration * 1000);
58
+ const e = tr.easing?.type ? FIGMA_EASE[tr.easing.type] : undefined;
59
+ if (e)
60
+ rule.easing = e === 'spring' ? 'cubic-bezier(0.34, 1.56, 0.64, 1)' : e === 'smooth' ? 'cubic-bezier(0.22, 1, 0.36, 1)' : e;
61
+ if (tr.easing?.easingFunctionCubicBezier) {
62
+ const b = tr.easing.easingFunctionCubicBezier;
63
+ rule.easing = `cubic-bezier(${b.x1}, ${b.y1}, ${b.x2}, ${b.y2})`;
64
+ }
65
+ if (r.trigger.type === 'AFTER_TIMEOUT' && typeof r.trigger.timeout === 'number')
66
+ rule.delay = Math.round(r.trigger.timeout * 1000);
67
+ rules.push(rule);
68
+ }
69
+ return components_dsl.serializeMotion(rules);
70
+ }
71
+ const pascal = (s) => s.replace(/(^|[-_\s]+)([a-z0-9])/gi, (_, __, c) => c.toUpperCase()).replace(/[^A-Za-z0-9]/g, '') || 'Component';
72
+ /** A Framer code component (TSX source) for a component description (9.7). */
73
+ function framerComponent(desc, opts = {}) {
74
+ const d = typeof desc === 'string' ? JSON.parse(desc) : desc;
75
+ const name = pascal(opts.name || d.tag.replace(/^usa-/, ''));
76
+ const attrs = Object.entries(d.attrs || {}).filter(([k]) => /^[a-z][\w-]*$/.test(k));
77
+ const prop = (k) => k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
78
+ const controls = attrs.map(([k, v]) => ` ${prop(k)}: { type: ${!isNaN(Number(v)) && v !== '' ? 'ControlType.Number' : v === '' ? 'ControlType.Boolean' : 'ControlType.String'}, defaultValue: ${!isNaN(Number(v)) && v !== '' ? Number(v) : v === '' ? 'true' : JSON.stringify(v)} },`).join('\n');
79
+ const jsxAttrs = attrs.map(([k]) => ` ${k === 'class' ? 'className' : k}={${v(prop(k))}}`).join('');
80
+ function v(p) {
81
+ return `props.${p}`;
82
+ }
83
+ const kids = (d.children || []).map((c) => (typeof c === 'string' ? c.replace(/[{}<>]/g, '') : '')).join(' ').trim();
84
+ return `// Framer code component generated by motionary/design (9.7)\nimport { useEffect } from "react"\nimport { addPropertyControls, ControlType } from "framer"\nimport { defineWidgets } from "https://cdn.jsdelivr.net/npm/motionary/dist/components/widgets.js"\n\nexport default function ${name}(props) {\n useEffect(() => defineWidgets(), [])\n return <${d.tag}${jsxAttrs}>${kids}</${d.tag}>\n}\n\naddPropertyControls(${name}, {\n${controls}\n})\n`;
85
+ }
86
+ /** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */
87
+ function motionToCss(rules, selector = '.motion') {
88
+ const rs = typeof rules === 'string' ? components_dsl.parseMotion(rules).rules : rules;
89
+ const out = [];
90
+ const done = new Set();
91
+ for (const r of rs) {
92
+ if (r.trigger !== 'enter' && r.trigger !== 'load')
93
+ continue;
94
+ const kf = core.TIMELINE_PRESETS[r.effect];
95
+ if (!kf)
96
+ continue;
97
+ const name = `usa-${r.effect}`;
98
+ if (!done.has(name)) {
99
+ done.add(name);
100
+ const steps = kf.map((f, i) => ` ${Math.round((f.offset != null ? Number(f.offset) : i / Math.max(1, kf.length - 1)) * 100)}% { ${Object.entries(f).filter(([k]) => k !== 'offset' && k !== 'easing').map(([k, val]) => `${k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}: ${val}`).join('; ')} }`);
101
+ out.push(`@keyframes ${name} {\n${steps.join('\n')}\n}`);
102
+ }
103
+ const target = r.stagger != null ? `${selector} > *` : selector;
104
+ out.push(`${target} { animation: ${name} ${r.duration ?? 600}ms ${r.easing || 'cubic-bezier(0.22, 1, 0.36, 1)'} ${r.delay ?? 0}ms both; }`);
105
+ if (r.stagger != null)
106
+ for (let i = 2; i <= 8; i++)
107
+ out.push(`${selector} > :nth-child(${i}) { animation-delay: ${(r.delay ?? 0) + r.stagger * (i - 1)}ms; }`);
108
+ }
109
+ out.push(`@media (prefers-reduced-motion: reduce) { ${selector}, ${selector} > * { animation: none !important; } }`);
110
+ return out.join('\n');
111
+ }
112
+
113
+ exports.easingPoints = easingPoints;
114
+ exports.figmaToMotion = figmaToMotion;
115
+ exports.framerComponent = framerComponent;
116
+ exports.motionToCss = motionToCss;
117
+ //# sourceMappingURL=design.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design.cjs","sources":["../../src/components/design/index.ts"],"sourcesContent":["/**\n * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool\n * integration.\n *\n * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API\n * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with\n * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE\n * transitions, easing and duration) → a Motionary DSL string for\n * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.\n * - `framerComponent(desc, { name })` — a Framer code component (React,\n * property controls for every attribute) from the 8.9 component JSON.\n * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the\n * entrance rules of a motion string (timeline presets), for hand-off to\n * teams without JS.\n * - `easingPoints(easing)` — the cubic-bezier control points of a CSS\n * easing (named or `cubic-bezier(…)`), for spec sheets.\n */\nimport { parseMotion, serializeMotion, type MotionRule, type ComponentJSON } from '../dsl/index';\nimport { TIMELINE_PRESETS } from '../timeline/core';\n\nconst EASE: Record<string, [number, number, number, number]> = {\n linear: [0, 0, 1, 1],\n ease: [0.25, 0.1, 0.25, 1],\n 'ease-in': [0.42, 0, 1, 1],\n 'ease-out': [0, 0, 0.58, 1],\n 'ease-in-out': [0.42, 0, 0.58, 1],\n};\n/** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */\nexport function easingPoints(easing = 'ease'): [number, number, number, number] {\n const m = easing.match(/cubic-bezier\\(\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*\\)/);\n if (m) return [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])];\n return EASE[easing] || EASE.ease;\n}\n\nconst FIGMA_EASE: Record<string, string> = { LINEAR: 'linear', EASE_IN: 'ease-in', EASE_OUT: 'ease-out', EASE_IN_AND_OUT: 'ease-in-out', EASE_IN_BACK: 'cubic-bezier(0.36, 0, 0.66, -0.56)', EASE_OUT_BACK: 'spring', EASE_IN_AND_OUT_BACK: 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', GENTLE: 'smooth', QUICK: 'ease-out', BOUNCY: 'spring', SLOW: 'ease-in-out' };\nconst FIGMA_TRIGGER: Record<string, string> = { ON_CLICK: 'click', ON_PRESS: 'click', ON_HOVER: 'hover', MOUSE_ENTER: 'hover', AFTER_TIMEOUT: 'load', ON_DRAG: 'click' };\nconst dirFx = (d: string | undefined, base: 'fade' | 'slide') => {\n const m: Record<string, string> = { LEFT: 'left', RIGHT: 'right', TOP: 'down', BOTTOM: 'up' };\n return base === 'fade' ? `fade-${m[d || 'BOTTOM'] || 'up'}` : `slide-${m[d || 'BOTTOM'] || 'up'}`;\n};\n/** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */\nexport function figmaToMotion(reactions: any[]): string {\n const rules: MotionRule[] = [];\n for (const r of reactions || []) {\n const trig = FIGMA_TRIGGER[r?.trigger?.type];\n const tr = r?.action?.transition ?? r?.actions?.[0]?.transition;\n if (!trig || !tr) continue;\n const effect = tr.type === 'DISSOLVE' ? 'fade' : tr.type === 'SMART_ANIMATE' || tr.type === 'SCROLL_ANIMATE' ? 'scale' : tr.type === 'MOVE_IN' || tr.type === 'PUSH' ? dirFx(tr.direction, 'fade') : tr.type === 'SLIDE_IN' ? dirFx(tr.direction, 'fade') : 'fade';\n const rule: MotionRule = { trigger: (r.trigger.type === 'AFTER_TIMEOUT' ? 'load' : trig) as MotionRule['trigger'], effect, options: {} };\n if (typeof tr.duration === 'number') rule.duration = Math.round(tr.duration * 1000);\n const e = tr.easing?.type ? FIGMA_EASE[tr.easing.type] : undefined;\n if (e) rule.easing = e === 'spring' ? 'cubic-bezier(0.34, 1.56, 0.64, 1)' : e === 'smooth' ? 'cubic-bezier(0.22, 1, 0.36, 1)' : e;\n if (tr.easing?.easingFunctionCubicBezier) {\n const b = tr.easing.easingFunctionCubicBezier;\n rule.easing = `cubic-bezier(${b.x1}, ${b.y1}, ${b.x2}, ${b.y2})`;\n }\n if (r.trigger.type === 'AFTER_TIMEOUT' && typeof r.trigger.timeout === 'number') rule.delay = Math.round(r.trigger.timeout * 1000);\n rules.push(rule);\n }\n return serializeMotion(rules);\n}\n\nconst pascal = (s: string) => s.replace(/(^|[-_\\s]+)([a-z0-9])/gi, (_, __, c) => c.toUpperCase()).replace(/[^A-Za-z0-9]/g, '') || 'Component';\n/** A Framer code component (TSX source) for a component description (9.7). */\nexport function framerComponent(desc: ComponentJSON | string, opts: { name?: string } = {}): string {\n const d: ComponentJSON = typeof desc === 'string' ? JSON.parse(desc) : desc;\n const name = pascal(opts.name || d.tag.replace(/^usa-/, ''));\n const attrs = Object.entries(d.attrs || {}).filter(([k]) => /^[a-z][\\w-]*$/.test(k));\n const prop = (k: string) => k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n const controls = attrs.map(([k, v]) => ` ${prop(k)}: { type: ${!isNaN(Number(v)) && v !== '' ? 'ControlType.Number' : v === '' ? 'ControlType.Boolean' : 'ControlType.String'}, defaultValue: ${!isNaN(Number(v)) && v !== '' ? Number(v) : v === '' ? 'true' : JSON.stringify(v)} },`).join('\\n');\n const jsxAttrs = attrs.map(([k]) => ` ${k === 'class' ? 'className' : k}={${v(prop(k))}}`).join('');\n function v(p: string) {\n return `props.${p}`;\n }\n const kids = (d.children || []).map((c) => (typeof c === 'string' ? c.replace(/[{}<>]/g, '') : '')).join(' ').trim();\n return `// Framer code component generated by motionary/design (9.7)\\nimport { useEffect } from \"react\"\\nimport { addPropertyControls, ControlType } from \"framer\"\\nimport { defineWidgets } from \"https://cdn.jsdelivr.net/npm/motionary/dist/components/widgets.js\"\\n\\nexport default function ${name}(props) {\\n useEffect(() => defineWidgets(), [])\\n return <${d.tag}${jsxAttrs}>${kids}</${d.tag}>\\n}\\n\\naddPropertyControls(${name}, {\\n${controls}\\n})\\n`;\n}\n\n/** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */\nexport function motionToCss(rules: string | MotionRule[], selector = '.motion'): string {\n const rs = typeof rules === 'string' ? parseMotion(rules).rules : rules;\n const out: string[] = [];\n const done = new Set<string>();\n for (const r of rs) {\n if (r.trigger !== 'enter' && r.trigger !== 'load') continue;\n const kf = TIMELINE_PRESETS[r.effect];\n if (!kf) continue;\n const name = `usa-${r.effect}`;\n if (!done.has(name)) {\n done.add(name);\n const steps = kf.map((f, i) => ` ${Math.round((f.offset != null ? Number(f.offset) : i / Math.max(1, kf.length - 1)) * 100)}% { ${Object.entries(f).filter(([k]) => k !== 'offset' && k !== 'easing').map(([k, val]) => `${k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}: ${val}`).join('; ')} }`);\n out.push(`@keyframes ${name} {\\n${steps.join('\\n')}\\n}`);\n }\n const target = r.stagger != null ? `${selector} > *` : selector;\n out.push(`${target} { animation: ${name} ${r.duration ?? 600}ms ${r.easing || 'cubic-bezier(0.22, 1, 0.36, 1)'} ${r.delay ?? 0}ms both; }`);\n if (r.stagger != null) for (let i = 2; i <= 8; i++) out.push(`${selector} > :nth-child(${i}) { animation-delay: ${(r.delay ?? 0) + r.stagger * (i - 1)}ms; }`);\n }\n out.push(`@media (prefers-reduced-motion: reduce) { ${selector}, ${selector} > * { animation: none !important; } }`);\n return out.join('\\n');\n}\n"],"names":["serializeMotion","parseMotion","TIMELINE_PRESETS"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAIH,MAAM,IAAI,GAAqD;IAC7D,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1B,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC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EAAE;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAA,EAAG,QAAQ,CAAA,cAAA,EAAiB,CAAC,CAAA,qBAAA,EAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA,KAAA,CAAO,CAAC;IAChK;IACA,GAAG,CAAC,IAAI,CAAC,CAAA,0CAAA,EAA6C,QAAQ,CAAA,EAAA,EAAK,QAAQ,CAAA,sCAAA,CAAwC,CAAC;AACpH,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AACvB;;;;;;;"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
3
+ * yours) is a plain object registered once and played the same way:
4
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
5
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
6
+ * already applies reduced motion, motion sensitivity, intensity and the
7
+ * animation budget.
8
+ */
9
+
10
+ declare const EFFECT_TRIGGERS: readonly ["click", "hover", "enter", "load", "loop", "manual"];
11
+ type EffectTrigger = (typeof EFFECT_TRIGGERS)[number];
12
+
13
+ /**
14
+ * `motionary/dsl` (= `motionary/components/dsl`, 9.0) — the declarative
15
+ * motion DSL. Describe motion as one readable string instead of code:
16
+ *
17
+ * ```html
18
+ * <section data-motion="enter: fade-up 600ms ease-out stagger 80ms; hover: pop; click: confetti count=40">
19
+ * ```
20
+ *
21
+ * Grammar — rules separated by `;`, each `trigger: effect [modifiers…]`:
22
+ * - trigger: `enter` · `click` · `hover` · `load` · `loop` · `manual`
23
+ * - effect: any registered effect name (timeline presets, packs, plugins)
24
+ * - modifiers: a duration (`600ms` / `0.6s`), `delay 120ms`,
25
+ * `stagger 80ms` (children one after another), an easing (`ease-out`,
26
+ * `linear`, `spring`, `cubic-bezier(…)`, `steps(…)`), `once`, and
27
+ * `key=value` effect options (numbers / booleans parsed).
28
+ *
29
+ * `parseMotion()` → rules + errors, `serializeMotion()` back to a string,
30
+ * `motion\`…\`` tagged template, `applyMotion(root)` binds every
31
+ * `[data-motion]` under `root` (and watches for new ones with `observe`),
32
+ * `bindMotion(el, rules)` for one element, and `createComponent(json)`
33
+ * builds live markup from the 8.9 `describeComponent()` JSON.
34
+ */
35
+
36
+ interface MotionRule {
37
+ trigger: EffectTrigger;
38
+ effect: string;
39
+ duration?: number;
40
+ delay?: number;
41
+ stagger?: number;
42
+ easing?: string;
43
+ once?: boolean;
44
+ options: Record<string, string | number | boolean>;
45
+ }
46
+ interface ComponentJSON {
47
+ $schema?: string;
48
+ tag: string;
49
+ attrs?: Record<string, string>;
50
+ children?: (ComponentJSON | string)[];
51
+ }
52
+
53
+ /**
54
+ * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool
55
+ * integration.
56
+ *
57
+ * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API
58
+ * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with
59
+ * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE
60
+ * transitions, easing and duration) → a Motionary DSL string for
61
+ * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.
62
+ * - `framerComponent(desc, { name })` — a Framer code component (React,
63
+ * property controls for every attribute) from the 8.9 component JSON.
64
+ * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the
65
+ * entrance rules of a motion string (timeline presets), for hand-off to
66
+ * teams without JS.
67
+ * - `easingPoints(easing)` — the cubic-bezier control points of a CSS
68
+ * easing (named or `cubic-bezier(…)`), for spec sheets.
69
+ */
70
+
71
+ /** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */
72
+ declare function easingPoints(easing?: string): [number, number, number, number];
73
+ /** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */
74
+ declare function figmaToMotion(reactions: any[]): string;
75
+ /** A Framer code component (TSX source) for a component description (9.7). */
76
+ declare function framerComponent(desc: ComponentJSON | string, opts?: {
77
+ name?: string;
78
+ }): string;
79
+ /** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */
80
+ declare function motionToCss(rules: string | MotionRule[], selector?: string): string;
81
+
82
+ export { easingPoints, figmaToMotion, framerComponent, motionToCss };
@@ -0,0 +1,82 @@
1
+ /**
2
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
3
+ * yours) is a plain object registered once and played the same way:
4
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
5
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
6
+ * already applies reduced motion, motion sensitivity, intensity and the
7
+ * animation budget.
8
+ */
9
+
10
+ declare const EFFECT_TRIGGERS: readonly ["click", "hover", "enter", "load", "loop", "manual"];
11
+ type EffectTrigger = (typeof EFFECT_TRIGGERS)[number];
12
+
13
+ /**
14
+ * `motionary/dsl` (= `motionary/components/dsl`, 9.0) — the declarative
15
+ * motion DSL. Describe motion as one readable string instead of code:
16
+ *
17
+ * ```html
18
+ * <section data-motion="enter: fade-up 600ms ease-out stagger 80ms; hover: pop; click: confetti count=40">
19
+ * ```
20
+ *
21
+ * Grammar — rules separated by `;`, each `trigger: effect [modifiers…]`:
22
+ * - trigger: `enter` · `click` · `hover` · `load` · `loop` · `manual`
23
+ * - effect: any registered effect name (timeline presets, packs, plugins)
24
+ * - modifiers: a duration (`600ms` / `0.6s`), `delay 120ms`,
25
+ * `stagger 80ms` (children one after another), an easing (`ease-out`,
26
+ * `linear`, `spring`, `cubic-bezier(…)`, `steps(…)`), `once`, and
27
+ * `key=value` effect options (numbers / booleans parsed).
28
+ *
29
+ * `parseMotion()` → rules + errors, `serializeMotion()` back to a string,
30
+ * `motion\`…\`` tagged template, `applyMotion(root)` binds every
31
+ * `[data-motion]` under `root` (and watches for new ones with `observe`),
32
+ * `bindMotion(el, rules)` for one element, and `createComponent(json)`
33
+ * builds live markup from the 8.9 `describeComponent()` JSON.
34
+ */
35
+
36
+ interface MotionRule {
37
+ trigger: EffectTrigger;
38
+ effect: string;
39
+ duration?: number;
40
+ delay?: number;
41
+ stagger?: number;
42
+ easing?: string;
43
+ once?: boolean;
44
+ options: Record<string, string | number | boolean>;
45
+ }
46
+ interface ComponentJSON {
47
+ $schema?: string;
48
+ tag: string;
49
+ attrs?: Record<string, string>;
50
+ children?: (ComponentJSON | string)[];
51
+ }
52
+
53
+ /**
54
+ * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool
55
+ * integration.
56
+ *
57
+ * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API
58
+ * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with
59
+ * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE
60
+ * transitions, easing and duration) → a Motionary DSL string for
61
+ * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.
62
+ * - `framerComponent(desc, { name })` — a Framer code component (React,
63
+ * property controls for every attribute) from the 8.9 component JSON.
64
+ * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the
65
+ * entrance rules of a motion string (timeline presets), for hand-off to
66
+ * teams without JS.
67
+ * - `easingPoints(easing)` — the cubic-bezier control points of a CSS
68
+ * easing (named or `cubic-bezier(…)`), for spec sheets.
69
+ */
70
+
71
+ /** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */
72
+ declare function easingPoints(easing?: string): [number, number, number, number];
73
+ /** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */
74
+ declare function figmaToMotion(reactions: any[]): string;
75
+ /** A Framer code component (TSX source) for a component description (9.7). */
76
+ declare function framerComponent(desc: ComponentJSON | string, opts?: {
77
+ name?: string;
78
+ }): string;
79
+ /** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */
80
+ declare function motionToCss(rules: string | MotionRule[], selector?: string): string;
81
+
82
+ export { easingPoints, figmaToMotion, framerComponent, motionToCss };
@@ -0,0 +1,112 @@
1
+ import { serializeMotion, parseMotion } from './dsl.js';
2
+ import { T as TIMELINE_PRESETS } from '../chunks/core-DsGoL9EY.js';
3
+ import '../chunks/registry-gFJRpPES.js';
4
+ import '../chunks/base-BnRyfuyM.js';
5
+ import './tokens.js';
6
+
7
+ /**
8
+ * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool
9
+ * integration.
10
+ *
11
+ * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API
12
+ * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with
13
+ * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE
14
+ * transitions, easing and duration) → a Motionary DSL string for
15
+ * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.
16
+ * - `framerComponent(desc, { name })` — a Framer code component (React,
17
+ * property controls for every attribute) from the 8.9 component JSON.
18
+ * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the
19
+ * entrance rules of a motion string (timeline presets), for hand-off to
20
+ * teams without JS.
21
+ * - `easingPoints(easing)` — the cubic-bezier control points of a CSS
22
+ * easing (named or `cubic-bezier(…)`), for spec sheets.
23
+ */
24
+ const EASE = {
25
+ linear: [0, 0, 1, 1],
26
+ ease: [0.25, 0.1, 0.25, 1],
27
+ 'ease-in': [0.42, 0, 1, 1],
28
+ 'ease-out': [0, 0, 0.58, 1],
29
+ 'ease-in-out': [0.42, 0, 0.58, 1],
30
+ };
31
+ /** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */
32
+ function easingPoints(easing = 'ease') {
33
+ const m = easing.match(/cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)/);
34
+ if (m)
35
+ return [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])];
36
+ return EASE[easing] || EASE.ease;
37
+ }
38
+ const FIGMA_EASE = { LINEAR: 'linear', EASE_IN: 'ease-in', EASE_OUT: 'ease-out', EASE_IN_AND_OUT: 'ease-in-out', EASE_IN_BACK: 'cubic-bezier(0.36, 0, 0.66, -0.56)', EASE_OUT_BACK: 'spring', EASE_IN_AND_OUT_BACK: 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', GENTLE: 'smooth', QUICK: 'ease-out', BOUNCY: 'spring', SLOW: 'ease-in-out' };
39
+ const FIGMA_TRIGGER = { ON_CLICK: 'click', ON_PRESS: 'click', ON_HOVER: 'hover', MOUSE_ENTER: 'hover', AFTER_TIMEOUT: 'load', ON_DRAG: 'click' };
40
+ const dirFx = (d, base) => {
41
+ const m = { LEFT: 'left', RIGHT: 'right', TOP: 'down', BOTTOM: 'up' };
42
+ return `fade-${m[d || 'BOTTOM'] || 'up'}` ;
43
+ };
44
+ /** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */
45
+ function figmaToMotion(reactions) {
46
+ const rules = [];
47
+ for (const r of reactions || []) {
48
+ const trig = FIGMA_TRIGGER[r?.trigger?.type];
49
+ const tr = r?.action?.transition ?? r?.actions?.[0]?.transition;
50
+ if (!trig || !tr)
51
+ continue;
52
+ const effect = tr.type === 'DISSOLVE' ? 'fade' : tr.type === 'SMART_ANIMATE' || tr.type === 'SCROLL_ANIMATE' ? 'scale' : tr.type === 'MOVE_IN' || tr.type === 'PUSH' ? dirFx(tr.direction) : tr.type === 'SLIDE_IN' ? dirFx(tr.direction) : 'fade';
53
+ const rule = { trigger: (r.trigger.type === 'AFTER_TIMEOUT' ? 'load' : trig), effect, options: {} };
54
+ if (typeof tr.duration === 'number')
55
+ rule.duration = Math.round(tr.duration * 1000);
56
+ const e = tr.easing?.type ? FIGMA_EASE[tr.easing.type] : undefined;
57
+ if (e)
58
+ rule.easing = e === 'spring' ? 'cubic-bezier(0.34, 1.56, 0.64, 1)' : e === 'smooth' ? 'cubic-bezier(0.22, 1, 0.36, 1)' : e;
59
+ if (tr.easing?.easingFunctionCubicBezier) {
60
+ const b = tr.easing.easingFunctionCubicBezier;
61
+ rule.easing = `cubic-bezier(${b.x1}, ${b.y1}, ${b.x2}, ${b.y2})`;
62
+ }
63
+ if (r.trigger.type === 'AFTER_TIMEOUT' && typeof r.trigger.timeout === 'number')
64
+ rule.delay = Math.round(r.trigger.timeout * 1000);
65
+ rules.push(rule);
66
+ }
67
+ return serializeMotion(rules);
68
+ }
69
+ const pascal = (s) => s.replace(/(^|[-_\s]+)([a-z0-9])/gi, (_, __, c) => c.toUpperCase()).replace(/[^A-Za-z0-9]/g, '') || 'Component';
70
+ /** A Framer code component (TSX source) for a component description (9.7). */
71
+ function framerComponent(desc, opts = {}) {
72
+ const d = typeof desc === 'string' ? JSON.parse(desc) : desc;
73
+ const name = pascal(opts.name || d.tag.replace(/^usa-/, ''));
74
+ const attrs = Object.entries(d.attrs || {}).filter(([k]) => /^[a-z][\w-]*$/.test(k));
75
+ const prop = (k) => k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
76
+ const controls = attrs.map(([k, v]) => ` ${prop(k)}: { type: ${!isNaN(Number(v)) && v !== '' ? 'ControlType.Number' : v === '' ? 'ControlType.Boolean' : 'ControlType.String'}, defaultValue: ${!isNaN(Number(v)) && v !== '' ? Number(v) : v === '' ? 'true' : JSON.stringify(v)} },`).join('\n');
77
+ const jsxAttrs = attrs.map(([k]) => ` ${k === 'class' ? 'className' : k}={${v(prop(k))}}`).join('');
78
+ function v(p) {
79
+ return `props.${p}`;
80
+ }
81
+ const kids = (d.children || []).map((c) => (typeof c === 'string' ? c.replace(/[{}<>]/g, '') : '')).join(' ').trim();
82
+ return `// Framer code component generated by motionary/design (9.7)\nimport { useEffect } from "react"\nimport { addPropertyControls, ControlType } from "framer"\nimport { defineWidgets } from "https://cdn.jsdelivr.net/npm/motionary/dist/components/widgets.js"\n\nexport default function ${name}(props) {\n useEffect(() => defineWidgets(), [])\n return <${d.tag}${jsxAttrs}>${kids}</${d.tag}>\n}\n\naddPropertyControls(${name}, {\n${controls}\n})\n`;
83
+ }
84
+ /** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */
85
+ function motionToCss(rules, selector = '.motion') {
86
+ const rs = typeof rules === 'string' ? parseMotion(rules).rules : rules;
87
+ const out = [];
88
+ const done = new Set();
89
+ for (const r of rs) {
90
+ if (r.trigger !== 'enter' && r.trigger !== 'load')
91
+ continue;
92
+ const kf = TIMELINE_PRESETS[r.effect];
93
+ if (!kf)
94
+ continue;
95
+ const name = `usa-${r.effect}`;
96
+ if (!done.has(name)) {
97
+ done.add(name);
98
+ const steps = kf.map((f, i) => ` ${Math.round((f.offset != null ? Number(f.offset) : i / Math.max(1, kf.length - 1)) * 100)}% { ${Object.entries(f).filter(([k]) => k !== 'offset' && k !== 'easing').map(([k, val]) => `${k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}: ${val}`).join('; ')} }`);
99
+ out.push(`@keyframes ${name} {\n${steps.join('\n')}\n}`);
100
+ }
101
+ const target = r.stagger != null ? `${selector} > *` : selector;
102
+ out.push(`${target} { animation: ${name} ${r.duration ?? 600}ms ${r.easing || 'cubic-bezier(0.22, 1, 0.36, 1)'} ${r.delay ?? 0}ms both; }`);
103
+ if (r.stagger != null)
104
+ for (let i = 2; i <= 8; i++)
105
+ out.push(`${selector} > :nth-child(${i}) { animation-delay: ${(r.delay ?? 0) + r.stagger * (i - 1)}ms; }`);
106
+ }
107
+ out.push(`@media (prefers-reduced-motion: reduce) { ${selector}, ${selector} > * { animation: none !important; } }`);
108
+ return out.join('\n');
109
+ }
110
+
111
+ export { easingPoints, figmaToMotion, framerComponent, motionToCss };
112
+ //# sourceMappingURL=design.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design.js","sources":["../../src/components/design/index.ts"],"sourcesContent":["/**\n * `motionary/design` (= `motionary/components/design`, 9.7) — design-tool\n * integration.\n *\n * - `figmaToMotion(reactions)` — Figma prototype reactions (plugin API\n * `node.reactions`: ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT with\n * DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH / SCROLL_ANIMATE\n * transitions, easing and duration) → a Motionary DSL string for\n * `data-motion`. The `figma-plugin/` scaffold in the repo uses it.\n * - `framerComponent(desc, { name })` — a Framer code component (React,\n * property controls for every attribute) from the 8.9 component JSON.\n * - `motionToCss(rules, selector)` — CSS `@keyframes` + rules for the\n * entrance rules of a motion string (timeline presets), for hand-off to\n * teams without JS.\n * - `easingPoints(easing)` — the cubic-bezier control points of a CSS\n * easing (named or `cubic-bezier(…)`), for spec sheets.\n */\nimport { parseMotion, serializeMotion, type MotionRule, type ComponentJSON } from '../dsl/index';\nimport { TIMELINE_PRESETS } from '../timeline/core';\n\nconst EASE: Record<string, [number, number, number, number]> = {\n linear: [0, 0, 1, 1],\n ease: [0.25, 0.1, 0.25, 1],\n 'ease-in': [0.42, 0, 1, 1],\n 'ease-out': [0, 0, 0.58, 1],\n 'ease-in-out': [0.42, 0, 0.58, 1],\n};\n/** Control points [x1, y1, x2, y2] of a CSS easing (unknown → ease) (9.7). */\nexport function easingPoints(easing = 'ease'): [number, number, number, number] {\n const m = easing.match(/cubic-bezier\\(\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*\\)/);\n if (m) return [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])];\n return EASE[easing] || EASE.ease;\n}\n\nconst FIGMA_EASE: Record<string, string> = { LINEAR: 'linear', EASE_IN: 'ease-in', EASE_OUT: 'ease-out', EASE_IN_AND_OUT: 'ease-in-out', EASE_IN_BACK: 'cubic-bezier(0.36, 0, 0.66, -0.56)', EASE_OUT_BACK: 'spring', EASE_IN_AND_OUT_BACK: 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', GENTLE: 'smooth', QUICK: 'ease-out', BOUNCY: 'spring', SLOW: 'ease-in-out' };\nconst FIGMA_TRIGGER: Record<string, string> = { ON_CLICK: 'click', ON_PRESS: 'click', ON_HOVER: 'hover', MOUSE_ENTER: 'hover', AFTER_TIMEOUT: 'load', ON_DRAG: 'click' };\nconst dirFx = (d: string | undefined, base: 'fade' | 'slide') => {\n const m: Record<string, string> = { LEFT: 'left', RIGHT: 'right', TOP: 'down', BOTTOM: 'up' };\n return base === 'fade' ? `fade-${m[d || 'BOTTOM'] || 'up'}` : `slide-${m[d || 'BOTTOM'] || 'up'}`;\n};\n/** Figma prototype reactions → a Motionary DSL string (unsupported reactions are skipped) (9.7). */\nexport function figmaToMotion(reactions: any[]): string {\n const rules: MotionRule[] = [];\n for (const r of reactions || []) {\n const trig = FIGMA_TRIGGER[r?.trigger?.type];\n const tr = r?.action?.transition ?? r?.actions?.[0]?.transition;\n if (!trig || !tr) continue;\n const effect = tr.type === 'DISSOLVE' ? 'fade' : tr.type === 'SMART_ANIMATE' || tr.type === 'SCROLL_ANIMATE' ? 'scale' : tr.type === 'MOVE_IN' || tr.type === 'PUSH' ? dirFx(tr.direction, 'fade') : tr.type === 'SLIDE_IN' ? dirFx(tr.direction, 'fade') : 'fade';\n const rule: MotionRule = { trigger: (r.trigger.type === 'AFTER_TIMEOUT' ? 'load' : trig) as MotionRule['trigger'], effect, options: {} };\n if (typeof tr.duration === 'number') rule.duration = Math.round(tr.duration * 1000);\n const e = tr.easing?.type ? FIGMA_EASE[tr.easing.type] : undefined;\n if (e) rule.easing = e === 'spring' ? 'cubic-bezier(0.34, 1.56, 0.64, 1)' : e === 'smooth' ? 'cubic-bezier(0.22, 1, 0.36, 1)' : e;\n if (tr.easing?.easingFunctionCubicBezier) {\n const b = tr.easing.easingFunctionCubicBezier;\n rule.easing = `cubic-bezier(${b.x1}, ${b.y1}, ${b.x2}, ${b.y2})`;\n }\n if (r.trigger.type === 'AFTER_TIMEOUT' && typeof r.trigger.timeout === 'number') rule.delay = Math.round(r.trigger.timeout * 1000);\n rules.push(rule);\n }\n return serializeMotion(rules);\n}\n\nconst pascal = (s: string) => s.replace(/(^|[-_\\s]+)([a-z0-9])/gi, (_, __, c) => c.toUpperCase()).replace(/[^A-Za-z0-9]/g, '') || 'Component';\n/** A Framer code component (TSX source) for a component description (9.7). */\nexport function framerComponent(desc: ComponentJSON | string, opts: { name?: string } = {}): string {\n const d: ComponentJSON = typeof desc === 'string' ? JSON.parse(desc) : desc;\n const name = pascal(opts.name || d.tag.replace(/^usa-/, ''));\n const attrs = Object.entries(d.attrs || {}).filter(([k]) => /^[a-z][\\w-]*$/.test(k));\n const prop = (k: string) => k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n const controls = attrs.map(([k, v]) => ` ${prop(k)}: { type: ${!isNaN(Number(v)) && v !== '' ? 'ControlType.Number' : v === '' ? 'ControlType.Boolean' : 'ControlType.String'}, defaultValue: ${!isNaN(Number(v)) && v !== '' ? Number(v) : v === '' ? 'true' : JSON.stringify(v)} },`).join('\\n');\n const jsxAttrs = attrs.map(([k]) => ` ${k === 'class' ? 'className' : k}={${v(prop(k))}}`).join('');\n function v(p: string) {\n return `props.${p}`;\n }\n const kids = (d.children || []).map((c) => (typeof c === 'string' ? c.replace(/[{}<>]/g, '') : '')).join(' ').trim();\n return `// Framer code component generated by motionary/design (9.7)\\nimport { useEffect } from \"react\"\\nimport { addPropertyControls, ControlType } from \"framer\"\\nimport { defineWidgets } from \"https://cdn.jsdelivr.net/npm/motionary/dist/components/widgets.js\"\\n\\nexport default function ${name}(props) {\\n useEffect(() => defineWidgets(), [])\\n return <${d.tag}${jsxAttrs}>${kids}</${d.tag}>\\n}\\n\\naddPropertyControls(${name}, {\\n${controls}\\n})\\n`;\n}\n\n/** CSS `@keyframes` + rules for the entrance (`enter` / `load`) rules of a motion string (9.7). */\nexport function motionToCss(rules: string | MotionRule[], selector = '.motion'): string {\n const rs = typeof rules === 'string' ? parseMotion(rules).rules : rules;\n const out: string[] = [];\n const done = new Set<string>();\n for (const r of rs) {\n if (r.trigger !== 'enter' && r.trigger !== 'load') continue;\n const kf = TIMELINE_PRESETS[r.effect];\n if (!kf) continue;\n const name = `usa-${r.effect}`;\n if (!done.has(name)) {\n done.add(name);\n const steps = kf.map((f, i) => ` ${Math.round((f.offset != null ? Number(f.offset) : i / Math.max(1, kf.length - 1)) * 100)}% { ${Object.entries(f).filter(([k]) => k !== 'offset' && k !== 'easing').map(([k, val]) => `${k.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}: ${val}`).join('; ')} }`);\n out.push(`@keyframes ${name} {\\n${steps.join('\\n')}\\n}`);\n }\n const target = r.stagger != null ? `${selector} > *` : selector;\n out.push(`${target} { animation: ${name} ${r.duration ?? 600}ms ${r.easing || 'cubic-bezier(0.22, 1, 0.36, 1)'} ${r.delay ?? 0}ms both; }`);\n if (r.stagger != null) for (let i = 2; i <= 8; i++) out.push(`${selector} > :nth-child(${i}) { animation-delay: ${(r.delay ?? 0) + r.stagger * (i - 1)}ms; }`);\n }\n out.push(`@media (prefers-reduced-motion: reduce) { ${selector}, ${selector} > * { animation: none !important; } }`);\n return out.join('\\n');\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAIH,MAAM,IAAI,GAAqD;IAC7D,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACpB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1B,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;CAClC;AACD;AACM,SAAU,YAAY,CAAC,MAAM,GAAG,MAAM,EAAA;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,iFAAiF,CAAC;AACzG,IA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,CAAC,GAAG,CAAC,CAAC,CAAA,KAAA,CAAO,CAAC;IAChK;IACA,GAAG,CAAC,IAAI,CAAC,CAAA,0CAAA,EAA6C,QAAQ,CAAA,EAAA,EAAK,QAAQ,CAAA,sCAAA,CAAwC,CAAC;AACpH,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AACvB;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var registry = require('../chunks/registry-BVklOepd.cjs');
4
- require('../chunks/base-DoRUZBy-.cjs');
3
+ var registry = require('../chunks/registry-xQZnSqqV.cjs');
4
+ require('../chunks/base-DBheNxJu.cjs');
5
5
 
6
6
  /**
7
7
  * `motionary/dsl` (= `motionary/components/dsl`, 9.0) — the declarative
@@ -1,5 +1,5 @@
1
- import { hasEffect, bindEffect, EFFECT_TRIGGERS } from '../chunks/registry-CnO7ZVPK.js';
2
- import '../chunks/base-CLuqlLfG.js';
1
+ import { hasEffect, bindEffect, EFFECT_TRIGGERS } from '../chunks/registry-gFJRpPES.js';
2
+ import '../chunks/base-BnRyfuyM.js';
3
3
 
4
4
  /**
5
5
  * `motionary/dsl` (= `motionary/components/dsl`, 9.0) — the declarative
@@ -2,15 +2,15 @@
2
2
 
3
3
  var components_fx = require('./fx.cjs');
4
4
  var shared = require('../chunks/shared-jkgRH-Hx.cjs');
5
- var player = require('../chunks/player-C2n17sdH.cjs');
5
+ var player = require('../chunks/player-C4y4jXSv.cjs');
6
6
  var generative = require('../chunks/generative-BHIj-NU0.cjs');
7
- var audio = require('../chunks/audio-cgWbDkoY.cjs');
8
- var registry = require('../chunks/registry-BVklOepd.cjs');
9
- var base = require('../chunks/base-DoRUZBy-.cjs');
7
+ var audio = require('../chunks/audio-BpU-A1m1.cjs');
8
+ var registry = require('../chunks/registry-xQZnSqqV.cjs');
9
+ var base = require('../chunks/base-DBheNxJu.cjs');
10
10
  var components_tokens = require('./tokens.cjs');
11
- require('../chunks/builtins-ClXshqj-.cjs');
12
- require('../chunks/core-CwO835Wm.cjs');
13
- require('../chunks/fx-C-XjLOTc.cjs');
11
+ require('../chunks/builtins-CKKZNR95.cjs');
12
+ require('../chunks/core-MQlXZKUG.cjs');
13
+ require('../chunks/fx-B_pbhpDp.cjs');
14
14
 
15
15
  const CARD_FX = [
16
16
  {
@@ -1,17 +1,17 @@
1
1
  import { registerBuiltinEffects } from './fx.js';
2
2
  import { P as PALETTE, o as overlay, a as all, b as origin, s as spawn, r as rand, f as fxLayer } from '../chunks/shared-CkKHWrtJ.js';
3
- import { d as defineStory, a as definePlayer } from '../chunks/player-YzQGkKaW.js';
4
- export { A as ANIMATION_FORMAT, S as STORY_TEMPLATES, c as createPlayer, f as formatCount, n as normalizeAnimation, s as storyProgress } from '../chunks/player-YzQGkKaW.js';
3
+ import { d as defineStory, a as definePlayer } from '../chunks/player-48Zy_NBG.js';
4
+ export { A as ANIMATION_FORMAT, S as STORY_TEMPLATES, c as createPlayer, f as formatCount, n as normalizeAnimation, s as storyProgress } from '../chunks/player-48Zy_NBG.js';
5
5
  import { c as canvasBackground, h as hexRgb, G as GENERATIVE_FX } from '../chunks/generative-2LhxG5BJ.js';
6
6
  export { n as noise2 } from '../chunks/generative-2LhxG5BJ.js';
7
- import { A as AUDIO_FX, d as defineAudio } from '../chunks/audio-CynhhWDi.js';
8
- export { b as bindBeat, c as createBeatDetector, a as disableAudio, e as enableAudio, g as getAudio, o as onBeat } from '../chunks/audio-CynhhWDi.js';
9
- import { playEffect, bindEffect, registerEffects } from '../chunks/registry-CnO7ZVPK.js';
10
- import { u as defineElement, B as adoptStyles } from '../chunks/base-CLuqlLfG.js';
7
+ import { A as AUDIO_FX, d as defineAudio } from '../chunks/audio-D95jwlOh.js';
8
+ export { b as bindBeat, c as createBeatDetector, a as disableAudio, e as enableAudio, g as getAudio, o as onBeat } from '../chunks/audio-D95jwlOh.js';
9
+ import { playEffect, bindEffect, registerEffects } from '../chunks/registry-gFJRpPES.js';
10
+ import { u as defineElement, B as adoptStyles } from '../chunks/base-BnRyfuyM.js';
11
11
  import { applyMotionTokens, motionTokensToVars, mergeMotionTokens } from './tokens.js';
12
- import '../chunks/builtins-Bs4smevg.js';
13
- import '../chunks/core-CiN5sqxB.js';
14
- import '../chunks/fx-CQv3IxMf.js';
12
+ import '../chunks/builtins-CqIq1zBv.js';
13
+ import '../chunks/core-DsGoL9EY.js';
14
+ import '../chunks/fx-CtnrFEg9.js';
15
15
 
16
16
  const CARD_FX = [
17
17
  {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-DoRUZBy-.cjs');
3
+ var base = require('../chunks/base-DBheNxJu.cjs');
4
4
 
5
5
  /**
6
6
  * `motionary/engine` (= `motionary/components/engine`, 8.0) — the unified
@@ -1,5 +1,5 @@
1
- import { v as onClockChange, x as setClock, y as getClock, p as prefersReducedMotion, e as animateWithMotion } from '../chunks/base-CLuqlLfG.js';
2
- export { z as trackAnimation } from '../chunks/base-CLuqlLfG.js';
1
+ import { v as onClockChange, x as setClock, y as getClock, p as prefersReducedMotion, e as animateWithMotion } from '../chunks/base-BnRyfuyM.js';
2
+ export { z as trackAnimation } from '../chunks/base-BnRyfuyM.js';
3
3
 
4
4
  /**
5
5
  * `motionary/engine` (= `motionary/components/engine`, 8.0) — the unified
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-DoRUZBy-.cjs');
3
+ var base = require('../chunks/base-DBheNxJu.cjs');
4
4
 
5
5
  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}}";
6
6
 
@@ -1,4 +1,4 @@
1
- import { u as defineElement, F as kindOf, D as EASE_OUT, k as clamp, H as FLUENT_DECELERATE, E as EASE_SPRING } from '../chunks/base-CLuqlLfG.js';
1
+ import { u as defineElement, F as kindOf, D as EASE_OUT, k as clamp, H as FLUENT_DECELERATE, E as EASE_SPRING } from '../chunks/base-BnRyfuyM.js';
2
2
 
3
3
  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}}";
4
4
 
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var registry = require('../chunks/registry-BVklOepd.cjs');
3
+ var registry = require('../chunks/registry-xQZnSqqV.cjs');
4
4
  var shared = require('../chunks/shared-jkgRH-Hx.cjs');
5
5
  var components_fxLight = require('./fx-light.cjs');
6
- require('../chunks/base-DoRUZBy-.cjs');
6
+ require('../chunks/base-DBheNxJu.cjs');
7
7
  require('../chunks/generative-BHIj-NU0.cjs');
8
8
 
9
9
  const layers = (el) => {
@@ -1,7 +1,7 @@
1
- import { registerEffects } from '../chunks/registry-CnO7ZVPK.js';
1
+ import { registerEffects } from '../chunks/registry-gFJRpPES.js';
2
2
  import { a as all } from '../chunks/shared-CkKHWrtJ.js';
3
3
  import { trackPointer } from './fx-light.js';
4
- import '../chunks/base-CLuqlLfG.js';
4
+ import '../chunks/base-BnRyfuyM.js';
5
5
  import '../chunks/generative-2LhxG5BJ.js';
6
6
 
7
7
  const layers = (el) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var registry = require('../chunks/registry-BVklOepd.cjs');
4
- require('../chunks/base-DoRUZBy-.cjs');
3
+ var registry = require('../chunks/registry-xQZnSqqV.cjs');
4
+ require('../chunks/base-DBheNxJu.cjs');
5
5
 
6
6
  /** Split text into words, keeping the whitespace after each (7.8). */
7
7
  function splitWords(text) {