@sdxc/ui 2026.11.10 → 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 (196) hide show
  1. package/README.md +92 -45
  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/feature-band.d.ts +8 -0
  143. package/dist/landing/feature-band.js +9 -3
  144. package/dist/landing/index.d.ts +9 -0
  145. package/dist/landing/index.js +9 -0
  146. package/dist/landing/landing-header.js +15 -4
  147. package/dist/landing/mixins/countdown-tick.d.ts +29 -0
  148. package/dist/landing/mixins/countdown-tick.js +65 -0
  149. package/dist/landing/mixins/usage-estimate-live.d.ts +32 -0
  150. package/dist/landing/mixins/usage-estimate-live.js +120 -0
  151. package/dist/landing/phone-fan.d.ts +38 -0
  152. package/dist/landing/phone-fan.js +89 -0
  153. package/dist/landing/phone-frame.d.ts +48 -0
  154. package/dist/landing/phone-frame.js +41 -0
  155. package/dist/landing/price-list.d.ts +68 -0
  156. package/dist/landing/price-list.js +125 -0
  157. package/dist/landing/scroll-scene.d.ts +59 -0
  158. package/dist/landing/scroll-scene.js +70 -0
  159. package/dist/landing/sponsor-wall.d.ts +30 -6
  160. package/dist/landing/sponsor-wall.js +70 -14
  161. package/dist/landing/typed-terminal.d.ts +24 -6
  162. package/dist/landing/typed-terminal.js +22 -14
  163. package/dist/landing/usage-estimate.d.ts +127 -0
  164. package/dist/landing/usage-estimate.js +164 -0
  165. package/dist/landing/utils/countdown.d.ts +33 -0
  166. package/dist/landing/utils/countdown.js +42 -0
  167. package/dist/landing/utils/pause-toggle.d.ts +2 -1
  168. package/dist/mixins/character-count.d.ts +62 -0
  169. package/dist/mixins/character-count.js +139 -0
  170. package/dist/mixins/index.d.ts +6 -2
  171. package/dist/mixins/index.js +6 -2
  172. package/dist/mixins/invoker-fields.d.ts +18 -0
  173. package/dist/mixins/invoker-fields.js +60 -0
  174. package/dist/mixins/media-sync.d.ts +58 -0
  175. package/dist/mixins/media-sync.js +102 -0
  176. package/dist/mixins/menu-keys.d.ts +11 -0
  177. package/dist/mixins/menu-keys.js +79 -70
  178. package/dist/mixins/sortable.d.ts +96 -0
  179. package/dist/mixins/sortable.js +433 -0
  180. package/dist/utils/code-lines.d.ts +26 -0
  181. package/dist/utils/code-lines.js +29 -0
  182. package/dist/utils/file-icon.d.ts +31 -0
  183. package/dist/utils/file-icon.js +60 -0
  184. package/dist/utils/index.d.ts +2 -0
  185. package/dist/utils/index.js +2 -0
  186. package/dist/utils/write-cookie.d.ts +15 -15
  187. package/dist/utils/write-cookie.js +10 -16
  188. package/dist/video/index.d.ts +11 -0
  189. package/dist/video/index.js +11 -0
  190. package/dist/video/mixins/video-player-sync.d.ts +27 -0
  191. package/dist/video/mixins/video-player-sync.js +413 -0
  192. package/dist/video/utils/timeline.d.ts +55 -0
  193. package/dist/video/utils/timeline.js +90 -0
  194. package/dist/video/video-player.d.ts +261 -0
  195. package/dist/video/video-player.js +927 -0
  196. package/package.json +6 -3
