motionary 6.9.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +2 -2
  3. package/README_ja.md +2 -2
  4. package/README_zh.md +2 -2
  5. package/dist/chunks/audio-DcPvT2Kh.js +333 -0
  6. package/dist/chunks/audio-DcPvT2Kh.js.map +1 -0
  7. package/dist/chunks/audio-EXUoijsG.cjs +342 -0
  8. package/dist/chunks/audio-EXUoijsG.cjs.map +1 -0
  9. package/dist/chunks/{base-D5MHqeDd.js → base-2-yYc93C.js} +2 -2
  10. package/dist/chunks/{base-D5MHqeDd.js.map → base-2-yYc93C.js.map} +1 -1
  11. package/dist/chunks/{core-DyJu5r5a.js → core-D5rU0CV6.js} +2 -2
  12. package/dist/chunks/{core-DyJu5r5a.js.map → core-D5rU0CV6.js.map} +1 -1
  13. package/dist/chunks/{core-ZGo4hOEk.js → core-DuO-AVXL.js} +2 -2
  14. package/dist/chunks/{core-ZGo4hOEk.js.map → core-DuO-AVXL.js.map} +1 -1
  15. package/dist/chunks/{fx-DlGRMJ-Z.js → fx-CMxWNwH8.js} +2 -2
  16. package/dist/chunks/{fx-DlGRMJ-Z.js.map → fx-CMxWNwH8.js.map} +1 -1
  17. package/dist/chunks/{gpu-DPhMkJq6.js → gpu-DLPghVWr.js} +183 -11
  18. package/dist/chunks/gpu-DLPghVWr.js.map +1 -0
  19. package/dist/chunks/{gpu-C2D4T9Q-.cjs → gpu-Dx0H875w.cjs} +185 -9
  20. package/dist/chunks/gpu-Dx0H875w.cjs.map +1 -0
  21. package/dist/chunks/{index-tags-wv0R_vkO.cjs → index-tags-BTMwrfgV.cjs} +3 -3
  22. package/dist/chunks/index-tags-BTMwrfgV.cjs.map +1 -0
  23. package/dist/chunks/{index-tags-DucKMQr_.js → index-tags-C04JP8g4.js} +3 -3
  24. package/dist/chunks/index-tags-C04JP8g4.js.map +1 -0
  25. package/dist/chunks/{player-DH3TIz-t.js → player-DxvCYo7Q.js} +4 -4
  26. package/dist/chunks/{player-DH3TIz-t.js.map → player-DxvCYo7Q.js.map} +1 -1
  27. package/dist/chunks/{registry-CTLWeg-J.js → registry-CyKExAmE.js} +2 -2
  28. package/dist/chunks/{registry-CTLWeg-J.js.map → registry-CyKExAmE.js.map} +1 -1
  29. package/dist/chunks/{spring-B-9MZOrW.js → spring-BK8DiezC.js} +2 -2
  30. package/dist/chunks/{spring-B-9MZOrW.js.map → spring-BK8DiezC.js.map} +1 -1
  31. package/dist/chunks/{variants-CoZn3k_5.js → variants-BQ6bhzn4.js} +2 -2
  32. package/dist/chunks/{variants-CoZn3k_5.js.map → variants-BQ6bhzn4.js.map} +1 -1
  33. package/dist/components/a11y.cjs +1 -1
  34. package/dist/components/a11y.d.cts +2 -2
  35. package/dist/components/a11y.d.ts +2 -2
  36. package/dist/components/a11y.js +3 -3
  37. package/dist/components/angular.cjs +2 -2
  38. package/dist/components/angular.cjs.map +1 -1
  39. package/dist/components/angular.d.cts +5 -36
  40. package/dist/components/angular.d.ts +5 -36
  41. package/dist/components/angular.js +9 -9
  42. package/dist/components/angular.js.map +1 -1
  43. package/dist/components/background.js +2 -2
  44. package/dist/components/bridge.js +1 -1
  45. package/dist/components/cards.js +2 -2
  46. package/dist/components/click.js +3 -3
  47. package/dist/components/depth.js +3 -3
  48. package/dist/components/effects.cjs +11 -336
  49. package/dist/components/effects.cjs.map +1 -1
  50. package/dist/components/effects.js +9 -333
  51. package/dist/components/effects.js.map +1 -1
  52. package/dist/components/feedback.js +1 -1
  53. package/dist/components/fx-3d.cjs +1 -7
  54. package/dist/components/fx-3d.cjs.map +1 -1
  55. package/dist/components/fx-3d.d.cts +1 -3
  56. package/dist/components/fx-3d.d.ts +1 -3
  57. package/dist/components/fx-3d.js +3 -8
  58. package/dist/components/fx-3d.js.map +1 -1
  59. package/dist/components/fx-focus.js +2 -2
  60. package/dist/components/fx-gpu.cjs +2 -3
  61. package/dist/components/fx-gpu.cjs.map +1 -1
  62. package/dist/components/fx-gpu.d.cts +1 -3
  63. package/dist/components/fx-gpu.d.ts +1 -3
  64. package/dist/components/fx-gpu.js +3 -3
  65. package/dist/components/fx-light.cjs +1 -7
  66. package/dist/components/fx-light.cjs.map +1 -1
  67. package/dist/components/fx-light.d.cts +1 -3
  68. package/dist/components/fx-light.d.ts +1 -3
  69. package/dist/components/fx-light.js +3 -8
  70. package/dist/components/fx-light.js.map +1 -1
  71. package/dist/components/fx-morph.cjs +1 -7
  72. package/dist/components/fx-morph.cjs.map +1 -1
  73. package/dist/components/fx-morph.d.cts +1 -3
  74. package/dist/components/fx-morph.d.ts +1 -3
  75. package/dist/components/fx-morph.js +3 -8
  76. package/dist/components/fx-morph.js.map +1 -1
  77. package/dist/components/fx-music.cjs +179 -0
  78. package/dist/components/fx-music.cjs.map +1 -0
  79. package/dist/components/fx-music.d.cts +102 -0
  80. package/dist/components/fx-music.d.ts +102 -0
  81. package/dist/components/fx-music.js +174 -0
  82. package/dist/components/fx-music.js.map +1 -0
  83. package/dist/components/fx-physics.cjs +1 -7
  84. package/dist/components/fx-physics.cjs.map +1 -1
  85. package/dist/components/fx-physics.d.cts +1 -3
  86. package/dist/components/fx-physics.d.ts +1 -3
  87. package/dist/components/fx-physics.js +3 -8
  88. package/dist/components/fx-physics.js.map +1 -1
  89. package/dist/components/fx-text.cjs +1 -7
  90. package/dist/components/fx-text.cjs.map +1 -1
  91. package/dist/components/fx-text.d.cts +1 -3
  92. package/dist/components/fx-text.d.ts +1 -3
  93. package/dist/components/fx-text.js +3 -8
  94. package/dist/components/fx-text.js.map +1 -1
  95. package/dist/components/fx-transitions.cjs +1 -7
  96. package/dist/components/fx-transitions.cjs.map +1 -1
  97. package/dist/components/fx-transitions.d.cts +1 -3
  98. package/dist/components/fx-transitions.d.ts +1 -3
  99. package/dist/components/fx-transitions.js +4 -9
  100. package/dist/components/fx-transitions.js.map +1 -1
  101. package/dist/components/fx-weather.cjs +1 -7
  102. package/dist/components/fx-weather.cjs.map +1 -1
  103. package/dist/components/fx-weather.d.cts +1 -3
  104. package/dist/components/fx-weather.d.ts +1 -3
  105. package/dist/components/fx-weather.js +3 -8
  106. package/dist/components/fx-weather.js.map +1 -1
  107. package/dist/components/fx.js +5 -5
  108. package/dist/components/fx2.cjs +15 -19
  109. package/dist/components/fx2.cjs.map +1 -1
  110. package/dist/components/fx2.d.cts +97 -22
  111. package/dist/components/fx2.d.ts +97 -22
  112. package/dist/components/fx2.js +16 -19
  113. package/dist/components/fx2.js.map +1 -1
  114. package/dist/components/gesture.js +4 -4
  115. package/dist/components/interaction.cjs +11 -95
  116. package/dist/components/interaction.cjs.map +1 -1
  117. package/dist/components/interaction.css +0 -1
  118. package/dist/components/interaction.d.cts +3 -21
  119. package/dist/components/interaction.d.ts +3 -21
  120. package/dist/components/interaction.js +13 -96
  121. package/dist/components/interaction.js.map +1 -1
  122. package/dist/components/jsx.d.cts +2 -2
  123. package/dist/components/jsx.d.ts +2 -2
  124. package/dist/components/layout.js +1 -1
  125. package/dist/components/lazy.cjs +1 -1
  126. package/dist/components/lazy.d.cts +2 -2
  127. package/dist/components/lazy.d.ts +2 -2
  128. package/dist/components/lazy.js +1 -1
  129. package/dist/components/lite.cjs +115 -258
  130. package/dist/components/lite.cjs.map +1 -1
  131. package/dist/components/lite.js +116 -257
  132. package/dist/components/lite.js.map +1 -1
  133. package/dist/components/marketplace.js +2 -2
  134. package/dist/components/packs.js +1 -1
  135. package/dist/components/page.js +3 -3
  136. package/dist/components/perf.cjs +1 -1
  137. package/dist/components/perf.d.cts +2 -2
  138. package/dist/components/perf.d.ts +2 -2
  139. package/dist/components/perf.js +3 -3
  140. package/dist/components/physics.js +3 -3
  141. package/dist/components/react.cjs +2 -2
  142. package/dist/components/react.cjs.map +1 -1
  143. package/dist/components/react.js +2 -2
  144. package/dist/components/react.js.map +1 -1
  145. package/dist/components/reveal.js +1 -1
  146. package/dist/components/solid.cjs +2 -2
  147. package/dist/components/solid.cjs.map +1 -1
  148. package/dist/components/solid.d.cts +4 -35
  149. package/dist/components/solid.d.ts +4 -35
  150. package/dist/components/solid.js +9 -9
  151. package/dist/components/solid.js.map +1 -1
  152. package/dist/components/svelte.cjs +2 -2
  153. package/dist/components/svelte.cjs.map +1 -1
  154. package/dist/components/svelte.d.cts +5 -36
  155. package/dist/components/svelte.d.ts +5 -36
  156. package/dist/components/svelte.js +9 -9
  157. package/dist/components/svelte.js.map +1 -1
  158. package/dist/components/svg.js +1 -1
  159. package/dist/components/text.js +2 -2
  160. package/dist/components/timeline.js +3 -3
  161. package/dist/components/transitions.js +1 -1
  162. package/dist/components/ui.cjs +16 -75
  163. package/dist/components/ui.cjs.map +1 -1
  164. package/dist/components/ui.css +0 -1
  165. package/dist/components/ui.d.cts +3 -18
  166. package/dist/components/ui.d.ts +3 -18
  167. package/dist/components/ui.js +21 -79
  168. package/dist/components/ui.js.map +1 -1
  169. package/dist/components/vue.cjs +2 -2
  170. package/dist/components/vue.cjs.map +1 -1
  171. package/dist/components/vue.d.cts +5 -36
  172. package/dist/components/vue.d.ts +5 -36
  173. package/dist/components/vue.js +9 -9
  174. package/dist/components/vue.js.map +1 -1
  175. package/dist/components/webgl.js +1 -1
  176. package/dist/components/widgets.cjs +542 -61
  177. package/dist/components/widgets.cjs.map +1 -1
  178. package/dist/components/widgets.d.cts +79 -2
  179. package/dist/components/widgets.d.ts +79 -2
  180. package/dist/components/widgets.js +542 -67
  181. package/dist/components/widgets.js.map +1 -1
  182. package/dist/components.cjs +1 -3
  183. package/dist/components.cjs.map +1 -1
  184. package/dist/components.css +0 -2
  185. package/dist/components.d.cts +6 -39
  186. package/dist/components.d.ts +6 -39
  187. package/dist/components.js +12 -12
  188. package/dist/components.umd.js +2 -2
  189. package/dist/components.umd.js.map +1 -1
  190. package/dist/index.js +2 -2
  191. package/dist/widgets.umd.js +1 -1
  192. package/dist/widgets.umd.js.map +1 -1
  193. package/docs/ROADMAP.md +12 -12
  194. package/docs/accessibility.md +2 -2
  195. package/docs/components.md +38 -2
  196. package/docs/frameworks-ssr.md +4 -4
  197. package/docs/hybrid-apps.md +2 -2
  198. package/docs/upgrading-7.md +11 -1
  199. package/docs/windows-apps.md +1 -1
  200. package/package.json +131 -1
  201. package/dist/chunks/gpu-C2D4T9Q-.cjs.map +0 -1
  202. package/dist/chunks/gpu-DPhMkJq6.js.map +0 -1
  203. package/dist/chunks/index-tags-DucKMQr_.js.map +0 -1
  204. package/dist/chunks/index-tags-wv0R_vkO.cjs.map +0 -1
