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
package/dist/components/ui.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('../chunks/base-
|
|
4
|
-
var spring = require('../chunks/spring-
|
|
5
|
-
var variants = require('../chunks/variants-
|
|
3
|
+
var base = require('../chunks/base-DoRUZBy-.cjs');
|
|
4
|
+
var spring = require('../chunks/spring-uQMVJTj9.cjs');
|
|
5
|
+
var variants = require('../chunks/variants-DagykrKH.cjs');
|
|
6
6
|
|
|
7
7
|
/** Position a fixed `floating` element next to `anchor`, flipping when it would leave the viewport. */
|
|
8
8
|
function place(floating, anchor, placement = 'top', gap = 8) {
|
|
@@ -36,7 +36,7 @@ function place(floating, anchor, placement = 'top', gap = 8) {
|
|
|
36
36
|
let uid = 0;
|
|
37
37
|
const nextId = (prefix) => `${prefix}-${++uid}`;
|
|
38
38
|
|
|
39
|
-
var css$
|
|
39
|
+
var css$8 = "usa-tabs{display:block;font-family:var(--usa-font)}usa-tabs .usa-tabs-list{position:relative;display:flex;gap:4px;border-bottom:1px solid color-mix(in srgb,currentColor 14%,transparent)}usa-tabs [role=\"tab\"]{position:relative;z-index:1;padding:10px 14px;border:0;background:none;color:inherit;font:inherit;cursor:pointer;opacity:0.7;transition:opacity 0.2s ease,color 0.2s ease;border-radius:calc(var(--usa-radius,14px) / 2)}usa-tabs [role=\"tab\"][aria-selected=\"true\"]{opacity:1;color:var(--usa-accent,#7c5cff)}usa-tabs [role=\"tab\"]:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:-2px}usa-tabs .usa-tabs-indicator{position:absolute;left:0;bottom:-1px;height:3px;width:0;border-radius:3px;background:var(--usa-accent,#7c5cff);pointer-events:none}usa-tabs[indicator=\"pill\"] .usa-tabs-list{border-bottom:0;padding:4px;border-radius:999px;background:color-mix(in srgb,currentColor 8%,transparent)}usa-tabs[indicator=\"pill\"] .usa-tabs-indicator{top:4px;bottom:4px;height:auto;border-radius:999px;opacity:0.18}usa-tabs [role=\"tabpanel\"]{padding:14px 2px}usa-tabs [role=\"tabpanel\"]:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:2px;border-radius:6px}";
|
|
40
40
|
|
|
41
41
|
function defineTabs(tag = 'usa-tabs') {
|
|
42
42
|
variants.adoptVariants();
|
|
@@ -139,10 +139,10 @@ function defineTabs(tag = 'usa-tabs') {
|
|
|
139
139
|
this.motion(p, [{ opacity: 0, transform: `translateX(${i > prev ? 16 : -16}px)` }, { opacity: 1, transform: 'none' }], { duration: 280, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' });
|
|
140
140
|
this.emit('change', { index: i });
|
|
141
141
|
}
|
|
142
|
-
}, { id: 'tabs', text: css$
|
|
142
|
+
}, { id: 'tabs', text: css$8 });
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
var css$
|
|
145
|
+
var css$7 = "usa-drawer,usa-bottom-sheet{position:fixed;z-index:1001;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;will-change:transform;outline:none}usa-drawer{top:0;bottom:0;left:0;width:min(86vw,360px);border-radius:0 var(--usa-radius,14px) var(--usa-radius,14px) 0;padding:20px}usa-drawer[side=\"right\"]{left:auto;right:0;border-radius:var(--usa-radius,14px) 0 0 var(--usa-radius,14px)}usa-drawer[side=\"top\"],usa-drawer[side=\"bottom\"]{left:0;right:0;width:auto;bottom:auto;max-height:80vh;border-radius:0 0 var(--usa-radius,14px) var(--usa-radius,14px);touch-action:pan-x}usa-drawer[side=\"bottom\"]{top:auto;bottom:0;border-radius:var(--usa-radius,14px) var(--usa-radius,14px) 0 0}usa-bottom-sheet{left:0;right:0;bottom:0;margin:0 auto;max-width:640px;border-radius:22px 22px 0 0;padding:8px 20px 24px;touch-action:none}usa-bottom-sheet .usa-sheet-handle{width:40px;height:5px;border-radius:3px;margin:4px auto 14px;background:color-mix(in srgb,currentColor 35%,transparent);cursor:grab}usa-drawer[hidden],usa-bottom-sheet[hidden]{display:none}.usa-panel-backdrop{position:fixed;inset:0;z-index:1000;background:rgb(0 0 0 / 0.45)}";
|
|
146
146
|
|
|
147
147
|
/** Shared machinery of `<usa-drawer>` and `<usa-bottom-sheet>`: backdrop, focus, Esc, drag-to-dismiss. */
|
|
148
148
|
function makePanel(Base, kind) {
|
|
@@ -299,7 +299,7 @@ function makePanel(Base, kind) {
|
|
|
299
299
|
}
|
|
300
300
|
function defineDrawer(tag = 'usa-drawer') {
|
|
301
301
|
variants.adoptVariants();
|
|
302
|
-
return base.defineElement(tag, (Base) => makePanel(Base, 'drawer'), { id: 'sheet', text: css$
|
|
302
|
+
return base.defineElement(tag, (Base) => makePanel(Base, 'drawer'), { id: 'sheet', text: css$7 });
|
|
303
303
|
}
|
|
304
304
|
function defineBottomSheet(tag = 'usa-bottom-sheet') {
|
|
305
305
|
variants.adoptVariants();
|
|
@@ -342,10 +342,10 @@ function defineBottomSheet(tag = 'usa-bottom-sheet') {
|
|
|
342
342
|
super.render(v);
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
|
-
}, { id: 'sheet', text: css$
|
|
345
|
+
}, { id: 'sheet', text: css$7 });
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
var css$
|
|
348
|
+
var css$6 = "usa-pull-refresh{position:relative;display:block;overflow:auto;overscroll-behavior-y:contain;touch-action:pan-x pan-down}usa-pull-refresh>:not(.usa-pull-indicator):not(.usa-sr){transform:translateY(var(--usa-pull,0px))}usa-pull-refresh .usa-pull-indicator{position:absolute;left:50%;top:0;width:34px;height:34px;margin-left:-17px;z-index:2;display:grid;place-items:center;border-radius:50%;background:var(--usa-surface,#1b1e27);box-shadow:var(--usa-shadow);color:var(--usa-accent,#7c5cff);transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(calc(var(--usa-pull-p,0) * 270deg));opacity:var(--usa-pull-p,0);pointer-events:none}usa-pull-refresh .usa-pull-indicator svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}usa-pull-refresh .usa-pull-indicator circle{stroke-dasharray:calc(var(--usa-pull-p,0) * 75) 100}usa-pull-refresh[data-armed] .usa-pull-indicator{background:var(--usa-accent,#7c5cff);color:var(--usa-accent-text,#fff)}usa-pull-refresh[data-refreshing] .usa-pull-indicator{opacity:1;animation:usa-pull-spin 0.8s linear infinite}usa-pull-refresh[data-refreshing] .usa-pull-indicator circle{stroke-dasharray:60 100}@keyframes usa-pull-spin{from{transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(0)}to{transform:translateY(calc(var(--usa-pull,0px) - 40px)) rotate(360deg)}}@media (prefers-reduced-motion:reduce){usa-pull-refresh[data-refreshing] .usa-pull-indicator{animation-duration:2.4s;transform:translateY(8px)}}";
|
|
349
349
|
|
|
350
350
|
function definePullRefresh(tag = 'usa-pull-refresh') {
|
|
351
351
|
variants.adoptVariants();
|
|
@@ -444,10 +444,10 @@ function definePullRefresh(tag = 'usa-pull-refresh') {
|
|
|
444
444
|
Promise.resolve(fn(ev)).then(done, done);
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
}, { id: 'pull-refresh', text: css$
|
|
447
|
+
}, { id: 'pull-refresh', text: css$6 });
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
var css$
|
|
450
|
+
var css$5 = "usa-fab{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:900;display:grid;place-items:center}usa-fab[position=\"bottom-left\"]{right:auto;left:max(20px,env(safe-area-inset-left))}usa-fab[position=\"inline\"]{position:relative;right:auto;bottom:auto;display:inline-grid}usa-fab>*{grid-area:1 / 1}usa-fab .usa-fab-main{position:relative;z-index:1;width:56px;height:56px;border-radius:min(var(--usa-radius,14px) * 1.2,28px);border:0;display:grid;place-items:center;font-size:24px;cursor:pointer;background:var(--usa-accent,#7c5cff);color:var(--usa-accent-text,#fff);box-shadow:var(--usa-shadow);transition:transform 0.35s cubic-bezier(0.34,1.56,0.64,1)}usa-fab[open] .usa-fab-main{transform:rotate(45deg)}usa-fab .usa-fab-action{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;opacity:0;transform:scale(0.4);will-change:transform,opacity}usa-fab .usa-fab-main:focus-visible,usa-fab .usa-fab-action:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}@media (prefers-reduced-motion:reduce){usa-fab .usa-fab-main{transition:none}}";
|
|
451
451
|
|
|
452
452
|
function defineFab(tag = 'usa-fab') {
|
|
453
453
|
variants.adoptVariants();
|
|
@@ -533,10 +533,10 @@ function defineFab(tag = 'usa-fab') {
|
|
|
533
533
|
this.apply(true);
|
|
534
534
|
this.emit('toggle', { open: next });
|
|
535
535
|
}
|
|
536
|
-
}, { id: 'fab', text: css$
|
|
536
|
+
}, { id: 'fab', text: css$5 });
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
var css$
|
|
539
|
+
var css$4 = "usa-navbar{position:sticky;top:0;z-index:800;display:block;transition:transform 0.35s cubic-bezier(0.22,1,0.36,1),padding 0.25s ease,box-shadow 0.25s ease;will-change:transform}usa-navbar[data-hidden]{transform:translateY(-100%)}usa-navbar[data-scrolled]{box-shadow:var(--usa-shadow,0 6px 20px -10px rgb(0 0 0 / 0.4))}usa-navbar[shrink][data-scrolled]{padding-block:4px}@media (prefers-reduced-motion:reduce){usa-navbar{transition:none}}";
|
|
540
540
|
|
|
541
541
|
function defineNavbar(tag = 'usa-navbar') {
|
|
542
542
|
variants.adoptVariants();
|
|
@@ -589,10 +589,10 @@ function defineNavbar(tag = 'usa-navbar') {
|
|
|
589
589
|
this.removeAttribute('data-hidden');
|
|
590
590
|
this.emit('show');
|
|
591
591
|
}
|
|
592
|
-
}, { id: 'navbar', text: css$
|
|
592
|
+
}, { id: 'navbar', text: css$4 });
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
-
var css$
|
|
595
|
+
var css$3 = "usa-slider{--usa-slider:0;position:relative;display:block;height:28px;min-width:120px;touch-action:none;cursor:pointer;-webkit-tap-highlight-color:transparent}usa-slider .usa-slider-track{position:absolute;left:0;right:0;top:50%;height:6px;margin-top:-3px;border-radius:3px;background:color-mix(in srgb,currentColor 16%,transparent);overflow:hidden}usa-slider .usa-slider-fill{position:absolute;inset:0;background:var(--usa-accent,#7c5cff);transform-origin:0 50%;transform:scaleX(var(--usa-slider))}usa-slider .usa-slider-thumb{position:absolute;top:50%;left:calc(var(--usa-slider) * 100%);width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgb(0 0 0 / 0.35),0 0 0 4px color-mix(in srgb,var(--usa-accent,#7c5cff) 0%,transparent);transition:transform 0.25s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.2s ease}usa-slider:hover .usa-slider-thumb,usa-slider:focus-visible .usa-slider-thumb{box-shadow:0 1px 4px rgb(0 0 0 / 0.35),0 0 0 6px color-mix(in srgb,var(--usa-accent,#7c5cff) 25%,transparent)}usa-slider[data-dragging] .usa-slider-thumb{transform:scale(1.25)}usa-slider .usa-slider-bubble{position:absolute;bottom:150%;left:50%;transform:translateX(-50%) scale(0.6);opacity:0;padding:2px 8px;border-radius:8px;font:600 12px/1.6 system-ui,sans-serif;color:var(--usa-accent-text,#fff);background:var(--usa-accent,#7c5cff);white-space:nowrap;pointer-events:none;transition:opacity 0.15s ease,transform 0.25s cubic-bezier(0.34,1.56,0.64,1)}usa-slider[bubble][data-dragging] .usa-slider-bubble,usa-slider[bubble]:focus-visible .usa-slider-bubble{opacity:1;transform:translateX(-50%) scale(1)}usa-slider:focus-visible{outline:none}usa-slider[disabled]{opacity:0.45;cursor:not-allowed}@media (prefers-reduced-motion:reduce){usa-slider .usa-slider-thumb,usa-slider .usa-slider-bubble{transition:none}}";
|
|
596
596
|
|
|
597
597
|
function defineSlider(tag = 'usa-slider') {
|
|
598
598
|
variants.adoptVariants();
|
|
@@ -713,95 +713,7 @@ function defineSlider(tag = 'usa-slider') {
|
|
|
713
713
|
}
|
|
714
714
|
UsaSlider.formAssociated = true;
|
|
715
715
|
return UsaSlider;
|
|
716
|
-
}, { id: 'slider', text: css$
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
var css$3 = "usa-rating{--usa-rating-on:#f5b301;display:inline-flex;gap:2px;font-size:1.5em;line-height:1;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}usa-rating[readonly]{cursor:default}usa-rating .usa-rating-star{display:inline-block;color:color-mix(in srgb,currentColor 22%,transparent);transition:color 0.15s ease,transform 0.2s ease}usa-rating .usa-rating-star[data-on]{color:var(--usa-rating-on)}usa-rating[data-previewing] .usa-rating-star{color:color-mix(in srgb,currentColor 22%,transparent)}usa-rating[data-previewing] .usa-rating-star[data-preview]{color:var(--usa-rating-on);transform:scale(1.12)}usa-rating:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px;border-radius:6px}@media (prefers-reduced-motion:reduce){usa-rating .usa-rating-star{transition:none;transform:none !important}}";
|
|
720
|
-
|
|
721
|
-
function defineRating(tag = 'usa-rating') {
|
|
722
|
-
variants.adoptVariants();
|
|
723
|
-
return base.defineElement(tag, (Base) => {
|
|
724
|
-
class UsaRating extends Base {
|
|
725
|
-
static get observedAttributes() {
|
|
726
|
-
return ['max', 'icon', 'readonly'];
|
|
727
|
-
}
|
|
728
|
-
constructor() {
|
|
729
|
-
super();
|
|
730
|
-
this._internals = null;
|
|
731
|
-
try {
|
|
732
|
-
this._internals = this.attachInternals?.() ?? null;
|
|
733
|
-
}
|
|
734
|
-
catch {
|
|
735
|
-
this._internals = null;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
get value() {
|
|
739
|
-
return base.clamp(this.num('value', 0), 0, this.num('max', 5));
|
|
740
|
-
}
|
|
741
|
-
set value(v) {
|
|
742
|
-
this.setAttribute('value', String(base.clamp(Math.round(v), 0, this.num('max', 5))));
|
|
743
|
-
this.sync();
|
|
744
|
-
}
|
|
745
|
-
mount() {
|
|
746
|
-
const max = this.num('max', 5);
|
|
747
|
-
this.innerHTML = Array.from({ length: max }, (_, i) => `<span class="usa-rating-star" data-i="${i + 1}" aria-hidden="true">${this.str('icon', '★')}</span>`).join('');
|
|
748
|
-
this.setAttribute('role', 'slider');
|
|
749
|
-
this.setAttribute('aria-valuemin', '0');
|
|
750
|
-
this.setAttribute('aria-valuemax', String(max));
|
|
751
|
-
this.setAttribute('aria-label', this.str('label', 'Rating'));
|
|
752
|
-
if (this.flag('readonly'))
|
|
753
|
-
this.setAttribute('aria-readonly', 'true');
|
|
754
|
-
else if (!this.hasAttribute('tabindex'))
|
|
755
|
-
this.tabIndex = 0;
|
|
756
|
-
this.sync();
|
|
757
|
-
if (this.flag('readonly'))
|
|
758
|
-
return;
|
|
759
|
-
this.listen(this, 'pointerover', (e) => {
|
|
760
|
-
const s = e.target.closest?.('[data-i]');
|
|
761
|
-
if (s)
|
|
762
|
-
this.preview(Number(s.dataset.i));
|
|
763
|
-
});
|
|
764
|
-
this.listen(this, 'pointerleave', () => this.preview(0));
|
|
765
|
-
this.listen(this, 'click', (e) => {
|
|
766
|
-
const s = e.target.closest?.('[data-i]');
|
|
767
|
-
if (s)
|
|
768
|
-
this.choose(Number(s.dataset.i) === this.value ? 0 : Number(s.dataset.i));
|
|
769
|
-
});
|
|
770
|
-
this.listen(this, 'keydown', (e) => {
|
|
771
|
-
const v = this.value;
|
|
772
|
-
const map = { ArrowRight: v + 1, ArrowUp: v + 1, ArrowLeft: v - 1, ArrowDown: v - 1, Home: 0, End: max };
|
|
773
|
-
const n = /^[0-9]$/.test(e.key) ? Number(e.key) : map[e.key];
|
|
774
|
-
if (n === undefined)
|
|
775
|
-
return;
|
|
776
|
-
e.preventDefault();
|
|
777
|
-
this.choose(base.clamp(n, 0, max));
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
preview(n) {
|
|
781
|
-
this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-preview', n > 0 && Number(s.dataset.i) <= n));
|
|
782
|
-
this.toggleAttribute('data-previewing', n > 0);
|
|
783
|
-
}
|
|
784
|
-
sync() {
|
|
785
|
-
const v = this.value;
|
|
786
|
-
this.setAttribute('aria-valuenow', String(v));
|
|
787
|
-
this.setAttribute('aria-valuetext', `${v} of ${this.num('max', 5)}`);
|
|
788
|
-
this._internals?.setFormValue?.(String(v));
|
|
789
|
-
this.querySelectorAll('[data-i]').forEach((s) => s.toggleAttribute('data-on', Number(s.dataset.i) <= v));
|
|
790
|
-
}
|
|
791
|
-
choose(n) {
|
|
792
|
-
if (n === this.value)
|
|
793
|
-
return;
|
|
794
|
-
this.value = n;
|
|
795
|
-
const star = this.querySelector(`[data-i="${n}"]`);
|
|
796
|
-
if (star && !this.reduced)
|
|
797
|
-
this.motion(star, [{ transform: 'scale(0.5) rotate(-20deg)' }, { transform: 'scale(1) rotate(0)' }], spring.springEasing('bouncy'));
|
|
798
|
-
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
799
|
-
this.emit('change', { value: n });
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
UsaRating.formAssociated = true;
|
|
803
|
-
return UsaRating;
|
|
804
|
-
}, { id: 'rating', text: css$3 });
|
|
716
|
+
}, { id: 'slider', text: css$3 });
|
|
805
717
|
}
|
|
806
718
|
|
|
807
719
|
var css$2 = "usa-popover{display:inline-block}usa-popover .usa-popover-panel{position:fixed;z-index:1500;min-width:180px;max-width:min(92vw,360px);padding:12px 14px;outline:none}usa-popover .usa-popover-panel[hidden]{display:none}";
|
|
@@ -954,7 +866,7 @@ function defineAvatarStack(tag = 'usa-avatar-stack') {
|
|
|
954
866
|
/**
|
|
955
867
|
* motionary/components/ui — animated UI components + style variants (v2.6).
|
|
956
868
|
* `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
|
|
957
|
-
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`,
|
|
869
|
+
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`,
|
|
958
870
|
* `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
|
|
959
871
|
* and `variant="minimal | neon | glass | brutalist | fluent | material"`
|
|
960
872
|
* design tokens (`setVariant()`, `VARIANTS`).
|
|
@@ -968,7 +880,6 @@ function defineUiComponents() {
|
|
|
968
880
|
defineFab();
|
|
969
881
|
defineNavbar();
|
|
970
882
|
defineSlider();
|
|
971
|
-
defineRating();
|
|
972
883
|
definePopover();
|
|
973
884
|
defineBadge();
|
|
974
885
|
defineAvatarStack();
|
|
@@ -985,7 +896,6 @@ exports.defineFab = defineFab;
|
|
|
985
896
|
exports.defineNavbar = defineNavbar;
|
|
986
897
|
exports.definePopover = definePopover;
|
|
987
898
|
exports.definePullRefresh = definePullRefresh;
|
|
988
|
-
exports.defineRating = defineRating;
|
|
989
899
|
exports.defineSlider = defineSlider;
|
|
990
900
|
exports.defineTabs = defineTabs;
|
|
991
901
|
exports.defineUiComponents = defineUiComponents;
|