use-scroll-animate 2.9.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +4 -3
- package/README_ja.md +1 -0
- package/README_zh.md +2 -1
- package/dist/chunks/{base-BkQcvoSG.cjs → base-CXx7jZ-o.cjs} +4 -23
- package/dist/chunks/{base-BkQcvoSG.cjs.map → base-CXx7jZ-o.cjs.map} +1 -1
- package/dist/chunks/{base-CB8gChoe.js → base-Cu-86Z31.js} +5 -24
- package/dist/chunks/{base-CB8gChoe.js.map → base-Cu-86Z31.js.map} +1 -1
- package/dist/chunks/{core-J_KM443q.js → core-mV_TPgG_.js} +2 -52
- package/dist/chunks/core-mV_TPgG_.js.map +1 -0
- package/dist/chunks/{core-C1cEwjJj.cjs → core-qpECfEkb.cjs} +2 -52
- package/dist/chunks/core-qpECfEkb.cjs.map +1 -0
- package/dist/chunks/{index-tags-f37txHmb.js → index-tags-D7NynL4r.js} +2 -1
- package/dist/chunks/{index-tags-f37txHmb.js.map → index-tags-D7NynL4r.js.map} +1 -1
- package/dist/chunks/{index-tags-BEM98giN.cjs → index-tags-Gw1G06Pb.cjs} +2 -1
- package/dist/chunks/{index-tags-BEM98giN.cjs.map → index-tags-Gw1G06Pb.cjs.map} +1 -1
- package/dist/chunks/{spring-7U9MC6yQ.cjs → spring-2OTnYCzm.cjs} +2 -2
- package/dist/chunks/{spring-7U9MC6yQ.cjs.map → spring-2OTnYCzm.cjs.map} +1 -1
- package/dist/chunks/{spring-ka0YJ_ZR.js → spring-BV-cpTHC.js} +2 -2
- package/dist/chunks/{spring-ka0YJ_ZR.js.map → spring-BV-cpTHC.js.map} +1 -1
- package/dist/chunks/{stagger-CGF18oNs.js → stagger-BFAhKknX.js} +2 -2
- package/dist/chunks/{stagger-CGF18oNs.js.map → stagger-BFAhKknX.js.map} +1 -1
- package/dist/chunks/{stagger-DtKKS6GP.cjs → stagger-CLc3j58T.cjs} +2 -2
- package/dist/chunks/{stagger-DtKKS6GP.cjs.map → stagger-CLc3j58T.cjs.map} +1 -1
- package/dist/chunks/{variants-PsCXbQ5h.cjs → variants-BNIrn4ch.cjs} +2 -2
- package/dist/chunks/{variants-PsCXbQ5h.cjs.map → variants-BNIrn4ch.cjs.map} +1 -1
- package/dist/chunks/{variants-Ce9CboVc.js → variants-BQ3gCb5L.js} +2 -2
- package/dist/chunks/{variants-Ce9CboVc.js.map → variants-BQ3gCb5L.js.map} +1 -1
- package/dist/components/background.cjs +3 -3
- package/dist/components/background.cjs.map +1 -1
- package/dist/components/background.css +1 -1
- package/dist/components/background.d.cts +1 -1
- package/dist/components/background.d.ts +1 -1
- package/dist/components/background.js +4 -4
- package/dist/components/background.js.map +1 -1
- package/dist/components/cards.cjs +2 -2
- package/dist/components/cards.js +3 -3
- package/dist/components/click.cjs +2 -2
- package/dist/components/click.js +3 -3
- package/dist/components/feedback.cjs +9 -16
- package/dist/components/feedback.cjs.map +1 -1
- package/dist/components/feedback.css +2 -2
- package/dist/components/feedback.d.cts +2 -4
- package/dist/components/feedback.d.ts +2 -4
- package/dist/components/feedback.js +10 -17
- package/dist/components/feedback.js.map +1 -1
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/jsx.d.cts +1 -0
- package/dist/components/jsx.d.ts +1 -0
- package/dist/components/lazy.cjs +2 -1
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +1 -0
- package/dist/components/lazy.d.ts +1 -0
- package/dist/components/lazy.js +2 -1
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/page.cjs +2 -2
- package/dist/components/page.js +3 -3
- package/dist/components/physics.cjs +2 -2
- package/dist/components/physics.js +4 -4
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +2 -2
- package/dist/components/timeline.cjs +303 -0
- package/dist/components/timeline.cjs.map +1 -0
- package/dist/components/timeline.css +3 -0
- package/dist/components/timeline.d.cts +164 -0
- package/dist/components/timeline.d.ts +164 -0
- package/dist/components/timeline.js +296 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/transitions.cjs +7 -7
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.d.cts +1 -1
- package/dist/components/transitions.d.ts +1 -1
- package/dist/components/transitions.js +8 -8
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +3 -3
- package/dist/components/ui.js +5 -5
- package/dist/components/vue.cjs +5 -4
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +91 -6
- package/dist/components/vue.d.ts +91 -6
- package/dist/components/vue.js +5 -4
- package/dist/components/vue.js.map +1 -1
- package/dist/components.cjs +11 -4
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +4 -3
- package/dist/components.d.cts +124 -8
- package/dist/components.d.ts +124 -8
- package/dist/components.js +10 -7
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/element.cjs +2 -3
- package/dist/element.cjs.map +1 -1
- package/dist/element.d.cts +4 -19
- package/dist/element.d.ts +4 -19
- package/dist/element.js +2 -3
- package/dist/element.js.map +1 -1
- package/dist/element.umd.js +1 -1
- package/dist/element.umd.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -19
- package/dist/index.d.ts +4 -19
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/react.cjs +3 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +3 -18
- package/dist/react.d.ts +3 -18
- package/dist/react.js +3 -3
- package/dist/react.js.map +1 -1
- package/dist/solid.cjs +2 -2
- package/dist/solid.d.cts +3 -18
- package/dist/solid.d.ts +3 -18
- package/dist/solid.js +2 -2
- package/dist/svelte.cjs +2 -2
- package/dist/svelte.d.cts +3 -18
- package/dist/svelte.d.ts +3 -18
- package/dist/svelte.js +2 -2
- package/dist/vue.cjs +3 -3
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +3 -18
- package/dist/vue.d.ts +3 -18
- package/dist/vue.js +3 -3
- package/dist/vue.js.map +1 -1
- package/docs/API.md +1 -2
- package/docs/components.md +12 -3
- package/docs/upgrading-3.md +1 -0
- package/package.json +14 -3
- package/dist/chunks/core-C1cEwjJj.cjs.map +0 -1
- package/dist/chunks/core-J_KM443q.js.map +0 -1
package/dist/components.d.cts
CHANGED
|
@@ -425,7 +425,7 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
425
425
|
* `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
|
|
426
426
|
* of `transform` / `opacity` (plus an SVG stroke for `fluent`).
|
|
427
427
|
*
|
|
428
|
-
* Kinds (`kind
|
|
428
|
+
* Kinds (`kind`): `fluent` (default — the WinUI / Windows 11
|
|
429
429
|
* ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
|
|
430
430
|
* `ring` (classic border spinner), `dots` (three bouncing dots / typing
|
|
431
431
|
* indicator), `pulse` (expanding ripple), `bars` (equalizer).
|
|
@@ -437,8 +437,6 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
437
437
|
interface UsaSpinnerElement extends UsaElement {
|
|
438
438
|
/** Spinner kind (`kind` attribute). */
|
|
439
439
|
kind: SpinnerVariant;
|
|
440
|
-
/** @deprecated alias of `kind`, removed in 3.0. */
|
|
441
|
-
variant: SpinnerVariant;
|
|
442
440
|
}
|
|
443
441
|
declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
|
|
444
442
|
|
|
@@ -524,7 +522,7 @@ declare function toast(message: string, options?: ToastOptions): ToastHandle | n
|
|
|
524
522
|
* `<usa-check>` — an animated result icon: the circle draws itself, then the
|
|
525
523
|
* check mark (or cross / exclamation) strokes in with a little pop.
|
|
526
524
|
*
|
|
527
|
-
* Attributes: `
|
|
525
|
+
* Attributes: `kind` (`success` default, `error`, `warning`), `size`
|
|
528
526
|
* (px, 56), `start` (`view` default | `load` | `manual`), `label`
|
|
529
527
|
* (accessible name, e.g. "Payment complete"; the icon is decorative
|
|
530
528
|
* without it). Event: `usa:complete`. Reduced motion: drawn instantly.
|
|
@@ -619,7 +617,7 @@ declare function defineMarquee(tag?: string): CustomElementConstructor | undefin
|
|
|
619
617
|
* tints from `--usa-mica-source`, a gradient you control). Optional
|
|
620
618
|
* `shimmer` adds a light sweep when it appears or on hover.
|
|
621
619
|
*
|
|
622
|
-
* Attributes: `kind` (`acrylic` default | `mica
|
|
620
|
+
* Attributes: `kind` (`acrylic` default | `mica`), `tint` (colour),
|
|
623
621
|
* `tint-opacity` (0–1, 0.55), `blur` (px, 30), `shimmer`
|
|
624
622
|
* (`hover` | `load` | `none`, default `none`). Falls back to a solid tint
|
|
625
623
|
* without `backdrop-filter` and under `prefers-reduced-transparency` or
|
|
@@ -715,7 +713,7 @@ type DialogVariant = 'modal' | 'drawer-start' | 'drawer-end' | 'drawer-bottom' |
|
|
|
715
713
|
* React / Vue / Svelte keep owning them). Style with `::part(panel)`,
|
|
716
714
|
* `::part(backdrop)` and the `--usa-dialog-*` custom properties.
|
|
717
715
|
*
|
|
718
|
-
* Attributes: `open` (reflects; set/remove to open/close), `
|
|
716
|
+
* Attributes: `open` (reflects; set/remove to open/close), `kind`
|
|
719
717
|
* (`modal` default — Fluent scale + fade; `drawer-start` / `drawer-end`
|
|
720
718
|
* slide from the side, `drawer-bottom` / `sheet` from below), `label`
|
|
721
719
|
* (accessible name), `no-backdrop-close`, `no-esc`. Elements inside
|
|
@@ -1776,6 +1774,123 @@ declare global {
|
|
|
1776
1774
|
}
|
|
1777
1775
|
}
|
|
1778
1776
|
|
|
1777
|
+
/**
|
|
1778
|
+
* Where a step starts on a timeline:
|
|
1779
|
+
* - a number: absolute time in ms
|
|
1780
|
+
* - `'>'` (default): when the previous step ends · `'<'`: when it starts
|
|
1781
|
+
* - `'+=200'` / `'-=200'`: after / overlapping the previous end
|
|
1782
|
+
* - `'<+=100'`: 100ms after the previous step's start
|
|
1783
|
+
* - `'intro'` / `'intro+=150'`: at (or relative to) a label
|
|
1784
|
+
*/
|
|
1785
|
+
type TimelinePosition = number | string;
|
|
1786
|
+
interface TimelineStepOptions {
|
|
1787
|
+
/** Duration in ms (default: timeline default, 600). */
|
|
1788
|
+
duration?: number;
|
|
1789
|
+
/** CSS easing (default `cubic-bezier(0.22, 1, 0.36, 1)`). */
|
|
1790
|
+
easing?: string;
|
|
1791
|
+
/** Start position, see `TimelinePosition`. */
|
|
1792
|
+
at?: TimelinePosition;
|
|
1793
|
+
/** ms between targets when the selector matches several elements. */
|
|
1794
|
+
stagger?: number;
|
|
1795
|
+
}
|
|
1796
|
+
interface TimelineOptions {
|
|
1797
|
+
/** Defaults for every step. */
|
|
1798
|
+
defaults?: Pick<TimelineStepOptions, 'duration' | 'easing' | 'stagger'>;
|
|
1799
|
+
/** Playback rate (1 = normal). */
|
|
1800
|
+
speed?: number;
|
|
1801
|
+
/** Called after `play()` reaches the end (or the start when reversed). */
|
|
1802
|
+
onComplete?: () => void;
|
|
1803
|
+
/** Called on every frame with progress 0–1. */
|
|
1804
|
+
onUpdate?: (progress: number) => void;
|
|
1805
|
+
}
|
|
1806
|
+
interface ScrubOptions {
|
|
1807
|
+
/** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts. */
|
|
1808
|
+
offset?: number;
|
|
1809
|
+
/** Smoothing 0–1 (0 = immediate, default 0). */
|
|
1810
|
+
smooth?: number;
|
|
1811
|
+
}
|
|
1812
|
+
interface Timeline {
|
|
1813
|
+
/** Total length in ms. */
|
|
1814
|
+
readonly duration: number;
|
|
1815
|
+
/** Label positions in ms. */
|
|
1816
|
+
readonly labels: Readonly<Record<string, number>>;
|
|
1817
|
+
/** Current playhead in ms. */
|
|
1818
|
+
readonly time: number;
|
|
1819
|
+
/** Add a step: animate `target` with keyframes or a preset name (`fade-up`, `scale`…). */
|
|
1820
|
+
to(target: string | Element | Element[] | NodeList, frames: Keyframe[] | string, options?: TimelineStepOptions): Timeline;
|
|
1821
|
+
/** Name a position (default: the current end). */
|
|
1822
|
+
label(name: string, at?: TimelinePosition): Timeline;
|
|
1823
|
+
/** Run `fn` when the playhead passes `at`. */
|
|
1824
|
+
call(fn: () => void, at?: TimelinePosition): Timeline;
|
|
1825
|
+
/** Play forwards from the playhead (from 0 when at the end). Resolves at the end. */
|
|
1826
|
+
play(from?: TimelinePosition): Promise<void>;
|
|
1827
|
+
/** Play backwards to 0. */
|
|
1828
|
+
reverse(): Promise<void>;
|
|
1829
|
+
pause(): Timeline;
|
|
1830
|
+
/** Jump to a time (ms) or label. */
|
|
1831
|
+
seek(to: TimelinePosition): Timeline;
|
|
1832
|
+
/** Get or set progress 0–1. */
|
|
1833
|
+
progress(p?: number): number;
|
|
1834
|
+
/** Tie progress to the scroll position of `source` (it moves through the viewport). Returns a stop function. */
|
|
1835
|
+
scrub(source: Element, options?: ScrubOptions): () => void;
|
|
1836
|
+
/** Stop and drop every animation (elements keep their last frame). */
|
|
1837
|
+
cancel(): void;
|
|
1838
|
+
}
|
|
1839
|
+
/** Keyframe presets usable by name in `to()` and `data-tl`. */
|
|
1840
|
+
declare const TIMELINE_PRESETS: Record<string, Keyframe[]>;
|
|
1841
|
+
/** Resolve a position against the previous step and labels (pure). */
|
|
1842
|
+
declare function resolvePosition(pos: TimelinePosition | undefined, end: number, prevStart: number, labels?: Record<string, number>): number;
|
|
1843
|
+
/**
|
|
1844
|
+
* Choreograph animations on one clock: chain, overlap, label, seek, reverse and
|
|
1845
|
+
* scrub them with scroll. Built on WAAPI (paused animations driven by one
|
|
1846
|
+
* playhead); without WAAPI or under reduced motion it jumps to the end state.
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* const tl = timeline({ defaults: { duration: 500 } })
|
|
1850
|
+
* .to('.title', 'fade-up')
|
|
1851
|
+
* .label('cards')
|
|
1852
|
+
* .to('.card', 'scale', { stagger: 80, at: '-=200' })
|
|
1853
|
+
* .to('.cta', [{ opacity: 0 }, { opacity: 1 }], { at: 'cards+=400' });
|
|
1854
|
+
* tl.play(); // or tl.scrub(document.querySelector('.hero'))
|
|
1855
|
+
*/
|
|
1856
|
+
declare function timeline(options?: TimelineOptions): Timeline;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* `<usa-timeline>` — declarative choreography. Every descendant with
|
|
1860
|
+
* `data-tl="<preset>"` becomes a step, in document order; `data-at`
|
|
1861
|
+
* (`'-=200'`, `'<'`, `'label+=100'`, ms), `data-duration` and `data-label`
|
|
1862
|
+
* fine-tune it.
|
|
1863
|
+
*
|
|
1864
|
+
* Attributes: `trigger` (`view` default · `click` · `manual`), `scrub`
|
|
1865
|
+
* (progress follows scroll instead of playing), `overlap` (ms each step
|
|
1866
|
+
* overlaps the previous, default 0), `duration` (600), `stagger` (ms),
|
|
1867
|
+
* `repeat` (replay every time it enters the viewport). Methods: `play()`,
|
|
1868
|
+
* `reverse()`, `seek(t)`; property `timeline`. Event `usa:complete`.
|
|
1869
|
+
* Reduced motion: steps appear in their final state.
|
|
1870
|
+
*/
|
|
1871
|
+
interface UsaTimelineElement extends UsaElement {
|
|
1872
|
+
readonly timeline: Timeline | null;
|
|
1873
|
+
play(): Promise<void>;
|
|
1874
|
+
reverse(): Promise<void>;
|
|
1875
|
+
seek(to: number | string): void;
|
|
1876
|
+
}
|
|
1877
|
+
declare function defineTimeline(tag?: string): CustomElementConstructor | undefined;
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* use-scroll-animate/components/timeline — choreography (v3.1).
|
|
1881
|
+
* `timeline()` chains, overlaps, labels, seeks, reverses and scroll-scrubs
|
|
1882
|
+
* WAAPI animations on one playhead; `<usa-timeline>` builds one from
|
|
1883
|
+
* `data-tl` children.
|
|
1884
|
+
*/
|
|
1885
|
+
|
|
1886
|
+
/** Register every component of this category under its default tag. */
|
|
1887
|
+
declare function defineTimelineComponents(): void;
|
|
1888
|
+
declare global {
|
|
1889
|
+
interface HTMLElementTagNameMap {
|
|
1890
|
+
'usa-timeline': UsaTimelineElement;
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1779
1894
|
/** The component categories and their default tags. */
|
|
1780
1895
|
declare const COMPONENT_CATEGORIES: {
|
|
1781
1896
|
readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
|
|
@@ -1789,6 +1904,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1789
1904
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
1790
1905
|
readonly ui: readonly ["usa-tabs", "usa-drawer", "usa-bottom-sheet", "usa-pull-refresh", "usa-fab", "usa-navbar", "usa-slider", "usa-rating", "usa-tooltip", "usa-popover", "usa-badge", "usa-avatar-stack"];
|
|
1791
1906
|
readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
|
|
1907
|
+
readonly timeline: readonly ["usa-timeline"];
|
|
1792
1908
|
};
|
|
1793
1909
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
1794
1910
|
|
|
@@ -1798,5 +1914,5 @@ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
|
1798
1914
|
*/
|
|
1799
1915
|
declare function defineComponents(categories?: ComponentCategory[]): void;
|
|
1800
1916
|
|
|
1801
|
-
export { AMBIENT_EFFECTS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, VARIANTS, adoptVariants, burst, confetti, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAurora, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCursor, defineDialog, defineDotNetwork, defineDoubleTap, defineDraggable, defineDrawer, defineFab, defineFeedbackComponents, defineFlipList, defineFullpage, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLike, defineLoadingBar, defineMagnetic, defineMarquee, defineMotionSwitch, defineNavbar, defineOverscroll, definePageComponents, defineParticles, definePhysicsComponents, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, easeOutExpo, enableMpaTransitions, flip, fluentPreset, getMotionIntensity, haptic, linearEasing, loadingBar, morphPath, pageTransition, prefersReducedMotion, projectInertia, readScrollProgress, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsViewTransitions, themeTransition, toast, viewTransition };
|
|
1802
|
-
export type { AmbientEffect, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, ConnectedOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, MotionIntensity, PageEffect, PageTransitionOptions, Placement, RevealEffect, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAuroraElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCursorElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFlipListElement, UsaFullpageElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaParticlesElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
|
1917
|
+
export { AMBIENT_EFFECTS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, burst, confetti, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAurora, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCursor, defineDialog, defineDotNetwork, defineDoubleTap, defineDraggable, defineDrawer, defineFab, defineFeedbackComponents, defineFlipList, defineFullpage, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLike, defineLoadingBar, defineMagnetic, defineMarquee, defineMotionSwitch, defineNavbar, defineOverscroll, definePageComponents, defineParticles, definePhysicsComponents, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineTimeline, defineTimelineComponents, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, easeOutExpo, enableMpaTransitions, flip, fluentPreset, getMotionIntensity, haptic, linearEasing, loadingBar, morphPath, pageTransition, prefersReducedMotion, projectInertia, readScrollProgress, resolvePosition, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsViewTransitions, themeTransition, timeline, toast, viewTransition };
|
|
1918
|
+
export type { AmbientEffect, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, ConnectedOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, MotionIntensity, PageEffect, PageTransitionOptions, Placement, RevealEffect, ScrubOptions, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, Timeline, TimelineOptions, TimelinePosition, TimelineStepOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAuroraElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCursorElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFlipListElement, UsaFullpageElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaParticlesElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaTimelineElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
package/dist/components.d.ts
CHANGED
|
@@ -425,7 +425,7 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
425
425
|
* `<usa-spinner>` — indeterminate loading indicators, pure CSS animations
|
|
426
426
|
* of `transform` / `opacity` (plus an SVG stroke for `fluent`).
|
|
427
427
|
*
|
|
428
|
-
* Kinds (`kind
|
|
428
|
+
* Kinds (`kind`): `fluent` (default — the WinUI / Windows 11
|
|
429
429
|
* ProgressRing arc), `windows` (the Windows 10 boot "orbiting dots"),
|
|
430
430
|
* `ring` (classic border spinner), `dots` (three bouncing dots / typing
|
|
431
431
|
* indicator), `pulse` (expanding ripple), `bars` (equalizer).
|
|
@@ -437,8 +437,6 @@ type SpinnerVariant = (typeof SPINNER_VARIANTS)[number];
|
|
|
437
437
|
interface UsaSpinnerElement extends UsaElement {
|
|
438
438
|
/** Spinner kind (`kind` attribute). */
|
|
439
439
|
kind: SpinnerVariant;
|
|
440
|
-
/** @deprecated alias of `kind`, removed in 3.0. */
|
|
441
|
-
variant: SpinnerVariant;
|
|
442
440
|
}
|
|
443
441
|
declare function defineSpinner(tag?: string): CustomElementConstructor | undefined;
|
|
444
442
|
|
|
@@ -524,7 +522,7 @@ declare function toast(message: string, options?: ToastOptions): ToastHandle | n
|
|
|
524
522
|
* `<usa-check>` — an animated result icon: the circle draws itself, then the
|
|
525
523
|
* check mark (or cross / exclamation) strokes in with a little pop.
|
|
526
524
|
*
|
|
527
|
-
* Attributes: `
|
|
525
|
+
* Attributes: `kind` (`success` default, `error`, `warning`), `size`
|
|
528
526
|
* (px, 56), `start` (`view` default | `load` | `manual`), `label`
|
|
529
527
|
* (accessible name, e.g. "Payment complete"; the icon is decorative
|
|
530
528
|
* without it). Event: `usa:complete`. Reduced motion: drawn instantly.
|
|
@@ -619,7 +617,7 @@ declare function defineMarquee(tag?: string): CustomElementConstructor | undefin
|
|
|
619
617
|
* tints from `--usa-mica-source`, a gradient you control). Optional
|
|
620
618
|
* `shimmer` adds a light sweep when it appears or on hover.
|
|
621
619
|
*
|
|
622
|
-
* Attributes: `kind` (`acrylic` default | `mica
|
|
620
|
+
* Attributes: `kind` (`acrylic` default | `mica`), `tint` (colour),
|
|
623
621
|
* `tint-opacity` (0–1, 0.55), `blur` (px, 30), `shimmer`
|
|
624
622
|
* (`hover` | `load` | `none`, default `none`). Falls back to a solid tint
|
|
625
623
|
* without `backdrop-filter` and under `prefers-reduced-transparency` or
|
|
@@ -715,7 +713,7 @@ type DialogVariant = 'modal' | 'drawer-start' | 'drawer-end' | 'drawer-bottom' |
|
|
|
715
713
|
* React / Vue / Svelte keep owning them). Style with `::part(panel)`,
|
|
716
714
|
* `::part(backdrop)` and the `--usa-dialog-*` custom properties.
|
|
717
715
|
*
|
|
718
|
-
* Attributes: `open` (reflects; set/remove to open/close), `
|
|
716
|
+
* Attributes: `open` (reflects; set/remove to open/close), `kind`
|
|
719
717
|
* (`modal` default — Fluent scale + fade; `drawer-start` / `drawer-end`
|
|
720
718
|
* slide from the side, `drawer-bottom` / `sheet` from below), `label`
|
|
721
719
|
* (accessible name), `no-backdrop-close`, `no-esc`. Elements inside
|
|
@@ -1776,6 +1774,123 @@ declare global {
|
|
|
1776
1774
|
}
|
|
1777
1775
|
}
|
|
1778
1776
|
|
|
1777
|
+
/**
|
|
1778
|
+
* Where a step starts on a timeline:
|
|
1779
|
+
* - a number: absolute time in ms
|
|
1780
|
+
* - `'>'` (default): when the previous step ends · `'<'`: when it starts
|
|
1781
|
+
* - `'+=200'` / `'-=200'`: after / overlapping the previous end
|
|
1782
|
+
* - `'<+=100'`: 100ms after the previous step's start
|
|
1783
|
+
* - `'intro'` / `'intro+=150'`: at (or relative to) a label
|
|
1784
|
+
*/
|
|
1785
|
+
type TimelinePosition = number | string;
|
|
1786
|
+
interface TimelineStepOptions {
|
|
1787
|
+
/** Duration in ms (default: timeline default, 600). */
|
|
1788
|
+
duration?: number;
|
|
1789
|
+
/** CSS easing (default `cubic-bezier(0.22, 1, 0.36, 1)`). */
|
|
1790
|
+
easing?: string;
|
|
1791
|
+
/** Start position, see `TimelinePosition`. */
|
|
1792
|
+
at?: TimelinePosition;
|
|
1793
|
+
/** ms between targets when the selector matches several elements. */
|
|
1794
|
+
stagger?: number;
|
|
1795
|
+
}
|
|
1796
|
+
interface TimelineOptions {
|
|
1797
|
+
/** Defaults for every step. */
|
|
1798
|
+
defaults?: Pick<TimelineStepOptions, 'duration' | 'easing' | 'stagger'>;
|
|
1799
|
+
/** Playback rate (1 = normal). */
|
|
1800
|
+
speed?: number;
|
|
1801
|
+
/** Called after `play()` reaches the end (or the start when reversed). */
|
|
1802
|
+
onComplete?: () => void;
|
|
1803
|
+
/** Called on every frame with progress 0–1. */
|
|
1804
|
+
onUpdate?: (progress: number) => void;
|
|
1805
|
+
}
|
|
1806
|
+
interface ScrubOptions {
|
|
1807
|
+
/** Scroll offset (px) before the source's top reaches the viewport bottom where progress starts. */
|
|
1808
|
+
offset?: number;
|
|
1809
|
+
/** Smoothing 0–1 (0 = immediate, default 0). */
|
|
1810
|
+
smooth?: number;
|
|
1811
|
+
}
|
|
1812
|
+
interface Timeline {
|
|
1813
|
+
/** Total length in ms. */
|
|
1814
|
+
readonly duration: number;
|
|
1815
|
+
/** Label positions in ms. */
|
|
1816
|
+
readonly labels: Readonly<Record<string, number>>;
|
|
1817
|
+
/** Current playhead in ms. */
|
|
1818
|
+
readonly time: number;
|
|
1819
|
+
/** Add a step: animate `target` with keyframes or a preset name (`fade-up`, `scale`…). */
|
|
1820
|
+
to(target: string | Element | Element[] | NodeList, frames: Keyframe[] | string, options?: TimelineStepOptions): Timeline;
|
|
1821
|
+
/** Name a position (default: the current end). */
|
|
1822
|
+
label(name: string, at?: TimelinePosition): Timeline;
|
|
1823
|
+
/** Run `fn` when the playhead passes `at`. */
|
|
1824
|
+
call(fn: () => void, at?: TimelinePosition): Timeline;
|
|
1825
|
+
/** Play forwards from the playhead (from 0 when at the end). Resolves at the end. */
|
|
1826
|
+
play(from?: TimelinePosition): Promise<void>;
|
|
1827
|
+
/** Play backwards to 0. */
|
|
1828
|
+
reverse(): Promise<void>;
|
|
1829
|
+
pause(): Timeline;
|
|
1830
|
+
/** Jump to a time (ms) or label. */
|
|
1831
|
+
seek(to: TimelinePosition): Timeline;
|
|
1832
|
+
/** Get or set progress 0–1. */
|
|
1833
|
+
progress(p?: number): number;
|
|
1834
|
+
/** Tie progress to the scroll position of `source` (it moves through the viewport). Returns a stop function. */
|
|
1835
|
+
scrub(source: Element, options?: ScrubOptions): () => void;
|
|
1836
|
+
/** Stop and drop every animation (elements keep their last frame). */
|
|
1837
|
+
cancel(): void;
|
|
1838
|
+
}
|
|
1839
|
+
/** Keyframe presets usable by name in `to()` and `data-tl`. */
|
|
1840
|
+
declare const TIMELINE_PRESETS: Record<string, Keyframe[]>;
|
|
1841
|
+
/** Resolve a position against the previous step and labels (pure). */
|
|
1842
|
+
declare function resolvePosition(pos: TimelinePosition | undefined, end: number, prevStart: number, labels?: Record<string, number>): number;
|
|
1843
|
+
/**
|
|
1844
|
+
* Choreograph animations on one clock: chain, overlap, label, seek, reverse and
|
|
1845
|
+
* scrub them with scroll. Built on WAAPI (paused animations driven by one
|
|
1846
|
+
* playhead); without WAAPI or under reduced motion it jumps to the end state.
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* const tl = timeline({ defaults: { duration: 500 } })
|
|
1850
|
+
* .to('.title', 'fade-up')
|
|
1851
|
+
* .label('cards')
|
|
1852
|
+
* .to('.card', 'scale', { stagger: 80, at: '-=200' })
|
|
1853
|
+
* .to('.cta', [{ opacity: 0 }, { opacity: 1 }], { at: 'cards+=400' });
|
|
1854
|
+
* tl.play(); // or tl.scrub(document.querySelector('.hero'))
|
|
1855
|
+
*/
|
|
1856
|
+
declare function timeline(options?: TimelineOptions): Timeline;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* `<usa-timeline>` — declarative choreography. Every descendant with
|
|
1860
|
+
* `data-tl="<preset>"` becomes a step, in document order; `data-at`
|
|
1861
|
+
* (`'-=200'`, `'<'`, `'label+=100'`, ms), `data-duration` and `data-label`
|
|
1862
|
+
* fine-tune it.
|
|
1863
|
+
*
|
|
1864
|
+
* Attributes: `trigger` (`view` default · `click` · `manual`), `scrub`
|
|
1865
|
+
* (progress follows scroll instead of playing), `overlap` (ms each step
|
|
1866
|
+
* overlaps the previous, default 0), `duration` (600), `stagger` (ms),
|
|
1867
|
+
* `repeat` (replay every time it enters the viewport). Methods: `play()`,
|
|
1868
|
+
* `reverse()`, `seek(t)`; property `timeline`. Event `usa:complete`.
|
|
1869
|
+
* Reduced motion: steps appear in their final state.
|
|
1870
|
+
*/
|
|
1871
|
+
interface UsaTimelineElement extends UsaElement {
|
|
1872
|
+
readonly timeline: Timeline | null;
|
|
1873
|
+
play(): Promise<void>;
|
|
1874
|
+
reverse(): Promise<void>;
|
|
1875
|
+
seek(to: number | string): void;
|
|
1876
|
+
}
|
|
1877
|
+
declare function defineTimeline(tag?: string): CustomElementConstructor | undefined;
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* use-scroll-animate/components/timeline — choreography (v3.1).
|
|
1881
|
+
* `timeline()` chains, overlaps, labels, seeks, reverses and scroll-scrubs
|
|
1882
|
+
* WAAPI animations on one playhead; `<usa-timeline>` builds one from
|
|
1883
|
+
* `data-tl` children.
|
|
1884
|
+
*/
|
|
1885
|
+
|
|
1886
|
+
/** Register every component of this category under its default tag. */
|
|
1887
|
+
declare function defineTimelineComponents(): void;
|
|
1888
|
+
declare global {
|
|
1889
|
+
interface HTMLElementTagNameMap {
|
|
1890
|
+
'usa-timeline': UsaTimelineElement;
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1779
1894
|
/** The component categories and their default tags. */
|
|
1780
1895
|
declare const COMPONENT_CATEGORIES: {
|
|
1781
1896
|
readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
|
|
@@ -1789,6 +1904,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
1789
1904
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
1790
1905
|
readonly ui: readonly ["usa-tabs", "usa-drawer", "usa-bottom-sheet", "usa-pull-refresh", "usa-fab", "usa-navbar", "usa-slider", "usa-rating", "usa-tooltip", "usa-popover", "usa-badge", "usa-avatar-stack"];
|
|
1791
1906
|
readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
|
|
1907
|
+
readonly timeline: readonly ["usa-timeline"];
|
|
1792
1908
|
};
|
|
1793
1909
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
1794
1910
|
|
|
@@ -1798,5 +1914,5 @@ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
|
1798
1914
|
*/
|
|
1799
1915
|
declare function defineComponents(categories?: ComponentCategory[]): void;
|
|
1800
1916
|
|
|
1801
|
-
export { AMBIENT_EFFECTS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, VARIANTS, adoptVariants, burst, confetti, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAurora, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCursor, defineDialog, defineDotNetwork, defineDoubleTap, defineDraggable, defineDrawer, defineFab, defineFeedbackComponents, defineFlipList, defineFullpage, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLike, defineLoadingBar, defineMagnetic, defineMarquee, defineMotionSwitch, defineNavbar, defineOverscroll, definePageComponents, defineParticles, definePhysicsComponents, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, easeOutExpo, enableMpaTransitions, flip, fluentPreset, getMotionIntensity, haptic, linearEasing, loadingBar, morphPath, pageTransition, prefersReducedMotion, projectInertia, readScrollProgress, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsViewTransitions, themeTransition, toast, viewTransition };
|
|
1802
|
-
export type { AmbientEffect, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, ConnectedOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, MotionIntensity, PageEffect, PageTransitionOptions, Placement, RevealEffect, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAuroraElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCursorElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFlipListElement, UsaFullpageElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaParticlesElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
|
1917
|
+
export { AMBIENT_EFFECTS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, burst, confetti, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAurora, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCursor, defineDialog, defineDotNetwork, defineDoubleTap, defineDraggable, defineDrawer, defineFab, defineFeedbackComponents, defineFlipList, defineFullpage, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLike, defineLoadingBar, defineMagnetic, defineMarquee, defineMotionSwitch, defineNavbar, defineOverscroll, definePageComponents, defineParticles, definePhysicsComponents, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineTimeline, defineTimelineComponents, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, easeOutExpo, enableMpaTransitions, flip, fluentPreset, getMotionIntensity, haptic, linearEasing, loadingBar, morphPath, pageTransition, prefersReducedMotion, projectInertia, readScrollProgress, resolvePosition, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsViewTransitions, themeTransition, timeline, toast, viewTransition };
|
|
1918
|
+
export type { AmbientEffect, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, ConnectedOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, MotionIntensity, PageEffect, PageTransitionOptions, Placement, RevealEffect, ScrubOptions, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, Timeline, TimelineOptions, TimelinePosition, TimelineStepOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAuroraElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCursorElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFlipListElement, UsaFullpageElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaParticlesElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaTimelineElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
package/dist/components.js
CHANGED
|
@@ -20,12 +20,14 @@ import { defineUiComponents } from './components/ui.js';
|
|
|
20
20
|
export { defineAvatarStack, defineBadge, defineBottomSheet, defineDrawer, defineFab, defineNavbar, definePopover, definePullRefresh, defineRating, defineSlider, defineTabs, defineTooltip } from './components/ui.js';
|
|
21
21
|
import { definePageComponents } from './components/page.js';
|
|
22
22
|
export { AMBIENT_EFFECTS, CURSOR_MODES, PAGE_EFFECTS, defineAmbient, defineAutoSkeleton, defineBackToTop, defineCursor, defineFullpage, defineLoadingBar, defineMotionSwitch, defineSplash, enableMpaTransitions, loadingBar, pageTransition, restoreMotionIntensity, scrollToTarget, setMotionIntensity, smoothScroll, supportsViewTransitions, themeTransition } from './components/page.js';
|
|
23
|
-
import {
|
|
24
|
-
export {
|
|
25
|
-
import {
|
|
26
|
-
export {
|
|
27
|
-
|
|
28
|
-
export {
|
|
23
|
+
import { defineTimelineComponents } from './components/timeline.js';
|
|
24
|
+
export { TIMELINE_PRESETS, defineTimeline, resolvePosition, timeline } from './components/timeline.js';
|
|
25
|
+
import { a as adoptVariants } from './chunks/variants-BQ3gCb5L.js';
|
|
26
|
+
export { V as VARIANTS, s as setVariant } from './chunks/variants-BQ3gCb5L.js';
|
|
27
|
+
import { c as canDefine } from './chunks/base-Cu-86Z31.js';
|
|
28
|
+
export { M as MOTION_SCALE, a as configureComponents, g as getMotionIntensity, p as prefersReducedMotion } from './chunks/base-Cu-86Z31.js';
|
|
29
|
+
export { C as COMPONENT_CATEGORIES } from './chunks/index-tags-D7NynL4r.js';
|
|
30
|
+
export { S as SPRING_PRESETS, c as createSpring, l as linearEasing, p as projectInertia, r as resolveSpring, a as rubberBand, s as snapTo, b as spring, d as springEasing, e as springSamples, f as stepSpring, g as supportsLinearEasing } from './chunks/spring-BV-cpTHC.js';
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* use-scroll-animate/components
|
|
@@ -59,6 +61,7 @@ const BY_CATEGORY = {
|
|
|
59
61
|
click: defineClickComponents,
|
|
60
62
|
ui: defineUiComponents,
|
|
61
63
|
page: definePageComponents,
|
|
64
|
+
timeline: defineTimelineComponents,
|
|
62
65
|
};
|
|
63
66
|
/**
|
|
64
67
|
* Register every `<usa-*>` component (or only the given categories).
|
|
@@ -70,5 +73,5 @@ function defineComponents(categories) {
|
|
|
70
73
|
(categories || Object.keys(BY_CATEGORY)).forEach((c) => BY_CATEGORY[c]?.());
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
export { adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineFeedbackComponents, defineInteractionComponents, definePageComponents, definePhysicsComponents, defineRevealComponents, defineTextComponents, defineTransitionComponents, defineUiComponents };
|
|
76
|
+
export { adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineFeedbackComponents, defineInteractionComponents, definePageComponents, definePhysicsComponents, defineRevealComponents, defineTextComponents, defineTimelineComponents, defineTransitionComponents, defineUiComponents };
|
|
74
77
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\n\nexport { COMPONENT_CATEGORIES } from './index-tags';\nexport type { ComponentCategory } from './index-tags';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n click: defineClickComponents,\n ui: defineUiComponents,\n page: definePageComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n if (canDefine()) adoptVariants();\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { definePageComponents } from './page/index';\nimport { defineTimelineComponents } from './timeline/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\nexport * from './page/index';\nexport * from './timeline/index';\n\nexport { COMPONENT_CATEGORIES } from './index-tags';\nexport type { ComponentCategory } from './index-tags';\nimport { COMPONENT_CATEGORIES, type ComponentCategory } from './index-tags';\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n click: defineClickComponents,\n ui: defineUiComponents,\n page: definePageComponents,\n timeline: defineTimelineComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n if (canDefine()) adoptVariants();\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAiCH,MAAM,WAAW,GAA0C;AACzD,IAAA,MAAM,EAAE,sBAAsB;AAC9B,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,2BAA2B;AACxC,IAAA,QAAQ,EAAE,wBAAwB;AAClC,IAAA,UAAU,EAAE,0BAA0B;AACtC,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,KAAK,EAAE,qBAAqB;AAC5B,IAAA,EAAE,EAAE,kBAAkB;AACtB,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,QAAQ,EAAE,wBAAwB;CACnC;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAAgC,EAAA;AAC/D,IAAA,IAAI,SAAS,EAAE;AAAE,QAAA,aAAa,EAAE;IAChC,CAAC,UAAU,IAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACtG;;;;"}
|