@@ -0,0 +1,342 @@
1
+ 'use strict';
2
+
3
+ var registry = require('./registry-DehBVRDV.cjs');
4
+ var base = require('./base-BaQV-2ha.cjs');
5
+ var generative = require('./generative-BHIj-NU0.cjs');
6
+ var shared = require('./shared-jkgRH-Hx.cjs');
7
+
8
+ let actx = null;
9
+ let current = null;
10
+ const mediaSources = new WeakMap();
11
+ /** The running analyser, if `enableAudio()` was called. */
12
+ const getAudio = () => current;
13
+ function audioContext() {
14
+ const AC = globalThis.AudioContext || globalThis.webkitAudioContext;
15
+ if (!AC)
16
+ throw new Error('[motionary] Web Audio is not available');
17
+ if (!actx || actx.state === 'closed')
18
+ actx = new AC();
19
+ return actx;
20
+ }
21
+ /**
22
+ * Start analysing `input` and make it the source of every sound-reactive
23
+ * effect. Call from a user gesture. Replaces a previous source.
24
+ */
25
+ async function enableAudio(input = 'mic', opts = {}) {
26
+ current?.stop();
27
+ const ac = audioContext();
28
+ if (ac.state === 'suspended')
29
+ await ac.resume().catch(() => undefined);
30
+ const analyser = ac.createAnalyser();
31
+ analyser.fftSize = opts.fftSize || 512;
32
+ analyser.smoothingTimeConstant = opts.smoothing ?? 0.8;
33
+ let src;
34
+ let release = () => { };
35
+ const media = typeof input === 'string' && input !== 'mic' ? document.querySelector(input) : input;
36
+ if (media === 'mic') {
37
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
38
+ src = ac.createMediaStreamSource(stream);
39
+ src.connect(analyser); // never to the speakers: no feedback
40
+ release = () => stream.getTracks().forEach((t) => t.stop());
41
+ }
42
+ else if (media && typeof media.play === 'function') {
43
+ const m = media;
44
+ let node = mediaSources.get(m);
45
+ if (!node)
46
+ mediaSources.set(m, (node = ac.createMediaElementSource(m)));
47
+ try {
48
+ node.disconnect();
49
+ }
50
+ catch {
51
+ /* not connected */
52
+ }
53
+ src = node;
54
+ src.connect(analyser);
55
+ analyser.connect(ac.destination);
56
+ release = () => {
57
+ try {
58
+ node.disconnect();
59
+ }
60
+ catch {
61
+ /* already */
62
+ }
63
+ node.connect(ac.destination); // keep the media audible
64
+ };
65
+ if (m.paused)
66
+ await m.play()?.catch?.(() => undefined);
67
+ }
68
+ else if (media && typeof media.getTracks === 'function') {
69
+ src = ac.createMediaStreamSource(media);
70
+ src.connect(analyser);
71
+ }
72
+ else
73
+ throw new Error(`[motionary] enableAudio: no audio source for ${String(input)}`);
74
+ const freq = new Uint8Array(analyser.frequencyBinCount);
75
+ const wave = new Uint8Array(analyser.fftSize);
76
+ const self = {
77
+ context: ac,
78
+ analyser,
79
+ sample: () => {
80
+ analyser.getByteFrequencyData(freq);
81
+ analyser.getByteTimeDomainData(wave);
82
+ let sq = 0;
83
+ for (let i = 0; i < wave.length; i++)
84
+ sq += ((wave[i] - 128) / 128) ** 2;
85
+ const n = Math.max(1, Math.round(freq.length * 0.08));
86
+ let b = 0;
87
+ for (let i = 0; i < n; i++)
88
+ b += freq[i];
89
+ return { level: Math.min(1, Math.sqrt(sq / wave.length) * 2), bass: b / n / 255, freq, wave };
90
+ },
91
+ stop: () => {
92
+ if (current === self) {
93
+ current = null;
94
+ if (raf && typeof cancelAnimationFrame === 'function')
95
+ cancelAnimationFrame(raf);
96
+ raf = 0;
97
+ }
98
+ try {
99
+ src.disconnect();
100
+ analyser.disconnect();
101
+ }
102
+ catch {
103
+ /* already */
104
+ }
105
+ release();
106
+ setVars(0, 0);
107
+ },
108
+ };
109
+ current = self;
110
+ kick();
111
+ return self;
112
+ }
113
+ /** Stop the current audio source (if any). */
114
+ function disableAudio() {
115
+ current?.stop();
116
+ }
117
+ /** A pure beat detector: feed it energy (0–1) and a timestamp per frame; it answers "beat?". */
118
+ function createBeatDetector(o = {}) {
119
+ const { threshold = 1.35, cooldown = 250, history = 43, floor = 0.08 } = o;
120
+ const hist = [];
121
+ let last = -Infinity;
122
+ return (energy, now) => {
123
+ const avg = hist.length ? hist.reduce((a, b) => a + b, 0) / hist.length : energy;
124
+ const ready = hist.length >= 8;
125
+ hist.push(energy);
126
+ if (hist.length > history)
127
+ hist.shift();
128
+ if (ready && energy > floor && energy > avg * threshold && now - last >= cooldown) {
129
+ last = now;
130
+ return true;
131
+ }
132
+ return false;
133
+ };
134
+ }
135
+ const listeners = new Set();
136
+ let raf = 0;
137
+ function setVars(level, bass) {
138
+ if (typeof document === 'undefined')
139
+ return;
140
+ const s = document.documentElement.style;
141
+ s.setProperty('--usa-audio-level', level.toFixed(3));
142
+ s.setProperty('--usa-audio-bass', bass.toFixed(3));
143
+ }
144
+ function loop(now) {
145
+ raf = 0;
146
+ if (!current)
147
+ return;
148
+ const { level, bass } = current.sample();
149
+ const reduced = base.prefersReducedMotion();
150
+ setVars(reduced ? 0 : level, reduced ? 0 : bass);
151
+ for (const l of Array.from(listeners))
152
+ if (l.detect(bass, now))
153
+ l.cb({ energy: bass, time: now });
154
+ kick();
155
+ }
156
+ function kick() {
157
+ if (!raf && current && typeof requestAnimationFrame === 'function')
158
+ raf = requestAnimationFrame(loop);
159
+ }
160
+ /** Call `cb` on every detected beat of the current audio source. Returns an unsubscribe. */
161
+ function onBeat(cb, o = {}) {
162
+ const l = { detect: createBeatDetector(o), cb };
163
+ listeners.add(l);
164
+ kick();
165
+ return () => void listeners.delete(l);
166
+ }
167
+ /** Play the registered effect `name` on `el` at every beat (not under reduced motion). Returns an unbind. */
168
+ function bindBeat(el, name, options = {}) {
169
+ const { threshold, cooldown, history, floor, ...fx } = options;
170
+ return onBeat(() => {
171
+ if (!base.prefersReducedMotion())
172
+ registry.playEffect(el, name, fx).catch(() => undefined);
173
+ }, { threshold, cooldown, history, floor });
174
+ }
175
+ // --- visual effects ----------------------------------------------------------
176
+ /** The current sample, or a gentle synthetic one while no audio is enabled. */
177
+ function read(t, bins) {
178
+ if (current)
179
+ return { ...current.sample(), idle: false };
180
+ const freq = new Uint8Array(bins);
181
+ const wave = new Uint8Array(bins * 2);
182
+ for (let i = 0; i < bins; i++)
183
+ freq[i] = 70 + 50 * Math.sin(t * 2 + i * 0.35) * Math.cos(t * 0.7 + i * 0.11) * (1 - i / bins);
184
+ for (let i = 0; i < wave.length; i++)
185
+ wave[i] = 128 + 22 * Math.sin(t * 3 + i * 0.12);
186
+ return { level: 0.25 + 0.1 * Math.sin(t * 2), bass: 0.35 + 0.2 * Math.sin(t * 2.4), freq, wave, idle: true };
187
+ }
188
+ const audioFx = (name, description, defaults, spec) => ({
189
+ name,
190
+ kind: 'background',
191
+ description,
192
+ reduced: 'skip',
193
+ defaults: { colors: shared.PALETTE, background: '#0b0d12', speed: 1, quality: 1, ...defaults },
194
+ run: (el, o, ctx) => generative.canvasBackground(el, ctx, spec, o),
195
+ });
196
+ const AUDIO_FX = [
197
+ audioFx('spectrum-bars', 'Frequency bars dance to the audio (mirror them with `mirror: true`).', { bars: 48, gap: 2, mirror: false }, {
198
+ draw: ({ ctx, w, h, t, o }) => {
199
+ ctx.fillStyle = o.background;
200
+ ctx.fillRect(0, 0, w, h);
201
+ const s = read(t, o.bars);
202
+ const per = Math.max(1, Math.floor((s.freq.length * 0.7) / o.bars));
203
+ const bw = w / o.bars;
204
+ for (let i = 0; i < o.bars; i++) {
205
+ let v = 0;
206
+ for (let k = 0; k < per; k++)
207
+ v += s.freq[Math.min(s.freq.length - 1, i * per + k)];
208
+ const bh = (v / per / 255) * h * (o.mirror ? 0.5 : 0.9);
209
+ ctx.fillStyle = o.colors[i % o.colors.length];
210
+ ctx.fillRect(i * bw + o.gap / 2, o.mirror ? h / 2 - bh : h - bh, Math.max(1, bw - o.gap), o.mirror ? bh * 2 : bh);
211
+ }
212
+ },
213
+ }),
214
+ audioFx('pulse-ring', 'Glowing rings pulse with the bass.', { rings: 3, color: '#7c5cff' }, {
215
+ draw: ({ ctx, w, h, t, o }) => {
216
+ ctx.fillStyle = o.background;
217
+ ctx.fillRect(0, 0, w, h);
218
+ const s = read(t, 32);
219
+ const [r, g, b] = generative.hexRgb(o.color);
220
+ const base = Math.min(w, h) * 0.18;
221
+ for (let i = 0; i < o.rings; i++) {
222
+ const rad = base * (1 + i * 0.55) * (1 + s.bass * 0.6);
223
+ ctx.strokeStyle = `rgba(${r},${g},${b},${(0.9 - i * 0.25) * (0.4 + s.level)})`;
224
+ ctx.lineWidth = 3 + s.bass * 10 - i;
225
+ ctx.beginPath();
226
+ ctx.arc(w / 2, h / 2, rad, 0, Math.PI * 2);
227
+ ctx.stroke();
228
+ }
229
+ },
230
+ }),
231
+ audioFx('wave-ring', 'The live waveform wrapped into a circle.', { color: '#22d3ee', amplitude: 0.35 }, {
232
+ draw: ({ ctx, w, h, t, o }) => {
233
+ ctx.fillStyle = o.background;
234
+ ctx.fillRect(0, 0, w, h);
235
+ const s = read(t, 64);
236
+ const n = s.wave.length;
237
+ const base = Math.min(w, h) * 0.28;
238
+ ctx.strokeStyle = o.color;
239
+ ctx.lineWidth = 2;
240
+ ctx.beginPath();
241
+ for (let i = 0; i <= n; i++) {
242
+ const a = (i / n) * Math.PI * 2;
243
+ const rad = base * (1 + ((s.wave[i % n] - 128) / 128) * o.amplitude * 2);
244
+ const x = w / 2 + Math.cos(a) * rad;
245
+ const y = h / 2 + Math.sin(a) * rad;
246
+ if (i)
247
+ ctx.lineTo(x, y);
248
+ else
249
+ ctx.moveTo(x, y);
250
+ }
251
+ ctx.closePath();
252
+ ctx.stroke();
253
+ },
254
+ }),
255
+ ];
256
+ /**
257
+ * `<usa-audio source="#track | mic" label="…">` — a toggle button (yours, as
258
+ * `[data-audio-toggle]`, or one it renders) that enables the audio source on
259
+ * click; children with `data-usa-beat="effect"` play that effect on every
260
+ * beat (`data-usa-beat-options` JSON; `threshold` / `cooldown` attributes).
261
+ * Emits `usa-beat` and `usa-audio-error`.
262
+ */
263
+ function defineAudio(tag = 'usa-audio') {
264
+ return base.defineElement(tag, (Base) => class UsaAudio extends Base {
265
+ constructor() {
266
+ super(...arguments);
267
+ this.active = false;
268
+ this.audio = null;
269
+ this.off = null;
270
+ }
271
+ static get observedAttributes() {
272
+ return ['source'];
273
+ }
274
+ button() {
275
+ let b = this.querySelector('[data-audio-toggle]');
276
+ if (!b) {
277
+ b = document.createElement('button');
278
+ b.type = 'button';
279
+ b.setAttribute('data-audio-toggle', '');
280
+ b.textContent = this.str('label', '🔊 Enable sound-reactive effects');
281
+ this.prepend(b);
282
+ this.onCleanup(() => b.remove());
283
+ }
284
+ return b;
285
+ }
286
+ async toggle() {
287
+ const b = this.button();
288
+ if (this.active)
289
+ return this.stop();
290
+ try {
291
+ this.audio = await enableAudio(this.str('source', 'mic'));
292
+ this.active = true;
293
+ this.removeAttribute('data-audio-error');
294
+ b.setAttribute('aria-pressed', 'true');
295
+ this.off = onBeat((d) => {
296
+ this.dispatchEvent(new CustomEvent('usa-beat', { detail: d, bubbles: true }));
297
+ if (base.prefersReducedMotion())
298
+ return;
299
+ this.querySelectorAll('[data-usa-beat]').forEach((el) => {
300
+ let opts = {};
301
+ try {
302
+ opts = JSON.parse(el.dataset.usaBeatOptions || '{}') || {};
303
+ }
304
+ catch {
305
+ /* ignore bad JSON */
306
+ }
307
+ registry.playEffect(el, el.dataset.usaBeat || 'pulse', opts).catch(() => undefined);
308
+ });
309
+ }, { threshold: this.num('threshold', 1.35), cooldown: this.num('cooldown', 250) });
310
+ }
311
+ catch (err) {
312
+ this.setAttribute('data-audio-error', '');
313
+ this.dispatchEvent(new CustomEvent('usa-audio-error', { detail: { error: err }, bubbles: true }));
314
+ }
315
+ }
316
+ stop() {
317
+ this.off?.();
318
+ this.off = null;
319
+ if (this.audio && current === this.audio)
320
+ this.audio.stop();
321
+ this.audio = null;
322
+ this.active = false;
323
+ this.querySelector('[data-audio-toggle]')?.setAttribute('aria-pressed', 'false');
324
+ }
325
+ mount() {
326
+ const b = this.button();
327
+ b.setAttribute('aria-pressed', 'false');
328
+ this.listen(b, 'click', () => void this.toggle());
329
+ this.onCleanup(() => this.stop());
330
+ }
331
+ }, { id: 'usa-audio', text: 'usa-audio{display:block}usa-audio[data-audio-error] [data-audio-toggle]{outline:2px solid #ff5c8a}' });
332
+ }
333
+
334
+ exports.AUDIO_FX = AUDIO_FX;
335
+ exports.bindBeat = bindBeat;
336
+ exports.createBeatDetector = createBeatDetector;
337
+ exports.defineAudio = defineAudio;
338
+ exports.disableAudio = disableAudio;
339
+ exports.enableAudio = enableAudio;
340
+ exports.getAudio = getAudio;
341
+ exports.onBeat = onBeat;
342
+ //# sourceMappingURL=audio-EXUoijsG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-EXUoijsG.cjs","sources":["../../src/components/effects/audio.ts"],"sourcesContent":["/**\n * 5.6 — sound-reactive effects (Web Audio).\n *\n * - `enableAudio(input)` — start analysing the microphone (`'mic'`), an\n * `<audio>` / `<video>` element (or a selector for one) or a `MediaStream`.\n * Browsers only allow an `AudioContext` to start inside a user gesture, so\n * call it from a click handler (or use `<usa-audio>`, which renders the\n * toggle button for you).\n * - Background effects (kind `background`, Canvas 2D through\n * `canvasBackground()`): `spectrum-bars`, `pulse-ring`, `wave-ring`. Before\n * audio is enabled they idle gently.\n * - Beat detection: `createBeatDetector()` (pure: energy → beat?), `onBeat(cb)`\n * and `bindBeat(el, effect, options)`, which plays any registered effect on\n * every beat. `<usa-audio>` does the same for `[data-usa-beat=\"effect\"]`\n * children and emits `usa-beat`.\n * - While audio runs, `--usa-audio-level` and `--usa-audio-bass` (0–1) are set\n * on `<html>` for CSS-driven reactions.\n *\n * Reduced motion: the visual effects are skipped, beats play no effects and\n * the CSS variables stay at 0 — audio itself keeps playing.\n */\nimport type { EffectDefinition } from '../fx/registry';\nimport { playEffect } from '../fx/registry';\nimport { defineElement, prefersReducedMotion, type UsaElement } from '../base';\nimport { canvasBackground, hexRgb, type GenerativeSpec } from './generative';\nimport { PALETTE } from './shared';\n\nexport type AudioInput = 'mic' | HTMLMediaElement | MediaStream | string;\n\nexport interface AudioSample {\n /** Overall loudness (RMS of the waveform), 0–1. */\n level: number;\n /** Low-frequency energy (first ~8 % of the spectrum), 0–1. */\n bass: number;\n /** Frequency bins, 0–255 each. */\n freq: Uint8Array;\n /** Time-domain waveform, 0–255 (128 = silence). */\n wave: Uint8Array;\n}\n\nexport interface AudioReactive {\n readonly context: AudioContext;\n readonly analyser: AnalyserNode;\n /** Read the analyser now. */\n sample(): AudioSample;\n /** Stop analysing (media keeps playing; the microphone is released). */\n stop(): void;\n}\n\nexport interface BeatOptions {\n /** A beat is energy above `threshold` × the recent average (default 1.35). */\n threshold?: number;\n /** Minimum ms between beats (default 250). */\n cooldown?: number;\n /** Frames of history for the average (default 43 ≈ 0.7 s). */\n history?: number;\n /** Ignore energy below this floor, 0–1 (default 0.08). */\n floor?: number;\n}\n\nlet actx: AudioContext | null = null;\nlet current: AudioReactive | null = null;\nconst mediaSources = new WeakMap<HTMLMediaElement, MediaElementAudioSourceNode>();\n\n/** The running analyser, if `enableAudio()` was called. */\nexport const getAudio = (): AudioReactive | null => current;\n\nfunction audioContext(): AudioContext {\n const AC = (globalThis as any).AudioContext || (globalThis as any).webkitAudioContext;\n if (!AC) throw new Error('[motionary] Web Audio is not available');\n if (!actx || actx.state === 'closed') actx = new AC() as AudioContext;\n return actx;\n}\n\n/**\n * Start analysing `input` and make it the source of every sound-reactive\n * effect. Call from a user gesture. Replaces a previous source.\n */\nexport async function enableAudio(input: AudioInput = 'mic', opts: { fftSize?: number; smoothing?: number } = {}): Promise<AudioReactive> {\n current?.stop();\n const ac = audioContext();\n if (ac.state === 'suspended') await ac.resume().catch(() => undefined);\n const analyser = ac.createAnalyser();\n analyser.fftSize = opts.fftSize || 512;\n analyser.smoothingTimeConstant = opts.smoothing ?? 0.8;\n let src: AudioNode;\n let release = () => {};\n const media = typeof input === 'string' && input !== 'mic' ? document.querySelector<HTMLMediaElement>(input) : input;\n if (media === 'mic') {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n src = ac.createMediaStreamSource(stream);\n src.connect(analyser); // never to the speakers: no feedback\n release = () => stream.getTracks().forEach((t) => t.stop());\n } else if (media && typeof (media as HTMLMediaElement).play === 'function') {\n const m = media as HTMLMediaElement;\n let node = mediaSources.get(m);\n if (!node) mediaSources.set(m, (node = ac.createMediaElementSource(m)));\n try {\n node.disconnect();\n } catch {\n /* not connected */\n }\n src = node;\n src.connect(analyser);\n analyser.connect(ac.destination);\n release = () => {\n try {\n node!.disconnect();\n } catch {\n /* already */\n }\n node!.connect(ac.destination); // keep the media audible\n };\n if (m.paused) await m.play()?.catch?.(() => undefined);\n } else if (media && typeof (media as MediaStream).getTracks === 'function') {\n src = ac.createMediaStreamSource(media as MediaStream);\n src.connect(analyser);\n } else throw new Error(`[motionary] enableAudio: no audio source for ${String(input)}`);\n const freq = new Uint8Array(analyser.frequencyBinCount);\n const wave = new Uint8Array(analyser.fftSize);\n const self: AudioReactive = {\n context: ac,\n analyser,\n sample: () => {\n analyser.getByteFrequencyData(freq);\n analyser.getByteTimeDomainData(wave);\n let sq = 0;\n for (let i = 0; i < wave.length; i++) sq += ((wave[i] - 128) / 128) ** 2;\n const n = Math.max(1, Math.round(freq.length * 0.08));\n let b = 0;\n for (let i = 0; i < n; i++) b += freq[i];\n return { level: Math.min(1, Math.sqrt(sq / wave.length) * 2), bass: b / n / 255, freq, wave };\n },\n stop: () => {\n if (current === self) {\n current = null;\n if (raf && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(raf);\n raf = 0;\n }\n try {\n src.disconnect();\n analyser.disconnect();\n } catch {\n /* already */\n }\n release();\n setVars(0, 0);\n },\n };\n current = self;\n kick();\n return self;\n}\n\n/** Stop the current audio source (if any). */\nexport function disableAudio(): void {\n current?.stop();\n}\n\n/** A pure beat detector: feed it energy (0–1) and a timestamp per frame; it answers \"beat?\". */\nexport function createBeatDetector(o: BeatOptions = {}): (energy: number, now: number) => boolean {\n const { threshold = 1.35, cooldown = 250, history = 43, floor = 0.08 } = o;\n const hist: number[] = [];\n let last = -Infinity;\n return (energy, now) => {\n const avg = hist.length ? hist.reduce((a, b) => a + b, 0) / hist.length : energy;\n const ready = hist.length >= 8;\n hist.push(energy);\n if (hist.length > history) hist.shift();\n if (ready && energy > floor && energy > avg * threshold && now - last >= cooldown) {\n last = now;\n return true;\n }\n return false;\n };\n}\n\ntype BeatListener = { detect: (e: number, t: number) => boolean; cb: (detail: { energy: number; time: number }) => void };\nconst listeners = new Set<BeatListener>();\nlet raf = 0;\n\nfunction setVars(level: number, bass: number): void {\n if (typeof document === 'undefined') return;\n const s = document.documentElement.style;\n s.setProperty('--usa-audio-level', level.toFixed(3));\n s.setProperty('--usa-audio-bass', bass.toFixed(3));\n}\n\nfunction loop(now: number): void {\n raf = 0;\n if (!current) return;\n const { level, bass } = current.sample();\n const reduced = prefersReducedMotion();\n setVars(reduced ? 0 : level, reduced ? 0 : bass);\n for (const l of Array.from(listeners)) if (l.detect(bass, now)) l.cb({ energy: bass, time: now });\n kick();\n}\n\nfunction kick(): void {\n if (!raf && current && typeof requestAnimationFrame === 'function') raf = requestAnimationFrame(loop);\n}\n\n/** Call `cb` on every detected beat of the current audio source. Returns an unsubscribe. */\nexport function onBeat(cb: (detail: { energy: number; time: number }) => void, o: BeatOptions = {}): () => void {\n const l: BeatListener = { detect: createBeatDetector(o), cb };\n listeners.add(l);\n kick();\n return () => void listeners.delete(l);\n}\n\n/** Play the registered effect `name` on `el` at every beat (not under reduced motion). Returns an unbind. */\nexport function bindBeat(el: HTMLElement, name: string, options: Record<string, unknown> & BeatOptions = {}): () => void {\n const { threshold, cooldown, history, floor, ...fx } = options;\n return onBeat(() => {\n if (!prefersReducedMotion()) playEffect(el, name, fx).catch(() => undefined);\n }, { threshold, cooldown, history, floor } as BeatOptions);\n}\n\n// --- visual effects ----------------------------------------------------------\n\n/** The current sample, or a gentle synthetic one while no audio is enabled. */\nfunction read(t: number, bins: number): AudioSample & { idle: boolean } {\n if (current) return { ...current.sample(), idle: false };\n const freq = new Uint8Array(bins);\n const wave = new Uint8Array(bins * 2);\n for (let i = 0; i < bins; i++) freq[i] = 70 + 50 * Math.sin(t * 2 + i * 0.35) * Math.cos(t * 0.7 + i * 0.11) * (1 - i / bins);\n for (let i = 0; i < wave.length; i++) wave[i] = 128 + 22 * Math.sin(t * 3 + i * 0.12);\n return { level: 0.25 + 0.1 * Math.sin(t * 2), bass: 0.35 + 0.2 * Math.sin(t * 2.4), freq, wave, idle: true };\n}\n\nconst audioFx = (name: string, description: string, defaults: Record<string, unknown>, spec: GenerativeSpec): EffectDefinition => ({\n name,\n kind: 'background',\n description,\n reduced: 'skip',\n defaults: { colors: PALETTE, background: '#0b0d12', speed: 1, quality: 1, ...defaults },\n run: (el, o: any, ctx) => canvasBackground(el, ctx, spec, o),\n});\n\nexport const AUDIO_FX: EffectDefinition[] = [\n audioFx('spectrum-bars', 'Frequency bars dance to the audio (mirror them with `mirror: true`).', { bars: 48, gap: 2, mirror: false }, {\n draw: ({ ctx, w, h, t, o }) => {\n ctx.fillStyle = o.background;\n ctx.fillRect(0, 0, w, h);\n const s = read(t, o.bars);\n const per = Math.max(1, Math.floor((s.freq.length * 0.7) / o.bars));\n const bw = w / o.bars;\n for (let i = 0; i < o.bars; i++) {\n let v = 0;\n for (let k = 0; k < per; k++) v += s.freq[Math.min(s.freq.length - 1, i * per + k)];\n const bh = (v / per / 255) * h * (o.mirror ? 0.5 : 0.9);\n ctx.fillStyle = o.colors[i % o.colors.length];\n ctx.fillRect(i * bw + o.gap / 2, o.mirror ? h / 2 - bh : h - bh, Math.max(1, bw - o.gap), o.mirror ? bh * 2 : bh);\n }\n },\n }),\n audioFx('pulse-ring', 'Glowing rings pulse with the bass.', { rings: 3, color: '#7c5cff' }, {\n draw: ({ ctx, w, h, t, o }) => {\n ctx.fillStyle = o.background;\n ctx.fillRect(0, 0, w, h);\n const s = read(t, 32);\n const [r, g, b] = hexRgb(o.color);\n const base = Math.min(w, h) * 0.18;\n for (let i = 0; i < o.rings; i++) {\n const rad = base * (1 + i * 0.55) * (1 + s.bass * 0.6);\n ctx.strokeStyle = `rgba(${r},${g},${b},${(0.9 - i * 0.25) * (0.4 + s.level)})`;\n ctx.lineWidth = 3 + s.bass * 10 - i;\n ctx.beginPath();\n ctx.arc(w / 2, h / 2, rad, 0, Math.PI * 2);\n ctx.stroke();\n }\n },\n }),\n audioFx('wave-ring', 'The live waveform wrapped into a circle.', { color: '#22d3ee', amplitude: 0.35 }, {\n draw: ({ ctx, w, h, t, o }) => {\n ctx.fillStyle = o.background;\n ctx.fillRect(0, 0, w, h);\n const s = read(t, 64);\n const n = s.wave.length;\n const base = Math.min(w, h) * 0.28;\n ctx.strokeStyle = o.color;\n ctx.lineWidth = 2;\n ctx.beginPath();\n for (let i = 0; i <= n; i++) {\n const a = (i / n) * Math.PI * 2;\n const rad = base * (1 + ((s.wave[i % n] - 128) / 128) * o.amplitude * 2);\n const x = w / 2 + Math.cos(a) * rad;\n const y = h / 2 + Math.sin(a) * rad;\n if (i) ctx.lineTo(x, y);\n else ctx.moveTo(x, y);\n }\n ctx.closePath();\n ctx.stroke();\n },\n }),\n];\n\n// --- <usa-audio> -----------------------------------------------------------\n\nexport interface UsaAudioElement extends UsaElement {\n /** `true` while this element's audio source is being analysed. */\n readonly active: boolean;\n /** Start (from a user gesture) or stop analysing. */\n toggle(): Promise<void>;\n}\n\n/**\n * `<usa-audio source=\"#track | mic\" label=\"…\">` — a toggle button (yours, as\n * `[data-audio-toggle]`, or one it renders) that enables the audio source on\n * click; children with `data-usa-beat=\"effect\"` play that effect on every\n * beat (`data-usa-beat-options` JSON; `threshold` / `cooldown` attributes).\n * Emits `usa-beat` and `usa-audio-error`.\n */\nexport function defineAudio(tag = 'usa-audio'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaAudio extends Base {\n static get observedAttributes(): string[] {\n return ['source'];\n }\n active = false;\n private audio: AudioReactive | null = null;\n private off: (() => void) | null = null;\n private button(): HTMLButtonElement {\n let b = this.querySelector<HTMLButtonElement>('[data-audio-toggle]');\n if (!b) {\n b = document.createElement('button');\n b.type = 'button';\n b.setAttribute('data-audio-toggle', '');\n b.textContent = this.str('label', '🔊 Enable sound-reactive effects');\n this.prepend(b);\n this.onCleanup(() => b!.remove());\n }\n return b;\n }\n async toggle(): Promise<void> {\n const b = this.button();\n if (this.active) return this.stop();\n try {\n this.audio = await enableAudio(this.str('source', 'mic'));\n this.active = true;\n this.removeAttribute('data-audio-error');\n b.setAttribute('aria-pressed', 'true');\n this.off = onBeat((d) => {\n this.dispatchEvent(new CustomEvent('usa-beat', { detail: d, bubbles: true }));\n if (prefersReducedMotion()) return;\n this.querySelectorAll<HTMLElement>('[data-usa-beat]').forEach((el) => {\n let opts = {};\n try {\n opts = JSON.parse(el.dataset.usaBeatOptions || '{}') || {};\n } catch {\n /* ignore bad JSON */\n }\n playEffect(el, el.dataset.usaBeat || 'pulse', opts).catch(() => undefined);\n });\n }, { threshold: this.num('threshold', 1.35), cooldown: this.num('cooldown', 250) });\n } catch (err) {\n this.setAttribute('data-audio-error', '');\n this.dispatchEvent(new CustomEvent('usa-audio-error', { detail: { error: err }, bubbles: true }));\n }\n }\n private stop(): void {\n this.off?.();\n this.off = null;\n if (this.audio && current === this.audio) this.audio.stop();\n this.audio = null;\n this.active = false;\n this.querySelector('[data-audio-toggle]')?.setAttribute('aria-pressed', 'false');\n }\n mount(): void {\n const b = this.button();\n b.setAttribute('aria-pressed', 'false');\n this.listen(b, 'click', () => void this.toggle());\n this.onCleanup(() => this.stop());\n }\n },\n { id: 'usa-audio', text: 'usa-audio{display:block}usa-audio[data-audio-error] [data-audio-toggle]{outline:2px solid #ff5c8a}' }\n );\n}\n"],"names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ACvB,YAAA,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC;AACvC,YAAA,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YACjD,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACnC;KACD,EACH,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,oGAAoG,EAAE,CAChI;AACH;;;;;;;;;;;"}
@@ -400,5 +400,5 @@ function kindOf(el, valid, fallback) {
400
400
  }
