@sdxc/ui 2026.11.17 → 2026.11.22

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 (238) hide show
  1. package/README.md +139 -2
  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/step-indicator.d.ts +46 -0
  120. package/dist/components/step-indicator.js +96 -0
  121. package/dist/finance/index.d.ts +10 -0
  122. package/dist/finance/index.js +10 -0
  123. package/dist/finance/ledger.d.ts +60 -0
  124. package/dist/finance/ledger.js +93 -0
  125. package/dist/finance/payment-card.d.ts +49 -0
  126. package/dist/finance/payment-card.js +115 -0
  127. package/dist/map/engine.d.ts +49 -0
  128. package/dist/map/engine.js +591 -0
  129. package/dist/map/index.d.ts +12 -0
  130. package/dist/map/index.js +12 -0
  131. package/dist/map/map-canvas.d.ts +101 -0
  132. package/dist/map/map-canvas.js +275 -0
  133. package/dist/map/map.d.ts +217 -0
  134. package/dist/map/map.js +598 -0
  135. package/dist/map/mixins/map-link.d.ts +30 -0
  136. package/dist/map/mixins/map-link.js +116 -0
  137. package/dist/map/utils/basemap.d.ts +88 -0
  138. package/dist/map/utils/basemap.js +84 -0
  139. package/dist/map/utils/cluster.d.ts +43 -0
  140. package/dist/map/utils/cluster.js +80 -0
  141. package/dist/map/utils/mercator.d.ts +66 -0
  142. package/dist/map/utils/mercator.js +92 -0
  143. package/dist/map/utils/stage.d.ts +24 -0
  144. package/dist/map/utils/stage.js +49 -0
  145. package/dist/mixins/autocomplete.d.ts +28 -0
  146. package/dist/mixins/autocomplete.js +283 -0
  147. package/dist/mixins/carousel-controls.d.ts +14 -3
  148. package/dist/mixins/carousel-controls.js +89 -30
  149. package/dist/mixins/index.d.ts +2 -0
  150. package/dist/mixins/index.js +2 -0
  151. package/dist/mixins/lightbox-controls.d.ts +34 -0
  152. package/dist/mixins/lightbox-controls.js +176 -0
  153. package/dist/schedule/agenda.d.ts +63 -0
  154. package/dist/schedule/agenda.js +221 -0
  155. package/dist/schedule/day-strip.d.ts +50 -0
  156. package/dist/schedule/day-strip.js +136 -0
  157. package/dist/schedule/free-busy.d.ts +96 -0
  158. package/dist/schedule/free-busy.js +285 -0
  159. package/dist/schedule/index.d.ts +15 -0
  160. package/dist/schedule/index.js +15 -0
  161. package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
  162. package/dist/schedule/mixins/day-strip-scroll.js +40 -0
  163. package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
  164. package/dist/schedule/mixins/time-grid-drag.js +532 -0
  165. package/dist/schedule/month-view.d.ts +68 -0
  166. package/dist/schedule/month-view.js +301 -0
  167. package/dist/schedule/time-grid.d.ts +168 -0
  168. package/dist/schedule/time-grid.js +417 -0
  169. package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
  170. package/dist/schedule/utils/time-grid-layout.js +93 -0
  171. package/dist/schedule/year-view.d.ts +46 -0
  172. package/dist/schedule/year-view.js +142 -0
  173. package/dist/styles/index.d.ts +1 -0
  174. package/dist/styles/index.js +1 -0
  175. package/dist/styles/typewriter-text.d.ts +20 -0
  176. package/dist/styles/typewriter-text.js +23 -0
  177. package/dist/test/map.d.ts +18 -0
  178. package/dist/test/map.js +96 -0
  179. package/dist/test/reels.d.ts +30 -0
  180. package/dist/test/reels.js +41 -0
  181. package/dist/test/stories.d.ts +31 -0
  182. package/dist/test/stories.js +66 -0
  183. package/dist/travel/boarding-pass.d.ts +107 -0
  184. package/dist/travel/boarding-pass.js +293 -0
  185. package/dist/travel/car-offer.d.ts +70 -0
  186. package/dist/travel/car-offer.js +127 -0
  187. package/dist/travel/fare-calendar.d.ts +85 -0
  188. package/dist/travel/fare-calendar.js +233 -0
  189. package/dist/travel/fare-options.d.ts +84 -0
  190. package/dist/travel/fare-options.js +142 -0
  191. package/dist/travel/flight-itinerary.d.ts +84 -0
  192. package/dist/travel/flight-itinerary.js +112 -0
  193. package/dist/travel/flight-option.d.ts +58 -0
  194. package/dist/travel/flight-option.js +111 -0
  195. package/dist/travel/flight-segment.d.ts +105 -0
  196. package/dist/travel/flight-segment.js +174 -0
  197. package/dist/travel/index.d.ts +20 -0
  198. package/dist/travel/index.js +20 -0
  199. package/dist/travel/package-savings.d.ts +74 -0
  200. package/dist/travel/package-savings.js +128 -0
  201. package/dist/travel/price-breakdown.d.ts +66 -0
  202. package/dist/travel/price-breakdown.js +102 -0
  203. package/dist/travel/rating-breakdown.d.ts +81 -0
  204. package/dist/travel/rating-breakdown.js +132 -0
  205. package/dist/travel/seat-map.d.ts +108 -0
  206. package/dist/travel/seat-map.js +371 -0
  207. package/dist/travel/trip-timeline.d.ts +84 -0
  208. package/dist/travel/trip-timeline.js +212 -0
  209. package/dist/utils/gamepad-presses.d.ts +21 -0
  210. package/dist/utils/gamepad-presses.js +28 -0
  211. package/dist/utils/index.d.ts +5 -0
  212. package/dist/utils/index.js +5 -0
  213. package/dist/utils/move-focus.d.ts +20 -0
  214. package/dist/utils/move-focus.js +28 -0
  215. package/dist/utils/range-months.d.ts +54 -0
  216. package/dist/utils/range-months.js +98 -0
  217. package/dist/utils/swipe-direction.d.ts +23 -0
  218. package/dist/utils/swipe-direction.js +27 -0
  219. package/dist/utils/typewriter.d.ts +49 -0
  220. package/dist/utils/typewriter.js +171 -0
  221. package/dist/video/index.d.ts +6 -2
  222. package/dist/video/index.js +6 -2
  223. package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
  224. package/dist/video/mixins/reel-feed-sync.js +430 -0
  225. package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
  226. package/dist/video/mixins/story-viewer-sync.js +391 -0
  227. package/dist/video/mixins/video-player-sync.js +138 -5
  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/dist/video/video-card.d.ts +3 -1
  235. package/dist/video/video-card.js +15 -5
  236. package/dist/video/video-player.d.ts +33 -0
  237. package/dist/video/video-player.js +226 -20
  238. package/package.json +21 -2
