use-scroll-animate 6.3.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +33 -2
  2. package/README.md +2 -2
  3. package/README_ja.md +2 -2
  4. package/README_zh.md +2 -2
  5. package/dist/chunks/{generative-BRUZaIsX.js → generative-2LhxG5BJ.js} +2 -2
  6. package/dist/chunks/{generative-BRUZaIsX.js.map → generative-2LhxG5BJ.js.map} +1 -1
  7. package/dist/chunks/{gpu-XHWzeNb5.js → gpu-EjV49FQk.js} +3 -3
  8. package/dist/chunks/{gpu-XHWzeNb5.js.map → gpu-EjV49FQk.js.map} +1 -1
  9. package/dist/chunks/{shared-eweTlzxv.js → shared-CkKHWrtJ.js} +2 -2
  10. package/dist/chunks/{shared-eweTlzxv.js.map → shared-CkKHWrtJ.js.map} +1 -1
  11. package/dist/components/effects.js +3 -3
  12. package/dist/components/fx-3d.cjs +236 -0
  13. package/dist/components/fx-3d.cjs.map +1 -0
  14. package/dist/components/fx-3d.d.cts +67 -0
  15. package/dist/components/fx-3d.d.ts +67 -0
  16. package/dist/components/fx-3d.js +233 -0
  17. package/dist/components/fx-3d.js.map +1 -0
  18. package/dist/components/fx-gpu.js +3 -3
  19. package/dist/components/fx-light.cjs +221 -0
  20. package/dist/components/fx-light.cjs.map +1 -0
  21. package/dist/components/fx-light.d.cts +72 -0
  22. package/dist/components/fx-light.d.ts +72 -0
  23. package/dist/components/fx-light.js +217 -0
  24. package/dist/components/fx-light.js.map +1 -0
  25. package/dist/components/fx-text.js +1 -1
  26. package/dist/components/fx2.cjs +11 -0
  27. package/dist/components/fx2.cjs.map +1 -1
  28. package/dist/components/fx2.d.cts +52 -1
  29. package/dist/components/fx2.d.ts +52 -1
  30. package/dist/components/fx2.js +12 -5
  31. package/dist/components/fx2.js.map +1 -1
  32. package/dist/components/widgets.cjs +1002 -14
  33. package/dist/components/widgets.cjs.map +1 -1
  34. package/dist/components/widgets.d.cts +132 -2
  35. package/dist/components/widgets.d.ts +132 -2
  36. package/dist/components/widgets.js +993 -15
  37. package/dist/components/widgets.js.map +1 -1
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.umd.js +1 -1
  43. package/dist/index.umd.js.map +1 -1
  44. package/dist/widgets.umd.js +1 -1
  45. package/dist/widgets.umd.js.map +1 -1
  46. package/docs/ROADMAP.md +2 -2
  47. package/docs/components.md +55 -1
  48. package/package.json +24 -4