@@ -0,0 +1,480 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
2
+ import { CheckIcon, ChevronDownIcon } from "@sdxc/icons";
3
+ import { visuallyHidden } from "@sdxc/u/a11y";
4
+ import { accent, bg, borderEdge, fg, outline } from "@sdxc/u/color";
5
+ import { rounded } from "@sdxc/u/effects";
6
+ import { cursor, mergeMix, raw } from "@sdxc/u/general";
7
+ import { flex, flexCol, gap, grow, hidden, inlineFlex, items, justify, relative, shrink, vstack, } from "@sdxc/u/layout";
8
+ import { overflowY, overscrollBehavior } from "@sdxc/u/overflow";
9
+ import { media } from "@sdxc/u/responsive";
10
+ import { bs, is, m, maxBs, minBs, minIs, p, pb, pbs, pi } from "@sdxc/u/size";
11
+ import { before, focusVisible, hover, when } from "@sdxc/u/state";
12
+ import { leading, nowrap, text, textDecoration, truncate, weight } from "@sdxc/u/typography";
13
+ import { clientEntry } from "remix/component";
14
+ import { Badge } from "../components/badge.js";
15
+ import { Button } from "../components/button.js";
16
+ import { LabelChip } from "../components/label-chip.js";
17
+ import { Popover } from "../components/popover.js";
18
+ import { SearchField } from "../components/search-field.js";
19
+ import { FILTER_MENU_ROW_SLOT, filterMenuKeys } from "./mixins/filter-menu-keys.js";
20
+ import { submitOnClose } from "./mixins/submit-on-close.js";
21
+ /** How many matching rows the list draws at most; the rest are counted in one closing row. */
22
+ const DEFAULT_LIMIT = 100;
23
+ /** Side of the trigger the popover opens on when `placement` is unset. */
24
+ const DEFAULT_PLACEMENT = "bottom-start";
25
+ /** The viewport width at and below which the popover is drawn as a bottom sheet. */
26
+ const SHEET_QUERY = "(max-width: 40rem)";
27
+ /**
28
+ * Renders a trigger and its native popover: links in `navigate` mode, a form posted to `action` by
29
+ * its Save button in `single` and `multiple`. Mapping `@sdxc/ui/app/filter-menu` in the browser
30
+ * entry runs {@link FilterMenuList}: typing filters, arrows walk, and closing a changed picker posts.
31
+ *
32
+ * @param handle Runtime handle carrying the menu's props.
33
+ * @returns The render function producing the trigger and popover.
34
+ * @example
35
+ * <FilterMenu id="ref-picker" mode="navigate" tabs trigger={<><GitBranchIcon /> main</>}
36
+ * groups={[{ label: "Branches", items: branches }, { label: "Tags", items: tags }]}
37
+ * filterAction="/delta/branches" footer={<a href="/delta/branches">View all branches</a>} labels={labels} />
38
+ * @example
39
+ * <FilterMenu id="labels" mode="multiple" name="label" action={`/issues/${id}/labels`}
40
+ * trigger="Labels" groups={[{ label: "Labels", items: labels }]} labels={copy} />
41
+ */
42
+ export function FilterMenu(handle) {
43
+ return () => {
44
+ let { trigger, ...rest } = handle.props;
45
+ return (_jsxs(_Fragment, { children: [_jsxs(Button, { type: "button", variant: "outline", size: "sm", id: `${rest.id}-trigger`, popovertarget: rest.id, "aria-haspopup": "dialog", "data-slot": "filter-menu-trigger", mix: [minIs(0)], children: [_jsx("span", { mix: [inlineFlex(), items("center"), gap(1.5), minIs(0), truncate()], children: trigger }), _jsx(ChevronDownIcon, { size: 14, "aria-hidden": "true", mix: [shrink(0), fg("neutral.muted")] })] }), _jsx(FilterMenu.Popover, { ...rest })] }));
46
+ };
47
+ }
48
+ /**
49
+ * Renders the popover alone, for a trigger the page already has, such as a property row's
50
+ * edit button targeting `id`. It holds the heading, the filter, the list and the footer; at
51
+ * phone widths the same element is drawn as a bottom sheet over a dimmed page.
52
+ *
53
+ * @param handle Runtime handle carrying the popover's props.
54
+ * @returns The render function producing the popover.
55
+ * @example
56
+ * <button popovertarget="issue-labels">Labels</button>
57
+ * <FilterMenu.Popover id="issue-labels" mode="multiple" name="label" groups={groups} labels={labels} />
58
+ */
59
+ FilterMenu.Popover = function FilterMenuPopover(handle) {
60
+ return () => {
61
+ let { id, mode, groups, tabs, name, action, target, filterAction, query, limit, footer, placement, labels, mix, ...rest } = handle.props;
62
+ let titleId = `${id}-title`;
63
+ let filterForm = `${id}-filter-form`;
64
+ let list = (_jsx(FilterMenuList, { id: id, mode: mode, name: name, groups: groups, tabs: tabs, limit: limit, query: query, filterForm: filterForm, searchable: filterAction !== undefined, labels: labels }));
65
+ return (_jsxs(Popover, { id: id, placement: placement ?? DEFAULT_PLACEMENT, role: "dialog", "aria-labelledby": labels.title ? titleId : undefined, "aria-label": labels.title ? undefined : labels.filter, "data-slot": "filter-menu", "data-mode": mode, ...rest, mix: mergeMix([
66
+ p(0),
67
+ is("20rem"),
68
+ raw({ maxInlineSize: "calc(100vw - 2rem)" }),
69
+ maxBs("min(30rem, calc(100dvh - 2rem))"),
70
+ flexCol(),
71
+ raw({ overflow: "hidden" }),
72
+ text("sm"),
73
+ /**
74
+ * On a phone the popover leaves its anchor and rests on the bottom edge at full width,
75
+ * over a dimmed page a tap dismisses, with room for the home indicator.
76
+ */
77
+ media(SHEET_QUERY, raw({
78
+ positionArea: "none",
79
+ positionTryFallbacks: "none",
80
+ inset: "auto 0 0 0",
81
+ margin: "0 !important",
82
+ inlineSize: "100%",
83
+ maxInlineSize: "100%",
84
+ maxBlockSize: "85dvh",
85
+ borderEndStartRadius: "0",
86
+ borderEndEndRadius: "0",
87
+ paddingBlockEnd: "env(safe-area-inset-bottom)",
88
+ })),
89
+ media(SHEET_QUERY, when("&::backdrop", raw({ backgroundColor: "rgb(0 0 0 / 0.32)" }))),
90
+ ], mix), children: [labels.title ? (_jsx("p", { id: titleId, "data-slot": "filter-menu-title", mix: [
91
+ m(0),
92
+ pi(3),
93
+ pb(2),
94
+ weight("semibold"),
95
+ borderEdge("block-end", { width: 1, style: "solid", color: "neutral" }),
96
+ ], children: labels.title })) : null, _jsx("form", { id: filterForm, method: "get", action: filterAction, hidden: true }), mode === "navigate" ? (list) : (_jsx("form", { method: "post", action: action, "data-rmx-target": target, "data-slot": "filter-menu-form", mix: [flexCol(), minBs(0), grow()], children: list })), footer ? (_jsx("div", { "data-slot": "filter-menu-footer", mix: [
97
+ flex(),
98
+ pi(3),
99
+ pb(2),
100
+ borderEdge("block-start", { width: 1, style: "solid", color: "neutral" }),
101
+ when("& a", [
102
+ fg("brand"),
103
+ textDecoration("none"),
104
+ hover(textDecoration("underline")),
105
+ ]),
106
+ ], children: footer })) : null] }));
107
+ };
108
+ };
109
+ /**
110
+ * Folds case and accents away, so "resume" finds "Résumé" and "MAIN" finds "main".
111
+ *
112
+ * @param text Any label, value or query.
113
+ * @returns The comparable form.
114
+ */
115
+ function fold(text) {
116
+ return text
117
+ .normalize("NFD")
118
+ .replace(/\p{Diacritic}/gu, "")
119
+ .toLowerCase();
120
+ }
121
+ /**
122
+ * Prepares every group for filtering: selected items first, each run in its given order.
123
+ *
124
+ * @param groups The groups as the caller passed them.
125
+ * @param id The menu's id prefix.
126
+ * @returns One list of entries per group.
127
+ */
128
+ function prepare(groups, id) {
129
+ return groups.map((group, g) => {
130
+ let entries = group.items.map((item, i) => ({
131
+ item,
132
+ group: g,
133
+ key: `${g}:${i}`,
134
+ controlId: `${id}-option-${g}-${i}`,
135
+ search: fold(`${item.label} ${item.value} ${item.description ?? ""}`),
136
+ }));
137
+ return [
138
+ ...entries.filter((entry) => entry.item.selected),
139
+ ...entries.filter((entry) => !entry.item.selected),
140
+ ];
141
+ });
142
+ }
143
+ /**
144
+ * Filters the prepared groups into what the list draws: one scope per tab, each limited on
145
+ * its own, or one scope for stacked groups limited across all of them.
146
+ *
147
+ * @returns The scopes, in tab order.
148
+ */
149
+ function scopesFor(prepared, labels, query, tabs, limit) {
150
+ let needle = fold(query.trim());
151
+ let matches = prepared.map((entries) => needle ? entries.filter((entry) => entry.search.includes(needle)) : entries);
152
+ let runs = tabs ? matches.map((_, g) => [g]) : [matches.map((_, g) => g)];
153
+ return runs.map((run) => {
154
+ let room = limit;
155
+ let groups = run.map((g) => {
156
+ let entries = (matches[g] ?? []).slice(0, Math.max(room, 0));
157
+ room -= entries.length;
158
+ return { index: g, label: labels[g] ?? "", entries };
159
+ });
160
+ return {
161
+ tab: tabs ? (run[0] ?? 0) : null,
162
+ groups: groups.filter((group) => group.entries.length > 0),
163
+ matched: run.reduce((sum, g) => sum + (matches[g]?.length ?? 0), 0),
164
+ drawn: groups.reduce((sum, group) => sum + group.entries.length, 0),
165
+ };
166
+ });
167
+ }
168
+ /** The values the server marked selected, which the list starts from. */
169
+ function selectedValues(groups) {
170
+ return new Set(groups.flatMap((group) => group.items.filter((item) => item.selected).map((item) => item.value)));
171
+ }
172
+ /**
173
+ * Client island: the filter field, the tabs and the rows of a {@link FilterMenu}. It draws at
174
+ * most `limit` matches, so a list of thousands keeps a small page; typing filters, ↑↓ move the
175
+ * highlighted row, Enter follows or picks it, Escape closes, and a changed picker then submits.
176
+ *
177
+ * @example <FilterMenuList id="labels" mode="multiple" name="label" groups={groups} filterForm="labels-filter-form" labels={labels} />
178
+ */
179
+ export const FilterMenuList = clientEntry("@sdxc/ui/app/filter-menu#FilterMenuList", function FilterMenuList(handle) {
180
+ let preparedFrom = handle.props.groups;
181
+ let prepared = prepare(preparedFrom, handle.props.id);
182
+ let selected = selectedValues(preparedFrom);
183
+ let query = handle.props.query ?? "";
184
+ let tab = Math.max(prepared.findIndex((entries) => entries.some((entry) => entry.item.selected)), 0);
185
+ let active;
186
+ let hydrated = false;
187
+ let scopes = [];
188
+ handle.queueTask(() => {
189
+ hydrated = true;
190
+ void handle.update();
191
+ });
192
+ /** The rows the arrows walk: the open tab's, or every stacked group's. */
193
+ function walkable() {
194
+ let scope = handle.props.tabs ? scopes[tab] : scopes[0];
195
+ return scope ? scope.groups.flatMap((group) => group.entries) : [];
196
+ }
197
+ /** Re-renders, then scrolls the highlighted row into view inside the list. */
198
+ async function show() {
199
+ await handle.update();
200
+ let entry = walkable().find((candidate) => candidate.key === active);
201
+ if (!entry)
202
+ return;
203
+ document
204
+ .getElementById(entry.controlId)
205
+ ?.closest(`[data-slot="${FILTER_MENU_ROW_SLOT}"]`)
206
+ ?.scrollIntoView({ block: "nearest" });
207
+ }
208
+ /** Closes the popover holding the list, which submits a changed picker. */
209
+ async function close(root) {
210
+ await handle.update();
211
+ let popover = root.closest("[popover]");
212
+ if (popover?.matches(":popover-open"))
213
+ popover.hidePopover();
214
+ }
215
+ /** Follows, picks or toggles one row, as Enter on the highlighted row does. */
216
+ function choose(entry, root) {
217
+ let { mode } = handle.props;
218
+ if (mode === "navigate") {
219
+ document.getElementById(entry.controlId)?.click();
220
+ return;
221
+ }
222
+ if (mode === "single") {
223
+ selected = new Set([entry.item.value]);
224
+ void close(root);
225
+ return;
226
+ }
227
+ let control = document.getElementById(entry.controlId);
228
+ toggle(entry.item.value, control instanceof HTMLInputElement ? control : undefined);
229
+ }
230
+ /**
231
+ * Flips one checkbox's value in the picked set, sets its box at once, so a popover
232
+ * closed in the same moment submits the new value, and renders. A rendered checkbox holds
233
+ * its rendered `checked` until the next render, so the set says what a click meant.
234
+ */
235
+ function toggle(value, control) {
236
+ if (selected.has(value))
237
+ selected.delete(value);
238
+ else
239
+ selected.add(value);
240
+ if (control)
241
+ control.checked = selected.has(value);
242
+ void handle.update();
243
+ }
244
+ /** Moves the highlight `step` rows, wrapping at either end. */
245
+ function move(step) {
246
+ let rows = walkable();
247
+ if (rows.length === 0)
248
+ return;
249
+ let at = rows.findIndex((entry) => entry.key === active);
250
+ if (at === -1)
251
+ at = step > 0 ? -1 : 0;
252
+ active = rows[(at + step + rows.length) % rows.length]?.key;
253
+ void show();
254
+ }
255
+ return () => {
256
+ let { id, mode, name, groups, tabs, filterForm, searchable, labels } = handle.props;
257
+ if (groups !== preparedFrom) {
258
+ preparedFrom = groups;
259
+ prepared = prepare(groups, id);
260
+ selected = selectedValues(groups);
261
+ }
262
+ let limit = handle.props.limit ?? DEFAULT_LIMIT;
263
+ scopes = scopesFor(prepared, groups.map((group) => group.label), query, tabs === true, limit);
264
+ let inputId = `${id}-filter`;
265
+ let listId = `${id}-list`;
266
+ let picker = mode !== "navigate";
267
+ let activeEntry = walkable().find((entry) => entry.key === active);
268
+ let drawnValues = new Set(scopes.flatMap((scope) => scope.groups.flatMap((group) => group.entries.map((entry) => entry.item.value))));
269
+ let heldSelected = picker ? [...selected].filter((value) => !drawnValues.has(value)) : [];
270
+ return (_jsxs("div", { "data-slot": "filter-menu-list", mix: [
271
+ flexCol(),
272
+ minBs(0),
273
+ grow(),
274
+ picker ? submitOnClose() : null,
275
+ filterMenuKeys({
276
+ input: inputId,
277
+ onFilter(value) {
278
+ query = value;
279
+ scopes = scopesFor(prepared, handle.props.groups.map((group) => group.label), query, handle.props.tabs === true, handle.props.limit ?? DEFAULT_LIMIT);
280
+ active = walkable()[0]?.key;
281
+ void show();
282
+ },
283
+ onMove: move,
284
+ onChoose(host) {
285
+ let entry = walkable().find((candidate) => candidate.key === active);
286
+ if (entry)
287
+ choose(entry, host);
288
+ },
289
+ onClose(host) {
290
+ void close(host);
291
+ },
292
+ onTab(index) {
293
+ tab = index;
294
+ active = undefined;
295
+ void handle.update();
296
+ },
297
+ onPick(input, host) {
298
+ if (name === undefined || input.name !== name)
299
+ return;
300
+ if (mode !== "single") {
301
+ toggle(input.value, input);
302
+ return;
303
+ }
304
+ selected = new Set([input.value]);
305
+ void close(host);
306
+ },
307
+ onHover(key) {
308
+ if (key === active)
309
+ return;
310
+ active = key;
311
+ void handle.update();
312
+ },
313
+ }),
314
+ ], children: [_jsx("div", { "data-slot": "filter-menu-filter", hidden: !hydrated && !searchable, mix: [
315
+ p(2),
316
+ borderEdge("block-end", { width: 1, style: "solid", color: "neutral" }),
317
+ when("&[hidden]", hidden()),
318
+ ], children: _jsx(SearchField.Input, { id: inputId, name: searchable ? "q" : undefined, form: filterForm, defaultValue: query, autofocus: true, autocomplete: "off", "aria-label": labels.filter, "aria-autocomplete": "list", "aria-controls": listId, "aria-activedescendant": activeEntry?.controlId, placeholder: labels.filter }) }), tabs ? (_jsx(FilterMenuTabs, { id: id, groups: groups, tab: tab, filterForm: filterForm, label: labels.tabs ?? labels.title ?? labels.filter })) : null, _jsx("div", { id: listId, "data-slot": "filter-menu-items", mix: [
319
+ grow(),
320
+ minBs(0),
321
+ overflowY("auto"),
322
+ overscrollBehavior("contain"),
323
+ p(1),
324
+ maxBs("min(24rem, 60dvh)"),
325
+ ], children: scopes.map((scope) => (_jsx(FilterMenuScope, { scope: scope, id: id, mode: mode, name: name, selected: selected, active: active, stacked: !tabs && groups.length > 1, labels: labels }))) }), heldSelected.map((value) => (_jsx("input", { type: "hidden", name: name, value: value, "data-slot": "filter-menu-held" }))), picker && !hydrated ? (_jsx("div", { "data-slot": "filter-menu-actions", mix: [
326
+ p(2),
327
+ borderEdge("block-start", { width: 1, style: "solid", color: "neutral" }),
328
+ ], children: _jsx(Button, { type: "submit", size: "sm", color: "brand", "data-slot": "filter-menu-save", mix: [is("full")], children: labels.save }) })) : null] }));
329
+ };
330
+ });
331
+ /**
332
+ * The tab strip: one radio per group, styled as underlined tabs. The radios belong to the
333
+ * filter form, so a picker's post never carries them, and CSS alone shows the chosen tab's
334
+ * panel, so tabs switch without script.
335
+ *
336
+ * @param handle Runtime handle carrying the groups and the chosen tab.
337
+ * @returns The render function producing the strip.
338
+ */
339
+ function FilterMenuTabs(handle) {
340
+ return () => {
341
+ let { id, groups, tab, filterForm, label } = handle.props;
342
+ return (_jsx("div", { role: "radiogroup", "aria-label": label, "data-slot": "filter-menu-tabs", mix: [
343
+ flex(),
344
+ gap(1),
345
+ pi(2),
346
+ borderEdge("block-end", { width: 1, style: "solid", color: "neutral" }),
347
+ ], children: groups.map((group, g) => (_jsxs("label", { "data-slot": "filter-menu-tab", mix: [
348
+ relative(),
349
+ inlineFlex(),
350
+ items("center"),
351
+ minBs("2.25rem"),
352
+ pi(2),
353
+ text("sm"),
354
+ weight("medium"),
355
+ fg("neutral.muted"),
356
+ cursor("pointer"),
357
+ nowrap(),
358
+ hover(fg()),
359
+ when("&:has(input:checked)", [
360
+ fg(),
361
+ weight("semibold"),
362
+ before(raw({
363
+ content: '""',
364
+ position: "absolute",
365
+ insetInline: "0",
366
+ insetBlockEnd: "-1px",
367
+ blockSize: "2px",
368
+ borderRadius: "1px",
369
+ backgroundColor: "var(--ui-brand-bg-solid)",
370
+ })),
371
+ ]),
372
+ when("&:has(input:focus-visible)", [
373
+ rounded("md"),
374
+ outline({ color: "brand.ring", width: 2, offset: -2 }),
375
+ ]),
376
+ ], children: [_jsx("input", { type: "radio", name: `${id}-tab`, value: String(g), form: filterForm, checked: g === tab, "data-tab-index": String(g), mix: [visuallyHidden()] }), group.label] }))) }));
377
+ };
378
+ }
379
+ /**
380
+ * One panel of rows: a tab's group, or every group stacked under its heading, followed by
381
+ * "Nothing to show" when the filter matched nothing and by the count it held back past the limit.
382
+ *
383
+ * @param handle Runtime handle carrying the scope and the list's state.
384
+ * @returns The render function producing the panel.
385
+ */
386
+ function FilterMenuScope(handle) {
387
+ return () => {
388
+ let { scope, id, mode, name, selected, active, stacked, labels } = handle.props;
389
+ let held = scope.matched - scope.drawn;
390
+ let tabRule = scope.tab === null
391
+ ? null
392
+ : when(`[data-slot="filter-menu-list"]:has(input[data-tab-index="${scope.tab}"]:not(:checked)) &`, hidden());
393
+ return (_jsxs("div", { "data-slot": "filter-menu-scope", "data-tab": scope.tab ?? undefined, mix: [vstack({ gap: 0 }), tabRule], children: [scope.groups.map((group) => {
394
+ let headingId = `${id}-group-${group.index}`;
395
+ return (_jsxs("div", { role: "group", "aria-labelledby": stacked ? headingId : undefined, "aria-label": stacked ? undefined : group.label, "data-slot": "filter-menu-group", mix: [vstack({ gap: 0 })], children: [stacked ? (_jsx("p", { id: headingId, "data-slot": "filter-menu-group-label", mix: [
396
+ m(0),
397
+ pi(2),
398
+ pbs(2),
399
+ pb(1),
400
+ text("xs"),
401
+ weight("semibold"),
402
+ fg("neutral.muted"),
403
+ ], children: group.label })) : null, group.entries.map((entry) => (_jsx(FilterMenuRow, { entry: entry, mode: mode, name: name, checked: mode === "navigate"
404
+ ? entry.item.selected === true
405
+ : selected.has(entry.item.value), active: entry.key === active }, entry.key)))] }));
406
+ }), scope.matched === 0 ? (_jsx("p", { "data-slot": "filter-menu-empty", mix: [m(0), pi(2), pb(3), fg("neutral.muted")], children: labels.empty })) : null, held > 0 ? (_jsx("p", { "data-slot": "filter-menu-more", mix: [m(0), pi(2), pb(2), text("xs"), fg("neutral.muted")], children: labels.more.replace("{count}", held.toLocaleString()) })) : null] }));
407
+ };
408
+ }
409
+ /**
410
+ * One 32px row (44px under a coarse pointer): a link in `navigate` mode, else a label wrapping
411
+ * its radio or checkbox. The highlighted row takes a tinted fill and a 4px accent bar on its
412
+ * start edge; a link to the current page and a picked radio show a check.
413
+ *
414
+ * @param handle Runtime handle carrying the entry and its state.
415
+ * @returns The render function producing the row.
416
+ */
417
+ function FilterMenuRow(handle) {
418
+ return () => {
419
+ let { entry, mode, name, checked, active } = handle.props;
420
+ let { item } = entry;
421
+ let rowMix = [
422
+ relative(),
423
+ flex(),
424
+ items("center"),
425
+ gap(2),
426
+ is("full"),
427
+ minBs("2rem"),
428
+ pi(2),
429
+ pb(1),
430
+ rounded("md"),
431
+ fg("neutral.emphasis"),
432
+ textDecoration("none"),
433
+ cursor("pointer"),
434
+ raw({ boxSizing: "border-box", "@media (pointer: coarse)": { minBlockSize: "2.75rem" } }),
435
+ hover(bg("neutral.bg-tint-hover")),
436
+ when("&[data-active]", [
437
+ bg("neutral.bg-tint-hover"),
438
+ before(raw({
439
+ content: '""',
440
+ position: "absolute",
441
+ insetInlineStart: "0",
442
+ insetBlock: "0.375rem",
443
+ inlineSize: "4px",
444
+ borderRadius: "2px",
445
+ backgroundColor: "var(--ui-brand-bg-solid)",
446
+ })),
447
+ ]),
448
+ focusVisible(outline({ color: "brand.ring", width: 2, offset: -2 })),
449
+ when("&:has(input:focus-visible)", outline({ color: "brand.ring", width: 2, offset: -2 })),
450
+ ];
451
+ let body = _jsx(FilterMenuRowBody, { item: item });
452
+ if (mode === "navigate") {
453
+ return (_jsxs("a", { id: entry.controlId, href: item.href, "data-slot": FILTER_MENU_ROW_SLOT, "data-key": entry.key, "data-active": active ? "" : undefined, "aria-current": checked ? "true" : undefined, mix: rowMix, children: [_jsx(FilterMenuCheck, { shown: checked }), body] }));
454
+ }
455
+ return (_jsxs("label", { "data-slot": FILTER_MENU_ROW_SLOT, "data-key": entry.key, "data-active": active ? "" : undefined, mix: rowMix, children: [mode === "single" ? (_jsxs(_Fragment, { children: [_jsx("input", { type: "radio", id: entry.controlId, name: name, value: item.value, checked: checked, mix: [visuallyHidden()] }), _jsx(FilterMenuCheck, { shown: checked })] })) : (_jsx("input", { type: "checkbox", id: entry.controlId, name: name, value: item.value, checked: checked, mix: [m(0), is("1rem"), bs("1rem"), shrink(0), accent("brand"), cursor("pointer")] })), body] }));
456
+ };
457
+ }
458
+ /**
459
+ * The check a current link or picked radio shows, in a fixed 16px slot, so labels line up
460
+ * down the list whether or not their row is the chosen one.
461
+ *
462
+ * @param handle Runtime handle carrying whether the check shows.
463
+ * @returns The render function producing the slot.
464
+ */
465
+ function FilterMenuCheck(handle) {
466
+ return () => (_jsx("span", { "aria-hidden": "true", "data-slot": "filter-menu-check", mix: [inlineFlex(), shrink(0), is("1rem"), bs("1rem"), fg("brand")], children: handle.props.shown ? _jsx(CheckIcon, { size: 16 }) : null }));
467
+ }
468
+ /**
469
+ * The row's text: the label (as a colour-dot `LabelChip` when the item has a colour) and its
470
+ * badge on one line, and the description muted under it.
471
+ *
472
+ * @param handle Runtime handle carrying the item.
473
+ * @returns The render function producing the text.
474
+ */
475
+ function FilterMenuRowBody(handle) {
476
+ return () => {
477
+ let { item } = handle.props;
478
+ return (_jsxs("span", { mix: [vstack({ gap: 0 }), grow(), minIs(0)], children: [_jsxs("span", { mix: [flex(), items("center"), justify("between"), gap(2), minIs(0)], children: [item.color ? (_jsx(LabelChip, { variant: "dot", color: item.color, mix: [minIs(0)], children: item.label })) : (_jsx("span", { mix: [truncate(), leading("1.25rem")], children: item.label })), item.badge ? (_jsx(Badge, { variant: "outline", mix: [shrink(0)], children: item.badge })) : null] }), item.description ? (_jsx("span", { mix: [text("xs"), fg("neutral.muted"), truncate()], children: item.description })) : null] }));
479
+ };
480
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * A Gantt chart: grouped rows of projects, each a name in a sticky list beside a bar on a shared
3
+ * time axis, with months and weeks across the top and today's line through every row. A bar
4
+ * fills with its progress and runs a hatched tail past its target when it is projected late.
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 Gantt}, {@link Gantt.Group} and {@link Gantt.Item}. */
11
+ export declare namespace Gantt {
12
+ /** Every string the chart shows or announces; `{…}` marks where a value goes. */
13
+ interface Labels {
14
+ /** The today marker's name, such as "Today". */
15
+ today: string;
16
+ /** A bar's dates, such as "{start} to {end}". */
17
+ schedule: string;
18
+ /** A bar's progress, such as "{percent} complete". */
19
+ progress: string;
20
+ /** A late bar's projection, such as "projected to finish {date}". */
21
+ projected: string;
22
+ /** What an item without dates says on the axis, such as "No dates". */
23
+ unscheduled: string;
24
+ }
25
+ /** Props accepted by {@link Gantt}. */
26
+ interface Props extends Omit<TagProps<"div">, "children"> {
27
+ /** The chart's accessible name. */
28
+ label: string;
29
+ /** The first day on the axis, as `YYYY-MM-DD`. */
30
+ start: string;
31
+ /** The last day on the axis, as `YYYY-MM-DD`. */
32
+ end: string;
33
+ /** Today, as `YYYY-MM-DD`; draws the line when it falls on the axis. */
34
+ today?: string;
35
+ /** Formats the month and day labels. @default "en" */
36
+ locale?: string;
37
+ /** The list column's heading row, such as Active and Closed tabs. */
38
+ header?: RemixNode;
39
+ labels: Labels;
40
+ /** {@link Gantt.Group}s, in order. */
41
+ children: RemixNode;
42
+ }
43
+ /** Context the chart hands its groups and items. */
44
+ interface Context {
45
+ start: number;
46
+ end: number;
47
+ locale: string;
48
+ labels: Labels;
49
+ }
50
+ /** Props accepted by {@link Gantt.Group}. */
51
+ interface GroupProps extends Omit<TagProps<"section">, "title" | "children"> {
52
+ /** The group's name, such as a quarter. */
53
+ title: RemixNode;
54
+ /** Controls at the group header's end, such as an "Add project" link. */
55
+ actions?: RemixNode;
56
+ /** {@link Gantt.Item}s. */
57
+ children?: RemixNode;
58
+ }
59
+ /** Props accepted by {@link Gantt.Item}. */
60
+ interface ItemProps extends Omit<TagProps<"li">, "children"> {
61
+ name: string;
62
+ /** The project's page; the name in the list and on the bar both link to it. */
63
+ href?: string;
64
+ /** A 16px glyph before the name, in the list and on the bar. */
65
+ icon?: RemixNode;
66
+ /** Trailing details in the list row, such as the lead's avatar and a status. */
67
+ meta?: RemixNode;
68
+ /** The first day, as `YYYY-MM-DD`; an item without `start` and `end` has no bar. */
69
+ start?: string;
70
+ /** The target day, as `YYYY-MM-DD`. */
71
+ end?: string;
72
+ /** How much is done, from 0 to 1, drawn as the bar's fill. */
73
+ progress?: number;
74
+ /** The day the work is projected to finish; past `end`, a hatched tail runs to it. */
75
+ projectedEnd?: string;
76
+ /** Drawn after the name on the bar, such as a burn-up sparkline. */
77
+ trailing?: RemixNode;
78
+ }
79
+ }
80
+ /**
81
+ * Client island: an invisible marker that scrolls the chart to today once it is laid out,
82
+ * so a narrow screen opens on the present. Loads from `@sdxc/ui/app/gantt#GanttToday`.
83
+ */
84
+ export declare const GanttToday: EntryComponent<Record<never, never>>;
85
+ /**
86
+ * Days from the epoch to a `YYYY-MM-DD` date, read as UTC so a time zone never shifts a bar.
87
+ *
88
+ * @param date The date.
89
+ * @returns Whole days since 1970-01-01.
90
+ */
91
+ export declare function ganttDay(date: string): number;
92
+ /**
93
+ * Renders the chart inside its own scrolling box: the list column stays put while the axis
94
+ * scrolls sideways, and the axis row stays put while the rows scroll. Size the box from
95
+ * outside (a block size, or a flex parent) for the rows to scroll inside it.
96
+ *
97
+ * @example
98
+ * <Gantt label="Gantt" start="2026-09-01" end="2027-03-31" today="2026-11-12" labels={labels}>
99
+ * <Gantt.Group title="Q4 2026">
100
+ * <Gantt.Item name="Checkout v2" href="/projects/checkout" start="2026-10-01" end="2026-12-15" progress={0.6} />
101
+ * </Gantt.Group>
102
+ * </Gantt>
103
+ */
104
+ export declare function Gantt(handle: Handle<Gantt.Props, Gantt.Context>): () => import("remix/component").RemixElement;
105
+ export declare namespace Gantt {
106
+ var Group: (handle: Handle<Gantt.GroupProps>) => () => import("remix/component").RemixElement;
107
+ var Item: (handle: Handle<Gantt.ItemProps>) => () => import("remix/component").RemixElement;
108
+ }