@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
@@ -1,30 +1,68 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useId, useRef, useState, } from "react";
3
- import { focusRing } from "./cx.js";
3
+ import { cx, focusRing } from "./cx.js";
4
+ import { ScrollBody } from "./scrollBody.js";
4
5
  import { GapProvider } from "./stackGap.js";
5
6
  import { releaseVelocity, restingSnap, snapCss, snapPx, } from "./sheetSnap.js";
6
- const SHEET = "absolute inset-x-0 bottom-0 z-10 flex max-h-full flex-col overflow-hidden rounded-t-2xl border border-b-0 border-slate-200 bg-white pb-[env(safe-area-inset-bottom)] text-slate-900 shadow-2xl transition-[height] duration-200 ease-out data-dragging:transition-none motion-reduce:transition-none md:start-4 md:end-auto md:w-96";
7
+ /** The sheet's surface and its docking at the bottom edge, at every width. */
8
+ const SHEET = "absolute inset-x-0 bottom-0 z-10 flex max-h-full flex-col overflow-hidden rounded-t-2xl border border-b-0 border-slate-200 bg-white pb-[env(safe-area-inset-bottom)] text-slate-900 shadow-2xl transition-[height] duration-200 ease-out data-dragging:transition-none motion-reduce:transition-none";
9
+ /** From `md` up, a sheet that is not inline is a panel at the start edge. */
10
+ const PANEL = "md:start-4 md:end-auto md:w-96";
11
+ /**
12
+ * From `md` up: a panel at the start edge, or, with `inlineFrom`, plain content in the parent's flow
13
+ * from that width (no docking, no height of its own, no handle), so the parent's grid places it;
14
+ * its body still scrolls within the parent's height.
15
+ */
16
+ const WIDE = {
17
+ panel: { sheet: PANEL, handle: "", header: "" },
18
+ md: {
19
+ sheet: "md:static md:z-auto md:h-auto! md:max-h-full md:rounded-none md:border-0 md:pb-0 md:shadow-none",
20
+ handle: "md:hidden",
21
+ header: "md:pt-3.5",
22
+ },
23
+ lg: {
24
+ sheet: `${PANEL} lg:static lg:z-auto lg:h-auto! lg:w-auto lg:max-h-full lg:rounded-none lg:border-0 lg:pb-0 lg:shadow-none`,
25
+ handle: "lg:hidden",
26
+ header: "lg:pt-3.5",
27
+ },
28
+ };
7
29
  const HANDLE = `flex h-6 w-full shrink-0 cursor-grab touch-none items-center justify-center text-slate-400 active:cursor-grabbing ${focusRing} focus-visible:-outline-offset-2`;
30
+ /** The arrow keys on the handle, and the step through the snaps each makes. */
31
+ const STEP = { ArrowUp: 1, ArrowDown: -1 };
8
32
  /** Pointer travel (px) under which a press on the handle is a tap, not a drag. */
9
33
  const TAP = 6;
10
34
  /** The pill grip on the handle. */
11
35
  const GRIP = (_jsx("svg", { viewBox: "0 0 36 4", fill: "currentColor", "aria-hidden": "true", className: "h-1 w-9", children: _jsx("rect", { width: "36", height: "4", rx: "2" }) }));
12
36
  const parentOf = (el) => el.offsetParent instanceof HTMLElement ? el.offsetParent : el.parentElement;
