@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
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Barrel for `@sdxc/ui/audio`: the pieces of a music app (track tables, artwork tiles, the
3
+ * player bar and its phone form, the queue, the playing mark) and the queue and Media Session
4
+ * helpers a player drives them with. Each module also imports on its own, as `@sdxc/ui/audio/player-bar`.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ export * from "./utils/media-session.js";
10
+ export * from "./utils/play-queue.js";
11
+ export * from "./utils/track-time.js";
12
+ export * from "./equalizer.js";
13
+ export * from "./media-tile.js";
14
+ export * from "./player-bar.js";
15
+ export * from "./queue-list.js";
16
+ export * from "./track-list.js";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * An album, a playlist or an artist in a music library as one tile: square artwork (round for
3
+ * a person), its name and a line under it, and a play button that rises over the art under the
4
+ * pointer. The link and the button stay separate controls, so each has its own name.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ /** Prop types for {@link MediaTile}. */
11
+ export declare namespace MediaTile {
12
+ /** `square` for an album or a playlist, `round` for an artist. */
13
+ type Shape = "square" | "round";
14
+ /** Every native `<div>` attribute but `title`, plus the tile's content. */
15
+ interface Props extends Omit<TagProps<"div">, "title" | "children"> {
16
+ href: string;
17
+ /** The name, the link's accessible name and the tile's first line. */
18
+ title: string;
19
+ /** The artwork, drawn edge to edge: an `<img>` or an `<svg>`. */
20
+ art: RemixNode;
21
+ /** The line under the name, such as "Album · Lumen Harbor" or "Artist". */
22
+ subtitle?: RemixNode;
23
+ /** @default "square" */
24
+ shape?: Shape;
25
+ /**
26
+ * A play control over the art's corner, outside the link: a button, or a form holding
27
+ * one. It shows under the pointer and on focus; touch screens reach it through the page.
28
+ */
29
+ play?: RemixNode;
30
+ }
31
+ }
32
+ /**
33
+ * Renders the tile, filling its column. The art lifts slightly under the pointer and holds
34
+ * still under reduced motion; the play control appears where a pointer can reach it.
35
+ *
36
+ * @example <MediaTile href="/album/tidelight" title="Tidelight" subtitle="2025 · Album" art={<img src={cover} alt="" />} />
37
+ */
38
+ export declare function MediaTile(handle: Handle<MediaTile.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,98 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { mergeMix, raw } from "@sdxc/u/general";
3
+ import { motionSafe } from "@sdxc/u/responsive";
4
+ /**
5
+ * Renders the tile, filling its column. The art lifts slightly under the pointer and holds
6
+ * still under reduced motion; the play control appears where a pointer can reach it.
7
+ *
8
+ * @example <MediaTile href="/album/tidelight" title="Tidelight" subtitle="2025 · Album" art={<img src={cover} alt="" />} />
9
+ */
10
+ export function MediaTile(handle) {
11
+ return () => {
12
+ let { art, href, mix, play, shape = "square", subtitle, title, ...rest } = handle.props;
13
+ let radius = shape === "round" ? "50%" : "var(--ui-media-tile-radius, var(--ui-radius-md, 0.375rem))";
14
+ return (_jsxs("div", { ...rest, "data-slot": "media-tile", "data-shape": shape, mix: mergeMix([
15
+ raw({
16
+ position: "relative",
17
+ containerType: "inline-size",
18
+ minInlineSize: "0",
19
+ "&:hover [data-slot=media-tile-play], &:focus-within [data-slot=media-tile-play]": {
20
+ opacity: "1",
21
+ translate: "0 0",
22
+ },
23
+ "@media (hover: none)": {
24
+ "& [data-slot=media-tile-play]": { display: "none" },
25
+ },
26
+ }),
27
+ ], mix), children: [_jsxs("a", { href: href, "data-slot": "media-tile-link", mix: [
28
+ raw({
29
+ display: "grid",
30
+ gap: "0.5rem",
31
+ padding: "0",
32
+ color: "inherit",
33
+ textDecoration: "none",
34
+ borderRadius: radius,
35
+ outline: "none",
36
+ WebkitTapHighlightColor: "transparent",
37
+ "&:focus-visible [data-slot=media-tile-art]": {
38
+ outline: "2px solid var(--ui-brand-ring)",
39
+ outlineOffset: "3px",
40
+ },
41
+ }),
42
+ motionSafe(raw({ "&:hover [data-slot=media-tile-art] > :first-child": { scale: "1.03" } })),
43
+ ], children: [_jsx("span", { "data-slot": "media-tile-art", mix: [
44
+ raw({
45
+ position: "relative",
46
+ display: "block",
47
+ aspectRatio: "1",
48
+ overflow: "clip",
49
+ borderRadius: radius,
50
+ backgroundColor: "var(--ui-neutral-bg-tint)",
51
+ boxShadow: "0 0 0 1px var(--ui-image-outline, rgb(0 0 0 / 0.08)), 0 8px 24px -12px rgb(0 0 0 / 0.35)",
52
+ "& > :first-child": {
53
+ display: "block",
54
+ inlineSize: "100%",
55
+ blockSize: "100%",
56
+ objectFit: "cover",
57
+ transition: "scale 320ms cubic-bezier(0.2, 0.7, 0.2, 1)",
58
+ },
59
+ }),
60
+ ], children: art }), _jsxs("span", { mix: [
61
+ raw({
62
+ display: "grid",
63
+ gap: "0.125rem",
64
+ minInlineSize: "0",
65
+ textAlign: shape === "round" ? "center" : "start",
66
+ }),
67
+ ], children: [_jsx("span", { "data-slot": "media-tile-title", mix: [
68
+ raw({
69
+ overflow: "hidden",
70
+ textOverflow: "ellipsis",
71
+ whiteSpace: "nowrap",
72
+ fontSize: "0.9375rem",
73
+ lineHeight: "1.375rem",
74
+ fontWeight: "600",
75
+ color: "var(--ui-neutral-fg-emphasis)",
76
+ }),
77
+ ], children: title }), subtitle === undefined ? null : (_jsx("span", { "data-slot": "media-tile-subtitle", mix: [
78
+ raw({
79
+ overflow: "hidden",
80
+ textOverflow: "ellipsis",
81
+ whiteSpace: "nowrap",
82
+ fontSize: "0.8125rem",
83
+ lineHeight: "1.125rem",
84
+ color: "var(--ui-neutral-fg-muted)",
85
+ }),
86
+ ], children: subtitle }))] })] }), play === undefined ? null : (_jsx("span", { "data-slot": "media-tile-play", mix: [
87
+ raw({
88
+ position: "absolute",
89
+ insetInlineEnd: shape === "round" ? "8cqi" : "0.5rem",
90
+ insetBlockStart: shape === "round" ? "calc(92cqi - 3rem)" : "calc(100cqi - 3.5rem)",
91
+ opacity: "0",
92
+ translate: "0 0.5rem",
93
+ transition: "opacity 160ms ease, translate 200ms cubic-bezier(0.2, 0.7, 0.2, 1)",
94
+ "&:has(:focus-visible)": { opacity: "1", translate: "0 0" },
95
+ }),
96
+ ], children: play }))] }));
97
+ };
98
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * A music player's controls as one bar along the window's foot: what plays on the left, the
3
+ * transport and the seek bar in the middle, volume and panel toggles on the right, with
4
+ * {@link PlayerBar.Mini} as its phone form above a tab bar. The parts draw; a player drives them.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ /** Prop types for {@link PlayerBar} and its parts. */
11
+ export declare namespace PlayerBar {
12
+ /** Every native `<section>` attribute, plus the bar's three regions. */
13
+ interface Props extends Omit<TagProps<"section">, "children"> {
14
+ /** The landmark's name, such as "Player". */
15
+ label: string;
16
+ /** What plays: a {@link PlayerBar.Track}. */
17
+ track: RemixNode;
18
+ /** The transport buttons in a row, then a {@link PlayerBar.Seek} under them. */
19
+ controls: RemixNode;
20
+ /** Panel toggles and the volume, at the bar's end. */
21
+ extras?: RemixNode;
22
+ }
23
+ /** Every native `<div>` attribute, plus one track's art and lines. */
24
+ interface TrackProps extends Omit<TagProps<"div">, "title" | "children"> {
25
+ /** A square cover. */
26
+ art?: RemixNode;
27
+ /** The track's name, usually a link to its album. */
28
+ title: RemixNode;
29
+ /** The artists, usually links. */
30
+ subtitle?: RemixNode;
31
+ /** A control after the lines, such as a like button. */
32
+ action?: RemixNode;
33
+ }
34
+ /** Every native `<button>` attribute, plus how the button reads. */
35
+ interface ButtonProps extends Omit<TagProps<"button">, "aria-label"> {
36
+ /** The button's name; also its tooltip. */
37
+ label: string;
38
+ /** A toggle's state, read out and marked with a dot under the icon. */
39
+ pressed?: boolean;
40
+ /** The play and pause button: a filled circle, larger than the rest. */
41
+ primary?: boolean;
42
+ /** A 16–20px icon. */
43
+ children: RemixNode;
44
+ }
45
+ /** Every native `<input>` attribute of a range, with its value required. */
46
+ interface RangeProps extends Omit<TagProps<"input">, "type" | "value" | "style" | "role"> {
47
+ value: number;
48
+ /** @default 100 */
49
+ max?: number;
50
+ "aria-label": string;
51
+ }
52
+ /** The seek bar's current time and length, with the slider's name. */
53
+ interface SeekProps extends Omit<RangeProps, "value" | "max"> {
54
+ /** Seconds played. */
55
+ current: number;
56
+ /** Length in seconds; `0` while it is unknown. */
57
+ duration: number;
58
+ }
59
+ /** Every native `<div>` attribute, plus what the phone's mini player shows. */
60
+ interface MiniProps extends Omit<TagProps<"div">, "title" | "children"> {
61
+ art?: RemixNode;
62
+ title: RemixNode;
63
+ subtitle?: RemixNode;
64
+ /** The share played, from 0 to 1, drawn as a hairline along the foot. */
65
+ progress: number;
66
+ /**
67
+ * The button that opens the full player, covering the card: usually a `<button>` with
68
+ * `commandfor` and `command="show-modal"` aimed at a `<dialog>`.
69
+ */
70
+ expand: RemixNode;
71
+ /** Controls at the end that stay pressable over the card, such as play and pause. */
72
+ actions: RemixNode;
73
+ }
74
+ }
75
+ /**
76
+ * Renders the bar: three columns from a laptop's width, and on a narrower container the track
77
+ * and the transport alone, with the seek bar across the top edge.
78
+ *
79
+ * @example <PlayerBar label="Player" track={<PlayerBar.Track title="Low Tide" />} controls={controls} />
80
+ */
81
+ export declare function PlayerBar(handle: Handle<PlayerBar.Props>): () => import("remix/component").RemixElement;
82
+ export declare namespace PlayerBar {
83
+ var Track: typeof PlayerBarTrack;
84
+ var Button: typeof PlayerBarButton;
85
+ var Range: typeof PlayerBarRange;
86
+ var Seek: typeof PlayerBarSeek;
87
+ var Mini: typeof PlayerBarMini;
88
+ }
89
+ /** What plays: the cover and two truncating lines, each usually a link. */
90
+ declare function PlayerBarTrack(handle: Handle<PlayerBar.TrackProps>): () => import("remix/component").RemixElement;
91
+ /**
92
+ * One transport button. A toggle (`pressed`) reads its state and shows a dot under its icon in
93
+ * the brand color; `primary` draws the play button as a filled circle.
94
+ */
95
+ declare function PlayerBarButton(handle: Handle<PlayerBar.ButtonProps>): () => import("remix/component").RemixElement;
96
+ /**
97
+ * A native range styled as a thin bar that thickens under the pointer, its played part filled.
98
+ * The fill follows the `value` prop and, once script runs, the `--ui-range-fill` a player sets.
99
+ */
100
+ declare function PlayerBarRange(handle: Handle<PlayerBar.RangeProps>): () => import("remix/component").RemixElement;
101
+ /** The seek bar: the time played, the slider and the track's length, in tabular figures. */
102
+ declare function PlayerBarSeek(handle: Handle<PlayerBar.SeekProps>): () => import("remix/component").RemixElement;
103
+ /**
104
+ * The phone's form: a card with the cover, two lines and a play button, a hairline of
105
+ * progress along its foot, and an expand button under everything that opens the full player.
106
+ */
107
+ declare function PlayerBarMini(handle: Handle<PlayerBar.MiniProps>): () => import("remix/component").RemixElement;
108
+ export {};
@@ -0,0 +1,338 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { mergeMix, raw } from "@sdxc/u/general";
3
+ import { formatTrackTime } from "./utils/track-time.js";
4
+ /**
5
+ * Renders the bar: three columns from a laptop's width, and on a narrower container the track
6
+ * and the transport alone, with the seek bar across the top edge.
7
+ *
8
+ * @example <PlayerBar label="Player" track={<PlayerBar.Track title="Low Tide" />} controls={controls} />
9
+ */
10
+ export function PlayerBar(handle) {
11
+ return () => {
12
+ let { controls, extras, label, mix, track, ...rest } = handle.props;
13
+ return (_jsxs("section", { ...rest, "aria-label": label, "data-slot": "player-bar", mix: mergeMix([
14
+ raw({
15
+ display: "grid",
16
+ gridTemplateColumns: "minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr)",
17
+ alignItems: "center",
18
+ gap: "1rem",
19
+ paddingInline: "1rem",
20
+ paddingBlock: "0.625rem",
21
+ color: "var(--ui-neutral-fg)",
22
+ "& > [data-region=controls]": {
23
+ display: "grid",
24
+ justifyItems: "center",
25
+ gap: "0.25rem",
26
+ minInlineSize: "0",
27
+ },
28
+ "& > [data-region=extras]": {
29
+ display: "flex",
30
+ alignItems: "center",
31
+ justifyContent: "flex-end",
32
+ gap: "0.25rem",
33
+ minInlineSize: "0",
34
+ },
35
+ }),
36
+ ], mix), children: [track, _jsx("div", { "data-region": "controls", children: controls }), _jsx("div", { "data-region": "extras", children: extras })] }));
37
+ };
38
+ }
39
+ /** What plays: the cover and two truncating lines, each usually a link. */
40
+ function PlayerBarTrack(handle) {
41
+ return () => {
42
+ let { action, art, mix, subtitle, title, ...rest } = handle.props;
43
+ return (_jsxs("div", { ...rest, "data-slot": "player-bar-track", mix: mergeMix([
44
+ raw({
45
+ display: "flex",
46
+ alignItems: "center",
47
+ gap: "0.75rem",
48
+ minInlineSize: "0",
49
+ "& a": { color: "inherit", textDecoration: "none" },
50
+ "& a:hover": { textDecoration: "underline" },
51
+ "& a:focus-visible": {
52
+ outline: "2px solid var(--ui-brand-ring)",
53
+ outlineOffset: "2px",
54
+ borderRadius: "2px",
55
+ },
56
+ }),
57
+ ], mix), children: [art === undefined ? null : _jsx(ArtFrame, { size: "3.5rem", children: art }), _jsxs("span", { mix: [raw({ display: "grid", minInlineSize: "0" })], children: [_jsx("span", { "data-slot": "player-bar-title", mix: [
58
+ raw({
59
+ overflow: "hidden",
60
+ textOverflow: "ellipsis",
61
+ whiteSpace: "nowrap",
62
+ fontSize: "0.875rem",
63
+ lineHeight: "1.25rem",
64
+ fontWeight: "600",
65
+ color: "var(--ui-neutral-fg-emphasis)",
66
+ }),
67
+ ], children: title }), subtitle === undefined ? null : (_jsx("span", { "data-slot": "player-bar-subtitle", mix: [
68
+ raw({
69
+ overflow: "hidden",
70
+ textOverflow: "ellipsis",
71
+ whiteSpace: "nowrap",
72
+ fontSize: "0.75rem",
73
+ lineHeight: "1.125rem",
74
+ color: "var(--ui-neutral-fg-muted)",
75
+ }),
76
+ ], children: subtitle }))] }), action] }));
77
+ };
78
+ }
79
+ /** A square cover at a fixed size, its content filling it. */
80
+ function ArtFrame(handle) {
81
+ return () => (_jsx("span", { "data-slot": "player-bar-art", mix: [
82
+ raw({
83
+ flex: "none",
84
+ display: "block",
85
+ overflow: "clip",
86
+ borderRadius: "var(--ui-radius-sm, 0.25rem)",
87
+ backgroundColor: "var(--ui-neutral-bg-tint)",
88
+ boxShadow: "0 0 0 1px var(--ui-image-outline, rgb(0 0 0 / 0.08))",
89
+ "& > *": {
90
+ display: "block",
91
+ inlineSize: "100%",
92
+ blockSize: "100%",
93
+ objectFit: "cover",
94
+ },
95
+ }),
96
+ ], style: { inlineSize: handle.props.size, blockSize: handle.props.size }, children: handle.props.children }));
97
+ }
98
+ /**
99
+ * One transport button. A toggle (`pressed`) reads its state and shows a dot under its icon in
100
+ * the brand color; `primary` draws the play button as a filled circle.
101
+ */
102
+ function PlayerBarButton(handle) {
103
+ return () => {
104
+ let { children, label, mix, pressed, primary, type = "button", ...rest } = handle.props;
105
+ return (_jsx("button", { ...rest, type: type, "aria-label": label, title: label, "aria-pressed": pressed, "data-slot": "player-bar-button", "data-primary": primary ? "" : undefined, mix: mergeMix([
106
+ raw({
107
+ position: "relative",
108
+ display: "inline-grid",
109
+ placeItems: "center",
110
+ flex: "none",
111
+ inlineSize: "2.25rem",
112
+ blockSize: "2.25rem",
113
+ padding: "0",
114
+ border: "0",
115
+ borderRadius: "999px",
116
+ color: "var(--ui-neutral-fg-muted)",
117
+ backgroundColor: "transparent",
118
+ cursor: "pointer",
119
+ transition: "color 120ms ease, background-color 120ms ease, scale 120ms ease",
120
+ "&:hover": { color: "var(--ui-neutral-fg-emphasis)" },
121
+ "&:active": { scale: "0.94" },
122
+ "&:focus-visible": {
123
+ outline: "2px solid var(--ui-brand-ring)",
124
+ outlineOffset: "2px",
125
+ },
126
+ "&:disabled": { opacity: "0.4", cursor: "default" },
127
+ "&[aria-pressed=true]": { color: "var(--ui-brand-fg)" },
128
+ "&[aria-pressed=true]::after": {
129
+ content: "''",
130
+ position: "absolute",
131
+ insetBlockEnd: "0.0625rem",
132
+ insetInlineStart: "calc(50% - 0.125rem)",
133
+ inlineSize: "0.25rem",
134
+ blockSize: "0.25rem",
135
+ borderRadius: "999px",
136
+ backgroundColor: "currentColor",
137
+ },
138
+ "&[data-primary]": {
139
+ inlineSize: "2.5rem",
140
+ blockSize: "2.5rem",
141
+ color: "var(--ui-neutral-bg, Canvas)",
142
+ backgroundColor: "var(--ui-neutral-fg-emphasis)",
143
+ },
144
+ "&[data-primary]:hover": {
145
+ color: "var(--ui-neutral-bg, Canvas)",
146
+ scale: "1.05",
147
+ },
148
+ "@media (pointer: coarse)": {
149
+ inlineSize: "var(--ui-target-size, 2.75rem)",
150
+ blockSize: "var(--ui-target-size, 2.75rem)",
151
+ },
152
+ }),
153
+ ], mix), children: children }));
154
+ };
155
+ }
156
+ /**
157
+ * A native range styled as a thin bar that thickens under the pointer, its played part filled.
158
+ * The fill follows the `value` prop and, once script runs, the `--ui-range-fill` a player sets.
159
+ */
160
+ function PlayerBarRange(handle) {
161
+ return () => {
162
+ let { max = 100, mix, value, ...rest } = handle.props;
163
+ let share = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;
164
+ return (_jsx("input", { ...rest, type: "range", min: rest.min ?? 0, max: max, value: String(value), "data-slot": "player-bar-range", style: { "--ui-range-fill": `${(share * 100).toFixed(2)}%` }, mix: mergeMix([rangeStyles()], mix) }));
165
+ };
166
+ }
167
+ /** The range's track, fill and thumb across engines, with a larger hit area than it draws. */
168
+ function rangeStyles() {
169
+ let track = "linear-gradient(to right, var(--ui-player-bar-fill, var(--ui-neutral-fg-emphasis)) var(--ui-range-fill, 0%), var(--ui-player-bar-track, color-mix(in oklch, currentColor 22%, transparent)) var(--ui-range-fill, 0%))";
170
+ return raw({
171
+ appearance: "none",
172
+ display: "block",
173
+ inlineSize: "100%",
174
+ minInlineSize: "0",
175
+ blockSize: "1rem",
176
+ margin: "0",
177
+ padding: "0",
178
+ background: "transparent",
179
+ cursor: "pointer",
180
+ color: "var(--ui-neutral-fg-muted)",
181
+ "&::-webkit-slider-runnable-track": {
182
+ blockSize: "0.25rem",
183
+ borderRadius: "999px",
184
+ background: track,
185
+ },
186
+ "&::-moz-range-track": {
187
+ blockSize: "0.25rem",
188
+ borderRadius: "999px",
189
+ background: track,
190
+ },
191
+ "&::-webkit-slider-thumb": {
192
+ appearance: "none",
193
+ inlineSize: "0.75rem",
194
+ blockSize: "0.75rem",
195
+ marginBlockStart: "-0.25rem",
196
+ border: "0",
197
+ borderRadius: "999px",
198
+ backgroundColor: "var(--ui-neutral-fg-emphasis)",
199
+ boxShadow: "0 1px 3px rgb(0 0 0 / 0.3)",
200
+ opacity: "0",
201
+ transition: "opacity 120ms ease",
202
+ },
203
+ "&::-moz-range-thumb": {
204
+ inlineSize: "0.75rem",
205
+ blockSize: "0.75rem",
206
+ border: "0",
207
+ borderRadius: "999px",
208
+ backgroundColor: "var(--ui-neutral-fg-emphasis)",
209
+ opacity: "0",
210
+ },
211
+ "&:hover, &:focus-visible": {
212
+ "--ui-player-bar-fill": "var(--ui-brand-bg-solid)",
213
+ },
214
+ "&:hover::-webkit-slider-thumb, &:focus-visible::-webkit-slider-thumb": { opacity: "1" },
215
+ "&:hover::-moz-range-thumb, &:focus-visible::-moz-range-thumb": { opacity: "1" },
216
+ "&:focus-visible": {
217
+ outline: "2px solid var(--ui-brand-ring)",
218
+ outlineOffset: "2px",
219
+ borderRadius: "999px",
220
+ },
221
+ "@media (pointer: coarse)": {
222
+ blockSize: "1.75rem",
223
+ "&::-webkit-slider-thumb": { opacity: "1" },
224
+ "&::-moz-range-thumb": { opacity: "1" },
225
+ },
226
+ });
227
+ }
228
+ /** The seek bar: the time played, the slider and the track's length, in tabular figures. */
229
+ function PlayerBarSeek(handle) {
230
+ return () => {
231
+ let { current, duration, ...rest } = handle.props;
232
+ let length = Number.isFinite(duration) && duration > 0 ? duration : 0;
233
+ return (_jsxs("div", { "data-slot": "player-bar-seek", mix: [
234
+ raw({
235
+ display: "grid",
236
+ gridTemplateColumns: "2.75rem minmax(0, 1fr) 2.75rem",
237
+ alignItems: "center",
238
+ gap: "0.5rem",
239
+ inlineSize: "100%",
240
+ maxInlineSize: "40rem",
241
+ fontSize: "0.6875rem",
242
+ lineHeight: "1rem",
243
+ fontVariantNumeric: "tabular-nums",
244
+ color: "var(--ui-neutral-fg-muted)",
245
+ "& > :first-child": { textAlign: "end" },
246
+ }),
247
+ ], children: [_jsx("span", { "data-slot": "player-bar-current", children: formatTrackTime(current) }), _jsx(PlayerBarRange, { ...rest, value: Math.min(current, length), max: length || 1, step: "any", "aria-valuetext": `${formatTrackTime(current)} / ${formatTrackTime(length)}` }), _jsx("span", { "data-slot": "player-bar-duration", children: formatTrackTime(length) })] }));
248
+ };
249
+ }
250
+ /**
251
+ * The phone's form: a card with the cover, two lines and a play button, a hairline of
252
+ * progress along its foot, and an expand button under everything that opens the full player.
253
+ */
254
+ function PlayerBarMini(handle) {
255
+ return () => {
256
+ let { actions, art, expand, mix, progress, subtitle, title, ...rest } = handle.props;
257
+ let share = Math.min(1, Math.max(0, Number.isFinite(progress) ? progress : 0));
258
+ return (_jsxs("div", { ...rest, "data-slot": "player-bar-mini", mix: mergeMix([
259
+ raw({
260
+ position: "relative",
261
+ display: "flex",
262
+ alignItems: "center",
263
+ gap: "0.625rem",
264
+ padding: "0.375rem",
265
+ paddingInlineEnd: "0.25rem",
266
+ overflow: "clip",
267
+ borderRadius: "var(--ui-radius-lg, 0.625rem)",
268
+ color: "var(--ui-neutral-fg)",
269
+ backgroundColor: "var(--ui-player-bar-mini-bg, color-mix(in oklch, var(--ui-surface-raised, Canvas) 88%, var(--ui-brand-bg-solid)))",
270
+ boxShadow: "0 8px 24px -8px rgb(0 0 0 / 0.35), 0 0 0 1px var(--ui-neutral-border)",
271
+ "& [data-slot=player-bar-mini-expand-slot] > *": {
272
+ position: "absolute",
273
+ inset: "0",
274
+ zIndex: "0",
275
+ margin: "0",
276
+ padding: "0",
277
+ border: "0",
278
+ background: "transparent",
279
+ cursor: "pointer",
280
+ borderRadius: "inherit",
281
+ },
282
+ "& [data-slot=player-bar-mini-expand-slot] > :focus-visible": {
283
+ outline: "2px solid var(--ui-brand-ring)",
284
+ outlineOffset: "-2px",
285
+ },
286
+ "& > :not([data-slot=player-bar-mini-expand-slot], [data-slot=player-bar-mini-progress])": {
287
+ position: "relative",
288
+ zIndex: "1",
289
+ pointerEvents: "none",
290
+ },
291
+ "& > [data-slot=player-bar-mini-actions]": {
292
+ pointerEvents: "auto",
293
+ display: "flex",
294
+ alignItems: "center",
295
+ },
296
+ }),
297
+ ], mix), children: [_jsx("span", { "data-slot": "player-bar-mini-expand-slot", children: expand }), art === undefined ? null : _jsx(ArtFrame, { size: "2.5rem", children: art }), _jsxs("span", { mix: [raw({ display: "grid", flex: "1", minInlineSize: "0" })], children: [_jsx("span", { mix: [
298
+ raw({
299
+ overflow: "hidden",
300
+ textOverflow: "ellipsis",
301
+ whiteSpace: "nowrap",
302
+ fontSize: "0.875rem",
303
+ lineHeight: "1.25rem",
304
+ fontWeight: "600",
305
+ color: "var(--ui-neutral-fg-emphasis)",
306
+ }),
307
+ ], children: title }), subtitle === undefined ? null : (_jsx("span", { mix: [
308
+ raw({
309
+ overflow: "hidden",
310
+ textOverflow: "ellipsis",
311
+ whiteSpace: "nowrap",
312
+ fontSize: "0.75rem",
313
+ lineHeight: "1rem",
314
+ color: "var(--ui-neutral-fg-muted)",
315
+ }),
316
+ ], children: subtitle }))] }), _jsx("span", { "data-slot": "player-bar-mini-actions", children: actions }), _jsx("span", { "aria-hidden": "true", "data-slot": "player-bar-mini-progress", mix: [
317
+ raw({
318
+ position: "absolute",
319
+ insetInline: "0.625rem",
320
+ insetBlockEnd: "0",
321
+ blockSize: "2px",
322
+ borderRadius: "999px",
323
+ backgroundColor: "color-mix(in oklch, currentColor 18%, transparent)",
324
+ "& > span": {
325
+ display: "block",
326
+ blockSize: "100%",
327
+ borderRadius: "inherit",
328
+ backgroundColor: "var(--ui-neutral-fg-emphasis)",
329
+ },
330
+ }),
331
+ ], children: _jsx("span", { style: { inlineSize: `${(share * 100).toFixed(2)}%` } }) })] }));
332
+ };
333
+ }
334
+ PlayerBar.Track = PlayerBarTrack;
335
+ PlayerBar.Button = PlayerBarButton;
336
+ PlayerBar.Range = PlayerBarRange;
337
+ PlayerBar.Seek = PlayerBarSeek;
338
+ PlayerBar.Mini = PlayerBarMini;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * A music player's queue as headed lists of compact rows: "Now playing" with the track on,
3
+ * then "Next up" in playing order. Each row is a cover, two lines and a length, with an
4
+ * optional control that jumps to it, so a queue panel or a now-playing screen reads the same.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ /** Prop types for {@link QueueList} and its parts. */
11
+ export declare namespace QueueList {
12
+ /** Every native `<section>` attribute, plus the section's heading and rows. */
13
+ interface SectionProps extends Omit<TagProps<"section">, "title"> {
14
+ /** Such as "Now playing" or "Next up". */
15
+ title: RemixNode;
16
+ /** A heading level for where the list sits. @default 3 */
17
+ level?: 2 | 3 | 4;
18
+ /** {@link QueueList.Item} elements; none draws the `empty` line. */
19
+ children?: RemixNode;
20
+ /** What shows when the section has no rows, such as "Nothing queued". */
21
+ empty?: RemixNode;
22
+ }
23
+ /** Every native `<li>` attribute, plus one queued track. */
24
+ interface ItemProps extends Omit<TagProps<"li">, "title"> {
25
+ art?: RemixNode;
26
+ title: string;
27
+ subtitle?: RemixNode;
28
+ /** Length in seconds. */
29
+ duration?: number;
30
+ /** The track playing; its title takes the brand color and an {@link Equalizer}. */
31
+ current?: boolean;
32
+ /**
33
+ * A button covering the row that jumps to the track; its own `aria-label` names it.
34
+ * The row draws its hover wash around it.
35
+ */
36
+ action?: RemixNode;
37
+ }
38
+ }
39
+ /** One headed group of queued tracks. */
40
+ declare function QueueListSection(handle: Handle<QueueList.SectionProps>): () => import("remix/component").RemixElement;
41
+ /** One queued track. */
42
+ declare function QueueListItem(handle: Handle<QueueList.ItemProps>): () => import("remix/component").RemixElement;
43
+ /**
44
+ * The queue's parts: {@link QueueList.Section} for a headed group, {@link QueueList.Item} for
45
+ * one track. A panel stacks a "Now playing" section with one item over a "Next up" section.
46
+ *
47
+ * @example
48
+ * <QueueList.Section title="Next up" empty="Nothing queued">
49
+ * <QueueList.Item title="Low Tide" subtitle="Lumen Harbor" duration={187} />
50
+ * </QueueList.Section>
51
+ */
52
+ export declare const QueueList: {
53
+ Section: typeof QueueListSection;
54
+ Item: typeof QueueListItem;
55
+ };
56
+ export {};