use-scroll-animate 2.9.0 → 3.1.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 (138) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +4 -3
  3. package/README_ja.md +1 -0
  4. package/README_zh.md +2 -1
  5. package/dist/chunks/{base-BkQcvoSG.cjs → base-CXx7jZ-o.cjs} +4 -23
  6. package/dist/chunks/{base-BkQcvoSG.cjs.map → base-CXx7jZ-o.cjs.map} +1 -1
  7. package/dist/chunks/{base-CB8gChoe.js → base-Cu-86Z31.js} +5 -24
  8. package/dist/chunks/{base-CB8gChoe.js.map → base-Cu-86Z31.js.map} +1 -1
  9. package/dist/chunks/{core-J_KM443q.js → core-mV_TPgG_.js} +2 -52
  10. package/dist/chunks/core-mV_TPgG_.js.map +1 -0
  11. package/dist/chunks/{core-C1cEwjJj.cjs → core-qpECfEkb.cjs} +2 -52
  12. package/dist/chunks/core-qpECfEkb.cjs.map +1 -0
  13. package/dist/chunks/{index-tags-f37txHmb.js → index-tags-D7NynL4r.js} +2 -1
  14. package/dist/chunks/{index-tags-f37txHmb.js.map → index-tags-D7NynL4r.js.map} +1 -1
  15. package/dist/chunks/{index-tags-BEM98giN.cjs → index-tags-Gw1G06Pb.cjs} +2 -1
  16. package/dist/chunks/{index-tags-BEM98giN.cjs.map → index-tags-Gw1G06Pb.cjs.map} +1 -1
  17. package/dist/chunks/{spring-7U9MC6yQ.cjs → spring-2OTnYCzm.cjs} +2 -2
  18. package/dist/chunks/{spring-7U9MC6yQ.cjs.map → spring-2OTnYCzm.cjs.map} +1 -1
  19. package/dist/chunks/{spring-ka0YJ_ZR.js → spring-BV-cpTHC.js} +2 -2
  20. package/dist/chunks/{spring-ka0YJ_ZR.js.map → spring-BV-cpTHC.js.map} +1 -1
  21. package/dist/chunks/{stagger-CGF18oNs.js → stagger-BFAhKknX.js} +2 -2
  22. package/dist/chunks/{stagger-CGF18oNs.js.map → stagger-BFAhKknX.js.map} +1 -1
  23. package/dist/chunks/{stagger-DtKKS6GP.cjs → stagger-CLc3j58T.cjs} +2 -2
  24. package/dist/chunks/{stagger-DtKKS6GP.cjs.map → stagger-CLc3j58T.cjs.map} +1 -1
  25. package/dist/chunks/{variants-PsCXbQ5h.cjs → variants-BNIrn4ch.cjs} +2 -2
  26. package/dist/chunks/{variants-PsCXbQ5h.cjs.map → variants-BNIrn4ch.cjs.map} +1 -1
  27. package/dist/chunks/{variants-Ce9CboVc.js → variants-BQ3gCb5L.js} +2 -2
  28. package/dist/chunks/{variants-Ce9CboVc.js.map → variants-BQ3gCb5L.js.map} +1 -1
  29. package/dist/components/background.cjs +3 -3
  30. package/dist/components/background.cjs.map +1 -1
  31. package/dist/components/background.css +1 -1
  32. package/dist/components/background.d.cts +1 -1
  33. package/dist/components/background.d.ts +1 -1
  34. package/dist/components/background.js +4 -4
  35. package/dist/components/background.js.map +1 -1
  36. package/dist/components/cards.cjs +2 -2
  37. package/dist/components/cards.js +3 -3
  38. package/dist/components/click.cjs +2 -2
  39. package/dist/components/click.js +3 -3
  40. package/dist/components/feedback.cjs +9 -16
  41. package/dist/components/feedback.cjs.map +1 -1
  42. package/dist/components/feedback.css +2 -2
  43. package/dist/components/feedback.d.cts +2 -4
  44. package/dist/components/feedback.d.ts +2 -4
  45. package/dist/components/feedback.js +10 -17
  46. package/dist/components/feedback.js.map +1 -1
  47. package/dist/components/interaction.cjs +1 -1
  48. package/dist/components/interaction.js +2 -2
  49. package/dist/components/jsx.d.cts +1 -0
  50. package/dist/components/jsx.d.ts +1 -0
  51. package/dist/components/lazy.cjs +2 -1
  52. package/dist/components/lazy.cjs.map +1 -1
  53. package/dist/components/lazy.d.cts +1 -0
  54. package/dist/components/lazy.d.ts +1 -0
  55. package/dist/components/lazy.js +2 -1
  56. package/dist/components/lazy.js.map +1 -1
  57. package/dist/components/page.cjs +2 -2
  58. package/dist/components/page.js +3 -3
  59. package/dist/components/physics.cjs +2 -2
  60. package/dist/components/physics.js +4 -4
  61. package/dist/components/react.cjs +1 -1
  62. package/dist/components/react.js +1 -1
  63. package/dist/components/reveal.cjs +1 -1
  64. package/dist/components/reveal.js +2 -2
  65. package/dist/components/text.cjs +1 -1
  66. package/dist/components/text.js +2 -2
  67. package/dist/components/timeline.cjs +303 -0
  68. package/dist/components/timeline.cjs.map +1 -0
  69. package/dist/components/timeline.css +3 -0
  70. package/dist/components/timeline.d.cts +164 -0
  71. package/dist/components/timeline.d.ts +164 -0
  72. package/dist/components/timeline.js +296 -0
  73. package/dist/components/timeline.js.map +1 -0
  74. package/dist/components/transitions.cjs +7 -7
  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 +8 -8
  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 +5 -4
  83. package/dist/components/vue.cjs.map +1 -1
  84. package/dist/components/vue.d.cts +91 -6
  85. package/dist/components/vue.d.ts +91 -6
  86. package/dist/components/vue.js +5 -4
  87. package/dist/components/vue.js.map +1 -1
  88. package/dist/components.cjs +11 -4
  89. package/dist/components.cjs.map +1 -1
  90. package/dist/components.css +4 -3
  91. package/dist/components.d.cts +124 -8
  92. package/dist/components.d.ts +124 -8
  93. package/dist/components.js +10 -7
  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/components.md +12 -3
  135. package/docs/upgrading-3.md +1 -0
  136. package/package.json +14 -3
  137. package/dist/chunks/core-C1cEwjJj.cjs.map +0 -1
  138. package/dist/chunks/core-J_KM443q.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BkQcvoSG.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 { f as defineElement, i as EASE_OUT, r as raf, d as caf, h as clamp, E as EASE_SPRING } from '../chunks/base-CB8gChoe.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-CB8gChoe.js';