401
401
  const clamp = (v, min, max) => Math.min(max, Math.max(min, v));
402
402
 
403
- export { kindOf as A, shadowStyles as B, EASE_SPRING as E, FLUENT_DECELERATE as F, MOTION_SCALE as M, MOTION_SENSITIVITY_LEVELS as a, activeAnimations as b, canDefine as c, adaptKeyframes as d, animateWithMotion as e, animationBudget as f, configureComponents as g, getMotionIntensity as h, getMotionSensitivity as i, setAnimationBudget as j, clamp as k, caf as l, motionScale as m, applyFrame as n, onFrame as o, prefersReducedMotion as p, now as q, raf as r, schedulerStats as s, setStyleLoader as t, deprecate as u, srText as v, withoutDeprecations as w, adoptStyles as x, defineElement as y, EASE_OUT as z };
404
- //# sourceMappingURL=base-D5MHqeDd.js.map
403
+ export { kindOf as A, shadowStyles as B, EASE_SPRING as E, FLUENT_DECELERATE as F, MOTION_SCALE as M, MOTION_SENSITIVITY_LEVELS as a, activeAnimations as b, canDefine as c, adaptKeyframes as d, animateWithMotion as e, animationBudget as f, configureComponents as g, getMotionIntensity as h, getMotionSensitivity as i, setAnimationBudget as j, clamp as k, caf as l, motionScale as m, applyFrame as n, onFrame as o, prefersReducedMotion as p, now as q, raf as r, schedulerStats as s, setStyleLoader as t, defineElement as u, srText as v, withoutDeprecations as w, adoptStyles as x, deprecate as y, EASE_OUT as z };
404
+ //# sourceMappingURL=base-2-yYc93C.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-D5MHqeDd.js","sources":["../../src/components/base.ts"],"sourcesContent":["/**\n * motionary/components — shared base for the `<usa-*>` custom elements.\n *\n * Everything here is lazy: nothing touches `window`, `document`,\n * `HTMLElement` or `matchMedia` at import time, so the components can be\n * imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload\n * scripts. Classes are created the first time a `define*()` function runs.\n */\n\nexport interface ComponentsConfig {\n /**\n * Inject each component's CSS when it is defined (default `true`). Uses a\n * constructable stylesheet (`document.adoptedStyleSheets`, which a strict\n * `style-src` CSP does not block) and falls back to a `<style>` tag. Set\n * to `false` when you load `motionary/components.css` yourself.\n */\n injectStyles?: boolean;\n /**\n * `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always\n * uses the reduced variants (e.g. a kiosk / battery-saver mode). 5.0: the\n * OS setting can no longer be ignored (`'no-preference'` was removed).\n */\n reducedMotion?: 'user' | 'reduce';\n /**\n * Global motion intensity (v2.7): `'low'` (shorter, calmer), `'normal'`\n * (default) or `'high'`. Scales every component animation's duration and\n * sets `--usa-motion` (0.6 / 1 / 1.25) on `<html>` for your own CSS. 5.0:\n * `'off'` was removed — use `motionSensitivity: 'minimal'`.\n */\n motionIntensity?: MotionIntensity;\n /**\n * Motion-sensitivity level (v4.4), finer than reduced motion:\n * `'full'` (default) · `'gentle'` (no spins, zooms, skews or parallax —\n * translations and fades only, safe for vestibular disorders) ·\n * `'minimal'` (fades only; components use their reduced-motion variants) ·\n * `'static'` (no animation: every component shows its static alternative).\n * See `setMotionSensitivity()` in `motionary/components/a11y`.\n */\n motionSensitivity?: MotionSensitivity;\n}\n\nexport type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';\nexport const MOTION_SENSITIVITY_LEVELS: readonly MotionSensitivity[] = ['full', 'gentle', 'minimal', 'static'];\n\nexport type MotionIntensity = 'low' | 'normal' | 'high';\nexport const MOTION_SCALE: Record<MotionIntensity, number> = { low: 0.6, normal: 1, high: 1.25 };\n\nconst config: Required<ComponentsConfig> = { injectStyles: true, reducedMotion: 'user', motionIntensity: 'normal', motionSensitivity: 'full' };\n\n/** Change global component settings (call before `define*()` for `injectStyles`). */\nexport function configureComponents(options: ComponentsConfig): void {\n options = { ...options };\n // 5.0: removed values are ignored (see docs/upgrading-5.md)\n if (options.motionIntensity && !(options.motionIntensity in MOTION_SCALE)) delete options.motionIntensity;\n if (options.reducedMotion && options.reducedMotion !== 'reduce') options.reducedMotion = 'user';\n Object.assign(config, options);\n if (options.motionIntensity && typeof document !== 'undefined') {\n document.documentElement.style.setProperty('--usa-motion', String(MOTION_SCALE[options.motionIntensity] ?? 1));\n document.documentElement.setAttribute('data-usa-motion', options.motionIntensity);\n }\n if (options.motionSensitivity && typeof document !== 'undefined') {\n if (options.motionSensitivity === 'full') document.documentElement.removeAttribute('data-usa-sensitivity');\n else document.documentElement.setAttribute('data-usa-sensitivity', options.motionSensitivity);\n }\n}\n\n/** The current motion-sensitivity level (v4.4). */\nexport function getMotionSensitivity(): MotionSensitivity {\n return config.motionSensitivity;\n}\n\nconst VESTIBULAR = /rotate|scale|skew|perspective|matrix3d/;\n/**\n * Adapt keyframes to the sensitivity level: `gentle` drops transforms that\n * spin, zoom or skew (and 3D), `minimal` keeps opacity only, `static` keeps\n * just the final frame. `full` returns them unchanged.\n */\nexport function adaptKeyframes(frames: Keyframe[], level: MotionSensitivity = config.motionSensitivity): Keyframe[] {\n if (level === 'full' || !frames.length) return frames;\n if (level === 'static') return [frames[frames.length - 1]];\n return frames.map((f) => {\n const out: Keyframe = {};\n for (const [k, v] of Object.entries(f)) {\n if (k === 'offset' || k === 'easing' || k === 'composite') out[k] = v as any;\n else if (level === 'minimal') {\n if (k === 'opacity') out[k] = v as any;\n } else if (k === 'rotate' || k === 'scale' || (k === 'transform' && VESTIBULAR.test(String(v)))) continue;\n else out[k] = v as any;\n }\n return out;\n });\n}\n\nlet quiet = 0;\n/** Run `fn` without 4.9 deprecation warnings (library-internal calls). */\nexport function withoutDeprecations<T>(fn: () => T): T {\n quiet++;\n try {\n return fn();\n } finally {\n quiet--;\n }\n}\n\n/** The current global motion intensity. */\nexport function getMotionIntensity(): MotionIntensity {\n return config.motionIntensity;\n}\n\n/** Duration multiplier for the current intensity (1 when `normal`). */\nexport function motionScale(): number {\n return MOTION_SCALE[config.motionIntensity] ?? 1;\n}\n\nexport const canDefine = (): boolean => typeof customElements !== 'undefined' && typeof HTMLElement !== 'undefined';\n\n/** `true` when animations should be reduced (OS setting or `configureComponents`). */\nexport function prefersReducedMotion(): boolean {\n if (config.motionSensitivity === 'minimal' || config.motionSensitivity === 'static') return true;\n if (config.reducedMotion === 'reduce') return true;\n return typeof matchMedia === 'function' && !!matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nconst injected = new Set<string>();\n\n/** Add a component's stylesheet to the document once. */\nexport function adoptStyles(id: string, css: string): void {\n if (!config.injectStyles || !css || injected.has(id) || typeof document === 'undefined') return;\n injected.add(id);\n try {\n if (typeof CSSStyleSheet === 'function' && 'adoptedStyleSheets' in document) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(css);\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n return;\n }\n } catch {\n /* fall through to <style> */\n }\n const style = document.createElement('style');\n style.setAttribute('data-usa', id);\n style.textContent = css;\n (document.head || document.documentElement).appendChild(style);\n}\n\n/** Attach `css` to a shadow root (constructable sheet where supported, else `<style>`). */\nexport function shadowStyles(root: ShadowRoot, css: string): void {\n try {\n if (typeof CSSStyleSheet === 'function' && 'adoptedStyleSheets' in root) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(css);\n root.adoptedStyleSheets = [sheet];\n return;\n }\n } catch {\n /* fall through */\n }\n const style = document.createElement('style');\n style.textContent = css;\n root.prepend(style);\n}\n\nexport type Cleanup = () => void;\n\n/**\n * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup\n * bag that is emptied on disconnect, and motion helpers that degrade to the\n * final state without WAAPI or under reduced motion.\n */\nexport interface UsaElement extends HTMLElement {\n /** `true` while reduced motion applies to this element. */\n readonly reduced: boolean;\n}\n\nexport interface UsaBase extends UsaElement {\n mount(): void;\n changed(name: string): void;\n unmount(): void;\n str(name: string, fallback?: string): string;\n num(name: string, fallback: number): number;\n flag(name: string): boolean;\n setFlag(name: string, on: boolean): void;\n onCleanup(fn: Cleanup): void;\n listen<K extends keyof HTMLElementEventMap>(\n target: EventTarget,\n type: K | string,\n fn: (e: any) => void,\n options?: AddEventListenerOptions\n ): void;\n inView(cb: (visible: boolean, entry?: IntersectionObserverEntry) => void, init?: IntersectionObserverInit, target?: Element): void;\n motion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;\n emit(type: string, detail?: unknown): boolean;\n}\n\ntype BaseCtor = new () => UsaBase;\nlet baseClass: BaseCtor | null = null;\n\n/** The lazily created base class (needs `HTMLElement`). */\nexport function getBase(): BaseCtor {\n if (baseClass) return baseClass;\n class Base extends HTMLElement {\n private _cleanups: Cleanup[] = [];\n private _connected = false;\n\n get reduced(): boolean {\n return prefersReducedMotion();\n }\n\n connectedCallback(): void {\n if (this._connected) return;\n this._connected = true;\n styleLoader?.(this.localName);\n // Upgraded while the parser is still inside us (a <script> in <head>\n // defined the element): children/text are not there yet, so wait.\n if (typeof document !== 'undefined' && document.readyState === 'loading' && !this.nextSibling && !this.childNodes.length) {\n const go = () => {\n if (this._connected && this.isConnected) this.mount();\n };\n document.addEventListener('DOMContentLoaded', go, { once: true });\n this._cleanups.push(() => document.removeEventListener('DOMContentLoaded', go));\n return;\n }\n this.mount();\n }\n\n disconnectedCallback(): void {\n this._connected = false;\n this.teardown();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, value: string | null): void {\n if (!this._connected || oldValue === value) return;\n this.changed(_name);\n }\n\n /** Re-mount on attribute change (override for finer updates). */\n changed(_name: string): void {\n this.teardown();\n this.mount();\n }\n\n private teardown(): void {\n this._cleanups.splice(0).reverse().forEach((fn) => fn());\n this.unmount();\n }\n\n mount(): void {}\n unmount(): void {}\n\n str(name: string, fallback = ''): string {\n const v = this.getAttribute(name);\n return v === null ? fallback : v;\n }\n\n num(name: string, fallback: number): number {\n const v = this.getAttribute(name);\n const n = v === null || v.trim() === '' ? NaN : Number(v);\n return Number.isFinite(n) ? n : fallback;\n }\n\n /** Boolean attribute: present and not `\"false\"`. */\n flag(name: string): boolean {\n const v = this.getAttribute(name);\n return v !== null && v !== 'false';\n }\n\n setFlag(name: string, on: boolean): void {\n if (on) this.setAttribute(name, '');\n else this.removeAttribute(name);\n }\n\n onCleanup(fn: Cleanup): void {\n this._cleanups.push(fn);\n }\n\n listen(target: EventTarget, type: string, fn: (e: any) => void, options?: AddEventListenerOptions): void {\n target.addEventListener(type, fn, options);\n this.onCleanup(() => target.removeEventListener(type, fn, options));\n }\n\n /** Calls `cb(true/false)` as the element enters / leaves the viewport. */\n inView(cb: (visible: boolean, entry?: IntersectionObserverEntry) => void, init?: IntersectionObserverInit, target: Element = this): void {\n if (typeof IntersectionObserver === 'undefined') {\n cb(true);\n return;\n }\n const io = new IntersectionObserver((entries) => {\n for (const e of entries) cb(e.isIntersecting, e);\n }, init);\n io.observe(target);\n this.onCleanup(() => io.disconnect());\n }\n\n /** `el.animate()` that returns `null` (and applies the last frame) without WAAPI. */\n motion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null {\n return animateWithMotion(el, keyframes, options);\n }\n\n emit(type: string, detail?: unknown): boolean {\n return this.dispatchEvent(new CustomEvent(`usa:${type}`, { detail, bubbles: true, cancelable: true }));\n }\n }\n baseClass = Base as unknown as BaseCtor;\n return baseClass;\n}\n\n/**\n * `el.animate()` with the library's motion rules (5.0, shared by elements and\n * registered effects): motion sensitivity (keyframes adapted, `static` →\n * final frame), intensity (duration scale) and the animation budget. Returns\n * `null` (final frame applied) when nothing should animate.\n */\nexport function animateWithMotion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null {\n if (typeof (el as HTMLElement).animate !== 'function' || config.motionSensitivity === 'static') {\n applyFrame(el as HTMLElement, keyframes[keyframes.length - 1]);\n return null;\n }\n keyframes = adaptKeyframes(keyframes);\n if (active >= maxActive) {\n applyFrame(el as HTMLElement, keyframes[keyframes.length - 1]);\n return null;\n }\n const k = motionScale();\n if (k !== 1 && k > 0 && typeof options.duration === 'number') options = { ...options, duration: options.duration * k, delay: (options.delay || 0) * k };\n const a = (el as HTMLElement).animate(keyframes, options);\n if (options.iterations !== Infinity) {\n active++;\n let done = false;\n const end = () => {\n if (!done) {\n done = true;\n active--;\n }\n };\n a?.finished?.then(end, end);\n }\n return a;\n}\n\n/** Write a keyframe's properties as inline styles (no-WAAPI fallback). */\nexport function applyFrame(el: HTMLElement, frame?: Keyframe): void {\n if (!frame) return;\n for (const [k, v] of Object.entries(frame)) {\n if (k === 'offset' || k === 'easing' || k === 'composite' || v == null) continue;\n (el.style as any)[k] = String(v);\n }\n}\n\n/**\n * Register `tag` with the class built by `make(Base)`. Returns the\n * constructor, the already registered one, or `undefined` without DOM.\n */\nexport function defineElement(\n tag: string,\n make: (Base: BaseCtor) => CustomElementConstructor,\n css?: { id: string; text: string }\n): CustomElementConstructor | undefined {\n if (!canDefine()) return undefined;\n adoptStyles('base', BASE_CSS);\n if (css) adoptStyles(css.id, css.text);\n const existing = customElements.get(tag);\n if (existing) return existing;\n const ctor = make(getBase());\n customElements.define(tag, ctor);\n return ctor;\n}\n\nconst BASE_CSS = '.usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}';\n\n/** A visually hidden copy of `text` for screen readers (the animated copy is `aria-hidden`). */\nexport function srText(text: string): HTMLSpanElement {\n const s = document.createElement('span');\n s.className = 'usa-sr';\n s.textContent = text;\n return s;\n}\n\n// --- shared rAF scheduler (4.5) ----------------------------------------------\n// Every component loop goes through one requestAnimationFrame per frame\n// instead of one per element: callbacks are batched, run in order, and a\n// throwing callback no longer starves the others (the first error is rethrown).\nconst frameQueue = new Map<number, FrameRequestCallback>();\nlet frameSeq = 1;\nlet frameHandle: number | ReturnType<typeof setTimeout> | 0 = 0;\nlet frameVia: unknown = null;\nconst frameStats = { frames: 0, callbacks: 0, peak: 0, last: 0 };\nconst frameListeners = new Set<(t: number, dt: number) => void>();\n\nfunction flushFrame(t: number): void {\n frameHandle = 0;\n const dt = frameStats.last && t > frameStats.last ? t - frameStats.last : 16.7;\n frameStats.last = t;\n frameStats.frames++;\n const cbs = Array.from(frameQueue.values());\n frameQueue.clear();\n frameStats.callbacks += cbs.length;\n frameStats.peak = Math.max(frameStats.peak, cbs.length);\n let error: unknown = null;\n for (const cb of cbs) {\n try {\n cb(t);\n } catch (e) {\n error ??= e;\n }\n }\n frameListeners.forEach((fn) => fn(t, dt));\n if (frameListeners.size) requestFlush();\n if (error) throw error;\n}\n\nfunction requestFlush(): void {\n const native = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : null;\n // A stale handle from a replaced requestAnimationFrame (tests, iframes) is dropped.\n if (frameHandle && frameVia === native) return;\n frameVia = native;\n frameHandle = native ? native(flushFrame) : setTimeout(() => flushFrame(now()), 16);\n}\n\n/** requestAnimationFrame through the shared scheduler (timeout fallback in jsdom / hidden documents). */\nexport const raf = (cb: FrameRequestCallback): number => {\n const id = frameSeq++;\n frameQueue.set(id, cb);\n requestFlush();\n return id;\n};\n/** Monotonic time in ms (rAF callback timestamps differ between environments, so loops use this). */\nexport const now = (): number => (typeof performance !== 'undefined' ? performance.now() : Date.now());\nexport const caf = (id: number): void => {\n frameQueue.delete(id);\n};\n\n/** Run `fn(time, dt)` every frame on the shared scheduler until the returned function is called. */\nexport function onFrame(fn: (t: number, dt: number) => void): () => void {\n frameListeners.add(fn);\n requestFlush();\n return () => frameListeners.delete(fn);\n}\n\n/** Scheduler counters: frames flushed, callbacks run, peak callbacks in one frame, pending now. */\nexport function schedulerStats(): { frames: number; callbacks: number; peak: number; pending: number; loops: number } {\n return { frames: frameStats.frames, callbacks: frameStats.callbacks, peak: frameStats.peak, pending: frameQueue.size, loops: frameListeners.size };\n}\n\n// --- active animation budget (4.5) ---------------------------------------------\nlet active = 0;\nlet maxActive = Infinity;\n/** Number of component animations running right now. */\nexport const activeAnimations = (): number => active;\n/** Cap concurrent component animations; extra ones jump to their final frame (`Infinity` = no cap). */\nexport function setAnimationBudget(max: number): void {\n maxActive = max > 0 ? max : Infinity;\n}\n/** The current cap. */\nexport const animationBudget = (): number => maxActive;\n\n// --- on-demand styles (4.5) -----------------------------------------------------\nlet styleLoader: ((tag: string) => void) | null = null;\n/** Called with each element's tag the first time one connects (used by the `lite` build to load CSS on demand). */\nexport function setStyleLoader(fn: ((tag: string) => void) | null): void {\n styleLoader = fn;\n}\n\nexport const EASE_OUT = 'cubic-bezier(0.22, 1, 0.36, 1)';\nexport const EASE_SPRING = 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n/** Windows Fluent \"decelerate\" / \"point-to-point\" curves. */\nexport const FLUENT_DECELERATE = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\nconst warned = new Set<string>();\n/** Log a deprecation once per key (console.warn). */\nexport function deprecate(key: string, message: string): void {\n if (warned.has(key)) return;\n warned.add(key);\n if (typeof console !== 'undefined') console.warn(`[motionary] ${message}`);\n}\n\n/**\n * The `kind` attribute of `<usa-spinner>`, `<usa-check>`, `<usa-dialog>` and\n * `<usa-acrylic>` (3.0: `variant` only selects a style variant).\n */\nexport function kindOf(el: Element, valid: readonly string[] | Record<string, unknown>, fallback: string): string {\n const k = el.getAttribute('kind');\n return k && (Array.isArray(valid) ? valid.includes(k) : k in (valid as object)) ? k : fallback;\n}\n\nexport const clamp = (v: number, min: number, max: number): number => Math.min(max, Math.max(min, v));\n"],"names":[],"mappings":"AAAA;;;;;;;AAOG;AAmCI,MAAM,yBAAyB,GAAiC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;AAGtG,MAAM,YAAY,GAAoC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC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E;AAEA;;;AAGG;SACa,MAAM,CAAC,EAAW,EAAE,KAAkD,EAAE,QAAgB,EAAA;IACtG,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;AACjC,IAAA,OAAO,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAK,KAAgB,CAAC,GAAG,CAAC,GAAG,QAAQ;AAChG;AAEO,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW,KAAa,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"base-2-yYc93C.js","sources":["../../src/components/base.ts"],"sourcesContent":["/**\n * motionary/components — shared base for the `<usa-*>` custom elements.\n *\n * Everything here is lazy: nothing touches `window`, `document`,\n * `HTMLElement` or `matchMedia` at import time, so the components can be\n * imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload\n * scripts. Classes are created the first time a `define*()` function runs.\n */\n\nexport interface ComponentsConfig {\n /**\n * Inject each component's CSS when it is defined (default `true`). Uses a\n * constructable stylesheet (`document.adoptedStyleSheets`, which a strict\n * `style-src` CSP does not block) and falls back to a `<style>` tag. Set\n * to `false` when you load `motionary/components.css` yourself.\n */\n injectStyles?: boolean;\n /**\n * `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always\n * uses the reduced variants (e.g. a kiosk / battery-saver mode). 5.0: the\n * OS setting can no longer be ignored (`'no-preference'` was removed).\n */\n reducedMotion?: 'user' | 'reduce';\n /**\n * Global motion intensity (v2.7): `'low'` (shorter, calmer), `'normal'`\n * (default) or `'high'`. Scales every component animation's duration and\n * sets `--usa-motion` (0.6 / 1 / 1.25) on `<html>` for your own CSS. 5.0:\n * `'off'` was removed — use `motionSensitivity: 'minimal'`.\n */\n motionIntensity?: MotionIntensity;\n /**\n * Motion-sensitivity level (v4.4), finer than reduced motion:\n * `'full'` (default) · `'gentle'` (no spins, zooms, skews or parallax —\n * translations and fades only, safe for vestibular disorders) ·\n * `'minimal'` (fades only; components use their reduced-motion variants) ·\n * `'static'` (no animation: every component shows its static alternative).\n * See `setMotionSensitivity()` in `motionary/components/a11y`.\n */\n motionSensitivity?: MotionSensitivity;\n}\n\nexport type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';\nexport const MOTION_SENSITIVITY_LEVELS: readonly MotionSensitivity[] = ['full', 'gentle', 'minimal', 'static'];\n\nexport type MotionIntensity = 'low' | 'normal' | 'high';\nexport const MOTION_SCALE: Record<MotionIntensity, number> = { low: 0.6, normal: 1, high: 1.25 };\n\nconst config: Required<ComponentsConfig> = { injectStyles: true, reducedMotion: 'user', motionIntensity: 'normal', motionSensitivity: 'full' };\n\n/** Change global component settings (call before `define*()` for `injectStyles`). */\nexport function configureComponents(options: ComponentsConfig): void {\n options = { ...options };\n // 5.0: removed values are ignored (see docs/upgrading-5.md)\n if (options.motionIntensity && !(options.motionIntensity in MOTION_SCALE)) delete options.motionIntensity;\n if (options.reducedMotion && options.reducedMotion !== 'reduce') options.reducedMotion = 'user';\n Object.assign(config, options);\n if (options.motionIntensity && typeof document !== 'undefined') {\n document.documentElement.style.setProperty('--usa-motion', String(MOTION_SCALE[options.motionIntensity] ?? 1));\n document.documentElement.setAttribute('data-usa-motion', options.motionIntensity);\n }\n if (options.motionSensitivity && typeof document !== 'undefined') {\n if (options.motionSensitivity === 'full') document.documentElement.removeAttribute('data-usa-sensitivity');\n else document.documentElement.setAttribute('data-usa-sensitivity', options.motionSensitivity);\n }\n}\n\n/** The current motion-sensitivity level (v4.4). */\nexport function getMotionSensitivity(): MotionSensitivity {\n return config.motionSensitivity;\n}\n\nconst VESTIBULAR = /rotate|scale|skew|perspective|matrix3d/;\n/**\n * Adapt keyframes to the sensitivity level: `gentle` drops transforms that\n * spin, zoom or skew (and 3D), `minimal` keeps opacity only, `static` keeps\n * just the final frame. `full` returns them unchanged.\n */\nexport function adaptKeyframes(frames: Keyframe[], level: MotionSensitivity = config.motionSensitivity): Keyframe[] {\n if (level === 'full' || !frames.length) return frames;\n if (level === 'static') return [frames[frames.length - 1]];\n return frames.map((f) => {\n const out: Keyframe = {};\n for (const [k, v] of Object.entries(f)) {\n if (k === 'offset' || k === 'easing' || k === 'composite') out[k] = v as any;\n else if (level === 'minimal') {\n if (k === 'opacity') out[k] = v as any;\n } else if (k === 'rotate' || k === 'scale' || (k === 'transform' && VESTIBULAR.test(String(v)))) continue;\n else out[k] = v as any;\n }\n return out;\n });\n}\n\nlet quiet = 0;\n/** Run `fn` without 4.9 deprecation warnings (library-internal calls). */\nexport function withoutDeprecations<T>(fn: () => T): T {\n quiet++;\n try {\n return fn();\n } finally {\n quiet--;\n }\n}\n\n/** The current global motion intensity. */\nexport function getMotionIntensity(): MotionIntensity {\n return config.motionIntensity;\n}\n\n/** Duration multiplier for the current intensity (1 when `normal`). */\nexport function motionScale(): number {\n return MOTION_SCALE[config.motionIntensity] ?? 1;\n}\n\nexport const canDefine = (): boolean => typeof customElements !== 'undefined' && typeof HTMLElement !== 'undefined';\n\n/** `true` when animations should be reduced (OS setting or `configureComponents`). */\nexport function prefersReducedMotion(): boolean {\n if (config.motionSensitivity === 'minimal' || config.motionSensitivity === 'static') return true;\n if (config.reducedMotion === 'reduce') return true;\n return typeof matchMedia === 'function' && !!matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nconst injected = new Set<string>();\n\n/** Add a component's stylesheet to the document once. */\nexport function adoptStyles(id: string, css: string): void {\n if (!config.injectStyles || !css || injected.has(id) || typeof document === 'undefined') return;\n injected.add(id);\n try {\n if (typeof CSSStyleSheet === 'function' && 'adoptedStyleSheets' in document) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(css);\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n return;\n }\n } catch {\n /* fall through to <style> */\n }\n const style = document.createElement('style');\n style.setAttribute('data-usa', id);\n style.textContent = css;\n (document.head || document.documentElement).appendChild(style);\n}\n\n/** Attach `css` to a shadow root (constructable sheet where supported, else `<style>`). */\nexport function shadowStyles(root: ShadowRoot, css: string): void {\n try {\n if (typeof CSSStyleSheet === 'function' && 'adoptedStyleSheets' in root) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(css);\n root.adoptedStyleSheets = [sheet];\n return;\n }\n } catch {\n /* fall through */\n }\n const style = document.createElement('style');\n style.textContent = css;\n root.prepend(style);\n}\n\nexport type Cleanup = () => void;\n\n/**\n * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup\n * bag that is emptied on disconnect, and motion helpers that degrade to the\n * final state without WAAPI or under reduced motion.\n */\nexport interface UsaElement extends HTMLElement {\n /** `true` while reduced motion applies to this element. */\n readonly reduced: boolean;\n}\n\nexport interface UsaBase extends UsaElement {\n mount(): void;\n changed(name: string): void;\n unmount(): void;\n str(name: string, fallback?: string): string;\n num(name: string, fallback: number): number;\n flag(name: string): boolean;\n setFlag(name: string, on: boolean): void;\n onCleanup(fn: Cleanup): void;\n listen<K extends keyof HTMLElementEventMap>(\n target: EventTarget,\n type: K | string,\n fn: (e: any) => void,\n options?: AddEventListenerOptions\n ): void;\n inView(cb: (visible: boolean, entry?: IntersectionObserverEntry) => void, init?: IntersectionObserverInit, target?: Element): void;\n motion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null;\n emit(type: string, detail?: unknown): boolean;\n}\n\ntype BaseCtor = new () => UsaBase;\nlet baseClass: BaseCtor | null = null;\n\n/** The lazily created base class (needs `HTMLElement`). */\nexport function getBase(): BaseCtor {\n if (baseClass) return baseClass;\n class Base extends HTMLElement {\n private _cleanups: Cleanup[] = [];\n private _connected = false;\n\n get reduced(): boolean {\n return prefersReducedMotion();\n }\n\n connectedCallback(): void {\n if (this._connected) return;\n this._connected = true;\n styleLoader?.(this.localName);\n // Upgraded while the parser is still inside us (a <script> in <head>\n // defined the element): children/text are not there yet, so wait.\n if (typeof document !== 'undefined' && document.readyState === 'loading' && !this.nextSibling && !this.childNodes.length) {\n const go = () => {\n if (this._connected && this.isConnected) this.mount();\n };\n document.addEventListener('DOMContentLoaded', go, { once: true });\n this._cleanups.push(() => document.removeEventListener('DOMContentLoaded', go));\n return;\n }\n this.mount();\n }\n\n disconnectedCallback(): void {\n this._connected = false;\n this.teardown();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, value: string | null): void {\n if (!this._connected || oldValue === value) return;\n this.changed(_name);\n }\n\n /** Re-mount on attribute change (override for finer updates). */\n changed(_name: string): void {\n this.teardown();\n this.mount();\n }\n\n private teardown(): void {\n this._cleanups.splice(0).reverse().forEach((fn) => fn());\n this.unmount();\n }\n\n mount(): void {}\n unmount(): void {}\n\n str(name: string, fallback = ''): string {\n const v = this.getAttribute(name);\n return v === null ? fallback : v;\n }\n\n num(name: string, fallback: number): number {\n const v = this.getAttribute(name);\n const n = v === null || v.trim() === '' ? NaN : Number(v);\n return Number.isFinite(n) ? n : fallback;\n }\n\n /** Boolean attribute: present and not `\"false\"`. */\n flag(name: string): boolean {\n const v = this.getAttribute(name);\n return v !== null && v !== 'false';\n }\n\n setFlag(name: string, on: boolean): void {\n if (on) this.setAttribute(name, '');\n else this.removeAttribute(name);\n }\n\n onCleanup(fn: Cleanup): void {\n this._cleanups.push(fn);\n }\n\n listen(target: EventTarget, type: string, fn: (e: any) => void, options?: AddEventListenerOptions): void {\n target.addEventListener(type, fn, options);\n this.onCleanup(() => target.removeEventListener(type, fn, options));\n }\n\n /** Calls `cb(true/false)` as the element enters / leaves the viewport. */\n inView(cb: (visible: boolean, entry?: IntersectionObserverEntry) => void, init?: IntersectionObserverInit, target: Element = this): void {\n if (typeof IntersectionObserver === 'undefined') {\n cb(true);\n return;\n }\n const io = new IntersectionObserver((entries) => {\n for (const e of entries) cb(e.isIntersecting, e);\n }, init);\n io.observe(target);\n this.onCleanup(() => io.disconnect());\n }\n\n /** `el.animate()` that returns `null` (and applies the last frame) without WAAPI. */\n motion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null {\n return animateWithMotion(el, keyframes, options);\n }\n\n emit(type: string, detail?: unknown): boolean {\n return this.dispatchEvent(new CustomEvent(`usa:${type}`, { detail, bubbles: true, cancelable: true }));\n }\n }\n baseClass = Base as unknown as BaseCtor;\n return baseClass;\n}\n\n/**\n * `el.animate()` with the library's motion rules (5.0, shared by elements and\n * registered effects): motion sensitivity (keyframes adapted, `static` →\n * final frame), intensity (duration scale) and the animation budget. Returns\n * `null` (final frame applied) when nothing should animate.\n */\nexport function animateWithMotion(el: Element, keyframes: Keyframe[], options: KeyframeAnimationOptions): Animation | null {\n if (typeof (el as HTMLElement).animate !== 'function' || config.motionSensitivity === 'static') {\n applyFrame(el as HTMLElement, keyframes[keyframes.length - 1]);\n return null;\n }\n keyframes = adaptKeyframes(keyframes);\n if (active >= maxActive) {\n applyFrame(el as HTMLElement, keyframes[keyframes.length - 1]);\n return null;\n }\n const k = motionScale();\n if (k !== 1 && k > 0 && typeof options.duration === 'number') options = { ...options, duration: options.duration * k, delay: (options.delay || 0) * k };\n const a = (el as HTMLElement).animate(keyframes, options);\n if (options.iterations !== Infinity) {\n active++;\n let done = false;\n const end = () => {\n if (!done) {\n done = true;\n active--;\n }\n };\n a?.finished?.then(end, end);\n }\n return a;\n}\n\n/** Write a keyframe's properties as inline styles (no-WAAPI fallback). */\nexport function applyFrame(el: HTMLElement, frame?: Keyframe): void {\n if (!frame) return;\n for (const [k, v] of Object.entries(frame)) {\n if (k === 'offset' || k === 'easing' || k === 'composite' || v == null) continue;\n (el.style as any)[k] = String(v);\n }\n}\n\n/**\n * Register `tag` with the class built by `make(Base)`. Returns the\n * constructor, the already registered one, or `undefined` without DOM.\n */\nexport function defineElement(\n tag: string,\n make: (Base: BaseCtor) => CustomElementConstructor,\n css?: { id: string; text: string }\n): CustomElementConstructor | undefined {\n if (!canDefine()) return undefined;\n adoptStyles('base', BASE_CSS);\n if (css) adoptStyles(css.id, css.text);\n const existing = customElements.get(tag);\n if (existing) return existing;\n const ctor = make(getBase());\n customElements.define(tag, ctor);\n return ctor;\n}\n\nconst BASE_CSS = '.usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}';\n\n/** A visually hidden copy of `text` for screen readers (the animated copy is `aria-hidden`). */\nexport function srText(text: string): HTMLSpanElement {\n const s = document.createElement('span');\n s.className = 'usa-sr';\n s.textContent = text;\n return s;\n}\n\n// --- shared rAF scheduler (4.5) ----------------------------------------------\n// Every component loop goes through one requestAnimationFrame per frame\n// instead of one per element: callbacks are batched, run in order, and a\n// throwing callback no longer starves the others (the first error is rethrown).\nconst frameQueue = new Map<number, FrameRequestCallback>();\nlet frameSeq = 1;\nlet frameHandle: number | ReturnType<typeof setTimeout> | 0 = 0;\nlet frameVia: unknown = null;\nconst frameStats = { frames: 0, callbacks: 0, peak: 0, last: 0 };\nconst frameListeners = new Set<(t: number, dt: number) => void>();\n\nfunction flushFrame(t: number): void {\n frameHandle = 0;\n const dt = frameStats.last && t > frameStats.last ? t - frameStats.last : 16.7;\n frameStats.last = t;\n frameStats.frames++;\n const cbs = Array.from(frameQueue.values());\n frameQueue.clear();\n frameStats.callbacks += cbs.length;\n frameStats.peak = Math.max(frameStats.peak, cbs.length);\n let error: unknown = null;\n for (const cb of cbs) {\n try {\n cb(t);\n } catch (e) {\n error ??= e;\n }\n }\n frameListeners.forEach((fn) => fn(t, dt));\n if (frameListeners.size) requestFlush();\n if (error) throw error;\n}\n\nfunction requestFlush(): void {\n const native = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : null;\n // A stale handle from a replaced requestAnimationFrame (tests, iframes) is dropped.\n if (frameHandle && frameVia === native) return;\n frameVia = native;\n frameHandle = native ? native(flushFrame) : setTimeout(() => flushFrame(now()), 16);\n}\n\n/** requestAnimationFrame through the shared scheduler (timeout fallback in jsdom / hidden documents). */\nexport const raf = (cb: FrameRequestCallback): number => {\n const id = frameSeq++;\n frameQueue.set(id, cb);\n requestFlush();\n return id;\n};\n/** Monotonic time in ms (rAF callback timestamps differ between environments, so loops use this). */\nexport const now = (): number => (typeof performance !== 'undefined' ? performance.now() : Date.now());\nexport const caf = (id: number): void => {\n frameQueue.delete(id);\n};\n\n/** Run `fn(time, dt)` every frame on the shared scheduler until the returned function is called. */\nexport function onFrame(fn: (t: number, dt: number) => void): () => void {\n frameListeners.add(fn);\n requestFlush();\n return () => frameListeners.delete(fn);\n}\n\n/** Scheduler counters: frames flushed, callbacks run, peak callbacks in one frame, pending now. */\nexport function schedulerStats(): { frames: number; callbacks: number; peak: number; pending: number; loops: number } {\n return { frames: frameStats.frames, callbacks: frameStats.callbacks, peak: frameStats.peak, pending: frameQueue.size, loops: frameListeners.size };\n}\n\n// --- active animation budget (4.5) ---------------------------------------------\nlet active = 0;\nlet maxActive = Infinity;\n/** Number of component animations running right now. */\nexport const activeAnimations = (): number => active;\n/** Cap concurrent component animations; extra ones jump to their final frame (`Infinity` = no cap). */\nexport function setAnimationBudget(max: number): void {\n maxActive = max > 0 ? max : Infinity;\n}\n/** The current cap. */\nexport const animationBudget = (): number => maxActive;\n\n// --- on-demand styles (4.5) -----------------------------------------------------\nlet styleLoader: ((tag: string) => void) | null = null;\n/** Called with each element's tag the first time one connects (used by the `lite` build to load CSS on demand). */\nexport function setStyleLoader(fn: ((tag: string) => void) | null): void {\n styleLoader = fn;\n}\n\nexport const EASE_OUT = 'cubic-bezier(0.22, 1, 0.36, 1)';\nexport const EASE_SPRING = 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n/** Windows Fluent \"decelerate\" / \"point-to-point\" curves. */\nexport const FLUENT_DECELERATE = 'cubic-bezier(0.1, 0.9, 0.2, 1)';\n\nconst warned = new Set<string>();\n/** Log a deprecation once per key (console.warn). */\nexport function deprecate(key: string, message: string): void {\n if (warned.has(key)) return;\n warned.add(key);\n if (typeof console !== 'undefined') console.warn(`[motionary] ${message}`);\n}\n\n/**\n * The `kind` attribute of `<usa-spinner>`, `<usa-check>`, `<usa-dialog>` and\n * `<usa-acrylic>` (3.0: `variant` only selects a style variant).\n */\nexport function kindOf(el: Element, valid: readonly string[] | Record<string, unknown>, fallback: string): string {\n const k = el.getAttribute('kind');\n return k && (Array.isArray(valid) ? valid.includes(k) : k in (valid as object)) ? k : fallback;\n}\n\nexport const clamp = (v: number, min: number, max: number): number => Math.min(max, Math.max(min, v));\n"],"names":[],"mappings":"AAAA;;;;;;;AAOG;AAmCI,MAAM,yBAAyB,GAAiC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;AAGtG,MAAM,YAAY,GAAoC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI;AAE9F,MAAM,MAAM,GAA+B,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE;AAE9I;AACM,SAAU,mBAAmB,CAAC,OAAyB,EAAA;AAC3D,IAAA,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE;;IAExB,IAAI,OAAO,CAAC,eAAe,IAAI,EAAE,OAAO,CAAC,eAAe,IAAI,YAAY,CAAC;QAAE,OAAO,OAAO,CAAC,eAAe;IACzG,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,MAAM;AAC/F,IAAA,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QAC9D,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9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WAAW,GAAmC,IAAI;AACtD;AACM,SAAU,cAAc,CAAC,EAAkC,EAAA;IAC/D,WAAW,GAAG,EAAE;AAClB;AAEO,MAAM,QAAQ,GAAG;AACjB,MAAM,WAAW,GAAG;AAC3B;AACO,MAAM,iBAAiB,GAAG;AAEjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU;AAChC;AACM,SAAU,SAAS,CAAC,GAAW,EAAE,OAAe,EAAA;AACpD,IAAA,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE;AACrB,IAAA,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;IACf,IAAI,OAAO,OAAO,KAAK,WAAW;AAAE,QAAA,OAAO,CAAC,IAAI,CAAC,eAAe,OAAO,CAAA,CAAE,CAAC;AAC5E;AAEA;;;AAGG;SACa,MAAM,CAAC,EAAW,EAAE,KAAkD,EAAE,QAAgB,EAAA;IACtG,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;AACjC,IAAA,OAAO,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAK,KAAgB,CAAC,GAAG,CAAC,GAAG,QAAQ;AAChG;AAEO,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW,KAAa,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import { p as prefersReducedMotion, k as clamp, l as caf, n as applyFrame, r as raf, m as motionScale, q as now } from './base-D5MHqeDd.js';
1
+ import { p as prefersReducedMotion, k as clamp, l as caf, n as applyFrame, r as raf, m as motionScale, q as now } from './base-2-yYc93C.js';
2
2
  import { resolveDurationToken, resolveEasingToken } from '../components/tokens.js';
3
3
 
4
4
  /** 4.1: whether `scrub()` can use native ScrollTimeline / ViewTimeline here. */
@@ -257,4 +257,4 @@ function timeline(options = {}) {
257
257
  }
258
258
 
259
259
  export { TIMELINE_PRESETS as T, resolvePosition as r, supportsNativeScrub as s, timeline as t };
260
- //# sourceMappingURL=core-DyJu5r5a.js.map
260
+ //# sourceMappingURL=core-D5rU0CV6.js.map