motionary 7.1.0 → 7.2.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.
@@ -662,6 +662,66 @@ declare function parseLRC(src: string): {
662
662
  }[];
663
663
  declare function defineLyrics(tag?: string): CustomElementConstructor | undefined;
664
664
 
665
+ /**
666
+ * `<usa-bar-chart>` (7.2) — an animated bar chart from data: bars grow in a
667
+ * stagger on first view, value labels count with them, and new data glides
668
+ * every bar to its new height (bars that appear grow, bars that leave
669
+ * shrink). Data from `data` (`[{ label, value }]`), a `values` +
670
+ * `labels` attribute pair, or `<data value="…">label</data>` children.
671
+ * `max`, `unit`, `horizontal`. Accessible as a list of "label: value"
672
+ * items. Reduced motion: no growth or glide.
673
+ */
674
+ interface UsaBarChartElement extends UsaElement {
675
+ data: {
676
+ label: string;
677
+ value: number;
678
+ }[];
679
+ }
680
+ declare function defineBarChart(tag?: string): CustomElementConstructor | undefined;
681
+
682
+ /**
683
+ * `<usa-gauge>` (7.2) — a semicircular gauge: the needle swings to `value`
684
+ * on a damped spring (overshoot, settle), the arc fills with a colour that
685
+ * follows `zones` ("60:#22c55e,85:#f59e0b,100:#ef4444" — upper bound:color)
686
+ * and the number counts. `min` / `max` / `unit` / `label`; `role="meter"`.
687
+ * Reduced motion: no swing or count.
688
+ */
689
+ interface UsaGaugeElement extends UsaElement {
690
+ value: number;
691
+ }
692
+ declare function defineGauge(tag?: string): CustomElementConstructor | undefined;
693
+
694
+ /**
695
+ * `<usa-sparkline>` (7.2) — a tiny inline trend line. `values`
696
+ * ("3,5,4,8,6,9") or the `data` property; it draws itself on first view, a
697
+ * soft area fades in under it, the last point pulses, and setting new data
698
+ * morphs the line (point-by-point tween). `variant="line | area | bars"`,
699
+ * `color`. Hover / touch shows a dot + value tooltip. Decorative by default
700
+ * with a text summary as `aria-label` ("Trend: 3 to 9, up 200%").
701
+ * Reduced motion: no draw, morph or pulse.
702
+ */
703
+ interface UsaSparklineElement extends UsaElement {
704
+ data: number[];
705
+ }
706
+ declare const SPARK_VARIANTS: readonly ["line", "area", "bars"];
707
+ /** Map values to SVG points in a w×h box (with padding). */
708
+ declare function sparkPoints(vals: number[], w?: number, h?: number, pad?: number): [number, number][];
709
+ declare function defineSparkline(tag?: string): CustomElementConstructor | undefined;
710
+
711
+ /**
712
+ * `<usa-kpi>` (7.2) — a KPI card: the value counts up on first view (keeps
713
+ * prefix / suffix / decimals: "$12.4k", "98.2%"), the delta chip slides in
714
+ * with an arrow that points and colours by sign (`delta="+12.5%"`, or
715
+ * `invert` when down is good), and an optional `trend` ("4,6,5,9") draws a
716
+ * sparkline. `label`, `value`, `delta`, `caption`. Setting `value` later
717
+ * rolls from the old number to the new one and flashes the card.
718
+ * Reduced motion: no count, slide or flash.
719
+ */
720
+ interface UsaKpiElement extends UsaElement {
721
+ value: string;
722
+ }
723
+ declare function defineKpi(tag?: string): CustomElementConstructor | undefined;
724
+
665
725
  /**
666
726
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
667
727
  * entry so `motionary/components` and `components/lite` keep their size
@@ -719,8 +779,12 @@ declare global {
719
779
  'usa-volume-knob': UsaVolumeKnobElement;
720
780
  'usa-equalizer': UsaEqualizerElement;
721
781
  'usa-lyrics': UsaLyricsElement;
782
+ 'usa-bar-chart': UsaBarChartElement;
783
+ 'usa-gauge': UsaGaugeElement;
784
+ 'usa-sparkline': UsaSparklineElement;
785
+ 'usa-kpi': UsaKpiElement;
722
786
  }
723
787
  }
724
788
 
725
- export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineColorPicker, defineCompare, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineKanban, defineKeyframeEditor, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, stackToast };
726
- export type { StackToastOptions, UsaCarouselElement, UsaColorPickerElement, UsaCompareElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
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 };
@@ -662,6 +662,66 @@ declare function parseLRC(src: string): {
662
662
  }[];
663
663
  declare function defineLyrics(tag?: string): CustomElementConstructor | undefined;
664
664
 
665
+ /**
666
+ * `<usa-bar-chart>` (7.2) — an animated bar chart from data: bars grow in a
667
+ * stagger on first view, value labels count with them, and new data glides
668
+ * every bar to its new height (bars that appear grow, bars that leave
669
+ * shrink). Data from `data` (`[{ label, value }]`), a `values` +
670
+ * `labels` attribute pair, or `<data value="…">label</data>` children.
671
+ * `max`, `unit`, `horizontal`. Accessible as a list of "label: value"
672
+ * items. Reduced motion: no growth or glide.
673
+ */
674
+ interface UsaBarChartElement extends UsaElement {
675
+ data: {
676
+ label: string;
677
+ value: number;
678
+ }[];
679
+ }
680
+ declare function defineBarChart(tag?: string): CustomElementConstructor | undefined;
681
+
682
+ /**
683
+ * `<usa-gauge>` (7.2) — a semicircular gauge: the needle swings to `value`
684
+ * on a damped spring (overshoot, settle), the arc fills with a colour that
685
+ * follows `zones` ("60:#22c55e,85:#f59e0b,100:#ef4444" — upper bound:color)
686
+ * and the number counts. `min` / `max` / `unit` / `label`; `role="meter"`.
687
+ * Reduced motion: no swing or count.
688
+ */
689
+ interface UsaGaugeElement extends UsaElement {
690
+ value: number;
691
+ }
692
+ declare function defineGauge(tag?: string): CustomElementConstructor | undefined;
693
+
694
+ /**
695
+ * `<usa-sparkline>` (7.2) — a tiny inline trend line. `values`
696
+ * ("3,5,4,8,6,9") or the `data` property; it draws itself on first view, a
697
+ * soft area fades in under it, the last point pulses, and setting new data
698
+ * morphs the line (point-by-point tween). `variant="line | area | bars"`,
699
+ * `color`. Hover / touch shows a dot + value tooltip. Decorative by default
700
+ * with a text summary as `aria-label` ("Trend: 3 to 9, up 200%").
701
+ * Reduced motion: no draw, morph or pulse.
702
+ */
703
+ interface UsaSparklineElement extends UsaElement {
704
+ data: number[];
705
+ }
706
+ declare const SPARK_VARIANTS: readonly ["line", "area", "bars"];
707
+ /** Map values to SVG points in a w×h box (with padding). */
708
+ declare function sparkPoints(vals: number[], w?: number, h?: number, pad?: number): [number, number][];
709
+ declare function defineSparkline(tag?: string): CustomElementConstructor | undefined;
710
+
711
+ /**
712
+ * `<usa-kpi>` (7.2) — a KPI card: the value counts up on first view (keeps
713
+ * prefix / suffix / decimals: "$12.4k", "98.2%"), the delta chip slides in
714
+ * with an arrow that points and colours by sign (`delta="+12.5%"`, or
715
+ * `invert` when down is good), and an optional `trend` ("4,6,5,9") draws a
716
+ * sparkline. `label`, `value`, `delta`, `caption`. Setting `value` later
717
+ * rolls from the old number to the new one and flashes the card.
718
+ * Reduced motion: no count, slide or flash.
719
+ */
720
+ interface UsaKpiElement extends UsaElement {
721
+ value: string;
722
+ }
723
+ declare function defineKpi(tag?: string): CustomElementConstructor | undefined;
724
+
665
725
  /**
666
726
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
667
727
  * entry so `motionary/components` and `components/lite` keep their size
@@ -719,8 +779,12 @@ declare global {
719
779
  'usa-volume-knob': UsaVolumeKnobElement;
720
780
  'usa-equalizer': UsaEqualizerElement;
721
781
  'usa-lyrics': UsaLyricsElement;
782
+ 'usa-bar-chart': UsaBarChartElement;
783
+ 'usa-gauge': UsaGaugeElement;
784
+ 'usa-sparkline': UsaSparklineElement;
785
+ 'usa-kpi': UsaKpiElement;
722
786
  }
723
787
  }
724
788
 
725
- export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SEGMENTED_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, SWITCH_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WEATHER_CONDITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineColorPicker, defineCompare, defineCubeGallery, defineDatePicker, defineDisclosure, defineDock, defineEqualizer, defineFileDrop, defineKanban, defineKeyframeEditor, defineLyrics, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineOdometer, definePagination, defineProgressRing, definePullCord, defineSegmented, defineSheet, defineSkeletonReveal, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, monthGrid, pageWindow, parseISODate, parseLRC, stackToast };
726
- export type { StackToastOptions, UsaCarouselElement, UsaColorPickerElement, UsaCompareElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaOdometerElement, UsaPaginationElement, UsaProgressRingElement, UsaPullCordElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
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 };