@sdxc/ui 2026.11.1 → 2026.11.3

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 (190) hide show
  1. package/README.md +1 -1
  2. package/dist/app/app-shell-toggle.d.ts +31 -0
  3. package/dist/app/app-shell-toggle.js +43 -0
  4. package/dist/app/app-shell.d.ts +131 -0
  5. package/dist/app/app-shell.js +542 -0
  6. package/dist/app/auto-refresh.d.ts +104 -0
  7. package/dist/app/auto-refresh.js +126 -0
  8. package/dist/app/behaviors/refresh-schedule.d.ts +53 -0
  9. package/dist/app/behaviors/refresh-schedule.js +95 -0
  10. package/dist/app/behaviors/shortcuts.d.ts +175 -0
  11. package/dist/app/behaviors/shortcuts.js +401 -0
  12. package/dist/app/behaviors/toaster.d.ts +31 -2
  13. package/dist/app/behaviors/toaster.js +62 -5
  14. package/dist/app/chart.d.ts +62 -8
  15. package/dist/app/chart.js +207 -9
  16. package/dist/app/command-palette.d.ts +132 -0
  17. package/dist/app/command-palette.js +181 -0
  18. package/dist/app/danger-zone.d.ts +66 -0
  19. package/dist/app/danger-zone.js +66 -0
  20. package/dist/app/detail-sheet.d.ts +119 -0
  21. package/dist/app/detail-sheet.js +173 -0
  22. package/dist/app/drop-zone.d.ts +2 -1
  23. package/dist/app/drop-zone.js +6 -3
  24. package/dist/app/editor-layout.d.ts +69 -0
  25. package/dist/app/editor-layout.js +143 -0
  26. package/dist/app/empty.d.ts +56 -19
  27. package/dist/app/empty.js +129 -22
  28. package/dist/app/filter-bar.d.ts +169 -0
  29. package/dist/app/filter-bar.js +346 -0
  30. package/dist/app/index.d.ts +51 -0
  31. package/dist/app/index.js +51 -0
  32. package/dist/app/keyboard-help.d.ts +66 -0
  33. package/dist/app/keyboard-help.js +56 -0
  34. package/dist/app/mixins/app-shell-controls.d.ts +46 -0
  35. package/dist/app/mixins/app-shell-controls.js +131 -0
  36. package/dist/app/mixins/auto-refresh.d.ts +29 -0
  37. package/dist/app/mixins/auto-refresh.js +66 -0
  38. package/dist/app/mixins/command-palette.d.ts +56 -0
  39. package/dist/app/mixins/command-palette.js +297 -0
  40. package/dist/app/mixins/copy-permalink.d.ts +26 -0
  41. package/dist/app/mixins/copy-permalink.js +54 -0
  42. package/dist/app/mixins/detail-sheet-keys.d.ts +28 -0
  43. package/dist/app/mixins/detail-sheet-keys.js +88 -0
  44. package/dist/app/mixins/escape-link.d.ts +17 -0
  45. package/dist/app/mixins/escape-link.js +35 -0
  46. package/dist/app/mixins/keyboard-help.d.ts +38 -0
  47. package/dist/app/mixins/keyboard-help.js +51 -0
  48. package/dist/app/mixins/optimistic-toggle-sync.d.ts +80 -0
  49. package/dist/app/mixins/optimistic-toggle-sync.js +153 -0
  50. package/dist/app/mixins/range-picker-keys.d.ts +18 -0
  51. package/dist/app/mixins/range-picker-keys.js +94 -0
  52. package/dist/app/mixins/row-navigation.d.ts +85 -0
  53. package/dist/app/mixins/row-navigation.js +208 -0
  54. package/dist/app/mixins/save-bar-sync.d.ts +27 -0
  55. package/dist/app/mixins/save-bar-sync.js +106 -0
  56. package/dist/app/mixins/save-shortcut.d.ts +47 -0
  57. package/dist/app/mixins/save-shortcut.js +101 -0
  58. package/dist/app/mixins/save-status-sync.d.ts +77 -0
  59. package/dist/app/mixins/save-status-sync.js +159 -0
  60. package/dist/app/mixins/selection-bar-sync.d.ts +32 -0
  61. package/dist/app/mixins/selection-bar-sync.js +151 -0
  62. package/dist/app/mixins/split-view.d.ts +66 -0
  63. package/dist/app/mixins/split-view.js +319 -0
  64. package/dist/app/mixins/status-strip-keys.d.ts +17 -0
  65. package/dist/app/mixins/status-strip-keys.js +79 -0
  66. package/dist/app/mixins/submit-on-change.d.ts +16 -0
  67. package/dist/app/mixins/submit-on-change.js +28 -0
  68. package/dist/app/mixins/table-selection.d.ts +39 -0
  69. package/dist/app/mixins/table-selection.js +272 -0
  70. package/dist/app/mixins/toast-queue.d.ts +36 -0
  71. package/dist/app/mixins/toast-queue.js +77 -0
  72. package/dist/app/mixins/toast-stack.d.ts +20 -0
  73. package/dist/app/mixins/toast-stack.js +55 -0
  74. package/dist/app/optimistic-toggle.d.ts +48 -0
  75. package/dist/app/optimistic-toggle.js +38 -0
  76. package/dist/app/page-header.d.ts +71 -0
  77. package/dist/app/page-header.js +249 -0
  78. package/dist/app/range-picker.d.ts +102 -0
  79. package/dist/app/range-picker.js +118 -0
  80. package/dist/app/save-bar.d.ts +54 -0
  81. package/dist/app/save-bar.js +64 -0
  82. package/dist/app/save-status.d.ts +50 -0
  83. package/dist/app/save-status.js +54 -0
  84. package/dist/app/selection-bar.d.ts +101 -0
  85. package/dist/app/selection-bar.js +157 -0
  86. package/dist/app/settings-layout.d.ts +70 -0
  87. package/dist/app/settings-layout.js +112 -0
  88. package/dist/app/settings-section.d.ts +140 -0
  89. package/dist/app/settings-section.js +182 -0
  90. package/dist/app/skeleton.d.ts +47 -4
  91. package/dist/app/skeleton.js +149 -2
  92. package/dist/app/sparkline.d.ts +61 -0
  93. package/dist/app/sparkline.js +145 -0
  94. package/dist/app/split-view.d.ts +154 -0
  95. package/dist/app/split-view.js +272 -0
  96. package/dist/app/stat-card.d.ts +109 -0
  97. package/dist/app/stat-card.js +379 -0
  98. package/dist/app/status-strip.d.ts +70 -0
  99. package/dist/app/status-strip.js +155 -0
  100. package/dist/app/styles/action-row.d.ts +41 -0
  101. package/dist/app/styles/action-row.js +59 -0
  102. package/dist/app/styles/stat-delta.d.ts +29 -0
  103. package/dist/app/styles/stat-delta.js +36 -0
  104. package/dist/app/styles/toast-stack.d.ts +21 -0
  105. package/dist/app/styles/toast-stack.js +54 -0
  106. package/dist/app/table.d.ts +199 -24
  107. package/dist/app/table.js +640 -36
  108. package/dist/app/toast.d.ts +105 -5
  109. package/dist/app/toast.js +89 -17
  110. package/dist/app/toasts.d.ts +49 -0
  111. package/dist/app/toasts.js +103 -0
  112. package/dist/app/utils/app-shell-cookie.d.ts +21 -0
  113. package/dist/app/utils/app-shell-cookie.js +33 -0
  114. package/dist/app/utils/chart-marker-indices.d.ts +9 -5
  115. package/dist/app/utils/chart-marker-indices.js +9 -8
  116. package/dist/app/utils/chart-path.d.ts +14 -10
  117. package/dist/app/utils/chart-path.js +46 -18
  118. package/dist/app/utils/edited-time.d.ts +19 -0
  119. package/dist/app/utils/edited-time.js +35 -0
  120. package/dist/app/utils/key-target.d.ts +23 -0
  121. package/dist/app/utils/key-target.js +48 -0
  122. package/dist/app/utils/search-params.d.ts +69 -0
  123. package/dist/app/utils/search-params.js +132 -0
  124. package/dist/app/utils/shortcut-groups.d.ts +21 -0
  125. package/dist/app/utils/shortcut-groups.js +53 -0
  126. package/dist/app/utils/split-view-layout.d.ts +48 -0
  127. package/dist/app/utils/split-view-layout.js +71 -0
  128. package/dist/app/view-options.d.ts +99 -0
  129. package/dist/app/view-options.js +182 -0
  130. package/dist/components/banner.d.ts +61 -0
  131. package/dist/components/banner.js +101 -0
  132. package/dist/components/confirm.d.ts +54 -5
  133. package/dist/components/confirm.js +44 -5
  134. package/dist/components/group.d.ts +14 -0
  135. package/dist/components/group.js +66 -11
  136. package/dist/components/index.d.ts +5 -0
  137. package/dist/components/index.js +5 -0
  138. package/dist/components/input.js +9 -3
  139. package/dist/components/link-button.js +8 -2
  140. package/dist/components/property-list.d.ts +76 -0
  141. package/dist/components/property-list.js +175 -0
  142. package/dist/components/relative-time.d.ts +72 -0
  143. package/dist/components/relative-time.js +45 -0
  144. package/dist/components/status-dot.d.ts +62 -0
  145. package/dist/components/status-dot.js +99 -0
  146. package/dist/components/text-field.d.ts +17 -2
  147. package/dist/components/text-field.js +13 -4
  148. package/dist/components/timeline.d.ts +67 -0
  149. package/dist/components/timeline.js +159 -0
  150. package/dist/components/typeset.d.ts +2 -1
  151. package/dist/components/typeset.js +4 -1
  152. package/dist/docs/code-tabs-sync.d.ts +1 -1
  153. package/dist/docs/code-tabs-sync.js +2 -2
  154. package/dist/docs/copy-button.d.ts +1 -1
  155. package/dist/docs/copy-button.js +2 -2
  156. package/dist/docs/docs-feedback.d.ts +12 -0
  157. package/dist/docs/docs-feedback.js +4 -2
  158. package/dist/docs/docs-hub.js +4 -4
  159. package/dist/docs/docs-layout.d.ts +1 -1
  160. package/dist/docs/docs-layout.js +1 -1
  161. package/dist/docs/docs-nav-tools.d.ts +1 -1
  162. package/dist/docs/docs-nav-tools.js +2 -2
  163. package/dist/docs/docs-nav.d.ts +6 -2
  164. package/dist/docs/docs-nav.js +2 -2
  165. package/dist/docs/docs-pager.d.ts +5 -1
  166. package/dist/docs/docs-pager.js +7 -6
  167. package/dist/docs/mixins/docs-nav-tools.d.ts +2 -2
  168. package/dist/docs/mixins/docs-nav-tools.js +32 -5
  169. package/dist/docs/next-steps.js +3 -2
  170. package/dist/docs/page-actions.d.ts +1 -1
  171. package/dist/docs/page-actions.js +2 -2
  172. package/dist/docs/table-of-contents.d.ts +1 -1
  173. package/dist/docs/table-of-contents.js +2 -2
  174. package/dist/mixins/confirm-phrase.d.ts +19 -0
  175. package/dist/mixins/confirm-phrase.js +56 -0
  176. package/dist/mixins/index.d.ts +2 -0
  177. package/dist/mixins/index.js +2 -0
  178. package/dist/mixins/viewer-time.d.ts +20 -0
  179. package/dist/mixins/viewer-time.js +40 -0
  180. package/dist/styles/index.d.ts +1 -0
  181. package/dist/styles/index.js +1 -0
  182. package/dist/styles/segmented-control.d.ts +49 -0
  183. package/dist/styles/segmented-control.js +71 -0
  184. package/dist/test/table.d.ts +65 -0
  185. package/dist/test/table.js +108 -0
  186. package/dist/utils/index.d.ts +1 -0
  187. package/dist/utils/index.js +1 -0
  188. package/dist/utils/relative-time.d.ts +44 -0
  189. package/dist/utils/relative-time.js +69 -0
  190. package/package.json +6 -6
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The placement every settings-style action row shares: a button that acts at once sits at
3
+ * the row's end centred on the title's first line, or under the text at its start, and a
4
+ * narrow container always stacks it under the text.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { raw } from "@sdxc/u/general";
10
+ import { text } from "@sdxc/u/typography";
11
+ /** Container width from which an end-placed action leaves the stack for the row's end. */
12
+ const ACTION_ROW_MIN = "32rem";
13
+ /**
14
+ * Lays out an action row as a grid of its text block and its control: one column with the
15
+ * control under the text at its start, and for `"end"` on a container at least 32rem wide,
16
+ * the text taking the flexible width and the control its own at the end.
17
+ *
18
+ * @param containerName The container query name the row measures.
19
+ * @param placement Where the control sits on a wide container.
20
+ * @param gap The grid's row and column gap.
21
+ * @returns A mixin for the row's grid element.
22
+ * @example
23
+ * <div mix={[actionRowGrid("ui-settings-card", "end", "0.5rem 1.5rem")]}>{text}{control}</div>
24
+ */
25
+ export function actionRowGrid(containerName, placement, gap) {
26
+ return raw({
27
+ display: "grid",
28
+ gap,
29
+ alignItems: "start",
30
+ justifyItems: "start",
31
+ gridTemplateColumns: "minmax(0, 1fr)",
32
+ ...(placement === "end"
33
+ ? {
34
+ [`@container ${containerName} (min-width: ${ACTION_ROW_MIN})`]: {
35
+ gridTemplateColumns: "minmax(0, 1fr) auto",
36
+ },
37
+ }
38
+ : {}),
39
+ });
40
+ }
41
+ /**
42
+ * Centres an end-placed control on the title's first line: on a wide container the
43
+ * control's box is one small-text line tall and the button overflows it evenly into the
44
+ * row's padding. Below 32rem the box wraps the control as stacked content.
45
+ *
46
+ * @param containerName The container query name the row measures.
47
+ * @returns The mixins for the element wrapping the row's control.
48
+ * @example
49
+ * <div mix={[onTitleLine("ui-settings-card")]}><Button>Open billing portal</Button></div>
50
+ */
51
+ export function onTitleLine(containerName) {
52
+ let styles = {};
53
+ styles[`@container ${containerName} (min-width: ${ACTION_ROW_MIN})`] = {
54
+ display: "flex",
55
+ alignItems: "center",
56
+ blockSize: "1lh",
57
+ };
58
+ return [text("sm"), raw(styles)];
59
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Where a stat's delta sits as the group around it changes layout, shared by the delta and
3
+ * every placeholder standing in for it, so a loading card moves its delta by the same
4
+ * container queries the resolved card does and keeps the card's height.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { ElementProps, MixinDescriptor } from "remix/component";
10
+ import type { CSSStyles } from "../../utils/css-styles.js";
11
+ /** Container a stat group measures, so its columns follow the pane it sits in. */
12
+ export declare const STAT_GROUP_CONTAINER = "ui-stat-group";
13
+ /**
14
+ * A group from 18rem up to 28rem wide: two columns of compact cards, so a phone shows four
15
+ * stats in two rows. Narrower than 18rem, a group keeps one column of full-size cards.
16
+ */
17
+ export declare const STAT_COMPACT = "@container ui-stat-group (min-width: 18rem) and (max-width: 27.9375rem)";
18
+ /**
19
+ * Places the delta at the end of the label's line in a card, and on its own line under the
20
+ * value in ruled columns, tabs and compact cards, where its comparison wraps under the pill
21
+ * before it overflows.
22
+ *
23
+ * @returns A mixin for the delta's host element.
24
+ * @example
25
+ * <span mix={[statDeltaPlacement()]}>{pill}{comparison}</span>
26
+ */
27
+ export declare function statDeltaPlacement<Node extends Element = Element>(): MixinDescriptor<Node, [
28
+ styles: CSSStyles
29
+ ], ElementProps>;
@@ -0,0 +1,36 @@
1
+ import { raw } from "@sdxc/u/general";
2
+ /** Container a stat group measures, so its columns follow the pane it sits in. */
3
+ export const STAT_GROUP_CONTAINER = "ui-stat-group";
4
+ /**
5
+ * A group from 18rem up to 28rem wide: two columns of compact cards, so a phone shows four
6
+ * stats in two rows. Narrower than 18rem, a group keeps one column of full-size cards.
7
+ */
8
+ export const STAT_COMPACT = `@container ${STAT_GROUP_CONTAINER} (min-width: 18rem) and (max-width: 27.9375rem)`;
9
+ /**
10
+ * Places the delta at the end of the label's line in a card, and on its own line under the
11
+ * value in ruled columns, tabs and compact cards, where its comparison wraps under the pill
12
+ * before it overflows.
13
+ *
14
+ * @returns A mixin for the delta's host element.
15
+ * @example
16
+ * <span mix={[statDeltaPlacement()]}>{pill}{comparison}</span>
17
+ */
18
+ export function statDeltaPlacement() {
19
+ return raw({
20
+ order: 1,
21
+ justifySelf: "end",
22
+ '[data-stat-group="ruled"] > * > &, [data-stat-group="tabs"] > * > &': {
23
+ order: 3,
24
+ gridColumn: "1 / -1",
25
+ justifySelf: "start",
26
+ },
27
+ [STAT_COMPACT]: {
28
+ "[data-stat-split] > * > &": {
29
+ order: 3,
30
+ gridColumn: "1 / -1",
31
+ justifySelf: "start",
32
+ flexWrap: "wrap",
33
+ },
34
+ },
35
+ });
36
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The peek stack a toast region draws: older toasts fold behind the newest,
3
+ * scaled to 0.95 and 0.9 and nudged out by `--ui-toast-peek`, then fan out
4
+ * into a list while the pointer or focus rests on the region.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { ElementProps, MixinDescriptor } from "remix/component";
10
+ import type { CSSStyles } from "../../utils/css-styles.js";
11
+ /**
12
+ * Styles a toast region's children as a capped peek stack. The newest toast
13
+ * is the last child; children past `max` from the end take no space, and
14
+ * folded toasts match the front one's height through `--ui-toast-front-size`.
15
+ *
16
+ * @param max Most toasts shown at once.
17
+ * @returns A mixin ready for the region element's `mix` prop.
18
+ * @example
19
+ * <div data-stack="peek" data-placement="bottom-end" mix={[toastStackStyle(3)]}>{toasts}</div>
20
+ */
21
+ export declare function toastStackStyle<Node extends Element = Element>(max: number): MixinDescriptor<Node, [styles: CSSStyles], ElementProps>;
@@ -0,0 +1,54 @@
1
+ import { combine, raw } from "@sdxc/u/general";
2
+ import { media } from "@sdxc/u/responsive";
3
+ import { when } from "@sdxc/u/state";
4
+ /** Selector for a peek region at rest; hover or focus inside fans it out. */
5
+ const COLLAPSED = '&[data-stack="peek"]:not(:hover, :focus-within)';
6
+ /** Distance each folded toast peeks past the one in front of it. */
7
+ const PEEK = "var(--ui-toast-peek, 0.625rem)";
8
+ /**
9
+ * Styles a toast region's children as a capped peek stack. The newest toast
10
+ * is the last child; children past `max` from the end take no space, and
11
+ * folded toasts match the front one's height through `--ui-toast-front-size`.
12
+ *
13
+ * @param max Most toasts shown at once.
14
+ * @returns A mixin ready for the region element's `mix` prop.
15
+ * @example
16
+ * <div data-stack="peek" data-placement="bottom-end" mix={[toastStackStyle(3)]}>{toasts}</div>
17
+ */
18
+ export function toastStackStyle(max) {
19
+ let cap = Math.max(1, Math.floor(max));
20
+ let folded = `${COLLAPSED} > :not(:last-child)`;
21
+ return combine([
22
+ raw({
23
+ "--ui-toast-peek-direction": "-1",
24
+ "--ui-toast-peek-origin": "center top",
25
+ }),
26
+ when('&[data-placement^="top"]', raw({
27
+ "--ui-toast-peek-direction": "1",
28
+ "--ui-toast-peek-origin": "center bottom",
29
+ flexDirection: "column-reverse",
30
+ })),
31
+ when("&:hover, &:focus-within", raw({ pointerEvents: "auto" })),
32
+ when(`& > :nth-last-child(n + ${cap + 1})`, raw({ display: "none" })),
33
+ when(COLLAPSED, raw({ display: "grid" })),
34
+ when(`${COLLAPSED} > *`, raw({ gridArea: "1 / 1", alignSelf: "end" })),
35
+ when(`${COLLAPSED}[data-placement^="top"] > *`, raw({ alignSelf: "start" })),
36
+ when(folded, raw({
37
+ blockSize: "var(--ui-toast-front-size, auto)",
38
+ overflow: "hidden",
39
+ transformOrigin: "var(--ui-toast-peek-origin)",
40
+ })),
41
+ when(`${folded} > [data-slot="toast"]`, raw({ blockSize: "100%" })),
42
+ when(`${folded}[data-slot="toast"] > *, ${folded} [data-slot="toast"] > *`, raw({ opacity: "0" })),
43
+ when(`${COLLAPSED} > :nth-last-child(2)`, raw({
44
+ transform: `translateY(calc(${PEEK} * var(--ui-toast-peek-direction))) scale(0.95)`,
45
+ })),
46
+ when(`${COLLAPSED} > :nth-last-child(n + 3)`, raw({
47
+ transform: `translateY(calc(${PEEK} * 2 * var(--ui-toast-peek-direction))) scale(0.9)`,
48
+ })),
49
+ media("(prefers-reduced-motion: no-preference)", combine([
50
+ when("& > *", raw({ transition: "transform 200ms ease-out" })),
51
+ when('& [data-slot="toast"] > *', raw({ transition: "opacity 200ms ease-out" })),
52
+ ])),
53
+ ]);
54
+ }
@@ -1,14 +1,22 @@
1
1
  /**
2
- * A tabular data display built on the native `<table>` element, with column
3
- * headers that become sort links and a trailing row that becomes a
4
- * "load more" link — both driven entirely by URLs a consumer computes, so the
5
- * sorted or paginated result renders back from the server with no client
6
- * state to track.
2
+ * A tabular data display built on the native `<table>`: URL-driven sort headers and a
3
+ * "load more" row, a sticky header, two row densities, a selection column, one-line row actions
4
+ * that fold into a menu, a whole-row link, a pinned first column, typed cells and states.
7
5
  *
8
6
  * @author [Sergio Xalambrí](https://sergiodxa.com)
9
7
  * @copyright Sergio Xalambrí 2026
10
8
  */
11
- import type { Handle, Props as TagProps, RemixNode } from "remix/component";
9
+ import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
10
+ import type { SemanticColor } from "../utils/semantic-color.js";
11
+ import { Menu } from "../components/menu.js";
12
+ import type { RowNavigation } from "./mixins/row-navigation.js";
13
+ /**
14
+ * What {@link Table} shares with its parts: the id of the actions column's name, which each
15
+ * row's ⋯ button takes as its own name when the row gives none.
16
+ */
17
+ interface TableContext {
18
+ actionsLabelId: string;
19
+ }
12
20
  /**
13
21
  * Prop types for {@link Table} and its compound parts.
14
22
  */
@@ -25,10 +33,20 @@ export declare namespace Table {
25
33
  * set renders the column as sortable but not the active sort key.
26
34
  */
27
35
  type SortDirection = "ascending" | "descending";
36
+ /** Row height: `compact` is 2.5rem for scanning, `comfortable` 3.5rem for two-line rows. */
37
+ type Density = "compact" | "comfortable";
28
38
  /**
29
- * Every native `<table>` attribute, unchanged, plus the `mix` passthrough.
39
+ * Every native `<table>` attribute plus layout switches. Set `aria-busy="true"` while
40
+ * refetching: the body dims in place so the old rows stay readable until new ones land.
30
41
  */
31
42
  interface Props extends TagProps<"table"> {
43
+ /** Row height, exposed as `data-density` and `--ui-table-row-block-size`. */
44
+ density?: Density;
45
+ /**
46
+ * Keeps the first column in view while the table scrolls sideways in its container,
47
+ * with an edge shadow that appears once anything has scrolled beneath it.
48
+ */
49
+ pinFirstColumn?: boolean;
32
50
  }
33
51
  /**
34
52
  * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.
@@ -78,8 +96,8 @@ export declare namespace Table {
78
96
  }
79
97
  /**
80
98
  * Every native `<tr>` attribute, unchanged, plus the `mix` passthrough.
81
- * Set `aria-selected="true"` directly to mark a row selected — the row's
82
- * own selection tint rides that native attribute.
99
+ * A row whose selection checkbox is checked, or that carries `aria-selected="true"`,
100
+ * is tinted as selected.
83
101
  */
84
102
  interface RowProps extends TagProps<"tr"> {
85
103
  }
@@ -93,6 +111,142 @@ export declare namespace Table {
93
111
  */
94
112
  numeric?: boolean;
95
113
  }
114
+ /**
115
+ * Props accepted by {@link Table.Keys}: the row-navigation options a server can send, so
116
+ * everything but the announcer, which lives in the browser.
117
+ */
118
+ type KeysProps = Omit<RowNavigation.Options, "announcer" | "within">;
119
+ /** Header cell for the selection column. */
120
+ interface SelectAllProps extends Omit<TagProps<"th">, "children"> {
121
+ /** Accessible name of the select-all checkbox, such as "Select all monitors". */
122
+ label: string;
123
+ /** Whether every row starts selected. */
124
+ checked?: boolean;
125
+ }
126
+ /** Body cell holding one row's selection checkbox. */
127
+ interface SelectProps extends Omit<TagProps<"td">, "children"> {
128
+ /** The row's key, submitted as the checkbox's value. */
129
+ value: string;
130
+ /** Accessible name, such as "Select api.example.com". */
131
+ label: string;
132
+ /** Field name the checked keys submit under. */
133
+ name?: string;
134
+ /** Id of a `<form>` elsewhere on the page the checkbox submits with, such as a bulk-action form. */
135
+ form?: string;
136
+ /** Whether the row starts selected. */
137
+ checked?: boolean;
138
+ /** Keeps the row out of the selection and out of select-all. */
139
+ disabled?: boolean;
140
+ }
141
+ /** Header cell over the row actions, holding a visually hidden name for the column. */
142
+ interface ActionsColumnProps extends Omit<TagProps<"th">, "children"> {
143
+ /** The column's name for assistive technology, such as "Actions". */
144
+ label: string;
145
+ }
146
+ /**
147
+ * Body cell holding a row's actions. Put the one most used action first and any
148
+ * destructive one last.
149
+ */
150
+ interface ActionsProps extends TagProps<"td"> {
151
+ /**
152
+ * Name of the menu button that stands in for the actions in a narrow table, such as
153
+ * "More actions", which then lists {@link Table.Action} children as menu rows. Without
154
+ * it, the button takes {@link Table.ActionsColumn}'s `label` and opens the actions as they are.
155
+ */
156
+ overflowLabel?: string;
157
+ }
158
+ /**
159
+ * One row action: a link when `href` is set, else a `<button>`, drawn as a small ghost
160
+ * button in the row and as a menu row in the overflow menu. `danger` tones it for a
161
+ * destructive action.
162
+ */
163
+ interface ActionProps extends Menu.ItemProps {
164
+ }
165
+ /** A link that makes its whole row the target; every other control in the row keeps its own click. */
166
+ type RowLinkProps = TagProps<"a"> & {
167
+ /** The record's page. */
168
+ href: string;
169
+ };
170
+ /** Shared props of the typed cells: every native `<td>` attribute but children. */
171
+ interface TypedCellProps extends Omit<TagProps<"td">, "children"> {
172
+ }
173
+ /** A number formatted through `Intl.NumberFormat` and aligned for comparison. */
174
+ interface NumberCellProps extends TypedCellProps {
175
+ /** The value; `null` or `undefined` renders `—`. */
176
+ value: number | null | undefined;
177
+ /** BCP 47 locale. Defaults to the runtime's. */
178
+ locale?: string;
179
+ /** Formatting, such as `{ style: "unit", unit: "millisecond" }` or `{ style: "percent" }`. */
180
+ format?: Intl.NumberFormatOptions;
181
+ }
182
+ /** An amount with its currency code muted after it, the form that reads across currencies. */
183
+ interface CurrencyCellProps extends TypedCellProps {
184
+ /** The amount in major units (12.8 for $12.80); `null` or `undefined` renders `—`. */
185
+ value: number | null | undefined;
186
+ /** ISO 4217 code, such as `"USD"`. */
187
+ currency: string;
188
+ /** BCP 47 locale. Defaults to the runtime's. */
189
+ locale?: string;
190
+ }
191
+ /** An identifier set in mono and truncated in the middle, keeping the end where ids differ. */
192
+ interface IdCellProps extends TypedCellProps {
193
+ /** The full id, kept whole in the text and the title; `null` or `undefined` renders `—`. */
194
+ value: string | null | undefined;
195
+ /**
196
+ * Characters kept after the ellipsis, always whole: the cell outgrows
197
+ * `--ui-table-id-max-inline-size` as far as they need. Defaults to {@link DEFAULT_ID_TAIL}.
198
+ */
199
+ tail?: number;
200
+ }
201
+ /** A moment shown through `RelativeTime`: relative within a week, a date after it. */
202
+ interface DateCellProps extends TypedCellProps {
203
+ /** The moment; `null` or `undefined` renders `—`. */
204
+ date: Date | string | number | null | undefined;
205
+ /** Reference moment, so the server renders deterministically. */
206
+ now?: Date | string | number;
207
+ /** BCP 47 locale. */
208
+ locale?: string;
209
+ /** IANA zone the server formats in. Defaults to UTC. */
210
+ timeZone?: string;
211
+ /** Rewrites the time in the viewer's zone through the `RelativeTimeLocal` island. */
212
+ local?: boolean;
213
+ }
214
+ /** A state shown as a `StatusDot` and its label. */
215
+ interface StatusCellProps extends Omit<TagProps<"td">, "color"> {
216
+ /** Semantic role of the state. */
217
+ color?: SemanticColor;
218
+ /** Marks a state still in progress, so its dot pulses. */
219
+ pulse?: boolean;
220
+ /** The state's name; omit it and the cell renders `—`. */
221
+ children?: RemixNode;
222
+ /** Detail after the name, muted past a middle dot on the same line, such as a date or a code. */
223
+ detail?: RemixNode;
224
+ }
225
+ /** A number over a bar sized to its share of `max`, for comparing rows without a chart. */
226
+ interface BarCellProps extends TypedCellProps {
227
+ /** The value; `null` or `undefined` renders `—`. */
228
+ value: number | null | undefined;
229
+ /** The value a full bar stands for. Defaults to {@link DEFAULT_BAR_MAX}. */
230
+ max?: number;
231
+ /** BCP 47 locale for the figure. */
232
+ locale?: string;
233
+ /** Formatting for the figure. */
234
+ format?: Intl.NumberFormatOptions;
235
+ /** The bar's role colour. Defaults to `neutral`. */
236
+ color?: SemanticColor;
237
+ }
238
+ /** Any content shown when a table has no rows, rendered beside the table rather than in it. */
239
+ interface EmptyProps extends TagProps<"div"> {
240
+ }
241
+ /** A failure shown in place of the body, with a slot for Retry. */
242
+ interface ErrorProps extends TagProps<"tbody"> {
243
+ /** Number of columns the table renders, so the message spans the full row width. */
244
+ colSpan: number;
245
+ /** What went wrong. */
246
+ children: RemixNode;
247
+ /** A Retry control, such as a link back to the same URL. */
248
+ action?: RemixNode;
249
+ }
96
250
  /**
97
251
  * Per-part styling for the elements {@link Table.LoadMore} renders besides
98
252
  * its own `<tr>` host.
@@ -120,27 +274,20 @@ export declare namespace Table {
120
274
  }
121
275
  }
122
276
  /**
123
- * Renders the table's `<table>` host: a full-width, border-collapsed grid
124
- * with a small base font size, ready to hold {@link Table.Header} and
125
- * {@link Table.Body}. Dev mode warns when it lacks an accessible name.
277
+ * Renders the `<table>` host: full width, border-collapsed, small text. `density` sets the row
278
+ * height, `pinFirstColumn` keeps the first column in view with a scroll-driven edge shadow,
279
+ * and `aria-busy="true"` dims the body while it refetches. Dev mode warns without a name.
126
280
  *
127
281
  * @param handle Runtime handle carrying the host `<table>`'s props.
128
282
  * @returns The render function producing the table's markup.
129
283
  * @example
130
- * <Table aria-label={t("subjects.title")}>
131
- * <Table.Header>
132
- * <Table.Row>
133
- * <Table.Column>{t("subjects.name")}</Table.Column>
134
- * </Table.Row>
135
- * </Table.Header>
136
- * <Table.Body>
137
- * <Table.Row>
138
- * <Table.Cell>{subject.name}</Table.Cell>
139
- * </Table.Row>
140
- * </Table.Body>
284
+ * <Table aria-label={t("monitors.title")} density="comfortable" pinFirstColumn>
285
+ * <Table.Header>…</Table.Header>
286
+ * <Table.Body>…</Table.Body>
141
287
  * </Table>
288
+ * @example <Table aria-label={t("monitors.title")} aria-busy={refreshing ? "true" : undefined}>…</Table>
142
289
  */
143
- export declare function Table(handle: Handle<Table.Props>): () => import("remix/component").RemixElement;
290
+ export declare function Table(handle: Handle<Table.Props, TableContext>): () => import("remix/component").RemixElement;
144
291
  export declare namespace Table {
145
292
  var Container: (handle: Handle<Table.ContainerProps>) => () => import("remix/component").RemixElement;
146
293
  var Header: (handle: Handle<Table.HeaderProps>) => () => import("remix/component").RemixElement;
@@ -148,5 +295,33 @@ export declare namespace Table {
148
295
  var Column: (handle: Handle<Table.ColumnProps>) => () => import("remix/component").RemixElement;
149
296
  var Row: (handle: Handle<Table.RowProps>) => () => import("remix/component").RemixElement;
150
297
  var Cell: (handle: Handle<Table.CellProps>) => () => import("remix/component").RemixElement;
298
+ var Keys: (handle: Handle<Table.KeysProps>) => () => import("remix/component").RemixElement;
299
+ var SelectAll: (handle: Handle<Table.SelectAllProps>) => () => import("remix/component").RemixElement;
300
+ var Select: (handle: Handle<Table.SelectProps>) => () => import("remix/component").RemixElement;
301
+ var ActionsColumn: (handle: Handle<Table.ActionsColumnProps>) => () => import("remix/component").RemixElement;
302
+ var Actions: (handle: Handle<Table.ActionsProps>) => () => import("remix/component").RemixElement;
303
+ var Action: (handle: Handle<Table.ActionProps>) => () => import("remix/component").RemixElement;
304
+ var RowLink: (handle: Handle<Table.RowLinkProps>) => () => import("remix/component").RemixElement;
305
+ var NumberCell: (handle: Handle<Table.NumberCellProps>) => () => import("remix/component").RemixElement;
306
+ var CurrencyCell: (handle: Handle<Table.CurrencyCellProps>) => () => import("remix/component").RemixElement;
307
+ var IdCell: (handle: Handle<Table.IdCellProps>) => () => import("remix/component").RemixElement;
308
+ var DateCell: (handle: Handle<Table.DateCellProps>) => () => import("remix/component").RemixElement;
309
+ var StatusCell: (handle: Handle<Table.StatusCellProps>) => () => import("remix/component").RemixElement;
310
+ var BarCell: (handle: Handle<Table.BarCellProps>) => () => import("remix/component").RemixElement;
311
+ var Empty: (handle: Handle<Table.EmptyProps>) => () => import("remix/component").RemixElement;
312
+ var Error: (handle: Handle<Table.ErrorProps>) => () => import("remix/component").RemixElement;
151
313
  var LoadMore: (handle: Handle<Table.LoadMoreProps>) => () => import("remix/component").RemixElement;
152
314
  }
315
+ /**
316
+ * Client island the select-all header carries: a hidden marker whose mixin keeps the table's
317
+ * selection checkboxes in step. Loads from `@sdxc/ui/app/table#TableSelection` once the app's
318
+ * browser entry maps it; until then every row checkbox still works on its own.
319
+ */
320
+ export declare const TableSelection: EntryComponent<Record<never, never>>;
321
+ /**
322
+ * Client island behind {@link Table.Keys}: a hidden marker whose `rowNavigation()` walks the
323
+ * rows of the container it sits in. Loads from `@sdxc/ui/app/table#TableKeys` once the app's
324
+ * browser entry maps it; until then every row link and checkbox stays reachable by Tab.
325
+ */
326
+ export declare const TableKeys: EntryComponent<Table.KeysProps>;
327
+ export {};