@slashsuite/ui-react 0.12.1 → 0.13.1

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 (385) hide show
  1. package/MIGRATING.md +386 -8
  2. package/README.md +89 -44
  3. package/agent-docs/components/app-shell.md +9 -6
  4. package/agent-docs/components/article-layout.md +140 -0
  5. package/agent-docs/components/audio.md +42 -0
  6. package/agent-docs/components/badge.md +2 -1
  7. package/agent-docs/components/body-text.md +26 -15
  8. package/agent-docs/components/bottom-sheet.md +27 -17
  9. package/agent-docs/components/breadcrumbs.md +10 -6
  10. package/agent-docs/components/button.md +2 -2
  11. package/agent-docs/components/call-to-action.md +59 -0
  12. package/agent-docs/components/callout.md +4 -3
  13. package/agent-docs/components/card-grid.md +15 -7
  14. package/agent-docs/components/card.md +33 -18
  15. package/agent-docs/components/cart-button.md +63 -0
  16. package/agent-docs/components/chat-composer.md +4 -3
  17. package/agent-docs/components/checkbox.md +11 -5
  18. package/agent-docs/components/cluster.md +10 -8
  19. package/agent-docs/components/code-example.md +2 -2
  20. package/agent-docs/components/code.md +7 -5
  21. package/agent-docs/components/colour-scheme-toggle.md +12 -6
  22. package/agent-docs/components/colour-swatch.md +41 -0
  23. package/agent-docs/components/combobox.md +88 -0
  24. package/agent-docs/components/confirm-dialog.md +98 -0
  25. package/agent-docs/components/container.md +2 -1
  26. package/agent-docs/components/copy-button.md +7 -5
  27. package/agent-docs/components/copy-line.md +6 -5
  28. package/agent-docs/components/date-field.md +14 -11
  29. package/agent-docs/components/date-range-picker.md +16 -9
  30. package/agent-docs/components/date-time-field.md +73 -0
  31. package/agent-docs/components/dialog.md +22 -68
  32. package/agent-docs/components/disclosure.md +4 -0
  33. package/agent-docs/components/docs-layout.md +10 -6
  34. package/agent-docs/components/drawer.md +13 -4
  35. package/agent-docs/components/embed-frame.md +48 -0
  36. package/agent-docs/components/empty-state.md +4 -1
  37. package/agent-docs/components/field-dialog.md +6 -5
  38. package/agent-docs/components/field.md +10 -7
  39. package/agent-docs/components/fieldset.md +4 -4
  40. package/agent-docs/components/flow-diagram.md +87 -0
  41. package/agent-docs/components/form-layout.md +4 -1
  42. package/agent-docs/components/form-row.md +7 -7
  43. package/agent-docs/components/full-bleed-layout.md +0 -2
  44. package/agent-docs/components/headings.md +13 -7
  45. package/agent-docs/components/hero.md +11 -2
  46. package/agent-docs/components/icon-button.md +1 -3
  47. package/agent-docs/components/icon.md +6 -13
  48. package/agent-docs/components/image.md +24 -14
  49. package/agent-docs/components/input.md +8 -7
  50. package/agent-docs/components/key-value-list.md +4 -1
  51. package/agent-docs/components/lightbox.md +1 -1
  52. package/agent-docs/components/list-layout.md +5 -7
  53. package/agent-docs/components/list-row.md +37 -34
  54. package/agent-docs/components/loading.md +2 -2
  55. package/agent-docs/components/markdown.md +13 -13
  56. package/agent-docs/components/media-tile.md +8 -4
  57. package/agent-docs/components/menu.md +19 -12
  58. package/agent-docs/components/meta-list.md +2 -2
  59. package/agent-docs/components/morph.md +11 -5
  60. package/agent-docs/components/navigation-progress.md +2 -2
  61. package/agent-docs/components/number-field.md +75 -0
  62. package/agent-docs/components/outline-region.md +19 -8
  63. package/agent-docs/components/page-fade.md +2 -1
  64. package/agent-docs/components/pill.md +7 -6
  65. package/agent-docs/components/popover.md +63 -0
  66. package/agent-docs/components/price.md +49 -0
  67. package/agent-docs/components/product-tile.md +78 -0
  68. package/agent-docs/components/promo-banner.md +46 -0
  69. package/agent-docs/components/prose-layout.md +1 -1
  70. package/agent-docs/components/radio-group.md +9 -6
  71. package/agent-docs/components/scroll-strip.md +3 -3
  72. package/agent-docs/components/segmented-control.md +4 -2
  73. package/agent-docs/components/select.md +8 -3
  74. package/agent-docs/components/show.md +2 -2
  75. package/agent-docs/components/side-column.md +13 -9
  76. package/agent-docs/components/sidebar-layout.md +1 -1
  77. package/agent-docs/components/site-footer.md +4 -4
  78. package/agent-docs/components/site-search.md +21 -9
  79. package/agent-docs/components/slider.md +59 -0
  80. package/agent-docs/components/sortable-list.md +15 -10
  81. package/agent-docs/components/stack.md +3 -3
  82. package/agent-docs/components/stacked-bar.md +7 -4
  83. package/agent-docs/components/state-machine.md +95 -0
  84. package/agent-docs/components/status-pages.md +13 -6
  85. package/agent-docs/components/stepper.md +54 -0
  86. package/agent-docs/components/switch.md +4 -4
  87. package/agent-docs/components/table-of-contents.md +78 -0
  88. package/agent-docs/components/table.md +35 -24
  89. package/agent-docs/components/tabs.md +24 -26
  90. package/agent-docs/components/text-link.md +12 -7
  91. package/agent-docs/components/textarea.md +4 -2
  92. package/agent-docs/components/toast.md +19 -14
  93. package/agent-docs/components/video.md +7 -2
  94. package/agent-docs/llms.txt +22 -3
  95. package/dist/AppShell.d.ts +25 -9
  96. package/dist/AppShell.js +67 -33
  97. package/dist/AppShellMenu.d.ts +31 -18
  98. package/dist/AppShellMenu.js +72 -45
  99. package/dist/ArticleLayout.d.ts +36 -0
  100. package/dist/ArticleLayout.js +27 -0
  101. package/dist/Audio.d.ts +16 -0
  102. package/dist/Audio.js +11 -0
  103. package/dist/Badge.d.ts +2 -1
  104. package/dist/Badge.js +3 -2
  105. package/dist/BottomSheet.d.ts +17 -6
  106. package/dist/BottomSheet.js +62 -11
  107. package/dist/Breadcrumbs.d.ts +8 -6
  108. package/dist/Breadcrumbs.js +17 -7
  109. package/dist/Button.d.ts +4 -2
  110. package/dist/Button.js +9 -87
  111. package/dist/CallToAction.d.ts +25 -0
  112. package/dist/CallToAction.js +17 -0
  113. package/dist/Callout.d.ts +2 -2
  114. package/dist/Callout.js +2 -2
  115. package/dist/Card.d.ts +88 -31
  116. package/dist/Card.js +55 -92
  117. package/dist/CardBody.d.ts +2 -0
  118. package/dist/CardBody.js +33 -3
  119. package/dist/CardGrid.d.ts +32 -4
  120. package/dist/CardGrid.js +42 -8
  121. package/dist/CardParts.d.ts +7 -1
  122. package/dist/CardParts.js +7 -2
  123. package/dist/CartButton.d.ts +33 -0
  124. package/dist/CartButton.js +18 -0
  125. package/dist/ChatComposer.d.ts +10 -4
  126. package/dist/ChatComposer.js +35 -13
  127. package/dist/Checkbox.d.ts +21 -3
  128. package/dist/Checkbox.js +66 -20
  129. package/dist/Chevron.js +1 -1
  130. package/dist/Cluster.d.ts +28 -15
  131. package/dist/Cluster.js +21 -4
  132. package/dist/Code.d.ts +15 -3
  133. package/dist/Code.js +23 -3
  134. package/dist/CodeBlock.d.ts +4 -4
  135. package/dist/CodeBlock.js +2 -2
  136. package/dist/CodeBody.d.ts +1 -1
  137. package/dist/CodeBody.js +4 -10
  138. package/dist/CodeExample.d.ts +1 -1
  139. package/dist/CodeExample.js +3 -2
  140. package/dist/ColourSchemeToggle.d.ts +21 -5
  141. package/dist/ColourSchemeToggle.js +15 -9
  142. package/dist/ColourSwatch.d.ts +15 -0
  143. package/dist/ColourSwatch.js +14 -0
  144. package/dist/Combobox.d.ts +42 -0
  145. package/dist/Combobox.js +43 -0
  146. package/dist/ConfirmDialog.d.ts +40 -0
  147. package/dist/ConfirmDialog.js +36 -0
  148. package/dist/Container.d.ts +3 -3
  149. package/dist/Container.js +1 -1
  150. package/dist/CopyButton.d.ts +8 -2
  151. package/dist/CopyButton.js +38 -28
  152. package/dist/CopyLine.d.ts +4 -2
  153. package/dist/CopyLine.js +4 -4
  154. package/dist/DateCalendar.d.ts +2 -0
  155. package/dist/DateCalendar.js +11 -9
  156. package/dist/DateField.d.ts +52 -21
  157. package/dist/DateField.js +73 -37
  158. package/dist/DateFieldCalendar.d.ts +12 -8
  159. package/dist/DateFieldCalendar.js +37 -18
  160. package/dist/DateRangePicker.d.ts +23 -3
  161. package/dist/DateRangePicker.js +10 -8
  162. package/dist/DateTimeField.d.ts +31 -0
  163. package/dist/DateTimeField.js +19 -0
  164. package/dist/Dialog.d.ts +42 -6
  165. package/dist/Dialog.js +50 -12
  166. package/dist/Disclosure.js +9 -1
  167. package/dist/DocsLayout.d.ts +13 -5
  168. package/dist/DocsLayout.js +11 -9
  169. package/dist/Drawer.d.ts +22 -7
  170. package/dist/Drawer.js +89 -8
  171. package/dist/EmbedFrame.d.ts +36 -0
  172. package/dist/EmbedFrame.js +18 -0
  173. package/dist/Field.d.ts +41 -4
  174. package/dist/Field.js +61 -25
  175. package/dist/FieldDialog.d.ts +8 -3
  176. package/dist/FieldDialog.js +19 -9
  177. package/dist/Fieldset.d.ts +3 -3
  178. package/dist/Fieldset.js +7 -9
  179. package/dist/FileDrop.js +2 -1
  180. package/dist/FlowDiagram.d.ts +92 -0
  181. package/dist/FlowDiagram.js +100 -0
  182. package/dist/FormRow.d.ts +6 -4
  183. package/dist/FormRow.js +11 -9
  184. package/dist/Hero.d.ts +30 -7
  185. package/dist/Hero.js +23 -9
  186. package/dist/Icon.d.ts +1 -1
  187. package/dist/Icon.js +1 -1
  188. package/dist/IconButton.js +1 -1
  189. package/dist/Image.d.ts +33 -9
  190. package/dist/Image.js +61 -16
  191. package/dist/Input.d.ts +1 -1
  192. package/dist/Input.js +4 -4
  193. package/dist/InputShell.d.ts +7 -0
  194. package/dist/InputShell.js +18 -3
  195. package/dist/KeyValueList.d.ts +2 -2
  196. package/dist/Lightbox.js +5 -3
  197. package/dist/ListRow.d.ts +4 -5
  198. package/dist/ListRow.js +36 -26
  199. package/dist/Mark.d.ts +10 -0
  200. package/dist/Mark.js +9 -0
  201. package/dist/Markdown.d.ts +18 -4
  202. package/dist/Markdown.js +176 -37
  203. package/dist/MediaTile.d.ts +9 -3
  204. package/dist/MediaTile.js +8 -4
  205. package/dist/Menu.d.ts +19 -8
  206. package/dist/Menu.js +13 -11
  207. package/dist/MetaList.d.ts +4 -3
  208. package/dist/MetaList.js +12 -4
  209. package/dist/Morph.d.ts +15 -1
  210. package/dist/Morph.js +70 -22
  211. package/dist/NavigationProgress.d.ts +2 -2
  212. package/dist/NavigationProgress.js +7 -5
  213. package/dist/NumberField.d.ts +66 -0
  214. package/dist/NumberField.js +68 -0
  215. package/dist/OutlineRegion.d.ts +41 -10
  216. package/dist/OutlineRegion.js +31 -6
  217. package/dist/PageFade.d.ts +9 -5
  218. package/dist/PageFade.js +39 -8
  219. package/dist/PageLayouts.d.ts +15 -5
  220. package/dist/PageLayouts.js +3 -3
  221. package/dist/Pill.d.ts +9 -4
  222. package/dist/Pill.js +15 -6
  223. package/dist/Popover.d.ts +31 -0
  224. package/dist/Popover.js +43 -0
  225. package/dist/Price.d.ts +21 -0
  226. package/dist/Price.js +34 -0
  227. package/dist/ProductTile.d.ts +36 -0
  228. package/dist/ProductTile.js +31 -0
  229. package/dist/ProgressBar.js +4 -2
  230. package/dist/PromoBanner.d.ts +25 -0
  231. package/dist/PromoBanner.js +16 -0
  232. package/dist/RadioGroup.d.ts +18 -8
  233. package/dist/RadioGroup.js +42 -18
  234. package/dist/ScrollStrip.d.ts +1 -1
  235. package/dist/ScrollStrip.js +1 -1
  236. package/dist/SearchInput.d.ts +17 -2
  237. package/dist/SearchInput.js +72 -13
  238. package/dist/SegmentedField.d.ts +15 -0
  239. package/dist/SegmentedField.js +15 -0
  240. package/dist/Select.js +5 -4
  241. package/dist/Show.d.ts +1 -1
  242. package/dist/Show.js +1 -1
  243. package/dist/SideColumn.d.ts +42 -15
  244. package/dist/SideColumn.js +45 -19
  245. package/dist/SiteFooter.d.ts +3 -3
  246. package/dist/SiteFooter.js +4 -3
  247. package/dist/SiteSearch.d.ts +57 -27
  248. package/dist/SiteSearch.js +13 -93
  249. package/dist/Slider.d.ts +27 -0
  250. package/dist/Slider.js +58 -0
  251. package/dist/SortableList.d.ts +19 -35
  252. package/dist/SortableList.js +36 -88
  253. package/dist/Stack.d.ts +4 -4
  254. package/dist/StackedBar.d.ts +13 -4
  255. package/dist/StackedBar.js +12 -7
  256. package/dist/StateMachine.d.ts +65 -0
  257. package/dist/StateMachine.js +116 -0
  258. package/dist/StatusPages.d.ts +28 -10
  259. package/dist/StatusPages.js +10 -10
  260. package/dist/Stepper.d.ts +21 -0
  261. package/dist/Stepper.js +33 -0
  262. package/dist/Steps.js +4 -3
  263. package/dist/Switch.d.ts +3 -3
  264. package/dist/Switch.js +18 -14
  265. package/dist/Table.d.ts +32 -9
  266. package/dist/Table.js +50 -20
  267. package/dist/TableCells.d.ts +24 -21
  268. package/dist/TableCells.js +68 -27
  269. package/dist/TableEditCell.d.ts +1 -1
  270. package/dist/TableOfContents.d.ts +34 -0
  271. package/dist/TableOfContents.js +23 -0
  272. package/dist/Tabs.d.ts +31 -16
  273. package/dist/Tabs.js +97 -22
  274. package/dist/TextLink.d.ts +18 -5
  275. package/dist/TextLink.js +19 -6
  276. package/dist/Textarea.d.ts +12 -1
  277. package/dist/Textarea.js +15 -2
  278. package/dist/ToastRegion.d.ts +17 -9
  279. package/dist/ToastRegion.js +70 -13
  280. package/dist/Tooltip.d.ts +10 -2
  281. package/dist/Tooltip.js +32 -11
  282. package/dist/Video.d.ts +19 -4
  283. package/dist/Video.js +15 -5
  284. package/dist/cardContext.d.ts +7 -0
  285. package/dist/cardContext.js +14 -0
  286. package/dist/cardControl.d.ts +15 -0
  287. package/dist/cardControl.js +32 -0
  288. package/dist/cardForm.d.ts +39 -0
  289. package/dist/cardForm.js +81 -0
  290. package/dist/cardWait.js +2 -1
  291. package/dist/colourScheme.d.ts +12 -2
  292. package/dist/colourScheme.js +32 -6
  293. package/dist/control.d.ts +30 -8
  294. package/dist/control.js +74 -7
  295. package/dist/copyScript.d.ts +7 -8
  296. package/dist/copyScript.js +8 -9
  297. package/dist/core/button.d.ts +33 -0
  298. package/dist/core/button.js +89 -0
  299. package/dist/core/control.d.ts +15 -0
  300. package/dist/core/control.js +14 -0
  301. package/dist/core/fixtures/button.d.ts +26 -0
  302. package/dist/core/fixtures/button.js +52 -0
  303. package/dist/core/fixtures/types.d.ts +13 -0
  304. package/dist/core/fixtures/types.js +10 -0
  305. package/dist/core/focus.d.ts +7 -0
  306. package/dist/core/focus.js +7 -0
  307. package/dist/core/index.d.ts +12 -0
  308. package/dist/core/index.js +12 -0
  309. package/dist/core/parity.d.ts +22 -0
  310. package/dist/core/parity.js +53 -0
  311. package/dist/core/themeNative.d.ts +62 -0
  312. package/dist/core/themeNative.js +290 -0
  313. package/dist/cx.d.ts +17 -5
  314. package/dist/cx.js +18 -5
  315. package/dist/dateLocale.d.ts +17 -0
  316. package/dist/dateLocale.js +30 -0
  317. package/dist/density.d.ts +17 -3
  318. package/dist/density.js +30 -19
  319. package/dist/emptySlot.d.ts +1 -0
  320. package/dist/fieldAnnounce.d.ts +11 -0
  321. package/dist/fieldAnnounce.js +36 -0
  322. package/dist/fieldControl.d.ts +7 -2
  323. package/dist/fieldControl.js +6 -2
  324. package/dist/fieldWait.d.ts +3 -3
  325. package/dist/fieldWait.js +3 -4
  326. package/dist/flowLayout.d.ts +68 -0
  327. package/dist/flowLayout.js +105 -0
  328. package/dist/focus.d.ts +2 -0
  329. package/dist/focus.js +9 -0
  330. package/dist/fromXState.d.ts +73 -0
  331. package/dist/fromXState.js +110 -0
  332. package/dist/icons.d.ts +1 -1
  333. package/dist/icons.js +15 -0
  334. package/dist/index.d.ts +37 -11
  335. package/dist/index.js +24 -2
  336. package/dist/isoDate.d.ts +8 -1
  337. package/dist/isoDate.js +20 -1
  338. package/dist/labelWords.d.ts +16 -7
  339. package/dist/labelWords.js +14 -12
  340. package/dist/listRowProps.d.ts +17 -15
  341. package/dist/modal.d.ts +5 -0
  342. package/dist/modal.js +21 -1
  343. package/dist/navFold.js +6 -3
  344. package/dist/optionCard.d.ts +18 -0
  345. package/dist/optionCard.js +16 -0
  346. package/dist/scrollBody.d.ts +16 -0
  347. package/dist/scrollBody.js +15 -0
  348. package/dist/scrollEdges.d.ts +7 -0
  349. package/dist/scrollEdges.js +39 -5
  350. package/dist/scrollStop.d.ts +6 -2
  351. package/dist/scrollStop.js +24 -8
  352. package/dist/shownDate.d.ts +28 -10
  353. package/dist/shownDate.js +41 -22
  354. package/dist/siteSearchBody.d.ts +34 -0
  355. package/dist/siteSearchBody.js +117 -0
  356. package/dist/size.d.ts +7 -1
  357. package/dist/sortableDrop.d.ts +44 -0
  358. package/dist/sortableDrop.js +78 -0
  359. package/dist/sortableSlide.d.ts +9 -0
  360. package/dist/sortableSlide.js +70 -0
  361. package/dist/sortableTitle.d.ts +10 -0
  362. package/dist/sortableTitle.js +48 -0
  363. package/dist/stateMachineDots.d.ts +77 -0
  364. package/dist/stateMachineDots.js +188 -0
  365. package/dist/stickyColumn.d.ts +2 -2
  366. package/dist/stickyColumn.js +2 -2
  367. package/dist/switcher.d.ts +10 -5
  368. package/dist/switcher.js +7 -5
  369. package/dist/tableColumns.d.ts +17 -0
  370. package/dist/tableColumns.js +30 -2
  371. package/dist/tableEmpty.js +5 -5
  372. package/dist/tableRow.d.ts +26 -2
  373. package/dist/tableRow.js +23 -1
  374. package/dist/tableSort.d.ts +10 -5
  375. package/dist/tableSort.js +15 -4
  376. package/dist/target.d.ts +12 -0
  377. package/dist/target.js +12 -0
  378. package/dist/textBox.js +1 -1
  379. package/dist/truncated.d.ts +31 -0
  380. package/dist/truncated.js +51 -0
  381. package/dist/typography.d.ts +19 -11
  382. package/dist/typography.js +11 -13
  383. package/dist/useFlowLayout.d.ts +38 -0
  384. package/dist/useFlowLayout.js +122 -0
  385. package/package.json +5 -3
@@ -9,38 +9,34 @@ When to use: Tabs switch a panel on the same page. A row of links to other pages
9
9
  - Fieldset (fieldset.md): Toggles that can be on together narrow a list: pressed `Button`s in a `Fieldset`, one per facet.
10
10
 
11
11
  ### The one right way
12
- `Tabs` switches a view in place; the panel it controls sits right under the row.
12
+ `Tabs` switches a view in place: each tab carries its `panel`, drawn right under the row.
13
13
  ```tsx
14
14
  import { useState } from "react";
15
- import { Tabs, Stack, Text } from "@slashsuite/ui-react";
15
+ import { Tabs, Text } from "@slashsuite/ui-react";
16
16
 
17
17
  function Example() {
18
18
  const [value, setValue] = useState("overview");
19
19
  return (
20
- <Stack>
21
- <Tabs
22
- label="Project views"
23
- value={value}
24
- onChange={setValue}
25
- items={[
26
- { value: "overview", label: "Overview", controls: "panel" },
27
- { value: "activity", label: "Activity", controls: "panel" },
28
- { value: "settings", label: "Settings", controls: "panel" },
29
- ]}
30
- />
31
- <Text id="panel" role="tabpanel">
32
- Showing {value}.
33
- </Text>
34
- </Stack>
20
+ <Tabs
21
+ label="Project views"
22
+ value={value}
23
+ onChange={setValue}
24
+ items={[
25
+ { value: "overview", label: "Overview", panel: <Text>The project at a glance.</Text> },
26
+ { value: "activity", label: "Activity", panel: <Text>What changed this week.</Text> },
27
+ { value: "settings", label: "Settings", panel: <Text>Who can see the project.</Text> },
28
+ ]}
29
+ />
35
30
  );
36
31
  }
37
32
  ```
38
33
 
39
34
  ### Do
40
- - `Tabs` switches a view in place; the caller owns `value` and `onChange`, and the panel sits right under the row.
35
+ - `Tabs` switches a view in place: each tab carries its `panel`, which Tabs draws under the row (beside the rail); the caller owns `value` and `onChange`.
36
+ - Every panel is mounted, the hidden ones too, so find in page reaches them. A view too heavy to mount before it is chosen is `null` until its tab is current (`panel: value === "a" ? <ViewA /> : null`), and find in page then skips it.
41
37
  - Going to another page is link items (`href`, and `selected` on the current one): links, so the URL, the back button and a new tab all work.
42
38
  - A `count` sits muted after the label and is read as part of the tab's name.
43
- - Across, tabs are always underline, under a `PageHeader` too. `orientation="vertical"` is the pill rail, the current tab filled, for a `SidebarLayout` aside, and only the rail takes `size`.
39
+ - Across, tabs are always underline, under a `PageHeader` too: one line that scrolls sideways, with a fade, when it is too wide. `orientation="vertical"` is the pill rail, the current tab filled, for a `SidebarLayout` aside, and only the rail takes `size`.
44
40
  - `size` (`sm`, `md` the default, `lg`) sets the vertical rail on the control scale, so it lines up with a `Button` of the same size; the underline row has one size.
45
41
  - A tab that cannot be chosen yet takes a `disabledReason` that says why.
46
42
  - Pill links with `orientation="vertical"` are the rail of a `SidebarLayout`: one link per line.
@@ -158,23 +154,25 @@ import { Button, Stack } from "@slashsuite/ui-react";
158
154
  ### Accessibility
159
155
  - The row is a tab list named by `label`; the arrow keys, Home and End move between the tabs, and a `disabled` tab is skipped.
160
156
  - A tab with `disabledReason` is `aria-disabled`: the arrow keys reach it and choose nothing, and the reason shows as a tooltip on hover, keyboard focus and a tap, read out as its description (the native `title` without CSS anchor positioning).
161
- - Give the panel `role="tabpanel"` and a tab `controls` that points at its `id`.
157
+ - A tab's `panel` is a `tabpanel` labelled by the tab and named in its `aria-controls`; a hidden one is `hidden="until-found"` where the browser has it, so find in page reaches its text and switches to the tab.
158
+ - The current tab is told apart by more than colour: the underline, and on the rail an outline round the fill. Every tab has the same weight, so choosing one does not shift the row.
162
159
  - A tab is a `button` with `role="tab"` and `aria-selected`; only the current tab is in the tab order, and the arrow keys move and choose.
163
160
  - Link items form a `<nav>` named by `label`; the current link gets `aria-current="page"`.
164
161
 
165
162
  ### Props
166
163
  ### Tabs
167
- Tabs for switching a view in place or between pages. Across (the default) they are underline tabs: a row over a bottom rule, the current tab underlined in the accent. `orientation="vertical"` is the pill rail instead, the current tab filled, for a `SidebarLayout` aside, and takes a `size`. `items` are `{ value, label }` buttons (`value` and `onChange` are the caller's state; the arrow keys, Home and End move between tabs) or links (`href`, an in-app one through `LinkProvider`; `selected` on an item, or `value`, marks the current one, which gets `aria-current`). An item may carry a `count`, and a button one `disabledReason` (it stays reachable by the arrows and its reason is a tooltip) or a bare `disabled`; `disabled` on the row disables every tab. `label` names the tab list. The panel is the caller's: give it `role="tabpanel"`, and a tab `controls` to point at it.
164
+ Tabs for switching a view in place or between pages. Across (the default) they are underline tabs: one line over a bottom rule, the current tab underlined in the accent, scrolling sideways with a fade when the row is too wide. `orientation="vertical"` is the pill rail instead, the current tab filled and outlined, for a `SidebarLayout` aside, and takes a `size`. `items` are `{ value, label, panel }` buttons (`value` and `onChange` are the caller's state; the arrow keys, Home and End move between tabs) or links (`href`, an in-app one through `LinkProvider`; `selected` on an item, or `value`, marks the current one, which gets `aria-current`). A button's `panel` is rendered as its `tabpanel`, wired to the tab and hidden while another is current. An item may carry a `count`, and a button one `disabledReason` (it stays reachable by the arrows and its reason is a tooltip) or a bare `disabled`; `disabled` on the row disables every tab. `label` names the tab list.
168
165
  - disabled: boolean. Every option is disabled, e.g. until the page has hydrated.
169
166
  - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
170
- - items: Tab[] (required). The options in order: `{ value, label }` buttons, or links (`href`), the current link marked by its `selected` or by a `value` equal to the group's. Either may carry a `count`; a button may be `disabled`.
167
+ - items: Tab[] | TabButton[] (required). The options in order: `{ value, label }` buttons, or links (`href`), the current link marked by its `selected` or by a `value` equal to the group's. Either may carry a `count`; a button may be `disabled`.
171
168
  - label: string (required). The accessible name of the group.
172
169
  - onChange: ((value: string) => void). Called with the option's `value` when one is chosen, by click or arrow key.
173
- - orientation: "horizontal" | "vertical" (default horizontal). `horizontal` is a row of underline tabs over a bottom rule; `vertical` is the pill rail, a
174
- column at the rail's width for a `SidebarLayout` aside, where the up and down arrows move
175
- between button tabs.
170
+ - orientation: "horizontal" | "vertical" (default horizontal). `horizontal` is a row of underline tabs over a bottom rule, one line that scrolls
171
+ sideways when it is too wide; `vertical` is the pill rail, a column at the rail's width
172
+ for a `SidebarLayout` aside, where the up and down arrows move between button tabs.
176
173
  - size: "sm" | "md" | "lg" (default md). The pills' height and text, on the scale of a `Button`. Only the vertical rail takes a `size`.
177
174
  - value: string. The `value` of the current option; for links, an alternative to `selected` on the item.
178
175
 
179
176
  ### Types
180
- - Tab: `{ label: ReactNode; count?: number; title?: string; value: string; disabled?: boolean; disabledReason?: string; controls?: string } | { label: ReactNode; count?: number; title?: string; value?: string; selected?: boolean; external?: boolean; href: string }`. One tab of a Tabs row: a button with a `value`, or a link with an `href`; never both kinds in one row.
177
+ - Tab: `TabButton | SwitchLink`. One tab of a Tabs row: a button with a `value`, or a link with an `href`; never both kinds in one row.
178
+ - TabButton: `{ label: ReactNode; count?: number; title?: string; value: string; disabled?: boolean; disabledReason?: string; panel?: ReactNode }`. A button tab; its `panel` is the view it shows, rendered by Tabs under (or beside) the row.
@@ -13,20 +13,20 @@ A link in running text is a `TextLink` inside a `Text`.
13
13
  import { Text, TextLink } from "@slashsuite/ui-react";
14
14
 
15
15
  <Text>
16
- Questions? Email <TextLink href="mailto:hello@example.com">hello@example.com</TextLink>, or
17
- read the <TextLink href="#terms">terms</TextLink> first.
16
+ Questions? Email <TextLink href="mailto:hello@example.com">hello@example.com</TextLink>, or read
17
+ the <TextLink href="#terms">terms</TextLink> first.
18
18
  </Text>
19
19
  ```
20
20
 
21
21
  ### Do
22
- - Use `TextLink` for every link in running text.
23
- - `external` is for another site: it opens a new tab with `rel="noreferrer"`.
22
+ - Use `TextLink` for every link in running text. `external` is for another site: it opens a new tab with `rel="noreferrer"`.
24
23
  - In an app with a router, set the router's `<Link>` once on a `LinkProvider` and give each `TextLink` its `href`. The library has no router.
25
24
  - Set the adapter once, at the router. TanStack Router: `InnerWrap: ({ children }) => <LinkProvider link={(p) => <Link to="." {...p} />}>{children}</LinkProvider>` on `createRouter` (`to="."` satisfies the typed `to`; the `href` wins). React Router: `<LinkProvider link={({ href, ...p }) => <Link to={href} {...p} />}>`. Astro: no provider.
26
25
  - `home` on the same `LinkProvider` is where every status page's "Back to home" goes, `/` by default (`home="https://example.com"` with no `link` for a home on another site). A provider inside another keeps what it does not set.
27
26
  - Only an in-app path (`/quotes?page=2#top`) reaches the adapter; `external`, `https:`, `mailto:`, `#hash` and a relative path are a plain `<a>`.
28
27
  - `size` pins the type size to `sm`, `md` or `lg`; left out, the link takes the size of its text. `mono` sets the monospace face for a path or an id.
29
28
  - `tone` gives the link a meaning's colour (`warn`, `danger`, `positive`, `info`, `muted`), underlined on hover. Use it for a link that is the message, like "3 failed". `underline` underlines it always: set it where the text around the link is as heavy as the link (a `Text strong`, a heading), since colour alone does not mark a link (WCAG 1.4.1); in plain `Text` its weight marks it.
29
+ - `icon` draws a small glyph after the text (`chevron-right` for "See all"); it is hidden from assistive tech, so the text alone names the link. `tone="quiet"` is the primary ink and turns the accent on hover, for a row or list of links that should not shout, like a footer; never inside a sentence, where it would read as plain text.
30
30
 
31
31
  ### Don't
32
32
  - Never write a bare `<a>` for a link in running text.
@@ -76,12 +76,14 @@ import { Card, TextLink } from "@slashsuite/ui-react";
76
76
  - It has a focus ring from the component, so the keyboard focus is always visible.
77
77
  - `external` sets `target="_blank"` and `rel="noreferrer"`.
78
78
  - Every anchor prop (`aria-*`, `download`, `title`, a handler) goes on the `<a>`; the app's `LinkProvider` adapter receives them as well.
79
+ - The `icon` glyph is `aria-hidden`, so the link's name is its text alone.
79
80
 
80
81
  ### Props
81
82
  ### TextLink
82
- An inline text link in the accent colour. Every anchor prop goes on the `<a>`; an in-app `href` is drawn by the app's router link through `LinkProvider`. `size` pins the type size (`sm`, `md` or `lg`), `tone` gives it a meaning's colour and `mono` sets the monospace face.
83
+ An inline text link in the accent colour. Every anchor prop goes on the `<a>`; an in-app `href` is drawn by the app's router link through `LinkProvider`. `size` pins the type size (`sm`, `md` or `lg`), `tone` gives it a meaning's colour (or `quiet`, ink that turns the accent on hover) and `mono` sets the monospace face. `icon` puts one of the library's icons after the words, hidden from assistive tech: the words name the link.
83
84
  - external: boolean (default false). Opens in a new tab: adds `target="_blank"` and `rel="noreferrer"`.
84
85
  - href: string (required). Where the link goes; an in-app path goes through the app's `LinkProvider`.
86
+ - icon: "page" | "grid" | "search" | "alert" | "table" | "type" | "diff" | "baseline" | "review" | "ci" | "self-host" | "privacy" | "capture" | "branch" | "theme" | "speed" | "chevron-right" | "chevron-down" | "close" | "external-link" | "settings" | "bell" | "check" | "plus" | "minus" | "more" | "window" | "card" | "pointer" | "field" | "compass" | "briefcase" | "cart" | "pause" | "play". An icon after the words (`chevron-right`, say), at one size on the baseline; it is decorative and hidden from assistive tech.
85
87
  - mono: boolean (default false). The monospace face, for a path, an id or a command.
86
88
  - size: "sm" | "md" | "lg". The link's own type size: `sm` is `text-xs`, `md` `text-sm` and `lg` `text-base`. Left out, it
87
89
  takes the size of the text around it: a link inside prose has no default size.
@@ -90,8 +92,10 @@ takes the size of the text around it: a link inside prose has no default size.
90
92
  Put it on the one link of a `Card` or a `TableRow` (a table row's first cell): any other link
91
93
  or button in it sits above the link and is clickable on its own. An action that is not
92
94
  navigation stays a `Button` in an actions column.
93
- - tone: "neutral" | "info" | "positive" | "warn" | "danger" | "muted" | "accent". A meaning's colour, as on the inline roles: `warn` for a warning link, `danger`, `positive`,
94
- `info` or `muted`. Left out, the link is the accent colour.
95
+ - tone: "muted" | "neutral" | "info" | "positive" | "warn" | "danger" | "accent" | "quiet". A meaning's colour, as on the inline roles: `warn` for a warning link, `danger`, `positive`,
96
+ `info` or `muted`; or `quiet`, the primary ink at rest and the accent on hover, for a row or list
97
+ of links and never inside a sentence. Left out, the
98
+ link is the accent colour.
95
99
  - underline: boolean (default false). Always underlined, for a link set inside running text, where colour alone does not mark it (WCAG 1.4.1).
96
100
 
97
101
  ### LinkProvider
@@ -103,3 +107,4 @@ Names the app's router link once, so every part that links (`Button`, `IconButto
103
107
  - LinkAdapter: `(props: LinkAdapterProps) => ReactNode`. Draws one in-app link: the app's router `<Link>`, handed `LinkAdapterProps`.
104
108
  - LinkAdapterProps: `{ href: string; className: string; children: ReactNode; aria-current?: boolean | "page" | "time" | "false" | "true" | "step" | "location" | "date"; target?: string; rel?: string; title?: string }`. What the app's `LinkAdapter` receives to draw an in-app link with its router's `<Link>`: the destination as `href` (search and hash included), the component's classes, its label as `children`, and (for a tab that is current, or an option with a tooltip) `aria-current`, `target`, `rel` and `title`. `@slashsuite/ui-react` has no router dependency. An optional field is `?: T`, never `?: T | undefined`, and a key that has no value is left out rather than set to `undefined`. A router's `<Link>` declares its props that way, so under `exactOptionalPropertyTypes` the spread compiles. Any other anchor prop the caller gave the component (`id`, `data-*`, `download`, a handler) arrives too, untyped here, and `<Link>` takes it as its own.
105
109
  - TextLinkSize: `"sm" | "md" | "lg"`. A TextLink's pinned type size, on the `Size` scale; left out, it takes the size of the text around it.
110
+ - TextLinkTone: `TextTone | "quiet"`. A TextLink's colour: a text tone, as on the inline roles, or `quiet`, the primary ink at rest and the accent on hover, for a link in a row or list of links (a footer row, a table of contents), never inside a sentence, where with no colour or underline at rest it reads as plain text. This extends `TextTone` outward with `quiet`, a look only a link has.
@@ -45,7 +45,9 @@ A multi-line text input, styled like `Input`. `rows` defaults to 3. Takes `size`
45
45
  - placeholder: string (native). A hint shown while the field is empty; never the label.
46
46
  - ref: Ref<HTMLTextAreaElement>. The `<textarea>` itself, for focus control.
47
47
  - rows: number (native). How many lines tall it starts.
48
- - size: "sm" | "md" | "lg" (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
48
+ - size: Size | ResponsiveSize (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
49
49
  `lg` is `text-lg` with more padding, for a hero form. Under an `AppShell density="compact"` each
50
50
  is one type step down, and on a touch screen a field is never under 16px.
51
- - width: "sm" | "md" | "lg" | "xs" | "auto" | "fill" | "full" (default full). `full` (default) fills the parent; `fill` grows to fill the room left in a row beside other items (it can shrink to nothing, so buttons stay on the line); `xs`, `sm`, `md`, `lg` are fixed; `auto` adds no width class, so the control is as wide as the browser makes it.
51
+ `{ base: "md", md: "lg" }` changes size at the `md` breakpoint (48rem), in CSS, as a `Button`'s
52
+ does: give the field and the buttons in its row the same value, so the row stays aligned.
53
+ - width: "sm" | "md" | "lg" | "auto" | "xs" | "fill" | "full" (default full). `full` (default) fills the parent; `fill` grows to fill the room left in a row beside other items (it can shrink to nothing, so buttons stay on the line); `xs`, `sm`, `md`, `lg` are fixed; `auto` adds no width class, so the control is as wide as the browser makes it.
@@ -4,8 +4,11 @@ Group: Feedback
4
4
 
5
5
  When to use: A confirmation or an offer that should not move the page: Saved, Copied, Update available.
6
6
 
7
+ ### Use instead
8
+ - ConfirmDialog (confirm-dialog.md): The action needs a yes or no before it runs.
9
+
7
10
  ### The one right way
8
- A confirmation is a toast the app adds to the list it holds: it leaves on its own after five seconds.
11
+ A confirmation is a toast the app adds to the list it holds: it leaves on its own after eight seconds.
9
12
  ```tsx
10
13
  import { useState } from "react";
11
14
  import { Button, Toast, ToastRegion } from "@slashsuite/ui-react";
@@ -25,7 +28,7 @@ function Example() {
25
28
  Save
26
29
  </Button>
27
30
  <ToastRegion
28
- toasts={toasts}
31
+ items={toasts}
29
32
  onDismiss={(id) => setToasts((all) => all.filter((toast) => toast.id !== id))}
30
33
  />
31
34
  </>
@@ -35,9 +38,9 @@ function Example() {
35
38
 
36
39
  ### Do
37
40
  - Mount one `ToastRegion` at the root of the app, beside `AppShell`, and hold the list in state: add a `Toast` to show it, and drop it by `id` in `onDismiss`.
38
- - Each toast is a `title`, an optional `body` line and a `tone` (`neutral`, the default, `info`, `positive`, `warn` or `danger`), on the same surfaces as a `Callout`.
39
- - A `neutral`, `info` or `positive` toast with no `actions` leaves on its own after five seconds, paused while the pointer is over it or focus is in it. One action goes in `actions` as a `Button size="sm"`; a toast with `actions`, or a `warn` or `danger` one, stays until it is dismissed.
40
- - A toast raised while a `Dialog` or `Drawer` is open sits under it, and can be read and dismissed once it closes.
41
+ - Each toast is a `title`, an optional `description` line and a `tone` (`neutral`, the default, `info`, `positive`, `warn` or `danger`), on the same surfaces as a `Callout`.
42
+ - A `neutral`, `info` or `positive` toast with no `actions` leaves on its own after eight seconds, paused while the pointer is over it or focus is in it. One action goes in `actions` as a `Button size="sm"`; a toast with `actions`, or a `warn` or `danger` one, stays until it is dismissed.
43
+ - A toast raised while a `Dialog`, `Drawer` or `Lightbox` is open waits: it shows, is read and starts its hide only once the modal closes.
41
44
  - Anything the reader must keep, such as a token shown once, is a `Callout` in the page. A failure that must be answered is a `Dialog`, and a field's error is its `Field`'s.
42
45
 
43
46
  ### Don't
@@ -51,36 +54,38 @@ import { Callout, Stack, Text } from "@slashsuite/ui-react";
51
54
  </Stack>
52
55
  ```
53
56
 
54
- An action put in `body` is not an action to the region: the toast still leaves after five seconds, taking the button with it before the reader reaches it.
57
+ An action put in `description` is not an action to the region: the toast still leaves after eight seconds, taking the button with it before the reader reaches it.
55
58
  ```tsx
56
59
  import { Button, ToastRegion } from "@slashsuite/ui-react";
57
60
 
58
61
  <ToastRegion
59
62
  onDismiss={() => undefined}
60
- toasts={[
63
+ items={[
61
64
  {
62
65
  id: "update",
63
66
  tone: "info",
64
67
  title: "Update available",
65
- body: <Button size="sm">Reload</Button>,
68
+ description: <Button size="sm">Reload</Button>,
66
69
  },
67
70
  ]}
68
71
  />
69
72
  ```
70
73
 
71
74
  ### Accessibility
72
- - The region is a landmark named by `label` ("Notifications") with a polite `role="status"` inside, in the page before the first toast, so each new toast is read once and the focus does not move.
73
- - Each toast's close button is named by `dismissLabel` ("Dismiss").
75
+ - The region is a landmark named by `label` ("Notifications") with a polite `role="status"` inside, in the page before the first toast. Each new toast is read once, as text (its title and description), and the focus does not move. A `danger` toast is read through a `role="alert"` beside it instead, so it interrupts.
76
+ - A toast with `actions` is read with `actionsLabel` ("Actions available") after it, never with the buttons themselves, so a reader knows to go to the region.
77
+ - Each toast's close button is named by `dismissLabel` ("Dismiss"). Dismissing it moves the focus to the next toast's close button, or back to where it was before the region took it.
74
78
  - The hide pauses on hover and on focus, and under `prefers-reduced-motion` it still leaves at the same moment, with no fade.
75
79
 
76
80
  ### Props
77
81
  ### ToastRegion
78
- 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`; add a toast to `toasts` to show it, and drop it in `onDismiss` to remove it. A `neutral`, `info` or `positive` toast with no `actions` leaves on its own after five seconds (paused while the pointer is over it or focus is in it); a `warn` or `danger` toast, or one with `actions`, stays until dismissed. The region is a named landmark with a polite `role="status"`, kept in the page while empty, so each new toast is read once. A toast raised while a `Dialog` or `Drawer` is open sits under it until it closes.
82
+ 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`; add a toast to `items` to show it, and drop it in `onDismiss` to remove it. A `neutral`, `info` or `positive` toast with no `actions` leaves on its own after eight seconds (paused while the pointer is over it or focus is in it); a `warn` or `danger` toast, or one with `actions`, stays until dismissed. The region is a named landmark with a polite `role="status"` kept in the page while empty, which reads each new toast's text once, followed by "Actions available" when it has actions; its buttons are not read out. A `danger` toast is read through a `role="alert"` beside it instead, so it interrupts. Dismissing the toast that holds focus moves focus to the next toast, or back where it was. A toast raised while a `Dialog`, `Drawer` or `Lightbox` is open is held back (those already shown stay), shown and read once the modal has closed.
83
+ - actionsLabel: string (default Actions available). Read after a toast that has `actions`, so a screen reader user knows to go and find them.
79
84
  - dismissLabel: string (default Dismiss). The close button's name.
80
85
  - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
86
+ - items: readonly Toast[] (required). What is shown, oldest first. `[]` shows nothing and keeps the live region in the page.
81
87
  - label: string (default Notifications). The region's accessible name.
82
- - onDismiss: (id: string) => void (required). Called by a toast's close button and when a self-hiding toast's time is up: drop it from `toasts`.
83
- - toasts: readonly Toast[] (required). What is shown, oldest first. `[]` shows nothing and keeps the live region in the page.
88
+ - onDismiss: (id: string) => void (required). Called by a toast's close button and when a self-hiding toast's time is up: drop it from `items`.
84
89
 
85
90
  ### Types
86
- - Toast: `{ id: string; title: string; body?: ReactNode; tone?: Tone; actions?: ReactNode }`. One notice in a `ToastRegion`. The caller holds the list; the region draws it.
91
+ - Toast: `{ id: string; title: string; description?: ReactNode; tone?: Tone; actions?: ReactNode }`. One notice in a `ToastRegion`. The caller holds the list; the region draws it.
@@ -6,6 +6,8 @@ When to use: Showing a recording or a walkthrough that your app serves.
6
6
 
7
7
  ### Use instead
8
8
  - MediaTile (media-tile.md): The video is one of a set of things to open: a tile with `video`.
9
+ - Audio (audio.md): The recording is sound only: a voice note or a clip.
10
+ - EmbedFrame (embed-frame.md): The video is a third party's player in an `<iframe>`.
9
11
 
10
12
  ### The one right way
11
13
  `captions` is a WebVTT file offered as the default track; `children` is the text for a browser that cannot play it.
@@ -18,7 +20,8 @@ import { Video } from "@slashsuite/ui-react";
18
20
  ```
19
21
 
20
22
  ### Do
21
- - `src` is your own video file. It loads only the metadata until it is played, so the page does not pull the whole file.
23
+ - `src` is your own video file. It loads only the metadata until it is played, and lazily where the browser can, so the page does not pull the whole file.
24
+ - `aspect` is the player's shape, `16:9` unless set: `square`, `4:3`, `3:2`, `16:10`, `16:9`, the portrait `3:4` and `9:16`. The shape is reserved before the video loads, and a clip of another shape fits inside it, letterboxed.
22
25
  - Give a `captions` WebVTT file for any video with speech; it is offered as the default track.
23
26
  - `poster` is the image shown before play; use a local one.
24
27
  - The children are the text for a browser that cannot play the video.
@@ -38,7 +41,9 @@ import { Video } from "@slashsuite/ui-react";
38
41
 
39
42
  ### Props
40
43
  ### Video
41
- A `<video>` with controls, full width and rounded; it loads metadata only, so the page does not pull the file until it is played. `src` is the app's own video; `captions` is a WebVTT file, offered as the default track. `children` is the fallback for a browser that cannot play it.
44
+ A `<video>` with controls, full width and rounded, in a fixed shape: `aspect` reserves its space before it loads, so the page does not jump, and the video fits inside it whole. It loads metadata only, and lazily where the browser can, so the page does not pull the file until it is played. `src` is the app's own video; `captions` is a WebVTT file, offered as the default track. `children` is the fallback for a browser that cannot play it.
45
+ - aspect: "square" | "4:3" | "3:2" | "16:10" | "16:9" | "3:4" | "9:16" (default 16:9). The shape it reserves, as `Image`'s `aspect`: `16:9`, `16:10`, `4:3`, `3:2`, `square`, or the
46
+ portrait `3:4` and `9:16`. A video of another shape fits inside it, letterboxed.
42
47
  - captions: string. A WebVTT file, offered as the default captions track.
43
48
  - poster: string (native). The image shown before play; use a local one.
44
49
  - src: string (required). The video file, the app's own.
@@ -61,6 +61,7 @@ Each component page is its own file under `components/`: the one right way, do a
61
61
  - DetailLayout (components/detail-layout.md): One quote, build or member, with its content in the main column and its facts in the aside.
62
62
  - FormLayout (components/form-layout.md): Creating or editing a record on a page of its own.
63
63
  - ProseLayout (components/prose-layout.md): Privacy, terms, help or any page that is mostly paragraphs.
64
+ - ArticleLayout (components/article-layout.md): A blog post, a news item or a recipe: writing with an author and a date.
64
65
  - SidebarLayout (components/sidebar-layout.md): A section with several sub-pages, such as settings, where the rail is the way between them.
65
66
  - DocsLayout (components/docs-layout.md): Every page of a docs site: a nav of grouped pages, an article with its own headings, and previous and next in reading order.
66
67
  - FullBleedLayout (components/full-bleed-layout.md): A viewer that needs the whole width, such as a snapshot, a canvas or a player; an ordinary page is not.
@@ -69,11 +70,11 @@ Each component page is its own file under `components/`: the one right way, do a
69
70
  ### Text
70
71
  - Headings (components/headings.md): Any title on a page: the public headline, the page title, a section, a subsection.
71
72
  - Prose (components/prose.md): The body of a docs page or an article, where a reader scans headings. An app screen never uses it.
72
- - Body text (components/body-text.md): Every run of text that is not a heading: a paragraph, a supporting line, a note, a label, the line in an empty Card.
73
+ - Body text (components/body-text.md): Every run of text that is not a heading: a paragraph, a supporting line, a note, a label.
73
74
  - Code (components/code.md): A command, name or path inside a sentence is `Code`; several lines of code are a `CodeBlock`.
74
75
  - CodeExample (components/code-example.md): Documentation that shows a part and its source together.
75
76
  - Kbd (components/kbd.md): A key or a shortcut the reader presses: `Esc`, `?`, `⌘S`.
76
- - Markdown (components/markdown.md): Text that arrives as markdown, such as an agent's summary, shown on a page.
77
+ - Markdown (components/markdown.md): Text that arrives as markdown, such as an agent's summary or a CMS article, shown on a page.
77
78
  - TextLink (components/text-link.md): A link that sits in text. A link that must look like a button is a `Button` with `href`.
78
79
  - BulletList (components/bullet-list.md): Items that read as a list of points: what changed, what to bring.
79
80
  - MetaList (components/meta-list.md): The facts about a record under its title (branch, SHA, date), or a footer's row of links (Privacy, Terms, Contact).
@@ -89,9 +90,17 @@ Each component page is its own file under `components/`: the one right way, do a
89
90
  - Disclosure (components/disclosure.md): Detail the person may not need on first sight: a history, an FAQ answer, the fine print.
90
91
  - KeyValueList (components/key-value-list.md): A set of facts about one thing: size, status, dates, shortcut keys.
91
92
  - Video (components/video.md): Showing a recording or a walkthrough that your app serves.
93
+ - Audio (components/audio.md): Playing a voice note, a recording or a clip that your app serves.
94
+ - EmbedFrame (components/embed-frame.md): Showing a third party's map, player or form in an `<iframe>` inside your page.
95
+ - ColourSwatch (components/colour-swatch.md): Showing a colour as data: one read off a page, a screenshot, a brand or a theme.
92
96
  - Image (components/image.md): Showing a picture that your app serves: a screenshot, a QR code, a product shot.
93
97
  - MediaTile (components/media-tile.md): A photo or video in a grid or a strip, that opens full size when it is picked: a status, a gallery, an attachment.
94
98
  - ScrollStrip (components/scroll-strip.md): A row of media or people that is longer than the page is wide: recent statuses, a team.
99
+ - Price (components/price.md): Showing what something costs: on a product tile, a product's page or a cart line.
100
+ - ProductTile (components/product-tile.md): A shop's grid of products, or a row of them on a landing page.
101
+ - CartButton (components/cart-button.md): A shop's header, to open the cart from any page.
102
+ - CallToAction (components/call-to-action.md): The last block of a landing or product page, before the footer: the one place the page asks the reader to act.
103
+ - PromoBanner (components/promo-banner.md): A shop's offer of the week, above the header or as the page's first block: one line and one action.
95
104
  - ChatThread (components/chat-thread.md): Holding the messages and tool calls of a chat, an agent log or a message thread.
96
105
  - ChatMessage (components/chat-message.md): A message from a person or an assistant inside a `ChatThread`.
97
106
  - ChatComposer (components/chat-composer.md): The foot of a chat, under the `ChatThread`.
@@ -111,6 +120,9 @@ Each component page is its own file under `components/`: the one right way, do a
111
120
  - Input (components/input.md): A short piece of text: a name, an amount, a search term.
112
121
  - Textarea (components/textarea.md): Text that runs to a sentence or a paragraph: a review, a note, a message.
113
122
  - Select (components/select.md): One choice from a list of about five or more: a category, a country, a rating.
123
+ - Combobox (components/combobox.md): One choice from more items than a `Select` reads well: a country, a time zone, a teammate.
124
+ - NumberField (components/number-field.md): A quantity, a count or an amount the person sets exactly: items in a cart, guests, a price.
125
+ - Slider (components/slider.md): A value set by eye where near enough is fine: an opacity, a volume, a price range filter.
114
126
  - Checkbox (components/checkbox.md): An on/off option the person ticks: a setting, a filter, a row to select.
115
127
  - Switch (components/switch.md): A setting that acts the moment it is flipped, usually by saving it to a server: a flag per environment, notifications on or off.
116
128
  - RadioGroup (components/radio-group.md): A setting or answer with two to five options the person should see side by side: a visibility, a delivery method, a type.
@@ -118,6 +130,7 @@ Each component page is its own file under `components/`: the one right way, do a
118
130
  - FormRow (components/form-row.md): `FormGrid` lays Fields out in two columns; `FormRow` puts several controls and a save button on one line.
119
131
  - DateField (components/date-field.md): Any date a person enters; leave `calendar` off for a date the person knows by heart.
120
132
  - DateRangePicker (components/date-range-picker.md): A from and to date: a report period, a timeline filter.
133
+ - DateTimeField (components/date-time-field.md): A moment a person enters: a booking, a meeting's start, a deadline with its hour.
121
134
  - SegmentedControl (components/segmented-control.md): A mode or a range chosen in place: daily or weekly, split or even.
122
135
  - Fieldset (components/fieldset.md): Several controls that answer one question or belong together, under one name.
123
136
 
@@ -130,17 +143,21 @@ Each component page is its own file under `components/`: the one right way, do a
130
143
  - SplitBar (components/split-bar.md): Two sides of one total: a pot split between two goals, for and against.
131
144
  - StackedBar (components/stacked-bar.md): The make-up of one whole in three or more parts: results by status, spend by group.
132
145
  - TrendChart (components/trend-chart.md): A figure over ordered time buckets: weekly counts, a trend.
146
+ - FlowDiagram (components/flow-diagram.md): Things that move from one step to another along named arrows, loops and branches included: a review flow, a deploy pipeline, the states an order goes through.
147
+ - StateMachine (components/state-machine.md): The states a thing goes through and the events that move it, with where each thing is now: tickets in a workflow, orders in fulfilment, jobs in a queue.
133
148
 
134
149
  ### Feedback
135
150
  - Callout (components/callout.md): A message the reader should see in the page, without being made to answer it.
136
151
  - Toast (components/toast.md): A confirmation or an offer that should not move the page: Saved, Copied, Update available.
137
152
  - EmptyState (components/empty-state.md): A whole page or list with no content yet: say what belongs here and offer the first step.
138
153
  - Loading (components/loading.md): Data that is on its way: give the layout or the part `loading` and keep the tree it draws with data.
139
- - Dialog (components/dialog.md): A confirmation or a short form the reader must answer before they go on.
154
+ - Dialog (components/dialog.md): A short form or a message the reader must deal with before they go on.
140
155
  - Drawer (components/drawer.md): A record or a form the reader works on beside the page, with actions that stay in view.
141
156
  - BottomSheet (components/bottom-sheet.md): A list or details over a full-screen view (a map, a canvas) that must stay usable behind it.
142
157
  - Lightbox (components/lightbox.md): Showing a photo or a video at full size, and stepping through a set of them.
158
+ - ConfirmDialog (components/confirm-dialog.md): An action that destroys something or cannot be undone: delete, discard, revoke, sign out everywhere.
143
159
  - FieldDialog (components/field-dialog.md): Asking for a single name or value: new project, rename, a label.
160
+ - Popover (components/popover.md): A detail, a short explanation or a filter or two that belongs to one control and is not worth a page or a modal.
144
161
  - PageFade (components/page-fade.md): A site where the frame stays put and only the content between pages should fade.
145
162
  - Morph (components/morph.md): A card or thumbnail that opens into its own page, where the reader should see the one become the other.
146
163
  - NavigationProgress (components/navigation-progress.md): A page load of unknown length: show at once that the click did something, until the next page renders.
@@ -148,6 +165,8 @@ Each component page is its own file under `components/`: the one right way, do a
148
165
  ### Navigation
149
166
  - Tabs (components/tabs.md): Tabs switch a panel on the same page. A row of links to other pages is `Tabs` with link items.
150
167
  - Breadcrumbs (components/breadcrumbs.md): A page several levels deep that needs a way back up: org, project, build, snapshot.
168
+ - TableOfContents (components/table-of-contents.md): A long page of several sections, such as a guide or a reference, where a reader jumps to a section or checks where they are.
169
+ - Stepper (components/stepper.md): A flow of a few steps taken in order, such as checkout or setting up an account, where the reader should see what is done and what is left.
151
170
  - Pagination (components/pagination.md): A list split into pages that the reader moves through: a directory, search results, an archive.
152
171
  - SiteSearch (components/site-search.md): A site with more pages than a reader can scan in its nav: a docs site, an app with many sections.
153
172
 
@@ -4,9 +4,15 @@ import type { Passthrough } from "./props.js";
4
4
  import type { Size } from "./size.js";
5
5
  /**
6
6
  * The class an app puts on its own `<html>`: it always reserves the scrollbar, so centred content
7
- * does not shift between a short page and a long one. AppShell never touches `<html>` itself.
7
+ * does not shift between a short page and a long one, and it paints the page canvas and sets the
8
+ * type face, ink and font smoothing, so a page outside AppShell (a `CenteredLayout` sign-in, a bare
9
+ * error page) looks like one inside it and an app writes no `<body>` or `<html>` styling of its own.
10
+ * A theme's scope class sits on the same element, where its `.<scope> .<utility>` rules do not reach,
11
+ * so the scope block itself sets the canvas, ink and face (unlayered, over these layered utilities).
12
+ * AppShell never touches `<html>` itself. Several classes: add them with `className`, or split them
13
+ * for `classList.add(...)`.
8
14
  */
9
- export declare const appShellRootClass = "overflow-y-scroll";
15
+ export declare const appShellRootClass = "overflow-y-scroll bg-gray-50 font-sans text-slate-900 antialiased";
10
16
  /**
11
17
  * Everything an app puts on its own `<html>` from the scheme the server knows: that scheme's class
12
18
  * (`schemeClass`) and the shell's root class, joined: `<html className={appShellRootClassFor(scheme,
@@ -57,8 +63,9 @@ export type AppShellDensity = "compact";
57
63
  *
58
64
  * On a phone (below `md`) the header is one 56px row at every page: `brand`, `header`, `controls`
59
65
  * and a "Menu" button (`menuLabel`), and `nav` and `subnav` move into that menu, so every link is
60
- * reachable and nothing scrolls sideways. The menu is a native `<details>`, so it works with the
61
- * keyboard, with a screen reader and on a page that never hydrates. From `md` the header is the
66
+ * reachable and nothing scrolls sideways. The menu is the browser's popover (`popovertarget`), so
67
+ * it works with the keyboard, closes on Escape and a click outside, hands focus back to the button,
68
+ * and opens on a page that never hydrates. From `md` the header is the
62
69
  * row, and the `subnav` row, as they are, except that a `nav` too wide for the row folds into the
63
70
  * Menu and comes back when the screen is wide enough (measured, with script; a `subnav` never
64
71
  * folds, it scrolls sideways with a fade).
@@ -70,10 +77,12 @@ export type AppShellDensity = "compact";
70
77
  *
71
78
  * `controls` stay in the row at every width, so keep them few (a theme toggle, the viewer's avatar);
72
79
  * on a phone a crowded `controls` clips, and the Menu button is never the part cut off. Pickers and
73
- * actions that do not fit a phone row go in `menuControls`: rendered once, they sit in the row after
74
- * `controls` from `md`, and below `md` at the top of the Menu, above `nav` and `subnav`.
80
+ * actions that do not fit a phone row go in `menuControls`: rendered once, from `md` they sit at the
81
+ * row's end, before `header` and `controls`, and fold into the Menu with a `nav` that does not fit;
82
+ * below `md` they are at the foot of the Menu, after `nav` and `subnav`. The markup is in the order
83
+ * the row shows, so the focus moves as the eye does.
75
84
  */
76
- export declare function AppShell({ brand, nav, controls, menuControls, header, subnav, menuLabel, footer, bleed, printChrome, density, children, ...rest }: {
85
+ export declare function AppShell({ brand, nav, controls, menuControls, header, subnav, menuLabel, footer, bleed, printChrome, density, skipLabel, children, ...rest }: {
77
86
  /** The brand: a logo and a name, in the header's brand type, with the gap between them. `AppShellBrand` makes both one link. */
78
87
  brand?: ReactNode;
79
88
  /** The main navigation, e.g. a `Tabs` of links (it is already a `<nav>`). Below `md` it is in the menu. */
@@ -82,8 +91,9 @@ export declare function AppShell({ brand, nav, controls, menuControls, header, s
82
91
  controls?: ReactNode;
83
92
  /**
84
93
  * Pickers and actions that do not fit a phone row, such as a project `Select` and a Sign out
85
- * `Button`. From `md` they sit in the row after `controls`; below `md` they are at the top of the
86
- * Menu, above `nav` and `subnav`. Rendered once, so a field keeps its state and ids stay unique.
94
+ * `Button`. From `md` they sit at the row's end, before `header` and `controls`, and fold into the
95
+ * Menu with the `nav`; below `md` they are at the foot of the Menu, after `nav` and `subnav`.
96
+ * Rendered once, so a field keeps its state and ids stay unique.
87
97
  * `controls` stay in the row at every width, so keep those few.
88
98
  */
89
99
  menuControls?: ReactNode;
@@ -123,5 +133,11 @@ export declare function AppShell({ brand, nav, controls, menuControls, header, s
123
133
  * one step down everywhere inside, for an app's dense chrome. Left out, text is 16px, as a site's.
124
134
  */
125
135
  density?: AppShellDensity | undefined;
136
+ /**
137
+ * The skip link's words, for an app in another language. The link is the page's first tab stop,
138
+ * hidden until it has the focus, and moves the focus past the header to the main area.
139
+ * @default Skip to content
140
+ */
141
+ skipLabel?: string;
126
142
  children: ReactNode;
127
143
  } & Passthrough): ReactElement;