@sdxc/ui 2026.11.18 → 2026.11.26

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 (234) hide show
  1. package/README.md +133 -1
  2. package/dist/app/index.d.ts +1 -0
  3. package/dist/app/index.js +1 -0
  4. package/dist/app/mixins/command-palette.js +10 -2
  5. package/dist/app/mixins/log-viewer.js +17 -14
  6. package/dist/app/mixins/route-dialog.d.ts +17 -0
  7. package/dist/app/mixins/route-dialog.js +53 -0
  8. package/dist/app/optimistic-toggle.js +6 -0
  9. package/dist/app/route-dialog.d.ts +38 -0
  10. package/dist/app/route-dialog.js +49 -0
  11. package/dist/audio/equalizer.d.ts +24 -0
  12. package/dist/audio/equalizer.js +57 -0
  13. package/dist/audio/index.d.ts +16 -0
  14. package/dist/audio/index.js +16 -0
  15. package/dist/audio/media-tile.d.ts +38 -0
  16. package/dist/audio/media-tile.js +98 -0
  17. package/dist/audio/player-bar.d.ts +108 -0
  18. package/dist/audio/player-bar.js +338 -0
  19. package/dist/audio/queue-list.d.ts +56 -0
  20. package/dist/audio/queue-list.js +102 -0
  21. package/dist/audio/track-list.d.ts +91 -0
  22. package/dist/audio/track-list.js +226 -0
  23. package/dist/audio/utils/media-session.d.ts +44 -0
  24. package/dist/audio/utils/media-session.js +87 -0
  25. package/dist/audio/utils/play-queue.d.ts +98 -0
  26. package/dist/audio/utils/play-queue.js +149 -0
  27. package/dist/audio/utils/track-time.d.ts +28 -0
  28. package/dist/audio/utils/track-time.js +36 -0
  29. package/dist/chat/composer-format.d.ts +35 -0
  30. package/dist/chat/composer-format.js +84 -0
  31. package/dist/chat/index.d.ts +6 -0
  32. package/dist/chat/index.js +6 -0
  33. package/dist/chat/mention-menu.d.ts +43 -0
  34. package/dist/chat/mention-menu.js +70 -0
  35. package/dist/chat/message-group.d.ts +92 -0
  36. package/dist/chat/message-group.js +222 -0
  37. package/dist/chat/mixins/composer-format.d.ts +28 -0
  38. package/dist/chat/mixins/composer-format.js +80 -0
  39. package/dist/chat/mixins/composer-send.d.ts +2 -2
  40. package/dist/chat/mixins/composer-send.js +4 -2
  41. package/dist/chat/mixins/mention-menu.d.ts +41 -0
  42. package/dist/chat/mixins/mention-menu.js +213 -0
  43. package/dist/chat/mixins/reaction-sync.d.ts +47 -0
  44. package/dist/chat/mixins/reaction-sync.js +172 -0
  45. package/dist/chat/reaction-bar.d.ts +70 -0
  46. package/dist/chat/reaction-bar.js +108 -0
  47. package/dist/chat/typing-indicator.d.ts +42 -0
  48. package/dist/chat/typing-indicator.js +68 -0
  49. package/dist/chat/utils/composer-text.d.ts +38 -0
  50. package/dist/chat/utils/composer-text.js +86 -0
  51. package/dist/chat/utils/markdown-format.d.ts +30 -0
  52. package/dist/chat/utils/markdown-format.js +158 -0
  53. package/dist/chat/utils/mention-query.d.ts +55 -0
  54. package/dist/chat/utils/mention-query.js +60 -0
  55. package/dist/commerce/cart-drawer.d.ts +69 -0
  56. package/dist/commerce/cart-drawer.js +163 -0
  57. package/dist/commerce/cart-line.d.ts +32 -0
  58. package/dist/commerce/cart-line.js +43 -0
  59. package/dist/commerce/checkout-layout.d.ts +32 -0
  60. package/dist/commerce/checkout-layout.js +51 -0
  61. package/dist/commerce/facet-filters.d.ts +121 -0
  62. package/dist/commerce/facet-filters.js +318 -0
  63. package/dist/commerce/fulfilment-note.d.ts +28 -0
  64. package/dist/commerce/fulfilment-note.js +26 -0
  65. package/dist/commerce/index.d.ts +27 -0
  66. package/dist/commerce/index.js +27 -0
  67. package/dist/commerce/item-options-dialog.d.ts +67 -0
  68. package/dist/commerce/item-options-dialog.js +150 -0
  69. package/dist/commerce/menu-item-card.d.ts +37 -0
  70. package/dist/commerce/menu-item-card.js +96 -0
  71. package/dist/commerce/option-group.d.ts +62 -0
  72. package/dist/commerce/option-group.js +121 -0
  73. package/dist/commerce/order-summary.d.ts +42 -0
  74. package/dist/commerce/order-summary.js +76 -0
  75. package/dist/commerce/order-tracker.d.ts +80 -0
  76. package/dist/commerce/order-tracker.js +178 -0
  77. package/dist/commerce/price.d.ts +52 -0
  78. package/dist/commerce/price.js +108 -0
  79. package/dist/commerce/product-card.d.ts +53 -0
  80. package/dist/commerce/product-card.js +127 -0
  81. package/dist/commerce/product-gallery.d.ts +70 -0
  82. package/dist/commerce/product-gallery.js +186 -0
  83. package/dist/commerce/promo-code.d.ts +56 -0
  84. package/dist/commerce/promo-code.js +101 -0
  85. package/dist/commerce/quantity-stepper.d.ts +42 -0
  86. package/dist/commerce/quantity-stepper.js +53 -0
  87. package/dist/commerce/question-list.d.ts +53 -0
  88. package/dist/commerce/question-list.js +92 -0
  89. package/dist/commerce/shipping-estimate.d.ts +53 -0
  90. package/dist/commerce/shipping-estimate.js +39 -0
  91. package/dist/commerce/sort-select.d.ts +38 -0
  92. package/dist/commerce/sort-select.js +38 -0
  93. package/dist/commerce/variant-picker.d.ts +75 -0
  94. package/dist/commerce/variant-picker.js +135 -0
  95. package/dist/components/amount.d.ts +46 -0
  96. package/dist/components/amount.js +34 -0
  97. package/dist/components/autocomplete.d.ts +82 -0
  98. package/dist/components/autocomplete.js +114 -0
  99. package/dist/components/carousel.d.ts +31 -1
  100. package/dist/components/carousel.js +66 -3
  101. package/dist/components/index.d.ts +11 -0
  102. package/dist/components/index.js +11 -0
  103. package/dist/components/letterbox.d.ts +47 -0
  104. package/dist/components/letterbox.js +56 -0
  105. package/dist/components/lightbox.d.ts +88 -0
  106. package/dist/components/lightbox.js +224 -0
  107. package/dist/components/media-grid.d.ts +53 -0
  108. package/dist/components/media-grid.js +89 -0
  109. package/dist/components/range-months.d.ts +100 -0
  110. package/dist/components/range-months.js +274 -0
  111. package/dist/components/rating-input.d.ts +33 -0
  112. package/dist/components/rating-input.js +63 -0
  113. package/dist/components/rating.d.ts +38 -0
  114. package/dist/components/rating.js +66 -0
  115. package/dist/components/review-card.d.ts +39 -0
  116. package/dist/components/review-card.js +59 -0
  117. package/dist/components/section-bar.d.ts +57 -0
  118. package/dist/components/section-bar.js +140 -0
  119. package/dist/components/slider.js +7 -0
  120. package/dist/components/step-indicator.d.ts +46 -0
  121. package/dist/components/step-indicator.js +96 -0
  122. package/dist/finance/index.d.ts +10 -0
  123. package/dist/finance/index.js +10 -0
  124. package/dist/finance/ledger.d.ts +60 -0
  125. package/dist/finance/ledger.js +93 -0
  126. package/dist/finance/payment-card.d.ts +49 -0
  127. package/dist/finance/payment-card.js +115 -0
  128. package/dist/map/engine.d.ts +49 -0
  129. package/dist/map/engine.js +591 -0
  130. package/dist/map/index.d.ts +12 -0
  131. package/dist/map/index.js +12 -0
  132. package/dist/map/map-canvas.d.ts +101 -0
  133. package/dist/map/map-canvas.js +275 -0
  134. package/dist/map/map.d.ts +217 -0
  135. package/dist/map/map.js +598 -0
  136. package/dist/map/mixins/map-link.d.ts +30 -0
  137. package/dist/map/mixins/map-link.js +116 -0
  138. package/dist/map/utils/basemap.d.ts +88 -0
  139. package/dist/map/utils/basemap.js +84 -0
  140. package/dist/map/utils/cluster.d.ts +43 -0
  141. package/dist/map/utils/cluster.js +80 -0
  142. package/dist/map/utils/mercator.d.ts +66 -0
  143. package/dist/map/utils/mercator.js +92 -0
  144. package/dist/map/utils/stage.d.ts +24 -0
  145. package/dist/map/utils/stage.js +49 -0
  146. package/dist/mixins/autocomplete.d.ts +28 -0
  147. package/dist/mixins/autocomplete.js +283 -0
  148. package/dist/mixins/carousel-controls.d.ts +14 -3
  149. package/dist/mixins/carousel-controls.js +89 -30
  150. package/dist/mixins/index.d.ts +2 -0
  151. package/dist/mixins/index.js +2 -0
  152. package/dist/mixins/lightbox-controls.d.ts +34 -0
  153. package/dist/mixins/lightbox-controls.js +176 -0
  154. package/dist/schedule/agenda.d.ts +63 -0
  155. package/dist/schedule/agenda.js +221 -0
  156. package/dist/schedule/day-strip.d.ts +50 -0
  157. package/dist/schedule/day-strip.js +136 -0
  158. package/dist/schedule/free-busy.d.ts +96 -0
  159. package/dist/schedule/free-busy.js +285 -0
  160. package/dist/schedule/index.d.ts +15 -0
  161. package/dist/schedule/index.js +15 -0
  162. package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
  163. package/dist/schedule/mixins/day-strip-scroll.js +40 -0
  164. package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
  165. package/dist/schedule/mixins/time-grid-drag.js +532 -0
  166. package/dist/schedule/month-view.d.ts +68 -0
  167. package/dist/schedule/month-view.js +301 -0
  168. package/dist/schedule/time-grid.d.ts +168 -0
  169. package/dist/schedule/time-grid.js +417 -0
  170. package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
  171. package/dist/schedule/utils/time-grid-layout.js +93 -0
  172. package/dist/schedule/year-view.d.ts +46 -0
  173. package/dist/schedule/year-view.js +142 -0
  174. package/dist/styles/index.d.ts +1 -0
  175. package/dist/styles/index.js +1 -0
  176. package/dist/styles/typewriter-text.d.ts +20 -0
  177. package/dist/styles/typewriter-text.js +23 -0
  178. package/dist/test/map.d.ts +18 -0
  179. package/dist/test/map.js +96 -0
  180. package/dist/test/reels.d.ts +30 -0
  181. package/dist/test/reels.js +41 -0
  182. package/dist/test/stories.d.ts +31 -0
  183. package/dist/test/stories.js +66 -0
  184. package/dist/travel/boarding-pass.d.ts +107 -0
  185. package/dist/travel/boarding-pass.js +293 -0
  186. package/dist/travel/car-offer.d.ts +70 -0
  187. package/dist/travel/car-offer.js +127 -0
  188. package/dist/travel/fare-calendar.d.ts +85 -0
  189. package/dist/travel/fare-calendar.js +233 -0
  190. package/dist/travel/fare-options.d.ts +84 -0
  191. package/dist/travel/fare-options.js +142 -0
  192. package/dist/travel/flight-itinerary.d.ts +84 -0
  193. package/dist/travel/flight-itinerary.js +112 -0
  194. package/dist/travel/flight-option.d.ts +58 -0
  195. package/dist/travel/flight-option.js +111 -0
  196. package/dist/travel/flight-segment.d.ts +105 -0
  197. package/dist/travel/flight-segment.js +174 -0
  198. package/dist/travel/index.d.ts +20 -0
  199. package/dist/travel/index.js +20 -0
  200. package/dist/travel/package-savings.d.ts +74 -0
  201. package/dist/travel/package-savings.js +128 -0
  202. package/dist/travel/price-breakdown.d.ts +66 -0
  203. package/dist/travel/price-breakdown.js +102 -0
  204. package/dist/travel/rating-breakdown.d.ts +81 -0
  205. package/dist/travel/rating-breakdown.js +132 -0
  206. package/dist/travel/seat-map.d.ts +108 -0
  207. package/dist/travel/seat-map.js +371 -0
  208. package/dist/travel/trip-timeline.d.ts +84 -0
  209. package/dist/travel/trip-timeline.js +212 -0
  210. package/dist/utils/gamepad-presses.d.ts +21 -0
  211. package/dist/utils/gamepad-presses.js +28 -0
  212. package/dist/utils/index.d.ts +5 -0
  213. package/dist/utils/index.js +5 -0
  214. package/dist/utils/move-focus.d.ts +20 -0
  215. package/dist/utils/move-focus.js +28 -0
  216. package/dist/utils/range-months.d.ts +54 -0
  217. package/dist/utils/range-months.js +98 -0
  218. package/dist/utils/swipe-direction.d.ts +23 -0
  219. package/dist/utils/swipe-direction.js +27 -0
  220. package/dist/utils/typewriter.d.ts +49 -0
  221. package/dist/utils/typewriter.js +171 -0
  222. package/dist/video/index.d.ts +6 -2
  223. package/dist/video/index.js +6 -2
  224. package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
  225. package/dist/video/mixins/reel-feed-sync.js +430 -0
  226. package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
  227. package/dist/video/mixins/story-viewer-sync.js +391 -0
  228. package/dist/video/reel-feed.d.ts +95 -0
  229. package/dist/video/reel-feed.js +124 -0
  230. package/dist/video/story-ring.d.ts +32 -0
  231. package/dist/video/story-ring.js +42 -0
  232. package/dist/video/story-viewer.d.ts +85 -0
  233. package/dist/video/story-viewer.js +250 -0
  234. package/package.json +21 -2
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
+ import { mergeMix, raw } from "@sdxc/u/general";
3
+ import { when } from "@sdxc/u/state";
4
+ /** The outer size, in rem, when a page names none. */
5
+ const DEFAULT_SIZE = 4;
6
+ /**
7
+ * Renders the ring around its picture, its size set on the element itself so every ring shares
8
+ * one set of rules and the seen state always wins. The unseen ring paints `--ui-story-ring`, the brand's
9
+ * solid colour unless a page names a gradient; the seen ring paints the quiet border colour.
10
+ *
11
+ * @example <StoryRing seen={person.seen}><Avatar src={person.photo} alt="" /></StoryRing>
12
+ */
13
+ export function StoryRing(handle) {
14
+ return () => {
15
+ let { children, mix, seen = false, size = DEFAULT_SIZE, style, ...rest } = handle.props;
16
+ let side = typeof size === "number" ? `${size}rem` : size;
17
+ return (_jsx("span", { ...rest, style: `--ui-story-ring-size: ${side};${typeof style === "string" ? ` ${style}` : ""}`, "data-slot": "story-ring", "data-seen": seen ? "" : undefined, mix: mergeMix([
18
+ raw({
19
+ position: "relative",
20
+ display: "inline-grid",
21
+ placeItems: "center",
22
+ flexShrink: "0",
23
+ inlineSize: "var(--ui-story-ring-size)",
24
+ blockSize: "var(--ui-story-ring-size)",
25
+ padding: "calc(var(--ui-story-ring-size) * 0.05 + 1px)",
26
+ borderRadius: "var(--ui-story-ring-radius, 999px)",
27
+ background: "var(--ui-story-ring, var(--ui-brand-bg-solid))",
28
+ "& > *": {
29
+ inlineSize: "100%",
30
+ blockSize: "100%",
31
+ borderRadius: "inherit",
32
+ overflow: "hidden",
33
+ boxShadow: "0 0 0 calc(var(--ui-story-ring-size) * 0.035 + 1px) var(--ui-bg, Canvas)",
34
+ },
35
+ }),
36
+ when("&[data-seen]", raw({
37
+ padding: "calc(var(--ui-story-ring-size) * 0.05)",
38
+ background: "var(--ui-neutral-border-strong)",
39
+ })),
40
+ ], mix), children: children }));
41
+ };
42
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * A full-screen story player: each person's stories are a group of timed segments under a row
3
+ * of progress bars, groups sit side by side on a horizontal snap track, and tap zones that are
4
+ * links step through them, so the viewer reads and moves without script and its island adds
5
+ * timing, hold to pause and swipe down to close.
6
+ *
7
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
8
+ * @copyright Sergio Xalambrí 2026
9
+ */
10
+ import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
11
+ export { STORY_CHANGE_EVENT } from "./mixins/story-viewer-sync.js";
12
+ export type { StoryChangeDetail } from "./mixins/story-viewer-sync.js";
13
+ /** Prop types for {@link StoryViewer} and its parts. */
14
+ export declare namespace StoryViewer {
15
+ /** Every native `<section>` attribute, plus the viewer's name, exit and control names. */
16
+ interface Props extends TagProps<"section"> {
17
+ /** The viewer's accessible name, such as "Stories". */
18
+ label: string;
19
+ /** Where closing leaves to: the page the viewer opened from. */
20
+ closeHref: string;
21
+ labels: {
22
+ close: string;
23
+ /** The pause button's name; it is pressed while the story is paused. */
24
+ pause: string;
25
+ };
26
+ /** {@link StoryViewer.Group} elements, one per person, in viewing order. */
27
+ children: RemixNode;
28
+ }
29
+ /** Every native `<article>` attribute, plus one person's stories. */
30
+ interface GroupProps extends Omit<TagProps<"article">, "children"> {
31
+ /** The group's accessible name, such as "Mara Quint's story". */
32
+ label: string;
33
+ /** What sits under the progress bars: the person, how long ago, a menu. */
34
+ header?: RemixNode;
35
+ /** Each segment's length in seconds, in order, which times its progress bar. */
36
+ durations: number[];
37
+ /** The segment the group shows first. */
38
+ current: number;
39
+ /** Whether the viewer opens on this group; exactly one group in a viewer sets it. */
40
+ active?: boolean;
41
+ /** The address of the segment before the current one, or the close address before the first. */
42
+ previousHref: string;
43
+ /** The address of the segment after the current one, or the close address after the last. */
44
+ nextHref: string;
45
+ /** The tap zones' names. */
46
+ labels: {
47
+ previous: string;
48
+ next: string;
49
+ };
50
+ /** What sits at the foot of the card, such as a reply field. */
51
+ footer?: RemixNode;
52
+ /** {@link StoryViewer.Segment} elements in order. */
53
+ children: RemixNode;
54
+ }
55
+ /** Every native `<div>` attribute, plus one segment's address and picture. */
56
+ interface SegmentProps extends TagProps<"div"> {
57
+ /** The segment's own address, which the address bar follows. */
58
+ href: string;
59
+ /** Whether this is the group's current segment. */
60
+ current: boolean;
61
+ }
62
+ }
63
+ /**
64
+ * Renders the viewer: a full-screen dark stage with the close and pause buttons, and the track
65
+ * of groups; the group marked `active` is the one the track starts at. A page shows it inside
66
+ * a box by setting `--ui-story-viewer-position: absolute` and `--ui-story-viewer-height`.
67
+ *
68
+ * @example
69
+ * <StoryViewer label="Stories" closeHref="/" labels={{ close: "Close", pause: "Pause" }}>
70
+ * <StoryViewer.Group label="Mara's story" durations={[5, 5]} current={0} active
71
+ * previousHref="/" nextHref="/stories/mara/2" labels={{ previous: "Previous", next: "Next" }}>
72
+ * <StoryViewer.Segment href="/stories/mara/1" current><Art /></StoryViewer.Segment>
73
+ * </StoryViewer.Group>
74
+ * </StoryViewer>
75
+ */
76
+ export declare function StoryViewer(handle: Handle<StoryViewer.Props>): () => import("remix/component").RemixElement;
77
+ export declare namespace StoryViewer {
78
+ var Group: (handle: Handle<StoryViewer.GroupProps>) => () => import("remix/component").RemixElement;
79
+ var Segment: (handle: Handle<StoryViewer.SegmentProps>) => () => import("remix/component").RemixElement;
80
+ }
81
+ /**
82
+ * The island inside every {@link StoryViewer}: a hidden marker that runs the viewer. It loads
83
+ * from `@sdxc/ui/video/story-viewer`, which the browser entry maps to an import.
84
+ */
85
+ export declare const StoryViewerSync: EntryComponent<Record<never, never>>;
@@ -0,0 +1,250 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { ChevronLeftIcon, ChevronRightIcon, PauseIcon, PlayIcon, XIcon } from "@sdxc/icons";
3
+ import { keyframes } from "@sdxc/u/animation";
4
+ import { mergeMix, raw } from "@sdxc/u/general";
5
+ import { motionReduce } from "@sdxc/u/responsive";
6
+ import { when } from "@sdxc/u/state";
7
+ import { clientEntry } from "remix/component";
8
+ import { STORY_ACTIVE, STORY_PAUSED, storyViewerSync } from "./mixins/story-viewer-sync.js";
9
+ export { STORY_CHANGE_EVENT } from "./mixins/story-viewer-sync.js";
10
+ /** The keyframes a current segment's bar fills by. */
11
+ const FILL = "ui-story-fill";
12
+ /**
13
+ * Renders the viewer: a full-screen dark stage with the close and pause buttons, and the track
14
+ * of groups; the group marked `active` is the one the track starts at. A page shows it inside
15
+ * a box by setting `--ui-story-viewer-position: absolute` and `--ui-story-viewer-height`.
16
+ *
17
+ * @example
18
+ * <StoryViewer label="Stories" closeHref="/" labels={{ close: "Close", pause: "Pause" }}>
19
+ * <StoryViewer.Group label="Mara's story" durations={[5, 5]} current={0} active
20
+ * previousHref="/" nextHref="/stories/mara/2" labels={{ previous: "Previous", next: "Next" }}>
21
+ * <StoryViewer.Segment href="/stories/mara/1" current><Art /></StoryViewer.Segment>
22
+ * </StoryViewer.Group>
23
+ * </StoryViewer>
24
+ */
25
+ export function StoryViewer(handle) {
26
+ return () => {
27
+ let { children, closeHref, label, labels, mix, ...rest } = handle.props;
28
+ return (_jsxs("section", { ...rest, "aria-label": label, "aria-roledescription": "stories", tabindex: -1, "data-slot": "story-viewer", mix: mergeMix([
29
+ keyframes(FILL, { from: { inlineSize: "0%" }, to: { inlineSize: "100%" } }),
30
+ raw({
31
+ position: "var(--ui-story-viewer-position, fixed)",
32
+ inset: "0",
33
+ zIndex: "var(--ui-story-viewer-z, 60)",
34
+ display: "grid",
35
+ backgroundColor: "var(--ui-story-viewer-bg, oklch(0.14 0.01 280))",
36
+ color: "oklch(0.98 0 0)",
37
+ outline: "none",
38
+ overscrollBehavior: "contain",
39
+ }),
40
+ ], mix), children: [_jsx("div", { "data-slot": "story-viewer-track", mix: [
41
+ raw({
42
+ display: "grid",
43
+ gridAutoFlow: "column",
44
+ gridAutoColumns: "100%",
45
+ overflowX: "auto",
46
+ overflowY: "hidden",
47
+ scrollSnapType: "x mandatory",
48
+ overscrollBehaviorX: "contain",
49
+ scrollbarWidth: "none",
50
+ "&::-webkit-scrollbar": { display: "none" },
51
+ }),
52
+ ], children: children }), _jsxs("div", { mix: [
53
+ raw({
54
+ position: "absolute",
55
+ insetBlockStart: "max(0.75rem, env(safe-area-inset-top))",
56
+ insetInlineEnd: "0.75rem",
57
+ zIndex: "2",
58
+ display: "flex",
59
+ gap: "0.25rem",
60
+ }),
61
+ ], children: [_jsxs("button", { type: "button", "data-story-pause": "", "data-story-control": "", "aria-label": labels.pause, "aria-pressed": "false", mix: [
62
+ roundControl(),
63
+ when("&:not([aria-pressed='true']) > [data-icon=play]", raw({ display: "none" })),
64
+ when("&[aria-pressed='true'] > [data-icon=pause]", raw({ display: "none" })),
65
+ ], children: [_jsx(PauseIcon, { "aria-hidden": "true", "data-icon": "pause", size: 20, fill: "currentColor" }), _jsx(PlayIcon, { "aria-hidden": "true", "data-icon": "play", size: 20, fill: "currentColor" })] }), _jsx("a", { href: closeHref, "data-story-close": "", "data-story-control": "", "aria-label": labels.close, mix: [roundControl()], children: _jsx(XIcon, { "aria-hidden": "true", size: 24 }) })] }), _jsx(StoryViewerSync, {})] }));
66
+ };
67
+ }
68
+ /** A round icon control over the dark stage, a 44px target. */
69
+ function roundControl() {
70
+ return [
71
+ raw({
72
+ display: "inline-grid",
73
+ placeItems: "center",
74
+ inlineSize: "2.75rem",
75
+ blockSize: "2.75rem",
76
+ padding: "0",
77
+ border: "0",
78
+ borderRadius: "999px",
79
+ color: "inherit",
80
+ background: "rgb(0 0 0 / 0.25)",
81
+ cursor: "pointer",
82
+ textDecoration: "none",
83
+ }),
84
+ when("&:hover", raw({ background: "rgb(255 255 255 / 0.16)" })),
85
+ when("&:focus-visible", raw({ outline: "2px solid oklch(0.98 0 0)", outlineOffset: "-2px" })),
86
+ ];
87
+ }
88
+ /**
89
+ * One person's stories: a screen-wide snap point holding a card that fills a phone and stands
90
+ * 9:16 with a margin on a wider screen, with the bars,
91
+ * the header, the segments, the two tap zones and an optional footer.
92
+ */
93
+ StoryViewer.Group = function StoryViewerGroup(handle) {
94
+ return () => {
95
+ let { active, children, current, durations, footer, header, label, labels, mix, nextHref, previousHref, ...rest } = handle.props;
96
+ return (_jsx("article", { ...rest, "aria-label": label, "data-slot": "story-viewer-group", [STORY_ACTIVE]: active ? "" : undefined, mix: mergeMix([
97
+ raw({
98
+ container: "ui-story-group / size",
99
+ display: "grid",
100
+ placeItems: "center",
101
+ blockSize: "var(--ui-story-viewer-height, 100dvh)",
102
+ scrollSnapAlign: "center",
103
+ scrollSnapStop: "always",
104
+ overflow: "hidden",
105
+ }),
106
+ raw(active ? { scrollInitialTarget: "nearest" } : {}),
107
+ ], mix), children: _jsxs("div", { "data-slot": "story-viewer-card", mix: [
108
+ raw({
109
+ position: "relative",
110
+ inlineSize: "100cqi",
111
+ blockSize: "100cqb",
112
+ overflow: "hidden",
113
+ backgroundColor: "oklch(0.2 0.01 280)",
114
+ touchAction: "pan-x",
115
+ userSelect: "none",
116
+ WebkitUserSelect: "none",
117
+ WebkitTouchCallout: "none",
118
+ transition: "transform 220ms ease, opacity 220ms ease, scale 220ms ease",
119
+ "@container ui-story-group (min-width: 40rem)": {
120
+ inlineSize: "min(100cqi, calc((100cqb - 3rem) * 0.5625))",
121
+ blockSize: "calc(100cqb - 3rem)",
122
+ borderRadius: "var(--ui-story-viewer-radius, 0.75rem)",
123
+ },
124
+ }),
125
+ when(`[data-story-dragging] [${STORY_ACTIVE}] > &`, raw({
126
+ transition: "none",
127
+ transform: "translateY(var(--ui-story-pull, 0px))",
128
+ opacity: "var(--ui-story-fade, 1)",
129
+ })),
130
+ motionReduce(raw({ transition: "none" })),
131
+ ], children: [children, _jsxs("div", { "data-slot": "story-viewer-chrome", mix: [
132
+ raw({
133
+ position: "absolute",
134
+ insetInline: "0",
135
+ insetBlockStart: "0",
136
+ zIndex: "2",
137
+ display: "grid",
138
+ gap: "0.625rem",
139
+ paddingBlock: "max(0.625rem, env(safe-area-inset-top)) 2.5rem",
140
+ paddingInline: "0.75rem 6.75rem",
141
+ background: "linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0))",
142
+ pointerEvents: "none",
143
+ "& a, & button": { pointerEvents: "auto" },
144
+ "@container ui-story-group (min-width: 40rem)": { paddingInlineEnd: "0.75rem" },
145
+ }),
146
+ ], children: [_jsx("div", { "aria-hidden": "true", mix: [
147
+ raw({
148
+ display: "grid",
149
+ gridAutoFlow: "column",
150
+ gridAutoColumns: "1fr",
151
+ gap: "0.25rem",
152
+ }),
153
+ ], children: durations.map((seconds, index) => (_jsx("span", { "data-slot": "story-viewer-bar", "data-done": index < current ? "" : undefined, "data-current": index === current ? "" : undefined, style: `--ui-story-duration: ${seconds}s`, mix: [
154
+ raw({
155
+ display: "block",
156
+ blockSize: "0.1875rem",
157
+ borderRadius: "999px",
158
+ overflow: "hidden",
159
+ backgroundColor: "rgb(255 255 255 / 0.35)",
160
+ "& > span": {
161
+ display: "block",
162
+ blockSize: "100%",
163
+ inlineSize: "0%",
164
+ backgroundColor: "oklch(0.99 0 0)",
165
+ },
166
+ }),
167
+ when("&[data-done] > span", raw({ inlineSize: "100%" })),
168
+ when("&[data-current] > span", raw({
169
+ animationName: FILL,
170
+ animationDuration: "var(--ui-story-duration)",
171
+ animationTimingFunction: "linear",
172
+ animationFillMode: "forwards",
173
+ animationPlayState: "paused",
174
+ })),
175
+ when(`[${STORY_ACTIVE}] &[data-current] > span`, raw({ animationPlayState: "running" })),
176
+ when(`[${STORY_PAUSED}] &[data-current] > span`, raw({ animationPlayState: "paused" })),
177
+ ], children: _jsx("span", {}) }))) }), header] }), _jsx(StoryZone, { direction: "previous", href: previousHref, label: labels.previous }), _jsx(StoryZone, { direction: "next", href: nextHref, label: labels.next }), footer === undefined ? null : (_jsx("div", { "data-slot": "story-viewer-footer", "data-story-control": "", mix: [
178
+ raw({
179
+ position: "absolute",
180
+ insetInline: "0",
181
+ insetBlockEnd: "0",
182
+ zIndex: "2",
183
+ paddingBlock: "2.5rem max(0.75rem, env(safe-area-inset-bottom))",
184
+ paddingInline: "0.75rem",
185
+ background: "linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.5))",
186
+ }),
187
+ ], children: footer }))] }) }));
188
+ };
189
+ };
190
+ /**
191
+ * A tap zone over one side of the card: a third of it going back, two thirds going forward,
192
+ * each a link to that segment's address, with a chevron where a pointer can hover.
193
+ */
194
+ function StoryZone(handle) {
195
+ return () => {
196
+ let { direction, href, label } = handle.props;
197
+ let back = direction === "previous";
198
+ return (_jsx("a", { href: href, "data-story-zone": direction, "aria-label": label, draggable: false, mix: [
199
+ raw({
200
+ position: "absolute",
201
+ zIndex: "1",
202
+ insetBlock: "0",
203
+ insetInlineStart: back ? "0" : "33.333%",
204
+ insetInlineEnd: back ? "66.667%" : "0",
205
+ display: "flex",
206
+ alignItems: "center",
207
+ justifyContent: back ? "flex-start" : "flex-end",
208
+ paddingInline: "0.5rem",
209
+ color: "oklch(0.99 0 0)",
210
+ WebkitTapHighlightColor: "transparent",
211
+ outline: "none",
212
+ "& > svg": {
213
+ inlineSize: "2rem",
214
+ blockSize: "2rem",
215
+ padding: "0.25rem",
216
+ borderRadius: "999px",
217
+ backgroundColor: "rgb(0 0 0 / 0.35)",
218
+ opacity: "0",
219
+ transition: "opacity 140ms ease",
220
+ },
221
+ "@media (hover: hover)": { "&:hover > svg": { opacity: "1" } },
222
+ }),
223
+ when("&:focus-visible > svg", raw({ opacity: "1", outline: "2px solid oklch(0.99 0 0)" })),
224
+ motionReduce(raw({ "& > svg": { transition: "none" } })),
225
+ ], children: back ? _jsx(ChevronLeftIcon, { "aria-hidden": "true" }) : _jsx(ChevronRightIcon, { "aria-hidden": "true" }) }));
226
+ };
227
+ }
228
+ /** One segment: a full-card layer, shown only while it is its group's current one. */
229
+ StoryViewer.Segment = function StoryViewerSegment(handle) {
230
+ return () => {
231
+ let { current, href, mix, ...rest } = handle.props;
232
+ return (_jsx("div", { ...rest, "data-slot": "story-viewer-segment", "data-href": href, "data-current": current ? "" : undefined, mix: mergeMix([
233
+ raw({
234
+ position: "absolute",
235
+ inset: "0",
236
+ visibility: "hidden",
237
+ "& > *": { inlineSize: "100%", blockSize: "100%" },
238
+ "& video, & img, & svg": { objectFit: "cover" },
239
+ }),
240
+ when("&[data-current]", raw({ visibility: "visible" })),
241
+ ], mix) }));
242
+ };
243
+ };
244
+ /**
245
+ * The island inside every {@link StoryViewer}: a hidden marker that runs the viewer. It loads
246
+ * from `@sdxc/ui/video/story-viewer`, which the browser entry maps to an import.
247
+ */
248
+ export const StoryViewerSync = clientEntry("@sdxc/ui/video/story-viewer#StoryViewerSync", function StoryViewerSync() {
249
+ return () => _jsx("span", { hidden: true, mix: [storyViewerSync()] });
250
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/ui",
3
- "version": "2026.11.18",
3
+ "version": "2026.11.26",
4
4
  "description": "Styled, accessible remix/component components rendered as server HTML",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,6 +19,18 @@
19
19
  "./app/*": "./dist/app/*.js",
20
20
  "./video": "./dist/video/index.js",
21
21
  "./video/*": "./dist/video/*.js",
22
+ "./audio": "./dist/audio/index.js",
23
+ "./audio/*": "./dist/audio/*.js",
24
+ "./commerce": "./dist/commerce/index.js",
25
+ "./commerce/*": "./dist/commerce/*.js",
26
+ "./map": "./dist/map/index.js",
27
+ "./map/*": "./dist/map/*.js",
28
+ "./travel": "./dist/travel/index.js",
29
+ "./travel/*": "./dist/travel/*.js",
30
+ "./finance": "./dist/finance/index.js",
31
+ "./finance/*": "./dist/finance/*.js",
32
+ "./schedule": "./dist/schedule/index.js",
33
+ "./schedule/*": "./dist/schedule/*.js",
22
34
  "./animations": "./dist/animations/index.js",
23
35
  "./behaviors": "./dist/behaviors/index.js",
24
36
  "./mixins": "./dist/mixins/index.js",
@@ -34,13 +46,20 @@
34
46
  "@sdxc/highlight": "2026.11.14",
35
47
  "@sdxc/icons": "2026.11.10",
36
48
  "@sdxc/iife": "2026.10.23",
49
+ "@sdxc/money": "2026.11.22",
37
50
  "@sdxc/u": "2026.11.10",
38
51
  "@sdxc/uuid": "2026.11.10"
39
52
  },
40
53
  "peerDependencies": {
54
+ "maplibre-gl": "6.17.0",
41
55
  "remix": "3.2.0"
42
56
  },
43
- "gitHead": "e298b0e963bc3012e6b6982bfee40a237fc93d1e",
57
+ "peerDependenciesMeta": {
58
+ "maplibre-gl": {
59
+ "optional": true
60
+ }
61
+ },
62
+ "gitHead": "a6d84fa08849d9318c95ac92e15cc77973a91561",
44
63
  "publishConfig": {
45
64
  "access": "public"
46
65
  },