@slashsuite/ui-react 0.12.0 → 0.13.0

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 (388) hide show
  1. package/MIGRATING.md +386 -8
  2. package/README.md +101 -44
  3. package/agent-docs/components/app-shell.md +139 -0
  4. package/agent-docs/components/article-layout.md +140 -0
  5. package/agent-docs/components/audio.md +42 -0
  6. package/agent-docs/components/avatar-stack.md +64 -0
  7. package/agent-docs/components/avatar.md +76 -0
  8. package/agent-docs/components/badge.md +62 -0
  9. package/agent-docs/components/body-text.md +169 -0
  10. package/agent-docs/components/bottom-sheet.md +105 -0
  11. package/agent-docs/components/breadcrumbs.md +66 -0
  12. package/agent-docs/components/bullet-list.md +54 -0
  13. package/agent-docs/components/button.md +135 -0
  14. package/agent-docs/components/call-to-action.md +59 -0
  15. package/agent-docs/components/callout.md +87 -0
  16. package/agent-docs/components/card-grid.md +116 -0
  17. package/agent-docs/components/card.md +128 -0
  18. package/agent-docs/components/cart-button.md +63 -0
  19. package/agent-docs/components/centered-layout.md +90 -0
  20. package/agent-docs/components/chat-composer.md +49 -0
  21. package/agent-docs/components/chat-message.md +61 -0
  22. package/agent-docs/components/chat-thread.md +49 -0
  23. package/agent-docs/components/checkbox.md +81 -0
  24. package/agent-docs/components/cluster.md +108 -0
  25. package/agent-docs/components/code-example.md +48 -0
  26. package/agent-docs/components/code.md +72 -0
  27. package/agent-docs/components/colour-scheme-toggle.md +98 -0
  28. package/agent-docs/components/colour-swatch.md +41 -0
  29. package/agent-docs/components/combobox.md +88 -0
  30. package/agent-docs/components/confirm-dialog.md +98 -0
  31. package/agent-docs/components/container.md +51 -0
  32. package/agent-docs/components/copy-button.md +63 -0
  33. package/agent-docs/components/copy-line.md +55 -0
  34. package/agent-docs/components/date-field.md +106 -0
  35. package/agent-docs/components/date-range-picker.md +108 -0
  36. package/agent-docs/components/date-time-field.md +73 -0
  37. package/agent-docs/components/detail-layout.md +147 -0
  38. package/agent-docs/components/dialog.md +132 -0
  39. package/agent-docs/components/disclosure.md +70 -0
  40. package/agent-docs/components/divider.md +62 -0
  41. package/agent-docs/components/docs-layout.md +164 -0
  42. package/agent-docs/components/drawer.md +137 -0
  43. package/agent-docs/components/embed-frame.md +48 -0
  44. package/agent-docs/components/empty-state.md +70 -0
  45. package/agent-docs/components/field-dialog.md +98 -0
  46. package/agent-docs/components/field.md +71 -0
  47. package/agent-docs/components/fieldset.md +82 -0
  48. package/agent-docs/components/file-drop.md +52 -0
  49. package/agent-docs/components/flow-diagram.md +87 -0
  50. package/agent-docs/components/form-layout.md +144 -0
  51. package/agent-docs/components/form-row.md +93 -0
  52. package/agent-docs/components/full-bleed-layout.md +114 -0
  53. package/agent-docs/components/headings.md +107 -0
  54. package/agent-docs/components/hero.md +68 -0
  55. package/agent-docs/components/icon-button.md +90 -0
  56. package/agent-docs/components/icon.md +59 -0
  57. package/agent-docs/components/image.md +74 -0
  58. package/agent-docs/components/input.md +84 -0
  59. package/agent-docs/components/kbd.md +38 -0
  60. package/agent-docs/components/key-value-list.md +84 -0
  61. package/agent-docs/components/lightbox.md +97 -0
  62. package/agent-docs/components/list-layout.md +152 -0
  63. package/agent-docs/components/list-row.md +119 -0
  64. package/agent-docs/components/loading.md +69 -0
  65. package/agent-docs/components/markdown.md +51 -0
  66. package/agent-docs/components/media-tile.md +101 -0
  67. package/agent-docs/components/menu.md +110 -0
  68. package/agent-docs/components/meta-list.md +69 -0
  69. package/agent-docs/components/morph.md +134 -0
  70. package/agent-docs/components/navigation-progress.md +56 -0
  71. package/agent-docs/components/number-field.md +75 -0
  72. package/agent-docs/components/outline-region.md +74 -0
  73. package/agent-docs/components/page-fade.md +117 -0
  74. package/agent-docs/components/page-header.md +93 -0
  75. package/agent-docs/components/pagination.md +64 -0
  76. package/agent-docs/components/pill.md +105 -0
  77. package/agent-docs/components/popover.md +63 -0
  78. package/agent-docs/components/price.md +49 -0
  79. package/agent-docs/components/product-tile.md +78 -0
  80. package/agent-docs/components/progress-bar.md +66 -0
  81. package/agent-docs/components/promo-banner.md +46 -0
  82. package/agent-docs/components/prose-layout.md +87 -0
  83. package/agent-docs/components/prose.md +41 -0
  84. package/agent-docs/components/radio-group.md +77 -0
  85. package/agent-docs/components/scroll-strip.md +48 -0
  86. package/agent-docs/components/segmented-control.md +135 -0
  87. package/agent-docs/components/select.md +70 -0
  88. package/agent-docs/components/show.md +120 -0
  89. package/agent-docs/components/side-column.md +74 -0
  90. package/agent-docs/components/sidebar-layout.md +134 -0
  91. package/agent-docs/components/site-footer.md +63 -0
  92. package/agent-docs/components/site-search.md +79 -0
  93. package/agent-docs/components/slider.md +59 -0
  94. package/agent-docs/components/sortable-list.md +112 -0
  95. package/agent-docs/components/split-bar.md +54 -0
  96. package/agent-docs/components/stack.md +197 -0
  97. package/agent-docs/components/stacked-bar.md +91 -0
  98. package/agent-docs/components/stat-tile.md +69 -0
  99. package/agent-docs/components/state-machine.md +95 -0
  100. package/agent-docs/components/status-pages.md +112 -0
  101. package/agent-docs/components/stepper.md +54 -0
  102. package/agent-docs/components/steps.md +74 -0
  103. package/agent-docs/components/sticky-bar.md +51 -0
  104. package/agent-docs/components/switch.md +79 -0
  105. package/agent-docs/components/table-of-contents.md +78 -0
  106. package/agent-docs/components/table.md +384 -0
  107. package/agent-docs/components/tabs.md +178 -0
  108. package/agent-docs/components/text-link.md +110 -0
  109. package/agent-docs/components/textarea.md +53 -0
  110. package/agent-docs/components/timeline.md +79 -0
  111. package/agent-docs/components/toast.md +91 -0
  112. package/agent-docs/components/trend-chart.md +61 -0
  113. package/agent-docs/components/video.md +49 -0
  114. package/agent-docs/llms.txt +174 -0
  115. package/dist/AppShell.d.ts +25 -9
  116. package/dist/AppShell.js +67 -33
  117. package/dist/AppShellMenu.d.ts +31 -18
  118. package/dist/AppShellMenu.js +72 -45
  119. package/dist/ArticleLayout.d.ts +36 -0
  120. package/dist/ArticleLayout.js +27 -0
  121. package/dist/Audio.d.ts +16 -0
  122. package/dist/Audio.js +11 -0
  123. package/dist/Badge.d.ts +2 -1
  124. package/dist/Badge.js +3 -2
  125. package/dist/BottomSheet.d.ts +17 -6
  126. package/dist/BottomSheet.js +62 -11
  127. package/dist/Breadcrumbs.d.ts +8 -6
  128. package/dist/Breadcrumbs.js +17 -7
  129. package/dist/Button.d.ts +1 -0
  130. package/dist/Button.js +4 -3
  131. package/dist/CallToAction.d.ts +25 -0
  132. package/dist/CallToAction.js +17 -0
  133. package/dist/Callout.d.ts +2 -2
  134. package/dist/Callout.js +2 -2
  135. package/dist/Card.d.ts +88 -31
  136. package/dist/Card.js +55 -92
  137. package/dist/CardBody.d.ts +2 -0
  138. package/dist/CardBody.js +33 -3
  139. package/dist/CardGrid.d.ts +32 -4
  140. package/dist/CardGrid.js +42 -8
  141. package/dist/CardParts.d.ts +7 -1
  142. package/dist/CardParts.js +7 -2
  143. package/dist/CartButton.d.ts +33 -0
  144. package/dist/CartButton.js +18 -0
  145. package/dist/ChatComposer.d.ts +10 -4
  146. package/dist/ChatComposer.js +35 -13
  147. package/dist/Checkbox.d.ts +21 -3
  148. package/dist/Checkbox.js +66 -20
  149. package/dist/Chevron.js +1 -1
  150. package/dist/Cluster.d.ts +28 -15
  151. package/dist/Cluster.js +21 -4
  152. package/dist/Code.d.ts +15 -3
  153. package/dist/Code.js +23 -3
  154. package/dist/CodeBlock.d.ts +4 -4
  155. package/dist/CodeBlock.js +2 -2
  156. package/dist/CodeBody.d.ts +1 -1
  157. package/dist/CodeBody.js +4 -10
  158. package/dist/CodeExample.d.ts +1 -1
  159. package/dist/CodeExample.js +3 -2
  160. package/dist/ColourSchemeToggle.d.ts +21 -5
  161. package/dist/ColourSchemeToggle.js +15 -9
  162. package/dist/ColourSwatch.d.ts +15 -0
  163. package/dist/ColourSwatch.js +14 -0
  164. package/dist/Combobox.d.ts +42 -0
  165. package/dist/Combobox.js +43 -0
  166. package/dist/ConfirmDialog.d.ts +40 -0
  167. package/dist/ConfirmDialog.js +36 -0
  168. package/dist/Container.d.ts +3 -3
  169. package/dist/Container.js +1 -1
  170. package/dist/CopyButton.d.ts +8 -2
  171. package/dist/CopyButton.js +38 -28
  172. package/dist/CopyLine.d.ts +4 -2
  173. package/dist/CopyLine.js +4 -4
  174. package/dist/DateCalendar.d.ts +2 -0
  175. package/dist/DateCalendar.js +11 -9
  176. package/dist/DateField.d.ts +52 -21
  177. package/dist/DateField.js +73 -37
  178. package/dist/DateFieldCalendar.d.ts +12 -8
  179. package/dist/DateFieldCalendar.js +37 -18
  180. package/dist/DateRangePicker.d.ts +23 -3
  181. package/dist/DateRangePicker.js +10 -8
  182. package/dist/DateTimeField.d.ts +31 -0
  183. package/dist/DateTimeField.js +19 -0
  184. package/dist/Dialog.d.ts +42 -6
  185. package/dist/Dialog.js +50 -12
  186. package/dist/Disclosure.js +9 -1
  187. package/dist/DocsLayout.d.ts +13 -5
  188. package/dist/DocsLayout.js +11 -9
  189. package/dist/Drawer.d.ts +22 -7
  190. package/dist/Drawer.js +89 -8
  191. package/dist/EmbedFrame.d.ts +36 -0
  192. package/dist/EmbedFrame.js +18 -0
  193. package/dist/Field.d.ts +41 -4
  194. package/dist/Field.js +61 -25
  195. package/dist/FieldDialog.d.ts +8 -3
  196. package/dist/FieldDialog.js +19 -9
  197. package/dist/Fieldset.d.ts +3 -3
  198. package/dist/Fieldset.js +7 -9
  199. package/dist/FileDrop.js +2 -1
  200. package/dist/FlowDiagram.d.ts +92 -0
  201. package/dist/FlowDiagram.js +100 -0
  202. package/dist/FormRow.d.ts +6 -4
  203. package/dist/FormRow.js +11 -9
  204. package/dist/Hero.d.ts +30 -7
  205. package/dist/Hero.js +23 -9
  206. package/dist/Icon.d.ts +1 -1
  207. package/dist/Icon.js +1 -1
  208. package/dist/IconButton.js +1 -1
  209. package/dist/Image.d.ts +33 -9
  210. package/dist/Image.js +61 -16
  211. package/dist/Input.d.ts +1 -1
  212. package/dist/Input.js +4 -4
  213. package/dist/InputShell.d.ts +7 -0
  214. package/dist/InputShell.js +18 -3
  215. package/dist/KeyValueList.d.ts +2 -2
  216. package/dist/Lightbox.js +5 -3
  217. package/dist/ListRow.d.ts +4 -5
  218. package/dist/ListRow.js +36 -26
  219. package/dist/Mark.d.ts +10 -0
  220. package/dist/Mark.js +9 -0
  221. package/dist/Markdown.d.ts +18 -4
  222. package/dist/Markdown.js +176 -37
  223. package/dist/MediaTile.d.ts +9 -3
  224. package/dist/MediaTile.js +8 -4
  225. package/dist/Menu.d.ts +19 -8
  226. package/dist/Menu.js +13 -11
  227. package/dist/MetaList.d.ts +4 -3
  228. package/dist/MetaList.js +12 -4
  229. package/dist/Morph.d.ts +15 -1
  230. package/dist/Morph.js +70 -22
  231. package/dist/NavigationProgress.d.ts +2 -2
  232. package/dist/NavigationProgress.js +7 -5
  233. package/dist/NumberField.d.ts +66 -0
  234. package/dist/NumberField.js +68 -0
  235. package/dist/OutlineRegion.d.ts +41 -10
  236. package/dist/OutlineRegion.js +31 -6
  237. package/dist/PageFade.d.ts +9 -5
  238. package/dist/PageFade.js +39 -8
  239. package/dist/PageLayouts.d.ts +15 -5
  240. package/dist/PageLayouts.js +3 -3
  241. package/dist/Pill.d.ts +9 -4
  242. package/dist/Pill.js +15 -6
  243. package/dist/Popover.d.ts +31 -0
  244. package/dist/Popover.js +43 -0
  245. package/dist/Price.d.ts +21 -0
  246. package/dist/Price.js +34 -0
  247. package/dist/ProductTile.d.ts +36 -0
  248. package/dist/ProductTile.js +31 -0
  249. package/dist/ProgressBar.js +4 -2
  250. package/dist/PromoBanner.d.ts +25 -0
  251. package/dist/PromoBanner.js +16 -0
  252. package/dist/RadioGroup.d.ts +18 -8
  253. package/dist/RadioGroup.js +42 -18
  254. package/dist/ScrollStrip.d.ts +1 -1
  255. package/dist/ScrollStrip.js +1 -1
  256. package/dist/SearchInput.d.ts +17 -2
  257. package/dist/SearchInput.js +72 -13
  258. package/dist/SegmentedField.d.ts +15 -0
  259. package/dist/SegmentedField.js +15 -0
  260. package/dist/Select.js +5 -4
  261. package/dist/Show.d.ts +1 -1
  262. package/dist/Show.js +1 -1
  263. package/dist/SideColumn.d.ts +42 -15
  264. package/dist/SideColumn.js +45 -19
  265. package/dist/SiteFooter.d.ts +3 -3
  266. package/dist/SiteFooter.js +4 -3
  267. package/dist/SiteSearch.d.ts +57 -27
  268. package/dist/SiteSearch.js +13 -93
  269. package/dist/Slider.d.ts +27 -0
  270. package/dist/Slider.js +58 -0
  271. package/dist/SortableList.d.ts +19 -35
  272. package/dist/SortableList.js +36 -88
  273. package/dist/Stack.d.ts +4 -4
  274. package/dist/StackedBar.d.ts +13 -4
  275. package/dist/StackedBar.js +12 -7
  276. package/dist/StateMachine.d.ts +65 -0
  277. package/dist/StateMachine.js +113 -0
  278. package/dist/StatusPages.d.ts +28 -10
  279. package/dist/StatusPages.js +10 -10
  280. package/dist/Stepper.d.ts +21 -0
  281. package/dist/Stepper.js +33 -0
  282. package/dist/Steps.js +4 -3
  283. package/dist/Switch.d.ts +3 -3
  284. package/dist/Switch.js +18 -14
  285. package/dist/Table.d.ts +32 -9
  286. package/dist/Table.js +50 -20
  287. package/dist/TableCells.d.ts +24 -21
  288. package/dist/TableCells.js +68 -27
  289. package/dist/TableEditCell.d.ts +1 -1
  290. package/dist/TableOfContents.d.ts +34 -0
  291. package/dist/TableOfContents.js +23 -0
  292. package/dist/Tabs.d.ts +31 -16
  293. package/dist/Tabs.js +97 -22
  294. package/dist/TextLink.d.ts +18 -5
  295. package/dist/TextLink.js +19 -6
  296. package/dist/Textarea.d.ts +12 -1
  297. package/dist/Textarea.js +15 -2
  298. package/dist/ToastRegion.d.ts +17 -9
  299. package/dist/ToastRegion.js +70 -13
  300. package/dist/Tooltip.d.ts +10 -2
  301. package/dist/Tooltip.js +32 -11
  302. package/dist/Video.d.ts +19 -4
  303. package/dist/Video.js +15 -5
  304. package/dist/cardContext.d.ts +7 -0
  305. package/dist/cardContext.js +14 -0
  306. package/dist/cardControl.d.ts +15 -0
  307. package/dist/cardControl.js +32 -0
  308. package/dist/cardForm.d.ts +39 -0
  309. package/dist/cardForm.js +81 -0
  310. package/dist/cardWait.js +2 -1
  311. package/dist/colourScheme.d.ts +12 -2
  312. package/dist/colourScheme.js +32 -6
  313. package/dist/control.d.ts +30 -8
  314. package/dist/control.js +74 -7
  315. package/dist/copyScript.d.ts +7 -8
  316. package/dist/copyScript.js +8 -9
  317. package/dist/cx.d.ts +22 -3
  318. package/dist/cx.js +22 -3
  319. package/dist/dateLocale.d.ts +17 -0
  320. package/dist/dateLocale.js +30 -0
  321. package/dist/density.d.ts +15 -1
  322. package/dist/density.js +27 -8
  323. package/dist/emptySlot.d.ts +1 -0
  324. package/dist/fieldAnnounce.d.ts +11 -0
  325. package/dist/fieldAnnounce.js +36 -0
  326. package/dist/fieldControl.d.ts +7 -2
  327. package/dist/fieldControl.js +6 -2
  328. package/dist/fieldWait.d.ts +3 -3
  329. package/dist/fieldWait.js +3 -4
  330. package/dist/flowLayout.d.ts +68 -0
  331. package/dist/flowLayout.js +105 -0
  332. package/dist/fromXState.d.ts +73 -0
  333. package/dist/fromXState.js +110 -0
  334. package/dist/icons.d.ts +1 -1
  335. package/dist/icons.js +15 -0
  336. package/dist/index.d.ts +37 -11
  337. package/dist/index.js +24 -2
  338. package/dist/isoDate.d.ts +8 -1
  339. package/dist/isoDate.js +20 -1
  340. package/dist/labelWords.d.ts +16 -7
  341. package/dist/labelWords.js +14 -12
  342. package/dist/listRowProps.d.ts +17 -15
  343. package/dist/modal.d.ts +5 -0
  344. package/dist/modal.js +21 -1
  345. package/dist/navFold.js +6 -3
  346. package/dist/optionCard.d.ts +18 -0
  347. package/dist/optionCard.js +16 -0
  348. package/dist/scrollBody.d.ts +16 -0
  349. package/dist/scrollBody.js +15 -0
  350. package/dist/scrollEdges.d.ts +7 -0
  351. package/dist/scrollEdges.js +39 -5
  352. package/dist/scrollStop.d.ts +6 -2
  353. package/dist/scrollStop.js +24 -8
  354. package/dist/shownDate.d.ts +28 -10
  355. package/dist/shownDate.js +41 -22
  356. package/dist/siteSearchBody.d.ts +34 -0
  357. package/dist/siteSearchBody.js +117 -0
  358. package/dist/size.d.ts +7 -1
  359. package/dist/sortableDrop.d.ts +44 -0
  360. package/dist/sortableDrop.js +78 -0
  361. package/dist/sortableSlide.d.ts +9 -0
  362. package/dist/sortableSlide.js +70 -0
  363. package/dist/sortableTitle.d.ts +10 -0
  364. package/dist/sortableTitle.js +48 -0
  365. package/dist/stateMachineDots.d.ts +45 -0
  366. package/dist/stateMachineDots.js +162 -0
  367. package/dist/stickyColumn.d.ts +2 -2
  368. package/dist/stickyColumn.js +2 -2
  369. package/dist/switcher.d.ts +10 -5
  370. package/dist/switcher.js +7 -5
  371. package/dist/tableColumns.d.ts +17 -0
  372. package/dist/tableColumns.js +30 -2
  373. package/dist/tableEmpty.js +5 -5
  374. package/dist/tableRow.d.ts +26 -2
  375. package/dist/tableRow.js +23 -1
  376. package/dist/tableSort.d.ts +10 -5
  377. package/dist/tableSort.js +15 -4
  378. package/dist/target.d.ts +12 -0
  379. package/dist/target.js +12 -0
  380. package/dist/textBox.js +1 -1
  381. package/dist/truncated.d.ts +31 -0
  382. package/dist/truncated.js +51 -0
  383. package/dist/typography.d.ts +19 -11
  384. package/dist/typography.js +11 -13
  385. package/dist/useFlowLayout.d.ts +27 -0
  386. package/dist/useFlowLayout.js +119 -0
  387. package/package.json +7 -3
  388. package/skills/uislash/SKILL.md +20 -0