@@ -170,6 +170,128 @@ interface UsaMenuElement extends UsaElement {
170
170
  declare const MENU_EFFECTS: readonly ["scale", "fold", "slide"];
171
171
  declare function defineMenu(tag?: string): CustomElementConstructor | undefined;
172
172
 
173
+ /**
174
+ * 6.4 meters: `<usa-progress-ring>` and `<usa-odometer>`.
175
+ *
176
+ * `<usa-progress-ring value="64" max="100">` — a ring, `bar` or `semi`
177
+ * (semicircle gauge) `variant`; the arc eases (with a little overshoot) to
178
+ * each new value while the centre label counts; `gradient="#a,#b"`;
179
+ * no `value` = indeterminate (spinning arc). `role="progressbar"`.
180
+ * Event `usa:complete` when it reaches max.
181
+ *
182
+ * `<usa-odometer value="1234">` — rolling digit wheels: every digit column
183
+ * spins to its new digit (lower digits travel further), columns slide in /
184
+ * out when the length changes; `locale` grouping via Intl.NumberFormat,
185
+ * `decimals`, `prefix` / `suffix`, `duration`. The accessible name is the
186
+ * formatted number.
187
+ *
188
+ * Reduced motion: values switch without animation.
189
+ */
190
+ interface UsaProgressRingElement extends UsaElement {
191
+ value: number | null;
192
+ max: number;
193
+ }
194
+ interface UsaOdometerElement extends UsaElement {
195
+ value: number;
196
+ readonly text: string;
197
+ }
198
+ declare const PROGRESS_VARIANTS: readonly ["ring", "bar", "semi"];
199
+ declare function defineProgressRing(tag?: string): CustomElementConstructor | undefined;
200
+ declare function defineOdometer(tag?: string): CustomElementConstructor | undefined;
201
+
202
+ /**
203
+ * `<usa-skeleton-reveal loading>` (6.4) — a skeleton generated from the
204
+ * real content: while `loading`, every text line, image and marked block
205
+ * (`[data-skeleton]`) of the children is measured and covered by a
206
+ * placeholder with one synchronized shimmer (`variant="wave | pulse |
207
+ * glow"`). Remove `loading` (or call `reveal()`) and the placeholders
208
+ * dissolve top-to-bottom while the content fades in from a blur.
209
+ *
210
+ * `aria-busy` follows `loading`. Event `usa:reveal`. Reduced motion: no
211
+ * shimmer, a plain crossfade.
212
+ */
213
+ interface UsaSkeletonRevealElement extends UsaElement {
214
+ loading: boolean;
215
+ reveal(): Promise<void>;
216
+ }
217
+ declare const SKELETON_VARIANTS: readonly ["wave", "pulse", "glow"];
218
+ declare function defineSkeletonReveal(tag?: string): CustomElementConstructor | undefined;
219
+
220
+ /**
221
+ * `<usa-star-rating value="3.5">` (6.4) — rating stars 2.0: the fill
222
+ * follows the pointer (hover preview, `step="0.5"` half stars), a click
223
+ * pops the chosen star and throws a small sparkle burst, the other stars
224
+ * ripple in sequence. `max`, `step` (`1` · `0.5`), `readonly`, `label`,
225
+ * `icon` (`star` · `heart`). Keyboard: it is a `role="slider"` — arrows,
226
+ * Home / End. Event `usa:change` (`{ value }`). Reduced motion: no pop,
227
+ * burst or ripple.
228
+ */
229
+ interface UsaStarRatingElement extends UsaElement {
230
+ value: number;
231
+ }
232
+ declare function defineStarRating(tag?: string): CustomElementConstructor | undefined;
233
+
234
+ /**
235
+ * `<usa-milestones>` (6.5) — a scroll-drawn timeline: a progress line grows
236
+ * down the rail as you scroll, and each milestone (a child element, with an
237
+ * optional `data-date`) pops its dot and slides its card in when the line
238
+ * reaches it. Cards alternate sides on wide screens (`layout="alternate"`,
239
+ * default) or sit on one side (`layout="left"`); below 640 px they always
240
+ * stack. Events `usa:reach` (`{ index }`). Reduced motion: everything is
241
+ * shown, the line is full.
242
+ */
243
+ interface UsaMilestonesElement extends UsaElement {
244
+ readonly reached: number;
245
+ }
246
+ declare function defineMilestones(tag?: string): CustomElementConstructor | undefined;
247
+
248
+ /**
249
+ * `<usa-masonry-flow>` (6.5) — a masonry grid whose items glide to their
250
+ * new places (FLIP) whenever the layout changes: resize, items added or
251
+ * removed, `filter()`, `shuffle()`, `sort()`. Columns come from `min`
252
+ * (minimum column width, px) and `gap`. Hidden items scale out, shown ones
253
+ * scale in. Event `usa:layout` (`{ columns }`). Reduced motion: items jump.
254
+ */
255
+ interface UsaMasonryFlowElement extends UsaElement {
256
+ readonly columns: number;
257
+ layout(animate?: boolean): void;
258
+ filter(fn: ((el: HTMLElement) => boolean) | string | null): void;
259
+ shuffle(): void;
260
+ sort(compare: (a: HTMLElement, b: HTMLElement) => number): void;
261
+ }
262
+ declare function defineMasonryFlow(tag?: string): CustomElementConstructor | undefined;
263
+
264
+ /**
265
+ * `<usa-compare>` (6.5) — before / after image compare slider. The first
266
+ * child is "before", the second "after" (images, videos or any element).
267
+ * Drag the handle (or anywhere with `hover`), click to jump, or use the
268
+ * keyboard (it is a `role="slider"`: arrows, Page Up / Down, Home / End).
269
+ * `position` (0–100, default 50), `orientation="horizontal | vertical"`,
270
+ * `intro` plays a short sweep when it scrolls into view, `labels="Before,
271
+ * After"`. Event `usa:change` (`{ position }`). Reduced motion: no intro
272
+ * sweep or eased jumps.
273
+ */
274
+ interface UsaCompareElement extends UsaElement {
275
+ position: number;
276
+ }
277
+ declare function defineCompare(tag?: string): CustomElementConstructor | undefined;
278
+
279
+ /**
280
+ * `<usa-cube-gallery>` (6.5) — a gallery on a turning 3D cube: the current
281
+ * slide and the next one sit on adjacent faces and the cube rotates between
282
+ * them. Swipe / drag, arrow keys, prev / next buttons, `autoplay` (ms;
283
+ * pauses on hover, focus and off screen), `axis="y | x"`. API `next()`,
284
+ * `prev()`, `goTo(i)`, `index`; event `usa:change`. Reduced motion: slides
285
+ * switch with a fade.
286
+ */
287
+ interface UsaCubeGalleryElement extends UsaElement {
288
+ readonly index: number;
289
+ next(): void;
290
+ prev(): void;
291
+ goTo(i: number): void;
292
+ }
293
+ declare function defineCubeGallery(tag?: string): CustomElementConstructor | undefined;
294
+
173
295
  /**
174
296
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
175
297
  * entry so `motionary/components` and `components/lite` keep their size
@@ -199,8 +321,16 @@ declare global {
199
321
  'usa-modal': UsaModalElement;
200
322
  'usa-sheet': UsaSheetElement;
201
323
  'usa-menu': UsaMenuElement;
324
+ 'usa-progress-ring': UsaProgressRingElement;
325
+ 'usa-odometer': UsaOdometerElement;
326
+ 'usa-skeleton-reveal': UsaSkeletonRevealElement;
327
+ 'usa-star-rating': UsaStarRatingElement;
328
+ 'usa-milestones': UsaMilestonesElement;
329
+ 'usa-masonry-flow': UsaMasonryFlowElement;
330
+ 'usa-compare': UsaCompareElement;
331
+ 'usa-cube-gallery': UsaCubeGalleryElement;
202
332
  }
203
333
  }
204
334
 
205
- export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, SHEET_SIDES, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineDisclosure, defineMenu, defineModal, defineSheet, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
206
- export type { StackToastOptions, UsaCarouselElement, UsaDisclosureElement, UsaMenuElement, UsaModalElement, UsaSheetElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };
335
+ export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineMasonryFlow, defineMenu, defineMilestones, defineModal, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
336
+ export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaMasonryFlowElement, UsaMenuElement, UsaMilestonesElement, UsaModalElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };
@@ -170,6 +170,128 @@ interface UsaMenuElement extends UsaElement {
170
170
  declare const MENU_EFFECTS: readonly ["scale", "fold", "slide"];
171
171
  declare function defineMenu(tag?: string): CustomElementConstructor | undefined;
172
172
 
173
+ /**
174
+ * 6.4 meters: `<usa-progress-ring>` and `<usa-odometer>`.
175
+ *
176
+ * `<usa-progress-ring value="64" max="100">` — a ring, `bar` or `semi`
177
+ * (semicircle gauge) `variant`; the arc eases (with a little overshoot) to
178
+ * each new value while the centre label counts; `gradient="#a,#b"`;
179
+ * no `value` = indeterminate (spinning arc). `role="progressbar"`.
180
+ * Event `usa:complete` when it reaches max.
181
+ *
182
+ * `<usa-odometer value="1234">` — rolling digit wheels: every digit column
183
+ * spins to its new digit (lower digits travel further), columns slide in /
184
+ * out when the length changes; `locale` grouping via Intl.NumberFormat,
185
+ * `decimals`, `prefix` / `suffix`, `duration`. The accessible name is the
186
+ * formatted number.
187
+ *
188
+ * Reduced motion: values switch without animation.
189
+ */
190
+ interface UsaProgressRingElement extends UsaElement {
191
+ value: number | null;
192
+ max: number;
193
+ }
194
+ interface UsaOdometerElement extends UsaElement {
195
+ value: number;
196
+ readonly text: string;
197
+ }
198
+ declare const PROGRESS_VARIANTS: readonly ["ring", "bar", "semi"];
199
+ declare function defineProgressRing(tag?: string): CustomElementConstructor | undefined;
200
+ declare function defineOdometer(tag?: string): CustomElementConstructor | undefined;
201
+
202
+ /**
203
+ * `<usa-skeleton-reveal loading>` (6.4) — a skeleton generated from the
204
+ * real content: while `loading`, every text line, image and marked block
205
+ * (`[data-skeleton]`) of the children is measured and covered by a
206
+ * placeholder with one synchronized shimmer (`variant="wave | pulse |
207
+ * glow"`). Remove `loading` (or call `reveal()`) and the placeholders
208
+ * dissolve top-to-bottom while the content fades in from a blur.
209
+ *
210
+ * `aria-busy` follows `loading`. Event `usa:reveal`. Reduced motion: no
211
+ * shimmer, a plain crossfade.
212
+ */
213
+ interface UsaSkeletonRevealElement extends UsaElement {
214
+ loading: boolean;
215
+ reveal(): Promise<void>;
216
+ }
217
+ declare const SKELETON_VARIANTS: readonly ["wave", "pulse", "glow"];
218
+ declare function defineSkeletonReveal(tag?: string): CustomElementConstructor | undefined;
219
+
220
+ /**
221
+ * `<usa-star-rating value="3.5">` (6.4) — rating stars 2.0: the fill
222
+ * follows the pointer (hover preview, `step="0.5"` half stars), a click
223
+ * pops the chosen star and throws a small sparkle burst, the other stars
224
+ * ripple in sequence. `max`, `step` (`1` · `0.5`), `readonly`, `label`,
225
+ * `icon` (`star` · `heart`). Keyboard: it is a `role="slider"` — arrows,
226
+ * Home / End. Event `usa:change` (`{ value }`). Reduced motion: no pop,
227
+ * burst or ripple.
228
+ */
229
+ interface UsaStarRatingElement extends UsaElement {
230
+ value: number;
231
+ }
232
+ declare function defineStarRating(tag?: string): CustomElementConstructor | undefined;
233
+
234
+ /**
235
+ * `<usa-milestones>` (6.5) — a scroll-drawn timeline: a progress line grows
236
+ * down the rail as you scroll, and each milestone (a child element, with an
237
+ * optional `data-date`) pops its dot and slides its card in when the line
238
+ * reaches it. Cards alternate sides on wide screens (`layout="alternate"`,
239
+ * default) or sit on one side (`layout="left"`); below 640 px they always
240
+ * stack. Events `usa:reach` (`{ index }`). Reduced motion: everything is
241
+ * shown, the line is full.
242
+ */
243
+ interface UsaMilestonesElement extends UsaElement {
244
+ readonly reached: number;
245
+ }
246
+ declare function defineMilestones(tag?: string): CustomElementConstructor | undefined;
247
+
248
+ /**
249
+ * `<usa-masonry-flow>` (6.5) — a masonry grid whose items glide to their
250
+ * new places (FLIP) whenever the layout changes: resize, items added or
251
+ * removed, `filter()`, `shuffle()`, `sort()`. Columns come from `min`
252
+ * (minimum column width, px) and `gap`. Hidden items scale out, shown ones
253
+ * scale in. Event `usa:layout` (`{ columns }`). Reduced motion: items jump.
254
+ */
255
+ interface UsaMasonryFlowElement extends UsaElement {
256
+ readonly columns: number;
257
+ layout(animate?: boolean): void;
258
+ filter(fn: ((el: HTMLElement) => boolean) | string | null): void;
259
+ shuffle(): void;
260
+ sort(compare: (a: HTMLElement, b: HTMLElement) => number): void;
261
+ }
262
+ declare function defineMasonryFlow(tag?: string): CustomElementConstructor | undefined;
263
+
264
+ /**
265
+ * `<usa-compare>` (6.5) — before / after image compare slider. The first
266
+ * child is "before", the second "after" (images, videos or any element).
267
+ * Drag the handle (or anywhere with `hover`), click to jump, or use the
268
+ * keyboard (it is a `role="slider"`: arrows, Page Up / Down, Home / End).
269
+ * `position` (0–100, default 50), `orientation="horizontal | vertical"`,
270
+ * `intro` plays a short sweep when it scrolls into view, `labels="Before,
271
+ * After"`. Event `usa:change` (`{ position }`). Reduced motion: no intro
272
+ * sweep or eased jumps.
273
+ */
274
+ interface UsaCompareElement extends UsaElement {
275
+ position: number;
276
+ }
277
+ declare function defineCompare(tag?: string): CustomElementConstructor | undefined;
278
+
279
+ /**
280
+ * `<usa-cube-gallery>` (6.5) — a gallery on a turning 3D cube: the current
281
+ * slide and the next one sit on adjacent faces and the cube rotates between
282
+ * them. Swipe / drag, arrow keys, prev / next buttons, `autoplay` (ms;
283
+ * pauses on hover, focus and off screen), `axis="y | x"`. API `next()`,
284
+ * `prev()`, `goTo(i)`, `index`; event `usa:change`. Reduced motion: slides
285
+ * switch with a fade.
286
+ */
287
+ interface UsaCubeGalleryElement extends UsaElement {
288
+ readonly index: number;
289
+ next(): void;
290
+ prev(): void;
291
+ goTo(i: number): void;
292
+ }
293
+ declare function defineCubeGallery(tag?: string): CustomElementConstructor | undefined;
294
+
173
295
  /**
174
296
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
175
297
  * entry so `motionary/components` and `components/lite` keep their size
@@ -199,8 +321,16 @@ declare global {
199
321
  'usa-modal': UsaModalElement;
200
322
  'usa-sheet': UsaSheetElement;
201
323
  'usa-menu': UsaMenuElement;
324
+ 'usa-progress-ring': UsaProgressRingElement;
325
+ 'usa-odometer': UsaOdometerElement;
326
+ 'usa-skeleton-reveal': UsaSkeletonRevealElement;
327
+ 'usa-star-rating': UsaStarRatingElement;
328
+ 'usa-milestones': UsaMilestonesElement;
329
+ 'usa-masonry-flow': UsaMasonryFlowElement;
330
+ 'usa-compare': UsaCompareElement;
331
+ 'usa-cube-gallery': UsaCubeGalleryElement;
202
332
  }
203
333
  }
204
334
 
205
- export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, SHEET_SIDES, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineDisclosure, defineMenu, defineModal, defineSheet, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
206
- export type { StackToastOptions, UsaCarouselElement, UsaDisclosureElement, UsaMenuElement, UsaModalElement, UsaSheetElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };
335
+ export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineMasonryFlow, defineMenu, defineMilestones, defineModal, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
336
+ export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaMasonryFlowElement, UsaMenuElement, UsaMilestonesElement, UsaModalElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };