use-scroll-animate 6.0.1 → 6.1.1
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 +31 -0
- package/README.md +157 -373
- package/README_ja.md +171 -145
- package/README_zh.md +169 -167
- package/dist/chunks/{base-B5i8qQPR.cjs → base-BaQV-2ha.cjs} +3 -3
- package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
- package/dist/chunks/{base-C3Sw9sAO.js → base-Yno7N2eC.js} +3 -3
- package/dist/chunks/base-Yno7N2eC.js.map +1 -0
- package/dist/chunks/{core-qpECfEkb.cjs → core-B5T0dhFH.cjs} +14 -210
- package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
- package/dist/chunks/{core-BDcszY4L.cjs → core-BGAyaY6L.cjs} +2 -2
- package/dist/chunks/{core-BDcszY4L.cjs.map → core-BGAyaY6L.cjs.map} +1 -1
- package/dist/chunks/{core-BTf__I-8.js → core-BIOaYdgN.js} +2 -2
- package/dist/chunks/{core-BTf__I-8.js.map → core-BIOaYdgN.js.map} +1 -1
- package/dist/chunks/{core-DN3hHbHh.js → core-CUGCsMsJ.js} +2 -2
- package/dist/chunks/{core-DN3hHbHh.js.map → core-CUGCsMsJ.js.map} +1 -1
- package/dist/chunks/{core-mV_TPgG_.js → core-D7cVumUu.js} +11 -203
- package/dist/chunks/core-D7cVumUu.js.map +1 -0
- package/dist/chunks/{core-BjOYKSrV.cjs → core-zq17EeCI.cjs} +2 -2
- package/dist/chunks/{core-BjOYKSrV.cjs.map → core-zq17EeCI.cjs.map} +1 -1
- package/dist/chunks/{fx-ChjxrMBo.js → fx-BqDeFywO.js} +2 -2
- package/dist/chunks/{fx-ChjxrMBo.js.map → fx-BqDeFywO.js.map} +1 -1
- package/dist/chunks/{fx-B8hk1Fby.cjs → fx-lBGVtQO1.cjs} +2 -2
- package/dist/chunks/{fx-B8hk1Fby.cjs.map → fx-lBGVtQO1.cjs.map} +1 -1
- package/dist/chunks/presets-BYBVJVeP.js +226 -0
- package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
- package/dist/chunks/presets-CUHys3sK.cjs +233 -0
- package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
- package/dist/chunks/{spring-CckMe3x0.js → spring-DfQO5USi.js} +2 -2
- package/dist/chunks/{spring-CckMe3x0.js.map → spring-DfQO5USi.js.map} +1 -1
- package/dist/chunks/{spring--oZh55tB.cjs → spring-Dgx187Vh.cjs} +2 -2
- package/dist/chunks/{spring--oZh55tB.cjs.map → spring-Dgx187Vh.cjs.map} +1 -1
- package/dist/chunks/{stagger-CLc3j58T.cjs → stagger-CCFyhzSw.cjs} +3 -3
- package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
- package/dist/chunks/{stagger-BFAhKknX.js → stagger-DtMKo2SK.js} +3 -3
- package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
- package/dist/chunks/{variants-DxPmgrNX.cjs → variants-BhjyddG8.cjs} +2 -2
- package/dist/chunks/{variants-DxPmgrNX.cjs.map → variants-BhjyddG8.cjs.map} +1 -1
- package/dist/chunks/{variants-Bsevy6Xm.js → variants-VNscPeTD.js} +2 -2
- package/dist/chunks/{variants-Bsevy6Xm.js.map → variants-VNscPeTD.js.map} +1 -1
- package/dist/components/a11y.cjs +4 -4
- package/dist/components/a11y.cjs.map +1 -1
- package/dist/components/a11y.d.cts +2 -2
- package/dist/components/a11y.d.ts +2 -2
- package/dist/components/a11y.js +5 -5
- package/dist/components/a11y.js.map +1 -1
- package/dist/components/angular.cjs +8 -8
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +22 -22
- package/dist/components/angular.d.ts +22 -22
- package/dist/components/angular.js +8 -8
- package/dist/components/angular.js.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 +3 -3
- package/dist/components/background.js.map +1 -1
- package/dist/components/bridge.cjs +2 -2
- package/dist/components/bridge.cjs.map +1 -1
- package/dist/components/bridge.d.cts +1 -1
- package/dist/components/bridge.d.ts +1 -1
- package/dist/components/bridge.js +2 -2
- package/dist/components/bridge.js.map +1 -1
- package/dist/components/cards.cjs +3 -3
- package/dist/components/cards.cjs.map +1 -1
- package/dist/components/cards.css +1 -1
- package/dist/components/cards.d.cts +1 -1
- package/dist/components/cards.d.ts +1 -1
- package/dist/components/cards.js +3 -3
- package/dist/components/cards.js.map +1 -1
- package/dist/components/click.cjs +4 -4
- package/dist/components/click.cjs.map +1 -1
- package/dist/components/click.css +1 -1
- package/dist/components/click.d.cts +1 -1
- package/dist/components/click.d.ts +1 -1
- package/dist/components/click.js +4 -4
- package/dist/components/click.js.map +1 -1
- package/dist/components/depth.cjs +4 -4
- package/dist/components/depth.cjs.map +1 -1
- package/dist/components/depth.css +1 -1
- package/dist/components/depth.d.cts +1 -1
- package/dist/components/depth.d.ts +1 -1
- package/dist/components/depth.js +4 -4
- package/dist/components/depth.js.map +1 -1
- package/dist/components/effects.cjs +13 -13
- package/dist/components/effects.cjs.map +1 -1
- package/dist/components/effects.d.cts +2 -2
- package/dist/components/effects.d.ts +2 -2
- package/dist/components/effects.js +13 -13
- package/dist/components/effects.js.map +1 -1
- package/dist/components/feedback.cjs +2 -2
- package/dist/components/feedback.cjs.map +1 -1
- package/dist/components/feedback.css +1 -1
- package/dist/components/feedback.d.cts +1 -1
- package/dist/components/feedback.d.ts +1 -1
- package/dist/components/feedback.js +2 -2
- package/dist/components/feedback.js.map +1 -1
- package/dist/components/fx.cjs +10 -10
- package/dist/components/fx.cjs.map +1 -1
- package/dist/components/fx.css +1 -1
- package/dist/components/fx.d.cts +2 -2
- package/dist/components/fx.d.ts +2 -2
- package/dist/components/fx.js +10 -10
- package/dist/components/fx.js.map +1 -1
- package/dist/components/gesture.cjs +4 -4
- package/dist/components/gesture.cjs.map +1 -1
- package/dist/components/gesture.css +1 -1
- package/dist/components/gesture.d.cts +1 -1
- package/dist/components/gesture.d.ts +1 -1
- package/dist/components/gesture.js +5 -5
- package/dist/components/gesture.js.map +1 -1
- package/dist/components/interaction.cjs +2 -2
- package/dist/components/interaction.cjs.map +1 -1
- package/dist/components/interaction.css +1 -1
- package/dist/components/interaction.d.cts +1 -1
- package/dist/components/interaction.d.ts +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/interaction.js.map +1 -1
- package/dist/components/jsx.d.cts +2 -2
- package/dist/components/jsx.d.ts +2 -2
- package/dist/components/layout.cjs +2 -2
- package/dist/components/layout.cjs.map +1 -1
- package/dist/components/layout.css +1 -1
- package/dist/components/layout.d.cts +1 -1
- package/dist/components/layout.d.ts +1 -1
- package/dist/components/layout.js +2 -2
- package/dist/components/layout.js.map +1 -1
- package/dist/components/lazy.cjs +2 -2
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +2 -2
- package/dist/components/lazy.d.ts +2 -2
- package/dist/components/lazy.js +2 -2
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/lite.cjs +45 -41
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +45 -41
- package/dist/components/lite.js.map +1 -1
- package/dist/components/packs.cjs +2 -2
- package/dist/components/packs.cjs.map +1 -1
- package/dist/components/packs.css +1 -1
- package/dist/components/packs.d.cts +1 -1
- package/dist/components/packs.d.ts +1 -1
- package/dist/components/packs.js +2 -2
- package/dist/components/packs.js.map +1 -1
- package/dist/components/page.cjs +3 -3
- package/dist/components/page.cjs.map +1 -1
- package/dist/components/page.css +1 -1
- package/dist/components/page.d.cts +1 -1
- package/dist/components/page.d.ts +1 -1
- package/dist/components/page.js +4 -4
- package/dist/components/page.js.map +1 -1
- package/dist/components/perf.cjs +3 -3
- package/dist/components/perf.cjs.map +1 -1
- package/dist/components/perf.d.cts +2 -2
- package/dist/components/perf.d.ts +2 -2
- package/dist/components/perf.js +4 -4
- package/dist/components/perf.js.map +1 -1
- package/dist/components/physics.cjs +3 -3
- package/dist/components/physics.cjs.map +1 -1
- package/dist/components/physics.css +1 -1
- package/dist/components/physics.d.cts +1 -1
- package/dist/components/physics.d.ts +1 -1
- package/dist/components/physics.js +4 -4
- package/dist/components/physics.js.map +1 -1
- package/dist/components/react.cjs +4 -4
- package/dist/components/react.cjs.map +1 -1
- package/dist/components/react.js +4 -4
- package/dist/components/react.js.map +1 -1
- package/dist/components/reveal.cjs +6 -2
- package/dist/components/reveal.cjs.map +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.d.cts +1 -1
- package/dist/components/reveal.d.ts +1 -1
- package/dist/components/reveal.js +6 -2
- package/dist/components/reveal.js.map +1 -1
- package/dist/components/solid.cjs +9 -9
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +22 -22
- package/dist/components/solid.d.ts +22 -22
- package/dist/components/solid.js +9 -9
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +8 -8
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +22 -22
- package/dist/components/svelte.d.ts +22 -22
- package/dist/components/svelte.js +8 -8
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.cjs +2 -2
- package/dist/components/svg.cjs.map +1 -1
- package/dist/components/svg.css +1 -1
- package/dist/components/svg.d.cts +1 -1
- package/dist/components/svg.d.ts +1 -1
- package/dist/components/svg.js +2 -2
- package/dist/components/svg.js.map +1 -1
- package/dist/components/text.cjs +3 -3
- package/dist/components/text.cjs.map +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.d.cts +1 -1
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +3 -3
- package/dist/components/text.js.map +1 -1
- package/dist/components/timeline.cjs +3 -3
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.css +1 -1
- package/dist/components/timeline.d.cts +1 -1
- package/dist/components/timeline.d.ts +1 -1
- package/dist/components/timeline.js +4 -4
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/tokens.cjs +2 -2
- package/dist/components/tokens.cjs.map +1 -1
- package/dist/components/tokens.d.cts +2 -2
- package/dist/components/tokens.d.ts +2 -2
- package/dist/components/tokens.js +2 -2
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/transitions.cjs +2 -2
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.css +1 -1
- package/dist/components/transitions.d.cts +1 -1
- package/dist/components/transitions.d.ts +1 -1
- package/dist/components/transitions.js +2 -2
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +4 -4
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.css +1 -1
- package/dist/components/ui.d.cts +1 -1
- package/dist/components/ui.d.ts +1 -1
- package/dist/components/ui.js +5 -5
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +9 -9
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +23 -23
- package/dist/components/vue.d.ts +23 -23
- package/dist/components/vue.js +9 -9
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.cjs +2 -2
- package/dist/components/webgl.cjs.map +1 -1
- package/dist/components/webgl.css +1 -1
- package/dist/components/webgl.d.cts +1 -1
- package/dist/components/webgl.d.ts +1 -1
- package/dist/components/webgl.js +2 -2
- package/dist/components/webgl.js.map +1 -1
- package/dist/components.cjs +9 -9
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.d.cts +30 -30
- package/dist/components.d.ts +30 -30
- package/dist/components.js +11 -11
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +5 -5
- package/dist/components.umd.js.map +1 -1
- package/dist/element.cjs +4 -3
- package/dist/element.cjs.map +1 -1
- package/dist/element.d.cts +19 -5
- package/dist/element.d.ts +19 -5
- package/dist/element.js +4 -3
- package/dist/element.js.map +1 -1
- package/dist/element.umd.js +1 -1
- package/dist/element.umd.js.map +1 -1
- package/dist/index.cjs +28 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -15
- package/dist/index.d.ts +40 -15
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/presets/extended.cjs +243 -0
- package/dist/presets/extended.cjs.map +1 -0
- package/dist/presets/extended.d.cts +37 -0
- package/dist/presets/extended.d.ts +37 -0
- package/dist/presets/extended.js +239 -0
- package/dist/presets/extended.js.map +1 -0
- package/dist/presets-extended.umd.js +2 -0
- package/dist/presets-extended.umd.js.map +1 -0
- package/dist/react.cjs +4 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +19 -5
- package/dist/react.d.ts +19 -5
- package/dist/react.js +4 -3
- package/dist/react.js.map +1 -1
- package/dist/solid.cjs +5 -4
- package/dist/solid.cjs.map +1 -1
- package/dist/solid.d.cts +20 -6
- package/dist/solid.d.ts +20 -6
- package/dist/solid.js +5 -4
- package/dist/solid.js.map +1 -1
- package/dist/svelte.cjs +5 -4
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +20 -6
- package/dist/svelte.d.ts +20 -6
- package/dist/svelte.js +5 -4
- package/dist/svelte.js.map +1 -1
- package/dist/vue.cjs +4 -3
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +19 -5
- package/dist/vue.d.ts +19 -5
- package/dist/vue.js +4 -3
- package/dist/vue.js.map +1 -1
- package/docs/API.md +17 -12
- package/docs/ROADMAP.md +12 -11
- package/docs/accessibility.md +2 -2
- package/docs/components.md +33 -33
- package/docs/frameworks-ssr.md +12 -12
- package/docs/hybrid-apps.md +10 -10
- package/docs/migration-from-aos.md +5 -5
- package/docs/migration-from-gsap-scrolltrigger.md +3 -3
- package/docs/motion-tokens.css +1 -1
- package/docs/motion-tokens.md +2 -2
- package/docs/performance.md +6 -6
- package/docs/presets.md +310 -0
- package/docs/windows-apps.md +8 -8
- package/package.json +40 -26
- package/dist/chunks/base-B5i8qQPR.cjs.map +0 -1
- package/dist/chunks/base-C3Sw9sAO.js.map +0 -1
- package/dist/chunks/core-mV_TPgG_.js.map +0 -1
- package/dist/chunks/core-qpECfEkb.cjs.map +0 -1
- package/dist/chunks/stagger-BFAhKknX.js.map +0 -1
- package/dist/chunks/stagger-CLc3j58T.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.js","sources":["../../src/components/a11y/baseline.ts","../../src/components/a11y/index.ts"],"sourcesContent":["/**\n * 4.9 — the 5.0 modern-browser baseline. `baselineReport()` lists which\n * required / progressive features this browser has; `warnBaseline()` logs\n * once in development when a required one is missing.\n */\nimport { deprecate } from '../base';\n\nexport interface BaselineFeature {\n id: string;\n required: boolean;\n supported: boolean;\n}\n\n/** Required in 5.0: Custom Elements, WAAPI, IntersectionObserver, ResizeObserver, adoptedStyleSheets. Progressive: View Transitions, scroll-driven animations, WebGL. */\nexport function baselineReport(): BaselineFeature[] {\n const w = (typeof window !== 'undefined' ? window : {}) as any;\n const d = (typeof document !== 'undefined' ? document : {}) as any;\n const css = (q: string) => typeof w.CSS?.supports === 'function' && w.CSS.supports(q);\n return [\n { id: 'custom-elements', required: true, supported: !!w.customElements },\n { id: 'web-animations', required: true, supported: typeof w.Element?.prototype?.animate === 'function' },\n { id: 'intersection-observer', required: true, supported: typeof w.IntersectionObserver === 'function' },\n { id: 'resize-observer', required: true, supported: typeof w.ResizeObserver === 'function' },\n { id: 'adopted-stylesheets', required: true, supported: 'adoptedStyleSheets' in d },\n { id: 'view-transitions', required: false, supported: typeof d.startViewTransition === 'function' },\n { id: 'scroll-driven-animations', required: false, supported: css('animation-timeline: view()') },\n { id: 'webgl', required: false, supported: !!(d.createElement && (() => { try { return d.createElement('canvas').getContext('webgl'); } catch { return null; } })()) },\n ];\n}\n\n/** Log (once) which required 5.0 features are missing here. Returns the missing ids. */\nexport function warnBaseline(): string[] {\n const missing = baselineReport().filter((f) => f.required && !f.supported).map((f) => f.id);\n if (missing.length) deprecate('baseline', `this browser lacks ${missing.join(', ')}; use-scroll-animate 5.0 requires them (modern-browser baseline, see docs/upgrading-5.md).`);\n return missing;\n}\n","/**\n * use-scroll-animate/components/a11y — accessibility toolkit (4.4).\n *\n * - Motion-sensitivity levels: `setMotionSensitivity('full' | 'gentle' | 'minimal' | 'static')`.\n * - Static alternatives: what every component shows when motion is off, and\n * `staticAlternative(root)` to freeze any subtree at its final state.\n * - `aria-live` conventions: one shared polite and one assertive region,\n * `announce(message, { politeness })`.\n * - `auditMotionA11y(root)`: the rules the automated regression tests run\n * over every `<usa-*>` element — usable in your own tests too.\n *\n * ```ts\n * import { setMotionSensitivity, announce, auditMotionA11y } from 'use-scroll-animate/components/a11y';\n * setMotionSensitivity('gentle', true); // no spins / zooms / parallax, remembered\n * announce('3 items added to cart'); // polite live region\n * expect(auditMotionA11y(document.body).errors).toEqual([]);\n * ```\n */\nimport {\n configureComponents,\n getMotionSensitivity,\n adaptKeyframes,\n adoptStyles,\n MOTION_SENSITIVITY_LEVELS,\n type MotionSensitivity,\n} from '../base';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from '../index-tags';\n\nexport { getMotionSensitivity, adaptKeyframes, MOTION_SENSITIVITY_LEVELS };\nexport { baselineReport, warnBaseline } from './baseline';\nexport type { BaselineFeature } from './baseline';\nexport type { MotionSensitivity };\n\nconst KEY = 'usa:sensitivity';\n\n/** What each level allows, for docs and settings UIs. */\nexport const MOTION_SENSITIVITY: Record<MotionSensitivity, { en: string; zh: string; allows: string[] }> = {\n full: { en: 'All motion', zh: '全部动效', allows: ['fade', 'translate', 'scale', 'rotate', 'parallax', 'loop', 'flash'] },\n gentle: { en: 'Gentle — no spins, zooms or parallax', zh: '温和 —— 无旋转、缩放与视差', allows: ['fade', 'translate', 'loop'] },\n minimal: { en: 'Minimal — fades only', zh: '最少 —— 仅淡入淡出', allows: ['fade'] },\n static: { en: 'Static — no animation', zh: '静态 —— 无动画', allows: [] },\n};\n\n/** CSS applied at the `static` / `minimal` / `gentle` levels (also stops your own CSS animations under `static`). */\nexport const SENSITIVITY_CSS =\n 'html[data-usa-sensitivity=\"static\"] *,html[data-usa-sensitivity=\"static\"] *::before,html[data-usa-sensitivity=\"static\"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"minimal\"] *,html[data-usa-sensitivity=\"minimal\"] *::before,html[data-usa-sensitivity=\"minimal\"] *::after{animation-duration:1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"gentle\"]{--usa-parallax:0;--usa-tilt:0}';\n\n/**\n * Set the motion-sensitivity level for every `<usa-*>` component and the page:\n * sets `data-usa-sensitivity` on `<html>`, adapts component keyframes, and\n * with `persist` remembers the choice (`restoreMotionSensitivity()`).\n * Dispatches `usa:sensitivity` on `document`.\n */\nexport function setMotionSensitivity(level: MotionSensitivity, persist = false): void {\n if (!MOTION_SENSITIVITY_LEVELS.includes(level)) return;\n configureComponents({ motionSensitivity: level });\n adoptStyles('a11y-sensitivity', SENSITIVITY_CSS);\n if (persist) {\n try {\n localStorage.setItem(KEY, level);\n } catch {\n /* private mode */\n }\n }\n if (level === 'static' && typeof document !== 'undefined') staticAlternative(document.documentElement);\n if (typeof document !== 'undefined') document.dispatchEvent(new CustomEvent('usa:sensitivity', { detail: { level } }));\n}\n\n/** Re-apply a persisted level (call early on page load). Returns the active level. */\nexport function restoreMotionSensitivity(): MotionSensitivity {\n try {\n const v = localStorage.getItem(KEY) as MotionSensitivity | null;\n if (v && MOTION_SENSITIVITY_LEVELS.includes(v)) setMotionSensitivity(v);\n } catch {\n /* ignore */\n }\n return getMotionSensitivity();\n}\n\n/** `true` when the current level allows a kind of motion (`'rotate'`, `'parallax'`, `'loop'`…). */\nexport function motionAllowed(kind: string, level: MotionSensitivity = getMotionSensitivity()): boolean {\n return MOTION_SENSITIVITY[level].allows.includes(kind);\n}\n\n/** The static alternative of each category: what its elements show without motion. */\nexport const STATIC_ALTERNATIVES: Record<ComponentCategory, string> = {\n reveal: 'Content visible in place; progress bars show the current value.',\n text: 'Full final text (screen readers always get a plain copy).',\n interaction: 'Normal hover / focus styles; no tilt, magnet or ripple.',\n feedback: 'Spinners become a static busy indicator; progress shows its value; toasts appear without sliding.',\n background: 'A still frame of the background (gradient / pattern); particles and marquees stop.',\n transitions: 'Dialogs, accordions and views switch instantly.',\n physics: 'Values jump to their target; drag still works, without inertia.',\n cards: 'Cards are shown flat and fully readable; stacks become lists.',\n click: 'Clicks work and states are announced; no bursts, confetti or deformation.',\n ui: 'Tabs, drawers, sheets and popovers open instantly with focus management intact.',\n page: 'Page transitions are instant; cursors and ambient layers are hidden.',\n timeline: 'Every step is shown at its final state.',\n gesture: 'Buttons / keys provide the same actions as swipes and pinches.',\n svg: 'Drawings and icons are shown complete.',\n webgl: 'A static poster image or CSS gradient instead of the shader.',\n depth: 'Flat, front-facing layout.',\n layout: 'Items reflow instantly.',\n packs: 'Roles are styled but not animated.',\n fx: 'Effects are skipped or reduced to a short fade; the content is unchanged.',\n};\n\n/**\n * Freeze a subtree at its static alternative: finishes running animations\n * (`finish()`, so content lands on its final state), marks the root with\n * `data-usa-static` and returns an undo that removes the mark.\n */\nexport function staticAlternative(root: Element): () => void {\n const getAll = (root as any).getAnimations as undefined | ((o: { subtree: boolean }) => Animation[]);\n if (typeof getAll === 'function') {\n for (const a of getAll.call(root, { subtree: true })) {\n try {\n const it = a.effect?.getComputedTiming().iterations;\n if (it === Infinity) a.cancel();\n else a.finish();\n } catch {\n /* finished already */\n }\n }\n }\n root.setAttribute('data-usa-static', '');\n return () => root.removeAttribute('data-usa-static');\n}\n\n// --- aria-live conventions ---------------------------------------------------\n\nexport type Politeness = 'polite' | 'assertive';\n/** The ids of the shared live regions. */\nexport const LIVE_REGION_IDS: Record<Politeness, string> = { polite: 'usa-live-polite', assertive: 'usa-live-assertive' };\n\n/** The shared live region (created once, visually hidden, `role=\"status\"` / `role=\"alert\"`). */\nexport function liveRegion(politeness: Politeness = 'polite'): HTMLElement | null {\n if (typeof document === 'undefined' || !document.body) return null;\n const id = LIVE_REGION_IDS[politeness];\n let el = document.getElementById(id);\n if (!el) {\n el = document.createElement('div');\n el.id = id;\n el.className = 'usa-sr';\n el.setAttribute('role', politeness === 'assertive' ? 'alert' : 'status');\n el.setAttribute('aria-live', politeness);\n el.setAttribute('aria-atomic', 'true');\n document.body.appendChild(el);\n }\n return el;\n}\n\nlet lastMsg = '';\nlet lastAt = 0;\n/**\n * Announce a message through the shared live region. Conventions: `polite`\n * for results of the user's own actions (added, saved, copied), `assertive`\n * only for errors that block them. Identical messages within `dedupe` ms\n * (default 500) are dropped; the region is cleared first so repeats are read.\n */\nexport function announce(message: string, options: { politeness?: Politeness; dedupe?: number } = {}): boolean {\n const { politeness = 'polite', dedupe = 500 } = options;\n const t = Date.now();\n if (!message || (message === lastMsg && t - lastAt < dedupe)) return false;\n lastMsg = message;\n lastAt = t;\n const el = liveRegion(politeness);\n if (!el) return false;\n el.textContent = '';\n el.textContent = message;\n return true;\n}\n\n// --- audit ---------------------------------------------------------------------\n\nexport interface A11yIssue {\n rule: string;\n level: 'error' | 'warning';\n element: Element;\n message: string;\n}\n\nconst FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\nconst NAMED_ROLES = ['button', 'switch', 'checkbox', 'slider', 'tab', 'progressbar', 'radiogroup', 'dialog'];\n\nfunction accessibleName(el: Element): string {\n const label = el.getAttribute('aria-label');\n if (label) return label;\n const by = el.getAttribute('aria-labelledby');\n if (by) return by.split(/\\s+/).map((id) => el.ownerDocument.getElementById(id)?.textContent || '').join(' ').trim();\n return (el.textContent || el.getAttribute('title') || '').trim();\n}\n\n/**\n * Check a subtree against the library's motion-a11y rules:\n * - `aria-hidden-focusable` (error): focusable content inside `aria-hidden`.\n * - `role-name` (error): a widget role without an accessible name.\n * - `range-value` (error): a slider / determinate progressbar without `aria-valuenow`.\n * - `img-alt` (error): an `<img>` without `alt`.\n * - `assertive-live` (warning): `aria-live=\"assertive\"` outside `role=\"alert\"`.\n * - `infinite-no-control` (warning, WCAG 2.2.2): an endless animation on a\n * page with no way to pause motion (`<usa-motion-switch>` or `[data-usa-pause]`).\n */\nexport function auditMotionA11y(root: Element | Document): { errors: A11yIssue[]; warnings: A11yIssue[] } {\n const issues: A11yIssue[] = [];\n const add = (rule: string, level: A11yIssue['level'], element: Element, message: string) => issues.push({ rule, level, element, message });\n const scope = root as ParentNode;\n scope.querySelectorAll('[aria-hidden=\"true\"]').forEach((h) => {\n const f = (h.matches(FOCUSABLE) ? [h] : Array.from(h.querySelectorAll(FOCUSABLE))).filter((x) => !x.closest('[inert]'));\n f.forEach((x) => add('aria-hidden-focusable', 'error', x, `focusable <${x.tagName.toLowerCase()}> inside aria-hidden`));\n });\n scope.querySelectorAll('[role]').forEach((el) => {\n const role = el.getAttribute('role')!;\n if (NAMED_ROLES.includes(role) && !accessibleName(el)) add('role-name', 'error', el, `role=\"${role}\" has no accessible name`);\n if (role === 'slider' && !el.hasAttribute('aria-valuenow'))\n add('range-value', 'error', el, 'slider without aria-valuenow');\n });\n scope.querySelectorAll('img:not([alt])').forEach((el) => add('img-alt', 'error', el, '<img> without alt'));\n scope.querySelectorAll('[aria-live=\"assertive\"]').forEach((el) => {\n if (el.getAttribute('role') !== 'alert') add('assertive-live', 'warning', el, 'assertive live region outside role=\"alert\"');\n });\n const doc = (root as Node).ownerDocument || (root as Document);\n const anims = typeof (root as any).getAnimations === 'function' ? ((root as any).getAnimations({ subtree: true }) as Animation[]) : [];\n const control = doc && (doc.querySelector('usa-motion-switch, [data-usa-pause]') || doc.documentElement.hasAttribute('data-usa-sensitivity'));\n if (!control)\n anims.forEach((a) => {\n try {\n if (a.effect?.getComputedTiming().iterations === Infinity) {\n const t = (a.effect as KeyframeEffect).target;\n if (t) add('infinite-no-control', 'warning', t, 'endless animation and no motion control on the page');\n }\n } catch {\n /* ignore */\n }\n });\n return { errors: issues.filter((i) => i.level === 'error'), warnings: issues.filter((i) => i.level === 'warning') };\n}\n\n/** Every `<usa-*>` tag, for sweeping audits. */\nexport const ALL_TAGS: string[] = (Object.values(COMPONENT_CATEGORIES) as readonly (readonly string[])[]).flat();\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AASH;SACgB,cAAc,GAAA;AAC5B,IAAA,MAAM,CAAC,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,EAAE,CAAQ;AAC9D,IAAA,MAAM,CAAC,IAAI,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAQ;IAClE,MAAM,GAAG,GAAG,CAAC,CAAS,KAAK,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,UAAU,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrF,OAAO;AACL,QAAA,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;QACxE,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,UAAU,EAAE;AACxG,QAAA,EAAE,EAAE,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,oBAAoB,KAAK,UAAU,EAAE;AACxG,QAAA,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,cAAc,KAAK,UAAU,EAAE;AAC5F,QAAA,EAAE,EAAE,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,IAAI,CAAC,EAAE;AACnF,QAAA,EAAE,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EA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C,EAAE,qDAAqD,CAAC;gBACxG;YACF;AAAE,YAAA,MAAM;;YAER;AACF,QAAA,CAAC,CAAC;AACJ,IAAA,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;AACrH;AAEA;AACO,MAAM,QAAQ,GAAc,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAoC,CAAC,IAAI;;;;"}
|
|
1
|
+
{"version":3,"file":"a11y.js","sources":["../../src/components/a11y/baseline.ts","../../src/components/a11y/index.ts"],"sourcesContent":["/**\n * 4.9 — the 5.0 modern-browser baseline. `baselineReport()` lists which\n * required / progressive features this browser has; `warnBaseline()` logs\n * once in development when a required one is missing.\n */\nimport { deprecate } from '../base';\n\nexport interface BaselineFeature {\n id: string;\n required: boolean;\n supported: boolean;\n}\n\n/** Required in 5.0: Custom Elements, WAAPI, IntersectionObserver, ResizeObserver, adoptedStyleSheets. Progressive: View Transitions, scroll-driven animations, WebGL. */\nexport function baselineReport(): BaselineFeature[] {\n const w = (typeof window !== 'undefined' ? window : {}) as any;\n const d = (typeof document !== 'undefined' ? document : {}) as any;\n const css = (q: string) => typeof w.CSS?.supports === 'function' && w.CSS.supports(q);\n return [\n { id: 'custom-elements', required: true, supported: !!w.customElements },\n { id: 'web-animations', required: true, supported: typeof w.Element?.prototype?.animate === 'function' },\n { id: 'intersection-observer', required: true, supported: typeof w.IntersectionObserver === 'function' },\n { id: 'resize-observer', required: true, supported: typeof w.ResizeObserver === 'function' },\n { id: 'adopted-stylesheets', required: true, supported: 'adoptedStyleSheets' in d },\n { id: 'view-transitions', required: false, supported: typeof d.startViewTransition === 'function' },\n { id: 'scroll-driven-animations', required: false, supported: css('animation-timeline: view()') },\n { id: 'webgl', required: false, supported: !!(d.createElement && (() => { try { return d.createElement('canvas').getContext('webgl'); } catch { return null; } })()) },\n ];\n}\n\n/** Log (once) which required 5.0 features are missing here. Returns the missing ids. */\nexport function warnBaseline(): string[] {\n const missing = baselineReport().filter((f) => f.required && !f.supported).map((f) => f.id);\n if (missing.length) deprecate('baseline', `this browser lacks ${missing.join(', ')}; motionary 5.0 requires them (modern-browser baseline, see docs/upgrading-5.md).`);\n return missing;\n}\n","/**\n * motionary/components/a11y — accessibility toolkit (4.4).\n *\n * - Motion-sensitivity levels: `setMotionSensitivity('full' | 'gentle' | 'minimal' | 'static')`.\n * - Static alternatives: what every component shows when motion is off, and\n * `staticAlternative(root)` to freeze any subtree at its final state.\n * - `aria-live` conventions: one shared polite and one assertive region,\n * `announce(message, { politeness })`.\n * - `auditMotionA11y(root)`: the rules the automated regression tests run\n * over every `<usa-*>` element — usable in your own tests too.\n *\n * ```ts\n * import { setMotionSensitivity, announce, auditMotionA11y } from 'motionary/components/a11y';\n * setMotionSensitivity('gentle', true); // no spins / zooms / parallax, remembered\n * announce('3 items added to cart'); // polite live region\n * expect(auditMotionA11y(document.body).errors).toEqual([]);\n * ```\n */\nimport {\n configureComponents,\n getMotionSensitivity,\n adaptKeyframes,\n adoptStyles,\n MOTION_SENSITIVITY_LEVELS,\n type MotionSensitivity,\n} from '../base';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from '../index-tags';\n\nexport { getMotionSensitivity, adaptKeyframes, MOTION_SENSITIVITY_LEVELS };\nexport { baselineReport, warnBaseline } from './baseline';\nexport type { BaselineFeature } from './baseline';\nexport type { MotionSensitivity };\n\nconst KEY = 'usa:sensitivity';\n\n/** What each level allows, for docs and settings UIs. */\nexport const MOTION_SENSITIVITY: Record<MotionSensitivity, { en: string; zh: string; allows: string[] }> = {\n full: { en: 'All motion', zh: '全部动效', allows: ['fade', 'translate', 'scale', 'rotate', 'parallax', 'loop', 'flash'] },\n gentle: { en: 'Gentle — no spins, zooms or parallax', zh: '温和 —— 无旋转、缩放与视差', allows: ['fade', 'translate', 'loop'] },\n minimal: { en: 'Minimal — fades only', zh: '最少 —— 仅淡入淡出', allows: ['fade'] },\n static: { en: 'Static — no animation', zh: '静态 —— 无动画', allows: [] },\n};\n\n/** CSS applied at the `static` / `minimal` / `gentle` levels (also stops your own CSS animations under `static`). */\nexport const SENSITIVITY_CSS =\n 'html[data-usa-sensitivity=\"static\"] *,html[data-usa-sensitivity=\"static\"] *::before,html[data-usa-sensitivity=\"static\"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"minimal\"] *,html[data-usa-sensitivity=\"minimal\"] *::before,html[data-usa-sensitivity=\"minimal\"] *::after{animation-duration:1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}' +\n 'html[data-usa-sensitivity=\"gentle\"]{--usa-parallax:0;--usa-tilt:0}';\n\n/**\n * Set the motion-sensitivity level for every `<usa-*>` component and the page:\n * sets `data-usa-sensitivity` on `<html>`, adapts component keyframes, and\n * with `persist` remembers the choice (`restoreMotionSensitivity()`).\n * Dispatches `usa:sensitivity` on `document`.\n */\nexport function setMotionSensitivity(level: MotionSensitivity, persist = false): void {\n if (!MOTION_SENSITIVITY_LEVELS.includes(level)) return;\n configureComponents({ motionSensitivity: level });\n adoptStyles('a11y-sensitivity', SENSITIVITY_CSS);\n if (persist) {\n try {\n localStorage.setItem(KEY, level);\n } catch {\n /* private mode */\n }\n }\n if (level === 'static' && typeof document !== 'undefined') staticAlternative(document.documentElement);\n if (typeof document !== 'undefined') document.dispatchEvent(new CustomEvent('usa:sensitivity', { detail: { level } }));\n}\n\n/** Re-apply a persisted level (call early on page load). Returns the active level. */\nexport function restoreMotionSensitivity(): MotionSensitivity {\n try {\n const v = localStorage.getItem(KEY) as MotionSensitivity | null;\n if (v && MOTION_SENSITIVITY_LEVELS.includes(v)) setMotionSensitivity(v);\n } catch {\n /* ignore */\n }\n return getMotionSensitivity();\n}\n\n/** `true` when the current level allows a kind of motion (`'rotate'`, `'parallax'`, `'loop'`…). */\nexport function motionAllowed(kind: string, level: MotionSensitivity = getMotionSensitivity()): boolean {\n return MOTION_SENSITIVITY[level].allows.includes(kind);\n}\n\n/** The static alternative of each category: what its elements show without motion. */\nexport const STATIC_ALTERNATIVES: Record<ComponentCategory, string> = {\n reveal: 'Content visible in place; progress bars show the current value.',\n text: 'Full final text (screen readers always get a plain copy).',\n interaction: 'Normal hover / focus styles; no tilt, magnet or ripple.',\n feedback: 'Spinners become a static busy indicator; progress shows its value; toasts appear without sliding.',\n background: 'A still frame of the background (gradient / pattern); particles and marquees stop.',\n transitions: 'Dialogs, accordions and views switch instantly.',\n physics: 'Values jump to their target; drag still works, without inertia.',\n cards: 'Cards are shown flat and fully readable; stacks become lists.',\n click: 'Clicks work and states are announced; no bursts, confetti or deformation.',\n ui: 'Tabs, drawers, sheets and popovers open instantly with focus management intact.',\n page: 'Page transitions are instant; cursors and ambient layers are hidden.',\n timeline: 'Every step is shown at its final state.',\n gesture: 'Buttons / keys provide the same actions as swipes and pinches.',\n svg: 'Drawings and icons are shown complete.',\n webgl: 'A static poster image or CSS gradient instead of the shader.',\n depth: 'Flat, front-facing layout.',\n layout: 'Items reflow instantly.',\n packs: 'Roles are styled but not animated.',\n fx: 'Effects are skipped or reduced to a short fade; the content is unchanged.',\n};\n\n/**\n * Freeze a subtree at its static alternative: finishes running animations\n * (`finish()`, so content lands on its final state), marks the root with\n * `data-usa-static` and returns an undo that removes the mark.\n */\nexport function staticAlternative(root: Element): () => void {\n const getAll = (root as any).getAnimations as undefined | ((o: { subtree: boolean }) => Animation[]);\n if (typeof getAll === 'function') {\n for (const a of getAll.call(root, { subtree: true })) {\n try {\n const it = a.effect?.getComputedTiming().iterations;\n if (it === Infinity) a.cancel();\n else a.finish();\n } catch {\n /* finished already */\n }\n }\n }\n root.setAttribute('data-usa-static', '');\n return () => root.removeAttribute('data-usa-static');\n}\n\n// --- aria-live conventions ---------------------------------------------------\n\nexport type Politeness = 'polite' | 'assertive';\n/** The ids of the shared live regions. */\nexport const LIVE_REGION_IDS: Record<Politeness, string> = { polite: 'usa-live-polite', assertive: 'usa-live-assertive' };\n\n/** The shared live region (created once, visually hidden, `role=\"status\"` / `role=\"alert\"`). */\nexport function liveRegion(politeness: Politeness = 'polite'): HTMLElement | null {\n if (typeof document === 'undefined' || !document.body) return null;\n const id = LIVE_REGION_IDS[politeness];\n let el = document.getElementById(id);\n if (!el) {\n el = document.createElement('div');\n el.id = id;\n el.className = 'usa-sr';\n el.setAttribute('role', politeness === 'assertive' ? 'alert' : 'status');\n el.setAttribute('aria-live', politeness);\n el.setAttribute('aria-atomic', 'true');\n document.body.appendChild(el);\n }\n return el;\n}\n\nlet lastMsg = '';\nlet lastAt = 0;\n/**\n * Announce a message through the shared live region. Conventions: `polite`\n * for results of the user's own actions (added, saved, copied), `assertive`\n * only for errors that block them. Identical messages within `dedupe` ms\n * (default 500) are dropped; the region is cleared first so repeats are read.\n */\nexport function announce(message: string, options: { politeness?: Politeness; dedupe?: number } = {}): boolean {\n const { politeness = 'polite', dedupe = 500 } = options;\n const t = Date.now();\n if (!message || (message === lastMsg && t - lastAt < dedupe)) return false;\n lastMsg = message;\n lastAt = t;\n const el = liveRegion(politeness);\n if (!el) return false;\n el.textContent = '';\n el.textContent = message;\n return true;\n}\n\n// --- audit ---------------------------------------------------------------------\n\nexport interface A11yIssue {\n rule: string;\n level: 'error' | 'warning';\n element: Element;\n message: string;\n}\n\nconst FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\nconst NAMED_ROLES = ['button', 'switch', 'checkbox', 'slider', 'tab', 'progressbar', 'radiogroup', 'dialog'];\n\nfunction accessibleName(el: Element): string {\n const label = el.getAttribute('aria-label');\n if (label) return label;\n const by = el.getAttribute('aria-labelledby');\n if (by) return by.split(/\\s+/).map((id) => el.ownerDocument.getElementById(id)?.textContent || '').join(' ').trim();\n return (el.textContent || el.getAttribute('title') || '').trim();\n}\n\n/**\n * Check a subtree against the library's motion-a11y rules:\n * - `aria-hidden-focusable` (error): focusable content inside `aria-hidden`.\n * - `role-name` (error): a widget role without an accessible name.\n * - `range-value` (error): a slider / determinate progressbar without `aria-valuenow`.\n * - `img-alt` (error): an `<img>` without `alt`.\n * - `assertive-live` (warning): `aria-live=\"assertive\"` outside `role=\"alert\"`.\n * - `infinite-no-control` (warning, WCAG 2.2.2): an endless animation on a\n * page with no way to pause motion (`<usa-motion-switch>` or `[data-usa-pause]`).\n */\nexport function auditMotionA11y(root: Element | Document): { errors: A11yIssue[]; warnings: A11yIssue[] } {\n const issues: A11yIssue[] = [];\n const add = (rule: string, level: A11yIssue['level'], element: Element, message: string) => issues.push({ rule, level, element, message });\n const scope = root as ParentNode;\n scope.querySelectorAll('[aria-hidden=\"true\"]').forEach((h) => {\n const f = (h.matches(FOCUSABLE) ? [h] : Array.from(h.querySelectorAll(FOCUSABLE))).filter((x) => !x.closest('[inert]'));\n f.forEach((x) => add('aria-hidden-focusable', 'error', x, `focusable <${x.tagName.toLowerCase()}> inside aria-hidden`));\n });\n scope.querySelectorAll('[role]').forEach((el) => {\n const role = el.getAttribute('role')!;\n if (NAMED_ROLES.includes(role) && !accessibleName(el)) add('role-name', 'error', el, `role=\"${role}\" has no accessible name`);\n if (role === 'slider' && !el.hasAttribute('aria-valuenow'))\n add('range-value', 'error', el, 'slider without aria-valuenow');\n });\n scope.querySelectorAll('img:not([alt])').forEach((el) => add('img-alt', 'error', el, '<img> without alt'));\n scope.querySelectorAll('[aria-live=\"assertive\"]').forEach((el) => {\n if (el.getAttribute('role') !== 'alert') add('assertive-live', 'warning', el, 'assertive live region outside role=\"alert\"');\n });\n const doc = (root as Node).ownerDocument || (root as Document);\n const anims = typeof (root as any).getAnimations === 'function' ? ((root as any).getAnimations({ subtree: true }) as Animation[]) : [];\n const control = doc && (doc.querySelector('usa-motion-switch, [data-usa-pause]') || doc.documentElement.hasAttribute('data-usa-sensitivity'));\n if (!control)\n anims.forEach((a) => {\n try {\n if (a.effect?.getComputedTiming().iterations === Infinity) {\n const t = (a.effect as KeyframeEffect).target;\n if (t) add('infinite-no-control', 'warning', t, 'endless animation and no motion control on the page');\n }\n } catch {\n /* ignore */\n }\n });\n return { errors: issues.filter((i) => i.level === 'error'), warnings: issues.filter((i) => i.level === 'warning') };\n}\n\n/** Every `<usa-*>` tag, for sweeping audits. */\nexport const ALL_TAGS: string[] = (Object.values(COMPONENT_CATEGORIES) as readonly (readonly string[])[]).flat();\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AASH;SACgB,cAAc,GAAA;AAC5B,IAAA,MAAM,CAAC,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,EAAE,CAAQ;AAC9D,IAAA,MAAM,CAAC,IAAI,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAQ;IAClE,MAAM,GAAG,GAAG,CAAC,CAAS,KAAK,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,UAAU,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrF,OAAO;AACL,QAAA,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;QACxE,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,UAAU,EAAE;AACxG,QAAA,EAAE,EAAE,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,oBAAoB,KAAK,UAAU,EAAE;AACxG,QAAA,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,cAAc,KAAK,UAAU,EAAE;AAC5F,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AC,UAAU,KAAK,QAAQ,EAAE;AACzD,oBAAA,MAAM,CAAC,GAAI,CAAC,CAAC,MAAyB,CAAC,MAAM;AAC7C,oBAAA,IAAI,CAAC;wBAAE,GAAG,CAAC,qBAAqB,EAAE,SAAS,EAAE,CAAC,EAAE,qDAAqD,CAAC;gBACxG;YACF;AAAE,YAAA,MAAM;;YAER;AACF,QAAA,CAAC,CAAC;AACJ,IAAA,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;AACrH;AAEA;AACO,MAAM,QAAQ,GAAc,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAoC,CAAC,IAAI;;;;"}
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
var components = require('../components.cjs');
|
|
4
4
|
var bind = require('../chunks/bind-Ui43-n2d.cjs');
|
|
5
5
|
require('./reveal.cjs');
|
|
6
|
-
require('../chunks/base-
|
|
6
|
+
require('../chunks/base-BaQV-2ha.cjs');
|
|
7
7
|
require('./text.cjs');
|
|
8
|
-
require('../chunks/core-
|
|
8
|
+
require('../chunks/core-BGAyaY6L.cjs');
|
|
9
9
|
require('./tokens.cjs');
|
|
10
10
|
require('./interaction.cjs');
|
|
11
11
|
require('./feedback.cjs');
|
|
12
12
|
require('./background.cjs');
|
|
13
|
-
require('../chunks/variants-
|
|
13
|
+
require('../chunks/variants-BhjyddG8.cjs');
|
|
14
14
|
require('./transitions.cjs');
|
|
15
15
|
require('./physics.cjs');
|
|
16
|
-
require('../chunks/spring
|
|
16
|
+
require('../chunks/spring-Dgx187Vh.cjs');
|
|
17
17
|
require('./cards.cjs');
|
|
18
18
|
require('./click.cjs');
|
|
19
|
-
require('../chunks/fx-
|
|
19
|
+
require('../chunks/fx-lBGVtQO1.cjs');
|
|
20
20
|
require('./ui.cjs');
|
|
21
21
|
require('./page.cjs');
|
|
22
22
|
require('./timeline.cjs');
|
|
23
23
|
require('./gesture.cjs');
|
|
24
|
-
require('../chunks/core-
|
|
24
|
+
require('../chunks/core-zq17EeCI.cjs');
|
|
25
25
|
require('./svg.cjs');
|
|
26
26
|
require('./webgl.cjs');
|
|
27
27
|
require('./depth.cjs');
|
|
@@ -34,7 +34,7 @@ require('./perf.cjs');
|
|
|
34
34
|
require('./bridge.cjs');
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* motionary/components/angular — Angular integration (v3.8).
|
|
38
38
|
* Angular renders `<usa-*>` tags once the component (or NgModule) allows
|
|
39
39
|
* custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding
|
|
40
40
|
* `[checked]="on"` and event binding `(usa:change)="…"` then work as is.
|
|
@@ -42,7 +42,7 @@ require('./bridge.cjs');
|
|
|
42
42
|
*
|
|
43
43
|
* ```ts
|
|
44
44
|
* import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';
|
|
45
|
-
* import { usaInitializer } from '
|
|
45
|
+
* import { usaInitializer } from 'motionary/components/angular';
|
|
46
46
|
*
|
|
47
47
|
* // app.config.ts
|
|
48
48
|
* providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.cjs","sources":["../../src/components/frameworks/angular.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"angular.cjs","sources":["../../src/components/frameworks/angular.ts"],"sourcesContent":["/**\n * motionary/components/angular — Angular integration (v3.8).\n * Angular renders `<usa-*>` tags once the component (or NgModule) allows\n * custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding\n * `[checked]=\"on\"` and event binding `(usa:change)=\"…\"` then work as is.\n * This entry is framework-free (no `@angular/*` import):\n *\n * ```ts\n * import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';\n * import { usaInitializer } from 'motionary/components/angular';\n *\n * // app.config.ts\n * providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]\n *\n * @Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],\n * template: `<usa-toggle [checked]=\"on\" (usa:change)=\"on = $any($event).detail.checked\"></usa-toggle>` })\n * ```\n * `bindUsa(el, { props, on })` is available for directives that bind imperatively.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** `APP_INITIALIZER` factory: registers the elements in the browser (no-op during SSR). */\nexport function usaInitializer(categories?: ComponentCategory[]): () => () => void {\n return () => () => {\n if (typeof window !== 'undefined') defineComponents(categories);\n };\n}\n\n/** Register the elements directly (e.g. in `main.ts` before `bootstrapApplication`). */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** Read `event.detail` from a `usa:*` event in a template handler: `(usa:change)=\"on = usaDetail($event).checked\"`. */\nexport const usaDetail = <T = any>(e: Event): T => (e as CustomEvent<T>).detail;\n"],"names":["defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAMH;AACM,SAAU,cAAc,CAAC,UAAgC,EAAA;AAC7D,IAAA,OAAO,MAAM,MAAK;QAChB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAEA,2BAAgB,CAAC,UAAU,CAAC;AACjE,IAAA,CAAC;AACH;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAEA,2BAAgB,CAAC,UAAU,CAAC;AACjE;AAEA;AACO,MAAM,SAAS,GAAG,CAAU,CAAQ,KAAS,CAAoB,CAAC;;;;;;;;"}
|
|
@@ -79,7 +79,7 @@ interface UsaScrollyElement extends UsaElement {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* motionary/components/reveal — entrance & scroll reveal components.
|
|
83
83
|
* `<usa-reveal>`, `<usa-stagger>`, `<usa-scroll-progress>`, `<usa-scrolly>`.
|
|
84
84
|
*/
|
|
85
85
|
|
|
@@ -310,7 +310,7 @@ interface Timeline {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
|
-
*
|
|
313
|
+
* motionary/components/text — text effects.
|
|
314
314
|
* `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>`,
|
|
315
315
|
* `<usa-shimmer-text>`, `<usa-text-rotate>`.
|
|
316
316
|
*/
|
|
@@ -410,7 +410,7 @@ interface UsaToggleElement extends UsaElement {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/**
|
|
413
|
-
*
|
|
413
|
+
* motionary/components/interaction — micro-interactions.
|
|
414
414
|
* `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
|
|
415
415
|
* `<usa-press>`, `<usa-toggle>`.
|
|
416
416
|
*/
|
|
@@ -527,7 +527,7 @@ interface UsaCheckElement extends UsaElement {
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
/**
|
|
530
|
-
*
|
|
530
|
+
* motionary/components/feedback — loading & feedback.
|
|
531
531
|
* `<usa-spinner>`, `<usa-skeleton>`, `<usa-progress>`, `<usa-toaster>` +
|
|
532
532
|
* `toast()`, `<usa-check>`.
|
|
533
533
|
*/
|
|
@@ -645,7 +645,7 @@ interface UsaDotNetworkElement extends UsaElement {
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
/**
|
|
648
|
-
*
|
|
648
|
+
* motionary/components/background — backgrounds & decoration.
|
|
649
649
|
* `<usa-aurora>`, `<usa-particles>`, `<usa-grain>`, `<usa-marquee>`,
|
|
650
650
|
* `<usa-acrylic>`.
|
|
651
651
|
*/
|
|
@@ -719,7 +719,7 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
/**
|
|
722
|
-
*
|
|
722
|
+
* motionary/components/transitions — view & layout transitions.
|
|
723
723
|
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
724
724
|
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
725
725
|
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
@@ -786,7 +786,7 @@ interface UsaOverscrollElement extends UsaElement {
|
|
|
786
786
|
}
|
|
787
787
|
|
|
788
788
|
/**
|
|
789
|
-
*
|
|
789
|
+
* motionary/components/physics — spring & bounce physics (v2.3).
|
|
790
790
|
* `<usa-spring>` (bounce-in, pop, drop, jelly, rubber-band), `<usa-draggable>`
|
|
791
791
|
* (spring-back, inertia, snap) and `<usa-overscroll>` (elastic edges), plus
|
|
792
792
|
* the spring core: `spring()`, `springEasing()`, `createSpring()`,
|
|
@@ -880,7 +880,7 @@ interface UsaCarousel3dElement extends UsaElement {
|
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
/**
|
|
883
|
-
*
|
|
883
|
+
* motionary/components/cards — card effects (v2.4).
|
|
884
884
|
* `<usa-card effect="flip | holo | glass | border-glow | conic-border | lift |
|
|
885
885
|
* spotlight | sheen | parallax-layers | expand">` (combinable),
|
|
886
886
|
* `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on
|
|
@@ -1028,7 +1028,7 @@ interface UsaCheckboxElement extends UsaElement {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
/**
|
|
1031
|
-
*
|
|
1031
|
+
* motionary/components/click — click & tap effects (v2.5).
|
|
1032
1032
|
* `<usa-click>` (ripple, burst, confetti, squish, press-spring, shake),
|
|
1033
1033
|
* `<usa-button>` (button click deformation: squash, wobble, gooey, dent;
|
|
1034
1034
|
* shape morph; submit → loading → success), `<usa-icon-morph>`,
|
|
@@ -1200,7 +1200,7 @@ interface UsaAvatarStackElement extends UsaElement {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
|
|
1202
1202
|
/**
|
|
1203
|
-
*
|
|
1203
|
+
* motionary/components/ui — animated UI components + style variants (v2.6).
|
|
1204
1204
|
* `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
|
|
1205
1205
|
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`, `<usa-rating>`,
|
|
1206
1206
|
* `<usa-tooltip>`, `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
|
|
@@ -1337,7 +1337,7 @@ interface UsaMotionSwitchElement extends UsaElement {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
/**
|
|
1340
|
-
*
|
|
1340
|
+
* motionary/components/page — page & app-wide effects (v2.7).
|
|
1341
1341
|
* Page transitions (`pageTransition()`, `enableMpaTransitions()`,
|
|
1342
1342
|
* `themeTransition()`), `<usa-cursor>`, `smoothScroll()` / `scrollToTarget()`,
|
|
1343
1343
|
* `<usa-fullpage>`, `<usa-loading-bar>` + `loadingBar`, `<usa-back-to-top>`,
|
|
@@ -1381,7 +1381,7 @@ interface UsaTimelineElement extends UsaElement {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
|
|
1383
1383
|
/**
|
|
1384
|
-
*
|
|
1384
|
+
* motionary/components/timeline — choreography (v3.1).
|
|
1385
1385
|
* `timeline()` chains, overlaps, labels, seeks, reverses and scroll-scrubs
|
|
1386
1386
|
* WAAPI animations on one playhead; `<usa-timeline>` builds one from
|
|
1387
1387
|
* `data-tl` children.
|
|
@@ -1427,7 +1427,7 @@ interface UsaPinchZoomElement extends UsaElement {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
1429
|
/**
|
|
1430
|
-
*
|
|
1430
|
+
* motionary/components/gesture — unified gestures (v3.2).
|
|
1431
1431
|
* `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap
|
|
1432
1432
|
* with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)
|
|
1433
1433
|
* and `<usa-pinch-zoom>` are built on it.
|
|
@@ -1488,7 +1488,7 @@ interface UsaAnimIconElement extends UsaElement {
|
|
|
1488
1488
|
}
|
|
1489
1489
|
|
|
1490
1490
|
/**
|
|
1491
|
-
*
|
|
1491
|
+
* motionary/components/svg — SVG animation (v3.3).
|
|
1492
1492
|
* `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`
|
|
1493
1493
|
* (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus
|
|
1494
1494
|
* `interpolatePath()`, `morphTo()`, `drawLines()`.
|
|
@@ -1515,7 +1515,7 @@ interface UsaGLElement extends UsaElement {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
/**
|
|
1518
|
-
*
|
|
1518
|
+
* motionary/components/webgl — lightweight canvas / WebGL (v3.4).
|
|
1519
1519
|
* `<usa-shader>` (shader backgrounds), `<usa-distort>` (hover image
|
|
1520
1520
|
* distortion), `<usa-liquid>` (ripple images) on a tiny single-quad runner
|
|
1521
1521
|
* (`glQuad()`), with graceful fallbacks when WebGL is unavailable.
|
|
@@ -1563,7 +1563,7 @@ interface UsaDepthElement extends UsaElement {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
1565
|
/**
|
|
1566
|
-
*
|
|
1566
|
+
* motionary/components/depth — 3D (v3.5).
|
|
1567
1567
|
* `<usa-cube>` (CSS 3D cube), `<usa-depth>` (layered depth parallax driven by
|
|
1568
1568
|
* pointer, device orientation or scroll) and `deviceTilt()`. The 3D ring
|
|
1569
1569
|
* carousel is `<usa-carousel-3d>` in `components/cards`.
|
|
@@ -1597,7 +1597,7 @@ interface UsaMasonryElement extends UsaElement {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
|
|
1599
1599
|
/**
|
|
1600
|
-
*
|
|
1600
|
+
* motionary/components/layout — layout animation (v3.6).
|
|
1601
1601
|
* `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
|
|
1602
1602
|
* `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
|
|
1603
1603
|
* (View Transitions API with a FLIP fallback).
|
|
@@ -1621,7 +1621,7 @@ interface UsaPackElement extends UsaElement {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
|
|
1623
1623
|
/**
|
|
1624
|
-
*
|
|
1624
|
+
* motionary/components/packs — effect packs (v3.9).
|
|
1625
1625
|
* Ready-made motion for e-commerce, portfolio, dashboard, game UI and
|
|
1626
1626
|
* landing pages: mark elements with `data-role` and apply a pack with
|
|
1627
1627
|
* `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
|
|
@@ -1670,12 +1670,12 @@ interface UsaFxElement extends UsaElement {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
|
|
1672
1672
|
/**
|
|
1673
|
-
*
|
|
1673
|
+
* motionary/components/fx — unified plugin-style effects (5.0).
|
|
1674
1674
|
* `registerEffect({ name, kind, run })`, `playEffect(el, name)`,
|
|
1675
1675
|
* `bindEffect(el, name, { trigger })`, `<usa-fx effect trigger>`. Built-ins:
|
|
1676
1676
|
* every timeline preset (`enter`), `pulse` · `pop` · `jelly` · `wiggle` ·
|
|
1677
1677
|
* `heartbeat` · `bounce` · `flash` · `tada` · `shake` (attention),
|
|
1678
|
-
* `burst` · `confetti` · `ripple` (click). More packs: `
|
|
1678
|
+
* `burst` · `confetti` · `ripple` (click). More packs: `motionary/components/effects`.
|
|
1679
1679
|
*/
|
|
1680
1680
|
|
|
1681
1681
|
declare global {
|
|
@@ -1704,7 +1704,7 @@ declare function bindUsa(el: HTMLElement, binding?: UsaBinding): {
|
|
|
1704
1704
|
};
|
|
1705
1705
|
|
|
1706
1706
|
/**
|
|
1707
|
-
*
|
|
1707
|
+
* motionary/components/angular — Angular integration (v3.8).
|
|
1708
1708
|
* Angular renders `<usa-*>` tags once the component (or NgModule) allows
|
|
1709
1709
|
* custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding
|
|
1710
1710
|
* `[checked]="on"` and event binding `(usa:change)="…"` then work as is.
|
|
@@ -1712,7 +1712,7 @@ declare function bindUsa(el: HTMLElement, binding?: UsaBinding): {
|
|
|
1712
1712
|
*
|
|
1713
1713
|
* ```ts
|
|
1714
1714
|
* import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';
|
|
1715
|
-
* import { usaInitializer } from '
|
|
1715
|
+
* import { usaInitializer } from 'motionary/components/angular';
|
|
1716
1716
|
*
|
|
1717
1717
|
* // app.config.ts
|
|
1718
1718
|
* providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]
|
|
@@ -79,7 +79,7 @@ interface UsaScrollyElement extends UsaElement {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* motionary/components/reveal — entrance & scroll reveal components.
|
|
83
83
|
* `<usa-reveal>`, `<usa-stagger>`, `<usa-scroll-progress>`, `<usa-scrolly>`.
|
|
84
84
|
*/
|
|
85
85
|
|
|
@@ -310,7 +310,7 @@ interface Timeline {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
|
-
*
|
|
313
|
+
* motionary/components/text — text effects.
|
|
314
314
|
* `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>`,
|
|
315
315
|
* `<usa-shimmer-text>`, `<usa-text-rotate>`.
|
|
316
316
|
*/
|
|
@@ -410,7 +410,7 @@ interface UsaToggleElement extends UsaElement {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/**
|
|
413
|
-
*
|
|
413
|
+
* motionary/components/interaction — micro-interactions.
|
|
414
414
|
* `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>`, `<usa-spotlight>`,
|
|
415
415
|
* `<usa-press>`, `<usa-toggle>`.
|
|
416
416
|
*/
|
|
@@ -527,7 +527,7 @@ interface UsaCheckElement extends UsaElement {
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
/**
|
|
530
|
-
*
|
|
530
|
+
* motionary/components/feedback — loading & feedback.
|
|
531
531
|
* `<usa-spinner>`, `<usa-skeleton>`, `<usa-progress>`, `<usa-toaster>` +
|
|
532
532
|
* `toast()`, `<usa-check>`.
|
|
533
533
|
*/
|
|
@@ -645,7 +645,7 @@ interface UsaDotNetworkElement extends UsaElement {
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
/**
|
|
648
|
-
*
|
|
648
|
+
* motionary/components/background — backgrounds & decoration.
|
|
649
649
|
* `<usa-aurora>`, `<usa-particles>`, `<usa-grain>`, `<usa-marquee>`,
|
|
650
650
|
* `<usa-acrylic>`.
|
|
651
651
|
*/
|
|
@@ -719,7 +719,7 @@ interface UsaViewSwitchElement extends UsaElement {
|
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
/**
|
|
722
|
-
*
|
|
722
|
+
* motionary/components/transitions — view & layout transitions.
|
|
723
723
|
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
724
724
|
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
725
725
|
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
@@ -786,7 +786,7 @@ interface UsaOverscrollElement extends UsaElement {
|
|
|
786
786
|
}
|
|
787
787
|
|
|
788
788
|
/**
|
|
789
|
-
*
|
|
789
|
+
* motionary/components/physics — spring & bounce physics (v2.3).
|
|
790
790
|
* `<usa-spring>` (bounce-in, pop, drop, jelly, rubber-band), `<usa-draggable>`
|
|
791
791
|
* (spring-back, inertia, snap) and `<usa-overscroll>` (elastic edges), plus
|
|
792
792
|
* the spring core: `spring()`, `springEasing()`, `createSpring()`,
|
|
@@ -880,7 +880,7 @@ interface UsaCarousel3dElement extends UsaElement {
|
|
|
880
880
|
}
|
|
881
881
|
|
|
882
882
|
/**
|
|
883
|
-
*
|
|
883
|
+
* motionary/components/cards — card effects (v2.4).
|
|
884
884
|
* `<usa-card effect="flip | holo | glass | border-glow | conic-border | lift |
|
|
885
885
|
* spotlight | sheen | parallax-layers | expand">` (combinable),
|
|
886
886
|
* `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on
|
|
@@ -1028,7 +1028,7 @@ interface UsaCheckboxElement extends UsaElement {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
/**
|
|
1031
|
-
*
|
|
1031
|
+
* motionary/components/click — click & tap effects (v2.5).
|
|
1032
1032
|
* `<usa-click>` (ripple, burst, confetti, squish, press-spring, shake),
|
|
1033
1033
|
* `<usa-button>` (button click deformation: squash, wobble, gooey, dent;
|
|
1034
1034
|
* shape morph; submit → loading → success), `<usa-icon-morph>`,
|
|
@@ -1200,7 +1200,7 @@ interface UsaAvatarStackElement extends UsaElement {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
|
|
1202
1202
|
/**
|
|
1203
|
-
*
|
|
1203
|
+
* motionary/components/ui — animated UI components + style variants (v2.6).
|
|
1204
1204
|
* `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
|
|
1205
1205
|
* `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`, `<usa-rating>`,
|
|
1206
1206
|
* `<usa-tooltip>`, `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
|
|
@@ -1337,7 +1337,7 @@ interface UsaMotionSwitchElement extends UsaElement {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
/**
|
|
1340
|
-
*
|
|
1340
|
+
* motionary/components/page — page & app-wide effects (v2.7).
|
|
1341
1341
|
* Page transitions (`pageTransition()`, `enableMpaTransitions()`,
|
|
1342
1342
|
* `themeTransition()`), `<usa-cursor>`, `smoothScroll()` / `scrollToTarget()`,
|
|
1343
1343
|
* `<usa-fullpage>`, `<usa-loading-bar>` + `loadingBar`, `<usa-back-to-top>`,
|
|
@@ -1381,7 +1381,7 @@ interface UsaTimelineElement extends UsaElement {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
|
|
1383
1383
|
/**
|
|
1384
|
-
*
|
|
1384
|
+
* motionary/components/timeline — choreography (v3.1).
|
|
1385
1385
|
* `timeline()` chains, overlaps, labels, seeks, reverses and scroll-scrubs
|
|
1386
1386
|
* WAAPI animations on one playhead; `<usa-timeline>` builds one from
|
|
1387
1387
|
* `data-tl` children.
|
|
@@ -1427,7 +1427,7 @@ interface UsaPinchZoomElement extends UsaElement {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
1429
|
/**
|
|
1430
|
-
*
|
|
1430
|
+
* motionary/components/gesture — unified gestures (v3.2).
|
|
1431
1431
|
* `gesture()` recognises pan, swipe, pinch, long-press, tap and double-tap
|
|
1432
1432
|
* with release velocities for springs; `<usa-swipeable>` (swipe-to-dismiss)
|
|
1433
1433
|
* and `<usa-pinch-zoom>` are built on it.
|
|
@@ -1488,7 +1488,7 @@ interface UsaAnimIconElement extends UsaElement {
|
|
|
1488
1488
|
}
|
|
1489
1489
|
|
|
1490
1490
|
/**
|
|
1491
|
-
*
|
|
1491
|
+
* motionary/components/svg — SVG animation (v3.3).
|
|
1492
1492
|
* `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`
|
|
1493
1493
|
* (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus
|
|
1494
1494
|
* `interpolatePath()`, `morphTo()`, `drawLines()`.
|
|
@@ -1515,7 +1515,7 @@ interface UsaGLElement extends UsaElement {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
/**
|
|
1518
|
-
*
|
|
1518
|
+
* motionary/components/webgl — lightweight canvas / WebGL (v3.4).
|
|
1519
1519
|
* `<usa-shader>` (shader backgrounds), `<usa-distort>` (hover image
|
|
1520
1520
|
* distortion), `<usa-liquid>` (ripple images) on a tiny single-quad runner
|
|
1521
1521
|
* (`glQuad()`), with graceful fallbacks when WebGL is unavailable.
|
|
@@ -1563,7 +1563,7 @@ interface UsaDepthElement extends UsaElement {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
1565
|
/**
|
|
1566
|
-
*
|
|
1566
|
+
* motionary/components/depth — 3D (v3.5).
|
|
1567
1567
|
* `<usa-cube>` (CSS 3D cube), `<usa-depth>` (layered depth parallax driven by
|
|
1568
1568
|
* pointer, device orientation or scroll) and `deviceTilt()`. The 3D ring
|
|
1569
1569
|
* carousel is `<usa-carousel-3d>` in `components/cards`.
|
|
@@ -1597,7 +1597,7 @@ interface UsaMasonryElement extends UsaElement {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
|
|
1599
1599
|
/**
|
|
1600
|
-
*
|
|
1600
|
+
* motionary/components/layout — layout animation (v3.6).
|
|
1601
1601
|
* `autoAnimate()` / `<usa-auto-animate>` (list & grid reflow),
|
|
1602
1602
|
* `<usa-masonry>`, and `sharedTransition()` for shared-element transitions
|
|
1603
1603
|
* (View Transitions API with a FLIP fallback).
|
|
@@ -1621,7 +1621,7 @@ interface UsaPackElement extends UsaElement {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
|
|
1623
1623
|
/**
|
|
1624
|
-
*
|
|
1624
|
+
* motionary/components/packs — effect packs (v3.9).
|
|
1625
1625
|
* Ready-made motion for e-commerce, portfolio, dashboard, game UI and
|
|
1626
1626
|
* landing pages: mark elements with `data-role` and apply a pack with
|
|
1627
1627
|
* `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
|
|
@@ -1670,12 +1670,12 @@ interface UsaFxElement extends UsaElement {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
|
|
1672
1672
|
/**
|
|
1673
|
-
*
|
|
1673
|
+
* motionary/components/fx — unified plugin-style effects (5.0).
|
|
1674
1674
|
* `registerEffect({ name, kind, run })`, `playEffect(el, name)`,
|
|
1675
1675
|
* `bindEffect(el, name, { trigger })`, `<usa-fx effect trigger>`. Built-ins:
|
|
1676
1676
|
* every timeline preset (`enter`), `pulse` · `pop` · `jelly` · `wiggle` ·
|
|
1677
1677
|
* `heartbeat` · `bounce` · `flash` · `tada` · `shake` (attention),
|
|
1678
|
-
* `burst` · `confetti` · `ripple` (click). More packs: `
|
|
1678
|
+
* `burst` · `confetti` · `ripple` (click). More packs: `motionary/components/effects`.
|
|
1679
1679
|
*/
|
|
1680
1680
|
|
|
1681
1681
|
declare global {
|
|
@@ -1704,7 +1704,7 @@ declare function bindUsa(el: HTMLElement, binding?: UsaBinding): {
|
|
|
1704
1704
|
};
|
|
1705
1705
|
|
|
1706
1706
|
/**
|
|
1707
|
-
*
|
|
1707
|
+
* motionary/components/angular — Angular integration (v3.8).
|
|
1708
1708
|
* Angular renders `<usa-*>` tags once the component (or NgModule) allows
|
|
1709
1709
|
* custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding
|
|
1710
1710
|
* `[checked]="on"` and event binding `(usa:change)="…"` then work as is.
|
|
@@ -1712,7 +1712,7 @@ declare function bindUsa(el: HTMLElement, binding?: UsaBinding): {
|
|
|
1712
1712
|
*
|
|
1713
1713
|
* ```ts
|
|
1714
1714
|
* import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';
|
|
1715
|
-
* import { usaInitializer } from '
|
|
1715
|
+
* import { usaInitializer } from 'motionary/components/angular';
|
|
1716
1716
|
*
|
|
1717
1717
|
* // app.config.ts
|
|
1718
1718
|
* providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { defineComponents } from '../components.js';
|
|
2
2
|
export { b as bindUsa, u as usaEventName } from '../chunks/bind-B_CTL6Qn.js';
|
|
3
3
|
import './reveal.js';
|
|
4
|
-
import '../chunks/base-
|
|
4
|
+
import '../chunks/base-Yno7N2eC.js';
|
|
5
5
|
import './text.js';
|
|
6
|
-
import '../chunks/core-
|
|
6
|
+
import '../chunks/core-CUGCsMsJ.js';
|
|
7
7
|
import './tokens.js';
|
|
8
8
|
import './interaction.js';
|
|
9
9
|
import './feedback.js';
|
|
10
10
|
import './background.js';
|
|
11
|
-
import '../chunks/variants-
|
|
11
|
+
import '../chunks/variants-VNscPeTD.js';
|
|
12
12
|
import './transitions.js';
|
|
13
13
|
import './physics.js';
|
|
14
|
-
import '../chunks/spring-
|
|
14
|
+
import '../chunks/spring-DfQO5USi.js';
|
|
15
15
|
import './cards.js';
|
|
16
16
|
import './click.js';
|
|
17
|
-
import '../chunks/fx-
|
|
17
|
+
import '../chunks/fx-BqDeFywO.js';
|
|
18
18
|
import './ui.js';
|
|
19
19
|
import './page.js';
|
|
20
20
|
import './timeline.js';
|
|
21
21
|
import './gesture.js';
|
|
22
|
-
import '../chunks/core-
|
|
22
|
+
import '../chunks/core-BIOaYdgN.js';
|
|
23
23
|
import './svg.js';
|
|
24
24
|
import './webgl.js';
|
|
25
25
|
import './depth.js';
|
|
@@ -32,7 +32,7 @@ import './perf.js';
|
|
|
32
32
|
import './bridge.js';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* motionary/components/angular — Angular integration (v3.8).
|
|
36
36
|
* Angular renders `<usa-*>` tags once the component (or NgModule) allows
|
|
37
37
|
* custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding
|
|
38
38
|
* `[checked]="on"` and event binding `(usa:change)="…"` then work as is.
|
|
@@ -40,7 +40,7 @@ import './bridge.js';
|
|
|
40
40
|
*
|
|
41
41
|
* ```ts
|
|
42
42
|
* import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';
|
|
43
|
-
* import { usaInitializer } from '
|
|
43
|
+
* import { usaInitializer } from 'motionary/components/angular';
|
|
44
44
|
*
|
|
45
45
|
* // app.config.ts
|
|
46
46
|
* providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.js","sources":["../../src/components/frameworks/angular.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"angular.js","sources":["../../src/components/frameworks/angular.ts"],"sourcesContent":["/**\n * motionary/components/angular — Angular integration (v3.8).\n * Angular renders `<usa-*>` tags once the component (or NgModule) allows\n * custom elements with `CUSTOM_ELEMENTS_SCHEMA`; property binding\n * `[checked]=\"on\"` and event binding `(usa:change)=\"…\"` then work as is.\n * This entry is framework-free (no `@angular/*` import):\n *\n * ```ts\n * import { CUSTOM_ELEMENTS_SCHEMA, Component, APP_INITIALIZER } from '@angular/core';\n * import { usaInitializer } from 'motionary/components/angular';\n *\n * // app.config.ts\n * providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer(['click', 'ui']) }]\n *\n * @Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],\n * template: `<usa-toggle [checked]=\"on\" (usa:change)=\"on = $any($event).detail.checked\"></usa-toggle>` })\n * ```\n * `bindUsa(el, { props, on })` is available for directives that bind imperatively.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\nexport { bindUsa, usaEventName } from './bind';\nexport type { UsaBinding } from './bind';\n\n/** `APP_INITIALIZER` factory: registers the elements in the browser (no-op during SSR). */\nexport function usaInitializer(categories?: ComponentCategory[]): () => () => void {\n return () => () => {\n if (typeof window !== 'undefined') defineComponents(categories);\n };\n}\n\n/** Register the elements directly (e.g. in `main.ts` before `bootstrapApplication`). */\nexport function defineUsa(categories?: ComponentCategory[]): void {\n if (typeof window !== 'undefined') defineComponents(categories);\n}\n\n/** Read `event.detail` from a `usa:*` event in a template handler: `(usa:change)=\"on = usaDetail($event).checked\"`. */\nexport const usaDetail = <T = any>(e: Event): T => (e as CustomEvent<T>).detail;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAMH;AACM,SAAU,cAAc,CAAC,UAAgC,EAAA;AAC7D,IAAA,OAAO,MAAM,MAAK;QAChB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE,IAAA,CAAC;AACH;AAEA;AACM,SAAU,SAAS,CAAC,UAAgC,EAAA;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,gBAAgB,CAAC,UAAU,CAAC;AACjE;AAEA;AACO,MAAM,SAAS,GAAG,CAAU,CAAQ,KAAS,CAAoB,CAAC;;;;"}
|