use-scroll-animate 2.8.0 → 2.9.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 +24 -0
- package/README.md +2 -2
- package/README_zh.md +1 -1
- package/dist/chunks/{base-BR6fYLBA.cjs → base-BkQcvoSG.cjs} +29 -1
- package/dist/chunks/{base-BR6fYLBA.cjs.map → base-BkQcvoSG.cjs.map} +1 -1
- package/dist/chunks/{base-C_w9ibbn.js → base-CB8gChoe.js} +29 -2
- package/dist/chunks/{base-C_w9ibbn.js.map → base-CB8gChoe.js.map} +1 -1
- package/dist/chunks/{core-B_J4rXbC.cjs → core-C1cEwjJj.cjs} +11 -2
- package/dist/chunks/core-C1cEwjJj.cjs.map +1 -0
- package/dist/chunks/{core-BP-a1iNc.js → core-J_KM443q.js} +12 -3
- package/dist/chunks/core-J_KM443q.js.map +1 -0
- package/dist/chunks/index-tags-BEM98giN.cjs +20 -0
- package/dist/chunks/index-tags-BEM98giN.cjs.map +1 -0
- package/dist/chunks/index-tags-f37txHmb.js +18 -0
- package/dist/chunks/index-tags-f37txHmb.js.map +1 -0
- package/dist/chunks/{spring-DyHe1Hfa.cjs → spring-7U9MC6yQ.cjs} +2 -2
- package/dist/chunks/{spring-DyHe1Hfa.cjs.map → spring-7U9MC6yQ.cjs.map} +1 -1
- package/dist/chunks/{spring-Dc8ZqDWE.js → spring-ka0YJ_ZR.js} +2 -2
- package/dist/chunks/{spring-Dc8ZqDWE.js.map → spring-ka0YJ_ZR.js.map} +1 -1
- package/dist/chunks/{stagger-DTv_WiUQ.js → stagger-CGF18oNs.js} +2 -2
- package/dist/chunks/{stagger-DTv_WiUQ.js.map → stagger-CGF18oNs.js.map} +1 -1
- package/dist/chunks/{stagger-DHw0ExuR.cjs → stagger-DtKKS6GP.cjs} +2 -2
- package/dist/chunks/{stagger-DHw0ExuR.cjs.map → stagger-DtKKS6GP.cjs.map} +1 -1
- package/dist/chunks/{variants-idgMVXhE.js → variants-Ce9CboVc.js} +2 -2
- package/dist/chunks/{variants-idgMVXhE.js.map → variants-Ce9CboVc.js.map} +1 -1
- package/dist/chunks/{variants-Bbatdq8d.cjs → variants-PsCXbQ5h.cjs} +2 -2
- package/dist/chunks/{variants-Bbatdq8d.cjs.map → variants-PsCXbQ5h.cjs.map} +1 -1
- package/dist/components/background.cjs +3 -3
- package/dist/components/background.cjs.map +1 -1
- package/dist/components/background.css +1 -1
- package/dist/components/background.d.cts +1 -1
- package/dist/components/background.d.ts +1 -1
- package/dist/components/background.js +4 -4
- package/dist/components/background.js.map +1 -1
- package/dist/components/cards.cjs +2 -2
- package/dist/components/cards.js +3 -3
- package/dist/components/click.cjs +2 -2
- package/dist/components/click.js +3 -3
- package/dist/components/feedback.cjs +15 -8
- package/dist/components/feedback.cjs.map +1 -1
- package/dist/components/feedback.d.cts +4 -1
- package/dist/components/feedback.d.ts +4 -1
- package/dist/components/feedback.js +16 -9
- package/dist/components/feedback.js.map +1 -1
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/jsx.cjs +3 -0
- package/dist/components/jsx.cjs.map +1 -0
- package/dist/components/jsx.d.cts +45 -0
- package/dist/components/jsx.d.ts +45 -0
- package/dist/components/jsx.js +2 -0
- package/dist/components/jsx.js.map +1 -0
- package/dist/components/lazy.cjs +84 -0
- package/dist/components/lazy.cjs.map +1 -0
- package/dist/components/lazy.d.cts +40 -0
- package/dist/components/lazy.d.ts +40 -0
- package/dist/components/lazy.js +79 -0
- package/dist/components/lazy.js.map +1 -0
- package/dist/components/page.cjs +2 -2
- package/dist/components/page.js +3 -3
- package/dist/components/physics.cjs +2 -2
- package/dist/components/physics.js +4 -4
- package/dist/components/react.cjs +96 -0
- package/dist/components/react.cjs.map +1 -0
- package/dist/components/react.d.cts +18 -0
- package/dist/components/react.d.ts +18 -0
- package/dist/components/react.js +91 -0
- package/dist/components/react.js.map +1 -0
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +2 -2
- package/dist/components/transitions.cjs +3 -4
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.js +4 -5
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +3 -3
- package/dist/components/ui.js +5 -5
- package/dist/components/vue.cjs +51 -0
- package/dist/components/vue.cjs.map +1 -0
- package/dist/components/vue.d.cts +1344 -0
- package/dist/components/vue.d.ts +1344 -0
- package/dist/components/vue.js +48 -0
- package/dist/components/vue.js.map +1 -0
- package/dist/components.cjs +5 -18
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.d.cts +6 -2
- package/dist/components.d.ts +6 -2
- package/dist/components.js +7 -20
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/element.cjs +1 -1
- package/dist/element.js +1 -1
- package/dist/element.umd.js +1 -1
- package/dist/element.umd.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +3 -3
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.js +2 -2
- package/dist/solid.cjs +2 -2
- package/dist/solid.js +2 -2
- package/dist/svelte.cjs +2 -2
- package/dist/svelte.js +2 -2
- package/dist/vue.cjs +2 -2
- package/dist/vue.js +2 -2
- package/docs/accessibility.md +32 -0
- package/docs/components.md +28 -6
- package/docs/frameworks-ssr.md +64 -0
- package/docs/upgrading-3.md +20 -0
- package/docs/windows-apps.md +2 -2
- package/package.json +42 -1
- package/dist/chunks/core-BP-a1iNc.js.map +0 -1
- package/dist/chunks/core-B_J4rXbC.cjs.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponents } from '../components.js';
|
|
2
|
+
import './reveal.js';
|
|
3
|
+
import '../chunks/base-CB8gChoe.js';
|
|
4
|
+
import './text.js';
|
|
5
|
+
import './interaction.js';
|
|
6
|
+
import './feedback.js';
|
|
7
|
+
import './background.js';
|
|
8
|
+
import '../chunks/variants-Ce9CboVc.js';
|
|
9
|
+
import './transitions.js';
|
|
10
|
+
import './physics.js';
|
|
11
|
+
import '../chunks/spring-ka0YJ_ZR.js';
|
|
12
|
+
import './cards.js';
|
|
13
|
+
import './click.js';
|
|
14
|
+
import './ui.js';
|
|
15
|
+
import './page.js';
|
|
16
|
+
import '../chunks/index-tags-f37txHmb.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* use-scroll-animate/components/vue — Vue integration (v2.9).
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* // vite.config.js
|
|
23
|
+
* import vue from '@vitejs/plugin-vue';
|
|
24
|
+
* import { isUsaElement } from 'use-scroll-animate/components/vue';
|
|
25
|
+
* export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };
|
|
26
|
+
*
|
|
27
|
+
* // main.js
|
|
28
|
+
* import { UsaPlugin } from 'use-scroll-animate/components/vue';
|
|
29
|
+
* app.use(UsaPlugin, { categories: ['click', 'cards'] });
|
|
30
|
+
* ```
|
|
31
|
+
* In templates, listen with `@usa:change="…"` and bind properties with
|
|
32
|
+
* `.prop`: `<usa-toggle :checked.prop="on" @usa:change="on = $event.detail.checked">`.
|
|
33
|
+
*/
|
|
34
|
+
/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */
|
|
35
|
+
const isUsaElement = (tag) => tag.startsWith('usa-');
|
|
36
|
+
/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */
|
|
37
|
+
const UsaPlugin = {
|
|
38
|
+
install(app, options = {}) {
|
|
39
|
+
var _a;
|
|
40
|
+
const co = ((_a = app.config).compilerOptions || (_a.compilerOptions = {}));
|
|
41
|
+
const prev = co.isCustomElement;
|
|
42
|
+
co.isCustomElement = (t) => isUsaElement(t) || !!prev?.(t);
|
|
43
|
+
defineComponents(options.categories);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { UsaPlugin, isUsaElement };
|
|
48
|
+
//# sourceMappingURL=vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.js","sources":["../../src/components/frameworks/vue.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/vue — Vue integration (v2.9).\n *\n * ```js\n * // vite.config.js\n * import vue from '@vitejs/plugin-vue';\n * import { isUsaElement } from 'use-scroll-animate/components/vue';\n * export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };\n *\n * // main.js\n * import { UsaPlugin } from 'use-scroll-animate/components/vue';\n * app.use(UsaPlugin, { categories: ['click', 'cards'] });\n * ```\n * In templates, listen with `@usa:change=\"…\"` and bind properties with\n * `.prop`: `<usa-toggle :checked.prop=\"on\" @usa:change=\"on = $event.detail.checked\">`.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\n/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */\nexport const isUsaElement = (tag: string): boolean => tag.startsWith('usa-');\n\nexport interface UsaPluginOptions {\n /** Only register these categories (default: all). */\n categories?: ComponentCategory[];\n}\n\n/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */\nexport const UsaPlugin = {\n install(app: { config: { compilerOptions?: { isCustomElement?: (t: string) => boolean } } }, options: UsaPluginOptions = {}): void {\n const co = (app.config.compilerOptions ||= {});\n const prev = co.isCustomElement;\n co.isCustomElement = (t: string) => isUsaElement(t) || !!prev?.(t);\n defineComponents(options.categories);\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAGH;AACO,MAAM,YAAY,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,MAAM;AAO3E;AACO,MAAM,SAAS,GAAG;AACvB,IAAA,OAAO,CAAC,GAAmF,EAAE,OAAA,GAA4B,EAAE,EAAA;;AACzH,QAAA,MAAM,EAAE,IAAG,CAAA,EAAA,GAAC,GAAG,CAAC,MAAM,EAAC,eAAe,KAAA,EAAA,CAAf,eAAe,GAAK,EAAE,EAAC;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe;QAC/B,EAAE,CAAC,eAAe,GAAG,CAAC,CAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AAClE,QAAA,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;;;;;"}
|
package/dist/components.cjs
CHANGED
|
@@ -11,9 +11,10 @@ var components_cards = require('./components/cards.cjs');
|
|
|
11
11
|
var components_click = require('./components/click.cjs');
|
|
12
12
|
var components_ui = require('./components/ui.cjs');
|
|
13
13
|
var components_page = require('./components/page.cjs');
|
|
14
|
-
var variants = require('./chunks/variants-
|
|
15
|
-
var base = require('./chunks/base-
|
|
16
|
-
var
|
|
14
|
+
var variants = require('./chunks/variants-PsCXbQ5h.cjs');
|
|
15
|
+
var base = require('./chunks/base-BkQcvoSG.cjs');
|
|
16
|
+
var indexTags = require('./chunks/index-tags-BEM98giN.cjs');
|
|
17
|
+
var spring = require('./chunks/spring-7U9MC6yQ.cjs');
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* use-scroll-animate/components
|
|
@@ -35,20 +36,6 @@ var spring = require('./chunks/spring-DyHe1Hfa.cjs');
|
|
|
35
36
|
*
|
|
36
37
|
* @license MIT
|
|
37
38
|
*/
|
|
38
|
-
/** The component categories and their default tags. */
|
|
39
|
-
const COMPONENT_CATEGORIES = {
|
|
40
|
-
reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],
|
|
41
|
-
text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate', 'usa-wave-text', 'usa-glitch', 'usa-gradient-text', 'usa-handwriting', 'usa-scroll-highlight'],
|
|
42
|
-
interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],
|
|
43
|
-
feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],
|
|
44
|
-
background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic', 'usa-grid-glow', 'usa-blobs', 'usa-water-ripple', 'usa-dot-network'],
|
|
45
|
-
transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],
|
|
46
|
-
physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],
|
|
47
|
-
cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],
|
|
48
|
-
click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],
|
|
49
|
-
ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],
|
|
50
|
-
page: ['usa-cursor', 'usa-fullpage', 'usa-loading-bar', 'usa-back-to-top', 'usa-ambient', 'usa-splash', 'usa-auto-skeleton', 'usa-motion-switch'],
|
|
51
|
-
};
|
|
52
39
|
const BY_CATEGORY = {
|
|
53
40
|
reveal: components_reveal.defineRevealComponents,
|
|
54
41
|
text: components_text.defineTextComponents,
|
|
@@ -197,6 +184,7 @@ exports.MOTION_SCALE = base.MOTION_SCALE;
|
|
|
197
184
|
exports.configureComponents = base.configureComponents;
|
|
198
185
|
exports.getMotionIntensity = base.getMotionIntensity;
|
|
199
186
|
exports.prefersReducedMotion = base.prefersReducedMotion;
|
|
187
|
+
exports.COMPONENT_CATEGORIES = indexTags.COMPONENT_CATEGORIES;
|
|
200
188
|
exports.SPRING_PRESETS = spring.SPRING_PRESETS;
|
|
201
189
|
exports.createSpring = spring.createSpring;
|
|
202
190
|
exports.linearEasing = spring.linearEasing;
|
|
@@ -209,6 +197,5 @@ exports.springEasing = spring.springEasing;
|
|
|
209
197
|
exports.springSamples = spring.springSamples;
|
|
210
198
|
exports.stepSpring = spring.stepSpring;
|
|
211
199
|
exports.supportsLinearEasing = spring.supportsLinearEasing;
|
|
212
|
-
exports.COMPONENT_CATEGORIES = COMPONENT_CATEGORIES;
|
|
213
200
|
exports.defineComponents = defineComponents;
|
|
214
201
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.cjs","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\n\
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\n\nexport { COMPONENT_CATEGORIES } from './index-tags';\nexport type { ComponentCategory } from './index-tags';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n click: defineClickComponents,\n ui: defineUiComponents,\n page: definePageComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n if (canDefine()) adoptVariants();\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":["defineRevealComponents","defineTextComponents","defineInteractionComponents","defineFeedbackComponents","defineBackgroundComponents","defineTransitionComponents","definePhysicsComponents","defineCardComponents","defineClickComponents","defineUiComponents","definePageComponents","canDefine","adoptVariants"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA+BH,MAAM,WAAW,GAA0C;AACzD,IAAA,MAAM,EAAEA,wCAAsB;AAC9B,IAAA,IAAI,EAAEC,oCAAoB;AAC1B,IAAA,WAAW,EAAEC,kDAA2B;AACxC,IAAA,QAAQ,EAAEC,4CAAwB;AAClC,IAAA,UAAU,EAAEC,gDAA0B;AACtC,IAAA,WAAW,EAAEC,iDAA0B;AACvC,IAAA,OAAO,EAAEC,0CAAuB;AAChC,IAAA,KAAK,EAAEC,qCAAoB;AAC3B,IAAA,KAAK,EAAEC,sCAAqB;AAC5B,IAAA,EAAE,EAAEC,gCAAkB;AACtB,IAAA,IAAI,EAAEC,oCAAoB;CAC3B;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAAgC,EAAA;AAC/D,IAAA,IAAIC,cAAS,EAAE;AAAE,QAAAC,sBAAa,EAAE;IAChC,CAAC,UAAU,IAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components.css
CHANGED
|
@@ -20,7 +20,7 @@ usa-progress{--usa-progress-color:var(--usa-accent,#7c5cff);--usa-progress-track
|
|
|
20
20
|
usa-skeleton{display:block;--usa-skeleton-base:color-mix(in srgb,currentColor 10%,transparent);--usa-skeleton-shine:color-mix(in srgb,currentColor 9%,transparent);--usa-skeleton-radius:8px}usa-skeleton[loading]>:not(.usa-skeleton-ph){display:none !important}usa-skeleton .usa-skeleton-ph{display:flex;gap:14px;align-items:flex-start}usa-skeleton .usa-bone-lines{flex:1;display:grid;gap:10px;min-width:0}usa-skeleton .usa-bone{position:relative;display:block;overflow:hidden;height:0.9em;border-radius:var(--usa-skeleton-radius);background:var(--usa-skeleton-base)}usa-skeleton .usa-bone-last{width:62%}usa-skeleton .usa-bone-block{height:120px}usa-skeleton .usa-bone-circle{border-radius:50%;flex:none}usa-skeleton .usa-bone-avatar{width:44px;height:44px}usa-skeleton .usa-bone::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,var(--usa-skeleton-shine),transparent);animation:usa-skeleton 1.5s ease-in-out infinite}@keyframes usa-skeleton{to{transform:translateX(100%)}}@media (prefers-reduced-motion:reduce){usa-skeleton .usa-bone::after{animation:none}}
|
|
21
21
|
usa-spinner{--usa-spinner-size:32px;--usa-spinner-color:currentColor;position:relative;display:inline-block;vertical-align:middle;flex:none;width:var(--usa-spinner-size);height:var(--usa-spinner-size);color:var(--usa-spinner-color)}usa-spinner i{position:absolute;display:block}usa-spinner[paused] *,usa-spinner[paused] *::after{animation-play-state:paused !important}usa-spinner svg{width:100%;height:100%;animation:usa-spin 2s linear infinite;overflow:visible}usa-spinner svg circle{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-dasharray:0.5 100;stroke-dashoffset:0;animation:usa-ring-arc 1.6s ease-in-out infinite}@keyframes usa-spin{to{transform:rotate(360deg)}}@keyframes usa-ring-arc{0%{stroke-dasharray:0.5 100;stroke-dashoffset:0}50%{stroke-dasharray:62 100;stroke-dashoffset:-20}100%{stroke-dasharray:0.5 100;stroke-dashoffset:-99}}usa-spinner[data-variant="windows"] i{inset:0;opacity:0;animation:usa-orbit 5.5s infinite}usa-spinner[data-variant="windows"] i::after{content:"";position:absolute;left:50%;top:0;width:12%;height:12%;margin-left:-6%;border-radius:50%;background:currentColor}usa-spinner[data-variant="windows"] i:nth-child(2){animation-delay:240ms;--n:1}usa-spinner[data-variant="windows"] i:nth-child(3){animation-delay:480ms;--n:2}usa-spinner[data-variant="windows"] i:nth-child(4){animation-delay:720ms;--n:3}usa-spinner[data-variant="windows"] i:nth-child(5){animation-delay:960ms;--n:4}@keyframes usa-orbit{0%{transform:rotate(225deg);opacity:1;animation-timing-function:ease-out}7%{transform:rotate(345deg);animation-timing-function:linear}30%{transform:rotate(455deg);animation-timing-function:ease-in-out}39%{transform:rotate(690deg);animation-timing-function:linear}70%{transform:rotate(815deg);opacity:1;animation-timing-function:ease-out}75%{transform:rotate(945deg);animation-timing-function:ease-out}76%,100%{transform:rotate(945deg);opacity:0}}usa-spinner[data-variant="ring"] i{inset:0;border-radius:50%;border:calc(var(--usa-spinner-size) / 9) solid color-mix(in srgb,currentColor 20%,transparent);border-top-color:currentColor;animation:usa-spin 0.8s linear infinite}usa-spinner[data-variant="dots"]{display:inline-flex;align-items:center;justify-content:space-between;height:calc(var(--usa-spinner-size) / 2.5)}usa-spinner[data-variant="dots"] i{position:static;width:22%;aspect-ratio:1;border-radius:50%;background:currentColor;animation:usa-dot 1.2s ease-in-out infinite}usa-spinner[data-variant="dots"] i:nth-child(2){animation-delay:0.15s}usa-spinner[data-variant="dots"] i:nth-child(3){animation-delay:0.3s}@keyframes usa-dot{0%,60%,100%{transform:translateY(0);opacity:0.35}30%{transform:translateY(-70%);opacity:1}}usa-spinner[data-variant="pulse"] i{inset:0;border-radius:50%;background:currentColor;opacity:0;animation:usa-pulse 1.6s cubic-bezier(0.22,1,0.36,1) infinite}usa-spinner[data-variant="pulse"] i:nth-child(2){animation-delay:0.8s}@keyframes usa-pulse{from{transform:scale(0.1);opacity:0.8}to{transform:scale(1);opacity:0}}usa-spinner[data-variant="bars"]{display:inline-flex;align-items:center;justify-content:space-between}usa-spinner[data-variant="bars"] i{position:static;width:16%;height:100%;border-radius:2px;background:currentColor;transform:scaleY(0.35);animation:usa-bar 1s ease-in-out infinite}usa-spinner[data-variant="bars"] i:nth-child(2){animation-delay:0.12s}usa-spinner[data-variant="bars"] i:nth-child(3){animation-delay:0.24s}usa-spinner[data-variant="bars"] i:nth-child(4){animation-delay:0.36s}@keyframes usa-bar{0%,100%{transform:scaleY(0.35)}40%{transform:scaleY(1)}}@media (prefers-reduced-motion:reduce){usa-spinner svg,usa-spinner i,usa-spinner i::after{animation:usa-calm 2.4s ease-in-out infinite !important}usa-spinner[data-variant="windows"] i{transform:rotate(calc(var(--n,0) * 72deg))}usa-spinner svg circle{animation:none;stroke-dasharray:30 100}}@keyframes usa-calm{0%,100%{opacity:1}50%{opacity:0.4}}
|
|
22
22
|
usa-toaster{position:fixed;z-index:2147483000;right:16px;bottom:16px;display:flex;flex-direction:column;gap:10px;width:min(360px,calc(100vw - 32px));pointer-events:none}usa-toaster[position^="top"]{bottom:auto;top:16px}usa-toaster[position$="left"]{right:auto;left:16px}usa-toaster[position$="center"]{right:auto;left:50%;translate:-50% 0}usa-toaster .usa-toast{--usa-toast-accent:#0078d4;pointer-events:auto;display:flex;align-items:flex-start;gap:10px;padding:12px 12px 12px 14px;border-radius:10px;background:var(--usa-toast-bg,color-mix(in srgb,Canvas 92%,transparent));color:var(--usa-toast-fg,CanvasText);border:1px solid color-mix(in srgb,CanvasText 12%,transparent);border-left:3px solid var(--usa-toast-accent);box-shadow:0 8px 28px -8px rgb(0 0 0 / 0.35);font:inherit;font-size:14px;line-height:1.4;-webkit-backdrop-filter:blur(20px) saturate(1.4);backdrop-filter:blur(20px) saturate(1.4)}usa-toaster .usa-toast[data-type="success"]{--usa-toast-accent:#0f9d58}usa-toaster .usa-toast[data-type="warning"]{--usa-toast-accent:#c19c00}usa-toaster .usa-toast[data-type="error"]{--usa-toast-accent:#d13438}usa-toaster .usa-toast-icon{flex:none;width:20px;height:20px;fill:none;stroke:var(--usa-toast-accent);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}usa-toaster .usa-toast-msg{flex:1;min-width:0;padding-top:1px;overflow-wrap:anywhere}usa-toaster .usa-toast-action,usa-toaster .usa-toast-close{flex:none;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;border-radius:6px;padding:2px 6px}usa-toaster .usa-toast-action{color:var(--usa-toast-accent);font-weight:600}usa-toaster .usa-toast-close{opacity:0.6;line-height:0;padding:3px}usa-toaster .usa-toast-close svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}usa-toaster .usa-toast-action:hover,usa-toaster .usa-toast-close:hover{background:color-mix(in srgb,currentColor 10%,transparent);opacity:1}
|
|
23
|
-
usa-acrylic{--usa-acrylic-tint:#f3f3f3;--usa-acrylic-opacity:55%;--usa-acrylic-blur:30px;position:relative;display:block;isolation:isolate;overflow:hidden;background-color:color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent);-webkit-backdrop-filter:blur(var(--usa-acrylic-blur)) saturate(1.6);backdrop-filter:blur(var(--usa-acrylic-blur)) saturate(1.6);border:1px solid color-mix(in srgb,#fff 22%,transparent)}@media (prefers-color-scheme:dark){usa-acrylic{--usa-acrylic-tint:#2c2c2c}}usa-acrylic::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:0.035;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}usa-acrylic::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;transform:translateX(-120%);background:linear-gradient(105deg,transparent 30%,rgb(255 255 255 / 0.28) 50%,transparent 70%)}usa-acrylic[shimmer="hover"]:hover::after,usa-acrylic[data-shine]::after{animation:usa-acrylic-shine 1.1s cubic-bezier(0.22,1,0.36,1) both}@keyframes usa-acrylic-shine{from{transform:translateX(-120%)}to{transform:translateX(120%)}}usa-acrylic[variant="mica"]{--usa-acrylic-opacity:80%;-webkit-backdrop-filter:none;backdrop-filter:none;background:linear-gradient(color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent),color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent)),var(--usa-mica-source,linear-gradient(135deg,#b8c6ff,#ffd6e8));border-color:transparent}@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){usa-acrylic{background-color:var(--usa-acrylic-tint)}}@media (prefers-reduced-transparency:reduce){usa-acrylic{background:var(--usa-acrylic-tint);-webkit-backdrop-filter:none;backdrop-filter:none}}@media (forced-colors:active){usa-acrylic{background:Canvas;-webkit-backdrop-filter:none;backdrop-filter:none;border-color:CanvasText}usa-acrylic::before,usa-acrylic::after{display:none}}
|
|
23
|
+
usa-acrylic{--usa-acrylic-tint:#f3f3f3;--usa-acrylic-opacity:55%;--usa-acrylic-blur:30px;position:relative;display:block;isolation:isolate;overflow:hidden;background-color:color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent);-webkit-backdrop-filter:blur(var(--usa-acrylic-blur)) saturate(1.6);backdrop-filter:blur(var(--usa-acrylic-blur)) saturate(1.6);border:1px solid color-mix(in srgb,#fff 22%,transparent)}@media (prefers-color-scheme:dark){usa-acrylic{--usa-acrylic-tint:#2c2c2c}}usa-acrylic::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:0.035;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}usa-acrylic::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;transform:translateX(-120%);background:linear-gradient(105deg,transparent 30%,rgb(255 255 255 / 0.28) 50%,transparent 70%)}usa-acrylic[shimmer="hover"]:hover::after,usa-acrylic[data-shine]::after{animation:usa-acrylic-shine 1.1s cubic-bezier(0.22,1,0.36,1) both}@keyframes usa-acrylic-shine{from{transform:translateX(-120%)}to{transform:translateX(120%)}}usa-acrylic:is([kind="mica"],[variant="mica"]){--usa-acrylic-opacity:80%;-webkit-backdrop-filter:none;backdrop-filter:none;background:linear-gradient(color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent),color-mix(in srgb,var(--usa-acrylic-tint) var(--usa-acrylic-opacity),transparent)),var(--usa-mica-source,linear-gradient(135deg,#b8c6ff,#ffd6e8));border-color:transparent}@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){usa-acrylic{background-color:var(--usa-acrylic-tint)}}@media (prefers-reduced-transparency:reduce){usa-acrylic{background:var(--usa-acrylic-tint);-webkit-backdrop-filter:none;backdrop-filter:none}}@media (forced-colors:active){usa-acrylic{background:Canvas;-webkit-backdrop-filter:none;backdrop-filter:none;border-color:CanvasText}usa-acrylic::before,usa-acrylic::after{display:none}}
|
|
24
24
|
usa-aurora{position:relative;display:block;isolation:isolate;overflow:hidden}usa-aurora .usa-aurora-layer{position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:var(--usa-aurora-opacity,0.7);overflow:hidden;contain:strict}usa-aurora .usa-aurora-layer i{position:absolute;display:block;width:70%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,var(--c),transparent);will-change:transform;animation:usa-aurora-a var(--usa-aurora-speed,18s) ease-in-out infinite alternate}usa-aurora .usa-aurora-layer i:nth-child(1){left:-15%;top:-30%}usa-aurora .usa-aurora-layer i:nth-child(2){right:-20%;top:-10%;animation-name:usa-aurora-b;animation-duration:calc(var(--usa-aurora-speed,18s) * 1.3)}usa-aurora .usa-aurora-layer i:nth-child(3){left:10%;bottom:-45%;animation-name:usa-aurora-c;animation-duration:calc(var(--usa-aurora-speed,18s) * 0.9)}usa-aurora .usa-aurora-layer i:nth-child(4){right:0;bottom:-30%;width:50%;animation-name:usa-aurora-b;animation-direction:alternate-reverse}usa-aurora[paused] .usa-aurora-layer i,usa-aurora[data-offscreen] .usa-aurora-layer i{animation-play-state:paused}@keyframes usa-aurora-a{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(30%,20%,0) scale(1.25)}}@keyframes usa-aurora-b{from{transform:translate3d(0,0,0) scale(1.1)}to{transform:translate3d(-35%,25%,0) scale(0.85)}}@keyframes usa-aurora-c{from{transform:translate3d(0,0,0) rotate(0deg) scale(1)}to{transform:translate3d(25%,-30%,0) rotate(40deg) scale(1.2)}}@media (prefers-reduced-motion:reduce){usa-aurora .usa-aurora-layer i,usa-grain .usa-grain-layer,usa-acrylic::after{animation:none !important}}
|
|
25
25
|
usa-grid-glow,usa-blobs,usa-water-ripple,usa-dot-network{position:relative;display:block;isolation:isolate;overflow:hidden}usa-grid-glow{--usa-grid:32px;--usa-grid-r:220px;--usa-grid-color:var(--usa-accent,#7c5cff);--usa-grid-x:50%;--usa-grid-y:50%}usa-grid-glow::before,usa-grid-glow::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:linear-gradient(to right,var(--l) 1px,transparent 1px),linear-gradient(to bottom,var(--l) 1px,transparent 1px);background-size:var(--usa-grid) var(--usa-grid)}usa-grid-glow::before{--l:color-mix(in srgb,currentColor 9%,transparent)}usa-grid-glow::after{--l:var(--usa-grid-color);-webkit-mask:radial-gradient(var(--usa-grid-r) circle at var(--usa-grid-x) var(--usa-grid-y),#000,transparent 70%);mask:radial-gradient(var(--usa-grid-r) circle at var(--usa-grid-x) var(--usa-grid-y),#000,transparent 70%)}usa-blobs .usa-blobs-layer{position:absolute;inset:-20%;z-index:-1;filter:blur(var(--usa-blobs-blur,60px)) saturate(1.3);pointer-events:none}usa-blobs .usa-blobs-layer i{position:absolute;width:45%;aspect-ratio:1;border-radius:42% 58% 60% 40% / 45% 45% 55% 55%;background:var(--c);opacity:0.75;left:calc(10% + var(--i) * 18%);top:calc(10% + var(--i) * 14%);animation:usa-blob calc(14s / var(--usa-blobs-speed,1)) ease-in-out infinite alternate;animation-delay:calc(var(--i) * -3.5s)}@keyframes usa-blob{0%{transform:translate(0,0) rotate(0) scale(1);border-radius:42% 58% 60% 40% / 45% 45% 55% 55%}50%{transform:translate(18%,-12%) rotate(120deg) scale(1.15);border-radius:60% 40% 35% 65% / 55% 60% 40% 45%}100%{transform:translate(-14%,14%) rotate(240deg) scale(0.9);border-radius:38% 62% 55% 45% / 62% 38% 62% 38%}}usa-water-ripple .usa-bg-canvas{position:absolute;inset:0;z-index:1;pointer-events:none;mix-blend-mode:screen}usa-dot-network .usa-bg-canvas{position:absolute;inset:0;z-index:-1;pointer-events:none}@media (prefers-reduced-motion:reduce){usa-blobs .usa-blobs-layer i{animation:none}}
|
|
26
26
|
.usa-fluent{font-family:"Segoe UI Variable","Segoe UI",system-ui,sans-serif;accent-color:var(--usa-accent,#0067c0)}.usa-fluent-mica body{background:linear-gradient(135deg,color-mix(in srgb,var(--usa-accent,#0067c0) 8%,#f3f3f3),#f3f3f3 60%)}@media (prefers-color-scheme:dark){.usa-fluent-mica body{background:linear-gradient(135deg,color-mix(in srgb,var(--usa-accent,#4cc2ff) 10%,#202020),#202020 60%)}}.usa-fluent :is(.usa-acrylic,[data-acrylic]){background:color-mix(in srgb,var(--usa-surface) 70%,transparent);-webkit-backdrop-filter:blur(30px) saturate(1.25);backdrop-filter:blur(30px) saturate(1.25);border:var(--usa-border);border-radius:var(--usa-radius)}.usa-fluent :is(button,[role="button"],[data-fluent-reveal],.usa-fluent-item){position:relative}.usa-fluent [data-reveal]::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;padding:1px;background:radial-gradient(90px circle at var(--usa-reveal-x) var(--usa-reveal-y),rgb(255 255 255 / 0.55),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}.usa-fluent [data-reveal]{background-image:radial-gradient(120px circle at var(--usa-reveal-x) var(--usa-reveal-y),rgb(255 255 255 / 0.1),transparent 70%)}@media (prefers-reduced-transparency:reduce),(forced-colors:active){.usa-fluent :is(.usa-acrylic,[data-acrylic]){background:var(--usa-surface);-webkit-backdrop-filter:none;backdrop-filter:none}}
|
package/dist/components.d.cts
CHANGED
|
@@ -425,7 +425,7 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
425
425
|
* `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
|
|
426
426
|
* of `transform` / `opacity` (plus an SVG stroke for `fluent`).
|
|
427
427
|
*
|
|
428
|
-
*
|
|
428
|
+
* Kinds (`kind`; `variant` is a deprecated alias until 3.0): `fluent` (default — the WinUI / Windows 11
|
|
429
429
|
* ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
|
|
430
430
|
* `ring` (classic border spinner), `dots` (three bouncing dots / typing
|
|
431
431
|
* indicator), `pulse` (expanding ripple), `bars` (equalizer).
|
|
@@ -435,6 +435,9 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
435
435
|
* a slow opacity pulse instead of movement.
|
|
436
436
|
*/
|
|
437
437
|
interface UsaSpinnerElement extends UsaElement {
|
|
438
|
+
/** Spinner kind (`kind` attribute). */
|
|
439
|
+
kind: SpinnerVariant;
|
|
440
|
+
/** @deprecated alias of `kind`, removed in 3.0. */
|
|
438
441
|
variant: SpinnerVariant;
|
|
439
442
|
}
|
|
440
443
|
declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
|
|
@@ -616,7 +619,7 @@ declare function defineMarquee(tag?: string): CustomElementConstructor | undefin
|
|
|
616
619
|
* tints from `--usa-mica-source`, a gradient you control). Optional
|
|
617
620
|
* `shimmer` adds a light sweep when it appears or on hover.
|
|
618
621
|
*
|
|
619
|
-
* Attributes: `
|
|
622
|
+
* Attributes: `kind` (`acrylic` default | `mica`; `variant` is a deprecated alias until 3.0), `tint` (colour),
|
|
620
623
|
* `tint-opacity` (0–1, 0.55), `blur` (px, 30), `shimmer`
|
|
621
624
|
* (`hover` | `load` | `none`, default `none`). Falls back to a solid tint
|
|
622
625
|
* without `backdrop-filter` and under `prefers-reduced-transparency` or
|
|
@@ -1788,6 +1791,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1788
1791
|
readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
|
|
1789
1792
|
};
|
|
1790
1793
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
1794
|
+
|
|
1791
1795
|
/**
|
|
1792
1796
|
* Register every `<usa-*>` component (or only the given categories).
|
|
1793
1797
|
* Safe to call more than once and on the server (no-op without DOM).
|
package/dist/components.d.ts
CHANGED
|
@@ -425,7 +425,7 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
425
425
|
* `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
|
|
426
426
|
* of `transform` / `opacity` (plus an SVG stroke for `fluent`).
|
|
427
427
|
*
|
|
428
|
-
*
|
|
428
|
+
* Kinds (`kind`; `variant` is a deprecated alias until 3.0): `fluent` (default — the WinUI / Windows 11
|
|
429
429
|
* ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
|
|
430
430
|
* `ring` (classic border spinner), `dots` (three bouncing dots / typing
|
|
431
431
|
* indicator), `pulse` (expanding ripple), `bars` (equalizer).
|
|
@@ -435,6 +435,9 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
435
435
|
* a slow opacity pulse instead of movement.
|
|
436
436
|
*/
|
|
437
437
|
interface UsaSpinnerElement extends UsaElement {
|
|
438
|
+
/** Spinner kind (`kind` attribute). */
|
|
439
|
+
kind: SpinnerVariant;
|
|
440
|
+
/** @deprecated alias of `kind`, removed in 3.0. */
|
|
438
441
|
variant: SpinnerVariant;
|
|
439
442
|
}
|
|
440
443
|
declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
|
|
@@ -616,7 +619,7 @@ declare function defineMarquee(tag?: string): CustomElementConstructor | undefin
|
|
|
616
619
|
* tints from `--usa-mica-source`, a gradient you control). Optional
|
|
617
620
|
* `shimmer` adds a light sweep when it appears or on hover.
|
|
618
621
|
*
|
|
619
|
-
* Attributes: `
|
|
622
|
+
* Attributes: `kind` (`acrylic` default | `mica`; `variant` is a deprecated alias until 3.0), `tint` (colour),
|
|
620
623
|
* `tint-opacity` (0–1, 0.55), `blur` (px, 30), `shimmer`
|
|
621
624
|
* (`hover` | `load` | `none`, default `none`). Falls back to a solid tint
|
|
622
625
|
* without `backdrop-filter` and under `prefers-reduced-transparency` or
|
|
@@ -1788,6 +1791,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1788
1791
|
readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
|
|
1789
1792
|
};
|
|
1790
1793
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
1794
|
+
|
|
1791
1795
|
/**
|
|
1792
1796
|
* Register every `<usa-*>` component (or only the given categories).
|
|
1793
1797
|
* Safe to call more than once and on the server (no-op without DOM).
|
package/dist/components.js
CHANGED
|
@@ -20,11 +20,12 @@ import { defineUiComponents } from './components/ui.js';
|
|
|
20
20
|
export { defineAvatarStack, defineBadge, defineBottomSheet, defineDrawer, defineFab, defineNavbar, definePopover, definePullRefresh, defineRating, defineSlider, defineTabs, defineTooltip } from './components/ui.js';
|
|
21
21
|
import { definePageComponents } from './components/page.js';
|
|
22
22
|
export { AMBIENT_EFFECTS, CURSOR_MODES, PAGE_EFFECTS, defineAmbient, defineAutoSkeleton, defineBackToTop, defineCursor, defineFullpage, defineLoadingBar, defineMotionSwitch, defineSplash, enableMpaTransitions, loadingBar, pageTransition, restoreMotionIntensity, scrollToTarget, setMotionIntensity, smoothScroll, supportsViewTransitions, themeTransition } from './components/page.js';
|
|
23
|
-
import { a as adoptVariants } from './chunks/variants-
|
|
24
|
-
export { V as VARIANTS, s as setVariant } from './chunks/variants-
|
|
25
|
-
import { c as canDefine } from './chunks/base-
|
|
26
|
-
export { M as MOTION_SCALE, a as configureComponents, g as getMotionIntensity, p as prefersReducedMotion } from './chunks/base-
|
|
27
|
-
export {
|
|
23
|
+
import { a as adoptVariants } from './chunks/variants-Ce9CboVc.js';
|
|
24
|
+
export { V as VARIANTS, s as setVariant } from './chunks/variants-Ce9CboVc.js';
|
|
25
|
+
import { c as canDefine } from './chunks/base-CB8gChoe.js';
|
|
26
|
+
export { M as MOTION_SCALE, a as configureComponents, g as getMotionIntensity, p as prefersReducedMotion } from './chunks/base-CB8gChoe.js';
|
|
27
|
+
export { C as COMPONENT_CATEGORIES } from './chunks/index-tags-f37txHmb.js';
|
|
28
|
+
export { S as SPRING_PRESETS, c as createSpring, l as linearEasing, p as projectInertia, r as resolveSpring, a as rubberBand, s as snapTo, b as spring, d as springEasing, e as springSamples, f as stepSpring, g as supportsLinearEasing } from './chunks/spring-ka0YJ_ZR.js';
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* use-scroll-animate/components
|
|
@@ -46,20 +47,6 @@ export { S as SPRING_PRESETS, c as createSpring, l as linearEasing, p as project
|
|
|
46
47
|
*
|
|
47
48
|
* @license MIT
|
|
48
49
|
*/
|
|
49
|
-
/** The component categories and their default tags. */
|
|
50
|
-
const COMPONENT_CATEGORIES = {
|
|
51
|
-
reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],
|
|
52
|
-
text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate', 'usa-wave-text', 'usa-glitch', 'usa-gradient-text', 'usa-handwriting', 'usa-scroll-highlight'],
|
|
53
|
-
interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],
|
|
54
|
-
feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],
|
|
55
|
-
background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic', 'usa-grid-glow', 'usa-blobs', 'usa-water-ripple', 'usa-dot-network'],
|
|
56
|
-
transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],
|
|
57
|
-
physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],
|
|
58
|
-
cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],
|
|
59
|
-
click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],
|
|
60
|
-
ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],
|
|
61
|
-
page: ['usa-cursor', 'usa-fullpage', 'usa-loading-bar', 'usa-back-to-top', 'usa-ambient', 'usa-splash', 'usa-auto-skeleton', 'usa-motion-switch'],
|
|
62
|
-
};
|
|
63
50
|
const BY_CATEGORY = {
|
|
64
51
|
reveal: defineRevealComponents,
|
|
65
52
|
text: defineTextComponents,
|
|
@@ -83,5 +70,5 @@ function defineComponents(categories) {
|
|
|
83
70
|
(categories || Object.keys(BY_CATEGORY)).forEach((c) => BY_CATEGORY[c]?.());
|
|
84
71
|
}
|
|
85
72
|
|
|
86
|
-
export {
|
|
73
|
+
export { adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineFeedbackComponents, defineInteractionComponents, definePageComponents, definePhysicsComponents, defineRevealComponents, defineTextComponents, defineTransitionComponents, defineUiComponents };
|
|
87
74
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\n\
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\n\nexport { COMPONENT_CATEGORIES } from './index-tags';\nexport type { ComponentCategory } from './index-tags';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n click: defineClickComponents,\n ui: defineUiComponents,\n page: definePageComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n if (canDefine()) adoptVariants();\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AA+BH,MAAM,WAAW,GAA0C;AACzD,IAAA,MAAM,EAAE,sBAAsB;AAC9B,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,2BAA2B;AACxC,IAAA,QAAQ,EAAE,wBAAwB;AAClC,IAAA,UAAU,EAAE,0BAA0B;AACtC,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,KAAK,EAAE,qBAAqB;AAC5B,IAAA,EAAE,EAAE,kBAAkB;AACtB,IAAA,IAAI,EAAE,oBAAoB;CAC3B;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAAgC,EAAA;AAC/D,IAAA,IAAI,SAAS,EAAE;AAAE,QAAA,aAAa,EAAE;IAChC,CAAC,UAAU,IAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACtG;;;;"}
|