use-scroll-animate 3.8.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/README.md +17 -14
- package/README_ja.md +11 -11
- package/README_zh.md +12 -12
- package/dist/chunks/{base-BpROOcey.js → base-ZARFccur.js} +2 -2
- package/dist/chunks/{base-BpROOcey.js.map → base-ZARFccur.js.map} +1 -1
- package/dist/chunks/core-Co-6AL0h.js +218 -0
- package/dist/chunks/core-Co-6AL0h.js.map +1 -0
- package/dist/chunks/{core-uxs3ETou.js → core-DKY-fVzR.js} +2 -2
- package/dist/chunks/{core-uxs3ETou.js.map → core-DKY-fVzR.js.map} +1 -1
- package/dist/chunks/core-DXqZm5Il.cjs +222 -0
- package/dist/chunks/core-DXqZm5Il.cjs.map +1 -0
- package/dist/chunks/{index-tags-BANJ-e4H.js → index-tags-43Xtd01A.js} +3 -2
- package/dist/chunks/index-tags-43Xtd01A.js.map +1 -0
- package/dist/chunks/{index-tags-wbuPiMR6.cjs → index-tags-BQh_uGqH.cjs} +3 -2
- package/dist/chunks/index-tags-BQh_uGqH.cjs.map +1 -0
- package/dist/chunks/{spring-C-fw7_9f.js → spring-E2ickYNI.js} +2 -2
- package/dist/chunks/{spring-C-fw7_9f.js.map → spring-E2ickYNI.js.map} +1 -1
- package/dist/chunks/{variants-CHe1VbSn.js → variants-DvnxvRCM.js} +2 -2
- package/dist/chunks/{variants-CHe1VbSn.js.map → variants-DvnxvRCM.js.map} +1 -1
- package/dist/components/angular.cjs +3 -1
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +29 -17
- package/dist/components/angular.d.ts +29 -17
- package/dist/components/angular.js +7 -5
- package/dist/components/angular.js.map +1 -1
- package/dist/components/background.js +3 -3
- package/dist/components/cards.js +3 -3
- package/dist/components/click.js +3 -3
- package/dist/components/depth.js +4 -4
- package/dist/components/feedback.js +2 -2
- package/dist/components/gesture.js +5 -5
- package/dist/components/interaction.js +2 -2
- package/dist/components/jsx.d.cts +2 -1
- package/dist/components/jsx.d.ts +2 -1
- package/dist/components/layout.js +2 -2
- package/dist/components/lazy.cjs +2 -1
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +2 -1
- package/dist/components/lazy.d.ts +2 -1
- package/dist/components/lazy.js +2 -1
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/packs.cjs +194 -0
- package/dist/components/packs.cjs.map +1 -0
- package/dist/components/packs.css +3 -0
- package/dist/components/packs.d.cts +107 -0
- package/dist/components/packs.d.ts +107 -0
- package/dist/components/packs.js +185 -0
- package/dist/components/packs.js.map +1 -0
- package/dist/components/page.js +3 -3
- package/dist/components/physics.js +4 -4
- package/dist/components/react.cjs +2 -2
- package/dist/components/react.cjs.map +1 -1
- package/dist/components/react.d.cts +1 -1
- package/dist/components/react.d.ts +1 -1
- package/dist/components/react.js +2 -2
- package/dist/components/react.js.map +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/solid.cjs +3 -1
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +29 -17
- package/dist/components/solid.d.ts +29 -17
- package/dist/components/solid.js +7 -5
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +3 -1
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +29 -17
- package/dist/components/svelte.d.ts +29 -17
- package/dist/components/svelte.js +7 -5
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.js +2 -2
- package/dist/components/text.js +2 -2
- package/dist/components/timeline.cjs +6 -219
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.js +5 -217
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/transitions.cjs +7 -120
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.css +0 -1
- package/dist/components/transitions.d.cts +5 -32
- package/dist/components/transitions.d.ts +5 -32
- package/dist/components/transitions.js +10 -121
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.js +5 -5
- package/dist/components/vue.cjs +3 -1
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +29 -17
- package/dist/components/vue.d.ts +29 -17
- package/dist/components/vue.js +7 -5
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.js +2 -2
- package/dist/components.cjs +18 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.d.cts +67 -33
- package/dist/components.d.ts +67 -33
- package/dist/components.js +14 -10
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.cjs +5 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -30
- package/dist/index.d.ts +72 -30
- package/dist/index.js +4 -103
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/docs/API.md +6 -6
- package/docs/ROADMAP.md +14 -0
- package/docs/components.md +16 -4
- package/docs/migration-from-aos.md +1 -1
- package/docs/migration-from-gsap-scrolltrigger.md +6 -6
- package/docs/upgrading-4.md +65 -0
- package/package.json +13 -2
- package/dist/chunks/index-tags-BANJ-e4H.js.map +0 -1
- package/dist/chunks/index-tags-wbuPiMR6.cjs.map +0 -1
package/dist/components.css
CHANGED
|
@@ -29,7 +29,6 @@ usa-marquee{--usa-marquee-gap:32px;display:block;overflow:hidden;contain:content
|
|
|
29
29
|
usa-particles{position:relative;display:block;min-height:120px;overflow:hidden}usa-particles>canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
|
|
30
30
|
usa-accordion{display:block}usa-accordion>details>summary{cursor:pointer}usa-accordion>details>summary::-webkit-details-marker{display:none}usa-accordion>details>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:1em}usa-accordion>details>summary::after{content:"";flex:none;width:0.5em;height:0.5em;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-25%) rotate(45deg);transition:transform 0.3s cubic-bezier(0.22,1,0.36,1);opacity:0.7}usa-accordion>details[open]:not([data-closing])>summary::after{transform:translateY(25%) rotate(-135deg)}@media (prefers-reduced-motion:reduce){usa-accordion>details>summary::after{transition:none}}
|
|
31
31
|
usa-dialog{display:contents}usa-dialog:not(:defined){display:none}
|
|
32
|
-
usa-flip-list{display:block}
|
|
33
32
|
usa-view-switch{display:grid}usa-view-switch>*{grid-area:1 / 1;min-width:0}usa-view-switch>[hidden]:not([data-leaving]){display:none !important}usa-view-switch>[data-leaving]{display:block;pointer-events:none}
|
|
34
33
|
usa-draggable{display:inline-block;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;will-change:transform;-webkit-tap-highlight-color:transparent}usa-draggable[axis="x"]{touch-action:pan-y}usa-draggable[axis="y"]{touch-action:pan-x}usa-draggable[block]{display:block}usa-draggable[data-dragging]{cursor:grabbing}usa-draggable[disabled]{cursor:default}usa-draggable:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}
|
|
35
34
|
usa-overscroll{display:block;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}usa-overscroll[axis="x"]{overflow-y:hidden}usa-overscroll>*{transform:translate3d(0,var(--usa-overscroll,0px),0)}usa-overscroll[axis="x"]>*{transform:translate3d(var(--usa-overscroll,0px),0,0)}usa-overscroll[data-stretched]>*{will-change:transform}
|
|
@@ -72,3 +71,4 @@ usa-draw{display:inline-block}usa-draw svg :is(path,line,polyline,polygon,circle
|
|
|
72
71
|
usa-shader,usa-distort,usa-liquid{display:block;position:relative;isolation:isolate;overflow:hidden}usa-shader{background:linear-gradient(120deg,#6366f1,#ec4899 50%,#22d3ee)}usa-shader>canvas.usa-gl{position:absolute;inset:0;width:100%;height:100%;z-index:-1;display:block}usa-distort>canvas.usa-gl,usa-liquid>canvas.usa-gl{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none}usa-distort>img,usa-liquid>img{display:block;width:100%;height:auto}usa-distort[data-active]>img,usa-liquid[data-active]>img{visibility:hidden}usa-distort[data-fallback]>img{transition:transform 0.6s cubic-bezier(0.22,1,0.36,1),filter 0.6s}usa-distort[data-fallback]:hover>img{transform:scale(1.04);filter:saturate(1.2)}@media (prefers-reduced-motion:reduce){usa-distort[data-fallback]:hover>img{transform:none}}
|
|
73
72
|
usa-cube{--usa-cube-size:200px;display:block;width:var(--usa-cube-size);height:var(--usa-cube-size);perspective:var(--usa-cube-perspective,900px);touch-action:pan-y;user-select:none;-webkit-user-select:none;position:relative}usa-cube>[data-face]{position:absolute;inset:0;backface-visibility:hidden;transform:translateZ(calc(var(--usa-cube-size) / -2)) rotateX(var(--usa-cube-rx,0deg)) rotateY(var(--usa-cube-ry,0deg)) var(--usa-face) translateZ(calc(var(--usa-cube-size) / 2));transform-origin:50% 50%}usa-cube>[data-face="front"]{--usa-face:rotateY(0deg)}usa-cube>[data-face="right"]{--usa-face:rotateY(90deg)}usa-cube>[data-face="back"]{--usa-face:rotateY(180deg)}usa-cube>[data-face="left"]{--usa-face:rotateY(-90deg)}usa-cube>[data-face="top"]{--usa-face:rotateX(90deg)}usa-cube>[data-face="bottom"]{--usa-face:rotateX(-90deg)}usa-cube:focus-visible{outline:2px solid currentColor;outline-offset:6px}usa-depth{display:block;position:relative;perspective:1000px}usa-depth>*{transform:var(--usa-depth-rot,none);transform-style:preserve-3d}usa-depth [data-depth]{will-change:transform;transition:transform 0.12s linear}@media (prefers-reduced-motion:reduce){usa-depth [data-depth]{transform:none !important}}
|
|
74
73
|
usa-auto-animate{display:block}usa-masonry{display:block;column-width:220px;column-gap:16px}usa-masonry>*{break-inside:avoid;margin-bottom:16px}usa-masonry[data-js]{position:relative;columns:auto}usa-masonry[data-js]>*{position:absolute;left:0;top:0;margin:0;box-sizing:border-box;transition:transform 0.45s cubic-bezier(0.22,1,0.36,1)}@media (prefers-reduced-motion:reduce){usa-masonry[data-js]>*{transition:none}}
|
|
74
|
+
|
package/dist/components.d.cts
CHANGED
|
@@ -745,20 +745,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
745
745
|
}
|
|
746
746
|
declare function defineAccordion(tag?: string): CustomElementConstructor | undefined;
|
|
747
747
|
|
|
748
|
-
/**
|
|
749
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
750
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
751
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
752
|
-
*
|
|
753
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
754
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
755
|
-
* Reduced motion: no animation.
|
|
756
|
-
*/
|
|
757
|
-
interface UsaFlipListElement extends UsaElement {
|
|
758
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
759
|
-
}
|
|
760
|
-
declare function defineFlipList(tag?: string): CustomElementConstructor | undefined;
|
|
761
|
-
|
|
762
748
|
/**
|
|
763
749
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
764
750
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -815,24 +801,12 @@ type Targets = Element | Iterable<Element> | ArrayLike<Element>;
|
|
|
815
801
|
* ```
|
|
816
802
|
*/
|
|
817
803
|
declare function flip(targets: Targets, mutate: () => void | Promise<void>, options?: FlipOptions): Promise<void>;
|
|
818
|
-
interface ConnectedOptions {
|
|
819
|
-
duration?: number;
|
|
820
|
-
easing?: string;
|
|
821
|
-
/** Hide `from` while the animation runs (default true). */
|
|
822
|
-
hideSource?: boolean;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Connected (shared-element) animation, like WinUI's
|
|
826
|
-
* `ConnectedAnimationService`: `to` flies from the position and size of
|
|
827
|
-
* `from` into its own place (e.g. a thumbnail opening into a detail view).
|
|
828
|
-
* Call it right after `to` is shown. Transforms only.
|
|
829
|
-
*/
|
|
830
|
-
declare function connectedAnimation(from: Element, to: HTMLElement, options?: ConnectedOptions): Promise<void>;
|
|
831
804
|
|
|
832
805
|
/**
|
|
833
806
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
834
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
835
|
-
* and the `viewTransition()
|
|
807
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
808
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
809
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
836
810
|
*/
|
|
837
811
|
|
|
838
812
|
/** Register every component of this category under its default tag. */
|
|
@@ -841,7 +815,6 @@ declare global {
|
|
|
841
815
|
interface HTMLElementTagNameMap {
|
|
842
816
|
'usa-dialog': UsaDialogElement;
|
|
843
817
|
'usa-accordion': UsaAccordionElement;
|
|
844
|
-
'usa-flip-list': UsaFlipListElement;
|
|
845
818
|
'usa-view-switch': UsaViewSwitchElement;
|
|
846
819
|
}
|
|
847
820
|
}
|
|
@@ -2342,6 +2315,66 @@ declare global {
|
|
|
2342
2315
|
}
|
|
2343
2316
|
}
|
|
2344
2317
|
|
|
2318
|
+
/**
|
|
2319
|
+
* `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
|
|
2320
|
+
* `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
|
|
2321
|
+
* descendants opt in with `data-role` (see `PACKS`). Re-applies when
|
|
2322
|
+
* `name` changes; undone on disconnect.
|
|
2323
|
+
*/
|
|
2324
|
+
interface UsaPackElement extends UsaElement {
|
|
2325
|
+
readonly roles: string[];
|
|
2326
|
+
}
|
|
2327
|
+
declare function definePack(tag?: string): CustomElementConstructor | undefined;
|
|
2328
|
+
|
|
2329
|
+
type Cleanup = () => void;
|
|
2330
|
+
interface PackContext {
|
|
2331
|
+
root: HTMLElement;
|
|
2332
|
+
/** Index of the element among those with the same role (for staggering). */
|
|
2333
|
+
index: number;
|
|
2334
|
+
reduced: boolean;
|
|
2335
|
+
}
|
|
2336
|
+
/** Count `el`'s number up from 0 when it enters the view (keeps prefix / suffix / decimals). */
|
|
2337
|
+
declare function countUp(el: HTMLElement, duration?: number): Cleanup;
|
|
2338
|
+
/**
|
|
2339
|
+
* Fly a copy of `from` (e.g. a product image) into `to` (the cart icon) along
|
|
2340
|
+
* an arc, then bump the target. Resolves when it lands. Instant under
|
|
2341
|
+
* reduced motion (only the bump's state change, no flight).
|
|
2342
|
+
*/
|
|
2343
|
+
declare function flyToCart(from: Element, to: Element, o?: {
|
|
2344
|
+
duration?: number;
|
|
2345
|
+
}): Promise<void>;
|
|
2346
|
+
/** The five effect packs: `data-role` → primitives. */
|
|
2347
|
+
declare const PACKS: Record<string, Record<string, string[]>>;
|
|
2348
|
+
type PackName = keyof typeof PACKS;
|
|
2349
|
+
/**
|
|
2350
|
+
* Apply an effect pack to `root`: every descendant with a `data-role` the
|
|
2351
|
+
* pack knows gets its effects (staggered by index). Returns an undo function.
|
|
2352
|
+
* Reduced motion: only non-motion behaviour (e.g. the cart event) remains.
|
|
2353
|
+
*
|
|
2354
|
+
* @example
|
|
2355
|
+
* applyPack('ecommerce', document.querySelector('main'));
|
|
2356
|
+
* // <article data-role="product">… <button data-role="add-to-cart"> … <a data-role="cart">
|
|
2357
|
+
*/
|
|
2358
|
+
declare function applyPack(name: PackName | string, root?: HTMLElement | Document): Cleanup;
|
|
2359
|
+
/** Primitive names a pack uses (for docs / tooling). */
|
|
2360
|
+
declare const PACK_PRIMITIVES: string[];
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* use-scroll-animate/components/packs — effect packs (v3.9).
|
|
2364
|
+
* Ready-made motion for e-commerce, portfolio, dashboard, game UI and
|
|
2365
|
+
* landing pages: mark elements with `data-role` and apply a pack with
|
|
2366
|
+
* `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
|
|
2367
|
+
* and `countUp()`.
|
|
2368
|
+
*/
|
|
2369
|
+
|
|
2370
|
+
/** Register every component of this category under its default tag. */
|
|
2371
|
+
declare function definePacksComponents(): void;
|
|
2372
|
+
declare global {
|
|
2373
|
+
interface HTMLElementTagNameMap {
|
|
2374
|
+
'usa-pack': UsaPackElement;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2345
2378
|
/** The component categories and their default tags. */
|
|
2346
2379
|
declare const COMPONENT_CATEGORIES: {
|
|
2347
2380
|
readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
|
|
@@ -2349,7 +2382,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
2349
2382
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
2350
2383
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
2351
2384
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
2352
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
2385
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
2353
2386
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
2354
2387
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
2355
2388
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -2361,6 +2394,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
2361
2394
|
readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
|
|
2362
2395
|
readonly depth: readonly ["usa-cube", "usa-depth"];
|
|
2363
2396
|
readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
|
|
2397
|
+
readonly packs: readonly ["usa-pack"];
|
|
2364
2398
|
};
|
|
2365
2399
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
2366
2400
|
|
|
@@ -2370,5 +2404,5 @@ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
|
2370
2404
|
*/
|
|
2371
2405
|
declare function defineComponents(categories?: ComponentCategory[]): void;
|
|
2372
2406
|
|
|
2373
|
-
export { AMBIENT_EFFECTS, ANIM_ICONS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MASK_SHAPES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SHADERS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, autoAnimate, burst, confetti, configureComponents,
|
|
2374
|
-
export type { AmbientEffect, AutoAnimateOptions, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions,
|
|
2407
|
+
export { AMBIENT_EFFECTS, ANIM_ICONS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MASK_SHAPES, MORPH_ICONS, MOTION_SCALE, PACKS, PACK_PRIMITIVES, PAGE_EFFECTS, REVEAL_EFFECTS, SHADERS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, applyPack, autoAnimate, burst, confetti, configureComponents, countUp, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAnimIcon, defineAurora, defineAutoAnimate, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCube, defineCursor, defineDepth, defineDepthComponents, defineDialog, defineDistort, defineDotNetwork, defineDoubleTap, defineDraggable, defineDraw, defineDrawer, defineFab, defineFeedbackComponents, defineFullpage, defineGestureComponents, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLayoutComponents, defineLike, defineLiquid, defineLoadingBar, defineMagnetic, defineMarquee, defineMaskReveal, defineMasonry, defineMorph, defineMotionSwitch, defineNavbar, defineOverscroll, definePack, definePacksComponents, definePageComponents, defineParticles, definePhysicsComponents, definePinchZoom, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShader, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineSvgComponents, defineSwipeable, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineTimeline, defineTimelineComponents, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, defineWebglComponents, deviceTilt, drawLines, easeOutExpo, enableMpaTransitions, flip, flipFrames, fluentPreset, flyToCart, fragmentSource, gesture, getMotionIntensity, glQuad, haptic, interpolatePath, linearEasing, loadingBar, masonryLayout, morphPath, morphTo, orientationToTilt, pageTransition, pathsCompatible, pinchScale, prefersReducedMotion, projectInertia, readScrollProgress, requestOrientationPermission, resolvePosition, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, sharedTransition, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsOrientation, supportsViewTransitions, supportsWebGL, swipeDirection, themeTransition, timeline, toast, viewTransition };
|
|
2408
|
+
export type { AmbientEffect, AutoAnimateOptions, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, GLQuad, GestureHandlers, GestureOptions, MorphOptions, MotionIntensity, PackContext, PackName, PageEffect, PageTransitionOptions, PanState, PinchState, Placement, PressState, RevealEffect, ScrubOptions, SharedOptions, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, SwipeDirection, SwipeState, TiltReading, Timeline, TimelineOptions, TimelinePosition, TimelineStepOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAnimIconElement, UsaAuroraElement, UsaAutoAnimateElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCubeElement, UsaCursorElement, UsaDepthElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFullpageElement, UsaGLElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMaskRevealElement, UsaMasonryElement, UsaMorphElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaPackElement, UsaParticlesElement, UsaPinchZoomElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaSwipeableElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaTimelineElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
package/dist/components.d.ts
CHANGED
|
@@ -745,20 +745,6 @@ interface UsaAccordionElement extends UsaElement {
|
|
|
745
745
|
}
|
|
746
746
|
declare function defineAccordion(tag?: string): CustomElementConstructor | undefined;
|
|
747
747
|
|
|
748
|
-
/**
|
|
749
|
-
* `<usa-flip-list>` — animates its children to their new places whenever
|
|
750
|
-
* they are added, removed or reordered (FLIP: transforms only). Works with
|
|
751
|
-
* any rendering: plain DOM, React keyed lists, Vue `v-for`, Svelte `{#each}`.
|
|
752
|
-
*
|
|
753
|
-
* Attributes: `duration` (ms, 420), `easing`, `disabled`.
|
|
754
|
-
* Method: `flip(mutate)` for explicit changes (also measures resizes).
|
|
755
|
-
* Reduced motion: no animation.
|
|
756
|
-
*/
|
|
757
|
-
interface UsaFlipListElement extends UsaElement {
|
|
758
|
-
flip(mutate: () => void | Promise<void>): Promise<void>;
|
|
759
|
-
}
|
|
760
|
-
declare function defineFlipList(tag?: string): CustomElementConstructor | undefined;
|
|
761
|
-
|
|
762
748
|
/**
|
|
763
749
|
* `<usa-view-switch>` — shows one of its children at a time (tabs, wizard
|
|
764
750
|
* steps, app pages) and animates between them. Children are views; name
|
|
@@ -815,24 +801,12 @@ type Targets = Element | Iterable<Element> | ArrayLike<Element>;
|
|
|
815
801
|
* ```
|
|
816
802
|
*/
|
|
817
803
|
declare function flip(targets: Targets, mutate: () => void | Promise<void>, options?: FlipOptions): Promise<void>;
|
|
818
|
-
interface ConnectedOptions {
|
|
819
|
-
duration?: number;
|
|
820
|
-
easing?: string;
|
|
821
|
-
/** Hide `from` while the animation runs (default true). */
|
|
822
|
-
hideSource?: boolean;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Connected (shared-element) animation, like WinUI's
|
|
826
|
-
* `ConnectedAnimationService`: `to` flies from the position and size of
|
|
827
|
-
* `from` into its own place (e.g. a thumbnail opening into a detail view).
|
|
828
|
-
* Call it right after `to` is shown. Transforms only.
|
|
829
|
-
*/
|
|
830
|
-
declare function connectedAnimation(from: Element, to: HTMLElement, options?: ConnectedOptions): Promise<void>;
|
|
831
804
|
|
|
832
805
|
/**
|
|
833
806
|
* use-scroll-animate/components/transitions — view & layout transitions.
|
|
834
|
-
* `<usa-dialog>`, `<usa-accordion>`, `<usa-
|
|
835
|
-
* and the `viewTransition()
|
|
807
|
+
* `<usa-dialog>`, `<usa-accordion>`, `<usa-view-switch>`
|
|
808
|
+
* and the `viewTransition()` and `flip()` helpers (4.0: `<usa-flip-list>` → `<usa-auto-animate>`,
|
|
809
|
+
* `connectedAnimation()` → `sharedTransition()`, both in `components/layout`).
|
|
836
810
|
*/
|
|
837
811
|
|
|
838
812
|
/** Register every component of this category under its default tag. */
|
|
@@ -841,7 +815,6 @@ declare global {
|
|
|
841
815
|
interface HTMLElementTagNameMap {
|
|
842
816
|
'usa-dialog': UsaDialogElement;
|
|
843
817
|
'usa-accordion': UsaAccordionElement;
|
|
844
|
-
'usa-flip-list': UsaFlipListElement;
|
|
845
818
|
'usa-view-switch': UsaViewSwitchElement;
|
|
846
819
|
}
|
|
847
820
|
}
|
|
@@ -2342,6 +2315,66 @@ declare global {
|
|
|
2342
2315
|
}
|
|
2343
2316
|
}
|
|
2344
2317
|
|
|
2318
|
+
/**
|
|
2319
|
+
* `<usa-pack name="ecommerce">` — applies an effect pack (`ecommerce` ·
|
|
2320
|
+
* `portfolio` · `dashboard` · `game` · `landing`) to its subtree:
|
|
2321
|
+
* descendants opt in with `data-role` (see `PACKS`). Re-applies when
|
|
2322
|
+
* `name` changes; undone on disconnect.
|
|
2323
|
+
*/
|
|
2324
|
+
interface UsaPackElement extends UsaElement {
|
|
2325
|
+
readonly roles: string[];
|
|
2326
|
+
}
|
|
2327
|
+
declare function definePack(tag?: string): CustomElementConstructor | undefined;
|
|
2328
|
+
|
|
2329
|
+
type Cleanup = () => void;
|
|
2330
|
+
interface PackContext {
|
|
2331
|
+
root: HTMLElement;
|
|
2332
|
+
/** Index of the element among those with the same role (for staggering). */
|
|
2333
|
+
index: number;
|
|
2334
|
+
reduced: boolean;
|
|
2335
|
+
}
|
|
2336
|
+
/** Count `el`'s number up from 0 when it enters the view (keeps prefix / suffix / decimals). */
|
|
2337
|
+
declare function countUp(el: HTMLElement, duration?: number): Cleanup;
|
|
2338
|
+
/**
|
|
2339
|
+
* Fly a copy of `from` (e.g. a product image) into `to` (the cart icon) along
|
|
2340
|
+
* an arc, then bump the target. Resolves when it lands. Instant under
|
|
2341
|
+
* reduced motion (only the bump's state change, no flight).
|
|
2342
|
+
*/
|
|
2343
|
+
declare function flyToCart(from: Element, to: Element, o?: {
|
|
2344
|
+
duration?: number;
|
|
2345
|
+
}): Promise<void>;
|
|
2346
|
+
/** The five effect packs: `data-role` → primitives. */
|
|
2347
|
+
declare const PACKS: Record<string, Record<string, string[]>>;
|
|
2348
|
+
type PackName = keyof typeof PACKS;
|
|
2349
|
+
/**
|
|
2350
|
+
* Apply an effect pack to `root`: every descendant with a `data-role` the
|
|
2351
|
+
* pack knows gets its effects (staggered by index). Returns an undo function.
|
|
2352
|
+
* Reduced motion: only non-motion behaviour (e.g. the cart event) remains.
|
|
2353
|
+
*
|
|
2354
|
+
* @example
|
|
2355
|
+
* applyPack('ecommerce', document.querySelector('main'));
|
|
2356
|
+
* // <article data-role="product">… <button data-role="add-to-cart"> … <a data-role="cart">
|
|
2357
|
+
*/
|
|
2358
|
+
declare function applyPack(name: PackName | string, root?: HTMLElement | Document): Cleanup;
|
|
2359
|
+
/** Primitive names a pack uses (for docs / tooling). */
|
|
2360
|
+
declare const PACK_PRIMITIVES: string[];
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* use-scroll-animate/components/packs — effect packs (v3.9).
|
|
2364
|
+
* Ready-made motion for e-commerce, portfolio, dashboard, game UI and
|
|
2365
|
+
* landing pages: mark elements with `data-role` and apply a pack with
|
|
2366
|
+
* `<usa-pack name="…">` or `applyPack(name, root)`. Includes `flyToCart()`
|
|
2367
|
+
* and `countUp()`.
|
|
2368
|
+
*/
|
|
2369
|
+
|
|
2370
|
+
/** Register every component of this category under its default tag. */
|
|
2371
|
+
declare function definePacksComponents(): void;
|
|
2372
|
+
declare global {
|
|
2373
|
+
interface HTMLElementTagNameMap {
|
|
2374
|
+
'usa-pack': UsaPackElement;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2345
2378
|
/** The component categories and their default tags. */
|
|
2346
2379
|
declare const COMPONENT_CATEGORIES: {
|
|
2347
2380
|
readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
|
|
@@ -2349,7 +2382,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
2349
2382
|
readonly interaction: readonly ["usa-ripple", "usa-magnetic", "usa-tilt", "usa-spotlight", "usa-press", "usa-toggle"];
|
|
2350
2383
|
readonly feedback: readonly ["usa-spinner", "usa-skeleton", "usa-progress", "usa-toaster", "usa-check"];
|
|
2351
2384
|
readonly background: readonly ["usa-aurora", "usa-particles", "usa-grain", "usa-marquee", "usa-acrylic", "usa-grid-glow", "usa-blobs", "usa-water-ripple", "usa-dot-network"];
|
|
2352
|
-
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-
|
|
2385
|
+
readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-view-switch"];
|
|
2353
2386
|
readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
|
|
2354
2387
|
readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
|
|
2355
2388
|
readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
|
|
@@ -2361,6 +2394,7 @@ declare const COMPONENT_CATEGORIES: {
|
|
|
2361
2394
|
readonly webgl: readonly ["usa-shader", "usa-distort", "usa-liquid"];
|
|
2362
2395
|
readonly depth: readonly ["usa-cube", "usa-depth"];
|
|
2363
2396
|
readonly layout: readonly ["usa-auto-animate", "usa-masonry"];
|
|
2397
|
+
readonly packs: readonly ["usa-pack"];
|
|
2364
2398
|
};
|
|
2365
2399
|
type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
2366
2400
|
|
|
@@ -2370,5 +2404,5 @@ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
|
|
|
2370
2404
|
*/
|
|
2371
2405
|
declare function defineComponents(categories?: ComponentCategory[]): void;
|
|
2372
2406
|
|
|
2373
|
-
export { AMBIENT_EFFECTS, ANIM_ICONS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MASK_SHAPES, MORPH_ICONS, MOTION_SCALE, PAGE_EFFECTS, REVEAL_EFFECTS, SHADERS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, autoAnimate, burst, confetti, configureComponents,
|
|
2374
|
-
export type { AmbientEffect, AutoAnimateOptions, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions,
|
|
2407
|
+
export { AMBIENT_EFFECTS, ANIM_ICONS, BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, CURSOR_MODES, MASK_SHAPES, MORPH_ICONS, MOTION_SCALE, PACKS, PACK_PRIMITIVES, PAGE_EFFECTS, REVEAL_EFFECTS, SHADERS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, TIMELINE_PRESETS, VARIANTS, adoptVariants, applyPack, autoAnimate, burst, confetti, configureComponents, countUp, createSpring, defineAccordion, defineAcrylic, defineAmbient, defineAnimIcon, defineAurora, defineAutoAnimate, defineAutoSkeleton, defineAvatarStack, defineBackToTop, defineBackgroundComponents, defineBadge, defineBlobs, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineCube, defineCursor, defineDepth, defineDepthComponents, defineDialog, defineDistort, defineDotNetwork, defineDoubleTap, defineDraggable, defineDraw, defineDrawer, defineFab, defineFeedbackComponents, defineFullpage, defineGestureComponents, defineGlitch, defineGradientText, defineGrain, defineGridGlow, defineHandwriting, defineHold, defineIconMorph, defineInteractionComponents, defineLayoutComponents, defineLike, defineLiquid, defineLoadingBar, defineMagnetic, defineMarquee, defineMaskReveal, defineMasonry, defineMorph, defineMotionSwitch, defineNavbar, defineOverscroll, definePack, definePacksComponents, definePageComponents, defineParticles, definePhysicsComponents, definePinchZoom, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollHighlight, defineScrollProgress, defineScrolly, defineShader, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplash, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineSvgComponents, defineSwipeable, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineTimeline, defineTimelineComponents, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, defineWaterRipple, defineWaveText, defineWebglComponents, deviceTilt, drawLines, easeOutExpo, enableMpaTransitions, flip, flipFrames, fluentPreset, flyToCart, fragmentSource, gesture, getMotionIntensity, glQuad, haptic, interpolatePath, linearEasing, loadingBar, masonryLayout, morphPath, morphTo, orientationToTilt, pageTransition, pathsCompatible, pinchScale, prefersReducedMotion, projectInertia, readScrollProgress, requestOrientationPermission, resolvePosition, resolveSpring, restoreMotionIntensity, revealKeyframes, rubberBand, scrambleFrame, scrollToTarget, setMotionIntensity, setVariant, shake, sharedTransition, smoothScroll, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, supportsOrientation, supportsViewTransitions, supportsWebGL, swipeDirection, themeTransition, timeline, toast, viewTransition };
|
|
2408
|
+
export type { AmbientEffect, AutoAnimateOptions, BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, CursorMode, DialogVariant, FlipOptions, FluentPresetOptions, GLQuad, GestureHandlers, GestureOptions, MorphOptions, MotionIntensity, PackContext, PackName, PageEffect, PageTransitionOptions, PanState, PinchState, Placement, PressState, RevealEffect, ScrubOptions, SharedOptions, SmoothScrollOptions, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, SwipeDirection, SwipeState, TiltReading, Timeline, TimelineOptions, TimelinePosition, TimelineStepOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAmbientElement, UsaAnimIconElement, UsaAuroraElement, UsaAutoAnimateElement, UsaAutoSkeletonElement, UsaAvatarStackElement, UsaBackToTopElement, UsaBadgeElement, UsaBlobsElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaCubeElement, UsaCursorElement, UsaDepthElement, UsaDialogElement, UsaDotNetworkElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFullpageElement, UsaGLElement, UsaGlitchElement, UsaGradientTextElement, UsaGrainElement, UsaGridGlowElement, UsaHandwritingElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaLoadingBarElement, UsaMagneticElement, UsaMarqueeElement, UsaMaskRevealElement, UsaMasonryElement, UsaMorphElement, UsaMotionSwitchElement, UsaNavbarElement, UsaOverscrollElement, UsaPackElement, UsaParticlesElement, UsaPinchZoomElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollHighlightElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplashElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaSwipeableElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaTimelineElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, UsaWaterRippleElement, UsaWaveTextElement, Variant, ViewTransitionOptions };
|
package/dist/components.js
CHANGED
|
@@ -9,7 +9,7 @@ export { SPINNER_VARIANTS, defineCheck, defineProgress, defineSkeleton, defineSp
|
|
|
9
9
|
import { defineBackgroundComponents } from './components/background.js';
|
|
10
10
|
export { defineAcrylic, defineAurora, defineBlobs, defineDotNetwork, defineGrain, defineGridGlow, defineMarquee, defineParticles, defineWaterRipple, fluentPreset } from './components/background.js';
|
|
11
11
|
import { defineTransitionComponents } from './components/transitions.js';
|
|
12
|
-
export {
|
|
12
|
+
export { defineAccordion, defineDialog, defineViewSwitch, flip, viewTransition } from './components/transitions.js';
|
|
13
13
|
import { definePhysicsComponents } from './components/physics.js';
|
|
14
14
|
export { SPRING_EFFECTS, defineDraggable, defineOverscroll, defineSpring, springEffectKeyframes } from './components/physics.js';
|
|
15
15
|
import { defineCardComponents } from './components/cards.js';
|
|
@@ -21,7 +21,7 @@ export { defineAvatarStack, defineBadge, defineBottomSheet, defineDrawer, define
|
|
|
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
23
|
import { defineTimelineComponents } from './components/timeline.js';
|
|
24
|
-
export {
|
|
24
|
+
export { defineTimeline } from './components/timeline.js';
|
|
25
25
|
import { defineGestureComponents } from './components/gesture.js';
|
|
26
26
|
export { definePinchZoom, defineSwipeable } from './components/gesture.js';
|
|
27
27
|
import { defineSvgComponents } from './components/svg.js';
|
|
@@ -32,13 +32,16 @@ import { defineDepthComponents } from './components/depth.js';
|
|
|
32
32
|
export { defineCube, defineDepth, deviceTilt, orientationToTilt, requestOrientationPermission, supportsOrientation } from './components/depth.js';
|
|
33
33
|
import { defineLayoutComponents } from './components/layout.js';
|
|
34
34
|
export { autoAnimate, defineAutoAnimate, defineMasonry, flipFrames, masonryLayout, sharedTransition } from './components/layout.js';
|
|
35
|
-
import {
|
|
36
|
-
export {
|
|
37
|
-
import {
|
|
38
|
-
export {
|
|
39
|
-
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
35
|
+
import { definePacksComponents } from './components/packs.js';
|
|
36
|
+
export { PACKS, PACK_PRIMITIVES, applyPack, countUp, definePack, flyToCart } from './components/packs.js';
|
|
37
|
+
import { a as adoptVariants } from './chunks/variants-DvnxvRCM.js';
|
|
38
|
+
export { V as VARIANTS, s as setVariant } from './chunks/variants-DvnxvRCM.js';
|
|
39
|
+
import { c as canDefine } from './chunks/base-ZARFccur.js';
|
|
40
|
+
export { M as MOTION_SCALE, a as configureComponents, g as getMotionIntensity, p as prefersReducedMotion } from './chunks/base-ZARFccur.js';
|
|
41
|
+
export { C as COMPONENT_CATEGORIES } from './chunks/index-tags-43Xtd01A.js';
|
|
42
|
+
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-E2ickYNI.js';
|
|
43
|
+
export { T as TIMELINE_PRESETS, r as resolvePosition, t as timeline } from './chunks/core-Co-6AL0h.js';
|
|
44
|
+
export { g as gesture, p as pinchScale, s as swipeDirection } from './chunks/core-DKY-fVzR.js';
|
|
42
45
|
|
|
43
46
|
/**
|
|
44
47
|
* use-scroll-animate/components
|
|
@@ -78,6 +81,7 @@ const BY_CATEGORY = {
|
|
|
78
81
|
webgl: defineWebglComponents,
|
|
79
82
|
depth: defineDepthComponents,
|
|
80
83
|
layout: defineLayoutComponents,
|
|
84
|
+
packs: definePacksComponents,
|
|
81
85
|
};
|
|
82
86
|
/**
|
|
83
87
|
* Register every `<usa-*>` component (or only the given categories).
|
|
@@ -89,5 +93,5 @@ function defineComponents(categories) {
|
|
|
89
93
|
(categories || Object.keys(BY_CATEGORY)).forEach((c) => BY_CATEGORY[c]?.());
|
|
90
94
|
}
|
|
91
95
|
|
|
92
|
-
export { adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineDepthComponents, defineFeedbackComponents, defineGestureComponents, defineInteractionComponents, defineLayoutComponents, definePageComponents, definePhysicsComponents, defineRevealComponents, defineSvgComponents, defineTextComponents, defineTimelineComponents, defineTransitionComponents, defineUiComponents, defineWebglComponents };
|
|
96
|
+
export { adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineDepthComponents, defineFeedbackComponents, defineGestureComponents, defineInteractionComponents, defineLayoutComponents, definePacksComponents, definePageComponents, definePhysicsComponents, defineRevealComponents, defineSvgComponents, defineTextComponents, defineTimelineComponents, defineTransitionComponents, defineUiComponents, defineWebglComponents };
|
|
93
97
|
//# 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 { defineTimelineComponents } from './timeline/index';\nimport { defineGestureComponents } from './gesture/index';\nimport { defineSvgComponents } from './svg/index';\nimport { defineWebglComponents } from './webgl/index';\nimport { defineDepthComponents } from './depth/index';\nimport { defineLayoutComponents } from './layout/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';\nexport * from './gesture/index';\nexport * from './svg/index';\nexport * from './webgl/index';\nexport * from './depth/index';\nexport * from './layout/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 gesture: defineGestureComponents,\n svg: defineSvgComponents,\n webgl: defineWebglComponents,\n depth: defineDepthComponents,\n layout: defineLayoutComponents,\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 { defineGestureComponents } from './gesture/index';\nimport { defineSvgComponents } from './svg/index';\nimport { defineWebglComponents } from './webgl/index';\nimport { defineDepthComponents } from './depth/index';\nimport { defineLayoutComponents } from './layout/index';\nimport { definePacksComponents } from './packs/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';\nexport * from './gesture/index';\nexport * from './svg/index';\nexport * from './webgl/index';\nexport * from './depth/index';\nexport * from './layout/index';\nexport * from './packs/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 gesture: defineGestureComponents,\n svg: defineSvgComponents,\n webgl: defineWebglComponents,\n depth: defineDepthComponents,\n layout: defineLayoutComponents,\n packs: definePacksComponents,\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;AA6CH,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;AAClC,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,GAAG,EAAE,mBAAmB;AACxB,IAAA,KAAK,EAAE,qBAAqB;AAC5B,IAAA,KAAK,EAAE,qBAAqB;AAC5B,IAAA,MAAM,EAAE,sBAAsB;AAC9B,IAAA,KAAK,EAAE,qBAAqB;CAC7B;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;;;;"}
|