@@ -0,0 +1,69 @@
1
+ ## MetaList
2
+
3
+ Group: Text
4
+
5
+ When to use: The facts about a record under its title (branch, SHA, date), or a footer's row of links (Privacy, Terms, Contact).
6
+
7
+ ### Use instead
8
+ - Table (table.md): Many records with the same columns, to read across and compare.
9
+ - KeyValueList (key-value-list.md): One record's fields, one per line, each label beside its value.
10
+ - ListRow (list-row.md): Each item is a thing to open, on a row of its own.
11
+
12
+ ### The one right way
13
+ A row of facts is a `MetaList`; an item is text, a `Code` or a `TextLink`.
14
+ ```tsx
15
+ import { Code, MetaList, TextLink } from "@slashsuite/ui-react";
16
+
17
+ <MetaList>
18
+ <TextLink href="#hc-145">hc-145</TextLink>
19
+ <Code>0f9d376</Code>
20
+ <span>26 Oct 2026</span>
21
+ </MetaList>
22
+ ```
23
+
24
+ ### Do
25
+ - Each child is one item: text, a `Code` or a `TextLink`.
26
+ - `separator` is `·` (default), `•` or `none`.
27
+ - An item never breaks inside itself; the row wraps between items.
28
+ - `mono` sets the whole row in the monospace face, for ids and paths.
29
+ - A labelled fact is a `KeyValueList`.
30
+
31
+ ### Don't
32
+ - Never type the separators yourself: a wrap can leave one at the start of a line, and a screen reader reads them.
33
+
34
+ Dots typed into one string are one item to a screen reader and can wrap onto the end of a line.
35
+ ```tsx
36
+ import { Caption } from "@slashsuite/ui-react";
37
+
38
+ <Caption>hc-145 · 0f9d376 · 26 Oct 2026</Caption>
39
+
40
+ ```
41
+
42
+ Separators typed by hand are read aloud and can wrap onto the end of a line.
43
+ ```tsx
44
+ import { Prose, TextLink } from "@slashsuite/ui-react";
45
+
46
+ <Prose as="p">
47
+ <TextLink href="#privacy">Privacy</TextLink> | <TextLink href="#terms">Terms</TextLink> |{" "}
48
+ <TextLink href="#contact">Contact</TextLink>
49
+ </Prose>
50
+ ```
51
+
52
+ ### Accessibility
53
+ - A `MetaList` renders a `<ul>` with an `<li>` per item.
54
+ - The separators are `aria-hidden` and lead each item; the one before whichever item starts a line falls in a margin the row clips, so no line starts or ends with one, at any width.
55
+ - Each link keeps its own focus ring; the row adds no extra tab stop.
56
+ - `aria-*` and `data-*` go on the list.
57
+
58
+ ### Props
59
+ ### MetaList
60
+ A wrapping row of facts or links in muted small text, joined by a `·`: branch · SHA · date, or a footer's Privacy · Terms · Email. An item is text, a `Code` or a `TextLink`. The separator is `aria-hidden` and leads every item in a slot of its own; the list starts one slot before its box, which clips it, so the separator of whichever item starts a line falls outside and no line starts or ends with one, at any width. `separator` swaps it for a `•` or none. An item never breaks inside itself: the row wraps between items. `mono` sets the whole row in the monospace face, for ids and paths. While `loading` with no items it draws three word-sized bones.
61
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
62
+ - loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
63
+ Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
64
+ - loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
65
+ - mono: boolean (default false). The whole row in the monospace face, for ids and paths.
66
+ - separator: "none" | "·" | "•" (default ·). The mark between items: `·`, `•`, or `none` for a gap alone.
67
+
68
+ ### Types
69
+ - MetaListSeparator: `"none" | "·" | "•"`. The mark between MetaList items: `·`, `•`, or `none` for a gap alone.
@@ -0,0 +1,134 @@
1
+ ## Morph
2
+
3
+ Group: Feedback
4
+
5
+ When to use: A card or thumbnail that opens into its own page, where the reader should see the one become the other.
6
+
7
+ ### The one right way
8
+ Each card's `item` is its shop's id, so only the pressed card has a partner on the next page and it morphs.
9
+ ```tsx
10
+ import { useState } from "react";
11
+ import { Button, Card, CardGrid, Morph, startPageTransition } from "@slashsuite/ui-react";
12
+
13
+ function Example() {
14
+ const [open, setOpen] = useState<string | undefined>(undefined);
15
+ const letters = ["A", "B"];
16
+ return open ? (
17
+ <Morph name="shop-do" item={open}>
18
+ <Card title={`Shop ${open}`} size="lg">
19
+ <Button variant="outline" onClick={() => startPageTransition(() => setOpen(undefined))}>
20
+ Back
21
+ </Button>
22
+ </Card>
23
+ </Morph>
24
+ ) : (
25
+ <CardGrid columns={2}>
26
+ {letters.map((shop) => (
27
+ <Morph key={shop} name="shop-do" item={shop}>
28
+ <Card title={`Shop ${shop}`}>
29
+ <Button variant="outline" onClick={() => startPageTransition(() => setOpen(shop))}>
30
+ Open Shop {shop}
31
+ </Button>
32
+ </Card>
33
+ </Morph>
34
+ ))}
35
+ </CardGrid>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ### Do
41
+ - Wrap the card in the grid and the element on the detail page, each with the same `name` and the record's id as `item`: `<Morph name="shop" item={shop.id}>`.
42
+ - The same `name` and `item` may appear only once on a page; two and the browser skips the morph, so a list passes each record's own id. When one record shows twice (a featured card and the same card in the list), pass `active={false}` to the copy that should not morph; in development two active Morphs with one `name` and `item` log a console warning.
43
+ - Start the change inside a view transition: `startPageTransition(() => setOpen(id))` for a state change, or the router's own option (TanStack Router `defaultViewTransition: true` on `createRouter`, or `viewTransition` on a `Link`; React Router's `viewTransition`, Astro's `ClientRouter`). Without one nothing morphs.
44
+ - The destination's Morph must be in the page when the navigation lands: a route that shows a pending component first has nothing to morph into.
45
+ - Inside a `PageFade` the rest of the page cross-fades while the card morphs over it.
46
+ - Portal an overlay such as a dropdown to the body: the morphing element is a stacking context, so an overlay inside it cannot rise above a sticky header outside it.
47
+ - A card that is a list item takes `as="li"`, so a `Stack as="ul"` of Morphs stays a list of items. A Morph far below the fold carries no transition name until it scrolls near, so a long list costs only what is on screen.
48
+ - With TanStack Router, call `refreshMorphs()` after it restores scroll: `router.subscribe("onRendered", () => refreshMorphs())`, after `createRouter`. Its restore lands after the render, so without the call the card scrolled back on screen is not named and Back does not shrink into it.
49
+
50
+ ### Don't
51
+ Every card shares one `item`, so the page holds the same name twice and the browser skips the morph.
52
+ ```tsx
53
+ import { useState } from "react";
54
+ import { Button, Card, CardGrid, Morph, startPageTransition } from "@slashsuite/ui-react";
55
+
56
+ function Example() {
57
+ const [open, setOpen] = useState<string | undefined>(undefined);
58
+ const letters = ["A", "B"];
59
+ return open ? (
60
+ <Morph name="shop-dont" item={"shop"}>
61
+ <Card title={`Shop ${open}`} size="lg">
62
+ <Button variant="outline" onClick={() => startPageTransition(() => setOpen(undefined))}>
63
+ Back
64
+ </Button>
65
+ </Card>
66
+ </Morph>
67
+ ) : (
68
+ <CardGrid columns={2}>
69
+ {letters.map((shop) => (
70
+ <Morph key={shop} name="shop-dont" item={"shop"}>
71
+ <Card title={`Shop ${shop}`}>
72
+ <Button variant="outline" onClick={() => startPageTransition(() => setOpen(shop))}>
73
+ Open Shop {shop}
74
+ </Button>
75
+ </Card>
76
+ </Morph>
77
+ ))}
78
+ </CardGrid>
79
+ );
80
+ }
81
+ ```
82
+
83
+ A plain state change swaps the page at once: there is no transition to morph.
84
+ ```tsx
85
+ import { useState } from "react";
86
+ import { Button, Card, CardGrid, Morph } from "@slashsuite/ui-react";
87
+
88
+ function Example() {
89
+ const [open, setOpen] = useState<string | undefined>(undefined);
90
+ const letters = ["A", "B"];
91
+ return open ? (
92
+ <Morph name="shop-transition-dont" item={open}>
93
+ <Card title={`Shop ${open}`} size="lg">
94
+ <Button variant="outline" onClick={() => setOpen(undefined)}>
95
+ Back
96
+ </Button>
97
+ </Card>
98
+ </Morph>
99
+ ) : (
100
+ <CardGrid columns={2}>
101
+ {letters.map((shop) => (
102
+ <Morph key={shop} name="shop-transition-dont" item={shop}>
103
+ <Card title={`Shop ${shop}`}>
104
+ <Button variant="outline" onClick={() => setOpen(shop)}>
105
+ Open Shop {shop}
106
+ </Button>
107
+ </Card>
108
+ </Morph>
109
+ ))}
110
+ </CardGrid>
111
+ );
112
+ }
113
+ ```
114
+
115
+ ### Accessibility
116
+ - A Morph is a plain `<div>` (or `<li>` with `as="li"`) with no role of its own, so it changes nothing for assistive technology.
117
+ - Under `prefers-reduced-motion: reduce` the element swaps with no animation, and `startPageTransition` just runs the update. A router's own transition of the rest of the page is the router's: quiet it in the app's stylesheet, as the browser does not.
118
+ - Morph is for a page change in one document. A cross-document transition (`@view-transition { navigation: auto; }`) is an app stylesheet rule the library does not ship.
119
+ - Where the browser has no View Transitions it is a plain `<div>` and the content swaps.
120
+
121
+ ### Props
122
+ ### Morph
123
+ An element that grows into its counterpart on the next page, and shrinks back on Back, through the View Transitions API. Wrap the card in the list and the element on the detail page, each with the same `name` and the record's id as `item`: the browser morphs one into the other over 450 ms. The same `name` and `item` may appear only once on a page; two on one page and the browser skips the morph, so a list passes each record's own id. The morph runs only when the change is wrapped in a view transition: `startPageTransition`, or a router's own option (TanStack Router `defaultViewTransition: true` on `createRouter`, or `viewTransition` on a `Link`; React Router's `viewTransition`, Astro's `ClientRouter`). Otherwise, or where the browser has no View Transitions, it renders and behaves as a plain `<div>`. Inside a `PageFade` the page fades while this element morphs. While it is named (near the screen) the div is a stacking context, so a dropdown inside it cannot rise above a sticky header outside it: portal overlays to the body. Under `prefers-reduced-motion: reduce` it swaps with no animation; a router's own transition of the rest of the page is the router's to quiet. A Morph more than a screen above or below the viewport carries no transition name until it scrolls near, so a long list costs only what is on screen. In a list, `as="li"` makes it the list's item. When one record shows twice on a page, pass `active={false}` to the copy that should not morph; in development two active Morphs with the same `name` and `item` log a console warning.
124
+ - active: boolean (default true). Whether it carries its transition name; `true` by default. Pass `false` to every copy but one
125
+ when the same record shows twice on a page (a featured card and the same card in the list), so
126
+ only the one that should grow into the detail is named.
127
+ - as: "div" | "li" (default div). The element it renders: `"div"` (the default), or `"li"` for a card that is an item of a list,
128
+ so the list stays a `ul` of `li`.
129
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
130
+ - item: string | number (required). Which one, usually the record's id. Any text or number; unique on the page for one `name`.
131
+ - name: string (required). What the element is, shared by the card and its detail: `"shop"`, `"product"`. Any text.
132
+
133
+ ### Functions
134
+ - refreshMorphs: `refreshMorphs(): void`. measures every Morph again, so a card a router scrolled on screen after the render is named before the capture; call it from the router's `onRendered`.
@@ -0,0 +1,56 @@
1
+ ## NavigationProgress
2
+
3
+ Group: Feedback
4
+
5
+ When to use: A page load of unknown length: show at once that the click did something, until the next page renders.
6
+
7
+ ### The one right way
8
+ Pass `loading` from the router's pending state: the bar shows while it is true and is gone when the page has arrived.
9
+ ```tsx
10
+ import { useState } from "react";
11
+ import { Button, NavigationProgress, PageFade, Stack, Text } from "@slashsuite/ui-react";
12
+
13
+ function Example() {
14
+ const [pending, setPending] = useState(true);
15
+ return (
16
+ <Stack gap="sm">
17
+ <NavigationProgress loading={pending} />
18
+ <Button variant="outline" onClick={() => setPending(!pending)}>
19
+ {pending ? "The page has arrived" : "Open the store page"}
20
+ </Button>
21
+ <PageFade>
22
+ <Text>{pending ? "Waiting for the next page." : "The current page."}</Text>
23
+ </PageFade>
24
+ </Stack>
25
+ );
26
+ }
27
+ ```
28
+
29
+ ### Do
30
+ - Render it once per app, beside the page frame, and pass `loading` from the router's pending state: with TanStack Router, `loading={useRouterState({ select: (s) => s.status === "pending" })}`. It has no router dependency.
31
+ - There is nothing to configure: it draws the bar while `loading` is true and nothing while it is false. The bar is invisible for its first 150ms, so a fast navigation shows nothing.
32
+ - It is fixed to the top edge of the viewport and overlays the header, so nothing on the page moves. Pair it with `PageFade`: the bar says the page is loading, and the fade swaps the content when it arrives.
33
+ - A task with a known length and a value is a `ProgressBar`, not this.
34
+
35
+ ### Don't
36
+ A `ProgressBar` needs a value, and a page load has none to give: a guessed one sits still or lies about how far along it is.
37
+ ```tsx
38
+ import { ProgressBar, Stack, Text } from "@slashsuite/ui-react";
39
+
40
+ <Stack gap="sm">
41
+ <ProgressBar value={60} label="Loading page" />
42
+ <Text>Waiting for the next page.</Text>
43
+ </Stack>
44
+ ```
45
+
46
+ ### Accessibility
47
+ - While shown it is `role="progressbar"` named by `label` ("Loading page" by default) and has no `aria-valuenow`, so it reads as an indeterminate progress bar. When hidden it is not in the page.
48
+ - Under `prefers-reduced-motion: reduce` the segment slides slowly and evenly rather than stopping: a still, full-width bar would read as finished.
49
+ - It takes no pointer events, so it never covers a control in the header.
50
+
51
+ ### Props
52
+ ### NavigationProgress
53
+ A thin indeterminate bar along the top edge of the viewport, in the accent tone, for a route change that is under way and has no known length. Pass `loading` from the router's pending state and render it once per app, beside the page frame. It draws exactly what `loading` says: the bar while it is true and nothing while it is false. The stylesheet holds it invisible for the first 150ms, so a fast navigation shows nothing. It is fixed to the viewport and overlays the top of the header, so nothing on the page moves. Under `prefers-reduced-motion: reduce` the segment slides slowly and evenly instead: a still, full bar would read as finished.
54
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
55
+ - label: string (default Loading page). The bar's accessible name.
56
+ - loading: boolean (required). True while a navigation is pending, e.g. from the router's state.
@@ -0,0 +1,75 @@
1
+ ## NumberField
2
+
3
+ Group: Forms
4
+
5
+ When to use: A quantity, a count or an amount the person sets exactly: items in a cart, guests, a price.
6
+
7
+ ### The one right way
8
+ A count the person sets is a `NumberField`: type it, or step it with the buttons.
9
+ ```tsx
10
+ import { NumberField } from "@slashsuite/ui-react";
11
+
12
+ <NumberField label="Quantity" defaultValue={1} minValue={1} maxValue={99} width="sm" />
13
+ ```
14
+
15
+ ### Do
16
+ - Give it a `label`; it draws its own label, `hint` and `error`, so it is never put in a `Field`.
17
+ - Set `minValue` and `maxValue`: the buttons stop there, and a typed number outside them is clamped when the field is left.
18
+ - `step` is how far a button or an arrow key moves it; a typed number snaps to it.
19
+ - `formatOptions` writes it as a currency (`{ style: "currency", currency: "EUR" }`), a percent or with fixed decimals, in the app's locale; `name` posts the plain number.
20
+ - Keep it with `defaultValue`, or control it with `value` and `onChange(number)`.
21
+ - `size` and `width` are the same choices as on `Input`. Name the buttons in another language with `decrementLabel` and `incrementLabel`.
22
+ - A level set by eye is a `Slider`. A choice from a few fixed numbers is a `Select` or a `RadioGroup`.
23
+
24
+ ### Don't
25
+ - Do not use a `Select` of numbers for a count: it caps the count and makes the person scroll.
26
+
27
+ A `Select` of numbers caps the count at its last option and makes the person scroll for it.
28
+ ```tsx
29
+ import { Select } from "@slashsuite/ui-react";
30
+
31
+ <Select
32
+ aria-label="Quantity"
33
+ defaultValue="1"
34
+ items={Array.from({ length: 10 }, (_, i) => ({
35
+ value: String(i + 1),
36
+ label: String(i + 1),
37
+ }))}
38
+ />
39
+ ```
40
+
41
+ ### Accessibility
42
+ - React Aria's number field: the input is a `textbox` with the label as its name, and the arrow keys, Page Up and Page Down step it.
43
+ - The minus and plus buttons are named after the label ("Decrease Quantity") and kept out of the tab order, since the keys do the same.
44
+ - A `hint` and an `error` are the field's description; an `error` marks it `aria-invalid` and is announced politely.
45
+
46
+ ### Props
47
+ ### NumberField
48
+ A number with a minus and a plus button either side of it, for a quantity, a count or an amount: React Aria's `NumberField`. The person types the number or steps it by `step` with the buttons, the arrow keys, Page Up and Page Down; `minValue` and `maxValue` stop the buttons and clamp a typed number when the field is left. `formatOptions` writes it as a currency, a percent or with fixed decimals in the app's locale, and the person types in that format. `label`, `hint`, `error`, `required` and `disabled` are a `DateField`'s; `size` and `width` an `Input`'s. While `loading` the label is drawn and the field is a bone of its height.
49
+ - decrementLabel: string (default Decrease). The name of the minus button, for an app in another language.
50
+ - defaultValue: number. The number it starts with, uncontrolled.
51
+ - disabled: boolean. Disables the field and its buttons.
52
+ - error: ReactNode. Marks the field invalid and shows this in red under the hint, announced politely.
53
+ - formatOptions: NumberFormatOptions. How the number is written, in the locale of the app's `I18nProvider` or else the browser's:
54
+ `{ style: "currency", currency: "EUR" }`, `{ style: "percent" }`, `{ maximumFractionDigits: 2 }`.
55
+ The person types in the same format.
56
+ - hint: ReactNode. A muted line under the field that says more; it stays while an error shows under it.
57
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
58
+ - incrementLabel: string (default Increase). The name of the plus button, for an app in another language.
59
+ - label: ReactNode. The field's visible label, above it. Without one, name the field with `aria-label`.
60
+ - loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
61
+ Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
62
+ - loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
63
+ - maxValue: number. The largest number allowed: the plus button stops there, and a larger typed one is lowered to it.
64
+ - minValue: number. The smallest number allowed: the minus button stops there, and a smaller typed one is raised to it.
65
+ - name: string. Posts the number in a form under this key, as plain digits whatever the format.
66
+ - onChange: ((value: number) => void). Called with the new number when it is committed (a step, or leaving the field); `NaN` when it is cleared.
67
+ - required: boolean. Marks the number required: the field is `aria-required`, and an empty one is invalid.
68
+ - size: Size | ResponsiveSize (default md). `sm` is compact, `text-sm` with less padding, for dense forms and table rows; `md` is `text-base`;
69
+ `lg` is `text-lg` with more padding, for a hero form. Under an `AppShell density="compact"` each
70
+ is one type step down, and on a touch screen a field is never under 16px.
71
+ `{ base: "md", md: "lg" }` changes size at the `md` breakpoint (48rem), in CSS, as a `Button`'s
72
+ does: give the field and the buttons in its row the same value, so the row stays aligned.
73
+ - step: number (default 1). How far one press of a button or an arrow key moves the number; a typed number snaps to it.
74
+ - value: number. The number shown, controlled, with `onChange`. `NaN` is an empty field.
75
+ - width: "sm" | "md" | "lg" | "auto" | "xs" | "fill" | "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.
@@ -0,0 +1,74 @@
1
+ ## OutlineRegion
2
+
3
+ Group: Content
4
+
5
+ When to use: Marking an area of a screenshot or an image: one that is ignored, flagged or picked.
6
+
7
+ ### Use instead
8
+ - Image (image.md): The picture is shown with nothing marked on it.
9
+
10
+ ### The one right way
11
+ A `label` says why the area is marked, so a reader can tell an ignored area from a flagged one.
12
+ ```tsx
13
+ import { OutlineRegion, RegionFrame } from "@slashsuite/ui-react";
14
+
15
+ <RegionFrame src={sampleShot} alt="The dashboard">
16
+ <OutlineRegion
17
+ rect={{ x: 228, y: 4, width: 80, height: 20 }}
18
+ within={sampleShotSize}
19
+ label="ignored"
20
+ hatched
21
+ />
22
+ </RegionFrame>
23
+ ```
24
+
25
+ ### Do
26
+ - Put the picture in a `RegionFrame` (`src`, `alt`, and `onLoad`, `id`, `data-*` or `aria-*`) and the `OutlineRegion`s inside it; each region places itself over the picture.
27
+ - `rect` is the area and `within` the picture's full size, both in the picture's own pixels (its natural size), so the box stays on its area at any width.
28
+ - Size the frame as an `Image`: `width` (`full`, or `sm`, `md`, `lg`, `xl`) and `aspect` (`natural`, its own proportions, or a shape that letterboxes the picture, never cropping it and never scaling it up). The regions stay on the picture, not the box. A shape also holds the frame's height before the picture loads.
29
+ - `label` is a short tag in the top-left corner that says what the area is or where it came from. `hatched` stripes the inside, for an area that is left out.
30
+ - `tone` says what the area is: `accent` (the default), `positive`, `warn` or `danger`. There is no `neutral` or `info`: their edges are too pale to stand out on a picture.
31
+ - `dashed` draws the edge dashed, for an area that is proposed or approximate. `active` draws a thicker edge on the one region the app has picked, such as the one hovered in a list beside the picture; the region has no hover state of its own.
32
+ - The outline takes its colour from the theme; do not draw a box of your own with a raw colour.
33
+
34
+ ### Don't
35
+ An unlabelled box leaves the reader to guess what it marks and where it came from.
36
+ ```tsx
37
+ import { OutlineRegion, RegionFrame } from "@slashsuite/ui-react";
38
+
39
+ <RegionFrame src={sampleShot} alt="The dashboard">
40
+ <OutlineRegion rect={{ x: 228, y: 4, width: 80, height: 20 }} within={sampleShotSize} />
41
+ </RegionFrame>
42
+ ```
43
+
44
+ ### Accessibility
45
+ - The region takes no pointer events, so it never blocks the picture or a layer drawn over it; the hatch is hidden from assistive tech.
46
+ - A `label` is plain text and is read out; a region with no label says nothing to a screen reader, so name the areas in text as well when they matter.
47
+
48
+ ### Props
49
+ ### RegionFrame
50
+ A picture with a hairline edge, and `children` laid over it: the `OutlineRegion`s that mark its areas. `onLoad`, `id`, `data-*` and `aria-*` go to the `<img>`, so the app can read the picture's own size for `within`. While `loading` with no `src` yet it is a bone of the frame's shape (4:3 for a `natural` one), as an `Image` is. It sizes as `Image` does. `width` is `full` (the parent's width) or 96, 160 or 256px. `aspect` `natural` keeps the picture's own proportions; any other shape letterboxes it (contain, never a crop) on the inset surface, centred and never scaled up, and the regions are laid over the picture itself, not the box, so each stays on its spot. A letterboxed picture needs its own size: a screenshot has one; an SVG needs `width` and `height` on its root, not only a `viewBox`.
51
+ - alt: string (required). What the picture shows; `""` for one that only decorates.
52
+ - aspect: "square" | "4:3" | "3:2" | "16:10" | "16:9" | "3:4" | "9:16" | "natural" (default natural). The box's shape: `natural` is the picture's own; any other letterboxes the picture inside it.
53
+ - children: ReactNode. The `OutlineRegion`s over the picture.
54
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
55
+ - loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
56
+ Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
57
+ - loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
58
+ - src: string. The picture; left out while it is not known yet, with `loading`.
59
+ - width: "sm" | "md" | "lg" | "xl" | "full" (default full). How wide the frame is: `full` fills its parent; `sm`, `md` and `lg` are 96, 160 and 256px, capped at the parent's width.
60
+
61
+ ### OutlineRegion
62
+ An accent outline over one area of a picture, such as a screenshot's ignored or flagged region. `rect` is in the picture's own units and `within` is the picture's full size in the same units; the box is placed in percent of them, so it sits right at any scale. Put it in a `RegionFrame`, over the picture. `label` is a small tag in its top-left corner; `hatched` stripes the inside, for an area that is left out. It takes no pointer events, so it never blocks the picture or a layer drawn over it. `tone` colours it by what the area is (`positive`, `warn`, `danger`; `accent` by default), `dashed` draws the edge dashed, for an area that is proposed or approximate, and `active` draws a thicker edge, for the one region the app has picked (the one hovered in a list beside the picture, say). The app sets `active`; the region has no hover state of its own.
63
+ - active: boolean (default false). Draws a thicker edge, for the region the app has picked. The app sets it; there is no hover state.
64
+ - dashed: boolean (default false). Draws the edge dashed, for an area that is proposed or approximate.
65
+ - hatched: boolean (default false). Stripes the inside, for an area left out (ignored, masked).
66
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
67
+ - label: ReactNode. A short tag in the top-left corner: where the area came from, or what it is.
68
+ - rect: RegionRect (required). The area, in the picture's own units.
69
+ - tone: "positive" | "warn" | "danger" | "accent" (default accent). The colour: `accent`, `positive`, `warn` or `danger`.
70
+ - within: { width: number; height: number; } (required). The picture's full size, in the same units as `rect`.
71
+
72
+ ### Types
73
+ - OutlineRegionTone: `"positive" | "warn" | "danger" | "accent"`. An `OutlineRegion`'s colour: `accent` (the default), or the shared `Tone`s that have a strong edge, `positive`, `warn` and `danger`. `neutral` and `info` are left out: their edges are pale lines that would not stand out on a picture.
74
+ - RegionRect: `{ x: number; y: number; width: number; height: number }`. A box in a picture's own units (an image's pixels): its top-left corner and its size.
@@ -0,0 +1,117 @@
1
+ ## PageFade
2
+
3
+ Group: Feedback
4
+
5
+ When to use: A site where the frame stays put and only the content between pages should fade.
6
+
7
+ ### The one right way
8
+ `PageFade` wraps only the content that changes between pages; the frame around it, with the control, stays put.
9
+ ```tsx
10
+ import { useState } from "react";
11
+ import {
12
+ PageFade,
13
+ SegmentedControl,
14
+ Stack,
15
+ startPageTransition,
16
+ Text,
17
+ } from "@slashsuite/ui-react";
18
+
19
+ function Example() {
20
+ const [value, setValue] = useState("overview");
21
+ const items = [
22
+ { value: "overview", label: "Overview" },
23
+ { value: "activity", label: "Activity" },
24
+ ];
25
+ return (
26
+ <Stack gap="sm">
27
+ <SegmentedControl
28
+ label="Page"
29
+ items={items}
30
+ value={value}
31
+ onChange={(next) => startPageTransition(() => setValue(next))}
32
+ />
33
+ <PageFade>
34
+ <Text>The {value} page.</Text>
35
+ </PageFade>
36
+ </Stack>
37
+ );
38
+ }
39
+ ```
40
+
41
+ ### Do
42
+ - Wrap what changes between pages, once per page, and leave the header and footer outside it.
43
+ - Start the change inside a view transition: `startPageTransition(() => setPage(next))` for a state change, or the router's own option (TanStack Router `viewTransition`, React Router's `viewTransition`, Astro's `ClientRouter`). Without one nothing fades.
44
+ - Leave `name` off: the whole page cross-fades and the frame, the same on both pages, looks still.
45
+ - Give a `name` only to a second region that must fade apart from the page, and only one no taller than the screen: a named region is captured at its full height. Each named one on a page needs its own `name`, and it is a stacking context, so portal an overlay inside it to the body.
46
+
47
+ ### Don't
48
+ Wrapping the frame too makes the control fade with the content, so the page flickers instead of changing in place.
49
+ ```tsx
50
+ import { useState } from "react";
51
+ import {
52
+ PageFade,
53
+ SegmentedControl,
54
+ Stack,
55
+ startPageTransition,
56
+ Text,
57
+ } from "@slashsuite/ui-react";
58
+
59
+ function Example() {
60
+ const [value, setValue] = useState("overview");
61
+ const items = [
62
+ { value: "overview", label: "Overview" },
63
+ { value: "activity", label: "Activity" },
64
+ ];
65
+ return (
66
+ <PageFade>
67
+ <Stack gap="sm">
68
+ <SegmentedControl
69
+ label="Page"
70
+ items={items}
71
+ value={value}
72
+ onChange={(next) => startPageTransition(() => setValue(next))}
73
+ />
74
+ <Text>The {value} page.</Text>
75
+ </Stack>
76
+ </PageFade>
77
+ );
78
+ }
79
+ ```
80
+
81
+ A plain state change swaps the content at once: there is no transition to fade.
82
+ ```tsx
83
+ import { useState } from "react";
84
+ import { Button, PageFade, Stack, Text } from "@slashsuite/ui-react";
85
+
86
+ function Example() {
87
+ const [value, setValue] = useState("overview");
88
+ return (
89
+ <Stack gap="sm">
90
+ <Button
91
+ variant="outline"
92
+ onClick={() => setValue(value === "overview" ? "activity" : "overview")}
93
+ >
94
+ Switch page
95
+ </Button>
96
+ <PageFade>
97
+ <Text>The {value} page.</Text>
98
+ </PageFade>
99
+ </Stack>
100
+ );
101
+ }
102
+ ```
103
+
104
+ ### Accessibility
105
+ - A PageFade is a plain `<div>` with no role, so it changes nothing for assistive technology.
106
+ - After `startPageTransition` swaps the page, focus moves to the new view (the PageFade with no `name`), so a screen reader starts reading the new page and Tab goes on from there. A tab or a segmented control that switched the view in place keeps its focus.
107
+ - Under `prefers-reduced-motion: reduce` the content swaps with no fade, and `startPageTransition` just runs the update.
108
+ - Where the browser has no View Transitions it is a plain `<div>` and the content swaps.
109
+
110
+ ### Props
111
+ ### PageFade
112
+ The page's content area, cross-faded by the View Transitions API when the route changes. Wrap what changes between pages, once per page. With no `name` the fade is the browser's own cross-fade of the whole viewport; the frame around the content (header, footer) stays still because it is the same on both pages. A `name` names this box so it fades apart from the page, for a second region; a named region is captured at its full height, so name only a region no taller than the screen, and give each named one on a page its own `name`. The fade runs only when the navigation is wrapped in a view transition: `startPageTransition`, or a router's own option (TanStack Router `viewTransition`, React Router's `viewTransition` prop, Astro's `ClientRouter`). Otherwise, or where the browser has no View Transitions, it renders and behaves as a plain `<div>`. A named PageFade is a stacking context, so a dropdown inside it cannot rise above a sticky header outside it: portal overlays to the body. The default one is not. Under `prefers-reduced-motion: reduce` the content swaps with no fade; a named one quiets only its own box, and a router's own transition of the rest of the page is the router's to quiet. It is where `startPageTransition` puts the focus after the change: it takes focus from script, never from Tab, and draws no ring for it.
113
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
114
+ - name: string. A view-transition name for this box, a CSS identifier (letters, digits, `-`, `_`), for a region no taller than the screen that fades apart from the page.
115
+
116
+ ### Functions
117
+ - startPageTransition: `startPageTransition(update: () => void): void`. runs a synchronous state change inside a view transition, so a PageFade cross-fades; call it from an event handler.
@@ -0,0 +1,93 @@
1
+ ## PageHeader
2
+
3
+ Group: Layout
4
+
5
+ When to use: The first block of every page but a landing page, which opens with a `Hero`; it puts the page's first content at the same y on every page.
6
+
7
+ ### The one right way
8
+ Breadcrumbs, title, description, actions and tabs are slots of one `PageHeader`; each is optional.
9
+ ```tsx
10
+ import { Breadcrumbs, Button, Tabs, PageHeader } from "@slashsuite/ui-react";
11
+
12
+ <PageHeader
13
+ breadcrumbs={
14
+ <Breadcrumbs
15
+ items={[
16
+ { label: "Hack Cove", href: "#project" },
17
+ { label: "Builds", href: "#builds" },
18
+ "Build 412",
19
+ ]}
20
+ />
21
+ }
22
+ title="Build 412"
23
+ description="main · 3 changed"
24
+ actions={
25
+ <>
26
+ <Button variant="outline">Reject</Button>
27
+ <Button>Accept all</Button>
28
+ </>
29
+ }
30
+ tabs={
31
+ <Tabs
32
+ label="Build"
33
+ items={[
34
+ { label: "Changed", href: "#changed", selected: true },
35
+ { label: "New", href: "#new" },
36
+ ]}
37
+ />
38
+ }
39
+ />
40
+ ```
41
+
42
+ ### Do
43
+ - Pass `title`, and `description`, `breadcrumbs`, `actions` and `tabs` as needed; never build a title row from a heading and a `Cluster`.
44
+ - `actions` sit beside the title from `sm` up and under it on a phone: a `Button` or two, one primary.
45
+ - `breadcrumbs` take a `Breadcrumbs`; `tabs` take `Tabs` of links to pages.
46
+ - Its fixed bottom margin gives every page the same first-block position. As a direct child of a `Stack` it has none and the Stack's `gap` is the only space, so do not wrap it in another element.
47
+ - One `PageHeader` per page: it holds the page's `<h1>`. A landing page has a `Hero` in its place.
48
+
49
+ ### Don't
50
+ A title row built from a heading, a description and a `Cluster` is a second header that drifts from every other page's. Use `PageHeader`.
51
+ ```tsx
52
+ import { Button, Cluster, PageHeading, Stack, Text } from "@slashsuite/ui-react";
53
+
54
+ <Cluster justify="between">
55
+ <Stack gap="xs">
56
+ <PageHeading>Build 412</PageHeading>
57
+ <Text>main · 3 changed</Text>
58
+ </Stack>
59
+ <Button>Accept all</Button>
60
+ </Cluster>
61
+ ```
62
+
63
+ Wrapped in a `div`, the header is no longer a direct child of the Stack, keeps its margin and doubles the space.
64
+ ```tsx
65
+ import { Card, PageHeader, Stack, Text } from "@slashsuite/ui-react";
66
+
67
+ <Stack gap="lg">
68
+ <div>
69
+ <PageHeader title="Members" description="Who can see this project." />
70
+ </div>
71
+ <Card title="Active">
72
+ <Text>3 members</Text>
73
+ </Card>
74
+ </Stack>
75
+ ```
76
+
77
+ ### Accessibility
78
+ - The title is the page's `<h1>`; the description is a paragraph.
79
+ - `Breadcrumbs` is a `<nav>` named Breadcrumb, with the last crumb marked `aria-current="page"`. Give the `Tabs` a `label`.
80
+ - On a narrow screen the actions move below the title.
81
+
82
+ ### Props
83
+ ### PageHeader
84
+ The top of a page: breadcrumbs, title, description, actions and tabs. Its fixed bottom margin puts every page's first block at the same y; as a direct child of a `Stack` it has none, so the Stack's gap is the only space under it. While `loading` it is the owner of the wait: what it has is drawn and an empty title is a bone.
85
+ - actions: ReactNode. Right of the title on `sm` and up, below it on a phone.
86
+ - breadcrumbs: ReactNode. A `Breadcrumbs` above the title.
87
+ - description: ReactNode. The lede under the title: a `Lead`, so it outranks the body text after it.
88
+ - id: string. The root element's `id`: an anchor, or the target of a `for` or an `aria-describedby`.
89
+ - loading: boolean. The data is not here yet: an empty slot draws a bone of its shape, a filled one draws as usual.
90
+ Left out, the part takes the nearest loading layout's or part's; `false` opts it out inside one.
91
+ - loadingLabel: string (default Loading). What a screen reader hears while this part is loading, when its own `loading` is set.
92
+ - tabs: ReactNode. A `Tabs` (or similar) under the title.
93
+ - title: ReactNode (required). The page's `h1`.