motionary 7.3.0 → 7.4.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.
@@ -810,6 +810,92 @@ declare function splitTime(sec: number): {
810
810
  };
811
811
  declare function defineCountdown(tag?: string): CustomElementConstructor | undefined;
812
812
 
813
+ interface ChatMessage {
814
+ text: string;
815
+ from?: string;
816
+ me?: boolean;
817
+ time?: string;
818
+ }
819
+ /**
820
+ * `<usa-message-list>` (7.4) — a chat thread. Messages come from `<p>`
821
+ * children (`data-me`, `data-from`, `data-time`) or `push(msg)`: each new
822
+ * bubble pops in from its side, consecutive bubbles from the same sender are
823
+ * grouped, and the list sticks to the bottom (smooth scroll) unless the
824
+ * reader scrolled up — then a “↓ New messages” pill appears. `typing(name)`
825
+ * shows an animated “… is typing” bubble until the next message (or
826
+ * `typing(false)`). A `log` with `aria-live="polite"`. Reduced motion: no pop
827
+ * or smooth scroll, the typing dots are static.
828
+ */
829
+ interface UsaMessageListElement extends UsaElement {
830
+ readonly messages: ChatMessage[];
831
+ push(msg: ChatMessage): void;
832
+ typing(who: string | false): void;
833
+ }
834
+ declare function defineMessageList(tag?: string): CustomElementConstructor | undefined;
835
+
836
+ /**
837
+ * `<usa-reactions>` (7.4) — an emoji reaction bar (Slack / iMessage style).
838
+ * `emojis` ("👍,❤️,😂,🎉") with optional `counts` ("3,1,0,0"). Clicking a pill
839
+ * toggles your reaction: the count rolls up / down, the emoji pops and a few
840
+ * copies float up. A + button opens a small picker that springs open. Each
841
+ * pill is a `button` with `aria-pressed` and a label ("❤️ 2 reactions").
842
+ * `usa:react` (`{ emoji, on, count }`). Reduced motion: no pop, roll or float.
843
+ */
844
+ interface UsaReactionsElement extends UsaElement {
845
+ /** emoji → count */
846
+ readonly counts: Record<string, number>;
847
+ /** Your active reactions. */
848
+ readonly mine: string[];
849
+ toggle(emoji: string, on?: boolean): void;
850
+ }
851
+ /** Parse "👍,❤️" + "3,1" into ordered [emoji, count] pairs (7.4). */
852
+ declare function parseReactions(emojis: string, counts?: string): [string, number][];
853
+ declare function defineReactions(tag?: string): CustomElementConstructor | undefined;
854
+
855
+ interface BellNotice {
856
+ id?: string;
857
+ text: string;
858
+ time?: string;
859
+ read?: boolean;
860
+ }
861
+ /**
862
+ * `<usa-notification-bell>` (7.4) — a bell button with an unread badge and a
863
+ * dropdown list. `notify(n)` rings the bell (a pendulum swing), bumps the
864
+ * badge and slides the notice in at the top of the list; opening the list and
865
+ * “Mark all read” clears the badge (it shrinks away). Notices from `<li>`
866
+ * children too. Esc / outside click close it. The bell is a `button` with
867
+ * `aria-expanded` and a label including the unread count; the list is a
868
+ * labelled region. `usa:notify`, `usa:read`. Reduced motion: no swing, bump
869
+ * or slide.
870
+ */
871
+ interface UsaNotificationBellElement extends UsaElement {
872
+ readonly unread: number;
873
+ readonly notices: BellNotice[];
874
+ open: boolean;
875
+ notify(n: BellNotice | string): void;
876
+ markAllRead(): void;
877
+ ring(): void;
878
+ }
879
+ declare function defineNotificationBell(tag?: string): CustomElementConstructor | undefined;
880
+
881
+ /** Presence states (7.4). */
882
+ declare const PRESENCE_STATES: readonly ["online", "away", "busy", "offline"];
883
+ type PresenceState = (typeof PRESENCE_STATES)[number];
884
+ /**
885
+ * `<usa-presence>` (7.4) — an avatar with a live status dot: `status`
886
+ * online | away | busy | offline. Going online sends a ripple from the dot;
887
+ * every change cross-fades the dot colour; `speaking` adds a pulsing ring
888
+ * (voice chat), `story` an animated gradient ring (unseen story). Initials from
889
+ * `name` when there is no `src`. Labelled `img` ("Ada Lovelace, online").
890
+ * Reduced motion: no ripple, pulse or ring spin.
891
+ */
892
+ interface UsaPresenceElement extends UsaElement {
893
+ status: PresenceState;
894
+ }
895
+ /** Initials for a display name (7.4). */
896
+ declare const initials: (name: string) => string;
897
+ declare function definePresence(tag?: string): CustomElementConstructor | undefined;
898
+
813
899
  /**
814
900
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
815
901
  * entry so `motionary/components` and `components/lite` keep their size
@@ -875,8 +961,12 @@ declare global {
875
961
  'usa-cart-drawer': UsaCartDrawerElement;
876
962
  'usa-product-gallery': UsaProductGalleryElement;
877
963
  'usa-countdown': UsaCountdownElement;
964
+ 'usa-message-list': UsaMessageListElement;
965
+ 'usa-reactions': UsaReactionsElement;
966
+ 'usa-notification-bell': UsaNotificationBellElement;
967
+ 'usa-presence': UsaPresenceElement;
878
968
  }
879
969
  }
880
970
 
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 };
971
+ export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PRESENCE_STATES, 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, defineMessageList, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineNotificationBell, defineOdometer, definePagination, definePresence, defineProductGallery, defineProgressRing, definePullCord, defineReactions, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, initials, monthGrid, pageWindow, parseISODate, parseLRC, parseReactions, sparkPoints, splitTime, stackToast, wrapIndex };
972
+ export type { BellNotice, CartItem, ChatMessage, PresenceState, StackToastOptions, UsaAddToCartElement, UsaBarChartElement, UsaCarouselElement, UsaCartDrawerElement, UsaColorPickerElement, UsaCompareElement, UsaCountdownElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMessageListElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaNotificationBellElement, UsaOdometerElement, UsaPaginationElement, UsaPresenceElement, UsaProductGalleryElement, UsaProgressRingElement, UsaPullCordElement, UsaReactionsElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };
@@ -810,6 +810,92 @@ declare function splitTime(sec: number): {
810
810
  };
811
811
  declare function defineCountdown(tag?: string): CustomElementConstructor | undefined;
812
812
 
813
+ interface ChatMessage {
814
+ text: string;
815
+ from?: string;
816
+ me?: boolean;
817
+ time?: string;
818
+ }
819
+ /**
820
+ * `<usa-message-list>` (7.4) — a chat thread. Messages come from `<p>`
821
+ * children (`data-me`, `data-from`, `data-time`) or `push(msg)`: each new
822
+ * bubble pops in from its side, consecutive bubbles from the same sender are
823
+ * grouped, and the list sticks to the bottom (smooth scroll) unless the
824
+ * reader scrolled up — then a “↓ New messages” pill appears. `typing(name)`
825
+ * shows an animated “… is typing” bubble until the next message (or
826
+ * `typing(false)`). A `log` with `aria-live="polite"`. Reduced motion: no pop
827
+ * or smooth scroll, the typing dots are static.
828
+ */
829
+ interface UsaMessageListElement extends UsaElement {
830
+ readonly messages: ChatMessage[];
831
+ push(msg: ChatMessage): void;
832
+ typing(who: string | false): void;
833
+ }
834
+ declare function defineMessageList(tag?: string): CustomElementConstructor | undefined;
835
+
836
+ /**
837
+ * `<usa-reactions>` (7.4) — an emoji reaction bar (Slack / iMessage style).
838
+ * `emojis` ("👍,❤️,😂,🎉") with optional `counts` ("3,1,0,0"). Clicking a pill
839
+ * toggles your reaction: the count rolls up / down, the emoji pops and a few
840
+ * copies float up. A + button opens a small picker that springs open. Each
841
+ * pill is a `button` with `aria-pressed` and a label ("❤️ 2 reactions").
842
+ * `usa:react` (`{ emoji, on, count }`). Reduced motion: no pop, roll or float.
843
+ */
844
+ interface UsaReactionsElement extends UsaElement {
845
+ /** emoji → count */
846
+ readonly counts: Record<string, number>;
847
+ /** Your active reactions. */
848
+ readonly mine: string[];
849
+ toggle(emoji: string, on?: boolean): void;
850
+ }
851
+ /** Parse "👍,❤️" + "3,1" into ordered [emoji, count] pairs (7.4). */
852
+ declare function parseReactions(emojis: string, counts?: string): [string, number][];
853
+ declare function defineReactions(tag?: string): CustomElementConstructor | undefined;
854
+
855
+ interface BellNotice {
856
+ id?: string;
857
+ text: string;
858
+ time?: string;
859
+ read?: boolean;
860
+ }
861
+ /**
862
+ * `<usa-notification-bell>` (7.4) — a bell button with an unread badge and a
863
+ * dropdown list. `notify(n)` rings the bell (a pendulum swing), bumps the
864
+ * badge and slides the notice in at the top of the list; opening the list and
865
+ * “Mark all read” clears the badge (it shrinks away). Notices from `<li>`
866
+ * children too. Esc / outside click close it. The bell is a `button` with
867
+ * `aria-expanded` and a label including the unread count; the list is a
868
+ * labelled region. `usa:notify`, `usa:read`. Reduced motion: no swing, bump
869
+ * or slide.
870
+ */
871
+ interface UsaNotificationBellElement extends UsaElement {
872
+ readonly unread: number;
873
+ readonly notices: BellNotice[];
874
+ open: boolean;
875
+ notify(n: BellNotice | string): void;
876
+ markAllRead(): void;
877
+ ring(): void;
878
+ }
879
+ declare function defineNotificationBell(tag?: string): CustomElementConstructor | undefined;
880
+
881
+ /** Presence states (7.4). */
882
+ declare const PRESENCE_STATES: readonly ["online", "away", "busy", "offline"];
883
+ type PresenceState = (typeof PRESENCE_STATES)[number];
884
+ /**
885
+ * `<usa-presence>` (7.4) — an avatar with a live status dot: `status`
886
+ * online | away | busy | offline. Going online sends a ripple from the dot;
887
+ * every change cross-fades the dot colour; `speaking` adds a pulsing ring
888
+ * (voice chat), `story` an animated gradient ring (unseen story). Initials from
889
+ * `name` when there is no `src`. Labelled `img` ("Ada Lovelace, online").
890
+ * Reduced motion: no ripple, pulse or ring spin.
891
+ */
892
+ interface UsaPresenceElement extends UsaElement {
893
+ status: PresenceState;
894
+ }
895
+ /** Initials for a display name (7.4). */
896
+ declare const initials: (name: string) => string;
897
+ declare function definePresence(tag?: string): CustomElementConstructor | undefined;
898
+
813
899
  /**
814
900
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
815
901
  * entry so `motionary/components` and `components/lite` keep their size
@@ -875,8 +961,12 @@ declare global {
875
961
  'usa-cart-drawer': UsaCartDrawerElement;
876
962
  'usa-product-gallery': UsaProductGalleryElement;
877
963
  'usa-countdown': UsaCountdownElement;
964
+ 'usa-message-list': UsaMessageListElement;
965
+ 'usa-reactions': UsaReactionsElement;
966
+ 'usa-notification-bell': UsaNotificationBellElement;
967
+ 'usa-presence': UsaPresenceElement;
878
968
  }
879
969
  }
880
970
 
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 };
971
+ export { CAROUSEL_EFFECTS, EQ_PRESETS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PRESENCE_STATES, 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, defineMessageList, defineMilestones, defineModal, defineMusicPlayer, defineNavMorph, defineNotificationBell, defineOdometer, definePagination, definePresence, defineProductGallery, defineProgressRing, definePullCord, defineReactions, defineSegmented, defineSheet, defineSkeletonReveal, defineSparkline, defineStarRating, defineStepper, defineStories, defineSwipeDeck, defineSwitch, defineTabBar, defineTip, defineToastStack, defineVolumeKnob, defineWeatherCard, defineWidgets, hexToHsv, hsvToHex, initials, monthGrid, pageWindow, parseISODate, parseLRC, parseReactions, sparkPoints, splitTime, stackToast, wrapIndex };
972
+ export type { BellNotice, CartItem, ChatMessage, PresenceState, StackToastOptions, UsaAddToCartElement, UsaBarChartElement, UsaCarouselElement, UsaCartDrawerElement, UsaColorPickerElement, UsaCompareElement, UsaCountdownElement, UsaCubeGalleryElement, UsaDatePickerElement, UsaDisclosureElement, UsaDockElement, UsaEqualizerElement, UsaFileDropElement, UsaGaugeElement, UsaKanbanElement, UsaKeyframeEditorElement, UsaKpiElement, UsaLyricsElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMessageListElement, UsaMilestonesElement, UsaModalElement, UsaMusicPlayerElement, UsaNavMorphElement, UsaNotificationBellElement, UsaOdometerElement, UsaPaginationElement, UsaPresenceElement, UsaProductGalleryElement, UsaProgressRingElement, UsaPullCordElement, UsaReactionsElement, UsaSegmentedElement, UsaSheetElement, UsaSkeletonRevealElement, UsaSparklineElement, UsaStarRatingElement, UsaStepperElement, UsaStoriesElement, UsaSwipeDeckElement, UsaSwitchElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement, UsaVolumeKnobElement, UsaWeatherCardElement };