use-scroll-animate 2.1.0 → 2.3.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 (70) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +31 -2
  3. package/README_ja.md +19 -0
  4. package/README_zh.md +30 -0
  5. package/dist/chunks/base-CJ7XfidP.cjs +233 -0
  6. package/dist/chunks/base-CJ7XfidP.cjs.map +1 -0
  7. package/dist/chunks/base-CuvCgqLy.js +219 -0
  8. package/dist/chunks/base-CuvCgqLy.js.map +1 -0
  9. package/dist/components/background.cjs +395 -0
  10. package/dist/components/background.cjs.map +1 -0
  11. package/dist/components/background.css +7 -0
  12. package/dist/components/background.d.cts +132 -0
  13. package/dist/components/background.d.ts +132 -0
  14. package/dist/components/background.js +387 -0
  15. package/dist/components/background.js.map +1 -0
  16. package/dist/components/feedback.cjs +444 -0
  17. package/dist/components/feedback.cjs.map +1 -0
  18. package/dist/components/feedback.css +7 -0
  19. package/dist/components/feedback.d.cts +170 -0
  20. package/dist/components/feedback.d.ts +170 -0
  21. package/dist/components/feedback.js +434 -0
  22. package/dist/components/feedback.js.map +1 -0
  23. package/dist/components/interaction.cjs +426 -0
  24. package/dist/components/interaction.cjs.map +1 -0
  25. package/dist/components/interaction.css +8 -0
  26. package/dist/components/interaction.d.cts +142 -0
  27. package/dist/components/interaction.d.ts +142 -0
  28. package/dist/components/interaction.js +417 -0
  29. package/dist/components/interaction.js.map +1 -0
  30. package/dist/components/physics.cjs +664 -0
  31. package/dist/components/physics.cjs.map +1 -0
  32. package/dist/components/physics.css +5 -0
  33. package/dist/components/physics.d.cts +216 -0
  34. package/dist/components/physics.d.ts +216 -0
  35. package/dist/components/physics.js +644 -0
  36. package/dist/components/physics.js.map +1 -0
  37. package/dist/components/reveal.cjs +360 -0
  38. package/dist/components/reveal.cjs.map +1 -0
  39. package/dist/components/reveal.css +5 -0
  40. package/dist/components/reveal.d.cts +132 -0
  41. package/dist/components/reveal.d.ts +132 -0
  42. package/dist/components/reveal.js +350 -0
  43. package/dist/components/reveal.js.map +1 -0
  44. package/dist/components/text.cjs +528 -0
  45. package/dist/components/text.cjs.map +1 -0
  46. package/dist/components/text.css +7 -0
  47. package/dist/components/text.d.cts +164 -0
  48. package/dist/components/text.d.ts +164 -0
  49. package/dist/components/text.js +517 -0
  50. package/dist/components/text.js.map +1 -0
  51. package/dist/components/transitions.cjs +546 -0
  52. package/dist/components/transitions.cjs.map +1 -0
  53. package/dist/components/transitions.css +6 -0
  54. package/dist/components/transitions.d.cts +180 -0
  55. package/dist/components/transitions.d.ts +180 -0
  56. package/dist/components/transitions.js +536 -0
  57. package/dist/components/transitions.js.map +1 -0
  58. package/dist/components.cjs +127 -0
  59. package/dist/components.cjs.map +1 -0
  60. package/dist/components.css +33 -0
  61. package/dist/components.d.cts +919 -0
  62. package/dist/components.d.ts +919 -0
  63. package/dist/components.js +65 -0
  64. package/dist/components.js.map +1 -0
  65. package/dist/components.umd.js +22 -0
  66. package/dist/components.umd.js.map +1 -0
  67. package/docs/API.md +2 -0
  68. package/docs/components.md +169 -0
  69. package/docs/windows-apps.md +108 -0
  70. package/package.json +105 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.cjs","sources":["../../src/components/text/typewriter.ts","../../src/components/text/split-text.ts","../../src/components/text/scramble.ts","../../src/components/text/counter.ts","../../src/components/text/shimmer-text.ts","../../src/components/text/text-rotate.ts","../../src/components/text/index.ts"],"sourcesContent":["import { defineElement, srText, type UsaElement } from '../base';\nimport css from './typewriter.css?raw';\n\n/**\n * `<usa-typewriter>` — types text character by character, optionally cycling\n * through several phrases (typing, pausing, deleting).\n *\n * Attributes: `text` (default: the element's text), `words` (phrases\n * separated by `|`, overrides `text`), `speed` (ms per character, 55),\n * `delete-speed` (ms, 30), `pause` (ms before deleting, 1400), `delay`\n * (ms, 0), `loop`, `cursor=\"false\"` to hide the caret, `start`\n * (`view` | `load` | `manual`, default `view`). The full text is exposed to\n * assistive tech via `aria-label`. Event: `usa:complete` (one pass done).\n * Reduced motion: the text appears at once.\n */\nexport interface UsaTypewriterElement extends UsaElement {\n /** Phrases being typed. */\n readonly phrases: string[];\n start(): void;\n stop(): void;\n restart(): void;\n}\n\nexport function defineTypewriter(tag = 'usa-typewriter'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTypewriter extends Base {\n static get observedAttributes(): string[] {\n return ['text', 'words'];\n }\n\n private _source: string | null = null;\n private _out: HTMLElement | null = null;\n private _timer: ReturnType<typeof setTimeout> | 0 = 0;\n private _running = false;\n\n get phrases(): string[] {\n const words = this.getAttribute('words');\n if (words) return words.split('|').map((w) => w.trim()).filter(Boolean);\n return [this.getAttribute('text') ?? this._source ?? ''];\n }\n\n mount(): void {\n if (this._source === null) this._source = (this.textContent || '').trim();\n const phrases = this.phrases;\n const sr = srText(phrases.join(', '));\n this._out = document.createElement('span');\n this._out.className = 'usa-tw-text';\n this._out.setAttribute('aria-hidden', 'true');\n const caret = document.createElement('span');\n caret.className = 'usa-tw-caret';\n caret.setAttribute('aria-hidden', 'true');\n this.replaceChildren(sr, this._out, caret);\n this.toggleAttribute('data-no-cursor', this.getAttribute('cursor') === 'false');\n if (this.reduced) {\n this._out.textContent = phrases[0] || '';\n return;\n }\n const start = this.str('start', 'view');\n if (start === 'load') this.start();\n else if (start === 'view') {\n this.inView((visible) => {\n if (visible && !this._running && !this._out?.textContent) this.start();\n });\n }\n }\n\n unmount(): void {\n this.stop();\n }\n\n stop(): void {\n clearTimeout(this._timer as ReturnType<typeof setTimeout>);\n this._timer = 0;\n this._running = false;\n this.removeAttribute('data-typing');\n }\n\n restart(): void {\n this.stop();\n if (this._out) this._out.textContent = '';\n this.start();\n }\n\n start(): void {\n if (this._running || !this._out) return;\n const out = this._out;\n const phrases = this.phrases;\n if (this.reduced) {\n out.textContent = phrases[0] || '';\n return;\n }\n this._running = true;\n const speed = this.num('speed', 55);\n const del = this.num('delete-speed', 30);\n const pause = this.num('pause', 1400);\n const loop = this.flag('loop') || phrases.length > 1;\n let p = 0;\n let i = 0;\n let deleting = false;\n const tick = () => {\n const word = phrases[p] || '';\n if (!deleting) {\n i++;\n out.textContent = word.slice(0, i);\n this.setAttribute('data-typing', '');\n if (i >= word.length) {\n this.removeAttribute('data-typing');\n const last = p === phrases.length - 1;\n if (last) this.emit('complete');\n if (!loop && last) {\n this._running = false;\n return;\n }\n deleting = true;\n this._timer = setTimeout(tick, pause);\n return;\n }\n this._timer = setTimeout(tick, speed * (0.6 + Math.random() * 0.8));\n } else {\n i--;\n out.textContent = word.slice(0, Math.max(0, i));\n if (i <= 0) {\n deleting = false;\n p = (p + 1) % phrases.length;\n this._timer = setTimeout(tick, speed * 4);\n return;\n }\n this._timer = setTimeout(tick, del);\n }\n };\n this._timer = setTimeout(tick, this.num('delay', 0));\n }\n },\n { id: 'typewriter', text: css }\n );\n}\n","import { defineElement, srText, type UsaElement } from '../base';\nimport css from './split-text.css?raw';\n\n/**\n * `<usa-split-text>` — splits its text into words or characters and reveals\n * them in a cascade (pure CSS animation per unit, transform / opacity /\n * filter only). Words never break across lines.\n *\n * Attributes: `by` (`chars` | `words`, default `chars`), `effect`\n * (`rise` | `fade` | `blur` | `flip` | `pop`, default `rise`), `stagger`\n * (ms between units, 28 for chars / 70 for words), `duration` (ms, 620),\n * `delay` (ms, 0), `trigger` (`view` | `load` | `manual`, default `view`),\n * `repeat`. The original text stays readable via `aria-label`.\n * Event: `usa:complete`.\n */\nexport interface UsaSplitTextElement extends UsaElement {\n readonly units: HTMLElement[];\n play(): void;\n reset(): void;\n}\n\nexport function defineSplitText(tag = 'usa-split-text'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaSplitText extends Base {\n static get observedAttributes(): string[] {\n return ['by', 'text'];\n }\n\n private _source: string | null = null;\n private _timer: ReturnType<typeof setTimeout> | 0 = 0;\n\n get units(): HTMLElement[] {\n return Array.from(this.querySelectorAll<HTMLElement>('.usa-split-unit'));\n }\n\n mount(): void {\n if (this._source === null) this._source = this.getAttribute('text') ?? (this.textContent || '').replace(/\\s+/g, ' ').trim();\n const text = this.getAttribute('text') ?? this._source;\n const byWords = this.str('by', 'chars') === 'words';\n const frag = document.createDocumentFragment();\n frag.append(srText(text));\n let i = 0;\n text.split(' ').forEach((word, w) => {\n if (w > 0) frag.append(' ');\n const wordEl = document.createElement('span');\n wordEl.className = 'usa-split-word';\n wordEl.setAttribute('aria-hidden', 'true');\n const parts = byWords ? [word] : Array.from(word);\n for (const part of parts) {\n const u = document.createElement('span');\n u.className = 'usa-split-unit';\n u.textContent = part;\n u.style.setProperty('--i', String(i++));\n wordEl.append(u);\n }\n frag.append(wordEl);\n });\n this.replaceChildren(frag);\n this.style.setProperty('--usa-split-stagger', `${this.num('stagger', byWords ? 70 : 28)}ms`);\n this.style.setProperty('--usa-split-duration', `${this.num('duration', 620)}ms`);\n this.style.setProperty('--usa-split-delay', `${this.num('delay', 0)}ms`);\n this.style.setProperty('--usa-split-count', String(i));\n if (this.reduced) {\n this.setAttribute('data-state', 'shown');\n return;\n }\n this.setAttribute('data-state', 'hidden');\n const trigger = this.str('trigger', 'view');\n if (trigger === 'load') this.play();\n else if (trigger === 'view') {\n this.inView((visible) => {\n if (visible && this.getAttribute('data-state') === 'hidden') this.play();\n else if (!visible && this.flag('repeat')) this.reset();\n }, { threshold: 0.2 });\n }\n }\n\n unmount(): void {\n clearTimeout(this._timer as ReturnType<typeof setTimeout>);\n }\n\n play(): void {\n clearTimeout(this._timer as ReturnType<typeof setTimeout>);\n if (this.reduced) {\n this.setAttribute('data-state', 'shown');\n return;\n }\n // Restart the CSS animations\n this.setAttribute('data-state', 'hidden');\n void this.offsetWidth;\n this.setAttribute('data-state', 'play');\n const n = this.units.length;\n const total = this.num('delay', 0) + this.num('duration', 620) + Math.max(0, n - 1) * this.num('stagger', this.str('by') === 'words' ? 70 : 28);\n this._timer = setTimeout(() => {\n this.setAttribute('data-state', 'shown');\n this.emit('complete');\n }, total);\n }\n\n reset(): void {\n clearTimeout(this._timer as ReturnType<typeof setTimeout>);\n this.setAttribute('data-state', this.reduced ? 'shown' : 'hidden');\n }\n },\n { id: 'split-text', text: css }\n );\n}\n","import { defineElement, srText, raf, caf, now, type UsaElement } from '../base';\n\nconst GLYPHS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=<>/\\\\?!';\n\n/**\n * `<usa-scramble>` — \"decodes\" text out of random glyphs, left to right.\n *\n * Attributes: `text` (default: the element's text), `duration` (ms, 900),\n * `chars` (glyph set), `trigger` (`view` | `hover` | `load` | `manual`,\n * default `view`). Spaces and punctuation stay in place. Uses a monospace-\n * friendly fixed width per glyph only if you style it so; the element sets\n * nothing that causes reflow beyond its own text. Event: `usa:complete`.\n * Reduced motion: shows the final text.\n */\nexport interface UsaScrambleElement extends UsaElement {\n play(): Promise<void>;\n}\n\n/** One frame of the scramble: the first `progress` share is resolved. */\nexport function scrambleFrame(text: string, progress: number, glyphs = GLYPHS, rnd: () => number = Math.random): string {\n const done = Math.floor(text.length * progress);\n let out = '';\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n out += i < done || /\\s|[.,:;!?'\"()\\-–—]/.test(ch) ? ch : glyphs[Math.floor(rnd() * glyphs.length)];\n }\n return out;\n}\n\nexport function defineScramble(tag = 'usa-scramble'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaScramble extends Base {\n static get observedAttributes(): string[] {\n return ['text'];\n }\n\n private _source: string | null = null;\n private _out: HTMLElement | null = null;\n private _frame = 0;\n\n private get text(): string {\n return this.getAttribute('text') ?? this._source ?? '';\n }\n\n mount(): void {\n if (this._source === null) this._source = (this.textContent || '').trim();\n this._out = document.createElement('span');\n this._out.setAttribute('aria-hidden', 'true');\n this._out.textContent = this.text;\n this.replaceChildren(srText(this.text), this._out);\n if (this.reduced) return;\n const trigger = this.str('trigger', 'view');\n if (trigger === 'load') this.play();\n else if (trigger === 'hover') {\n this.listen(this, 'pointerenter', () => this.play());\n this.listen(this, 'focusin', () => this.play());\n } else if (trigger === 'view') {\n let played = false;\n this.inView((v) => {\n if (v && !played) {\n played = true;\n this.play();\n }\n });\n }\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n }\n\n play(): Promise<void> {\n caf(this._frame);\n const out = this._out;\n const text = this.text;\n if (!out || this.reduced) {\n if (out) out.textContent = text;\n return Promise.resolve();\n }\n const duration = this.num('duration', 900);\n const glyphs = this.str('chars', GLYPHS) || GLYPHS;\n const t0 = now();\n let last = -1;\n return new Promise((resolve) => {\n const step = () => {\n const p = Math.min(1, Math.max(0, now() - t0) / duration);\n // ~30 fps glyph churn is plenty and halves DOM writes\n const bucket = Math.floor(p * duration / 33);\n if (bucket !== last || p === 1) {\n last = bucket;\n out.textContent = p === 1 ? text : scrambleFrame(text, p, glyphs);\n }\n if (p < 1) this._frame = raf(step);\n else {\n this._frame = 0;\n this.emit('complete');\n resolve();\n }\n };\n this._frame = raf(step);\n });\n }\n },\n undefined\n );\n}\n","import { defineElement, raf, caf, now, type UsaElement } from '../base';\nimport css from './counter.css?raw';\n\n/**\n * `<usa-counter>` — counts up (or down) to a number when it scrolls into view.\n *\n * Attributes: `to` (target, required), `from` (0), `duration` (ms, 1600),\n * `decimals` (0), `locale` (default: the document language), `prefix`,\n * `suffix`, `grouping=\"false\"` (no thousands separators), `start`\n * (`view` | `load` | `manual`). Setting the `value` property animates from\n * the current value — handy for live dashboards. Uses tabular digits so\n * the width does not jump. Event: `usa:complete`. Reduced motion: jumps.\n */\nexport interface UsaCounterElement extends UsaElement {\n /** Current target; setting it animates to the new number. */\n value: number;\n /** Animate to `to` (default: the `to` attribute). */\n play(to?: number): Promise<void>;\n format(n: number): string;\n}\n\n/** easeOutExpo */\nexport const easeOutExpo = (t: number): number => (t >= 1 ? 1 : 1 - Math.pow(2, -10 * t));\n\nexport function defineCounter(tag = 'usa-counter'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCounter extends Base {\n static get observedAttributes(): string[] {\n return ['to', 'decimals', 'locale', 'prefix', 'suffix', 'grouping'];\n }\n\n private _current = NaN;\n private _target = NaN;\n private _frame = 0;\n private _fmt: Intl.NumberFormat | null = null;\n\n get value(): number {\n return Number.isNaN(this._target) ? this.num('to', 0) : this._target;\n }\n set value(v: number) {\n this.play(Number(v));\n }\n\n format(n: number): string {\n if (!this._fmt) {\n const d = Math.max(0, Math.min(20, this.num('decimals', 0)));\n const locale = this.getAttribute('locale') || (typeof document !== 'undefined' && document.documentElement.lang) || undefined;\n try {\n this._fmt = new Intl.NumberFormat(locale, { minimumFractionDigits: d, maximumFractionDigits: d, useGrouping: this.getAttribute('grouping') !== 'false' });\n } catch {\n this._fmt = new Intl.NumberFormat(undefined, { minimumFractionDigits: d, maximumFractionDigits: d });\n }\n }\n return `${this.str('prefix')}${this._fmt.format(n)}${this.str('suffix')}`;\n }\n\n private render(n: number): void {\n this._current = n;\n this.textContent = this.format(n);\n }\n\n changed(name: string): void {\n this._fmt = null;\n if (name === 'to') this.play();\n else this.render(Number.isNaN(this._current) ? this.num('from', 0) : this._current);\n }\n\n mount(): void {\n this._fmt = null;\n const to = this.num('to', 0);\n if (this.reduced) {\n this._target = to;\n this.render(to);\n return;\n }\n if (Number.isNaN(this._current)) this.render(this.num('from', 0));\n const start = this.str('start', 'view');\n if (start === 'load') this.play();\n else if (start === 'view') {\n let done = false;\n this.inView((v) => {\n if (v && !done) {\n done = true;\n this.play();\n }\n }, { threshold: 0.4 });\n }\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n }\n\n play(to = this.num('to', 0)): Promise<void> {\n caf(this._frame);\n this._target = to;\n const from = Number.isNaN(this._current) ? this.num('from', 0) : this._current;\n if (this.reduced || from === to || !this.isConnected) {\n this.render(to);\n this.emit('complete', { value: to });\n return Promise.resolve();\n }\n const duration = this.num('duration', 1600);\n const t0 = now();\n return new Promise((resolve) => {\n const step = () => {\n const t = Math.min(1, Math.max(0, now() - t0) / duration);\n this.render(from + (to - from) * easeOutExpo(t));\n if (t < 1) this._frame = raf(step);\n else {\n this._frame = 0;\n this.render(to);\n this.emit('complete', { value: to });\n resolve();\n }\n };\n this._frame = raf(step);\n });\n }\n },\n { id: 'counter', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './shimmer-text.css?raw';\n\n/**\n * `<usa-shimmer-text>` — a light sweep across gradient-filled text (CSS\n * only; the element just maps attributes to custom properties).\n *\n * Attributes: `duration` (ms, 2600), `color` (base text colour), `shine`\n * (highlight colour), `angle` (deg, 110). Or style `--usa-shimmer-*`\n * directly. Reduced motion: static gradient text.\n */\nexport type UsaShimmerTextElement = UsaElement;\n\nexport function defineShimmerText(tag = 'usa-shimmer-text'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaShimmerText extends Base {\n static get observedAttributes(): string[] {\n return ['duration', 'color', 'shine', 'angle'];\n }\n\n mount(): void {\n const set = (attr: string, prop: string, unit = '') => {\n const v = this.getAttribute(attr);\n if (v !== null) this.style.setProperty(prop, v + unit);\n else this.style.removeProperty(prop);\n };\n set('duration', '--usa-shimmer-duration', 'ms');\n set('color', '--usa-shimmer-color');\n set('shine', '--usa-shimmer-shine');\n set('angle', '--usa-shimmer-angle', 'deg');\n }\n },\n { id: 'shimmer-text', text: css }\n );\n}\n","import { defineElement, srText, EASE_SPRING, EASE_OUT, type UsaElement } from '../base';\nimport css from './text-rotate.css?raw';\n\n/**\n * `<usa-text-rotate>` — cycles through words in place (\"Build *fast* /\n * *small* / *typed* apps\"). All words share one grid cell, so the width is\n * that of the longest word and nothing around it reflows.\n *\n * Attributes: `words` (separated by `|`, default: the element's text split\n * on `|`), `interval` (ms, 2200), `effect` (`slide` | `fade` | `flip` |\n * `blur`, default `slide`), `paused`. Pauses while off-screen and on hover\n * is not needed. Event: `usa:change` (`detail.index`, `detail.word`).\n * Reduced motion: words still change, without movement (fade only).\n */\nexport interface UsaTextRotateElement extends UsaElement {\n readonly index: number;\n next(): void;\n}\n\nexport function defineTextRotate(tag = 'usa-text-rotate'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaTextRotate extends Base {\n static get observedAttributes(): string[] {\n return ['words', 'interval', 'paused'];\n }\n\n private _source: string | null = null;\n private _index = 0;\n private _timer: ReturnType<typeof setInterval> | 0 = 0;\n private _visible = true;\n\n get index(): number {\n return this._index;\n }\n\n private get words(): string[] {\n return (this.getAttribute('words') ?? this._source ?? '').split('|').map((w) => w.trim()).filter(Boolean);\n }\n\n mount(): void {\n if (this._source === null) this._source = (this.textContent || '').trim();\n const words = this.words;\n this.replaceChildren(\n srText(words.join(', ')),\n ...words.map((w, i) => {\n const s = document.createElement('span');\n s.className = 'usa-rotate-word';\n s.textContent = w;\n s.setAttribute('aria-hidden', 'true');\n if (i !== this._index) s.setAttribute('data-hidden', '');\n return s;\n })\n );\n if (this._index >= words.length) this._index = 0;\n if (words.length < 2) return;\n this.inView((v) => (this._visible = v));\n if (!this.flag('paused')) {\n this._timer = setInterval(() => {\n if (this._visible && !(typeof document !== 'undefined' && document.hidden)) this.next();\n }, Math.max(400, this.num('interval', 2200)));\n }\n }\n\n unmount(): void {\n clearInterval(this._timer as ReturnType<typeof setInterval>);\n this._timer = 0;\n }\n\n next(): void {\n const els = Array.from(this.querySelectorAll<HTMLElement>('.usa-rotate-word'));\n if (els.length < 2) return;\n const prev = els[this._index];\n this._index = (this._index + 1) % els.length;\n const cur = els[this._index];\n prev.setAttribute('data-hidden', '');\n cur.removeAttribute('data-hidden');\n const effect = this.reduced ? 'fade' : this.str('effect', 'slide');\n const [inFrom, outTo] =\n effect === 'fade'\n ? [{ opacity: 0 }, { opacity: 0 }]\n : effect === 'flip'\n ? [{ opacity: 0, transform: 'perspective(400px) rotateX(-90deg)' }, { opacity: 0, transform: 'perspective(400px) rotateX(90deg)' }]\n : effect === 'blur'\n ? [{ opacity: 0, filter: 'blur(8px)' }, { opacity: 0, filter: 'blur(8px)' }]\n : [{ opacity: 0, transform: 'translateY(0.8em)' }, { opacity: 0, transform: 'translateY(-0.8em)' }];\n const neutral = { opacity: 1, transform: 'none', filter: 'none' };\n const pick = (f: Keyframe) => Object.fromEntries(Object.keys(f).map((k) => [k, (neutral as any)[k]]));\n this.motion(prev, [{ ...pick(outTo) }, outTo], { duration: 380, easing: EASE_OUT });\n this.motion(cur, [inFrom, pick(inFrom)], { duration: 520, easing: effect === 'slide' ? EASE_SPRING : EASE_OUT });\n this.emit('change', { index: this._index, word: cur.textContent });\n }\n },\n { id: 'text-rotate', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/text — text effects.\n * `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>`,\n * `<usa-shimmer-text>`, `<usa-text-rotate>`.\n */\nimport { defineTypewriter, type UsaTypewriterElement } from './typewriter';\nimport { defineSplitText, type UsaSplitTextElement } from './split-text';\nimport { defineScramble, type UsaScrambleElement } from './scramble';\nimport { defineCounter, type UsaCounterElement } from './counter';\nimport { defineShimmerText, type UsaShimmerTextElement } from './shimmer-text';\nimport { defineTextRotate, type UsaTextRotateElement } from './text-rotate';\n\nexport { defineTypewriter, defineSplitText, defineScramble, defineCounter, defineShimmerText, defineTextRotate };\nexport { scrambleFrame } from './scramble';\nexport { easeOutExpo } from './counter';\nexport type { UsaTypewriterElement, UsaSplitTextElement, UsaScrambleElement, UsaCounterElement, UsaShimmerTextElement, UsaTextRotateElement };\nexport { configureComponents, prefersReducedMotion } from '../base';\nexport type { ComponentsConfig, UsaElement } from '../base';\n\n/** Register every component of this category under its default tag. */\nexport function defineTextComponents(): void {\n defineTypewriter();\n defineSplitText();\n defineScramble();\n defineCounter();\n defineShimmerText();\n defineTextRotate();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-typewriter': UsaTypewriterElement;\n 'usa-split-text': UsaSplitTextElement;\n 'usa-scramble': UsaScrambleElement;\n 'usa-counter': UsaCounterElement;\n 'usa-shimmer-text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QACpE;KACD,EACH,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,EAAE,CACjC;AACH;;AChGA;;;;AAIG;AAeH;SACgB,oBAAoB,GAAA;AAClC,IAAA,gBAAgB,EAAE;AAClB,IAAA,eAAe,EAAE;AACjB,IAAA,cAAc,EAAE;AAChB,IAAA,aAAa,EAAE;AACf,IAAA,iBAAiB,EAAE;AACnB,IAAA,gBAAgB,EAAE;AACpB;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ /* use-scroll-animate/components/text */
2
+ .usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
3
+ usa-counter{font-variant-numeric:tabular-nums}
4
+ usa-shimmer-text{--usa-shimmer-color:currentColor;--usa-shimmer-shine:#fff;background:linear-gradient(var(--usa-shimmer-angle,110deg),var(--usa-shimmer-color) 35%,var(--usa-shimmer-shine) 50%,var(--usa-shimmer-color) 65%) 0 0 / 250% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:usa-shimmer var(--usa-shimmer-duration,2600ms) linear infinite}@keyframes usa-shimmer{from{background-position:100% 0}to{background-position:-150% 0}}
5
+ usa-split-text .usa-split-word{display:inline-block;white-space:nowrap}usa-split-text .usa-split-unit{display:inline-block;white-space:pre}usa-split-text[data-state="hidden"] .usa-split-unit{opacity:0}usa-split-text[data-state="play"] .usa-split-unit{animation:usa-split-rise var(--usa-split-duration,620ms) cubic-bezier(0.22,1,0.36,1) both;animation-delay:calc(var(--usa-split-delay,0ms) + var(--i,0) * var(--usa-split-stagger,28ms))}usa-split-text[effect="fade"][data-state="play"] .usa-split-unit{animation-name:usa-split-fade}usa-split-text[effect="blur"][data-state="play"] .usa-split-unit{animation-name:usa-split-blur}usa-split-text[effect="flip"][data-state="play"] .usa-split-unit{animation-name:usa-split-flip;transform-origin:50% 100%}usa-split-text[effect="pop"][data-state="play"] .usa-split-unit{animation-name:usa-split-pop;animation-timing-function:cubic-bezier(0.34,1.56,0.64,1)}@keyframes usa-split-rise{from{opacity:0;transform:translate3d(0,0.6em,0)}to{opacity:1;transform:none}}@keyframes usa-split-fade{from{opacity:0}to{opacity:1}}@keyframes usa-split-blur{from{opacity:0;filter:blur(8px)}to{opacity:1;filter:none}}@keyframes usa-split-flip{from{opacity:0;transform:perspective(500px) rotateX(-80deg)}to{opacity:1;transform:none}}@keyframes usa-split-pop{from{opacity:0;transform:scale(0.3)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){usa-split-text .usa-split-unit{animation:none !important;opacity:1 !important}}
6
+ usa-text-rotate{display:inline-grid;vertical-align:bottom;overflow:hidden;padding-block:0.08em}usa-text-rotate .usa-rotate-word{grid-area:1 / 1;white-space:nowrap}usa-text-rotate .usa-rotate-word[data-hidden]{opacity:0}
7
+ 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}}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * use-scroll-animate/components — shared base for the `<usa-*>` custom elements.
3
+ *
4
+ * Everything here is lazy: nothing touches `window`, `document`,
5
+ * `HTMLElement` or `matchMedia` at import time, so the components can be
6
+ * imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
7
+ * scripts. Classes are created the first time a `define*()` function runs.
8
+ */
9
+ interface ComponentsConfig {
10
+ /**
11
+ * Inject each component's CSS when it is defined (default `true`). Uses a
12
+ * constructable stylesheet (`document.adoptedStyleSheets`, which a strict
13
+ * `style-src` CSP does not block) and falls back to a `<style>` tag. Set
14
+ * to `false` when you load `use-scroll-animate/components.css` yourself.
15
+ */
16
+ injectStyles?: boolean;
17
+ /**
18
+ * `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always
19
+ * uses the reduced variants (e.g. a kiosk / battery-saver mode);
20
+ * `'no-preference'` ignores the OS setting (only for demos — respect your users).
21
+ */
22
+ reducedMotion?: 'user' | 'reduce' | 'no-preference';
23
+ }
24
+ /** Change global component settings (call before `define*()` for `injectStyles`). */
25
+ declare function configureComponents(options: ComponentsConfig): void;
26
+ /** `true` when animations should be reduced (OS setting or `configureComponents`). */
27
+ declare function prefersReducedMotion(): boolean;
28
+ /**
29
+ * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
30
+ * bag that is emptied on disconnect, and motion helpers that degrade to the
31
+ * final state without WAAPI or under reduced motion.
32
+ */
33
+ interface UsaElement extends HTMLElement {
34
+ /** `true` while reduced motion applies to this element. */
35
+ readonly reduced: boolean;
36
+ }
37
+
38
+ /**
39
+ * `<usa-typewriter>` — types text character by character, optionally cycling
40
+ * through several phrases (typing, pausing, deleting).
41
+ *
42
+ * Attributes: `text` (default: the element's text), `words` (phrases
43
+ * separated by `|`, overrides `text`), `speed` (ms per character, 55),
44
+ * `delete-speed` (ms, 30), `pause` (ms before deleting, 1400), `delay`
45
+ * (ms, 0), `loop`, `cursor="false"` to hide the caret, `start`
46
+ * (`view` | `load` | `manual`, default `view`). The full text is exposed to
47
+ * assistive tech via `aria-label`. Event: `usa:complete` (one pass done).
48
+ * Reduced motion: the text appears at once.
49
+ */
50
+ interface UsaTypewriterElement extends UsaElement {
51
+ /** Phrases being typed. */
52
+ readonly phrases: string[];
53
+ start(): void;
54
+ stop(): void;
55
+ restart(): void;
56
+ }
57
+ declare function defineTypewriter(tag?: string): CustomElementConstructor | undefined;
58
+
59
+ /**
60
+ * `<usa-split-text>` — splits its text into words or characters and reveals
61
+ * them in a cascade (pure CSS animation per unit, transform / opacity /
62
+ * filter only). Words never break across lines.
63
+ *
64
+ * Attributes: `by` (`chars` | `words`, default `chars`), `effect`
65
+ * (`rise` | `fade` | `blur` | `flip` | `pop`, default `rise`), `stagger`
66
+ * (ms between units, 28 for chars / 70 for words), `duration` (ms, 620),
67
+ * `delay` (ms, 0), `trigger` (`view` | `load` | `manual`, default `view`),
68
+ * `repeat`. The original text stays readable via `aria-label`.
69
+ * Event: `usa:complete`.
70
+ */
71
+ interface UsaSplitTextElement extends UsaElement {
72
+ readonly units: HTMLElement[];
73
+ play(): void;
74
+ reset(): void;
75
+ }
76
+ declare function defineSplitText(tag?: string): CustomElementConstructor | undefined;
77
+
78
+ /**
79
+ * `<usa-scramble>` — "decodes" text out of random glyphs, left to right.
80
+ *
81
+ * Attributes: `text` (default: the element's text), `duration` (ms, 900),
82
+ * `chars` (glyph set), `trigger` (`view` | `hover` | `load` | `manual`,
83
+ * default `view`). Spaces and punctuation stay in place. Uses a monospace-
84
+ * friendly fixed width per glyph only if you style it so; the element sets
85
+ * nothing that causes reflow beyond its own text. Event: `usa:complete`.
86
+ * Reduced motion: shows the final text.
87
+ */
88
+ interface UsaScrambleElement extends UsaElement {
89
+ play(): Promise<void>;
90
+ }
91
+ /** One frame of the scramble: the first `progress` share is resolved. */
92
+ declare function scrambleFrame(text: string, progress: number, glyphs?: string, rnd?: () => number): string;
93
+ declare function defineScramble(tag?: string): CustomElementConstructor | undefined;
94
+
95
+ /**
96
+ * `<usa-counter>` — counts up (or down) to a number when it scrolls into view.
97
+ *
98
+ * Attributes: `to` (target, required), `from` (0), `duration` (ms, 1600),
99
+ * `decimals` (0), `locale` (default: the document language), `prefix`,
100
+ * `suffix`, `grouping="false"` (no thousands separators), `start`
101
+ * (`view` | `load` | `manual`). Setting the `value` property animates from
102
+ * the current value — handy for live dashboards. Uses tabular digits so
103
+ * the width does not jump. Event: `usa:complete`. Reduced motion: jumps.
104
+ */
105
+ interface UsaCounterElement extends UsaElement {
106
+ /** Current target; setting it animates to the new number. */
107
+ value: number;
108
+ /** Animate to `to` (default: the `to` attribute). */
109
+ play(to?: number): Promise<void>;
110
+ format(n: number): string;
111
+ }
112
+ /** easeOutExpo */
113
+ declare const easeOutExpo: (t: number) => number;
114
+ declare function defineCounter(tag?: string): CustomElementConstructor | undefined;
115
+
116
+ /**
117
+ * `<usa-shimmer-text>` — a light sweep across gradient-filled text (CSS
118
+ * only; the element just maps attributes to custom properties).
119
+ *
120
+ * Attributes: `duration` (ms, 2600), `color` (base text colour), `shine`
121
+ * (highlight colour), `angle` (deg, 110). Or style `--usa-shimmer-*`
122
+ * directly. Reduced motion: static gradient text.
123
+ */
124
+ type UsaShimmerTextElement = UsaElement;
125
+ declare function defineShimmerText(tag?: string): CustomElementConstructor | undefined;
126
+
127
+ /**
128
+ * `<usa-text-rotate>` — cycles through words in place ("Build *fast* /
129
+ * *small* / *typed* apps"). All words share one grid cell, so the width is
130
+ * that of the longest word and nothing around it reflows.
131
+ *
132
+ * Attributes: `words` (separated by `|`, default: the element's text split
133
+ * on `|`), `interval` (ms, 2200), `effect` (`slide` | `fade` | `flip` |
134
+ * `blur`, default `slide`), `paused`. Pauses while off-screen and on hover
135
+ * is not needed. Event: `usa:change` (`detail.index`, `detail.word`).
136
+ * Reduced motion: words still change, without movement (fade only).
137
+ */
138
+ interface UsaTextRotateElement extends UsaElement {
139
+ readonly index: number;
140
+ next(): void;
141
+ }
142
+ declare function defineTextRotate(tag?: string): CustomElementConstructor | undefined;
143
+
144
+ /**
145
+ * use-scroll-animate/components/text — text effects.
146
+ * `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>`,
147
+ * `<usa-shimmer-text>`, `<usa-text-rotate>`.
148
+ */
149
+
150
+ /** Register every component of this category under its default tag. */
151
+ declare function defineTextComponents(): void;
152
+ declare global {
153
+ interface HTMLElementTagNameMap {
154
+ 'usa-typewriter': UsaTypewriterElement;
155
+ 'usa-split-text': UsaSplitTextElement;
156
+ 'usa-scramble': UsaScrambleElement;
157
+ 'usa-counter': UsaCounterElement;
158
+ 'usa-shimmer-text': UsaShimmerTextElement;
159
+ 'usa-text-rotate': UsaTextRotateElement;
160
+ }
161
+ }
162
+
163
+ export { configureComponents, defineCounter, defineScramble, defineShimmerText, defineSplitText, defineTextComponents, defineTextRotate, defineTypewriter, easeOutExpo, prefersReducedMotion, scrambleFrame };
164
+ export type { ComponentsConfig, UsaCounterElement, UsaElement, UsaScrambleElement, UsaShimmerTextElement, UsaSplitTextElement, UsaTextRotateElement, UsaTypewriterElement };
@@ -0,0 +1,164 @@
1
+ /**
2
+ * use-scroll-animate/components — shared base for the `<usa-*>` custom elements.
3
+ *
4
+ * Everything here is lazy: nothing touches `window`, `document`,
5
+ * `HTMLElement` or `matchMedia` at import time, so the components can be
6
+ * imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
7
+ * scripts. Classes are created the first time a `define*()` function runs.
8
+ */
9
+ interface ComponentsConfig {
10
+ /**
11
+ * Inject each component's CSS when it is defined (default `true`). Uses a
12
+ * constructable stylesheet (`document.adoptedStyleSheets`, which a strict
13
+ * `style-src` CSP does not block) and falls back to a `<style>` tag. Set
14
+ * to `false` when you load `use-scroll-animate/components.css` yourself.
15
+ */
16
+ injectStyles?: boolean;
17
+ /**
18
+ * `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always
19
+ * uses the reduced variants (e.g. a kiosk / battery-saver mode);
20
+ * `'no-preference'` ignores the OS setting (only for demos — respect your users).
21
+ */
22
+ reducedMotion?: 'user' | 'reduce' | 'no-preference';
23
+ }
24
+ /** Change global component settings (call before `define*()` for `injectStyles`). */
25
+ declare function configureComponents(options: ComponentsConfig): void;
26
+ /** `true` when animations should be reduced (OS setting or `configureComponents`). */
27
+ declare function prefersReducedMotion(): boolean;
28
+ /**
29
+ * Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
30
+ * bag that is emptied on disconnect, and motion helpers that degrade to the
31
+ * final state without WAAPI or under reduced motion.
32
+ */
33
+ interface UsaElement extends HTMLElement {
34
+ /** `true` while reduced motion applies to this element. */
35
+ readonly reduced: boolean;
36
+ }
37
+
38
+ /**
39
+ * `<usa-typewriter>` — types text character by character, optionally cycling
40
+ * through several phrases (typing, pausing, deleting).
41
+ *
42
+ * Attributes: `text` (default: the element's text), `words` (phrases
43
+ * separated by `|`, overrides `text`), `speed` (ms per character, 55),
44
+ * `delete-speed` (ms, 30), `pause` (ms before deleting, 1400), `delay`
45
+ * (ms, 0), `loop`, `cursor="false"` to hide the caret, `start`
46
+ * (`view` | `load` | `manual`, default `view`). The full text is exposed to
47
+ * assistive tech via `aria-label`. Event: `usa:complete` (one pass done).
48
+ * Reduced motion: the text appears at once.
49
+ */
50
+ interface UsaTypewriterElement extends UsaElement {
51
+ /** Phrases being typed. */
52
+ readonly phrases: string[];
53
+ start(): void;
54
+ stop(): void;
55
+ restart(): void;
56
+ }
57
+ declare function defineTypewriter(tag?: string): CustomElementConstructor | undefined;
58
+
59
+ /**
60
+ * `<usa-split-text>` — splits its text into words or characters and reveals
61
+ * them in a cascade (pure CSS animation per unit, transform / opacity /
62
+ * filter only). Words never break across lines.
63
+ *
64
+ * Attributes: `by` (`chars` | `words`, default `chars`), `effect`
65
+ * (`rise` | `fade` | `blur` | `flip` | `pop`, default `rise`), `stagger`
66
+ * (ms between units, 28 for chars / 70 for words), `duration` (ms, 620),
67
+ * `delay` (ms, 0), `trigger` (`view` | `load` | `manual`, default `view`),
68
+ * `repeat`. The original text stays readable via `aria-label`.
69
+ * Event: `usa:complete`.
70
+ */
71
+ interface UsaSplitTextElement extends UsaElement {
72
+ readonly units: HTMLElement[];
73
+ play(): void;
74
+ reset(): void;
75
+ }
76
+ declare function defineSplitText(tag?: string): CustomElementConstructor | undefined;
77
+
78
+ /**
79
+ * `<usa-scramble>` — "decodes" text out of random glyphs, left to right.
80
+ *
81
+ * Attributes: `text` (default: the element's text), `duration` (ms, 900),
82
+ * `chars` (glyph set), `trigger` (`view` | `hover` | `load` | `manual`,
83
+ * default `view`). Spaces and punctuation stay in place. Uses a monospace-
84
+ * friendly fixed width per glyph only if you style it so; the element sets
85
+ * nothing that causes reflow beyond its own text. Event: `usa:complete`.
86
+ * Reduced motion: shows the final text.
87
+ */
88
+ interface UsaScrambleElement extends UsaElement {
89
+ play(): Promise<void>;
90
+ }
91
+ /** One frame of the scramble: the first `progress` share is resolved. */
92
+ declare function scrambleFrame(text: string, progress: number, glyphs?: string, rnd?: () => number): string;
93
+ declare function defineScramble(tag?: string): CustomElementConstructor | undefined;
94
+
95
+ /**
96
+ * `<usa-counter>` — counts up (or down) to a number when it scrolls into view.
97
+ *
98
+ * Attributes: `to` (target, required), `from` (0), `duration` (ms, 1600),
99
+ * `decimals` (0), `locale` (default: the document language), `prefix`,
100
+ * `suffix`, `grouping="false"` (no thousands separators), `start`
101
+ * (`view` | `load` | `manual`). Setting the `value` property animates from
102
+ * the current value — handy for live dashboards. Uses tabular digits so
103
+ * the width does not jump. Event: `usa:complete`. Reduced motion: jumps.
104
+ */
105
+ interface UsaCounterElement extends UsaElement {
106
+ /** Current target; setting it animates to the new number. */
107
+ value: number;
108
+ /** Animate to `to` (default: the `to` attribute). */
109
+ play(to?: number): Promise<void>;
110
+ format(n: number): string;
111
+ }
112
+ /** easeOutExpo */
113
+ declare const easeOutExpo: (t: number) => number;
114
+ declare function defineCounter(tag?: string): CustomElementConstructor | undefined;
115
+
116
+ /**
117
+ * `<usa-shimmer-text>` — a light sweep across gradient-filled text (CSS
118
+ * only; the element just maps attributes to custom properties).
119
+ *
120
+ * Attributes: `duration` (ms, 2600), `color` (base text colour), `shine`
121
+ * (highlight colour), `angle` (deg, 110). Or style `--usa-shimmer-*`
122
+ * directly. Reduced motion: static gradient text.
123
+ */
124
+ type UsaShimmerTextElement = UsaElement;
125
+ declare function defineShimmerText(tag?: string): CustomElementConstructor | undefined;
126
+
127
+ /**
128
+ * `<usa-text-rotate>` — cycles through words in place ("Build *fast* /
129
+ * *small* / *typed* apps"). All words share one grid cell, so the width is
130
+ * that of the longest word and nothing around it reflows.
131
+ *
132
+ * Attributes: `words` (separated by `|`, default: the element's text split
133
+ * on `|`), `interval` (ms, 2200), `effect` (`slide` | `fade` | `flip` |
134
+ * `blur`, default `slide`), `paused`. Pauses while off-screen and on hover
135
+ * is not needed. Event: `usa:change` (`detail.index`, `detail.word`).
136
+ * Reduced motion: words still change, without movement (fade only).
137
+ */
138
+ interface UsaTextRotateElement extends UsaElement {
139
+ readonly index: number;
140
+ next(): void;
141
+ }
142
+ declare function defineTextRotate(tag?: string): CustomElementConstructor | undefined;
143
+
144
+ /**
145
+ * use-scroll-animate/components/text — text effects.
146
+ * `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>`,
147
+ * `<usa-shimmer-text>`, `<usa-text-rotate>`.
148
+ */
149
+
150
+ /** Register every component of this category under its default tag. */
151
+ declare function defineTextComponents(): void;
152
+ declare global {
153
+ interface HTMLElementTagNameMap {
154
+ 'usa-typewriter': UsaTypewriterElement;
155
+ 'usa-split-text': UsaSplitTextElement;
156
+ 'usa-scramble': UsaScrambleElement;
157
+ 'usa-counter': UsaCounterElement;
158
+ 'usa-shimmer-text': UsaShimmerTextElement;
159
+ 'usa-text-rotate': UsaTextRotateElement;
160
+ }
161
+ }
162
+
163
+ export { configureComponents, defineCounter, defineScramble, defineShimmerText, defineSplitText, defineTextComponents, defineTextRotate, defineTypewriter, easeOutExpo, prefersReducedMotion, scrambleFrame };
164
+ export type { ComponentsConfig, UsaCounterElement, UsaElement, UsaScrambleElement, UsaShimmerTextElement, UsaSplitTextElement, UsaTextRotateElement, UsaTypewriterElement };