@sdxc/ui 2026.11.14 → 2026.11.17

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.
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Why JS: paging a scroller by one screenful and disabling a button at the end it points to
3
+ * both need the scroller's live width and position, which CSS cannot read.
4
+ * No-JS baseline: the shelf scrolls by touch, trackpad, wheel and the Tab key through its
5
+ * cards, with its scrollbar showing and its paging buttons hidden.
6
+ *
7
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
8
+ * @copyright Sergio Xalambrí 2026
9
+ */
10
+ import { createMixin } from "remix/component";
11
+ /** Set on the scroller once its paging buttons run, which then hide its scrollbar. */
12
+ export const READY_ATTRIBUTE = "data-video-shelf-ready";
13
+ /** The attribute a paging button carries: `-1` steps back, `1` steps forward. */
14
+ export const STEP_ATTRIBUTE = "data-video-shelf-step";
15
+ /**
16
+ * Runs the paging buttons of the shelf it sits in: each step moves one screenful, flipped under
17
+ * right-to-left, and each button disables at the end it points to as the scroller moves or
18
+ * resizes.
19
+ */
20
+ export const videoShelfSteps = createMixin((handle) => {
21
+ let controller;
22
+ handle.addEventListener("insert", (event) => {
23
+ controller?.abort();
24
+ let shelf = event.node.closest("[data-slot=video-shelf]");
25
+ let scroller = shelf?.querySelector("[data-slot=video-shelf-scroller]");
26
+ if (!shelf || !scroller)
27
+ return;
28
+ controller = new AbortController();
29
+ wireShelf(shelf, scroller, controller.signal);
30
+ });
31
+ handle.addEventListener("remove", () => {
32
+ controller?.abort();
33
+ controller = undefined;
34
+ });
35
+ });
36
+ /**
37
+ * Reveals a shelf's paging buttons and runs them until `signal` aborts, when the buttons hide
38
+ * again and the scroller gets its scrollbar back.
39
+ *
40
+ * @param shelf The shelf's root.
41
+ * @param view Its scroller.
42
+ * @param signal Ends the wiring.
43
+ */
44
+ function wireShelf(shelf, view, signal) {
45
+ let buttons = [...shelf.querySelectorAll(`[${STEP_ATTRIBUTE}]`)];
46
+ /** Disables the button that points past the end the scroller sits at. */
47
+ function sync() {
48
+ let rtl = getComputedStyle(view).direction === "rtl";
49
+ let position = rtl ? -view.scrollLeft : view.scrollLeft;
50
+ let max = view.scrollWidth - view.clientWidth;
51
+ for (let button of buttons) {
52
+ let forward = button.getAttribute(STEP_ATTRIBUTE) === "1";
53
+ button.disabled = forward ? position >= max - 1 : position <= 1;
54
+ }
55
+ }
56
+ /** Scrolls one screenful less a peek of half a card, so the card at the edge stays in view. */
57
+ function step(button) {
58
+ let rtl = getComputedStyle(view).direction === "rtl";
59
+ let direction = Number(button.getAttribute(STEP_ATTRIBUTE)) * (rtl ? -1 : 1);
60
+ let item = view.querySelector("[data-slot=video-shelf-item]");
61
+ let peek = item === null ? 0 : item.getBoundingClientRect().width / 2;
62
+ view.scrollBy({ left: direction * Math.max(view.clientWidth - peek, peek) });
63
+ }
64
+ for (let button of buttons) {
65
+ button.hidden = false;
66
+ button.addEventListener("click", () => step(button), { signal });
67
+ }
68
+ view.setAttribute(READY_ATTRIBUTE, "");
69
+ view.addEventListener("scroll", sync, { passive: true, signal });
70
+ let observer = new ResizeObserver(sync);
71
+ observer.observe(view);
72
+ sync();
73
+ signal.addEventListener("abort", () => {
74
+ observer.disconnect();
75
+ view.removeAttribute(READY_ATTRIBUTE);
76
+ for (let button of buttons)
77
+ button.hidden = true;
78
+ });
79
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A video title's hero: its art edge to edge behind the page's top bar, faded into the page at
3
+ * its foot and toward the text, with an eyebrow, the title, a row of facts, a summary and the
4
+ * actions. A catalogue's home features a title with it, and a title's page opens on it.
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 TitleHero} and its parts. */
11
+ export declare namespace TitleHero {
12
+ /** `feature` for a home's billboard, `title` for the head of a title's own page. */
13
+ type Size = "feature" | "title";
14
+ /** Every native `<section>` attribute, plus the art behind it and its size. */
15
+ interface Props extends TagProps<"section"> {
16
+ /** The picture behind the hero, drawn edge to edge: an `<img>`, `<picture>` or `<video>`. */
17
+ art: RemixNode;
18
+ /** Default: `"feature"`. */
19
+ size?: Size;
20
+ /** The hero's parts: eyebrow, title, facts, summary and actions, in reading order. */
21
+ children: RemixNode;
22
+ }
23
+ /** Every native heading attribute, plus the heading's level. */
24
+ interface TitleProps extends TagProps<"h1"> {
25
+ /** `1` on a title's own page, `2` when the page has its own `h1`. */
26
+ level: 1 | 2;
27
+ }
28
+ }
29
+ /**
30
+ * Renders the hero. It pulls itself up under a sticky top bar by `--ui-title-hero-offset`
31
+ * (the bar's height), so the art starts at the window's edge while the text clears the bar;
32
+ * under reduced motion the art holds still instead of drifting.
33
+ *
34
+ * @example
35
+ * <TitleHero art={<img src="/art/tidewater.jpg" alt="" />} aria-labelledby="hero-title">
36
+ * <TitleHero.Eyebrow>Original</TitleHero.Eyebrow>
37
+ * <TitleHero.Title id="hero-title" level={1}>Tidewater</TitleHero.Title>
38
+ * <TitleHero.Facts><span>2026</span><span>2 seasons</span></TitleHero.Facts>
39
+ * <TitleHero.Summary>A harbour town keeps one secret a season.</TitleHero.Summary>
40
+ * <TitleHero.Actions><LinkButton href="/watch/tidewater">Play</LinkButton></TitleHero.Actions>
41
+ * </TitleHero>
42
+ */
43
+ export declare function TitleHero(handle: Handle<TitleHero.Props>): () => import("remix/component").RemixElement;
44
+ export declare namespace TitleHero {
45
+ var Eyebrow: (handle: Handle<TagProps<"span">>) => () => import("remix/component").RemixElement;
46
+ var Title: (handle: Handle<TitleHero.TitleProps>) => () => import("remix/component").RemixElement;
47
+ var Facts: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
48
+ var Rating: (handle: Handle<TagProps<"span">>) => () => import("remix/component").RemixElement;
49
+ var Summary: (handle: Handle<TagProps<"p">>) => () => import("remix/component").RemixElement;
50
+ var Actions: (handle: Handle<TagProps<"div">>) => () => import("remix/component").RemixElement;
51
+ }
@@ -0,0 +1,170 @@
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
+ /** Container the hero declares, which its text column sizes against. */
5
+ const CONTAINER = "ui-title-hero";
6
+ /** How tall the hero stands per size, before its content asks for more. */
7
+ const MIN_SIZES = {
8
+ feature: "var(--ui-title-hero-feature-size, min(88svh, 52rem))",
9
+ title: "var(--ui-title-hero-title-size, min(70svh, 40rem))",
10
+ };
11
+ /** The page colour the art fades into, so its foot meets the page with no edge. */
12
+ const FADE = "var(--ui-title-hero-fade, var(--ui-bg))";
13
+ /**
14
+ * Renders the hero. It pulls itself up under a sticky top bar by `--ui-title-hero-offset`
15
+ * (the bar's height), so the art starts at the window's edge while the text clears the bar;
16
+ * under reduced motion the art holds still instead of drifting.
17
+ *
18
+ * @example
19
+ * <TitleHero art={<img src="/art/tidewater.jpg" alt="" />} aria-labelledby="hero-title">
20
+ * <TitleHero.Eyebrow>Original</TitleHero.Eyebrow>
21
+ * <TitleHero.Title id="hero-title" level={1}>Tidewater</TitleHero.Title>
22
+ * <TitleHero.Facts><span>2026</span><span>2 seasons</span></TitleHero.Facts>
23
+ * <TitleHero.Summary>A harbour town keeps one secret a season.</TitleHero.Summary>
24
+ * <TitleHero.Actions><LinkButton href="/watch/tidewater">Play</LinkButton></TitleHero.Actions>
25
+ * </TitleHero>
26
+ */
27
+ export function TitleHero(handle) {
28
+ return () => {
29
+ let { art, children, mix, size = "feature", ...rest } = handle.props;
30
+ return (_jsxs("section", { ...rest, "data-slot": "title-hero", "data-size": size, mix: mergeMix([
31
+ raw({
32
+ containerName: CONTAINER,
33
+ containerType: "inline-size",
34
+ position: "relative",
35
+ isolation: "isolate",
36
+ display: "grid",
37
+ alignContent: "end",
38
+ marginBlockStart: "calc(-1 * var(--ui-title-hero-offset, 0px))",
39
+ minBlockSize: MIN_SIZES[size],
40
+ paddingInline: "var(--ui-title-hero-inset, 1rem)",
41
+ paddingBlock: "calc(var(--ui-title-hero-offset, 0px) + 2rem) clamp(2rem, 6vh, 4.5rem)",
42
+ overflow: "clip",
43
+ }),
44
+ ], mix), children: [_jsx("div", { "data-slot": "title-hero-art", mix: [
45
+ raw({
46
+ position: "absolute",
47
+ inset: "0",
48
+ zIndex: "-1",
49
+ "& > *": {
50
+ position: "absolute",
51
+ inset: "0",
52
+ inlineSize: "100%",
53
+ blockSize: "100%",
54
+ objectFit: "cover",
55
+ },
56
+ "&::after": {
57
+ content: '""',
58
+ position: "absolute",
59
+ inset: "0",
60
+ background: `linear-gradient(to top, ${FADE} 0%, color-mix(in oklch, ${FADE}, transparent 30%) 22%, transparent 55%), linear-gradient(to right, color-mix(in oklch, ${FADE}, transparent 15%) 0%, transparent 62%)`,
61
+ },
62
+ "@keyframes ui-title-hero-drift": {
63
+ from: { scale: "1.06" },
64
+ to: { scale: "1" },
65
+ },
66
+ }),
67
+ motionSafe(raw({
68
+ "& > :first-child": { animation: "ui-title-hero-drift 14s ease-out both" },
69
+ })),
70
+ ], children: art }), _jsx("div", { "data-slot": "title-hero-content", mix: [raw({ display: "grid", gap: "1rem", maxInlineSize: "38rem" })], children: children })] }));
71
+ };
72
+ }
73
+ /** The small line over the title, such as "Original" or "New season". */
74
+ TitleHero.Eyebrow = function TitleHeroEyebrow(handle) {
75
+ return () => {
76
+ let { mix, ...rest } = handle.props;
77
+ return (_jsx("span", { ...rest, "data-slot": "title-hero-eyebrow", mix: mergeMix([
78
+ raw({
79
+ fontSize: "0.75rem",
80
+ fontWeight: "700",
81
+ letterSpacing: "0.28em",
82
+ textTransform: "uppercase",
83
+ color: "var(--ui-title-hero-accent, var(--ui-brand-fg))",
84
+ }),
85
+ ], mix) }));
86
+ };
87
+ };
88
+ /**
89
+ * The title as the hero's heading, large and balanced; a page sets its own lettering through
90
+ * `mix`, so each title can read in its own type.
91
+ */
92
+ TitleHero.Title = function TitleHeroTitle(handle) {
93
+ return () => {
94
+ let { children, level, mix, ...rest } = handle.props;
95
+ let merged = mergeMix([
96
+ raw({
97
+ margin: "0",
98
+ fontSize: "clamp(2.25rem, 9cqi, 4.75rem)",
99
+ lineHeight: "0.95",
100
+ color: "var(--ui-neutral-fg-emphasis)",
101
+ textWrap: "balance",
102
+ textShadow: "0 2px 24px rgb(0 0 0 / 0.45)",
103
+ }),
104
+ ], mix);
105
+ return level === 1 ? (_jsx("h1", { ...rest, "data-slot": "title-hero-title", mix: merged, children: children })) : (_jsx("h2", { ...rest, "data-slot": "title-hero-title", mix: merged, children: children }));
106
+ };
107
+ };
108
+ /** The facts under the title (rating, year, length, genres) as one wrapping row. */
109
+ TitleHero.Facts = function TitleHeroFacts(handle) {
110
+ return () => {
111
+ let { mix, ...rest } = handle.props;
112
+ return (_jsx("p", { ...rest, "data-slot": "title-hero-facts", mix: mergeMix([
113
+ raw({
114
+ display: "flex",
115
+ flexWrap: "wrap",
116
+ alignItems: "center",
117
+ gap: "0.375rem 0.75rem",
118
+ margin: "0",
119
+ fontSize: "0.9375rem",
120
+ color: "var(--ui-neutral-fg-emphasis)",
121
+ fontVariantNumeric: "tabular-nums",
122
+ }),
123
+ ], mix) }));
124
+ };
125
+ };
126
+ /** An age rating in the facts row, outlined so it reads as a label rather than a fact. */
127
+ TitleHero.Rating = function TitleHeroRating(handle) {
128
+ return () => {
129
+ let { mix, ...rest } = handle.props;
130
+ return (_jsx("span", { ...rest, "data-slot": "title-hero-rating", mix: mergeMix([
131
+ raw({
132
+ paddingInline: "0.375rem",
133
+ borderRadius: "var(--ui-radius-sm, 0.25rem)",
134
+ boxShadow: "inset 0 0 0 1px color-mix(in oklch, currentColor 45%, transparent)",
135
+ fontSize: "0.8125rem",
136
+ fontWeight: "600",
137
+ }),
138
+ ], mix) }));
139
+ };
140
+ };
141
+ /** The title's synopsis or tagline, shadowed so it reads over any art. */
142
+ TitleHero.Summary = function TitleHeroSummary(handle) {
143
+ return () => {
144
+ let { mix, ...rest } = handle.props;
145
+ return (_jsx("p", { ...rest, "data-slot": "title-hero-summary", mix: mergeMix([
146
+ raw({
147
+ margin: "0",
148
+ fontSize: "clamp(0.9375rem, 2.2cqi, 1.0625rem)",
149
+ lineHeight: "1.6",
150
+ color: "var(--ui-neutral-fg)",
151
+ textWrap: "pretty",
152
+ textShadow: "0 1px 8px rgb(0 0 0 / 0.5)",
153
+ }),
154
+ ], mix) }));
155
+ };
156
+ };
157
+ /** The hero's buttons, primary first, wrapping onto a second line on a narrow screen. */
158
+ TitleHero.Actions = function TitleHeroActions(handle) {
159
+ return () => {
160
+ let { mix, ...rest } = handle.props;
161
+ return (_jsx("div", { ...rest, "data-slot": "title-hero-actions", mix: mergeMix([
162
+ raw({
163
+ display: "flex",
164
+ flexWrap: "wrap",
165
+ gap: "0.625rem",
166
+ marginBlockStart: "0.25rem",
167
+ }),
168
+ ], mix) }));
169
+ };
170
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A title in a video catalogue as one link: its artwork in a landscape still or a portrait
3
+ * poster, a badge on the art, how much of it the viewer has watched, and its name and meta
4
+ * below. The card owns the hover lift and focus ring, so every row and grid reads alike.
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 VideoCard}. */
11
+ export declare namespace VideoCard {
12
+ /** `landscape` is a 16:9 still, `poster` a 2:3 key art. */
13
+ type Shape = "landscape" | "poster";
14
+ /** Every native `<a>` attribute but `children`, `title` and `role`, plus the card's own content. */
15
+ interface Props extends Omit<TagProps<"a">, "children" | "title" | "href" | "role"> {
16
+ /** The link's destination: the title's page, or straight into playback. */
17
+ href: string;
18
+ /** The title's name, the card's accessible name and its first line. */
19
+ title: string;
20
+ /** The artwork, drawn edge to edge in the frame: an `<img>`, an `<svg>` or a gradient. */
21
+ art: RemixNode;
22
+ /** Default: `"landscape"`. */
23
+ shape?: Shape;
24
+ /** A short second line, such as "S2 · E4 · 38 min" or "2026 · Drama". */
25
+ meta?: RemixNode;
26
+ /** A label on the art's top corner, such as "New episodes". */
27
+ badge?: RemixNode;
28
+ /** The share watched, from 0 to 1, drawn as a bar along the art's foot. */
29
+ progress?: number;
30
+ /** What a screen reader hears for the bar, such as "38% watched"; required with `progress`. */
31
+ progressLabel?: string;
32
+ }
33
+ }
34
+ /**
35
+ * Clamps a watched share into 0–1, so a bar never overflows its track or runs backwards.
36
+ *
37
+ * @param value The share a page passed.
38
+ * @returns The share the bar draws.
39
+ */
40
+ export declare function clampProgress(value: number): number;
41
+ /**
42
+ * Renders the card. The whole card is one link whose name is the title, so a row of them
43
+ * reads as a list of titles; the art scales a little under the pointer and stays still under
44
+ * reduced motion.
45
+ *
46
+ * @example
47
+ * <VideoCard href="/title/tidewater" title="Tidewater" art={<img src={still} alt="" />} meta="S1 · E3" progress={0.4} progressLabel="40% watched" />
48
+ * @example
49
+ * <VideoCard shape="poster" href="/title/ember" title="Ember Line" art={<Poster />} badge="New" />
50
+ */
51
+ export declare function VideoCard(handle: Handle<VideoCard.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,135 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { visuallyHidden } from "@sdxc/u/a11y";
3
+ import { mergeMix, raw } from "@sdxc/u/general";
4
+ import { motionSafe } from "@sdxc/u/responsive";
5
+ import { when } from "@sdxc/u/state";
6
+ /** The art frame's proportions per shape. */
7
+ const RATIOS = { landscape: "16 / 9", poster: "2 / 3" };
8
+ /** The bar's fill, the brand's own unless a page names another. */
9
+ const PROGRESS_COLOR = "var(--ui-video-card-progress-color, var(--ui-brand-bg-solid))";
10
+ /**
11
+ * Clamps a watched share into 0–1, so a bar never overflows its track or runs backwards.
12
+ *
13
+ * @param value The share a page passed.
14
+ * @returns The share the bar draws.
15
+ */
16
+ export function clampProgress(value) {
17
+ if (!Number.isFinite(value))
18
+ return 0;
19
+ return Math.min(1, Math.max(0, value));
20
+ }
21
+ /**
22
+ * Renders the card. The whole card is one link whose name is the title, so a row of them
23
+ * reads as a list of titles; the art scales a little under the pointer and stays still under
24
+ * reduced motion.
25
+ *
26
+ * @example
27
+ * <VideoCard href="/title/tidewater" title="Tidewater" art={<img src={still} alt="" />} meta="S1 · E3" progress={0.4} progressLabel="40% watched" />
28
+ * @example
29
+ * <VideoCard shape="poster" href="/title/ember" title="Ember Line" art={<Poster />} badge="New" />
30
+ */
31
+ export function VideoCard(handle) {
32
+ return () => {
33
+ let { art, badge, href, meta, mix, progress, progressLabel, shape = "landscape", title, ...rest } = handle.props;
34
+ let watched = progress === undefined ? null : clampProgress(progress);
35
+ return (_jsxs("a", { ...rest, href: href, "data-slot": "video-card", "data-shape": shape, mix: mergeMix([
36
+ raw({
37
+ position: "relative",
38
+ display: "grid",
39
+ alignContent: "start",
40
+ gap: "0.5rem",
41
+ minInlineSize: "0",
42
+ color: "inherit",
43
+ textDecoration: "none",
44
+ borderRadius: "var(--ui-video-card-radius, var(--ui-radius-lg, 0.5rem))",
45
+ outline: "none",
46
+ WebkitTapHighlightColor: "transparent",
47
+ }),
48
+ when("&:focus-visible [data-slot=video-card-art]", raw({ outline: "2px solid var(--ui-brand-ring)", outlineOffset: "3px" })),
49
+ when("&:hover [data-slot=video-card-art]", raw({
50
+ boxShadow: "0 0 0 1px var(--ui-video-card-ring-hover, rgb(255 255 255 / 0.28))",
51
+ })),
52
+ motionSafe(when("&:hover [data-slot=video-card-art] > :first-child", raw({ scale: "1.04" }))),
53
+ ], mix), children: [_jsxs("span", { "data-slot": "video-card-art", mix: [
54
+ raw({
55
+ position: "relative",
56
+ display: "block",
57
+ aspectRatio: RATIOS[shape],
58
+ overflow: "clip",
59
+ borderRadius: "var(--ui-video-card-radius, var(--ui-radius-lg, 0.5rem))",
60
+ backgroundColor: "var(--ui-neutral-bg-tint-pressed)",
61
+ boxShadow: "0 0 0 1px var(--ui-image-outline, rgb(0 0 0 / 0.08))",
62
+ transition: "box-shadow 160ms ease",
63
+ "& > :first-child": {
64
+ position: "absolute",
65
+ inset: "0",
66
+ inlineSize: "100%",
67
+ blockSize: "100%",
68
+ objectFit: "cover",
69
+ transition: "scale 320ms cubic-bezier(0.2, 0.7, 0.2, 1)",
70
+ },
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: [
73
+ raw({
74
+ overflow: "hidden",
75
+ textOverflow: "ellipsis",
76
+ whiteSpace: "nowrap",
77
+ fontSize: "0.9375rem",
78
+ lineHeight: "1.375rem",
79
+ fontWeight: "600",
80
+ color: "var(--ui-neutral-fg-emphasis)",
81
+ }),
82
+ ], children: title }), meta === undefined ? null : (_jsx("span", { "data-slot": "video-card-meta", mix: [
83
+ raw({
84
+ overflow: "hidden",
85
+ textOverflow: "ellipsis",
86
+ whiteSpace: "nowrap",
87
+ fontSize: "0.8125rem",
88
+ lineHeight: "1.125rem",
89
+ color: "var(--ui-neutral-fg-muted)",
90
+ fontVariantNumeric: "tabular-nums",
91
+ }),
92
+ ], children: meta })), watched === null || progressLabel === undefined ? null : (_jsx("span", { mix: [visuallyHidden()], children: progressLabel }))] })] }));
93
+ };
94
+ }
95
+ /** The label on the art's top corner, on a dark glass so it reads over any artwork. */
96
+ function CardBadge(handle) {
97
+ return () => (_jsx("span", { "data-slot": "video-card-badge", mix: [
98
+ raw({
99
+ position: "absolute",
100
+ insetBlockStart: "0.5rem",
101
+ insetInlineStart: "0.5rem",
102
+ paddingInline: "0.4375rem",
103
+ paddingBlock: "0.125rem",
104
+ borderRadius: "var(--ui-radius-sm, 0.25rem)",
105
+ fontSize: "0.6875rem",
106
+ lineHeight: "1rem",
107
+ fontWeight: "700",
108
+ letterSpacing: "0.04em",
109
+ textTransform: "uppercase",
110
+ color: "oklch(0.98 0 0)",
111
+ backgroundColor: "var(--ui-video-card-badge-bg, rgb(10 10 14 / 0.72))",
112
+ "@media (prefers-reduced-transparency: no-preference)": {
113
+ backdropFilter: "blur(6px)",
114
+ },
115
+ }),
116
+ ], children: handle.props.children }));
117
+ }
118
+ /** The watched bar along the art's foot: a pale track and the fill, both decorative. */
119
+ function CardProgress(handle) {
120
+ return () => (_jsx("span", { "data-slot": "video-card-progress", "aria-hidden": "true", mix: [
121
+ raw({
122
+ position: "absolute",
123
+ insetInline: "0",
124
+ insetBlockEnd: "0",
125
+ blockSize: "0.25rem",
126
+ backgroundColor: "rgb(255 255 255 / 0.28)",
127
+ }),
128
+ ], children: _jsx("span", { mix: [
129
+ raw({
130
+ display: "block",
131
+ blockSize: "100%",
132
+ backgroundColor: PROGRESS_COLOR,
133
+ }),
134
+ ], style: { inlineSize: `${(handle.props.value * 100).toFixed(1)}%` } }) }));
135
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * A titled row of video cards that scrolls sideways, the shelf a catalogue home stacks:
3
+ * native scroll snap moves it by touch, trackpad and keyboard with no script, and once script
4
+ * runs, paging buttons at its edges step one screenful at a time and disable at either end.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ /** Prop types for {@link VideoShelf} and its parts. */
11
+ export declare namespace VideoShelf {
12
+ /** Which card shape the shelf holds, which sets how wide each item is. */
13
+ type Size = "landscape" | "poster";
14
+ /** The paging buttons' accessible names. */
15
+ interface Labels {
16
+ previous: string;
17
+ next: string;
18
+ }
19
+ /** Every native `<section>` attribute but `title`, plus the shelf's heading and items. */
20
+ interface Props extends Omit<TagProps<"section">, "title"> {
21
+ /** Names the shelf and its parts; the heading and the scroller derive their ids from it. */
22
+ id: string;
23
+ /** The shelf's heading, such as "Continue watching". */
24
+ title: RemixNode;
25
+ /** A link beside the heading, such as "See all". */
26
+ action?: RemixNode;
27
+ /** The paging buttons' names, which script reveals. */
28
+ labels: Labels;
29
+ /** Default: `"landscape"`. */
30
+ size?: Size;
31
+ /** The heading's level. Default: `2`. */
32
+ level?: 2 | 3;
33
+ /** {@link VideoShelf.Item} elements, one per card. */
34
+ children: RemixNode;
35
+ }
36
+ /** Every native `<li>` attribute. */
37
+ interface ItemProps extends TagProps<"li"> {
38
+ }
39
+ }
40
+ /**
41
+ * Renders the shelf: the heading row, then the scroller holding a list of items, between two
42
+ * paging buttons kept hidden until the shelf's island reveals them. The scroller is a labelled
43
+ * region, so a keyboard reaches it and scrolls it with the arrow keys.
44
+ *
45
+ * @example
46
+ * <VideoShelf id="trending" title="Trending now" labels={{ previous: "Previous", next: "Next" }}>
47
+ * {titles.map((title) => <VideoShelf.Item><VideoCard {...title} /></VideoShelf.Item>)}
48
+ * </VideoShelf>
49
+ */
50
+ export declare function VideoShelf(handle: Handle<VideoShelf.Props>): () => import("remix/component").RemixElement;
51
+ export declare namespace VideoShelf {
52
+ var Item: (handle: Handle<VideoShelf.ItemProps>) => () => import("remix/component").RemixElement;
53
+ }
54
+ /**
55
+ * The island inside every {@link VideoShelf}: a hidden marker that reveals and runs the paging
56
+ * buttons. It loads from `@sdxc/ui/video/video-shelf`, which the browser entry maps to an import.
57
+ */
58
+ export declare const VideoShelfSync: EntryComponent<Record<never, never>>;