13
- /** Report the height the sheet rests at: now, on a change of snap, and when its parent resizes. */
14
- function useReportedHeight(sheet, resting, onHeightChange) {
37
+ /** Report the sheet's height: now, on a change of snap, when its parent resizes and through a drag. */
38
+ function useReportedHeight(sheet, resting, dragHeight, onHeightChange) {
15
39
  const report = useRef(onHeightChange);
16
40
  const reported = useRef(null);
41
+ const dragging = useRef(false);
17
42
  useEffect(() => {
18
43
  report.current = onHeightChange;
19
44
  });
45
+ // A drag reports each height it passes through, and its end the height the sheet rests at (the
46
+ // same snap included, which the effect below does not hear about).
47
+ useEffect(() => {
48
+ const el = sheet.current;
49
+ const parent = el && parentOf(el);
50
+ dragging.current = dragHeight !== null;
51
+ const px = dragHeight ?? (parent ? snapPx(resting, parent.clientHeight) : null);
52
+ if (px === null || px === reported.current)
53
+ return;
54
+ reported.current = px;
55
+ report.current?.(px);
56
+ }, [sheet, resting, dragHeight]);
20
57
  useEffect(() => {
21
58
  const el = sheet.current;
22
59
  const parent = el && parentOf(el);
23
60
  if (!parent)
24
61
  return undefined;
62
+ // A resize mid-drag reports nothing: the drag reports the height the sheet is at.
25
63
  const send = () => {
26
64
  const px = snapPx(resting, parent.clientHeight);
27
- if (px === reported.current)
65
+ if (dragging.current || px === reported.current)
28
66
  return;
29
67
  reported.current = px;
30
68
  report.current?.(px);
@@ -104,10 +142,21 @@ function useSheetDrag(sheet, { snaps, snap, onSnapChange }) {
104
142
  if (!swallow)
105
143
  onSnapChange((snap + 1) % snaps.length);
106
144
  };
145
+ /** ArrowUp steps one snap taller and ArrowDown one shorter, stopping at the ends. */
146
+ const onKeyDown = (event) => {
147
+ const step = STEP[event.key];
148
+ if (step === undefined)
149
+ return;
150
+ event.preventDefault();
151
+ const next = Math.min(Math.max(snap + step, 0), snaps.length - 1);
152
+ if (next !== snap)
153
+ onSnapChange(next);
154
+ };
107
155
  return {
108
156
  dragHeight,
109
157
  handle: {
110
158
  onClick,
159
+ onKeyDown,
111
160
  onPointerDown,
112
161
  onPointerMove,
113
162
  onPointerUp: (event) => release(event, false),
@@ -118,16 +167,18 @@ function useSheetDrag(sheet, { snaps, snap, onSnapChange }) {
118
167
  /**
119
168
  * A non-modal panel docked to the bottom edge of its positioned parent, over a full-screen view (a
120
169
  * map, a canvas) that stays usable behind it. It rests at one of its `snaps`; the handle steps
121
- * through them (Enter and Space), a drag of the handle moves it and releases to the nearest snap
122
- * (a fling steps on), and Escape inside it returns it to the first. Nothing is made inert and focus
123
- * never moves. Full width below `md`, a panel at the start edge from `md` up.
170
+ * through them (Enter and Space; ArrowUp and ArrowDown one up or down), a drag of the handle moves
171
+ * it and releases to the nearest snap (a fling steps on), and Escape inside it returns it to the
172
+ * first. Nothing is made inert and focus never moves. Full width below `md`, a panel at the start
173
+ * edge from `md` up, or, with `inlineFrom`, plain content in the page from that width.
124
174
  */
125
- export function BottomSheet({ label, snaps, snap, onSnapChange, header, footer, children, onHeightChange, ...rest }) {
175
+ export function BottomSheet({ label, snaps, snap, onSnapChange, header, footer, children, onHeightChange, inlineFrom, ...rest }) {
126
176
  const sheet = useRef(null);
127
177
  const bodyId = useId();
128
178
  const resting = snaps[snap] ?? snaps[0];
129
- useReportedHeight(sheet, resting, onHeightChange);
130
179
  const { dragHeight, handle } = useSheetDrag(sheet, { snaps, snap, onSnapChange });
180
+ useReportedHeight(sheet, resting, dragHeight, onHeightChange);
181
+ const wide = WIDE[inlineFrom ?? "panel"];
131
182
  const onKeyDown = (event) => {
132
183
  if (event.key !== "Escape" || event.defaultPrevented || snap === 0)
133
184
  return;
@@ -138,5 +189,5 @@ export function BottomSheet({ label, snaps, snap, onSnapChange, header, footer,
138
189
  event.preventDefault();
139
190
  onSnapChange(0);
140
191
  };
141
- return (_jsxs("section", { ...rest, ref: sheet, "aria-label": label, onKeyDown: onKeyDown, "data-dragging": dragHeight === null ? undefined : "", className: SHEET, style: { height: dragHeight === null ? snapCss(resting) : `${dragHeight}px` }, children: [_jsx("button", { ...handle, type: "button", "aria-label": label, "aria-expanded": snap > 0, "aria-controls": bodyId, className: HANDLE, children: GRIP }), header != null && (_jsx("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-slate-200 px-5.5 pb-3.5", children: header })), _jsx("div", { id: bodyId, className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-5.5 py-4", children: _jsx(GapProvider, { gap: "xs", children: children }) }), footer != null && (_jsx("footer", { className: "flex shrink-0 justify-end gap-2 border-t border-slate-200 px-5.5 py-3.5", children: footer }))] }));
192
+ return (_jsxs("section", { ...rest, ref: sheet, "aria-label": label, onKeyDown: onKeyDown, "data-dragging": dragHeight === null ? undefined : "", className: cx(SHEET, wide.sheet), style: { height: dragHeight === null ? snapCss(resting) : `${dragHeight}px` }, children: [_jsx("button", { ...handle, type: "button", "aria-label": label, "aria-expanded": snap > 0, "aria-controls": bodyId, className: cx(HANDLE, wide.handle), children: GRIP }), header != null && (_jsx("div", { className: cx("flex shrink-0 items-center justify-between gap-3 border-b border-slate-200 px-5.5 pb-3.5", wide.header), children: header })), _jsx(ScrollBody, { id: bodyId, label: label, className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-5.5 py-4", children: _jsx(GapProvider, { gap: "xs", children: children }) }), footer != null && (_jsx("footer", { className: "flex shrink-0 justify-end gap-2 border-t border-slate-200 px-5.5 py-3.5", children: footer }))] }));
142
193
  }
@@ -1,11 +1,11 @@
1
1
  import { type ReactElement, type ReactNode } from "react";
2
2
  import type { Passthrough } from "./props.js";
3
- /** The classes of a crumb that links somewhere, for a router's own <Link>. The current page is plain text, not a link. */
3
+ /** The classes of a crumb that links somewhere, for a router's own <Link>. */
4
4
  export declare const crumbLinkClass: string;
5
5
  /**
6
6
  * A crumb that links: `href`, drawn by the app's router link through `LinkProvider` for an in-app
7
- * path, else a plain `<a>`. `external` opens in a new tab. The last crumb is the current page and is
8
- * never a link.
7
+ * path, else a plain `<a>`. `external` opens in a new tab. The last crumb is the current page: given
8
+ * an `href` it is a link to this page with `aria-current="page"`.
9
9
  */
10
10
  export type Crumb = {
11
11
  label: ReactNode;
@@ -13,11 +13,13 @@ export type Crumb = {
13
13
  external?: boolean;
14
14
  };
15
15
  /**
16
- * `org / project / build / snapshot`: each crumb truncates, and the last is the current page. A
17
- * crumb is a node, or a `Crumb` object when it links.
16
+ * `org / project / build / snapshot`: the last crumb is the current page. A crumb is a node, or a
17
+ * `Crumb` object when it links. A trail too long for its row wraps onto the next line; a long parent
18
+ * truncates, showing its whole label in a tooltip on hover, focus and a tap, and the current page is
19
+ * never cut: its words wrap instead.
18
20
  */
19
21
  export declare function Breadcrumbs({ items, label, ...rest }: {
20
- /** The trail, first to current: a node, or a `Crumb` (`{ label, href, external? }`) for one that links. The last is the current page and never a link. */
22
+ /** The trail, first to current: a node, or a `Crumb` (`{ label, href, external? }`) for one that links. The last is the current page; a `Crumb` there links to it with `aria-current="page"`. */
21
23
  items: Array<Crumb | ReactNode>;
22
24
  /**
23
25
  * The trail's accessible name, on its `<nav>`, for an app in another language.
@@ -2,28 +2,38 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { isValidElement } from "react";
3
3
  import { cx, focusRing } from "./cx.js";
4
4
  import { renderLink } from "./link.js";
5
- /** The classes of a crumb that links somewhere, for a router's own <Link>. The current page is plain text, not a link. */
6
- export const crumbLinkClass = cx("rounded text-slate-500 hover:underline", focusRing);
5
+ import { Truncated } from "./truncated.js";
6
+ /** The classes of a crumb that links somewhere, for a router's own <Link>. */
7
+ export const crumbLinkClass = cx("rounded hover:underline", focusRing);
7
8
  function isCrumb(crumb) {
8
9
  return typeof crumb === "object" && crumb !== null && !isValidElement(crumb) && "label" in crumb;
9
10
  }
11
+ /** A crumb's words as plain text, for the tooltip of a cut parent; a node that is not text has none. */
12
+ function crumbText(crumb) {
13
+ const label = isCrumb(crumb) ? crumb.label : crumb;
14
+ return typeof label === "string" || typeof label === "number" ? String(label) : undefined;
15
+ }
10
16
  function CrumbContent({ crumb, current, }) {
11
17
  if (!isCrumb(crumb))
12
18
  return crumb;
13
- if (current)
14
- return crumb.label;
15
19
  return renderLink({
16
20
  href: crumb.href,
17
21
  external: crumb.external,
18
22
  className: crumbLinkClass,
23
+ "aria-current": current ? "page" : undefined,
19
24
  children: crumb.label,
20
25
  });
21
26
  }
22
27
  /**
23
- * `org / project / build / snapshot`: each crumb truncates, and the last is the current page. A
24
- * crumb is a node, or a `Crumb` object when it links.
28
+ * `org / project / build / snapshot`: the last crumb is the current page. A crumb is a node, or a
29
+ * `Crumb` object when it links. A trail too long for its row wraps onto the next line; a long parent
30
+ * truncates, showing its whole label in a tooltip on hover, focus and a tap, and the current page is
31
+ * never cut: its words wrap instead.
25
32
  */
26
33
  export function Breadcrumbs({ items, label = "Breadcrumb", ...rest }) {
27
34
  const last = items.length - 1;
28
- return (_jsx("nav", { ...rest, "aria-label": label, className: "min-w-0", children: _jsx("ol", { className: "flex min-w-0 items-center gap-2 text-sm", children: items.map((crumb, index) => (_jsxs("li", { "aria-current": index === last ? "page" : undefined, className: "flex min-w-0 items-center gap-2", children: [index > 0 && (_jsx("span", { "aria-hidden": "true", className: "text-slate-400", children: "/" })), _jsx("span", { className: cx("min-w-0 truncate", index === last ? "font-medium text-slate-900" : "text-slate-500"), children: _jsx(CrumbContent, { crumb: crumb, current: index === last }) })] }, index))) }) }));
35
+ return (_jsx("nav", { ...rest, "aria-label": label, className: "min-w-0", children: _jsx("ol", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-sm", children: items.map((crumb, index) => {
36
+ const current = index === last;
37
+ return (_jsxs("li", { "aria-current": current && !isCrumb(crumb) ? "page" : undefined, className: "flex min-w-0 items-center gap-2", children: [index > 0 && (_jsx("span", { "aria-hidden": "true", className: "text-slate-400", children: "/" })), current ? (_jsx("span", { className: "min-w-0 font-medium [overflow-wrap:anywhere] text-slate-900", children: _jsx(CrumbContent, { crumb: crumb, current: current }) })) : (_jsx(Truncated, { text: crumbText(crumb), className: "max-w-48 min-w-0 text-slate-500", children: _jsx(CrumbContent, { crumb: crumb, current: current }) }))] }, index));
38
+ }) }) }));
29
39
  }
package/dist/Button.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare const buttonSizeTables: {
15
15
  box: Record<Size, string>;
16
16
  boxMd: Record<Size, string>;
17
17
  };
18
+ export declare const COUNT = "inline-flex min-h-4 min-w-4 items-center justify-center rounded-full border border-current px-1 text-[0.625rem]/[1.4] font-semibold tabular-nums";
18
19
  /** Size, tone and variant: the look of a button, apart from its state. */
19
20
  type ButtonLook = {
20
21
  /**
package/dist/Button.js CHANGED
@@ -69,8 +69,9 @@ const TOGGLE_OFF = {
69
69
  hover: "hover:border-violet-400",
70
70
  };
71
71
  // The count chip: a pill in the button's own text colour (a hairline of `currentColor`), so it reads
72
- // on every variant and tone and needs no palette entry. The size is a Badge's.
73
- const COUNT = "inline-flex h-4 min-w-4 items-center justify-center rounded-full border border-current px-1 text-[10px] font-semibold leading-none tabular-nums";
72
+ // on every variant and tone and needs no palette entry. The size is a Badge's: rem text and a
73
+ // min-height, so the chip grows with the reader's text size.
74
+ export const COUNT = "inline-flex min-h-4 min-w-4 items-center justify-center rounded-full border border-current px-1 text-[0.625rem]/[1.4] font-semibold tabular-nums";
74
75
  /** The label, then the count chip. The comma is for a screen reader only, so the name reads "Splits, 3". */
75
76
  function withCount(children, count) {
76
77
  if (count === undefined)
@@ -110,7 +111,7 @@ export function blockedButtonClass(variant = "primary", { size = "md" } = {}, st
110
111
  }
111
112
  function idleClass(variant, size, tone, { step, pressed }) {
112
113
  const look = lookOf(variant, tone, pressed);
113
- return cx(shape(variant, size, step), DISABLED_PLAIN, look.color, look.hover);
114
+ return cx(shape(variant, size, step), "cursor-pointer", DISABLED_PLAIN, look.color, look.hover);
114
115
  }
115
116
  function isLink(props) {
116
117
  return props.href !== undefined;
@@ -0,0 +1,25 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { type HeadingLevel } from "./headingLevel.js";
3
+ import type { Passthrough } from "./props.js";
4
+ export type CallToActionProps = {
5
+ /** The ask, one line: "Start your first review today". Its heading names the band. */
6
+ title: ReactNode;
7
+ /** A small label above the title, set in the monospace face. */
8
+ overline?: ReactNode;
9
+ /** One sentence under the title, as a `Lead`. */
10
+ description?: ReactNode;
11
+ /** One or two actions: a primary `Button` and, if it has one, an `outline` or `ghost` one. */
12
+ actions: ReactNode;
13
+ /**
14
+ * The title's heading level, 2 to 6. It does not change how the title looks.
15
+ * @default one below the heading that holds the band: 2 on the page
16
+ */
17
+ level?: HeadingLevel | undefined;
18
+ } & Passthrough;
19
+ /**
20
+ * The closing ask of a landing page: a rounded band on the subtle surface with a hairline edge, its
21
+ * overline, title, one sentence and one or two actions centred in it. It is a `<section>` named by
22
+ * its title. One per page, as the last block before the footer; a section's own actions stay in its
23
+ * `Section`.
24
+ */
25
+ export declare function CallToAction({ title, overline, description, actions, level, ...rest }: CallToActionProps): ReactElement;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import { Cluster } from "./Cluster.js";
4
+ import { useHeadingLevel } from "./headingLevel.js";
5
+ import { Lead, Overline, PageHeading } from "./typography.js";
6
+ /**
7
+ * The closing ask of a landing page: a rounded band on the subtle surface with a hairline edge, its
8
+ * overline, title, one sentence and one or two actions centred in it. It is a `<section>` named by
9
+ * its title. One per page, as the last block before the footer; a section's own actions stay in its
10
+ * `Section`.
11
+ */
12
+ export function CallToAction({ title, overline, description, actions, level, ...rest }) {
13
+ const id = useId();
14
+ const own = useHeadingLevel(level);
15
+ const kicker = overline != null && overline !== false;
16
+ return (_jsx("section", { ...rest, "aria-labelledby": id, className: "rounded-2xl border border-slate-200 bg-slate-50 px-6 py-12 text-center sm:px-12 sm:py-16", children: _jsxs("div", { className: "mx-auto flex max-w-2xl flex-col items-center gap-4", children: [_jsxs("header", { children: [kicker && _jsx(Overline, { mono: true, children: overline }), _jsx(PageHeading, { as: `h${own}`, id: id, children: title })] }), description != null && description !== false && _jsx(Lead, { children: description }), _jsx("div", { className: "pt-2", children: _jsx(Cluster, { justify: "center", children: actions }) })] }) }));
17
+ }
package/dist/Callout.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const TONE_TEXT: Record<Tone, string>;
9
9
  /**
10
10
  * A tinted notice box, with an optional bold title above its body. Its text is text-sm (text-base/7
11
11
  * inside a `Prose`, boxed or `banner`). `actions` puts a button or link
12
- * at the end of the row; `banner` makes it a flat strip (bottom border only, no radius) for the
12
+ * at the end of the row, or under the text at full width below `sm`; `banner` makes it a flat strip (bottom border only, no radius) for the
13
13
  * top of a `Card flush` and nowhere else: a padded card or a padded `FullBleedLayout` column
14
14
  * would inset it. `align="center"` centres the text. In a page's column the notice is a plain Callout, first in the column's `Stack`. With `actions` the box is `relative`, so a `TextLink
15
15
  * stretch` there makes the whole callout its click target, like a link in a table row. `icon`
@@ -37,7 +37,7 @@ export declare function Callout({ tone, icon, title, actions, banner, align, chi
37
37
  * @default start
38
38
  */
39
39
  align?: "start" | "center" | undefined;
40
- /** A button or link at the end of the row, beside the title and body. */
40
+ /** A button or link at the end of the row, beside the title and body; on a phone, under them at full width. */
41
41
  actions?: ReactNode;
42
42
  children: ReactNode;
43
43
  } & Passthrough): ReactElement;
package/dist/Callout.js CHANGED
@@ -24,7 +24,7 @@ export const TONE_TEXT = {
24
24
  /**
25
25
  * A tinted notice box, with an optional bold title above its body. Its text is text-sm (text-base/7
26
26
  * inside a `Prose`, boxed or `banner`). `actions` puts a button or link
27
- * at the end of the row; `banner` makes it a flat strip (bottom border only, no radius) for the
27
+ * at the end of the row, or under the text at full width below `sm`; `banner` makes it a flat strip (bottom border only, no radius) for the
28
28
  * top of a `Card flush` and nowhere else: a padded card or a padded `FullBleedLayout` column
29
29
  * would inset it. `align="center"` centres the text. In a page's column the notice is a plain Callout, first in the column's `Stack`. With `actions` the box is `relative`, so a `TextLink
30
30
  * stretch` there makes the whole callout its click target, like a link in a table row. `icon`
@@ -35,7 +35,7 @@ export const TONE_TEXT = {
35
35
  export function Callout({ tone = "neutral", icon, title, actions, banner = false, align = "start", children, ...rest }) {
36
36
  const size = useProse() ? "text-base/7" : "text-sm";
37
37
  const content = withIcon(icon, title ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-semibold", children: title }), _jsx("div", { className: "mt-1", children: children })] })) : (children));
38
- return (_jsx("div", { role: ROLE[tone], className: cx(Boolean(actions) && "relative", banner ? "border-b px-5 py-3" : "rounded-xl border p-4", size, TONE_SURFACE[tone], TONE_TEXT[tone], align === "center" && "text-center"), ...rest, children: _jsx(GapProvider, { gap: "xs", children: actions ? (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: "min-w-0", children: content }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })] })) : (content) }) }));
38
+ return (_jsx("div", { role: ROLE[tone], className: cx(Boolean(actions) && "relative", banner ? "border-b px-5 py-3" : "rounded-xl border p-4", size, TONE_SURFACE[tone], TONE_TEXT[tone], align === "center" && "text-center"), ...rest, children: _jsx(GapProvider, { gap: "xs", children: actions ? (_jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("div", { className: "min-w-0", children: content }), _jsx("div", { className: "flex items-center gap-2 *:flex-1 sm:shrink-0 sm:*:flex-none", children: actions })] })) : (content) }) }));
39
39
  }
40
40
  /** The callout's text with its `icon` at the start, the icon centred on the first line. */
41
41
  function withIcon(icon, text) {
package/dist/Card.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode } from "react";
2
2
  import type { Tone } from "./tone.js";
3
+ import { type CardHue } from "./cardForm.js";
3
4
  import { type HeadingLevel } from "./headingLevel.js";
4
5
  import type { IconName } from "./icons.js";
5
- import type { Unstyled } from "./props.js";
6
+ import type { Passthrough } from "./props.js";
6
7
  import { type LoadingProps } from "./skeleton.js";
8
+ export type { CardHue } from "./cardForm.js";
7
9
  import type { Size } from "./size.js";
8
10
  type CardBase = LoadingProps & {
9
- /** The card's heading (a small uppercase label unless `titleStyle` says otherwise). It names the card, which is then a `section`. */
11
+ /** The card's heading (a small uppercase label unless `titleStyle` says otherwise). It names the card, which is then an `article`. */
10
12
  title?: string;
11
13
  /**
12
14
  * The title's heading level, 2 to 6. It does not change how the title looks.
@@ -28,8 +30,11 @@ type CardBase = LoadingProps & {
28
30
  bar?: boolean;
29
31
  /** No padding and `overflow-hidden`: the body (a table, a list) fills the card. */
30
32
  flush?: boolean;
31
- /** A soft fill and border in the Callout's tones, for a data panel with a status. Ignored with `bar`. */
32
- tone?: Tone;
33
+ /**
34
+ * A dashed edge, for a card that stands for something not real yet: a plan, a draft, an imagined
35
+ * result beside a real one. With `bar` the strip's lower edge is dashed too.
36
+ */
37
+ dashed?: boolean;
33
38
  /**
34
39
  * One of the library's icons, drawn at feature size in the accent colour above the title: the
35
40
  * mark of a feature card. Ignored with `bar` and `flush`.
@@ -46,8 +51,9 @@ type CardBase = LoadingProps & {
46
51
  inset?: ReactNode;
47
52
  /**
48
53
  * A `Pill` (or any small node) pinned in the top corner at the end edge, over the content and
49
- * inside the radius, with no change to the layout. On a card that is a link it is part of the
50
- * link's name, and a link or button in it is clickable on its own.
54
+ * inside the radius, with no change to the layout. On a titled link card the link is named by the
55
+ * title alone; an untitled one is named by its whole content, badge included. A link or button in
56
+ * it is clickable on its own.
51
57
  *
52
58
  * Use it for a category (`Pill tone="info"`) or a flag on the thing itself.
53
59
  */
@@ -68,7 +74,26 @@ type CardBase = LoadingProps & {
68
74
  * @default md
69
75
  */
70
76
  size?: Size;
77
+ /**
78
+ * `sm` caps the card at 24rem, for a card that stands alone in a wide column (a sign-in panel, a
79
+ * plan). Left out, the card takes the width it is given.
80
+ */
81
+ width?: "sm" | undefined;
71
82
  children: ReactNode;
83
+ } & CardSurface;
84
+ /** `tone` and `hue` paint the same fill and edge, so a card takes one or the other. */
85
+ type CardSurface = {
86
+ /** A soft fill and border in the Callout's tones, for a data panel with a status. Ignored with `bar`. */
87
+ tone?: Tone | undefined;
88
+ hue?: undefined;
89
+ } | {
90
+ tone?: undefined;
91
+ /**
92
+ * One hue of a set of peer cards, such as one card per product: a soft fill and edge the theme
93
+ * paints. It is not a status (that is `tone`), and the title still names the card. Ignored with
94
+ * `bar` and `dashed`.
95
+ */
96
+ hue?: CardHue | undefined;
72
97
  };
73
98
  type CardPanelProps = CardBase & {
74
99
  /** Buttons or links at the end of the header: in the strip with `bar`, else beside the title. */
@@ -83,38 +108,66 @@ type CardPanelProps = CardBase & {
83
108
  * body, so a keyboard can reach and scroll it.
84
109
  */
85
110
  fill?: boolean;
86
- /**
87
- * `article` for a card that stands alone as a piece of content (a post, a listing). Left out, a
88
- * titled card is a `section` named by its title, one with only an `aria-label` a `section` named
89
- * by that, and any other a `div`. Not on a card that is a link.
90
- */
91
- as?: "article" | undefined;
92
111
  href?: undefined;
93
112
  external?: undefined;
94
- } & Omit<ComponentPropsWithoutRef<"section">, "title" | "className" | "style" | "children">;
113
+ more?: undefined;
114
+ moreLabel?: undefined;
115
+ onPress?: undefined;
116
+ } & Omit<ComponentPropsWithoutRef<"article">, "title" | "className" | "style" | "children">;
95
117
  type CardLinkProps = CardBase & {
96
118
  actions?: undefined;
97
119
  footer?: undefined;
98
120
  fill?: undefined;
99
- as?: undefined;
121
+ onPress?: undefined;
100
122
  /** Opens in a new tab: adds `target="_blank"` and `rel="noreferrer"`. */
101
123
  external?: boolean | undefined;
102
124
  /**
103
- * Makes the whole card one link to this URL, with no `actions`, `footer` or `as`; an in-app path
104
- * goes through the app's `LinkProvider`.
125
+ * Makes the whole card one link to this URL, with no `actions` or `footer`; an in-app path goes
126
+ * through the app's `LinkProvider`. The link is named by the card's title.
105
127
  */
106
128
  href: string;
107
- } & Unstyled<Omit<ComponentPropsWithoutRef<"a">, "href" | "title" | "children">>;
129
+ /**
130
+ * A "Read more" line with an arrow at the foot of the card, in the accent colour: the cue that the
131
+ * card goes somewhere, for a post or an article. Draw it on every card of a set or on none.
132
+ */
133
+ more?: boolean | undefined;
134
+ /**
135
+ * The words of the `more` line.
136
+ * @default "Read more"
137
+ */
138
+ moreLabel?: string | undefined;
139
+ } & Passthrough &
140
+ /** The link's own: a file to save, a `rel` beyond `external`'s, and a press to track. */
141
+ Pick<ComponentPropsWithoutRef<"a">, "download" | "rel" | "onClick">;
142
+ type CardButtonProps = CardBase & {
143
+ actions?: undefined;
144
+ footer?: undefined;
145
+ fill?: undefined;
146
+ href?: undefined;
147
+ external?: undefined;
148
+ more?: undefined;
149
+ moreLabel?: undefined;
150
+ /**
151
+ * Makes the whole card one button that runs this, stretched over the card like a link card's link
152
+ * and named by its title: a card the user picks (a store, a plan). With no `actions`, `footer` or
153
+ * `href`. A picked card says so with `aria-pressed` and its own words (a `Pill` in `badge`).
154
+ */
155
+ onPress: () => void;
156
+ } & Passthrough;
157
+ type CardProps = CardPanelProps | CardLinkProps | CardButtonProps;
108
158
  /**
109
- * A bordered panel with an optional title, count and status. A titled card is a `section` named by
110
- * its title, one with only an `aria-label` a `section` too, any other a `div`, and `as="article"` makes it an `article`. Two opt-in forms
159
+ * A bordered panel with an optional title, count and status. A titled card is an `article` named by
160
+ * its title, one with only an `aria-label` an `article` too, and any other a `div`. Two opt-in forms
111
161
  * for data views: `flush` drops the padding and clips the corners, for a table that runs edge to
112
162
  * edge; `bar` puts the title, count and `actions` in a tinted strip across the top, over the body.
113
163
  * A flush card has no padding for a `title`, so give it a `bar`. An empty state is an `EmptyState`,
114
164
  * which draws its own dashed frame. Inside a card a `Stack` is `xs` apart, and the title's
115
165
  * heading level is one below the heading that holds the card. `size="sm"` is the dense padding and `size="lg"` the
116
166
  * roomy one, the same on a `ListRow` and a `FileDrop`. `tone` is the Callout's set, for a data panel that carries a status
117
- * (a soft fill and border, no shadow); a message is still a `Callout`, and `bar` has no tone. A
167
+ * (a soft fill and border, no shadow); a message is still a `Callout`, and `bar` has no tone. `hue`
168
+ * paints one of a set of peer cards in its own hue, the theme's; it is not a status, and `tone`,
169
+ * `bar` and `dashed` win over it. `dashed` draws a dashed edge for a card that stands for something
170
+ * not real yet, and with `bar` the strip's edge is dashed too. `width="sm"` caps the card at 24rem. A
118
171
  * titled panel is named by its title: the root gets
119
172
  * `aria-labelledby` pointing at the heading, unless the caller passes its own `aria-label` or
120
173
  * `aria-labelledby`, which wins. Other props (`id`, `data-*`, `aria-*`) go on the root. The root is `relative`, so a
@@ -129,20 +182,24 @@ type CardLinkProps = CardBase & {
129
182
  * total; in a `CardGrid` it stays at the foot of a card that is stretched to the row's height. It
130
183
  * suits a panel, not a card that is a link.
131
184
  *
132
- * `fill` makes a panel take its parent's full height (the parent sets it): the title or bar stays
133
- * put and the body scrolls. Not on a link card.
185
+ * `fill` makes a panel take its parent's full height (the parent sets it): the title or bar and the
186
+ * `inset` band stay put and the body scrolls, with room inside it for a focus ring at its edge. Not
187
+ * on a link card.
134
188
  *
135
189
  * `href` makes the whole card one link: a hover border and the focus ring, with the link stretched
136
- * over the card, so it takes no `actions`, `footer` or `as`. A `TextLink`, `Button` or `Checkbox` in
137
- * the body sits above the link and is clickable on its own. An in-app `href` is drawn by the app's
138
- * router link through `LinkProvider`. `external` opens it in a new tab. On a link card
139
- * `id`, `data-*` and the describing `aria-*` (`aria-describedby`, `aria-details`, …) go on the card
140
- * root, not the link; the link's own `aria-label`, `aria-labelledby` and `aria-current` stay on the
141
- * link. The link is named by the card's text (title, body, `badge`) through the root's id, which is
142
- * generated when the caller gives none.
190
+ * over the card, so it takes no `actions` or `footer`. `onPress` makes it one button the same way. A
191
+ * `TextLink`, `Button` or `Checkbox` in the body sits above the link and is clickable on its own. An
192
+ * in-app `href` is drawn by the app's router link through `LinkProvider`. `external` opens it in a
193
+ * new tab, and `more` draws a "Read more" line at its foot. On a link or button card `id`, `data-*`
194
+ * and the describing `aria-*` (`aria-describedby`, `aria-details`, …) go on the card root; the
195
+ * control's own `aria-label`, `aria-labelledby`, `aria-current` and `aria-pressed` stay on it. The
196
+ * link or button is named by the card's title; an untitled one by the card's text, through the root's
197
+ * id, which is generated when the caller gives none.
198
+ *
199
+ * In a `CardGrid align="regions"` the card's header, body and footer line up with its neighbours'
200
+ * across the row.
143
201
  *
144
202
  * While `loading` a card with no children draws three lines of text bones, a `flush` one three
145
203
  * `ListRow` bones; what it has (its title, its children) draws as usual.
146
204
  */
147
- export declare function Card(props: CardPanelProps | CardLinkProps): ReactElement;
148
- export {};
205
+ export declare function Card(props: CardProps): ReactElement;