motionary 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,12 +1,13 @@
|
|
|
1
|
-
import { u as defineElement, k as clamp } from '../chunks/base-
|
|
2
|
-
import { d as springEasing } from '../chunks/spring-
|
|
3
|
-
import { A as ANIMATION_FORMAT, c as createPlayer } from '../chunks/player-
|
|
4
|
-
import { getEffect, playEffect } from '../chunks/registry-
|
|
5
|
-
import '../chunks/builtins-
|
|
1
|
+
import { u as defineElement, k as clamp, y as getClock, x as setClock, v as onClockChange } from '../chunks/base-CLuqlLfG.js';
|
|
2
|
+
import { d as springEasing } from '../chunks/spring-BFKNHmfl.js';
|
|
3
|
+
import { A as ANIMATION_FORMAT, c as createPlayer } from '../chunks/player-YzQGkKaW.js';
|
|
4
|
+
import { getEffect, playEffect } from '../chunks/registry-CnO7ZVPK.js';
|
|
5
|
+
import '../chunks/builtins-Bs4smevg.js';
|
|
6
6
|
import { registerShopPack } from './fx-shop.js';
|
|
7
|
-
import '
|
|
7
|
+
import { HYDRATE_PRESETS, createTimeline } from './engine.js';
|
|
8
|
+
import '../chunks/core-CiN5sqxB.js';
|
|
8
9
|
import './tokens.js';
|
|
9
|
-
import '../chunks/fx-
|
|
10
|
+
import '../chunks/fx-CQv3IxMf.js';
|
|
10
11
|
|
|
11
12
|
/** Helpers shared by the 6.x widgets (`motionary/components/widgets`). */
|
|
12
13
|
const clampN = (v, a, b) => Math.min(b, Math.max(a, v));
|
|
@@ -25,9 +26,9 @@ function part(tag, cls, attrs = {}, html = '') {
|
|
|
25
26
|
}
|
|
26
27
|
/** Remove the parts a previous mount created. */
|
|
27
28
|
const dropParts = (el) => el.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
28
|
-
let uid$
|
|
29
|
+
let uid$2 = 0;
|
|
29
30
|
/** A document-unique id with a prefix. */
|
|
30
|
-
const nextId = (p) => `${p}-${++uid$
|
|
31
|
+
const nextId = (p) => `${p}-${++uid$2}`;
|
|
31
32
|
/** Roving arrow-key focus over `items` (horizontal or vertical); returns the new index or -1. */
|
|
32
33
|
function arrowIndex(e, i, n, vertical = false) {
|
|
33
34
|
const prev = vertical ? 'ArrowUp' : 'ArrowLeft';
|
|
@@ -43,7 +44,7 @@ function arrowIndex(e, i, n, vertical = false) {
|
|
|
43
44
|
return -1;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
var css$
|
|
47
|
+
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}";
|
|
47
48
|
|
|
48
49
|
const CAROUSEL_EFFECTS = ['slide', 'fade', 'scale', 'cards'];
|
|
49
50
|
function defineCarousel(tag = 'usa-carousel') {
|
|
@@ -232,10 +233,10 @@ function defineCarousel(tag = 'usa-carousel') {
|
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
return UsaCarousel;
|
|
235
|
-
}, { id: 'carousel', text: css$
|
|
236
|
+
}, { id: 'carousel', text: css$Z });
|
|
236
237
|
}
|
|
237
238
|
|
|
238
|
-
var css$
|
|
239
|
+
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}";
|
|
239
240
|
|
|
240
241
|
const TAB_INDICATORS = ['pill', 'underline', 'glow', 'gooey'];
|
|
241
242
|
function defineTabBar(tag = 'usa-tab-bar') {
|
|
@@ -348,10 +349,10 @@ function defineTabBar(tag = 'usa-tab-bar') {
|
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
351
|
return UsaTabBar;
|
|
351
|
-
}, { id: 'tab-bar', text: css$
|
|
352
|
+
}, { id: 'tab-bar', text: css$Y });
|
|
352
353
|
}
|
|
353
354
|
|
|
354
|
-
var css$
|
|
355
|
+
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}}";
|
|
355
356
|
|
|
356
357
|
function defineDisclosure(tag = 'usa-disclosure') {
|
|
357
358
|
return defineElement(tag, (Base) => {
|
|
@@ -419,10 +420,10 @@ function defineDisclosure(tag = 'usa-disclosure') {
|
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
422
|
return UsaDisclosure;
|
|
422
|
-
}, { id: 'disclosure', text: css$
|
|
423
|
+
}, { id: 'disclosure', text: css$X });
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
var css$
|
|
426
|
+
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}}";
|
|
426
427
|
|
|
427
428
|
function defineStories(tag = 'usa-stories') {
|
|
428
429
|
return defineElement(tag, (Base) => {
|
|
@@ -555,10 +556,10 @@ function defineStories(tag = 'usa-stories') {
|
|
|
555
556
|
}
|
|
556
557
|
}
|
|
557
558
|
return UsaStories;
|
|
558
|
-
}, { id: 'stories', text: css$
|
|
559
|
+
}, { id: 'stories', text: css$W });
|
|
559
560
|
}
|
|
560
561
|
|
|
561
|
-
var css$
|
|
562
|
+
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)}}";
|
|
562
563
|
|
|
563
564
|
const MODAL_EFFECTS = ['scale', 'slide-up', 'flip', 'origin'];
|
|
564
565
|
const SHEET_SIDES = ['right', 'left', 'bottom', 'top'];
|
|
@@ -785,12 +786,12 @@ function defineOverlay(tag, kind) {
|
|
|
785
786
|
}
|
|
786
787
|
}
|
|
787
788
|
return UsaOverlay;
|
|
788
|
-
}, { id: 'overlay', text: css$
|
|
789
|
+
}, { id: 'overlay', text: css$V });
|
|
789
790
|
}
|
|
790
791
|
const defineModal = (tag = 'usa-modal') => defineOverlay(tag, 'modal');
|
|
791
792
|
const defineSheet = (tag = 'usa-sheet') => defineOverlay(tag, 'sheet');
|
|
792
793
|
|
|
793
|
-
var css$
|
|
794
|
+
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}}";
|
|
794
795
|
|
|
795
796
|
const TOAST_POSITIONS = ['bottom-right', 'bottom-left', 'bottom-center', 'top-right', 'top-left', 'top-center'];
|
|
796
797
|
const ICONS = { info: 'ℹ', success: '✓', warning: '!', error: '✕' };
|
|
@@ -961,7 +962,7 @@ function defineToastStack(tag = 'usa-toast-stack') {
|
|
|
961
962
|
}
|
|
962
963
|
}
|
|
963
964
|
return UsaToastStack;
|
|
964
|
-
}, { id: 'toast', text: css$
|
|
965
|
+
}, { id: 'toast', text: css$U });
|
|
965
966
|
}
|
|
966
967
|
/** Show a toast on the first `<usa-toast-stack>` of the page (one is created when missing). */
|
|
967
968
|
function stackToast(input, stack) {
|
|
@@ -989,7 +990,7 @@ function installToastTriggers() {
|
|
|
989
990
|
});
|
|
990
991
|
}
|
|
991
992
|
|
|
992
|
-
var css$
|
|
993
|
+
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)}}";
|
|
993
994
|
|
|
994
995
|
const MENU_EFFECTS = ['scale', 'fold', 'slide'];
|
|
995
996
|
function defineMenu(tag = 'usa-menu') {
|
|
@@ -1128,10 +1129,10 @@ function defineMenu(tag = 'usa-menu') {
|
|
|
1128
1129
|
}
|
|
1129
1130
|
}
|
|
1130
1131
|
return UsaMenu;
|
|
1131
|
-
}, { id: 'menu', text: css$
|
|
1132
|
+
}, { id: 'menu', text: css$T });
|
|
1132
1133
|
}
|
|
1133
1134
|
|
|
1134
|
-
var css$
|
|
1135
|
+
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}}";
|
|
1135
1136
|
|
|
1136
1137
|
const PROGRESS_VARIANTS = ['ring', 'bar', 'semi'];
|
|
1137
1138
|
const NS = 'http://www.w3.org/2000/svg';
|
|
@@ -1271,7 +1272,7 @@ function defineProgressRing(tag = 'usa-progress-ring') {
|
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1273
1274
|
return UsaProgressRing;
|
|
1274
|
-
}, { id: 'meters', text: css$
|
|
1275
|
+
}, { id: 'meters', text: css$S });
|
|
1275
1276
|
}
|
|
1276
1277
|
function defineOdometer(tag = 'usa-odometer') {
|
|
1277
1278
|
return defineElement(tag, (Base) => {
|
|
@@ -1381,10 +1382,10 @@ function defineOdometer(tag = 'usa-odometer') {
|
|
|
1381
1382
|
}
|
|
1382
1383
|
}
|
|
1383
1384
|
return UsaOdometer;
|
|
1384
|
-
}, { id: 'meters', text: css$
|
|
1385
|
+
}, { id: 'meters', text: css$S });
|
|
1385
1386
|
}
|
|
1386
1387
|
|
|
1387
|
-
var css$
|
|
1388
|
+
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}}";
|
|
1388
1389
|
|
|
1389
1390
|
const SKELETON_VARIANTS = ['wave', 'pulse', 'glow'];
|
|
1390
1391
|
function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
@@ -1499,25 +1500,34 @@ function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
|
1499
1500
|
}
|
|
1500
1501
|
}
|
|
1501
1502
|
return UsaSkeletonReveal;
|
|
1502
|
-
}, { id: 'skeleton-reveal', text: css$
|
|
1503
|
+
}, { id: 'skeleton-reveal', text: css$R });
|
|
1503
1504
|
}
|
|
1504
1505
|
|
|
1505
|
-
var css$
|
|
1506
|
+
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}}";
|
|
1506
1507
|
|
|
1507
1508
|
const PATHS = {
|
|
1508
1509
|
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',
|
|
1509
1510
|
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',
|
|
1510
1511
|
};
|
|
1512
|
+
/** <usa-rating> icon characters accepted by `icon` (7.9). */
|
|
1513
|
+
const ICON_ALIASES = { '★': 'star', '☆': 'star', '♥': 'heart', '❤': 'heart', '❤️': 'heart' };
|
|
1511
1514
|
function defineStarRating(tag = 'usa-star-rating') {
|
|
1512
1515
|
return defineElement(tag, (Base) => {
|
|
1513
1516
|
class UsaStarRating extends Base {
|
|
1517
|
+
static get observedAttributes() {
|
|
1518
|
+
return ['max', 'icon', 'readonly', 'step'];
|
|
1519
|
+
}
|
|
1514
1520
|
constructor() {
|
|
1515
|
-
super(
|
|
1521
|
+
super();
|
|
1522
|
+
this._internals = null;
|
|
1516
1523
|
this._v = 0;
|
|
1517
1524
|
this._stars = [];
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1525
|
+
try {
|
|
1526
|
+
this._internals = this.attachInternals?.() ?? null;
|
|
1527
|
+
}
|
|
1528
|
+
catch {
|
|
1529
|
+
this._internals = null;
|
|
1530
|
+
}
|
|
1521
1531
|
}
|
|
1522
1532
|
get value() {
|
|
1523
1533
|
return this._v;
|
|
@@ -1533,7 +1543,7 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1533
1543
|
}
|
|
1534
1544
|
mount() {
|
|
1535
1545
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
1536
|
-
const icon = PATHS[this.str('icon', 'star')] || PATHS.star;
|
|
1546
|
+
const icon = PATHS[ICON_ALIASES[this.str('icon', 'star')] || this.str('icon', 'star')] || PATHS.star;
|
|
1537
1547
|
this._stars = [];
|
|
1538
1548
|
for (let i = 0; i < this.max; i++) {
|
|
1539
1549
|
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>`);
|
|
@@ -1590,6 +1600,7 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1590
1600
|
sync() {
|
|
1591
1601
|
this.setAttribute('aria-valuenow', String(this._v));
|
|
1592
1602
|
this.setAttribute('aria-valuetext', `${this._v} of ${this.max}`);
|
|
1603
|
+
this._internals?.setFormValue?.(String(this._v));
|
|
1593
1604
|
if (this.flag('readonly'))
|
|
1594
1605
|
this.setAttribute('aria-label', `${this.str('label', 'Rating')}: ${this._v} of ${this.max}`);
|
|
1595
1606
|
}
|
|
@@ -1621,15 +1632,18 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1621
1632
|
rm();
|
|
1622
1633
|
}
|
|
1623
1634
|
}
|
|
1624
|
-
if (changed)
|
|
1635
|
+
if (changed) {
|
|
1636
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
1625
1637
|
this.emit('change', { value: nv });
|
|
1638
|
+
}
|
|
1626
1639
|
}
|
|
1627
1640
|
}
|
|
1641
|
+
UsaStarRating.formAssociated = true;
|
|
1628
1642
|
return UsaStarRating;
|
|
1629
|
-
}, { id: 'star-rating', text: css$
|
|
1643
|
+
}, { id: 'star-rating', text: css$Q });
|
|
1630
1644
|
}
|
|
1631
1645
|
|
|
1632
|
-
var css$
|
|
1646
|
+
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}}";
|
|
1633
1647
|
|
|
1634
1648
|
function defineMilestones(tag = 'usa-milestones') {
|
|
1635
1649
|
return defineElement(tag, (Base) => {
|
|
@@ -1717,10 +1731,10 @@ function defineMilestones(tag = 'usa-milestones') {
|
|
|
1717
1731
|
}
|
|
1718
1732
|
}
|
|
1719
1733
|
return UsaMilestones;
|
|
1720
|
-
}, { id: 'milestones', text: css$
|
|
1734
|
+
}, { id: 'milestones', text: css$P });
|
|
1721
1735
|
}
|
|
1722
1736
|
|
|
1723
|
-
var css$
|
|
1737
|
+
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}";
|
|
1724
1738
|
|
|
1725
1739
|
function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
1726
1740
|
return defineElement(tag, (Base) => {
|
|
@@ -1841,10 +1855,10 @@ function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
|
1841
1855
|
}
|
|
1842
1856
|
}
|
|
1843
1857
|
return UsaMasonryFlow;
|
|
1844
|
-
}, { id: 'masonry-flow', text: css$
|
|
1858
|
+
}, { id: 'masonry-flow', text: css$O });
|
|
1845
1859
|
}
|
|
1846
1860
|
|
|
1847
|
-
var css$
|
|
1861
|
+
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}";
|
|
1848
1862
|
|
|
1849
1863
|
function defineCompare(tag = 'usa-compare') {
|
|
1850
1864
|
return defineElement(tag, (Base) => {
|
|
@@ -1968,10 +1982,10 @@ function defineCompare(tag = 'usa-compare') {
|
|
|
1968
1982
|
}
|
|
1969
1983
|
}
|
|
1970
1984
|
return UsaCompare;
|
|
1971
|
-
}, { id: 'compare', text: css$
|
|
1985
|
+
}, { id: 'compare', text: css$N });
|
|
1972
1986
|
}
|
|
1973
1987
|
|
|
1974
|
-
var css$
|
|
1988
|
+
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}";
|
|
1975
1989
|
|
|
1976
1990
|
function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
1977
1991
|
return defineElement(tag, (Base) => {
|
|
@@ -2104,10 +2118,10 @@ function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
|
2104
2118
|
}
|
|
2105
2119
|
}
|
|
2106
2120
|
return UsaCubeGallery;
|
|
2107
|
-
}, { id: 'cube-gallery', text: css$
|
|
2121
|
+
}, { id: 'cube-gallery', text: css$M });
|
|
2108
2122
|
}
|
|
2109
2123
|
|
|
2110
|
-
var css$
|
|
2124
|
+
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}}";
|
|
2111
2125
|
|
|
2112
2126
|
function defineDock(tag = 'usa-dock') {
|
|
2113
2127
|
return defineElement(tag, (Base) => {
|
|
@@ -2175,10 +2189,10 @@ function defineDock(tag = 'usa-dock') {
|
|
|
2175
2189
|
}
|
|
2176
2190
|
}
|
|
2177
2191
|
return UsaDock;
|
|
2178
|
-
}, { id: 'dock', text: css$
|
|
2192
|
+
}, { id: 'dock', text: css$L });
|
|
2179
2193
|
}
|
|
2180
2194
|
|
|
2181
|
-
var css$
|
|
2195
|
+
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)}";
|
|
2182
2196
|
|
|
2183
2197
|
const NAV_INDICATORS = ['underline', 'pill', 'blob', 'dot'];
|
|
2184
2198
|
function defineNavMorph(tag = 'usa-nav-morph') {
|
|
@@ -2282,10 +2296,10 @@ function defineNavMorph(tag = 'usa-nav-morph') {
|
|
|
2282
2296
|
}
|
|
2283
2297
|
}
|
|
2284
2298
|
return UsaNavMorph;
|
|
2285
|
-
}, { id: 'nav-morph', text: css$
|
|
2299
|
+
}, { id: 'nav-morph', text: css$K });
|
|
2286
2300
|
}
|
|
2287
2301
|
|
|
2288
|
-
var css$
|
|
2302
|
+
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}";
|
|
2289
2303
|
|
|
2290
2304
|
const TOGGLE_VARIANTS = ['cross', 'arrow', 'minus', 'plus-x'];
|
|
2291
2305
|
function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
@@ -2358,10 +2372,10 @@ function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
|
2358
2372
|
}
|
|
2359
2373
|
}
|
|
2360
2374
|
return UsaMenuToggle;
|
|
2361
|
-
}, { id: 'menu-toggle', text: css$
|
|
2375
|
+
}, { id: 'menu-toggle', text: css$J });
|
|
2362
2376
|
}
|
|
2363
2377
|
|
|
2364
|
-
var css$
|
|
2378
|
+
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)}";
|
|
2365
2379
|
|
|
2366
2380
|
const TIP_PLACEMENTS = ['top', 'bottom', 'left', 'right'];
|
|
2367
2381
|
const FLIP = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
|
|
@@ -2493,10 +2507,10 @@ function defineTip(tag = 'usa-tip') {
|
|
|
2493
2507
|
}
|
|
2494
2508
|
}
|
|
2495
2509
|
return UsaTip;
|
|
2496
|
-
}, { id: 'tip', text: css$
|
|
2510
|
+
}, { id: 'tip', text: css$I });
|
|
2497
2511
|
}
|
|
2498
2512
|
|
|
2499
|
-
var css$
|
|
2513
|
+
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}}";
|
|
2500
2514
|
|
|
2501
2515
|
function defineStepper(tag = 'usa-stepper') {
|
|
2502
2516
|
return defineElement(tag, (Base) => {
|
|
@@ -2593,10 +2607,10 @@ function defineStepper(tag = 'usa-stepper') {
|
|
|
2593
2607
|
}
|
|
2594
2608
|
}
|
|
2595
2609
|
return UsaStepper;
|
|
2596
|
-
}, { id: 'stepper', text: css$
|
|
2610
|
+
}, { id: 'stepper', text: css$H });
|
|
2597
2611
|
}
|
|
2598
2612
|
|
|
2599
|
-
var css$
|
|
2613
|
+
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}}";
|
|
2600
2614
|
|
|
2601
2615
|
/** The visible page list: numbers and `'…'` gaps (1-based). */
|
|
2602
2616
|
function pageWindow(page, total, siblings = 1) {
|
|
@@ -2718,10 +2732,10 @@ function definePagination(tag = 'usa-pagination') {
|
|
|
2718
2732
|
}
|
|
2719
2733
|
}
|
|
2720
2734
|
return UsaPagination;
|
|
2721
|
-
}, { id: 'pagination', text: css$
|
|
2735
|
+
}, { id: 'pagination', text: css$G });
|
|
2722
2736
|
}
|
|
2723
2737
|
|
|
2724
|
-
var css$
|
|
2738
|
+
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}}";
|
|
2725
2739
|
|
|
2726
2740
|
const SEGMENTED_VARIANTS = ['ios', 'pill', 'outline'];
|
|
2727
2741
|
function defineSegmented(tag = 'usa-segmented') {
|
|
@@ -2815,10 +2829,10 @@ function defineSegmented(tag = 'usa-segmented') {
|
|
|
2815
2829
|
}
|
|
2816
2830
|
}
|
|
2817
2831
|
return UsaSegmented;
|
|
2818
|
-
}, { id: 'segmented', text: css$
|
|
2832
|
+
}, { id: 'segmented', text: css$F });
|
|
2819
2833
|
}
|
|
2820
2834
|
|
|
2821
|
-
var css$
|
|
2835
|
+
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}}";
|
|
2822
2836
|
|
|
2823
2837
|
const SWITCH_VARIANTS = ['ios', 'daynight', 'bounce', 'liquid'];
|
|
2824
2838
|
function defineSwitch(tag = 'usa-switch') {
|
|
@@ -2906,10 +2920,10 @@ function defineSwitch(tag = 'usa-switch') {
|
|
|
2906
2920
|
}
|
|
2907
2921
|
}
|
|
2908
2922
|
return UsaSwitch;
|
|
2909
|
-
}, { id: 'switch', text: css$
|
|
2923
|
+
}, { id: 'switch', text: css$E });
|
|
2910
2924
|
}
|
|
2911
2925
|
|
|
2912
|
-
var css$
|
|
2926
|
+
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}}";
|
|
2913
2927
|
|
|
2914
2928
|
function defineKanban(tag = 'usa-kanban') {
|
|
2915
2929
|
return defineElement(tag, (Base) => {
|
|
@@ -3114,10 +3128,10 @@ function defineKanban(tag = 'usa-kanban') {
|
|
|
3114
3128
|
}
|
|
3115
3129
|
}
|
|
3116
3130
|
return UsaKanban;
|
|
3117
|
-
}, { id: 'kanban', text: css$
|
|
3131
|
+
}, { id: 'kanban', text: css$D });
|
|
3118
3132
|
}
|
|
3119
3133
|
|
|
3120
|
-
var css$
|
|
3134
|
+
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}}";
|
|
3121
3135
|
|
|
3122
3136
|
function defineSwipeDeck(tag = 'usa-swipe-deck') {
|
|
3123
3137
|
return defineElement(tag, (Base) => {
|
|
@@ -3259,10 +3273,10 @@ function defineSwipeDeck(tag = 'usa-swipe-deck') {
|
|
|
3259
3273
|
}
|
|
3260
3274
|
}
|
|
3261
3275
|
return UsaSwipeDeck;
|
|
3262
|
-
}, { id: 'swipe-deck', text: css$
|
|
3276
|
+
}, { id: 'swipe-deck', text: css$C });
|
|
3263
3277
|
}
|
|
3264
3278
|
|
|
3265
|
-
var css$
|
|
3279
|
+
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}}";
|
|
3266
3280
|
|
|
3267
3281
|
const WEATHER_CONDITIONS = ['clear', 'cloudy', 'rain', 'snow', 'storm', 'fog', 'night'];
|
|
3268
3282
|
const LABEL = { clear: 'Clear', cloudy: 'Cloudy', rain: 'Rain', snow: 'Snow', storm: 'Thunderstorm', fog: 'Fog', night: 'Clear night' };
|
|
@@ -3343,10 +3357,10 @@ function defineWeatherCard(tag = 'usa-weather-card') {
|
|
|
3343
3357
|
}
|
|
3344
3358
|
}
|
|
3345
3359
|
return UsaWeatherCard;
|
|
3346
|
-
}, { id: 'weather-card', text: css$
|
|
3360
|
+
}, { id: 'weather-card', text: css$B });
|
|
3347
3361
|
}
|
|
3348
3362
|
|
|
3349
|
-
var css$
|
|
3363
|
+
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}}";
|
|
3350
3364
|
|
|
3351
3365
|
function definePullCord(tag = 'usa-pull-cord') {
|
|
3352
3366
|
return defineElement(tag, (Base) => {
|
|
@@ -3475,10 +3489,10 @@ function definePullCord(tag = 'usa-pull-cord') {
|
|
|
3475
3489
|
}
|
|
3476
3490
|
}
|
|
3477
3491
|
return UsaPullCord;
|
|
3478
|
-
}, { id: 'pull-cord', text: css$
|
|
3492
|
+
}, { id: 'pull-cord', text: css$A });
|
|
3479
3493
|
}
|
|
3480
3494
|
|
|
3481
|
-
var css$
|
|
3495
|
+
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}}";
|
|
3482
3496
|
|
|
3483
3497
|
const iso = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
3484
3498
|
/** Parse `YYYY-MM-DD` as a local date (or null). */
|
|
@@ -3627,10 +3641,10 @@ function defineDatePicker(tag = 'usa-date-picker') {
|
|
|
3627
3641
|
}
|
|
3628
3642
|
}
|
|
3629
3643
|
return UsaDatePicker;
|
|
3630
|
-
}, { id: 'date-picker', text: css$
|
|
3644
|
+
}, { id: 'date-picker', text: css$z });
|
|
3631
3645
|
}
|
|
3632
3646
|
|
|
3633
|
-
var css$
|
|
3647
|
+
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}}";
|
|
3634
3648
|
|
|
3635
3649
|
/** HSV (h 0–360, s / v 0–1) → `#rrggbb`. */
|
|
3636
3650
|
function hsvToHex(h, s, v) {
|
|
@@ -3750,10 +3764,10 @@ function defineColorPicker(tag = 'usa-color-picker') {
|
|
|
3750
3764
|
}
|
|
3751
3765
|
}
|
|
3752
3766
|
return UsaColorPicker;
|
|
3753
|
-
}, { id: 'color-picker', text: css$
|
|
3767
|
+
}, { id: 'color-picker', text: css$y });
|
|
3754
3768
|
}
|
|
3755
3769
|
|
|
3756
|
-
var css$
|
|
3770
|
+
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}}";
|
|
3757
3771
|
|
|
3758
3772
|
const size = (n) => (n < 1024 ? `${n} B` : n < 1048576 ? `${(n / 1024).toFixed(1)} KB` : `${(n / 1048576).toFixed(1)} MB`);
|
|
3759
3773
|
function defineFileDrop(tag = 'usa-file-drop') {
|
|
@@ -3854,10 +3868,10 @@ function defineFileDrop(tag = 'usa-file-drop') {
|
|
|
3854
3868
|
}
|
|
3855
3869
|
}
|
|
3856
3870
|
return UsaFileDrop;
|
|
3857
|
-
}, { id: 'file-drop', text: css$
|
|
3871
|
+
}, { id: 'file-drop', text: css$x });
|
|
3858
3872
|
}
|
|
3859
3873
|
|
|
3860
|
-
var css$
|
|
3874
|
+
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}}";
|
|
3861
3875
|
|
|
3862
3876
|
const DEFAULT = {
|
|
3863
3877
|
format: ANIMATION_FORMAT,
|
|
@@ -4031,10 +4045,10 @@ function defineKeyframeEditor(tag = 'usa-keyframe-editor') {
|
|
|
4031
4045
|
}
|
|
4032
4046
|
}
|
|
4033
4047
|
return UsaKeyframeEditor;
|
|
4034
|
-
}, { id: 'keyframe-editor', text: css$
|
|
4048
|
+
}, { id: 'keyframe-editor', text: css$w });
|
|
4035
4049
|
}
|
|
4036
4050
|
|
|
4037
|
-
var css$
|
|
4051
|
+
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}}";
|
|
4038
4052
|
|
|
4039
4053
|
const fmt = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`;
|
|
4040
4054
|
function defineMusicPlayer(tag = 'usa-music-player') {
|
|
@@ -4195,10 +4209,10 @@ function defineMusicPlayer(tag = 'usa-music-player') {
|
|
|
4195
4209
|
}
|
|
4196
4210
|
}
|
|
4197
4211
|
return UsaMusicPlayer;
|
|
4198
|
-
}, { id: 'music-player', text: css$
|
|
4212
|
+
}, { id: 'music-player', text: css$v });
|
|
4199
4213
|
}
|
|
4200
4214
|
|
|
4201
|
-
var css$
|
|
4215
|
+
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}}";
|
|
4202
4216
|
|
|
4203
4217
|
const ARC = 270;
|
|
4204
4218
|
function defineVolumeKnob(tag = 'usa-volume-knob') {
|
|
@@ -4289,10 +4303,10 @@ function defineVolumeKnob(tag = 'usa-volume-knob') {
|
|
|
4289
4303
|
}
|
|
4290
4304
|
}
|
|
4291
4305
|
return UsaVolumeKnob;
|
|
4292
|
-
}, { id: 'volume-knob', text: css$
|
|
4306
|
+
}, { id: 'volume-knob', text: css$u });
|
|
4293
4307
|
}
|
|
4294
4308
|
|
|
4295
|
-
var css$
|
|
4309
|
+
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}}";
|
|
4296
4310
|
|
|
4297
4311
|
const EQ_PRESETS = {
|
|
4298
4312
|
flat: [0, 0, 0, 0, 0, 0, 0],
|
|
@@ -4390,10 +4404,10 @@ function defineEqualizer(tag = 'usa-equalizer') {
|
|
|
4390
4404
|
}
|
|
4391
4405
|
}
|
|
4392
4406
|
return UsaEqualizer;
|
|
4393
|
-
}, { id: 'equalizer', text: css$
|
|
4407
|
+
}, { id: 'equalizer', text: css$t });
|
|
4394
4408
|
}
|
|
4395
4409
|
|
|
4396
|
-
var css$
|
|
4410
|
+
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}}";
|
|
4397
4411
|
|
|
4398
4412
|
/** Parse LRC text into sorted `{ t, text }` lines. */
|
|
4399
4413
|
function parseLRC(src) {
|
|
@@ -4505,10 +4519,10 @@ function defineLyrics(tag = 'usa-lyrics') {
|
|
|
4505
4519
|
}
|
|
4506
4520
|
}
|
|
4507
4521
|
return UsaLyrics;
|
|
4508
|
-
}, { id: 'lyrics', text: css$
|
|
4522
|
+
}, { id: 'lyrics', text: css$s });
|
|
4509
4523
|
}
|
|
4510
4524
|
|
|
4511
|
-
var css$
|
|
4525
|
+
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}}";
|
|
4512
4526
|
|
|
4513
4527
|
function defineBarChart(tag = 'usa-bar-chart') {
|
|
4514
4528
|
return defineElement(tag, (Base) => {
|
|
@@ -4602,10 +4616,10 @@ function defineBarChart(tag = 'usa-bar-chart') {
|
|
|
4602
4616
|
}
|
|
4603
4617
|
}
|
|
4604
4618
|
return UsaBarChart;
|
|
4605
|
-
}, { id: 'bar-chart', text: css$
|
|
4619
|
+
}, { id: 'bar-chart', text: css$r });
|
|
4606
4620
|
}
|
|
4607
4621
|
|
|
4608
|
-
var css$
|
|
4622
|
+
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)}";
|
|
4609
4623
|
|
|
4610
4624
|
function defineGauge(tag = 'usa-gauge') {
|
|
4611
4625
|
return defineElement(tag, (Base) => {
|
|
@@ -4690,10 +4704,10 @@ function defineGauge(tag = 'usa-gauge') {
|
|
|
4690
4704
|
}
|
|
4691
4705
|
}
|
|
4692
4706
|
return UsaGauge;
|
|
4693
|
-
}, { id: 'gauge', text: css$
|
|
4707
|
+
}, { id: 'gauge', text: css$q });
|
|
4694
4708
|
}
|
|
4695
4709
|
|
|
4696
|
-
var css$
|
|
4710
|
+
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}}";
|
|
4697
4711
|
|
|
4698
4712
|
const SPARK_VARIANTS = ['line', 'area', 'bars'];
|
|
4699
4713
|
/** Map values to SVG points in a w×h box (with padding). */
|
|
@@ -4816,7 +4830,7 @@ function defineSparkline(tag = 'usa-sparkline') {
|
|
|
4816
4830
|
}
|
|
4817
4831
|
}
|
|
4818
4832
|
return UsaSparkline;
|
|
4819
|
-
}, { id: 'sparkline', text: css$
|
|
4833
|
+
}, { id: 'sparkline', text: css$p });
|
|
4820
4834
|
}
|
|
4821
4835
|
|
|
4822
4836
|
/** Parse a figure like "$12.4k" / "−3.5%" / "1,204" → number + prefix / suffix / decimals (7.2). */
|
|
@@ -4829,7 +4843,7 @@ function parseFigureText(s) {
|
|
|
4829
4843
|
return Number.isFinite(n) ? { n, pre: m[1], post: m[3], dec: (raw.split('.')[1] || '').length } : null;
|
|
4830
4844
|
}
|
|
4831
4845
|
|
|
4832
|
-
var css$
|
|
4846
|
+
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}";
|
|
4833
4847
|
|
|
4834
4848
|
function defineKpi(tag = 'usa-kpi') {
|
|
4835
4849
|
return defineElement(tag, (Base) => {
|
|
@@ -4909,10 +4923,10 @@ function defineKpi(tag = 'usa-kpi') {
|
|
|
4909
4923
|
}
|
|
4910
4924
|
}
|
|
4911
4925
|
return UsaKpi;
|
|
4912
|
-
}, { id: 'kpi', text: css$
|
|
4926
|
+
}, { id: 'kpi', text: css$o });
|
|
4913
4927
|
}
|
|
4914
4928
|
|
|
4915
|
-
var css$
|
|
4929
|
+
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}}";
|
|
4916
4930
|
|
|
4917
4931
|
function defineAddToCart(tag = 'usa-add-to-cart') {
|
|
4918
4932
|
return defineElement(tag, (Base) => {
|
|
@@ -4957,10 +4971,10 @@ function defineAddToCart(tag = 'usa-add-to-cart') {
|
|
|
4957
4971
|
}
|
|
4958
4972
|
}
|
|
4959
4973
|
return UsaAddToCart;
|
|
4960
|
-
}, { id: 'add-to-cart', text: css$
|
|
4974
|
+
}, { id: 'add-to-cart', text: css$n });
|
|
4961
4975
|
}
|
|
4962
4976
|
|
|
4963
|
-
var css$
|
|
4977
|
+
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}";
|
|
4964
4978
|
|
|
4965
4979
|
/** Cart total (7.3). */
|
|
4966
4980
|
const cartTotal = (items) => Math.round(items.reduce((a, i) => a + (Number(i.price) || 0) * (i.qty || 1), 0) * 100) / 100;
|
|
@@ -5125,10 +5139,10 @@ function defineCartDrawer(tag = 'usa-cart-drawer') {
|
|
|
5125
5139
|
}
|
|
5126
5140
|
}
|
|
5127
5141
|
return UsaCartDrawer;
|
|
5128
|
-
}, { id: 'cart-drawer', text: css$
|
|
5142
|
+
}, { id: 'cart-drawer', text: css$m });
|
|
5129
5143
|
}
|
|
5130
5144
|
|
|
5131
|
-
var css$
|
|
5145
|
+
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}}";
|
|
5132
5146
|
|
|
5133
5147
|
/** Wrap an index into 0..n-1 (7.3). */
|
|
5134
5148
|
const wrapIndex = (i, n) => (n ? ((i % n) + n) % n : 0);
|
|
@@ -5242,10 +5256,10 @@ function defineProductGallery(tag = 'usa-product-gallery') {
|
|
|
5242
5256
|
}
|
|
5243
5257
|
}
|
|
5244
5258
|
return UsaProductGallery;
|
|
5245
|
-
}, { id: 'product-gallery', text: css$
|
|
5259
|
+
}, { id: 'product-gallery', text: css$l });
|
|
5246
5260
|
}
|
|
5247
5261
|
|
|
5248
|
-
var css$
|
|
5262
|
+
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)}";
|
|
5249
5263
|
|
|
5250
5264
|
/** Split seconds into d/h/m/s (7.3). */
|
|
5251
5265
|
function splitTime(sec) {
|
|
@@ -5333,10 +5347,10 @@ function defineCountdown(tag = 'usa-countdown') {
|
|
|
5333
5347
|
}
|
|
5334
5348
|
}
|
|
5335
5349
|
return UsaCountdown;
|
|
5336
|
-
}, { id: 'countdown', text: css$
|
|
5350
|
+
}, { id: 'countdown', text: css$k });
|
|
5337
5351
|
}
|
|
5338
5352
|
|
|
5339
|
-
var css$
|
|
5353
|
+
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}}";
|
|
5340
5354
|
|
|
5341
5355
|
function defineMessageList(tag = 'usa-message-list') {
|
|
5342
5356
|
return defineElement(tag, (Base) => {
|
|
@@ -5423,10 +5437,10 @@ function defineMessageList(tag = 'usa-message-list') {
|
|
|
5423
5437
|
}
|
|
5424
5438
|
}
|
|
5425
5439
|
return UsaMessageList;
|
|
5426
|
-
}, { id: 'message-list', text: css$
|
|
5440
|
+
}, { id: 'message-list', text: css$j });
|
|
5427
5441
|
}
|
|
5428
5442
|
|
|
5429
|
-
var css$
|
|
5443
|
+
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}";
|
|
5430
5444
|
|
|
5431
5445
|
/** Parse "👍,❤️" + "3,1" into ordered [emoji, count] pairs (7.4). */
|
|
5432
5446
|
function parseReactions(emojis, counts = '') {
|
|
@@ -5528,10 +5542,10 @@ function defineReactions(tag = 'usa-reactions') {
|
|
|
5528
5542
|
}
|
|
5529
5543
|
}
|
|
5530
5544
|
return UsaReactions;
|
|
5531
|
-
}, { id: 'reactions', text: css$
|
|
5545
|
+
}, { id: 'reactions', text: css$i });
|
|
5532
5546
|
}
|
|
5533
5547
|
|
|
5534
|
-
var css$
|
|
5548
|
+
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}";
|
|
5535
5549
|
|
|
5536
5550
|
function defineNotificationBell(tag = 'usa-notification-bell') {
|
|
5537
5551
|
return defineElement(tag, (Base) => {
|
|
@@ -5626,10 +5640,10 @@ function defineNotificationBell(tag = 'usa-notification-bell') {
|
|
|
5626
5640
|
}
|
|
5627
5641
|
}
|
|
5628
5642
|
return UsaNotificationBell;
|
|
5629
|
-
}, { id: 'notification-bell', text: css$
|
|
5643
|
+
}, { id: 'notification-bell', text: css$h });
|
|
5630
5644
|
}
|
|
5631
5645
|
|
|
5632
|
-
var css$
|
|
5646
|
+
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}}";
|
|
5633
5647
|
|
|
5634
5648
|
/** Presence states (7.4). */
|
|
5635
5649
|
const PRESENCE_STATES = ['online', 'away', 'busy', 'offline'];
|
|
@@ -5699,10 +5713,10 @@ function definePresence(tag = 'usa-presence') {
|
|
|
5699
5713
|
}
|
|
5700
5714
|
}
|
|
5701
5715
|
return UsaPresence;
|
|
5702
|
-
}, { id: 'presence', text: css$
|
|
5716
|
+
}, { id: 'presence', text: css$g });
|
|
5703
5717
|
}
|
|
5704
5718
|
|
|
5705
|
-
var css$
|
|
5719
|
+
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)}";
|
|
5706
5720
|
|
|
5707
5721
|
/** Sort rows by score desc, then name (7.5). */
|
|
5708
5722
|
const rankRows = (rows) => [...rows].sort((a, b) => b.score - a.score || a.name.localeCompare(b.name));
|
|
@@ -5811,10 +5825,10 @@ function defineLeaderboard(tag = 'usa-leaderboard') {
|
|
|
5811
5825
|
}
|
|
5812
5826
|
}
|
|
5813
5827
|
return UsaLeaderboard;
|
|
5814
|
-
}, { id: 'leaderboard', text: css$
|
|
5828
|
+
}, { id: 'leaderboard', text: css$f });
|
|
5815
5829
|
}
|
|
5816
5830
|
|
|
5817
|
-
var css$
|
|
5831
|
+
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)}";
|
|
5818
5832
|
|
|
5819
5833
|
/** Apply `gain` XP to (level, xp) with `per` XP per level (7.5). */
|
|
5820
5834
|
function levelFor(level, xp, gain, per = 100) {
|
|
@@ -5911,10 +5925,10 @@ function defineXpBar(tag = 'usa-xp-bar') {
|
|
|
5911
5925
|
}
|
|
5912
5926
|
}
|
|
5913
5927
|
return UsaXpBar;
|
|
5914
|
-
}, { id: 'xp-bar', text: css$
|
|
5928
|
+
}, { id: 'xp-bar', text: css$e });
|
|
5915
5929
|
}
|
|
5916
5930
|
|
|
5917
|
-
var css$
|
|
5931
|
+
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}}";
|
|
5918
5932
|
|
|
5919
5933
|
/** Unlocked / total counts for a badge list (7.5). */
|
|
5920
5934
|
const badgeProgress = (b) => ({ unlocked: b.filter((x) => !x.locked).length, total: b.length });
|
|
@@ -5981,10 +5995,10 @@ function defineBadgeWall(tag = 'usa-badge-wall') {
|
|
|
5981
5995
|
}
|
|
5982
5996
|
}
|
|
5983
5997
|
return UsaBadgeWall;
|
|
5984
|
-
}, { id: 'badge-wall', text: css$
|
|
5998
|
+
}, { id: 'badge-wall', text: css$d });
|
|
5985
5999
|
}
|
|
5986
6000
|
|
|
5987
|
-
var css$
|
|
6001
|
+
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)}";
|
|
5988
6002
|
|
|
5989
6003
|
/** Final wheel rotation (deg) that puts segment `index` of `count` under the top pointer after `turns` full turns (7.5). */
|
|
5990
6004
|
function wheelAngle(index, count, turns = 5) {
|
|
@@ -6064,10 +6078,10 @@ function definePrizeWheel(tag = 'usa-prize-wheel') {
|
|
|
6064
6078
|
}
|
|
6065
6079
|
}
|
|
6066
6080
|
return UsaPrizeWheel;
|
|
6067
|
-
}, { id: 'prize-wheel', text: css$
|
|
6081
|
+
}, { id: 'prize-wheel', text: css$c });
|
|
6068
6082
|
}
|
|
6069
6083
|
|
|
6070
|
-
var css$
|
|
6084
|
+
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}}";
|
|
6071
6085
|
|
|
6072
6086
|
const RAD = Math.PI / 180;
|
|
6073
6087
|
/** Orthographic projection on a unit sphere seen from longitude `lon0`, tilted by `tilt` degrees (7.6). */
|
|
@@ -6224,10 +6238,10 @@ function defineGlobe(tag = 'usa-globe') {
|
|
|
6224
6238
|
}
|
|
6225
6239
|
}
|
|
6226
6240
|
return UsaGlobe;
|
|
6227
|
-
}, { id: 'globe', text: css$
|
|
6241
|
+
}, { id: 'globe', text: css$b });
|
|
6228
6242
|
}
|
|
6229
6243
|
|
|
6230
|
-
var css$
|
|
6244
|
+
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}";
|
|
6231
6245
|
|
|
6232
6246
|
/** Great-circle distance in km between two lat/lon points (7.6). */
|
|
6233
6247
|
function haversine(lat1, lon1, lat2, lon2) {
|
|
@@ -6243,7 +6257,7 @@ function formatDistance(km, unit = 'km') {
|
|
|
6243
6257
|
}
|
|
6244
6258
|
return km < 1 ? `${Math.round(km * 1000)} m` : `${km < 10 ? km.toFixed(1) : Math.round(km)} km`;
|
|
6245
6259
|
}
|
|
6246
|
-
const esc$
|
|
6260
|
+
const esc$6 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6247
6261
|
function defineLocationCard(tag = 'usa-location-card') {
|
|
6248
6262
|
return defineElement(tag, (Base) => {
|
|
6249
6263
|
class UsaLocationCard extends Base {
|
|
@@ -6268,7 +6282,7 @@ function defineLocationCard(tag = 'usa-location-card') {
|
|
|
6268
6282
|
const dist = this.str('distance') || (km === null ? '' : formatDistance(km, this.str('unit') === 'mi' ? 'mi' : 'km'));
|
|
6269
6283
|
const href = this.str('href');
|
|
6270
6284
|
const origin = km !== null;
|
|
6271
|
-
this.insertAdjacentHTML('beforeend', `<article class="usa-lc" data-usa-part aria-label="${esc$
|
|
6285
|
+
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>`);
|
|
6272
6286
|
if (origin)
|
|
6273
6287
|
this.setAttribute('data-route', '');
|
|
6274
6288
|
else
|
|
@@ -6301,10 +6315,10 @@ function defineLocationCard(tag = 'usa-location-card') {
|
|
|
6301
6315
|
}
|
|
6302
6316
|
}
|
|
6303
6317
|
return UsaLocationCard;
|
|
6304
|
-
}, { id: 'location-card', text: css$
|
|
6318
|
+
}, { id: 'location-card', text: css$a });
|
|
6305
6319
|
}
|
|
6306
6320
|
|
|
6307
|
-
var css$
|
|
6321
|
+
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}}";
|
|
6308
6322
|
|
|
6309
6323
|
/** 0–4 password strength score with a label (7.7). */
|
|
6310
6324
|
function passwordStrength(pw) {
|
|
@@ -6326,15 +6340,15 @@ function passwordStrength(pw) {
|
|
|
6326
6340
|
const score = Math.min(4, s);
|
|
6327
6341
|
return { score, label: ['Too short', 'Weak', 'Fair', 'Good', 'Strong'][score] };
|
|
6328
6342
|
}
|
|
6329
|
-
const esc$
|
|
6330
|
-
let uid = 0;
|
|
6343
|
+
const esc$5 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6344
|
+
let uid$1 = 0;
|
|
6331
6345
|
const PASS = ['type', 'name', 'required', 'pattern', 'minlength', 'maxlength', 'autocomplete', 'inputmode', 'placeholder'];
|
|
6332
6346
|
function defineField(tag = 'usa-field') {
|
|
6333
6347
|
return defineElement(tag, (Base) => {
|
|
6334
6348
|
class UsaField extends Base {
|
|
6335
6349
|
constructor() {
|
|
6336
6350
|
super(...arguments);
|
|
6337
|
-
this._id = `usa-fld-${++uid}`;
|
|
6351
|
+
this._id = `usa-fld-${++uid$1}`;
|
|
6338
6352
|
this._checking = false;
|
|
6339
6353
|
}
|
|
6340
6354
|
static get observedAttributes() {
|
|
@@ -6360,9 +6374,9 @@ function defineField(tag = 'usa-field') {
|
|
|
6360
6374
|
const id = this._id;
|
|
6361
6375
|
const strength = this.flag('strength');
|
|
6362
6376
|
const attrs = PASS.filter((a) => this.hasAttribute(a))
|
|
6363
|
-
.map((a) => (a === 'required' ? ' required' : ` ${a}="${esc$
|
|
6377
|
+
.map((a) => (a === 'required' ? ' required' : ` ${a}="${esc$5(this.str(a))}"`))
|
|
6364
6378
|
.join('');
|
|
6365
|
-
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$
|
|
6379
|
+
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>`);
|
|
6366
6380
|
const input = this.input;
|
|
6367
6381
|
input.value = keep;
|
|
6368
6382
|
this.listen(input, 'input', () => {
|
|
@@ -6430,10 +6444,10 @@ function defineField(tag = 'usa-field') {
|
|
|
6430
6444
|
}
|
|
6431
6445
|
}
|
|
6432
6446
|
return UsaField;
|
|
6433
|
-
}, { id: 'field', text: css$
|
|
6447
|
+
}, { id: 'field', text: css$9 });
|
|
6434
6448
|
}
|
|
6435
6449
|
|
|
6436
|
-
var css$
|
|
6450
|
+
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}}";
|
|
6437
6451
|
|
|
6438
6452
|
/** Keep only the characters an OTP accepts (7.7). */
|
|
6439
6453
|
function sanitizeCode(s, mode = 'numeric') {
|
|
@@ -6564,10 +6578,10 @@ function defineOtp(tag = 'usa-otp') {
|
|
|
6564
6578
|
}
|
|
6565
6579
|
}
|
|
6566
6580
|
return UsaOtp;
|
|
6567
|
-
}, { id: 'otp', text: css$
|
|
6581
|
+
}, { id: 'otp', text: css$8 });
|
|
6568
6582
|
}
|
|
6569
6583
|
|
|
6570
|
-
var css$
|
|
6584
|
+
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}}";
|
|
6571
6585
|
|
|
6572
6586
|
/** 1536 → "1.5 KB", 2_400_000 → "2.3 MB" (7.7). */
|
|
6573
6587
|
function formatBytes(n) {
|
|
@@ -6581,7 +6595,7 @@ function formatBytes(n) {
|
|
|
6581
6595
|
}
|
|
6582
6596
|
return `${i === 0 ? Math.round(n) : n < 10 ? n.toFixed(1) : Math.round(n)} ${u[i]}`;
|
|
6583
6597
|
}
|
|
6584
|
-
const esc$
|
|
6598
|
+
const esc$4 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6585
6599
|
function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
6586
6600
|
return defineElement(tag, (Base) => {
|
|
6587
6601
|
class UsaUploadProgress extends Base {
|
|
@@ -6609,7 +6623,7 @@ function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
|
6609
6623
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6610
6624
|
const name = this.str('name', 'file');
|
|
6611
6625
|
const size = formatBytes(this.num('size', NaN));
|
|
6612
|
-
this.insertAdjacentHTML('beforeend', `<div class="usa-up" data-usa-part><span class="usa-up-icon" aria-hidden="true">${esc$
|
|
6626
|
+
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>`);
|
|
6613
6627
|
this.listen(this.querySelector('.usa-up-retry'), 'click', () => this.emit('retry', { name }));
|
|
6614
6628
|
this._shown = 0;
|
|
6615
6629
|
this.render(true);
|
|
@@ -6650,12 +6664,12 @@ function defineUploadProgress(tag = 'usa-upload-progress') {
|
|
|
6650
6664
|
}
|
|
6651
6665
|
}
|
|
6652
6666
|
return UsaUploadProgress;
|
|
6653
|
-
}, { id: 'upload-progress', text: css$
|
|
6667
|
+
}, { id: 'upload-progress', text: css$7 });
|
|
6654
6668
|
}
|
|
6655
6669
|
|
|
6656
|
-
var css$
|
|
6670
|
+
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}}";
|
|
6657
6671
|
|
|
6658
|
-
const esc$
|
|
6672
|
+
const esc$3 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6659
6673
|
function defineChatComposer(tag = 'usa-chat-composer') {
|
|
6660
6674
|
return defineElement(tag, (Base) => {
|
|
6661
6675
|
class UsaChatComposer extends Base {
|
|
@@ -6685,7 +6699,7 @@ function defineChatComposer(tag = 'usa-chat-composer') {
|
|
|
6685
6699
|
const keep = this.area?.value ?? this.str('value');
|
|
6686
6700
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6687
6701
|
const label = this.str('label', 'Message');
|
|
6688
|
-
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$
|
|
6702
|
+
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>`);
|
|
6689
6703
|
const a = this.area;
|
|
6690
6704
|
a.value = keep;
|
|
6691
6705
|
this.listen(a, 'input', () => this.sync());
|
|
@@ -6751,10 +6765,10 @@ function defineChatComposer(tag = 'usa-chat-composer') {
|
|
|
6751
6765
|
}
|
|
6752
6766
|
}
|
|
6753
6767
|
return UsaChatComposer;
|
|
6754
|
-
}, { id: 'chat-composer', text: css$
|
|
6768
|
+
}, { id: 'chat-composer', text: css$6 });
|
|
6755
6769
|
}
|
|
6756
6770
|
|
|
6757
|
-
var css$
|
|
6771
|
+
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}}";
|
|
6758
6772
|
|
|
6759
6773
|
/** "a | b|c" → ["a", "b", "c"] (7.8). */
|
|
6760
6774
|
function parseChips(s) {
|
|
@@ -6763,7 +6777,7 @@ function parseChips(s) {
|
|
|
6763
6777
|
.map((t) => t.trim())
|
|
6764
6778
|
.filter(Boolean);
|
|
6765
6779
|
}
|
|
6766
|
-
const esc = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6780
|
+
const esc$2 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6767
6781
|
function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
6768
6782
|
return defineElement(tag, (Base) => {
|
|
6769
6783
|
class UsaSuggestionChips extends Base {
|
|
@@ -6798,7 +6812,7 @@ function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
|
6798
6812
|
Array.from(this.children).forEach((c) => !c.hasAttribute('data-usa-part') && c.setAttribute('hidden', ''));
|
|
6799
6813
|
}
|
|
6800
6814
|
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
6801
|
-
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>`);
|
|
6815
|
+
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>`);
|
|
6802
6816
|
const chips = Array.from(this.querySelectorAll('.usa-sc-chip'));
|
|
6803
6817
|
chips.forEach((c, i) => {
|
|
6804
6818
|
this.listen(c, 'click', () => this.pick(i));
|
|
@@ -6839,10 +6853,10 @@ function defineSuggestionChips(tag = 'usa-suggestion-chips') {
|
|
|
6839
6853
|
}
|
|
6840
6854
|
}
|
|
6841
6855
|
return UsaSuggestionChips;
|
|
6842
|
-
}, { id: 'suggestion-chips', text: css$
|
|
6856
|
+
}, { id: 'suggestion-chips', text: css$5 });
|
|
6843
6857
|
}
|
|
6844
6858
|
|
|
6845
|
-
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}}";
|
|
6859
|
+
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}}";
|
|
6846
6860
|
|
|
6847
6861
|
/** Bar heights (0–1) for a level and a phase, centre bars tallest (7.8). */
|
|
6848
6862
|
function waveBars(level, n = 5, phase = 0) {
|
|
@@ -6914,7 +6928,424 @@ function defineVoiceButton(tag = 'usa-voice-button') {
|
|
|
6914
6928
|
}
|
|
6915
6929
|
}
|
|
6916
6930
|
return UsaVoiceButton;
|
|
6917
|
-
}, { id: 'voice-button', text: css });
|
|
6931
|
+
}, { id: 'voice-button', text: css$4 });
|
|
6932
|
+
}
|
|
6933
|
+
|
|
6934
|
+
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)}";
|
|
6935
|
+
|
|
6936
|
+
/**
|
|
6937
|
+
* Fuzzy match: every query letter in order. Returns a score (higher is
|
|
6938
|
+
* better; -1 = no match) and the matched indexes (7.9).
|
|
6939
|
+
*/
|
|
6940
|
+
function fuzzyMatch(query, text) {
|
|
6941
|
+
const q = query.trim().toLowerCase();
|
|
6942
|
+
const t = text.toLowerCase();
|
|
6943
|
+
if (!q)
|
|
6944
|
+
return { score: 0, hits: [] };
|
|
6945
|
+
const hits = [];
|
|
6946
|
+
let score = 0;
|
|
6947
|
+
let from = 0;
|
|
6948
|
+
let prev = -2;
|
|
6949
|
+
for (const ch of q) {
|
|
6950
|
+
if (ch === ' ')
|
|
6951
|
+
continue;
|
|
6952
|
+
const i = t.indexOf(ch, from);
|
|
6953
|
+
if (i < 0)
|
|
6954
|
+
return { score: -1, hits: [] };
|
|
6955
|
+
hits.push(i);
|
|
6956
|
+
score += i === prev + 1 ? 3 : 1; // consecutive letters
|
|
6957
|
+
if (i === 0 || /[\s\-_/]/.test(t[i - 1]))
|
|
6958
|
+
score += 2; // word starts
|
|
6959
|
+
prev = i;
|
|
6960
|
+
from = i + 1;
|
|
6961
|
+
}
|
|
6962
|
+
return { score: score - t.length / 100, hits };
|
|
6963
|
+
}
|
|
6964
|
+
/** "mod+shift+k" → ["⌘", "⇧", "K"] on Apple platforms, ["Ctrl", "Shift", "K"] elsewhere (7.9). */
|
|
6965
|
+
function keyLabels(keys, apple = isApple()) {
|
|
6966
|
+
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'] };
|
|
6967
|
+
return keys
|
|
6968
|
+
.split('+')
|
|
6969
|
+
.map((k) => k.trim())
|
|
6970
|
+
.filter(Boolean)
|
|
6971
|
+
.map((k) => (map[k.toLowerCase()] ? map[k.toLowerCase()][apple ? 0 : 1] : k.length === 1 ? k.toUpperCase() : k[0].toUpperCase() + k.slice(1)));
|
|
6972
|
+
}
|
|
6973
|
+
/** Does a KeyboardEvent match "mod+k"-style keys? (7.9) */
|
|
6974
|
+
function matchesKeys(e, keys, apple = isApple()) {
|
|
6975
|
+
const parts = keys.toLowerCase().split('+').map((k) => k.trim()).filter(Boolean);
|
|
6976
|
+
const key = parts.filter((p) => !['mod', 'cmd', 'meta', 'ctrl', 'shift', 'alt', 'option'].includes(p))[0];
|
|
6977
|
+
if (!key)
|
|
6978
|
+
return false;
|
|
6979
|
+
const want = { meta: false, ctrl: false, shift: parts.includes('shift'), alt: parts.includes('alt') || parts.includes('option') };
|
|
6980
|
+
if (parts.includes('mod'))
|
|
6981
|
+
want[apple ? 'meta' : 'ctrl'] = true;
|
|
6982
|
+
if (parts.includes('cmd') || parts.includes('meta'))
|
|
6983
|
+
want.meta = true;
|
|
6984
|
+
if (parts.includes('ctrl'))
|
|
6985
|
+
want.ctrl = true;
|
|
6986
|
+
const names = { esc: 'escape', space: ' ', up: 'arrowup', down: 'arrowdown', left: 'arrowleft', right: 'arrowright' };
|
|
6987
|
+
const k = (e.key || '').toLowerCase();
|
|
6988
|
+
return k === (names[key] || key) && e.metaKey === want.meta && e.ctrlKey === want.ctrl && e.shiftKey === want.shift && e.altKey === want.alt;
|
|
6989
|
+
}
|
|
6990
|
+
function isApple() {
|
|
6991
|
+
return typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.userAgentData?.platform || navigator.platform || navigator.userAgent || '');
|
|
6992
|
+
}
|
|
6993
|
+
const esc$1 = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
6994
|
+
let uid = 0;
|
|
6995
|
+
function defineCommandPalette(tag = 'usa-command-palette') {
|
|
6996
|
+
return defineElement(tag, (Base) => {
|
|
6997
|
+
class UsaCommandPalette extends Base {
|
|
6998
|
+
constructor() {
|
|
6999
|
+
super(...arguments);
|
|
7000
|
+
this._cmds = null;
|
|
7001
|
+
this._id = `usa-cp-${++uid}`;
|
|
7002
|
+
this._active = 0;
|
|
7003
|
+
this._shown = [];
|
|
7004
|
+
this._opener = null;
|
|
7005
|
+
}
|
|
7006
|
+
static get observedAttributes() {
|
|
7007
|
+
return ['placeholder', 'label', 'hotkey', 'inline'];
|
|
7008
|
+
}
|
|
7009
|
+
get commands() {
|
|
7010
|
+
if (this._cmds)
|
|
7011
|
+
return this._cmds.slice();
|
|
7012
|
+
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 }));
|
|
7013
|
+
}
|
|
7014
|
+
set commands(v) {
|
|
7015
|
+
this.setCommands(v);
|
|
7016
|
+
}
|
|
7017
|
+
setCommands(list) {
|
|
7018
|
+
this._cmds = list.map((c) => ({ ...c, id: String(c.id), label: String(c.label) }));
|
|
7019
|
+
this.render();
|
|
7020
|
+
}
|
|
7021
|
+
get dlg() {
|
|
7022
|
+
return this.querySelector('.usa-cp');
|
|
7023
|
+
}
|
|
7024
|
+
get opened() {
|
|
7025
|
+
return !!this.dlg?.hasAttribute('open');
|
|
7026
|
+
}
|
|
7027
|
+
mount() {
|
|
7028
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7029
|
+
const id = this._id;
|
|
7030
|
+
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>`);
|
|
7031
|
+
const dlg = this.dlg;
|
|
7032
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7033
|
+
this.listen(q, 'input', () => this.render(true));
|
|
7034
|
+
this.listen(q, 'keydown', (e) => {
|
|
7035
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
7036
|
+
e.preventDefault();
|
|
7037
|
+
this.move(e.key === 'ArrowDown' ? 1 : -1);
|
|
7038
|
+
}
|
|
7039
|
+
else if (e.key === 'Enter') {
|
|
7040
|
+
e.preventDefault();
|
|
7041
|
+
this.run(this._active);
|
|
7042
|
+
}
|
|
7043
|
+
else if (e.key === 'Escape' && typeof dlg.showModal !== 'function')
|
|
7044
|
+
this.close();
|
|
7045
|
+
});
|
|
7046
|
+
this.listen(dlg, 'click', (e) => {
|
|
7047
|
+
if (e.target === dlg)
|
|
7048
|
+
this.close();
|
|
7049
|
+
});
|
|
7050
|
+
this.listen(dlg, 'cancel', (e) => {
|
|
7051
|
+
e.preventDefault();
|
|
7052
|
+
this.close();
|
|
7053
|
+
});
|
|
7054
|
+
const hk = this.str('hotkey', 'mod+k');
|
|
7055
|
+
if (hk !== 'none')
|
|
7056
|
+
this.listen(document, 'keydown', (e) => {
|
|
7057
|
+
if (matchesKeys(e, hk)) {
|
|
7058
|
+
e.preventDefault();
|
|
7059
|
+
this.toggle();
|
|
7060
|
+
}
|
|
7061
|
+
});
|
|
7062
|
+
this.render();
|
|
7063
|
+
if (this.flag('inline'))
|
|
7064
|
+
dlg.setAttribute('open', '');
|
|
7065
|
+
}
|
|
7066
|
+
render(typed = false) {
|
|
7067
|
+
const list = this.querySelector('.usa-cp-list');
|
|
7068
|
+
if (!list)
|
|
7069
|
+
return;
|
|
7070
|
+
const q = this.querySelector('.usa-cp-q').value;
|
|
7071
|
+
const all = this.commands;
|
|
7072
|
+
const scored = all
|
|
7073
|
+
.map((c, i) => ({ c, i, m: fuzzyMatch(q, c.label) }))
|
|
7074
|
+
.filter((x) => x.m.score >= 0)
|
|
7075
|
+
.sort((a, b) => (q ? b.m.score - a.m.score : 0) || a.i - b.i);
|
|
7076
|
+
this._shown = scored.map((x) => x.c);
|
|
7077
|
+
this._active = 0;
|
|
7078
|
+
list.querySelectorAll('.usa-cp-item, .usa-cp-group').forEach((n) => n.remove());
|
|
7079
|
+
let html = '';
|
|
7080
|
+
let group = '\u0000';
|
|
7081
|
+
scored.forEach(({ c, m }, i) => {
|
|
7082
|
+
if (!q && c.group !== group) {
|
|
7083
|
+
group = c.group;
|
|
7084
|
+
if (group)
|
|
7085
|
+
html += `<div class="usa-cp-group" role="presentation">${esc$1(group)}</div>`;
|
|
7086
|
+
}
|
|
7087
|
+
const label = Array.from(c.label)
|
|
7088
|
+
.map((ch, j) => (m.hits.includes(j) ? `<mark>${esc$1(ch)}</mark>` : esc$1(ch)))
|
|
7089
|
+
.join('');
|
|
7090
|
+
const keys = c.keys ? `<span class="usa-cp-keys">${keyLabels(c.keys).map((k) => `<kbd>${esc$1(k)}</kbd>`).join('')}</span>` : '';
|
|
7091
|
+
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>`;
|
|
7092
|
+
});
|
|
7093
|
+
list.insertAdjacentHTML('beforeend', html);
|
|
7094
|
+
list.querySelectorAll('.usa-cp-item').forEach((el) => {
|
|
7095
|
+
el.addEventListener('pointermove', () => this.select(Number(el.dataset.i)));
|
|
7096
|
+
el.addEventListener('click', () => this.run(Number(el.dataset.i)));
|
|
7097
|
+
});
|
|
7098
|
+
this.querySelector('.usa-cp-empty').hidden = scored.length > 0;
|
|
7099
|
+
this.select(0, false);
|
|
7100
|
+
if (typed && !this.reduced)
|
|
7101
|
+
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' }));
|
|
7102
|
+
}
|
|
7103
|
+
select(i, glide = true) {
|
|
7104
|
+
const items = Array.from(this.querySelectorAll('.usa-cp-item'));
|
|
7105
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7106
|
+
const hl = this.querySelector('.usa-cp-hl');
|
|
7107
|
+
if (!items.length || !q || !hl) {
|
|
7108
|
+
q?.removeAttribute('aria-activedescendant');
|
|
7109
|
+
if (hl)
|
|
7110
|
+
hl.style.opacity = '0';
|
|
7111
|
+
return;
|
|
7112
|
+
}
|
|
7113
|
+
this._active = Math.max(0, Math.min(items.length - 1, i));
|
|
7114
|
+
items.forEach((el, j) => el.setAttribute('aria-selected', String(j === this._active)));
|
|
7115
|
+
const el = items[this._active];
|
|
7116
|
+
q.setAttribute('aria-activedescendant', el.id);
|
|
7117
|
+
const to = `translateY(${el.offsetTop}px)`;
|
|
7118
|
+
const from = hl.style.transform;
|
|
7119
|
+
hl.style.opacity = '1';
|
|
7120
|
+
hl.style.height = `${el.offsetHeight || 36}px`;
|
|
7121
|
+
hl.style.transform = to;
|
|
7122
|
+
if (glide && from && from !== to && !this.reduced)
|
|
7123
|
+
this.motion(hl, [{ transform: from }, { transform: to }], { duration: 160, easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
7124
|
+
el.scrollIntoView?.({ block: 'nearest' });
|
|
7125
|
+
}
|
|
7126
|
+
move(d) {
|
|
7127
|
+
const n = this._shown.length;
|
|
7128
|
+
if (n)
|
|
7129
|
+
this.select((this._active + d + n) % n);
|
|
7130
|
+
}
|
|
7131
|
+
run(i) {
|
|
7132
|
+
const c = this._shown[i];
|
|
7133
|
+
if (!c)
|
|
7134
|
+
return;
|
|
7135
|
+
this.emit('run', { id: c.id, label: c.label });
|
|
7136
|
+
this.close();
|
|
7137
|
+
}
|
|
7138
|
+
show() {
|
|
7139
|
+
const dlg = this.dlg;
|
|
7140
|
+
if (dlg && this.flag('inline'))
|
|
7141
|
+
return this.querySelector('.usa-cp-q').focus();
|
|
7142
|
+
if (!dlg || this.opened)
|
|
7143
|
+
return;
|
|
7144
|
+
this._opener = document.activeElement;
|
|
7145
|
+
const q = this.querySelector('.usa-cp-q');
|
|
7146
|
+
q.value = '';
|
|
7147
|
+
this.render();
|
|
7148
|
+
if (typeof dlg.showModal === 'function') {
|
|
7149
|
+
try {
|
|
7150
|
+
dlg.showModal();
|
|
7151
|
+
}
|
|
7152
|
+
catch {
|
|
7153
|
+
dlg.setAttribute('open', '');
|
|
7154
|
+
}
|
|
7155
|
+
}
|
|
7156
|
+
else
|
|
7157
|
+
dlg.setAttribute('open', '');
|
|
7158
|
+
this.select(0, false);
|
|
7159
|
+
q.focus();
|
|
7160
|
+
if (!this.reduced)
|
|
7161
|
+
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)' });
|
|
7162
|
+
this.emit('open');
|
|
7163
|
+
}
|
|
7164
|
+
close() {
|
|
7165
|
+
const dlg = this.dlg;
|
|
7166
|
+
if (dlg && this.flag('inline')) {
|
|
7167
|
+
this.querySelector('.usa-cp-q').value = '';
|
|
7168
|
+
return this.render();
|
|
7169
|
+
}
|
|
7170
|
+
if (!dlg || !this.opened)
|
|
7171
|
+
return;
|
|
7172
|
+
const done = () => {
|
|
7173
|
+
if (typeof dlg.close === 'function' && dlg.open)
|
|
7174
|
+
dlg.close();
|
|
7175
|
+
dlg.removeAttribute('open');
|
|
7176
|
+
this._opener?.focus?.();
|
|
7177
|
+
this.emit('close');
|
|
7178
|
+
};
|
|
7179
|
+
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' });
|
|
7180
|
+
if (a)
|
|
7181
|
+
a.finished.then(done, done);
|
|
7182
|
+
else
|
|
7183
|
+
done();
|
|
7184
|
+
}
|
|
7185
|
+
toggle() {
|
|
7186
|
+
if (this.opened)
|
|
7187
|
+
this.close();
|
|
7188
|
+
else
|
|
7189
|
+
this.show();
|
|
7190
|
+
}
|
|
7191
|
+
}
|
|
7192
|
+
return UsaCommandPalette;
|
|
7193
|
+
}, { id: 'command-palette', text: css$3 });
|
|
7194
|
+
}
|
|
7195
|
+
|
|
7196
|
+
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}";
|
|
7197
|
+
|
|
7198
|
+
const SPOKEN = { '⌘': 'Command', '⇧': 'Shift', '⌥': 'Option', '⌃': 'Control', Ctrl: 'Control', '↵': 'Enter', '⇥': 'Tab', '⌫': 'Backspace' };
|
|
7199
|
+
const esc = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
7200
|
+
function defineShortcut(tag = 'usa-shortcut') {
|
|
7201
|
+
return defineElement(tag, (Base) => {
|
|
7202
|
+
class UsaShortcut extends Base {
|
|
7203
|
+
static get observedAttributes() {
|
|
7204
|
+
return ['keys', 'label', 'listen', 'for'];
|
|
7205
|
+
}
|
|
7206
|
+
get labels() {
|
|
7207
|
+
return keyLabels(this.str('keys', 'mod+k'));
|
|
7208
|
+
}
|
|
7209
|
+
mount() {
|
|
7210
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7211
|
+
const labels = this.labels;
|
|
7212
|
+
const spoken = labels.map((l) => SPOKEN[l] || l).join(' ');
|
|
7213
|
+
const text = this.str('label');
|
|
7214
|
+
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>`);
|
|
7215
|
+
if (this.str('listen') !== 'false')
|
|
7216
|
+
this.listen(document, 'keydown', (e) => {
|
|
7217
|
+
if (!e.repeat && matchesKeys(e, this.str('keys', 'mod+k'))) {
|
|
7218
|
+
this.press();
|
|
7219
|
+
const id = this.str('for');
|
|
7220
|
+
const target = id ? document.getElementById(id) : null;
|
|
7221
|
+
if (target) {
|
|
7222
|
+
e.preventDefault();
|
|
7223
|
+
target.click();
|
|
7224
|
+
}
|
|
7225
|
+
}
|
|
7226
|
+
});
|
|
7227
|
+
}
|
|
7228
|
+
/** Animate the caps as if pressed and emit `usa:trigger`. */
|
|
7229
|
+
press() {
|
|
7230
|
+
const caps = Array.from(this.querySelectorAll('kbd'));
|
|
7231
|
+
this.setAttribute('data-pressed', '');
|
|
7232
|
+
const off = () => this.removeAttribute('data-pressed');
|
|
7233
|
+
if (!this.reduced) {
|
|
7234
|
+
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' }));
|
|
7235
|
+
const last = runs[runs.length - 1];
|
|
7236
|
+
if (last)
|
|
7237
|
+
last.finished.then(off, off);
|
|
7238
|
+
else
|
|
7239
|
+
off();
|
|
7240
|
+
}
|
|
7241
|
+
else
|
|
7242
|
+
off();
|
|
7243
|
+
this.emit('trigger', { keys: this.str('keys', 'mod+k') });
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
return UsaShortcut;
|
|
7247
|
+
}, { id: 'shortcut', text: css$2 });
|
|
7248
|
+
}
|
|
7249
|
+
|
|
7250
|
+
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}}";
|
|
7251
|
+
|
|
7252
|
+
function defineClockControl(tag = 'usa-clock-control') {
|
|
7253
|
+
return defineElement(tag, (Base) => {
|
|
7254
|
+
class UsaClockControl extends Base {
|
|
7255
|
+
static get observedAttributes() {
|
|
7256
|
+
return ['speeds', 'label'];
|
|
7257
|
+
}
|
|
7258
|
+
get rate() {
|
|
7259
|
+
return getClock().rate;
|
|
7260
|
+
}
|
|
7261
|
+
get paused() {
|
|
7262
|
+
return getClock().paused;
|
|
7263
|
+
}
|
|
7264
|
+
mount() {
|
|
7265
|
+
this.querySelectorAll(':scope > [data-usa-part]').forEach((n) => n.remove());
|
|
7266
|
+
const speeds = this.str('speeds', '0.25,0.5,1,2')
|
|
7267
|
+
.split(',')
|
|
7268
|
+
.map(Number)
|
|
7269
|
+
.filter((n) => Number.isFinite(n) && n > 0)
|
|
7270
|
+
.slice(0, 6);
|
|
7271
|
+
const label = this.str('label', 'Motion clock').replace(/"/g, '"');
|
|
7272
|
+
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>`);
|
|
7273
|
+
this.listen(this.querySelector('.usa-clk-play'), 'click', () => {
|
|
7274
|
+
setClock({ paused: !getClock().paused });
|
|
7275
|
+
});
|
|
7276
|
+
this.querySelectorAll('.usa-clk-speed').forEach((b) => this.listen(b, 'click', () => setClock({ rate: Number(b.dataset.rate) })));
|
|
7277
|
+
this.onCleanup(onClockChange(() => this.sync(true)));
|
|
7278
|
+
this.sync(false);
|
|
7279
|
+
}
|
|
7280
|
+
sync(user) {
|
|
7281
|
+
const { rate, paused } = getClock();
|
|
7282
|
+
const play = this.querySelector('.usa-clk-play');
|
|
7283
|
+
if (!play)
|
|
7284
|
+
return;
|
|
7285
|
+
play.setAttribute('aria-pressed', String(paused));
|
|
7286
|
+
play.setAttribute('aria-label', paused ? 'Resume animations' : 'Pause animations');
|
|
7287
|
+
this.setFlag('data-paused', paused);
|
|
7288
|
+
let on = null;
|
|
7289
|
+
this.querySelectorAll('.usa-clk-speed').forEach((b) => {
|
|
7290
|
+
const hit = Math.abs(Number(b.dataset.rate) - rate) < 1e-6;
|
|
7291
|
+
b.setAttribute('aria-checked', String(hit));
|
|
7292
|
+
if (hit)
|
|
7293
|
+
on = b;
|
|
7294
|
+
});
|
|
7295
|
+
const ink = this.querySelector('.usa-clk-ink');
|
|
7296
|
+
const target = on;
|
|
7297
|
+
if (target) {
|
|
7298
|
+
ink.style.opacity = '1';
|
|
7299
|
+
ink.style.width = `${target.offsetWidth}px`;
|
|
7300
|
+
ink.style.transform = `translateX(${target.offsetLeft}px)`;
|
|
7301
|
+
}
|
|
7302
|
+
else
|
|
7303
|
+
ink.style.opacity = '0';
|
|
7304
|
+
if (user)
|
|
7305
|
+
this.emit('change', { rate, paused });
|
|
7306
|
+
}
|
|
7307
|
+
}
|
|
7308
|
+
return UsaClockControl;
|
|
7309
|
+
}, { id: 'clock-control', text: css$1 });
|
|
7310
|
+
}
|
|
7311
|
+
|
|
7312
|
+
var css = "usa-hydrate{display:block}";
|
|
7313
|
+
|
|
7314
|
+
function defineHydrate(tag = 'usa-hydrate') {
|
|
7315
|
+
return defineElement(tag, (Base) => {
|
|
7316
|
+
class UsaHydrate extends Base {
|
|
7317
|
+
constructor() {
|
|
7318
|
+
super(...arguments);
|
|
7319
|
+
this._tl = null;
|
|
7320
|
+
}
|
|
7321
|
+
static get observedAttributes() {
|
|
7322
|
+
return ['effect', 'stagger', 'duration'];
|
|
7323
|
+
}
|
|
7324
|
+
get timeline() {
|
|
7325
|
+
return this._tl;
|
|
7326
|
+
}
|
|
7327
|
+
mount() {
|
|
7328
|
+
this.replay();
|
|
7329
|
+
}
|
|
7330
|
+
unmount() {
|
|
7331
|
+
this._tl?.cancel();
|
|
7332
|
+
this._tl = null;
|
|
7333
|
+
}
|
|
7334
|
+
replay() {
|
|
7335
|
+
this._tl?.cancel();
|
|
7336
|
+
const kids = Array.from(this.children);
|
|
7337
|
+
const frames = HYDRATE_PRESETS[this.str('effect', 'fade-up')] || HYDRATE_PRESETS['fade-up'];
|
|
7338
|
+
const tl = createTimeline({ duration: this.num('duration', 600), easing: 'cubic-bezier(.2,.8,.2,1)' });
|
|
7339
|
+
const stagger = this.num('stagger', 60);
|
|
7340
|
+
kids.forEach((k, i) => tl.add(k, frames, {}, i * stagger));
|
|
7341
|
+
this._tl = tl;
|
|
7342
|
+
tl.play();
|
|
7343
|
+
this.setAttribute('data-usa-hydrated', '');
|
|
7344
|
+
tl.finished.then(() => this.isConnected && this._tl === tl && this.emit('hydrated', { count: kids.length }));
|
|
7345
|
+
}
|
|
7346
|
+
}
|
|
7347
|
+
return UsaHydrate;
|
|
7348
|
+
}, { id: 'hydrate', text: css });
|
|
6918
7349
|
}
|
|
6919
7350
|
|
|
6920
7351
|
/**
|
|
@@ -6947,6 +7378,8 @@ const WIDGETS = {
|
|
|
6947
7378
|
'7.6': { 'usa-globe': defineGlobe, 'usa-location-card': defineLocationCard },
|
|
6948
7379
|
'7.7': { 'usa-field': defineField, 'usa-otp': defineOtp, 'usa-upload-progress': defineUploadProgress },
|
|
6949
7380
|
'7.8': { 'usa-chat-composer': defineChatComposer, 'usa-suggestion-chips': defineSuggestionChips, 'usa-voice-button': defineVoiceButton },
|
|
7381
|
+
'7.9': { 'usa-command-palette': defineCommandPalette, 'usa-shortcut': defineShortcut },
|
|
7382
|
+
'8.0': { 'usa-clock-control': defineClockControl, 'usa-hydrate': defineHydrate },
|
|
6950
7383
|
};
|
|
6951
7384
|
/** Every widget tag, in release order. */
|
|
6952
7385
|
const WIDGET_TAGS = Object.values(WIDGETS).flatMap((g) => Object.keys(g));
|
|
@@ -6958,5 +7391,5 @@ function defineWidgets(release) {
|
|
|
6958
7391
|
fn(tag);
|
|
6959
7392
|
}
|
|
6960
7393
|
|
|
6961
|
-
export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PRESENCE_STATES, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, badgeProgress, cartTotal, defineAddToCart, defineBadgeWall, defineBarChart, defineCarousel, defineCartDrawer, defineChatComposer, defineColorPicker, defineCompare, defineCountdown, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineField, defineFileDrop, defineGauge, defineGlobe, defineKanban, defineKeyframeEditor, defineKpi, defineLeaderboard, defineLocationCard, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMessageList, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineNotificationBell, defineOdometer, defineOtp, definePagination, definePresence, definePrizeWheel, defineProductGallery, defineProgressRing, definePullCord, defineReactions, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSuggestionChips, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineUploadProgress, defineVoiceButton, defineVolumeKnob, defineWeatherCard, defineWidgets, defineXpBar, formatBytes, formatDistance, haversine, hexToHsv, hsvToHex, initials, levelFor, monthGrid, pageWindow, parseChips, parseISODate, parseLRC, parseMarkers, parseReactions, passwordStrength, project, rankRows, sanitizeCode, sparkPoints, splitTime, stackToast, waveBars, wheelAngle, wrapIndex };
|
|
7394
|
+
export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PRESENCE_STATES, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, badgeProgress, cartTotal, defineAddToCart, defineBadgeWall, defineBarChart, defineCarousel, defineCartDrawer, defineChatComposer, defineClockControl, defineColorPicker, defineCommandPalette, defineCompare, defineCountdown, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineField, defineFileDrop, defineGauge, defineGlobe, defineHydrate, defineKanban, defineKeyframeEditor, defineKpi, defineLeaderboard, defineLocationCard, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMessageList, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineNotificationBell, defineOdometer, defineOtp, definePagination, definePresence, definePrizeWheel, defineProductGallery, defineProgressRing, definePullCord, defineReactions, defineSegmented, defineSheet, defineShortcut, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSuggestionChips, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineUploadProgress, defineVoiceButton, defineVolumeKnob, defineWeatherCard, defineWidgets, defineXpBar, formatBytes, formatDistance, fuzzyMatch, haversine, hexToHsv, hsvToHex, initials, keyLabels, levelFor, matchesKeys, monthGrid, pageWindow, parseChips, parseISODate, parseLRC, parseMarkers, parseReactions, passwordStrength, project, rankRows, sanitizeCode, sparkPoints, splitTime, stackToast, waveBars, wheelAngle, wrapIndex };
|
|
6962
7395
|
//# sourceMappingURL=widgets.js.map
|