use-scroll-animate 2.4.0 → 2.5.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"click.cjs","sources":["../../src/components/click/fx.ts","../../src/components/click/click.ts","../../src/components/click/button.ts","../../src/components/click/icon-morph.ts","../../src/components/click/like.ts","../../src/components/click/hold.ts","../../src/components/click/double-tap.ts","../../src/components/click/checkbox.ts","../../src/components/click/index.ts"],"sourcesContent":["import { prefersReducedMotion, applyFrame } from '../base';\n\n/**\n * Click-effect helpers (v2.5): `burst()`, `confetti()`, `shake()`, `haptic()`.\n * Particles live in one fixed, pointer-transparent layer and are removed when\n * their animation ends. Under reduced motion particles are skipped and\n * `shake()` only flashes an outline.\n */\n\nlet layer: HTMLElement | null = null;\nfunction fxLayer(): HTMLElement {\n if (layer && layer.isConnected) return layer;\n layer = document.createElement('div');\n layer.className = 'usa-fx-layer';\n layer.setAttribute('aria-hidden', 'true');\n layer.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483000;overflow:hidden;contain:strict';\n document.body.appendChild(layer);\n return layer;\n}\n\nexport interface BurstOptions {\n /** Number of particles (default 12). */\n count?: number;\n /** Colours to pick from (default: accent palette). */\n colors?: string[];\n /** Travel distance in px (default 48). */\n distance?: number;\n /** Particle size in px (default 6). */\n size?: number;\n /** `circle` (default), `square`, `star`, `heart` or any text / emoji. */\n shape?: 'circle' | 'square' | 'star' | 'heart' | string;\n /** Duration in ms (default 600). */\n duration?: number;\n}\n\nconst PALETTE = ['#7c5cff', '#22d3ee', '#f472b6', '#facc15', '#34d399', '#fb923c'];\nconst GLYPH: Record<string, string> = { star: '★', heart: '♥' };\n\nfunction particle(x: number, y: number, size: number, color: string, shape: string): HTMLElement {\n const p = document.createElement('span');\n const glyph = GLYPH[shape] || (shape !== 'circle' && shape !== 'square' ? shape : '');\n p.style.cssText = `position:absolute;left:${x}px;top:${y}px;width:${size}px;height:${size}px;margin:${-size / 2}px 0 0 ${-size / 2}px;will-change:transform,opacity;` +\n (glyph ? `font-size:${size * 2}px;line-height:${size}px;text-align:center;color:${color}` : `background:${color};border-radius:${shape === 'square' ? '2px' : '50%'}`);\n if (glyph) p.textContent = glyph;\n fxLayer().appendChild(p);\n return p;\n}\n\nconst done = (a: Animation | null, el: Element) => {\n if (a) a.onfinish = () => el.remove();\n else el.remove();\n};\n\n/** Particles radiating from client point (x, y). Returns the number spawned. */\nexport function burst(x: number, y: number, options: BurstOptions = {}): number {\n if (typeof document === 'undefined' || prefersReducedMotion()) return 0;\n const { count = 12, colors = PALETTE, distance = 48, size = 6, shape = 'circle', duration = 600 } = options;\n for (let i = 0; i < count; i++) {\n const angle = (i / count) * Math.PI * 2 + Math.random() * 0.4;\n const d = distance * (0.7 + Math.random() * 0.5);\n const p = particle(x, y, size, colors[i % colors.length], shape);\n const a = typeof p.animate === 'function'\n ? p.animate(\n [\n { transform: 'translate(0,0) scale(1)', opacity: 1 },\n { transform: `translate(${Math.cos(angle) * d}px, ${Math.sin(angle) * d}px) scale(0.2)`, opacity: 0 },\n ],\n { duration: duration * (0.8 + Math.random() * 0.4), easing: 'cubic-bezier(0.22, 1, 0.36, 1)', fill: 'forwards' }\n )\n : null;\n done(a, p);\n }\n return count;\n}\n\nexport interface ConfettiOptions {\n /** Origin in client px (default: centre-bottom third of the viewport). */\n x?: number;\n y?: number;\n /** Pieces (default 80). */\n count?: number;\n /** Spread angle in degrees (default 70). */\n spread?: number;\n /** Launch speed multiplier (default 1). */\n velocity?: number;\n colors?: string[];\n /** Duration in ms (default 1600). */\n duration?: number;\n}\n\n/** A confetti cannon (paper pieces with gravity, drift and spin). */\nexport function confetti(options: ConfettiOptions = {}): number {\n if (typeof document === 'undefined' || prefersReducedMotion()) return 0;\n const W = window.innerWidth || 800;\n const H = window.innerHeight || 600;\n const { x = W / 2, y = H * 0.66, count = 80, spread = 70, velocity = 1, colors = PALETTE, duration = 1600 } = options;\n for (let i = 0; i < count; i++) {\n const angle = ((-90 + (Math.random() - 0.5) * spread) * Math.PI) / 180;\n const speed = (260 + Math.random() * 320) * velocity;\n const vx = Math.cos(angle) * speed;\n const vy = Math.sin(angle) * speed;\n const p = particle(x, y, 6 + Math.random() * 5, colors[i % colors.length], Math.random() > 0.5 ? 'square' : 'circle');\n p.style.height = `${4 + Math.random() * 3}px`;\n const frames: Keyframe[] = [];\n const steps = 8;\n const T = duration / 1000;\n const spin = (Math.random() - 0.5) * 1440;\n for (let s = 0; s <= steps; s++) {\n const t = (s / steps) * T;\n const g = 900;\n frames.push({\n transform: `translate(${(vx * t * 0.8).toFixed(1)}px, ${(vy * t + 0.5 * g * t * t).toFixed(1)}px) rotate(${((spin * s) / steps).toFixed(0)}deg) rotateX(${s * 120}deg)`,\n opacity: s === steps ? 0 : 1,\n });\n }\n const a = typeof p.animate === 'function' ? p.animate(frames, { duration: duration * (0.85 + Math.random() * 0.3), easing: 'linear', fill: 'forwards' }) : null;\n done(a, p);\n }\n return count;\n}\n\n/** Horizontal error shake (`intensity` px, default 8). Reduced motion: a red outline flash. */\nexport function shake(el: Element, intensity = 8, duration = 480): Animation | null {\n const t = el as HTMLElement;\n if (typeof t.animate !== 'function') return null;\n if (prefersReducedMotion()) return t.animate([{ outline: '2px solid #e5484d' }, { outline: '2px solid transparent' }], { duration: 600 });\n const k = intensity;\n return t.animate(\n [0, -k, k, -k * 0.75, k * 0.75, -k * 0.4, k * 0.4, 0].map((v) => ({ transform: `translateX(${v}px)` })),\n { duration, easing: 'ease-in-out' }\n );\n}\n\n/** `navigator.vibrate()` where supported (Android Chrome, some WebViews). Returns whether it ran. */\nexport function haptic(pattern: number | number[] = 10): boolean {\n try {\n return typeof navigator !== 'undefined' && typeof navigator.vibrate === 'function' ? navigator.vibrate(pattern) : false;\n } catch {\n return false;\n }\n}\n\nexport { applyFrame };\n","import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport { burst, confetti, shake, haptic } from './fx';\nimport css from './click.css?raw';\n\nexport const CLICK_EFFECTS = ['ripple', 'burst', 'confetti', 'squish', 'press-spring', 'shake'] as const;\nexport type ClickEffect = (typeof CLICK_EFFECTS)[number];\n\n/**\n * `<usa-click>` — click / tap effects on whatever it wraps (combinable:\n * `effect=\"press-spring burst\"`).\n *\n * - `ripple` — an ink wave from the pointer (enhanced: `color`, soft edge);\n * - `burst` — particles radiating from the pointer (`shape`: circle, square, star, heart, emoji);\n * - `confetti` — a confetti cannon from the click point;\n * - `squish` — squash on press, stretch on release (spring);\n * - `press-spring` — dips while pressed, springs back with overshoot;\n * - `shake` — horizontal error shake; plays on `invalid` events from a form\n * inside, on `shake()`, or on click when `trigger=\"click\"`.\n *\n * Attributes: `effect`, `color`, `shape`, `count`, `haptic` (vibrate ms,\n * where supported), `disabled`. Keyboard (Space/Enter) triggers the effects\n * from the centre. Reduced motion: no particles or movement; press dims.\n */\nexport interface UsaClickElement extends UsaElement {\n readonly effects: string[];\n play(x?: number, y?: number): void;\n shake(): void;\n}\n\nexport function defineClick(tag = 'usa-click'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaClick extends Base {\n static get observedAttributes(): string[] {\n return ['effect', 'disabled'];\n }\n\n private _press: Animation | null = null;\n\n get effects(): string[] {\n return this.str('effect', 'ripple').split(/[\\s,]+/).filter(Boolean);\n }\n\n mount(): void {\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (this.flag('disabled') || (e.pointerType === 'mouse' && e.button !== 0)) return;\n this.down();\n if (this.effects.includes('ripple')) this.ripple(e.clientX, e.clientY);\n });\n const up = () => this.up();\n this.listen(this, 'pointerup', up);\n this.listen(this, 'pointerleave', up);\n this.listen(this, 'pointercancel', up);\n this.listen(this, 'click', (e: MouseEvent) => {\n if (this.flag('disabled')) return;\n const kb = e.detail === 0;\n const r = this.getBoundingClientRect();\n const x = kb ? r.left + r.width / 2 : e.clientX;\n const y = kb ? r.top + r.height / 2 : e.clientY;\n if (kb && this.effects.includes('ripple')) this.ripple(x, y);\n this.play(x, y);\n if (this.effects.includes('shake') && this.str('trigger') === 'click') this.shake();\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) this.down();\n });\n this.listen(this, 'keyup', up);\n if (this.effects.includes('shake')) this.listen(this, 'invalid', () => this.shake(), { capture: true });\n }\n\n /** Particles + haptics at client (x, y) (default: centre). */\n play(x?: number, y?: number): void {\n if (x === undefined || y === undefined) {\n const r = this.getBoundingClientRect();\n x = r.left + r.width / 2;\n y = r.top + r.height / 2;\n }\n const fx = this.effects;\n const colors = this.str('color') ? this.str('color').split(',') : undefined;\n if (fx.includes('burst')) burst(x, y, { count: this.num('count', 12), shape: this.str('shape', 'circle'), colors });\n if (fx.includes('confetti')) confetti({ x, y, count: this.num('count', 60), colors, spread: 90, velocity: 0.8 });\n if (this.hasAttribute('haptic')) haptic(this.num('haptic', 10));\n this.emit('click-effect', { x, y, effects: fx });\n }\n\n shake(): void {\n shake(this);\n if (this.hasAttribute('haptic')) haptic([30, 40, 30]);\n }\n\n private ripple(x: number, y: number): void {\n if (this.reduced) return;\n const r = this.getBoundingClientRect();\n const cx = x - r.left;\n const cy = y - r.top;\n const radius = Math.hypot(Math.max(cx, r.width - cx), Math.max(cy, r.height - cy));\n const wave = document.createElement('span');\n wave.className = 'usa-click-wave';\n wave.setAttribute('aria-hidden', 'true');\n wave.style.cssText = `width:${radius * 2}px;height:${radius * 2}px;left:${cx - radius}px;top:${cy - radius}px;--usa-wave:${this.str('color', 'currentColor').split(',')[0]}`;\n this.append(wave);\n const a = this.motion(wave, [{ transform: 'scale(0)', opacity: 0.35 }, { transform: 'scale(1)', opacity: 0.25, offset: 0.6 }, { transform: 'scale(1.05)', opacity: 0 }], {\n duration: 650,\n easing: EASE_OUT,\n fill: 'forwards',\n });\n if (a) a.onfinish = () => wave.remove();\n else wave.remove();\n }\n\n private down(): void {\n if (this.hasAttribute('data-pressed')) return;\n const fx = this.effects;\n if (!fx.includes('squish') && !fx.includes('press-spring')) return;\n this.setAttribute('data-pressed', '');\n this._press?.cancel();\n const to = this.reduced ? { opacity: 0.75 } : fx.includes('squish') ? { transform: 'scale(1.08, 0.86)' } : { transform: 'scale(0.94)' };\n const from: Keyframe = this.reduced ? { opacity: 1 } : { transform: 'none' };\n this._press = this.motion(this, [from, to], {\n duration: 110,\n easing: 'ease-out',\n fill: 'forwards',\n });\n }\n\n private up(): void {\n if (!this.hasAttribute('data-pressed')) return;\n this.removeAttribute('data-pressed');\n const fx = this.effects;\n this._press?.cancel();\n if (this.reduced) {\n this._press = this.motion(this, [{ opacity: 0.75 }, { opacity: 1 }], { duration: 150 });\n return;\n }\n const from = fx.includes('squish') ? 'scale(1.08, 0.86)' : 'scale(0.94)';\n const frames: Keyframe[] = fx.includes('squish')\n ? [{ transform: from }, { transform: 'scale(0.92, 1.1)', offset: 0.3 }, { transform: 'scale(1.03, 0.97)', offset: 0.6 }, { transform: 'none' }]\n : [{ transform: from }, { transform: 'none' }];\n this._press = this.motion(this, frames, fx.includes('squish') ? { duration: 520, easing: 'ease-out' } : springEasing('bouncy'));\n }\n },\n { id: 'click', text: css }\n );\n}\n","import { defineElement, clamp, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport { shake, haptic } from './fx';\nimport css from './button.css?raw';\n\nexport const BUTTON_DEFORMS = ['squash', 'wobble', 'gooey', 'dent'] as const;\nexport type ButtonDeform = (typeof BUTTON_DEFORMS)[number];\nexport type ButtonShape = 'pill' | 'circle' | 'icon';\nexport type ButtonState = 'idle' | 'loading' | 'success' | 'error';\n\nlet gooInjected = false;\nfunction injectGoo(): void {\n if (gooInjected || typeof document === 'undefined') return;\n gooInjected = true;\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('aria-hidden', 'true');\n svg.setAttribute('width', '0');\n svg.setAttribute('height', '0');\n svg.style.position = 'absolute';\n svg.innerHTML = '<filter id=\"usa-goo\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"b\"/><feColorMatrix in=\"b\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9\" result=\"g\"/><feComposite in=\"SourceGraphic\" in2=\"g\" operator=\"atop\"/></filter>';\n document.body.appendChild(svg);\n}\n\n/**\n * `<usa-button>` — **button click deformation** (按钮点击形变) around a\n * native `<button>` (or `<a>`) child — or the element itself becomes a button.\n *\n * `deform` (combinable, e.g. `deform=\"squash wobble\"`):\n * - `squash` — squash on press, stretch-and-settle on release (spring);\n * - `wobble` — elastic border-radius wobble after a click;\n * - `gooey` — liquid blob: droplets squeeze out from the press point and\n * merge back (SVG goo filter);\n * - `dent` — the surface dents toward the pressed point (3D tilt + inner shade).\n *\n * `shape=\"pill | circle | icon\"` morphs the outline with a spring (label =\n * `[data-label]`, icon = `[data-icon]` children); `morphTo(shape)`.\n *\n * `morph=\"submit\"` — click → `loading` (shrinks to a circle with a spinner,\n * `aria-busy`), then `success` (check) or `error` (shake + cross), and back\n * to `idle` after `reset` ms (1800). Drive it with `state=\"…\"` / `.state`, or\n * call `event.detail.done(ok)` from a `usa:submit` listener.\n *\n * Attributes: `deform`, `shape`, `morph`, `state`, `reset`, `haptic`,\n * `disabled`. Events: `usa:submit`, `usa:state`. Reduced motion: no\n * deformation; shape and state changes are instant; status still announced.\n */\nexport interface UsaButtonElement extends UsaElement {\n readonly target: HTMLElement;\n shape: ButtonShape;\n state: ButtonState;\n morphTo(shape: ButtonShape): Promise<void>;\n}\n\nexport function defineButton(tag = 'usa-button'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaButton extends Base {\n static get observedAttributes(): string[] {\n return ['deform', 'state', 'shape', 'disabled'];\n }\n\n private _press: Animation | null = null;\n private _timer: ReturnType<typeof setTimeout> | undefined;\n private _status: HTMLElement | null = null;\n private _shapeBefore: ButtonShape | null = null;\n\n get target(): HTMLElement {\n return (this.querySelector(':scope > button, :scope > a, :scope > [role=\"button\"]') as HTMLElement) || this;\n }\n private deforms(): string[] {\n return this.str('deform').split(/[\\s,]+/).filter(Boolean);\n }\n get shape(): ButtonShape {\n return (this.str('shape', 'pill') as ButtonShape) || 'pill';\n }\n set shape(v: ButtonShape) {\n this.morphTo(v);\n }\n get state(): ButtonState {\n return (this.str('state', 'idle') as ButtonState) || 'idle';\n }\n set state(v: ButtonState) {\n this.setAttribute('state', v);\n }\n\n mount(): void {\n const t = this.target;\n if (t === this) {\n this.setAttribute('role', 'button');\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n }\n t.classList.add('usa-button-face');\n if (this.str('morph') === 'submit' && !t.querySelector('.usa-button-status')) {\n const s = document.createElement('span');\n s.className = 'usa-button-status';\n s.setAttribute('aria-hidden', 'true');\n s.innerHTML =\n '<svg class=\"usa-button-spin\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\" pathLength=\"100\"/></svg>' +\n '<svg class=\"usa-button-ok\" viewBox=\"0 0 24 24\"><path d=\"M5 12.5l4.2 4.2L19 7\" pathLength=\"1\"/></svg>' +\n '<svg class=\"usa-button-err\" viewBox=\"0 0 24 24\"><path d=\"M7 7l10 10M17 7L7 17\" pathLength=\"1\"/></svg>';\n t.append(s);\n const live = document.createElement('span');\n live.className = 'usa-sr';\n live.setAttribute('role', 'status');\n this.append(live);\n this._status = live;\n }\n if (this.deforms().includes('gooey')) injectGoo();\n this.applyState();\n this.listen(t, 'pointerdown', (e: PointerEvent) => {\n if (this.isOff() || (e.pointerType === 'mouse' && e.button !== 0)) return;\n this.down(e.clientX, e.clientY);\n });\n for (const ev of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(t, ev, () => this.up());\n this.listen(t, 'keydown', (e: KeyboardEvent) => (e.key === 'Enter' || e.key === ' ') && !e.repeat && this.down());\n this.listen(t, 'keyup', () => this.up());\n this.listen(t, 'click', (e: MouseEvent) => {\n if (this.isOff()) {\n if (this.state === 'loading') e.preventDefault();\n return;\n }\n if (this.deforms().includes('wobble')) this.wobble();\n if (this.hasAttribute('haptic')) haptic(this.num('haptic', 10));\n if (this.str('morph') === 'submit' && this.state === 'idle') this.submit();\n });\n if (t === this)\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) {\n e.preventDefault();\n this.click();\n }\n });\n }\n\n unmount(): void {\n clearTimeout(this._timer);\n this._press?.cancel();\n }\n\n changed(name: string): void {\n if (name === 'state') this.applyState();\n else if (name === 'shape') this.target.setAttribute('data-shape', this.shape);\n else {\n super.changed(name);\n }\n }\n\n private isOff(): boolean {\n return this.flag('disabled') || this.state === 'loading';\n }\n\n /* ------------------------------------------------ press deformations */\n private down(x?: number, y?: number): void {\n if (this.reduced || this.hasAttribute('data-pressed')) return;\n const d = this.deforms();\n if (!d.length) return;\n this.setAttribute('data-pressed', '');\n const t = this.target;\n const r = t.getBoundingClientRect();\n const px = x === undefined ? 0.5 : clamp((x - r.left) / (r.width || 1), 0, 1);\n const py = y === undefined ? 0.5 : clamp((y - r.top) / (r.height || 1), 0, 1);\n t.style.setProperty('--usa-dent-x', `${(px * 100).toFixed(1)}%`);\n t.style.setProperty('--usa-dent-y', `${(py * 100).toFixed(1)}%`);\n const parts: string[] = [];\n if (d.includes('dent')) parts.push(`perspective(600px) rotateX(${((0.5 - py) * -14).toFixed(2)}deg) rotateY(${((px - 0.5) * 14).toFixed(2)}deg) scale(0.97)`);\n if (d.includes('squash')) parts.push('scale(1.12, 0.84)');\n if (d.includes('gooey')) {\n parts.push('scale(0.96)');\n this.goo(px, py);\n }\n if (!parts.length) return;\n this._press?.cancel();\n this._press = this.motion(t, [{ transform: 'none' }, { transform: parts.join(' ') }], { duration: 110, easing: 'ease-out', fill: 'forwards' });\n }\n\n private up(): void {\n if (!this.hasAttribute('data-pressed')) return;\n this.removeAttribute('data-pressed');\n const t = this.target;\n const a = this._press;\n const from = (a?.effect as KeyframeEffect | null)?.getKeyframes?.().slice(-1)[0]?.transform as string | undefined;\n a?.cancel();\n if (!from) return;\n this._press = this.motion(t, [{ transform: from }, { transform: 'none' }], { ...springEasing(this.deforms().includes('squash') ? 'bouncy' : 'wobbly') });\n }\n\n private wobble(): void {\n if (this.reduced) return;\n const t = this.target;\n const r = getComputedStyle(t).borderRadius || '12px';\n this.motion(\n t,\n [\n { borderRadius: r },\n { borderRadius: '42% 58% 50% 50% / 60% 45% 55% 40%', offset: 0.2 },\n { borderRadius: '58% 42% 45% 55% / 40% 60% 40% 60%', offset: 0.45 },\n { borderRadius: '48% 52% 52% 48% / 52% 48% 52% 48%', offset: 0.7 },\n { borderRadius: r },\n ],\n { duration: 700, easing: 'ease-out' }\n );\n }\n\n private goo(px: number, py: number): void {\n const t = this.target;\n const layer = document.createElement('span');\n layer.className = 'usa-button-goo';\n layer.setAttribute('aria-hidden', 'true');\n layer.style.setProperty('--usa-goo-bg', getComputedStyle(t).backgroundColor || 'currentColor');\n const drops: HTMLElement[] = [];\n for (let i = 0; i < 4; i++) {\n const d = document.createElement('i');\n d.style.left = `${(px * 100).toFixed(1)}%`;\n d.style.top = `${(py * 100).toFixed(1)}%`;\n layer.append(d);\n drops.push(d);\n }\n this.prepend(layer);\n let left = drops.length;\n drops.forEach((d, i) => {\n const ang = (i / drops.length) * Math.PI * 2 + 0.6;\n const dist = 26 + (i % 2) * 12;\n const a = this.motion(\n d,\n [\n { transform: 'translate(-50%, -50%) scale(0.4)' },\n { transform: `translate(calc(-50% + ${(Math.cos(ang) * dist).toFixed(1)}px), calc(-50% + ${(Math.sin(ang) * dist).toFixed(1)}px)) scale(1)`, offset: 0.45 },\n { transform: 'translate(-50%, -50%) scale(0.2)' },\n ],\n { duration: 700, easing: 'cubic-bezier(0.34, 1.3, 0.64, 1)', fill: 'forwards' }\n );\n const end = () => --left === 0 && layer.remove();\n if (a) a.onfinish = end;\n else end();\n });\n }\n\n /* ------------------------------------------------ shape morph */\n async morphTo(shape: ButtonShape): Promise<void> {\n const t = this.target;\n const before = t.getBoundingClientRect();\n this.setAttribute('shape', shape);\n t.setAttribute('data-shape', shape);\n if (this.reduced) return;\n const after = t.getBoundingClientRect();\n if (!before.width || !after.width || Math.abs(before.width - after.width) < 0.5) return;\n const a = this.motion(t, [{ width: `${before.width}px` }, { width: `${after.width}px` }], springEasing('stiff'));\n await a?.finished.catch(() => undefined);\n }\n\n /* ------------------------------------------------ submit morph */\n private submit(): void {\n let settled = false;\n const done = (ok = true) => {\n if (settled) return;\n settled = true;\n this.state = ok ? 'success' : 'error';\n };\n this.state = 'loading';\n this.emit('submit', { done });\n }\n\n private applyState(): void {\n if (this.str('morph') !== 'submit') return;\n const t = this.target;\n const s = this.state;\n clearTimeout(this._timer);\n t.setAttribute('data-state', s);\n if (s === 'loading') {\n if (this._shapeBefore === null) this._shapeBefore = this.shape;\n t.setAttribute('aria-busy', 'true');\n this.morphTo('circle');\n } else {\n t.removeAttribute('aria-busy');\n }\n if (s === 'error') {\n shake(t);\n if (this.hasAttribute('haptic')) haptic([30, 40, 30]);\n }\n if (s === 'success' && !this.reduced) {\n const ok = t.querySelector('.usa-button-ok');\n if (ok) this.motion(ok, [{ transform: 'scale(0.4)' }, { transform: 'scale(1)' }], springEasing('bouncy'));\n }\n if (this._status) this._status.textContent = s === 'loading' ? 'Loading…' : s === 'success' ? 'Done' : s === 'error' ? 'Failed' : '';\n if (s === 'success' || s === 'error') {\n this._timer = setTimeout(() => {\n this.state = 'idle';\n }, this.num('reset', 1800));\n }\n if (s === 'idle' && this._shapeBefore !== null) {\n const back = this._shapeBefore;\n this._shapeBefore = null;\n this.morphTo(back);\n }\n this.emit('state', { state: s });\n }\n },\n { id: 'button', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport css from './icon-morph.css?raw';\n\ntype Pt = [number, number];\ntype Quad = [Pt, Pt, Pt, Pt];\nconst C: Quad = [[12, 12], [12, 12], [12, 12], [12, 12]];\n\n/**\n * Morphable icons: every icon is three quads (four points each) on a 24×24\n * grid, so any icon can morph into any other by interpolating points.\n */\nexport const MORPH_ICONS: Record<string, [Quad, Quad, Quad]> = {\n play: [[[7, 5], [12.5, 8.25], [12.5, 15.75], [7, 19]], [[12.5, 8.25], [19, 12], [19, 12], [12.5, 15.75]], C],\n pause: [[[6, 5], [10, 5], [10, 19], [6, 19]], [[14, 5], [18, 5], [18, 19], [14, 19]], C],\n menu: [[[4, 6], [20, 6], [20, 8], [4, 8]], [[4, 11], [20, 11], [20, 13], [4, 13]], [[4, 16], [20, 16], [20, 18], [4, 18]]],\n close: [[[5.2, 6.6], [6.6, 5.2], [18.8, 17.4], [17.4, 18.8]], C, [[17.4, 5.2], [18.8, 6.6], [6.6, 18.8], [5.2, 17.4]]],\n plus: [[[11, 4], [13, 4], [13, 20], [11, 20]], [[4, 11], [20, 11], [20, 13], [4, 13]], C],\n minus: [[[4, 11], [20, 11], [20, 13], [4, 13]], [[4, 11], [20, 11], [20, 13], [4, 13]], C],\n check: [[[4.3, 12.7], [5.7, 11.3], [10.4, 16], [9, 17.4]], [[9, 17.4], [7.6, 16], [18.3, 5.3], [19.7, 6.7]], C],\n 'arrow-right': [[[4, 11], [17, 11], [17, 13], [4, 13]], [[12.6, 6.4], [14, 5], [21, 12], [19.6, 13.4]], [[19.6, 10.6], [21, 12], [14, 19], [12.6, 17.6]]],\n};\n\n/** SVG path data for an icon, or for the interpolation `t` (0–1) between two. */\nexport function morphPath(from: string, to: string = from, t = 0): string {\n const a = MORPH_ICONS[from] || MORPH_ICONS.menu;\n const b = MORPH_ICONS[to] || a;\n return a\n .map((q, i) => {\n const pts = q.map((p, j) => {\n const r = b[i][j];\n return `${(p[0] + (r[0] - p[0]) * t).toFixed(2)} ${(p[1] + (r[1] - p[1]) * t).toFixed(2)}`;\n });\n return `M${pts.join('L')}Z`;\n })\n .join('');\n}\n\n/**\n * `<usa-icon-morph>` — an icon that morphs between shapes with a spring:\n * play ↔ pause, menu ↔ close, plus ↔ minus, check, arrow-right…\n *\n * Attributes: `icons` (comma list, cycled; default `play,pause`), `index`\n * (current, 0), `size` (px, 24), `toggle` (makes it a button that cycles\n * on click / Enter / Space), `labels` (comma list of accessible names per\n * icon, e.g. `Play,Pause`), `preset` (spring, `wobbly`). Methods:\n * `next()`, `show(nameOrIndex)`. Events: `usa:change` (`{ index, icon }`).\n * Inside a `<usa-button>` or `<button>` it is decorative. Reduced motion:\n * the icon switches instantly.\n */\nexport interface UsaIconMorphElement extends UsaElement {\n index: number;\n readonly icon: string;\n next(): void;\n show(icon: string | number): void;\n}\n\nexport function defineIconMorph(tag = 'usa-icon-morph'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaIconMorph extends Base {\n static get observedAttributes(): string[] {\n return ['icons', 'size', 'toggle'];\n }\n\n private _i = 0;\n private _from = 'play';\n private _to = 'play';\n private _t!: SpringValue;\n\n private list(): string[] {\n return this.str('icons', 'play,pause').split(',').map((s) => s.trim()).filter((s) => MORPH_ICONS[s]);\n }\n get index(): number {\n return this._i;\n }\n set index(v: number) {\n this.show(v);\n }\n get icon(): string {\n return this.list()[this._i] || 'play';\n }\n\n private draw(t: number): void {\n this.querySelector('path')?.setAttribute('d', morphPath(this._from, this._to, t));\n }\n\n mount(): void {\n const size = this.num('size', 24);\n this.innerHTML = `<svg viewBox=\"0 0 24 24\" width=\"${size}\" height=\"${size}\" aria-hidden=\"true\" focusable=\"false\"><path/></svg>`;\n this._i = Math.max(0, Math.min(this.list().length - 1, this.num('index', 0)));\n this._from = this._to = this.icon;\n this._t = createSpring({ value: 1, spring: this.str('preset', 'wobbly'), onUpdate: (v) => this.draw(v) });\n this.draw(1);\n if (this.flag('toggle')) {\n this.setAttribute('role', 'button');\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.listen(this, 'click', () => this.next());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) {\n e.preventDefault();\n this.next();\n }\n });\n }\n this.label();\n }\n\n unmount(): void {\n this._t?.stop();\n }\n\n private label(): void {\n const labels = this.str('labels').split(',').map((s) => s.trim());\n const l = labels[this._i];\n if (l) this.setAttribute('aria-label', l);\n if (!this.flag('toggle') && !l) this.setAttribute('aria-hidden', 'true');\n }\n\n show(icon: string | number): void {\n const list = this.list();\n const i = typeof icon === 'number' ? ((icon % list.length) + list.length) % list.length : list.indexOf(icon);\n if (i < 0 || !this._t) return;\n const name = list[i];\n // morph from wherever we are now (interruptible)\n const cur = this._t.value;\n this._from = cur >= 0.5 ? this._to : this._from;\n this._to = name;\n this._i = i;\n this._t.jump(0);\n this._t.set(1);\n this.label();\n this.emit('change', { index: i, icon: name });\n }\n\n next(): void {\n this.show(this._i + 1);\n }\n },\n { id: 'icon-morph', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport { burst, haptic } from './fx';\nimport css from './like.css?raw';\n\nconst HEART = 'M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 5.3 3.2 1.7-2 3.2-3.2 5.3-3.2 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z';\n\n/**\n * `<usa-like>` — a like / favourite toggle: the heart pops with a spring and\n * bursts into particles when liked. `role=\"button\"` + `aria-pressed`.\n *\n * Attributes: `liked`, `count` (shown next to the heart, updated ±1),\n * `label` (accessible name, default \"Like\"), `color`, `size` (px, 24),\n * `haptic`, `disabled`. Events: `change`, `usa:change` (`{ liked, count }`).\n * Reduced motion: colour change only.\n */\nexport interface UsaLikeElement extends UsaElement {\n liked: boolean;\n count: number | null;\n toggle(force?: boolean): void;\n}\n\nexport function defineLike(tag = 'usa-like'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaLike extends Base {\n static get observedAttributes(): string[] {\n return ['liked', 'count', 'label', 'disabled'];\n }\n\n get liked(): boolean {\n return this.flag('liked');\n }\n set liked(v: boolean) {\n this.setFlag('liked', v);\n }\n get count(): number | null {\n return this.hasAttribute('count') ? this.num('count', 0) : null;\n }\n set count(v: number | null) {\n if (v === null) this.removeAttribute('count');\n else this.setAttribute('count', String(v));\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-like-heart')) {\n const size = this.num('size', 24);\n this.insertAdjacentHTML('afterbegin', `<svg class=\"usa-like-heart\" viewBox=\"0 0 24 24\" width=\"${size}\" height=\"${size}\" aria-hidden=\"true\"><path d=\"${HEART}\"/></svg><span class=\"usa-like-count\" aria-hidden=\"true\"></span>`);\n }\n if (this.str('color')) this.style.setProperty('--usa-like-color', this.str('color'));\n this.setAttribute('role', 'button');\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !e.repeat) {\n e.preventDefault();\n this.toggle();\n }\n });\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n const c = this.count;\n const label = this.str('label', 'Like');\n this.setAttribute('aria-pressed', String(this.liked));\n this.setAttribute('aria-label', c === null ? label : `${label} (${c})`);\n this.toggleAttribute('aria-disabled', this.flag('disabled'));\n const out = this.querySelector('.usa-like-count');\n if (out) out.textContent = c === null ? '' : new Intl.NumberFormat().format(c);\n }\n\n toggle(force?: boolean): void {\n if (this.flag('disabled')) return;\n const next = force === undefined ? !this.liked : force;\n if (next === this.liked) return;\n this.liked = next;\n if (this.count !== null) this.count = Math.max(0, this.count + (next ? 1 : -1));\n this.sync();\n const heart = this.querySelector('.usa-like-heart');\n if (next && heart && !this.reduced) {\n this.motion(heart, [{ transform: 'scale(0.4)' }, { transform: 'scale(1)' }], springEasing('bouncy'));\n const r = heart.getBoundingClientRect();\n burst(r.left + r.width / 2, r.top + r.height / 2, { count: 10, distance: 28, size: 5, colors: [getComputedStyle(this).getPropertyValue('--usa-like-color').trim() || '#f43f5e', '#fb923c', '#facc15'] });\n }\n if (this.hasAttribute('haptic')) haptic(this.num('haptic', 12));\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { liked: next, count: this.count });\n }\n },\n { id: 'like', text: css }\n );\n}\n","import { defineElement, raf, caf, now, type UsaElement } from '../base';\nimport { haptic } from './fx';\nimport css from './hold.css?raw';\n\n/**\n * `<usa-hold>` — hold-to-confirm: press and hold (pointer, Space or Enter)\n * while a progress ring fills; releasing early rewinds it. Good for\n * destructive actions.\n *\n * Attributes: `duration` (ms, 1200), `label` (accessible name), `color`,\n * `disabled`. CSS variable `--usa-hold` (0–1). Events: `usa:progress`,\n * `usa:confirm`, `usa:cancel`. Reduced motion: same timing, the ring fills\n * without the scale pulse.\n */\nexport interface UsaHoldElement extends UsaElement {\n readonly progress: number;\n cancel(): void;\n}\n\nexport function defineHold(tag = 'usa-hold'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaHold extends Base {\n static get observedAttributes(): string[] {\n return ['duration', 'disabled'];\n }\n\n private _p = 0;\n private _frame = 0;\n private _holding = false;\n\n get progress(): number {\n return this._p;\n }\n\n private set(p: number): void {\n this._p = p;\n this.style.setProperty('--usa-hold', p.toFixed(4));\n const c = this.querySelector<SVGCircleElement>('.usa-hold-ring circle:last-child');\n if (c) c.style.strokeDashoffset = String(100 - p * 100);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-hold-ring')) {\n this.insertAdjacentHTML('beforeend', '<svg class=\"usa-hold-ring\" viewBox=\"0 0 36 36\" aria-hidden=\"true\"><circle cx=\"18\" cy=\"18\" r=\"15.9\" pathLength=\"100\"/><circle cx=\"18\" cy=\"18\" r=\"15.9\" pathLength=\"100\"/></svg>');\n }\n if (this.str('color')) this.style.setProperty('--usa-hold-color', this.str('color'));\n this.setAttribute('role', 'button');\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n if (this.str('label')) this.setAttribute('aria-label', this.str('label'));\n this.setAttribute('aria-description', 'Press and hold to confirm');\n this.set(0);\n this.listen(this, 'pointerdown', (e: PointerEvent) => (e.pointerType !== 'mouse' || e.button === 0) && this.start());\n for (const t of ['pointerup', 'pointerleave', 'pointercancel']) this.listen(this, t, () => this.stop());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (!e.repeat) this.start();\n }\n });\n this.listen(this, 'keyup', (e: KeyboardEvent) => (e.key === 'Enter' || e.key === ' ') && this.stop());\n this.listen(this, 'contextmenu', (e: Event) => this._holding && e.preventDefault());\n }\n\n unmount(): void {\n caf(this._frame);\n this._holding = false;\n }\n\n private start(): void {\n if (this.flag('disabled') || this._holding) return;\n this._holding = true;\n this.setAttribute('data-holding', '');\n const dur = Math.max(100, this.num('duration', 1200));\n let last = now();\n const tick = () => {\n const t = now();\n const p = Math.min(1, this._p + (t - last) / dur);\n last = t;\n this.set(p);\n this.emit('progress', { progress: p });\n if (p >= 1) {\n this._holding = false;\n this.removeAttribute('data-holding');\n this.setAttribute('data-done', '');\n if (this.hasAttribute('haptic')) haptic(20);\n this.emit('confirm');\n setTimeout(() => {\n this.removeAttribute('data-done');\n this.rewind();\n }, 700);\n return;\n }\n this._frame = raf(tick);\n };\n this._frame = raf(tick);\n }\n\n private stop(): void {\n if (!this._holding) return;\n this._holding = false;\n caf(this._frame);\n this.removeAttribute('data-holding');\n if (this._p < 1) {\n this.emit('cancel', { progress: this._p });\n this.rewind();\n }\n }\n\n private rewind(): void {\n let last = now();\n const back = () => {\n if (this._holding) return;\n const t = now();\n const p = Math.max(0, this._p - (t - last) / 250);\n last = t;\n this.set(p);\n if (p > 0) this._frame = raf(back);\n };\n this._frame = raf(back);\n }\n\n cancel(): void {\n this.stop();\n }\n },\n { id: 'hold', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { burst, haptic } from './fx';\nimport css from './double-tap.css?raw';\n\n/**\n * `<usa-double-tap>` — detects a double tap / double click on its content\n * (photos, posts) and pops a heart (or `icon`) at the tap point.\n *\n * Attributes: `icon` (text / emoji, default ♥), `color`, `delay` (max ms\n * between taps, 300), `haptic`, `disabled`. Events: `usa:double-tap`\n * (`{ x, y }`, element-relative). Keyboard users: press `L` while focused.\n * Reduced motion: the icon fades in and out without scaling or particles.\n */\nexport interface UsaDoubleTapElement extends UsaElement {\n pop(x?: number, y?: number): void;\n}\n\nexport function defineDoubleTap(tag = 'usa-double-tap'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaDoubleTap extends Base {\n mount(): void {\n let last = 0;\n let lx = 0;\n let ly = 0;\n this.listen(this, 'pointerup', (e: PointerEvent) => {\n if (this.flag('disabled')) return;\n const t = e.timeStamp || Date.now();\n if (t - last < this.num('delay', 300) && Math.hypot(e.clientX - lx, e.clientY - ly) < 40) {\n last = 0;\n this.pop(e.clientX, e.clientY);\n } else {\n last = t;\n lx = e.clientX;\n ly = e.clientY;\n }\n });\n this.listen(this, 'dblclick', (e: MouseEvent) => e.preventDefault());\n this.listen(this, 'keydown', (e: KeyboardEvent) => e.key.toLowerCase() === 'l' && !e.repeat && this.pop());\n }\n\n pop(x?: number, y?: number): void {\n const r = this.getBoundingClientRect();\n if (x === undefined || y === undefined) {\n x = r.left + r.width / 2;\n y = r.top + r.height / 2;\n }\n const icon = document.createElement('span');\n icon.className = 'usa-double-tap-icon';\n icon.setAttribute('aria-hidden', 'true');\n icon.textContent = this.str('icon', '♥');\n icon.style.left = `${x - r.left}px`;\n icon.style.top = `${y - r.top}px`;\n if (this.str('color')) icon.style.color = this.str('color');\n this.append(icon);\n const frames: Keyframe[] = this.reduced\n ? [{ opacity: 0 }, { opacity: 1, offset: 0.3 }, { opacity: 0 }]\n : [\n { opacity: 0, transform: 'translate(-50%, -50%) scale(0.2) rotate(-15deg)' },\n { opacity: 1, transform: 'translate(-50%, -50%) scale(1.15) rotate(5deg)', offset: 0.3 },\n { opacity: 1, transform: 'translate(-50%, -50%) scale(1) rotate(0deg)', offset: 0.6 },\n { opacity: 0, transform: 'translate(-50%, -110%) scale(0.9)' },\n ];\n const a = this.motion(icon, frames, { duration: 900, easing: 'ease-out', fill: 'forwards' });\n if (a) a.onfinish = () => icon.remove();\n else icon.remove();\n burst(x, y, { count: 8, distance: 40, size: 5, colors: [this.str('color', '#f43f5e'), '#fb923c', '#facc15'] });\n if (this.hasAttribute('haptic')) haptic(15);\n this.emit('double-tap', { x: x - r.left, y: y - r.top });\n }\n },\n { id: 'double-tap', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport css from './checkbox.css?raw';\n\n/**\n * `<usa-checkbox>` — an animated, form-associated checkbox: the box springs\n * and the check mark draws itself. `role=\"checkbox\"` + `aria-checked`\n * (`mixed` with `indeterminate`).\n *\n * Attributes: `checked`, `indeterminate`, `disabled`, `name`, `value`\n * (`on`), `label`, `shape` (`square` default, `circle`). Events: `change`,\n * `usa:change` (`{ checked }`). Reduced motion: no spring or drawing.\n */\nexport interface UsaCheckboxElement extends UsaElement {\n checked: boolean;\n indeterminate: boolean;\n toggle(force?: boolean): void;\n}\n\nexport function defineCheckbox(tag = 'usa-checkbox'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) => {\n class UsaCheckbox extends Base {\n static formAssociated = true;\n static get observedAttributes(): string[] {\n return ['checked', 'indeterminate', 'disabled', 'label'];\n }\n\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n try {\n this._internals = (this as any).attachInternals?.() ?? null;\n } catch {\n this._internals = null;\n }\n }\n\n get checked(): boolean {\n return this.flag('checked');\n }\n set checked(v: boolean) {\n this.setFlag('checked', v);\n }\n get indeterminate(): boolean {\n return this.flag('indeterminate');\n }\n set indeterminate(v: boolean) {\n this.setFlag('indeterminate', v);\n }\n\n mount(): void {\n if (!this.querySelector(':scope > .usa-checkbox-box')) {\n this.insertAdjacentHTML(\n 'afterbegin',\n '<span class=\"usa-checkbox-box\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\"><path class=\"usa-checkbox-check\" d=\"M5 12.5l4.2 4.2L19 7\" pathLength=\"1\"/><path class=\"usa-checkbox-dash\" d=\"M6 12h12\" pathLength=\"1\"/></svg></span>'\n );\n }\n this.setAttribute('role', 'checkbox');\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.sync();\n this.listen(this, 'click', () => this.toggle());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === ' ' && !e.repeat) {\n e.preventDefault();\n this.toggle();\n }\n });\n }\n\n changed(): void {\n this.sync();\n }\n\n private sync(): void {\n this.setAttribute('aria-checked', this.indeterminate ? 'mixed' : String(this.checked));\n if (this.str('label')) this.setAttribute('aria-label', this.str('label'));\n this.toggleAttribute('aria-disabled', this.flag('disabled'));\n this._internals?.setFormValue?.(this.checked ? this.str('value', 'on') : null);\n }\n\n toggle(force?: boolean): void {\n if (this.flag('disabled')) return;\n const next = force === undefined ? !this.checked || this.indeterminate : force;\n this.indeterminate = false;\n this.checked = next;\n this.sync();\n const box = this.querySelector('.usa-checkbox-box');\n if (box && !this.reduced) this.motion(box, [{ transform: 'scale(0.75)' }, { transform: 'scale(1)' }], springEasing('bouncy'));\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.emit('change', { checked: next });\n }\n }\n return UsaCheckbox as unknown as CustomElementConstructor;\n },\n { id: 'checkbox', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/click — click & tap effects (v2.5).\n * `<usa-click>` (ripple, burst, confetti, squish, press-spring, shake),\n * `<usa-button>` (button click deformation: squash, wobble, gooey, dent;\n * shape morph; submit → loading → success), `<usa-icon-morph>`,\n * `<usa-like>`, `<usa-hold>`, `<usa-double-tap>`, `<usa-checkbox>`, plus\n * `burst()`, `confetti()`, `shake()` and `haptic()`.\n */\nimport { defineClick, type UsaClickElement } from './click';\nimport { defineButton, type UsaButtonElement } from './button';\nimport { defineIconMorph, type UsaIconMorphElement } from './icon-morph';\nimport { defineLike, type UsaLikeElement } from './like';\nimport { defineHold, type UsaHoldElement } from './hold';\nimport { defineDoubleTap, type UsaDoubleTapElement } from './double-tap';\nimport { defineCheckbox, type UsaCheckboxElement } from './checkbox';\n\nexport { defineClick, defineButton, defineIconMorph, defineLike, defineHold, defineDoubleTap, defineCheckbox };\nexport { CLICK_EFFECTS } from './click';\nexport type { ClickEffect } from './click';\nexport { BUTTON_DEFORMS } from './button';\nexport type { ButtonDeform, ButtonShape, ButtonState } from './button';\nexport { MORPH_ICONS, morphPath } from './icon-morph';\nexport { burst, confetti, shake, haptic } from './fx';\nexport type { BurstOptions, ConfettiOptions } from './fx';\nexport type { UsaClickElement, UsaButtonElement, UsaIconMorphElement, UsaLikeElement, UsaHoldElement, UsaDoubleTapElement, UsaCheckboxElement };\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 defineClickComponents(): void {\n defineClick();\n defineButton();\n defineIconMorph();\n defineLike();\n defineHold();\n defineDoubleTap();\n defineCheckbox();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-click': UsaClickElement;\n 'usa-button': UsaButtonElement;\n 'usa-icon-morph': UsaIconMorphElement;\n 'usa-like': UsaLikeElement;\n 'usa-hold': UsaHoldElement;\n 'usa-double-tap': UsaDoubleTapElement;\n 'usa-checkbox': UsaCheckboxElement;\n }\n}\n"],"names":["prefersReducedMotion","defineElement","EASE_OUT","springEasing","css","clamp","createSpring","caf","now","raf"],"mappings":";;;;;AAEA;;;;;AAKG;AAEH,IAAI,KAAK,GAAuB,IAAI;AACpC,SAAS,OAAO,GAAA;AACd,IAAA,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW;AAAE,QAAA,OAAO,KAAK;AAC5C,IAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACrC,IAAA,KAAK,CAAC,SAAS,GAAG,cAAc;AAChC,IAAA,KAAK,CAAC,YAAY,CAAC,aAAa,E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QAAQ,CAAC,CAAC;AAC7H,gBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACxC;;QArEO,WAAA,CAAA,cAAc,GAAG,IAAH;AAuEvB,QAAA,OAAO,WAAkD;IAC3D,CAAC,EACD,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAC9B;AACH;;ACnGA;;;;;;;AAOG;AAqBH;SACgB,qBAAqB,GAAA;AACnC,IAAA,WAAW,EAAE;AACb,IAAA,YAAY,EAAE;AACd,IAAA,eAAe,EAAE;AACjB,IAAA,UAAU,EAAE;AACZ,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,cAAc,EAAE;AAClB;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ /* use-scroll-animate/components/click */
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-button{position:relative;display:inline-block;isolation:isolate;-webkit-tap-highlight-color:transparent;touch-action:manipulation;vertical-align:middle}usa-button[role="button"]{cursor:pointer}usa-button .usa-button-face{position:relative;overflow:hidden;will-change:transform;transform-origin:50% 60%;white-space:nowrap}usa-button[deform~="gooey"] .usa-button-face{overflow:visible}usa-button[deform~="dent"] .usa-button-face::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity 0.2s ease;background:radial-gradient(circle at var(--usa-dent-x,50%) var(--usa-dent-y,50%),rgb(0 0 0 / 0.28),transparent 60%)}usa-button[deform~="dent"][data-pressed] .usa-button-face::after{opacity:1}usa-button .usa-button-goo{position:absolute;inset:0;z-index:-1;pointer-events:none;filter:url(#usa-goo)}usa-button .usa-button-goo i{position:absolute;width:22px;height:22px;border-radius:50%;background:var(--usa-goo-bg);transform:translate(-50%,-50%) scale(0.4)}usa-button .usa-button-face[data-shape="circle"],usa-button .usa-button-face[data-shape="icon"]{padding-inline:0;aspect-ratio:1;border-radius:999px;display:inline-grid;place-items:center}usa-button .usa-button-face [data-label],usa-button .usa-button-face [data-icon]{transition:opacity 0.2s ease}usa-button .usa-button-face[data-shape="circle"] [data-label],usa-button .usa-button-face[data-shape="icon"] [data-label]{position:absolute;opacity:0;pointer-events:none}usa-button .usa-button-face[data-shape="circle"] [data-icon]{opacity:0}usa-button .usa-button-status{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}usa-button .usa-button-status svg{grid-area:1 / 1;width:1.25em;height:1.25em;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:0}usa-button .usa-button-spin circle{stroke-dasharray:60 100;transform-origin:50% 50%;animation:usa-btn-spin 0.8s linear infinite}usa-button .usa-button-ok path,usa-button .usa-button-err path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 0.35s ease 0.1s}usa-button .usa-button-face[data-state="loading"] .usa-button-spin,usa-button .usa-button-face[data-state="success"] .usa-button-ok,usa-button .usa-button-face[data-state="error"] .usa-button-err{opacity:1}usa-button .usa-button-face[data-state="success"] .usa-button-ok path,usa-button .usa-button-face[data-state="error"] .usa-button-err path{stroke-dashoffset:0}usa-button .usa-button-face:is([data-state="loading"],[data-state="success"],[data-state="error"])>:not(.usa-button-status){opacity:0}usa-button .usa-button-face[data-state="success"]{background:#16a34a;border-color:#16a34a;color:#fff}usa-button .usa-button-face[data-state="error"]{background:#e5484d;border-color:#e5484d;color:#fff}usa-button .usa-button-face[data-state]{transition:background-color 0.25s ease,color 0.25s ease,border-radius 0.3s ease}@keyframes usa-btn-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){usa-button .usa-button-spin circle{animation-duration:2.4s}usa-button .usa-button-face,usa-button .usa-button-face *{transition:none !important}}
4
+ usa-checkbox{--usa-checkbox-on:var(--usa-accent,#7c5cff);display:inline-flex;align-items:center;gap:0.55em;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;vertical-align:middle}usa-checkbox .usa-checkbox-box{flex:none;width:1.25em;height:1.25em;border-radius:0.3em;border:1.5px solid color-mix(in srgb,currentColor 55%,transparent);display:grid;place-items:center;transition:background-color 0.2s ease,border-color 0.2s ease;box-sizing:border-box}usa-checkbox[shape="circle"] .usa-checkbox-box{border-radius:50%}usa-checkbox svg{width:85%;height:85%;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}usa-checkbox svg path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 0.28s cubic-bezier(0.65,0,0.35,1) 0.05s}usa-checkbox[checked]:not([indeterminate]) .usa-checkbox-check,usa-checkbox[indeterminate] .usa-checkbox-dash{stroke-dashoffset:0}usa-checkbox[checked] .usa-checkbox-box,usa-checkbox[indeterminate] .usa-checkbox-box{background:var(--usa-checkbox-on);border-color:var(--usa-checkbox-on)}usa-checkbox[disabled]{opacity:0.45;cursor:not-allowed}usa-checkbox:focus-visible{outline:none}usa-checkbox:focus-visible .usa-checkbox-box{outline:2px solid var(--usa-checkbox-on);outline-offset:2px}@media (prefers-reduced-motion:reduce){usa-checkbox svg path,usa-checkbox .usa-checkbox-box{transition:none}}
5
+ usa-click{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}usa-click[block]{display:block}usa-click .usa-click-wave{position:absolute;border-radius:50%;pointer-events:none;z-index:-1;transform:scale(0);background:radial-gradient(circle,var(--usa-wave) 0 55%,color-mix(in srgb,var(--usa-wave) 40%,transparent) 70%,transparent 72%)}
6
+ usa-double-tap{position:relative;display:block;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}usa-double-tap .usa-double-tap-icon{position:absolute;pointer-events:none;font-size:64px;line-height:1;color:#f43f5e;transform:translate(-50%,-50%);text-shadow:0 6px 18px rgb(0 0 0 / 0.35);z-index:2}
7
+ usa-hold{--usa-hold-color:#e5484d;position:relative;display:inline-flex;align-items:center;gap:0.5em;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}usa-hold .usa-hold-ring{width:1.6em;height:1.6em;transform:rotate(-90deg);flex:none}usa-hold .usa-hold-ring circle{fill:none;stroke-width:3.5;stroke-linecap:round}usa-hold .usa-hold-ring circle:first-child{stroke:color-mix(in srgb,currentColor 18%,transparent)}usa-hold .usa-hold-ring circle:last-child{stroke:var(--usa-hold-color);stroke-dasharray:100;stroke-dashoffset:100}usa-hold[data-holding]{transform:scale(calc(1 - var(--usa-hold,0) * 0.05))}usa-hold[data-done] .usa-hold-ring{animation:usa-hold-pop 0.4s cubic-bezier(0.34,1.56,0.64,1)}@keyframes usa-hold-pop{50%{transform:rotate(-90deg) scale(1.3)}}usa-hold[disabled]{opacity:0.5;cursor:not-allowed}usa-hold:focus-visible{outline:2px solid var(--usa-hold-color);outline-offset:3px;border-radius:10px}@media (prefers-reduced-motion:reduce){usa-hold[data-holding]{transform:none}usa-hold[data-done] .usa-hold-ring{animation:none}}
8
+ usa-icon-morph{display:inline-grid;place-items:center;line-height:0;color:inherit;-webkit-tap-highlight-color:transparent;vertical-align:middle}usa-icon-morph svg{fill:currentColor;overflow:visible}usa-icon-morph[toggle]{cursor:pointer;border-radius:8px}usa-icon-morph[toggle]:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}
9
+ usa-like{--usa-like-color:#f43f5e;display:inline-flex;align-items:center;gap:0.35em;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;vertical-align:middle}usa-like .usa-like-heart{fill:transparent;stroke:currentColor;stroke-width:1.8;transition:fill 0.2s ease,stroke 0.2s ease;overflow:visible}usa-like[liked] .usa-like-heart{fill:var(--usa-like-color);stroke:var(--usa-like-color)}usa-like .usa-like-count{font-variant-numeric:tabular-nums}usa-like[disabled]{opacity:0.5;cursor:not-allowed}usa-like:focus-visible{outline:2px solid var(--usa-like-color);outline-offset:3px;border-radius:8px}
@@ -0,0 +1,250 @@
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
+ declare const CLICK_EFFECTS: readonly ["ripple", "burst", "confetti", "squish", "press-spring", "shake"];
39
+ type ClickEffect = (typeof CLICK_EFFECTS)[number];
40
+ /**
41
+ * `<usa-click>` — click / tap effects on whatever it wraps (combinable:
42
+ * `effect="press-spring burst"`).
43
+ *
44
+ * - `ripple` — an ink wave from the pointer (enhanced: `color`, soft edge);
45
+ * - `burst` — particles radiating from the pointer (`shape`: circle, square, star, heart, emoji);
46
+ * - `confetti` — a confetti cannon from the click point;
47
+ * - `squish` — squash on press, stretch on release (spring);
48
+ * - `press-spring` — dips while pressed, springs back with overshoot;
49
+ * - `shake` — horizontal error shake; plays on `invalid` events from a form
50
+ * inside, on `shake()`, or on click when `trigger="click"`.
51
+ *
52
+ * Attributes: `effect`, `color`, `shape`, `count`, `haptic` (vibrate ms,
53
+ * where supported), `disabled`. Keyboard (Space/Enter) triggers the effects
54
+ * from the centre. Reduced motion: no particles or movement; press dims.
55
+ */
56
+ interface UsaClickElement extends UsaElement {
57
+ readonly effects: string[];
58
+ play(x?: number, y?: number): void;
59
+ shake(): void;
60
+ }
61
+ declare function defineClick(tag?: string): CustomElementConstructor | undefined;
62
+
63
+ declare const BUTTON_DEFORMS: readonly ["squash", "wobble", "gooey", "dent"];
64
+ type ButtonDeform = (typeof BUTTON_DEFORMS)[number];
65
+ type ButtonShape = 'pill' | 'circle' | 'icon';
66
+ type ButtonState = 'idle' | 'loading' | 'success' | 'error';
67
+ /**
68
+ * `<usa-button>` — **button click deformation** (按钮点击形变) around a
69
+ * native `<button>` (or `<a>`) child — or the element itself becomes a button.
70
+ *
71
+ * `deform` (combinable, e.g. `deform="squash wobble"`):
72
+ * - `squash` — squash on press, stretch-and-settle on release (spring);
73
+ * - `wobble` — elastic border-radius wobble after a click;
74
+ * - `gooey` — liquid blob: droplets squeeze out from the press point and
75
+ * merge back (SVG goo filter);
76
+ * - `dent` — the surface dents toward the pressed point (3D tilt + inner shade).
77
+ *
78
+ * `shape="pill | circle | icon"` morphs the outline with a spring (label =
79
+ * `[data-label]`, icon = `[data-icon]` children); `morphTo(shape)`.
80
+ *
81
+ * `morph="submit"` — click → `loading` (shrinks to a circle with a spinner,
82
+ * `aria-busy`), then `success` (check) or `error` (shake + cross), and back
83
+ * to `idle` after `reset` ms (1800). Drive it with `state="…"` / `.state`, or
84
+ * call `event.detail.done(ok)` from a `usa:submit` listener.
85
+ *
86
+ * Attributes: `deform`, `shape`, `morph`, `state`, `reset`, `haptic`,
87
+ * `disabled`. Events: `usa:submit`, `usa:state`. Reduced motion: no
88
+ * deformation; shape and state changes are instant; status still announced.
89
+ */
90
+ interface UsaButtonElement extends UsaElement {
91
+ readonly target: HTMLElement;
92
+ shape: ButtonShape;
93
+ state: ButtonState;
94
+ morphTo(shape: ButtonShape): Promise<void>;
95
+ }
96
+ declare function defineButton(tag?: string): CustomElementConstructor | undefined;
97
+
98
+ type Pt = [number, number];
99
+ type Quad = [Pt, Pt, Pt, Pt];
100
+ /**
101
+ * Morphable icons: every icon is three quads (four points each) on a 24×24
102
+ * grid, so any icon can morph into any other by interpolating points.
103
+ */
104
+ declare const MORPH_ICONS: Record<string, [Quad, Quad, Quad]>;
105
+ /** SVG path data for an icon, or for the interpolation `t` (0–1) between two. */
106
+ declare function morphPath(from: string, to?: string, t?: number): string;
107
+ /**
108
+ * `<usa-icon-morph>` — an icon that morphs between shapes with a spring:
109
+ * play ↔ pause, menu ↔ close, plus ↔ minus, check, arrow-right…
110
+ *
111
+ * Attributes: `icons` (comma list, cycled; default `play,pause`), `index`
112
+ * (current, 0), `size` (px, 24), `toggle` (makes it a button that cycles
113
+ * on click / Enter / Space), `labels` (comma list of accessible names per
114
+ * icon, e.g. `Play,Pause`), `preset` (spring, `wobbly`). Methods:
115
+ * `next()`, `show(nameOrIndex)`. Events: `usa:change` (`{ index, icon }`).
116
+ * Inside a `<usa-button>` or `<button>` it is decorative. Reduced motion:
117
+ * the icon switches instantly.
118
+ */
119
+ interface UsaIconMorphElement extends UsaElement {
120
+ index: number;
121
+ readonly icon: string;
122
+ next(): void;
123
+ show(icon: string | number): void;
124
+ }
125
+ declare function defineIconMorph(tag?: string): CustomElementConstructor | undefined;
126
+
127
+ /**
128
+ * `<usa-like>` — a like / favourite toggle: the heart pops with a spring and
129
+ * bursts into particles when liked. `role="button"` + `aria-pressed`.
130
+ *
131
+ * Attributes: `liked`, `count` (shown next to the heart, updated ±1),
132
+ * `label` (accessible name, default "Like"), `color`, `size` (px, 24),
133
+ * `haptic`, `disabled`. Events: `change`, `usa:change` (`{ liked, count }`).
134
+ * Reduced motion: colour change only.
135
+ */
136
+ interface UsaLikeElement extends UsaElement {
137
+ liked: boolean;
138
+ count: number | null;
139
+ toggle(force?: boolean): void;
140
+ }
141
+ declare function defineLike(tag?: string): CustomElementConstructor | undefined;
142
+
143
+ /**
144
+ * `<usa-hold>` — hold-to-confirm: press and hold (pointer, Space or Enter)
145
+ * while a progress ring fills; releasing early rewinds it. Good for
146
+ * destructive actions.
147
+ *
148
+ * Attributes: `duration` (ms, 1200), `label` (accessible name), `color`,
149
+ * `disabled`. CSS variable `--usa-hold` (0–1). Events: `usa:progress`,
150
+ * `usa:confirm`, `usa:cancel`. Reduced motion: same timing, the ring fills
151
+ * without the scale pulse.
152
+ */
153
+ interface UsaHoldElement extends UsaElement {
154
+ readonly progress: number;
155
+ cancel(): void;
156
+ }
157
+ declare function defineHold(tag?: string): CustomElementConstructor | undefined;
158
+
159
+ /**
160
+ * `<usa-double-tap>` — detects a double tap / double click on its content
161
+ * (photos, posts) and pops a heart (or `icon`) at the tap point.
162
+ *
163
+ * Attributes: `icon` (text / emoji, default ♥), `color`, `delay` (max ms
164
+ * between taps, 300), `haptic`, `disabled`. Events: `usa:double-tap`
165
+ * (`{ x, y }`, element-relative). Keyboard users: press `L` while focused.
166
+ * Reduced motion: the icon fades in and out without scaling or particles.
167
+ */
168
+ interface UsaDoubleTapElement extends UsaElement {
169
+ pop(x?: number, y?: number): void;
170
+ }
171
+ declare function defineDoubleTap(tag?: string): CustomElementConstructor | undefined;
172
+
173
+ /**
174
+ * `<usa-checkbox>` — an animated, form-associated checkbox: the box springs
175
+ * and the check mark draws itself. `role="checkbox"` + `aria-checked`
176
+ * (`mixed` with `indeterminate`).
177
+ *
178
+ * Attributes: `checked`, `indeterminate`, `disabled`, `name`, `value`
179
+ * (`on`), `label`, `shape` (`square` default, `circle`). Events: `change`,
180
+ * `usa:change` (`{ checked }`). Reduced motion: no spring or drawing.
181
+ */
182
+ interface UsaCheckboxElement extends UsaElement {
183
+ checked: boolean;
184
+ indeterminate: boolean;
185
+ toggle(force?: boolean): void;
186
+ }
187
+ declare function defineCheckbox(tag?: string): CustomElementConstructor | undefined;
188
+
189
+ interface BurstOptions {
190
+ /** Number of particles (default 12). */
191
+ count?: number;
192
+ /** Colours to pick from (default: accent palette). */
193
+ colors?: string[];
194
+ /** Travel distance in px (default 48). */
195
+ distance?: number;
196
+ /** Particle size in px (default 6). */
197
+ size?: number;
198
+ /** `circle` (default), `square`, `star`, `heart` or any text / emoji. */
199
+ shape?: 'circle' | 'square' | 'star' | 'heart' | string;
200
+ /** Duration in ms (default 600). */
201
+ duration?: number;
202
+ }
203
+ /** Particles radiating from client point (x, y). Returns the number spawned. */
204
+ declare function burst(x: number, y: number, options?: BurstOptions): number;
205
+ interface ConfettiOptions {
206
+ /** Origin in client px (default: centre-bottom third of the viewport). */
207
+ x?: number;
208
+ y?: number;
209
+ /** Pieces (default 80). */
210
+ count?: number;
211
+ /** Spread angle in degrees (default 70). */
212
+ spread?: number;
213
+ /** Launch speed multiplier (default 1). */
214
+ velocity?: number;
215
+ colors?: string[];
216
+ /** Duration in ms (default 1600). */
217
+ duration?: number;
218
+ }
219
+ /** A confetti cannon (paper pieces with gravity, drift and spin). */
220
+ declare function confetti(options?: ConfettiOptions): number;
221
+ /** Horizontal error shake (`intensity` px, default 8). Reduced motion: a red outline flash. */
222
+ declare function shake(el: Element, intensity?: number, duration?: number): Animation | null;
223
+ /** `navigator.vibrate()` where supported (Android Chrome, some WebViews). Returns whether it ran. */
224
+ declare function haptic(pattern?: number | number[]): boolean;
225
+
226
+ /**
227
+ * use-scroll-animate/components/click — click & tap effects (v2.5).
228
+ * `<usa-click>` (ripple, burst, confetti, squish, press-spring, shake),
229
+ * `<usa-button>` (button click deformation: squash, wobble, gooey, dent;
230
+ * shape morph; submit → loading → success), `<usa-icon-morph>`,
231
+ * `<usa-like>`, `<usa-hold>`, `<usa-double-tap>`, `<usa-checkbox>`, plus
232
+ * `burst()`, `confetti()`, `shake()` and `haptic()`.
233
+ */
234
+
235
+ /** Register every component of this category under its default tag. */
236
+ declare function defineClickComponents(): void;
237
+ declare global {
238
+ interface HTMLElementTagNameMap {
239
+ 'usa-click': UsaClickElement;
240
+ 'usa-button': UsaButtonElement;
241
+ 'usa-icon-morph': UsaIconMorphElement;
242
+ 'usa-like': UsaLikeElement;
243
+ 'usa-hold': UsaHoldElement;
244
+ 'usa-double-tap': UsaDoubleTapElement;
245
+ 'usa-checkbox': UsaCheckboxElement;
246
+ }
247
+ }
248
+
249
+ export { BUTTON_DEFORMS, CLICK_EFFECTS, MORPH_ICONS, burst, confetti, configureComponents, defineButton, defineCheckbox, defineClick, defineClickComponents, defineDoubleTap, defineHold, defineIconMorph, defineLike, haptic, morphPath, prefersReducedMotion, shake };
250
+ export type { BurstOptions, ButtonDeform, ButtonShape, ButtonState, ClickEffect, ComponentsConfig, ConfettiOptions, UsaButtonElement, UsaCheckboxElement, UsaClickElement, UsaDoubleTapElement, UsaElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement };