use-scroll-animate 6.6.0 → 6.7.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 +14 -0
- package/dist/chunks/{gpu-EjV49FQk.js → gpu-CsP2ZB3x.js} +2 -2
- package/dist/chunks/{gpu-EjV49FQk.js.map → gpu-CsP2ZB3x.js.map} +1 -1
- package/dist/chunks/{registry-Bu5NrAyA.js → registry-D23neB4M.js} +2 -2
- package/dist/chunks/{registry-Bu5NrAyA.js.map → registry-D23neB4M.js.map} +1 -1
- package/dist/components/angular.js +1 -1
- package/dist/components/effects.js +1 -1
- package/dist/components/fx-3d.js +1 -1
- package/dist/components/fx-gpu.js +2 -2
- package/dist/components/fx-light.js +1 -1
- package/dist/components/fx-morph.js +1 -1
- package/dist/components/fx-text.js +1 -1
- package/dist/components/fx-transitions.cjs +249 -0
- package/dist/components/fx-transitions.cjs.map +1 -0
- package/dist/components/fx-transitions.d.cts +77 -0
- package/dist/components/fx-transitions.d.ts +77 -0
- package/dist/components/fx-transitions.js +244 -0
- package/dist/components/fx-transitions.js.map +1 -0
- package/dist/components/fx.js +2 -2
- package/dist/components/fx2.cjs +7 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +34 -1
- package/dist/components/fx2.d.ts +34 -1
- package/dist/components/fx2.js +8 -4
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/solid.js +1 -1
- package/dist/components/svelte.js +1 -1
- package/dist/components/vue.js +1 -1
- package/dist/components/widgets.cjs +458 -37
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +72 -2
- package/dist/components/widgets.d.ts +72 -2
- package/dist/components/widgets.js +452 -38
- package/dist/components/widgets.js.map +1 -1
- package/dist/components.js +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +1 -1
- package/docs/components.md +23 -0
- package/package.json +11 -1
|
@@ -36,7 +36,7 @@ function arrowIndex(e, i, n, vertical = false) {
|
|
|
36
36
|
return -1;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var css$
|
|
39
|
+
var css$l = "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}";
|
|
40
40
|
|
|
41
41
|
const CAROUSEL_EFFECTS = ['slide', 'fade', 'scale', 'cards'];
|
|
42
42
|
function defineCarousel(tag = 'usa-carousel') {
|
|
@@ -225,10 +225,10 @@ function defineCarousel(tag = 'usa-carousel') {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
return UsaCarousel;
|
|
228
|
-
}, { id: 'carousel', text: css$
|
|
228
|
+
}, { id: 'carousel', text: css$l });
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
var css$
|
|
231
|
+
var css$k = "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}";
|
|
232
232
|
|
|
233
233
|
const TAB_INDICATORS = ['pill', 'underline', 'glow', 'gooey'];
|
|
234
234
|
function defineTabBar(tag = 'usa-tab-bar') {
|
|
@@ -341,10 +341,10 @@ function defineTabBar(tag = 'usa-tab-bar') {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
return UsaTabBar;
|
|
344
|
-
}, { id: 'tab-bar', text: css$
|
|
344
|
+
}, { id: 'tab-bar', text: css$k });
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
var css$
|
|
347
|
+
var css$j = "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}}";
|
|
348
348
|
|
|
349
349
|
function defineDisclosure(tag = 'usa-disclosure') {
|
|
350
350
|
return defineElement(tag, (Base) => {
|
|
@@ -412,10 +412,10 @@ function defineDisclosure(tag = 'usa-disclosure') {
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
return UsaDisclosure;
|
|
415
|
-
}, { id: 'disclosure', text: css$
|
|
415
|
+
}, { id: 'disclosure', text: css$j });
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
var css$
|
|
418
|
+
var css$i = "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}}";
|
|
419
419
|
|
|
420
420
|
function defineStories(tag = 'usa-stories') {
|
|
421
421
|
return defineElement(tag, (Base) => {
|
|
@@ -548,10 +548,10 @@ function defineStories(tag = 'usa-stories') {
|
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
return UsaStories;
|
|
551
|
-
}, { id: 'stories', text: css$
|
|
551
|
+
}, { id: 'stories', text: css$i });
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
var css$
|
|
554
|
+
var css$h = "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)}}";
|
|
555
555
|
|
|
556
556
|
const MODAL_EFFECTS = ['scale', 'slide-up', 'flip', 'origin'];
|
|
557
557
|
const SHEET_SIDES = ['right', 'left', 'bottom', 'top'];
|
|
@@ -778,12 +778,12 @@ function defineOverlay(tag, kind) {
|
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
return UsaOverlay;
|
|
781
|
-
}, { id: 'overlay', text: css$
|
|
781
|
+
}, { id: 'overlay', text: css$h });
|
|
782
782
|
}
|
|
783
783
|
const defineModal = (tag = 'usa-modal') => defineOverlay(tag, 'modal');
|
|
784
784
|
const defineSheet = (tag = 'usa-sheet') => defineOverlay(tag, 'sheet');
|
|
785
785
|
|
|
786
|
-
var css$
|
|
786
|
+
var css$g = "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}}";
|
|
787
787
|
|
|
788
788
|
const TOAST_POSITIONS = ['bottom-right', 'bottom-left', 'bottom-center', 'top-right', 'top-left', 'top-center'];
|
|
789
789
|
const ICONS = { info: 'ℹ', success: '✓', warning: '!', error: '✕' };
|
|
@@ -954,7 +954,7 @@ function defineToastStack(tag = 'usa-toast-stack') {
|
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
return UsaToastStack;
|
|
957
|
-
}, { id: 'toast', text: css$
|
|
957
|
+
}, { id: 'toast', text: css$g });
|
|
958
958
|
}
|
|
959
959
|
/** Show a toast on the first `<usa-toast-stack>` of the page (one is created when missing). */
|
|
960
960
|
function stackToast(input, stack) {
|
|
@@ -982,7 +982,7 @@ function installToastTriggers() {
|
|
|
982
982
|
});
|
|
983
983
|
}
|
|
984
984
|
|
|
985
|
-
var css$
|
|
985
|
+
var css$f = "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)}}";
|
|
986
986
|
|
|
987
987
|
const MENU_EFFECTS = ['scale', 'fold', 'slide'];
|
|
988
988
|
function defineMenu(tag = 'usa-menu') {
|
|
@@ -1121,10 +1121,10 @@ function defineMenu(tag = 'usa-menu') {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
return UsaMenu;
|
|
1124
|
-
}, { id: 'menu', text: css$
|
|
1124
|
+
}, { id: 'menu', text: css$f });
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
|
-
var css$
|
|
1127
|
+
var css$e = "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}}";
|
|
1128
1128
|
|
|
1129
1129
|
const PROGRESS_VARIANTS = ['ring', 'bar', 'semi'];
|
|
1130
1130
|
const NS = 'http://www.w3.org/2000/svg';
|
|
@@ -1264,7 +1264,7 @@ function defineProgressRing(tag = 'usa-progress-ring') {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
1266
|
return UsaProgressRing;
|
|
1267
|
-
}, { id: 'meters', text: css$
|
|
1267
|
+
}, { id: 'meters', text: css$e });
|
|
1268
1268
|
}
|
|
1269
1269
|
function defineOdometer(tag = 'usa-odometer') {
|
|
1270
1270
|
return defineElement(tag, (Base) => {
|
|
@@ -1374,10 +1374,10 @@ function defineOdometer(tag = 'usa-odometer') {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
return UsaOdometer;
|
|
1377
|
-
}, { id: 'meters', text: css$
|
|
1377
|
+
}, { id: 'meters', text: css$e });
|
|
1378
1378
|
}
|
|
1379
1379
|
|
|
1380
|
-
var css$
|
|
1380
|
+
var css$d = "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}}";
|
|
1381
1381
|
|
|
1382
1382
|
const SKELETON_VARIANTS = ['wave', 'pulse', 'glow'];
|
|
1383
1383
|
function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
@@ -1492,10 +1492,10 @@ function defineSkeletonReveal(tag = 'usa-skeleton-reveal') {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
1494
|
return UsaSkeletonReveal;
|
|
1495
|
-
}, { id: 'skeleton-reveal', text: css$
|
|
1495
|
+
}, { id: 'skeleton-reveal', text: css$d });
|
|
1496
1496
|
}
|
|
1497
1497
|
|
|
1498
|
-
var css$
|
|
1498
|
+
var css$c = "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}}";
|
|
1499
1499
|
|
|
1500
1500
|
const PATHS = {
|
|
1501
1501
|
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',
|
|
@@ -1619,10 +1619,10 @@ function defineStarRating(tag = 'usa-star-rating') {
|
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
1621
|
return UsaStarRating;
|
|
1622
|
-
}, { id: 'star-rating', text: css$
|
|
1622
|
+
}, { id: 'star-rating', text: css$c });
|
|
1623
1623
|
}
|
|
1624
1624
|
|
|
1625
|
-
var css$
|
|
1625
|
+
var css$b = "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}}";
|
|
1626
1626
|
|
|
1627
1627
|
function defineMilestones(tag = 'usa-milestones') {
|
|
1628
1628
|
return defineElement(tag, (Base) => {
|
|
@@ -1710,10 +1710,10 @@ function defineMilestones(tag = 'usa-milestones') {
|
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
1712
|
return UsaMilestones;
|
|
1713
|
-
}, { id: 'milestones', text: css$
|
|
1713
|
+
}, { id: 'milestones', text: css$b });
|
|
1714
1714
|
}
|
|
1715
1715
|
|
|
1716
|
-
var css$
|
|
1716
|
+
var css$a = "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}";
|
|
1717
1717
|
|
|
1718
1718
|
function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
1719
1719
|
return defineElement(tag, (Base) => {
|
|
@@ -1834,10 +1834,10 @@ function defineMasonryFlow(tag = 'usa-masonry-flow') {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
1836
|
return UsaMasonryFlow;
|
|
1837
|
-
}, { id: 'masonry-flow', text: css$
|
|
1837
|
+
}, { id: 'masonry-flow', text: css$a });
|
|
1838
1838
|
}
|
|
1839
1839
|
|
|
1840
|
-
var css$
|
|
1840
|
+
var css$9 = "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}";
|
|
1841
1841
|
|
|
1842
1842
|
function defineCompare(tag = 'usa-compare') {
|
|
1843
1843
|
return defineElement(tag, (Base) => {
|
|
@@ -1961,10 +1961,10 @@ function defineCompare(tag = 'usa-compare') {
|
|
|
1961
1961
|
}
|
|
1962
1962
|
}
|
|
1963
1963
|
return UsaCompare;
|
|
1964
|
-
}, { id: 'compare', text: css$
|
|
1964
|
+
}, { id: 'compare', text: css$9 });
|
|
1965
1965
|
}
|
|
1966
1966
|
|
|
1967
|
-
var css$
|
|
1967
|
+
var css$8 = "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}";
|
|
1968
1968
|
|
|
1969
1969
|
function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
1970
1970
|
return defineElement(tag, (Base) => {
|
|
@@ -2097,10 +2097,10 @@ function defineCubeGallery(tag = 'usa-cube-gallery') {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
2099
|
return UsaCubeGallery;
|
|
2100
|
-
}, { id: 'cube-gallery', text: css$
|
|
2100
|
+
}, { id: 'cube-gallery', text: css$8 });
|
|
2101
2101
|
}
|
|
2102
2102
|
|
|
2103
|
-
var css$
|
|
2103
|
+
var css$7 = "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}}";
|
|
2104
2104
|
|
|
2105
2105
|
function defineDock(tag = 'usa-dock') {
|
|
2106
2106
|
return defineElement(tag, (Base) => {
|
|
@@ -2168,10 +2168,10 @@ function defineDock(tag = 'usa-dock') {
|
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
return UsaDock;
|
|
2171
|
-
}, { id: 'dock', text: css$
|
|
2171
|
+
}, { id: 'dock', text: css$7 });
|
|
2172
2172
|
}
|
|
2173
2173
|
|
|
2174
|
-
var css$
|
|
2174
|
+
var css$6 = "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)}";
|
|
2175
2175
|
|
|
2176
2176
|
const NAV_INDICATORS = ['underline', 'pill', 'blob', 'dot'];
|
|
2177
2177
|
function defineNavMorph(tag = 'usa-nav-morph') {
|
|
@@ -2275,10 +2275,10 @@ function defineNavMorph(tag = 'usa-nav-morph') {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
}
|
|
2277
2277
|
return UsaNavMorph;
|
|
2278
|
-
}, { id: 'nav-morph', text: css$
|
|
2278
|
+
}, { id: 'nav-morph', text: css$6 });
|
|
2279
2279
|
}
|
|
2280
2280
|
|
|
2281
|
-
var css$
|
|
2281
|
+
var css$5 = "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}";
|
|
2282
2282
|
|
|
2283
2283
|
const TOGGLE_VARIANTS = ['cross', 'arrow', 'minus', 'plus-x'];
|
|
2284
2284
|
function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
@@ -2351,10 +2351,10 @@ function defineMenuToggle(tag = 'usa-menu-toggle') {
|
|
|
2351
2351
|
}
|
|
2352
2352
|
}
|
|
2353
2353
|
return UsaMenuToggle;
|
|
2354
|
-
}, { id: 'menu-toggle', text: css$
|
|
2354
|
+
}, { id: 'menu-toggle', text: css$5 });
|
|
2355
2355
|
}
|
|
2356
2356
|
|
|
2357
|
-
var css = "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)}";
|
|
2357
|
+
var css$4 = "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)}";
|
|
2358
2358
|
|
|
2359
2359
|
const TIP_PLACEMENTS = ['top', 'bottom', 'left', 'right'];
|
|
2360
2360
|
const FLIP = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
|
|
@@ -2486,7 +2486,420 @@ function defineTip(tag = 'usa-tip') {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
}
|
|
2488
2488
|
return UsaTip;
|
|
2489
|
-
}, { id: 'tip', text: css });
|
|
2489
|
+
}, { id: 'tip', text: css$4 });
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
var css$3 = "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}}";
|
|
2493
|
+
|
|
2494
|
+
function defineStepper(tag = 'usa-stepper') {
|
|
2495
|
+
return defineElement(tag, (Base) => {
|
|
2496
|
+
class UsaStepper extends Base {
|
|
2497
|
+
constructor() {
|
|
2498
|
+
super(...arguments);
|
|
2499
|
+
this._steps = [];
|
|
2500
|
+
this._v = 0;
|
|
2501
|
+
this._fill = null;
|
|
2502
|
+
}
|
|
2503
|
+
static get observedAttributes() {
|
|
2504
|
+
return ['orientation'];
|
|
2505
|
+
}
|
|
2506
|
+
get steps() {
|
|
2507
|
+
return this._steps;
|
|
2508
|
+
}
|
|
2509
|
+
get value() {
|
|
2510
|
+
return this._v;
|
|
2511
|
+
}
|
|
2512
|
+
set value(v) {
|
|
2513
|
+
this.go(v);
|
|
2514
|
+
}
|
|
2515
|
+
mount() {
|
|
2516
|
+
this.dataset.orientation = this.str('orientation', 'horizontal') === 'vertical' ? 'vertical' : 'horizontal';
|
|
2517
|
+
this.setAttribute('role', 'list');
|
|
2518
|
+
if (!this.hasAttribute('aria-label'))
|
|
2519
|
+
this.setAttribute('aria-label', this.str('label', 'Progress'));
|
|
2520
|
+
this._steps = ownChildren(this);
|
|
2521
|
+
if (!this.querySelector(':scope > .usa-st-rail')) {
|
|
2522
|
+
const rail = document.createElement('span');
|
|
2523
|
+
rail.className = 'usa-st-rail';
|
|
2524
|
+
rail.setAttribute('data-usa-part', '');
|
|
2525
|
+
rail.setAttribute('aria-hidden', 'true');
|
|
2526
|
+
rail.innerHTML = '<span class="usa-st-fill"></span>';
|
|
2527
|
+
this.prepend(rail);
|
|
2528
|
+
}
|
|
2529
|
+
this._fill = this.querySelector('.usa-st-fill');
|
|
2530
|
+
this._steps.forEach((s, i) => {
|
|
2531
|
+
s.classList.add('usa-st-step');
|
|
2532
|
+
s.setAttribute('role', 'listitem');
|
|
2533
|
+
s.style.setProperty('--usa-st-i', String(i));
|
|
2534
|
+
if (!s.querySelector(':scope > .usa-st-dot')) {
|
|
2535
|
+
const d = document.createElement('span');
|
|
2536
|
+
d.className = 'usa-st-dot';
|
|
2537
|
+
d.setAttribute('aria-hidden', 'true');
|
|
2538
|
+
d.setAttribute('data-usa-part', '');
|
|
2539
|
+
d.innerHTML = `<span class="usa-st-num">${i + 1}</span><svg class="usa-st-check" viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.8"/></svg>`;
|
|
2540
|
+
s.prepend(d);
|
|
2541
|
+
}
|
|
2542
|
+
if (s.hasAttribute('data-clickable') || this.flag('clickable'))
|
|
2543
|
+
this.listen(s, 'click', () => this.go(i));
|
|
2544
|
+
});
|
|
2545
|
+
this._v = clampN(this.num('value', 0) | 0, 0, Math.max(0, this._steps.length - 1));
|
|
2546
|
+
this.sync(-1);
|
|
2547
|
+
}
|
|
2548
|
+
sync(prev) {
|
|
2549
|
+
const n = this._steps.length;
|
|
2550
|
+
this._steps.forEach((s, i) => {
|
|
2551
|
+
s.toggleAttribute('data-done', i < this._v);
|
|
2552
|
+
s.toggleAttribute('data-current', i === this._v);
|
|
2553
|
+
if (i === this._v)
|
|
2554
|
+
s.setAttribute('aria-current', 'step');
|
|
2555
|
+
else
|
|
2556
|
+
s.removeAttribute('aria-current');
|
|
2557
|
+
});
|
|
2558
|
+
const pct = n > 1 ? (this._v / (n - 1)) * 100 : 0;
|
|
2559
|
+
this.style.setProperty('--usa-st-p', pct.toFixed(2) + '%');
|
|
2560
|
+
if (prev < 0 || this.reduced)
|
|
2561
|
+
return;
|
|
2562
|
+
const cur = this._steps[this._v]?.querySelector('.usa-st-dot');
|
|
2563
|
+
if (cur)
|
|
2564
|
+
this.motion(cur, [{ transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(124,92,255,.55)' }, { transform: 'scale(1.18)', offset: 0.35 }, { transform: 'scale(1)', boxShadow: '0 0 0 12px rgba(124,92,255,0)' }], { duration: 620, easing: 'ease-out' });
|
|
2565
|
+
if (this._v > prev) {
|
|
2566
|
+
const done = this._steps[prev]?.querySelector('.usa-st-check');
|
|
2567
|
+
if (done)
|
|
2568
|
+
this.motion(done, [{ strokeDashoffset: 20, transform: 'scale(.4)' }, { strokeDashoffset: 0, transform: 'scale(1)' }], { duration: 420, easing: 'cubic-bezier(.3,1.4,.5,1)' });
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
go(i) {
|
|
2572
|
+
const v = clampN(Math.round(i), 0, Math.max(0, this._steps.length - 1));
|
|
2573
|
+
if (v === this._v)
|
|
2574
|
+
return;
|
|
2575
|
+
const prev = this._v;
|
|
2576
|
+
this._v = v;
|
|
2577
|
+
this.setAttribute('value', String(v));
|
|
2578
|
+
this.sync(prev);
|
|
2579
|
+
this.emit('change', { value: v });
|
|
2580
|
+
}
|
|
2581
|
+
next() {
|
|
2582
|
+
this.go(this._v + 1);
|
|
2583
|
+
}
|
|
2584
|
+
prev() {
|
|
2585
|
+
this.go(this._v - 1);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
return UsaStepper;
|
|
2589
|
+
}, { id: 'stepper', text: css$3 });
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
var css$2 = "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}}";
|
|
2593
|
+
|
|
2594
|
+
/** The visible page list: numbers and `'…'` gaps (1-based). */
|
|
2595
|
+
function pageWindow(page, total, siblings = 1) {
|
|
2596
|
+
const out = [];
|
|
2597
|
+
const lo = Math.max(2, page - siblings);
|
|
2598
|
+
const hi = Math.min(total - 1, page + siblings);
|
|
2599
|
+
out.push(1);
|
|
2600
|
+
if (lo > 2)
|
|
2601
|
+
out.push('…');
|
|
2602
|
+
for (let p = lo; p <= hi; p++)
|
|
2603
|
+
out.push(p);
|
|
2604
|
+
if (hi < total - 1)
|
|
2605
|
+
out.push('…');
|
|
2606
|
+
if (total > 1)
|
|
2607
|
+
out.push(total);
|
|
2608
|
+
return out;
|
|
2609
|
+
}
|
|
2610
|
+
function definePagination(tag = 'usa-pagination') {
|
|
2611
|
+
return defineElement(tag, (Base) => {
|
|
2612
|
+
class UsaPagination extends Base {
|
|
2613
|
+
constructor() {
|
|
2614
|
+
super(...arguments);
|
|
2615
|
+
this._page = 1;
|
|
2616
|
+
this._ink = null;
|
|
2617
|
+
this._list = null;
|
|
2618
|
+
}
|
|
2619
|
+
static get observedAttributes() {
|
|
2620
|
+
return ['total', 'siblings'];
|
|
2621
|
+
}
|
|
2622
|
+
get total() {
|
|
2623
|
+
return Math.max(1, this.num('total', 1) | 0);
|
|
2624
|
+
}
|
|
2625
|
+
get page() {
|
|
2626
|
+
return this._page;
|
|
2627
|
+
}
|
|
2628
|
+
set page(p) {
|
|
2629
|
+
this.go(p);
|
|
2630
|
+
}
|
|
2631
|
+
mount() {
|
|
2632
|
+
dropParts(this);
|
|
2633
|
+
this.setAttribute('role', 'navigation');
|
|
2634
|
+
if (!this.hasAttribute('aria-label'))
|
|
2635
|
+
this.setAttribute('aria-label', this.str('label', 'Pagination'));
|
|
2636
|
+
this._page = clampN(this.num('page', 1) | 0, 1, this.total);
|
|
2637
|
+
const prev = this.btn('‹', 'Previous page', 'usa-pg-prev');
|
|
2638
|
+
const next = this.btn('›', 'Next page', 'usa-pg-next');
|
|
2639
|
+
this._list = document.createElement('span');
|
|
2640
|
+
this._list.className = 'usa-pg-list';
|
|
2641
|
+
this._list.setAttribute('data-usa-part', '');
|
|
2642
|
+
this._ink = document.createElement('span');
|
|
2643
|
+
this._ink.className = 'usa-pg-ink';
|
|
2644
|
+
this._ink.setAttribute('aria-hidden', 'true');
|
|
2645
|
+
this._list.appendChild(this._ink);
|
|
2646
|
+
this.append(prev, this._list, next);
|
|
2647
|
+
this.listen(prev, 'click', () => this.go(this._page - 1));
|
|
2648
|
+
this.listen(next, 'click', () => this.go(this._page + 1));
|
|
2649
|
+
this.listen(this._list, 'click', (e) => {
|
|
2650
|
+
const b = e.target.closest?.('[data-page]');
|
|
2651
|
+
if (b)
|
|
2652
|
+
this.go(Number(b.dataset.page));
|
|
2653
|
+
});
|
|
2654
|
+
this.render(0);
|
|
2655
|
+
}
|
|
2656
|
+
btn(txt, label, cls) {
|
|
2657
|
+
const b = document.createElement('button');
|
|
2658
|
+
b.type = 'button';
|
|
2659
|
+
b.className = 'usa-pg-btn ' + cls;
|
|
2660
|
+
b.textContent = txt;
|
|
2661
|
+
b.setAttribute('aria-label', label);
|
|
2662
|
+
b.setAttribute('data-usa-part', '');
|
|
2663
|
+
return b;
|
|
2664
|
+
}
|
|
2665
|
+
render(dir) {
|
|
2666
|
+
const list = this._list;
|
|
2667
|
+
const old = new Map(Array.from(list.querySelectorAll('[data-page]')).map((b) => [b.dataset.page, b]));
|
|
2668
|
+
list.querySelectorAll('.usa-pg-btn,.usa-pg-gap').forEach((n) => n.remove());
|
|
2669
|
+
for (const p of pageWindow(this._page, this.total, Math.max(0, this.num('siblings', 1) | 0))) {
|
|
2670
|
+
if (p === '…') {
|
|
2671
|
+
const g = document.createElement('span');
|
|
2672
|
+
g.className = 'usa-pg-gap';
|
|
2673
|
+
g.textContent = '…';
|
|
2674
|
+
g.setAttribute('aria-hidden', 'true');
|
|
2675
|
+
list.appendChild(g);
|
|
2676
|
+
continue;
|
|
2677
|
+
}
|
|
2678
|
+
const b = this.btn(String(p), `Page ${p}`, 'usa-pg-num');
|
|
2679
|
+
b.dataset.page = String(p);
|
|
2680
|
+
if (p === this._page)
|
|
2681
|
+
b.setAttribute('aria-current', 'page');
|
|
2682
|
+
list.appendChild(b);
|
|
2683
|
+
if (dir && !old.has(String(p)) && !this.reduced)
|
|
2684
|
+
this.motion(b, [{ transform: `translateX(${dir * 14}px)`, opacity: 0 }, { transform: 'none', opacity: 1 }], { duration: 280, easing: 'ease-out' });
|
|
2685
|
+
}
|
|
2686
|
+
this.querySelector('.usa-pg-prev').disabled = this._page <= 1;
|
|
2687
|
+
this.querySelector('.usa-pg-next').disabled = this._page >= this.total;
|
|
2688
|
+
this.placeInk(dir !== 0);
|
|
2689
|
+
}
|
|
2690
|
+
placeInk(animate) {
|
|
2691
|
+
const cur = this._list?.querySelector('[aria-current="page"]');
|
|
2692
|
+
const ink = this._ink;
|
|
2693
|
+
if (!cur || !ink)
|
|
2694
|
+
return;
|
|
2695
|
+
const from = ink.style.transform;
|
|
2696
|
+
const to = `translateX(${cur.offsetLeft}px)`;
|
|
2697
|
+
ink.style.width = cur.offsetWidth + 'px';
|
|
2698
|
+
ink.style.transform = to;
|
|
2699
|
+
if (animate && from && from !== to && !this.reduced)
|
|
2700
|
+
this.motion(ink, [{ transform: from }, { transform: `${to} scaleX(1.35) scaleY(.8)`, offset: 0.55 }, { transform: to }], { duration: 420, easing: 'cubic-bezier(.3,1.3,.5,1)' });
|
|
2701
|
+
}
|
|
2702
|
+
go(p) {
|
|
2703
|
+
const v = clampN(Math.round(p), 1, this.total);
|
|
2704
|
+
if (v === this._page)
|
|
2705
|
+
return;
|
|
2706
|
+
const dir = v > this._page ? 1 : -1;
|
|
2707
|
+
this._page = v;
|
|
2708
|
+
this.setAttribute('page', String(v));
|
|
2709
|
+
this.render(dir);
|
|
2710
|
+
this.emit('change', { page: v });
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
return UsaPagination;
|
|
2714
|
+
}, { id: 'pagination', text: css$2 });
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
var css$1 = "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}}";
|
|
2718
|
+
|
|
2719
|
+
const SEGMENTED_VARIANTS = ['ios', 'pill', 'outline'];
|
|
2720
|
+
function defineSegmented(tag = 'usa-segmented') {
|
|
2721
|
+
return defineElement(tag, (Base) => {
|
|
2722
|
+
class UsaSegmented extends Base {
|
|
2723
|
+
constructor() {
|
|
2724
|
+
super(...arguments);
|
|
2725
|
+
this._segs = [];
|
|
2726
|
+
this._v = 0;
|
|
2727
|
+
this._thumb = null;
|
|
2728
|
+
}
|
|
2729
|
+
static get observedAttributes() {
|
|
2730
|
+
return ['variant'];
|
|
2731
|
+
}
|
|
2732
|
+
get segments() {
|
|
2733
|
+
return this._segs;
|
|
2734
|
+
}
|
|
2735
|
+
get value() {
|
|
2736
|
+
return this._v;
|
|
2737
|
+
}
|
|
2738
|
+
set value(v) {
|
|
2739
|
+
this.select(v, false);
|
|
2740
|
+
}
|
|
2741
|
+
mount() {
|
|
2742
|
+
const v = this.str('variant', 'ios');
|
|
2743
|
+
this.dataset.variant = SEGMENTED_VARIANTS.includes(v) ? v : 'ios';
|
|
2744
|
+
this.setAttribute('role', 'radiogroup');
|
|
2745
|
+
if (!this.hasAttribute('aria-label'))
|
|
2746
|
+
this.setAttribute('aria-label', this.str('label', 'Options'));
|
|
2747
|
+
this._segs = ownChildren(this);
|
|
2748
|
+
if (!this.querySelector(':scope > .usa-seg-thumb')) {
|
|
2749
|
+
const t = document.createElement('span');
|
|
2750
|
+
t.className = 'usa-seg-thumb';
|
|
2751
|
+
t.setAttribute('aria-hidden', 'true');
|
|
2752
|
+
t.setAttribute('data-usa-part', '');
|
|
2753
|
+
this.prepend(t);
|
|
2754
|
+
}
|
|
2755
|
+
this._thumb = this.querySelector('.usa-seg-thumb');
|
|
2756
|
+
const pre = this._segs.findIndex((s) => s.hasAttribute('selected') || s.getAttribute('aria-checked') === 'true');
|
|
2757
|
+
this._v = clampN(pre >= 0 ? pre : this.num('value', 0) | 0, 0, Math.max(0, this._segs.length - 1));
|
|
2758
|
+
this._segs.forEach((s, i) => {
|
|
2759
|
+
s.classList.add('usa-seg-item');
|
|
2760
|
+
s.setAttribute('role', 'radio');
|
|
2761
|
+
this.listen(s, 'click', () => this.select(i, true));
|
|
2762
|
+
this.listen(s, 'keydown', (e) => {
|
|
2763
|
+
const j = arrowIndex(e, i, this._segs.length);
|
|
2764
|
+
if (j < 0)
|
|
2765
|
+
return;
|
|
2766
|
+
e.preventDefault();
|
|
2767
|
+
this.select(j, true);
|
|
2768
|
+
this._segs[j].focus();
|
|
2769
|
+
});
|
|
2770
|
+
});
|
|
2771
|
+
this.sync(false);
|
|
2772
|
+
if (typeof ResizeObserver === 'function') {
|
|
2773
|
+
const ro = new ResizeObserver(() => this.place(false));
|
|
2774
|
+
ro.observe(this);
|
|
2775
|
+
this.onCleanup(() => ro.disconnect());
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
sync(animate) {
|
|
2779
|
+
this._segs.forEach((s, i) => {
|
|
2780
|
+
s.setAttribute('aria-checked', String(i === this._v));
|
|
2781
|
+
s.tabIndex = i === this._v ? 0 : -1;
|
|
2782
|
+
s.toggleAttribute('data-selected', i === this._v);
|
|
2783
|
+
});
|
|
2784
|
+
this.place(animate);
|
|
2785
|
+
}
|
|
2786
|
+
place(animate) {
|
|
2787
|
+
const s = this._segs[this._v];
|
|
2788
|
+
const t = this._thumb;
|
|
2789
|
+
if (!s || !t)
|
|
2790
|
+
return;
|
|
2791
|
+
const from = { x: t.offsetLeft, w: t.offsetWidth };
|
|
2792
|
+
t.style.left = s.offsetLeft + 'px';
|
|
2793
|
+
t.style.width = s.offsetWidth + 'px';
|
|
2794
|
+
if (!animate || this.reduced || !from.w)
|
|
2795
|
+
return;
|
|
2796
|
+
const dx = from.x - s.offsetLeft;
|
|
2797
|
+
const sx = from.w / (s.offsetWidth || 1);
|
|
2798
|
+
this.motion(t, [{ transform: `translateX(${dx}px) scaleX(${sx})` }, { transform: `translateX(${dx * 0.35}px) scaleX(${Math.max(sx, 1) * 1.18}) scaleY(.88)`, offset: 0.45 }, { transform: 'none' }], { duration: 430, easing: 'cubic-bezier(.3,1.25,.5,1)' });
|
|
2799
|
+
}
|
|
2800
|
+
select(i, user) {
|
|
2801
|
+
const v = clampN(i | 0, 0, Math.max(0, this._segs.length - 1));
|
|
2802
|
+
if (v === this._v)
|
|
2803
|
+
return;
|
|
2804
|
+
this._v = v;
|
|
2805
|
+
this.sync(true);
|
|
2806
|
+
if (user)
|
|
2807
|
+
this.emit('change', { value: v, label: this._segs[v]?.textContent?.trim() || '' });
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
return UsaSegmented;
|
|
2811
|
+
}, { id: 'segmented', text: css$1 });
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
var css = "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}}";
|
|
2815
|
+
|
|
2816
|
+
const SWITCH_VARIANTS = ['ios', 'daynight', 'bounce', 'liquid'];
|
|
2817
|
+
function defineSwitch(tag = 'usa-switch') {
|
|
2818
|
+
return defineElement(tag, (Base) => {
|
|
2819
|
+
class UsaSwitch extends Base {
|
|
2820
|
+
constructor() {
|
|
2821
|
+
super(...arguments);
|
|
2822
|
+
this._on = false;
|
|
2823
|
+
this._input = null;
|
|
2824
|
+
}
|
|
2825
|
+
static get observedAttributes() {
|
|
2826
|
+
return ['variant'];
|
|
2827
|
+
}
|
|
2828
|
+
get checked() {
|
|
2829
|
+
return this._on;
|
|
2830
|
+
}
|
|
2831
|
+
set checked(v) {
|
|
2832
|
+
this.toggle(!!v, false);
|
|
2833
|
+
}
|
|
2834
|
+
mount() {
|
|
2835
|
+
const v = this.str('variant', 'ios');
|
|
2836
|
+
this.dataset.variant = SWITCH_VARIANTS.includes(v) ? v : 'ios';
|
|
2837
|
+
if (!this.querySelector(':scope > .usa-sw-track')) {
|
|
2838
|
+
const t = document.createElement('span');
|
|
2839
|
+
t.className = 'usa-sw-track';
|
|
2840
|
+
t.setAttribute('aria-hidden', 'true');
|
|
2841
|
+
t.setAttribute('data-usa-part', '');
|
|
2842
|
+
t.innerHTML = '<span class="usa-sw-fill"></span><span class="usa-sw-deco"></span><span class="usa-sw-thumb"></span>';
|
|
2843
|
+
this.prepend(t);
|
|
2844
|
+
}
|
|
2845
|
+
this.setAttribute('role', 'switch');
|
|
2846
|
+
if (!this.hasAttribute('tabindex'))
|
|
2847
|
+
this.tabIndex = 0;
|
|
2848
|
+
if (!this.hasAttribute('aria-label') && !this.textContent?.trim())
|
|
2849
|
+
this.setAttribute('aria-label', this.str('label', 'Toggle'));
|
|
2850
|
+
this._on = this.flag('checked');
|
|
2851
|
+
if (this.str('name', '') && !this._input) {
|
|
2852
|
+
this._input = document.createElement('input');
|
|
2853
|
+
this._input.type = 'hidden';
|
|
2854
|
+
this._input.setAttribute('data-usa-part', '');
|
|
2855
|
+
this.appendChild(this._input);
|
|
2856
|
+
}
|
|
2857
|
+
this.sync(false);
|
|
2858
|
+
this.querySelector('.usa-sw-thumb');
|
|
2859
|
+
this.listen(this, 'pointerdown', () => !this.reduced && this.toggleAttribute('data-press', true));
|
|
2860
|
+
this.listen(this, 'pointerup', () => this.removeAttribute('data-press'));
|
|
2861
|
+
this.listen(this, 'pointerleave', () => this.removeAttribute('data-press'));
|
|
2862
|
+
this.listen(this, 'click', () => this.toggle(undefined, true));
|
|
2863
|
+
this.listen(this, 'keydown', (e) => {
|
|
2864
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
2865
|
+
e.preventDefault();
|
|
2866
|
+
this.toggle(undefined, true);
|
|
2867
|
+
}
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
sync(animate) {
|
|
2871
|
+
this.setAttribute('aria-checked', String(this._on));
|
|
2872
|
+
this.toggleAttribute('data-on', this._on);
|
|
2873
|
+
this.toggleAttribute('data-animate', animate && !this.reduced);
|
|
2874
|
+
if (this._input) {
|
|
2875
|
+
this._input.name = this.str('name', '');
|
|
2876
|
+
this._input.value = this.str('value', 'on');
|
|
2877
|
+
this._input.disabled = !this._on;
|
|
2878
|
+
}
|
|
2879
|
+
if (!animate || this.reduced)
|
|
2880
|
+
return;
|
|
2881
|
+
const thumb = this.querySelector('.usa-sw-thumb');
|
|
2882
|
+
if (thumb && this.dataset.variant === 'bounce')
|
|
2883
|
+
this.motion(thumb, [{ scale: '1 1' }, { scale: '1.35 .7', offset: 0.55 }, { scale: '.9 1.1', offset: 0.75 }, { scale: '1 1' }], { duration: 520, easing: 'ease-out' });
|
|
2884
|
+
const fill = this.querySelector('.usa-sw-fill');
|
|
2885
|
+
if (fill && this.dataset.variant === 'liquid')
|
|
2886
|
+
this.motion(fill, [{ borderRadius: '50% 50% 40% 60%' }, { borderRadius: '30% 70% 60% 40%', offset: 0.5 }, { borderRadius: '999px' }], { duration: 600, easing: 'ease-out' });
|
|
2887
|
+
}
|
|
2888
|
+
toggle(force, user = false) {
|
|
2889
|
+
if (this.flag('disabled') && user)
|
|
2890
|
+
return;
|
|
2891
|
+
const next = typeof force === 'boolean' ? force : !this._on;
|
|
2892
|
+
if (next === this._on)
|
|
2893
|
+
return;
|
|
2894
|
+
this._on = next;
|
|
2895
|
+
this.toggleAttribute('checked', next);
|
|
2896
|
+
this.sync(user);
|
|
2897
|
+
if (user)
|
|
2898
|
+
this.emit('change', { checked: next });
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
return UsaSwitch;
|
|
2902
|
+
}, { id: 'switch', text: css });
|
|
2490
2903
|
}
|
|
2491
2904
|
|
|
2492
2905
|
/**
|
|
@@ -2508,6 +2921,7 @@ const WIDGETS = {
|
|
|
2508
2921
|
'6.4': { 'usa-progress-ring': defineProgressRing, 'usa-odometer': defineOdometer, 'usa-skeleton-reveal': defineSkeletonReveal, 'usa-star-rating': defineStarRating },
|
|
2509
2922
|
'6.5': { 'usa-milestones': defineMilestones, 'usa-masonry-flow': defineMasonryFlow, 'usa-compare': defineCompare, 'usa-cube-gallery': defineCubeGallery },
|
|
2510
2923
|
'6.6': { 'usa-dock': defineDock, 'usa-nav-morph': defineNavMorph, 'usa-menu-toggle': defineMenuToggle, 'usa-tip': defineTip },
|
|
2924
|
+
'6.7': { 'usa-stepper': defineStepper, 'usa-pagination': definePagination, 'usa-segmented': defineSegmented, 'usa-switch': defineSwitch },
|
|
2511
2925
|
};
|
|
2512
2926
|
/** Every widget tag, in release order. */
|
|
2513
2927
|
const WIDGET_TAGS = Object.values(WIDGETS).flatMap((g) => Object.keys(g));
|
|
@@ -2519,5 +2933,5 @@ function defineWidgets(release) {
|
|
|
2519
2933
|
fn(tag);
|
|
2520
2934
|
}
|
|
2521
2935
|
|
|
2522
|
-
export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineDock, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineNavMorph, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineTip, defineToastStack, defineWidgets, stackToast };
|
|
2936
|
+
export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineDock, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineNavMorph, defineOdometer, definePagination, defineProgressRing, defineSegmented, defineSheet, defineSkeletonReveal, defineStarRating, defineStepper, defineStories, defineSwitch, defineTabBar, defineTip, defineToastStack, defineWidgets, pageWindow, stackToast };
|
|
2523
2937
|
//# sourceMappingURL=widgets.js.map
|