use-scroll-animate 2.8.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +5 -5
  3. package/README_zh.md +2 -2
  4. package/dist/chunks/{base-BR6fYLBA.cjs → base-CXx7jZ-o.cjs} +10 -1
  5. package/dist/chunks/{base-BR6fYLBA.cjs.map → base-CXx7jZ-o.cjs.map} +1 -1
  6. package/dist/chunks/{base-C_w9ibbn.js → base-Co98Z2iM.js} +10 -2
  7. package/dist/chunks/{base-C_w9ibbn.js.map → base-Co98Z2iM.js.map} +1 -1
  8. package/dist/chunks/{core-BP-a1iNc.js → core-mV_TPgG_.js} +3 -44
  9. package/dist/chunks/core-mV_TPgG_.js.map +1 -0
  10. package/dist/chunks/{core-B_J4rXbC.cjs → core-qpECfEkb.cjs} +2 -43
  11. package/dist/chunks/core-qpECfEkb.cjs.map +1 -0
  12. package/dist/chunks/index-tags-BEM98giN.cjs +20 -0
  13. package/dist/chunks/index-tags-BEM98giN.cjs.map +1 -0
  14. package/dist/chunks/index-tags-f37txHmb.js +18 -0
  15. package/dist/chunks/index-tags-f37txHmb.js.map +1 -0
  16. package/dist/chunks/{spring-DyHe1Hfa.cjs → spring-2OTnYCzm.cjs} +2 -2
  17. package/dist/chunks/{spring-DyHe1Hfa.cjs.map → spring-2OTnYCzm.cjs.map} +1 -1
  18. package/dist/chunks/{spring-Dc8ZqDWE.js → spring-YNUpez2g.js} +2 -2
  19. package/dist/chunks/{spring-Dc8ZqDWE.js.map → spring-YNUpez2g.js.map} +1 -1
  20. package/dist/chunks/{stagger-DTv_WiUQ.js → stagger-BFAhKknX.js} +2 -2
  21. package/dist/chunks/{stagger-DTv_WiUQ.js.map → stagger-BFAhKknX.js.map} +1 -1
  22. package/dist/chunks/{stagger-DHw0ExuR.cjs → stagger-CLc3j58T.cjs} +2 -2
  23. package/dist/chunks/{stagger-DHw0ExuR.cjs.map → stagger-CLc3j58T.cjs.map} +1 -1
  24. package/dist/chunks/{variants-Bbatdq8d.cjs → variants-BNIrn4ch.cjs} +2 -2
  25. package/dist/chunks/{variants-Bbatdq8d.cjs.map → variants-BNIrn4ch.cjs.map} +1 -1
  26. package/dist/chunks/{variants-idgMVXhE.js → variants-Dp_5lJ_J.js} +2 -2
  27. package/dist/chunks/{variants-idgMVXhE.js.map → variants-Dp_5lJ_J.js.map} +1 -1
  28. package/dist/components/background.cjs +3 -3
  29. package/dist/components/background.cjs.map +1 -1
  30. package/dist/components/background.css +1 -1
  31. package/dist/components/background.d.cts +1 -1
  32. package/dist/components/background.d.ts +1 -1
  33. package/dist/components/background.js +4 -4
  34. package/dist/components/background.js.map +1 -1
  35. package/dist/components/cards.cjs +2 -2
  36. package/dist/components/cards.js +3 -3
  37. package/dist/components/click.cjs +2 -2
  38. package/dist/components/click.js +3 -3
  39. package/dist/components/feedback.cjs +15 -15
  40. package/dist/components/feedback.cjs.map +1 -1
  41. package/dist/components/feedback.css +2 -2
  42. package/dist/components/feedback.d.cts +4 -3
  43. package/dist/components/feedback.d.ts +4 -3
  44. package/dist/components/feedback.js +16 -16
  45. package/dist/components/feedback.js.map +1 -1
  46. package/dist/components/interaction.cjs +1 -1
  47. package/dist/components/interaction.js +2 -2
  48. package/dist/components/jsx.cjs +3 -0
  49. package/dist/components/jsx.cjs.map +1 -0
  50. package/dist/components/jsx.d.cts +45 -0
  51. package/dist/components/jsx.d.ts +45 -0
  52. package/dist/components/jsx.js +2 -0
  53. package/dist/components/jsx.js.map +1 -0
  54. package/dist/components/lazy.cjs +84 -0
  55. package/dist/components/lazy.cjs.map +1 -0
  56. package/dist/components/lazy.d.cts +40 -0
  57. package/dist/components/lazy.d.ts +40 -0
  58. package/dist/components/lazy.js +79 -0
  59. package/dist/components/lazy.js.map +1 -0
  60. package/dist/components/page.cjs +2 -2
  61. package/dist/components/page.js +3 -3
  62. package/dist/components/physics.cjs +2 -2
  63. package/dist/components/physics.js +4 -4
  64. package/dist/components/react.cjs +96 -0
  65. package/dist/components/react.cjs.map +1 -0
  66. package/dist/components/react.d.cts +18 -0
  67. package/dist/components/react.d.ts +18 -0
  68. package/dist/components/react.js +91 -0
  69. package/dist/components/react.js.map +1 -0
  70. package/dist/components/reveal.cjs +1 -1
  71. package/dist/components/reveal.js +2 -2
  72. package/dist/components/text.cjs +1 -1
  73. package/dist/components/text.js +2 -2
  74. package/dist/components/transitions.cjs +8 -9
  75. package/dist/components/transitions.cjs.map +1 -1
  76. package/dist/components/transitions.d.cts +1 -1
  77. package/dist/components/transitions.d.ts +1 -1
  78. package/dist/components/transitions.js +9 -10
  79. package/dist/components/transitions.js.map +1 -1
  80. package/dist/components/ui.cjs +3 -3
  81. package/dist/components/ui.js +5 -5
  82. package/dist/components/vue.cjs +51 -0
  83. package/dist/components/vue.cjs.map +1 -0
  84. package/dist/components/vue.d.cts +1342 -0
  85. package/dist/components/vue.d.ts +1342 -0
  86. package/dist/components/vue.js +48 -0
  87. package/dist/components/vue.js.map +1 -0
  88. package/dist/components.cjs +5 -18
  89. package/dist/components.cjs.map +1 -1
  90. package/dist/components.css +3 -3
  91. package/dist/components.d.cts +7 -5
  92. package/dist/components.d.ts +7 -5
  93. package/dist/components.js +7 -20
  94. package/dist/components.js.map +1 -1
  95. package/dist/components.umd.js +2 -2
  96. package/dist/components.umd.js.map +1 -1
  97. package/dist/element.cjs +2 -3
  98. package/dist/element.cjs.map +1 -1
  99. package/dist/element.d.cts +4 -19
  100. package/dist/element.d.ts +4 -19
  101. package/dist/element.js +2 -3
  102. package/dist/element.js.map +1 -1
  103. package/dist/element.umd.js +1 -1
  104. package/dist/element.umd.js.map +1 -1
  105. package/dist/index.cjs +2 -2
  106. package/dist/index.cjs.map +1 -1
  107. package/dist/index.d.cts +4 -19
  108. package/dist/index.d.ts +4 -19
  109. package/dist/index.js +3 -3
  110. package/dist/index.js.map +1 -1
  111. package/dist/index.umd.js +2 -2
  112. package/dist/index.umd.js.map +1 -1
  113. package/dist/react.cjs +3 -3
  114. package/dist/react.cjs.map +1 -1
  115. package/dist/react.d.cts +3 -18
  116. package/dist/react.d.ts +3 -18
  117. package/dist/react.js +3 -3
  118. package/dist/react.js.map +1 -1
  119. package/dist/solid.cjs +2 -2
  120. package/dist/solid.d.cts +3 -18
  121. package/dist/solid.d.ts +3 -18
  122. package/dist/solid.js +2 -2
  123. package/dist/svelte.cjs +2 -2
  124. package/dist/svelte.d.cts +3 -18
  125. package/dist/svelte.d.ts +3 -18
  126. package/dist/svelte.js +2 -2
  127. package/dist/vue.cjs +3 -3
  128. package/dist/vue.cjs.map +1 -1
  129. package/dist/vue.d.cts +3 -18
  130. package/dist/vue.d.ts +3 -18
  131. package/dist/vue.js +3 -3
  132. package/dist/vue.js.map +1 -1
  133. package/docs/API.md +1 -2
  134. package/docs/accessibility.md +32 -0
  135. package/docs/components.md +30 -8
  136. package/docs/frameworks-ssr.md +64 -0
  137. package/docs/upgrading-3.md +21 -0
  138. package/docs/windows-apps.md +2 -2
  139. package/package.json +43 -2
  140. package/dist/chunks/core-BP-a1iNc.js.map +0 -1
  141. package/dist/chunks/core-B_J4rXbC.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BR6fYLBA.cjs');
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
4
 
