@sdxc/ui 2026.11.11 → 2026.11.14

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 (191) hide show
  1. package/README.md +89 -44
  2. package/dist/app/app-shell-toggle.d.ts +2 -0
  3. package/dist/app/app-shell-toggle.js +5 -2
  4. package/dist/app/app-shell.d.ts +25 -1
  5. package/dist/app/app-shell.js +73 -38
  6. package/dist/app/auto-refresh.d.ts +2 -0
  7. package/dist/app/auto-refresh.js +3 -3
  8. package/dist/app/behaviors/refresh-schedule.d.ts +8 -3
  9. package/dist/app/behaviors/refresh-schedule.js +4 -3
  10. package/dist/app/board.d.ts +123 -0
  11. package/dist/app/board.js +224 -0
  12. package/dist/app/chart.d.ts +2 -2
  13. package/dist/app/chart.js +7 -3
  14. package/dist/app/check-runs.d.ts +116 -0
  15. package/dist/app/check-runs.js +201 -0
  16. package/dist/app/code-view.d.ts +172 -0
  17. package/dist/app/code-view.js +414 -0
  18. package/dist/app/command-palette.d.ts +38 -3
  19. package/dist/app/command-palette.js +53 -5
  20. package/dist/app/contribution-graph.d.ts +106 -0
  21. package/dist/app/contribution-graph.js +289 -0
  22. package/dist/app/detail-sheet.d.ts +7 -0
  23. package/dist/app/detail-sheet.js +7 -7
  24. package/dist/app/diff.d.ts +200 -0
  25. package/dist/app/diff.js +702 -0
  26. package/dist/app/filter-bar.d.ts +20 -0
  27. package/dist/app/filter-bar.js +35 -15
  28. package/dist/app/filter-menu.d.ts +144 -0
  29. package/dist/app/filter-menu.js +480 -0
  30. package/dist/app/gantt.d.ts +108 -0
  31. package/dist/app/gantt.js +420 -0
  32. package/dist/app/index.d.ts +19 -0
  33. package/dist/app/index.js +19 -0
  34. package/dist/app/log-viewer.d.ts +120 -0
  35. package/dist/app/log-viewer.js +384 -0
  36. package/dist/app/merge-box.d.ts +97 -0
  37. package/dist/app/merge-box.js +227 -0
  38. package/dist/app/mixins/app-shell-controls.d.ts +4 -1
  39. package/dist/app/mixins/app-shell-controls.js +64 -4
  40. package/dist/app/mixins/auto-refresh.d.ts +5 -2
  41. package/dist/app/mixins/auto-refresh.js +9 -3
  42. package/dist/app/mixins/close-popover-on-submit.d.ts +16 -0
  43. package/dist/app/mixins/close-popover-on-submit.js +32 -0
  44. package/dist/app/mixins/code-view-selection.d.ts +60 -0
  45. package/dist/app/mixins/code-view-selection.js +276 -0
  46. package/dist/app/mixins/command-palette.d.ts +15 -4
  47. package/dist/app/mixins/command-palette.js +94 -6
  48. package/dist/app/mixins/contribution-graph-keys.d.ts +19 -0
  49. package/dist/app/mixins/contribution-graph-keys.js +155 -0
  50. package/dist/app/mixins/diff-interactions.d.ts +72 -0
  51. package/dist/app/mixins/diff-interactions.js +269 -0
  52. package/dist/app/mixins/filter-menu-keys.d.ts +41 -0
  53. package/dist/app/mixins/filter-menu-keys.js +91 -0
  54. package/dist/app/mixins/gantt-today.d.ts +17 -0
  55. package/dist/app/mixins/gantt-today.js +50 -0
  56. package/dist/app/mixins/log-viewer.d.ts +29 -0
  57. package/dist/app/mixins/log-viewer.js +333 -0
  58. package/dist/app/mixins/optimistic-toggle-sync.d.ts +5 -0
  59. package/dist/app/mixins/optimistic-toggle-sync.js +25 -1
  60. package/dist/app/mixins/save-bar-sync.d.ts +7 -1
  61. package/dist/app/mixins/save-bar-sync.js +23 -4
  62. package/dist/app/mixins/save-status-sync.js +23 -1
  63. package/dist/app/mixins/split-view.js +1 -1
  64. package/dist/app/mixins/submit-on-close.d.ts +17 -0
  65. package/dist/app/mixins/submit-on-close.js +52 -0
  66. package/dist/app/mixins/tree-filter.d.ts +44 -0
  67. package/dist/app/mixins/tree-filter.js +111 -0
  68. package/dist/app/mixins/tree-navigation.d.ts +50 -0
  69. package/dist/app/mixins/tree-navigation.js +216 -0
  70. package/dist/app/optimistic-toggle.d.ts +8 -0
  71. package/dist/app/optimistic-toggle.js +3 -2
  72. package/dist/app/page-header.d.ts +18 -3
  73. package/dist/app/page-header.js +105 -50
  74. package/dist/app/review-thread.d.ts +115 -0
  75. package/dist/app/review-thread.js +116 -0
  76. package/dist/app/save-bar.d.ts +5 -0
  77. package/dist/app/save-bar.js +1 -1
  78. package/dist/app/settings-layout.d.ts +5 -0
  79. package/dist/app/settings-layout.js +5 -5
  80. package/dist/app/skeleton.d.ts +9 -0
  81. package/dist/app/skeleton.js +28 -0
  82. package/dist/app/split-view.d.ts +4 -0
  83. package/dist/app/split-view.js +3 -3
  84. package/dist/app/styles/code-tokens.d.ts +24 -0
  85. package/dist/app/styles/code-tokens.js +47 -0
  86. package/dist/app/tab-bar.d.ts +59 -0
  87. package/dist/app/tab-bar.js +111 -0
  88. package/dist/app/tree.d.ts +111 -14
  89. package/dist/app/tree.js +202 -15
  90. package/dist/app/utils/ansi.d.ts +55 -0
  91. package/dist/app/utils/ansi.js +157 -0
  92. package/dist/app/utils/diff-rows.d.ts +82 -0
  93. package/dist/app/utils/diff-rows.js +209 -0
  94. package/dist/app/utils/fuzzy-path.d.ts +58 -0
  95. package/dist/app/utils/fuzzy-path.js +202 -0
  96. package/dist/app/utils/line-range.d.ts +48 -0
  97. package/dist/app/utils/line-range.js +61 -0
  98. package/dist/app/utils/log-lines.d.ts +107 -0
  99. package/dist/app/utils/log-lines.js +170 -0
  100. package/dist/app/utils/tree-filter.d.ts +19 -0
  101. package/dist/app/utils/tree-filter.js +26 -0
  102. package/dist/app/view-options.d.ts +2 -0
  103. package/dist/app/view-options.js +2 -2
  104. package/dist/chat/activity.d.ts +72 -0
  105. package/dist/chat/activity.js +184 -0
  106. package/dist/chat/composer-submit.d.ts +38 -0
  107. package/dist/chat/composer-submit.js +44 -0
  108. package/dist/chat/composer.d.ts +47 -0
  109. package/dist/chat/composer.js +100 -0
  110. package/dist/chat/index.d.ts +6 -0
  111. package/dist/chat/index.js +6 -0
  112. package/dist/chat/mixins/composer-send.d.ts +32 -0
  113. package/dist/chat/mixins/composer-send.js +121 -0
  114. package/dist/chat/mixins/reveal-stream.d.ts +68 -0
  115. package/dist/chat/mixins/reveal-stream.js +184 -0
  116. package/dist/chat/mixins/stream-target.d.ts +18 -0
  117. package/dist/chat/mixins/stream-target.js +38 -0
  118. package/dist/components/button.js +7 -1
  119. package/dist/components/character-count.d.ts +44 -0
  120. package/dist/components/character-count.js +68 -0
  121. package/dist/components/index.d.ts +2 -0
  122. package/dist/components/index.js +2 -0
  123. package/dist/components/label-chip.d.ts +42 -0
  124. package/dist/components/label-chip.js +86 -0
  125. package/dist/components/property-list.d.ts +9 -2
  126. package/dist/components/property-list.js +11 -6
  127. package/dist/components/textarea.js +6 -1
  128. package/dist/components/timeline.d.ts +62 -5
  129. package/dist/components/timeline.js +124 -5
  130. package/dist/docs/code-block.js +8 -31
  131. package/dist/docs/file-tree.js +3 -48
  132. package/dist/landing/case-study.d.ts +79 -0
  133. package/dist/landing/case-study.js +162 -0
  134. package/dist/landing/contributor-wall.d.ts +72 -0
  135. package/dist/landing/contributor-wall.js +129 -0
  136. package/dist/landing/countdown.d.ts +88 -0
  137. package/dist/landing/countdown.js +91 -0
  138. package/dist/landing/episode-player.d.ts +87 -0
  139. package/dist/landing/episode-player.js +113 -0
  140. package/dist/landing/faq-band.d.ts +3 -2
  141. package/dist/landing/faq-band.js +4 -3
  142. package/dist/landing/index.d.ts +7 -0
  143. package/dist/landing/index.js +7 -0
  144. package/dist/landing/landing-header.js +15 -4
  145. package/dist/landing/mixins/countdown-tick.d.ts +29 -0
  146. package/dist/landing/mixins/countdown-tick.js +65 -0
  147. package/dist/landing/mixins/usage-estimate-live.d.ts +32 -0
  148. package/dist/landing/mixins/usage-estimate-live.js +120 -0
  149. package/dist/landing/phone-frame.d.ts +2 -1
  150. package/dist/landing/price-list.d.ts +68 -0
  151. package/dist/landing/price-list.js +125 -0
  152. package/dist/landing/scroll-scene.d.ts +59 -0
  153. package/dist/landing/scroll-scene.js +70 -0
  154. package/dist/landing/sponsor-wall.d.ts +30 -6
  155. package/dist/landing/sponsor-wall.js +70 -14
  156. package/dist/landing/typed-terminal.d.ts +24 -6
  157. package/dist/landing/typed-terminal.js +22 -14
  158. package/dist/landing/usage-estimate.d.ts +127 -0
  159. package/dist/landing/usage-estimate.js +164 -0
  160. package/dist/landing/utils/countdown.d.ts +33 -0
  161. package/dist/landing/utils/countdown.js +42 -0
  162. package/dist/landing/utils/pause-toggle.d.ts +2 -1
  163. package/dist/mixins/character-count.d.ts +62 -0
  164. package/dist/mixins/character-count.js +139 -0
  165. package/dist/mixins/index.d.ts +6 -2
  166. package/dist/mixins/index.js +6 -2
  167. package/dist/mixins/invoker-fields.d.ts +18 -0
  168. package/dist/mixins/invoker-fields.js +60 -0
  169. package/dist/mixins/media-sync.d.ts +58 -0
  170. package/dist/mixins/media-sync.js +102 -0
  171. package/dist/mixins/menu-keys.d.ts +11 -0
  172. package/dist/mixins/menu-keys.js +79 -70
  173. package/dist/mixins/sortable.d.ts +96 -0
  174. package/dist/mixins/sortable.js +433 -0
  175. package/dist/utils/code-lines.d.ts +26 -0
  176. package/dist/utils/code-lines.js +29 -0
  177. package/dist/utils/file-icon.d.ts +31 -0
  178. package/dist/utils/file-icon.js +60 -0
  179. package/dist/utils/index.d.ts +2 -0
  180. package/dist/utils/index.js +2 -0
  181. package/dist/utils/write-cookie.d.ts +15 -15
  182. package/dist/utils/write-cookie.js +10 -16
  183. package/dist/video/index.d.ts +11 -0
  184. package/dist/video/index.js +11 -0
  185. package/dist/video/mixins/video-player-sync.d.ts +27 -0
  186. package/dist/video/mixins/video-player-sync.js +413 -0
  187. package/dist/video/utils/timeline.d.ts +55 -0
  188. package/dist/video/utils/timeline.js +90 -0
  189. package/dist/video/video-player.d.ts +261 -0
  190. package/dist/video/video-player.js +927 -0
  191. package/package.json +6 -3
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
2
  import { tokenize } from "@sdxc/highlight";
3
- import { FileBracesIcon, FileCodeIcon, FileCogIcon, FileIcon, FileTextIcon, TerminalIcon, } from "@sdxc/icons";
3
+ import { FileCodeIcon, FileIcon, TerminalIcon } from "@sdxc/icons";
4
4
  import { bg, border, borderEdge, fg } from "@sdxc/u/color";
5
5
  import { rounded } from "@sdxc/u/effects";
6
6
  import { mergeMix, raw } from "@sdxc/u/general";
@@ -10,6 +10,8 @@ import { bs, m, minIs, pi } from "@sdxc/u/size";
10
10
  import { z } from "@sdxc/u/stacking";
11
11
  import { font, text, truncate } from "@sdxc/u/typography";
12
12
  import { COPY_EXCLUDE_ATTRIBUTE } from "../mixins/copy-to-clipboard.js";
13
+ import { codeLines } from "../utils/code-lines.js";
14
+ import { fileIcon } from "../utils/file-icon.js";
13
15
  import { CopyButton } from "./copy-button.js";
14
16
  /** Inline padding of every line, which a marked line splits between its bar and its text. */
15
17
  const LINE_INSET = "1rem";
@@ -178,7 +180,8 @@ function lineRules(hasHeader, lineNumbers, digits) {
178
180
  }
179
181
  /**
180
182
  * The glyph before the header text: a terminal for a shell session, otherwise a file
181
- * glyph picked by the title's extension, so a reader sees what kind of file it is.
183
+ * glyph picked by the title's extension, so a reader sees what kind of file it is; an
184
+ * extension without a glyph of its own reads as source code.
182
185
  */
183
186
  function TitleIcon(handle) {
184
187
  return () => {
@@ -186,18 +189,8 @@ function TitleIcon(handle) {
186
189
  let extension = title?.match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase();
187
190
  if (shell && !extension)
188
191
  return _jsx(TerminalIcon, { size: 14, "aria-hidden": "true" });
189
- if (extension === "json" || extension === "jsonc") {
190
- return _jsx(FileBracesIcon, { size: 14, "aria-hidden": "true" });
191
- }
192
- if (extension && ["md", "mdx", "txt"].includes(extension)) {
193
- return _jsx(FileTextIcon, { size: 14, "aria-hidden": "true" });
194
- }
195
- if (extension && ["toml", "yaml", "yml", "env", "ini"].includes(extension)) {
196
- return _jsx(FileCogIcon, { size: 14, "aria-hidden": "true" });
197
- }
198
- if (extension)
199
- return _jsx(FileCodeIcon, { size: 14, "aria-hidden": "true" });
200
- return _jsx(FileIcon, { size: 14, "aria-hidden": "true" });
192
+ let Glyph = title && extension ? fileIcon(title, { fallback: FileCodeIcon }) : FileIcon;
193
+ return _jsx(Glyph, { size: 14, "aria-hidden": "true" });
201
194
  };
202
195
  }
203
196
  /** Whether a title names a file, which sets it in the mono face. */
@@ -226,7 +219,7 @@ function paintLines(code, language, tokens, shell, marks) {
226
219
  let runs = tokens ?? (language ? tokenize(text, language) : [{ type: "plain", value: text }]);
227
220
  let lines = [];
228
221
  let continued = false;
229
- for (let [index, lineTokens] of splitLines(runs).slice(0, rawLines.length).entries()) {
222
+ for (let [index, lineTokens] of codeLines(runs).slice(0, rawLines.length).entries()) {
230
223
  let prompt = prompts[index] ?? false;
231
224
  let command = prompt || continued;
232
225
  continued = command && (rawLines[index] ?? "").endsWith("\\");
@@ -249,22 +242,6 @@ function markOf(number, marks) {
249
242
  return "highlight";
250
243
  return undefined;
251
244
  }
252
- /**
253
- * Splits runs at newlines so each line owns its runs; a run spanning lines (a block
254
- * comment, a template literal) becomes one run per line, same type.
255
- */
256
- function splitLines(runs) {
257
- let lines = [[]];
258
- for (let run of runs) {
259
- for (let [index, piece] of run.value.split(/\r?\n/).entries()) {
260
- if (index > 0)
261
- lines.push([]);
262
- if (piece.length > 0)
263
- lines[lines.length - 1]?.push({ type: run.type, value: piece });
264
- }
265
- }
266
- return lines;
267
- }
268
245
  /** Drops the first `count` characters of a line's runs, for a prompt already painted in. */
269
246
  function dropLeading(runs, count) {
270
247
  let remaining = count;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
- import { EllipsisIcon, FileBracesIcon, FileCodeIcon, FileCogIcon, FileIcon, FileImageIcon, FileLockIcon, FileTerminalIcon, FileTextIcon, FileTypeIcon, FolderIcon, FolderOpenIcon, } from "@sdxc/icons";
2
+ import { EllipsisIcon, FolderIcon, FolderOpenIcon } from "@sdxc/icons";
3
3
  import { bg, border, borderEdge, fg } from "@sdxc/u/color";
4
4
  import { rounded } from "@sdxc/u/effects";
5
5
  import { cursor, listStyle, mergeMix, raw } from "@sdxc/u/general";
@@ -8,56 +8,11 @@ import { overflowX } from "@sdxc/u/overflow";
8
8
  import { m, minIs, mis, p, pi, pis } from "@sdxc/u/size";
9
9
  import { focusVisible, when } from "@sdxc/u/state";
10
10
  import { font, nowrap, text, weight } from "@sdxc/u/typography";
11
+ import { fileIcon } from "../utils/file-icon.js";
11
12
  /** Placeholder entry standing for "more files here" that a tree leaves out. */
12
13
  const MORE = "…";
13
14
  /** Matches an icon inside the summary row of an open directory, and only that directory's. */
14
15
  const OPEN_ROW = ":is(details[open] > summary) &";
15
- /** Icons for file extensions whose type a reader recognises at a glance. */
16
- const ICON_BY_EXTENSION = {
17
- ts: FileCodeIcon,
18
- tsx: FileCodeIcon,
19
- js: FileCodeIcon,
20
- jsx: FileCodeIcon,
21
- mjs: FileCodeIcon,
22
- cjs: FileCodeIcon,
23
- mts: FileCodeIcon,
24
- cts: FileCodeIcon,
25
- html: FileCodeIcon,
26
- sql: FileCodeIcon,
27
- json: FileBracesIcon,
28
- jsonc: FileBracesIcon,
29
- md: FileTextIcon,
30
- mdx: FileTextIcon,
31
- txt: FileTextIcon,
32
- css: FileTypeIcon,
33
- png: FileImageIcon,
34
- jpg: FileImageIcon,
35
- jpeg: FileImageIcon,
36
- gif: FileImageIcon,
37
- svg: FileImageIcon,
38
- webp: FileImageIcon,
39
- avif: FileImageIcon,
40
- ico: FileImageIcon,
41
- sh: FileTerminalIcon,
42
- toml: FileCogIcon,
43
- yaml: FileCogIcon,
44
- yml: FileCogIcon,
45
- env: FileCogIcon,
46
- lock: FileLockIcon,
47
- lockb: FileLockIcon,
48
- };
49
- /**
50
- * Picks a file's icon from its extension, treating a dotfile's name as its extension
51
- * (`.env`), and falls back to a plain file icon for anything unrecognised.
52
- *
53
- * @param name File name as shown in the tree.
54
- */
55
- function iconFor(name) {
56
- let dot = name.lastIndexOf(".");
57
- if (dot === -1)
58
- return FileIcon;
59
- return ICON_BY_EXTENSION[name.slice(dot + 1).toLowerCase()] ?? FileIcon;
60
- }
61
16
  /**
62
17
  * Renders the tree's card: an optional caption, then the top level of entries in a box
63
18
  * that scrolls sideways on its own when a deep path is wider than the page.
@@ -107,7 +62,7 @@ function Entry(handle) {
107
62
  return (_jsx("li", { "data-slot": "file-tree-more", "aria-label": moreLabel, mix: [m(0), fg("neutral.muted")], children: _jsx("span", { mix: [hstack({ gap: 2, align: "center" })], children: _jsx(EllipsisIcon, { size: 16, "aria-hidden": "true" }) }) }));
108
63
  }
109
64
  if (entry.children === undefined) {
110
- let Glyph = iconFor(entry.name);
65
+ let Glyph = fileIcon(entry.name);
111
66
  return (_jsx("li", { "data-slot": "file-tree-file", mix: [m(0)], children: _jsx(Row, { node: entry, children: _jsx(Glyph, { size: 16, "aria-hidden": "true" }) }) }));
112
67
  }
113
68
  return (_jsx("li", { "data-slot": "file-tree-directory", mix: [m(0), minIs(0)], children: _jsxs("details", { open: !entry.collapsed, children: [_jsx("summary", { mix: [
@@ -0,0 +1,79 @@
1
+ /**
2
+ * A case study as one full-bleed scene: a running head, a plate that crosses the whole band
3
+ * edge to edge, and under it the title with the problem, what was built and the measured
4
+ * result set on a twelve-column grid, the way a printed portfolio lays out a project spread.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, RemixNode } from "remix/component";
10
+ import { LandingSection } from "./landing-section.js";
11
+ /**
12
+ * Prop types for {@link CaseStudy}.
13
+ */
14
+ export declare namespace CaseStudy {
15
+ /** The measured outcome, set as the spread's largest figure. */
16
+ interface Result {
17
+ /** The figure itself, such as "−31%" or "48 s → 19 s". */
18
+ value: RemixNode;
19
+ /** What the figure measures and over which period. */
20
+ label: RemixNode;
21
+ }
22
+ /** The column labels, for a page in another language. */
23
+ interface Labels {
24
+ /** @default "Problem" */
25
+ problem?: RemixNode;
26
+ /** @default "What we built" */
27
+ built?: RemixNode;
28
+ /** @default "Result" */
29
+ result?: RemixNode;
30
+ }
31
+ /**
32
+ * Props accepted by {@link CaseStudy}.
33
+ */
34
+ interface Props extends Omit<LandingSection.Props, "children" | "title" | "align"> {
35
+ /** The project's place in the sequence, such as "01", set first in the running head. */
36
+ index?: RemixNode;
37
+ /** Who the work was for. */
38
+ client: RemixNode;
39
+ /** Sector, year or discipline, set after the client in the running head. */
40
+ meta?: RemixNode;
41
+ /** The spread's headline, at chapter display size through the ambient heading depth. */
42
+ title: RemixNode;
43
+ /** The scene: inline SVG or drawn UI, stretched to fill the plate. */
44
+ scene: RemixNode;
45
+ /** What the scene shows, read as the plate's accessible name. */
46
+ sceneLabel: string;
47
+ /** The plate's fill behind the scene. Defaults to the tinted neutral. */
48
+ plate?: string;
49
+ /** What stood in the client's way. */
50
+ problem: RemixNode;
51
+ /** The work, as delivered. */
52
+ built: RemixNode;
53
+ /** The measured outcome. */
54
+ result: Result;
55
+ /** Column labels; English by default. */
56
+ labels?: Labels;
57
+ }
58
+ }
59
+ /**
60
+ * Renders the running head, the edge-to-edge plate and the spread: one column on a phone, then
61
+ * from the `lg` container twelve, the first three a margin beside the title and the facts. Server
62
+ * markup and CSS alone; `--ui-landing-case-figure-size` resizes the result's figure.
63
+ *
64
+ * @param handle Runtime handle carrying the spread's props.
65
+ * @returns The render function producing the band.
66
+ * @example
67
+ * <CaseStudy
68
+ * index="01"
69
+ * client="Harbour Line"
70
+ * meta="Transit · 2025"
71
+ * title="A ferry timetable you read from the pier"
72
+ * scene={<DeparturesBoard />}
73
+ * sceneLabel="The departures board on pier 3"
74
+ * problem="Riders missed connections they could not see coming."
75
+ * built="A live board and a rider app sharing one timetable service."
76
+ * result={{ value: "−31%", label: "missed connections, first winter" }}
77
+ * />
78
+ */
79
+ export declare function CaseStudy(handle: Handle<CaseStudy.Props>): () => import("remix/component").RemixElement;
@@ -0,0 +1,162 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
+ import { combine, raw } from "@sdxc/u/general";
3
+ import { at } from "@sdxc/u/responsive";
4
+ import { when } from "@sdxc/u/state";
5
+ import { font } from "@sdxc/u/typography";
6
+ import { Heading } from "../components/heading.js";
7
+ import { landingEmphasis } from "../styles/landing.js";
8
+ import { LandingSection } from "./landing-section.js";
9
+ /** The container every case study's grid queries, published by its {@link LandingSection}. */
10
+ const CONTAINER = "ui-landing-section";
11
+ /** The rule between the parts of a spread, in the band's hairline. */
12
+ const RULE = "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))";
13
+ /** The small label face shared by the running head and the column labels. */
14
+ const LABEL_FONT = "var(--ui-landing-eyebrow-font, var(--ui-font-mono))";
15
+ /**
16
+ * Renders the running head, the edge-to-edge plate and the spread: one column on a phone, then
17
+ * from the `lg` container twelve, the first three a margin beside the title and the facts. Server
18
+ * markup and CSS alone; `--ui-landing-case-figure-size` resizes the result's figure.
19
+ *
20
+ * @param handle Runtime handle carrying the spread's props.
21
+ * @returns The render function producing the band.
22
+ * @example
23
+ * <CaseStudy
24
+ * index="01"
25
+ * client="Harbour Line"
26
+ * meta="Transit · 2025"
27
+ * title="A ferry timetable you read from the pier"
28
+ * scene={<DeparturesBoard />}
29
+ * sceneLabel="The departures board on pier 3"
30
+ * problem="Riders missed connections they could not see coming."
31
+ * built="A live board and a rider app sharing one timetable service."
32
+ * result={{ value: "−31%", label: "missed connections, first winter" }}
33
+ * />
34
+ */
35
+ export function CaseStudy(handle) {
36
+ return () => {
37
+ let { built, client, index, labels, meta, plate, problem, result, scene, sceneLabel, title, ...rest } = handle.props;
38
+ return (_jsx(LandingSection, { ...rest, children: _jsxs("article", { "data-slot": "case-study", mix: [spread()], children: [_jsxs("p", { "data-slot": "case-study-head", mix: [runningHead()], children: [index ? _jsx("span", { "data-slot": "case-study-index", children: index }) : null, _jsx("span", { "data-slot": "case-study-client", mix: [raw({ color: "var(--ui-neutral-fg-emphasis)" })], children: client }), meta ? _jsx("span", { "data-slot": "case-study-meta", children: meta }) : null] }), _jsx("figure", { "data-slot": "case-study-plate", role: "img", "aria-label": sceneLabel, mix: [plateFrame(plate)], children: scene }), _jsx(Heading, { size: "chapter", mix: [titleCell()], children: title }), _jsxs("dl", { "data-slot": "case-study-facts", mix: [facts()], children: [_jsxs("div", { "data-slot": "case-study-problem", mix: [fact()], children: [_jsx("dt", { mix: [factLabel()], children: labels?.problem ?? "Problem" }), _jsx("dd", { mix: [factBody()], children: problem })] }), _jsxs("div", { "data-slot": "case-study-built", mix: [fact()], children: [_jsx("dt", { mix: [factLabel()], children: labels?.built ?? "What we built" }), _jsx("dd", { mix: [factBody()], children: built })] }), _jsxs("div", { "data-slot": "case-study-result", mix: [fact()], children: [_jsx("dt", { mix: [factLabel()], children: labels?.result ?? "Result" }), _jsxs("dd", { mix: [factBody(), raw({ display: "grid", gap: "0.5rem" })], children: [_jsx("span", { "data-slot": "case-study-figure", mix: [figure()], children: result.value }), _jsx("span", { children: result.label })] })] })] })] }) }));
39
+ };
40
+ }
41
+ /**
42
+ * The spread's grid: one column on a phone, twelve from the `lg` container, so every part
43
+ * of every case study on a page lands on the same columns.
44
+ */
45
+ function spread() {
46
+ return combine([
47
+ raw({
48
+ display: "grid",
49
+ gridTemplateColumns: "minmax(0, 1fr)",
50
+ rowGap: "2rem",
51
+ inlineSize: "100%",
52
+ }),
53
+ at("lg", CONTAINER, raw({ gridTemplateColumns: "repeat(12, minmax(0, 1fr))", columnGap: "2rem", rowGap: "3rem" })),
54
+ ]);
55
+ }
56
+ /** The running head: index, client and meta on one ruled line in the small label face. */
57
+ function runningHead() {
58
+ return combine([
59
+ raw({
60
+ gridColumn: "1 / -1",
61
+ margin: "0",
62
+ display: "flex",
63
+ flexWrap: "wrap",
64
+ columnGap: "1.5rem",
65
+ rowGap: "0.25rem",
66
+ paddingBlockEnd: "0.75rem",
67
+ borderBlockEnd: RULE,
68
+ fontFamily: LABEL_FONT,
69
+ fontSize: "0.75rem",
70
+ letterSpacing: "0.12em",
71
+ textTransform: "uppercase",
72
+ color: "var(--ui-neutral-fg-muted)",
73
+ fontVariantNumeric: "tabular-nums",
74
+ }),
75
+ ]);
76
+ }
77
+ /**
78
+ * The plate: the whole band's width, edge to edge past the measured column, at a
79
+ * landscape height that grows with the viewport. The scene inside fills it.
80
+ *
81
+ * @param fill The plate colour, or the tinted neutral.
82
+ */
83
+ function plateFrame(fill) {
84
+ return combine([
85
+ raw({
86
+ gridColumn: "1 / -1",
87
+ margin: "0",
88
+ marginInline: "calc(50% - 50cqi)",
89
+ inlineSize: "100cqi",
90
+ blockSize: "clamp(20rem, 52cqi, 40rem)",
91
+ display: "grid",
92
+ overflow: "hidden",
93
+ backgroundColor: fill ?? "var(--ui-neutral-bg-tint)",
94
+ }),
95
+ when("& > *", raw({ inlineSize: "100%", blockSize: "100%", minInlineSize: "0" })),
96
+ ]);
97
+ }
98
+ /** The headline cell: full width on a phone, columns 4 to 12 beside an empty margin from `lg`. */
99
+ function titleCell() {
100
+ return combine([
101
+ raw({ margin: "0", maxInlineSize: "22ch" }),
102
+ at("lg", CONTAINER, raw({ gridColumn: "4 / -1" })),
103
+ ]);
104
+ }
105
+ /** The facts list: stacked on a phone, three columns of three from `lg` under the headline, on the page grid. */
106
+ function facts() {
107
+ return combine([
108
+ raw({ margin: "0", display: "grid", gridTemplateColumns: "minmax(0, 1fr)", rowGap: "1.5rem" }),
109
+ at("lg", CONTAINER, raw({
110
+ gridColumn: "4 / -1",
111
+ gridTemplateColumns: "subgrid",
112
+ })),
113
+ ]);
114
+ }
115
+ /** One fact: its label over its body, under a rule; three columns each from `lg`. */
116
+ function fact() {
117
+ return combine([
118
+ raw({
119
+ display: "grid",
120
+ alignContent: "start",
121
+ gap: "0.75rem",
122
+ paddingBlockStart: "1rem",
123
+ borderBlockStart: RULE,
124
+ }),
125
+ at("lg", CONTAINER, raw({ gridColumn: "span 3" })),
126
+ ]);
127
+ }
128
+ /** A fact's label, in the running head's face. */
129
+ function factLabel() {
130
+ return raw({
131
+ fontFamily: LABEL_FONT,
132
+ fontSize: "0.75rem",
133
+ letterSpacing: "0.12em",
134
+ textTransform: "uppercase",
135
+ color: "var(--ui-neutral-fg-muted)",
136
+ });
137
+ }
138
+ /** A fact's copy, in the body ink with emphasis in the heading ink. */
139
+ function factBody() {
140
+ return combine([
141
+ raw({ margin: "0", color: "var(--ui-neutral-fg)", lineHeight: "1.6", textWrap: "pretty" }),
142
+ landingEmphasis(),
143
+ ]);
144
+ }
145
+ /**
146
+ * The result's figure in the display face, sized for a column a quarter of the page wide
147
+ * so a before-and-after pair fits on one line at 1440; `--ui-landing-case-figure-size` resizes it.
148
+ */
149
+ function figure() {
150
+ return combine([
151
+ font("display"),
152
+ raw({
153
+ fontSize: "var(--ui-landing-case-figure-size, clamp(2rem, 1rem + 2cqi, 3rem))",
154
+ fontWeight: "var(--ui-landing-display-weight, 500)",
155
+ letterSpacing: "var(--ui-landing-display-tracking, -0.035em)",
156
+ lineHeight: "1.05",
157
+ color: "var(--ui-neutral-fg-emphasis)",
158
+ fontVariantNumeric: "lining-nums tabular-nums",
159
+ textWrap: "balance",
160
+ }),
161
+ ]);
162
+ }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * A project's contributors as a dense mosaic of square tiles, each a link to one person,
3
+ * ending on a tile that counts everyone the wall leaves out. Tiles take a quiet tint read
4
+ * from the name, so a wall of initials reads as texture and the page's accent stays free.
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
+ /**
11
+ * Prop types for {@link ContributorWall} and its compound parts.
12
+ */
13
+ export declare namespace ContributorWall {
14
+ /** Columns at the phone, `md` and `lg` container steps. */
15
+ type Columns = readonly [phone: number, md: number, lg: number];
16
+ /**
17
+ * Props accepted by {@link ContributorWall}.
18
+ */
19
+ interface Props extends TagProps<"ul"> {
20
+ /** Accessible name for the list, such as "Contributors to plumb". */
21
+ "aria-label": string;
22
+ /**
23
+ * Columns at each container step. A tile count that divides every step, the
24
+ * {@link ContributorWall.More} tile included, fills every row.
25
+ *
26
+ * @default [6, 9, 12]
27
+ */
28
+ columns?: Columns;
29
+ /** {@link ContributorWall.Person} tiles, then an optional {@link ContributorWall.More}. */
30
+ children: RemixNode;
31
+ }
32
+ /**
33
+ * Props accepted by {@link ContributorWall.Person}.
34
+ */
35
+ interface PersonProps extends Omit<TagProps<"a">, "children" | "href" | "role"> {
36
+ /** Their profile or commit history. */
37
+ href: string;
38
+ /** Their name, read by assistive technology and shown as a tooltip. */
39
+ name: string;
40
+ /** Their picture; the tile shows their initials when omitted. */
41
+ src?: string;
42
+ }
43
+ /**
44
+ * Props accepted by {@link ContributorWall.More}.
45
+ */
46
+ interface MoreProps extends Omit<TagProps<"a">, "children" | "href" | "role"> {
47
+ /** The full contributor list. */
48
+ href: string;
49
+ /** The short count the tile shows, such as "+190". */
50
+ count: RemixNode;
51
+ /** What the link opens, read in full by assistive technology. */
52
+ "aria-label": string;
53
+ }
54
+ }
55
+ /**
56
+ * Renders the mosaic. Every tile is square and the grid's columns step with its own
57
+ * width, so the wall keeps its texture from a phone column to a wide split. Server markup and
58
+ * CSS alone; tiles round to `--ui-landing-card-radius-inner` and outline in `--ui-landing-hairline`.
59
+ *
60
+ * @param handle Runtime handle carrying the host `<ul>`'s props.
61
+ * @returns The render function producing the wall's markup.
62
+ * @example
63
+ * <ContributorWall aria-label="Contributors">
64
+ * <ContributorWall.Person href="https://github.com/ana" name="Ana Souza" />
65
+ * <ContributorWall.More href="https://github.com/org/repo/graphs/contributors" count="+190" aria-label="All 214 contributors" />
66
+ * </ContributorWall>
67
+ */
68
+ export declare function ContributorWall(handle: Handle<ContributorWall.Props>): () => import("remix/component").RemixElement;
69
+ export declare namespace ContributorWall {
70
+ var Person: (handle: Handle<ContributorWall.PersonProps>) => () => import("remix/component").RemixElement;
71
+ var More: (handle: Handle<ContributorWall.MoreProps>) => () => import("remix/component").RemixElement;
72
+ }
@@ -0,0 +1,129 @@
1
+ import { jsx as _jsx } from "remix/component/jsx-runtime";
2
+ import { combine, raw, mergeMix } from "@sdxc/u/general";
3
+ import { container } from "@sdxc/u/layout";
4
+ import { at, motionSafe } from "@sdxc/u/responsive";
5
+ import { when } from "@sdxc/u/state";
6
+ /** Container the mosaic queries for its column steps. */
7
+ const CONTAINER = "ui-landing-contributor-wall";
8
+ /** Columns at the phone, `md` and `lg` container steps when `columns` is omitted. */
9
+ const DEFAULT_COLUMNS = [6, 9, 12];
10
+ /** Shares of the heading ink a tile's tint takes, picked per name so neighbours differ. */
11
+ const TINTS = [5, 8, 11, 14];
12
+ /**
13
+ * Renders the mosaic. Every tile is square and the grid's columns step with its own
14
+ * width, so the wall keeps its texture from a phone column to a wide split. Server markup and
15
+ * CSS alone; tiles round to `--ui-landing-card-radius-inner` and outline in `--ui-landing-hairline`.
16
+ *
17
+ * @param handle Runtime handle carrying the host `<ul>`'s props.
18
+ * @returns The render function producing the wall's markup.
19
+ * @example
20
+ * <ContributorWall aria-label="Contributors">
21
+ * <ContributorWall.Person href="https://github.com/ana" name="Ana Souza" />
22
+ * <ContributorWall.More href="https://github.com/org/repo/graphs/contributors" count="+190" aria-label="All 214 contributors" />
23
+ * </ContributorWall>
24
+ */
25
+ export function ContributorWall(handle) {
26
+ return () => {
27
+ let { children, columns, mix, ...rest } = handle.props;
28
+ let [phone, md, lg] = columns ?? DEFAULT_COLUMNS;
29
+ return (_jsx("div", { "data-slot": "contributor-wall", mix: [container(CONTAINER), raw({ inlineSize: "100%" })], children: _jsx("ul", { ...rest, "data-slot": "contributor-wall-tiles", mix: mergeMix([
30
+ raw({
31
+ "--ui-contributor-wall-columns": String(phone),
32
+ display: "grid",
33
+ gridTemplateColumns: "repeat(var(--ui-contributor-wall-columns), minmax(0, 1fr))",
34
+ gap: "0.25rem",
35
+ margin: "0",
36
+ padding: "0",
37
+ listStyle: "none",
38
+ }),
39
+ at("md", CONTAINER, raw({ "--ui-contributor-wall-columns": String(md) })),
40
+ at("lg", CONTAINER, raw({ "--ui-contributor-wall-columns": String(lg) })),
41
+ ], mix), children: children }) }));
42
+ };
43
+ }
44
+ /** The initials a tile without a picture shows: the first letter of up to two words. */
45
+ function initials(name) {
46
+ return name
47
+ .split(/\s+/)
48
+ .filter(Boolean)
49
+ .slice(0, 2)
50
+ .map((word) => word[0]?.toUpperCase() ?? "")
51
+ .join("");
52
+ }
53
+ /** A stable tint step for a name, so the same person keeps the same tile on every render. */
54
+ function tintFor(name) {
55
+ let sum = 0;
56
+ for (let index = 0; index < name.length; index += 1)
57
+ sum = (sum * 31 + name.charCodeAt(index)) | 0;
58
+ return TINTS[Math.abs(sum) % TINTS.length];
59
+ }
60
+ /**
61
+ * One square tile in one rule: the tint (or, for the closing tile, a hairline outline), mono
62
+ * initials, a picture in grayscale, and the brand fill on hover or focus, so a pointer finds
63
+ * a person without anything moving.
64
+ */
65
+ function tile(tint) {
66
+ let outlined = tint === "outline";
67
+ return combine([
68
+ raw({
69
+ display: "grid",
70
+ placeItems: "center",
71
+ aspectRatio: "1",
72
+ minInlineSize: "0",
73
+ overflow: "hidden",
74
+ borderRadius: "var(--ui-landing-card-radius-inner, 0.25rem)",
75
+ backgroundColor: outlined
76
+ ? "transparent"
77
+ : `color-mix(in oklch, var(--ui-neutral-fg-emphasis) ${tint}%, transparent)`,
78
+ boxShadow: outlined
79
+ ? "inset 0 0 0 1px var(--ui-landing-hairline, var(--ui-neutral-border))"
80
+ : "none",
81
+ color: outlined ? "var(--ui-neutral-fg-emphasis)" : "var(--ui-neutral-fg-muted)",
82
+ fontVariantNumeric: "tabular-nums",
83
+ fontFamily: "var(--ui-font-mono)",
84
+ fontSize: "clamp(0.625rem, 2.5cqi, 0.8125rem)",
85
+ fontWeight: "500",
86
+ letterSpacing: "0.02em",
87
+ textDecoration: "none",
88
+ outlineOffset: "2px",
89
+ }),
90
+ when("&:is(:hover, :focus-visible)", raw({ backgroundColor: "var(--ui-brand-bg-solid)", color: "var(--ui-brand-fg-on-solid)" })),
91
+ when("& > img", raw({
92
+ inlineSize: "100%",
93
+ blockSize: "100%",
94
+ objectFit: "cover",
95
+ filter: "grayscale(1)",
96
+ })),
97
+ when("&:is(:hover, :focus-visible) > img", raw({ filter: "none" })),
98
+ motionSafe(raw({ transition: "background-color 150ms, color 150ms" })),
99
+ ]);
100
+ }
101
+ /**
102
+ * One contributor: a linked tile with their picture or their initials, named by `name`.
103
+ *
104
+ * @param handle Runtime handle carrying the host `<a>`'s props.
105
+ * @returns The render function producing the tile's list item.
106
+ * @example
107
+ * <ContributorWall.Person href="https://github.com/ana" name="Ana Souza" />
108
+ */
109
+ ContributorWall.Person = function ContributorWallPerson(handle) {
110
+ return () => {
111
+ let { href, mix, name, src, ...rest } = handle.props;
112
+ return (_jsx("li", { "data-slot": "contributor-wall-person", mix: [raw({ display: "grid" })], children: _jsx("a", { ...rest, href: href, "aria-label": name, title: name, mix: mergeMix(tile(tintFor(name)), mix), children: src ? (_jsx("img", { src: src, alt: "", loading: "lazy" })) : (_jsx("span", { "aria-hidden": "true", children: initials(name) })) }) }));
113
+ };
114
+ };
115
+ /**
116
+ * The closing tile: the count of contributors the wall leaves out, linking to all of them,
117
+ * drawn as a hairline outline so it reads as a way out of the mosaic.
118
+ *
119
+ * @param handle Runtime handle carrying the host `<a>`'s props.
120
+ * @returns The render function producing the tile's list item.
121
+ * @example
122
+ * <ContributorWall.More href={contributorsUrl} count="+190" aria-label="All 214 contributors" />
123
+ */
124
+ ContributorWall.More = function ContributorWallMore(handle) {
125
+ return () => {
126
+ let { count, mix, ...rest } = handle.props;
127
+ return (_jsx("li", { "data-slot": "contributor-wall-more", mix: [raw({ display: "grid" })], children: _jsx("a", { ...rest, mix: mergeMix(tile("outline"), mix), children: _jsx("span", { "aria-hidden": "true", children: count }) }) }));
128
+ };
129
+ };