motionary 9.6.0 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/components/design.cjs +117 -0
- package/dist/components/design.cjs.map +1 -0
- package/dist/components/design.d.cts +82 -0
- package/dist/components/design.d.ts +82 -0
- package/dist/components/design.js +112 -0
- package/dist/components/design.js.map +1 -0
- package/dist/components/widgets.cjs +296 -231
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +18 -2
- package/dist/components/widgets.d.ts +18 -2
- package/dist/components/widgets.js +296 -232
- package/dist/components/widgets.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +1 -1
- package/docs/components.md +14 -0
- package/figma-plugin/README.md +9 -0
- package/figma-plugin/code.js +26 -0
- package/figma-plugin/manifest.json +9 -0
- package/figma-plugin/ui.html +10 -0
- package/package.json +23 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.7.0] - 2026-10-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Design tool integration — `motionary/design`** (= `motionary/components/design`):
|
|
14
|
+
- `figmaToMotion(reactions)` — Figma prototype reactions (ON_CLICK / ON_HOVER / ON_PRESS / AFTER_TIMEOUT; DISSOLVE / SMART_ANIMATE / MOVE_IN / SLIDE_IN / PUSH; easing presets or custom bezier; duration) → a `data-motion` DSL string.
|
|
15
|
+
- `framerComponent(desc, { name })` — a Framer code component (TSX with `addPropertyControls` for every attribute) from the 8.9 component JSON.
|
|
16
|
+
- `motionToCss(rules, selector)` — `@keyframes` + rules (with stagger delays and a reduced-motion guard) for the entrance rules of a motion string.
|
|
17
|
+
- `easingPoints(easing)` — cubic-bezier control points of a CSS easing.
|
|
18
|
+
- **Figma plugin scaffold** — `figma-plugin/` (manifest, code, UI, README; shipped in the npm package): select layers with prototype interactions → copy their `data-motion` strings.
|
|
19
|
+
- **New component (9.7)** `<usa-motion-spec>` in `motionary/components/widgets` — motion spec sheet for hand-off: per-rule trigger, timing bar on a shared axis, easing curve, Play playhead, Copy CSS; `parsed`, `css`, `play()`; `usa:copy`.
|
|
20
|
+
- Showcase: a new gallery card with copyable code, live demo and live Store thumbnail.
|
|
21
|
+
|
|
22
|
+
### Accessibility
|
|
23
|
+
- The spec sheet is a real `table` with row / column headers and a label; curves and bars are decorative next to their text values.
|
|
24
|
+
|
|
10
25
|
## [9.6.0] - 2026-10-09
|
|
11
26
|
|
|
12
27
|
### Added
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var components_dsl = require('./dsl.cjs');
|
|
4
|
+
var core = require('../chunks/core-CwO835Wm.cjs');
|
|
5
|
+
require('../chunks/registry-BVklOepd.cjs');
|
|
6
|
+
require('../chunks/base-DoRUZBy-.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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EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,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-CiN5sqxB.js';
|
|
3
|
+
import '../chunks/registry-CnO7ZVPK.js';
|
|
4
|
+
import '../chunks/base-CLuqlLfG.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,IAAA,IAAI,CAAC;AAAE,QAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI;AAClC;AAEA,MAAM,UAAU,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,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