1
+ import { h as defineElement, i as EASE_OUT, r as raf, d as caf, f as clamp, E as EASE_SPRING } from '../chunks/base-Cu-86Z31.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Cu-86Z31.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
 
@@ -11,6 +11,7 @@ declare const COMPONENT_CATEGORIES: {
11
11
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
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
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
+ readonly timeline: readonly ["usa-timeline"];
14
15
  };
15
16
 
16
17
  /**
@@ -11,6 +11,7 @@ declare const COMPONENT_CATEGORIES: {
11
11
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
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
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
+ readonly timeline: readonly ["usa-timeline"];
14
15
  };
15
16
 
16
17
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var indexTags = require('../chunks/index-tags-BEM98giN.cjs');
3
+ var indexTags = require('../chunks/index-tags-Gw1G06Pb.cjs');
4
4
 
5
5
  /**
6
6
  * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
@@ -27,6 +27,7 @@ const LOADERS = {
27
27
  click: () => Promise.resolve().then(function () { return require('./click.cjs'); }),
28
28
  ui: () => Promise.resolve().then(function () { return require('./ui.cjs'); }),
29
29
  page: () => Promise.resolve().then(function () { return require('./page.cjs'); }),
30
+ timeline: () => Promise.resolve().then(function () { return require('./timeline.cjs'); }),
30
31
  };
31
32
  const TAG_TO_CAT = new Map();
32
33
  for (const [cat, tags] of Object.entries(indexTags.COMPONENT_CATEGORIES))
@@ -1 +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,U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CAAC,IAAI,UAAU,CAAC,CAAY,CAAC,CAAC;AACpG,IAAA,CAAC,CAAC;AACF,IAAA,EAAE,CAAC,OAAO,CAAC,IAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5D,IAAA,OAAO,MAAM,EAAE,CAAC,UAAU,EAAE;AAC9B;;;;;;;"}
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 timeline: () => import('./timeline/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;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EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5D,IAAA,OAAO,MAAM,EAAE,CAAC,UAAU,EAAE;AAC9B;;;;;;;"}
@@ -11,6 +11,7 @@ declare const COMPONENT_CATEGORIES: {
11
11
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
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
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
+ readonly timeline: readonly ["usa-timeline"];
14
15
  };
15
16
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
16
17
 
@@ -11,6 +11,7 @@ declare const COMPONENT_CATEGORIES: {
11
11
  readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
12
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
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
+ readonly timeline: readonly ["usa-timeline"];
14
15
  };
15
16
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
16
17
 
@@ -1,4 +1,4 @@
1
- import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-f37txHmb.js';
1
+ import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-D7NynL4r.js';
2
2
 
3
3
  /**
4
4
  * use-scroll-animate/components/lazy — lazy, per-category registration (v2.9).
@@ -25,6 +25,7 @@ const LOADERS = {
25
25
  click: () => import('./click.js'),
26
26
  ui: () => import('./ui.js'),
27
27
  page: () => import('./page.js'),
28
+ timeline: () => import('./timeline.js'),
28
29
  };
29
30
  const TAG_TO_CAT = new Map();
30
31
  for (const [cat, tags] of Object.entries(COMPONENT_CATEGORIES))
@@ -1 +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,cAAiB,CAAC;AACxC,IAAA,KAAK,EAAE,MAAM,OAAO,YAAe,CAAC;AACpC,IAAA,KAAK,EAAE,MAAM,OAAO,YAAe,CAAC;AACpC,IAAA,EAAE,EAAE,MAAM,OAAO,S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"],"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 timeline: () => import('./timeline/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,cAAiB,CAAC;AACxC,IAAA,KAAK,EAAE,MAAM,OAAO,YAAe,CAAC;AACpC,IAAA,KAAK,EAAE,MAAM,OAAO,YAAe,CAAC;AACpC,IAAA,EAAE,EAAE,MAAM,OAAO,SAAY,CAAC;AAC9B,IAAA,IAAI,EAAE,MAAM,OAAO,WAAc,CAAC;AAClC,IAAA,QAAQ,EAAE,MAAM,OAAO,eAAkB,CAAC;CAC3C;AAED,MAAM,UAAU,GAAG,IAAI,GAAG,EAA6B;AACvD,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,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I,CAAC;AAAE,YAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACpB,IAAA,CAAC;IACD,IAAK,IAAgB,CAAC,SAAS;QAAE,IAAI,CAAC,IAAe,CAAC;IACtD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;AACxC,IAAA,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC9C,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC;AAClB;AAEA;AACM,SAAU,UAAU,CAAC,IAAA,GAAmB,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,GAAI,SAAiB,EAAA;AAC3G,IAAA,IAAI,CAAC,IAAI,IAAI,OAAO,gBAAgB,KAAK,WAAW;AAAE,QAAA,OAAO,MAAM,SAAS;IAC5E,UAAU,CAAC,IAAI,CAAC;IAChB,MAAM,EAAE,GAAG,IAAI,gBAAgB,CAAC,CAAC,OAAO,KAAI;QAC1C,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,IAAI,UAAU,CAAC,CAAY,CAAC,CAAC;AACpG,IAAA,CAAC,CAAC;AACF,IAAA,EAAE,CAAC,OAAO,CAAC,IAAY,EAAE,EAAE,SAAS,EAAE,IAAI,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-BkQcvoSG.cjs');
4
- var spring = require('../chunks/spring-7U9MC6yQ.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 { 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-CB8gChoe.js';
2
- export { M as MOTION_SCALE } from '../chunks/base-CB8gChoe.js';
3
- import { e as springSamples } from '../chunks/spring-ka0YJ_ZR.js';
1
+ import { h 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-Cu-86Z31.js';
2
+ export { M as MOTION_SCALE } from '../chunks/base-Cu-86Z31.js';
3
+ import { e as springSamples } from '../chunks/spring-BV-cpTHC.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-BkQcvoSG.cjs');
4
- var spring = require('../chunks/spring-7U9MC6yQ.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 { f as defineElement, h as clamp } from '../chunks/base-CB8gChoe.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-CB8gChoe.js';
3
- import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-ka0YJ_ZR.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-ka0YJ_ZR.js';
1
+ import { h as defineElement, f as clamp } from '../chunks/base-Cu-86Z31.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Cu-86Z31.js';
3
+ import { d as springEasing, c as createSpring, s as snapTo, a as rubberBand, p as projectInertia } from '../chunks/spring-BV-cpTHC.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-BV-cpTHC.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
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var indexTags = require('../chunks/index-tags-BEM98giN.cjs');
3
+ var indexTags = require('../chunks/index-tags-Gw1G06Pb.cjs');
4
4
 
5
5
  /**
6
6
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -1,4 +1,4 @@
1
- import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-f37txHmb.js';
1
+ import { C as COMPONENT_CATEGORIES } from '../chunks/index-tags-D7NynL4r.js';
2
2
 
3
3
  /**
4
4
  * use-scroll-animate/components/react — React wrappers for every `<usa-*>`
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BkQcvoSG.cjs');
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
4
 
5
5
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
6
6
  const REVEAL_EFFECTS = [
@@ -1,5 +1,5 @@
1
- import { f as defineElement, i as EASE_OUT, h as clamp, d as caf, r as raf } from '../chunks/base-CB8gChoe.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-CB8gChoe.js';
1
+ import { h as defineElement, i as EASE_OUT, f as clamp, d as caf, r as raf } from '../chunks/base-Cu-86Z31.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Cu-86Z31.js';
3
3
 
4
4
  /** Entrance effects shared by `<usa-reveal>` and `<usa-stagger>` (transform / opacity / filter only). */
