use-scroll-animate 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/chunks/builtins-HlqAkK0f.js +99 -0
  3. package/dist/chunks/builtins-HlqAkK0f.js.map +1 -0
  4. package/dist/chunks/builtins-xalxV2d5.cjs +101 -0
  5. package/dist/chunks/builtins-xalxV2d5.cjs.map +1 -0
  6. package/dist/components/angular.cjs +1 -0
  7. package/dist/components/angular.cjs.map +1 -1
  8. package/dist/components/angular.js +1 -0
  9. package/dist/components/angular.js.map +1 -1
  10. package/dist/components/effects.cjs +1 -0
  11. package/dist/components/effects.cjs.map +1 -1
  12. package/dist/components/effects.js +1 -0
  13. package/dist/components/effects.js.map +1 -1
  14. package/dist/components/fx-shop.cjs +133 -0
  15. package/dist/components/fx-shop.cjs.map +1 -0
  16. package/dist/components/fx-shop.d.cts +70 -0
  17. package/dist/components/fx-shop.d.ts +70 -0
  18. package/dist/components/fx-shop.js +129 -0
  19. package/dist/components/fx-shop.js.map +1 -0
  20. package/dist/components/fx.cjs +5 -98
  21. package/dist/components/fx.cjs.map +1 -1
  22. package/dist/components/fx.js +3 -96
  23. package/dist/components/fx.js.map +1 -1
  24. package/dist/components/fx2.cjs +6 -0
  25. package/dist/components/fx2.cjs.map +1 -1
  26. package/dist/components/fx2.d.cts +27 -1
  27. package/dist/components/fx2.d.ts +27 -1
  28. package/dist/components/fx2.js +5 -1
  29. package/dist/components/fx2.js.map +1 -1
  30. package/dist/components/solid.cjs +1 -0
  31. package/dist/components/solid.cjs.map +1 -1
  32. package/dist/components/solid.js +1 -0
  33. package/dist/components/solid.js.map +1 -1
  34. package/dist/components/svelte.cjs +1 -0
  35. package/dist/components/svelte.cjs.map +1 -1
  36. package/dist/components/svelte.js +1 -0
  37. package/dist/components/svelte.js.map +1 -1
  38. package/dist/components/vue.cjs +1 -0
  39. package/dist/components/vue.cjs.map +1 -1
  40. package/dist/components/vue.js +1 -0
  41. package/dist/components/vue.js.map +1 -1
  42. package/dist/components/widgets.cjs +513 -78
  43. package/dist/components/widgets.cjs.map +1 -1
  44. package/dist/components/widgets.d.cts +94 -2
  45. package/dist/components/widgets.d.ts +94 -2
  46. package/dist/components/widgets.js +507 -79
  47. package/dist/components/widgets.js.map +1 -1
  48. package/dist/components.cjs +2 -1
  49. package/dist/components.cjs.map +1 -1
  50. package/dist/components.js +2 -1
  51. package/dist/components.js.map +1 -1
  52. package/dist/widgets.umd.js +1 -1
  53. package/dist/widgets.umd.js.map +1 -1
  54. package/docs/ROADMAP.md +1 -1
  55. package/docs/components.md +26 -0
  56. package/package.json +21 -1
@@ -722,6 +722,94 @@ interface UsaKpiElement extends UsaElement {
722
722
  }
723
723
  declare function defineKpi(tag?: string): CustomElementConstructor | undefined;
724
724
 
