use-scroll-animate 7.6.0 → 7.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.8.0] - 2026-10-08
11
+
12
+ ### Added
13
+ - **3 new components (7.8)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
14
+ - `<usa-chat-composer>` — AI chat input: the textarea grows with its text (up to `rows`, default 6), Enter sends / Shift+Enter new line, the send button pops when there is text and morphs into Stop while `busy`, when a conic "thinking" glow runs round the composer. `usa:send` { text } (cancelable), `usa:stop`; `placeholder`, `label`, `value`, `busy`, `send()`, `clear()`.
15
+ - `<usa-suggestion-chips>` — follow-up prompt chips from `items="a|b|c"` (or child elements): slide in one after another, picking pulses the chip and emits `usa:pick` { text, index }; `dismiss` fades the others; `setItems()` / `items`; arrow keys. `parseChips()`.
16
+ - `<usa-voice-button>` — push-to-talk mic: toggles `listening` (`usa:start` / `usa:stop`), a halo breathes and `bars` (3–9) wave; set `level` (0–1) from an analyser / speech API and both follow it. `toggle()`; `waveBars()`.
17
+ - **AI UI motion — `motionary/fx/ai`** (= `motionary/components/fx-ai`, `registerAiPack()`, also in `registerEffectPacks()`): `stream-text` (enter), `thinking-glow` (loop), `voice-wave` (attention), `gen-skeleton` (enter). `splitWords()`.
18
+ - Showcase: 5 new gallery cards with copyable code, live demos and live Store thumbnails; Animation Store 326 → 331 items.
19
+
20
+ ### Accessibility
21
+ - Composer: labelled textarea, the button's `aria-label` switches Send ↔ Stop generating. Chips: labelled list of real buttons, arrow-key navigation, dismissed chips are disabled. Voice button: a real `<button aria-pressed>`. `stream-text` restores the original text nodes when it finishes (screen readers read the full text). Reduced motion: no glow, pop, slide, halo or wave; `stream-text` shows the text at once, `thinking-glow` is skipped, `voice-wave` does nothing, `gen-skeleton` fades in.
22
+
23
+ ## [7.7.0] - 2026-10-08
24
+
25
+ ### Added
26
+ - **3 new components (7.7)** in `motionary/components/widgets` (also in `dist/widgets.umd.js`):
27
+ - `<usa-field>` — animated text input: the `label` floats up on focus / when filled, the underline grows, native validation on blur (`type`, `required`, `pattern`, `minlength`, `maxlength`) — invalid shakes and slides the message in (`usa:invalid`, custom text via `error`), valid draws a check (`usa:valid`); `hint`; `strength` adds a 4-step password meter. The `<input>` is in the light DOM, so forms submit it by `name`. `value`, `validate()`, `input`; `passwordStrength()`.
28
+ - `<usa-otp>` — one-time-code input: `length` boxes (3–10, default 6), auto-advance, Backspace / arrow keys, paste a whole code, `autocomplete="one-time-code"`, `mode="alnum"`, initial `value`; digits pop in; `usa:complete` { code }; `error(message)` shakes red and clears, `success()` green wave, `fillCode(code)`, `clear()`. `sanitizeCode()`.
29
+ - `<usa-upload-progress>` — file row: `name`, `size` (bytes), `value` 0–100 (bar eases, shine while uploading), `status` uploading | done | error, `message`; done draws a check (`usa:done`), error shakes + Retry (`usa:error`, `usa:retry`). `formatBytes()`.
30
+ - **Form motion — `motionary/fx/form`** (= `motionary/components/fx-form`, `registerFormPack()`, also in `registerEffectPacks()`): `field-shake` (attention), `field-success` (attention), `label-float` (enter), `form-cascade` (enter). `shakeFrames()`.
31
+ - Showcase: 5 new gallery cards with copyable code, live demos and live Store thumbnails; Animation Store 321 → 326 items.
32
+ - Note: the plan's "success check" ships as `field-success` (the existing `success-check` effect is unchanged).
33
+
34
+ ### Accessibility
35
+ - Field: real `<label for>`, `aria-invalid`, message in an `aria-live` region linked with `aria-describedby`. OTP: labelled `role="group"`, each box labelled "Digit n of N". Upload: `role="progressbar"` with `aria-valuenow` / `aria-valuetext`, a real Retry button. Reduced motion: no shake, pop, wave, shine or easing — states switch at once; `field-shake` / `field-success` only flash the outline, `label-float` / `form-cascade` fade in.
36
+
10
37
  ## [7.6.0] - 2026-10-08
11
38
 
12
39
  ### Added
@@ -0,0 +1,130 @@
1
+ 'use strict';
2
+
3
+ var registry = require('../chunks/registry-DehBVRDV.cjs');
4
+ require('../chunks/base-BaQV-2ha.cjs');
5
+
6
+ /** Split text into words, keeping the whitespace after each (7.8). */
7
+ function splitWords(text) {
8
+ return text.match(/\S+\s*|\s+/g) || [];
9
+ }
10
+ const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);
11
+ function textNodes(el) {
12
+ const out = [];
13
+ const walk = (n) => n.childNodes.forEach((c) => (c.nodeType === 3 ? (c.textContent || '').trim() && out.push(c) : c.nodeType === 1 && walk(c)));
14
+ walk(el);
15
+ return out;
16
+ }
17
+ const AI_FX = [
18
+ {
19
+ name: 'stream-text',
20
+ kind: 'enter',
21
+ description: 'The text appears word by word like a streamed LLM reply, with a blinking caret (`speed` ms per word).',
22
+ defaults: { speed: 45 },
23
+ run: (el, o, ctx) => {
24
+ if (ctx.reduced)
25
+ return;
26
+ const speed = Math.max(5, Number(o.speed) || 45);
27
+ const spans = [];
28
+ const restores = [];
29
+ for (const t of textNodes(el)) {
30
+ const wrap = document.createElement('span');
31
+ wrap.setAttribute('data-usa-stream', '');
32
+ for (const w of splitWords(t.textContent || '')) {
33
+ const s = document.createElement('span');
34
+ s.textContent = w;
35
+ s.style.opacity = '0';
36
+ wrap.appendChild(s);
37
+ spans.push(s);
38
+ }
39
+ t.parentNode.replaceChild(wrap, t);
40
+ restores.push(() => wrap.isConnected && wrap.replaceWith(t));
41
+ }
42
+ const caret = document.createElement('span');
43
+ caret.setAttribute('aria-hidden', 'true');
44
+ caret.textContent = '▍';
45
+ Object.assign(caret.style, { opacity: '.7', marginLeft: '1px' });
46
+ el.appendChild(caret);
47
+ const blink = ctx.animate(caret, [{ opacity: 0.8 }, { opacity: 0 }], { duration: 500, iterations: Infinity, direction: 'alternate' });
48
+ let done = false;
49
+ const finish = () => {
50
+ if (done)
51
+ return;
52
+ done = true;
53
+ blink?.cancel();
54
+ caret.remove();
55
+ restores.forEach((r) => r());
56
+ };
57
+ ctx.onCleanup(finish);
58
+ const runs = spans.map((s, i) => {
59
+ const a = ctx.animate(s, [{ opacity: 0, filter: 'blur(3px)' }, { opacity: 1, filter: 'none' }], { duration: 220, delay: i * speed, fill: 'both', easing: 'ease-out' });
60
+ if (!a)
61
+ s.style.opacity = '';
62
+ return a?.finished.catch(() => undefined);
63
+ });
64
+ return Promise.all(runs).then(finish);
65
+ },
66
+ },
67
+ {
68
+ name: 'thinking-glow',
69
+ kind: 'loop',
70
+ description: 'A soft colour glow breathes and drifts round the element while a model is "thinking" (`colors`, comma-separated). Stops on cleanup.',
71
+ defaults: { colors: '#6366f1,#ec4899,#22d3ee', duration: 2400 },
72
+ run: (el, o, ctx) => {
73
+ const cs = String(o.colors).split(',').map((c) => c.trim()).filter(Boolean);
74
+ const c = cs.length ? cs : ['#6366f1'];
75
+ const frames = c.map((col, i) => ({ boxShadow: `0 0 ${i % 2 ? 26 : 14}px ${i % 2 ? 4 : 1}px ${col}`, offset: i / c.length }));
76
+ frames.push({ boxShadow: `0 0 14px 1px ${c[0]}`, offset: 1 });
77
+ const a = ctx.animate(el, frames, { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });
78
+ return () => a?.cancel();
79
+ },
80
+ },
81
+ {
82
+ name: 'voice-wave',
83
+ kind: 'attention',
84
+ description: "The element's children bounce in a wave like voice level bars, or the element pulses when it has none (`cycles`).",
85
+ defaults: { cycles: 2, duration: 700 },
86
+ run: (el, o, ctx) => {
87
+ if (ctx.reduced)
88
+ return;
89
+ const kids = Array.from(el.children);
90
+ const n = Math.max(1, Math.min(6, Number(o.cycles) || 2));
91
+ if (!kids.length)
92
+ return ctx.animate(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.12)' }, { transform: 'scale(1)' }], { duration: o.duration, iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined);
93
+ return Promise.all(kids.map((k, i) => ctx.animate(k, [{ transform: 'scaleY(1)' }, { transform: 'scaleY(1.9)' }, { transform: 'scaleY(.6)' }, { transform: 'scaleY(1)' }], { duration: o.duration, delay: i * (o.duration / (kids.length * 2)), iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined))).then(() => undefined);
94
+ },
95
+ },
96
+ {
97
+ name: 'gen-skeleton',
98
+ kind: 'enter',
99
+ description: 'A shimmering skeleton covers the element, then dissolves to reveal the generated content (`hold` ms).',
100
+ defaults: { hold: 900, duration: 500 },
101
+ run: (el, o, ctx) => {
102
+ if (ctx.reduced)
103
+ return fade(el, ctx);
104
+ if (getComputedStyle(el).position === 'static') {
105
+ const prev = el.style.position;
106
+ el.style.position = 'relative';
107
+ ctx.onCleanup(() => (el.style.position = prev));
108
+ }
109
+ const sk = document.createElement('span');
110
+ sk.setAttribute('aria-hidden', 'true');
111
+ Object.assign(sk.style, { position: 'absolute', inset: '0', borderRadius: 'inherit', pointerEvents: 'none', background: 'linear-gradient(100deg,#e2e8f0 30%,#f8fafc 50%,#e2e8f0 70%)', backgroundSize: '200% 100%', zIndex: '1' });
112
+ el.appendChild(sk);
113
+ const end = () => sk.remove();
114
+ ctx.onCleanup(end);
115
+ const hold = Math.max(0, Number(o.hold) || 0);
116
+ ctx.animate(sk, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-20% 0' }], { duration: 900, iterations: Math.max(1, Math.ceil(hold / 900)) });
117
+ const a = ctx.animate(sk, [{ opacity: 1 }, { opacity: 0 }], { duration: o.duration, delay: hold, fill: 'both', easing: 'ease-out' });
118
+ return a ? a.finished.then(end, end) : (end(), undefined);
119
+ },
120
+ },
121
+ ];
122
+ /** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */
123
+ function registerAiPack() {
124
+ registry.registerEffects(AI_FX);
125
+ }
126
+
127
+ exports.AI_FX = AI_FX;
128
+ exports.registerAiPack = registerAiPack;
129
+ exports.splitWords = splitWords;
130
+ //# sourceMappingURL=fx-ai.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-ai.cjs","sources":["../../src/components/fx2/ai.ts"],"sourcesContent":["/**\n * 7.8 — AI UI motion (`motionary/fx/ai`, also `motionary/components/fx-ai`):\n *\n * - `stream-text` (enter) — the element's text appears word by word, like a\n * streamed LLM reply, with a blinking caret at the end (`speed` ms/word).\n * - `thinking-glow` (loop) — a soft colour glow breathes and drifts round the\n * element while a model is \"thinking\" (`colors`); the cleanup stops it.\n * - `voice-wave` (attention) — the element's children bounce in a wave like\n * voice level bars (or the element pulses when it has none) (`cycles`).\n * - `gen-skeleton` (enter) — a shimmering skeleton covers the element, then\n * dissolves to reveal the generated content (`hold`).\n *\n * Reduced motion: stream-text shows the text, thinking-glow is skipped,\n * voice-wave does nothing, gen-skeleton fades in.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\n/** Split text into words, keeping the whitespace after each (7.8). */\nexport function splitWords(text: string): string[] {\n return text.match(/\\S+\\s*|\\s+/g) || [];\n}\n\nconst fade = (el: HTMLElement, ctx: EffectContext) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);\n\nfunction textNodes(el: Node): Text[] {\n const out: Text[] = [];\n const walk = (n: Node) => n.childNodes.forEach((c) => (c.nodeType === 3 ? (c.textContent || '').trim() && out.push(c as Text) : c.nodeType === 1 && walk(c)));\n walk(el);\n return out;\n}\n\nexport const AI_FX: EffectDefinition[] = [\n {\n name: 'stream-text',\n kind: 'enter',\n description: 'The text appears word by word like a streamed LLM reply, with a blinking caret (`speed` ms per word).',\n defaults: { speed: 45 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const speed = Math.max(5, Number(o.speed) || 45);\n const spans: HTMLElement[] = [];\n const restores: (() => void)[] = [];\n for (const t of textNodes(el)) {\n const wrap = document.createElement('span');\n wrap.setAttribute('data-usa-stream', '');\n for (const w of splitWords(t.textContent || '')) {\n const s = document.createElement('span');\n s.textContent = w;\n s.style.opacity = '0';\n wrap.appendChild(s);\n spans.push(s);\n }\n (t.parentNode as Node).replaceChild(wrap, t);\n restores.push(() => wrap.isConnected && wrap.replaceWith(t));\n }\n const caret = document.createElement('span');\n caret.setAttribute('aria-hidden', 'true');\n caret.textContent = '▍';\n Object.assign(caret.style, { opacity: '.7', marginLeft: '1px' });\n el.appendChild(caret);\n const blink = ctx.animate(caret, [{ opacity: 0.8 }, { opacity: 0 }], { duration: 500, iterations: Infinity, direction: 'alternate' });\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n blink?.cancel();\n caret.remove();\n restores.forEach((r) => r());\n };\n ctx.onCleanup(finish);\n const runs = spans.map((s, i) => {\n const a = ctx.animate(s, [{ opacity: 0, filter: 'blur(3px)' }, { opacity: 1, filter: 'none' }], { duration: 220, delay: i * speed, fill: 'both', easing: 'ease-out' });\n if (!a) s.style.opacity = '';\n return a?.finished.catch(() => undefined);\n });\n return Promise.all(runs).then(finish);\n },\n },\n {\n name: 'thinking-glow',\n kind: 'loop',\n description: 'A soft colour glow breathes and drifts round the element while a model is \"thinking\" (`colors`, comma-separated). Stops on cleanup.',\n defaults: { colors: '#6366f1,#ec4899,#22d3ee', duration: 2400 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const cs = String(o.colors).split(',').map((c) => c.trim()).filter(Boolean);\n const c = cs.length ? cs : ['#6366f1'];\n const frames: Keyframe[] = c.map((col, i) => ({ boxShadow: `0 0 ${i % 2 ? 26 : 14}px ${i % 2 ? 4 : 1}px ${col}`, offset: i / c.length }));\n frames.push({ boxShadow: `0 0 14px 1px ${c[0]}`, offset: 1 });\n const a = ctx.animate(el, frames, { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });\n return () => a?.cancel();\n },\n },\n {\n name: 'voice-wave',\n kind: 'attention',\n description: \"The element's children bounce in a wave like voice level bars, or the element pulses when it has none (`cycles`).\",\n defaults: { cycles: 2, duration: 700 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n const n = Math.max(1, Math.min(6, Number(o.cycles) || 2));\n if (!kids.length) return ctx.animate(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.12)' }, { transform: 'scale(1)' }], { duration: o.duration, iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined);\n return Promise.all(\n kids.map((k, i) =>\n ctx.animate(k, [{ transform: 'scaleY(1)' }, { transform: 'scaleY(1.9)' }, { transform: 'scaleY(.6)' }, { transform: 'scaleY(1)' }], { duration: o.duration, delay: i * (o.duration / (kids.length * 2)), iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined)\n )\n ).then(() => undefined);\n },\n },\n {\n name: 'gen-skeleton',\n kind: 'enter',\n description: 'A shimmering skeleton covers the element, then dissolves to reveal the generated content (`hold` ms).',\n defaults: { hold: 900, duration: 500 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const sk = document.createElement('span');\n sk.setAttribute('aria-hidden', 'true');\n Object.assign(sk.style, { position: 'absolute', inset: '0', borderRadius: 'inherit', pointerEvents: 'none', background: 'linear-gradient(100deg,#e2e8f0 30%,#f8fafc 50%,#e2e8f0 70%)', backgroundSize: '200% 100%', zIndex: '1' });\n el.appendChild(sk);\n const end = () => sk.remove();\n ctx.onCleanup(end);\n const hold = Math.max(0, Number(o.hold) || 0);\n ctx.animate(sk, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-20% 0' }], { duration: 900, iterations: Math.max(1, Math.ceil(hold / 900)) });\n const a = ctx.animate(sk, [{ opacity: 1 }, { opacity: 0 }], { duration: o.duration, delay: hold, fill: 'both', easing: 'ease-out' });\n return a ? a.finished.then(end, end) : (end(), undefined);\n },\n },\n];\n\n/** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */\nexport function registerAiPack(): void {\n regist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CAAC,SAAS,CAAC,GAAG,CAAC;AAClB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7C,YAAA,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;AACxJ,YAAA,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;YACpI,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,SAAS,CAAC;QAC3D,CAAC;AACF,KAAA;;AAGH;SACgB,cAAc,GAAA;IAC5BA,wBAAe,CAAC,KAAK,CAAC;AACxB;;;;;;"}
@@ -0,0 +1,66 @@
1
+ type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
2
+ type Cleanup = () => void;
3
+
4
+ /**
5
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
6
+ * yours) is a plain object registered once and played the same way:
7
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
8
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
9
+ * already applies reduced motion, motion sensitivity, intensity and the
10
+ * animation budget.
11
+ */
12
+
13
+ declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
14
+ type EffectKind = (typeof EFFECT_KINDS)[number];
15
+ interface EffectContext {
16
+ /** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
17
+ readonly reduced: boolean;
18
+ readonly sensitivity: MotionSensitivity;
19
+ /** The triggering event (pointer position for click effects), if any. */
20
+ readonly event?: Event;
21
+ /** `el.animate()` with the library's motion rules (may return `null`). */
22
+ animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
23
+ /** Register teardown for long-running effects (loops, listeners). */
24
+ onCleanup(fn: Cleanup): void;
25
+ }
26
+ interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
27
+ /** Unique, kebab-case. */
28
+ name: string;
29
+ kind: EffectKind;
30
+ /** One line for docs and the gallery. */
31
+ description?: string;
32
+ /** Option defaults (merged under the caller's options). */
33
+ defaults?: Partial<O>;
34
+ /**
35
+ * Under reduced motion: `'skip'` (do nothing — default for loop, background
36
+ * and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
37
+ * effect degrades itself — default for everything else).
38
+ */
39
+ reduced?: 'skip' | 'run';
40
+ /** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
41
+ run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
42
+ }
43
+
44
+ /**
45
+ * 7.8 — AI UI motion (`motionary/fx/ai`, also `motionary/components/fx-ai`):
46
+ *
47
+ * - `stream-text` (enter) — the element's text appears word by word, like a
48
+ * streamed LLM reply, with a blinking caret at the end (`speed` ms/word).
49
+ * - `thinking-glow` (loop) — a soft colour glow breathes and drifts round the
50
+ * element while a model is "thinking" (`colors`); the cleanup stops it.
51
+ * - `voice-wave` (attention) — the element's children bounce in a wave like
52
+ * voice level bars (or the element pulses when it has none) (`cycles`).
53
+ * - `gen-skeleton` (enter) — a shimmering skeleton covers the element, then
54
+ * dissolves to reveal the generated content (`hold`).
55
+ *
56
+ * Reduced motion: stream-text shows the text, thinking-glow is skipped,
57
+ * voice-wave does nothing, gen-skeleton fades in.
58
+ */
59
+
60
+ /** Split text into words, keeping the whitespace after each (7.8). */
61
+ declare function splitWords(text: string): string[];
62
+ declare const AI_FX: EffectDefinition[];
63
+ /** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */
64
+ declare function registerAiPack(): void;
65
+
66
+ export { AI_FX, registerAiPack, splitWords };
@@ -0,0 +1,66 @@
1
+ type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
2
+ type Cleanup = () => void;
3
+
4
+ /**
5
+ * 5.0 — unified plugin-style effect registration. Every effect (built-in or
6
+ * yours) is a plain object registered once and played the same way:
7
+ * `playEffect(el, name)`, `bindEffect(el, name, { trigger })` or
8
+ * `<usa-fx effect="name" trigger="click">`. Effects get a context that
9
+ * already applies reduced motion, motion sensitivity, intensity and the
10
+ * animation budget.
11
+ */
12
+
13
+ declare const EFFECT_KINDS: readonly ["enter", "exit", "attention", "click", "hover", "card", "loop", "page", "background", "text", "cursor", "scroll"];
14
+ type EffectKind = (typeof EFFECT_KINDS)[number];
15
+ interface EffectContext {
16
+ /** Reduced motion applies (OS setting, `minimal` / `static` sensitivity). */
17
+ readonly reduced: boolean;
18
+ readonly sensitivity: MotionSensitivity;
19
+ /** The triggering event (pointer position for click effects), if any. */
20
+ readonly event?: Event;
21
+ /** `el.animate()` with the library's motion rules (may return `null`). */
22
+ animate(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;
23
+ /** Register teardown for long-running effects (loops, listeners). */
24
+ onCleanup(fn: Cleanup): void;
25
+ }
26
+ interface EffectDefinition<O extends Record<string, unknown> = Record<string, any>> {
27
+ /** Unique, kebab-case. */
28
+ name: string;
29
+ kind: EffectKind;
30
+ /** One line for docs and the gallery. */
31
+ description?: string;
32
+ /** Option defaults (merged under the caller's options). */
33
+ defaults?: Partial<O>;
34
+ /**
35
+ * Under reduced motion: `'skip'` (do nothing — default for loop, background
36
+ * and cursor effects) or `'run'` (run with `ctx.reduced === true`, the
37
+ * effect degrades itself — default for everything else).
38
+ */
39
+ reduced?: 'skip' | 'run';
40
+ /** Play the effect. Return an Animation / Promise to be awaited, or a cleanup. */
41
+ run(el: HTMLElement, options: O, ctx: EffectContext): void | Cleanup | Animation | null | Promise<unknown>;
42
+ }
43
+
44
+ /**
45
+ * 7.8 — AI UI motion (`motionary/fx/ai`, also `motionary/components/fx-ai`):
46
+ *
47
+ * - `stream-text` (enter) — the element's text appears word by word, like a
48
+ * streamed LLM reply, with a blinking caret at the end (`speed` ms/word).
49
+ * - `thinking-glow` (loop) — a soft colour glow breathes and drifts round the
50
+ * element while a model is "thinking" (`colors`); the cleanup stops it.
51
+ * - `voice-wave` (attention) — the element's children bounce in a wave like
52
+ * voice level bars (or the element pulses when it has none) (`cycles`).
53
+ * - `gen-skeleton` (enter) — a shimmering skeleton covers the element, then
54
+ * dissolves to reveal the generated content (`hold`).
55
+ *
56
+ * Reduced motion: stream-text shows the text, thinking-glow is skipped,
57
+ * voice-wave does nothing, gen-skeleton fades in.
58
+ */
59
+
60
+ /** Split text into words, keeping the whitespace after each (7.8). */
61
+ declare function splitWords(text: string): string[];
62
+ declare const AI_FX: EffectDefinition[];
63
+ /** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */
64
+ declare function registerAiPack(): void;
65
+
66
+ export { AI_FX, registerAiPack, splitWords };
@@ -0,0 +1,126 @@
1
+ import { registerEffects } from '../chunks/registry-CyKExAmE.js';
2
+ import '../chunks/base-2-yYc93C.js';
3
+
4
+ /** Split text into words, keeping the whitespace after each (7.8). */
5
+ function splitWords(text) {
6
+ return text.match(/\S+\s*|\s+/g) || [];
7
+ }
8
+ const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);
9
+ function textNodes(el) {
10
+ const out = [];
11
+ const walk = (n) => n.childNodes.forEach((c) => (c.nodeType === 3 ? (c.textContent || '').trim() && out.push(c) : c.nodeType === 1 && walk(c)));
12
+ walk(el);
13
+ return out;
14
+ }
15
+ const AI_FX = [
16
+ {
17
+ name: 'stream-text',
18
+ kind: 'enter',
19
+ description: 'The text appears word by word like a streamed LLM reply, with a blinking caret (`speed` ms per word).',
20
+ defaults: { speed: 45 },
21
+ run: (el, o, ctx) => {
22
+ if (ctx.reduced)
23
+ return;
24
+ const speed = Math.max(5, Number(o.speed) || 45);
25
+ const spans = [];
26
+ const restores = [];
27
+ for (const t of textNodes(el)) {
28
+ const wrap = document.createElement('span');
29
+ wrap.setAttribute('data-usa-stream', '');
30
+ for (const w of splitWords(t.textContent || '')) {
31
+ const s = document.createElement('span');
32
+ s.textContent = w;
33
+ s.style.opacity = '0';
34
+ wrap.appendChild(s);
35
+ spans.push(s);
36
+ }
37
+ t.parentNode.replaceChild(wrap, t);
38
+ restores.push(() => wrap.isConnected && wrap.replaceWith(t));
39
+ }
40
+ const caret = document.createElement('span');
41
+ caret.setAttribute('aria-hidden', 'true');
42
+ caret.textContent = '▍';
43
+ Object.assign(caret.style, { opacity: '.7', marginLeft: '1px' });
44
+ el.appendChild(caret);
45
+ const blink = ctx.animate(caret, [{ opacity: 0.8 }, { opacity: 0 }], { duration: 500, iterations: Infinity, direction: 'alternate' });
46
+ let done = false;
47
+ const finish = () => {
48
+ if (done)
49
+ return;
50
+ done = true;
51
+ blink?.cancel();
52
+ caret.remove();
53
+ restores.forEach((r) => r());
54
+ };
55
+ ctx.onCleanup(finish);
56
+ const runs = spans.map((s, i) => {
57
+ const a = ctx.animate(s, [{ opacity: 0, filter: 'blur(3px)' }, { opacity: 1, filter: 'none' }], { duration: 220, delay: i * speed, fill: 'both', easing: 'ease-out' });
58
+ if (!a)
59
+ s.style.opacity = '';
60
+ return a?.finished.catch(() => undefined);
61
+ });
62
+ return Promise.all(runs).then(finish);
63
+ },
64
+ },
65
+ {
66
+ name: 'thinking-glow',
67
+ kind: 'loop',
68
+ description: 'A soft colour glow breathes and drifts round the element while a model is "thinking" (`colors`, comma-separated). Stops on cleanup.',
69
+ defaults: { colors: '#6366f1,#ec4899,#22d3ee', duration: 2400 },
70
+ run: (el, o, ctx) => {
71
+ const cs = String(o.colors).split(',').map((c) => c.trim()).filter(Boolean);
72
+ const c = cs.length ? cs : ['#6366f1'];
73
+ const frames = c.map((col, i) => ({ boxShadow: `0 0 ${i % 2 ? 26 : 14}px ${i % 2 ? 4 : 1}px ${col}`, offset: i / c.length }));
74
+ frames.push({ boxShadow: `0 0 14px 1px ${c[0]}`, offset: 1 });
75
+ const a = ctx.animate(el, frames, { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });
76
+ return () => a?.cancel();
77
+ },
78
+ },
79
+ {
80
+ name: 'voice-wave',
81
+ kind: 'attention',
82
+ description: "The element's children bounce in a wave like voice level bars, or the element pulses when it has none (`cycles`).",
83
+ defaults: { cycles: 2, duration: 700 },
84
+ run: (el, o, ctx) => {
85
+ if (ctx.reduced)
86
+ return;
87
+ const kids = Array.from(el.children);
88
+ const n = Math.max(1, Math.min(6, Number(o.cycles) || 2));
89
+ if (!kids.length)
90
+ return ctx.animate(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.12)' }, { transform: 'scale(1)' }], { duration: o.duration, iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined);
91
+ return Promise.all(kids.map((k, i) => ctx.animate(k, [{ transform: 'scaleY(1)' }, { transform: 'scaleY(1.9)' }, { transform: 'scaleY(.6)' }, { transform: 'scaleY(1)' }], { duration: o.duration, delay: i * (o.duration / (kids.length * 2)), iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined))).then(() => undefined);
92
+ },
93
+ },
94
+ {
95
+ name: 'gen-skeleton',
96
+ kind: 'enter',
97
+ description: 'A shimmering skeleton covers the element, then dissolves to reveal the generated content (`hold` ms).',
98
+ defaults: { hold: 900, duration: 500 },
99
+ run: (el, o, ctx) => {
100
+ if (ctx.reduced)
101
+ return fade(el, ctx);
102
+ if (getComputedStyle(el).position === 'static') {
103
+ const prev = el.style.position;
104
+ el.style.position = 'relative';
105
+ ctx.onCleanup(() => (el.style.position = prev));
106
+ }
107
+ const sk = document.createElement('span');
108
+ sk.setAttribute('aria-hidden', 'true');
109
+ Object.assign(sk.style, { position: 'absolute', inset: '0', borderRadius: 'inherit', pointerEvents: 'none', background: 'linear-gradient(100deg,#e2e8f0 30%,#f8fafc 50%,#e2e8f0 70%)', backgroundSize: '200% 100%', zIndex: '1' });
110
+ el.appendChild(sk);
111
+ const end = () => sk.remove();
112
+ ctx.onCleanup(end);
113
+ const hold = Math.max(0, Number(o.hold) || 0);
114
+ ctx.animate(sk, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-20% 0' }], { duration: 900, iterations: Math.max(1, Math.ceil(hold / 900)) });
115
+ const a = ctx.animate(sk, [{ opacity: 1 }, { opacity: 0 }], { duration: o.duration, delay: hold, fill: 'both', easing: 'ease-out' });
116
+ return a ? a.finished.then(end, end) : (end(), undefined);
117
+ },
118
+ },
119
+ ];
120
+ /** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */
121
+ function registerAiPack() {
122
+ registerEffects(AI_FX);
123
+ }
124
+
125
+ export { AI_FX, registerAiPack, splitWords };
126
+ //# sourceMappingURL=fx-ai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-ai.js","sources":["../../src/components/fx2/ai.ts"],"sourcesContent":["/**\n * 7.8 — AI UI motion (`motionary/fx/ai`, also `motionary/components/fx-ai`):\n *\n * - `stream-text` (enter) — the element's text appears word by word, like a\n * streamed LLM reply, with a blinking caret at the end (`speed` ms/word).\n * - `thinking-glow` (loop) — a soft colour glow breathes and drifts round the\n * element while a model is \"thinking\" (`colors`); the cleanup stops it.\n * - `voice-wave` (attention) — the element's children bounce in a wave like\n * voice level bars (or the element pulses when it has none) (`cycles`).\n * - `gen-skeleton` (enter) — a shimmering skeleton covers the element, then\n * dissolves to reveal the generated content (`hold`).\n *\n * Reduced motion: stream-text shows the text, thinking-glow is skipped,\n * voice-wave does nothing, gen-skeleton fades in.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\n/** Split text into words, keeping the whitespace after each (7.8). */\nexport function splitWords(text: string): string[] {\n return text.match(/\\S+\\s*|\\s+/g) || [];\n}\n\nconst fade = (el: HTMLElement, ctx: EffectContext) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);\n\nfunction textNodes(el: Node): Text[] {\n const out: Text[] = [];\n const walk = (n: Node) => n.childNodes.forEach((c) => (c.nodeType === 3 ? (c.textContent || '').trim() && out.push(c as Text) : c.nodeType === 1 && walk(c)));\n walk(el);\n return out;\n}\n\nexport const AI_FX: EffectDefinition[] = [\n {\n name: 'stream-text',\n kind: 'enter',\n description: 'The text appears word by word like a streamed LLM reply, with a blinking caret (`speed` ms per word).',\n defaults: { speed: 45 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const speed = Math.max(5, Number(o.speed) || 45);\n const spans: HTMLElement[] = [];\n const restores: (() => void)[] = [];\n for (const t of textNodes(el)) {\n const wrap = document.createElement('span');\n wrap.setAttribute('data-usa-stream', '');\n for (const w of splitWords(t.textContent || '')) {\n const s = document.createElement('span');\n s.textContent = w;\n s.style.opacity = '0';\n wrap.appendChild(s);\n spans.push(s);\n }\n (t.parentNode as Node).replaceChild(wrap, t);\n restores.push(() => wrap.isConnected && wrap.replaceWith(t));\n }\n const caret = document.createElement('span');\n caret.setAttribute('aria-hidden', 'true');\n caret.textContent = '▍';\n Object.assign(caret.style, { opacity: '.7', marginLeft: '1px' });\n el.appendChild(caret);\n const blink = ctx.animate(caret, [{ opacity: 0.8 }, { opacity: 0 }], { duration: 500, iterations: Infinity, direction: 'alternate' });\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n blink?.cancel();\n caret.remove();\n restores.forEach((r) => r());\n };\n ctx.onCleanup(finish);\n const runs = spans.map((s, i) => {\n const a = ctx.animate(s, [{ opacity: 0, filter: 'blur(3px)' }, { opacity: 1, filter: 'none' }], { duration: 220, delay: i * speed, fill: 'both', easing: 'ease-out' });\n if (!a) s.style.opacity = '';\n return a?.finished.catch(() => undefined);\n });\n return Promise.all(runs).then(finish);\n },\n },\n {\n name: 'thinking-glow',\n kind: 'loop',\n description: 'A soft colour glow breathes and drifts round the element while a model is \"thinking\" (`colors`, comma-separated). Stops on cleanup.',\n defaults: { colors: '#6366f1,#ec4899,#22d3ee', duration: 2400 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const cs = String(o.colors).split(',').map((c) => c.trim()).filter(Boolean);\n const c = cs.length ? cs : ['#6366f1'];\n const frames: Keyframe[] = c.map((col, i) => ({ boxShadow: `0 0 ${i % 2 ? 26 : 14}px ${i % 2 ? 4 : 1}px ${col}`, offset: i / c.length }));\n frames.push({ boxShadow: `0 0 14px 1px ${c[0]}`, offset: 1 });\n const a = ctx.animate(el, frames, { duration: o.duration, iterations: Infinity, easing: 'ease-in-out' });\n return () => a?.cancel();\n },\n },\n {\n name: 'voice-wave',\n kind: 'attention',\n description: \"The element's children bounce in a wave like voice level bars, or the element pulses when it has none (`cycles`).\",\n defaults: { cycles: 2, duration: 700 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return;\n const kids = Array.from(el.children) as HTMLElement[];\n const n = Math.max(1, Math.min(6, Number(o.cycles) || 2));\n if (!kids.length) return ctx.animate(el, [{ transform: 'scale(1)' }, { transform: 'scale(1.12)' }, { transform: 'scale(1)' }], { duration: o.duration, iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined);\n return Promise.all(\n kids.map((k, i) =>\n ctx.animate(k, [{ transform: 'scaleY(1)' }, { transform: 'scaleY(1.9)' }, { transform: 'scaleY(.6)' }, { transform: 'scaleY(1)' }], { duration: o.duration, delay: i * (o.duration / (kids.length * 2)), iterations: n, easing: 'ease-in-out' })?.finished.catch(() => undefined)\n )\n ).then(() => undefined);\n },\n },\n {\n name: 'gen-skeleton',\n kind: 'enter',\n description: 'A shimmering skeleton covers the element, then dissolves to reveal the generated content (`hold` ms).',\n defaults: { hold: 900, duration: 500 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n if (ctx.reduced) return fade(el, ctx);\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const sk = document.createElement('span');\n sk.setAttribute('aria-hidden', 'true');\n Object.assign(sk.style, { position: 'absolute', inset: '0', borderRadius: 'inherit', pointerEvents: 'none', background: 'linear-gradient(100deg,#e2e8f0 30%,#f8fafc 50%,#e2e8f0 70%)', backgroundSize: '200% 100%', zIndex: '1' });\n el.appendChild(sk);\n const end = () => sk.remove();\n ctx.onCleanup(end);\n const hold = Math.max(0, Number(o.hold) || 0);\n ctx.animate(sk, [{ backgroundPosition: '120% 0' }, { backgroundPosition: '-20% 0' }], { duration: 900, iterations: Math.max(1, Math.ceil(hold / 900)) });\n const a = ctx.animate(sk, [{ opacity: 1 }, { opacity: 0 }], { duration: o.duration, delay: hold, fill: 'both', easing: 'ease-out' });\n return a ? a.finished.then(end, end) : (end(), undefined);\n },\n },\n];\n\n/** Register stream-text, thinking-glow, voice-wave and gen-skeleton (7.8). */\nexport function registerAiPack(): void {\n registerEffects(AI_FX);\n}\n"],"names":[],"mappings":";;;AAkBA;AACM,SAAU,UAAU,CAAC,IAAY,EAAA;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;AACxC;AAEA,MAAM,IAAI,GAAG,CAAC,EAAe,EAAE,GAAkB,KAAK,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,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I,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;AACxJ,YAAA,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;YACpI,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,SAAS,CAAC;QAC3D,CAAC;AACF,KAAA;;AAGH;SACgB,cAAc,GAAA;IAC5B,eAAe,CAAC,KAAK,CAAC;AACxB;;;;"}
@@ -0,0 +1,92 @@
1
+ 'use strict';
2
+
3
+ var registry = require('../chunks/registry-DehBVRDV.cjs');
4
+ require('../chunks/base-BaQV-2ha.cjs');
5
+
6
+ /** Decaying sideways shake keyframes (7.7). */
7
+ function shakeFrames(distance = 8, steps = 5) {
8
+ const f = [{ transform: 'none' }];
9
+ for (let i = 0; i < steps; i++) {
10
+ const d = Math.round(distance * (1 - i / steps) * 10) / 10;
11
+ f.push({ transform: `translateX(${i % 2 ? d : -d}px)` });
12
+ }
13
+ f.push({ transform: 'none' });
14
+ return f;
15
+ }
16
+ const fade = (el, ctx) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);
17
+ const ring = (el, color, ctx, duration) => ctx.animate(el, [{ boxShadow: `0 0 0 0 ${color}` }, { boxShadow: `0 0 0 4px ${color}`, offset: 0.3 }, { boxShadow: '0 0 0 0 transparent' }], { duration })?.finished.catch(() => undefined);
18
+ const FORM_FX = [
19
+ {
20
+ name: 'field-shake',
21
+ kind: 'attention',
22
+ description: 'Shakes the element sideways with a red outline flash — the "invalid" cue (`distance`, `color`).',
23
+ defaults: { distance: 8, color: 'rgba(225,29,72,.55)', duration: 450 },
24
+ run: (el, o, ctx) => {
25
+ const r = ring(el, o.color, ctx, o.duration + 200);
26
+ if (ctx.reduced)
27
+ return r;
28
+ return ctx.animate(el, shakeFrames(Number(o.distance) || 8), { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);
29
+ },
30
+ },
31
+ {
32
+ name: 'field-success',
33
+ kind: 'attention',
34
+ description: 'A green glow pulses round the element and a check badge pops on its corner (`color`).',
35
+ defaults: { color: 'rgba(22,163,74,.5)', duration: 900 },
36
+ run: (el, o, ctx) => {
37
+ const r = ring(el, o.color, ctx, o.duration);
38
+ if (ctx.reduced)
39
+ return r;
40
+ if (getComputedStyle(el).position === 'static') {
41
+ const prev = el.style.position;
42
+ el.style.position = 'relative';
43
+ ctx.onCleanup(() => (el.style.position = prev));
44
+ }
45
+ const b = document.createElement('span');
46
+ b.setAttribute('aria-hidden', 'true');
47
+ b.textContent = '✓';
48
+ Object.assign(b.style, { position: 'absolute', right: '-6px', top: '-6px', width: '18px', height: '18px', borderRadius: '50%', background: '#16a34a', color: '#fff', font: '700 12px/18px system-ui,sans-serif', textAlign: 'center', pointerEvents: 'none' });
49
+ el.appendChild(b);
50
+ const end = () => b.remove();
51
+ ctx.onCleanup(end);
52
+ const a = ctx.animate(b, [{ transform: 'scale(0)', opacity: 0 }, { transform: 'scale(1.25)', opacity: 1, offset: 0.25 }, { transform: 'scale(1)', opacity: 1, offset: 0.4 }, { transform: 'scale(1)', opacity: 1, offset: 0.85 }, { transform: 'scale(.6)', opacity: 0 }], { duration: o.duration + 500, easing: 'ease-out' });
53
+ return a ? a.finished.then(end, end) : (end(), undefined);
54
+ },
55
+ },
56
+ {
57
+ name: 'label-float',
58
+ kind: 'enter',
59
+ description: 'Every `label` (or `[data-label]`) inside rises and settles one after another, like floating labels (`stagger`).',
60
+ defaults: { stagger: 80, duration: 450 },
61
+ run: (el, o, ctx) => {
62
+ const marked = Array.from(el.querySelectorAll('[data-label]'));
63
+ const labels = marked.length ? marked : Array.from(el.querySelectorAll('label'));
64
+ const items = labels.length ? labels : [el];
65
+ return Promise.all(items.map((l, i) => ctx.reduced
66
+ ? fade(l, ctx)
67
+ : ctx.animate(l, [{ transform: 'translateY(14px) scale(1.12)', opacity: 0, transformOrigin: '0 50%' }, { transform: 'translateY(-3px) scale(.96)', opacity: 1, offset: 0.7 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined))).then(() => undefined);
68
+ },
69
+ },
70
+ {
71
+ name: 'form-cascade',
72
+ kind: 'enter',
73
+ description: "The element's children (fields, buttons) slide in one after another (`stagger`, `distance`).",
74
+ defaults: { stagger: 70, distance: 18, duration: 500 },
75
+ run: (el, o, ctx) => {
76
+ const kids = Array.from(el.children);
77
+ const items = kids.length ? kids : [el];
78
+ return Promise.all(items.map((k, i) => ctx.reduced
79
+ ? fade(k, ctx)
80
+ : ctx.animate(k, [{ transform: `translateY(${Number(o.distance) || 18}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined))).then(() => undefined);
81
+ },
82
+ },
83
+ ];
84
+ /** Register field-shake, field-success, label-float and form-cascade (7.7). */
85
+ function registerFormPack() {
86
+ registry.registerEffects(FORM_FX);
87
+ }
88
+
89
+ exports.FORM_FX = FORM_FX;
90
+ exports.registerFormPack = registerFormPack;
91
+ exports.shakeFrames = shakeFrames;
92
+ //# sourceMappingURL=fx-form.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx-form.cjs","sources":["../../src/components/fx2/form.ts"],"sourcesContent":["/**\n * 7.7 — Form motion (`motionary/fx/form`, also `motionary/components/fx-form`):\n *\n * - `field-shake` (attention) — the element shakes sideways with a red\n * outline flash, the classic \"invalid\" cue (`distance`, `color`).\n * - `field-success` (attention) — a green glow pulses round the element and a\n * small check badge pops on its corner (`color`).\n * - `label-float` (enter) — every `label` (or `[data-label]`) inside rises and\n * settles, one after another, like floating labels (`stagger`).\n * - `form-cascade` (enter) — the element's children (fields, buttons) slide\n * in one after another (`stagger`, `distance`).\n *\n * Reduced motion: field-shake / field-success only flash the outline colour,\n * label-float and form-cascade fade in.\n */\nimport type { EffectContext, EffectDefinition } from '../fx/registry';\nimport { registerEffects } from '../fx/registry';\n\n/** Decaying sideways shake keyframes (7.7). */\nexport function shakeFrames(distance = 8, steps = 5): Keyframe[] {\n const f: Keyframe[] = [{ transform: 'none' }];\n for (let i = 0; i < steps; i++) {\n const d = Math.round(distance * (1 - i / steps) * 10) / 10;\n f.push({ transform: `translateX(${i % 2 ? d : -d}px)` });\n }\n f.push({ transform: 'none' });\n return f;\n}\n\nconst fade = (el: HTMLElement, ctx: EffectContext) => ctx.animate(el, [{ opacity: 0 }, { opacity: 1 }], { duration: 250 })?.finished.catch(() => undefined);\nconst ring = (el: HTMLElement, color: string, ctx: EffectContext, duration: number) =>\n ctx.animate(el, [{ boxShadow: `0 0 0 0 ${color}` }, { boxShadow: `0 0 0 4px ${color}`, offset: 0.3 }, { boxShadow: '0 0 0 0 transparent' }], { duration })?.finished.catch(() => undefined);\n\nexport const FORM_FX: EffectDefinition[] = [\n {\n name: 'field-shake',\n kind: 'attention',\n description: 'Shakes the element sideways with a red outline flash — the \"invalid\" cue (`distance`, `color`).',\n defaults: { distance: 8, color: 'rgba(225,29,72,.55)', duration: 450 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const r = ring(el, o.color, ctx, o.duration + 200);\n if (ctx.reduced) return r;\n return ctx.animate(el, shakeFrames(Number(o.distance) || 8), { duration: o.duration, easing: 'ease-out' })?.finished.catch(() => undefined);\n },\n },\n {\n name: 'field-success',\n kind: 'attention',\n description: 'A green glow pulses round the element and a check badge pops on its corner (`color`).',\n defaults: { color: 'rgba(22,163,74,.5)', duration: 900 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const r = ring(el, o.color, ctx, o.duration);\n if (ctx.reduced) return r;\n if (getComputedStyle(el).position === 'static') {\n const prev = el.style.position;\n el.style.position = 'relative';\n ctx.onCleanup(() => (el.style.position = prev));\n }\n const b = document.createElement('span');\n b.setAttribute('aria-hidden', 'true');\n b.textContent = '✓';\n Object.assign(b.style, { position: 'absolute', right: '-6px', top: '-6px', width: '18px', height: '18px', borderRadius: '50%', background: '#16a34a', color: '#fff', font: '700 12px/18px system-ui,sans-serif', textAlign: 'center', pointerEvents: 'none' });\n el.appendChild(b);\n const end = () => b.remove();\n ctx.onCleanup(end);\n const a = ctx.animate(b, [{ transform: 'scale(0)', opacity: 0 }, { transform: 'scale(1.25)', opacity: 1, offset: 0.25 }, { transform: 'scale(1)', opacity: 1, offset: 0.4 }, { transform: 'scale(1)', opacity: 1, offset: 0.85 }, { transform: 'scale(.6)', opacity: 0 }], { duration: o.duration + 500, easing: 'ease-out' });\n return a ? a.finished.then(end, end) : (end(), undefined);\n },\n },\n {\n name: 'label-float',\n kind: 'enter',\n description: 'Every `label` (or `[data-label]`) inside rises and settles one after another, like floating labels (`stagger`).',\n defaults: { stagger: 80, duration: 450 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const marked = Array.from(el.querySelectorAll<HTMLElement>('[data-label]'));\n const labels = marked.length ? marked : Array.from(el.querySelectorAll<HTMLElement>('label'));\n const items = labels.length ? labels : [el];\n return Promise.all(\n items.map((l, i) =>\n ctx.reduced\n ? fade(l, ctx)\n : ctx.animate(l, [{ transform: 'translateY(14px) scale(1.12)', opacity: 0, transformOrigin: '0 50%' }, { transform: 'translateY(-3px) scale(.96)', opacity: 1, offset: 0.7 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined)\n )\n ).then(() => undefined);\n },\n },\n {\n name: 'form-cascade',\n kind: 'enter',\n description: \"The element's children (fields, buttons) slide in one after another (`stagger`, `distance`).\",\n defaults: { stagger: 70, distance: 18, duration: 500 },\n run: (el: HTMLElement, o: any, ctx: EffectContext) => {\n const kids = Array.from(el.children) as HTMLElement[];\n const items = kids.length ? kids : [el];\n return Promise.all(\n items.map((k, i) =>\n ctx.reduced\n ? fade(k, ctx)\n : ctx.animate(k, [{ transform: `translateY(${Number(o.distance) || 18}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: o.duration, delay: i * o.stagger, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'backwards' })?.finished.catch(() => undefined)\n )\n ).then(() => undefined);\n },\n },\n];\n\n/** Register field-shake, field-success, label-float and form-cascade (7.7). */\nexport function registerFormPack(): void {\n registerEffects(FORM_FX);\n}\n"],"names":["registerEffects"],"mappings":";;;;;AAkBA;AACM,SAAU,WAAW,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAA;IACjD,MAAM,CAAC,GAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC7C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QAC1D,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAA,WAAA,EAAc,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA,GAAA,CAAK,EAAE,CAAC;IAC1D;IACA,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC7B,IAAA,OAAO,CAAC;AACV;AAEA,MAAM,IAAI,GAAG,CAAC,EAAe,EAAE,GAAkB,KAAK,GAAG,CAAC,OAAO,CAAC,EA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