@@ -30,7 +30,7 @@ export function clampProgress(value) {
30
30
  */
31
31
  export function VideoCard(handle) {
32
32
  return () => {
33
- let { art, badge, href, meta, mix, progress, progressLabel, shape = "landscape", title, ...rest } = handle.props;
33
+ let { art, badge, badgePlacement = "top", href, meta, mix, progress, progressLabel, shape = "landscape", title, ...rest } = handle.props;
34
34
  let watched = progress === undefined ? null : clampProgress(progress);
35
35
  return (_jsxs("a", { ...rest, href: href, "data-slot": "video-card", "data-shape": shape, mix: mergeMix([
36
36
  raw({
@@ -69,7 +69,7 @@ export function VideoCard(handle) {
69
69
  transition: "scale 320ms cubic-bezier(0.2, 0.7, 0.2, 1)",
70
70
  },
71
71
  }),
72
- ], children: [art, badge === undefined ? null : _jsx(CardBadge, { children: badge }), watched === null ? null : _jsx(CardProgress, { value: watched })] }), _jsxs("span", { mix: [raw({ display: "grid", gap: "0.125rem", minInlineSize: "0" })], children: [_jsx("span", { "data-slot": "video-card-title", mix: [
72
+ ], children: [art, badge === undefined ? null : (_jsx(CardBadge, { placement: badgePlacement, raised: watched !== null, children: badge })), watched === null ? null : _jsx(CardProgress, { value: watched })] }), _jsxs("span", { mix: [raw({ display: "grid", gap: "0.125rem", minInlineSize: "0" })], children: [_jsx("span", { "data-slot": "video-card-title", mix: [
73
73
  raw({
74
74
  overflow: "hidden",
75
75
  textOverflow: "ellipsis",
@@ -92,12 +92,22 @@ export function VideoCard(handle) {
92
92
  ], children: meta })), watched === null || progressLabel === undefined ? null : (_jsx("span", { mix: [visuallyHidden()], children: progressLabel }))] })] }));
93
93
  };
94
94
  }
95
- /** The label on the art's top corner, on a dark glass so it reads over any artwork. */
95
+ /** How far above the art's foot a badge sits: clear of the watched bar, or not at the foot. */
96
+ function badgeFoot(placement, raised) {
97
+ if (placement === "top")
98
+ return "auto";
99
+ return raised ? "0.75rem" : "0.5rem";
100
+ }
101
+ /**
102
+ * The label on one corner of the art, on a dark glass so it reads over any artwork; at the foot
103
+ * it sits clear of the watched bar.
104
+ */
96
105
  function CardBadge(handle) {
97
- return () => (_jsx("span", { "data-slot": "video-card-badge", mix: [
106
+ return () => (_jsx("span", { "data-slot": "video-card-badge", "data-placement": handle.props.placement, mix: [
98
107
  raw({
99
108
  position: "absolute",
100
- insetBlockStart: "0.5rem",
109
+ insetBlockStart: handle.props.placement === "top" ? "0.5rem" : "auto",
110
+ insetBlockEnd: badgeFoot(handle.props.placement, handle.props.raised),
101
111
  insetInlineStart: "0.5rem",
102
112
  paddingInline: "0.4375rem",
103
113
  paddingBlock: "0.125rem",
@@ -11,6 +11,12 @@ import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix
11
11
  export declare namespace VideoPlayer {
12
12
  /** `plain` follows the page's scheme; `theater` is a dark screening room in either. */
13
13
  type Tone = "plain" | "theater";
14
+ /**
15
+ * `page` sets the screen at 16:9 in a framed card with room for a side column, as a lesson
16
+ * or talk sits on a page; `stage` fills the box it is given with the picture, its bar and
17
+ * overlay floating over it and fading while it plays, as a film or episode is watched.
18
+ */
19
+ type Layout = "page" | "stage";
14
20
  /** One chapter, from its start to the next chapter's start or the video's end. */
15
21
  interface Chapter {
16
22
  /** Seconds from the start of the video. */
@@ -42,6 +48,8 @@ export declare namespace VideoPlayer {
42
48
  current?: number;
43
49
  /** Colour scheme of the player. @default "plain" */
44
50
  tone?: Tone;
51
+ /** How the player sits on the page. @default "page" */
52
+ layout?: Layout;
45
53
  /** The parts, in reading order; a {@link VideoPlayer.Side} becomes the second column. */
46
54
  children: RemixNode;
47
55
  }
@@ -77,6 +85,8 @@ export declare namespace VideoPlayer {
77
85
  sources: readonly SourceInfo[];
78
86
  /** The captions tracks in the order the video holds them. */
79
87
  captions: readonly CaptionsInfo[];
88
+ /** The player's layout. */
89
+ layout?: Layout;
80
90
  }
81
91
  /** Props accepted by {@link VideoPlayer.Screen}. */
82
92
  interface ScreenProps extends Omit<TagProps<"div">, "children"> {
@@ -132,6 +142,24 @@ export declare namespace VideoPlayer {
132
142
  /** The button's accessible name. */
133
143
  label: string;
134
144
  }
145
+ /** Props accepted by {@link VideoPlayer.Skip}. */
146
+ interface SkipProps extends ButtonProps {
147
+ /** Seconds to move: negative steps back, positive steps forward. */
148
+ seconds: number;
149
+ }
150
+ /** Props accepted by {@link VideoPlayer.Group}. */
151
+ interface GroupProps extends TagProps<"div"> {
152
+ /**
153
+ * Where the group sits on the bar: `start` and `end` share the space either side, so a
154
+ * `center` group between them stays centred whatever they hold. @default "start"
155
+ */
156
+ align?: "start" | "center" | "end";
157
+ }
158
+ /** Props accepted by {@link VideoPlayer.Mute}. */
159
+ interface MuteProps extends ButtonProps {
160
+ /** The name while the sound is off; `label` is the name while it plays. */
161
+ unmuteLabel: string;
162
+ }
135
163
  /** Props accepted by {@link VideoPlayer.Play}. */
136
164
  interface PlayProps extends ButtonProps {
137
165
  /** The name while the video plays; `label` is the name while it is paused. */
@@ -251,6 +279,11 @@ export declare namespace VideoPlayer {
251
279
  var QualityMenu: (handle: Handle<VideoPlayer.BuiltInMenuProps>) => () => import("remix/component").RemixElement;
252
280
  var Theater: (handle: Handle<VideoPlayer.ButtonProps>) => () => import("remix/component").RemixElement;
253
281
  var Fullscreen: (handle: Handle<VideoPlayer.ButtonProps>) => () => import("remix/component").RemixElement;
282
+ var Overlay: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
283
+ var Group: (handle: Handle<VideoPlayer.GroupProps>) => () => import("remix/component").RemixElement;
284
+ var Skip: (handle: Handle<VideoPlayer.SkipProps>) => () => import("remix/component").RemixElement;
285
+ var Mute: (handle: Handle<VideoPlayer.MuteProps>) => () => import("remix/component").RemixElement;
286
+ var Heading: (handle: Handle<TagProps<"span">>) => () => import("remix/component").RemixElement;
254
287
  }
255
288
  /**
256
289
  * The island inside every {@link VideoPlayer}: a hidden marker that seeks from time links,
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/compone
2
2
  import { visuallyHidden } from "@sdxc/u/a11y";
3
3
  import { combine, mergeMix, raw } from "@sdxc/u/general";
4
4
  import { container, hidden } from "@sdxc/u/layout";
5
- import { at, motionSafe } from "@sdxc/u/responsive";
5
+ import { at, motionReduce, motionSafe } from "@sdxc/u/responsive";
6
6
  import { focusVisible, hover, when } from "@sdxc/u/state";
7
7
  import { clientEntry } from "remix/component";
8
8
  import { Popover } from "../components/popover.js";
@@ -48,6 +48,12 @@ const TONES = {
48
48
  };
49
49
  /** Surface of the settings menu over the picture. */
50
50
  const MENU_BG = "var(--ui-video-player-menu-bg, rgb(28 28 30 / 0.96))";
51
+ /** How each {@link VideoPlayer.Group} alignment lays its controls out along the bar. */
52
+ const GROUP_JUSTIFY = {
53
+ start: "flex-start",
54
+ center: "center",
55
+ end: "flex-end",
56
+ };
51
57
  /** Colour scheme of a player that names none. */
52
58
  const DEFAULT_TONE = "plain";
53
59
  /** Language of the generated tracks when the screen names none. */
@@ -130,7 +136,8 @@ function captionsOf(children, transcript) {
130
136
  */
131
137
  export function VideoPlayer(handle) {
132
138
  return () => {
133
- let { chapters = [], children, current, duration, mix, tone = DEFAULT_TONE, transcript = [], ...rest } = handle.props;
139
+ let { chapters = [], children, current, duration, mix, layout = "page", tone = DEFAULT_TONE, transcript = [], ...rest } = handle.props;
140
+ let stage = layout === "stage";
134
141
  let sources = findAll(children, VideoPlayer.Source).map((source) => ({
135
142
  src: text(source.props.src) ?? "",
136
143
  label: text(source.props.label),
@@ -144,25 +151,45 @@ export function VideoPlayer(handle) {
144
151
  href: sources[0]?.src,
145
152
  sources,
146
153
  captions: captionsOf(children, transcript),
154
+ layout,
147
155
  });
148
156
  let parts = flatten(children);
149
157
  let side = parts.filter((part) => isElementOf(part, VideoPlayer.Side));
150
158
  let main = parts.filter((part) => !isElementOf(part, VideoPlayer.Side));
151
- return (_jsxs("figure", { ...rest, "data-slot": "video-player", "data-tone": tone, mix: mergeMix([
159
+ return (_jsxs("figure", { ...rest, "data-slot": "video-player", "data-tone": tone, "data-layout": layout, mix: mergeMix([
152
160
  container(CONTAINER),
153
- raw({
154
- ...TONES[tone],
155
- margin: "0",
156
- padding: "clamp(0.75rem, 2.5cqi, 1.5rem)",
157
- boxSizing: "border-box",
158
- inlineSize: "100%",
159
- colorScheme: tone === "theater" ? "dark" : "inherit",
160
- color: "var(--ui-video-player-body)",
161
- backgroundColor: "var(--ui-video-player-bg)",
162
- borderRadius: RADIUS,
163
- boxShadow: "var(--ui-video-player-shadow)",
164
- textAlign: "start",
165
- }),
161
+ stage
162
+ ? raw({
163
+ ...TONES[tone],
164
+ position: "relative",
165
+ margin: "0",
166
+ padding: "0",
167
+ boxSizing: "border-box",
168
+ inlineSize: "100%",
169
+ blockSize: "100%",
170
+ colorScheme: "dark",
171
+ color: ON_VIDEO,
172
+ backgroundColor: "black",
173
+ "& [data-slot='video-player-layout'], & [data-slot='video-player-main']": {
174
+ blockSize: "100%",
175
+ },
176
+ })
177
+ : [],
178
+ stage
179
+ ? []
180
+ : raw({
181
+ ...TONES[tone],
182
+ margin: "0",
183
+ padding: "clamp(0.75rem, 2.5cqi, 1.5rem)",
184
+ boxSizing: "border-box",
185
+ inlineSize: "100%",
186
+ colorScheme: tone === "theater" ? "dark" : "inherit",
187
+ color: "var(--ui-video-player-body)",
188
+ backgroundColor: "var(--ui-video-player-bg)",
189
+ borderRadius: RADIUS,
190
+ boxShadow: "var(--ui-video-player-shadow)",
191
+ textAlign: "start",
192
+ }),
166
193
  ], mix), children: [_jsxs("div", { "data-slot": "video-player-layout", mix: [
167
194
  combine([
168
195
  raw({ display: "grid", gridTemplateColumns: "minmax(0, 1fr)", gap: "1.25rem" }),
@@ -199,11 +226,14 @@ function timeHref(context, start) {
199
226
  VideoPlayer.Screen = function VideoPlayerScreen(handle) {
200
227
  return () => {
201
228
  let { captionsLabel, chaptersLabel, children, label, language = DEFAULT_LANGUAGE, mix, poster, ...rest } = handle.props;
202
- let { chapters, duration, transcript } = timeline(handle);
229
+ let { chapters, duration, layout, transcript } = timeline(handle);
203
230
  let nodes = flatten(children);
204
231
  let frames = nodes.filter((node) => isElementOf(node, VideoPlayer.Frame));
205
232
  let bars = nodes.filter((node) => isElementOf(node, VideoPlayer.Controls));
206
- let sources = nodes.filter((node) => !isElementOf(node, VideoPlayer.Frame) && !isElementOf(node, VideoPlayer.Controls));
233
+ let overlays = nodes.filter((node) => isElementOf(node, VideoPlayer.Overlay));
234
+ let sources = nodes.filter((node) => !isElementOf(node, VideoPlayer.Frame) &&
235
+ !isElementOf(node, VideoPlayer.Controls) &&
236
+ !isElementOf(node, VideoPlayer.Overlay));
207
237
  return (_jsxs("div", { ...rest, "data-slot": "video-player-screen", mix: mergeMix([
208
238
  raw({
209
239
  position: "relative",
@@ -212,6 +242,10 @@ VideoPlayer.Screen = function VideoPlayerScreen(handle) {
212
242
  borderRadius: `max(0px, calc(${RADIUS} - 0.375rem))`,
213
243
  backgroundColor: "black",
214
244
  }),
245
+ layout === "stage"
246
+ ? raw({ aspectRatio: "auto", blockSize: "100%", borderRadius: "0" })
247
+ : [],
248
+ when("[data-playing][data-idle] &", raw({ cursor: "none" })),
215
249
  when("& > video, & > [data-slot='video-player-frame']", raw({ position: "absolute", inset: "0", inlineSize: "100%", blockSize: "100%" })),
216
250
  when("&:fullscreen", raw({
217
251
  aspectRatio: "auto",
@@ -219,7 +253,7 @@ VideoPlayer.Screen = function VideoPlayerScreen(handle) {
219
253
  inlineSize: "100%",
220
254
  blockSize: "100%",
221
255
  })),
222
- ], mix), children: [frames, _jsxs("video", { "data-slot": "video-player-video", controls: true, preload: "metadata", playsInline: true, poster: poster, "aria-label": label, mix: [raw({ objectFit: "contain", backgroundColor: "transparent" })], children: [sources, chapters.length > 0 ? (_jsx("track", { kind: "chapters", srcLang: language, label: chaptersLabel, src: webVttUrl(chapters.map((chapter) => ({ start: chapter.start, text: chapter.title })), duration) })) : null, _jsx("track", { kind: "captions", srcLang: language, label: captionsLabel, src: webVttUrl(transcript, duration), "data-empty": transcript.length === 0 ? "" : undefined })] }), bars] }));
256
+ ], mix), children: [frames, _jsxs("video", { "data-slot": "video-player-video", controls: true, preload: "metadata", playsInline: true, poster: poster, "aria-label": label, mix: [raw({ objectFit: "contain", backgroundColor: "transparent" })], children: [sources, chapters.length > 0 ? (_jsx("track", { kind: "chapters", srcLang: language, label: chaptersLabel, src: webVttUrl(chapters.map((chapter) => ({ start: chapter.start, text: chapter.title })), duration) })) : null, _jsx("track", { kind: "captions", srcLang: language, label: captionsLabel, src: webVttUrl(transcript, duration), "data-empty": transcript.length === 0 ? "" : undefined })] }), bars, overlays] }));
223
257
  };
224
258
  };
225
259
  /**
@@ -387,6 +421,14 @@ VideoPlayer.Controls = function VideoPlayerControls(handle) {
387
421
  backgroundImage: "linear-gradient(to top, rgb(0 0 0 / 0.72), transparent)",
388
422
  }),
389
423
  when("&:not([hidden])", raw({ display: "flex" })),
424
+ when("[data-layout='stage'] &", raw({
425
+ padding: "6rem clamp(0.75rem, 3cqi, 2.5rem) clamp(0.75rem, 2.5cqi, 1.75rem)",
426
+ columnGap: "0.5rem",
427
+ backgroundImage: "linear-gradient(to top, rgb(0 0 0 / 0.85), transparent)",
428
+ "& > button, & > [data-slot='video-player-group'] > button:not([data-video-action='play'])": { inlineSize: "3rem", blockSize: "3rem" },
429
+ "--ui-video-player-icon-size": "1.875rem",
430
+ })),
431
+ idleFade(),
390
432
  ], mix) }));
391
433
  };
392
434
  };
@@ -428,6 +470,11 @@ VideoPlayer.Play = function VideoPlayerPlay(handle) {
428
470
  let { label, mix, pauseLabel, ...rest } = handle.props;
429
471
  return (_jsxs("button", { ...rest, type: "button", "aria-label": label, "data-label-play": label, "data-label-pause": pauseLabel, "data-video-action": "play", mix: mergeMix([
430
472
  barButton(),
473
+ when("[data-slot='video-player-group'][data-align='center'] > &", raw({
474
+ inlineSize: "4rem",
475
+ blockSize: "4rem",
476
+ "--ui-video-player-icon-size": "2.75rem",
477
+ })),
431
478
  when("& > [data-icon='pause']", raw({ display: "none" })),
432
479
  when("[data-playing] & > [data-icon='play']", raw({ display: "none" })),
433
480
  when("[data-playing] & > [data-icon='pause']", raw({ display: "block" })),
@@ -453,6 +500,7 @@ VideoPlayer.Time = function VideoPlayerTime(handle) {
453
500
  fontVariantNumeric: "tabular-nums",
454
501
  whiteSpace: "nowrap",
455
502
  }),
503
+ when("[data-slot='video-player-controls']:has(> [data-slot='video-player-heading']) > &", raw({ marginInline: "0.375rem 0" })),
456
504
  ], mix), children: [_jsx("span", { "data-slot": "video-player-elapsed", children: formatVideoTime(current) }), _jsx("span", { "aria-hidden": "true", mix: [raw({ color: ON_VIDEO_MUTED })], children: " / " }), _jsx("span", { "data-slot": "video-player-length", mix: [raw({ color: ON_VIDEO_MUTED })], children: formatVideoTime(duration) })] }));
457
505
  };
458
506
  };
@@ -638,6 +686,129 @@ VideoPlayer.Fullscreen = function VideoPlayerFullscreen(handle) {
638
686
  ], mix), children: [_jsx(VideoIcon, { name: "fullscreen" }), _jsx(VideoIcon, { name: "exit-fullscreen" })] }));
639
687
  };
640
688
  };
689
+ /**
690
+ * Content over the top of the screen, such as the way back and what is playing, on a shade so
691
+ * it reads over any picture. It shows without script, and on a stage it fades with the bar
692
+ * while the video plays and the pointer rests.
693
+ *
694
+ * @param handle Runtime handle carrying the `<div>`'s props.
695
+ * @returns The render function producing the overlay.
696
+ * @example <VideoPlayer.Overlay><a href="/title/tidewater">Back</a></VideoPlayer.Overlay>
697
+ */
698
+ VideoPlayer.Overlay = function VideoPlayerOverlay(handle) {
699
+ return () => {
700
+ let { mix, ...rest } = handle.props;
701
+ return (_jsx("div", { ...rest, "data-slot": "video-player-overlay", mix: mergeMix([
702
+ raw({
703
+ position: "absolute",
704
+ insetInline: "0",
705
+ insetBlockStart: "0",
706
+ zIndex: "1",
707
+ display: "flex",
708
+ alignItems: "center",
709
+ gap: "0.75rem",
710
+ padding: "clamp(0.75rem, 2.5cqi, 1.5rem) clamp(0.75rem, 3cqi, 2.5rem) 4rem",
711
+ colorScheme: "dark",
712
+ color: ON_VIDEO,
713
+ backgroundImage: "linear-gradient(to bottom, rgb(0 0 0 / 0.7), transparent)",
714
+ }),
715
+ idleFade(),
716
+ ], mix) }));
717
+ };
718
+ };
719
+ /**
720
+ * A cluster of bar controls placed together, so a bar can keep its playback controls centred
721
+ * between what sits at either end; a centred group draws its Play button larger, and on a
722
+ * narrow player takes a row of its own under the rest.
723
+ *
724
+ * @param handle Runtime handle carrying the `<div>`'s props.
725
+ * @returns The render function producing the group.
726
+ * @example <VideoPlayer.Group align="center"><VideoPlayer.Play label="Play" pauseLabel="Pause" /></VideoPlayer.Group>
727
+ */
728
+ VideoPlayer.Group = function VideoPlayerGroup(handle) {
729
+ return () => {
730
+ let { align = "start", mix, ...rest } = handle.props;
731
+ return (_jsx("div", { ...rest, "data-slot": "video-player-group", "data-align": align, mix: mergeMix([
732
+ raw({
733
+ display: "flex",
734
+ alignItems: "center",
735
+ gap: "0.25rem",
736
+ minInlineSize: "0",
737
+ flex: align === "center" ? "0 0 auto" : "1 1 0",
738
+ justifyContent: GROUP_JUSTIFY[align],
739
+ }),
740
+ align === "center"
741
+ ? raw({
742
+ gap: "clamp(0.5rem, 3cqi, 2rem)",
743
+ [`@container ${CONTAINER} (max-width: 36rem)`]: {
744
+ order: "2",
745
+ flex: "1 1 100%",
746
+ paddingBlockStart: "0.5rem",
747
+ },
748
+ })
749
+ : [],
750
+ ], mix) }));
751
+ };
752
+ };
753
+ /**
754
+ * Steps back or forward by `seconds`, ten by convention; the glyph shows the direction and the
755
+ * count, and the accessible name says it in words.
756
+ *
757
+ * @param handle Runtime handle carrying the button's props.
758
+ * @returns The render function producing the button.
759
+ * @example <VideoPlayer.Skip seconds={-10} label="Back 10 seconds" />
760
+ */
761
+ VideoPlayer.Skip = function VideoPlayerSkip(handle) {
762
+ return () => {
763
+ let { label, mix, seconds, ...rest } = handle.props;
764
+ return (_jsx("button", { ...rest, type: "button", "aria-label": label, "data-video-action": "skip", "data-seconds": String(seconds), mix: mergeMix([barButton()], mix), children: _jsx(SkipIcon, { seconds: seconds }) }));
765
+ };
766
+ };
767
+ /**
768
+ * Turns the sound off and on; `aria-pressed` says whether it is off, and the name says what a
769
+ * press does next.
770
+ *
771
+ * @param handle Runtime handle carrying the button's props.
772
+ * @returns The render function producing the button.
773
+ * @example <VideoPlayer.Mute label="Mute" unmuteLabel="Unmute" />
774
+ */
775
+ VideoPlayer.Mute = function VideoPlayerMute(handle) {
776
+ return () => {
777
+ let { label, mix, unmuteLabel, ...rest } = handle.props;
778
+ return (_jsxs("button", { ...rest, type: "button", "aria-label": label, "aria-pressed": "false", "data-label-mute": label, "data-label-unmute": unmuteLabel, "data-video-action": "mute", mix: mergeMix([
779
+ barButton(),
780
+ when("& > [data-icon='muted']", raw({ display: "none" })),
781
+ when("&[aria-pressed='true'] > [data-icon='volume']", raw({ display: "none" })),
782
+ when("&[aria-pressed='true'] > [data-icon='muted']", raw({ display: "block" })),
783
+ ], mix), children: [_jsx(VideoIcon, { name: "volume" }), _jsx(VideoIcon, { name: "muted" })] }));
784
+ };
785
+ };
786
+ /**
787
+ * What is playing, centred in the bar between the playback controls and the rest, such as a
788
+ * series' name and the episode; it truncates rather than pushing a control off the bar.
789
+ *
790
+ * @param handle Runtime handle carrying the `<span>`'s props.
791
+ * @returns The render function producing the heading.
792
+ * @example <VideoPlayer.Heading>Tidewater · E3 Lee Shore</VideoPlayer.Heading>
793
+ */
794
+ VideoPlayer.Heading = function VideoPlayerHeading(handle) {
795
+ return () => {
796
+ let { mix, ...rest } = handle.props;
797
+ return (_jsx("span", { ...rest, "data-slot": "video-player-heading", mix: mergeMix([
798
+ raw({
799
+ flex: "1 1 0",
800
+ minInlineSize: "0",
801
+ overflow: "hidden",
802
+ paddingInline: "0.75rem",
803
+ textAlign: "center",
804
+ textOverflow: "ellipsis",
805
+ whiteSpace: "nowrap",
806
+ fontSize: "0.9375rem",
807
+ fontWeight: "600",
808
+ }),
809
+ ], mix) }));
810
+ };
811
+ };
641
812
  /** A 24px glyph in the current colour, decorative because its button carries the name. */
642
813
  function VideoIcon(handle) {
643
814
  return () => {
@@ -649,7 +820,13 @@ function VideoIcon(handle) {
649
820
  "stroke-linecap": "round",
650
821
  "stroke-linejoin": "round",
651
822
  };
652
- return (_jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", "data-icon": name, mix: [raw({ inlineSize: "1.5rem", blockSize: "1.5rem", flexShrink: "0" })], children: [name === "play" ? _jsx("path", { d: "M8 5.5v13l11-6.5z", fill: "currentColor" }) : null, name === "pause" ? (_jsx("path", { d: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z", fill: "currentColor" })) : null, name === "captions" ? (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5", ...stroke }), _jsx("path", { d: "M10.5 10a2 2 0 1 0 0 4M16.5 10a2 2 0 1 0 0 4", ...stroke })] })) : null, name === "settings" ? (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "8", ...stroke, "stroke-width": "3", "stroke-dasharray": "3 3.283", "stroke-linecap": "butt" }), _jsx("circle", { cx: "12", cy: "12", r: "5.5", ...stroke, "stroke-width": "3" })] })) : null, name === "theater" ? (_jsx("rect", { x: "2.5", y: "6.5", width: "19", height: "11", rx: "1.5", ...stroke })) : null, name === "fullscreen" ? (_jsx("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5", ...stroke })) : null, name === "exit-fullscreen" ? (_jsx("path", { d: "M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5", ...stroke })) : null, name === "next" ? _jsx("path", { d: "M9 6l6 6-6 6", ...stroke }) : null, name === "back" ? _jsx("path", { d: "M15 6l-6 6 6 6", ...stroke }) : null] }));
823
+ return (_jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", "data-icon": name, mix: [
824
+ raw({
825
+ inlineSize: "var(--ui-video-player-icon-size, 1.5rem)",
826
+ blockSize: "var(--ui-video-player-icon-size, 1.5rem)",
827
+ flexShrink: "0",
828
+ }),
829
+ ], children: [name === "play" ? _jsx("path", { d: "M8 5.5v13l11-6.5z", fill: "currentColor" }) : null, name === "pause" ? (_jsx("path", { d: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z", fill: "currentColor" })) : null, name === "captions" ? (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5", ...stroke }), _jsx("path", { d: "M10.5 10a2 2 0 1 0 0 4M16.5 10a2 2 0 1 0 0 4", ...stroke })] })) : null, name === "settings" ? (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "8", ...stroke, "stroke-width": "3", "stroke-dasharray": "3 3.283", "stroke-linecap": "butt" }), _jsx("circle", { cx: "12", cy: "12", r: "5.5", ...stroke, "stroke-width": "3" })] })) : null, name === "theater" ? (_jsx("rect", { x: "2.5", y: "6.5", width: "19", height: "11", rx: "1.5", ...stroke })) : null, name === "fullscreen" ? (_jsx("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5", ...stroke })) : null, name === "exit-fullscreen" ? (_jsx("path", { d: "M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5", ...stroke })) : null, name === "next" ? _jsx("path", { d: "M9 6l6 6-6 6", ...stroke }) : null, name === "back" ? _jsx("path", { d: "M15 6l-6 6 6 6", ...stroke }) : null, name === "volume" ? (_jsxs(_Fragment, { children: [_jsx("path", { d: "M4 9.5h3.5L12 5.5v13l-4.5-4H4z", fill: "currentColor" }), _jsx("path", { d: "M15.5 9a4 4 0 0 1 0 6M18 6.5a7.5 7.5 0 0 1 0 11", ...stroke })] })) : null, name === "muted" ? (_jsxs(_Fragment, { children: [_jsx("path", { d: "M4 9.5h3.5L12 5.5v13l-4.5-4H4z", fill: "currentColor" }), _jsx("path", { d: "M16 9.5l5 5M21 9.5l-5 5", ...stroke })] })) : null] }));
653
830
  };
654
831
  }
655
832
  /** One scrubber segment, as wide as its chapter is long, filled up to the played share. */
@@ -763,6 +940,34 @@ function timeLink() {
763
940
  function barButton() {
764
941
  return combine([barButtonShape(), when("&:not([hidden])", raw({ display: "inline-grid" }))]);
765
942
  }
943
+ /**
944
+ * Fades a stage's bar and overlay while the video plays and the pointer rests, and keeps them
945
+ * out of the way of clicks until the pointer moves again; under reduced motion they vanish.
946
+ */
947
+ function idleFade() {
948
+ return combine([
949
+ raw({ transition: "opacity 300ms ease" }),
950
+ when("[data-layout='stage'][data-playing][data-idle] &", raw({ opacity: "0", pointerEvents: "none" })),
951
+ motionReduce(raw({ transition: "none" })),
952
+ ]);
953
+ }
954
+ /**
955
+ * A skip glyph: a circular arrow turning back or forward with the count inside, so a ten
956
+ * second step reads at a glance.
957
+ */
958
+ function SkipIcon(handle) {
959
+ return () => {
960
+ let { seconds } = handle.props;
961
+ let back = seconds < 0;
962
+ return (_jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", mix: [
963
+ raw({
964
+ inlineSize: "var(--ui-video-player-icon-size, 1.625rem)",
965
+ blockSize: "var(--ui-video-player-icon-size, 1.625rem)",
966
+ flexShrink: "0",
967
+ }),
968
+ ], children: [_jsx("path", { d: back ? "M5 12a7 7 0 1 0 2.2-5.1M5 4v4h4" : "M19 12a7 7 0 1 1-2.2-5.1M19 4v4h-4", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), _jsx("text", { x: "12", y: "15.2", "text-anchor": "middle", "font-size": "7.5", "font-weight": "700", fill: "currentColor", "font-family": "system-ui, sans-serif", children: Math.abs(seconds) })] }));
969
+ };
970
+ }
766
971
  /** The look of a bar button, leaving when it shows to the caller. */
767
972
  function barButtonShape() {
768
973
  return combine([
@@ -809,6 +1014,7 @@ function gearBadge() {
809
1014
  function menuSurface() {
810
1015
  return raw({
811
1016
  positionTryFallbacks: "flip-block, top span-all, bottom span-all",
1017
+ "--ui-video-player-icon-size": "1.5rem",
812
1018
  colorScheme: "dark",
813
1019
  color: ON_VIDEO,
814
1020
  backgroundColor: MENU_BG,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/ui",
3
- "version": "2026.11.17",
3
+ "version": "2026.11.22",
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": "d0a98d9f22d429ae5da7d5e75b4c0f55d311e758",
57
+ "peerDependenciesMeta": {
58
+ "maplibre-gl": {
59
+ "optional": true
60
+ }
61
+ },
62
+ "gitHead": "5c6ffab7ddf89b7bbd97eb489c2fecceb4297351",
44
63
  "publishConfig": {
45
64
  "access": "public"
46
65
  },