5
5
  var css$5 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
6
6
 
@@ -1,5 +1,5 @@
1
- import { d as defineElement, E as EASE_OUT, r as raf, e as caf, b as clamp, f as EASE_SPRING } from '../chunks/base-C_w9ibbn.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-C_w9ibbn.js';
1
+ import { f as defineElement, i as EASE_OUT, r as raf, d as caf, h as clamp, E as EASE_SPRING } from '../chunks/base-Co98Z2iM.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Co98Z2iM.js';
3
3
 
4
4
  var css$5 = "usa-ripple{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent}usa-ripple[block]{display:block}usa-ripple .usa-ripple-wave{position:absolute;border-radius:50%;pointer-events:none;transform:scale(0);z-index:-1;will-change:transform,opacity}";
5
5
 
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=jsx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,45 @@
1
+ /** The component categories and their default tags. */
2
+ declare const COMPONENT_CATEGORIES: {
3
+ readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["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"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["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"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ };
15
+
16
+ /**
17
+ * use-scroll-animate/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
18
+ *
19
+ * ```ts
20
+ * // src/usa-jsx.d.ts (React 18/19)
21
+ * import type { UsaIntrinsicElements } from 'use-scroll-animate/components/jsx';
22
+ * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
23
+ * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
24
+ * ```
25
+ */
26
+
27
+ type Tags = (typeof COMPONENT_CATEGORIES)[keyof typeof COMPONENT_CATEGORIES][number];
28
+ /** Attributes accepted by every `<usa-*>` element (all component attributes are strings / booleans). */
29
+ interface UsaAttributes {
30
+ [attr: string]: unknown;
31
+ class?: string;
32
+ className?: string;
33
+ id?: string;
34
+ style?: unknown;
35
+ slot?: string;
36
+ variant?: 'minimal' | 'neon' | 'glass' | 'brutalist' | 'fluent' | 'material' | (string & {});
37
+ children?: unknown;
38
+ ref?: unknown;
39
+ }
40
+ type UsaIntrinsicElements = {
41
+ [K in Tags]: UsaAttributes;
42
+ };
43
+ type UsaTag = Tags;
44
+
45
+ export type { UsaAttributes, UsaIntrinsicElements, UsaTag };
@@ -0,0 +1,45 @@
1
+ /** The component categories and their default tags. */
2
+ declare const COMPONENT_CATEGORIES: {
3
+ readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["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"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["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"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ };
15
+
16
+ /**
17
+ * use-scroll-animate/components/jsx — JSX typings for the raw `<usa-*>` tags (v2.9).
18
+ *
19
+ * ```ts
20
+ * // src/usa-jsx.d.ts (React 18/19)
21
+ * import type { UsaIntrinsicElements } from 'use-scroll-animate/components/jsx';
22
+ * declare module 'react' { namespace JSX { interface IntrinsicElements extends UsaIntrinsicElements {} } }
23
+ * // Solid / Preact / other JSX: extend their JSX.IntrinsicElements the same way.
24
+ * ```
25
+ */
26
+
27
+ type Tags = (typeof COMPONENT_CATEGORIES)[keyof typeof COMPONENT_CATEGORIES][number];
28
+ /** Attributes accepted by every `<usa-*>` element (all component attributes are strings / booleans). */
29
+ interface UsaAttributes {
30
+ [attr: string]: unknown;
31
+ class?: string;
32
+ className?: string;
33
+ id?: string;
34
+ style?: unknown;
35
+ slot?: string;
36
+ variant?: 'minimal' | 'neon' | 'glass' | 'brutalist' | 'fluent' | 'material' | (string & {});
37
+ children?: unknown;
38
+ ref?: unknown;
39
+ }
40
+ type UsaIntrinsicElements = {
41
+ [K in Tags]: UsaAttributes;
42
+ };
43
+ type UsaTag = Tags;
44
+
45
+ export type { UsaAttributes, UsaIntrinsicElements, UsaTag };
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=jsx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ var indexTags = require('../chunks/index-tags-BEM98giN.cjs');
4
+
5
+ /**
6
+ * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
7
+ *
8
+ * `lazyDefine()` scans the page (and watches it with a MutationObserver) for
9
+ * `<usa-*>` tags that are not registered yet and dynamically imports only the
10
+ * categories they belong to. Bundlers split each category into its own chunk,
11
+ * so a page that only uses `<usa-button>` loads just the click category.
12
+ *
13
+ * ```js
14
+ * import { lazyDefine } from 'use-scroll-animate/components/lazy';
15
+ * lazyDefine(); // returns a stop() function
16
+ * ```
17
+ */
18
+ const LOADERS = {
19
+ reveal: () => Promise.resolve().then(function () { return require('./reveal.cjs'); }),
20
+ text: () => Promise.resolve().then(function () { return require('./text.cjs'); }),
21
+ interaction: () => Promise.resolve().then(function () { return require('./interaction.cjs'); }),
22
+ feedback: () => Promise.resolve().then(function () { return require('./feedback.cjs'); }),
23
+ background: () => Promise.resolve().then(function () { return require('./background.cjs'); }),
24
+ transitions: () => Promise.resolve().then(function () { return require('./transitions.cjs'); }),
25
+ physics: () => Promise.resolve().then(function () { return require('./physics.cjs'); }),
26
+ cards: () => Promise.resolve().then(function () { return require('./cards.cjs'); }),
27
+ click: () => Promise.resolve().then(function () { return require('./click.cjs'); }),
28
+ ui: () => Promise.resolve().then(function () { return require('./ui.cjs'); }),
29
+ page: () => Promise.resolve().then(function () { return require('./page.cjs'); }),
30
+ };
31
+ const TAG_TO_CAT = new Map();
32
+ for (const [cat, tags] of Object.entries(indexTags.COMPONENT_CATEGORIES))
33
+ for (const t of tags)
34
+ TAG_TO_CAT.set(t, cat);
35
+ const loaded = new Map();
36
+ /** Category of a tag (`usa-button` → `click`), or `null`. */
37
+ const categoryOfTag = (tag) => TAG_TO_CAT.get(tag.toLowerCase()) ?? null;
38
+ /** Load and register one category (once). */
39
+ function loadCategory(cat) {
40
+ let p = loaded.get(cat);
41
+ if (!p) {
42
+ p = LOADERS[cat]().then((m) => {
43
+ const fn = Object.keys(m).find((k) => /^define[A-Z]\w*Components$/.test(k));
44
+ if (fn)
45
+ m[fn]();
46
+ });
47
+ loaded.set(cat, p);
48
+ }
49
+ return p;
50
+ }
51
+ /** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */
52
+ async function defineUsed(root = document) {
53
+ if (typeof customElements === 'undefined')
54
+ return [];
55
+ const cats = new Set();
56
+ const scan = (el) => {
57
+ const c = el.localName.startsWith('usa-') && !customElements.get(el.localName) ? categoryOfTag(el.localName) : null;
58
+ if (c)
59
+ cats.add(c);
60
+ };
61
+ if (root.localName)
62
+ scan(root);
63
+ root.querySelectorAll('*').forEach(scan);
64
+ await Promise.all([...cats].map(loadCategory));
65
+ return [...cats];
66
+ }
67
+ /** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */
68
+ function lazyDefine(root = typeof document !== 'undefined' ? document : undefined) {
69
+ if (!root || typeof MutationObserver === 'undefined')
70
+ return () => undefined;
71
+ defineUsed(root);
72
+ const mo = new MutationObserver((records) => {
73
+ for (const r of records)
74
+ r.addedNodes.forEach((n) => n.nodeType === 1 && defineUsed(n));
75
+ });
76
+ mo.observe(root, { childList: true, subtree: true });
77
+ return () => mo.disconnect();
78
+ }
79
+
80
+ exports.categoryOfTag = categoryOfTag;
81
+ exports.defineUsed = defineUsed;
82
+ exports.lazyDefine = lazyDefine;
83
+ exports.loadCategory = loadCategory;
84
+ //# sourceMappingURL=lazy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.cjs","sources":["../../src/components/lazy.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).\n *\n * `lazyDefine()` scans the page (and watches it with a MutationObserver) for\n * `<usa-*>` tags that are not registered yet and dynamically imports only the\n * categories they belong to. Bundlers split each category into its own chunk,\n * so a page that only uses `<usa-button>` loads just the click category.\n *\n * ```js\n * import { lazyDefine } from 'use-scroll-animate/components/lazy';\n * lazyDefine(); // returns a stop() function\n * ```\n */\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst LOADERS: Record<ComponentCategory, () => Promise<Record<string, any>>> = {\n reveal: () => import('./reveal/index'),\n text: () => import('./text/index'),\n interaction: () => import('./interaction/index'),\n feedback: () => import('./feedback/index'),\n background: () => import('./background/index'),\n transitions: () => import('./transitions/index'),\n physics: () => import('./physics/index'),\n cards: () => import('./cards/index'),\n click: () => import('./click/index'),\n ui: () => import('./ui/index'),\n page: () => import('./page/index'),\n};\n\nconst TAG_TO_CAT = new Map<string, ComponentCategory>();\nfor (const [cat, tags] of Object.entries(COMPONENT_CATEGORIES)) for (const t of tags) TAG_TO_CAT.set(t, cat as ComponentCategory);\nconst loaded = new Map<ComponentCategory, Promise<void>>();\n\n/** Category of a tag (`usa-button` → `click`), or `null`. */\nexport const categoryOfTag = (tag: string): ComponentCategory | null => TAG_TO_CAT.get(tag.toLowerCase()) ?? null;\n\n/** Load and register one category (once). */\nexport function loadCategory(cat: ComponentCategory): Promise<void> {\n let p = loaded.get(cat);\n if (!p) {\n p = LOADERS[cat]().then((m) => {\n const fn = Object.keys(m).find((k) => /^define[A-Z]\\w*Components$/.test(k));\n if (fn) m[fn]();\n });\n loaded.set(cat, p);\n }\n return p;\n}\n\n/** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */\nexport async function defineUsed(root: ParentNode = document): Promise<ComponentCategory[]> {\n if (typeof customElements === 'undefined') return [];\n const cats = new Set<ComponentCategory>();\n const scan = (el: Element) => {\n const c = el.localName.startsWith('usa-') && !customElements.get(el.localName) ? categoryOfTag(el.localName) : null;\n if (c) cats.add(c);\n };\n if ((root as Element).localName) scan(root as Element);\n root.querySelectorAll('*').forEach(scan);\n await Promise.all([...cats].map(loadCategory));\n return [...cats];\n}\n\n/** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */\nexport function lazyDefine(root: ParentNode = typeof document !== 'undefined' ? document : (undefined as any)): () => void {\n if (!root || typeof MutationObserver === 'undefined') return () => undefined;\n defineUsed(root);\n const mo = new MutationObserver((records) => {\n for (const r of records) r.addedNodes.forEach((n) => n.nodeType === 1 && defineUsed(n as Element));\n });\n mo.observe(root as Node, { childList: true, subtree: true });\n return () => mo.disconnect();\n}\n"],"names":["COMPONENT_CATEGORIES"],"mappings":";;;;AAAA;;;;;;;;;;;;AAYG;AAGH,MAAM,OAAO,GAAkE;AAC7E,IAAA,MAAM,EAAE,MAAM,oDAAO,cAAgB,KAAC;AACtC,IAAA,IAAI,EAAE,MAAM,oDAAO,YAAc,KAAC;AAClC,IAAA,WAAW,EAAE,MAAM,oDAAO,mBAAqB,KAAC;AAChD,IAAA,QAAQ,EAAE,MAAM,oDAAO,gBAAkB,KAAC;AAC1C,IAAA,UAAU,EAAE,MAAM,oDAAO,kBAAoB,KAAC;AAC9C,IAAA,WAAW,EAAE,MAAM,oDAAO,mBAAqB,KAAC;AAChD,IAAA,OAAO,EAAE,MAAM,oDAAO,eAAiB,KAAC;AACxC,IAAA,KAAK,EAAE,MAAM,oDAAO,aAAe,KAAC;AACpC,IAAA,KAAK,EAAE,MAAM,oDAAO,aAAe,KAAC;AACpC,IAAA,EAAE,EAAE,MAAM,oDAAO,UAAY,KAAC;AAC9B,IAAA,IAAI,EAAE,MAAM,oD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readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["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"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["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"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ };
15
+ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
16
+
17
+ /**
18
+ * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
19
+ *
20
+ * `lazyDefine()` scans the page (and watches it with a MutationObserver) for
21
+ * `<usa-*>` tags that are not registered yet and dynamically imports only the
22
+ * categories they belong to. Bundlers split each category into its own chunk,
23
+ * so a page that only uses `<usa-button>` loads just the click category.
24
+ *
25
+ * ```js
26
+ * import { lazyDefine } from 'use-scroll-animate/components/lazy';
27
+ * lazyDefine(); // returns a stop() function
28
+ * ```
29
+ */
30
+
31
+ /** Category of a tag (`usa-button` → `click`), or `null`. */
32
+ declare const categoryOfTag: (tag: string) => ComponentCategory | null;
33
+ /** Load and register one category (once). */
34
+ declare function loadCategory(cat: ComponentCategory): Promise<void>;
35
+ /** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */
36
+ declare function defineUsed(root?: ParentNode): Promise<ComponentCategory[]>;
37
+ /** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */
38
+ declare function lazyDefine(root?: ParentNode): () => void;
39
+
40
+ export { categoryOfTag, defineUsed, lazyDefine, loadCategory };
@@ -0,0 +1,40 @@
1
+ /** The component categories and their default tags. */
2
+ declare const COMPONENT_CATEGORIES: {
3
+ readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
4
+ readonly text: readonly ["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"];
5
+ readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
6
+ readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
7
+ readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
8
+ readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
9
+ readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
10
+ readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
11
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
+ readonly ui: readonly ["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"];
13
+ readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
14
+ };
15
+ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
16
+
17
+ /**
18
+ * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
19
+ *
20
+ * `lazyDefine()` scans the page (and watches it with a MutationObserver) for
21
+ * `<usa-*>` tags that are not registered yet and dynamically imports only the
22
+ * categories they belong to. Bundlers split each category into its own chunk,
23
+ * so a page that only uses `<usa-button>` loads just the click category.
24
+ *
25
+ * ```js
26
+ * import { lazyDefine } from 'use-scroll-animate/components/lazy';
27
+ * lazyDefine(); // returns a stop() function
28
+ * ```
29
+ */
30
+
31
+ /** Category of a tag (`usa-button` → `click`), or `null`. */
32
+ declare const categoryOfTag: (tag: string) => ComponentCategory | null;
33
+ /** Load and register one category (once). */
34
+ declare function loadCategory(cat: ComponentCategory): Promise<void>;
35
+ /** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */
36
+ declare function defineUsed(root?: ParentNode): Promise<ComponentCategory[]>;
37
+ /** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */
38
+ declare function lazyDefine(root?: ParentNode): () => void;
39
+
40
+ export { categoryOfTag, defineUsed, lazyDefine, loadCategory };
@@ -0,0 +1,79 @@
1
+ import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-f37txHmb.js';
2
+
3
+ /**
4
+ * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
5
+ *
6
+ * `lazyDefine()` scans the page (and watches it with a MutationObserver) for
7
+ * `<usa-*>` tags that are not registered yet and dynamically imports only the
8
+ * categories they belong to. Bundlers split each category into its own chunk,
9
+ * so a page that only uses `<usa-button>` loads just the click category.
10
+ *
11
+ * ```js
12
+ * import { lazyDefine } from 'use-scroll-animate/components/lazy';
13
+ * lazyDefine(); // returns a stop() function
14
+ * ```
15
+ */
16
+ const LOADERS = {
17
+ reveal: () => import('./reveal.js'),
18
+ text: () => import('./text.js'),
19
+ interaction: () => import('./interaction.js'),
20
+ feedback: () => import('./feedback.js'),
21
+ background: () => import('./background.js'),
22
+ transitions: () => import('./transitions.js'),
23
+ physics: () => import('./physics.js'),
24
+ cards: () => import('./cards.js'),
25
+ click: () => import('./click.js'),
26
+ ui: () => import('./ui.js'),
27
+ page: () => import('./page.js'),
28
+ };
29
+ const TAG_TO_CAT = new Map();
30
+ for (const [cat, tags] of Object.entries(COMPONENT_CATEGORIES))
31
+ for (const t of tags)
32
+ TAG_TO_CAT.set(t, cat);
33
+ const loaded = new Map();
34
+ /** Category of a tag (`usa-button` → `click`), or `null`. */
35
+ const categoryOfTag = (tag) => TAG_TO_CAT.get(tag.toLowerCase()) ?? null;
36
+ /** Load and register one category (once). */
37
+ function loadCategory(cat) {
38
+ let p = loaded.get(cat);
39
+ if (!p) {
40
+ p = LOADERS[cat]().then((m) => {
41
+ const fn = Object.keys(m).find((k) => /^define[A-Z]\w*Components$/.test(k));
42
+ if (fn)
43
+ m[fn]();
44
+ });
45
+ loaded.set(cat, p);
46
+ }
47
+ return p;
48
+ }
49
+ /** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */
50
+ async function defineUsed(root = document) {
51
+ if (typeof customElements === 'undefined')
52
+ return [];
53
+ const cats = new Set();
54
+ const scan = (el) => {
55
+ const c = el.localName.startsWith('usa-') && !customElements.get(el.localName) ? categoryOfTag(el.localName) : null;
56
+ if (c)
57
+ cats.add(c);
58
+ };
59
+ if (root.localName)
60
+ scan(root);
61
+ root.querySelectorAll('*').forEach(scan);
62
+ await Promise.all([...cats].map(loadCategory));
63
+ return [...cats];
64
+ }
65
+ /** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */
66
+ function lazyDefine(root = typeof document !== 'undefined' ? document : undefined) {
67
+ if (!root || typeof MutationObserver === 'undefined')
68
+ return () => undefined;
69
+ defineUsed(root);
70
+ const mo = new MutationObserver((records) => {
71
+ for (const r of records)
72
+ r.addedNodes.forEach((n) => n.nodeType === 1 && defineUsed(n));
73
+ });
74
+ mo.observe(root, { childList: true, subtree: true });
75
+ return () => mo.disconnect();
76
+ }
77
+
78
+ export { categoryOfTag, defineUsed, lazyDefine, loadCategory };
79
+ //# sourceMappingURL=lazy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.js","sources":["../../src/components/lazy.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).\n *\n * `lazyDefine()` scans the page (and watches it with a MutationObserver) for\n * `<usa-*>` tags that are not registered yet and dynamically imports only the\n * categories they belong to. Bundlers split each category into its own chunk,\n * so a page that only uses `<usa-button>` loads just the click category.\n *\n * ```js\n * import { lazyDefine } from 'use-scroll-animate/components/lazy';\n * lazyDefine(); // returns a stop() function\n * ```\n */\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst LOADERS: Record<ComponentCategory, () => Promise<Record<string, any>>> = {\n reveal: () => import('./reveal/index'),\n text: () => import('./text/index'),\n interaction: () => import('./interaction/index'),\n feedback: () => import('./feedback/index'),\n background: () => import('./background/index'),\n transitions: () => import('./transitions/index'),\n physics: () => import('./physics/index'),\n cards: () => import('./cards/index'),\n click: () => import('./click/index'),\n ui: () => import('./ui/index'),\n page: () => import('./page/index'),\n};\n\nconst TAG_TO_CAT = new Map<string, ComponentCategory>();\nfor (const [cat, tags] of Object.entries(COMPONENT_CATEGORIES)) for (const t of tags) TAG_TO_CAT.set(t, cat as ComponentCategory);\nconst loaded = new Map<ComponentCategory, Promise<void>>();\n\n/** Category of a tag (`usa-button` → `click`), or `null`. */\nexport const categoryOfTag = (tag: string): ComponentCategory | null => TAG_TO_CAT.get(tag.toLowerCase()) ?? null;\n\n/** Load and register one category (once). */\nexport function loadCategory(cat: ComponentCategory): Promise<void> {\n let p = loaded.get(cat);\n if (!p) {\n p = LOADERS[cat]().then((m) => {\n const fn = Object.keys(m).find((k) => /^define[A-Z]\\w*Components$/.test(k));\n if (fn) m[fn]();\n });\n loaded.set(cat, p);\n }\n return p;\n}\n\n/** Register the categories needed by the `<usa-*>` tags under `root`. Resolves when they are defined. */\nexport async function defineUsed(root: ParentNode = document): Promise<ComponentCategory[]> {\n if (typeof customElements === 'undefined') return [];\n const cats = new Set<ComponentCategory>();\n const scan = (el: Element) => {\n const c = el.localName.startsWith('usa-') && !customElements.get(el.localName) ? categoryOfTag(el.localName) : null;\n if (c) cats.add(c);\n };\n if ((root as Element).localName) scan(root as Element);\n root.querySelectorAll('*').forEach(scan);\n await Promise.all([...cats].map(loadCategory));\n return [...cats];\n}\n\n/** `defineUsed()` now and whenever new `<usa-*>` elements are added. Returns a stop function. */\nexport function lazyDefine(root: ParentNode = typeof document !== 'undefined' ? document : (undefined as any)): () => void {\n if (!root || typeof MutationObserver === 'undefined') return () => undefined;\n defineUsed(root);\n const mo = new MutationObserver((records) => {\n for (const r of records) r.addedNodes.forEach((n) => n.nodeType === 1 && defineUsed(n as Element));\n });\n mo.observe(root as Node, { childList: true, subtree: true });\n return () => mo.disconnect();\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;AAYG;AAGH,MAAM,OAAO,GAAkE;AAC7E,IAAA,MAAM,EAAE,MAAM,OAAO,aAAgB,CAAC;AACtC,IAAA,IAAI,EAAE,MAAM,OAAO,WAAc,CAAC;AAClC,IAAA,WAAW,EAAE,MAAM,OAAO,kBAAqB,CAAC;AAChD,IAAA,QAAQ,EAAE,MAAM,OAAO,eAAkB,CAAC;AAC1C,IAAA,UAAU,EAAE,MAAM,OAAO,iBAAoB,CAAC;AAC9C,IAAA,WAAW,EAAE,MAAM,OAAO,kBAAqB,CAAC;AAChD,IAAA,OAAO,EAAE,MAAM,OAAO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AAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5D,IAAA,OAAO,MAAM,EAAE,CAAC,UAAU,EAAE;AAC9B;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BR6fYLBA.cjs');
4
- var spring = require('../chunks/spring-DyHe1Hfa.cjs');
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
+ var spring = require('../chunks/spring-2OTnYCzm.cjs');
5
5
 
6
6
  var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[mode=\"trail\"] .usa-cursor-ring{border:0;background:var(--usa-cursor-color);width:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));height:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));margin:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2) 0 0 calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2);opacity:calc(1 - var(--i) * 0.11)}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
7
7
 
@@ -1,6 +1,6 @@
1
- import { d as defineElement, e as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, h as adoptStyles } from '../chunks/base-C_w9ibbn.js';
2
- export { M as MOTION_SCALE } from '../chunks/base-C_w9ibbn.js';
3
- import { e as springSamples } from '../chunks/spring-Dc8ZqDWE.js';
1
+ import { f as defineElement, d as caf, r as raf, p as prefersReducedMotion, n as now, g as getMotionIntensity, a as configureComponents, e as adoptStyles } from '../chunks/base-Co98Z2iM.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-Co98Z2iM.js';
3
+ import { e as springSamples } from '../chunks/spring-YNUpez2g.js';
4
4
 
5
5
  var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[mode=\"trail\"] .usa-cursor-ring{border:0;background:var(--usa-cursor-color);width:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));height:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04));margin:calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2) 0 0 calc(var(--usa-cursor-size) * (0.45 - var(--i) * 0.04) / -2);opacity:calc(1 - var(--i) * 0.11)}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
6
6
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BR6fYLBA.cjs');
4
- var spring = require('../chunks/spring-DyHe1Hfa.cjs');
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
+ var spring = require('../chunks/spring-2OTnYCzm.cjs');
5
5
 
6
6
  var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
7
7
 
@@ -1,7 +1,7 @@
1
- import { d as defineElement, b as clamp } from '../chunks/base-C_w9ibbn.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-C_w9ibbn.js';
3
- import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-Dc8ZqDWE.js';
4
- export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-Dc8ZqDWE.js';
1
+ import { f as defineElement, h as clamp } from '../chunks/base-Co98Z2iM.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Co98Z2iM.js';
3
+ import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-YNUpez2g.js';
4
+ export { S as SPRING_PRESETS, l as linearEasing, r as resolveSpring, b as spring, e as springSamples, f as stepSpring, g as supportsLinearEasing } from '../chunks/spring-YNUpez2g.js';
5
5
 
6
6
  var css$2 = "usa-spring{display:inline-block;transform-origin:50% 70%}usa-spring[block]{display:block}usa-spring[effect=\"drop\"]{transform-origin:50% 100%}usa-spring[data-state=\"hidden\"]{opacity:0}usa-spring[trigger=\"click\"],usa-spring[trigger=\"hover\"]{cursor:pointer;-webkit-tap-highlight-color:transparent}";
7
7
 
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ var indexTags = require('../chunks/index-tags-BEM98giN.cjs');
4
+
5
+ /**
6
+ * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
7
+ * element (v2.9). React 19 handles custom elements natively; for React 18
8
+ * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper
9
+ * components that set **properties** (`checked`, `value`, `state`, …),
10
+ * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.
11
+ *
12
+ * ```tsx
13
+ * import * as React from 'react';
14
+ * import { createUsaComponents } from 'use-scroll-animate/components/react';
15
+ * import { defineComponents } from 'use-scroll-animate/components';
16
+ * defineComponents();
17
+ * const { UsaButton, UsaToggle } = createUsaComponents(React);
18
+ * <UsaButton deform="squash" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>
19
+ * ```
20
+ *
21
+ * JSX types for the raw tags (`<usa-card effect="flip">`) come from
22
+ * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).
23
+ */
24
+ /** `usa-flip-list` → `UsaFlipList` */
25
+ const pascal = (tag) => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());
26
+ /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
27
+ function eventName(prop) {
28
+ const m = /^on([A-Z].*)$/.exec(prop);
29
+ if (!m)
30
+ return null;
31
+ const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
32
+ return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;
33
+ }
34
+ /** Props written as DOM properties (not attributes) when given non-string values. */
35
+ const PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);
36
+ /** All `<usa-*>` tags shipped by the package. */
37
+ const USA_TAGS = Object.values(indexTags.COMPONENT_CATEGORIES).flat();
38
+ function createUsaComponents(React) {
39
+ const useIso = React.useLayoutEffect || React.useEffect;
40
+ const make = (tag) => {
41
+ const C = React.forwardRef((props, ref) => {
42
+ const inner = React.useRef(null);
43
+ const attrs = {};
44
+ const events = [];
45
+ const propsSet = [];
46
+ for (const [k, v] of Object.entries(props)) {
47
+ if (k === 'children')
48
+ continue;
49
+ const ev = typeof v === 'function' ? eventName(k) : null;
50
+ if (ev)
51
+ events.push([ev, v]);
52
+ else if (PROPS.has(k) && typeof v !== 'string')
53
+ propsSet.push([k, v]);
54
+ else if (k === 'className')
55
+ attrs.class = v;
56
+ else if (typeof v === 'boolean') {
57
+ if (v)
58
+ attrs[k] = '';
59
+ }
60
+ else
61
+ attrs[k] = v;
62
+ }
63
+ useIso(() => {
64
+ const el = inner.current;
65
+ if (!el)
66
+ return;
67
+ for (const [k, v] of propsSet)
68
+ el[k] = v;
69
+ });
70
+ useIso(() => {
71
+ const el = inner.current;
72
+ if (!el)
73
+ return;
74
+ events.forEach(([n, f]) => el.addEventListener(n, f));
75
+ return () => events.forEach(([n, f]) => el.removeEventListener(n, f));
76
+ });
77
+ const setRef = (node) => {
78
+ inner.current = node;
79
+ if (typeof ref === 'function')
80
+ ref(node);
81
+ else if (ref)
82
+ ref.current = node;
83
+ };
84
+ return React.createElement(tag, { ...attrs, ref: setRef }, props.children);
85
+ });
86
+ C.displayName = pascal(tag);
87
+ return C;
88
+ };
89
+ return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));
90
+ }
91
+
92
+ exports.USA_TAGS = USA_TAGS;
93
+ exports.createUsaComponents = createUsaComponents;
94
+ exports.eventName = eventName;
95
+ exports.pascal = pascal;
96
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.cjs","sources":["../../src/components/frameworks/react.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/react — React wrappers for every `<usa-*>`\n * element (v2.9). React 19 handles custom elements natively; for React 18\n * (and nicer DX in both) `createUsaComponents(React)` returns typed wrapper\n * components that set **properties** (`checked`, `value`, `state`, …),\n * forward `ref`, and map `onUsaChange`-style props to `usa:change` events.\n *\n * ```tsx\n * import * as React from 'react';\n * import { createUsaComponents } from 'use-scroll-animate/components/react';\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents();\n * const { UsaButton, UsaToggle } = createUsaComponents(React);\n * <UsaButton deform=\"squash\" onUsaSubmit={(e) => e.detail.done(true)}><button>Pay</button></UsaButton>\n * ```\n *\n * JSX types for the raw tags (`<usa-card effect=\"flip\">`) come from\n * `use-scroll-animate/components/jsx` (see `UsaIntrinsicElements`).\n */\nimport { COMPONENT_CATEGORIES } from '../index-tags';\n\ntype AnyProps = Record<string, any>;\ninterface ReactLike {\n createElement: (type: any, props?: any, ...children: any[]) => any;\n forwardRef: (render: (props: any, ref: any) => any) => any;\n useRef: <T>(v: T) => { current: T };\n useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;\n useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;\n}\n\n/** `usa-flip-list` → `UsaFlipList` */\nexport const pascal = (tag: string): string => tag.replace(/(^|-)([a-z0-9])/g, (_, __, c) => c.toUpperCase());\n/** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */\nexport function eventName(prop: string): string | null {\n const m = /^on([A-Z].*)$/.exec(prop);\n if (!m) return null;\n const kebab = m[1].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n return kebab.startsWith('usa-') ? `usa:${kebab.slice(4)}` : kebab;\n}\n\n/** Props written as DOM properties (not attributes) when given non-string values. */\nconst PROPS = new Set(['checked', 'value', 'state', 'open', 'liked', 'count', 'loading', 'flipped', 'selected', 'index', 'indeterminate']);\n\n/** All `<usa-*>` tags shipped by the package. */\nexport const USA_TAGS: string[] = Object.values(COMPONENT_CATEGORIES).flat() as string[];\n\nexport function createUsaComponents(React: ReactLike): Record<string, any> {\n const useIso = React.useLayoutEffect || React.useEffect;\n const make = (tag: string) => {\n const C = React.forwardRef((props: AnyProps, ref: any) => {\n const inner = React.useRef<HTMLElement | null>(null);\n const attrs: AnyProps = {};\n const events: [string, any][] = [];\n const propsSet: [string, any][] = [];\n for (const [k, v] of Object.entries(props)) {\n if (k === 'children') continue;\n const ev = typeof v === 'function' ? eventName(k) : null;\n if (ev) events.push([ev, v]);\n else if (PROPS.has(k) && typeof v !== 'string') propsSet.push([k, v]);\n else if (k === 'className') attrs.class = v;\n else if (typeof v === 'boolean') {\n if (v) attrs[k] = '';\n } else attrs[k] = v;\n }\n useIso(() => {\n const el = inner.current as any;\n if (!el) return;\n for (const [k, v] of propsSet) el[k] = v;\n });\n useIso(() => {\n const el = inner.current;\n if (!el) return;\n events.forEach(([n, f]) => el.addEventListener(n, f));\n return () => events.forEach(([n, f]) => el.removeEventListener(n, f));\n });\n const setRef = (node: HTMLElement | null) => {\n inner.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n return React.createElement(tag, { ...attrs, ref: setRef }, props.children);\n });\n (C as any).displayName = pascal(tag);\n return C;\n };\n return Object.fromEntries(USA_TAGS.map((t) => [pascal(t), make(t)]));\n}\n"],"names":["COMPONENT_CATEGORIES"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAYH;AACO,MAAM,MAAM,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;AAC5G;AACM,SAAU,SAAS,CAAC,IAAY,EAAA;IACpC,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI;AACnB,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE;IACvE,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAA,IAAA,EAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK;AACnE;AAEA;AACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAA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AAO,CAAC;AACV,IAAA,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ interface ReactLike {
2
+ createElement: (type: any, props?: any, ...children: any[]) => any;
3
+ forwardRef: (render: (props: any, ref: any) => any) => any;
4
+ useRef: <T>(v: T) => {
5
+ current: T;
6
+ };
7
+ useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;
8
+ useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;
9
+ }
10
+ /** `usa-flip-list` → `UsaFlipList` */
11
+ declare const pascal: (tag: string) => string;
12
+ /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
13
+ declare function eventName(prop: string): string | null;
14
+ /** All `<usa-*>` tags shipped by the package. */
15
+ declare const USA_TAGS: string[];
16
+ declare function createUsaComponents(React: ReactLike): Record<string, any>;
17
+
18
+ export { USA_TAGS, createUsaComponents, eventName, pascal };
@@ -0,0 +1,18 @@
1
+ interface ReactLike {
2
+ createElement: (type: any, props?: any, ...children: any[]) => any;
3
+ forwardRef: (render: (props: any, ref: any) => any) => any;
4
+ useRef: <T>(v: T) => {
5
+ current: T;
6
+ };
7
+ useEffect: (fn: () => void | (() => void), deps?: unknown[]) => void;
8
+ useLayoutEffect?: (fn: () => void | (() => void), deps?: unknown[]) => void;
9
+ }
10
+ /** `usa-flip-list` → `UsaFlipList` */
11
+ declare const pascal: (tag: string) => string;
12
+ /** `onUsaChange` → `usa:change`, `onUsaDragEnd` → `usa:drag-end`; `onChange` → `change`. */
13
+ declare function eventName(prop: string): string | null;
14
+ /** All `<usa-*>` tags shipped by the package. */
15
+ declare const USA_TAGS: string[];
16
+ declare function createUsaComponents(React: ReactLike): Record<string, any>;
17
+
18
+ export { USA_TAGS, createUsaComponents, eventName, pascal };