725
+ /**
726
+ * `<usa-add-to-cart>` (7.3) — a buy button: on click a ghost of the product
727
+ * (`from` selector, default the closest `[data-product]` image) flies into
728
+ * the cart (`cart` selector, default `[data-cart]`, or a `<usa-cart-drawer>`
729
+ * whose `add()` is called with `item` JSON), then the button morphs into a
730
+ * ✓ "Added" state for `hold` ms. `usa:add` (`{ item }`). A real `<button>`
731
+ * inside; `aria-live` announces "Added to cart". Reduced motion: no flight
732
+ * or morph — the cart just bumps.
733
+ */
734
+ interface UsaAddToCartElement extends UsaElement {
735
+ add(): void;
736
+ }
737
+ declare function defineAddToCart(tag?: string): CustomElementConstructor | undefined;
738
+
739
+ interface CartItem {
740
+ id?: string;
741
+ name: string;
742
+ price: number;
743
+ qty?: number;
744
+ img?: string;
745
+ }
746
+ /**
747
+ * `<usa-cart-drawer>` (7.3) — a cart button with a count badge plus a drawer
748
+ * that slides in from the side. `add(item)` slides the line in (or bumps its
749
+ * quantity), the badge bumps and the total rolls; lines remove with a collapse.
750
+ * `open` / `close()` / `toggle()`; Esc and the backdrop close it; focus moves
751
+ * into the panel and back. `currency` (default "$"), `label`. Events
752
+ * `usa:change` (`{ items, total }`), `usa:open`, `usa:close`. The panel is a
753
+ * labelled `dialog`; the badge count is announced. Reduced motion: no slide,
754
+ * bump or roll.
755
+ */
756
+ interface UsaCartDrawerElement extends UsaElement {
757
+ items: CartItem[];
758
+ readonly total: number;
759
+ readonly count: number;
760
+ open: boolean;
761
+ add(item: CartItem): void;
762
+ removeItem(id: string): void;
763
+ toggle(force?: boolean): void;
764
+ }
765
+ /** Cart total (7.3). */
766
+ declare const cartTotal: (items: CartItem[]) => number;
767
+ declare function defineCartDrawer(tag?: string): CustomElementConstructor | undefined;
768
+
769
+ /**
770
+ * `<usa-product-gallery>` (7.3) — a product image gallery from its `<img>`
771
+ * children: a large stage plus a thumbnail strip. Picking a thumbnail (click,
772
+ * ←/→, swipe on touch) cross-slides the stage in the direction of travel; the
773
+ * active thumbnail's ring glides to it. Hovering the stage zooms the photo
774
+ * under the pointer (`zoom`, default 2; `nozoom` turns it off). `index`
775
+ * property / attribute; `usa:change` (`{ index }`). The stage is a labelled
776
+ * `group` whose label says "Image 2 of 4: alt". Reduced motion: images swap
777
+ * instantly and the hover zoom is off.
778
+ */
779
+ interface UsaProductGalleryElement extends UsaElement {
780
+ index: number;
781
+ readonly count: number;
782
+ go(i: number): void;
783
+ next(): void;
784
+ prev(): void;
785
+ }
786
+ /** Wrap an index into 0..n-1 (7.3). */
787
+ declare const wrapIndex: (i: number, n: number) => number;
788
+ declare function defineProductGallery(tag?: string): CustomElementConstructor | undefined;
789
+
790
+ /**
791
+ * `<usa-countdown>` (7.3) — a flip-card countdown to `to` (ISO date / time)
792
+ * or for `seconds`: days · hours · minutes · seconds, each digit flips like a
793
+ * split-flap card when it changes. `units` ("d,h,m,s"), `labels`. Fires
794
+ * `usa:tick` (`{ left }`) and `usa:done`; adds `data-done`. A `timer` with an
795
+ * `aria-label` that updates once a minute (not every second). Reduced motion:
796
+ * digits change without the flip.
797
+ */
798
+ interface UsaCountdownElement extends UsaElement {
799
+ /** Seconds left. */
800
+ readonly left: number;
801
+ start(): void;
802
+ stop(): void;
803
+ }
804
+ /** Split seconds into d/h/m/s (7.3). */
805
+ declare function splitTime(sec: number): {
806
+ d: number;
807
+ h: number;
808
+ m: number;
809
+ s: number;
810
+ };
811
+ declare function defineCountdown(tag?: string): CustomElementConstructor | undefined;
812
+
725
813
  /**
726
814
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
727
815
  * entry so `motionary/components` and `components/lite` keep their size
@@ -783,8 +871,12 @@ declare global {
783
871
  'usa-gauge': UsaGaugeElement;
784
872
  'usa-sparkline': UsaSparklineElement;
785
873
  'usa-kpi': UsaKpiElement;
874
+ 'usa-add-to-cart': UsaAddToCartElement;
875
+ 'usa-cart-drawer': UsaCartDrawerElement;
876
+ 'usa-product-gallery': UsaProductGalleryElement;
877
+ 'usa-countdown': UsaCountdownElement;
786
878
  }
787
879
  }
788
880
 
789
- export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, defineBarChart, defineCarousel, defineColorPicker, defineCompare, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineGauge, defineKanban, defineKeyframeEditor, defineKpi, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, sparkPoints, stackToast };
790
- export type { StackToastOptions, UsaBarChartElement, UsaCarouselElement, UsaColorPickerElement, UsaCompareElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
881
+ export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, cartTotal, defineAddToCart, defineBarChart, defineCarousel, defineCartDrawer, defineColorPicker, defineCompare, defineCountdown, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineGauge, defineKanban, defineKeyframeEditor, defineKpi, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProductGallery, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, sparkPoints, splitTime, stackToast, wrapIndex };
882
+ export type { CartItem, StackToastOptions, UsaAddToCartElement, UsaBarChartElement, UsaCarouselElement, UsaCartDrawerElement, UsaColorPickerElement, UsaCompareElement, UsaCountdownElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProductGalleryElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
@@ -722,6 +722,94 @@ interface UsaKpiElement extends UsaElement {
722
722
  }
723
723
  declare function defineKpi(tag?: string): CustomElementConstructor | undefined;
724
724
 
725
+ /**
726
+ * `<usa-add-to-cart>` (7.3) — a buy button: on click a ghost of the product
727
+ * (`from` selector, default the closest `[data-product]` image) flies into
728
+ * the cart (`cart` selector, default `[data-cart]`, or a `<usa-cart-drawer>`
729
+ * whose `add()` is called with `item` JSON), then the button morphs into a
730
+ * ✓ "Added" state for `hold` ms. `usa:add` (`{ item }`). A real `<button>`
731
+ * inside; `aria-live` announces "Added to cart". Reduced motion: no flight
732
+ * or morph — the cart just bumps.
733
+ */
734
+ interface UsaAddToCartElement extends UsaElement {
735
+ add(): void;
736
+ }
737
+ declare function defineAddToCart(tag?: string): CustomElementConstructor | undefined;
738
+
739
+ interface CartItem {
740
+ id?: string;
741
+ name: string;
742
+ price: number;
743
+ qty?: number;
744
+ img?: string;
745
+ }
746
+ /**
747
+ * `<usa-cart-drawer>` (7.3) — a cart button with a count badge plus a drawer
748
+ * that slides in from the side. `add(item)` slides the line in (or bumps its
749
+ * quantity), the badge bumps and the total rolls; lines remove with a collapse.
750
+ * `open` / `close()` / `toggle()`; Esc and the backdrop close it; focus moves
751
+ * into the panel and back. `currency` (default "$"), `label`. Events
752
+ * `usa:change` (`{ items, total }`), `usa:open`, `usa:close`. The panel is a
753
+ * labelled `dialog`; the badge count is announced. Reduced motion: no slide,
754
+ * bump or roll.
755
+ */
756
+ interface UsaCartDrawerElement extends UsaElement {
757
+ items: CartItem[];
758
+ readonly total: number;
759
+ readonly count: number;
760
+ open: boolean;
761
+ add(item: CartItem): void;
762
+ removeItem(id: string): void;
763
+ toggle(force?: boolean): void;
764
+ }
765
+ /** Cart total (7.3). */
766
+ declare const cartTotal: (items: CartItem[]) => number;
767
+ declare function defineCartDrawer(tag?: string): CustomElementConstructor | undefined;
768
+
769
+ /**
770
+ * `<usa-product-gallery>` (7.3) — a product image gallery from its `<img>`
771
+ * children: a large stage plus a thumbnail strip. Picking a thumbnail (click,
772
+ * ←/→, swipe on touch) cross-slides the stage in the direction of travel; the
773
+ * active thumbnail's ring glides to it. Hovering the stage zooms the photo
774
+ * under the pointer (`zoom`, default 2; `nozoom` turns it off). `index`
775
+ * property / attribute; `usa:change` (`{ index }`). The stage is a labelled
776
+ * `group` whose label says "Image 2 of 4: alt". Reduced motion: images swap
777
+ * instantly and the hover zoom is off.
778
+ */
779
+ interface UsaProductGalleryElement extends UsaElement {
780
+ index: number;
781
+ readonly count: number;
782
+ go(i: number): void;
783
+ next(): void;
784
+ prev(): void;
785
+ }
786
+ /** Wrap an index into 0..n-1 (7.3). */
787
+ declare const wrapIndex: (i: number, n: number) => number;
788
+ declare function defineProductGallery(tag?: string): CustomElementConstructor | undefined;
789
+
790
+ /**
791
+ * `<usa-countdown>` (7.3) — a flip-card countdown to `to` (ISO date / time)
792
+ * or for `seconds`: days · hours · minutes · seconds, each digit flips like a
793
+ * split-flap card when it changes. `units` ("d,h,m,s"), `labels`. Fires
794
+ * `usa:tick` (`{ left }`) and `usa:done`; adds `data-done`. A `timer` with an
795
+ * `aria-label` that updates once a minute (not every second). Reduced motion:
796
+ * digits change without the flip.
797
+ */
798
+ interface UsaCountdownElement extends UsaElement {
799
+ /** Seconds left. */
800
+ readonly left: number;
801
+ start(): void;
802
+ stop(): void;
803
+ }
804
+ /** Split seconds into d/h/m/s (7.3). */
805
+ declare function splitTime(sec: number): {
806
+ d: number;
807
+ h: number;
808
+ m: number;
809
+ s: number;
810
+ };
811
+ declare function defineCountdown(tag?: string): CustomElementConstructor | undefined;
812
+
725
813
  /**
726
814
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
727
815
  * entry so `motionary/components` and `components/lite` keep their size
@@ -783,8 +871,12 @@ declare global {
783
871
  'usa-gauge': UsaGaugeElement;
784
872
  'usa-sparkline': UsaSparklineElement;
785
873
  'usa-kpi': UsaKpiElement;
874
+ 'usa-add-to-cart': UsaAddToCartElement;
875
+ 'usa-cart-drawer': UsaCartDrawerElement;
876
+ 'usa-product-gallery': UsaProductGalleryElement;
877
+ 'usa-countdown': UsaCountdownElement;
786
878
  }
787
879
  }
788
880
 
789
- export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, defineBarChart, defineCarousel, defineColorPicker, defineCompare, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineGauge, defineKanban, defineKeyframeEditor, defineKpi, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, sparkPoints, stackToast };
790
- export type { StackToastOptions, UsaBarChartElement, UsaCarouselElement, UsaColorPickerElement, UsaCompareElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
881
+ export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SPARK_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, cartTotal, defineAddToCart, defineBarChart, defineCarousel, defineCartDrawer, defineColorPicker, defineCompare, defineCountdown, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineGauge, defineKanban, defineKeyframeEditor, defineKpi, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProductGallery, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, sparkPoints, splitTime, stackToast, wrapIndex };
882
+ export type { CartItem, StackToastOptions, UsaAddToCartElement, UsaBarChartElement, UsaCarouselElement, UsaCartDrawerElement, UsaColorPickerElement, UsaCompareElement, UsaCountdownElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProductGalleryElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };