@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
@@ -142,10 +142,10 @@ export const SplitViewKeys = clientEntry("@sdxc/ui/app/split-view#SplitViewKeys"
142
142
  */
143
143
  export function SplitView(handle) {
144
144
  return () => {
145
- let { id, sidebar, rail, list, detail, empty, active, backHref, layout, cookie, keys, labels, mix, ...rest } = handle.props;
145
+ let { id, sidebar, rail, list, detail, empty, active, backHref, frame, layout, cookie, cookiePath, keys, labels, mix, ...rest } = handle.props;
146
146
  let hasDetail = detail !== null && detail !== undefined && detail !== false;
147
147
  let ids = { sidebar: `${id}-sidebar`, list: `${id}-list`, detail: `${id}-detail` };
148
- return (_jsxs("div", { id: id, "data-split-view": true, "data-slot": "split-view", "data-cookie": cookie ?? SPLIT_VIEW_COOKIE, "data-collapsed": (layout?.collapsed ?? []).join(" "), "data-active": active ?? (hasDetail ? "detail" : "list"), ...rest, mix: mergeMix([container(CONTAINER), is("full"), bs("full"), raw({ minBlockSize: 0 })], mix), children: [_jsxs(Resizable, { "data-resizable-group": true, mix: [
148
+ return (_jsxs("div", { id: id, "data-split-view": true, "data-slot": "split-view", "data-cookie": cookie ?? SPLIT_VIEW_COOKIE, "data-cookie-path": cookiePath, "data-collapsed": (layout?.collapsed ?? []).join(" "), "data-active": active ?? (hasDetail ? "detail" : "list"), ...rest, mix: mergeMix([container(CONTAINER), is("full"), bs("full"), raw({ minBlockSize: 0 })], mix), children: [_jsxs(Resizable, { "data-resizable-group": true, mix: [
149
149
  bs("full"),
150
150
  rounded("none"),
151
151
  border({ color: "transparent", width: 0 }),
@@ -177,7 +177,7 @@ export function SplitView(handle) {
177
177
  [whileRoot('[data-active="detail"]')]: { display: "flex" },
178
178
  },
179
179
  }),
180
- ], children: [backHref ? (_jsxs("a", { href: backHref, "data-slot": "split-view-back", mix: [
180
+ ], children: [backHref ? (_jsxs("a", { href: backHref, "data-rmx-target": frame, "data-slot": "split-view-back", mix: [
181
181
  inlineFlex(),
182
182
  items("center"),
183
183
  gap(1.5),
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The one set of token colours every code surface paints highlighted runs with, so a file,
3
+ * a diff and a thread excerpt read the same `keyword` in the same ink, in light and dark,
4
+ * and a page's own `--highlight-*` properties restyle all of them at once.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /**
10
+ * Token colours as `[light, dark]` pairs, used when the page declares no `--highlight-*`
11
+ * property of its own. A run whose type is missing here draws as plain text.
12
+ */
13
+ export declare const CODE_TOKEN_PALETTE: Readonly<Record<string, readonly [string, string]>>;
14
+ /**
15
+ * One rule per token type for `span.token.<type>` under the host, each reading the page's
16
+ * `--highlight-<type>` first. Spread into the host's `raw()` rules once, so rows carry no
17
+ * class of their own beyond the run's.
18
+ *
19
+ * @returns Nested rules keyed by selector.
20
+ * @example raw({ ...codeTokenRules(), fontFamily: "monospace" })
21
+ */
22
+ export declare function codeTokenRules(): Record<string, {
23
+ color: string;
24
+ }>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The one set of token colours every code surface paints highlighted runs with, so a file,
3
+ * a diff and a thread excerpt read the same `keyword` in the same ink, in light and dark,
4
+ * and a page's own `--highlight-*` properties restyle all of them at once.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /**
10
+ * Token colours as `[light, dark]` pairs, used when the page declares no `--highlight-*`
11
+ * property of its own. A run whose type is missing here draws as plain text.
12
+ */
13
+ export const CODE_TOKEN_PALETTE = {
14
+ comment: ["#6a737d", "#8b949e"],
15
+ keyword: ["#d73a49", "#ff7b72"],
16
+ operator: ["#d73a49", "#ff7b72"],
17
+ string: ["#032f62", "#a5d6ff"],
18
+ builtin: ["#032f62", "#a5d6ff"],
19
+ "attr-name": ["#032f62", "#a5d6ff"],
20
+ "attr-value": ["#032f62", "#a5d6ff"],
21
+ number: ["#005cc5", "#79c0ff"],
22
+ boolean: ["#005cc5", "#79c0ff"],
23
+ constant: ["#005cc5", "#79c0ff"],
24
+ property: ["#005cc5", "#79c0ff"],
25
+ tag: ["#005cc5", "#79c0ff"],
26
+ function: ["#6f42c1", "#d2a8ff"],
27
+ "class-name": ["#6f42c1", "#d2a8ff"],
28
+ regex: ["#e36209", "#ffa657"],
29
+ variable: ["#e36209", "#ffa657"],
30
+ punctuation: ["#24292f", "#e6edf3"],
31
+ inserted: ["#22863a", "#7ee787"],
32
+ deleted: ["#b31d28", "#ffa198"],
33
+ };
34
+ /**
35
+ * One rule per token type for `span.token.<type>` under the host, each reading the page's
36
+ * `--highlight-<type>` first. Spread into the host's `raw()` rules once, so rows carry no
37
+ * class of their own beyond the run's.
38
+ *
39
+ * @returns Nested rules keyed by selector.
40
+ * @example raw({ ...codeTokenRules(), fontFamily: "monospace" })
41
+ */
42
+ export function codeTokenRules() {
43
+ return Object.fromEntries(Object.entries(CODE_TOKEN_PALETTE).map(([type, [light, dark]]) => [
44
+ `& .token.${type}`,
45
+ { color: `var(--highlight-${type}, light-dark(${light}, ${dark}))` },
46
+ ]));
47
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * A phone's bottom tab bar: four or five destinations under the thumb, each an icon over its
3
+ * name, fixed above the home indicator, gone from the width where the sidebar takes over.
4
+ * It reserves its own height in the flow, so the page's last row never hides behind 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
+ /** The bar's height above the safe area, which a floating button above it offsets by. */
11
+ export declare const TAB_BAR_BLOCK_SIZE = "3.5rem";
12
+ /** Prop types for {@link TabBar} and {@link TabBar.Item}. */
13
+ export declare namespace TabBar {
14
+ /**
15
+ * The width from which the bar is gone, matching where the app's sidebar appears;
16
+ * `never` keeps it at every width, for an app made for phones alone.
17
+ */
18
+ type HideFrom = "30rem" | "40rem" | "48rem" | "64rem" | "never";
19
+ /** Props accepted by {@link TabBar}. */
20
+ interface Props extends TagProps<"nav"> {
21
+ /** The landmark's name, such as "Primary". */
22
+ label: string;
23
+ /** @default "40rem" */
24
+ hideFrom?: HideFrom;
25
+ /** Shows each item's name under its icon; `false` keeps names for assistive tech alone. @default true */
26
+ showLabels?: boolean;
27
+ /** Four or five {@link TabBar.Item}s. */
28
+ children: RemixNode;
29
+ }
30
+ /** Props accepted by {@link TabBar.Item}; a type, since anchor props are a union. */
31
+ type ItemProps = TagProps<"a"> & {
32
+ href: string;
33
+ /** A 24px icon. */
34
+ icon: RemixNode;
35
+ /** The destination's name, read out and shown under the icon. */
36
+ label: string;
37
+ /** This item is the page shown; sets `aria-current="page"`. */
38
+ current?: boolean;
39
+ /** A badge on the icon; zero or unset draws none. Counts over 99 read "99+". */
40
+ count?: number;
41
+ /** What the count means for a screen reader, such as "3 unread notifications". */
42
+ countLabel?: string;
43
+ };
44
+ }
45
+ /**
46
+ * Renders the bar. The outer box keeps the bar's height in the flow while the bar itself is
47
+ * fixed to the viewport's foot, so it reads as one more block at the end of the page; a
48
+ * screen at or above `hideFrom` draws neither.
49
+ *
50
+ * @example
51
+ * <TabBar label="Primary">
52
+ * <TabBar.Item href="/" icon={<HomeIcon />} label="Home" current />
53
+ * <TabBar.Item href="/alerts" icon={<BellIcon />} label="Alerts" count={3} countLabel="3 new" />
54
+ * </TabBar>
55
+ */
56
+ export declare function TabBar(handle: Handle<TabBar.Props>): () => import("remix/component").RemixElement;
57
+ export declare namespace TabBar {
58
+ var Item: (handle: Handle<TabBar.ItemProps>) => () => import("remix/component").RemixElement;
59
+ }
@@ -0,0 +1,111 @@
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 { media, motionReduce } from "@sdxc/u/responsive";
5
+ import { when } from "@sdxc/u/state";
6
+ /** The bar's height above the safe area, which a floating button above it offsets by. */
7
+ export const TAB_BAR_BLOCK_SIZE = "3.5rem";
8
+ /** The width from which a bar hides when `hideFrom` is omitted: a tablet's, where the sidebar shows. */
9
+ const DEFAULT_HIDE_FROM = "40rem";
10
+ /**
11
+ * Renders the bar. The outer box keeps the bar's height in the flow while the bar itself is
12
+ * fixed to the viewport's foot, so it reads as one more block at the end of the page; a
13
+ * screen at or above `hideFrom` draws neither.
14
+ *
15
+ * @example
16
+ * <TabBar label="Primary">
17
+ * <TabBar.Item href="/" icon={<HomeIcon />} label="Home" current />
18
+ * <TabBar.Item href="/alerts" icon={<BellIcon />} label="Alerts" count={3} countLabel="3 new" />
19
+ * </TabBar>
20
+ */
21
+ export function TabBar(handle) {
22
+ return () => {
23
+ let { label, hideFrom = DEFAULT_HIDE_FROM, showLabels = true, children, mix, ...rest } = handle.props;
24
+ return (_jsx("div", { "data-slot": "tab-bar", mix: [
25
+ raw({
26
+ "--ui-tab-bar-block-size": TAB_BAR_BLOCK_SIZE,
27
+ blockSize: `calc(${TAB_BAR_BLOCK_SIZE} + env(safe-area-inset-bottom, 0px))`,
28
+ flexShrink: "0",
29
+ }),
30
+ hideFrom === "never"
31
+ ? raw({})
32
+ : media(`(min-width: ${hideFrom})`, raw({ display: "none" })),
33
+ ], children: _jsx("nav", { ...rest, "aria-label": label, "data-labels": showLabels ? "" : undefined, mix: mergeMix([
34
+ raw({
35
+ position: "fixed",
36
+ insetInline: "0",
37
+ insetBlockEnd: "0",
38
+ zIndex: "40",
39
+ display: "grid",
40
+ gridAutoFlow: "column",
41
+ gridAutoColumns: "minmax(0, 1fr)",
42
+ paddingBlockEnd: "env(safe-area-inset-bottom, 0px)",
43
+ backgroundColor: "color-mix(in oklch, var(--ui-bg, Canvas) 88%, transparent)",
44
+ backdropFilter: "blur(16px) saturate(1.4)",
45
+ WebkitBackdropFilter: "blur(16px) saturate(1.4)",
46
+ borderBlockStart: "1px solid var(--ui-neutral-border)",
47
+ }),
48
+ ], mix), children: children }) }));
49
+ };
50
+ }
51
+ /**
52
+ * One destination: the whole column is the link, at least 44px square. The current item
53
+ * takes the brand colour and a heavier name, and a press dims it briefly.
54
+ */
55
+ TabBar.Item = function TabBarItem(handle) {
56
+ return () => {
57
+ let { href, icon, label, current = false, count, countLabel, mix, ...rest } = handle.props;
58
+ let hasCount = count !== undefined && count > 0;
59
+ return (_jsxs("a", { ...rest, href: href, "aria-current": current ? "page" : undefined, "data-slot": "tab-bar-item", mix: mergeMix([
60
+ raw({
61
+ display: "flex",
62
+ flexDirection: "column",
63
+ alignItems: "center",
64
+ justifyContent: "center",
65
+ gap: "0.125rem",
66
+ minBlockSize: TAB_BAR_BLOCK_SIZE,
67
+ minInlineSize: "2.75rem",
68
+ color: "var(--ui-neutral-fg-muted)",
69
+ textDecoration: "none",
70
+ WebkitTapHighlightColor: "transparent",
71
+ transition: "opacity 120ms",
72
+ outline: "none",
73
+ }),
74
+ when("&[aria-current='page']", raw({ color: "var(--ui-brand-fg)" })),
75
+ when("&:active", raw({ opacity: "0.6" })),
76
+ when("&:focus-visible", raw({ boxShadow: "inset 0 0 0 2px var(--ui-brand-ring)", borderRadius: "0.75rem" })),
77
+ motionReduce(raw({ transition: "none" })),
78
+ ], mix), children: [_jsxs("span", { "aria-hidden": "true", "data-slot": "tab-bar-icon", mix: [
79
+ raw({
80
+ position: "relative",
81
+ display: "inline-flex",
82
+ inlineSize: "1.5rem",
83
+ blockSize: "1.5rem",
84
+ "& > svg": { inlineSize: "100%", blockSize: "100%" },
85
+ }),
86
+ ], children: [icon, hasCount ? (_jsx("span", { "data-slot": "tab-bar-count", mix: [
87
+ raw({
88
+ position: "absolute",
89
+ insetBlockStart: "-0.375rem",
90
+ insetInlineStart: "0.875rem",
91
+ minInlineSize: "1.125rem",
92
+ blockSize: "1.125rem",
93
+ paddingInline: "0.3125rem",
94
+ boxSizing: "border-box",
95
+ borderRadius: "999px",
96
+ fontSize: "0.6875rem",
97
+ fontWeight: "700",
98
+ lineHeight: "1.125rem",
99
+ textAlign: "center",
100
+ fontVariantNumeric: "tabular-nums",
101
+ color: "var(--ui-brand-fg-on-solid, white)",
102
+ backgroundColor: "var(--ui-brand-bg-solid)",
103
+ boxShadow: "0 0 0 2px var(--ui-bg, Canvas)",
104
+ }),
105
+ ], children: (count ?? 0) > 99 ? "99+" : count })) : null] }), _jsxs("span", { "data-slot": "tab-bar-label", mix: [
106
+ raw({ fontSize: "0.6875rem", lineHeight: "1rem", fontWeight: "500" }),
107
+ when("[aria-current='page'] > &", raw({ fontWeight: "700" })),
108
+ when(":is(nav:not([data-labels])) &", visuallyHidden()),
109
+ ], children: [label, hasCount && countLabel ? _jsxs("span", { mix: [visuallyHidden()], children: [", ", countLabel] }) : null] })] }));
110
+ };
111
+ };
@@ -2,16 +2,17 @@
2
2
  * A hierarchical list of nodes built from nested `<details>` and `<summary>`
3
3
  * elements, so a branch's expand/collapse state, keyboard toggling, and
4
4
  * content hiding all come from the platform rather than tracked state.
5
- * {@link Tree.Item} nests further {@link Tree.Item} nodes directly inside
6
- * itself to describe a subtree, {@link Tree.ItemContent} renders each node's
7
- * always-visible row, and {@link Tree.LoadMoreItem} holds a trailing loading
8
- * placeholder exactly like a row list's own.
5
+ * {@link Tree.Item} nests further {@link Tree.Item} nodes and {@link Tree.Leaf}
6
+ * file rows inside itself, {@link Tree.ItemContent} renders a folder's row,
7
+ * {@link Tree.Filter} narrows the files, and {@link Tree.Navigation} adds arrow keys.
9
8
  *
10
9
  * @author [Sergio Xalambrí](https://sergiodxa.com)
11
10
  * @copyright Sergio Xalambrí 2026
12
11
  */
13
- import type { Handle, Props as TagProps, RemixNode } from "remix/component";
12
+ import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
14
13
  import { SentinelRow } from "../components/sentinel-row.js";
14
+ import type { TreeNavigation as TreeNavigationMixin } from "./mixins/tree-navigation.js";
15
+ export { treeFilterMatches } from "./utils/tree-filter.js";
15
16
  /**
16
17
  * Prop and context types for {@link Tree} and its compound parts.
17
18
  */
@@ -21,12 +22,84 @@ export declare namespace Tree {
21
22
  /** Nesting depth this item occupies, `0` for a node rendered directly inside {@link Tree}. */
22
23
  depth: number;
23
24
  }
25
+ /** Value {@link Tree} provides to every row inside it. */
26
+ interface RootContext {
27
+ /** The frame every {@link Tree.Leaf} link swaps, unless the leaf names its own. */
28
+ frame: string | undefined;
29
+ }
24
30
  /**
25
31
  * Props accepted by {@link Tree}.
26
32
  */
27
33
  interface Props extends TagProps<"div"> {
28
- /** {@link Tree.Item} and {@link Tree.LoadMoreItem} nodes to render. */
34
+ /** {@link Tree.Item}, {@link Tree.Leaf} and {@link Tree.LoadMoreItem} nodes to render. */
29
35
  children: RemixNode;
36
+ /**
37
+ * The frame every file link swaps (`data-rmx-target`), such as `"main"`, so picking a
38
+ * file redraws only the code while the tree, its open folders and scroll stay put.
39
+ */
40
+ frame?: string;
41
+ }
42
+ /** How a file changed, drawn as a toned letter: A, M, D or R. */
43
+ type LeafStatus = "added" | "modified" | "deleted" | "renamed";
44
+ /**
45
+ * Props accepted by {@link Tree.Leaf}: every native `<a>` attribute.
46
+ */
47
+ interface LeafProps extends Omit<TagProps<"a">, "children" | "role" | "href"> {
48
+ href: string;
49
+ /** The file's name; picks its icon and is what type-ahead matches. */
50
+ name: string;
51
+ /** The file's full path, which {@link Tree.Filter} matches. @default name */
52
+ path?: string;
53
+ /** What the row shows in place of `name`, such as a name with a matched part marked. */
54
+ children?: RemixNode;
55
+ /** Marks the file being read, with `aria-current="page"`; render its folders `open`. */
56
+ current?: boolean;
57
+ /** The frame this link swaps, over the tree's own `frame`. */
58
+ frame?: string;
59
+ status?: LeafStatus;
60
+ /** What assistive technology reads for `status`, such as "Modified"; the letter is decoration. */
61
+ statusLabel?: string;
62
+ /** Lines added, drawn end-aligned as `+n`. */
63
+ additions?: number;
64
+ /** Lines removed, drawn end-aligned as `−n`. */
65
+ deletions?: number;
66
+ }
67
+ /**
68
+ * Props accepted by {@link Tree.Filter}: every native `<form>` attribute. The form submits
69
+ * with GET to `action`, so a reader without script gets the narrowed tree from the server.
70
+ */
71
+ interface FilterProps extends Omit<TagProps<"form">, "children" | "method"> {
72
+ /** The `id` of the {@link Tree} the field narrows as the reader types. */
73
+ tree: string;
74
+ /** The field's accessible name, such as "Filter files". */
75
+ label: string;
76
+ placeholder?: string;
77
+ /** The query the page was rendered with, so the field shows what narrowed the tree. */
78
+ value?: string;
79
+ /** Search parameter the query submits under. @default "filter" */
80
+ name?: string;
81
+ /** Other search parameters the submission keeps, as hidden fields. */
82
+ params?: Record<string, string>;
83
+ }
84
+ /** Props {@link TreeFilterField} receives from {@link Tree.Filter}. */
85
+ interface FilterFieldProps {
86
+ tree: string;
87
+ label: string;
88
+ name: string;
89
+ value?: string;
90
+ placeholder?: string;
91
+ }
92
+ /** Props accepted by {@link Tree.NoMatches}: every native `<p>` attribute, plus its tree. */
93
+ interface NoMatchesProps extends TagProps<"p"> {
94
+ /**
95
+ * The id of the tree it answers for, when it sits beside the tree rather than inside it,
96
+ * which keeps the tree's children to its items.
97
+ */
98
+ tree?: string;
99
+ }
100
+ /** Props accepted by {@link Tree.Navigation}: the key copy the help sheet lists. */
101
+ interface NavigationProps {
102
+ labels?: TreeNavigationMixin.Labels;
30
103
  }
31
104
  /**
32
105
  * Props accepted by {@link Tree.Item}. Every native `<details>` attribute
@@ -64,9 +137,10 @@ export declare namespace Tree {
64
137
  }
65
138
  }
66
139
  /**
67
- * Renders the tree's root host: a bordered `<div>` carrying `role="tree"`,
68
- * stacking {@link Tree.Item} nodes in block flow, with `data-empty`
69
- * centering a fallback message; an unlabeled tree logs a dev `console.warn`.
140
+ * Renders the bordered `role="tree"` panel; folders open and file links work with no script.
141
+ * Rows indent `--ui-tree-indent` per level, `frame` aims every {@link Tree.Leaf} at one frame,
142
+ * `data-empty` centers a fallback, {@link Tree.NoMatches} answers a filter that matches
143
+ * nothing, and {@link Tree.Filter} and {@link Tree.Navigation} add islands.
70
144
  *
71
145
  * @param handle Runtime handle carrying the host `<div>`'s props.
72
146
  * @returns The render function producing the tree's markup.
@@ -74,7 +148,7 @@ export declare namespace Tree {
74
148
  * <Tree aria-label={t("files.title")}>
75
149
  * <Tree.Item id="src">
76
150
  * <Tree.ItemContent>
77
- * <Tree.ExpandButton aria-label={t("files.expand")} />
151
+ * <Tree.ExpandButton />
78
152
  * {t("files.folder", { name: "src" })}
79
153
  * </Tree.ItemContent>
80
154
  * <Tree.Item id="src-index">
@@ -86,13 +160,25 @@ export declare namespace Tree {
86
160
  * <Tree aria-label={t("files.title")} data-empty>
87
161
  * {t("files.empty")}
88
162
  * </Tree>
163
+ * @example
164
+ * <Tree id="files" aria-label={t("files.title")} frame="main">
165
+ * <Tree.Navigation labels={{ group: t("keys.files"), next: t("keys.next") }} />
166
+ * <Tree.Item id="app" open>
167
+ * <Tree.ItemContent><Tree.ExpandButton />app</Tree.ItemContent>
168
+ * <Tree.Leaf href="/blob/main/app/routes.ts" name="routes.ts" path="app/routes.ts" current />
169
+ * </Tree.Item>
170
+ * </Tree>
89
171
  */
90
- export declare function Tree(handle: Handle<Tree.Props>): () => import("remix/component").RemixElement;
172
+ export declare function Tree(handle: Handle<Tree.Props, Tree.RootContext>): () => import("remix/component").RemixElement;
91
173
  export declare namespace Tree {
92
174
  var Item: typeof TreeItem;
93
175
  var ItemContent: (handle: Handle<Tree.ItemContentProps>) => () => import("remix/component").RemixElement;
94
176
  var LoadMoreItem: typeof SentinelRow;
95
177
  var ExpandButton: (handle: Handle<Tree.ExpandButtonProps>) => () => import("remix/component").RemixElement;
178
+ var Leaf: (handle: Handle<Tree.LeafProps>) => () => import("remix/component").RemixElement;
179
+ var Filter: (handle: Handle<Tree.FilterProps>) => () => import("remix/component").RemixElement;
180
+ var NoMatches: (handle: Handle<Tree.NoMatchesProps>) => () => import("remix/component").RemixElement;
181
+ var Navigation: (handle: Handle<Tree.NavigationProps>) => () => import("remix/component").RemixElement;
96
182
  }
97
183
  /**
98
184
  * Renders a node as a native `<details>`, so a subtree's reveal and `[open]`
@@ -104,7 +190,7 @@ export declare namespace Tree {
104
190
  * @example
105
191
  * <Tree.Item id="src">
106
192
  * <Tree.ItemContent>
107
- * <Tree.ExpandButton aria-label={t("files.expand")} />
193
+ * <Tree.ExpandButton />
108
194
  * {t("files.folder", { name: "src" })}
109
195
  * </Tree.ItemContent>
110
196
  * <Tree.Item id="src-index">
@@ -114,10 +200,21 @@ export declare namespace Tree {
114
200
  * @example
115
201
  * <Tree.Item id="src" open>
116
202
  * <Tree.ItemContent>
117
- * <Tree.ExpandButton aria-label={t("files.collapse")} />
203
+ * <Tree.ExpandButton />
118
204
  * {t("files.folder", { name: "src" })}
119
205
  * </Tree.ItemContent>
120
206
  * </Tree.Item>
121
207
  */
122
208
  declare function TreeItem(handle: Handle<Tree.ItemProps, Tree.ItemContext>): () => import("remix/component").RemixElement;
123
- export {};
209
+ /**
210
+ * Client island behind {@link Tree.Filter}: the search field, whose `treeFilter()` narrows
211
+ * the tree as the reader types. Loads from `@sdxc/ui/app/tree#TreeFilterField` once the
212
+ * app's browser entry maps it; until then the field submits its form.
213
+ */
214
+ export declare const TreeFilterField: EntryComponent<Tree.FilterFieldProps>;
215
+ /**
216
+ * Client island behind {@link Tree.Navigation}: a hidden marker whose `treeNavigation()`
217
+ * walks the rows of the tree it sits in. Loads from `@sdxc/ui/app/tree#TreeNavigation` once
218
+ * the app's browser entry maps it; until then every row stays reachable by Tab.
219
+ */
220
+ export declare const TreeNavigation: EntryComponent<Tree.NavigationProps>;