5
5
  const REVEAL_EFFECTS = [
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var base = require('../chunks/base-BkQcvoSG.cjs');
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
4
 
5
5
  var css$5 = "usa-typewriter{white-space:pre-wrap}usa-typewriter .usa-tw-caret{display:inline-block;width:var(--usa-caret-width,0.08em);height:1.05em;margin-left:0.06em;vertical-align:-0.12em;background:var(--usa-caret-color,currentColor);animation:usa-caret 1.06s steps(1) infinite}usa-typewriter[data-typing] .usa-tw-caret{animation:none}usa-typewriter[data-no-cursor] .usa-tw-caret{display:none}@keyframes usa-caret{50%{opacity:0}}@media (prefers-reduced-motion:reduce){usa-typewriter .usa-tw-caret,usa-shimmer-text{animation:none}}";
6
6
 
@@ -1,5 +1,5 @@
1
- import { f as defineElement, j as srText, d as caf, n as now, r as raf, i as EASE_OUT, E as EASE_SPRING, h as clamp } from '../chunks/base-CB8gChoe.js';
2
- export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-CB8gChoe.js';
1
+ import { h as defineElement, j as srText, d as caf, n as now, r as raf, i as EASE_OUT, E as EASE_SPRING, f as clamp } from '../chunks/base-Cu-86Z31.js';
2
+ export { a as configureComponents, p as prefersReducedMotion } from '../chunks/base-Cu-86Z31.js';
3
3
 
4
4
  var css$5 = "usa-typewriter{white-space:pre-wrap}usa-typewriter .usa-tw-caret{display:inline-block;width:var(--usa-caret-width,0.08em);height:1.05em;margin-left:0.06em;vertical-align:-0.12em;background:var(--usa-caret-color,currentColor);animation:usa-caret 1.06s steps(1) infinite}usa-typewriter[data-typing] .usa-tw-caret{animation:none}usa-typewriter[data-no-cursor] .usa-tw-caret{display:none}@keyframes usa-caret{50%{opacity:0}}@media (prefers-reduced-motion:reduce){usa-typewriter .usa-tw-caret,usa-shimmer-text{animation:none}}";
5
5
 
@@ -0,0 +1,303 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-CXx7jZ-o.cjs');
4
+
5
+ /** Keyframe presets usable by name in `to()` and `data-tl`. */
6
+ const TIMELINE_PRESETS = {
7
+ fade: [{ opacity: 0 }, { opacity: 1 }],
8
+ 'fade-up': [{ opacity: 0, transform: 'translateY(24px)' }, { opacity: 1, transform: 'none' }],
9
+ 'fade-down': [{ opacity: 0, transform: 'translateY(-24px)' }, { opacity: 1, transform: 'none' }],
10
+ 'fade-left': [{ opacity: 0, transform: 'translateX(24px)' }, { opacity: 1, transform: 'none' }],
11
+ 'fade-right': [{ opacity: 0, transform: 'translateX(-24px)' }, { opacity: 1, transform: 'none' }],
12
+ scale: [{ opacity: 0, transform: 'scale(0.85)' }, { opacity: 1, transform: 'none' }],
13
+ blur: [{ opacity: 0, filter: 'blur(12px)' }, { opacity: 1, filter: 'blur(0)' }],
14
+ rotate: [{ opacity: 0, transform: 'rotate(-12deg) scale(0.9)' }, { opacity: 1, transform: 'none' }],
15
+ 'clip-up': [{ clipPath: 'inset(100% 0 0 0)' }, { clipPath: 'inset(0 0 0 0)' }],
16
+ 'clip-right': [{ clipPath: 'inset(0 100% 0 0)' }, { clipPath: 'inset(0 0 0 0)' }],
17
+ };
18
+ /** Resolve a position against the previous step and labels (pure). */
19
+ function resolvePosition(pos, end, prevStart, labels = {}) {
20
+ if (pos === undefined || pos === '' || pos === '>')
21
+ return end;
22
+ if (typeof pos === 'number')
23
+ return Math.max(0, pos);
24
+ const s = String(pos).trim();
25
+ if (/^-?\d+(\.\d+)?$/.test(s))
26
+ return Math.max(0, Number(s));
27
+ const m = /^(<|>|[A-Za-z_][\w-]*)?\s*(?:([+-])=\s*(\d+(?:\.\d+)?))?$/.exec(s);
28
+ if (!m)
29
+ return end;
30
+ const base = m[1] === '<' ? prevStart : m[1] === '>' || !m[1] ? end : labels[m[1]] ?? end;
31
+ const delta = m[2] ? (m[2] === '-' ? -1 : 1) * Number(m[3]) : 0;
32
+ return Math.max(0, base + delta);
33
+ }
34
+ const toEls = (t) => typeof t === 'string' ? (typeof document === 'undefined' ? [] : Array.from(document.querySelectorAll(t))) : t instanceof Element ? [t] : Array.from(t);
35
+ /**
36
+ * Choreograph animations on one clock: chain, overlap, label, seek, reverse and
37
+ * scrub them with scroll. Built on WAAPI (paused animations driven by one
38
+ * playhead); without WAAPI or under reduced motion it jumps to the end state.
39
+ *
40
+ * @example
41
+ * const tl = timeline({ defaults: { duration: 500 } })
42
+ * .to('.title', 'fade-up')
43
+ * .label('cards')
44
+ * .to('.card', 'scale', { stagger: 80, at: '-=200' })
45
+ * .to('.cta', [{ opacity: 0 }, { opacity: 1 }], { at: 'cards+=400' });
46
+ * tl.play(); // or tl.scrub(document.querySelector('.hero'))
47
+ */
48
+ function timeline(options = {}) {
49
+ const d = { duration: 600, easing: 'cubic-bezier(0.22, 1, 0.36, 1)', stagger: 0, ...options.defaults };
50
+ const steps = [];
51
+ const cues = [];
52
+ const labels = {};
53
+ let end = 0;
54
+ let prevStart = 0;
55
+ let t = 0;
56
+ let frame = 0;
57
+ let dir = 1;
58
+ let settle;
59
+ let built = false;
60
+ const total = () => Math.max(end, ...cues.map((c) => c.at), 0);
61
+ const build = () => {
62
+ if (built)
63
+ return;
64
+ built = true;
65
+ for (const s of steps) {
66
+ if (typeof s.el.animate !== 'function') {
67
+ s.anim = null;
68
+ continue;
69
+ }
70
+ s.anim = s.el.animate(s.frames, { duration: s.duration, delay: s.start, easing: s.easing, fill: 'both' });
71
+ s.anim.pause();
72
+ }
73
+ };
74
+ const render = (to, from) => {
75
+ build();
76
+ t = base.clamp(to, 0, total());
77
+ for (const s of steps) {
78
+ if (s.anim)
79
+ s.anim.currentTime = t;
80
+ else
81
+ base.applyFrame(s.el, s.frames[t >= s.start ? s.frames.length - 1 : 0]);
82
+ }
83
+ for (const c of cues)
84
+ if ((from < c.at && t >= c.at) || (from > c.at && t <= c.at))
85
+ c.fn();
86
+ options.onUpdate?.(total() ? t / total() : 1);
87
+ };
88
+ const stop = () => {
89
+ if (frame)
90
+ base.caf(frame);
91
+ frame = 0;
92
+ };
93
+ const run = (direction) => {
94
+ stop();
95
+ settle?.();
96
+ dir = direction;
97
+ const target = dir > 0 ? total() : 0;
98
+ const k = base.motionScale();
99
+ if (base.prefersReducedMotion() || k === 0 || !total()) {
100
+ render(target, t);
101
+ options.onComplete?.();
102
+ return Promise.resolve();
103
+ }
104
+ const rate = (options.speed ?? 1) / k;
105
+ return new Promise((resolve) => {
106
+ settle = () => { settle = undefined; resolve(); };
107
+ let last = base.now();
108
+ const loop = () => {
109
+ const n = base.now();
110
+ const next = t + (n - last) * rate * dir;
111
+ last = n;
112
+ render(next, t);
113
+ if ((dir > 0 && t >= target) || (dir < 0 && t <= 0)) {
114
+ frame = 0;
115
+ options.onComplete?.();
116
+ settle?.();
117
+ return;
118
+ }
119
+ frame = base.raf(loop);
120
+ };
121
+ frame = base.raf(loop);
122
+ });
123
+ };
124
+ const api = {
125
+ get duration() { return total(); },
126
+ get labels() { return { ...labels }; },
127
+ get time() { return t; },
128
+ to(target, frames, o = {}) {
129
+ const kf = typeof frames === 'string' ? TIMELINE_PRESETS[frames] || TIMELINE_PRESETS.fade : frames;
130
+ const start = resolvePosition(o.at, end, prevStart, labels);
131
+ const duration = o.duration ?? d.duration;
132
+ const stagger = o.stagger ?? d.stagger;
133
+ let last = start;
134
+ toEls(target).forEach((el, i) => {
135
+ const s = start + i * stagger;
136
+ steps.push({ el, frames: kf, start: s, duration, easing: o.easing ?? d.easing });
137
+ last = Math.max(last, s + duration);
138
+ });
139
+ prevStart = start;
140
+ end = Math.max(end, last);
141
+ built = false;
142
+ steps.forEach((s) => s.anim?.cancel());
143
+ return api;
144
+ },
145
+ label(name, at) {
146
+ labels[name] = resolvePosition(at, end, prevStart, labels);
147
+ return api;
148
+ },
149
+ call(fn, at) {
150
+ cues.push({ fn, at: resolvePosition(at, end, prevStart, labels) });
151
+ return api;
152
+ },
153
+ play(from) {
154
+ if (from !== undefined)
155
+ render(resolvePosition(from, 0, 0, labels), t);
156
+ else if (t >= total())
157
+ render(0, -1);
158
+ return run(1);
159
+ },
160
+ reverse() {
161
+ return run(-1);
162
+ },
163
+ pause() {
164
+ stop();
165
+ return api;
166
+ },
167
+ seek(to) {
168
+ stop();
169
+ render(resolvePosition(to, 0, 0, labels), t);
170
+ return api;
171
+ },
172
+ progress(p) {
173
+ if (p !== undefined)
174
+ api.seek(base.clamp(p, 0, 1) * total());
175
+ return total() ? t / total() : 0;
176
+ },
177
+ scrub(source, o = {}) {
178
+ stop();
179
+ if (base.prefersReducedMotion() || typeof window === 'undefined') {
180
+ render(total(), t);
181
+ return () => { };
182
+ }
183
+ let id = 0;
184
+ let cur = t;
185
+ const update = () => {
186
+ id = 0;
187
+ const r = source.getBoundingClientRect();
188
+ const vh = window.innerHeight || 1;
189
+ const p = base.clamp((vh + (o.offset ?? 0) - r.top) / (vh + r.height || 1), 0, 1);
190
+ const goal = p * total();
191
+ const sm = base.clamp(o.smooth ?? 0, 0, 0.95);
192
+ cur = sm ? cur + (goal - cur) * (1 - sm) : goal;
193
+ render(cur, t);
194
+ if (sm && Math.abs(goal - cur) > 0.5)
195
+ id = base.raf(update);
196
+ };
197
+ const onScroll = () => { if (!id)
198
+ id = base.raf(update); };
199
+ window.addEventListener('scroll', onScroll, { passive: true });
200
+ window.addEventListener('resize', onScroll, { passive: true });
201
+ update();
202
+ return () => {
203
+ window.removeEventListener('scroll', onScroll);
204
+ window.removeEventListener('resize', onScroll);
205
+ if (id)
206
+ base.caf(id);
207
+ };
208
+ },
209
+ cancel() {
210
+ stop();
211
+ settle?.();
212
+ steps.forEach((s) => s.anim?.cancel());
213
+ built = false;
214
+ },
215
+ };
216
+ return api;
217
+ }
218
+
219
+ var css = "usa-timeline{display:block}usa-timeline[scrub]{position:relative}@media (prefers-reduced-motion:reduce){usa-timeline [data-tl]{opacity:1 !important;transform:none !important;filter:none !important;clip-path:none !important}}";
220
+
221
+ function defineTimeline(tag = 'usa-timeline') {
222
+ return base.defineElement(tag, (Base) => class UsaTimeline extends Base {
223
+ constructor() {
224
+ super(...arguments);
225
+ this._tl = null;
226
+ }
227
+ static get observedAttributes() {
228
+ return ['scrub', 'trigger', 'overlap'];
229
+ }
230
+ get timeline() {
231
+ return this._tl;
232
+ }
233
+ play() {
234
+ return this._tl ? this._tl.play(0).then(() => void this.emit('complete')) : Promise.resolve();
235
+ }
236
+ reverse() {
237
+ return this._tl ? this._tl.reverse() : Promise.resolve();
238
+ }
239
+ seek(to) {
240
+ this._tl?.seek(to);
241
+ }
242
+ mount() {
243
+ const overlap = this.num('overlap', 0);
244
+ const tl = (this._tl = timeline({ defaults: { duration: this.num('duration', 600), stagger: this.num('stagger', 0) } }));
245
+ this.querySelectorAll('[data-tl]').forEach((el, i) => {
246
+ if (el.dataset.label)
247
+ tl.label(el.dataset.label);
248
+ const name = el.dataset.tl || 'fade';
249
+ tl.to(el, TIMELINE_PRESETS[name] ? name : 'fade', {
250
+ at: el.dataset.at ?? (i && overlap ? `-=${overlap}` : undefined),
251
+ duration: el.dataset.duration ? Number(el.dataset.duration) : undefined,
252
+ });
253
+ });
254
+ this.onCleanup(() => tl.cancel());
255
+ if (this.reduced) {
256
+ tl.seek(tl.duration);
257
+ return;
258
+ }
259
+ if (this.flag('scrub')) {
260
+ this.onCleanup(tl.scrub(this, { smooth: 0.2 }));
261
+ return;
262
+ }
263
+ tl.seek(0);
264
+ const trigger = this.str('trigger', 'view');
265
+ if (trigger === 'click')
266
+ this.listen(this, 'click', () => void this.play());
267
+ else if (trigger === 'view') {
268
+ let played = false;
269
+ this.inView((v) => {
270
+ if (v && (!played || this.flag('repeat'))) {
271
+ played = true;
272
+ void this.play();
273
+ }
274
+ else if (!v && this.flag('repeat'))
275
+ tl.seek(0);
276
+ }, { threshold: 0.2 });
277
+ }
278
+ }
279
+ unmount() {
280
+ this._tl = null;
281
+ }
282
+ }, { id: 'timeline', text: css });
283
+ }
284
+
285
+ /**
286
+ * use-scroll-animate/components/timeline — choreography (v3.1).
287
+ * `timeline()` chains, overlaps, labels, seeks, reverses and scroll-scrubs
288
+ * WAAPI animations on one playhead; `<usa-timeline>` builds one from
289
+ * `data-tl` children.
290
+ */
291
+ /** Register every component of this category under its default tag. */
292
+ function defineTimelineComponents() {
293
+ defineTimeline();
294
+ }
295
+
296
+ exports.configureComponents = base.configureComponents;
297
+ exports.prefersReducedMotion = base.prefersReducedMotion;
298
+ exports.TIMELINE_PRESETS = TIMELINE_PRESETS;
299
+ exports.defineTimeline = defineTimeline;
300
+ exports.defineTimelineComponents = defineTimelineComponents;
301
+ exports.resolvePosition = resolvePosition;
302
+ exports.timeline = timeline;
303
+ //# sourceMappingURL=timeline.cjs.map