use-scroll-animate 7.8.0 → 8.0.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 +34 -0
- package/README.md +1 -1
- package/README_ja.md +1 -1
- package/README_zh.md +1 -1
- package/bin/usa-codemod-8.mjs +74 -0
- 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 -14
- package/dist/components/angular.d.ts +2 -14
- 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-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 +4 -4
- package/dist/components/fx2.js +5 -5
- 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 -205
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +152 -205
- 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 -14
- package/dist/components/solid.d.ts +2 -14
- package/dist/components/solid.js +9 -9
- package/dist/components/svelte.cjs +9 -9
- package/dist/components/svelte.d.cts +2 -14
- package/dist/components/svelte.d.ts +2 -14
- 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 -107
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.css +0 -1
- package/dist/components/ui.d.cts +3 -16
- package/dist/components/ui.d.ts +3 -16
- package/dist/components/ui.js +19 -108
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +9 -9
- package/dist/components/vue.d.cts +2 -14
- package/dist/components/vue.d.ts +2 -14
- 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 +585 -145
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +136 -3
- package/dist/components/widgets.d.ts +136 -3
- package/dist/components/widgets.js +579 -146
- 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 -17
- package/dist/components.d.ts +4 -17
- 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 +4 -0
- package/docs/upgrading-8.md +37 -0
- package/package.json +23 -2
- 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
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('../chunks/base-
|
|
4
|
-
var spring = require('../chunks/spring-
|
|
5
|
-
var player = require('../chunks/player-
|
|
6
|
-
var registry = require('../chunks/registry-
|
|
7
|
-
require('../chunks/builtins-
|
|
3
|
+
var base = require('../chunks/base-DoRUZBy-.cjs');
|
|
4
|
+
var spring = require('../chunks/spring-uQMVJTj9.cjs');
|
|
5
|
+
var player = require('../chunks/player-C2n17sdH.cjs');
|
|
6
|
+
var registry = require('../chunks/registry-BVklOepd.cjs');
|
|
7
|
+
require('../chunks/builtins-ClXshqj-.cjs');
|
|
8
8
|
var components_fxShop = require('./fx-shop.cjs');
|
|
9
|
-
require('
|
|
9
|
+
var components_engine = require('./engine.cjs');
|
|
10
|
+
require('../chunks/core-CwO835Wm.cjs');
|
|
10
11
|
require('./tokens.cjs');
|
|
11
|
-
require('../chunks/fx-
|
|
12
|
+
require('../chunks/fx-C-XjLOTc.cjs');
|
|
12
13
|
|
|
13
14
|
/** Helpers shared by the 6.x widgets (`motionary/components/widgets`). */
|
|
14
15
|
const clampN = (v, a, b) => Math.min(b, Math.max(a, v));
|
|
@@ -27,9 +28,9 @@ function part(tag, cls, attrs = {}, html = '') {
|
|
|
27
28
|
}
|
|
28
29
|
/** Remove the parts a previous mount created. */
|
|
29
30
|
const dropParts = (el) => el.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
30
|
-
let uid$
|
|
31
|
+
let uid$2 = 0;
|
|
31
32
|
/** A document-unique id with a prefix. */
|
|
32
|
-
const nextId = (p) => `${p}-${++uid$
|
|
33
|
+
const nextId = (p) => `${p}-${++uid$2}`;
|
|
33
34
|
/** Roving arrow-key focus over `items` (horizontal or vertical); returns the new index or -1. */
|
|
34
35
|
function arrowIndex(e, i, n, vertical = false) {
|
|
35
36
|
const prev = vertical ? 'ArrowUp' : 'ArrowLeft';
|
|
@@ -45,7 +46,7 @@ function arrowIndex(e, i, n, vertical = false) {
|
|
|
45
46
|
return -1;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
var css$
|
|
49
|
+
var css$Z = "usa-carousel{display:block;position:relative;--usa-carousel-dur:520ms;--usa-carousel-ease:cubic-bezier(.22,1,.36,1);overflow:hidden;border-radius:var(--usa-radius,14px);touch-action:pan-y}.usa-carousel-viewport{position:relative;overflow:hidden;height:100%;min-height:inherit}.usa-carousel-track{display:flex;height:100%;transition:transform var(--usa-carousel-dur) var(--usa-carousel-ease);will-change:transform}.usa-carousel-track>*{flex:0 0 100%;min-width:0;box-sizing:border-box}usa-carousel:not([data-effect=\"slide\"]) .usa-carousel-track{display:grid}usa-carousel:not([data-effect=\"slide\"]) .usa-carousel-track>*{grid-area:1/1;transition:opacity var(--usa-carousel-dur) ease,transform var(--usa-carousel-dur) var(--usa-carousel-ease),filter var(--usa-carousel-dur) ease}usa-carousel[data-effect=\"cards\"] .usa-carousel-viewport{perspective:900px}usa-carousel[data-dragging] .usa-carousel-track,usa-carousel[data-dragging] .usa-carousel-track>*{transition:none}.usa-carousel-nav{position:absolute;top:50%;translate:0 -50%;z-index:2;width:36px;height:36px;border-radius:50%;border:0;background:rgba(255,255,255,.85);color:#111;font:600 18px/1 system-ui;cursor:pointer;display:grid;place-items:center;box-shadow:0 4px 14px rgba(0,0,0,.18);transition:transform .2s}.usa-carousel-nav:hover{transform:scale(1.08)}.usa-carousel-nav:focus-visible{outline:2px solid #7c5cff;outline-offset:2px}.usa-carousel-prev{left:10px}.usa-carousel-next{right:10px}.usa-carousel-dots{position:absolute;left:0;right:0;bottom:10px;display:flex;justify-content:center;gap:6px;z-index:2}.usa-carousel-dot{width:8px;height:8px;padding:0;border:0;border-radius:99px;background:rgba(255,255,255,.55);cursor:pointer;transition:width .35s var(--usa-carousel-ease),background .35s}.usa-carousel-dot[aria-current=\"true\"]{width:22px;background:#fff}@media (prefers-reduced-motion:reduce){usa-carousel .usa-carousel-track,usa-carousel .usa-carousel-track>*,.usa-carousel-dot{transition:none!important}}usa-carousel[data-reduced] .usa-carousel-track,usa-carousel[data-reduced] .usa-carousel-track>*{transition:none!important}";
|
|
49
50
|
|
|
50
51
|
const CAROUSEL_EFFECTS = ['slide', 'fade', 'scale', 'cards'];
|
|
51
52
|
function defineCarousel(tag = 'usa-carousel') {
|
|
@@ -234,10 +235,10 @@ function defineCarousel(tag = 'usa-carousel') {
|
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
return UsaCarousel;
|
|
237
|
-
}, { id: 'carousel', text: css$
|
|
238
|
+
}, { id: 'carousel', text: css$Z });
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
var css$
|
|
241
|
+
var css$Y = "usa-tab-bar{display:block;--usa-tab-accent:#7c5cff;--usa-tab-ease:cubic-bezier(.22,1,.36,1)}.usa-tab-bar-list{position:relative;display:flex;gap:4px;padding:4px;border-radius:12px;background:rgba(127,127,127,.12);isolation:isolate;overflow-x:auto;scrollbar-width:none}.usa-tab-bar-list::-webkit-scrollbar{display:none}.usa-tab-bar-list>[role=\"tab\"]{position:relative;z-index:1;flex:1 0 auto;border:0;background:none;color:inherit;font:inherit;font-weight:600;padding:8px 14px;border-radius:9px;cursor:pointer;opacity:.7;transition:opacity .25s,color .25s;white-space:nowrap}.usa-tab-bar-list>[role=\"tab\"][aria-selected=\"true\"]{opacity:1}.usa-tab-bar-list>[role=\"tab\"]:focus-visible{outline:2px solid var(--usa-tab-accent);outline-offset:1px}.usa-tab-bar-ink{position:absolute;z-index:0;left:0;top:4px;bottom:4px;width:0;border-radius:9px;background:var(--usa-tab-accent);pointer-events:none}usa-tab-bar[data-indicator=\"pill\"] [aria-selected=\"true\"]{color:#fff}usa-tab-bar[data-indicator=\"underline\"] .usa-tab-bar-list{background:none;border-bottom:1px solid rgba(127,127,127,.25);border-radius:0}usa-tab-bar[data-indicator=\"underline\"] .usa-tab-bar-ink{top:auto;bottom:0;height:3px;border-radius:3px}usa-tab-bar[data-indicator=\"glow\"] .usa-tab-bar-ink{background:transparent;box-shadow:0 0 0 2px var(--usa-tab-accent),0 0 18px var(--usa-tab-accent)}usa-tab-bar[data-indicator=\"gooey\"] .usa-tab-bar-ink{filter:blur(.5px);border-radius:999px}usa-tab-bar[data-indicator=\"gooey\"] [aria-selected=\"true\"]{color:#fff}.usa-tab-bar-panel{padding:14px 2px}.usa-tab-bar-panel[hidden]{display:none}";
|
|
241
242
|
|
|
242
243
|
const TAB_INDICATORS = ['pill', 'underline', 'glow', 'gooey'];
|
|
243
244
|
function defineTabBar(tag = 'usa-tab-bar') {
|
|
@@ -350,10 +351,10 @@ function defineTabBar(tag = 'usa-tab-bar') {
|
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
353
|
return UsaTabBar;
|
|
353
|
-
}, { id: 'tab-bar', text: css$
|
|
354
|
+
}, { id: 'tab-bar', text: css$Y });
|
|
354
355
|
}
|
|
355
356
|
|
|
356
|
-
var css$
|
|
357
|
+
var css$X = "usa-disclosure{display:block;--usa-disclosure-accent:#7c5cff}usa-disclosure>details{border-bottom:1px solid rgba(127,127,127,.25);overflow:hidden}usa-disclosure>details>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px;font-weight:600}usa-disclosure>details>summary::-webkit-details-marker{display:none}usa-disclosure>details>summary::after{content:\"\";flex:none;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;rotate:45deg;translate:0 -3px;transition:rotate .35s cubic-bezier(.34,1.56,.64,1),translate .35s}usa-disclosure>details[open]>summary::after{rotate:225deg;translate:0 2px}usa-disclosure>details>summary:focus-visible{outline:2px solid var(--usa-disclosure-accent);outline-offset:2px;border-radius:6px}usa-disclosure>details>:not(summary){padding:0 4px 12px}usa-disclosure[variant=\"cards\"]>details{border:1px solid rgba(127,127,127,.25);border-radius:12px;margin-bottom:8px;padding:0 10px;transition:box-shadow .3s,border-color .3s}usa-disclosure[variant=\"cards\"]>details[open]{border-color:var(--usa-disclosure-accent);box-shadow:0 8px 24px rgba(124,92,255,.16)}@media (prefers-reduced-motion:reduce){usa-disclosure>details>summary::after{transition:none}}";
|
|
357
358
|
|
|
358
359
|
function defineDisclosure(tag = 'usa-disclosure') {
|
|
359
360
|
return base.defineElement(tag, (Base) => {
|
|
@@ -421,10 +422,10 @@ function defineDisclosure(tag = 'usa-disclosure') {
|
|
|
421
422
|
}
|
|
422
423
|
}
|
|
423
424
|
return UsaDisclosure;
|
|
424
|
-
}, { id: 'disclosure', text: css$
|
|
425
|
+
}, { id: 'disclosure', text: css$X });
|
|
425
426
|
}
|
|
426
427
|
|
|
427
|
-
var css$
|
|
428
|
+
var css$W = "usa-stories{display:block;position:relative;overflow:hidden;border-radius:var(--usa-radius,16px);background:#111;color:#fff;aspect-ratio:9/14;max-height:520px;user-select:none;-webkit-user-select:none;touch-action:manipulation}usa-stories>:not([data-usa-part]){position:absolute;inset:0;opacity:0;transition:opacity .35s ease,transform .5s cubic-bezier(.22,1,.36,1);transform:scale(1.04);pointer-events:none;box-sizing:border-box}usa-stories>[data-active]:not([data-usa-part]){opacity:1;transform:none;pointer-events:auto}usa-stories>img:not([data-usa-part]){width:100%;height:100%;object-fit:cover}.usa-stories-bars{position:absolute;z-index:3;top:8px;left:8px;right:48px;display:flex;gap:4px}.usa-stories-bar{flex:1;height:3px;border-radius:3px;background:rgba(255,255,255,.35);overflow:hidden}.usa-stories-bar>i{display:block;height:100%;width:100%;background:#fff;transform-origin:left;transform:scaleX(0)}.usa-stories-bar[data-done]>i{transform:scaleX(1)}.usa-stories-toggle{position:absolute;z-index:3;top:2px;right:6px;width:36px;height:30px;border:0;background:none;color:#fff;font:700 14px/1 system-ui;cursor:pointer;border-radius:8px}.usa-stories-toggle:focus-visible{outline:2px solid #fff}@media (prefers-reduced-motion:reduce){usa-stories>*{transition:none!important;transform:none!important}}";
|
|
428
429
|
|
|
429
430
|
function defineStories(tag = 'usa-stories') {
|
|
430
431
|
return base.defineElement(tag, (Base) => {
|
|
@@ -557,10 +558,10 @@ function defineStories(tag = 'usa-stories') {
|
|
|
557
558
|
}
|
|
558
559
|
}
|
|
559
560
|
return UsaStories;
|
|
560
|
-
}, { id: 'stories', text: css$
|
|
561
|
+
}, { id: 'stories', text: css$W });
|
|
561
562
|
}
|
|
562
563
|
|
|
563
|
-
var css$
|
|
564
|
+
var css$V = "usa-modal,usa-sheet{display:contents}.usa-ov{border:0;padding:0;margin:auto;color:inherit;background:transparent;max-width:min(92vw,520px);max-height:88vh;overflow:visible}.usa-ov::backdrop{background:rgba(10,12,20,.45);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.usa-ov-body{box-sizing:border-box;background:var(--usa-ov-bg,#fff);color:var(--usa-ov-fg,#111827);border-radius:var(--usa-ov-radius,18px);padding:var(--usa-ov-pad,22px);box-shadow:0 30px 80px -20px rgba(0,0,0,.45);max-height:88vh;overflow:auto}.usa-sheet-panel{margin:0;max-width:none;max-height:none}usa-sheet[data-side=\"right\"] .usa-sheet-panel{inset:0 0 0 auto;height:100%;width:min(88vw,var(--usa-sheet-size,380px))}usa-sheet[data-side=\"left\"] .usa-sheet-panel{inset:0 auto 0 0;height:100%;width:min(88vw,var(--usa-sheet-size,380px))}usa-sheet[data-side=\"bottom\"] .usa-sheet-panel{inset:auto 0 0 0;width:100%;max-height:85vh}usa-sheet[data-side=\"top\"] .usa-sheet-panel{inset:0 0 auto 0;width:100%;max-height:85vh}usa-sheet .usa-ov-body{height:100%;max-height:inherit;border-radius:0}usa-sheet[data-side=\"bottom\"] .usa-ov-body{border-radius:var(--usa-ov-radius,18px) var(--usa-ov-radius,18px) 0 0;height:auto;max-height:85vh;touch-action:none}usa-sheet[data-side=\"top\"] .usa-ov-body{border-radius:0 0 var(--usa-ov-radius,18px) var(--usa-ov-radius,18px);height:auto}.usa-ov-grab{width:44px;height:5px;border-radius:3px;background:rgba(127,127,127,.45);margin:-8px auto 14px;cursor:grab}@media (prefers-color-scheme:dark){.usa-ov-body{background:var(--usa-ov-bg,#171a23);color:var(--usa-ov-fg,#e5e7eb)}}";
|
|
564
565
|
|
|
565
566
|
const MODAL_EFFECTS = ['scale', 'slide-up', 'flip', 'origin'];
|
|
566
567
|
const SHEET_SIDES = ['right', 'left', 'bottom', 'top'];
|
|
@@ -787,12 +788,12 @@ function defineOverlay(tag, kind) {
|
|
|
787
788
|
}
|
|
788
789
|
}
|
|
789
790
|
return UsaOverlay;
|
|
790
|
-
}, { id: 'overlay', text: css$
|
|
791
|
+
}, { id: 'overlay', text: css$V });
|
|
791
792
|
}
|
|
792
793
|
const defineModal = (tag = 'usa-modal') => defineOverlay(tag, 'modal');
|
|
793
794
|
const defineSheet = (tag = 'usa-sheet') => defineOverlay(tag, 'sheet');
|
|
794
795
|
|
|
795
|
-
var css$
|
|
796
|
+
var css$U = "usa-toast-stack{position:fixed;z-index:2147482000;width:min(360px,calc(100vw - 24px));pointer-events:none;--usa-tstack-bg:#111827;--usa-tstack-fg:#f9fafb}usa-toast-stack[contained]{position:absolute;width:min(360px,calc(100% - 24px))}usa-toast-stack[data-position^=\"bottom\"]{bottom:12px}usa-toast-stack[data-position^=\"top\"]{top:12px}usa-toast-stack[data-position$=\"right\"]{right:12px}usa-toast-stack[data-position$=\"left\"]{left:12px}usa-toast-stack[data-position$=\"center\"]{left:50%;transform:translateX(-50%)}.usa-tstack-list{position:relative;list-style:none;margin:0;padding:0;min-height:1px;transition:height .3s}.usa-tstack{position:absolute;left:0;right:0;display:flex;align-items:center;gap:10px;box-sizing:border-box;padding:12px 12px 12px 14px;border-radius:14px;background:var(--usa-tstack-bg);color:var(--usa-tstack-fg);box-shadow:0 12px 32px -10px rgba(0,0,0,.45);font:500 14px/1.35 system-ui,sans-serif;pointer-events:auto;touch-action:pan-y;transition:transform .38s cubic-bezier(.22,1,.36,1),opacity .3s;user-select:none}usa-toast-stack[data-position^=\"bottom\"] .usa-tstack{bottom:0;transform-origin:50% 100%}usa-toast-stack[data-position^=\"top\"] .usa-tstack{top:0;transform-origin:50% 0}.usa-tstack-icon{flex:none;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;font-size:13px;font-weight:800;background:#3b82f6;color:#fff}.usa-tstack-success .usa-tstack-icon{background:#22c55e}.usa-tstack-warning .usa-tstack-icon{background:#f59e0b}.usa-tstack-error .usa-tstack-icon{background:#ef4444}.usa-tstack-text{flex:1;min-width:0;display:flex;flex-direction:column}.usa-tstack-text strong{font-weight:700}.usa-tstack-action{border:0;border-radius:8px;padding:6px 10px;background:rgba(255,255,255,.14);color:inherit;font:600 13px system-ui,sans-serif;cursor:pointer}.usa-tstack-close{border:0;background:none;color:inherit;opacity:.6;font-size:18px;line-height:1;cursor:pointer;padding:2px 4px}.usa-tstack-close:hover{opacity:1}@media (prefers-reduced-motion:reduce){.usa-tstack,.usa-tstack-list{transition:none}}";
|
|
796
797
|
|
|
797
798
|
const TOAST_POSITIONS = ['bottom-right', 'bottom-left', 'bottom-center', 'top-right', 'top-left', 'top-center'];
|
|
798
799
|
const ICONS = { info: 'ℹ', success: '✓', warning: '!', error: '✕' };
|
|
@@ -963,7 +964,7 @@ function defineToastStack(tag = 'usa-toast-stack') {
|
|
|
963
964
|
}
|
|
964
965
|
}
|
|
965
966
|
return UsaToastStack;
|
|
966
|
-
}, { id: 'toast', text: css$
|
|
967
|
+
}, { id: 'toast', text: css$U });
|
|
967
968
|
}
|
|
968
969
|
/** Show a toast on the first `<usa-toast-stack>` of the page (one is created when missing). */
|
|
969
970
|
function stackToast(input, stack) {
|
|
@@ -991,7 +992,7 @@ function installToastTriggers() {
|
|
|
991
992
|
});
|
|
992
993
|
}
|
|
993
994
|
|
|
994
|
-
var css$
|
|
995
|
+
var css$T = "usa-menu{position:relative;display:inline-block}.usa-menu-list{position:absolute;z-index:50;min-width:180px;max-width:min(280px,90vw);box-sizing:border-box;padding:6px;border-radius:12px;background:var(--usa-menu-bg,#fff);color:var(--usa-menu-fg,#111827);box-shadow:0 18px 44px -12px rgba(0,0,0,.35),0 0 0 1px rgba(127,127,127,.15);display:flex;flex-direction:column;gap:2px;text-align:left}.usa-menu-list[hidden]{display:none}usa-menu[data-placement^=\"bottom\"] .usa-menu-list{top:calc(100% + 6px)}usa-menu[data-placement^=\"top\"] .usa-menu-list{bottom:calc(100% + 6px)}usa-menu[data-placement$=\"start\"] .usa-menu-list{left:0;transform-origin:0 0}usa-menu[data-placement$=\"end\"] .usa-menu-list{right:0;transform-origin:100% 0}usa-menu[data-placement=\"top-start\"] .usa-menu-list{transform-origin:0 100%}usa-menu[data-placement=\"top-end\"] .usa-menu-list{transform-origin:100% 100%}.usa-menu-list>[role=\"menuitem\"]{display:flex;align-items:center;gap:8px;width:100%;box-sizing:border-box;border:0;background:none;color:inherit;font:500 14px/1.3 system-ui,sans-serif;text-align:left;text-decoration:none;padding:8px 10px;border-radius:8px;cursor:pointer}.usa-menu-list>[role=\"menuitem\"]:hover,.usa-menu-list>[role=\"menuitem\"]:focus-visible{background:var(--usa-menu-hover,rgba(124,92,255,.14));outline:none}.usa-menu-list>hr{border:0;border-top:1px solid rgba(127,127,127,.2);margin:4px 2px}@media (prefers-color-scheme:dark){.usa-menu-list{background:var(--usa-menu-bg,#1d2130);color:var(--usa-menu-fg,#e5e7eb)}}";
|
|
995
996
|
|
|
996
997
|
const MENU_EFFECTS = ['scale', 'fold', 'slide'];
|
|
997
998
|
function defineMenu(tag = 'usa-menu') {
|
|
@@ -1130,10 +1131,10 @@ function defineMenu(tag = 'usa-menu') {
|
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
1132
1133
|
return UsaMenu;
|
|
1133
|
-
}, { id: 'menu', text: css$
|
|
1134
|
+
}, { id: 'menu', text: css$T });
|
|
1134
1135
|
}
|
|
1135
1136
|
|
|
1136
|
-
var css$
|
|
1137
|
+
var css$S = "usa-progress-ring{position:relative;display:inline-block;vertical-align:middle;width:var(--usa-pr-size,120px);aspect-ratio:1;--usa-pr-color:#7c5cff;--usa-pr-track:rgba(127,127,127,.18);--usa-pr-width:9;font:700 calc(var(--usa-pr-size,120px)*.2)/1 system-ui,sans-serif;font-variant-numeric:tabular-nums}usa-progress-ring[data-variant=\"semi\"]{aspect-ratio:100/56}.usa-pr-label{position:absolute;inset:0;display:grid;place-items:center}usa-progress-ring[data-variant=\"semi\"] .usa-pr-label{place-items:end center}usa-progress-ring[data-variant=\"bar\"]{display:inline-flex;width:var(--usa-pr-size,100%);aspect-ratio:auto;gap:10px;align-items:center;font-size:14px}usa-progress-ring[data-variant=\"bar\"]>.usa-pr-track{flex:1 1 auto;min-width:40px}usa-progress-ring[data-variant=\"bar\"] .usa-pr-label{position:static;display:inline}usa-progress-ring .usa-pr-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.usa-pr-svg path{fill:none;stroke-width:var(--usa-pr-width);stroke-linecap:round}.usa-pr-svg .usa-pr-track{stroke:var(--usa-pr-track)}.usa-pr-svg .usa-pr-arc{stroke:var(--usa-pr-color)}usa-progress-ring[data-variant=\"semi\"] .usa-pr-label{padding-bottom:2%}.usa-pr-track:is(div){height:10px;border-radius:999px;background:var(--usa-pr-track);overflow:hidden}.usa-pr-fill{height:100%;border-radius:inherit;background:var(--usa-pr-color);transform-origin:0 50%;transform:scaleX(0)}usa-progress-ring[data-indeterminate] .usa-pr-svg{animation:usa-pr-spin 1.1s linear infinite}usa-progress-ring[data-indeterminate] .usa-pr-fill{width:35%;transform:none!important;animation:usa-pr-slide 1.3s ease-in-out infinite}@keyframes usa-pr-spin{to{transform:rotate(360deg)}}@keyframes usa-pr-slide{from{margin-left:-35%}to{margin-left:100%}}usa-odometer{display:inline-flex;align-items:flex-end;font-variant-numeric:tabular-nums;line-height:1.15}.usa-odo-row{display:inline-flex;align-items:flex-end}.usa-odo-col{display:inline-block;height:1.15em;overflow:hidden;-webkit-mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent);mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent)}.usa-odo-strip{display:block;white-space:pre;line-height:1.15em;text-align:center}.usa-odo-sym{display:inline-block;height:1.15em}@media (prefers-reduced-motion:reduce){usa-progress-ring[data-indeterminate] .usa-pr-svg,usa-progress-ring[data-indeterminate] .usa-pr-fill{animation-duration:4s}}";
|
|
1137
1138
|
|
|
1138
1139
|
const PROGRESS_VARIANTS = ['ring', 'bar', 'semi'];
|
|
1139
1140
|
const NS = 'http://www.w3.org/2000/svg';
|
|
@@ -1273,7 +1274,7 @@ function defineProgressRing(tag = 'usa-progress-ring') {
|
|
|
1273
1274
|
}
|
|
1274
1275
|
}
|
|
1275
1276
|
return UsaProgressRing;
|
|
1276
|
-
}, { id: 'meters', text: css$
|
|
1277
|
+
}, { id: 'meters', text: css$S });
|
|
1277
1278
|
}
|
|
1278
1279
|
function defineOdometer(tag = 'usa-odometer') {
|
|
1279
1280
|
return base.defineElement(tag, (Base) => {
|
|
@@ -1383,10 +1384,10 @@ function defineOdometer(tag = 'usa-odometer') {
|
|
|
1383
1384
|
}
|
|
1384
1385
|
}
|
|
1385
1386
|
return UsaOdometer;
|
|
1386
|
-
}, { id: 'meters', text: css$
|
|
1387
|
+
}, { id: 'meters', text: css$S });
|
|
1387
1388
|
}
|
|
1388
1389
|
|
|
1389
|
-
var css$
|
|
1390
|
+
var css$R = "usa-skeleton-reveal{position:relative;display:block;--usa-sk-base:rgba(127,127,127,.16);--usa-sk-hi:rgba(255,255,255,.55)}usa-skeleton-reveal[data-loading]>:not(.usa-sk-layer){visibility:hidden}.usa-sk-layer{position:absolute;inset:0;pointer-events:none}.usa-sk-box{position:absolute;border-radius:6px;background:var(--usa-sk-base);overflow:hidden}usa-skeleton-reveal[data-variant=\"wave\"] .usa-sk-box{background:linear-gradient(100deg,var(--usa-sk-base) 30%,var(--usa-sk-hi) 50%,var(--usa-sk-base) 70%) var(--usa-sk-x,0) 0/var(--usa-sk-w,600px) 100% no-repeat,var(--usa-sk-base);animation:usa-sk-wave 1.4s linear infinite}usa-skeleton-reveal[data-variant=\"pulse\"] .usa-sk-box{animation:usa-sk-pulse 1.2s ease-in-out infinite alternate}usa-skeleton-reveal[data-variant=\"glow\"] .usa-sk-box{animation:usa-sk-glow 1.6s ease-in-out infinite alternate}@keyframes usa-sk-wave{from{background-position:calc(var(--usa-sk-x,0px) - var(--usa-sk-w,600px)) 0,0 0}to{background-position:calc(var(--usa-sk-x,0px) + var(--usa-sk-w,600px)) 0,0 0}}@keyframes usa-sk-pulse{from{opacity:1}to{opacity:.45}}@keyframes usa-sk-glow{from{box-shadow:0 0 0 rgba(124,92,255,0)}to{box-shadow:0 0 14px rgba(124,92,255,.45);background:rgba(124,92,255,.22)}}@media (prefers-color-scheme:dark){usa-skeleton-reveal{--usa-sk-hi:rgba(255,255,255,.16)}}@media (prefers-reduced-motion:reduce){.usa-sk-box{animation:none!important}}";
|
|
1390
1391
|
|
|
1391
1392
|
const SKELETON_VARIANTS = ['wave', 'pulse', 'glow'];
|
|
1392
1393
|
function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
@@ -1501,25 +1502,34 @@ function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
|
1501
1502
|
}
|
|
1502
1503
|
}
|
|
1503
1504
|
return UsaSkeletonReveal;
|
|
1504
|
-
}, { id: 'skeleton-reveal', text: css$
|
|
1505
|
+
}, { id: 'skeleton-reveal', text: css$R });
|
|
1505
1506
|
}
|
|
1506
1507
|
|
|
1507
|
-
var css$
|
|
1508
|
+
var css$Q = "usa-star-rating{display:inline-flex;gap:var(--usa-star-gap,4px);--usa-star-size:28px;--usa-star-on:#fbbf24;--usa-star-off:rgba(127,127,127,.28);cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;border-radius:8px}usa-star-rating[readonly]{cursor:default}usa-star-rating:focus-visible{outline:2px solid var(--usa-star-on);outline-offset:4px}.usa-star{position:relative;display:inline-block;width:var(--usa-star-size);height:var(--usa-star-size);--usa-star-fill:0%}.usa-star svg{display:block;width:100%;height:100%;overflow:visible;stroke:none}.usa-star-bg{fill:var(--usa-star-off)}.usa-star-fg{position:absolute;left:0;top:0;bottom:0;width:var(--usa-star-fill);overflow:hidden;transition:width .18s ease-out}.usa-star-fg svg{width:var(--usa-star-size);height:var(--usa-star-size);fill:var(--usa-star-on);filter:drop-shadow(0 1px 3px rgba(251,191,36,.45))}usa-star-rating[data-preview] .usa-star-fg{opacity:.8}.usa-star-spark{position:absolute;left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var(--usa-star-on);pointer-events:none}@media (prefers-reduced-motion:reduce){.usa-star-fg{transition:none}}";
|
|
1508
1509
|
|
|
1509
1510
|
const PATHS = {
|
|
1510
1511
|
star: 'M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6L2.5 9.4l6.6-.8z',
|
|
1511
1512
|
heart: 'M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.9 4.5 6.6 4.5c2.1 0 3.6 1.2 5.4 3.1 1.8-1.9 3.3-3.1 5.4-3.1 3.7 0 5.7 3.9 4.2 7.3C19.5 16.4 12 21 12 21z',
|
|
1512
1513
|
};
|
|
1514
|
+
/** <usa-rating> icon characters accepted by `icon` (7.9). */
|
|
1515
|
+
const ICON_ALIASES = { '★': 'star', '☆': 'star', '♥': 'heart', '❤': 'heart', '❤️': 'heart' };
|
|
1513
1516
|
function defineStarRating(tag = 'usa-star-rating') {
|
|
1514
1517
|
return base.defineElement(tag, (Base) => {
|
|
1515
1518
|
class UsaStarRating extends Base {
|
|
1519
|
+
static get observedAttributes() {
|
|
1520
|
+
return ['max', 'icon', 'readonly', 'step'];
|
|
1521
|
+
}
|
|
1516
1522
|
constructor() {
|
|
1517
|
-
super(
|
|
1523
|
+
super();
|
|
1524
|
+
this._internals = null;
|
|
1518
1525
|
this._v = 0;
|
|
1519
1526
|
this._stars = [];
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1527
|
+
try {
|
|
1528
|
+
this._internals = this.attachInternals?.() ?? null;
|
|
1529
|
+
}
|
|
1530
|
+
catch {
|
|
1531
|
+
this._internals = null;
|
|
1532
|
+
}
|
|
1523
1533
|
}
|
|
1524
1534
|
get value() {
|
|
1525
1535
|
return this._v;
|
|
@@ -1535,7 +1545,7 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1535
1545
|
}
|
|
1536
1546
|
mount() {
|
|
1537
1547
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
1538
|
-
const icon = PATHS[this.str('icon', 'star')] || PATHS.star;
|
|
1548
|
+
const icon = PATHS[ICON_ALIASES[this.str('icon', 'star')] || this.str('icon', 'star')] || PATHS.star;
|
|
1539
1549
|
this._stars = [];
|
|
1540
1550
|
for (let i = 0; i < this.max; i++) {
|
|
1541
1551
|
const s = part('span', 'usa-star', { 'aria-hidden': 'true' }, `<svg viewBox="0 0 24 24" width="100%" height="100%"><path class="usa-star-bg" d="${icon}"/></svg><span class="usa-star-fg"><svg viewBox="0 0 24 24" width="24" height="24"><path d="${icon}"/></svg></span>`);
|
|
@@ -1592,6 +1602,7 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1592
1602
|
sync() {
|
|
1593
1603
|
this.setAttribute('aria-valuenow', String(this._v));
|
|
1594
1604
|
this.setAttribute('aria-valuetext', `${this._v} of ${this.max}`);
|
|
1605
|
+
this._internals?.setFormValue?.(String(this._v));
|
|
1595
1606
|
if (this.flag('readonly'))
|
|
1596
1607
|
this.setAttribute('aria-label', `${this.str('label', 'Rating')}: ${this._v} of ${this.max}`);
|
|
1597
1608
|
}
|
|
@@ -1623,15 +1634,18 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1623
1634
|
rm();
|
|
1624
1635
|
}
|
|
1625
1636
|
}
|
|
1626
|
-
if (changed)
|
|
1637
|
+
if (changed) {
|
|
1638
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
1627
1639
|
this.emit('change', { value: nv });
|
|
1640
|
+
}
|
|
1628
1641
|
}
|
|
1629
1642
|
}
|
|
1643
|
+
UsaStarRating.formAssociated = true;
|
|
1630
1644
|
return UsaStarRating;
|
|
1631
|
-
}, { id: 'star-rating', text: css$
|
|
1645
|
+
}, { id: 'star-rating', text: css$Q });
|
|
1632
1646
|
}
|
|
1633
1647
|
|
|
1634
|
-
var css$
|
|
1648
|
+
var css$P = "usa-milestones{position:relative;display:block;--usa-ms-color:#7c5cff;--usa-ms-rail:rgba(127,127,127,.22);--usa-ms-gap:28px;padding:4px 0}.usa-ms-rail{position:absolute;top:0;bottom:0;left:50%;width:3px;margin-left:-1.5px;border-radius:3px;background:var(--usa-ms-rail);overflow:hidden}.usa-ms-fill{position:absolute;inset:0;background:linear-gradient(var(--usa-ms-color),#22d3ee);transform-origin:50% 0;transform:scaleY(0)}.usa-ms-item{position:relative;box-sizing:border-box;width:50%;padding:0 var(--usa-ms-gap) var(--usa-ms-gap);text-align:left}.usa-ms-item[data-side=\"right\"]{margin-left:50%}.usa-ms-item[data-side=\"left\"]{text-align:right}.usa-ms-dot{position:absolute;top:4px;width:14px;height:14px;border-radius:50%;background:var(--usa-ms-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--usa-ms-color) 22%,transparent);transform:scale(0)}.usa-ms-item[data-reached] .usa-ms-dot{transform:none}.usa-ms-item[data-side=\"right\"] .usa-ms-dot{left:-7px}.usa-ms-item[data-side=\"left\"] .usa-ms-dot{right:-7px}.usa-ms-date{display:block;font-size:.8em;font-weight:700;letter-spacing:.04em;color:var(--usa-ms-color);margin-bottom:2px}.usa-ms-item:not([data-reached])>:not(.usa-ms-dot){opacity:0}usa-milestones[data-layout=\"left\"] .usa-ms-rail{left:7px}usa-milestones[data-layout=\"left\"] .usa-ms-item{width:auto;margin-left:0;padding-left:calc(var(--usa-ms-gap) + 8px);text-align:left}usa-milestones[data-layout=\"left\"] .usa-ms-dot{left:1px;right:auto}@media (max-width:640px){usa-milestones .usa-ms-rail{left:7px}usa-milestones .usa-ms-item{width:auto;margin-left:0;padding-left:calc(var(--usa-ms-gap) + 8px);text-align:left}usa-milestones .usa-ms-item .usa-ms-dot{left:1px;right:auto}}";
|
|
1635
1649
|
|
|
1636
1650
|
function defineMilestones(tag = 'usa-milestones') {
|
|
1637
1651
|
return base.defineElement(tag, (Base) => {
|
|
@@ -1719,10 +1733,10 @@ function defineMilestones(tag = 'usa-milestones') {
|
|
|
1719
1733
|
}
|
|
1720
1734
|
}
|
|
1721
1735
|
return UsaMilestones;
|
|
1722
|
-
}, { id: 'milestones', text: css$
|
|
1736
|
+
}, { id: 'milestones', text: css$P });
|
|
1723
1737
|
}
|
|
1724
1738
|
|
|
1725
|
-
var css$
|
|
1739
|
+
var css$O = "usa-masonry-flow{position:relative;display:block;width:100%}usa-masonry-flow>*{position:absolute;left:0;top:0;box-sizing:border-box;margin:0;will-change:transform}usa-masonry-flow>[data-hidden]:not([data-leaving]){display:none}usa-masonry-flow>[data-leaving]{pointer-events:none}";
|
|
1726
1740
|
|
|
1727
1741
|
function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
1728
1742
|
return base.defineElement(tag, (Base) => {
|
|
@@ -1843,10 +1857,10 @@ function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
|
1843
1857
|
}
|
|
1844
1858
|
}
|
|
1845
1859
|
return UsaMasonryFlow;
|
|
1846
|
-
}, { id: 'masonry-flow', text: css$
|
|
1860
|
+
}, { id: 'masonry-flow', text: css$O });
|
|
1847
1861
|
}
|
|
1848
1862
|
|
|
1849
|
-
var css$
|
|
1863
|
+
var css$N = "usa-compare{position:relative;display:grid;overflow:hidden;border-radius:var(--usa-cmp-radius,14px);user-select:none;touch-action:pan-y;cursor:ew-resize;--usa-cmp-line:#fff;outline-offset:3px}usa-compare[data-orientation=\"vertical\"]{touch-action:pan-x;cursor:ns-resize}usa-compare>.usa-cmp-before,usa-compare>.usa-cmp-after{grid-area:1/1;display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}.usa-cmp-handle{position:absolute;top:0;bottom:0;left:50%;width:0;z-index:2;pointer-events:none}.usa-cmp-handle::before{content:\"\";position:absolute;top:0;bottom:0;left:-1.5px;width:3px;background:var(--usa-cmp-line);box-shadow:0 0 8px rgba(0,0,0,.35)}usa-compare[data-orientation=\"vertical\"] .usa-cmp-handle{top:50%;bottom:auto;left:0;right:0;width:auto;height:0}usa-compare[data-orientation=\"vertical\"] .usa-cmp-handle::before{left:0;right:0;top:-1.5px;width:auto;height:3px}.usa-cmp-knob{position:absolute;top:50%;left:0;display:grid;place-items:center;width:40px;height:40px;margin:-20px 0 0 -20px;border-radius:50%;background:var(--usa-cmp-line);color:#111827;box-shadow:0 6px 18px rgba(0,0,0,.35);pointer-events:auto;cursor:grab;transition:transform .2s}usa-compare[data-orientation=\"vertical\"] .usa-cmp-knob{left:50%;top:0;transform:rotate(90deg)}usa-compare:active .usa-cmp-knob{transform:scale(.92)}usa-compare[data-orientation=\"vertical\"]:active .usa-cmp-knob{transform:rotate(90deg) scale(.92)}.usa-cmp-label{position:absolute;top:10px;z-index:1;padding:3px 9px;border-radius:999px;background:rgba(0,0,0,.55);color:#fff;font:600 12px/1.4 system-ui,sans-serif;pointer-events:none}.usa-cmp-label-b{left:10px}.usa-cmp-label-a{right:10px}";
|
|
1850
1864
|
|
|
1851
1865
|
function defineCompare(tag = 'usa-compare') {
|
|
1852
1866
|
return base.defineElement(tag, (Base) => {
|
|
@@ -1970,10 +1984,10 @@ function defineCompare(tag = 'usa-compare') {
|
|
|
1970
1984
|
}
|
|
1971
1985
|
}
|
|
1972
1986
|
return UsaCompare;
|
|
1973
|
-
}, { id: 'compare', text: css$
|
|
1987
|
+
}, { id: 'compare', text: css$N });
|
|
1974
1988
|
}
|
|
1975
1989
|
|
|
1976
|
-
var css$
|
|
1990
|
+
var css$M = "usa-cube-gallery{position:relative;display:block;aspect-ratio:4/3;perspective:1100px;outline-offset:4px}.usa-cube-stage{position:absolute;inset:0;transform-style:preserve-3d;touch-action:pan-y}.usa-cube-face{position:absolute;inset:0;box-sizing:border-box;margin:0;backface-visibility:hidden;display:none;overflow:hidden;border-radius:var(--usa-cube-radius,14px)}.usa-cube-face[data-active]{display:block}.usa-cube-face>img{width:100%;height:100%;object-fit:cover;display:block}.usa-cube-btn{position:absolute;top:50%;z-index:2;width:34px;height:34px;margin-top:-17px;border:0;border-radius:50%;background:rgba(255,255,255,.85);color:#111827;font:700 20px/1 system-ui,sans-serif;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.25)}.usa-cube-prev{left:8px}.usa-cube-next{right:8px}.usa-cube-btn:focus-visible{outline:2px solid #7c5cff;outline-offset:2px}";
|
|
1977
1991
|
|
|
1978
1992
|
function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
1979
1993
|
return base.defineElement(tag, (Base) => {
|
|
@@ -2106,10 +2120,10 @@ function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
|
2106
2120
|
}
|
|
2107
2121
|
}
|
|
2108
2122
|
return UsaCubeGallery;
|
|
2109
|
-
}, { id: 'cube-gallery', text: css$
|
|
2123
|
+
}, { id: 'cube-gallery', text: css$M });
|
|
2110
2124
|
}
|
|
2111
2125
|
|
|
2112
|
-
var css$
|
|
2126
|
+
var css$L = "usa-dock{display:inline-flex;align-items:flex-end;gap:var(--usa-dock-gap,8px);padding:8px 10px;border-radius:20px;background:var(--usa-dock-bg,rgba(255,255,255,.55));-webkit-backdrop-filter:blur(14px) saturate(1.6);backdrop-filter:blur(14px) saturate(1.6);box-shadow:0 10px 30px -10px rgba(0,0,0,.35),inset 0 0 0 1px rgba(255,255,255,.45);--usa-dock-size:44px}usa-dock[data-orientation=\"vertical\"]{flex-direction:column;align-items:flex-start}.usa-dock-item{--usa-dock-s:1;position:relative;display:grid;place-items:center;flex:none;width:calc(var(--usa-dock-size) * var(--usa-dock-s));height:calc(var(--usa-dock-size) * var(--usa-dock-s));border:0;padding:0;border-radius:calc(var(--usa-dock-size) * .26 * var(--usa-dock-s));background:var(--usa-dock-item,linear-gradient(135deg,#7c5cff,#22d3ee));color:#fff;font-size:calc(var(--usa-dock-size) * .5 * var(--usa-dock-s));text-decoration:none;cursor:pointer;transition:width .12s ease-out,height .12s ease-out,font-size .12s ease-out,border-radius .12s;box-shadow:0 4px 10px rgba(0,0,0,.18)}.usa-dock-item:focus-visible{outline:2px solid #7c5cff;outline-offset:3px}.usa-dock-item[data-label]::after{content:attr(data-label);position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%) translateY(4px);padding:3px 8px;border-radius:6px;background:rgba(17,24,39,.9);color:#fff;font:500 12px/1.3 system-ui,sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s,transform .15s}.usa-dock-item[data-near]::after,.usa-dock-item:focus-visible::after{opacity:1;transform:translateX(-50%)}usa-dock[data-orientation=\"vertical\"] .usa-dock-item[data-label]::after{bottom:auto;left:calc(100% + 8px);top:50%;transform:translateY(-50%)}@media (prefers-reduced-motion:reduce){.usa-dock-item{transition:none}}";
|
|
2113
2127
|
|
|
2114
2128
|
function defineDock(tag = 'usa-dock') {
|
|
2115
2129
|
return base.defineElement(tag, (Base) => {
|
|
@@ -2177,10 +2191,10 @@ function defineDock(tag = 'usa-dock') {
|
|
|
2177
2191
|
}
|
|
2178
2192
|
}
|
|
2179
2193
|
return UsaDock;
|
|
2180
|
-
}, { id: 'dock', text: css$
|
|
2194
|
+
}, { id: 'dock', text: css$L });
|
|
2181
2195
|
}
|
|
2182
2196
|
|
|
2183
|
-
var css$
|
|
2197
|
+
var css$K = "usa-nav-morph{position:relative;display:flex;gap:4px;align-items:center;isolation:isolate;--usa-nm-color:#7c5cff;flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none}usa-nav-morph::-webkit-scrollbar{display:none}usa-nav-morph>:not(.usa-nm-ink){position:relative;z-index:1;flex:none;padding:8px 12px;border-radius:10px;color:inherit;text-decoration:none;font-weight:600;white-space:nowrap;transition:color .25s;outline-offset:2px}.usa-nm-ink{position:absolute;left:0;z-index:0;width:0;pointer-events:none;background:var(--usa-nm-color)}usa-nav-morph[data-indicator=\"underline\"] .usa-nm-ink{bottom:0;height:3px;border-radius:3px}usa-nav-morph[data-indicator=\"pill\"] .usa-nm-ink,usa-nav-morph[data-indicator=\"blob\"] .usa-nm-ink{top:0;bottom:0;border-radius:10px;opacity:.16}usa-nav-morph[data-indicator=\"blob\"] .usa-nm-ink{border-radius:999px;opacity:.2}usa-nav-morph[data-indicator=\"dot\"] .usa-nm-ink{bottom:0;height:6px;background:radial-gradient(circle,var(--usa-nm-color) 3px,transparent 3.5px)}usa-nav-morph>[aria-current=\"page\"]{color:var(--usa-nm-color)}";
|
|
2184
2198
|
|
|
2185
2199
|
const NAV_INDICATORS = ['underline', 'pill', 'blob', 'dot'];
|
|
2186
2200
|
function defineNavMorph(tag = 'usa-nav-morph') {
|
|
@@ -2284,10 +2298,10 @@ function defineNavMorph(tag = 'usa-nav-morph') {
|
|
|
2284
2298
|
}
|
|
2285
2299
|
}
|
|
2286
2300
|
return UsaNavMorph;
|
|
2287
|
-
}, { id: 'nav-morph', text: css$
|
|
2301
|
+
}, { id: 'nav-morph', text: css$K });
|
|
2288
2302
|
}
|
|
2289
2303
|
|
|
2290
|
-
var css$
|
|
2304
|
+
var css$J = "usa-menu-toggle{display:inline-grid;place-items:center;width:var(--usa-mt-size,44px);height:var(--usa-mt-size,44px);border-radius:12px;cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent;outline-offset:2px;--usa-mt-ease:cubic-bezier(.65,.05,.36,1)}usa-menu-toggle:hover{background:rgba(127,127,127,.12)}.usa-mt-box{position:relative;width:24px;height:18px}.usa-mt-bar{position:absolute;left:0;width:100%;height:2.5px;border-radius:2px;background:currentColor;transform-origin:50% 50%}.usa-mt-bar:nth-child(1){top:0}.usa-mt-bar:nth-child(2){top:7.75px}.usa-mt-bar:nth-child(3){bottom:0}usa-menu-toggle[data-animate] .usa-mt-bar{transition:transform .38s var(--usa-mt-ease),opacity .2s,top .38s var(--usa-mt-ease),bottom .38s var(--usa-mt-ease),width .38s var(--usa-mt-ease)}usa-menu-toggle[data-animate] .usa-mt-box{transition:transform .38s var(--usa-mt-ease)}usa-menu-toggle[data-variant=\"cross\"][data-open] .usa-mt-bar:nth-child(1),usa-menu-toggle[data-variant=\"plus-x\"][data-open] .usa-mt-bar:nth-child(1){top:7.75px;transform:rotate(45deg)}usa-menu-toggle[data-variant=\"cross\"][data-open] .usa-mt-bar:nth-child(2),usa-menu-toggle[data-variant=\"plus-x\"][data-open] .usa-mt-bar:nth-child(2){opacity:0;transform:scaleX(.2)}usa-menu-toggle[data-variant=\"cross\"][data-open] .usa-mt-bar:nth-child(3),usa-menu-toggle[data-variant=\"plus-x\"][data-open] .usa-mt-bar:nth-child(3){bottom:7.75px;transform:rotate(-45deg)}usa-menu-toggle[data-variant=\"plus-x\"][data-open] .usa-mt-box{transform:rotate(180deg)}usa-menu-toggle[data-variant=\"arrow\"][data-open] .usa-mt-bar:nth-child(1){width:55%;transform:translate(-2px,3.5px) rotate(-40deg)}usa-menu-toggle[data-variant=\"arrow\"][data-open] .usa-mt-bar:nth-child(3){width:55%;transform:translate(-2px,-3.5px) rotate(40deg)}usa-menu-toggle[data-variant=\"arrow\"][data-open] .usa-mt-box{transform:rotate(180deg)}usa-menu-toggle[data-variant=\"minus\"][data-open] .usa-mt-bar:nth-child(1){top:7.75px}usa-menu-toggle[data-variant=\"minus\"][data-open] .usa-mt-bar:nth-child(3){bottom:7.75px}";
|
|
2291
2305
|
|
|
2292
2306
|
const TOGGLE_VARIANTS = ['cross', 'arrow', 'minus', 'plus-x'];
|
|
2293
2307
|
function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
@@ -2360,10 +2374,10 @@ function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
|
2360
2374
|
}
|
|
2361
2375
|
}
|
|
2362
2376
|
return UsaMenuToggle;
|
|
2363
|
-
}, { id: 'menu-toggle', text: css$
|
|
2377
|
+
}, { id: 'menu-toggle', text: css$J });
|
|
2364
2378
|
}
|
|
2365
2379
|
|
|
2366
|
-
var css$
|
|
2380
|
+
var css$I = "usa-tip{position:relative;display:inline-block}.usa-tip-bubble{position:absolute;left:0;top:0;z-index:60;box-sizing:border-box;max-width:min(260px,calc(100vw - 16px));width:max-content;padding:7px 11px;border-radius:9px;background:var(--usa-tip-bg,#111827);color:var(--usa-tip-fg,#f9fafb);font:500 13px/1.4 system-ui,sans-serif;box-shadow:0 10px 26px -8px rgba(0,0,0,.4);text-align:left;white-space:normal}.usa-tip-bubble[hidden]{display:none}.usa-tip-bubble[data-placement=\"top\"]{transform-origin:50% 100%}.usa-tip-bubble[data-placement=\"bottom\"]{transform-origin:50% 0}.usa-tip-bubble[data-placement=\"left\"]{transform-origin:100% 50%}.usa-tip-bubble[data-placement=\"right\"]{transform-origin:0 50%}.usa-tip-arrow{position:absolute;width:10px;height:10px;background:inherit;transform:rotate(45deg)}.usa-tip-bubble[data-placement=\"top\"] .usa-tip-arrow{bottom:-4px;left:calc(50% - 5px + var(--usa-tip-shift,0px))}.usa-tip-bubble[data-placement=\"bottom\"] .usa-tip-arrow{top:-4px;left:calc(50% - 5px + var(--usa-tip-shift,0px))}.usa-tip-bubble[data-placement=\"left\"] .usa-tip-arrow{right:-4px;top:calc(50% - 5px)}.usa-tip-bubble[data-placement=\"right\"] .usa-tip-arrow{left:-4px;top:calc(50% - 5px)}";
|
|
2367
2381
|
|
|
2368
2382
|
const TIP_PLACEMENTS = ['top', 'bottom', 'left', 'right'];
|
|
2369
2383
|
const FLIP = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
|
|
@@ -2495,10 +2509,10 @@ function defineTip(tag = 'usa-tip') {
|
|
|
2495
2509
|
}
|
|
2496
2510
|
}
|
|
2497
2511
|
return UsaTip;
|
|
2498
|
-
}, { id: 'tip', text: css$
|
|
2512
|
+
}, { id: 'tip', text: css$I });
|
|
2499
2513
|
}
|
|
2500
2514
|
|
|
2501
|
-
var css$
|
|
2515
|
+
var css$H = "usa-stepper{--usa-st-c:#7c5cff;--usa-st-size:30px;position:relative;display:flex;justify-content:space-between;gap:8px;padding:0;counter-reset:s;max-width:100%}usa-stepper[data-orientation=\"vertical\"]{flex-direction:column;gap:22px}.usa-st-rail{position:absolute;left:calc(var(--usa-st-size)/2);right:calc(var(--usa-st-size)/2);top:calc(var(--usa-st-size)/2 - 2px);height:4px;border-radius:4px;background:rgba(127,127,127,.25);pointer-events:none}usa-stepper[data-orientation=\"vertical\"] .usa-st-rail{left:calc(var(--usa-st-size)/2 - 2px);right:auto;top:calc(var(--usa-st-size)/2);bottom:calc(var(--usa-st-size)/2);width:4px;height:auto}.usa-st-fill{position:absolute;inset:0;border-radius:inherit;background:var(--usa-st-c);transform-origin:0 0;transform:scaleX(calc(var(--usa-st-p,0%) / 100%));transition:transform .55s cubic-bezier(.6,.05,.3,1)}usa-stepper[data-orientation=\"vertical\"] .usa-st-fill{transform:scaleY(calc(var(--usa-st-p,0%) / 100%))}.usa-st-step{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;font:600 12px/1.25 system-ui,sans-serif;text-align:center;color:rgba(127,127,127,.95)}usa-stepper[data-orientation=\"vertical\"] .usa-st-step{flex-direction:row;text-align:left}.usa-st-step[data-current],.usa-st-step[data-done]{color:inherit}.usa-st-dot{position:relative;display:grid;place-items:center;flex:none;width:var(--usa-st-size);height:var(--usa-st-size);border-radius:50%;background:var(--usa-st-bg,#fff);box-shadow:inset 0 0 0 2px rgba(127,127,127,.4);color:#666;font-weight:700;transition:background .3s,box-shadow .3s,color .3s}.usa-st-step[data-current] .usa-st-dot{box-shadow:inset 0 0 0 2px var(--usa-st-c);color:var(--usa-st-c)}.usa-st-step[data-done] .usa-st-dot{background:var(--usa-st-c);box-shadow:none;color:#fff}.usa-st-check{position:absolute;width:60%;height:60%;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:20;stroke-dashoffset:20;opacity:0}.usa-st-step[data-done] .usa-st-check{stroke-dashoffset:0;opacity:1}.usa-st-step[data-done] .usa-st-num{opacity:0}.usa-st-step[data-clickable],usa-stepper[clickable] .usa-st-step{cursor:pointer}@media (prefers-reduced-motion:reduce){.usa-st-fill,.usa-st-dot{transition:none}}";
|
|
2502
2516
|
|
|
2503
2517
|
function defineStepper(tag = 'usa-stepper') {
|
|
2504
2518
|
return base.defineElement(tag, (Base) => {
|
|
@@ -2595,10 +2609,10 @@ function defineStepper(tag = 'usa-stepper') {
|
|
|
2595
2609
|
}
|
|
2596
2610
|
}
|
|
2597
2611
|
return UsaStepper;
|
|
2598
|
-
}, { id: 'stepper', text: css$
|
|
2612
|
+
}, { id: 'stepper', text: css$H });
|
|
2599
2613
|
}
|
|
2600
2614
|
|
|
2601
|
-
var css$
|
|
2615
|
+
var css$G = "usa-pagination{--usa-pg-c:#7c5cff;display:inline-flex;align-items:center;gap:4px;max-width:100%;font:600 14px/1 system-ui,sans-serif}.usa-pg-list{position:relative;display:inline-flex;align-items:center;gap:2px;isolation:isolate}.usa-pg-ink{position:absolute;left:0;top:0;height:100%;width:0;border-radius:10px;background:var(--usa-pg-c);z-index:-1;transition:width .3s}.usa-pg-btn{display:grid;place-items:center;min-width:34px;height:34px;padding:0 6px;border:0;border-radius:10px;background:none;color:inherit;font:inherit;cursor:pointer;transition:color .25s,background .2s}.usa-pg-btn:hover:not(:disabled):not([aria-current]){background:rgba(127,127,127,.14)}.usa-pg-btn[aria-current=\"page\"]{color:#fff}.usa-pg-btn:disabled{opacity:.35;cursor:default}.usa-pg-btn:focus-visible{outline:2px solid var(--usa-pg-c);outline-offset:2px}.usa-pg-gap{min-width:20px;text-align:center;opacity:.6}@media (max-width:420px){.usa-pg-btn{min-width:28px;height:30px;padding:0 3px}}@media (prefers-reduced-motion:reduce){.usa-pg-ink{transition:none}}";
|
|
2602
2616
|
|
|
2603
2617
|
/** The visible page list: numbers and `'…'` gaps (1-based). */
|
|
2604
2618
|
function pageWindow(page, total, siblings = 1) {
|
|
@@ -2720,10 +2734,10 @@ function definePagination(tag = 'usa-pagination') {
|
|
|
2720
2734
|
}
|
|
2721
2735
|
}
|
|
2722
2736
|
return UsaPagination;
|
|
2723
|
-
}, { id: 'pagination', text: css$
|
|
2737
|
+
}, { id: 'pagination', text: css$G });
|
|
2724
2738
|
}
|
|
2725
2739
|
|
|
2726
|
-
var css$
|
|
2740
|
+
var css$F = "usa-segmented{--usa-seg-c:#7c5cff;position:relative;display:inline-flex;align-items:stretch;padding:3px;border-radius:12px;background:rgba(127,127,127,.16);isolation:isolate;max-width:100%;font:600 13px/1 system-ui,sans-serif}.usa-seg-thumb{position:absolute;top:3px;bottom:3px;left:3px;z-index:-1;border-radius:9px;background:var(--usa-seg-thumb,#fff);box-shadow:0 2px 8px rgba(0,0,0,.18),0 0 0 .5px rgba(0,0,0,.05);transform-origin:50% 50%}usa-segmented[data-variant=\"pill\"]{border-radius:999px}usa-segmented[data-variant=\"pill\"] .usa-seg-thumb{border-radius:999px;background:var(--usa-seg-c)}usa-segmented[data-variant=\"pill\"] .usa-seg-item[data-selected]{color:#fff}usa-segmented[data-variant=\"outline\"]{background:none;box-shadow:inset 0 0 0 1.5px rgba(127,127,127,.35)}usa-segmented[data-variant=\"outline\"] .usa-seg-thumb{background:none;box-shadow:inset 0 0 0 2px var(--usa-seg-c)}.usa-seg-item{flex:1 1 0;min-width:0;padding:8px 14px;border:0;border-radius:9px;background:none;color:inherit;font:inherit;white-space:nowrap;cursor:pointer;opacity:.7;transition:opacity .2s,transform .25s cubic-bezier(.3,1.4,.5,1),color .2s}.usa-seg-item[data-selected]{opacity:1;transform:scale(1.04)}.usa-seg-item:focus-visible{outline:2px solid var(--usa-seg-c);outline-offset:1px}@media (max-width:420px){.usa-seg-item{padding:8px 9px}}@media (prefers-reduced-motion:reduce){.usa-seg-item{transition:none}}";
|
|
2727
2741
|
|
|
2728
2742
|
const SEGMENTED_VARIANTS = ['ios', 'pill', 'outline'];
|
|
2729
2743
|
function defineSegmented(tag = 'usa-segmented') {
|
|
@@ -2817,10 +2831,10 @@ function defineSegmented(tag = 'usa-segmented') {
|
|
|
2817
2831
|
}
|
|
2818
2832
|
}
|
|
2819
2833
|
return UsaSegmented;
|
|
2820
|
-
}, { id: 'segmented', text: css$
|
|
2834
|
+
}, { id: 'segmented', text: css$F });
|
|
2821
2835
|
}
|
|
2822
2836
|
|
|
2823
|
-
var css$
|
|
2837
|
+
var css$E = "usa-switch{--usa-sw-c:#34c759;--usa-sw-w:52px;--usa-sw-h:30px;display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-tap-highlight-color:transparent;vertical-align:middle;outline-offset:3px;border-radius:999px}usa-switch[disabled]{opacity:.45;cursor:not-allowed}.usa-sw-track{position:relative;flex:none;width:var(--usa-sw-w);height:var(--usa-sw-h);border-radius:999px;background:rgba(127,127,127,.35);overflow:hidden;transition:background .3s}.usa-sw-fill{position:absolute;inset:0;border-radius:999px;background:var(--usa-sw-c);transform:scale(0);transform-origin:calc(var(--usa-sw-h)/2) 50%;transition:transform .35s cubic-bezier(.4,0,.2,1)}usa-switch[data-on] .usa-sw-fill{transform:scale(1)}.usa-sw-thumb{position:absolute;top:3px;left:3px;width:calc(var(--usa-sw-h) - 6px);height:calc(var(--usa-sw-h) - 6px);border-radius:999px;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.25);transition:left .32s cubic-bezier(.3,1.25,.5,1),width .2s ease,background .3s,box-shadow .3s}usa-switch[data-on] .usa-sw-thumb{left:calc(var(--usa-sw-w) - var(--usa-sw-h) + 3px)}usa-switch[data-variant=\"ios\"][data-press] .usa-sw-thumb{width:calc(var(--usa-sw-h) + 2px)}usa-switch[data-variant=\"ios\"][data-press][data-on] .usa-sw-thumb{left:calc(var(--usa-sw-w) - var(--usa-sw-h) - 5px)}usa-switch[data-variant=\"daynight\"]{--usa-sw-w:64px;--usa-sw-h:32px}usa-switch[data-variant=\"daynight\"] .usa-sw-track{background:linear-gradient(#7dd3fc,#38bdf8)}usa-switch[data-variant=\"daynight\"] .usa-sw-fill{background:linear-gradient(#1e1b4b,#312e81);transform:none;opacity:0;transition:opacity .45s}usa-switch[data-variant=\"daynight\"][data-on] .usa-sw-fill{opacity:1}usa-switch[data-variant=\"daynight\"] .usa-sw-thumb{background:radial-gradient(circle at 40% 40%,#fde68a,#f59e0b);box-shadow:0 0 10px #fbbf24}usa-switch[data-variant=\"daynight\"][data-on] .usa-sw-thumb{background:radial-gradient(circle at 65% 35%,transparent 5px,#e5e7eb 5.5px);box-shadow:0 0 8px rgba(255,255,255,.5)}usa-switch[data-variant=\"daynight\"] .usa-sw-deco{position:absolute;inset:0;background:radial-gradient(circle,#fff 1px,transparent 1.5px) 12px 8px/14px 11px;opacity:0;transform:translateY(6px);transition:opacity .4s,transform .5s}usa-switch[data-variant=\"daynight\"][data-on] .usa-sw-deco{opacity:.9;transform:none}usa-switch[data-variant=\"bounce\"] .usa-sw-thumb{transition:left .28s cubic-bezier(.5,0,.75,0)}usa-switch[data-variant=\"liquid\"] .usa-sw-fill{background:linear-gradient(90deg,#22d3ee,#7c5cff)}usa-switch[data-variant=\"liquid\"] .usa-sw-thumb{transition:left .5s cubic-bezier(.68,-.4,.27,1.4)}usa-switch:focus-visible .usa-sw-track{box-shadow:0 0 0 3px rgba(124,92,255,.5)}@media (prefers-reduced-motion:reduce){.usa-sw-thumb,.usa-sw-fill,.usa-sw-deco,.usa-sw-track{transition:none!important}}";
|
|
2824
2838
|
|
|
2825
2839
|
const SWITCH_VARIANTS = ['ios', 'daynight', 'bounce', 'liquid'];
|
|
2826
2840
|
function defineSwitch(tag = 'usa-switch') {
|
|
@@ -2908,10 +2922,10 @@ function defineSwitch(tag = 'usa-switch') {
|
|
|
2908
2922
|
}
|
|
2909
2923
|
}
|
|
2910
2924
|
return UsaSwitch;
|
|
2911
|
-
}, { id: 'switch', text: css$
|
|
2925
|
+
}, { id: 'switch', text: css$E });
|
|
2912
2926
|
}
|
|
2913
2927
|
|
|
2914
|
-
var css$
|
|
2928
|
+
var css$D = "usa-kanban{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(140px,1fr);gap:12px;max-width:100%;overflow-x:auto;padding:4px;font:500 13px/1.35 system-ui,sans-serif}.usa-kb-col{display:flex;flex-direction:column;gap:8px;min-height:80px;padding:10px;border-radius:14px;background:rgba(127,127,127,.12);margin:0;list-style:none}.usa-kb-col>h1,.usa-kb-col>h2,.usa-kb-col>h3,.usa-kb-col>h4{margin:0 0 2px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;opacity:.7}.usa-kb-card{padding:10px 12px;border-radius:10px;background:var(--usa-kb-card,#fff);color:#111;box-shadow:0 1px 3px rgba(0,0,0,.14);cursor:grab;touch-action:none;user-select:none;outline-offset:2px}.usa-kb-card:focus-visible{outline:2px solid #7c5cff}.usa-kb-lifted{cursor:grabbing;box-shadow:0 18px 30px -8px rgba(0,0,0,.35);transition:transform .12s}.usa-kb-held{outline:2px dashed #7c5cff;transform:scale(1.03)}.usa-kb-ph{border-radius:10px;border:2px dashed rgba(124,92,255,.5);background:rgba(124,92,255,.08)}.usa-kb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media (prefers-reduced-motion:reduce){.usa-kb-lifted,.usa-kb-held{transition:none;transform:none!important}}";
|
|
2915
2929
|
|
|
2916
2930
|
function defineKanban(tag = 'usa-kanban') {
|
|
2917
2931
|
return base.defineElement(tag, (Base) => {
|
|
@@ -3116,10 +3130,10 @@ function defineKanban(tag = 'usa-kanban') {
|
|
|
3116
3130
|
}
|
|
3117
3131
|
}
|
|
3118
3132
|
return UsaKanban;
|
|
3119
|
-
}, { id: 'kanban', text: css$
|
|
3133
|
+
}, { id: 'kanban', text: css$D });
|
|
3120
3134
|
}
|
|
3121
3135
|
|
|
3122
|
-
var css$
|
|
3136
|
+
var css$C = "usa-swipe-deck{position:relative;display:grid;width:var(--usa-sd-w,240px);max-width:100%;height:var(--usa-sd-h,300px);touch-action:pan-y;outline-offset:6px;border-radius:18px}.usa-sd-card{grid-area:1/1;position:relative;display:grid;place-items:center;border-radius:18px;background:var(--usa-sd-bg,linear-gradient(160deg,#7c5cff,#22d3ee));color:#fff;font:800 22px/1.2 system-ui,sans-serif;box-shadow:0 12px 28px -10px rgba(0,0,0,.4);transition:transform .3s cubic-bezier(.3,1.3,.5,1),opacity .3s;user-select:none;cursor:grab;overflow:hidden;touch-action:none}.usa-sd-card.usa-sd-dragging{transition:none;cursor:grabbing}.usa-sd-stamp{position:absolute;top:18px;padding:4px 10px;border:3px solid currentColor;border-radius:8px;font:900 20px/1 system-ui,sans-serif;letter-spacing:.1em;opacity:0;pointer-events:none}.usa-sd-like{left:16px;color:#4ade80;transform:rotate(-14deg)}.usa-sd-nope{right:16px;color:#f87171;transform:rotate(14deg)}@media (prefers-reduced-motion:reduce){.usa-sd-card{transition:none}}";
|
|
3123
3137
|
|
|
3124
3138
|
function defineSwipeDeck(tag = 'usa-swipe-deck') {
|
|
3125
3139
|
return base.defineElement(tag, (Base) => {
|
|
@@ -3261,10 +3275,10 @@ function defineSwipeDeck(tag = 'usa-swipe-deck') {
|
|
|
3261
3275
|
}
|
|
3262
3276
|
}
|
|
3263
3277
|
return UsaSwipeDeck;
|
|
3264
|
-
}, { id: 'swipe-deck', text: css$
|
|
3278
|
+
}, { id: 'swipe-deck', text: css$C });
|
|
3265
3279
|
}
|
|
3266
3280
|
|
|
3267
|
-
var css$
|
|
3281
|
+
var css$B = "usa-weather-card{--usa-wc-sky:linear-gradient(160deg,#38bdf8,#0ea5e9);position:relative;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:14px;width:var(--usa-wc-w,260px);max-width:100%;padding:16px 18px;border-radius:20px;background:var(--usa-wc-sky);color:#fff;overflow:hidden;font:500 13px/1.3 system-ui,sans-serif;box-shadow:0 12px 30px -12px rgba(2,6,23,.5);transition:background .6s}usa-weather-card[data-condition=\"cloudy\"]{--usa-wc-sky:linear-gradient(160deg,#94a3b8,#64748b)}usa-weather-card[data-condition=\"rain\"]{--usa-wc-sky:linear-gradient(160deg,#475569,#1e3a8a)}usa-weather-card[data-condition=\"snow\"]{--usa-wc-sky:linear-gradient(160deg,#cbd5e1,#60a5fa);color:#0f172a}usa-weather-card[data-condition=\"storm\"]{--usa-wc-sky:linear-gradient(160deg,#1e293b,#312e81)}usa-weather-card[data-condition=\"fog\"]{--usa-wc-sky:linear-gradient(160deg,#9ca3af,#d1d5db);color:#1f2937}usa-weather-card[data-condition=\"night\"]{--usa-wc-sky:linear-gradient(160deg,#0f172a,#1e1b4b)}.usa-wc-scene{position:relative;width:76px;height:64px}.usa-wc-icon{position:absolute;inset:0}.usa-wc-icon *{position:absolute;display:block}.usa-wc-text{display:flex;flex-direction:column;gap:2px;min-width:0}.usa-wc-temp{font:800 34px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums}.usa-wc-place{opacity:.8;font-size:12px}.usa-wc-sun{left:14px;top:8px;width:46px;height:46px;border-radius:50%;background:radial-gradient(circle,#fde047 55%,transparent 56%);animation:usa-wc-spin 14s linear infinite}.usa-wc-sun::before{content:\"\";position:absolute;inset:-8px;border-radius:50%;background:repeating-conic-gradient(#fde047 0 8deg,transparent 8deg 30deg);-webkit-mask:radial-gradient(circle,transparent 58%,#000 60%,#000 70%,transparent 72%);mask:radial-gradient(circle,transparent 58%,#000 60%,#000 70%,transparent 72%)}.usa-wc-moon{left:18px;top:6px;width:40px;height:40px;border-radius:50%;box-shadow:-10px 6px 0 2px #f1f5f9;transform:rotate(-20deg)}.usa-wc-star{width:3px;height:3px;border-radius:50%;background:#fff;left:calc(8px + var(--i) * 14px);top:calc(40px + (var(--i) * 7px) % 20px);animation:usa-wc-tw 1.8s calc(var(--i) * .35s) ease-in-out infinite alternate}.usa-wc-cloud{left:8px;top:14px;width:56px;height:22px;border-radius:12px;background:#f1f5f9;animation:usa-wc-drift 4s ease-in-out infinite alternate}.usa-wc-cloud::before{content:\"\";position:absolute;left:12px;top:-12px;width:26px;height:26px;border-radius:50%;background:inherit}.usa-wc-c2{left:22px;top:6px;transform:scale(.7);opacity:.75;animation-delay:-2s}.usa-wc-dark{background:#94a3b8}.usa-wc-drop{left:calc(16px + var(--i) * 8px);top:38px;width:2px;height:9px;border-radius:2px;background:#bfdbfe;animation:usa-wc-fall .9s calc(var(--i) * .17s) linear infinite}.usa-wc-flake{left:calc(14px + var(--i) * 9px);top:38px;width:6px;height:6px;border-radius:50%;background:#fff;animation:usa-wc-snow 2.4s calc(var(--i) * .4s) linear infinite}.usa-wc-bolt{left:30px;top:30px;width:14px;height:26px;background:#fde047;clip-path:polygon(40% 0,100% 0,60% 45%,100% 45%,20% 100%,40% 55%,0 55%);animation:usa-wc-bolt 4s ease-in-out infinite}.usa-wc-fogband{left:4px;top:calc(14px + var(--i) * 14px);width:66px;height:6px;border-radius:6px;background:rgba(255,255,255,.85);animation:usa-wc-drift calc(3s + var(--i) * .8s) ease-in-out infinite alternate}@keyframes usa-wc-spin{to{transform:rotate(360deg)}}@keyframes usa-wc-tw{from{opacity:.2}to{opacity:1}}@keyframes usa-wc-drift{from{translate:-4px 0}to{translate:6px 0}}@keyframes usa-wc-fall{from{translate:0 0;opacity:1}to{translate:-3px 22px;opacity:0}}@keyframes usa-wc-snow{from{translate:0 0;opacity:1}50%{translate:4px 12px}to{translate:-2px 24px;opacity:0}}@keyframes usa-wc-bolt{0%,86%,100%{opacity:.35}90%{opacity:1}}@media (prefers-reduced-motion:reduce){usa-weather-card *{animation:none!important}}";
|
|
3268
3282
|
|
|
3269
3283
|
const WEATHER_CONDITIONS = ['clear', 'cloudy', 'rain', 'snow', 'storm', 'fog', 'night'];
|
|
3270
3284
|
const LABEL = { clear: 'Clear', cloudy: 'Cloudy', rain: 'Rain', snow: 'Snow', storm: 'Thunderstorm', fog: 'Fog', night: 'Clear night' };
|
|
@@ -3345,10 +3359,10 @@ function defineWeatherCard(tag = 'usa-weather-card') {
|
|
|
3345
3359
|
}
|
|
3346
3360
|
}
|
|
3347
3361
|
return UsaWeatherCard;
|
|
3348
|
-
}, { id: 'weather-card', text: css$
|
|
3362
|
+
}, { id: 'weather-card', text: css$B });
|
|
3349
3363
|
}
|
|
3350
3364
|
|
|
3351
|
-
var css$
|
|
3365
|
+
var css$A = "usa-pull-cord{--usa-pc-color:#cbd5e1;--usa-pc-light:#fde68a;position:relative;display:inline-flex;flex-direction:column;align-items:center;width:90px;height:190px;cursor:pointer;touch-action:none;user-select:none;outline-offset:4px;border-radius:12px}.usa-pc-lamp{position:relative;width:76px;height:38px;border-radius:38px 38px 6px 6px;background:linear-gradient(#475569,#334155);box-shadow:0 0 0 rgba(253,230,138,0);transition:box-shadow .35s,background .35s}.usa-pc-lamp::after{content:\"\";position:absolute;left:50%;bottom:-10px;width:22px;height:12px;margin-left:-11px;border-radius:0 0 12px 12px;background:#64748b;transition:background .35s,box-shadow .35s}usa-pull-cord[data-on] .usa-pc-lamp{background:linear-gradient(#f59e0b,#d97706);box-shadow:0 30px 60px 10px rgba(253,230,138,.55)}usa-pull-cord[data-on] .usa-pc-lamp::after{background:var(--usa-pc-light);box-shadow:0 0 22px 8px var(--usa-pc-light)}.usa-pc-svg{width:80px;height:150px;margin-top:-2px;overflow:visible}.usa-pc-cord{fill:none;stroke:var(--usa-pc-color);stroke-width:2.2;stroke-linecap:round}.usa-pc-knob{fill:#e2e8f0;stroke:#94a3b8;stroke-width:1.5}usa-pull-cord[data-on] .usa-pc-knob{fill:var(--usa-pc-light)}@media (prefers-reduced-motion:reduce){.usa-pc-lamp,.usa-pc-lamp::after{transition:none}}";
|
|
3352
3366
|
|
|
3353
3367
|
function definePullCord(tag = 'usa-pull-cord') {
|
|
3354
3368
|
return base.defineElement(tag, (Base) => {
|
|
@@ -3477,10 +3491,10 @@ function definePullCord(tag = 'usa-pull-cord') {
|
|
|
3477
3491
|
}
|
|
3478
3492
|
}
|
|
3479
3493
|
return UsaPullCord;
|
|
3480
|
-
}, { id: 'pull-cord', text: css$
|
|
3494
|
+
}, { id: 'pull-cord', text: css$A });
|
|
3481
3495
|
}
|
|
3482
3496
|
|
|
3483
|
-
var css$
|
|
3497
|
+
var css$z = "usa-date-picker{--usa-dp-c:#7c5cff;display:inline-block;width:var(--usa-dp-w,280px);max-width:100%;padding:12px;border-radius:16px;background:var(--usa-dp-bg,#fff);color:#111827;box-shadow:0 10px 30px -12px rgba(0,0,0,.3);font:500 13px/1 system-ui,sans-serif;user-select:none}.usa-dp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.usa-dp-title{font-weight:700;font-size:14px}.usa-dp-nav{width:30px;height:30px;border:0;border-radius:8px;background:none;color:inherit;font-size:18px;cursor:pointer}.usa-dp-nav:hover{background:rgba(127,127,127,.14)}.usa-dp-viewport{overflow:hidden}.usa-dp-row{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.usa-dp-dow{margin-bottom:4px;font-size:11px;opacity:.55;text-align:center}.usa-dp-day{position:relative;display:grid;place-items:center;aspect-ratio:1;border-radius:50%;cursor:pointer;font-variant-numeric:tabular-nums;outline:none;transition:background .2s,color .2s}.usa-dp-day:hover{background:rgba(124,92,255,.12)}.usa-dp-day[data-out]{opacity:.35}.usa-dp-day[data-today]{box-shadow:inset 0 0 0 1.5px var(--usa-dp-c)}.usa-dp-day[aria-selected=\"true\"]{background:var(--usa-dp-c);color:#fff}.usa-dp-day[aria-disabled]{opacity:.2;cursor:not-allowed;text-decoration:line-through}.usa-dp-day:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--usa-dp-c)}@media (prefers-reduced-motion:reduce){.usa-dp-day{transition:none}}";
|
|
3484
3498
|
|
|
3485
3499
|
const iso = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
3486
3500
|
/** Parse `YYYY-MM-DD` as a local date (or null). */
|
|
@@ -3629,10 +3643,10 @@ function defineDatePicker(tag = 'usa-date-picker') {
|
|
|
3629
3643
|
}
|
|
3630
3644
|
}
|
|
3631
3645
|
return UsaDatePicker;
|
|
3632
|
-
}, { id: 'date-picker', text: css$
|
|
3646
|
+
}, { id: 'date-picker', text: css$z });
|
|
3633
3647
|
}
|
|
3634
3648
|
|
|
3635
|
-
var css$
|
|
3649
|
+
var css$y = "usa-color-picker{display:inline-flex;flex-direction:column;gap:10px;width:var(--usa-cp-w,240px);max-width:100%;padding:12px;border-radius:16px;background:var(--usa-cp-bg,#fff);box-shadow:0 10px 30px -12px rgba(0,0,0,.3)}.usa-cp-sv{position:relative;height:140px;border-radius:10px;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,hsl(var(--usa-cp-h) 100% 50%));cursor:crosshair;touch-action:none;outline-offset:2px}.usa-cp-thumb{position:absolute;left:var(--usa-cp-x);top:var(--usa-cp-y);width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;background:var(--usa-cp-color);box-shadow:0 0 0 3px #fff,0 2px 6px rgba(0,0,0,.4);pointer-events:none;transition:left .18s cubic-bezier(.3,1.4,.5,1),top .18s cubic-bezier(.3,1.4,.5,1),transform .2s}[data-drag]>.usa-cp-thumb{transition:none;transform:scale(1.2)}.usa-cp-row{display:flex;align-items:center;gap:10px}.usa-cp-chip{flex:none;width:30px;height:30px;border-radius:50%;background:var(--usa-cp-color);box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.usa-cp-hue{position:relative;flex:1;height:14px;border-radius:7px;background:linear-gradient(90deg,red,#ff0,lime,cyan,blue,#f0f,red);cursor:pointer;touch-action:none;outline-offset:2px}.usa-cp-hue .usa-cp-thumb{left:var(--usa-cp-hx);top:50%;background:hsl(var(--usa-cp-h) 100% 50%)}.usa-cp-swatches{display:flex;flex-wrap:wrap;gap:6px}.usa-cp-sw{width:22px;height:22px;border:0;border-radius:50%;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}.usa-cp-sv:focus-visible,.usa-cp-hue:focus-visible,.usa-cp-sw:focus-visible{outline:2px solid #7c5cff}@media (prefers-reduced-motion:reduce){.usa-cp-thumb{transition:none}}";
|
|
3636
3650
|
|
|
3637
3651
|
/** HSV (h 0–360, s / v 0–1) → `#rrggbb`. */
|
|
3638
3652
|
function hsvToHex(h, s, v) {
|
|
@@ -3752,10 +3766,10 @@ function defineColorPicker(tag = 'usa-color-picker') {
|
|
|
3752
3766
|
}
|
|
3753
3767
|
}
|
|
3754
3768
|
return UsaColorPicker;
|
|
3755
|
-
}, { id: 'color-picker', text: css$
|
|
3769
|
+
}, { id: 'color-picker', text: css$y });
|
|
3756
3770
|
}
|
|
3757
3771
|
|
|
3758
|
-
var css$
|
|
3772
|
+
var css$x = "usa-file-drop{--usa-fd-c:#7c5cff;display:flex;flex-direction:column;gap:10px;width:var(--usa-fd-w,300px);max-width:100%;font:500 13px/1.3 system-ui,sans-serif}.usa-fd-zone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:120px;padding:16px;border-radius:16px;background:rgba(124,92,255,.06);cursor:pointer;text-align:center;outline-offset:3px;transition:background .25s,transform .25s}.usa-fd-ants{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.usa-fd-ants rect{fill:none;stroke:rgba(124,92,255,.55);stroke-width:2;stroke-dasharray:8 6}usa-file-drop[data-over] .usa-fd-zone{background:rgba(124,92,255,.14);transform:scale(1.02)}usa-file-drop[data-over] .usa-fd-ants rect{stroke:var(--usa-fd-c);animation:usa-fd-march .6s linear infinite}.usa-fd-icon{font-size:30px;color:var(--usa-fd-c);transition:transform .3s cubic-bezier(.3,1.5,.5,1)}usa-file-drop[data-over] .usa-fd-icon{transform:translateY(-8px) scale(1.15)}.usa-fd-zone:focus-visible{outline:2px solid var(--usa-fd-c)}.usa-fd-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.usa-fd-item{--usa-fd-p:0;position:relative;display:grid;grid-template-columns:1fr auto 18px;align-items:center;gap:4px 8px;padding:8px 10px;border-radius:10px;background:rgba(127,127,127,.1)}.usa-fd-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.usa-fd-size{opacity:.6;font-size:12px}.usa-fd-bar{grid-column:1/3;height:4px;border-radius:4px;background:rgba(127,127,127,.25);overflow:hidden}.usa-fd-fill{display:block;height:100%;background:var(--usa-fd-c);transform-origin:0 50%;transform:scaleX(var(--usa-fd-p));transition:transform .2s}.usa-fd-check{grid-row:1/3;grid-column:3;width:18px;height:18px;fill:none;stroke:#22c55e;stroke-width:2.4;stroke-linecap:round;stroke-dasharray:20;stroke-dashoffset:20;transition:stroke-dashoffset .4s}.usa-fd-item[data-done] .usa-fd-check{stroke-dashoffset:0}@keyframes usa-fd-march{to{stroke-dashoffset:-14}}@media (prefers-reduced-motion:reduce){usa-file-drop *{animation:none!important;transition:none!important}usa-file-drop[data-over] .usa-fd-zone,usa-file-drop[data-over] .usa-fd-icon{transform:none}}";
|
|
3759
3773
|
|
|
3760
3774
|
const size = (n) => (n < 1024 ? `${n} B` : n < 1048576 ? `${(n / 1024).toFixed(1)} KB` : `${(n / 1048576).toFixed(1)} MB`);
|
|
3761
3775
|
function defineFileDrop(tag = 'usa-file-drop') {
|
|
@@ -3856,10 +3870,10 @@ function defineFileDrop(tag = 'usa-file-drop') {
|
|
|
3856
3870
|
}
|
|
3857
3871
|
}
|
|
3858
3872
|
return UsaFileDrop;
|
|
3859
|
-
}, { id: 'file-drop', text: css$
|
|
3873
|
+
}, { id: 'file-drop', text: css$x });
|
|
3860
3874
|
}
|
|
3861
3875
|
|
|
3862
|
-
var css$
|
|
3876
|
+
var css$w = "usa-keyframe-editor{--usa-ke-c:#7c5cff;--usa-ke-head:100%;display:flex;flex-direction:column;gap:8px;width:var(--usa-ke-w,100%);max-width:100%;padding:10px;border-radius:14px;background:var(--usa-ke-bg,#0f172a);color:#e2e8f0;font:500 12px/1.2 system-ui,sans-serif}.usa-ke-bar{display:flex;align-items:center;gap:8px}.usa-ke-play{width:30px;height:30px;border:0;border-radius:50%;background:var(--usa-ke-c);color:#fff;cursor:pointer}.usa-ke-scrub{flex:1;min-width:0;accent-color:var(--usa-ke-c)}.usa-ke-time{min-width:58px;text-align:right;font-variant-numeric:tabular-nums;opacity:.8}.usa-ke-tracks{position:relative;display:flex;flex-direction:column;gap:4px}.usa-ke-tracks::after{content:\"\";position:absolute;top:0;bottom:0;left:calc(64px + (100% - 64px) * var(--usa-ke-head) / 100%);width:2px;background:#f43f5e;pointer-events:none}.usa-ke-row{display:grid;grid-template-columns:64px 1fr;align-items:center}.usa-ke-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:6px;opacity:.85}.usa-ke-lane{position:relative;height:22px;border-radius:6px;background:rgba(148,163,184,.14)}.usa-ke-clip{position:absolute;top:2px;bottom:2px;border-radius:5px;background:linear-gradient(90deg,var(--usa-ke-c),#22d3ee);cursor:grab;touch-action:none;outline-offset:2px;transition:left .2s,width .2s}.usa-ke-clip[data-drag]{cursor:grabbing;transition:none;box-shadow:0 4px 12px rgba(0,0,0,.4)}.usa-ke-clip:focus-visible{outline:2px solid #fff}.usa-ke-grip{position:absolute;right:0;top:0;bottom:0;width:8px;border-radius:0 5px 5px 0;background:rgba(255,255,255,.35);cursor:ew-resize}@media (prefers-reduced-motion:reduce){.usa-ke-clip{transition:none}}";
|
|
3863
3877
|
|
|
3864
3878
|
const DEFAULT = {
|
|
3865
3879
|
format: player.ANIMATION_FORMAT,
|
|
@@ -4033,10 +4047,10 @@ function defineKeyframeEditor(tag = 'usa-keyframe-editor') {
|
|
|
4033
4047
|
}
|
|
4034
4048
|
}
|
|
4035
4049
|
return UsaKeyframeEditor;
|
|
4036
|
-
}, { id: 'keyframe-editor', text: css$
|
|
4050
|
+
}, { id: 'keyframe-editor', text: css$w });
|
|
4037
4051
|
}
|
|
4038
4052
|
|
|
4039
|
-
var css$
|
|
4053
|
+
var css$v = "usa-music-player{--usa-mp-c:#7c5cff;--usa-mp-p:0;display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center;width:var(--usa-mp-w,320px);max-width:100%;padding:14px;border-radius:20px;background:var(--usa-mp-bg,linear-gradient(160deg,#111827,#1e1b4b));color:#f8fafc;font:500 13px/1.3 system-ui,sans-serif;box-shadow:0 14px 34px -14px rgba(0,0,0,.55)}.usa-mp-cover{width:84px;height:84px}.usa-mp-disc{display:block;width:100%;height:100%;border-radius:50%;background:radial-gradient(circle,#0f172a 9%,#e2e8f0 9.5%,#e2e8f0 12%,transparent 12.5%),repeating-radial-gradient(circle,#111 0 2px,#1f2937 2px 4px),#111;background-size:cover;box-shadow:0 6px 18px rgba(0,0,0,.5),inset 0 0 0 2px rgba(255,255,255,.06)}usa-music-player[data-animate] .usa-mp-disc{animation:usa-mp-spin 1.8s linear infinite}.usa-mp-body{display:flex;flex-direction:column;gap:6px;min-width:0}.usa-mp-meta{display:flex;flex-direction:column;min-width:0}.usa-mp-title{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usa-mp-artist{opacity:.7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usa-mp-bars{display:flex;gap:3px;align-items:flex-end;height:14px}.usa-mp-bars i{width:3px;height:30%;border-radius:2px;background:var(--usa-mp-c);transition:height .3s}usa-music-player[data-animate] .usa-mp-bars i{animation:usa-mp-bar .9s ease-in-out infinite alternate}.usa-mp-bars i:nth-child(2){animation-delay:-.3s!important}.usa-mp-bars i:nth-child(3){animation-delay:-.6s!important}.usa-mp-bars i:nth-child(4){animation-delay:-.15s!important}.usa-mp-track{position:relative;height:6px;border-radius:6px;background:rgba(255,255,255,.18);cursor:pointer;touch-action:none;outline-offset:4px}.usa-mp-fill{position:absolute;inset:0;border-radius:inherit;background:var(--usa-mp-c);transform-origin:0 50%;transform:scaleX(var(--usa-mp-p))}.usa-mp-knob{position:absolute;top:50%;left:calc(var(--usa-mp-p) * 100%);width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.4);transition:transform .2s}.usa-mp-track:hover .usa-mp-knob,.usa-mp-track:focus-visible .usa-mp-knob{transform:scale(1.3)}.usa-mp-times{display:flex;justify-content:space-between;font-size:11px;opacity:.65;font-variant-numeric:tabular-nums}.usa-mp-ctrls{display:flex;align-items:center;justify-content:center;gap:12px}.usa-mp-btn{border:0;background:none;color:inherit;font-size:16px;cursor:pointer;opacity:.85}.usa-mp-play{position:relative;width:40px;height:40px;border:0;border-radius:50%;background:#fff;cursor:pointer}.usa-mp-icon{position:absolute;left:50%;top:50%;width:14px;height:16px;margin:-8px 0 0 -6px;background:var(--usa-mp-c);clip-path:polygon(0 0,100% 50%,100% 50%,0 100%);transition:clip-path .3s cubic-bezier(.6,.05,.3,1)}usa-music-player[data-playing] .usa-mp-icon{margin-left:-7px;clip-path:polygon(0 0,35% 0,35% 100%,0 100%,0 0,65% 0,100% 0,100% 100%,65% 100%,65% 0)}.usa-mp-btn:focus-visible,.usa-mp-play:focus-visible,.usa-mp-track:focus-visible{outline:2px solid #fff}@keyframes usa-mp-spin{to{transform:rotate(360deg)}}@keyframes usa-mp-bar{from{height:20%}to{height:100%}}@media (prefers-reduced-motion:reduce){usa-music-player *{animation:none!important;transition:none!important}}";
|
|
4040
4054
|
|
|
4041
4055
|
const fmt = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`;
|
|
4042
4056
|
function defineMusicPlayer(tag = 'usa-music-player') {
|
|
@@ -4197,10 +4211,10 @@ function defineMusicPlayer(tag = 'usa-music-player') {
|
|
|
4197
4211
|
}
|
|
4198
4212
|
}
|
|
4199
4213
|
return UsaMusicPlayer;
|
|
4200
|
-
}, { id: 'music-player', text: css$
|
|
4214
|
+
}, { id: 'music-player', text: css$v });
|
|
4201
4215
|
}
|
|
4202
4216
|
|
|
4203
|
-
var css$
|
|
4217
|
+
var css$u = "usa-volume-knob{--usa-vk-c:#22d3ee;--usa-vk-size:120px;position:relative;display:inline-grid;place-items:center;width:var(--usa-vk-size);height:var(--usa-vk-size);border-radius:50%;cursor:ns-resize;touch-action:none;user-select:none;outline-offset:6px}.usa-vk-arc{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.usa-vk-arc path{fill:none;stroke-width:6;stroke-linecap:round}.usa-vk-bg{stroke:rgba(127,127,127,.25)}.usa-vk-val{stroke:var(--usa-vk-c);filter:drop-shadow(0 0 4px var(--usa-vk-c))}.usa-vk-ticks{position:absolute;inset:0}.usa-vk-ticks i{position:absolute;left:50%;top:50%;width:3px;height:3px;margin:-1.5px;border-radius:50%;background:rgba(127,127,127,.4);transform:rotate(var(--a)) translateY(calc(var(--usa-vk-size) * -.5 + 2px));transition:background .2s,box-shadow .2s}.usa-vk-ticks i[data-on]{background:var(--usa-vk-c);box-shadow:0 0 6px var(--usa-vk-c)}.usa-vk-cap{position:relative;width:62%;height:62%;border-radius:50%;background:radial-gradient(circle at 35% 30%,#4b5563,#111827 70%);box-shadow:0 8px 16px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.15);transform:rotate(var(--usa-vk-angle));transition:transform .35s cubic-bezier(.3,1.5,.5,1)}usa-volume-knob[data-drag] .usa-vk-cap{transition:none}.usa-vk-dot{position:absolute;left:50%;top:10%;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--usa-vk-c);box-shadow:0 0 6px var(--usa-vk-c)}usa-volume-knob:focus-visible{outline:2px solid var(--usa-vk-c)}@media (prefers-reduced-motion:reduce){.usa-vk-cap,.usa-vk-ticks i{transition:none}}";
|
|
4204
4218
|
|
|
4205
4219
|
const ARC = 270;
|
|
4206
4220
|
function defineVolumeKnob(tag = 'usa-volume-knob') {
|
|
@@ -4291,10 +4305,10 @@ function defineVolumeKnob(tag = 'usa-volume-knob') {
|
|
|
4291
4305
|
}
|
|
4292
4306
|
}
|
|
4293
4307
|
return UsaVolumeKnob;
|
|
4294
|
-
}, { id: 'volume-knob', text: css$
|
|
4308
|
+
}, { id: 'volume-knob', text: css$u });
|
|
4295
4309
|
}
|
|
4296
4310
|
|
|
4297
|
-
var css$
|
|
4311
|
+
var css$t = "usa-equalizer{--usa-eq-c:#7c5cff;position:relative;display:block;width:var(--usa-eq-w,320px);max-width:100%;padding:12px 10px 8px;border-radius:16px;background:var(--usa-eq-bg,#0f172a);color:#cbd5e1;font:600 10px/1 system-ui,sans-serif}.usa-eq-curve{position:absolute;left:10px;right:10px;top:12px;height:120px;width:calc(100% - 20px);pointer-events:none;overflow:visible}.usa-eq-curve path{fill:none;stroke:#22d3ee;stroke-width:1.6;vector-effect:non-scaling-stroke;opacity:.8;transition:d .45s cubic-bezier(.3,1.3,.5,1)}.usa-eq-bands{display:flex;justify-content:space-between;gap:4px}.usa-eq-band{display:flex;flex-direction:column;align-items:center;gap:6px;flex:1;min-width:0}.usa-eq-slot{--usa-eq-k:.5;position:relative;width:8px;height:120px;border-radius:6px;background:rgba(148,163,184,.18);cursor:ns-resize;touch-action:none;outline-offset:4px}.usa-eq-fill{position:absolute;left:0;right:0;top:calc((1 - max(var(--usa-eq-k),.5)) * 100%);bottom:calc(min(var(--usa-eq-k),.5) * 100%);border-radius:6px;background:var(--usa-eq-c)}.usa-eq-cap{position:absolute;left:50%;top:calc((1 - var(--usa-eq-k)) * 100%);width:20px;height:10px;margin:-5px 0 0 -10px;border-radius:4px;background:#f8fafc;box-shadow:0 2px 6px rgba(0,0,0,.5)}usa-equalizer[data-glide] .usa-eq-cap{transition:top .5s cubic-bezier(.3,1.4,.5,1)}usa-equalizer[data-glide] .usa-eq-fill{transition:top .5s cubic-bezier(.3,1.4,.5,1),bottom .5s cubic-bezier(.3,1.4,.5,1)}.usa-eq-slot[data-drag] .usa-eq-cap{transform:scale(1.15)}.usa-eq-slot:focus-visible{outline:2px solid #22d3ee}.usa-eq-label{opacity:.7;white-space:nowrap}@media (prefers-reduced-motion:reduce){.usa-eq-cap,.usa-eq-fill,.usa-eq-curve path{transition:none!important}}";
|
|
4298
4312
|
|
|
4299
4313
|
const EQ_PRESETS = {
|
|
4300
4314
|
flat: [0, 0, 0, 0, 0, 0, 0],
|
|
@@ -4392,10 +4406,10 @@ function defineEqualizer(tag = 'usa-equalizer') {
|
|
|
4392
4406
|
}
|
|
4393
4407
|
}
|
|
4394
4408
|
return UsaEqualizer;
|
|
4395
|
-
}, { id: 'equalizer', text: css$
|
|
4409
|
+
}, { id: 'equalizer', text: css$t });
|
|
4396
4410
|
}
|
|
4397
4411
|
|
|
4398
|
-
var css$
|
|
4412
|
+
var css$s = "usa-lyrics{--usa-ly-c:#f472b6;display:block;width:var(--usa-ly-w,320px);max-width:100%;font:700 18px/1.35 system-ui,sans-serif}.usa-ly-list{height:var(--usa-ly-h,180px);margin:0;padding:70px 0;overflow-y:auto;list-style:none;scrollbar-width:none;-webkit-mask:linear-gradient(transparent,#000 25%,#000 75%,transparent);mask:linear-gradient(transparent,#000 25%,#000 75%,transparent)}.usa-ly-list::-webkit-scrollbar{display:none}.usa-ly-line{--usa-ly-k:0;padding:5px 4px;opacity:.38;cursor:pointer;transform-origin:0 50%;transition:opacity .35s,transform .35s cubic-bezier(.3,1.3,.5,1),filter .35s;filter:blur(.4px)}.usa-ly-line[data-past]{opacity:.22}.usa-ly-line[data-active]{opacity:1;filter:none;transform:scale(1.06);color:transparent;background:linear-gradient(90deg,var(--usa-ly-c) calc(var(--usa-ly-k) * 100%),var(--usa-ly-base,#94a3b8) calc(var(--usa-ly-k) * 100%));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;text-shadow:0 0 18px rgba(244,114,182,.25)}@media (prefers-reduced-motion:reduce){.usa-ly-line{transition:none;transform:none!important}}";
|
|
4399
4413
|
|
|
4400
4414
|
/** Parse LRC text into sorted `{ t, text }` lines. */
|
|
4401
4415
|
function parseLRC(src) {
|
|
@@ -4507,10 +4521,10 @@ function defineLyrics(tag = 'usa-lyrics') {
|
|
|
4507
4521
|
}
|
|
4508
4522
|
}
|
|
4509
4523
|
return UsaLyrics;
|
|
4510
|
-
}, { id: 'lyrics', text: css$
|
|
4524
|
+
}, { id: 'lyrics', text: css$s });
|
|
4511
4525
|
}
|
|
4512
4526
|
|
|
4513
|
-
var css$
|
|
4527
|
+
var css$r = "usa-bar-chart{--usa-bc-c:#7c5cff;display:block;width:var(--usa-bc-w,100%);max-width:100%;font:600 11px/1.2 system-ui,sans-serif}.usa-bc-list{display:flex;align-items:flex-end;gap:8px;height:var(--usa-bc-h,140px);margin:0;padding:0;list-style:none}.usa-bc-item{display:grid;grid-template-rows:auto 1fr auto;justify-items:center;flex:1;min-width:0;height:100%;gap:4px}.usa-bc-track{position:relative;grid-row:2;width:100%;display:flex;align-items:flex-end;justify-content:center}.usa-bc-bar{display:block;width:min(100%,38px);height:calc(var(--usa-bc-k) * 100%);border-radius:6px 6px 2px 2px;background:linear-gradient(var(--usa-bc-c),#22d3ee);transform-origin:50% 100%}.usa-bc-item[data-glide] .usa-bc-bar{transition:height .6s cubic-bezier(.3,1.25,.5,1)}.usa-bc-val{grid-row:1;font-variant-numeric:tabular-nums;opacity:.8}.usa-bc-label{grid-row:3;opacity:.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}usa-bar-chart[data-dir=\"h\"] .usa-bc-list{flex-direction:column;align-items:stretch;height:auto}usa-bar-chart[data-dir=\"h\"] .usa-bc-item{grid-template-columns:70px 1fr auto;grid-template-rows:none;align-items:center;height:22px}usa-bar-chart[data-dir=\"h\"] .usa-bc-label{grid-row:auto;grid-column:1;justify-self:start}usa-bar-chart[data-dir=\"h\"] .usa-bc-track{grid-row:auto;grid-column:2;height:100%;justify-content:flex-start;align-items:center}usa-bar-chart[data-dir=\"h\"] .usa-bc-bar{width:calc(var(--usa-bc-k) * 100%);height:14px;border-radius:2px 6px 6px 2px;transform-origin:0 50%;background:linear-gradient(90deg,var(--usa-bc-c),#22d3ee)}usa-bar-chart[data-dir=\"h\"] .usa-bc-item[data-glide] .usa-bc-bar{transition:width .6s cubic-bezier(.3,1.25,.5,1)}usa-bar-chart[data-dir=\"h\"] .usa-bc-val{grid-row:auto;grid-column:3}@media (prefers-reduced-motion:reduce){.usa-bc-bar{transition:none!important}}";
|
|
4514
4528
|
|
|
4515
4529
|
function defineBarChart(tag = 'usa-bar-chart') {
|
|
4516
4530
|
return base.defineElement(tag, (Base) => {
|
|
@@ -4604,10 +4618,10 @@ function defineBarChart(tag = 'usa-bar-chart') {
|
|
|
4604
4618
|
}
|
|
4605
4619
|
}
|
|
4606
4620
|
return UsaBarChart;
|
|
4607
|
-
}, { id: 'bar-chart', text: css$
|
|
4621
|
+
}, { id: 'bar-chart', text: css$r });
|
|
4608
4622
|
}
|
|
4609
4623
|
|
|
4610
|
-
var css$
|
|
4624
|
+
var css$q = "usa-gauge{--usa-gg-c:#7c5cff;--usa-gg-k:0;position:relative;display:inline-block;width:var(--usa-gg-w,220px);max-width:100%;font:600 12px/1.2 system-ui,sans-serif;text-align:center}.usa-gg-svg{display:block;width:100%;height:auto;overflow:visible}.usa-gg-track,.usa-gg-arc{fill:none;stroke-width:16;stroke-linecap:round}.usa-gg-track{stroke:rgba(127,127,127,.2)}.usa-gg-arc{stroke:var(--usa-gg-c);stroke-dasharray:calc(max(var(--usa-gg-k),0) * 100) 100;transition:stroke .3s}.usa-gg-needle{transform-origin:100px 100px;transform:rotate(var(--usa-gg-angle,-90deg));fill:currentColor}.usa-gg-read{position:absolute;left:0;right:0;bottom:2px;display:flex;flex-direction:column;align-items:center;pointer-events:none}.usa-gg-num{font:800 22px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;transform:translateY(-34px)}.usa-gg-label{opacity:.65;transform:translateY(-34px)}";
|
|
4611
4625
|
|
|
4612
4626
|
function defineGauge(tag = 'usa-gauge') {
|
|
4613
4627
|
return base.defineElement(tag, (Base) => {
|
|
@@ -4692,10 +4706,10 @@ function defineGauge(tag = 'usa-gauge') {
|
|
|
4692
4706
|
}
|
|
4693
4707
|
}
|
|
4694
4708
|
return UsaGauge;
|
|
4695
|
-
}, { id: 'gauge', text: css$
|
|
4709
|
+
}, { id: 'gauge', text: css$q });
|
|
4696
4710
|
}
|
|
4697
4711
|
|
|
4698
|
-
var css$
|
|
4712
|
+
var css$p = "usa-sparkline{--usa-sl-c:#7c5cff;position:relative;display:inline-block;width:var(--usa-sl-w,120px);height:var(--usa-sl-h,32px);vertical-align:middle}.usa-sl-svg{display:block;width:100%;height:100%;overflow:visible}.usa-sl-line{fill:none;stroke:var(--usa-sl-c);stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;stroke-dasharray:1}.usa-sl-area{fill:var(--usa-sl-c);opacity:0}usa-sparkline[data-variant=\"area\"] .usa-sl-area{opacity:.16;transition:opacity .8s .4s}.usa-sl-bars rect{fill:var(--usa-sl-c);opacity:.75}usa-sparkline:not([data-variant=\"bars\"]) .usa-sl-bars,usa-sparkline[data-variant=\"bars\"] .usa-sl-line,usa-sparkline[data-variant=\"bars\"] .usa-sl-end{display:none}.usa-sl-end{fill:var(--usa-sl-c);vector-effect:non-scaling-stroke;transform-box:fill-box;transform-origin:center;animation:usa-sl-pulse 1.8s ease-out infinite}.usa-sl-hover{fill:#fff;stroke:var(--usa-sl-c);stroke-width:1.5;vector-effect:non-scaling-stroke;opacity:0}usa-sparkline[data-hover] .usa-sl-hover{opacity:1}.usa-sl-tip{position:absolute;bottom:calc(100% + 4px);transform:translateX(-50%);padding:2px 6px;border-radius:5px;background:#111827;color:#fff;font:600 11px/1.3 system-ui,sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}usa-sparkline[data-hover] .usa-sl-tip{opacity:1}@keyframes usa-sl-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:.4;transform:scale(1.8)}100%{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.usa-sl-end{animation:none}}";
|
|
4699
4713
|
|
|
4700
4714
|
const SPARK_VARIANTS = ['line', 'area', 'bars'];
|
|
4701
4715
|
/** Map values to SVG points in a w×h box (with padding). */
|
|
@@ -4818,7 +4832,7 @@ function defineSparkline(tag = 'usa-sparkline') {
|
|
|
4818
4832
|
}
|
|
4819
4833
|
}
|
|
4820
4834
|
return UsaSparkline;
|
|
4821
|
-
}, { id: 'sparkline', text: css$
|
|
4835
|
+
}, { id: 'sparkline', text: css$p });
|
|
4822
4836
|
}
|
|
4823
4837
|
|
|
4824
4838
|
/** Parse a figure like "$12.4k" / "−3.5%" / "1,204" → number + prefix / suffix / decimals (7.2). */
|
|
@@ -4831,7 +4845,7 @@ function parseFigureText(s) {
|
|
|
4831
4845
|
return Number.isFinite(n) ? { n, pre: m[1], post: m[3], dec: (raw.split('.')[1] || '').length } : null;
|
|
4832
4846
|
}
|
|
4833
4847
|
|
|
4834
|
-
var css$
|
|
4848
|
+
var css$o = "usa-kpi{display:inline-grid;grid-template-columns:1fr auto;grid-template-areas:\"label label\" \"value delta\" \"trend trend\" \"caption caption\";align-items:end;gap:4px 10px;width:var(--usa-kpi-w,220px);max-width:100%;padding:14px 16px;border-radius:16px;background:var(--usa-kpi-bg,#fff);color:#0f172a;box-shadow:0 8px 24px -12px rgba(15,23,42,.35);font:500 12px/1.3 system-ui,sans-serif}.usa-kpi-label{grid-area:label;opacity:.6;text-transform:uppercase;letter-spacing:.06em;font-size:11px;font-weight:700}.usa-kpi-value{grid-area:value;font:800 28px/1.05 system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}.usa-kpi-delta{grid-area:delta;display:inline-flex;align-items:center;gap:3px;padding:3px 7px;border-radius:999px;font-weight:700;font-size:12px;margin-bottom:4px}.usa-kpi-delta[data-good=\"true\"]{background:rgba(34,197,94,.14);color:#15803d}.usa-kpi-delta[data-good=\"false\"]{background:rgba(239,68,68,.14);color:#b91c1c}.usa-kpi-delta i{font-style:normal;font-size:9px}.usa-kpi-trend{grid-area:trend;--usa-sl-w:100%;--usa-sl-h:34px;margin-top:4px}.usa-kpi-caption{grid-area:caption;opacity:.55;font-size:11px}.usa-kpi-caption:empty{display:none}";
|
|
4835
4849
|
|
|
4836
4850
|
function defineKpi(tag = 'usa-kpi') {
|
|
4837
4851
|
return base.defineElement(tag, (Base) => {
|
|
@@ -4911,10 +4925,10 @@ function defineKpi(tag = 'usa-kpi') {
|
|
|
4911
4925
|
}
|
|
4912
4926
|
}
|
|
4913
4927
|
return UsaKpi;
|
|
4914
|
-
}, { id: 'kpi', text: css$
|
|
4928
|
+
}, { id: 'kpi', text: css$o });
|
|
4915
4929
|
}
|
|
4916
4930
|
|
|
4917
|
-
var css$
|
|
4931
|
+
var css$n = "usa-add-to-cart{display:inline-block}.usa-atc-btn{position:relative;display:inline-grid;place-items:center;min-width:var(--usa-atc-w,150px);padding:11px 18px;border:0;border-radius:999px;background:var(--usa-atc-bg,#7c5cff);color:#fff;font:700 14px/1 system-ui,sans-serif;cursor:pointer;overflow:hidden;transition:background .3s}.usa-atc-btn>span{grid-area:1/1;transition:transform .35s cubic-bezier(.3,1.4,.5,1),opacity .25s}.usa-atc-done{transform:translateY(120%);opacity:0}usa-add-to-cart[data-added] .usa-atc-btn{background:var(--usa-atc-ok,#16a34a)}usa-add-to-cart[data-added] .usa-atc-label{transform:translateY(-120%);opacity:0}usa-add-to-cart[data-added] .usa-atc-done{transform:none;opacity:1}.usa-atc-btn:focus-visible{outline:3px solid #a78bfa;outline-offset:2px}.usa-atc-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@media (prefers-reduced-motion:reduce){.usa-atc-btn>span{transition:none}}";
|
|
4918
4932
|
|
|
4919
4933
|
function defineAddToCart(tag = 'usa-add-to-cart') {
|
|
4920
4934
|
return base.defineElement(tag, (Base) => {
|
|
@@ -4959,10 +4973,10 @@ function defineAddToCart(tag = 'usa-add-to-cart') {
|
|
|
4959
4973
|
}
|
|
4960
4974
|
}
|
|
4961
4975
|
return UsaAddToCart;
|
|
4962
|
-
}, { id: 'add-to-cart', text: css$
|
|
4976
|
+
}, { id: 'add-to-cart', text: css$n });
|
|
4963
4977
|
}
|
|
4964
4978
|
|
|
4965
|
-
var css$
|
|
4979
|
+
var css$m = "usa-cart-drawer{position:relative;display:inline-block;font:500 13px/1.3 system-ui,sans-serif}.usa-cd2-toggle{position:relative;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--usa-cd2-btn,#f1f5f9);font-size:20px;cursor:pointer}.usa-cd2-badge{position:absolute;top:-2px;right:-2px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#ef4444;color:#fff;font:800 11px/18px system-ui,sans-serif;text-align:center}.usa-cd2-badge:empty{display:none}.usa-cd2-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:2147482000}.usa-cd2-panel{position:fixed;top:0;right:0;bottom:0;width:min(var(--usa-cd2-w,340px),92vw);display:flex;flex-direction:column;background:var(--usa-cd2-bg,#fff);color:#0f172a;box-shadow:-12px 0 40px -12px rgba(15,23,42,.4);z-index:2147482001;outline:none}.usa-cd2-panel header,.usa-cd2-panel footer{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(15,23,42,.08)}.usa-cd2-panel footer{border:0;border-top:1px solid rgba(15,23,42,.08);margin-top:auto;font-size:15px}.usa-cd2-close,.usa-cd2-rm{border:0;background:none;font-size:20px;line-height:1;cursor:pointer;color:inherit;opacity:.6}.usa-cd2-list{margin:0;padding:6px 8px;list-style:none;overflow:auto}.usa-cd2-item{display:grid;grid-template-columns:36px 1fr auto auto auto;align-items:center;gap:8px;padding:8px;border-radius:10px;overflow:hidden}.usa-cd2-item img,.usa-cd2-item i{width:36px;height:36px;border-radius:8px;object-fit:cover;background:linear-gradient(135deg,#a78bfa,#22d3ee)}.usa-cd2-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.usa-cd2-qty{opacity:.6}.usa-cd2-price,.usa-cd2-total{font-variant-numeric:tabular-nums;font-weight:700}.usa-cd2-empty{margin:24px;text-align:center;opacity:.55}.usa-cd2-panel[hidden],.usa-cd2-backdrop[hidden]{display:none}";
|
|
4966
4980
|
|
|
4967
4981
|
/** Cart total (7.3). */
|
|
4968
4982
|
const cartTotal = (items) => Math.round(items.reduce((a, i) => a + (Number(i.price) || 0) * (i.qty || 1), 0) * 100) / 100;
|
|
@@ -5127,10 +5141,10 @@ function defineCartDrawer(tag = 'usa-cart-drawer') {
|
|
|
5127
5141
|
}
|
|
5128
5142
|
}
|
|
5129
5143
|
return UsaCartDrawer;
|
|
5130
|
-
}, { id: 'cart-drawer', text: css$
|
|
5144
|
+
}, { id: 'cart-drawer', text: css$m });
|
|
5131
5145
|
}
|
|
5132
5146
|
|
|
5133
|
-
var css$
|
|
5147
|
+
var css$l = "usa-product-gallery{display:grid;gap:10px;width:var(--usa-pg2-w,320px);max-width:100%}.usa-pg2-stage{position:relative;aspect-ratio:var(--usa-pg2-ratio,1);border-radius:14px;overflow:hidden;background:#f1f5f9;cursor:zoom-in;outline:none}.usa-pg2-stage:focus-visible{box-shadow:0 0 0 3px #a78bfa}.usa-pg2-main{width:100%;height:100%;object-fit:cover;display:block;transition:transform .2s ease-out}.usa-pg2-thumbs{position:relative;display:flex;gap:8px;overflow-x:auto;padding:3px}.usa-pg2-thumb{flex:0 0 auto;width:var(--usa-pg2-t,56px);height:var(--usa-pg2-t,56px);padding:0;border:0;border-radius:10px;overflow:hidden;background:#e2e8f0;cursor:pointer;opacity:.65;transition:opacity .2s}.usa-pg2-thumb[aria-selected=true]{opacity:1}.usa-pg2-thumb img{width:100%;height:100%;object-fit:cover;display:block}.usa-pg2-thumb:focus-visible{outline:2px solid #7c5cff;outline-offset:2px}.usa-pg2-ring{position:absolute;left:0;top:3px;height:var(--usa-pg2-t,56px);border-radius:10px;box-shadow:0 0 0 2px var(--usa-pg2-accent,#7c5cff);pointer-events:none;transition:transform .35s cubic-bezier(.3,1.3,.5,1),width .35s}@media (prefers-reduced-motion:reduce){.usa-pg2-ring,.usa-pg2-main{transition:none}}";
|
|
5134
5148
|
|
|
5135
5149
|
/** Wrap an index into 0..n-1 (7.3). */
|
|
5136
5150
|
const wrapIndex = (i, n) => (n ? ((i % n) + n) % n : 0);
|
|
@@ -5244,10 +5258,10 @@ function defineProductGallery(tag = 'usa-product-gallery') {
|
|
|
5244
5258
|
}
|
|
5245
5259
|
}
|
|
5246
5260
|
return UsaProductGallery;
|
|
5247
|
-
}, { id: 'product-gallery', text: css$
|
|
5261
|
+
}, { id: 'product-gallery', text: css$l });
|
|
5248
5262
|
}
|
|
5249
5263
|
|
|
5250
|
-
var css$
|
|
5264
|
+
var css$k = "usa-countdown{display:inline-block;font:700 12px/1.2 system-ui,sans-serif;color:var(--usa-cd-fg,inherit)}.usa-cd-row{display:flex;gap:var(--usa-cd-gap,10px)}.usa-cd-unit{display:flex;flex-direction:column;align-items:center;gap:4px}.usa-cd-unit small{font-size:10px;text-transform:uppercase;letter-spacing:.08em;opacity:.6}.usa-cd-digits{display:flex;gap:3px;perspective:300px}.usa-cd-d{display:grid;place-items:center;width:var(--usa-cd-w,28px);height:calc(var(--usa-cd-w,28px) * 1.35);border-radius:6px;background:var(--usa-cd-bg,#111827);color:var(--usa-cd-c,#fff);font:800 calc(var(--usa-cd-w,28px) * .8)/1 ui-monospace,monospace;box-shadow:inset 0 -1px 0 rgba(255,255,255,.08),0 4px 10px -4px rgba(0,0,0,.5);background-image:linear-gradient(transparent 49%,rgba(0,0,0,.35) 50%,transparent 51%);transform-origin:50% 50%}usa-countdown[data-done] .usa-cd-d{background-color:var(--usa-cd-done,#ef4444)}";
|
|
5251
5265
|
|
|
5252
5266
|
/** Split seconds into d/h/m/s (7.3). */
|
|
5253
5267
|
function splitTime(sec) {
|
|
@@ -5335,10 +5349,10 @@ function defineCountdown(tag = 'usa-countdown') {
|
|
|
5335
5349
|
}
|
|
5336
5350
|
}
|
|
5337
5351
|
return UsaCountdown;
|
|
5338
|
-
}, { id: 'countdown', text: css$
|
|
5352
|
+
}, { id: 'countdown', text: css$k });
|
|
5339
5353
|
}
|
|
5340
5354
|
|
|
5341
|
-
var css$
|
|
5355
|
+
var css$j = "usa-message-list{position:relative;display:block;width:var(--usa-ml-w,320px);max-width:100%;font:400 14px/1.35 system-ui,sans-serif}.usa-ml-list{display:flex;flex-direction:column;gap:6px;height:var(--usa-ml-h,260px);margin:0;padding:10px;list-style:none;overflow-y:auto;overscroll-behavior:contain;border-radius:14px;background:var(--usa-ml-bg,#f8fafc)}.usa-ml-msg{display:flex;flex-direction:column;align-items:flex-start;max-width:80%}.usa-ml-msg[data-side=right]{align-self:flex-end;align-items:flex-end}.usa-ml-msg[data-grouped] .usa-ml-from{display:none}.usa-ml-from{font-size:11px;font-weight:600;opacity:.6;margin:2px 8px}.usa-ml-from:empty,.usa-ml-time:empty{display:none}.usa-ml-bubble{padding:8px 12px;border-radius:16px 16px 16px 4px;background:var(--usa-ml-them,#e2e8f0);color:#0f172a;overflow-wrap:anywhere}.usa-ml-msg[data-side=right] .usa-ml-bubble{border-radius:16px 16px 4px 16px;background:var(--usa-ml-me,#7c5cff);color:#fff}.usa-ml-time{font-size:10px;opacity:.5;margin:2px 8px}.usa-ml-typing .usa-ml-bubble{display:inline-flex;gap:4px;padding:11px 12px}.usa-ml-typing i{width:7px;height:7px;border-radius:50%;background:#64748b;animation:usa-ml-dot 1.1s infinite}.usa-ml-typing i:nth-child(2){animation-delay:.18s}.usa-ml-typing i:nth-child(3){animation-delay:.36s}@keyframes usa-ml-dot{0%,60%,100%{transform:none;opacity:.4}30%{transform:translateY(-5px);opacity:1}}.usa-ml-new{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);border:0;border-radius:999px;padding:6px 12px;background:#0f172a;color:#fff;font:600 12px/1 system-ui,sans-serif;cursor:pointer;box-shadow:0 6px 16px -6px rgba(0,0,0,.5)}.usa-ml-new[hidden]{display:none}@media (prefers-reduced-motion:reduce){.usa-ml-typing i{animation:none}}";
|
|
5342
5356
|
|
|
5343
5357
|
function defineMessageList(tag = 'usa-message-list') {
|
|
5344
5358
|
return base.defineElement(tag, (Base) => {
|
|
@@ -5425,10 +5439,10 @@ function defineMessageList(tag = 'usa-message-list') {
|
|
|
5425
5439
|
}
|
|
5426
5440
|
}
|
|
5427
5441
|
return UsaMessageList;
|
|
5428
|
-
}, { id: 'message-list', text: css$
|
|
5442
|
+
}, { id: 'message-list', text: css$j });
|
|
5429
5443
|
}
|
|
5430
5444
|
|
|
5431
|
-
var css$
|
|
5445
|
+
var css$i = "usa-reactions{position:relative;display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;font:600 13px/1 system-ui,sans-serif}.usa-rx-row{display:inline-flex;flex-wrap:wrap;gap:6px}.usa-rx-pill,.usa-rx-add{position:relative;display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:1px solid rgba(15,23,42,.12);border-radius:999px;background:var(--usa-rx-bg,#fff);color:inherit;font:inherit;cursor:pointer}.usa-rx-pill[hidden]{display:none}.usa-rx-pill[aria-pressed=true]{border-color:var(--usa-rx-accent,#7c5cff);background:color-mix(in srgb,var(--usa-rx-accent,#7c5cff) 14%,#fff)}.usa-rx-emo{display:inline-block;font-size:15px}.usa-rx-n{display:inline-block;min-width:1ch;font-variant-numeric:tabular-nums}.usa-rx-float{position:absolute;left:50%;top:0;font-size:16px;pointer-events:none}.usa-rx-picker{position:absolute;bottom:calc(100% + 6px);left:0;display:flex;gap:2px;padding:4px;border-radius:999px;background:#fff;box-shadow:0 10px 30px -10px rgba(15,23,42,.45);transform-origin:20% 100%;z-index:5}.usa-rx-picker[hidden]{display:none}.usa-rx-picker button{border:0;background:none;font-size:20px;width:32px;height:32px;border-radius:50%;cursor:pointer}.usa-rx-picker button:hover,.usa-rx-picker button:focus-visible{background:#f1f5f9}.usa-rx-pill:focus-visible,.usa-rx-add:focus-visible{outline:2px solid #7c5cff;outline-offset:2px}";
|
|
5432
5446
|
|
|
5433
5447
|
/** Parse "👍,❤️" + "3,1" into ordered [emoji, count] pairs (7.4). */
|
|
5434
5448
|
function parseReactions(emojis, counts = '') {
|
|
@@ -5530,10 +5544,10 @@ function defineReactions(tag = 'usa-reactions') {
|
|
|
5530
5544
|
}
|
|
5531
5545
|
}
|
|
5532
5546
|
return UsaReactions;
|
|
5533
|
-
}, { id: 'reactions', text: css$
|
|
5547
|
+
}, { id: 'reactions', text: css$i });
|
|
5534
5548
|
}
|
|
5535
5549
|
|
|
5536
|
-
var css$
|
|
5550
|
+
var css$h = "usa-notification-bell{position:relative;display:inline-block;font:400 13px/1.35 system-ui,sans-serif}.usa-nb-btn{position:relative;display:grid;place-items:center;width:42px;height:42px;border:0;border-radius:50%;background:var(--usa-nb-bg,#f1f5f9);color:var(--usa-nb-fg,#0f172a);cursor:pointer}.usa-nb-bell{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transform-origin:50% 12%}.usa-nb-badge{position:absolute;top:2px;right:2px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#ef4444;color:#fff;font:800 10px/17px system-ui,sans-serif;text-align:center}.usa-nb-badge:empty{display:none}.usa-nb-panel{position:absolute;top:calc(100% + 8px);right:0;width:min(280px,86vw);border-radius:14px;background:#fff;color:#0f172a;box-shadow:0 18px 40px -14px rgba(15,23,42,.45);overflow:hidden;z-index:20;transform-origin:90% 0}.usa-nb-panel[hidden]{display:none}.usa-nb-panel header{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid rgba(15,23,42,.08)}.usa-nb-read{border:0;background:none;color:#7c5cff;font:600 12px/1 system-ui,sans-serif;cursor:pointer}.usa-nb-list{max-height:220px;margin:0;padding:4px;list-style:none;overflow:auto}.usa-nb-item{display:flex;justify-content:space-between;gap:8px;padding:8px;border-radius:8px}.usa-nb-item[data-unread]{background:#f5f3ff;font-weight:600}.usa-nb-item[data-unread]::before{content:\"\";flex:0 0 7px;height:7px;margin-top:6px;border-radius:50%;background:#7c5cff}.usa-nb-item time{opacity:.5;font-size:11px;white-space:nowrap}.usa-nb-text{flex:1;min-width:0}.usa-nb-empty{margin:16px;text-align:center;opacity:.55}.usa-nb-btn:focus-visible,.usa-nb-read:focus-visible{outline:2px solid #7c5cff;outline-offset:2px}";
|
|
5537
5551
|
|
|
5538
5552
|
function defineNotificationBell(tag = 'usa-notification-bell') {
|
|
5539
5553
|
return base.defineElement(tag, (Base) => {
|
|
@@ -5628,10 +5642,10 @@ function defineNotificationBell(tag = 'usa-notification-bell') {
|
|
|
5628
5642
|
}
|
|
5629
5643
|
}
|
|
5630
5644
|
return UsaNotificationBell;
|
|
5631
|
-
}, { id: 'notification-bell', text: css$
|
|
5645
|
+
}, { id: 'notification-bell', text: css$h });
|
|
5632
5646
|
}
|
|
5633
5647
|
|
|
5634
|
-
var css$
|
|
5648
|
+
var css$g = "usa-presence{--s:var(--usa-pr2-size,48px);position:relative;display:inline-grid;place-items:center;width:var(--s);height:var(--s);vertical-align:middle}.usa-pr2-face{display:grid;place-items:center;width:100%;height:100%;border-radius:50%;overflow:hidden;background:linear-gradient(135deg,#a78bfa,#22d3ee);color:#fff;font:700 calc(var(--s) * .36)/1 system-ui,sans-serif}.usa-pr2-face img{width:100%;height:100%;object-fit:cover}.usa-pr2-dot,.usa-pr2-ripple{position:absolute;right:0;bottom:0;width:calc(var(--s) * .28);height:calc(var(--s) * .28);border-radius:50%;box-sizing:border-box}.usa-pr2-dot{border:2px solid var(--usa-pr2-ring,#fff);background:#94a3b8;transition:background-color .3s}.usa-pr2-ripple{background:#22c55e;pointer-events:none}usa-presence[data-state=online] .usa-pr2-dot{background:#22c55e}usa-presence[data-state=away] .usa-pr2-dot{background:#f59e0b}usa-presence[data-state=busy] .usa-pr2-dot{background:#ef4444}usa-presence[speaking] .usa-pr2-face{box-shadow:0 0 0 3px #22c55e;animation:usa-pr2-speak 1.2s ease-in-out infinite}@keyframes usa-pr2-speak{50%{box-shadow:0 0 0 6px rgba(34,197,94,.35)}}usa-presence[story]::before{content:\"\";position:absolute;inset:-4px;border-radius:50%;background:conic-gradient(#f59e0b,#ef4444,#d946ef,#7c3aed,#f59e0b);animation:usa-pr2-spin 3s linear infinite;z-index:-1}usa-presence[story] .usa-pr2-face{box-shadow:0 0 0 2px var(--usa-pr2-ring,#fff)}@keyframes usa-pr2-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){usa-presence[speaking] .usa-pr2-face,usa-presence[story]::before{animation:none}.usa-pr2-dot{transition:none}}";
|
|
5635
5649
|
|
|
5636
5650
|
/** Presence states (7.4). */
|
|
5637
5651
|
const PRESENCE_STATES = ['online', 'away', 'busy', 'offline'];
|
|
@@ -5701,10 +5715,10 @@ function definePresence(tag = 'usa-presence') {
|
|
|
5701
5715
|
}
|
|
5702
5716
|
}
|
|
5703
5717
|
return UsaPresence;
|
|
5704
|
-
}, { id: 'presence', text: css$
|
|
5718
|
+
}, { id: 'presence', text: css$g });
|
|
5705
5719
|
}
|
|
5706
5720
|
|
|
5707
|
-
var css$
|
|
5721
|
+
var css$f = "usa-leaderboard{display:block;width:var(--usa-lb-w,320px);max-width:100%;font:500 14px/1.2 system-ui,sans-serif}.usa-lb-list{margin:0;padding:0;list-style:none;display:grid;gap:4px}.usa-lb-row{display:grid;grid-template-columns:28px 30px 1fr auto auto;align-items:center;gap:8px;padding:6px 10px;border-radius:10px;background:var(--usa-lb-bg,rgba(15,23,42,.04));position:relative}.usa-lb-row[data-me]{box-shadow:inset 0 0 0 2px var(--usa-lb-accent,#7c5cff)}.usa-lb-rank{text-align:center;font-weight:800;font-size:15px}.usa-lb-av{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#a78bfa,#22d3ee) center/cover;color:#fff;font-weight:700;font-size:13px}.usa-lb-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usa-lb-delta{font:700 11px/1 system-ui,sans-serif;font-style:normal}.usa-lb-row[data-move=up] .usa-lb-delta{color:#16a34a}.usa-lb-row[data-move=down] .usa-lb-delta{color:#dc2626}.usa-lb-score{font-variant-numeric:tabular-nums;font-weight:800}.usa-lb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}";
|
|
5708
5722
|
|
|
5709
5723
|
/** Sort rows by score desc, then name (7.5). */
|
|
5710
5724
|
const rankRows = (rows) => [...rows].sort((a, b) => b.score - a.score || a.name.localeCompare(b.name));
|
|
@@ -5813,10 +5827,10 @@ function defineLeaderboard(tag = 'usa-leaderboard') {
|
|
|
5813
5827
|
}
|
|
5814
5828
|
}
|
|
5815
5829
|
return UsaLeaderboard;
|
|
5816
|
-
}, { id: 'leaderboard', text: css$
|
|
5830
|
+
}, { id: 'leaderboard', text: css$f });
|
|
5817
5831
|
}
|
|
5818
5832
|
|
|
5819
|
-
var css$
|
|
5833
|
+
var css$e = "usa-xp-bar{display:flex;align-items:center;gap:10px;width:var(--usa-xp-w,300px);max-width:100%;font:600 13px/1 system-ui,sans-serif}.usa-xp-lvl{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--usa-xp-accent,#7c5cff);color:#fff;font-size:15px;font-weight:800;box-shadow:0 0 0 3px rgba(124,92,255,.25)}.usa-xp-track{flex:1;min-width:0;height:12px;border-radius:99px;background:var(--usa-xp-track,rgba(15,23,42,.1));overflow:hidden}.usa-xp-fill{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--usa-xp-accent,#7c5cff),#22d3ee);transform-origin:0 50%;transform:scaleX(0)}.usa-xp-num{flex:none;font-variant-numeric:tabular-nums;opacity:.75}usa-xp-bar[data-levelup] .usa-xp-lvl{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.35)}.usa-xp-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}";
|
|
5820
5834
|
|
|
5821
5835
|
/** Apply `gain` XP to (level, xp) with `per` XP per level (7.5). */
|
|
5822
5836
|
function levelFor(level, xp, gain, per = 100) {
|
|
@@ -5913,10 +5927,10 @@ function defineXpBar(tag = 'usa-xp-bar') {
|
|
|
5913
5927
|
}
|
|
5914
5928
|
}
|
|
5915
5929
|
return UsaXpBar;
|
|
5916
|
-
}, { id: 'xp-bar', text: css$
|
|
5930
|
+
}, { id: 'xp-bar', text: css$e });
|
|
5917
5931
|
}
|
|
5918
5932
|
|
|
5919
|
-
var css$
|
|
5933
|
+
var css$d = "usa-badge-wall{display:block;width:var(--usa-bw-w,320px);max-width:100%;font:600 12px/1.2 system-ui,sans-serif}.usa-bw-count{margin:0 0 8px;font-size:13px;opacity:.75;font-variant-numeric:tabular-nums}.usa-bw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:8px;margin:0;padding:0;list-style:none}.usa-bw-badge{position:relative;display:grid;justify-items:center;gap:4px;padding:8px 4px;border-radius:12px;background:linear-gradient(160deg,#fde68a,#f59e0b);color:#422006;text-align:center;overflow:hidden}.usa-bw-icon{font-size:24px;line-height:1}.usa-bw-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usa-bw-badge[data-locked]{background:var(--usa-bw-locked,#e2e8f0);color:#64748b}.usa-bw-badge[data-locked] .usa-bw-icon{filter:grayscale(1);opacity:.45}.usa-bw-badge[data-locked]::after{content:\"🔒\";position:absolute;top:3px;right:4px;font-size:11px}.usa-bw-badge[data-shine]::before{content:\"\";position:absolute;inset:0;background:linear-gradient(110deg,transparent 35%,rgba(255,255,255,.75) 50%,transparent 65%) 120% 0/250% 100%;animation:usa-bw-shine 1s ease-in-out .3s both;pointer-events:none}@keyframes usa-bw-shine{to{background-position:-20% 0}}.usa-bw-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@media (prefers-reduced-motion:reduce){.usa-bw-badge[data-shine]::before{animation:none;display:none}}";
|
|
5920
5934
|
|
|
5921
5935
|
/** Unlocked / total counts for a badge list (7.5). */
|
|
5922
5936
|
const badgeProgress = (b) => ({ unlocked: b.filter((x) => !x.locked).length, total: b.length });
|
|
@@ -5983,10 +5997,10 @@ function defineBadgeWall(tag = 'usa-badge-wall') {
|
|
|
5983
5997
|
}
|
|
5984
5998
|
}
|
|
5985
5999
|
return UsaBadgeWall;
|
|
5986
|
-
}, { id: 'badge-wall', text: css$
|
|
6000
|
+
}, { id: 'badge-wall', text: css$d });
|
|
5987
6001
|
}
|
|
5988
6002
|
|
|
5989
|
-
var css$
|
|
6003
|
+
var css$c = "usa-prize-wheel{display:inline-block;--s:var(--usa-pw-size,200px);font:700 11px/1 system-ui,sans-serif}.usa-pw-box{position:relative;display:grid;place-items:center;width:var(--s);height:var(--s)}.usa-pw-wheel{position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 4px #fff,0 0 0 6px rgba(15,23,42,.15),0 8px 24px rgba(15,23,42,.2);will-change:transform}.usa-pw-label{position:absolute;left:50%;top:0;width:0;height:50%;display:flex;justify-content:center;padding-top:10px;transform-origin:0 100%;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.35);white-space:nowrap}.usa-pw-pointer{position:absolute;top:-10px;left:50%;margin-left:-9px;width:0;height:0;border:9px solid transparent;border-top:16px solid var(--usa-pw-pointer,#0f172a);border-bottom:0;z-index:2;transform-origin:50% 0}.usa-pw-btn{position:relative;z-index:1;width:30%;aspect-ratio:1;border:0;border-radius:50%;background:#fff;color:#0f172a;font:800 13px/1 system-ui,sans-serif;box-shadow:0 2px 8px rgba(15,23,42,.25);cursor:pointer}.usa-pw-btn:disabled{cursor:progress;opacity:.85}usa-prize-wheel[data-done] .usa-pw-wheel{box-shadow:0 0 0 4px #fff,0 0 0 6px #facc15,0 0 28px rgba(250,204,21,.6)}.usa-pw-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}";
|
|
5990
6004
|
|
|
5991
6005
|
/** Final wheel rotation (deg) that puts segment `index` of `count` under the top pointer after `turns` full turns (7.5). */
|
|
5992
6006
|
function wheelAngle(index, count, turns = 5) {
|
|
@@ -6066,10 +6080,10 @@ function definePrizeWheel(tag = 'usa-prize-wheel') {
|
|
|
6066
6080
|
}
|
|
6067
6081
|
}
|
|
6068
6082
|
return UsaPrizeWheel;
|
|
6069
|
-
}, { id: 'prize-wheel', text: css$
|
|
6083
|
+
}, { id: 'prize-wheel', text: css$c });
|
|
6070
6084
|
}
|
|
6071
6085
|
|
|
6072
|
-
var css$
|
|
6086
|
+
var css$b = "usa-globe{display:inline-block;width:var(--usa-gl-size,200px);max-width:100%;aspect-ratio:1;touch-action:pan-y;cursor:grab;user-select:none}usa-globe:active{cursor:grabbing}.usa-gl-svg{display:block;width:100%;height:100%;overflow:visible}.usa-gl-sea{fill:var(--usa-gl-sea,#1e3a8a)}.usa-gl-grid{fill:none;stroke:var(--usa-gl-grid,rgba(255,255,255,.35));stroke-width:.7}.usa-gl-dot{fill:var(--usa-gl-accent,#f59e0b);stroke:#fff;stroke-width:1}.usa-gl-ring{fill:none;stroke:var(--usa-gl-accent,#f59e0b);stroke-width:1.5;transform-box:fill-box;transform-origin:center;opacity:0}.usa-gl-mark[data-hidden]{display:none}.usa-gl-mark[data-active] .usa-gl-dot{fill:#ef4444}@media (prefers-reduced-motion:no-preference){.usa-gl-ring{animation:usa-gl-pulse 1.8s ease-out infinite}}@keyframes usa-gl-pulse{0%{transform:scale(.6);opacity:.9}100%{transform:scale(3.2);opacity:0}}";
|
|
6073
6087
|
|
|
6074
6088
|
const RAD = Math.PI / 180;
|
|
6075
6089
|
/** Orthographic projection on a unit sphere seen from longitude `lon0`, tilted by `tilt` degrees (7.6). */
|
|
@@ -6226,10 +6240,10 @@ function defineGlobe(tag = 'usa-globe') {
|
|
|
6226
6240
|
}
|
|
6227
6241
|
}
|
|
6228
6242
|
return UsaGlobe;
|
|
6229
|
-
}, { id: 'globe', text: css$
|
|
6243
|
+
}, { id: 'globe', text: css$b });
|
|
6230
6244
|
}
|
|
6231
6245
|
|
|
6232
|
-
var css$
|
|
6246
|
+
var css$a = "usa-location-card{display:block;width:var(--usa-lc-w,280px);max-width:100%;font:500 13px/1.35 system-ui,sans-serif}.usa-lc{border-radius:16px;overflow:hidden;background:var(--usa-lc-bg,#fff);color:var(--usa-lc-fg,#0f172a);box-shadow:0 10px 28px -14px rgba(15,23,42,.45);border:1px solid rgba(15,23,42,.08)}.usa-lc-map{position:relative;height:var(--usa-lc-map-h,110px);background:var(--usa-lc-land,#e8efe4);overflow:hidden}.usa-lc-map svg{display:block;width:100%;height:100%}.usa-lc-street{fill:none;stroke:#fff;stroke-width:7;stroke-linecap:round}.usa-lc-route{fill:none;stroke:var(--usa-lc-accent,#2563eb);stroke-width:4;stroke-linecap:round;stroke-dasharray:100}.usa-lc-from{fill:#fff;stroke:var(--usa-lc-accent,#2563eb);stroke-width:3}.usa-lc-pin{position:absolute;left:70%;top:calc(48% - 8px);width:22px;height:22px;transform:translate(-50%,-100%);border-radius:50%;background:var(--usa-lc-pin,#ef4444);box-shadow:0 4px 8px rgba(0,0,0,.25)}.usa-lc-pin::after{content:\"\";position:absolute;inset:6px;border-radius:50%;background:#fff}.usa-lc-pin::before{content:\"\";position:absolute;left:50%;bottom:-8px;width:0;height:0;border:6px solid transparent;border-top:9px solid var(--usa-lc-pin,#ef4444);border-bottom:0;transform:translateX(-50%)}.usa-lc-ring{position:absolute;left:70%;top:48%;width:18px;height:18px;border-radius:50%;border:2px solid var(--usa-lc-pin,#ef4444);transform:translate(-50%,-50%);opacity:0;pointer-events:none}.usa-lc-body{padding:10px 14px 12px}.usa-lc-name{margin:0;font-size:15px;font-weight:750}.usa-lc-addr{margin:2px 0 0;opacity:.7}.usa-lc-meta{display:flex;align-items:center;gap:10px;margin:8px 0 0}.usa-lc-meta:empty{display:none}.usa-lc-dist{font-weight:700;font-variant-numeric:tabular-nums}.usa-lc-go{margin-left:auto;color:var(--usa-lc-accent,#2563eb);font-weight:700;text-decoration:none}.usa-lc-go:hover,.usa-lc-go:focus-visible{text-decoration:underline}";
|
|
6233
6247
|
|
|
6234
6248
|
/** Great-circle distance in km between two lat/lon points (7.6). */
|
|
6235
6249
|
function haversine(lat1, lon1, lat2, lon2) {
|
|
@@ -6245,7 +6259,7 @@ function formatDistance(km, unit = 'km') {
|
|
|
6245
6259
|
}
|
|
6246
6260
|
return km < 1 ? `${Math.round(km * 1000)} m` : `${km < 10 ? km.toFixed(1) : Math.round(km)} km`;
|
|
6247
6261
|
}
|
|
6248
|
-
const esc$
|
|
6262
|
+
const esc$6 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6249
6263
|
function defineLocationCard(tag = 'usa-location-card') {
|
|
6250
6264
|
return base.defineElement(tag, (Base) => {
|
|
6251
6265
|
class UsaLocationCard extends Base {
|
|
@@ -6270,7 +6284,7 @@ function defineLocationCard(tag = 'usa-location-card') {
|
|
|
6270
6284
|
const dist = this.str('distance') || (km === null ? '' : formatDistance(km, this.str('unit') === 'mi' ? 'mi' : 'km'));
|
|
6271
6285
|
const href = this.str('href');
|
|
6272
6286
|
const origin = km !== null;
|
|
6273
|
-
this.insertAdjacentHTML('beforeend', `<article class="usa-lc" data-usa-part aria-label="${esc$
|
|
6287
|
+
this.insertAdjacentHTML('beforeend', `<article class="usa-lc" data-usa-part aria-label="${esc$6(name)}"><div class="usa-lc-map" aria-hidden="true"><svg viewBox="0 0 240 120" preserveAspectRatio="xMidYMid slice"><path class="usa-lc-street" d="M0 30H240M0 78H240M40 0V120M120 0V120M196 0V120M0 112L240 8"/>${origin ? '<path class="usa-lc-route" pathLength="100" d="M28 100C60 100 64 78 96 78S120 40 160 40 168 58 168 58"/><circle class="usa-lc-from" cx="28" cy="100" r="4"/>' : ''}</svg><span class="usa-lc-ring"></span><span class="usa-lc-pin"></span></div><div class="usa-lc-body"><h3 class="usa-lc-name">${esc$6(name)}</h3>${this.str('address') ? `<p class="usa-lc-addr">${esc$6(this.str('address'))}</p>` : ''}<p class="usa-lc-meta">${dist ? `<span class="usa-lc-dist">${esc$6(dist)}</span>` : ''}${href ? `<a class="usa-lc-go" href="${esc$6(href)}" target="_blank" rel="noopener">Directions</a>` : ''}</p></div></article>`);
|
|
6274
6288
|
if (origin)
|
|
6275
6289
|
this.setAttribute('data-route', '');
|
|
6276
6290
|
else
|
|
@@ -6303,10 +6317,10 @@ function defineLocationCard(tag = 'usa-location-card') {
|
|
|
6303
6317
|
}
|
|
6304
6318
|
}
|
|
6305
6319
|
return UsaLocationCard;
|
|
6306
|
-
}, { id: 'location-card', text: css$
|
|
6320
|
+
}, { id: 'location-card', text: css$a });
|
|
6307
6321
|
}
|
|
6308
6322
|
|
|
6309
|
-
var css$
|
|
6323
|
+
var css$9 = "usa-field{display:block;width:var(--usa-fld-w,280px);max-width:100%;font:500 14px/1.3 system-ui,sans-serif;--usa-fld-accent:#6366f1;--usa-fld-bad:#e11d48;--usa-fld-good:#16a34a}.usa-fld{position:relative;padding-top:18px}.usa-fld-input{display:block;box-sizing:border-box;width:100%;padding:8px 30px 8px 2px;border:0;border-bottom:2px solid var(--usa-fld-rule,rgba(100,116,139,.45));background:transparent;color:inherit;font:inherit;outline:none;border-radius:0}.usa-fld-label{position:absolute;left:2px;top:26px;color:var(--usa-fld-muted,#64748b);pointer-events:none;transform-origin:0 0;transition:transform .22s cubic-bezier(.2,.8,.2,1),color .2s}usa-field[data-focus] .usa-fld-label,usa-field[data-filled] .usa-fld-label,.usa-fld-input:not(:placeholder-shown)+.usa-fld-label{transform:translateY(-24px) scale(.8)}usa-field[data-focus] .usa-fld-label{color:var(--usa-fld-accent)}.usa-fld-line{position:absolute;left:0;right:0;top:calc(18px + 2.3em - 1px);height:2px;background:var(--usa-fld-accent);transform:scaleX(0);transition:transform .3s cubic-bezier(.2,.8,.2,1)}usa-field[data-focus] .usa-fld-line{transform:scaleX(1)}usa-field[data-invalid] .usa-fld-line{transform:scaleX(1);background:var(--usa-fld-bad)}usa-field[data-invalid] .usa-fld-label{color:var(--usa-fld-bad)}.usa-fld-ok{position:absolute;right:2px;top:24px;width:20px;height:20px;fill:none;stroke:var(--usa-fld-good);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.usa-fld-ok path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset .35s ease-out}usa-field[data-valid] .usa-fld-ok path{stroke-dashoffset:0}.usa-fld-meter{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:6px}.usa-fld-meter i{height:4px;border-radius:2px;background:rgba(100,116,139,.25);transform-origin:0 50%;transition:background .25s}.usa-fld-meter[data-score=\"1\"] i:nth-child(-n+1){background:#ef4444}.usa-fld-meter[data-score=\"2\"] i:nth-child(-n+2){background:#f59e0b}.usa-fld-meter[data-score=\"3\"] i:nth-child(-n+3){background:#84cc16}.usa-fld-meter[data-score=\"4\"] i{background:#16a34a}.usa-fld-msg{margin:4px 0 0;min-height:1.3em;font-size:12px;color:var(--usa-fld-muted,#64748b)}usa-field[data-invalid] .usa-fld-msg{color:var(--usa-fld-bad)}@media (prefers-reduced-motion:reduce){.usa-fld-label,.usa-fld-line,.usa-fld-ok path,.usa-fld-meter i{transition:none}}";
|
|
6310
6324
|
|
|
6311
6325
|
/** 0–4 password strength score with a label (7.7). */
|
|
6312
6326
|
function passwordStrength(pw) {
|
|
@@ -6328,15 +6342,15 @@ function passwordStrength(pw) {
|
|
|
6328
6342
|
const score = Math.min(4, s);
|
|
6329
6343
|
return { score, label: ['Too short', 'Weak', 'Fair', 'Good', 'Strong'][score] };
|
|
6330
6344
|
}
|
|
6331
|
-
const esc$
|
|
6332
|
-
let uid = 0;
|
|
6345
|
+
const esc$5 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6346
|
+
let uid$1 = 0;
|
|
6333
6347
|
const PASS = ['type', 'name', 'required', 'pattern', 'minlength', 'maxlength', 'autocomplete', 'inputmode', 'placeholder'];
|
|
6334
6348
|
function defineField(tag = 'usa-field') {
|
|
6335
6349
|
return base.defineElement(tag, (Base) => {
|
|
6336
6350
|
class UsaField extends Base {
|
|
6337
6351
|
constructor() {
|
|
6338
6352
|
super(...arguments);
|
|
6339
|
-
this._id = `usa-fld-${++uid}`;
|
|
6353
|
+
this._id = `usa-fld-${++uid$1}`;
|
|
6340
6354
|
this._checking = false;
|
|
6341
6355
|
}
|
|
6342
6356
|
static get observedAttributes() {
|
|
@@ -6362,9 +6376,9 @@ function defineField(tag = 'usa-field') {
|
|
|
6362
6376
|
const id = this._id;
|
|
6363
6377
|
const strength = this.flag('strength');
|
|
6364
6378
|
const attrs = PASS.filter((a) => this.hasAttribute(a))
|
|
6365
|
-
.map((a) => (a === 'required' ? ' required' : ` ${a}="${esc$
|
|
6379
|
+
.map((a) => (a === 'required' ? ' required' : ` ${a}="${esc$5(this.str(a))}"`))
|
|
6366
6380
|
.join('');
|
|
6367
|
-
this.insertAdjacentHTML('beforeend', `<div class="usa-fld" data-usa-part><input class="usa-fld-input" id="${id}"${attrs} aria-describedby="${id}-msg"${this.hasAttribute('type') ? '' : ' type="text"'}><label class="usa-fld-label" for="${id}">${esc$
|
|
6381
|
+
this.insertAdjacentHTML('beforeend', `<div class="usa-fld" data-usa-part><input class="usa-fld-input" id="${id}"${attrs} aria-describedby="${id}-msg"${this.hasAttribute('type') ? '' : ' type="text"'}><label class="usa-fld-label" for="${id}">${esc$5(this.str('label', 'Label'))}</label><span class="usa-fld-line" aria-hidden="true"></span><svg class="usa-fld-ok" viewBox="0 0 24 24" aria-hidden="true"><path pathLength="1" d="M5 12.5l4.5 4.5L19 7.5"/></svg>${strength ? '<div class="usa-fld-meter" aria-hidden="true"><i></i><i></i><i></i><i></i></div>' : ''}<p class="usa-fld-msg" id="${id}-msg" aria-live="polite">${esc$5(this.str('hint'))}</p></div>`);
|
|
6368
6382
|
const input = this.input;
|
|
6369
6383
|
input.value = keep;
|
|
6370
6384
|
this.listen(input, 'input', () => {
|
|
@@ -6432,10 +6446,10 @@ function defineField(tag = 'usa-field') {
|
|
|
6432
6446
|
}
|
|
6433
6447
|
}
|
|
6434
6448
|
return UsaField;
|
|
6435
|
-
}, { id: 'field', text: css$
|
|
6449
|
+
}, { id: 'field', text: css$9 });
|
|
6436
6450
|
}
|
|
6437
6451
|
|
|
6438
|
-
var css$
|
|
6452
|
+
var css$8 = "usa-otp{display:inline-block;max-width:100%;--usa-otp-accent:#6366f1;--usa-otp-size:44px}.usa-otp{display:flex;gap:var(--usa-otp-gap,8px)}.usa-otp-box{box-sizing:border-box;width:var(--usa-otp-size);height:calc(var(--usa-otp-size)*1.18);min-width:0;flex:0 1 auto;padding:0;text-align:center;font:700 calc(var(--usa-otp-size)*.48)/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:inherit;background:var(--usa-otp-bg,rgba(148,163,184,.12));border:2px solid var(--usa-otp-rule,rgba(100,116,139,.35));border-radius:10px;outline:none;caret-color:var(--usa-otp-accent);transition:border-color .2s,box-shadow .2s,background .2s}.usa-otp-box:focus{border-color:var(--usa-otp-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--usa-otp-accent) 22%,transparent)}.usa-otp-box[data-filled]{border-color:color-mix(in srgb,var(--usa-otp-accent) 60%,transparent)}usa-otp[data-state=error] .usa-otp-box{border-color:#e11d48;background:rgba(225,29,72,.08)}usa-otp[data-state=success] .usa-otp-box{border-color:#16a34a;background:rgba(22,163,74,.1);color:#15803d}@media (prefers-reduced-motion:reduce){.usa-otp-box{transition:none}}";
|
|
6439
6453
|
|
|
6440
6454
|
/** Keep only the characters an OTP accepts (7.7). */
|
|
6441
6455
|
function sanitizeCode(s, mode = 'numeric') {
|
|
@@ -6566,10 +6580,10 @@ function defineOtp(tag = 'usa-otp') {
|
|
|
6566
6580
|
}
|
|
6567
6581
|
}
|
|
6568
6582
|
return UsaOtp;
|
|
6569
|
-
}, { id: 'otp', text: css$
|
|
6583
|
+
}, { id: 'otp', text: css$8 });
|
|
6570
6584
|
}
|
|
6571
6585
|
|
|
6572
|
-
var css$
|
|
6586
|
+
var css$7 = "usa-upload-progress{display:block;width:var(--usa-up-w,300px);max-width:100%;font:500 13px/1.3 system-ui,sans-serif;--usa-up-accent:#6366f1}.usa-up{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--usa-up-bg,rgba(148,163,184,.1));border:1px solid rgba(100,116,139,.18)}.usa-up-icon{flex:none;display:grid;place-items:center;width:34px;height:40px;border-radius:6px;background:var(--usa-up-accent);color:#fff;font:800 9px/1 system-ui,sans-serif;letter-spacing:.04em}.usa-up-main{flex:1;min-width:0}.usa-up-top,.usa-up-sub{display:flex;align-items:center;gap:8px}.usa-up-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:650}.usa-up-pct{font-variant-numeric:tabular-nums;font-weight:700;color:var(--usa-up-accent)}.usa-up-track{position:relative;height:6px;margin:6px 0 4px;border-radius:3px;background:rgba(100,116,139,.2);overflow:hidden}.usa-up-fill{position:absolute;inset:0;border-radius:inherit;background:var(--usa-up-accent);transform-origin:0 50%;transform:scaleX(0);overflow:hidden}usa-upload-progress[data-state=uploading] .usa-up-fill::after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent);transform:translateX(-100%);animation:usa-up-shine 1.2s linear infinite}@keyframes usa-up-shine{to{transform:translateX(100%)}}.usa-up-sub{font-size:11.5px;color:var(--usa-up-muted,#64748b)}.usa-up-msg{flex:1;color:#e11d48}.usa-up-retry{display:none;border:0;background:none;padding:0;font:inherit;font-weight:700;color:var(--usa-up-accent);cursor:pointer}usa-upload-progress[data-state=error] .usa-up-retry{display:inline}usa-upload-progress[data-state=error] .usa-up-fill{background:#e11d48}usa-upload-progress[data-state=error] .usa-up-icon{background:#e11d48}usa-upload-progress[data-state=done] .usa-up-fill{background:#16a34a}.usa-up-ok{flex:none;width:0;height:24px;fill:none;stroke:#16a34a;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;transition:width .25s}.usa-up-ok circle{opacity:.25}.usa-up-ok path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset .4s .15s ease-out}usa-upload-progress[data-state=done] .usa-up-ok{width:24px}usa-upload-progress[data-state=done] .usa-up-ok path{stroke-dashoffset:0}@media (prefers-reduced-motion:reduce){.usa-up-fill::after{animation:none!important;display:none}.usa-up-ok,.usa-up-ok path{transition:none}}";
|
|
6573
6587
|
|
|
6574
6588
|
/** 1536 → "1.5 KB", 2_400_000 → "2.3 MB" (7.7). */
|
|
6575
6589
|
function formatBytes(n) {
|
|
@@ -6583,7 +6597,7 @@ function formatBytes(n) {
|
|
|
6583
6597
|
}
|
|
6584
6598
|
return `${i === 0 ? Math.round(n) : n < 10 ? n.toFixed(1) : Math.round(n)} ${u[i]}`;
|
|
6585
6599
|
}
|
|
6586
|
-
const esc$
|
|
6600
|
+
const esc$4 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6587
6601
|
function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
6588
6602
|
return base.defineElement(tag, (Base) => {
|
|
6589
6603
|
class UsaUploadProgress extends Base {
|
|
@@ -6611,7 +6625,7 @@ function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
|
6611
6625
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6612
6626
|
const name = this.str('name', 'file');
|
|
6613
6627
|
const size = formatBytes(this.num('size', NaN));
|
|
6614
|
-
this.insertAdjacentHTML('beforeend', `<div class="usa-up" data-usa-part><span class="usa-up-icon" aria-hidden="true">${esc$
|
|
6628
|
+
this.insertAdjacentHTML('beforeend', `<div class="usa-up" data-usa-part><span class="usa-up-icon" aria-hidden="true">${esc$4((name.split('.').pop() || '').slice(0, 4).toUpperCase())}</span><div class="usa-up-main"><div class="usa-up-top"><span class="usa-up-name">${esc$4(name)}</span><span class="usa-up-pct"></span></div><div class="usa-up-track" role="progressbar" aria-label="Uploading ${esc$4(name)}" aria-valuemin="0" aria-valuemax="100"><span class="usa-up-fill"></span></div><div class="usa-up-sub"><span class="usa-up-size">${esc$4(size)}</span><span class="usa-up-msg" aria-live="polite"></span><button type="button" class="usa-up-retry">Retry</button></div></div><svg class="usa-up-ok" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path pathLength="1" d="M7 12.5l3.2 3.2L17 9"/></svg></div>`);
|
|
6615
6629
|
this.listen(this.querySelector('.usa-up-retry'), 'click', () => this.emit('retry', { name }));
|
|
6616
6630
|
this._shown = 0;
|
|
6617
6631
|
this.render(true);
|
|
@@ -6652,12 +6666,12 @@ function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
|
6652
6666
|
}
|
|
6653
6667
|
}
|
|
6654
6668
|
return UsaUploadProgress;
|
|
6655
|
-
}, { id: 'upload-progress', text: css$
|
|
6669
|
+
}, { id: 'upload-progress', text: css$7 });
|
|
6656
6670
|
}
|
|
6657
6671
|
|
|
6658
|
-
var css$
|
|
6672
|
+
var css$6 = "usa-chat-composer{display:block;width:var(--usa-cc-w,100%);max-width:100%;font:500 14px/1.45 system-ui,sans-serif;--usa-cc-accent:#6366f1}.usa-cc{position:relative;display:flex;align-items:flex-end;gap:8px;padding:8px 8px 8px 14px;border-radius:22px;background:var(--usa-cc-bg,#fff);color:var(--usa-cc-fg,#0f172a);border:1px solid rgba(100,116,139,.28);box-shadow:0 6px 20px -12px rgba(15,23,42,.4)}.usa-cc-glow{position:absolute;inset:-2px;border-radius:24px;padding:2px;background:conic-gradient(from var(--usa-cc-a,0deg),#6366f1,#ec4899,#f59e0b,#22d3ee,#6366f1);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:0;transition:opacity .3s;pointer-events:none}@property --usa-cc-a{syntax:\"<angle>\";inherits:false;initial-value:0deg}usa-chat-composer[data-busy] .usa-cc-glow{opacity:1;animation:usa-cc-spin 2.4s linear infinite}@keyframes usa-cc-spin{to{--usa-cc-a:360deg}}.usa-cc-input{flex:1;min-width:0;resize:none;border:0;outline:none;background:transparent;color:inherit;font:inherit;padding:6px 0;max-height:12em;overflow-y:auto}.usa-cc-send{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:0;background:rgba(100,116,139,.25);color:#fff;cursor:pointer;transition:background .2s}usa-chat-composer[data-ready] .usa-cc-send{background:var(--usa-cc-accent)}.usa-cc-send:focus-visible{outline:2px solid var(--usa-cc-accent);outline-offset:2px}.usa-cc-send svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.usa-cc-arrow{transition:transform .25s,opacity .2s;transform-origin:center}.usa-cc-stop{fill:currentColor;stroke:none;opacity:0;transform:scale(.4);transform-origin:12px 12px;transition:transform .25s,opacity .2s}usa-chat-composer[data-busy] .usa-cc-arrow{opacity:0;transform:scale(.4)}usa-chat-composer[data-busy] .usa-cc-stop{opacity:1;transform:none}@media (prefers-reduced-motion:reduce){usa-chat-composer[data-busy] .usa-cc-glow{animation:none}.usa-cc-arrow,.usa-cc-stop,.usa-cc-glow{transition:none}}";
|
|
6659
6673
|
|
|
6660
|
-
const esc$
|
|
6674
|
+
const esc$3 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6661
6675
|
function defineChatComposer(tag = 'usa-chat-composer') {
|
|
6662
6676
|
return base.defineElement(tag, (Base) => {
|
|
6663
6677
|
class UsaChatComposer extends Base {
|
|
@@ -6687,7 +6701,7 @@ function defineChatComposer(tag = 'usa-chat-composer') {
|
|
|
6687
6701
|
const keep = this.area?.value ?? this.str('value');
|
|
6688
6702
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6689
6703
|
const label = this.str('label', 'Message');
|
|
6690
|
-
this.insertAdjacentHTML('beforeend', `<div class="usa-cc" data-usa-part><span class="usa-cc-glow" aria-hidden="true"></span><textarea class="usa-cc-input" rows="1" aria-label="${esc$
|
|
6704
|
+
this.insertAdjacentHTML('beforeend', `<div class="usa-cc" data-usa-part><span class="usa-cc-glow" aria-hidden="true"></span><textarea class="usa-cc-input" rows="1" aria-label="${esc$3(label)}" placeholder="${esc$3(this.str('placeholder', 'Ask anything…'))}"></textarea><button type="button" class="usa-cc-send" aria-label="Send"><svg viewBox="0 0 24 24" aria-hidden="true"><path class="usa-cc-arrow" d="M12 19V5M5.5 11.5L12 5l6.5 6.5"/><rect class="usa-cc-stop" x="7" y="7" width="10" height="10" rx="2"/></svg></button></div>`);
|
|
6691
6705
|
const a = this.area;
|
|
6692
6706
|
a.value = keep;
|
|
6693
6707
|
this.listen(a, 'input', () => this.sync());
|
|
@@ -6753,10 +6767,10 @@ function defineChatComposer(tag = 'usa-chat-composer') {
|
|
|
6753
6767
|
}
|
|
6754
6768
|
}
|
|
6755
6769
|
return UsaChatComposer;
|
|
6756
|
-
}, { id: 'chat-composer', text: css$
|
|
6770
|
+
}, { id: 'chat-composer', text: css$6 });
|
|
6757
6771
|
}
|
|
6758
6772
|
|
|
6759
|
-
var css$
|
|
6773
|
+
var css$5 = "usa-suggestion-chips{display:block;max-width:100%;font:500 13px/1.2 system-ui,sans-serif;--usa-sc-accent:#6366f1}.usa-sc{display:flex;flex-wrap:wrap;gap:8px}.usa-sc>span{display:contents}.usa-sc-chip{padding:8px 13px;border-radius:999px;border:1px solid color-mix(in srgb,var(--usa-sc-accent) 35%,transparent);background:color-mix(in srgb,var(--usa-sc-accent) 8%,var(--usa-sc-bg,#fff));color:inherit;font:inherit;cursor:pointer;transition:background .2s,border-color .2s,opacity .3s,transform .3s}.usa-sc-chip:hover,.usa-sc-chip:focus-visible{background:color-mix(in srgb,var(--usa-sc-accent) 16%,var(--usa-sc-bg,#fff));outline:none;border-color:var(--usa-sc-accent)}.usa-sc-chip[data-picked]{background:var(--usa-sc-accent);border-color:var(--usa-sc-accent);color:#fff}.usa-sc-chip[data-gone]{opacity:0;transform:scale(.85);pointer-events:none}@media (prefers-reduced-motion:reduce){.usa-sc-chip{transition:none}}";
|
|
6760
6774
|
|
|
6761
6775
|
/** "a | b|c" → ["a", "b", "c"] (7.8). */
|
|
6762
6776
|
function parseChips(s) {
|
|
@@ -6765,7 +6779,7 @@ function parseChips(s) {
|
|
|
6765
6779
|
.map((t) => t.trim())
|
|
6766
6780
|
.filter(Boolean);
|
|
6767
6781
|
}
|
|
6768
|
-
const esc = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6782
|
+
const esc$2 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6769
6783
|
function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
6770
6784
|
return base.defineElement(tag, (Base) => {
|
|
6771
6785
|
class UsaSuggestionChips extends Base {
|
|
@@ -6800,7 +6814,7 @@ function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
|
6800
6814
|
Array.from(this.children).forEach((c) => !c.hasAttribute('data-usa-part') && c.setAttribute('hidden', ''));
|
|
6801
6815
|
}
|
|
6802
6816
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6803
|
-
this.insertAdjacentHTML('beforeend', `<div class="usa-sc" role="list" aria-label="${esc(this.str('label', 'Suggestions'))}" data-usa-part>${items.map((t, i) => `<span role="listitem"><button type="button" class="usa-sc-chip" data-i="${i}">${esc(t)}</button></span>`).join('')}</div>`);
|
|
6817
|
+
this.insertAdjacentHTML('beforeend', `<div class="usa-sc" role="list" aria-label="${esc$2(this.str('label', 'Suggestions'))}" data-usa-part>${items.map((t, i) => `<span role="listitem"><button type="button" class="usa-sc-chip" data-i="${i}">${esc$2(t)}</button></span>`).join('')}</div>`);
|
|
6804
6818
|
const chips = Array.from(this.querySelectorAll('.usa-sc-chip'));
|
|
6805
6819
|
chips.forEach((c, i) => {
|
|
6806
6820
|
this.listen(c, 'click', () => this.pick(i));
|
|
@@ -6841,10 +6855,10 @@ function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
|
6841
6855
|
}
|
|
6842
6856
|
}
|
|
6843
6857
|
return UsaSuggestionChips;
|
|
6844
|
-
}, { id: 'suggestion-chips', text: css$
|
|
6858
|
+
}, { id: 'suggestion-chips', text: css$5 });
|
|
6845
6859
|
}
|
|
6846
6860
|
|
|
6847
|
-
var css = "usa-voice-button{display:inline-block;--usa-vb-accent:#6366f1;--usa-vb-size:52px}.usa-vb{display:flex;align-items:center;gap:12px}.usa-vb-btn{position:relative;display:grid;place-items:center;width:var(--usa-vb-size);height:var(--usa-vb-size);border-radius:50%;border:0;background:var(--usa-vb-idle,#e2e8f0);color:#334155;cursor:pointer;transition:background .2s,color .2s}.usa-vb-btn:focus-visible{outline:2px solid var(--usa-vb-accent);outline-offset:3px}.usa-vb-btn svg{position:relative;width:46%;height:46%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}.usa-vb-btn svg rect{fill:currentColor;stroke:none}.usa-vb-halo{position:absolute;inset:0;border-radius:50%;background:var(--usa-vb-accent);opacity:0;transition:transform .12s linear}usa-voice-button[listening] .usa-vb-btn{background:var(--usa-vb-accent);color:#fff}usa-voice-button[listening] .usa-vb-halo{opacity:.25;animation:usa-vb-breathe 1.6s ease-in-out infinite}usa-voice-button[data-live] .usa-vb-halo{animation:none}@keyframes usa-vb-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.35)}}.usa-vb-bars{display:flex;align-items:center;gap:3px;height:calc(var(--usa-vb-size)*.6);opacity:.25;transition:opacity .2s}.usa-vb-bars i{display:block;width:4px;height:100%;border-radius:2px;background:var(--usa-vb-accent);transform:scaleY(.15);transition:transform .1s linear}usa-voice-button[listening] .usa-vb-bars{opacity:1}usa-voice-button[listening]:not([data-live]) .usa-vb-bars i{animation:usa-vb-wave 1s ease-in-out infinite}.usa-vb-bars i:nth-child(2){animation-delay:-.15s!important}.usa-vb-bars i:nth-child(3){animation-delay:-.3s!important}.usa-vb-bars i:nth-child(4){animation-delay:-.45s!important}.usa-vb-bars i:nth-child(5){animation-delay:-.6s!important}.usa-vb-bars i:nth-child(6){animation-delay:-.75s!important}.usa-vb-bars i:nth-child(7){animation-delay:-.9s!important}@keyframes usa-vb-wave{0%,100%{transform:scaleY(.2)}50%{transform:scaleY(.9)}}@media (prefers-reduced-motion:reduce){usa-voice-button[listening] .usa-vb-halo,usa-voice-button[listening] .usa-vb-bars i{animation:none!important}.usa-vb-bars i{transition:none}}";
|
|
6861
|
+
var css$4 = "usa-voice-button{display:inline-block;--usa-vb-accent:#6366f1;--usa-vb-size:52px}.usa-vb{display:flex;align-items:center;gap:12px}.usa-vb-btn{position:relative;display:grid;place-items:center;width:var(--usa-vb-size);height:var(--usa-vb-size);border-radius:50%;border:0;background:var(--usa-vb-idle,#e2e8f0);color:#334155;cursor:pointer;transition:background .2s,color .2s}.usa-vb-btn:focus-visible{outline:2px solid var(--usa-vb-accent);outline-offset:3px}.usa-vb-btn svg{position:relative;width:46%;height:46%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}.usa-vb-btn svg rect{fill:currentColor;stroke:none}.usa-vb-halo{position:absolute;inset:0;border-radius:50%;background:var(--usa-vb-accent);opacity:0;transition:transform .12s linear}usa-voice-button[listening] .usa-vb-btn{background:var(--usa-vb-accent);color:#fff}usa-voice-button[listening] .usa-vb-halo{opacity:.25;animation:usa-vb-breathe 1.6s ease-in-out infinite}usa-voice-button[data-live] .usa-vb-halo{animation:none}@keyframes usa-vb-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.35)}}.usa-vb-bars{display:flex;align-items:center;gap:3px;height:calc(var(--usa-vb-size)*.6);opacity:.25;transition:opacity .2s}.usa-vb-bars i{display:block;width:4px;height:100%;border-radius:2px;background:var(--usa-vb-accent);transform:scaleY(.15);transition:transform .1s linear}usa-voice-button[listening] .usa-vb-bars{opacity:1}usa-voice-button[listening]:not([data-live]) .usa-vb-bars i{animation:usa-vb-wave 1s ease-in-out infinite}.usa-vb-bars i:nth-child(2){animation-delay:-.15s!important}.usa-vb-bars i:nth-child(3){animation-delay:-.3s!important}.usa-vb-bars i:nth-child(4){animation-delay:-.45s!important}.usa-vb-bars i:nth-child(5){animation-delay:-.6s!important}.usa-vb-bars i:nth-child(6){animation-delay:-.75s!important}.usa-vb-bars i:nth-child(7){animation-delay:-.9s!important}@keyframes usa-vb-wave{0%,100%{transform:scaleY(.2)}50%{transform:scaleY(.9)}}@media (prefers-reduced-motion:reduce){usa-voice-button[listening] .usa-vb-halo,usa-voice-button[listening] .usa-vb-bars i{animation:none!important}.usa-vb-bars i{transition:none}}";
|
|
6848
6862
|
|
|
6849
6863
|
/** Bar heights (0–1) for a level and a phase, centre bars tallest (7.8). */
|
|
6850
6864
|
function waveBars(level, n = 5, phase = 0) {
|
|
@@ -6916,7 +6930,424 @@ function defineVoiceButton(tag = 'usa-voice-button') {
|
|
|
6916
6930
|
}
|
|
6917
6931
|
}
|
|
6918
6932
|
return UsaVoiceButton;
|
|
6919
|
-
}, { id: 'voice-button', text: css });
|
|
6933
|
+
}, { id: 'voice-button', text: css$4 });
|
|
6934
|
+
}
|
|
6935
|
+
|
|
6936
|
+
var css$3 = "usa-command-palette{display:contents;--usa-cp-accent:#6366f1}usa-command-palette>option{display:none}.usa-cp{width:min(560px,calc(100vw - 24px));max-width:none;padding:0;margin:12vh auto auto;border:0;border-radius:16px;background:transparent;color:inherit;overflow:visible}.usa-cp::backdrop{background:rgba(15,23,42,.35);backdrop-filter:blur(3px)}.usa-cp-box{border-radius:16px;background:var(--usa-cp-bg,#fff);color:var(--usa-cp-fg,#0f172a);box-shadow:0 24px 60px -20px rgba(15,23,42,.55);border:1px solid rgba(100,116,139,.2);overflow:hidden;font:500 14px/1.3 system-ui,sans-serif}.usa-cp-q{box-sizing:border-box;width:100%;padding:16px 18px;border:0;border-bottom:1px solid rgba(100,116,139,.18);background:transparent;color:inherit;font:inherit;font-size:16px;outline:none}.usa-cp-list{position:relative;max-height:min(340px,50vh);overflow-y:auto;padding:6px}.usa-cp-hl{position:absolute;left:6px;right:6px;top:0;border-radius:10px;background:color-mix(in srgb,var(--usa-cp-accent) 12%,transparent);pointer-events:none;opacity:0}.usa-cp-group{padding:8px 10px 4px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;opacity:.55}.usa-cp-item{position:relative;display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:10px;cursor:pointer}.usa-cp-item[aria-selected=true] .usa-cp-label{color:var(--usa-cp-accent)}.usa-cp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usa-cp-label mark{background:none;color:var(--usa-cp-accent);font-weight:800}.usa-cp-keys{display:flex;gap:3px}.usa-cp-keys kbd,usa-shortcut kbd{display:inline-grid;place-items:center;min-width:1.6em;padding:2px 5px;border-radius:5px;border:1px solid rgba(100,116,139,.35);border-bottom-width:2px;background:var(--usa-kbd-bg,rgba(148,163,184,.12));font:600 11px/1.3 system-ui,sans-serif;color:inherit}.usa-cp-empty{margin:0;padding:18px;text-align:center;opacity:.6}usa-command-palette[inline]{display:block;width:var(--usa-cp-w,100%);max-width:100%}usa-command-palette[inline] .usa-cp{position:static;width:100%;margin:0}usa-command-palette[inline] .usa-cp-box{box-shadow:0 12px 30px -18px rgba(15,23,42,.45)}";
|
|
6937
|
+
|
|
6938
|
+
/**
|
|
6939
|
+
* Fuzzy match: every query letter in order. Returns a score (higher is
|
|
6940
|
+
* better; -1 = no match) and the matched indexes (7.9).
|
|
6941
|
+
*/
|
|
6942
|
+
function fuzzyMatch(query, text) {
|
|
6943
|
+
const q = query.trim().toLowerCase();
|
|
6944
|
+
const t = text.toLowerCase();
|
|
6945
|
+
if (!q)
|
|
6946
|
+
return { score: 0, hits: [] };
|
|
6947
|
+
const hits = [];
|
|
6948
|
+
let score = 0;
|
|
6949
|
+
let from = 0;
|
|
6950
|
+
let prev = -2;
|
|
6951
|
+
for (const ch of q) {
|
|
6952
|
+
if (ch === ' ')
|
|
6953
|
+
continue;
|
|
6954
|
+
const i = t.indexOf(ch, from);
|
|
6955
|
+
if (i < 0)
|
|
6956
|
+
return { score: -1, hits: [] };
|
|
6957
|
+
hits.push(i);
|
|
6958
|
+
score += i === prev + 1 ? 3 : 1; // consecutive letters
|
|
6959
|
+
if (i === 0 || /[\s\-_/]/.test(t[i - 1]))
|
|
6960
|
+
score += 2; // word starts
|
|
6961
|
+
prev = i;
|
|
6962
|
+
from = i + 1;
|
|
6963
|
+
}
|
|
6964
|
+
return { score: score - t.length / 100, hits };
|
|
6965
|
+
}
|
|
6966
|
+
/** "mod+shift+k" → ["⌘", "⇧", "K"] on Apple platforms, ["Ctrl", "Shift", "K"] elsewhere (7.9). */
|
|
6967
|
+
function keyLabels(keys, apple = isApple()) {
|
|
6968
|
+
const map = { mod: ['⌘', 'Ctrl'], cmd: ['⌘', '⌘'], meta: ['⌘', 'Win'], ctrl: ['⌃', 'Ctrl'], shift: ['⇧', 'Shift'], alt: ['⌥', 'Alt'], option: ['⌥', 'Alt'], enter: ['↵', 'Enter'], esc: ['Esc', 'Esc'], escape: ['Esc', 'Esc'], up: ['↑', '↑'], down: ['↓', '↓'], left: ['←', '←'], right: ['→', '→'], space: ['Space', 'Space'], tab: ['⇥', 'Tab'], backspace: ['⌫', 'Backspace'] };
|
|
6969
|
+
return keys
|
|
6970
|
+
.split('+')
|
|
6971
|
+
.map((k) => k.trim())
|
|
6972
|
+
.filter(Boolean)
|
|
6973
|
+
.map((k) => (map[k.toLowerCase()] ? map[k.toLowerCase()][apple ? 0 : 1] : k.length === 1 ? k.toUpperCase() : k[0].toUpperCase() + k.slice(1)));
|
|
6974
|
+
}
|
|
6975
|
+
/** Does a KeyboardEvent match "mod+k"-style keys? (7.9) */
|
|
6976
|
+
function matchesKeys(e, keys, apple = isApple()) {
|
|
6977
|
+
const parts = keys.toLowerCase().split('+').map((k) => k.trim()).filter(Boolean);
|
|
6978
|
+
const key = parts.filter((p) => !['mod', 'cmd', 'meta', 'ctrl', 'shift', 'alt', 'option'].includes(p))[0];
|
|
6979
|
+
if (!key)
|
|
6980
|
+
return false;
|
|
6981
|
+
const want = { meta: false, ctrl: false, shift: parts.includes('shift'), alt: parts.includes('alt') || parts.includes('option') };
|
|
6982
|
+
if (parts.includes('mod'))
|
|
6983
|
+
want[apple ? 'meta' : 'ctrl'] = true;
|
|
6984
|
+
if (parts.includes('cmd') || parts.includes('meta'))
|
|
6985
|
+
want.meta = true;
|
|
6986
|
+
if (parts.includes('ctrl'))
|
|
6987
|
+
want.ctrl = true;
|
|
6988
|
+
const names = { esc: 'escape', space: ' ', up: 'arrowup', down: 'arrowdown', left: 'arrowleft', right: 'arrowright' };
|
|
6989
|
+
const k = (e.key || '').toLowerCase();
|
|
6990
|
+
return k === (names[key] || key) && e.metaKey === want.meta && e.ctrlKey === want.ctrl && e.shiftKey === want.shift && e.altKey === want.alt;
|
|
6991
|
+
}
|
|
6992
|
+
function isApple() {
|
|
6993
|
+
return typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.userAgentData?.platform || navigator.platform || navigator.userAgent || '');
|
|
6994
|
+
}
|
|
6995
|
+
const esc$1 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6996
|
+
let uid = 0;
|
|
6997
|
+
function defineCommandPalette(tag = 'usa-command-palette') {
|
|
6998
|
+
return base.defineElement(tag, (Base) => {
|
|
6999
|
+
class UsaCommandPalette extends Base {
|
|
7000
|
+
constructor() {
|
|
7001
|
+
super(...arguments);
|
|
7002
|
+
this._cmds = null;
|
|
7003
|
+
this._id = `usa-cp-${++uid}`;
|
|
7004
|
+
this._active = 0;
|
|
7005
|
+
this._shown = [];
|
|
7006
|
+
this._opener = null;
|
|
7007
|
+
}
|
|
7008
|
+
static get observedAttributes() {
|
|
7009
|
+
return ['placeholder', 'label', 'hotkey', 'inline'];
|
|
7010
|
+
}
|
|
7011
|
+
get commands() {
|
|
7012
|
+
if (this._cmds)
|
|
7013
|
+
return this._cmds.slice();
|
|
7014
|
+
return Array.from(this.querySelectorAll(':scope > option')).map((o) => ({ id: o.value || (o.textContent || '').trim(), label: (o.textContent || '').trim(), group: o.getAttribute('data-group') || undefined, keys: o.getAttribute('data-keys') || undefined }));
|
|
7015
|
+
}
|
|
7016
|
+
set commands(v) {
|
|
7017
|
+
this.setCommands(v);
|
|
7018
|
+
}
|
|
7019
|
+
setCommands(list) {
|
|
7020
|
+
this._cmds = list.map((c) => ({ ...c, id: String(c.id), label: String(c.label) }));
|
|
7021
|
+
this.render();
|
|
7022
|
+
}
|
|
7023
|
+
get dlg() {
|
|
7024
|
+
return this.querySelector('.usa-cp');
|
|
7025
|
+
}
|
|
7026
|
+
get opened() {
|
|
7027
|
+
return !!this.dlg?.hasAttribute('open');
|
|
7028
|
+
}
|
|
7029
|
+
mount() {
|
|
7030
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7031
|
+
const id = this._id;
|
|
7032
|
+
this.insertAdjacentHTML('beforeend', `<dialog class="usa-cp" data-usa-part aria-label="${esc$1(this.str('label', 'Command palette'))}"><div class="usa-cp-box"><input class="usa-cp-q" role="combobox" aria-expanded="true" aria-controls="${id}-list" aria-autocomplete="list" autocomplete="off" spellcheck="false" placeholder="${esc$1(this.str('placeholder', 'Type a command or search…'))}"><div class="usa-cp-list" id="${id}-list" role="listbox"><span class="usa-cp-hl" aria-hidden="true"></span></div><p class="usa-cp-empty" hidden>No results</p></div></dialog>`);
|
|
7033
|
+
const dlg = this.dlg;
|
|
7034
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7035
|
+
this.listen(q, 'input', () => this.render(true));
|
|
7036
|
+
this.listen(q, 'keydown', (e) => {
|
|
7037
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
7038
|
+
e.preventDefault();
|
|
7039
|
+
this.move(e.key === 'ArrowDown' ? 1 : -1);
|
|
7040
|
+
}
|
|
7041
|
+
else if (e.key === 'Enter') {
|
|
7042
|
+
e.preventDefault();
|
|
7043
|
+
this.run(this._active);
|
|
7044
|
+
}
|
|
7045
|
+
else if (e.key === 'Escape' && typeof dlg.showModal !== 'function')
|
|
7046
|
+
this.close();
|
|
7047
|
+
});
|
|
7048
|
+
this.listen(dlg, 'click', (e) => {
|
|
7049
|
+
if (e.target === dlg)
|
|
7050
|
+
this.close();
|
|
7051
|
+
});
|
|
7052
|
+
this.listen(dlg, 'cancel', (e) => {
|
|
7053
|
+
e.preventDefault();
|
|
7054
|
+
this.close();
|
|
7055
|
+
});
|
|
7056
|
+
const hk = this.str('hotkey', 'mod+k');
|
|
7057
|
+
if (hk !== 'none')
|
|
7058
|
+
this.listen(document, 'keydown', (e) => {
|
|
7059
|
+
if (matchesKeys(e, hk)) {
|
|
7060
|
+
e.preventDefault();
|
|
7061
|
+
this.toggle();
|
|
7062
|
+
}
|
|
7063
|
+
});
|
|
7064
|
+
this.render();
|
|
7065
|
+
if (this.flag('inline'))
|
|
7066
|
+
dlg.setAttribute('open', '');
|
|
7067
|
+
}
|
|
7068
|
+
render(typed = false) {
|
|
7069
|
+
const list = this.querySelector('.usa-cp-list');
|
|
7070
|
+
if (!list)
|
|
7071
|
+
return;
|
|
7072
|
+
const q = this.querySelector('.usa-cp-q').value;
|
|
7073
|
+
const all = this.commands;
|
|
7074
|
+
const scored = all
|
|
7075
|
+
.map((c, i) => ({ c, i, m: fuzzyMatch(q, c.label) }))
|
|
7076
|
+
.filter((x) => x.m.score >= 0)
|
|
7077
|
+
.sort((a, b) => (q ? b.m.score - a.m.score : 0) || a.i - b.i);
|
|
7078
|
+
this._shown = scored.map((x) => x.c);
|
|
7079
|
+
this._active = 0;
|
|
7080
|
+
list.querySelectorAll('.usa-cp-item, .usa-cp-group').forEach((n) => n.remove());
|
|
7081
|
+
let html = '';
|
|
7082
|
+
let group = '\u0000';
|
|
7083
|
+
scored.forEach(({ c, m }, i) => {
|
|
7084
|
+
if (!q && c.group !== group) {
|
|
7085
|
+
group = c.group;
|
|
7086
|
+
if (group)
|
|
7087
|
+
html += `<div class="usa-cp-group" role="presentation">${esc$1(group)}</div>`;
|
|
7088
|
+
}
|
|
7089
|
+
const label = Array.from(c.label)
|
|
7090
|
+
.map((ch, j) => (m.hits.includes(j) ? `<mark>${esc$1(ch)}</mark>` : esc$1(ch)))
|
|
7091
|
+
.join('');
|
|
7092
|
+
const keys = c.keys ? `<span class="usa-cp-keys">${keyLabels(c.keys).map((k) => `<kbd>${esc$1(k)}</kbd>`).join('')}</span>` : '';
|
|
7093
|
+
html += `<div class="usa-cp-item" role="option" id="${this._id}-o${i}" data-i="${i}" aria-selected="false"><span class="usa-cp-label">${label}</span>${keys}</div>`;
|
|
7094
|
+
});
|
|
7095
|
+
list.insertAdjacentHTML('beforeend', html);
|
|
7096
|
+
list.querySelectorAll('.usa-cp-item').forEach((el) => {
|
|
7097
|
+
el.addEventListener('pointermove', () => this.select(Number(el.dataset.i)));
|
|
7098
|
+
el.addEventListener('click', () => this.run(Number(el.dataset.i)));
|
|
7099
|
+
});
|
|
7100
|
+
this.querySelector('.usa-cp-empty').hidden = scored.length > 0;
|
|
7101
|
+
this.select(0, false);
|
|
7102
|
+
if (typed && !this.reduced)
|
|
7103
|
+
list.querySelectorAll('.usa-cp-item').forEach((el, i) => i < 8 && this.motion(el, [{ opacity: 0, transform: 'translateY(6px)' }, { opacity: 1, transform: 'none' }], { duration: 200, delay: i * 25, easing: 'ease-out', fill: 'backwards' }));
|
|
7104
|
+
}
|
|
7105
|
+
select(i, glide = true) {
|
|
7106
|
+
const items = Array.from(this.querySelectorAll('.usa-cp-item'));
|
|
7107
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7108
|
+
const hl = this.querySelector('.usa-cp-hl');
|
|
7109
|
+
if (!items.length || !q || !hl) {
|
|
7110
|
+
q?.removeAttribute('aria-activedescendant');
|
|
7111
|
+
if (hl)
|
|
7112
|
+
hl.style.opacity = '0';
|
|
7113
|
+
return;
|
|
7114
|
+
}
|
|
7115
|
+
this._active = Math.max(0, Math.min(items.length - 1, i));
|
|
7116
|
+
items.forEach((el, j) => el.setAttribute('aria-selected', String(j === this._active)));
|
|
7117
|
+
const el = items[this._active];
|
|
7118
|
+
q.setAttribute('aria-activedescendant', el.id);
|
|
7119
|
+
const to = `translateY(${el.offsetTop}px)`;
|
|
7120
|
+
const from = hl.style.transform;
|
|
7121
|
+
hl.style.opacity = '1';
|
|
7122
|
+
hl.style.height = `${el.offsetHeight || 36}px`;
|
|
7123
|
+
hl.style.transform = to;
|
|
7124
|
+
if (glide && from && from !== to && !this.reduced)
|
|
7125
|
+
this.motion(hl, [{ transform: from }, { transform: to }], { duration: 160, easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
7126
|
+
el.scrollIntoView?.({ block: 'nearest' });
|
|
7127
|
+
}
|
|
7128
|
+
move(d) {
|
|
7129
|
+
const n = this._shown.length;
|
|
7130
|
+
if (n)
|
|
7131
|
+
this.select((this._active + d + n) % n);
|
|
7132
|
+
}
|
|
7133
|
+
run(i) {
|
|
7134
|
+
const c = this._shown[i];
|
|
7135
|
+
if (!c)
|
|
7136
|
+
return;
|
|
7137
|
+
this.emit('run', { id: c.id, label: c.label });
|
|
7138
|
+
this.close();
|
|
7139
|
+
}
|
|
7140
|
+
show() {
|
|
7141
|
+
const dlg = this.dlg;
|
|
7142
|
+
if (dlg && this.flag('inline'))
|
|
7143
|
+
return this.querySelector('.usa-cp-q').focus();
|
|
7144
|
+
if (!dlg || this.opened)
|
|
7145
|
+
return;
|
|
7146
|
+
this._opener = document.activeElement;
|
|
7147
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7148
|
+
q.value = '';
|
|
7149
|
+
this.render();
|
|
7150
|
+
if (typeof dlg.showModal === 'function') {
|
|
7151
|
+
try {
|
|
7152
|
+
dlg.showModal();
|
|
7153
|
+
}
|
|
7154
|
+
catch {
|
|
7155
|
+
dlg.setAttribute('open', '');
|
|
7156
|
+
}
|
|
7157
|
+
}
|
|
7158
|
+
else
|
|
7159
|
+
dlg.setAttribute('open', '');
|
|
7160
|
+
this.select(0, false);
|
|
7161
|
+
q.focus();
|
|
7162
|
+
if (!this.reduced)
|
|
7163
|
+
this.motion(this.querySelector('.usa-cp-box'), [{ opacity: 0, transform: 'translateY(-8px) scale(.96)' }, { opacity: 1, transform: 'none' }], { duration: 220, easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
7164
|
+
this.emit('open');
|
|
7165
|
+
}
|
|
7166
|
+
close() {
|
|
7167
|
+
const dlg = this.dlg;
|
|
7168
|
+
if (dlg && this.flag('inline')) {
|
|
7169
|
+
this.querySelector('.usa-cp-q').value = '';
|
|
7170
|
+
return this.render();
|
|
7171
|
+
}
|
|
7172
|
+
if (!dlg || !this.opened)
|
|
7173
|
+
return;
|
|
7174
|
+
const done = () => {
|
|
7175
|
+
if (typeof dlg.close === 'function' && dlg.open)
|
|
7176
|
+
dlg.close();
|
|
7177
|
+
dlg.removeAttribute('open');
|
|
7178
|
+
this._opener?.focus?.();
|
|
7179
|
+
this.emit('close');
|
|
7180
|
+
};
|
|
7181
|
+
const a = this.reduced ? null : this.motion(this.querySelector('.usa-cp-box'), [{ opacity: 1, transform: 'none' }, { opacity: 0, transform: 'scale(.97)' }], { duration: 140, easing: 'ease-in' });
|
|
7182
|
+
if (a)
|
|
7183
|
+
a.finished.then(done, done);
|
|
7184
|
+
else
|
|
7185
|
+
done();
|
|
7186
|
+
}
|
|
7187
|
+
toggle() {
|
|
7188
|
+
if (this.opened)
|
|
7189
|
+
this.close();
|
|
7190
|
+
else
|
|
7191
|
+
this.show();
|
|
7192
|
+
}
|
|
7193
|
+
}
|
|
7194
|
+
return UsaCommandPalette;
|
|
7195
|
+
}, { id: 'command-palette', text: css$3 });
|
|
7196
|
+
}
|
|
7197
|
+
|
|
7198
|
+
var css$2 = "usa-shortcut{display:inline-block;font:500 13px/1.3 system-ui,sans-serif}.usa-sk{display:inline-flex;align-items:center;gap:8px}.usa-sk-caps{display:inline-flex;gap:4px}usa-shortcut kbd{display:inline-grid;place-items:center;min-width:1.9em;height:1.9em;padding:0 6px;box-sizing:border-box;border-radius:6px;border:1px solid rgba(100,116,139,.4);border-bottom-width:3px;background:var(--usa-kbd-bg,#fff);color:inherit;font:600 12px/1 system-ui,sans-serif;box-shadow:0 1px 0 rgba(15,23,42,.08)}usa-shortcut[data-pressed] kbd{background:var(--usa-kbd-on,#eef2ff);border-color:var(--usa-kbd-accent,#6366f1)}.usa-sk-label{opacity:.75}";
|
|
7199
|
+
|
|
7200
|
+
const SPOKEN = { '⌘': 'Command', '⇧': 'Shift', '⌥': 'Option', '⌃': 'Control', Ctrl: 'Control', '↵': 'Enter', '⇥': 'Tab', '⌫': 'Backspace' };
|
|
7201
|
+
const esc = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
7202
|
+
function defineShortcut(tag = 'usa-shortcut') {
|
|
7203
|
+
return base.defineElement(tag, (Base) => {
|
|
7204
|
+
class UsaShortcut extends Base {
|
|
7205
|
+
static get observedAttributes() {
|
|
7206
|
+
return ['keys', 'label', 'listen', 'for'];
|
|
7207
|
+
}
|
|
7208
|
+
get labels() {
|
|
7209
|
+
return keyLabels(this.str('keys', 'mod+k'));
|
|
7210
|
+
}
|
|
7211
|
+
mount() {
|
|
7212
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7213
|
+
const labels = this.labels;
|
|
7214
|
+
const spoken = labels.map((l) => SPOKEN[l] || l).join(' ');
|
|
7215
|
+
const text = this.str('label');
|
|
7216
|
+
this.insertAdjacentHTML('beforeend', `<span class="usa-sk" data-usa-part><span class="usa-sk-caps" role="img" aria-label="${esc(spoken)}">${labels.map((l) => `<kbd aria-hidden="true">${esc(l)}</kbd>`).join('')}</span>${text ? `<span class="usa-sk-label">${esc(text)}</span>` : ''}</span>`);
|
|
7217
|
+
if (this.str('listen') !== 'false')
|
|
7218
|
+
this.listen(document, 'keydown', (e) => {
|
|
7219
|
+
if (!e.repeat && matchesKeys(e, this.str('keys', 'mod+k'))) {
|
|
7220
|
+
this.press();
|
|
7221
|
+
const id = this.str('for');
|
|
7222
|
+
const target = id ? document.getElementById(id) : null;
|
|
7223
|
+
if (target) {
|
|
7224
|
+
e.preventDefault();
|
|
7225
|
+
target.click();
|
|
7226
|
+
}
|
|
7227
|
+
}
|
|
7228
|
+
});
|
|
7229
|
+
}
|
|
7230
|
+
/** Animate the caps as if pressed and emit `usa:trigger`. */
|
|
7231
|
+
press() {
|
|
7232
|
+
const caps = Array.from(this.querySelectorAll('kbd'));
|
|
7233
|
+
this.setAttribute('data-pressed', '');
|
|
7234
|
+
const off = () => this.removeAttribute('data-pressed');
|
|
7235
|
+
if (!this.reduced) {
|
|
7236
|
+
const runs = caps.map((k, i) => this.motion(k, [{ transform: 'none' }, { transform: 'translateY(2px) scale(.94)', borderBottomWidth: '1px' }, { transform: 'none' }], { duration: 260, delay: i * 50, easing: 'ease-out' }));
|
|
7237
|
+
const last = runs[runs.length - 1];
|
|
7238
|
+
if (last)
|
|
7239
|
+
last.finished.then(off, off);
|
|
7240
|
+
else
|
|
7241
|
+
off();
|
|
7242
|
+
}
|
|
7243
|
+
else
|
|
7244
|
+
off();
|
|
7245
|
+
this.emit('trigger', { keys: this.str('keys', 'mod+k') });
|
|
7246
|
+
}
|
|
7247
|
+
}
|
|
7248
|
+
return UsaShortcut;
|
|
7249
|
+
}, { id: 'shortcut', text: css$2 });
|
|
7250
|
+
}
|
|
7251
|
+
|
|
7252
|
+
var css$1 = "usa-clock-control{display:inline-block;font:600 12.5px/1 system-ui,sans-serif;--usa-clk-accent:#6366f1}.usa-clk{display:inline-flex;align-items:center;gap:8px;padding:5px;border-radius:999px;background:var(--usa-clk-bg,rgba(148,163,184,.14));border:1px solid rgba(100,116,139,.2)}.usa-clk-play{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;border:0;background:var(--usa-clk-accent);color:#fff;cursor:pointer}.usa-clk-play:focus-visible,.usa-clk-speed:focus-visible{outline:2px solid var(--usa-clk-accent);outline-offset:2px}.usa-clk-play svg{width:15px;height:15px;fill:currentColor}.usa-clk-tri{opacity:0;transform-origin:center;transition:opacity .15s}usa-clock-control[data-paused] .usa-clk-tri{opacity:1}usa-clock-control[data-paused] .usa-clk-bar{opacity:0}.usa-clk-speeds{position:relative;display:flex}.usa-clk-ink{position:absolute;left:0;top:0;bottom:0;border-radius:999px;background:var(--usa-clk-ink,#fff);box-shadow:0 1px 4px rgba(15,23,42,.18);transition:transform .25s cubic-bezier(.2,.8,.2,1),width .25s;opacity:0}.usa-clk-speed{position:relative;padding:8px 10px;border:0;background:none;color:inherit;font:inherit;cursor:pointer;border-radius:999px;font-variant-numeric:tabular-nums}.usa-clk-speed[aria-checked=true]{color:var(--usa-clk-accent)}@media (prefers-reduced-motion:reduce){.usa-clk-ink{transition:none}}";
|
|
7253
|
+
|
|
7254
|
+
function defineClockControl(tag = 'usa-clock-control') {
|
|
7255
|
+
return base.defineElement(tag, (Base) => {
|
|
7256
|
+
class UsaClockControl extends Base {
|
|
7257
|
+
static get observedAttributes() {
|
|
7258
|
+
return ['speeds', 'label'];
|
|
7259
|
+
}
|
|
7260
|
+
get rate() {
|
|
7261
|
+
return base.getClock().rate;
|
|
7262
|
+
}
|
|
7263
|
+
get paused() {
|
|
7264
|
+
return base.getClock().paused;
|
|
7265
|
+
}
|
|
7266
|
+
mount() {
|
|
7267
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7268
|
+
const speeds = this.str('speeds', '0.25,0.5,1,2')
|
|
7269
|
+
.split(',')
|
|
7270
|
+
.map(Number)
|
|
7271
|
+
.filter((n) => Number.isFinite(n) && n > 0)
|
|
7272
|
+
.slice(0, 6);
|
|
7273
|
+
const label = this.str('label', 'Motion clock').replace(/"/g, '"');
|
|
7274
|
+
this.insertAdjacentHTML('beforeend', `<div class="usa-clk" role="group" aria-label="${label}" data-usa-part><button type="button" class="usa-clk-play" aria-pressed="false" aria-label="Pause animations"><svg viewBox="0 0 24 24" aria-hidden="true"><rect class="usa-clk-bar" x="6" y="5" width="4" height="14" rx="1"/><rect class="usa-clk-bar" x="14" y="5" width="4" height="14" rx="1"/><path class="usa-clk-tri" d="M7 5l12 7-12 7z"/></svg></button><div class="usa-clk-speeds" role="radiogroup" aria-label="Speed"><span class="usa-clk-ink" aria-hidden="true"></span>${speeds.map((s) => `<button type="button" role="radio" class="usa-clk-speed" data-rate="${s}" aria-checked="false">${s}×</button>`).join('')}</div></div>`);
|
|
7275
|
+
this.listen(this.querySelector('.usa-clk-play'), 'click', () => {
|
|
7276
|
+
base.setClock({ paused: !base.getClock().paused });
|
|
7277
|
+
});
|
|
7278
|
+
this.querySelectorAll('.usa-clk-speed').forEach((b) => this.listen(b, 'click', () => base.setClock({ rate: Number(b.dataset.rate) })));
|
|
7279
|
+
this.onCleanup(base.onClockChange(() => this.sync(true)));
|
|
7280
|
+
this.sync(false);
|
|
7281
|
+
}
|
|
7282
|
+
sync(user) {
|
|
7283
|
+
const { rate, paused } = base.getClock();
|
|
7284
|
+
const play = this.querySelector('.usa-clk-play');
|
|
7285
|
+
if (!play)
|
|
7286
|
+
return;
|
|
7287
|
+
play.setAttribute('aria-pressed', String(paused));
|
|
7288
|
+
play.setAttribute('aria-label', paused ? 'Resume animations' : 'Pause animations');
|
|
7289
|
+
this.setFlag('data-paused', paused);
|
|
7290
|
+
let on = null;
|
|
7291
|
+
this.querySelectorAll('.usa-clk-speed').forEach((b) => {
|
|
7292
|
+
const hit = Math.abs(Number(b.dataset.rate) - rate) < 1e-6;
|
|
7293
|
+
b.setAttribute('aria-checked', String(hit));
|
|
7294
|
+
if (hit)
|
|
7295
|
+
on = b;
|
|
7296
|
+
});
|
|
7297
|
+
const ink = this.querySelector('.usa-clk-ink');
|
|
7298
|
+
const target = on;
|
|
7299
|
+
if (target) {
|
|
7300
|
+
ink.style.opacity = '1';
|
|
7301
|
+
ink.style.width = `${target.offsetWidth}px`;
|
|
7302
|
+
ink.style.transform = `translateX(${target.offsetLeft}px)`;
|
|
7303
|
+
}
|
|
7304
|
+
else
|
|
7305
|
+
ink.style.opacity = '0';
|
|
7306
|
+
if (user)
|
|
7307
|
+
this.emit('change', { rate, paused });
|
|
7308
|
+
}
|
|
7309
|
+
}
|
|
7310
|
+
return UsaClockControl;
|
|
7311
|
+
}, { id: 'clock-control', text: css$1 });
|
|
7312
|
+
}
|
|
7313
|
+
|
|
7314
|
+
var css = "usa-hydrate{display:block}";
|
|
7315
|
+
|
|
7316
|
+
function defineHydrate(tag = 'usa-hydrate') {
|
|
7317
|
+
return base.defineElement(tag, (Base) => {
|
|
7318
|
+
class UsaHydrate extends Base {
|
|
7319
|
+
constructor() {
|
|
7320
|
+
super(...arguments);
|
|
7321
|
+
this._tl = null;
|
|
7322
|
+
}
|
|
7323
|
+
static get observedAttributes() {
|
|
7324
|
+
return ['effect', 'stagger', 'duration'];
|
|
7325
|
+
}
|
|
7326
|
+
get timeline() {
|
|
7327
|
+
return this._tl;
|
|
7328
|
+
}
|
|
7329
|
+
mount() {
|
|
7330
|
+
this.replay();
|
|
7331
|
+
}
|
|
7332
|
+
unmount() {
|
|
7333
|
+
this._tl?.cancel();
|
|
7334
|
+
this._tl = null;
|
|
7335
|
+
}
|
|
7336
|
+
replay() {
|
|
7337
|
+
this._tl?.cancel();
|
|
7338
|
+
const kids = Array.from(this.children);
|
|
7339
|
+
const frames = components_engine.HYDRATE_PRESETS[this.str('effect', 'fade-up')] || components_engine.HYDRATE_PRESETS['fade-up'];
|
|
7340
|
+
const tl = components_engine.createTimeline({ duration: this.num('duration', 600), easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
7341
|
+
const stagger = this.num('stagger', 60);
|
|
7342
|
+
kids.forEach((k, i) => tl.add(k, frames, {}, i * stagger));
|
|
7343
|
+
this._tl = tl;
|
|
7344
|
+
tl.play();
|
|
7345
|
+
this.setAttribute('data-usa-hydrated', '');
|
|
7346
|
+
tl.finished.then(() => this.isConnected && this._tl === tl && this.emit('hydrated', { count: kids.length }));
|
|
7347
|
+
}
|
|
7348
|
+
}
|
|
7349
|
+
return UsaHydrate;
|
|
7350
|
+
}, { id: 'hydrate', text: css });
|
|
6920
7351
|
}
|
|
6921
7352
|
|
|
6922
7353
|
/**
|
|
@@ -6949,6 +7380,8 @@ const WIDGETS = {
|
|
|
6949
7380
|
'7.6': { 'usa-globe': defineGlobe, 'usa-location-card': defineLocationCard },
|
|
6950
7381
|
'7.7': { 'usa-field': defineField, 'usa-otp': defineOtp, 'usa-upload-progress': defineUploadProgress },
|
|
6951
7382
|
'7.8': { 'usa-chat-composer': defineChatComposer, 'usa-suggestion-chips': defineSuggestionChips, 'usa-voice-button': defineVoiceButton },
|
|
7383
|
+
'7.9': { 'usa-command-palette': defineCommandPalette, 'usa-shortcut': defineShortcut },
|
|
7384
|
+
'8.0': { 'usa-clock-control': defineClockControl, 'usa-hydrate': defineHydrate },
|
|
6952
7385
|
};
|
|
6953
7386
|
/** Every widget tag, in release order. */
|
|
6954
7387
|
const WIDGET_TAGS = Object.values(WIDGETS).flatMap((g) => Object.keys(g));
|
|
@@ -6987,7 +7420,9 @@ exports.defineBarChart = defineBarChart;
|
|
|
6987
7420
|
exports.defineCarousel = defineCarousel;
|
|
6988
7421
|
exports.defineCartDrawer = defineCartDrawer;
|
|
6989
7422
|
exports.defineChatComposer = defineChatComposer;
|
|
7423
|
+
exports.defineClockControl = defineClockControl;
|
|
6990
7424
|
exports.defineColorPicker = defineColorPicker;
|
|
7425
|
+
exports.defineCommandPalette = defineCommandPalette;
|
|
6991
7426
|
exports.defineCompare = defineCompare;
|
|
6992
7427
|
exports.defineCountdown = defineCountdown;
|
|
6993
7428
|
exports.defineCubeGallery = defineCubeGallery;
|
|
@@ -6999,6 +7434,7 @@ exports.defineField = defineField;
|
|
|
6999
7434
|
exports.defineFileDrop = defineFileDrop;
|
|
7000
7435
|
exports.defineGauge = defineGauge;
|
|
7001
7436
|
exports.defineGlobe = defineGlobe;
|
|
7437
|
+
exports.defineHydrate = defineHydrate;
|
|
7002
7438
|
exports.defineKanban = defineKanban;
|
|
7003
7439
|
exports.defineKeyframeEditor = defineKeyframeEditor;
|
|
7004
7440
|
exports.defineKpi = defineKpi;
|
|
@@ -7025,6 +7461,7 @@ exports.definePullCord = definePullCord;
|
|
|
7025
7461
|
exports.defineReactions = defineReactions;
|
|
7026
7462
|
exports.defineSegmented = defineSegmented;
|
|
7027
7463
|
exports.defineSheet = defineSheet;
|
|
7464
|
+
exports.defineShortcut = defineShortcut;
|
|
7028
7465
|
exports.defineSkeletonReveal = defineSkeletonReveal;
|
|
7029
7466
|
exports.defineSparkline = defineSparkline;
|
|
7030
7467
|
exports.defineStarRating = defineStarRating;
|
|
@@ -7044,11 +7481,14 @@ exports.defineWidgets = defineWidgets;
|
|
|
7044
7481
|
exports.defineXpBar = defineXpBar;
|
|
7045
7482
|
exports.formatBytes = formatBytes;
|
|
7046
7483
|
exports.formatDistance = formatDistance;
|
|
7484
|
+
exports.fuzzyMatch = fuzzyMatch;
|
|
7047
7485
|
exports.haversine = haversine;
|
|
7048
7486
|
exports.hexToHsv = hexToHsv;
|
|
7049
7487
|
exports.hsvToHex = hsvToHex;
|
|
7050
7488
|
exports.initials = initials;
|
|
7489
|
+
exports.keyLabels = keyLabels;
|
|
7051
7490
|
exports.levelFor = levelFor;
|
|
7491
|
+
exports.matchesKeys = matchesKeys;
|
|
7052
7492
|
exports.monthGrid = monthGrid;
|
|
7053
7493
|
exports.pageWindow = pageWindow;
|
|
7054
7494
|
exports.parseChips = parseChips;
|