@slashsuite/ui-react 0.0.0-stage → 0.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 (304) hide show
  1. package/LICENSE +21 -0
  2. package/MIGRATING.md +540 -0
  3. package/README.md +548 -2
  4. package/dist/AppShell.d.ts +127 -0
  5. package/dist/AppShell.js +119 -0
  6. package/dist/AppShellMenu.d.ts +26 -0
  7. package/dist/AppShellMenu.js +66 -0
  8. package/dist/Avatar.d.ts +75 -0
  9. package/dist/Avatar.js +95 -0
  10. package/dist/AvatarStack.d.ts +31 -0
  11. package/dist/AvatarStack.js +34 -0
  12. package/dist/Badge.d.ts +15 -0
  13. package/dist/Badge.js +15 -0
  14. package/dist/BottomSheet.d.ts +36 -0
  15. package/dist/BottomSheet.js +142 -0
  16. package/dist/Breadcrumbs.d.ts +27 -0
  17. package/dist/Breadcrumbs.js +29 -0
  18. package/dist/BulletList.d.ts +18 -0
  19. package/dist/BulletList.js +18 -0
  20. package/dist/Button.d.ts +121 -0
  21. package/dist/Button.js +182 -0
  22. package/dist/ButtonGroup.d.ts +15 -0
  23. package/dist/ButtonGroup.js +10 -0
  24. package/dist/Callout.d.ts +43 -0
  25. package/dist/Callout.js +45 -0
  26. package/dist/Card.d.ts +148 -0
  27. package/dist/Card.js +171 -0
  28. package/dist/CardBadge.d.ts +7 -0
  29. package/dist/CardBadge.js +12 -0
  30. package/dist/CardBody.d.ts +28 -0
  31. package/dist/CardBody.js +30 -0
  32. package/dist/CardGrid.d.ts +53 -0
  33. package/dist/CardGrid.js +52 -0
  34. package/dist/CardParts.d.ts +40 -0
  35. package/dist/CardParts.js +41 -0
  36. package/dist/ChatComposer.d.ts +35 -0
  37. package/dist/ChatComposer.js +50 -0
  38. package/dist/ChatMessage.d.ts +26 -0
  39. package/dist/ChatMessage.js +21 -0
  40. package/dist/ChatThread.d.ts +25 -0
  41. package/dist/ChatThread.js +60 -0
  42. package/dist/Checkbox.d.ts +42 -0
  43. package/dist/Checkbox.js +63 -0
  44. package/dist/Chevron.d.ts +5 -0
  45. package/dist/Chevron.js +6 -0
  46. package/dist/Cluster.d.ts +70 -0
  47. package/dist/Cluster.js +47 -0
  48. package/dist/Code.d.ts +6 -0
  49. package/dist/Code.js +5 -0
  50. package/dist/CodeBlock.d.ts +46 -0
  51. package/dist/CodeBlock.js +21 -0
  52. package/dist/CodeBody.d.ts +20 -0
  53. package/dist/CodeBody.js +38 -0
  54. package/dist/CodeExample.d.ts +25 -0
  55. package/dist/CodeExample.js +17 -0
  56. package/dist/CodeText.d.ts +11 -0
  57. package/dist/CodeText.js +64 -0
  58. package/dist/ColourSchemeToggle.d.ts +36 -0
  59. package/dist/ColourSchemeToggle.js +64 -0
  60. package/dist/Container.d.ts +22 -0
  61. package/dist/Container.js +26 -0
  62. package/dist/CopyButton.d.ts +17 -0
  63. package/dist/CopyButton.js +39 -0
  64. package/dist/CopyLine.d.ts +9 -0
  65. package/dist/CopyLine.js +7 -0
  66. package/dist/DateCalendar.d.ts +23 -0
  67. package/dist/DateCalendar.js +89 -0
  68. package/dist/DateField.d.ts +124 -0
  69. package/dist/DateField.js +111 -0
  70. package/dist/DateFieldCalendar.d.ts +24 -0
  71. package/dist/DateFieldCalendar.js +50 -0
  72. package/dist/DateRangePicker.d.ts +47 -0
  73. package/dist/DateRangePicker.js +44 -0
  74. package/dist/Dialog.d.ts +56 -0
  75. package/dist/Dialog.js +94 -0
  76. package/dist/Disclosure.d.ts +29 -0
  77. package/dist/Disclosure.js +23 -0
  78. package/dist/Divider.d.ts +4 -0
  79. package/dist/Divider.js +5 -0
  80. package/dist/DocsLayout.d.ts +69 -0
  81. package/dist/DocsLayout.js +64 -0
  82. package/dist/Drawer.d.ts +30 -0
  83. package/dist/Drawer.js +24 -0
  84. package/dist/EmptyState.d.ts +47 -0
  85. package/dist/EmptyState.js +34 -0
  86. package/dist/Field.d.ts +44 -0
  87. package/dist/Field.js +51 -0
  88. package/dist/FieldDialog.d.ts +26 -0
  89. package/dist/FieldDialog.js +31 -0
  90. package/dist/Fieldset.d.ts +21 -0
  91. package/dist/Fieldset.js +22 -0
  92. package/dist/FileDrop.d.ts +17 -0
  93. package/dist/FileDrop.js +14 -0
  94. package/dist/FormRow.d.ts +46 -0
  95. package/dist/FormRow.js +39 -0
  96. package/dist/Hero.d.ts +23 -0
  97. package/dist/Hero.js +28 -0
  98. package/dist/Icon.d.ts +40 -0
  99. package/dist/Icon.js +30 -0
  100. package/dist/IconButton.d.ts +72 -0
  101. package/dist/IconButton.js +65 -0
  102. package/dist/Image.d.ts +58 -0
  103. package/dist/Image.js +69 -0
  104. package/dist/InlineEdit.d.ts +22 -0
  105. package/dist/InlineEdit.js +60 -0
  106. package/dist/Input.d.ts +40 -0
  107. package/dist/Input.js +42 -0
  108. package/dist/InputShell.d.ts +24 -0
  109. package/dist/InputShell.js +40 -0
  110. package/dist/Kbd.d.ts +6 -0
  111. package/dist/Kbd.js +5 -0
  112. package/dist/KeyValueList.d.ts +34 -0
  113. package/dist/KeyValueList.js +35 -0
  114. package/dist/Lightbox.d.ts +45 -0
  115. package/dist/Lightbox.js +46 -0
  116. package/dist/ListRow.d.ts +26 -0
  117. package/dist/ListRow.js +151 -0
  118. package/dist/Markdown.d.ts +11 -0
  119. package/dist/Markdown.js +49 -0
  120. package/dist/MediaTile.d.ts +66 -0
  121. package/dist/MediaTile.js +50 -0
  122. package/dist/Menu.d.ts +64 -0
  123. package/dist/Menu.js +86 -0
  124. package/dist/MetaList.d.ts +23 -0
  125. package/dist/MetaList.js +20 -0
  126. package/dist/Morph.d.ts +41 -0
  127. package/dist/Morph.js +107 -0
  128. package/dist/NavigationProgress.d.ts +20 -0
  129. package/dist/NavigationProgress.js +26 -0
  130. package/dist/OutlineRegion.d.ts +60 -0
  131. package/dist/OutlineRegion.js +51 -0
  132. package/dist/PageFade.d.ts +30 -0
  133. package/dist/PageFade.js +46 -0
  134. package/dist/PageHeader.d.ts +26 -0
  135. package/dist/PageHeader.js +18 -0
  136. package/dist/PageLayouts.d.ts +100 -0
  137. package/dist/PageLayouts.js +78 -0
  138. package/dist/Pagination.d.ts +38 -0
  139. package/dist/Pagination.js +65 -0
  140. package/dist/Pill.d.ts +79 -0
  141. package/dist/Pill.js +121 -0
  142. package/dist/ProgressBar.d.ts +47 -0
  143. package/dist/ProgressBar.js +47 -0
  144. package/dist/RadioGroup.d.ts +55 -0
  145. package/dist/RadioGroup.js +53 -0
  146. package/dist/ScrollStrip.d.ts +21 -0
  147. package/dist/ScrollStrip.js +12 -0
  148. package/dist/SearchInput.d.ts +9 -0
  149. package/dist/SearchInput.js +55 -0
  150. package/dist/Section.d.ts +93 -0
  151. package/dist/Section.js +55 -0
  152. package/dist/SegmentedControl.d.ts +47 -0
  153. package/dist/SegmentedControl.js +78 -0
  154. package/dist/Select.d.ts +28 -0
  155. package/dist/Select.js +19 -0
  156. package/dist/Show.d.ts +33 -0
  157. package/dist/Show.js +27 -0
  158. package/dist/SideColumn.d.ts +50 -0
  159. package/dist/SideColumn.js +45 -0
  160. package/dist/SidebarLayout.d.ts +32 -0
  161. package/dist/SidebarLayout.js +77 -0
  162. package/dist/SiteFooter.d.ts +31 -0
  163. package/dist/SiteFooter.js +24 -0
  164. package/dist/SiteSearch.d.ts +40 -0
  165. package/dist/SiteSearch.js +150 -0
  166. package/dist/SortableList.d.ts +86 -0
  167. package/dist/SortableList.js +191 -0
  168. package/dist/SplitBar.d.ts +29 -0
  169. package/dist/SplitBar.js +22 -0
  170. package/dist/Stack.d.ts +114 -0
  171. package/dist/Stack.js +76 -0
  172. package/dist/StackedBar.d.ts +64 -0
  173. package/dist/StackedBar.js +58 -0
  174. package/dist/StatTile.d.ts +33 -0
  175. package/dist/StatTile.js +44 -0
  176. package/dist/StatusPages.d.ts +49 -0
  177. package/dist/StatusPages.js +63 -0
  178. package/dist/Steps.d.ts +29 -0
  179. package/dist/Steps.js +43 -0
  180. package/dist/StickyBar.d.ts +12 -0
  181. package/dist/StickyBar.js +10 -0
  182. package/dist/Switch.d.ts +56 -0
  183. package/dist/Switch.js +91 -0
  184. package/dist/Table.d.ts +92 -0
  185. package/dist/Table.js +92 -0
  186. package/dist/TableCells.d.ts +97 -0
  187. package/dist/TableCells.js +104 -0
  188. package/dist/TableEditCell.d.ts +31 -0
  189. package/dist/TableEditCell.js +17 -0
  190. package/dist/TableExpandCell.d.ts +25 -0
  191. package/dist/TableExpandCell.js +15 -0
  192. package/dist/Tabs.d.ts +38 -0
  193. package/dist/Tabs.js +46 -0
  194. package/dist/TextLink.d.ts +51 -0
  195. package/dist/TextLink.js +38 -0
  196. package/dist/Textarea.d.ts +11 -0
  197. package/dist/Textarea.js +11 -0
  198. package/dist/Timeline.d.ts +31 -0
  199. package/dist/Timeline.js +38 -0
  200. package/dist/ToastRegion.d.ts +44 -0
  201. package/dist/ToastRegion.js +37 -0
  202. package/dist/Tooltip.d.ts +46 -0
  203. package/dist/Tooltip.js +181 -0
  204. package/dist/TrendChart.d.ts +36 -0
  205. package/dist/TrendChart.js +58 -0
  206. package/dist/Video.d.ts +13 -0
  207. package/dist/Video.js +9 -0
  208. package/dist/blocked.d.ts +31 -0
  209. package/dist/blocked.js +31 -0
  210. package/dist/cardContext.d.ts +8 -0
  211. package/dist/cardContext.js +14 -0
  212. package/dist/cardWait.d.ts +13 -0
  213. package/dist/cardWait.js +16 -0
  214. package/dist/colourScheme.d.ts +22 -0
  215. package/dist/colourScheme.js +53 -0
  216. package/dist/control.d.ts +29 -0
  217. package/dist/control.js +37 -0
  218. package/dist/copyScript.d.ts +13 -0
  219. package/dist/copyScript.js +13 -0
  220. package/dist/cx.d.ts +19 -0
  221. package/dist/cx.js +21 -0
  222. package/dist/density.d.ts +38 -0
  223. package/dist/density.js +77 -0
  224. package/dist/emptySlot.d.ts +11 -0
  225. package/dist/emptySlot.js +16 -0
  226. package/dist/fieldControl.d.ts +23 -0
  227. package/dist/fieldControl.js +24 -0
  228. package/dist/fieldWait.d.ts +30 -0
  229. package/dist/fieldWait.js +27 -0
  230. package/dist/foldedColumn.d.ts +18 -0
  231. package/dist/foldedColumn.js +51 -0
  232. package/dist/headingLevel.d.ts +10 -0
  233. package/dist/headingLevel.js +18 -0
  234. package/dist/highlight.d.ts +18 -0
  235. package/dist/highlight.js +306 -0
  236. package/dist/highlightConsole.d.ts +9 -0
  237. package/dist/highlightConsole.js +42 -0
  238. package/dist/highlightHtml.d.ts +7 -0
  239. package/dist/highlightHtml.js +132 -0
  240. package/dist/highlightKit.d.ts +16 -0
  241. package/dist/highlightKit.js +23 -0
  242. package/dist/highlightYaml.d.ts +3 -0
  243. package/dist/highlightYaml.js +143 -0
  244. package/dist/icons.d.ts +16 -0
  245. package/dist/icons.js +108 -0
  246. package/dist/index.d.ts +99 -0
  247. package/dist/index.js +92 -0
  248. package/dist/isoDate.d.ts +5 -0
  249. package/dist/isoDate.js +16 -0
  250. package/dist/labelWords.d.ts +20 -0
  251. package/dist/labelWords.js +28 -0
  252. package/dist/layoutWait.d.ts +15 -0
  253. package/dist/layoutWait.js +18 -0
  254. package/dist/link.d.ts +82 -0
  255. package/dist/link.js +68 -0
  256. package/dist/listRowProps.d.ts +108 -0
  257. package/dist/listRowProps.js +1 -0
  258. package/dist/listRowWait.d.ts +6 -0
  259. package/dist/listRowWait.js +14 -0
  260. package/dist/modal.d.ts +25 -0
  261. package/dist/modal.js +61 -0
  262. package/dist/navFold.d.ts +15 -0
  263. package/dist/navFold.js +46 -0
  264. package/dist/pillTip.d.ts +8 -0
  265. package/dist/pillTip.js +25 -0
  266. package/dist/props.d.ts +26 -0
  267. package/dist/props.js +14 -0
  268. package/dist/scrollEdges.d.ts +12 -0
  269. package/dist/scrollEdges.js +40 -0
  270. package/dist/scrollStop.d.ts +32 -0
  271. package/dist/scrollStop.js +79 -0
  272. package/dist/sheetSnap.d.ts +27 -0
  273. package/dist/sheetSnap.js +45 -0
  274. package/dist/shownDate.d.ts +88 -0
  275. package/dist/shownDate.js +186 -0
  276. package/dist/size.d.ts +45 -0
  277. package/dist/size.js +12 -0
  278. package/dist/skeleton.d.ts +83 -0
  279. package/dist/skeleton.js +88 -0
  280. package/dist/stackGap.d.ts +9 -0
  281. package/dist/stackGap.js +16 -0
  282. package/dist/stickyColumn.d.ts +38 -0
  283. package/dist/stickyColumn.js +38 -0
  284. package/dist/switcher.d.ts +93 -0
  285. package/dist/switcher.js +78 -0
  286. package/dist/tableColumns.d.ts +31 -0
  287. package/dist/tableColumns.js +72 -0
  288. package/dist/tableEmpty.d.ts +15 -0
  289. package/dist/tableEmpty.js +26 -0
  290. package/dist/tableRow.d.ts +67 -0
  291. package/dist/tableRow.js +49 -0
  292. package/dist/tableSort.d.ts +22 -0
  293. package/dist/tableSort.js +19 -0
  294. package/dist/textBox.d.ts +10 -0
  295. package/dist/textBox.js +23 -0
  296. package/dist/tone.d.ts +11 -0
  297. package/dist/tone.js +1 -0
  298. package/dist/trend.d.ts +26 -0
  299. package/dist/trend.js +64 -0
  300. package/dist/typography.d.ts +203 -0
  301. package/dist/typography.js +242 -0
  302. package/dist/useImageFailed.d.ts +19 -0
  303. package/dist/useImageFailed.js +21 -0
  304. package/package.json +84 -4
package/README.md CHANGED
@@ -1,3 +1,549 @@
1
- # Temporary Holding Version
1
+ # @slashsuite/ui-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ UISlash React components, written against Tailwind v4 utilities. They carry no theme: pair them
4
+ with a theme from `@slashsuite/themes`, such as `@slashsuite/themes/catppuccin-mocha.css`, and put its scope
5
+ class on `<html>` (`.dark` for Mocha). With no theme they render in Tailwind's own default colours,
6
+ a plain light look; it works, but it is not a look UISlash designs or checks.
7
+
8
+ Status: `0.x`, published to npm. License: MIT.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ bun add @slashsuite/ui-react
14
+ # peers: react >= 19, react-dom >= 19, tailwindcss ^4
15
+ # optional type peers: @types/react, @types/react-dom (install them in a TypeScript app)
16
+ ```
17
+
18
+ One runtime dependency comes with it: `react-aria-components` (and `@internationalized/date`),
19
+ for the date controls (`DateField`, `DateRangePicker`), `Menu`, `Disclosure`, `RadioGroup` and
20
+ `SortableList`'s keyboard and drag. It brings no CSS; the classes are ours.
21
+
22
+ Tailwind skips `node_modules`, so tell it to scan the build for the utilities the components use,
23
+ in the stylesheet that imports Tailwind (the path is relative to that file):
24
+
25
+ ```css
26
+ @import "tailwindcss";
27
+ @source "../node_modules/@slashsuite/ui-react/dist";
28
+ ```
29
+
30
+ ## Use
31
+
32
+ ```tsx
33
+ import { Card, PageHeading, Pill, Text } from "@slashsuite/ui-react";
34
+
35
+ export const Example = () => (
36
+ <Card title="Status" count={2}>
37
+ <PageHeading>All good</PageHeading>
38
+ <Text>Two things shipped.</Text> <Pill tone="positive">ok</Pill>
39
+ </Card>
40
+ );
41
+ ```
42
+
43
+ ## No styling props
44
+
45
+ No component takes `className` or `style`, as an own prop or through the HTML props it spreads
46
+ (`data-*`, `aria-*`, `id`, `title` and event props still pass). `Badge` pins to a corner with
47
+ `corner`, `ListRow` draws its line with `divided`; a look the component lacks is a prop or variant
48
+ to propose, not a class to add. A router link is drawn by the app's `LinkProvider` (see Router links), never
49
+ by copying a component's classes.
50
+
51
+ Every exported component passes `data-*` and `aria-*` through to its root element (an e2e hook such as
52
+ `data-testid`, or `aria-describedby`), so there is no need to wrap one in an element of your own to
53
+ carry them; `passthrough.test.tsx` fails for an export that does not. A component with no single
54
+ root (`DateField`) puts `data-*` on its wrapper and `aria-describedby` on the field.
55
+
56
+ ## Sizes
57
+
58
+ One scale runs through the library: `Size` is `"sm" | "md" | "lg"`, and `md` is the default
59
+ wherever a component takes `size`. The controls (`Button` (also as a link), `IconButton`,
60
+ `ColourSchemeToggle`, `Input` (also `type="search"`), `Select`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`,
61
+ `DateField` (also with `calendar`), `SegmentedControl`, `Tabs orientation="vertical"`)
62
+ share heights at each step (`sm` 26px, `md` 38px, `lg` 46px, the same on a `Select` and a `DateField` as on an `Input`; a Playwright check measures them side by side in every theme), so a row of mixed controls at one size lines up. The text of a `Button`, `Input`, `Select`, `Textarea`, `DateField`, `DateRangePicker`, `SegmentedControl` and vertical `Tabs` is `text-sm`, `text-base` and `text-lg` at `sm`, `md` and `lg`, one step down under `AppShell density="compact"`, and a field is never under 16px on a touch screen; a `Checkbox`, `Switch` or `RadioGroup` label is one step smaller. `Button`, `IconButton`, `SegmentedControl` and `Icon` also take a `ResponsiveSize`, `{ base, md }`, which changes at the `md` breakpoint in CSS. `Card`, `ListRow`,
63
+ `FileDrop`, `Dialog`, `Drawer`, `Avatar`, `SubsectionHeading`, `TextLink` and the bars take the
64
+ same three names. Where a scale goes past them, and the few defaults that are not `md`, are
65
+ listed once, on the `Size` type. `TextLink` with no `size` takes the size of the text around it. Upgrading: `MIGRATING.md`, shipped in the package (`node_modules/@slashsuite/ui-react/MIGRATING.md`).
66
+
67
+ ## Disabled
68
+
69
+ A control that cannot be used says why. `Button`, `IconButton`, `Checkbox`, `Switch` and a button
70
+ `ListRow` take `disabledReason`: the control fades, stays focusable and `aria-disabled`, and the
71
+ reason is its tooltip and its description. A `Tabs` or `SegmentedControl` option takes the same
72
+ `disabledReason` on its item. Every other control (`Input`, `Textarea`, `Select`, `FileDrop`,
73
+ `DateField`, `RadioGroup`, `CopyLine`, `ChatComposer`, a `Fieldset`) takes the native `disabled`,
74
+ with the reason in the text beside it: its `Field` hint, or its own `hint`. A link is never
75
+ disabled: leave it out, or say in the text why it is not there.
76
+
77
+ ## What is exported
78
+
79
+ - Primitives: `Card` (a bordered panel; `title` and `count` make a small heading, `titleStyle="name"` sets the title in sentence case in the primary ink for a card that is a named thing (the default `overline` is small uppercase), and `status` (a `Pill` or any node) sits right after them, where `actions` sits at the far end; `flush` drops the padding and clips the corners, for a table that runs edge to edge; `bar` moves the title, count and `actions` into a tinted strip over the body; an empty state is an `EmptyState`, not a card form; `badge` pins a `Pill` to the top corner at the end edge over the content, on a panel or a link card, where it is part of the link's name; `icon` puts one of the `Icon` set's names above the title at `feature` size in the accent colour, decorative, on a panel or a link card but not a `bar` or `flush` one; `attention` draws the strong warn edge (`border-amber-600`) round a card that needs a look, with or without `tone="warn"`; `footer` puts a tinted strip under a hairline across the bottom, for the card's own actions or a total: it takes the padding off the root and gives it to the body, so the strip runs edge to edge and stays at the foot of a card stretched in a `CardGrid`; not on a card that is a link; `fill` takes the parent's full height: the title or bar stays put and the body scrolls; the parent sets the height; not on a card that is a link; `inset` is a full-bleed band (a progress bar, a chart, an image) under the title and over the children, running edge to edge of a padded card; a bordered sub-card inside a card is a nested `Card tone="neutral"`; a card with a `title` or an `aria-label` is a `section` and any other a `div`, and `as="article"` makes it an `article`; the title is an `h2` on the page and an `h3` in a `Section`, and `level` sets it by hand; `size="sm"` makes a `Button`, `IconButton` or `Pill` inside with no `size` `sm` too, and a `Stack` in any card is `xs` apart; `id`, `data-*` and `aria-*` go on the root (on a link card too: the link inside takes only its own `aria-label`, `aria-labelledby` and `aria-current`); a titled panel is named by its title through `aria-labelledby`, unless you pass your own `aria-label` or `aria-labelledby`; a Card with an `id` is an anchor target, scrolled clear of the sticky header and outlined in the accent colour while it is the `:target`), `Pill` (a small tinted label; `tone` is what it means, `neutral` (default), `info`, `positive`, `warn` or `danger`, or `accent` for a category that is none of those; `size` is `sm`, `md` (default) or `lg`, and left out it takes its container's; `dot`, `round` and `title` (its tooltip on hover, keyboard focus and a tap, and its description; a plain pill with one takes a tab stop); `name` makes it a two-tone `name: value` pill, the name keeping the tint and the children, the value, on the surface; `href` makes it a link and `onClick` a button; `onRemove` with `removeLabel` adds an x button, a separate button beside a link or button pill and never inside it), `Markdown` (a small, safe renderer for short notes; `md` (required) is the source; it supports `## ` and `### ` headings, `- ` or `* ` bullets, `**bold**` and paragraphs, rendered as React nodes, never as HTML; while `loading` with no `md` yet, it draws a paragraph of bones), `Badge` (a small red count for sitting on an icon; `count` above 99 reads `99+`, `corner` pins it to the top corner at the end edge of its `relative` parent; an `IconButton` takes `count` and does this itself).
80
+ - Data: `StatTile` (one headline figure: an uppercase `label` over a large tabular `value`, already formatted, an optional `hint` under it; `tone` is `neutral` (default), `positive`, `warn` or `danger`, and `accent` adds a bar across the top in the same tone; `trend` (numbers, oldest first) draws a small line under the value in its colour on a scale from 0; it is decoration, so say the trend in `hint` too), `ProgressBar` (a thin bar with a filled share of `max` (default 100); `label` names it for a screen reader, which also hears the percentage; `tone` is `accent` (default), `positive`, `warn` or `danger`), `SplitBar` (a bar split between `a` and `b` by their shares; `names` says whose is whose to a screen reader; `toneA` (default `danger`) and `toneB` (default `positive`)), `StackedBar` (any number of `items`, each `{ label, value, tone }`, sized by its share of the sum; `legend` draws a `Legend` under it), `TrendChart` (one or two series over ordered buckets, on a y axis from 0: `label` is its name and its table's caption, `buckets` the x labels in order, `series` one or two `{ label, tone, values }`, where a `null` or missing value draws nothing and breaks a line; `kind` is `bar` (default, a count per bucket) or `line` (a level over time); a hidden table holds the same figures for a screen reader, and two series draw a `Legend` under the chart) and `Legend` (a swatch, a `label` and an optional `detail` per item, the key to a chart's or a row stripe's colours). The three bars take `size`: `sm` 6px, `md` 8px (default), `lg` 12px.
81
+ - Media: `Image` (a picture in a fixed shape; `alt` is required, and `""` marks decoration; `src` is a local path or data URL, and when it is missing or broken a same-sized placeholder with a picture mark stands in; `aspect` is `square`, `4:3` (default), `3:2`, `16:9`, `3:4`, `9:16` or `natural` (no crop, and no space reserved before it loads); `fit` is `cover` (default) or `contain`; `width` is `sm` 96px, `md` 160px, `lg` 256px or `full` (default); `framed` puts it on a white mat in every theme, for a QR code or a logo, and always shows the whole picture, whatever `fit` says; while `loading` with no `src`, it is a bone of the same shape; a user's photo is an `Avatar`), `MediaTile` (a thumbnail tile with an optional `label` on the media scrim at its bottom edge and a muted `caption` under it; `alt` (required) is its name; `aspect` defaults to `3:4`, not `4:3`, and `width` defaults to `md`; `onClick` makes the whole tile one button, from which the app opens a `Lightbox`; `href` makes it one link instead (`external` too); with neither, it is a plain block; `onRemove` adds a separate remove button on the top corner, named by `removeLabel` ("Remove") and `alt`; `video` draws a play mark), `ScrollStrip` (one row that scrolls sideways, with snapping and a thin themed scrollbar, for `MediaTile`s or `Avatar`s; `label` (required) names it; `gap` is `xs`, `sm` (default) or `md`; items never shrink or wrap; it takes keyboard focus, so the arrow keys scroll it; a wrapping grid is a `CardGrid` or `Cluster`), `Lightbox` (a full-screen photo or video viewer on a native `<dialog>` opened on mount, so render it only while it is open; `label` and `onClose` are required, and `children` is one `<img>` or `<video>`; `title` sits above the media, `meta` is a muted line under the title, and `caption` sits under the media; Esc, a click on the scrim and the close button all call `onClose`; `onPrevious` and `onNext` add step buttons and bind ArrowLeft and ArrowRight, so leave one out at the end of the list; `closeLabel`, `previousLabel` and `nextLabel` are for other languages; the scrim stays near-black in every theme) and `RegionFrame` (a picture, `src` and `alt` required, with the `OutlineRegion`s as its `children` laid over it; `aspect` defaults to `natural`, and any other value letterboxes the picture, never crops it; `width` is as for `Image`; other props go to the `<img>`) with `OutlineRegion` (an accent outline over one area; `rect` (`{ x, y, width, height }`) is in the picture's own units and `within` (`{ width, height }`) is the picture's full size, so it stays in place at any scale; `label` is a small tag at the top left; `hatched` stripes an area that is left out; it takes no pointer events).
82
+ - Chat: `ChatThread` (the scrolling box of a chat; it follows the newest content unless the reader has scrolled up; it is a named region, `label` (required), and a tab stop; `height` is `sm` 20rem, `md` 28rem (default), `lg` 40rem or `fill`, the height of a parent that sets one; `empty` is drawn when it has no children; it is deliberately not a live region: set `announce` when a message is finished, not on each token), `ChatMessage` (one bubble; `role` (required) is `user` (end edge, inset fill) or `assistant` (start edge, surface); `author` (required) is read first by a screen reader and is drawn nowhere, so a visible sender and time go in `meta`, a line above the bubble; `actions` is a row under the bubble; `streaming` sets `aria-busy` and draws a caret, which pulses unless reduced motion is on; with no children, the caret alone is the pending state) and `ChatComposer` (the message box and its button, which keeps its own text; `label` (required) is its unseen name, and `onSend` (required) gets the trimmed text; Enter sends and clears, Shift+Enter is a newline, and blank text does not send; `busy` turns the button into Stop, which calls `onStop`, and Enter does not send while typing carries on; with `busy` and no `onStop`, the button stays a disabled Send; `disabled` is for a chat that cannot take a message at all; `placeholder`, `sendLabel` ("Send") and `stopLabel` ("Stop") are also props).
83
+ - Status pages: `NotFound` (404), `ErrorPage` (500 or any failure; `detail` is error text shown in a `CodeBlock`, never a stack trace, and `onRetry` adds "Try again"), `Offline` (`onRetry` too), `Maintenance` and `Forbidden` (403). Each is a whole page with default copy: `title` and `children` replace the heading and the body, `actions` are the page's own buttons, before the home link. Every page but `Maintenance` links "Back to home", to `LinkProvider`'s `home` (`/` by default): say where home is once, on the provider, never on a page. `Maintenance` has none, since home is the site that is down.
84
+ - Layout (see Layout): `AppShell`, `AppShellBrand`, `appShellRootClassFor`, `Container`, `PageHeader`, `Hero`, `Stack`, `Section`, `Cluster`, `ClusterGrow`, `SideColumn`, `CardGrid`, `StickyBar`, `Show`, `SiteFooter`, and the page layouts `ListLayout`, `DetailLayout`, `FormLayout`, `ProseLayout`, `SidebarLayout`, `DocsLayout`, `FullBleedLayout`, `CenteredLayout`.
85
+ - `Prose` (a `div` for long-form content, a docs page or an article, never an app screen: it sets the long line height (leading-7) and puts `Text`, `SectionHeading`, `SubsectionHeading` and the `Callout` text on the long-form scale inside it, body 16, h4 16 semibold, h3 20 and h2 24; every other role keeps its size, and a `Dialog`, `Drawer` or `EmptyState` inside it keeps the app sizes; it takes no `className`, `style` or size prop).
86
+ - Typography roles (each pins size, weight and ink, and takes an `as`): `Display`, `Lead`,
87
+ `PageHeading`, `SectionHeading`, `SubsectionHeading`, `Overline`, `Text`, `Caption`. `Text` and
88
+ `Caption` are a `<p>`; `as="span"` is their inline form, inside a row, a cell or a sentence. Opt-in props, none changing today's look: `SectionHeading rule`
89
+ (a hairline under it, with its spacing), `SubsectionHeading size` (`sm`, `md` default, `lg`) and `truncate` (one line with an ellipsis),
90
+ `Text strong` (font-medium in the primary ink, for emphasis), `Text preserveNewlines` (keeps a
91
+ note's line breaks). The three inline roles (`Text`, `Caption`, `Overline`) also take `tone`, the one ink prop (`neutral`, the default, is the role's own ink;
92
+ `muted` and `accent`, or `info`, `positive`, `warn`, `danger`, the same text colours as a `TableCell` tone; pair the colour with a word, as in "Saved."),
93
+ `numeric` (tabular figures), `mono` (the monospace face) and `align` (`start`, `center`, `end`);
94
+ `Text` and `Caption` also take `lines` (1 to 4, then an ellipsis, the full plain text in a
95
+ `title`), `italic` and `breakWords` (a long URL or token breaks where its container ends).
96
+ - Controls: `Button` (`variant` is `primary` (default), `outline`, `ghost`, `link` or `dashed`, the link having no box: text with an underline on hover, for an in-line action, and the dashed one a dashed outline in muted text that fills its container, like a standalone `EmptyState`, for an "add another" row, ignoring `tone`; `icon` puts one of the `Icon` set's names before the label; `size="sm"` is compact, for table rows and toolbars, `size="lg"` larger, with more padding (see Sizes); `tone="danger"` is red, for delete and clear, and `tone="positive"` green, for accept and approve; `disabledReason` greys it flat and blocks it with `aria-disabled` while it stays in the tab order, and shows the reason as a tooltip on hover, keyboard focus and a tap, read out as its description (its native `title` in a browser without CSS anchor positioning); `busy` disables it with `aria-busy` and keeps its colour, and a string (`busy={saving && "Saving"}`) is also the label while busy; `pressed` makes it a toggle with `aria-pressed`, on `outline` and `ghost` neutral when off and filled in the tone's primary colour when on, so an `outline` `size="sm"` Button with `pressed` is a filter chip; `count` puts a small number chip after the label, part of the button's name ("Splits, 3"), and a button that opens something also takes `aria-expanded`; with `href` it is a link with the same look (through the app's `LinkProvider`), `external` opening a new tab), `ButtonGroup` (a wrapping row of buttons; `end` is one item pushed to the far side, `label` makes it a named `role="group"`), `IconButton` (a square button holding one icon of the set, `icon` (required, no children); `label` is required and becomes its `aria-label` and its tooltip on hover and keyboard focus; `variant` is `outline` (default) or `ghost`, `tone` is `neutral` (default) or `danger`, `size` matches a `Button`'s height; `count` puts a red count on its corner, not shown at 0; `disabledReason` dims it, blocks it with `aria-disabled` while it stays in the tab order, and shows the reason as a tooltip on hover, keyboard focus and a tap, read out as its description (its native `title` without CSS anchor positioning), in place of the label; with `href` it is a link, `external` opening a new tab), `Icon` (one bare `<svg>` sized to fill a box, or `name` for one of the set's own icons (`diff`, `baseline`, `review`, `ci`, `self-host`, `privacy`, `capture`, `branch`, `theme`, `speed`, `search`, `chevron-right`, `chevron-down`, `close`, `external-link`, `settings`, `bell`, `check`, `plus`, `more`, `grid`, `window`, `type`, `card`, `pointer`, `field`, `table`, `compass`, `page`, `briefcase`: feature ideas and UI glyphs on one 24 grid, a 1.5 stroke, round caps and joins, each the idea or action, not a product): `size` `sm` 14px, `md` 16px (default), `lg` 20px or `feature` 32px; `tone` is a text tone, and left out the icon takes the text colour around it; `aria-hidden` unless `label` names it as `role="img"`), `Menu` (a button that opens a short list of actions, for the overflow menu of a row, a card or a header: `label` (required) names the trigger and the menu; `items` (required) are data, each a `label` with `onSelect`, or a link with `href` (through the app's `LinkProvider`) and `external`, plus an optional `icon`, `tone` (`neutral` default, `danger` red, put last) and `disabled`; `trigger` is `icon` (default, a ghost three-dot button) or `button` (an outline button reading `label`); `size` is the trigger's height; the keyboard is the menu button pattern, and inside a `Dialog` it opens in the dialog), `ColourSchemeToggle` (a light/dark switch on `<html>`; `id`, `data-*` and other button props go on the button, `store={false}` skips `localStorage`; see Light and dark), `Input` (a text input; `icon` names a leading icon of the `Icon` set inside the field; `prefix` is short text inside the border before the value, a currency symbol, on a plain field only; `type="search"` drops the browser's search look and shows a clear button while the field has a value, named by `clearLabel` (default "Clear search")), `Textarea` (a multi-line text input, `rows` defaults to 3), `Select` (a native `<select>` in the control look over its `items`, `{ value, label, disabled? }`, keeping the browser's arrow). `Input`, `Select`, `Textarea` and `Checkbox` take a `ref` to the native element. `Input`, `Select` and `Textarea` take `size` (`md` default, `sm`: compact, less padding, for dense forms and table rows, or `lg`: larger, more padding) and `width` (`full` default, except a `Select` outside a `Field`, which is `auto`; the fixed `xs` 5rem, `sm` 7rem, `md` 9rem, `lg` 12rem, `fill`: grows to the room left in a flex row and can shrink to nothing, so the buttons beside it stay on the line, or `auto`: no width class, as wide as the browser makes it); a fixed width replaces `w-full`, so there is no class to collide with. `Input` also takes `numeric`, a field for a figure: an amount (`<Input prefix="R" numeric />`) or a count (`numeric inputMode="numeric"`), the value right-aligned in tabular figures with `inputMode="decimal"` unless you pass your own, still a text field so the value is kept as typed; never `type="number"` for a figure a person types. `size` replaces the native `size` attribute, so a multi-row `<select size={4}>` is not reachable through `Select`. `Checkbox` (a real `<input type="checkbox">` with its label, drawn by the library as an empty outlined box and a filled accent one with a check mark, so it reads the same in every theme and browser; other props go on the input; `size="sm"` is compact with a smaller box and `size="lg"` larger with a larger one (see Sizes); the box sits on the label's first line; `checked` or `defaultChecked`, and `onChange(checked)`; with no `label` it is a bare box for a table cell, named by `aria-label`; `hint` is a muted line under the label, the box's `aria-describedby`, and `error` replaces it in red with `role="alert"` and marks the box `aria-invalid`; `disabledReason` dims it and blocks it with `aria-disabled` while it stays in the tab order, and shows the reason as a tooltip on hover, keyboard focus and a tap, read out as its description (its native `title` without CSS anchor positioning)). `Switch` (an on/off setting that acts at once, usually by saving to a server: a native `<button role="switch" aria-checked>`, with `checked` or `defaultChecked` and `onChange(checked)`; give it a `label` (the whole label is the click target) or, with none, an `aria-label`: one is required; `hint` is a muted line under the label and its `aria-describedby`, and `error` replaces it as on a `Checkbox`; `size` is `sm`, `md` (default) or `lg`; `busy` is the save in flight: `aria-busy`, a click or key does nothing, it keeps its colour and its focus; `disabled` is the native one, washed out; `disabledReason` washes it out and blocks it with `aria-disabled` while it stays in the tab order, and shows the reason as a tooltip on hover, keyboard focus and a tap, read out as its description (its native `title` without CSS anchor positioning); a value sent with a form stays a `Checkbox`). `RadioGroup` and `Radio` (one choice from a few options: the group has a `label`, `value`/`onChange` or `defaultValue`, `name`, `disabled`, `required`, `hint` (a line under the group's label), `size` (`sm`, `md` default, `lg`, as `Checkbox`) and an `error` shown like `Field`'s with `role="alert"`; each `Radio` has a `value`, a `label`, an optional `hint` and `disabled`; one tab stop, the arrow keys move and choose). `Disclosure` (a summary button with a chevron and `aria-expanded` over a body that opens and closes; `summary`, `children`, `defaultOpen`; it keeps its own state, or the app holds it with `open` and `onOpenChange`; it replaces `<details>`). `FileDrop` (a dashed drop zone, a `<label>` around a file input that covers it, so a click opens the dialog and a dropped file lands on the input; `children` is the prompt, `accept`, `multiple`, `name`, `disabled` and `onChange` on the input). `CopyButton` (a small text button that writes `text` to the clipboard and shows `copiedLabel` ("Copied") in place of `label` ("Copy") for two seconds, by a CSS animation, not a timer; its accessible name stays `label` and a status region beside it announces `copiedLabel` on each copy; every other button prop, `disabled` included, goes on the `<button>`). `CopyLine` (one line of mono text in a box with a `CopyButton` beside it; `disabled` disables the button; other props go on the root `<div>`). `Field` (a label above an `Input`, `Select`, `Textarea` or `FileDrop`, which takes the label, the hint or error as `aria-describedby`, and with an error `aria-invalid` and a red edge, by itself, so neither `htmlFor` nor the control's `id` is needed; `htmlFor` gives the control a fixed id; `labelHidden` keeps the label for assistive tech and draws no text, for a control whose purpose is plain from what surrounds it, and makes `layout="row"` a column; a `hint` sits under it, and an `error` replaces the hint with a `role="alert"` line; `span="full"` runs it across both columns of a `FormGrid`). `FormGrid` (two columns of `Field`s from `md`, one below it), `FormRow` (an inline-edit row: `FormRowField`s side by side, `actions` after them, and one `hint` or `error` under the whole row; see Layout) and `FormRowField` (a compact label over one control, `span` 1 to 4). `Callout` (a tinted notice box; `tone` is `neutral` (default), `info`, `positive`, `warn` or `danger`; `icon` sets one of the `Icon` names at the start; an optional `title` sits in bold above the body; `actions` puts a button or link at the end of the row; `banner` makes it a flat strip, bottom border only and no radius, for the top of a `Card flush`). `ToastRegion` (the page's toasts, short notices fixed to the bottom of the viewport, from a list the app holds: mount it once at the root beside `AppShell`; `toasts` (required) is the list, oldest first, each a `Toast` with `id`, `title`, an optional `body`, `tone` (a `Callout` tone, `neutral` by default) and `actions` (one `Button size="sm"`); `onDismiss(id)` (required) is called by a toast's close button and when a self-hiding toast's time is up, and the app drops it from the list; a `neutral`, `info` or `positive` toast with no `actions` leaves on its own after five seconds by a CSS animation, not a timer, paused on hover and focus and kept under reduced motion without the fade, and any other stays until dismissed; `label` names the region ("Notifications") and `dismissLabel` the close button ("Dismiss"); the region is a landmark with a polite `role="status"`, and a toast raised while a `Dialog` or `Drawer` is open sits under it). `ListRow` (a full-width row that is a `<button>` with `onClick`, or a link with `href`, with a hover fill, a left-aligned label and `trailing` content; `divided` draws a hairline above the row, to separate rows in a `Card flush`; `expanded` makes it the header of a collapsible section: `aria-expanded` and a chevron, the caller owning the state and the section; `leading` is content before the label (an `Avatar`), and `leadingWidth="thumbnail"` gives it a fixed width so rows with and without a picture line up; `size` sets the padding (`sm` dense, `md` default, `lg`); `focused` draws the focus ring on the row the keyboard cursor is on, for a list moved with the arrow keys while focus stays on the list; `selected` marks the row in view with an accent fill and `aria-current="true"`; a button or link row can hold its own link, button or `Checkbox` in `trailing`, with its own click; `secondary` is a second, muted line under the label; with no `href` and no `onClick` it is a plain `<div>`, for a row that holds its own buttons, and takes `actions`, buttons after `trailing`, and `revealOnHover`, which shows them only on hover or focus inside the row and always on a touch screen, and `panel`, content under the row lined up with the label, for a row that opens in place; a compact bordered list is `Card flush` around such rows at `size="sm"`, `divided` after the first (no separate part); `highlighted` marks the row the pointer or the keyboard is on, with a fill one step deeper than hover and the `revealOnHover` actions shown, for a list that follows both through the row's `onPointerEnter`, `onPointerLeave` and `onFocus`, which every row passes through; a button row takes `disabledReason`, which fades the row and blocks it with `aria-disabled` while it stays in the tab order, and shows the reason as a tooltip on hover, keyboard focus and a tap, read out as its description (its native `title` without CSS anchor positioning)). `SortableList` (a list the user puts in order: `label` (required) names it, and `onReorder(move)` (required) is called once per drop with a `SortableMove`, `{ id, section?, target? }`, which the app applies to its own data; the list never reorders itself; its children are `SortableSection`s (`id` (required, the move's `section`), `title`, and `emptyLabel`, "Drop here" by default, the row an empty section shows) or `SortableItem`s directly; a `SortableItem` takes an `id` (required, the move's `id` and `target`), a `title` and, as children, a meta line under it; a pointer drags the row, and the keyboard uses its grip handle: Enter, the arrow keys, Enter to drop, Escape to cancel). `Tabs` (underline tabs for switching a view in place: a row over a bottom rule, the current tab underlined in the accent; `items` are `{ value, label }` buttons, with `value` the current one's `value` and `onChange(value)` the caller's state, one tab stop and the arrow keys, Home and End moving between enabled tabs, or `{ label, href, selected?, external? }` links in a `<nav>` with `aria-current="page"` on the current one (`selected`, or the item whose `value` is `value`); `label` names the group; a button tab takes `disabled` and `controls`, the id of its `role="tabpanel"`, which is the caller's; `orientation="vertical"` is the pill rail instead, the current tab filled, with no rule, stacked in one column for a `SidebarLayout` `aside`, and only the rail takes `size`; there is no `variant`: across is always underline, a `PageHeader` `tabs` slot and an `AppShell` `nav` included; `disabled` on the row disables every tab, e.g. until hydration). `SegmentedControl` (a joined pill group, one option filled; the same `items`, `value`, `onChange`, `disabled` and `label` as `Tabs`, as a `radiogroup` with `aria-checked` on each `radio`). On both an item takes `data-*` attributes (typed `data-${string}`) onto its button or link; on `Tabs` and `SegmentedControl` an item takes `count` (a small muted number after the label, part of its name: "Shots 12") and `title`; a button option takes `disabledReason`: it is `aria-disabled`, the arrow keys reach it and choose nothing, and the reason is its tooltip on hover, keyboard focus and a tap, read out as its description; a bare `disabled` option is `aria-disabled` too, and the arrow keys, Home and End skip it. `Dialog` (a modal on the browser's `<dialog>`, opened on mount, so render it only while open: `title` is its name, `description` a line under it, `footer` the right-aligned actions; Esc, the backdrop or a `<form method="dialog">` call `onClose`; `width` is `sm` (320px, a list), `md` (440px, default, a form), `lg` (640px, a wider form or a table) or `full` (the whole screen, for media or a player: the body fills the height between the title and the footer and scrolls if taller; there is no backdrop to click, so put a close button on a `<form method="dialog">` in the `footer`); `onSubmit` makes it a form (one `<form noValidate>` round the body, the `error` and the footer, so a submit button or Enter submits; no `<form method="dialog">` in its footer then); `error` is the whole submit's error, a danger `Callout` above the footer). `FieldDialog` (a `Dialog` with one text field and Cancel and submit buttons, every string passed in: `title`, `description`, `label` (which names the input), `placeholder`, `hint`, `emptyReason`, `submit` and `busyLabel`; `onSubmit` gets the trimmed value and a resolved promise closes it, a rejection shows its message). `Drawer` (a modal slide-over on the right edge, on a native `<dialog>` opened on mount like `Dialog`, so render it only while open: `title` is its name, `description` a line under it, a close button sits beside it, `children` scroll between the header and an optional pinned `footer`; Esc, the scrim and the close button call `onClose`; `width` is `sm`, `md` (default) or `lg`; `closeLabel` names the close button). `BottomSheet` (a non-modal panel docked to the bottom of its positioned parent, over a view such as a map or a canvas that stays usable behind it; nothing is made inert and focus never moves; `label` (required) names the region and its handle; `snaps` (required, at least two, lowest first) are shares of the parent's height from 0 to 1, or `"120px"` strings; `snap` (required) is the current index, and `onSnapChange` (required) is told which snap to move to; the handle steps through the snaps with Enter and Space, a drag releases to the nearest snap, and Escape returns it to the first; `header` stays put, `children` scroll, and `footer` is pinned under the body; `onHeightChange(px)` reports its resting height, so a map camera can be padded by it; it is full width below `md` and a panel at the start edge from `md` up). `Pagination` (page links for a long list, in a `<nav>` named by `label` (required): `page` (from 1, drawn clamped into range) of `pageCount` (one page draws nothing), each page a link to `pageHref(page)` through the app's `LinkProvider`, so the page lives in the URL; Previous and Next in the outline `sm` look, plain text at the first and last page; a window of at most seven numbers (the first, the last, the current and its neighbours, `…` for a run of hidden pages), the current one `aria-current="page"`; below `sm` the numbers give way to `pageLabel` ("Page 4 of 12"); `previousLabel` and `nextLabel` for another language). `Breadcrumbs` (a `<nav>` named by `label`, "Breadcrumb" by default, over an ordered list; `items` are nodes, or `{ label, href, external? }` for one that links; the last is the current page and is never a link and gets `aria-current="page"`, and each crumb truncates). `SiteSearch` (a header button that opens a search dialog over links to the matching pages; put it in `AppShell`'s `controls`, render it once per page, and pass every page as `items` (`{ label, href, description?, keywords? }`, in rail order); `label` (required) is the dialog's title and the phone icon button's name; Ctrl+K (Cmd K on a Mac) opens it from anywhere; typing matches the label, then `keywords`, then the description; Enter opens the first result, the arrow keys move, and Esc closes it and returns focus; `resultsLabel` ("Results") is also a prop). `Table` (a list of records in a rounded, bordered card around a full-width `<table>` that scrolls sideways on a narrow screen; `label` (required) names it for assistive tech and is not drawn; a `TableHeaderCell` with `sort` and `onSort` makes its column sortable (the app sorts the rows), `TableRow selected` marks the row whose detail is open (`aria-current`), a `TableExpandCell` opens a row whose panel is a `TableCell span="full"`, and `TableBody empty` takes an `EmptyState` across every column; `size` is the row padding, `sm` by default, and the buttons and pills in its rows take the same size; inside a `Card` it is plain: no card of its own, no head strip and no row hover, only the row dividers; compose it from `TableHead`, `TableBody`, `TableFoot`, `TableRow`, `TableHeaderCell` (`numeric` declares a column of figures once, so the title and every cell under it are end aligned and the cells in tabular figures; `align` `start`, `center` or `end`; `label` is a visually hidden column name, in place of children, for a column of row actions: "Actions") and `TableCell` (`align`, `indent` of 1 to 3 to set a start-aligned cell in, for a line under a parent row, `tone` `neutral` (the default), `strong` or `muted`, or the tones `info`, `positive`, `warn` or `danger` for an amount that means something, in the tone's text colour and with no fill, so pair the colour with a sign or a word; `numeric` for a figure, end aligned in tabular figures (a cell under a `numeric` head cell is one already), `mono` for a small mono face, `truncate` to cap a long value's width, cut it with an ellipsis and put the full text in a `title`, so its content is text (strings and numbers); `secondary` for a second, muted line under the content; `colSpan` passes through, so a `TableCell` with `colSpan` in a row of its own is a full-width panel, an empty state or a note, centred with `align="center"`); `TableEditCell` (a `TableCell` whose value opens an editor in place: `children` is the value, drawn as a button; a click, Enter or Space swaps it for `renderEditor(close)`, a plain control in the cell and not a popover of its own, and moves the focus into it; `close` and Esc put the focus back on the value, and a press outside or Tab out of it closes it too, so the control saves on its own change or submit; `label` names the button and the editor; it takes the `TableCell` props except `truncate`); `InlineEdit` (the same edit trigger without the cell, for a `TableCell` that holds other content too: `label`, `renderEditor(close)` and `children`, with the same keyboard and focus behaviour); `TableFoot` (the `<tfoot>` for totals: its cells are strong by default and each row has a firmer line above it, alone and in a card alike); `TableGroupRow` (a full-width group header in the body: `label` spans `colSpan` columns, the table's column count, which is required; optional `trailing` content sits at the far end, and the group's rows follow it); `tone` on a `TableRow` in the body marks the row with a stripe on its leading edge over a soft fill: `neutral`, `info`, `positive`, `warn` or `danger`, as `Callout`, or `muted`, which only fades the row (a transfer, a row that is not the point); a bold subtotal is not a tone: `emphasis` on a `TableRow` in the body gives it a `TableFoot` row's look among the other rows; `stripe` (a text tone) draws the leading stripe alone, with no fill; a row takes one of `tone`, `stripe` and `emphasis`; `selected` on a `TableRow` marks the current one with the `ListRow` selected fill and `aria-current`, and wins over a tone; every table element passes `id`, `data-*` and `aria-*` through, and none takes a `className` or `style`). `Timeline` (a named `<ol>` of events; `label` is its `aria-label`, `empty` is drawn instead when there are no items) with `TimelineItem` (a `title`, an already-formatted `time`, the `children` as a note, and `tone`, a Callout tone for the marker dot, `neutral` by default). `KeyValueList` (a `<dl>` of label/value rows; each `KeyValue` takes a `label` and its value as children, the value right-aligned in tabular figures; `total` makes it the sum row, a firm rule above and strong text, and `tone` (a text tone: `muted`, `accent`, `info`, `positive`, `warn`, `danger`) colours the value on any row, so `total tone="warn"` is a total that does not reconcile; `align="start"` puts the values left-aligned in one column beside the labels instead). `Avatar` (a badge of the initials of `name`, titled with the name and `aria-hidden`; with `src` (the app's own local image path, never a remote one) it is a cropped `<img alt={name}>` instead, and if that image fails to load it shows the initials; `size` is `xs` (16px, for an inline mention), `sm`, `md` (default), `lg`, `xl` (56px), `2xl` (64px) or `3xl` (96px); `onClick` makes it one button named by `name`; `shape` is `round` (default, a person) or `square` (an org or a team); `href` makes it one link (`external` too); a row of overlapping avatars is an `AvatarStack`; the colour is one of seven stock background classes picked by a hash of the name, remapped by each theme). `AvatarStack` (a row of overlapping avatars, each in a ring of the page colour; `items` (required) is `{ name, src? }[]`, in order, with full names; `max` shows that many and then a "+N" chip of the same size and shape; `size` (default `md`) and `shape` (`round` default, or `square`) are as for `Avatar`; the row is one image to assistive tech, named by the people in it; while `loading` with no `items`, it draws three bones). `TextLink` (an inline text link in the accent colour; `href` is required and an in-app one goes through the app's `LinkProvider`, `external` adds `target="_blank"` and `rel="noreferrer"`, `stretch` covers the nearest `relative` ancestor so a whole row or card is the click target, `size` (`sm`, `md` or `lg`) pins the type size where it would otherwise follow the text around it, `mono` sets the monospace face, `tone` (`warn`, `danger`, `positive`, `info` or `muted`) gives it a meaning's colour in place of the accent (`neutral` and `accent` keep the accent), every other anchor prop passes through). `MetaList` (a wrapping row of facts or links in muted small text, joined by an `aria-hidden` `separator`: `·` (default), `•` or `none`; branch · SHA · date, or a footer's Privacy · Terms; an item is text, a `Code` or a `TextLink`, and never breaks inside itself; `mono` sets the row in the monospace face, for ids and paths). `PageFade` (the page's content area, named for the View Transitions API so a route change cross-fades it while the frame around it stays put; wrap what changes between pages, once per page, or give each a `name` (a CSS identifier) when there are two; it fades when the navigation runs in a view transition, through `startPageTransition(update)` (flushes a synchronous state change inside `document.startViewTransition`) or a router's own option such as TanStack Router `viewTransition`, and otherwise, in a browser without View Transitions, or under `prefers-reduced-motion: reduce`, it swaps with no fade; it renders a small `<style>`, with no colour in it, and the div is a stacking context, so portal an overlay that must rise above the frame). `Morph` (a `<div>` that grows into its counterpart on the next page and shrinks back on Back, through the View Transitions API, over 450 ms; wrap the list card and the detail element, each with the same `name` (required) and the record's id as `item` (required); one `name` and `item` pair may appear only once per page; it morphs only inside a view transition (`startPageTransition`, TanStack Router `defaultViewTransition: true` or a `Link`'s `viewTransition`), and otherwise, and under reduced motion, it swaps with no animation; while it is named it is a stacking context, so overlays inside it portal to the body; `refreshMorphs()` measures every mounted Morph again: call it after a router restores scroll after the render, with TanStack Router `router.subscribe("onRendered", () => refreshMorphs())`, subscribed after the router is created; it does nothing on the server). `NavigationProgress` (a thin indeterminate accent bar fixed along the top edge of the viewport, over the header, for a route change under way; `loading` is the router's pending flag (TanStack Router: `useRouterState({ select: (s) => s.status === "pending" })`), `label` its accessible name (default "Loading page"); it draws the bar while `loading` is true and nothing otherwise, with the bar invisible for its first 150ms so a fast navigation shows nothing; render it once per app, beside the page frame, and pair it with `PageFade`; a still bar under `prefers-reduced-motion: reduce`; it adds nothing to the layout and has no router dependency). `EmptyState` (what a page or list shows when it has nothing yet: a centred `title`, the `children` as the explanation under it, and `actions` in a centred row; a named `<section>`, which draws its own dashed frame on its own and none inside a `Card`; `icon` sets a mark above the title; `level` is the title's heading level, one below the heading that holds it, and does not change its look; for one muted line inside a card, `Text tone="muted"`). `Steps` (a numbered `<ol>` of `Step`s, each a `title` and the `children` as a detail line, the numbers counted by CSS in an accent disc; for a "get started" list, not for progress). `Divider` (a hairline `<hr>` in the theme's line colour; spacing comes from the layout around it). `BulletList` (a `<ul>` with discs, an indent and a small gap; its children are `BulletItem`s, each an `<li>` in the body text). `Code` (inline code: mono, on a subtle background). `CodeBlock` (a block of code, no client JS: the text is `children` (a string) or `lines` (one entry per line), `language` (`text` (default, one colour), `tsx`, `ts`, `js`, `json`, `bash`, `console`, `css`, `html` or `yaml`) colours it, `console` being a shell session where a `$ ` line is a command and the rest is output, and `copy` then copies only the commands; `label` is a caption naming the language or file; long lines wrap by default, so nothing is cut off and a command copies as one line, and `overflow="scroll"` keeps lines whole and scrolls them under a thin scrollbar in the theme's muted ink; `copy` adds a copy button beside the code, which copies it exactly as given; on a static page it needs `copyScript` (see Copy on a static page); other props go on the root `<figure>`). `CodeExample` (one framed example: the rendered `children` over the `code` that makes them, coloured as TSX, in one bordered box, with an optional `caption` as its last band; a wide preview or long code scrolls inside the frame under the same thin scrollbar; `copy` adds a button that copies the code; no client JS without `copy`). `Video` (a full-width, rounded `<video>` with controls that loads metadata only; `src` is required, `poster` and a WebVTT `captions` track are optional, children are the fallback). `Kbd` (a keyboard key in mono; its border takes the surrounding text colour, so it reads on a filled button too). `Fieldset` (a `<fieldset>` named by its `label`, drawn as its legend in the `Field` label's look, over its children in one column: `Checkbox`es for one question, `Field`s in a `FormGrid`, or a `ButtonGroup` of `outline` `sm` `Button`s with `pressed` for filter chips; `hint` is a muted line under it and its `aria-describedby`, `error` replaces it in red with `role="alert"`; `disabled` disables every control inside; a `RadioGroup` is its own group and never goes in one). `DateField` and `DateRangePicker` (see Dates).
97
+ - Dates: `toISODate`, `fromISODate`, and the `CalendarDate` type.
98
+
99
+ ## Loading
100
+
101
+ A part waiting for its data draws its own shape. Set `loading` once, on the page layout, and render
102
+ the tree you render with data:
103
+
104
+ ```tsx
105
+ <ListLayout title="Quotes" loading={q.isPending}>
106
+ <StatTile label="Open" value={q.data?.open} />
107
+ </ListLayout>
108
+ ```
109
+
110
+ What a part has is drawn as itself and an empty slot (`null`, `undefined`, `false`, an empty string
111
+ or array) is a bone of that slot's shape, so the caption stays and a bone stands where the figure
112
+ will land. A container with nothing in it draws a fixed set (a `Table` five rows, a `Card` three
113
+ lines, a `CardGrid` one card per column, a `Timeline` three items), and loading beats `empty`. A
114
+ part's own `loading` wins; left out, it takes the nearest loading layout's or part's, and
115
+ `loading={false}` opts it out. The owner (the part or layout whose own `loading` is `true`) sets
116
+ `aria-busy` and holds one hidden label, `loadingLabel` ("Loading"). Bones pulse only when the reader
117
+ allows motion. Actions, navigation, bare controls and frames are known before the data and draw as
118
+ themselves; the docs' Loading page lists every part either way. There is no `Skeleton` part.
119
+
120
+ ## Dates
121
+
122
+ ```tsx
123
+ import { DateField, fromISODate, toISODate, type CalendarDate } from "@slashsuite/ui-react";
124
+
125
+ <DateField
126
+ calendar
127
+ label="Date of birth"
128
+ hint="DD/MM/YYYY"
129
+ defaultValue={fromISODate("1990-05-17")}
130
+ maxValue={fromISODate("2026-10-23")}
131
+ onChange={(date: CalendarDate | null) => save(toISODate(date))}
132
+ name="dob"
133
+ required
134
+ />;
135
+ ```
136
+
137
+ - `DateField` is a segmented DD/MM/YYYY field (always en-GB, whatever the browser's locale).
138
+ `calendar` adds a calendar button. The popover has ‹ › month steps, month and year dropdowns,
139
+ Monday-first weeks and a Clear action. `defaultOpen` opens it on mount.
140
+ - Without `calendar` it is typed only, for a date the person knows by heart.
141
+ - It takes `label`, `hint`, `error`, `value` / `defaultValue` / `onChange`, `minValue`,
142
+ `maxValue`, `disabled`, `required`, `size` and `name` (the form posts `YYYY-MM-DD`). With `calendar`,
143
+ `monthLabel` and `yearLabel` name the dropdowns (default `Month` and `Year`).
144
+ Values are `CalendarDate`s (from `@internationalized/date`, re-exported as a type).
145
+ - `toISODate(date)` gives `"1990-05-17"` (`""` for `null`); `fromISODate(text)` gives a
146
+ `CalendarDate`, or `null` for a malformed or impossible date such as `"1990-02-31"`.
147
+ - `onChange` reports what the field shows: the date once it is complete, exists and is within
148
+ `minValue` / `maxValue`. When a valid date is edited into one that is not, it reports `null` once
149
+ and `name` posts `""`, so a controlled parent holds `null` until the date is fixed (holding it does
150
+ not clear what was typed). Fixing it reports the date again. A `value` the parent sets is shown,
151
+ not reported back.
152
+ - With `required`, a partly filled date blocks the form and shows "Enter the whole date." once
153
+ the field loses focus.
154
+ - A date before `minValue` or after `maxValue` stays as typed (it is never clamped) and shows the
155
+ error once the field loses focus.
156
+ - An impossible date such as 31/02/1990 shows "February 1990 has 28 days." and stays exactly as
157
+ typed, focus leaving included, until it is fixed.
158
+ - `error` is an error from outside the field, a server's say: it shows in place of the hint, in
159
+ red with `role="alert"` (as `Field`'s `error` does), and marks the field invalid. It wins over
160
+ the built-in messages; clear it when the date changes.
161
+ - `DateRangePicker` is a from and to date in one field, DD/MM/YYYY "to" DD/MM/YYYY, with a
162
+ calendar button that opens one month, where two presses pick the range.
163
+ - Its value is a `DateRange`, `{ start, end }`, or `null`; `onChange` reports a range only when both
164
+ sides are complete, real, within `minValue` / `maxValue` and in order, and `null` otherwise.
165
+ `startName` and `endName` post each side as `YYYY-MM-DD`, or `""` while there is no range.
166
+ - `presets` are `DateRangePreset`s, `{ label, value }`, a row of buttons above the month. The app
167
+ builds them from its own today; the picker never reads the clock.
168
+ - `label`, `hint`, `error`, `minValue`, `maxValue`, `required`, `disabled`, `size`, `defaultOpen`,
169
+ `monthLabel` and `yearLabel` work as on a `DateField`.
170
+
171
+ ## Router links
172
+
173
+ `@slashsuite/ui-react` has no router dependency. The app names its router's link once, on a
174
+ `LinkProvider`, and every part that links (`Button`, `IconButton`, `TextLink`, `Pill`, `Card`,
175
+ `ListRow`, `Breadcrumbs`, `Tabs`, `SegmentedControl`, `AppShellBrand`, `SiteSearch`, `MediaTile`,
176
+ `Avatar` and the status pages) takes a plain `href`. Do: set the adapter once, at the router.
177
+ Don't: a render prop or a wrapper component per link.
178
+
179
+ ```tsx
180
+ // TanStack Router: InnerWrap also wraps the not-found and error components. A registered
181
+ // router's Link requires `to`; `to="."` satisfies it, and the `href` the adapter is handed wins.
182
+ const router = createRouter({
183
+ routeTree,
184
+ InnerWrap: ({ children }) => (
185
+ <LinkProvider link={(p) => <Link to="." {...p} />}>{children}</LinkProvider>
186
+ ),
187
+ });
188
+
189
+ // React Router, inside the router:
190
+ <LinkProvider link={({ href, ...p }) => <Link to={href} {...p} />}>…</LinkProvider>
191
+
192
+ // Then anywhere:
193
+ <Tabs label="Main" items={[{ label: "Quotes", href: "/quotes", selected: true }]} />
194
+ <Button variant="ghost" href={`/stores/${encodeURIComponent(id)}?tab=stock#top`}>Back</Button>
195
+ ```
196
+
197
+ Only an in-app path (one that starts with a single `/`) reaches the adapter. An `external` link, a
198
+ full URL (`https:`, `mailto:`, `tel:`), a `//` URL, a `#hash` and a relative path are a plain `<a>`.
199
+ With no provider (Astro, or a site with no router) every link is a plain `<a>`, which Astro's
200
+ `ClientRouter` intercepts on its own. A per-link `viewTransition` becomes `defaultViewTransition`
201
+ on `createRouter`.
202
+
203
+ `home` on the same provider is where every status page's "Back to home" goes, `/` by default:
204
+ `<LinkProvider link={...} home="/app">`, or `<LinkProvider home="https://example.com">` with no
205
+ `link` for a site whose home is elsewhere. Since `InnerWrap` wraps the router's not-found and error
206
+ components, the router setup is the one place an app wires its status pages. A provider inside
207
+ another keeps what it does not set.
208
+
209
+ The adapter is handed `LinkAdapterProps`: `href`, `className` and `children`, plus `aria-current`,
210
+ `target`, `rel` and `title` when there is one. Each optional field is `?: T` and an absent one is
211
+ left out, never set to `undefined`, so the spread compiles on a router `<Link>` that declares its
212
+ props the same way under `exactOptionalPropertyTypes` (TanStack Router's does). Any other anchor
213
+ prop you gave the component (`id`, `download`, a handler) is handed over too. The class strings are
214
+ not exported: the adapter is the one way to draw a router link.
215
+
216
+ ## Layout
217
+
218
+ One content edge for every page, so nothing moves sideways between pages or viewport sizes.
219
+
220
+ ```tsx
221
+ import {
222
+ AppShell,
223
+ AppShellBrand,
224
+ PageHeader,
225
+ Section,
226
+ Stack,
227
+ Tabs,
228
+ appShellRootClassFor,
229
+ } from "@slashsuite/ui-react";
230
+
231
+ // Your root layout. `appShellRootClassFor` adds `overflow-y-scroll`: it reserves the scrollbar, so
232
+ // a short page and a long one centre their content at the same x. AppShell cannot set it itself.
233
+ <html className={appShellRootClassFor("light")}>
234
+ <body>
235
+ <AppShell
236
+ brand={<AppShellBrand logo={<Logo />} label="Builds" href="/" />}
237
+ nav={<Tabs label="Main" items={nav} />}
238
+ footer="…"
239
+ >
240
+ <PageHeader title="Builds" description="Every build" actions={<Button>New</Button>} />
241
+ <Stack>
242
+ <Section title="Recent">…</Section>
243
+ </Stack>
244
+ </AppShell>
245
+ </body>
246
+ </html>;
247
+ ```
248
+
249
+ - **`AppShell`** is the page frame: a sticky header that is one `h-14` row on a phone and, from
250
+ `md`, an `h-14` row plus an `h-12` `subnav` row. On a phone `nav` and `subnav` fold behind one
251
+ **Menu** button (a native `<details>`, so it opens with no JavaScript, on the keyboard and for a
252
+ screen reader; Escape closes it and a followed link closes it). The panel hangs below the header
253
+ and never changes its height, nothing wraps and nothing scrolls sideways. `menuLabel` renames the
254
+ button (default `Menu`). From `md` the nav and the subnav are rows again (a row wider than the
255
+ screen scrolls sideways, never wraps, and the edge with more to reach fades out). `main`
256
+ has fixed `py-8`, and an optional `footer`. The header row is filled by slots, left to right:
257
+ `brand` (logo and name, at the brand type with the logo gap), `nav` (`Tabs` of links), `header` (a
258
+ free node for what no other slot covers; prefer `brand`, `nav` and `controls`) and `controls` (end-aligned, `gap-2`, centred): no wrapper and
259
+ no styling. Nothing in `controls` shrinks, and a full-width control there (a `Select` with
260
+ `width="full"`) sizes to its content, so a `Select` next to a `ColourSchemeToggle` leaves
261
+ the toggle its square. `printChrome={false}` is opt-in: the header and footer are hidden in print and main
262
+ drops its padding (the page margin is then your `@page`); without it a print is unchanged. `bleed` drops main's `Container` for a full-bleed
263
+ page; the header keeps its own, so put a `Container` back around anything that should line up. `density="compact"`, set once here and nowhere else,
264
+ puts the whole app one type step down: `Text` 14px, `Caption` 12px, the headings and the controls one
265
+ step smaller. Left out, text is 16px, as a site's.
266
+ - **`AppShellBrand`** is the `brand` slot as one link: `logo` and `label` inside the same `<a>`, so
267
+ the whole brand goes home (the label names the link; the logo is hidden from assistive tech).
268
+ `logoSize` is `sm` (20px), `md` (24px, the default, an `Avatar size="sm"`) or `lg` (32px); an
269
+ `<img>` or `<svg>` logo fills it. Its `href` goes through your `LinkProvider`, as every link does:
270
+
271
+ ```tsx
272
+ <AppShell brand={<AppShellBrand logo={<Avatar name="Quotes" size="sm" />} label="Quotes" href="/" />} …>
273
+ ```
274
+
275
+ Stories: `Layout/AppShell › DoBrand`, `DoRouterBrand`.
276
+ - **`appShellRootClassFor(scheme, schemes?)`** is what goes on `<html>` when the server knows the
277
+ scheme: that scheme's class and `overflow-y-scroll`, joined, so there is no string concatenation:
278
+ `<html className={appShellRootClassFor(scheme, schemes)}>`. With no scheme, pass `"light"`.
279
+ `schemeClass` stays exported.
280
+ - **`Container`** is the only place the content width (`max-w-6xl`) and side padding
281
+ (`px-4 sm:px-6`) are defined. **Pages never set their own width or outer padding**: no `max-w-*`,
282
+ no `mx-auto`, no `px-*` on a page. AppShell already gives them the edge.
283
+ - **`PageHeader`** is the top of every page but a landing page (that one opens with a `Hero`): optional `breadcrumbs`, the `title` (a `PageHeading`),
284
+ `description`, `actions` (right of the title from `sm`, under it on a phone) and `tabs` under it. Its
285
+ fixed bottom margin puts every page's first block at the same y.
286
+ - **`Hero`** is a landing page's top block, once per page and only there; every other page opens
287
+ with a `PageHeader`. It takes an `overline` (the small mono label), the `title` (the page's `h1`,
288
+ at `Display` size) and `children`: a `Lead`, and the page's first actions in a `Cluster` if it has
289
+ any (a primary `Button` and an `outline` or `ghost` one in the default tone, or a `TextLink`: the
290
+ text each theme's contrast check holds over the glow). Behind the text drift three soft ribbons of the theme's glow, in its own colours and strength
291
+ (faint on a paper theme), anchored to the text column and clipped to it, so a phone never scrolls
292
+ sideways. The glow is `aria-hidden`, stands still under `prefers-reduced-motion: reduce`, and is
293
+ markup plus one small `<style>` with no colour in it, so it needs no script. It takes no colour,
294
+ size or styling prop.
295
+ - **`Stack`** spaces blocks in a column: `gap="xs"` (`gap-2`) between lines of one text block (a
296
+ heading, the line under it), `sm` (`gap-4`) inside a group, `md` (`gap-6`) between
297
+ blocks, `lg` (`gap-8`) between groups, `xl` (`gap-12`, `sm:gap-16`) between a page's top-level blocks. Left out, the gap comes from where it sits: `xs` inside a `Card`, `Dialog`, `Drawer`, `BottomSheet`, `Callout` or `ListRow`, `md` on the page. Use it instead of `space-y-*`. `width` caps the column:
298
+ `narrow` (`max-w-3xl`, a reading measure), `wide` (`max-w-5xl`), `full` (`w-full`) or `default`
299
+ (nothing). A capped Stack starts at the Container's start edge and is never re-centred.
300
+ `rowFrom` (`sm`, `md` or `lg`) lays the blocks out in a row from that breakpoint and keeps the
301
+ column below it, a main block beside a side panel that stacks on a phone; a row that is a row at
302
+ every width is a `Cluster`.
303
+ `as` is `div` (default), `section`, `form`, `ul` or `ol`, and nothing else. A `form` Stack takes
304
+ the form props (`onSubmit`, `action`, `method`, `noValidate`, `aria-*`, `data-*`). A `ul` or `ol`
305
+ Stack has no markers and its children are `<li>`s (the Stack does not wrap them, as with
306
+ `BulletList` and `Timeline`; `Text as="li"` works).
307
+ **`Section`** is a `<section>` Stack (its gap as a `Stack`'s) with an optional `SectionHeading` `title` (an `h2` on the page, one below the section that holds it, `level` to set it),
308
+ `actions` beside it and the same `width`.
309
+ - **`Cluster`** spaces items in a row, the counterpart of `Stack`: `gap` is `xs` (`gap-2`), `sm`
310
+ (`gap-4`, the default) or `md` (`gap-6`), `align` the cross axis (`center` (default), `baseline`,
311
+ `start` or `end`), `justify` the main axis (`start` (default), `between` or `end`), and the row
312
+ flows onto more lines when it runs out of room (`wrap={false}` keeps it on one line). Wrap the one item that
313
+ should take the room left in **`ClusterGrow`**, an input beside its buttons say: it can shrink to
314
+ nothing, so the items beside it stay on the line; `minWidth` (`sm` 12rem, `md` 17rem) gives it a
315
+ floor instead, so in a Cluster that wraps it drops under the others rather than squashing. An empty `ClusterGrow` is a spacer that pushes
316
+ what follows it to the end. `ButtonGroup` stays the row for buttons; `Cluster` is any other row.
317
+ It is a separate part, not `Stack direction="row"`, because a row has no `lg`, `xl` or
318
+ `width` and a column has no `align` or `justify`.
319
+ - **`FormGrid`** is the two-column form: `Field`s in two columns from `md`, one below. A `Field`
320
+ with `span="full"` (a textarea, a long hint) runs across both. **`FormRow`** is an inline-edit
321
+ row of **`FormRowField`**s (a compact `text-xs` label over a control; `span` 1, 2, 3 or 4 is its
322
+ share of the row, so 2, 1 and 1 give a half and two quarters) with optional `actions` after
323
+ them (a save button, kept at its own width). Every control sits on the bottom edge, so the actions
324
+ line up with them, and under `md` the fields and the actions stack. A `FormRow` is always the full
325
+ width of a `FormGrid`. Its `hint` or `error` (which replaces the hint, `role="alert"`) sits under
326
+ the whole row; a `FormRowField` has no note of its own, so the controls beside each other stay
327
+ level. Closed spans, no `col-span` or width to pass.
328
+
329
+ - **`CardGrid`**: use this for stat tiles or a gallery of cards, inside a page layout. `columns` is `2`, `3` (default) or
330
+ `4`: one column on a phone, two from `sm`, `columns` from `lg`. `columns="auto"` instead fits as
331
+ many per row as the width allows, each at least `minWidth` wide: `md` (17rem, default) or `sm`
332
+ (12rem); `minWidth` is only for `auto`. Every tile is one width: a main card beside a narrower one is a `SideColumn`. `align="start"` keeps each card its own height; the
333
+ default stretches every card to the tallest in its row. `as="ul"` makes it a list, each child
334
+ wrapped in an `<li>`.
335
+ - **`SideColumn`**: use this when part of a page is a main area beside a side column of a known width,
336
+ such as a thread beside an assistant. `children` are the main area and `aside` the column; from `lg`
337
+ the aside is `asideWidth` wide on the right (`sm` 18rem, `md` 24rem, the default) and the main area
338
+ takes the room left, and below `lg` the aside stacks under it. `asideLabel` folds the aside, closed,
339
+ behind a native disclosure of that name below `lg` (the aside stays mounted, so state inside it is
340
+ kept) and names the `<aside>` landmark; from `lg` it is the same column, always shown. It sets no page width, padding or header of
341
+ its own, so it sits inside a layout or a card; a share of a page under a `PageHeader` is
342
+ `DetailLayout`'s aside. A `Stack` with `rowFrom` and a `ClusterGrow` sizes the side by its content
343
+ and is not a fixed column. A grid of fields, one row per item, is a `Table` in a `Card`.
344
+ - **`StickyBar`**: a full-width row that sticks under `AppShell`'s header as the page scrolls (a
345
+ filter or actions bar, or a viewer's title and actions). It sits on the surface with a bottom
346
+ line, and its content is padded as `Container` pads a page. Put one `Cluster` in it
347
+ (`justify="between"` for a title and actions). It spans its parent, so it goes at the top of an
348
+ `AppShell bleed` page; `FullBleedLayout`'s `bar` is one.
349
+ - **`Show`**: shows its children only from a breakpoint up (`from`) or only below it (`below`), each
350
+ `sm`, `md` or `lg`. It uses CSS alone: the same markup on the server and the client, and no
351
+ script. Hidden is `display: none`, so the content leaves the accessibility tree and the tab
352
+ order. Shown, the wrapper adds no box, so the children take the parent's gap. Hidden content
353
+ stays mounted, so two `Show`s of the same content mount it twice; a stateful panel that folds is
354
+ a `SideColumn asideLabel`. `as="span"` is for use inside phrasing content.
355
+ - **`SiteFooter`**: the footer that goes in `AppShell`'s `footer` slot. `brand` is the site's mark,
356
+ linked to `brandHref` (default `/`) and named by `brandLabel`. `children` is the contact line
357
+ beside it. `links` (`{ label, href, external? }[]`) is one wrapping row. `notes` are lines of
358
+ fine print, one paragraph each. It is not a `<footer>`: the shell draws the one `contentinfo`
359
+ landmark. No link columns, newsletter form or social icons.
360
+
361
+ ### Page layouts
362
+
363
+ Small compositions of the above: they take slots, own no data, and set no page width or outer
364
+ padding. `ListLayout`, `DetailLayout`, `FormLayout` and `ProseLayout` take the `PageHeader` props
365
+ (`title`, `description`, `actions`, `breadcrumbs`, `tabs`), and `CenteredLayout` its `title` and
366
+ `description`.
367
+
368
+ - **`ListLayout`**: use this when a page is a filterable list. `filters` sits under the header;
369
+ `children` is the list, replaced by `empty` when there are none.
370
+ - **`DetailLayout`**: use this when a page is one thing with facts beside it. `children` take two
371
+ thirds from `lg` and `aside` one third; below `lg` the aside stacks under the main column.
372
+ `sticky` (off by default, since an aside of ordinary cards may be taller than the screen)
373
+ keeps the aside in view from `lg` as a long page scrolls: it sticks under the shell's header and
374
+ scrolls itself when it is taller than the room left.
375
+ `asideLabel` names the aside's landmark (it never folds it), for a page with another complementary
376
+ landmark.
377
+ - **`FormLayout`**: use this for a create or edit page. A `max-w-3xl` `<form>` that starts at the
378
+ Container's start edge (it is not re-centred, so the title does not jump), with an `actions` row at
379
+ the end. Other props (`onSubmit`, `action`) go on the `<form>`.
380
+ - **`ProseLayout`**: use this for a text page (privacy, terms, a CV, an about page). One `narrow`
381
+ (`max-w-3xl`) column that starts at the Container's start edge (not re-centred, so the title does
382
+ not jump): the header, then `children` in a `Stack` (`gap` prop, `md` by default). Unlike
383
+ `FormLayout` the header sits inside the column, so its `actions` stay beside the text.
384
+ - **`SidebarLayout`**: use this when a rail of navigation, its `aside`, sits beside the content. Render it in a
385
+ plain `<AppShell>`, no `bleed`: it sits in the Container like every other layout, so the rail
386
+ starts at the header logo's x and the canvas ends at the header's right edge. The rail has no fill
387
+ and no border (pill `Tabs` with `orientation="vertical"` is its content); from `md` it is `md:w-56` beside
388
+ the canvas, and below `md` it stacks above it. From `md` the rail also stays in view under the
389
+ shell's header as a long page scrolls (always, with or without `asideLabel`); a rail taller than
390
+ the screen scrolls itself, so its last link is reachable. A long rail sets `asideLabel`: below `md`
391
+ the rail then folds, closed, behind a disclosure of that name, so a phone shows the page first;
392
+ `asideLabel` also names the rail's `<aside>` landmark.
393
+ - **`DocsLayout`**: use this for a docs page. It is a `SidebarLayout` whose rail is `nav` (required,
394
+ `{ title?, items }[]`, each group's title over a vertical pill list), named by `navLabel`
395
+ (required). Below `md` the rail folds behind a disclosure of that name. The canvas holds
396
+ `breadcrumbs`, the `title` (required, the `h1`), `description` (a `Lead`), an "On this page" list
397
+ of `contents` (`{ id, label, level: 2 | 3 }[]`; none with fewer than two; named by
398
+ `contentsLabel`), the article (`children`, long text in a `Prose`), and `previous` and `next`
399
+ links (`{ label, href }`, with `previousLabel` and `nextLabel`). From `xl` the contents are a
400
+ sticky 12rem column right of the article, and below `xl` they are a closed disclosure above it.
401
+ `current` is the id of the heading being read, which the page passes in; there is no scroll spy
402
+ inside.
403
+ - **`FullBleedLayout`**: use this for a viewer that needs the whole width. Render it in
404
+ `<AppShell bleed>`; `children` fill the width, and an optional `aside` takes `lg:w-72` on the
405
+ right and stacks below under `lg`. It adds no padding, so a viewer fills the width; set `padded`
406
+ for a body that is not a viewer, which gives the canvas the other layouts' page padding. A `bar`
407
+ (a viewer's title and actions) runs full width above both on the surface with a bottom line, and
408
+ sticks under the shell's header as the page scrolls; `padded` does not pad it. `asideLabel` names
409
+ the `<aside>` landmark.
410
+
411
+ **`FullBleedLayout` deliberately breaks the shared start edge from `lg` up.** An edge-to-edge
412
+ viewer needs the viewport's edges, so it cannot sit inside the Container the header uses. At
413
+ 1280 px the header logo and every other layout start at x=88, `FullBleedLayout`'s `children` at
414
+ x=0 (unless `padded`). Below `lg` it stacks and agrees with the other layouts. To avoid the shift
415
+ between pages, give a whole section of an app the same layout rather than mixing it with
416
+ `ListLayout` pages that a user moves between; the header, which stays inside the Container, is
417
+ the constant. The title's y also
418
+ differs from `ListLayout` only when one page passes `breadcrumbs` and the other does not:
419
+ `PageHeader` puts them above the title in every layout.
420
+ - **`CenteredLayout`**: use this for sign-in, landing, not-found and error pages. A `max-w-md` card
421
+ centred at a fixed offset from the top; the one layout that does not share the start edge.
422
+
423
+ ```tsx
424
+ <AppShell brand={<AppShellBrand logo={<Logo />} label="Quotes" href="/" />} nav={nav}>
425
+ <ListLayout title="Quotes" actions={<Button>New</Button>} filters={<Fieldset …/>}
426
+ empty={<EmptyState title="No quotes yet." />}>
427
+ {quotes.map(…)}
428
+ </ListLayout>
429
+ </AppShell>
430
+ ```
431
+
432
+ ## Copy on a static page
433
+
434
+ `CopyButton` copies from a React click handler, so on a page rendered to static HTML and never
435
+ hydrated (an Astro page whose body is not an island) it draws and does nothing. Inline `copyScript`
436
+ once, as you do `colourSchemeScript`, and every copy button works there, `CopyLine` and a `CodeBlock`
437
+ or `CodeExample` with `copy` included. It is one click listener on `document`; in Astro, use
438
+ `<script is:inline set:html={copyScript} />`. A hydrated button and the script share each click and
439
+ copy it once between them, so the script is safe on a hydrated page too.
440
+
441
+ ## Light and dark
442
+
443
+ A dark theme does its colour work under `.dark`; this only decides whether `.dark` is on `<html>`.
444
+ Two states, light and dark. The stored choice wins; with nothing stored the system's
445
+ `prefers-color-scheme` decides. Which dark theme is loaded stays your CSS import.
446
+
447
+ 1. **Inline `colourSchemeScript` in `<head>`**, before the stylesheet, so the class is right at
448
+ first paint and neither scheme flashes the other. It is a few hundred bytes of plain JavaScript:
449
+
450
+ ```tsx
451
+ import { colourSchemeScript } from "@slashsuite/ui-react";
452
+
453
+ <head>
454
+ <script dangerouslySetInnerHTML={{ __html: colourSchemeScript }} />
455
+ </head>;
456
+ ```
457
+
458
+ In Astro, use `<script is:inline set:html={colourSchemeScript} />`.
459
+
460
+ 2. **Drop the hard-coded `class="dark"`** from `<html>`. The script sets and removes it (and
461
+ `color-scheme`, so native controls and scrollbars follow). For a server-rendered `<html>`, add
462
+ `suppressHydrationWarning` (React) because the script changes its `class` before React hydrates.
463
+
464
+ 3. **Place the toggle** wherever the header wants it:
465
+
466
+ ```tsx
467
+ import { ColourSchemeToggle } from "@slashsuite/ui-react";
468
+
469
+ <ColourSchemeToggle onChange={(scheme) => track(scheme)} />;
470
+ ```
471
+
472
+ It is an icon button showing the scheme you would switch *to* (a sun on a dark page, a moon on a
473
+ light one), labelled "Switch to light theme" / "Switch to dark theme". A click applies the scheme
474
+ to `<html>` and stores it under `localStorage["hackcove:colour-scheme"]`; a storage error (private
475
+ mode) is swallowed and the page still switches. It reads the current state from the `dark` class
476
+ when it mounts, so it agrees with the script and renders the same on the server and the client.
477
+ It draws both icons and a small `<style>` shows one from the class on `<html>`, so a dark visitor
478
+ with no cookie and no `defaultValue` sees the sun from the first frame, not the server's light-page moon;
479
+ the button's name is drawn the same way (both names are in the markup, visually hidden, and the
480
+ rule hides the wrong one), so a screen reader hears the right one before hydration too, with no
481
+ script. Only the tooltip waits for hydration.
482
+
483
+ 4. **A light theme with a class of its own, or a scheme the server knows.** An app that picks the
484
+ scheme from a cookie and whose light theme has a scope class passes both:
485
+
486
+ ```tsx
487
+ import { ColourSchemeToggle, schemeClass } from "@slashsuite/ui-react";
488
+
489
+ const schemes = { light: "my-light", dark: "dark" }; // default: { light: "", dark: "dark" }
490
+
491
+ <html className={schemeClass(scheme, schemes)}>
492
+ <ColourSchemeToggle schemes={schemes} defaultValue={scheme} onChange={(next) => saveCookie(next)} />
493
+ ```
494
+
495
+ Leave `colourSchemeScript` out here: it knows only the `dark` class and the stored choice, so it would fight the server. `schemes` is the class each scheme puts on `<html>`; a click swaps them. `defaultValue` is the scheme the
496
+ server rendered: the server markup, the hydrating client and the `<html>` class (from
497
+ `schemeClass`) then agree, with no flash. Persist the choice from `onChange`; the toggle still
498
+ writes `localStorage`, which an app reading a cookie simply ignores. With neither prop nothing
499
+ changes: `dark` on and off, light on the server.
500
+
501
+ **Persisting to a cookie instead of `localStorage`.** Pass `store={false}` (default `true`) and write the
502
+ choice from `onChange`; the toggle then touches no storage at all:
503
+
504
+ ```tsx
505
+ <ColourSchemeToggle
506
+ store={false}
507
+ defaultValue={scheme} // read from the cookie on the server
508
+ onChange={(next) => {
509
+ document.cookie = `scheme=${next}; path=/; max-age=31536000; samesite=lax`;
510
+ // or POST it to the server, which sets the cookie
511
+ }}
512
+ />
513
+ ```
514
+
515
+ The toggle takes `id`, `data-*` and the rest of a button's props, which go on its button. It has no
516
+ `aria-pressed`: its label already says what a click does ("Switch to dark theme"), and a pressed state on a
517
+ button whose label changes would say it twice.
518
+
519
+ Without React, `applyColourScheme(scheme, root?, schemes?)`, `readColourScheme(fallback?)`,
520
+ `storeColourScheme(scheme)` and `schemeClass(scheme, schemes?)` are exported too; `ColourScheme` is
521
+ `"light" | "dark"` and `ColourSchemeClasses` is the `schemes` shape.
522
+
523
+ ## Palette
524
+
525
+ `palette.json` (in the repo, not in the package) lists the colour utilities the components may use,
526
+ by role.
527
+
528
+ | Role | For |
529
+ | ---------- | --------------------------------------------------------------------- |
530
+ | `canvas` | The page behind the cards: `AppShell` paints it. |
531
+ | `surface` | Cards and panels: the main background. |
532
+ | `subtle` | A step off the surface: table stripes, hover rows. |
533
+ | `inset` | A step deeper: wells, chips, pressed fills. |
534
+ | `line` | Borders and dividers. |
535
+ | `ink` | Text, from primary down to muted, plus input placeholders. |
536
+ | `accent` | Primary actions, links, focus rings and controls; text on the accent. |
537
+ | `positive` | Success: fill, text and border. |
538
+ | `warn` | Caution: fill, text and border. |
539
+ | `danger` | Errors and destructive actions: fill, text and border. |
540
+ | `info` | Neutral notes: fill, text and border. |
541
+
542
+ A theme remaps every utility in `palette.json`; a component uses no colour utility outside it.
543
+
544
+ ## Develop
545
+
546
+ From the workspace root: `bunx moon run ui-react:typecheck ui-react:lint ui-react:test ui-react:build` and
547
+ `bunx moon run ui-react:pack-check` (the tarball is `dist/` plus `package.json`, `README.md`, `LICENSE`; it also typechecks the tarball in a
548
+ consumer app: `scripts/consumer-types.ts`).
549
+ The stories live in `apps/storybook`.