motionary 7.9.0 → 8.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.
- package/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/README_ja.md +1 -1
- package/README_zh.md +1 -1
- package/dist/chunks/{audio-DcPvT2Kh.js → audio-CynhhWDi.js} +3 -3
- package/dist/chunks/{audio-DcPvT2Kh.js.map → audio-CynhhWDi.js.map} +1 -1
- package/dist/chunks/{audio-EXUoijsG.cjs → audio-cgWbDkoY.cjs} +3 -3
- package/dist/chunks/{audio-EXUoijsG.cjs.map → audio-cgWbDkoY.cjs.map} +1 -1
- package/dist/chunks/{base-2-yYc93C.js → base-CLuqlLfG.js} +63 -6
- package/dist/chunks/base-CLuqlLfG.js.map +1 -0
- package/dist/chunks/{base-BaQV-2ha.cjs → base-DoRUZBy-.cjs} +66 -5
- package/dist/chunks/base-DoRUZBy-.cjs.map +1 -0
- package/dist/chunks/{builtins-HlqAkK0f.js → builtins-Bs4smevg.js} +3 -3
- package/dist/chunks/{builtins-HlqAkK0f.js.map → builtins-Bs4smevg.js.map} +1 -1
- package/dist/chunks/{builtins-xalxV2d5.cjs → builtins-ClXshqj-.cjs} +3 -3
- package/dist/chunks/{builtins-xalxV2d5.cjs.map → builtins-ClXshqj-.cjs.map} +1 -1
- package/dist/chunks/{core-DuO-AVXL.js → core-C3Taz-ew.js} +2 -2
- package/dist/chunks/{core-DuO-AVXL.js.map → core-C3Taz-ew.js.map} +1 -1
- package/dist/chunks/{core-D5rU0CV6.js → core-CiN5sqxB.js} +2 -2
- package/dist/chunks/{core-D5rU0CV6.js.map → core-CiN5sqxB.js.map} +1 -1
- package/dist/chunks/{core-BGAyaY6L.cjs → core-CwO835Wm.cjs} +2 -2
- package/dist/chunks/{core-BGAyaY6L.cjs.map → core-CwO835Wm.cjs.map} +1 -1
- package/dist/chunks/{core-zq17EeCI.cjs → core-O4grKHSa.cjs} +2 -2
- package/dist/chunks/{core-zq17EeCI.cjs.map → core-O4grKHSa.cjs.map} +1 -1
- package/dist/chunks/{fx-lBGVtQO1.cjs → fx-C-XjLOTc.cjs} +2 -2
- package/dist/chunks/{fx-lBGVtQO1.cjs.map → fx-C-XjLOTc.cjs.map} +1 -1
- package/dist/chunks/{fx-CMxWNwH8.js → fx-CQv3IxMf.js} +2 -2
- package/dist/chunks/{fx-CMxWNwH8.js.map → fx-CQv3IxMf.js.map} +1 -1
- package/dist/chunks/{gpu-DLPghVWr.js → gpu-CB8frFOD.js} +2 -2
- package/dist/chunks/{gpu-DLPghVWr.js.map → gpu-CB8frFOD.js.map} +1 -1
- package/dist/chunks/{gpu-Dx0H875w.cjs → gpu-CcdA2D2i.cjs} +2 -2
- package/dist/chunks/{gpu-Dx0H875w.cjs.map → gpu-CcdA2D2i.cjs.map} +1 -1
- package/dist/chunks/{index-tags-C04JP8g4.js → index-tags-B-JBecYg.js} +2 -2
- package/dist/chunks/index-tags-B-JBecYg.js.map +1 -0
- package/dist/chunks/{index-tags-BTMwrfgV.cjs → index-tags-hLIF2Clq.cjs} +2 -2
- package/dist/chunks/index-tags-hLIF2Clq.cjs.map +1 -0
- package/dist/chunks/{player-PS6_FzNw.cjs → player-C2n17sdH.cjs} +4 -4
- package/dist/chunks/{player-PS6_FzNw.cjs.map → player-C2n17sdH.cjs.map} +1 -1
- package/dist/chunks/{player-DxvCYo7Q.js → player-YzQGkKaW.js} +4 -4
- package/dist/chunks/{player-DxvCYo7Q.js.map → player-YzQGkKaW.js.map} +1 -1
- package/dist/chunks/{registry-DehBVRDV.cjs → registry-BVklOepd.cjs} +2 -2
- package/dist/chunks/{registry-DehBVRDV.cjs.map → registry-BVklOepd.cjs.map} +1 -1
- package/dist/chunks/{registry-CyKExAmE.js → registry-CnO7ZVPK.js} +2 -2
- package/dist/chunks/{registry-CyKExAmE.js.map → registry-CnO7ZVPK.js.map} +1 -1
- package/dist/chunks/{spring-BK8DiezC.js → spring-BFKNHmfl.js} +2 -2
- package/dist/chunks/{spring-BK8DiezC.js.map → spring-BFKNHmfl.js.map} +1 -1
- package/dist/chunks/{spring-Dgx187Vh.cjs → spring-uQMVJTj9.cjs} +2 -2
- package/dist/chunks/{spring-Dgx187Vh.cjs.map → spring-uQMVJTj9.cjs.map} +1 -1
- package/dist/chunks/{variants-BQ6bhzn4.js → variants-B-zKORvt.js} +2 -2
- package/dist/chunks/{variants-BQ6bhzn4.js.map → variants-B-zKORvt.js.map} +1 -1
- package/dist/chunks/{variants-BhjyddG8.cjs → variants-DagykrKH.cjs} +2 -2
- package/dist/chunks/{variants-BhjyddG8.cjs.map → variants-DagykrKH.cjs.map} +1 -1
- package/dist/components/a11y.cjs +2 -2
- package/dist/components/a11y.d.cts +1 -1
- package/dist/components/a11y.d.ts +1 -1
- package/dist/components/a11y.js +3 -3
- package/dist/components/angular.cjs +9 -9
- package/dist/components/angular.d.cts +2 -18
- package/dist/components/angular.d.ts +2 -18
- package/dist/components/angular.js +9 -9
- package/dist/components/background.cjs +2 -2
- package/dist/components/background.js +2 -2
- package/dist/components/bridge.cjs +1 -1
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.cjs +2 -2
- package/dist/components/cards.js +2 -2
- package/dist/components/click.cjs +3 -3
- package/dist/components/click.js +3 -3
- package/dist/components/depth.cjs +3 -3
- package/dist/components/depth.js +3 -3
- package/dist/components/effects.cjs +7 -7
- package/dist/components/effects.js +9 -9
- package/dist/components/engine.cjs +266 -0
- package/dist/components/engine.cjs.map +1 -0
- package/dist/components/engine.d.cts +105 -0
- package/dist/components/engine.d.ts +105 -0
- package/dist/components/engine.js +255 -0
- package/dist/components/engine.js.map +1 -0
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-3d.cjs +2 -2
- package/dist/components/fx-3d.js +2 -2
- package/dist/components/fx-ai.cjs +2 -2
- package/dist/components/fx-ai.js +2 -2
- package/dist/components/fx-chart.cjs +2 -2
- package/dist/components/fx-chart.js +2 -2
- package/dist/components/fx-festival.cjs +121 -0
- package/dist/components/fx-festival.cjs.map +1 -0
- package/dist/components/fx-festival.d.cts +69 -0
- package/dist/components/fx-festival.d.ts +69 -0
- package/dist/components/fx-festival.js +117 -0
- package/dist/components/fx-festival.js.map +1 -0
- package/dist/components/fx-focus.cjs +2 -2
- package/dist/components/fx-focus.js +2 -2
- package/dist/components/fx-form.cjs +2 -2
- package/dist/components/fx-form.js +2 -2
- package/dist/components/fx-game.cjs +2 -2
- package/dist/components/fx-game.js +2 -2
- package/dist/components/fx-geo.cjs +2 -2
- package/dist/components/fx-geo.js +2 -2
- package/dist/components/fx-gpu.cjs +3 -3
- package/dist/components/fx-gpu.js +3 -3
- package/dist/components/fx-light.cjs +2 -2
- package/dist/components/fx-light.js +2 -2
- package/dist/components/fx-morph.cjs +2 -2
- package/dist/components/fx-morph.js +2 -2
- package/dist/components/fx-music.cjs +3 -3
- package/dist/components/fx-music.js +3 -3
- package/dist/components/fx-physics.cjs +2 -2
- package/dist/components/fx-physics.js +2 -2
- package/dist/components/fx-shop.cjs +2 -2
- package/dist/components/fx-shop.js +2 -2
- package/dist/components/fx-social.cjs +2 -2
- package/dist/components/fx-social.js +2 -2
- package/dist/components/fx-text.cjs +2 -2
- package/dist/components/fx-text.js +2 -2
- package/dist/components/fx-transitions.cjs +3 -3
- package/dist/components/fx-transitions.js +3 -3
- package/dist/components/fx-weather.cjs +2 -2
- package/dist/components/fx-weather.js +2 -2
- package/dist/components/fx.cjs +5 -5
- package/dist/components/fx.js +6 -6
- package/dist/components/fx2.cjs +10 -4
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +26 -1
- package/dist/components/fx2.d.ts +26 -1
- package/dist/components/fx2.js +10 -6
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/gesture.cjs +3 -3
- package/dist/components/gesture.js +4 -4
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +1 -1
- package/dist/components/jsx.d.cts +1 -1
- package/dist/components/jsx.d.ts +1 -1
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/lazy.cjs +1 -1
- package/dist/components/lazy.d.cts +1 -1
- package/dist/components/lazy.d.ts +1 -1
- package/dist/components/lazy.js +1 -1
- package/dist/components/lite.cjs +151 -206
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +152 -206
- package/dist/components/lite.js.map +1 -1
- package/dist/components/marketplace.cjs +2 -2
- package/dist/components/marketplace.js +2 -2
- package/dist/components/packs.cjs +1 -1
- package/dist/components/packs.js +1 -1
- package/dist/components/page.cjs +2 -2
- package/dist/components/page.js +3 -3
- package/dist/components/perf.cjs +2 -2
- package/dist/components/perf.d.cts +1 -1
- package/dist/components/perf.d.ts +1 -1
- package/dist/components/perf.js +3 -3
- package/dist/components/physics.cjs +2 -2
- package/dist/components/physics.js +3 -3
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +1 -1
- package/dist/components/solid.cjs +9 -9
- package/dist/components/solid.d.cts +2 -18
- package/dist/components/solid.d.ts +2 -18
- package/dist/components/solid.js +9 -9
- package/dist/components/svelte.cjs +9 -9
- package/dist/components/svelte.d.cts +2 -18
- package/dist/components/svelte.d.ts +2 -18
- package/dist/components/svelte.js +9 -9
- package/dist/components/svg.cjs +1 -1
- package/dist/components/svg.js +1 -1
- package/dist/components/text.cjs +2 -2
- package/dist/components/text.js +2 -2
- package/dist/components/timeline.cjs +2 -2
- package/dist/components/timeline.js +3 -3
- package/dist/components/transitions.cjs +1 -1
- package/dist/components/transitions.js +1 -1
- package/dist/components/ui.cjs +17 -108
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.css +0 -1
- package/dist/components/ui.d.cts +3 -20
- package/dist/components/ui.d.ts +3 -20
- package/dist/components/ui.js +19 -109
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +9 -9
- package/dist/components/vue.d.cts +2 -18
- package/dist/components/vue.d.ts +2 -18
- package/dist/components/vue.js +9 -9
- package/dist/components/webgl.cjs +1 -1
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +373 -146
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +110 -2
- package/dist/components/widgets.d.ts +110 -2
- package/dist/components/widgets.js +369 -147
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.cjs +9 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +0 -1
- package/dist/components.d.cts +4 -21
- package/dist/components.d.ts +4 -21
- package/dist/components.js +12 -12
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +14 -12
- package/docs/accessibility.md +1 -2
- package/docs/components.md +44 -1
- package/docs/deprecations.md +1 -1
- package/docs/upgrading-8.md +9 -6
- package/package.json +41 -1
- package/dist/chunks/base-2-yYc93C.js.map +0 -1
- package/dist/chunks/base-BaQV-2ha.cjs.map +0 -1
- package/dist/chunks/index-tags-BTMwrfgV.cjs.map +0 -1
- package/dist/chunks/index-tags-C04JP8g4.js.map +0 -1
package/dist/components/lite.cjs
CHANGED
|
@@ -9,6 +9,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
9
9
|
* imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
|
|
10
10
|
* scripts. Classes are created the first time a `define*()` function runs.
|
|
11
11
|
*/
|
|
12
|
+
var _a$1;
|
|
12
13
|
const MOTION_SENSITIVITY_LEVELS = ['full', 'gentle', 'minimal', 'static'];
|
|
13
14
|
const MOTION_SCALE = { low: 0.6, normal: 1, high: 1.25 };
|
|
14
15
|
const config = { injectStyles: true, reducedMotion: 'user', motionIntensity: 'normal', motionSensitivity: 'full' };
|
|
@@ -251,6 +252,7 @@ function animateWithMotion(el, keyframes, options) {
|
|
|
251
252
|
if (k !== 1 && k > 0 && typeof options.duration === 'number')
|
|
252
253
|
options = { ...options, duration: options.duration * k, delay: (options.delay || 0) * k };
|
|
253
254
|
const a = el.animate(keyframes, options);
|
|
255
|
+
trackAnimation(a);
|
|
254
256
|
if (options.iterations !== Infinity) {
|
|
255
257
|
active$1++;
|
|
256
258
|
let done = false;
|
|
@@ -327,9 +329,14 @@ function flushFrame(t) {
|
|
|
327
329
|
error ?? (error = e);
|
|
328
330
|
}
|
|
329
331
|
}
|
|
330
|
-
|
|
331
|
-
if (
|
|
332
|
-
|
|
332
|
+
// 8.0: loops run on the unified motion clock — dt scaled by its rate, frozen while paused
|
|
333
|
+
if (!clockState.paused) {
|
|
334
|
+
const cdt = dt * clockState.rate;
|
|
335
|
+
clockState.time += cdt;
|
|
336
|
+
frameListeners.forEach((fn) => fn(t, cdt));
|
|
337
|
+
if (frameListeners.size)
|
|
338
|
+
requestFlush();
|
|
339
|
+
}
|
|
333
340
|
if (error)
|
|
334
341
|
throw error;
|
|
335
342
|
}
|
|
@@ -356,13 +363,42 @@ const caf = (id) => {
|
|
|
356
363
|
/** Run `fn(time, dt)` every frame on the shared scheduler until the returned function is called. */
|
|
357
364
|
function onFrame(fn) {
|
|
358
365
|
frameListeners.add(fn);
|
|
359
|
-
|
|
366
|
+
if (!clockState.paused)
|
|
367
|
+
requestFlush();
|
|
360
368
|
return () => frameListeners.delete(fn);
|
|
361
369
|
}
|
|
362
370
|
/** Scheduler counters: frames flushed, callbacks run, peak callbacks in one frame, pending now. */
|
|
363
371
|
function schedulerStats() {
|
|
364
372
|
return { frames: frameStats.frames, callbacks: frameStats.callbacks, peak: frameStats.peak, pending: frameQueue.size, loops: frameListeners.size };
|
|
365
373
|
}
|
|
374
|
+
const CLOCK_KEY = Symbol.for('motionary.clock');
|
|
375
|
+
const clockState = ((_a$1 = globalThis)[CLOCK_KEY] || (_a$1[CLOCK_KEY] = { rate: 1, paused: false, time: 0, anims: new Set(), subs: new Set() }));
|
|
376
|
+
function applyClock(a) {
|
|
377
|
+
try {
|
|
378
|
+
if (typeof a.updatePlaybackRate === 'function')
|
|
379
|
+
a.updatePlaybackRate(clockState.rate);
|
|
380
|
+
else if (clockState.rate !== 1 || a.playbackRate !== undefined)
|
|
381
|
+
a.playbackRate = clockState.rate;
|
|
382
|
+
if (clockState.paused)
|
|
383
|
+
a.pause?.();
|
|
384
|
+
else if (a.playState === 'paused' && a._usaClockPaused)
|
|
385
|
+
a.play?.();
|
|
386
|
+
a._usaClockPaused = clockState.paused;
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
/* finished / detached animation */
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/** Put an animation on the shared motion clock (animateWithMotion does this for every component / effect animation). */
|
|
393
|
+
function trackAnimation(a) {
|
|
394
|
+
if (!a)
|
|
395
|
+
return;
|
|
396
|
+
if (clockState.rate !== 1 || clockState.paused)
|
|
397
|
+
applyClock(a);
|
|
398
|
+
clockState.anims.add(a);
|
|
399
|
+
const drop = () => clockState.anims.delete(a);
|
|
400
|
+
a.finished?.then(drop, drop);
|
|
401
|
+
}
|
|
366
402
|
// --- active animation budget (4.5) ---------------------------------------------
|
|
367
403
|
let active$1 = 0;
|
|
368
404
|
let maxActive = Infinity;
|
|
@@ -415,7 +451,7 @@ const COMPONENT_CATEGORIES = {
|
|
|
415
451
|
physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],
|
|
416
452
|
cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],
|
|
417
453
|
click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],
|
|
418
|
-
ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-
|
|
454
|
+
ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],
|
|
419
455
|
page: ['usa-cursor', 'usa-fullpage', 'usa-loading-bar', 'usa-back-to-top', 'usa-ambient', 'usa-splash', 'usa-auto-skeleton', 'usa-motion-switch'],
|
|
420
456
|
timeline: ['usa-timeline'],
|
|
421
457
|
gesture: ['usa-swipeable', 'usa-pinch-zoom'],
|
|
@@ -598,7 +634,7 @@ function revealKeyframes(effect, distance) {
|
|
|
598
634
|
return [from, to];
|
|
599
635
|
}
|
|
600
636
|
|
|
601
|
-
var css$
|
|
637
|
+
var css$13 = "";
|
|
602
638
|
|
|
603
639
|
function defineReveal(tag = 'usa-reveal') {
|
|
604
640
|
return defineElement(tag, (Base) => class UsaReveal extends Base {
|
|
@@ -673,7 +709,7 @@ function defineReveal(tag = 'usa-reveal') {
|
|
|
673
709
|
if (!this.reduced)
|
|
674
710
|
this.setAttribute('data-state', 'hidden');
|
|
675
711
|
}
|
|
676
|
-
}, { id: 'reveal', text: css$
|
|
712
|
+
}, { id: 'reveal', text: css$13 });
|
|
677
713
|
}
|
|
678
714
|
|
|
679
715
|
function defineStagger(tag = 'usa-stagger') {
|
|
@@ -739,10 +775,10 @@ function defineStagger(tag = 'usa-stagger') {
|
|
|
739
775
|
if (!this.reduced)
|
|
740
776
|
this.setAttribute('data-state', 'hidden');
|
|
741
777
|
}
|
|
742
|
-
}, { id: 'reveal', text: css$
|
|
778
|
+
}, { id: 'reveal', text: css$13 });
|
|
743
779
|
}
|
|
744
780
|
|
|
745
|
-
var css$
|
|
781
|
+
var css$12 = "";
|
|
746
782
|
|
|
747
783
|
/** Progress (0–1) of `target` scrolling through the viewport, or of the page. */
|
|
748
784
|
function readScrollProgress(target) {
|
|
@@ -810,10 +846,10 @@ function defineScrollProgress(tag = 'usa-scroll-progress') {
|
|
|
810
846
|
this.setAttribute('aria-valuenow', pct);
|
|
811
847
|
this.emit('progress', { progress: p });
|
|
812
848
|
}
|
|
813
|
-
}, { id: 'scroll-progress', text: css$
|
|
849
|
+
}, { id: 'scroll-progress', text: css$12 });
|
|
814
850
|
}
|
|
815
851
|
|
|
816
|
-
var css$
|
|
852
|
+
var css$11 = "";
|
|
817
853
|
|
|
818
854
|
function defineScrolly(tag = 'usa-scrolly') {
|
|
819
855
|
return defineElement(tag, (Base) => class UsaScrolly extends Base {
|
|
@@ -865,7 +901,7 @@ function defineScrolly(tag = 'usa-scrolly') {
|
|
|
865
901
|
if (!silent)
|
|
866
902
|
this.emit('step', { index, step, name: step.dataset.step || '' });
|
|
867
903
|
}
|
|
868
|
-
}, { id: 'scrolly', text: css$
|
|
904
|
+
}, { id: 'scrolly', text: css$11 });
|
|
869
905
|
}
|
|
870
906
|
|
|
871
907
|
/**
|
|
@@ -880,7 +916,7 @@ function defineRevealComponents() {
|
|
|
880
916
|
defineScrolly();
|
|
881
917
|
}
|
|
882
918
|
|
|
883
|
-
var css$
|
|
919
|
+
var css$10 = "";
|
|
884
920
|
|
|
885
921
|
function defineTypewriter(tag = 'usa-typewriter') {
|
|
886
922
|
return defineElement(tag, (Base) => class UsaTypewriter extends Base {
|
|
@@ -994,10 +1030,10 @@ function defineTypewriter(tag = 'usa-typewriter') {
|
|
|
994
1030
|
};
|
|
995
1031
|
this._timer = setTimeout(tick, this.num('delay', 0));
|
|
996
1032
|
}
|
|
997
|
-
}, { id: 'typewriter', text: css$
|
|
1033
|
+
}, { id: 'typewriter', text: css$10 });
|
|
998
1034
|
}
|
|
999
1035
|
|
|
1000
|
-
var css
|
|
1036
|
+
var css$$ = "";
|
|
1001
1037
|
|
|
1002
1038
|
/**
|
|
1003
1039
|
* motionary/components/tokens — motion design tokens (4.2).
|
|
@@ -1811,7 +1847,7 @@ function defineSplitText(tag = 'usa-split-text') {
|
|
|
1811
1847
|
clearTimeout(this._timer);
|
|
1812
1848
|
this.setAttribute('data-state', this.reduced ? 'shown' : 'hidden');
|
|
1813
1849
|
}
|
|
1814
|
-
}, { id: 'split-text', text: css
|
|
1850
|
+
}, { id: 'split-text', text: css$$ });
|
|
1815
1851
|
}
|
|
1816
1852
|
|
|
1817
1853
|
const GLYPHS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=<>/\\?!';
|
|
@@ -1905,7 +1941,7 @@ function defineScramble(tag = 'usa-scramble') {
|
|
|
1905
1941
|
}, undefined);
|
|
1906
1942
|
}
|
|
1907
1943
|
|
|
1908
|
-
var css
|
|
1944
|
+
var css$_ = "";
|
|
1909
1945
|
|
|
1910
1946
|
/** easeOutExpo */
|
|
1911
1947
|
const easeOutExpo = (t) => (t >= 1 ? 1 : 1 - Math.pow(2, -10 * t));
|
|
@@ -2005,10 +2041,10 @@ function defineCounter(tag = 'usa-counter') {
|
|
|
2005
2041
|
this._frame = raf(step);
|
|
2006
2042
|
});
|
|
2007
2043
|
}
|
|
2008
|
-
}, { id: 'counter', text: css
|
|
2044
|
+
}, { id: 'counter', text: css$_ });
|
|
2009
2045
|
}
|
|
2010
2046
|
|
|
2011
|
-
var css$
|
|
2047
|
+
var css$Z = "";
|
|
2012
2048
|
|
|
2013
2049
|
function defineShimmerText(tag = 'usa-shimmer-text') {
|
|
2014
2050
|
return defineElement(tag, (Base) => class UsaShimmerText extends Base {
|
|
@@ -2028,10 +2064,10 @@ function defineShimmerText(tag = 'usa-shimmer-text') {
|
|
|
2028
2064
|
set('shine', '--usa-shimmer-shine');
|
|
2029
2065
|
set('angle', '--usa-shimmer-angle', 'deg');
|
|
2030
2066
|
}
|
|
2031
|
-
}, { id: 'shimmer-text', text: css$
|
|
2067
|
+
}, { id: 'shimmer-text', text: css$Z });
|
|
2032
2068
|
}
|
|
2033
2069
|
|
|
2034
|
-
var css$
|
|
2070
|
+
var css$Y = "";
|
|
2035
2071
|
|
|
2036
2072
|
function defineTextRotate(tag = 'usa-text-rotate') {
|
|
2037
2073
|
return defineElement(tag, (Base) => class UsaTextRotate extends Base {
|
|
@@ -2103,10 +2139,10 @@ function defineTextRotate(tag = 'usa-text-rotate') {
|
|
|
2103
2139
|
this.motion(cur, [inFrom, pick(inFrom)], { duration: 520, easing: effect === 'slide' ? EASE_SPRING : EASE_OUT });
|
|
2104
2140
|
this.emit('change', { index: this._index, word: cur.textContent });
|
|
2105
2141
|
}
|
|
2106
|
-
}, { id: 'text-rotate', text: css$
|
|
2142
|
+
}, { id: 'text-rotate', text: css$Y });
|
|
2107
2143
|
}
|
|
2108
2144
|
|
|
2109
|
-
var css$
|
|
2145
|
+
var css$X = "";
|
|
2110
2146
|
|
|
2111
2147
|
/** Split `text` into per-character spans (words never break). The animated copy is aria-hidden. */
|
|
2112
2148
|
function splitChars(host, text) {
|
|
@@ -2143,7 +2179,7 @@ function defineWaveText(tag = 'usa-wave-text') {
|
|
|
2143
2179
|
this.style.setProperty('--usa-wave-s', `${this.num('speed', 1.6)}s`);
|
|
2144
2180
|
this.style.setProperty('--usa-wave-d', `${this.num('stagger', 0.06)}s`);
|
|
2145
2181
|
}
|
|
2146
|
-
}, { id: 'text-fx', text: css$
|
|
2182
|
+
}, { id: 'text-fx', text: css$X });
|
|
2147
2183
|
}
|
|
2148
2184
|
function defineGlitch(tag = 'usa-glitch') {
|
|
2149
2185
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -2155,7 +2191,7 @@ function defineGlitch(tag = 'usa-glitch') {
|
|
|
2155
2191
|
if (!this.firstChild)
|
|
2156
2192
|
this.textContent = t;
|
|
2157
2193
|
}
|
|
2158
|
-
}, { id: 'text-fx', text: css$
|
|
2194
|
+
}, { id: 'text-fx', text: css$X });
|
|
2159
2195
|
}
|
|
2160
2196
|
function defineGradientText(tag = 'usa-gradient-text') {
|
|
2161
2197
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -2165,7 +2201,7 @@ function defineGradientText(tag = 'usa-gradient-text') {
|
|
|
2165
2201
|
this.style.setProperty('--usa-grad', `linear-gradient(${this.num('angle', 90)}deg, ${[...c, c[0]].join(', ')})`);
|
|
2166
2202
|
this.style.setProperty('--usa-grad-s', `${this.num('speed', 6)}s`);
|
|
2167
2203
|
}
|
|
2168
|
-
}, { id: 'text-fx', text: css$
|
|
2204
|
+
}, { id: 'text-fx', text: css$X });
|
|
2169
2205
|
}
|
|
2170
2206
|
function defineHandwriting(tag = 'usa-handwriting') {
|
|
2171
2207
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -2198,7 +2234,7 @@ function defineHandwriting(tag = 'usa-handwriting') {
|
|
|
2198
2234
|
this.emit('complete');
|
|
2199
2235
|
}, this.reduced ? 0 : this.num('duration', 2400));
|
|
2200
2236
|
}
|
|
2201
|
-
}, { id: 'text-fx', text: css$
|
|
2237
|
+
}, { id: 'text-fx', text: css$X });
|
|
2202
2238
|
}
|
|
2203
2239
|
function defineScrollHighlight(tag = 'usa-scroll-highlight') {
|
|
2204
2240
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -2262,7 +2298,7 @@ function defineScrollHighlight(tag = 'usa-scroll-highlight') {
|
|
|
2262
2298
|
caf(this._f);
|
|
2263
2299
|
this._f = 0;
|
|
2264
2300
|
}
|
|
2265
|
-
}, { id: 'text-fx', text: css$
|
|
2301
|
+
}, { id: 'text-fx', text: css$X });
|
|
2266
2302
|
}
|
|
2267
2303
|
|
|
2268
2304
|
/**
|
|
@@ -2285,7 +2321,7 @@ function defineTextComponents() {
|
|
|
2285
2321
|
defineScrollHighlight();
|
|
2286
2322
|
}
|
|
2287
2323
|
|
|
2288
|
-
var css$
|
|
2324
|
+
var css$W = "";
|
|
2289
2325
|
|
|
2290
2326
|
function defineRipple(tag = 'usa-ripple') {
|
|
2291
2327
|
return defineElement(tag, (Base) => class UsaRipple extends Base {
|
|
@@ -2332,10 +2368,10 @@ function defineRipple(tag = 'usa-ripple') {
|
|
|
2332
2368
|
else
|
|
2333
2369
|
setTimeout(() => wave.remove(), 0);
|
|
2334
2370
|
}
|
|
2335
|
-
}, { id: 'ripple', text: css$
|
|
2371
|
+
}, { id: 'ripple', text: css$W });
|
|
2336
2372
|
}
|
|
2337
2373
|
|
|
2338
|
-
var css$
|
|
2374
|
+
var css$V = "";
|
|
2339
2375
|
|
|
2340
2376
|
function defineMagnetic(tag = 'usa-magnetic') {
|
|
2341
2377
|
return defineElement(tag, (Base) => class UsaMagnetic extends Base {
|
|
@@ -2392,10 +2428,10 @@ function defineMagnetic(tag = 'usa-magnetic') {
|
|
|
2392
2428
|
this._frame = 0;
|
|
2393
2429
|
this.release();
|
|
2394
2430
|
}
|
|
2395
|
-
}, { id: 'magnetic', text: css$
|
|
2431
|
+
}, { id: 'magnetic', text: css$V });
|
|
2396
2432
|
}
|
|
2397
2433
|
|
|
2398
|
-
var css$
|
|
2434
|
+
var css$U = "";
|
|
2399
2435
|
|
|
2400
2436
|
function defineTilt(tag = 'usa-tilt') {
|
|
2401
2437
|
return defineElement(tag, (Base) => class UsaTilt extends Base {
|
|
@@ -2464,10 +2500,10 @@ function defineTilt(tag = 'usa-tilt') {
|
|
|
2464
2500
|
unmount() {
|
|
2465
2501
|
this.reset();
|
|
2466
2502
|
}
|
|
2467
|
-
}, { id: 'tilt', text: css$
|
|
2503
|
+
}, { id: 'tilt', text: css$U });
|
|
2468
2504
|
}
|
|
2469
2505
|
|
|
2470
|
-
var css$
|
|
2506
|
+
var css$T = "";
|
|
2471
2507
|
|
|
2472
2508
|
function defineSpotlight(tag = 'usa-spotlight') {
|
|
2473
2509
|
return defineElement(tag, (Base) => class UsaSpotlight extends Base {
|
|
@@ -2529,10 +2565,10 @@ function defineSpotlight(tag = 'usa-spotlight') {
|
|
|
2529
2565
|
this._frame = 0;
|
|
2530
2566
|
this.removeAttribute('data-lit');
|
|
2531
2567
|
}
|
|
2532
|
-
}, { id: 'spotlight', text: css$
|
|
2568
|
+
}, { id: 'spotlight', text: css$T });
|
|
2533
2569
|
}
|
|
2534
2570
|
|
|
2535
|
-
var css$
|
|
2571
|
+
var css$S = "";
|
|
2536
2572
|
|
|
2537
2573
|
function definePress(tag = 'usa-press') {
|
|
2538
2574
|
return defineElement(tag, (Base) => class UsaPress extends Base {
|
|
@@ -2598,7 +2634,7 @@ function definePress(tag = 'usa-press') {
|
|
|
2598
2634
|
this._anim = null;
|
|
2599
2635
|
this._down = false;
|
|
2600
2636
|
}
|
|
2601
|
-
}, { id: 'press', text: css$
|
|
2637
|
+
}, { id: 'press', text: css$S });
|
|
2602
2638
|
}
|
|
2603
2639
|
|
|
2604
2640
|
/**
|
|
@@ -2615,7 +2651,7 @@ function defineInteractionComponents() {
|
|
|
2615
2651
|
definePress();
|
|
2616
2652
|
}
|
|
2617
2653
|
|
|
2618
|
-
var css$
|
|
2654
|
+
var css$R = "";
|
|
2619
2655
|
|
|
2620
2656
|
const SPINNER_VARIANTS = ['fluent', 'windows', 'ring', 'dots', 'pulse', 'bars'];
|
|
2621
2657
|
function markup(variant) {
|
|
@@ -2661,10 +2697,10 @@ function defineSpinner(tag = 'usa-spinner') {
|
|
|
2661
2697
|
if (!this.hasAttribute('aria-label') || this.hasAttribute('label'))
|
|
2662
2698
|
this.setAttribute('aria-label', this.str('label', 'Loading'));
|
|
2663
2699
|
}
|
|
2664
|
-
}, { id: 'spinner', text: css$
|
|
2700
|
+
}, { id: 'spinner', text: css$R });
|
|
2665
2701
|
}
|
|
2666
2702
|
|
|
2667
|
-
var css$
|
|
2703
|
+
var css$Q = "";
|
|
2668
2704
|
|
|
2669
2705
|
function defineSkeleton(tag = 'usa-skeleton') {
|
|
2670
2706
|
return defineElement(tag, (Base) => class UsaSkeleton extends Base {
|
|
@@ -2744,10 +2780,10 @@ function defineSkeleton(tag = 'usa-skeleton') {
|
|
|
2744
2780
|
}
|
|
2745
2781
|
this.emit('loaded');
|
|
2746
2782
|
}
|
|
2747
|
-
}, { id: 'skeleton', text: css$
|
|
2783
|
+
}, { id: 'skeleton', text: css$Q });
|
|
2748
2784
|
}
|
|
2749
2785
|
|
|
2750
|
-
var css$
|
|
2786
|
+
var css$P = "";
|
|
2751
2787
|
|
|
2752
2788
|
function defineProgress(tag = 'usa-progress') {
|
|
2753
2789
|
return defineElement(tag, (Base) => class UsaProgress extends Base {
|
|
@@ -2810,10 +2846,10 @@ function defineProgress(tag = 'usa-progress') {
|
|
|
2810
2846
|
if (ratio === 1)
|
|
2811
2847
|
this.emit('complete');
|
|
2812
2848
|
}
|
|
2813
|
-
}, { id: 'progress', text: css$
|
|
2849
|
+
}, { id: 'progress', text: css$P });
|
|
2814
2850
|
}
|
|
2815
2851
|
|
|
2816
|
-
var css$
|
|
2852
|
+
var css$O = "";
|
|
2817
2853
|
|
|
2818
2854
|
const ICONS = {
|
|
2819
2855
|
info: '<path d="M12 8h.01M11 12h1v5h1"/>',
|
|
@@ -2929,7 +2965,7 @@ function defineToaster(tag = 'usa-toaster') {
|
|
|
2929
2965
|
clear() {
|
|
2930
2966
|
this.querySelectorAll('.usa-toast').forEach((t) => t._close?.());
|
|
2931
2967
|
}
|
|
2932
|
-
}, { id: 'toast', text: css$
|
|
2968
|
+
}, { id: 'toast', text: css$O });
|
|
2933
2969
|
}
|
|
2934
2970
|
/**
|
|
2935
2971
|
* Show a toast. Defines `<usa-toaster>` and adds one to `<body>` if the
|
|
@@ -2950,7 +2986,7 @@ function toast(message, options = {}) {
|
|
|
2950
2986
|
return host.show(message, options);
|
|
2951
2987
|
}
|
|
2952
2988
|
|
|
2953
|
-
var css$
|
|
2989
|
+
var css$N = "";
|
|
2954
2990
|
|
|
2955
2991
|
const PATHS = {
|
|
2956
2992
|
success: 'M15 27 l7 7 l14 -15',
|
|
@@ -3027,7 +3063,7 @@ function defineCheck(tag = 'usa-check') {
|
|
|
3027
3063
|
done();
|
|
3028
3064
|
});
|
|
3029
3065
|
}
|
|
3030
|
-
}, { id: 'check', text: css$
|
|
3066
|
+
}, { id: 'check', text: css$N });
|
|
3031
3067
|
}
|
|
3032
3068
|
|
|
3033
3069
|
/**
|
|
@@ -3044,7 +3080,7 @@ function defineFeedbackComponents() {
|
|
|
3044
3080
|
defineCheck();
|
|
3045
3081
|
}
|
|
3046
3082
|
|
|
3047
|
-
var css$
|
|
3083
|
+
var css$M = "";
|
|
3048
3084
|
|
|
3049
3085
|
function defineAurora(tag = 'usa-aurora') {
|
|
3050
3086
|
return defineElement(tag, (Base) => class UsaAurora extends Base {
|
|
@@ -3072,10 +3108,10 @@ function defineAurora(tag = 'usa-aurora') {
|
|
|
3072
3108
|
this.style.setProperty('--usa-aurora-opacity', String(this.num('intensity', 0.7)));
|
|
3073
3109
|
this.inView((v) => this.toggleAttribute('data-offscreen', !v));
|
|
3074
3110
|
}
|
|
3075
|
-
}, { id: 'aurora', text: css$
|
|
3111
|
+
}, { id: 'aurora', text: css$M });
|
|
3076
3112
|
}
|
|
3077
3113
|
|
|
3078
|
-
var css$
|
|
3114
|
+
var css$L = "";
|
|
3079
3115
|
|
|
3080
3116
|
function defineParticles(tag = 'usa-particles') {
|
|
3081
3117
|
return defineElement(tag, (Base) => class UsaParticles extends Base {
|
|
@@ -3234,10 +3270,10 @@ function defineParticles(tag = 'usa-particles') {
|
|
|
3234
3270
|
}
|
|
3235
3271
|
ctx.globalAlpha = 1;
|
|
3236
3272
|
}
|
|
3237
|
-
}, { id: 'particles', text: css$
|
|
3273
|
+
}, { id: 'particles', text: css$L });
|
|
3238
3274
|
}
|
|
3239
3275
|
|
|
3240
|
-
var css$
|
|
3276
|
+
var css$K = "";
|
|
3241
3277
|
|
|
3242
3278
|
const noise = (freq) => `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='${freq}' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.6 -0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`;
|
|
3243
3279
|
function defineGrain(tag = 'usa-grain') {
|
|
@@ -3262,10 +3298,10 @@ function defineGrain(tag = 'usa-grain') {
|
|
|
3262
3298
|
s.opacity = String(this.num('opacity', 0.12));
|
|
3263
3299
|
s.mixBlendMode = this.str('blend', 'overlay');
|
|
3264
3300
|
}
|
|
3265
|
-
}, { id: 'grain', text: css$
|
|
3301
|
+
}, { id: 'grain', text: css$K });
|
|
3266
3302
|
}
|
|
3267
3303
|
|
|
3268
|
-
var css$
|
|
3304
|
+
var css$J = "";
|
|
3269
3305
|
|
|
3270
3306
|
function defineMarquee(tag = 'usa-marquee') {
|
|
3271
3307
|
return defineElement(tag, (Base) => class UsaMarquee extends Base {
|
|
@@ -3385,10 +3421,10 @@ function defineMarquee(tag = 'usa-marquee') {
|
|
|
3385
3421
|
else
|
|
3386
3422
|
super.changed(name);
|
|
3387
3423
|
}
|
|
3388
|
-
}, { id: 'marquee', text: css$
|
|
3424
|
+
}, { id: 'marquee', text: css$J });
|
|
3389
3425
|
}
|
|
3390
3426
|
|
|
3391
|
-
var css$
|
|
3427
|
+
var css$I = "";
|
|
3392
3428
|
|
|
3393
3429
|
function defineAcrylic(tag = 'usa-acrylic') {
|
|
3394
3430
|
return defineElement(tag, (Base) => class UsaAcrylic extends Base {
|
|
@@ -3409,10 +3445,10 @@ function defineAcrylic(tag = 'usa-acrylic') {
|
|
|
3409
3445
|
this.setAttribute('data-shine', '');
|
|
3410
3446
|
}
|
|
3411
3447
|
}
|
|
3412
|
-
}, { id: 'acrylic', text: css$
|
|
3448
|
+
}, { id: 'acrylic', text: css$I });
|
|
3413
3449
|
}
|
|
3414
3450
|
|
|
3415
|
-
var css$
|
|
3451
|
+
var css$H = "";
|
|
3416
3452
|
|
|
3417
3453
|
/** Shared canvas setup: DPR ≤ 2, resize with the host, run only while visible & tab shown. */
|
|
3418
3454
|
function canvasLoop(host, draw, still) {
|
|
@@ -3487,7 +3523,7 @@ function defineGridGlow(tag = 'usa-grid-glow') {
|
|
|
3487
3523
|
});
|
|
3488
3524
|
this.onCleanup(() => caf(f));
|
|
3489
3525
|
}
|
|
3490
|
-
}, { id: 'bg-fx', text: css$
|
|
3526
|
+
}, { id: 'bg-fx', text: css$H });
|
|
3491
3527
|
}
|
|
3492
3528
|
function defineBlobs(tag = 'usa-blobs') {
|
|
3493
3529
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -3502,7 +3538,7 @@ function defineBlobs(tag = 'usa-blobs') {
|
|
|
3502
3538
|
this.style.setProperty('--usa-blobs-speed', String(this.num('speed', 1)));
|
|
3503
3539
|
this.style.setProperty('--usa-blobs-blur', `${this.num('blur', 60)}px`);
|
|
3504
3540
|
}
|
|
3505
|
-
}, { id: 'bg-fx', text: css$
|
|
3541
|
+
}, { id: 'bg-fx', text: css$H });
|
|
3506
3542
|
}
|
|
3507
3543
|
function defineWaterRipple(tag = 'usa-water-ripple') {
|
|
3508
3544
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -3564,7 +3600,7 @@ function defineWaterRipple(tag = 'usa-water-ripple') {
|
|
|
3564
3600
|
this.drop(e.clientX - r.left, e.clientY - r.top, 1.5);
|
|
3565
3601
|
});
|
|
3566
3602
|
}
|
|
3567
|
-
}, { id: 'bg-fx', text: css$
|
|
3603
|
+
}, { id: 'bg-fx', text: css$H });
|
|
3568
3604
|
}
|
|
3569
3605
|
function defineDotNetwork(tag = 'usa-dot-network') {
|
|
3570
3606
|
return defineElement(tag, (Base) => class extends Base {
|
|
@@ -3607,10 +3643,10 @@ function defineDotNetwork(tag = 'usa-dot-network') {
|
|
|
3607
3643
|
}
|
|
3608
3644
|
}, this.reduced);
|
|
3609
3645
|
}
|
|
3610
|
-
}, { id: 'bg-fx', text: css$
|
|
3646
|
+
}, { id: 'bg-fx', text: css$H });
|
|
3611
3647
|
}
|
|
3612
3648
|
|
|
3613
|
-
var css$
|
|
3649
|
+
var css$G = "";
|
|
3614
3650
|
|
|
3615
3651
|
/**
|
|
3616
3652
|
* Style variants (v2.6): `variant="minimal | neon | glass | brutalist |
|
|
@@ -3628,7 +3664,7 @@ var css$H = "";
|
|
|
3628
3664
|
const VARIANTS = ['minimal', 'neon', 'glass', 'brutalist', 'fluent', 'material'];
|
|
3629
3665
|
/** Inject the variant token sheet (done automatically by every `ui` component). */
|
|
3630
3666
|
function adoptVariants() {
|
|
3631
|
-
adoptStyles('variants', css$
|
|
3667
|
+
adoptStyles('variants', css$G);
|
|
3632
3668
|
}
|
|
3633
3669
|
/** Apply a variant to the whole page (or `root`); `null` removes it. */
|
|
3634
3670
|
function setVariant(variant, root = typeof document !== 'undefined' ? document.documentElement : null) {
|
|
@@ -3641,7 +3677,7 @@ function setVariant(variant, root = typeof document !== 'undefined' ? document.d
|
|
|
3641
3677
|
root.removeAttribute('data-usa-variant');
|
|
3642
3678
|
}
|
|
3643
3679
|
|
|
3644
|
-
var css$
|
|
3680
|
+
var css$F = "";
|
|
3645
3681
|
|
|
3646
3682
|
/**
|
|
3647
3683
|
* Windows 11 **Fluent preset** (v2.8): applies the `fluent` variant
|
|
@@ -3656,7 +3692,7 @@ function fluentPreset(options = {}) {
|
|
|
3656
3692
|
if (typeof document === 'undefined')
|
|
3657
3693
|
return () => undefined;
|
|
3658
3694
|
const root = options.root || document.documentElement;
|
|
3659
|
-
adoptStyles('fluent-preset', css$
|
|
3695
|
+
adoptStyles('fluent-preset', css$F);
|
|
3660
3696
|
setVariant('fluent', root);
|
|
3661
3697
|
root.classList.add('usa-fluent');
|
|
3662
3698
|
if (options.mica !== false)
|
|
@@ -3719,7 +3755,7 @@ function defineBackgroundComponents() {
|
|
|
3719
3755
|
|
|
3720
3756
|
var shadowCss = ":host{display:contents}dialog{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:hidden}dialog:not([open]){display:none}dialog::backdrop{background:transparent}[part=\"backdrop\"]{position:absolute;inset:0;background:var(--usa-dialog-backdrop,rgb(0 0 0 / 0.42))}[part=\"panel\"]{position:absolute;left:50%;top:50%;translate:-50% -50%;box-sizing:border-box;width:min(var(--usa-dialog-width,480px),calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;padding:var(--usa-dialog-padding,24px);border-radius:var(--usa-dialog-radius,12px);background:var(--usa-dialog-bg,Canvas);color:var(--usa-dialog-fg,CanvasText);box-shadow:0 32px 64px -12px rgb(0 0 0 / 0.45),0 0 0 1px rgb(127 127 127 / 0.18)}dialog[data-kind^=\"drawer\"] [part=\"panel\"]{top:0;bottom:0;translate:none;max-height:none;height:100%;border-radius:0;width:min(var(--usa-dialog-width,380px),88vw)}dialog[data-kind=\"drawer-start\"] [part=\"panel\"]{left:0}dialog[data-kind=\"drawer-end\"] [part=\"panel\"]{left:auto;right:0}dialog[data-kind=\"drawer-bottom\"] [part=\"panel\"],dialog[data-kind=\"sheet\"] [part=\"panel\"]{top:auto;bottom:0;left:0;right:0;translate:none;width:100%;height:auto;max-height:85vh;border-radius:var(--usa-dialog-radius,16px) var(--usa-dialog-radius,16px) 0 0}dialog[data-kind=\"sheet\"] [part=\"panel\"]{left:50%;translate:-50% 0;width:min(var(--usa-dialog-width,560px),100vw)}";
|
|
3721
3757
|
|
|
3722
|
-
var css$
|
|
3758
|
+
var css$E = "";
|
|
3723
3759
|
|
|
3724
3760
|
const FROM = {
|
|
3725
3761
|
modal: 'scale(0.94)',
|
|
@@ -3874,10 +3910,10 @@ function defineDialog(tag = 'usa-dialog') {
|
|
|
3874
3910
|
const b = this._backdrop ? this.motion(this._backdrop, backdrop, { duration, easing: 'linear', fill }) : null;
|
|
3875
3911
|
return Promise.all([a?.finished, b?.finished].map((p) => p?.catch(() => undefined))).then(() => undefined);
|
|
3876
3912
|
}
|
|
3877
|
-
}, { id: 'dialog', text: css$
|
|
3913
|
+
}, { id: 'dialog', text: css$E });
|
|
3878
3914
|
}
|
|
3879
3915
|
|
|
3880
|
-
var css$
|
|
3916
|
+
var css$D = "";
|
|
3881
3917
|
|
|
3882
3918
|
function defineAccordion(tag = 'usa-accordion') {
|
|
3883
3919
|
return defineElement(tag, (Base) => class UsaAccordion extends Base {
|
|
@@ -3943,10 +3979,10 @@ function defineAccordion(tag = 'usa-accordion') {
|
|
|
3943
3979
|
d.removeAttribute('data-closing');
|
|
3944
3980
|
}
|
|
3945
3981
|
}
|
|
3946
|
-
}, { id: 'accordion', text: css$
|
|
3982
|
+
}, { id: 'accordion', text: css$D });
|
|
3947
3983
|
}
|
|
3948
3984
|
|
|
3949
|
-
var css$
|
|
3985
|
+
var css$C = "";
|
|
3950
3986
|
|
|
3951
3987
|
function defineViewSwitch(tag = 'usa-view-switch') {
|
|
3952
3988
|
return defineElement(tag, (Base) => class UsaViewSwitch extends Base {
|
|
@@ -4039,7 +4075,7 @@ function defineViewSwitch(tag = 'usa-view-switch') {
|
|
|
4039
4075
|
this.setVisible(from, false);
|
|
4040
4076
|
a?.cancel();
|
|
4041
4077
|
}
|
|
4042
|
-
}, { id: 'view-switch', text: css$
|
|
4078
|
+
}, { id: 'view-switch', text: css$C });
|
|
4043
4079
|
}
|
|
4044
4080
|
|
|
4045
4081
|
/**
|
|
@@ -4351,7 +4387,7 @@ function rubberBand(distance, dimension, constant = 0.55) {
|
|
|
4351
4387
|
return sign * (1 - 1 / ((d * constant) / dimension + 1)) * dimension;
|
|
4352
4388
|
}
|
|
4353
4389
|
|
|
4354
|
-
var css$
|
|
4390
|
+
var css$B = "";
|
|
4355
4391
|
|
|
4356
4392
|
const SPRING_EFFECTS = ['bounce-in', 'pop', 'drop', 'jelly', 'rubber-band'];
|
|
4357
4393
|
/** Entrance effects start hidden; attention effects (jelly, rubber-band) play on visible content. */
|
|
@@ -4466,10 +4502,10 @@ function defineSpring(tag = 'usa-spring') {
|
|
|
4466
4502
|
this.setAttribute('data-state', 'done');
|
|
4467
4503
|
this.emit('complete', { effect });
|
|
4468
4504
|
}
|
|
4469
|
-
}, { id: 'spring', text: css$
|
|
4505
|
+
}, { id: 'spring', text: css$B });
|
|
4470
4506
|
}
|
|
4471
4507
|
|
|
4472
|
-
var css$
|
|
4508
|
+
var css$A = "";
|
|
4473
4509
|
|
|
4474
4510
|
const parseSnap = (s) => {
|
|
4475
4511
|
if (!s.trim())
|
|
@@ -4666,10 +4702,10 @@ function defineDraggable(tag = 'usa-draggable') {
|
|
|
4666
4702
|
reset() {
|
|
4667
4703
|
this.go(0, 0);
|
|
4668
4704
|
}
|
|
4669
|
-
}, { id: 'draggable', text: css$
|
|
4705
|
+
}, { id: 'draggable', text: css$A });
|
|
4670
4706
|
}
|
|
4671
4707
|
|
|
4672
|
-
var css$
|
|
4708
|
+
var css$z = "";
|
|
4673
4709
|
|
|
4674
4710
|
function defineOverscroll(tag = 'usa-overscroll') {
|
|
4675
4711
|
return defineElement(tag, (Base) => class UsaOverscroll extends Base {
|
|
@@ -4758,7 +4794,7 @@ function defineOverscroll(tag = 'usa-overscroll') {
|
|
|
4758
4794
|
this._spring?.stop();
|
|
4759
4795
|
this.set(0);
|
|
4760
4796
|
}
|
|
4761
|
-
}, { id: 'overscroll', text: css$
|
|
4797
|
+
}, { id: 'overscroll', text: css$z });
|
|
4762
4798
|
}
|
|
4763
4799
|
|
|
4764
4800
|
/**
|
|
@@ -4775,7 +4811,7 @@ function definePhysicsComponents() {
|
|
|
4775
4811
|
defineOverscroll();
|
|
4776
4812
|
}
|
|
4777
4813
|
|
|
4778
|
-
var css$
|
|
4814
|
+
var css$y = "";
|
|
4779
4815
|
|
|
4780
4816
|
const CARD_EFFECTS = ['flip', 'holo', 'glass', 'border-glow', 'conic-border', 'lift', 'spotlight', 'sheen', 'parallax-layers', 'expand'];
|
|
4781
4817
|
/** Effects that follow the pointer (they share one rAF-throttled tracker). */
|
|
@@ -4980,7 +5016,7 @@ function defineCard(tag = 'usa-card') {
|
|
|
4980
5016
|
const a = this.motion(this, [{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }], { duration: Math.min(duration, 900), easing: easing || EASE_OUT });
|
|
4981
5017
|
await a?.finished.catch(() => undefined);
|
|
4982
5018
|
}
|
|
4983
|
-
}, { id: 'card', text: css$
|
|
5019
|
+
}, { id: 'card', text: css$y });
|
|
4984
5020
|
}
|
|
4985
5021
|
function deco(cls) {
|
|
4986
5022
|
const s = document.createElement('span');
|
|
@@ -4994,7 +5030,7 @@ function interactive(t, host) {
|
|
|
4994
5030
|
return !!el && el !== host && host.contains(el);
|
|
4995
5031
|
}
|
|
4996
5032
|
|
|
4997
|
-
var css$
|
|
5033
|
+
var css$x = "";
|
|
4998
5034
|
|
|
4999
5035
|
function defineCardStack(tag = 'usa-card-stack') {
|
|
5000
5036
|
return defineElement(tag, (Base) => class UsaCardStack extends Base {
|
|
@@ -5117,10 +5153,10 @@ function defineCardStack(tag = 'usa-card-stack') {
|
|
|
5117
5153
|
if (!this.top)
|
|
5118
5154
|
this.emit('empty');
|
|
5119
5155
|
}
|
|
5120
|
-
}, { id: 'card-stack', text: css$
|
|
5156
|
+
}, { id: 'card-stack', text: css$x });
|
|
5121
5157
|
}
|
|
5122
5158
|
|
|
5123
|
-
var css$
|
|
5159
|
+
var css$w = "";
|
|
5124
5160
|
|
|
5125
5161
|
function defineStickyStack(tag = 'usa-sticky-stack') {
|
|
5126
5162
|
return defineElement(tag, (Base) => class UsaStickyStack extends Base {
|
|
@@ -5184,10 +5220,10 @@ function defineStickyStack(tag = 'usa-sticky-stack') {
|
|
|
5184
5220
|
c.style.filter = covered > 0.001 ? `brightness(${(1 - Math.min(0.35, covered * 0.12)).toFixed(3)})` : '';
|
|
5185
5221
|
});
|
|
5186
5222
|
}
|
|
5187
|
-
}, { id: 'sticky-stack', text: css$
|
|
5223
|
+
}, { id: 'sticky-stack', text: css$w });
|
|
5188
5224
|
}
|
|
5189
5225
|
|
|
5190
|
-
var css$
|
|
5226
|
+
var css$v = "";
|
|
5191
5227
|
|
|
5192
5228
|
function defineCarousel3d(tag = 'usa-carousel-3d') {
|
|
5193
5229
|
return defineElement(tag, (Base) => class UsaCarousel3d extends Base {
|
|
@@ -5306,7 +5342,7 @@ function defineCarousel3d(tag = 'usa-carousel-3d') {
|
|
|
5306
5342
|
prev() {
|
|
5307
5343
|
this.goTo(this._i - 1);
|
|
5308
5344
|
}
|
|
5309
|
-
}, { id: 'carousel-3d', text: css$
|
|
5345
|
+
}, { id: 'carousel-3d', text: css$v });
|
|
5310
5346
|
}
|
|
5311
5347
|
|
|
5312
5348
|
/**
|
|
@@ -5429,7 +5465,7 @@ function haptic(pattern = 10) {
|
|
|
5429
5465
|
}
|
|
5430
5466
|
}
|
|
5431
5467
|
|
|
5432
|
-
var css$
|
|
5468
|
+
var css$u = "";
|
|
5433
5469
|
|
|
5434
5470
|
const CLICK_EFFECTS = ['ripple', 'burst', 'confetti', 'squish', 'press-spring', 'shake'];
|
|
5435
5471
|
function defineClick(tag = 'usa-click') {
|
|
@@ -5553,10 +5589,10 @@ function defineClick(tag = 'usa-click') {
|
|
|
5553
5589
|
: [{ transform: from }, { transform: 'none' }];
|
|
5554
5590
|
this._press = this.motion(this, frames, fx.includes('squish') ? { duration: 520, easing: 'ease-out' } : springEasing('bouncy'));
|
|
5555
5591
|
}
|
|
5556
|
-
}, { id: 'click', text: css$
|
|
5592
|
+
}, { id: 'click', text: css$u });
|
|
5557
5593
|
}
|
|
5558
5594
|
|
|
5559
|
-
var css$
|
|
5595
|
+
var css$t = "";
|
|
5560
5596
|
|
|
5561
5597
|
const BUTTON_DEFORMS = ['squash', 'wobble', 'gooey', 'dent'];
|
|
5562
5598
|
let gooInjected = false;
|
|
@@ -5823,10 +5859,10 @@ function defineButton(tag = 'usa-button') {
|
|
|
5823
5859
|
}
|
|
5824
5860
|
this.emit('state', { state: s });
|
|
5825
5861
|
}
|
|
5826
|
-
}, { id: 'button', text: css$
|
|
5862
|
+
}, { id: 'button', text: css$t });
|
|
5827
5863
|
}
|
|
5828
5864
|
|
|
5829
|
-
var css$
|
|
5865
|
+
var css$s = "";
|
|
5830
5866
|
|
|
5831
5867
|
const C = [[12, 12], [12, 12], [12, 12], [12, 12]];
|
|
5832
5868
|
/**
|
|
@@ -5934,10 +5970,10 @@ function defineIconMorph(tag = 'usa-icon-morph') {
|
|
|
5934
5970
|
next() {
|
|
5935
5971
|
this.show(this._i + 1);
|
|
5936
5972
|
}
|
|
5937
|
-
}, { id: 'icon-morph', text: css$
|
|
5973
|
+
}, { id: 'icon-morph', text: css$s });
|
|
5938
5974
|
}
|
|
5939
5975
|
|
|
5940
|
-
var css$
|
|
5976
|
+
var css$r = "";
|
|
5941
5977
|
|
|
5942
5978
|
const HEART = 'M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 5.3 3.2 1.7-2 3.2-3.2 5.3-3.2 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z';
|
|
5943
5979
|
function defineLike(tag = 'usa-like') {
|
|
@@ -6013,10 +6049,10 @@ function defineLike(tag = 'usa-like') {
|
|
|
6013
6049
|
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
6014
6050
|
this.emit('change', { liked: next, count: this.count });
|
|
6015
6051
|
}
|
|
6016
|
-
}, { id: 'like', text: css$
|
|
6052
|
+
}, { id: 'like', text: css$r });
|
|
6017
6053
|
}
|
|
6018
6054
|
|
|
6019
|
-
var css$
|
|
6055
|
+
var css$q = "";
|
|
6020
6056
|
|
|
6021
6057
|
function defineHold(tag = 'usa-hold') {
|
|
6022
6058
|
return defineElement(tag, (Base) => class UsaHold extends Base {
|
|
@@ -6127,10 +6163,10 @@ function defineHold(tag = 'usa-hold') {
|
|
|
6127
6163
|
cancel() {
|
|
6128
6164
|
this.stop();
|
|
6129
6165
|
}
|
|
6130
|
-
}, { id: 'hold', text: css$
|
|
6166
|
+
}, { id: 'hold', text: css$q });
|
|
6131
6167
|
}
|
|
6132
6168
|
|
|
6133
|
-
var css$
|
|
6169
|
+
var css$p = "";
|
|
6134
6170
|
|
|
6135
6171
|
function defineDoubleTap(tag = 'usa-double-tap') {
|
|
6136
6172
|
return defineElement(tag, (Base) => class UsaDoubleTap extends Base {
|
|
@@ -6188,10 +6224,10 @@ function defineDoubleTap(tag = 'usa-double-tap') {
|
|
|
6188
6224
|
haptic(15);
|
|
6189
6225
|
this.emit('double-tap', { x: x - r.left, y: y - r.top });
|
|
6190
6226
|
}
|
|
6191
|
-
}, { id: 'double-tap', text: css$
|
|
6227
|
+
}, { id: 'double-tap', text: css$p });
|
|
6192
6228
|
}
|
|
6193
6229
|
|
|
6194
|
-
var css$
|
|
6230
|
+
var css$o = "";
|
|
6195
6231
|
|
|
6196
6232
|
function defineCheckbox(tag = 'usa-checkbox') {
|
|
6197
6233
|
return defineElement(tag, (Base) => {
|
|
@@ -6263,7 +6299,7 @@ function defineCheckbox(tag = 'usa-checkbox') {
|
|
|
6263
6299
|
}
|
|
6264
6300
|
UsaCheckbox.formAssociated = true;
|
|
6265
6301
|
return UsaCheckbox;
|
|
6266
|
-
}, { id: 'checkbox', text: css$
|
|
6302
|
+
}, { id: 'checkbox', text: css$o });
|
|
6267
6303
|
}
|
|
6268
6304
|
|
|
6269
6305
|
/**
|
|
@@ -6318,7 +6354,7 @@ function place(floating, anchor, placement = 'top', gap = 8) {
|
|
|
6318
6354
|
let uid = 0;
|
|
6319
6355
|
const nextId = (prefix) => `${prefix}-${++uid}`;
|
|
6320
6356
|
|
|
6321
|
-
var css$
|
|
6357
|
+
var css$n = "";
|
|
6322
6358
|
|
|
6323
6359
|
function defineTabs(tag = 'usa-tabs') {
|
|
6324
6360
|
adoptVariants();
|
|
@@ -6421,10 +6457,10 @@ function defineTabs(tag = 'usa-tabs') {
|
|
|
6421
6457
|
this.motion(p, [{ opacity: 0, transform: `translateX(${i > prev ? 16 : -16}px)` }, { opacity: 1, transform: 'none' }], { duration: 280, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' });
|
|
6422
6458
|
this.emit('change', { index: i });
|
|
6423
6459
|
}
|
|
6424
|
-
}, { id: 'tabs', text: css$
|
|
6460
|
+
}, { id: 'tabs', text: css$n });
|
|
6425
6461
|
}
|
|
6426
6462
|
|
|
6427
|
-
var css$
|
|
6463
|
+
var css$m = "";
|
|
6428
6464
|
|
|
6429
6465
|
/** Shared machinery of `<usa-drawer>` and `<usa-bottom-sheet>`: backdrop, focus, Esc, drag-to-dismiss. */
|
|
6430
6466
|
function makePanel(Base, kind) {
|
|
@@ -6581,7 +6617,7 @@ function makePanel(Base, kind) {
|
|
|
6581
6617
|
}
|
|
6582
6618
|
function defineDrawer(tag = 'usa-drawer') {
|
|
6583
6619
|
adoptVariants();
|
|
6584
|
-
return defineElement(tag, (Base) => makePanel(Base, 'drawer'), { id: 'sheet', text: css$
|
|
6620
|
+
return defineElement(tag, (Base) => makePanel(Base, 'drawer'), { id: 'sheet', text: css$m });
|
|
6585
6621
|
}
|
|
6586
6622
|
function defineBottomSheet(tag = 'usa-bottom-sheet') {
|
|
6587
6623
|
adoptVariants();
|
|
@@ -6624,10 +6660,10 @@ function defineBottomSheet(tag = 'usa-bottom-sheet') {
|
|
|
6624
6660
|
super.render(v);
|
|
6625
6661
|
}
|
|
6626
6662
|
};
|
|
6627
|
-
}, { id: 'sheet', text: css$
|
|
6663
|
+
}, { id: 'sheet', text: css$m });
|
|
6628
6664
|
}
|
|
6629
6665
|
|
|
6630
|
-
var css$
|
|
6666
|
+
var css$l = "";
|
|
6631
6667
|
|
|
6632
6668
|
function definePullRefresh(tag = 'usa-pull-refresh') {
|
|
6633
6669
|
adoptVariants();
|
|
@@ -6726,10 +6762,10 @@ function definePullRefresh(tag = 'usa-pull-refresh') {
|
|
|
6726
6762
|
Promise.resolve(fn(ev)).then(done, done);
|
|
6727
6763
|
});
|
|
6728
6764
|
}
|
|
6729
|
-
}, { id: 'pull-refresh', text: css$
|
|
6765
|
+
}, { id: 'pull-refresh', text: css$l });
|
|
6730
6766
|
}
|
|
6731
6767
|
|
|
6732
|
-
var css$
|
|
6768
|
+
var css$k = "";
|
|
6733
6769
|
|
|
6734
6770
|
function defineFab(tag = 'usa-fab') {
|
|
6735
6771
|
adoptVariants();
|
|
@@ -6815,10 +6851,10 @@ function defineFab(tag = 'usa-fab') {
|
|
|
6815
6851
|
this.apply(true);
|
|
6816
6852
|
this.emit('toggle', { open: next });
|
|
6817
6853
|
}
|
|
6818
|
-
}, { id: 'fab', text: css$
|
|
6854
|
+
}, { id: 'fab', text: css$k });
|
|
6819
6855
|
}
|
|
6820
6856
|
|
|
6821
|
-
var css$
|
|
6857
|
+
var css$j = "";
|
|
6822
6858
|
|
|
6823
6859
|
function defineNavbar(tag = 'usa-navbar') {
|
|
6824
6860
|
adoptVariants();
|
|
@@ -6871,10 +6907,10 @@ function defineNavbar(tag = 'usa-navbar') {
|
|
|
6871
6907
|
this.removeAttribute('data-hidden');
|
|
6872
6908
|
this.emit('show');
|
|
6873
6909
|
}
|
|
6874
|
-
}, { id: 'navbar', text: css$
|
|
6910
|
+
}, { id: 'navbar', text: css$j });
|
|
6875
6911
|
}
|
|
6876
6912
|
|
|
6877
|
-
var css$
|
|
6913
|
+
var css$i = "";
|
|
6878
6914
|
|
|
6879
6915
|
function defineSlider(tag = 'usa-slider') {
|
|
6880
6916
|
adoptVariants();
|
|
@@ -6995,96 +7031,7 @@ function defineSlider(tag = 'usa-slider') {
|
|
|
6995
7031
|
}
|
|
6996
7032
|
UsaSlider.formAssociated = true;
|
|
6997
7033
|
return UsaSlider;
|
|
6998
|
-
}, { id: 'slider', text: css$
|
|
6999
|
-
}
|
|
7000
|
-
|
|
7001
|
-
var css$i = "";
|
|
7002
|
-
|
|
7003
|
-
function defineRating(tag = 'usa-rating') {
|
|
7004
|
-
adoptVariants();
|
|
7005
|
-
return defineElement(tag, (Base) => {
|
|
7006
|
-
class UsaRating extends Base {
|
|
7007
|
-
static get observedAttributes() {
|
|
7008
|
-
return ['max', 'icon', 'readonly'];
|
|
7009
|
-
}
|
|
7010
|
-
constructor() {
|
|
7011
|
-
super();
|
|
7012
|
-
this._internals = null;
|
|
7013
|
-
try {
|
|
7014
|
-
this._internals = this.attachInternals?.() ?? null;
|
|
7015
|
-
}
|
|
7016
|
-
catch {
|
|
7017
|
-
this._internals = null;
|
|
7018
|
-
}
|
|
7019
|
-
}
|
|
7020
|
-
get value() {
|
|
7021
|
-
return clamp(this.num('value', 0), 0, this.num('max', 5));
|
|
7022
|
-
}
|
|
7023
|
-
set value(v) {
|
|
7024
|
-
this.setAttribute('value', String(clamp(Math.round(v), 0, this.num('max', 5))));
|
|
7025
|
-
this.sync();
|
|
7026
|
-
}
|
|
7027
|
-
mount() {
|
|
7028
|
-
deprecate('usa-rating', '<usa-rating> is deprecated and removed in 8.0 — use <usa-star-rating> (same value / max / readonly / label / name; icon="heart"). Run `npx usa-codemod-8 --write src`.');
|
|
7029
|
-
const max = this.num('max', 5);
|
|
7030
|
-
this.innerHTML = Array.from({ length: max }, (_, i) => `<span class="usa-rating-star" data-i="${i + 1}" aria-hidden="true">${this.str('icon', '★')}</span>`).join('');
|
|
7031
|
-
this.setAttribute('role', 'slider');
|
|
7032
|
-
this.setAttribute('aria-valuemin', '0');
|
|
7033
|
-
this.setAttribute('aria-valuemax', String(max));
|
|
7034
|
-
this.setAttribute('aria-label', this.str('label', 'Rating'));
|
|
7035
|
-
if (this.flag('readonly'))
|
|
7036
|
-
this.setAttribute('aria-readonly', 'true');
|
|
7037
|
-
else if (!this.hasAttribute('tabindex'))
|
|
7038
|
-
this.tabIndex = 0;
|
|
7039
|
-
this.sync();
|
|
7040
|
-
if (this.flag('readonly'))
|
|
7041
|
-
return;
|
|
7042
|
-
this.listen(this, 'pointerover', (e) => {
|
|
7043
|
-
const s = e.target.closest?.('[data-i]');
|
|
7044
|
-
if (s)
|
|
7045
|
-
this.preview(Number(s.dataset.i));
|
|
7046
|
-
});
|
|
7047
|
-
this.listen(this, 'pointerleave', () => this.preview(0));
|
|
7048
|
-
this.listen(this, 'click', (e) => {
|
|
7049
|
-
const s = e.target.closest?.('[data-i]');
|
|
7050
|
-
if (s)
|
|
7051
|
-
this.choose(Number(s.dataset.i) === this.value ? 0 : Number(s.dataset.i));
|
|
7052
|
-
});
|
|
7053
|
-
this.listen(this, 'keydown', (e) => {
|
|
7054
|
-
const v = this.value;
|
|
7055
|
-
const map = { ArrowRight: v + 1, ArrowUp: v + 1, ArrowLeft: v - 1, ArrowDown: v - 1, Home: 0, End: max };
|
|
7056
|
-
const n = /^[0-9]$/.test(e.key) ? Number(e.key) : map[e.key];
|
|
7057
|
-
if (n === undefined)
|
|
7058
|
-
return;
|
|
7059
|
-
e.preventDefault();
|
|
7060
|
-
this.choose(clamp(n, 0, max));
|
|
7061
|
-
});
|
|
7062
|
-
}
|
|
7063
|
-
preview(n) {
|
|
7064
|
-
this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-preview', n > 0 && Number(s.dataset.i) <= n));
|
|
7065
|
-
this.toggleAttribute('data-previewing', n > 0);
|
|
7066
|
-
}
|
|
7067
|
-
sync() {
|
|
7068
|
-
const v = this.value;
|
|
7069
|
-
this.setAttribute('aria-valuenow', String(v));
|
|
7070
|
-
this.setAttribute('aria-valuetext', `${v} of ${this.num('max', 5)}`);
|
|
7071
|
-
this._internals?.setFormValue?.(String(v));
|
|
7072
|
-
this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-on', Number(s.dataset.i) <= v));
|
|
7073
|
-
}
|
|
7074
|
-
choose(n) {
|
|
7075
|
-
if (n === this.value)
|
|
7076
|
-
return;
|
|
7077
|
-
this.value = n;
|
|
7078
|
-
const star = this.querySelector(`[data-i="${n}"]`);
|
|
7079
|
-
if (star && !this.reduced)
|
|
7080
|
-
this.motion(star, [{ transform: 'scale(0.5) rotate(-20deg)' }, { transform: 'scale(1) rotate(0)' }], springEasing('bouncy'));
|
|
7081
|
-
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
7082
|
-
this.emit('change', { value: n });
|
|
7083
|
-
}
|
|
7084
|
-
}
|
|
7085
|
-
UsaRating.formAssociated = true;
|
|
7086
|
-
return UsaRating;
|
|
7087
|
-
}, { id: 'rating', text: css$i });
|
|
7034
|
+
}, { id: 'slider', text: css$i });
|
|
7088
7035
|
}
|
|
7089
7036
|
|
|
7090
7037
|
var css$h = "";
|
|
@@ -7237,7 +7184,7 @@ function defineAvatarStack(tag = 'usa-avatar-stack') {
|
|
|
7237
7184
|
/**
|
|
7238
7185
|
* motionary/components/ui — animated UI components + style variants (v2.6).
|
|
7239
7186
|
* `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
|
|
7240
|
-
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`,
|
|
7187
|
+
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`,
|
|
7241
7188
|
* `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
|
|
7242
7189
|
* and `variant="minimal | neon | glass | brutalist | fluent | material"`
|
|
7243
7190
|
* design tokens (`setVariant()`, `VARIANTS`).
|
|
@@ -7251,7 +7198,6 @@ function defineUiComponents() {
|
|
|
7251
7198
|
defineFab();
|
|
7252
7199
|
defineNavbar();
|
|
7253
7200
|
defineSlider();
|
|
7254
|
-
defineRating();
|
|
7255
7201
|
definePopover();
|
|
7256
7202
|
defineBadge();
|
|
7257
7203
|
defineAvatarStack();
|
|
@@ -10815,7 +10761,6 @@ exports.definePostFx = definePostFx;
|
|
|
10815
10761
|
exports.definePress = definePress;
|
|
10816
10762
|
exports.defineProgress = defineProgress;
|
|
10817
10763
|
exports.definePullRefresh = definePullRefresh;
|
|
10818
|
-
exports.defineRating = defineRating;
|
|
10819
10764
|
exports.defineReveal = defineReveal;
|
|
10820
10765
|
exports.defineRevealComponents = defineRevealComponents;
|
|
10821
10766
|
exports.defineRipple = defineRipple;
|