@slashsuite/ui-react 0.0.0-stage → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/LICENSE +21 -0
  2. package/MIGRATING.md +540 -0
  3. package/README.md +548 -2
  4. package/dist/AppShell.d.ts +127 -0
  5. package/dist/AppShell.js +119 -0
  6. package/dist/AppShellMenu.d.ts +26 -0
  7. package/dist/AppShellMenu.js +66 -0
  8. package/dist/Avatar.d.ts +75 -0
  9. package/dist/Avatar.js +95 -0
  10. package/dist/AvatarStack.d.ts +31 -0
  11. package/dist/AvatarStack.js +34 -0
  12. package/dist/Badge.d.ts +15 -0
  13. package/dist/Badge.js +15 -0
  14. package/dist/BottomSheet.d.ts +36 -0
  15. package/dist/BottomSheet.js +142 -0
  16. package/dist/Breadcrumbs.d.ts +27 -0
  17. package/dist/Breadcrumbs.js +29 -0
  18. package/dist/BulletList.d.ts +18 -0
  19. package/dist/BulletList.js +18 -0
  20. package/dist/Button.d.ts +121 -0
  21. package/dist/Button.js +182 -0
  22. package/dist/ButtonGroup.d.ts +15 -0
  23. package/dist/ButtonGroup.js +10 -0
  24. package/dist/Callout.d.ts +43 -0
  25. package/dist/Callout.js +45 -0
  26. package/dist/Card.d.ts +148 -0
  27. package/dist/Card.js +171 -0
  28. package/dist/CardBadge.d.ts +7 -0
  29. package/dist/CardBadge.js +12 -0
  30. package/dist/CardBody.d.ts +28 -0
  31. package/dist/CardBody.js +30 -0
  32. package/dist/CardGrid.d.ts +53 -0
  33. package/dist/CardGrid.js +52 -0
  34. package/dist/CardParts.d.ts +40 -0
  35. package/dist/CardParts.js +41 -0
  36. package/dist/ChatComposer.d.ts +35 -0
  37. package/dist/ChatComposer.js +50 -0
  38. package/dist/ChatMessage.d.ts +26 -0
  39. package/dist/ChatMessage.js +21 -0
  40. package/dist/ChatThread.d.ts +25 -0
  41. package/dist/ChatThread.js +60 -0
  42. package/dist/Checkbox.d.ts +42 -0
  43. package/dist/Checkbox.js +63 -0
  44. package/dist/Chevron.d.ts +5 -0
  45. package/dist/Chevron.js +6 -0
  46. package/dist/Cluster.d.ts +70 -0
  47. package/dist/Cluster.js +47 -0
  48. package/dist/Code.d.ts +6 -0
  49. package/dist/Code.js +5 -0
  50. package/dist/CodeBlock.d.ts +46 -0
  51. package/dist/CodeBlock.js +21 -0
  52. package/dist/CodeBody.d.ts +20 -0
  53. package/dist/CodeBody.js +38 -0
  54. package/dist/CodeExample.d.ts +25 -0
  55. package/dist/CodeExample.js +17 -0
  56. package/dist/CodeText.d.ts +11 -0
  57. package/dist/CodeText.js +64 -0
  58. package/dist/ColourSchemeToggle.d.ts +36 -0
  59. package/dist/ColourSchemeToggle.js +64 -0
  60. package/dist/Container.d.ts +22 -0
  61. package/dist/Container.js +26 -0
  62. package/dist/CopyButton.d.ts +17 -0
  63. package/dist/CopyButton.js +39 -0
  64. package/dist/CopyLine.d.ts +9 -0
  65. package/dist/CopyLine.js +7 -0
  66. package/dist/DateCalendar.d.ts +23 -0
  67. package/dist/DateCalendar.js +89 -0
  68. package/dist/DateField.d.ts +124 -0
  69. package/dist/DateField.js +111 -0
  70. package/dist/DateFieldCalendar.d.ts +24 -0
  71. package/dist/DateFieldCalendar.js +50 -0
  72. package/dist/DateRangePicker.d.ts +47 -0
  73. package/dist/DateRangePicker.js +44 -0
  74. package/dist/Dialog.d.ts +56 -0
  75. package/dist/Dialog.js +94 -0
  76. package/dist/Disclosure.d.ts +29 -0
  77. package/dist/Disclosure.js +23 -0
  78. package/dist/Divider.d.ts +4 -0
  79. package/dist/Divider.js +5 -0
  80. package/dist/DocsLayout.d.ts +69 -0
  81. package/dist/DocsLayout.js +64 -0
  82. package/dist/Drawer.d.ts +30 -0
  83. package/dist/Drawer.js +24 -0
  84. package/dist/EmptyState.d.ts +47 -0
  85. package/dist/EmptyState.js +34 -0
  86. package/dist/Field.d.ts +44 -0
  87. package/dist/Field.js +51 -0
  88. package/dist/FieldDialog.d.ts +26 -0
  89. package/dist/FieldDialog.js +31 -0
  90. package/dist/Fieldset.d.ts +21 -0
  91. package/dist/Fieldset.js +22 -0
  92. package/dist/FileDrop.d.ts +17 -0
  93. package/dist/FileDrop.js +14 -0
  94. package/dist/FormRow.d.ts +46 -0
  95. package/dist/FormRow.js +39 -0
  96. package/dist/Hero.d.ts +23 -0
  97. package/dist/Hero.js +28 -0
  98. package/dist/Icon.d.ts +40 -0
  99. package/dist/Icon.js +30 -0
  100. package/dist/IconButton.d.ts +72 -0
  101. package/dist/IconButton.js +65 -0
  102. package/dist/Image.d.ts +58 -0
  103. package/dist/Image.js +69 -0
  104. package/dist/InlineEdit.d.ts +22 -0
  105. package/dist/InlineEdit.js +60 -0
  106. package/dist/Input.d.ts +40 -0
  107. package/dist/Input.js +42 -0
  108. package/dist/InputShell.d.ts +24 -0
  109. package/dist/InputShell.js +40 -0
  110. package/dist/Kbd.d.ts +6 -0
  111. package/dist/Kbd.js +5 -0
  112. package/dist/KeyValueList.d.ts +34 -0
  113. package/dist/KeyValueList.js +35 -0
  114. package/dist/Lightbox.d.ts +45 -0
  115. package/dist/Lightbox.js +46 -0
  116. package/dist/ListRow.d.ts +26 -0
  117. package/dist/ListRow.js +151 -0
  118. package/dist/Markdown.d.ts +11 -0
  119. package/dist/Markdown.js +49 -0
  120. package/dist/MediaTile.d.ts +66 -0
  121. package/dist/MediaTile.js +50 -0
  122. package/dist/Menu.d.ts +64 -0
  123. package/dist/Menu.js +86 -0
  124. package/dist/MetaList.d.ts +23 -0
  125. package/dist/MetaList.js +20 -0
  126. package/dist/Morph.d.ts +41 -0
  127. package/dist/Morph.js +107 -0
  128. package/dist/NavigationProgress.d.ts +20 -0
  129. package/dist/NavigationProgress.js +26 -0
  130. package/dist/OutlineRegion.d.ts +60 -0
  131. package/dist/OutlineRegion.js +51 -0
  132. package/dist/PageFade.d.ts +30 -0
  133. package/dist/PageFade.js +46 -0
  134. package/dist/PageHeader.d.ts +26 -0
  135. package/dist/PageHeader.js +18 -0
  136. package/dist/PageLayouts.d.ts +100 -0
  137. package/dist/PageLayouts.js +78 -0
  138. package/dist/Pagination.d.ts +38 -0
  139. package/dist/Pagination.js +65 -0
  140. package/dist/Pill.d.ts +79 -0
  141. package/dist/Pill.js +121 -0
  142. package/dist/ProgressBar.d.ts +47 -0
  143. package/dist/ProgressBar.js +47 -0
  144. package/dist/RadioGroup.d.ts +55 -0
  145. package/dist/RadioGroup.js +53 -0
  146. package/dist/ScrollStrip.d.ts +21 -0
  147. package/dist/ScrollStrip.js +12 -0
  148. package/dist/SearchInput.d.ts +9 -0
  149. package/dist/SearchInput.js +55 -0
  150. package/dist/Section.d.ts +93 -0
  151. package/dist/Section.js +55 -0
  152. package/dist/SegmentedControl.d.ts +47 -0
  153. package/dist/SegmentedControl.js +78 -0
  154. package/dist/Select.d.ts +28 -0
  155. package/dist/Select.js +19 -0
  156. package/dist/Show.d.ts +33 -0
  157. package/dist/Show.js +27 -0
  158. package/dist/SideColumn.d.ts +50 -0
  159. package/dist/SideColumn.js +45 -0
  160. package/dist/SidebarLayout.d.ts +32 -0
  161. package/dist/SidebarLayout.js +77 -0
  162. package/dist/SiteFooter.d.ts +31 -0
  163. package/dist/SiteFooter.js +24 -0
  164. package/dist/SiteSearch.d.ts +40 -0
  165. package/dist/SiteSearch.js +150 -0
  166. package/dist/SortableList.d.ts +86 -0
  167. package/dist/SortableList.js +191 -0
  168. package/dist/SplitBar.d.ts +29 -0
  169. package/dist/SplitBar.js +22 -0
  170. package/dist/Stack.d.ts +114 -0
  171. package/dist/Stack.js +76 -0
  172. package/dist/StackedBar.d.ts +64 -0
  173. package/dist/StackedBar.js +58 -0
  174. package/dist/StatTile.d.ts +33 -0
  175. package/dist/StatTile.js +44 -0
  176. package/dist/StatusPages.d.ts +49 -0
  177. package/dist/StatusPages.js +63 -0
  178. package/dist/Steps.d.ts +29 -0
  179. package/dist/Steps.js +43 -0
  180. package/dist/StickyBar.d.ts +12 -0
  181. package/dist/StickyBar.js +10 -0
  182. package/dist/Switch.d.ts +56 -0
  183. package/dist/Switch.js +91 -0
  184. package/dist/Table.d.ts +92 -0
  185. package/dist/Table.js +92 -0
  186. package/dist/TableCells.d.ts +97 -0
  187. package/dist/TableCells.js +104 -0
  188. package/dist/TableEditCell.d.ts +31 -0
  189. package/dist/TableEditCell.js +17 -0
  190. package/dist/TableExpandCell.d.ts +25 -0
  191. package/dist/TableExpandCell.js +15 -0
  192. package/dist/Tabs.d.ts +38 -0
  193. package/dist/Tabs.js +46 -0
  194. package/dist/TextLink.d.ts +51 -0
  195. package/dist/TextLink.js +38 -0
  196. package/dist/Textarea.d.ts +11 -0
  197. package/dist/Textarea.js +11 -0
  198. package/dist/Timeline.d.ts +31 -0
  199. package/dist/Timeline.js +38 -0
  200. package/dist/ToastRegion.d.ts +44 -0
  201. package/dist/ToastRegion.js +37 -0
  202. package/dist/Tooltip.d.ts +46 -0
  203. package/dist/Tooltip.js +181 -0
  204. package/dist/TrendChart.d.ts +36 -0
  205. package/dist/TrendChart.js +58 -0
  206. package/dist/Video.d.ts +13 -0
  207. package/dist/Video.js +9 -0
  208. package/dist/blocked.d.ts +31 -0
  209. package/dist/blocked.js +31 -0
  210. package/dist/cardContext.d.ts +8 -0
  211. package/dist/cardContext.js +14 -0
  212. package/dist/cardWait.d.ts +13 -0
  213. package/dist/cardWait.js +16 -0
  214. package/dist/colourScheme.d.ts +22 -0
  215. package/dist/colourScheme.js +53 -0
  216. package/dist/control.d.ts +29 -0
  217. package/dist/control.js +37 -0
  218. package/dist/copyScript.d.ts +13 -0
  219. package/dist/copyScript.js +13 -0
  220. package/dist/cx.d.ts +19 -0
  221. package/dist/cx.js +21 -0
  222. package/dist/density.d.ts +38 -0
  223. package/dist/density.js +77 -0
  224. package/dist/emptySlot.d.ts +11 -0
  225. package/dist/emptySlot.js +16 -0
  226. package/dist/fieldControl.d.ts +23 -0
  227. package/dist/fieldControl.js +24 -0
  228. package/dist/fieldWait.d.ts +30 -0
  229. package/dist/fieldWait.js +27 -0
  230. package/dist/foldedColumn.d.ts +18 -0
  231. package/dist/foldedColumn.js +51 -0
  232. package/dist/headingLevel.d.ts +10 -0
  233. package/dist/headingLevel.js +18 -0
  234. package/dist/highlight.d.ts +18 -0
  235. package/dist/highlight.js +306 -0
  236. package/dist/highlightConsole.d.ts +9 -0
  237. package/dist/highlightConsole.js +42 -0
  238. package/dist/highlightHtml.d.ts +7 -0
  239. package/dist/highlightHtml.js +132 -0
  240. package/dist/highlightKit.d.ts +16 -0
  241. package/dist/highlightKit.js +23 -0
  242. package/dist/highlightYaml.d.ts +3 -0
  243. package/dist/highlightYaml.js +143 -0
  244. package/dist/icons.d.ts +16 -0
  245. package/dist/icons.js +108 -0
  246. package/dist/index.d.ts +99 -0
  247. package/dist/index.js +92 -0
  248. package/dist/isoDate.d.ts +5 -0
  249. package/dist/isoDate.js +16 -0
  250. package/dist/labelWords.d.ts +20 -0
  251. package/dist/labelWords.js +28 -0
  252. package/dist/layoutWait.d.ts +15 -0
  253. package/dist/layoutWait.js +18 -0
  254. package/dist/link.d.ts +82 -0
  255. package/dist/link.js +68 -0
  256. package/dist/listRowProps.d.ts +108 -0
  257. package/dist/listRowProps.js +1 -0
  258. package/dist/listRowWait.d.ts +6 -0
  259. package/dist/listRowWait.js +14 -0
  260. package/dist/modal.d.ts +25 -0
  261. package/dist/modal.js +61 -0
  262. package/dist/navFold.d.ts +15 -0
  263. package/dist/navFold.js +46 -0
  264. package/dist/pillTip.d.ts +8 -0
  265. package/dist/pillTip.js +25 -0
  266. package/dist/props.d.ts +26 -0
  267. package/dist/props.js +14 -0
  268. package/dist/scrollEdges.d.ts +12 -0
  269. package/dist/scrollEdges.js +40 -0
  270. package/dist/scrollStop.d.ts +32 -0
  271. package/dist/scrollStop.js +79 -0
  272. package/dist/sheetSnap.d.ts +27 -0
  273. package/dist/sheetSnap.js +45 -0
  274. package/dist/shownDate.d.ts +88 -0
  275. package/dist/shownDate.js +186 -0
  276. package/dist/size.d.ts +45 -0
  277. package/dist/size.js +12 -0
  278. package/dist/skeleton.d.ts +83 -0
  279. package/dist/skeleton.js +88 -0
  280. package/dist/stackGap.d.ts +9 -0
  281. package/dist/stackGap.js +16 -0
  282. package/dist/stickyColumn.d.ts +38 -0
  283. package/dist/stickyColumn.js +38 -0
  284. package/dist/switcher.d.ts +93 -0
  285. package/dist/switcher.js +78 -0
  286. package/dist/tableColumns.d.ts +31 -0
  287. package/dist/tableColumns.js +72 -0
  288. package/dist/tableEmpty.d.ts +15 -0
  289. package/dist/tableEmpty.js +26 -0
  290. package/dist/tableRow.d.ts +67 -0
  291. package/dist/tableRow.js +49 -0
  292. package/dist/tableSort.d.ts +22 -0
  293. package/dist/tableSort.js +19 -0
  294. package/dist/textBox.d.ts +10 -0
  295. package/dist/textBox.js +23 -0
  296. package/dist/tone.d.ts +11 -0
  297. package/dist/tone.js +1 -0
  298. package/dist/trend.d.ts +26 -0
  299. package/dist/trend.js +64 -0
  300. package/dist/typography.d.ts +203 -0
  301. package/dist/typography.js +242 -0
  302. package/dist/useImageFailed.d.ts +19 -0
  303. package/dist/useImageFailed.js +21 -0
  304. package/package.json +84 -4
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Children } from "react";
3
+ import { cx } from "./cx.js";
4
+ import { Bone, BusyLabel, busy, isEmptySlot, LoadingScope, useLoading, } from "./skeleton.js";
5
+ import { Caption } from "./typography.js";
6
+ /**
7
+ * A wrapping row of facts or links in muted small text, joined by a `·`: branch · SHA · date, or a
8
+ * footer's Privacy · Terms · Email. An item is text, a `Code` or a `TextLink`. The separator is
9
+ * `aria-hidden` and trails each item but the last, held to its item like a comma, so a wrap leaves
10
+ * it at the end of a line and never at the start; `separator` swaps it for a `•` or none. An item never breaks inside itself: the
11
+ * row wraps between items. `mono` sets the whole row in the monospace face, for ids and paths.
12
+ * While `loading` with no items it draws three word-sized bones.
13
+ */
14
+ export function MetaList({ mono = false, separator = "·", loading: ownLoading, loadingLabel, children, ...rest }) {
15
+ const { loading, owner } = useLoading(ownLoading);
16
+ const items = loading && isEmptySlot(children)
17
+ ? [0, 1, 2].map((i) => (_jsx(Bone, { shape: "inline-block h-[0.6lh] w-16 rounded align-middle" }, i)))
18
+ : Children.toArray(children);
19
+ return (_jsxs("ul", { ...rest, ...busy(owner, loading), className: cx("flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-slate-500", mono && "font-mono"), children: [items.map((child, index) => (_jsxs("li", { className: "inline-flex items-center gap-x-3 whitespace-nowrap", children: [_jsx(LoadingScope, { loading: loading, children: child }), index < items.length - 1 && separator !== "none" && (_jsx(Caption, { as: "span", "aria-hidden": "true", children: separator }))] }, index))), owner && loading && (_jsx("li", { className: "sr-only", children: _jsx(BusyLabel, { owner: owner, loading: loading, label: loadingLabel }) }))] }));
20
+ }
@@ -0,0 +1,41 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import type { Passthrough } from "./props.js";
3
+ /**
4
+ * Measures every mounted Morph again, at once, so a card a router has just scrolled on screen
5
+ * carries its transition name before the browser captures the new page. Call it right after the
6
+ * router restores scroll, when that happens after the render: TanStack Router restores scroll on
7
+ * `onRendered`, a few microtasks after the commit, which is too late for Morph to see on its own.
8
+ *
9
+ * ```ts
10
+ * const router = createRouter({ routeTree, defaultViewTransition: true, scrollRestoration: true });
11
+ * router.subscribe("onRendered", () => refreshMorphs());
12
+ * ```
13
+ *
14
+ * Subscribe after the router is created, so its own scroll restore runs first. A restore in a
15
+ * layout effect, during the commit, needs no call. It takes no arguments and does nothing on the
16
+ * server or where there is no IntersectionObserver.
17
+ */
18
+ export declare function refreshMorphs(): void;
19
+ /**
20
+ * An element that grows into its counterpart on the next page, and shrinks back on Back, through
21
+ * the View Transitions API. Wrap the card in the list and the element on the detail page, each with
22
+ * the same `name` and the record's id as `item`: the browser morphs one into the other over 450 ms. The same
23
+ * `name` and `item` may appear only once on a page; two on one page and the browser skips the
24
+ * morph, so a list passes each record's own id. The morph runs only when the change is wrapped in a
25
+ * view transition: `startPageTransition`, or a router's own option (TanStack Router
26
+ * `defaultViewTransition: true` on `createRouter`, or `viewTransition` on a `Link`; React Router's
27
+ * `viewTransition`, Astro's `ClientRouter`). Otherwise, or where the browser has no View
28
+ * Transitions, it renders and behaves as a plain `<div>`. Inside a `PageFade` the page fades while
29
+ * this element morphs. While it is named (near the screen) the div is a stacking context, so a
30
+ * dropdown inside it cannot rise above a sticky header outside it: portal overlays to the body. Under
31
+ * `prefers-reduced-motion: reduce` it swaps with no animation; a router's own transition of the
32
+ * rest of the page is the router's to quiet. A Morph more than a screen above or below the viewport
33
+ * carries no transition name until it scrolls near, so a long list costs only what is on screen.
34
+ */
35
+ export declare function Morph({ name, item, children, ...rest }: {
36
+ /** What the element is, shared by the card and its detail: `"shop"`, `"product"`. Any text. */
37
+ name: string;
38
+ /** Which one, usually the record's id. Any text or number; unique on the page for one `name`. */
39
+ item: string | number;
40
+ children: ReactNode;
41
+ } & Passthrough): ReactElement;
package/dist/Morph.js ADDED
@@ -0,0 +1,107 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef, useState } from "react";
3
+ import { flushSync } from "react-dom";
4
+ // Keeps letters and digits and writes every other character, `-` and `_` included, as
5
+ // `_<hex code point>_`, so two different pairs never give one name and no character can end the
6
+ // attribute selector or the rule.
7
+ const enc = (value) => Array.from(value, (ch) => /[A-Za-z0-9]/.test(ch) ? ch : `_${(ch.codePointAt(0) ?? 0).toString(16)}_`).join("");
8
+ const morphName = (name, item) => `hc-morph-${enc(name)}-${enc(String(item))}`;
9
+ // As in PageFade: the one place the View Transitions pseudo-elements can be styled is a stylesheet.
10
+ // The browser's own group animation moves and resizes the box and cross-fades its content; this
11
+ // names the element and gives the group and both images the library's one morph timing, 450 ms on
12
+ // an ease that starts quick and settles gently (the browser's default 250 ms is too quick to see),
13
+ // so the cross-fade lasts as long as the move. Under reduced motion the later rule switches the
14
+ // animations off so it swaps. No colour in it. Where the API is missing the rules are never matched.
15
+ // The name applies only while the element carries `data-morph-near` (within a screen of the
16
+ // viewport): a named element is captured whole before a transition, so naming every card of a long
17
+ // list makes the browser (WebKit worst) capture pixels nobody sees.
18
+ const css = (n) => `[data-morph="${n}"][data-morph-near]{view-transition-name:${n}}
19
+ ::view-transition-group(${n}),::view-transition-old(${n}),::view-transition-new(${n}){animation-duration:450ms;animation-timing-function:cubic-bezier(0.2,0,0,1)}
20
+ @media (prefers-reduced-motion:reduce){::view-transition-group(${n}),::view-transition-old(${n}),::view-transition-new(${n}){animation:none}}`;
21
+ // Every mounted Morph's re-measure, for refreshMorphs. A Morph registers only where it measures at
22
+ // all (in the browser, with an IntersectionObserver), so on the server or without one the set is
23
+ // empty and refreshMorphs does nothing.
24
+ const remeasures = new Set();
25
+ /**
26
+ * Measures every mounted Morph again, at once, so a card a router has just scrolled on screen
27
+ * carries its transition name before the browser captures the new page. Call it right after the
28
+ * router restores scroll, when that happens after the render: TanStack Router restores scroll on
29
+ * `onRendered`, a few microtasks after the commit, which is too late for Morph to see on its own.
30
+ *
31
+ * ```ts
32
+ * const router = createRouter({ routeTree, defaultViewTransition: true, scrollRestoration: true });
33
+ * router.subscribe("onRendered", () => refreshMorphs());
34
+ * ```
35
+ *
36
+ * Subscribe after the router is created, so its own scroll restore runs first. A restore in a
37
+ * layout effect, during the commit, needs no call. It takes no arguments and does nothing on the
38
+ * server or where there is no IntersectionObserver.
39
+ */
40
+ export function refreshMorphs() {
41
+ if (remeasures.size === 0)
42
+ return;
43
+ flushSync(() => {
44
+ for (const remeasure of remeasures)
45
+ remeasure();
46
+ });
47
+ }
48
+ /**
49
+ * An element that grows into its counterpart on the next page, and shrinks back on Back, through
50
+ * the View Transitions API. Wrap the card in the list and the element on the detail page, each with
51
+ * the same `name` and the record's id as `item`: the browser morphs one into the other over 450 ms. The same
52
+ * `name` and `item` may appear only once on a page; two on one page and the browser skips the
53
+ * morph, so a list passes each record's own id. The morph runs only when the change is wrapped in a
54
+ * view transition: `startPageTransition`, or a router's own option (TanStack Router
55
+ * `defaultViewTransition: true` on `createRouter`, or `viewTransition` on a `Link`; React Router's
56
+ * `viewTransition`, Astro's `ClientRouter`). Otherwise, or where the browser has no View
57
+ * Transitions, it renders and behaves as a plain `<div>`. Inside a `PageFade` the page fades while
58
+ * this element morphs. While it is named (near the screen) the div is a stacking context, so a
59
+ * dropdown inside it cannot rise above a sticky header outside it: portal overlays to the body. Under
60
+ * `prefers-reduced-motion: reduce` it swaps with no animation; a router's own transition of the
61
+ * rest of the page is the router's to quiet. A Morph more than a screen above or below the viewport
62
+ * carries no transition name until it scrolls near, so a long list costs only what is on screen.
63
+ */
64
+ export function Morph({ name, item, children, ...rest }) {
65
+ const n = morphName(name, item);
66
+ const ref = useRef(null);
67
+ // Named until measured, so the server render and an engine with no IntersectionObserver keep the
68
+ // name. The layout effect's update is flushed with the render, so inside a view transition's
69
+ // update the new page's far cards are already unnamed when the browser captures it. A parent's
70
+ // layout effect runs after this one and may scroll this element on screen (a router restoring
71
+ // the list's scroll on Back), so a microtask measures again once the whole commit is done and
72
+ // flushes the result, before the browser's next rendering step, where it captures the new state.
73
+ // A restore later than that microtask (TanStack Router's, several awaits after the commit) is
74
+ // not seen here: neither `updateCallbackDone` nor a scroll event reliably comes before the
75
+ // capture in Chromium, so the router calls `refreshMorphs` after it restores.
76
+ const [near, setNear] = useState(true);
77
+ useLayoutEffect(() => {
78
+ const el = ref.current;
79
+ if (!el || typeof IntersectionObserver !== "function")
80
+ return undefined;
81
+ const measure = () => {
82
+ const rect = el.getBoundingClientRect();
83
+ const h = window.innerHeight;
84
+ return rect.bottom >= -h && rect.top <= 2 * h;
85
+ };
86
+ setNear(measure());
87
+ let live = true;
88
+ queueMicrotask(() => {
89
+ if (live)
90
+ flushSync(() => setNear(measure()));
91
+ });
92
+ const remeasure = () => setNear(measure());
93
+ remeasures.add(remeasure);
94
+ const observer = new IntersectionObserver((entries) => {
95
+ const last = entries.at(-1);
96
+ if (last)
97
+ setNear(last.isIntersecting);
98
+ }, { rootMargin: "100% 0px" });
99
+ observer.observe(el);
100
+ return () => {
101
+ live = false;
102
+ remeasures.delete(remeasure);
103
+ observer.disconnect();
104
+ };
105
+ }, []);
106
+ return (_jsxs(_Fragment, { children: [_jsx("style", { children: css(n) }), _jsx("div", { ...rest, ref: ref, "data-morph": n, "data-morph-near": near ? "" : undefined, className: "grid", children: children })] }));
107
+ }
@@ -0,0 +1,20 @@
1
+ import type { ReactElement } from "react";
2
+ import type { Passthrough } from "./props.js";
3
+ /**
4
+ * A thin indeterminate bar along the top edge of the viewport, in the accent tone, for a route
5
+ * change that is under way and has no known length. Pass `loading` from the router's pending state
6
+ * and render it once per app, beside the page frame. It draws exactly what `loading` says: the bar
7
+ * while it is true and nothing while it is false. The stylesheet holds it invisible for the first
8
+ * 150ms, so a fast navigation shows nothing. It is fixed to the viewport and overlays the top of
9
+ * the header, so nothing on the page moves. Under `prefers-reduced-motion: reduce` it is a still
10
+ * bar.
11
+ */
12
+ export declare function NavigationProgress({ loading, label, ...rest }: {
13
+ /** True while a navigation is pending, e.g. from the router's state. */
14
+ loading: boolean;
15
+ /**
16
+ * The bar's accessible name.
17
+ * @default Loading page
18
+ */
19
+ label?: string;
20
+ } & Passthrough): ReactElement | null;
@@ -0,0 +1,26 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BAR_FILL } from "./ProgressBar.js";
3
+ // The one place the bar's motion lives: a stylesheet, as Tailwind classes cannot declare
4
+ // `@keyframes`. Nothing here is a timer in script: the 150ms wait is the opacity animation's own
5
+ // delay (backwards fill, so the bar is invisible until it ends), and a navigation that finishes
6
+ // first removes the bar before it ever showed. A segment slides across the bar; under reduced
7
+ // motion it is a still, full-width bar. No colour in it, which the bar's own class carries.
8
+ const css = `@keyframes hc-navigation-progress-in{from{opacity:0}to{opacity:1}}
9
+ @keyframes hc-navigation-progress{from{transform:translateX(-100%)}to{transform:translateX(250%)}}
10
+ [data-navigation-progress]{animation:hc-navigation-progress-in .01s linear 150ms backwards}
11
+ [data-navigation-progress-bar]{width:40%;animation:hc-navigation-progress 1.4s ease-in-out infinite}
12
+ @media (prefers-reduced-motion:reduce){[data-navigation-progress-bar]{width:100%;animation:none}}`;
13
+ /**
14
+ * A thin indeterminate bar along the top edge of the viewport, in the accent tone, for a route
15
+ * change that is under way and has no known length. Pass `loading` from the router's pending state
16
+ * and render it once per app, beside the page frame. It draws exactly what `loading` says: the bar
17
+ * while it is true and nothing while it is false. The stylesheet holds it invisible for the first
18
+ * 150ms, so a fast navigation shows nothing. It is fixed to the viewport and overlays the top of
19
+ * the header, so nothing on the page moves. Under `prefers-reduced-motion: reduce` it is a still
20
+ * bar.
21
+ */
22
+ export function NavigationProgress({ loading, label = "Loading page", ...rest }) {
23
+ if (!loading)
24
+ return null;
25
+ return (_jsxs(_Fragment, { children: [_jsx("style", { children: css }), _jsx("div", { ...rest, role: "progressbar", "aria-label": label, "data-navigation-progress": "", className: "pointer-events-none fixed inset-x-0 top-0 z-50 h-[3px] overflow-hidden", children: _jsx("div", { "data-navigation-progress-bar": "", className: `h-full ${BAR_FILL.accent}` }) })] }));
26
+ }
@@ -0,0 +1,60 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes, ReactElement, ReactNode } from "react";
2
+ import { type ImageAspect, type ImageWidth } from "./Image.js";
3
+ import type { Unstyled } from "./props.js";
4
+ /** A box in a picture's own units (an image's pixels): its top-left corner and its size. */
5
+ export type RegionRect = {
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ };
11
+ /**
12
+ * An accent outline over one area of a picture, such as a screenshot's ignored or flagged region.
13
+ * `rect` is in the picture's own units and `within` is the picture's full size in the same units;
14
+ * the box is placed in percent of them, so it sits right at any scale. Put it in a `RegionFrame`,
15
+ * over the picture. `label` is a small tag in its top-left
16
+ * corner; `hatched` stripes the inside, for an area that is left out. It takes no pointer events,
17
+ * so it never blocks the picture or a layer drawn over it.
18
+ */
19
+ export declare function OutlineRegion({ rect, within, label, hatched, ...rest }: {
20
+ /** The area, in the picture's own units. */
21
+ rect: RegionRect;
22
+ /** The picture's full size, in the same units as `rect`. */
23
+ within: {
24
+ width: number;
25
+ height: number;
26
+ };
27
+ /** A short tag in the top-left corner: where the area came from, or what it is. */
28
+ label?: ReactNode;
29
+ /** Stripes the inside, for an area left out (ignored, masked). */
30
+ hatched?: boolean | undefined;
31
+ } & Unstyled<Omit<HTMLAttributes<HTMLDivElement>, "children">>): ReactElement;
32
+ /**
33
+ * A picture with a hairline edge, and `children` laid over it: the `OutlineRegion`s that mark its
34
+ * areas. Every other prop goes to the `<img>` (`onLoad`, `loading`, `data-*`), so the app can read
35
+ * the picture's own size for `within`.
36
+ *
37
+ * It sizes as `Image` does. `width` is `full` (the parent's width) or 96, 160 or 256px. `aspect`
38
+ * `natural` keeps the picture's own proportions; any other shape letterboxes it (contain, never a
39
+ * crop) on the inset surface, centred and never scaled up, and the regions are laid over the
40
+ * picture itself, not the box, so each stays on its spot. A letterboxed picture needs its own size:
41
+ * a screenshot has one; an SVG needs `width` and `height` on its root, not only a `viewBox`.
42
+ */
43
+ export declare function RegionFrame({ src, alt, aspect, width, children, ...rest }: {
44
+ /** The picture. */
45
+ src: string;
46
+ /** What the picture shows; `""` for one that only decorates. */
47
+ alt: string;
48
+ /**
49
+ * The box's shape: `natural` is the picture's own; any other letterboxes the picture inside it.
50
+ * @default natural
51
+ */
52
+ aspect?: ImageAspect | undefined;
53
+ /**
54
+ * How wide the frame is: `full` fills its parent; `sm`, `md` and `lg` are 96, 160 and 256px, capped at the parent's width.
55
+ * @default full
56
+ */
57
+ width?: ImageWidth | undefined;
58
+ /** The `OutlineRegion`s over the picture. */
59
+ children?: ReactNode;
60
+ } & Unstyled<Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt" | "children" | "width" | "height">>): ReactElement;
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "./cx.js";
3
+ import { IMAGE_WIDTH } from "./Image.js";
4
+ /** Thin accent stripes, drawn in the box's own colour, for an area that is left out. */
5
+ const HATCH = "absolute inset-0 opacity-40 bg-[repeating-linear-gradient(45deg,currentColor_0_1px,transparent_1px_6px)]";
6
+ /**
7
+ * An accent outline over one area of a picture, such as a screenshot's ignored or flagged region.
8
+ * `rect` is in the picture's own units and `within` is the picture's full size in the same units;
9
+ * the box is placed in percent of them, so it sits right at any scale. Put it in a `RegionFrame`,
10
+ * over the picture. `label` is a small tag in its top-left
11
+ * corner; `hatched` stripes the inside, for an area that is left out. It takes no pointer events,
12
+ * so it never blocks the picture or a layer drawn over it.
13
+ */
14
+ export function OutlineRegion({ rect, within, label, hatched = false, ...rest }) {
15
+ return (_jsxs("div", { ...rest, className: "pointer-events-none absolute border-2 border-violet-600 text-violet-600", style: {
16
+ left: `${(rect.x / within.width) * 100}%`,
17
+ top: `${(rect.y / within.height) * 100}%`,
18
+ width: `${(rect.width / within.width) * 100}%`,
19
+ height: `${(rect.height / within.height) * 100}%`,
20
+ }, children: [hatched && _jsx("span", { "aria-hidden": "true", className: HATCH }), label != null && (_jsx("span", { className: "absolute top-0 left-0 bg-violet-600 px-1 text-xs leading-tight text-violet-50", children: label }))] }));
21
+ }
22
+ /** The shapes `RegionFrame` letterboxes a picture into, as `Image`'s `aspect`, or `natural` (its own). */
23
+ const FRAME_ASPECT = {
24
+ square: "aspect-square",
25
+ "4:3": "aspect-[4/3]",
26
+ "3:2": "aspect-[3/2]",
27
+ "16:9": "aspect-video",
28
+ "3:4": "aspect-[3/4]",
29
+ "9:16": "aspect-[9/16]",
30
+ natural: "",
31
+ };
32
+ /**
33
+ * A picture with a hairline edge, and `children` laid over it: the `OutlineRegion`s that mark its
34
+ * areas. Every other prop goes to the `<img>` (`onLoad`, `loading`, `data-*`), so the app can read
35
+ * the picture's own size for `within`.
36
+ *
37
+ * It sizes as `Image` does. `width` is `full` (the parent's width) or 96, 160 or 256px. `aspect`
38
+ * `natural` keeps the picture's own proportions; any other shape letterboxes it (contain, never a
39
+ * crop) on the inset surface, centred and never scaled up, and the regions are laid over the
40
+ * picture itself, not the box, so each stays on its spot. A letterboxed picture needs its own size:
41
+ * a screenshot has one; an SVG needs `width` and `height` on its root, not only a `viewBox`.
42
+ */
43
+ export function RegionFrame({ src, alt, aspect = "natural", width = "full", children, ...rest }) {
44
+ if (aspect === "natural") {
45
+ return (_jsxs("div", { className: cx("relative border border-slate-200", IMAGE_WIDTH[width]), children: [_jsx("img", { ...rest, src: src, alt: alt, className: "block w-full" }), children] }));
46
+ }
47
+ // The box is a size container, so the picture is capped by its width and height in `cq` units
48
+ // (a percentage height would not resolve), and the inner box shrinks to the picture: the
49
+ // regions are placed in percent of the picture, wherever the letterbox puts it.
50
+ return (_jsx("div", { className: cx("grid place-items-center overflow-hidden border border-slate-200 bg-slate-100 [container-type:size]", FRAME_ASPECT[aspect], IMAGE_WIDTH[width]), children: _jsxs("div", { className: "relative", children: [_jsx("img", { ...rest, src: src, alt: alt, className: "block max-h-[100cqh] max-w-[100cqw]" }), children] }) }));
51
+ }
@@ -0,0 +1,30 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import type { Passthrough } from "./props.js";
3
+ /**
4
+ * The page's content area, cross-faded by the View Transitions API when the route changes. Wrap
5
+ * what changes between pages, once per page. With no `name` the fade is the browser's own
6
+ * cross-fade of the whole viewport; the frame around the content (header, footer) stays still
7
+ * because it is the same on both pages. A `name` names this box so it fades apart from the page,
8
+ * for a second region; a named region is captured at its full height, so name only a region no
9
+ * taller than the screen, and give each named one on a page its own `name`.
10
+ * The fade runs only when the navigation is wrapped in a view transition: `startPageTransition`,
11
+ * or a router's own option (TanStack Router `viewTransition`, React Router's `viewTransition` prop,
12
+ * Astro's `ClientRouter`). Otherwise, or where the browser has no View Transitions, it renders
13
+ * and behaves as a plain `<div>`. A named PageFade is a stacking context, so a dropdown inside it
14
+ * cannot rise above a sticky header outside it: portal overlays to the body. The default one is
15
+ * not. Under `prefers-reduced-motion: reduce` the content swaps with no fade; a named one quiets
16
+ * only its own box, and a router's own transition of the rest of the page is the router's to quiet.
17
+ */
18
+ export declare function PageFade({ name, children, ...rest }: {
19
+ /** 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. */
20
+ name?: string;
21
+ children: ReactNode;
22
+ } & Passthrough): ReactElement;
23
+ /**
24
+ * Run `update` inside a view transition, so a `PageFade` cross-fades. `update` is a synchronous
25
+ * state change, flushed at once as the browser needs the new DOM; for a router's navigation, which
26
+ * is async, use the router's own view-transition option instead. Where the browser has
27
+ * no View Transitions, or the user prefers reduced motion, `update` just runs. Call it from an event
28
+ * handler, not during render.
29
+ */
30
+ export declare function startPageTransition(update: () => void): void;
@@ -0,0 +1,46 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { flushSync } from "react-dom";
3
+ // The one place the View Transitions pseudo-elements can be styled: a stylesheet, as Tailwind
4
+ // classes cannot reach `::view-transition-*`. The browser's own cross-fade does the fading; under
5
+ // reduced motion this switches the animations off so the content swaps. With no name the fade is
6
+ // the browser's root transition, captured at the viewport's size; a named box is captured at its
7
+ // full height, which on a long page costs seconds in WebKit. No colour in it. Where the API is
8
+ // missing the rules are never matched.
9
+ const quiet = (name) => `@media (prefers-reduced-motion:reduce){::view-transition-group(${name}),::view-transition-old(${name}),::view-transition-new(${name}){animation:none}}`;
10
+ const css = (name) => name === undefined
11
+ ? quiet("root")
12
+ : `[data-page-fade="${name}"]{view-transition-name:${name}}\n${quiet(name)}`;
13
+ /**
14
+ * The page's content area, cross-faded by the View Transitions API when the route changes. Wrap
15
+ * what changes between pages, once per page. With no `name` the fade is the browser's own
16
+ * cross-fade of the whole viewport; the frame around the content (header, footer) stays still
17
+ * because it is the same on both pages. A `name` names this box so it fades apart from the page,
18
+ * for a second region; a named region is captured at its full height, so name only a region no
19
+ * taller than the screen, and give each named one on a page its own `name`.
20
+ * The fade runs only when the navigation is wrapped in a view transition: `startPageTransition`,
21
+ * or a router's own option (TanStack Router `viewTransition`, React Router's `viewTransition` prop,
22
+ * Astro's `ClientRouter`). Otherwise, or where the browser has no View Transitions, it renders
23
+ * and behaves as a plain `<div>`. A named PageFade is a stacking context, so a dropdown inside it
24
+ * cannot rise above a sticky header outside it: portal overlays to the body. The default one is
25
+ * not. Under `prefers-reduced-motion: reduce` the content swaps with no fade; a named one quiets
26
+ * only its own box, and a router's own transition of the rest of the page is the router's to quiet.
27
+ */
28
+ export function PageFade({ name, children, ...rest }) {
29
+ return (_jsxs(_Fragment, { children: [_jsx("style", { children: css(name) }), _jsx("div", { ...rest, "data-page-fade": name, children: children })] }));
30
+ }
31
+ /**
32
+ * Run `update` inside a view transition, so a `PageFade` cross-fades. `update` is a synchronous
33
+ * state change, flushed at once as the browser needs the new DOM; for a router's navigation, which
34
+ * is async, use the router's own view-transition option instead. Where the browser has
35
+ * no View Transitions, or the user prefers reduced motion, `update` just runs. Call it from an event
36
+ * handler, not during render.
37
+ */
38
+ export function startPageTransition(update) {
39
+ const reduce = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
40
+ if (reduce || typeof document.startViewTransition !== "function") {
41
+ update();
42
+ return;
43
+ }
44
+ // A skipped transition (a second one starting, a hidden tab) rejects `ready`; the update still ran.
45
+ document.startViewTransition(() => flushSync(update)).ready.catch(() => { });
46
+ }
@@ -0,0 +1,26 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import type { Passthrough } from "./props.js";
3
+ import { type LoadingProps } from "./skeleton.js";
4
+ export type PageHeaderProps = LoadingProps & {
5
+ /** A `Breadcrumbs` above the title. */
6
+ breadcrumbs?: ReactNode;
7
+ /** The page's `h1`. */
8
+ title: ReactNode;
9
+ /** The lede under the title: a `Lead`, so it outranks the body text after it. */
10
+ description?: ReactNode;
11
+ /** Right of the title on `sm` and up, below it on a phone. */
12
+ actions?: ReactNode;
13
+ /** A `Tabs` (or similar) under the title. */
14
+ tabs?: ReactNode;
15
+ };
16
+ /** The header block without its bottom margin; PageHeader adds the margin (a `Stack` child drops it). */
17
+ export declare function PageHeaderContent({ breadcrumbs, title, description, actions, tabs, className, loading, loadingLabel, ...rest }: PageHeaderProps & Passthrough & {
18
+ className?: string;
19
+ }): ReactElement;
20
+ /**
21
+ * The top of a page: breadcrumbs, title, description, actions and tabs. Its fixed bottom margin puts
22
+ * every page's first block at the same y; as a direct child of a `Stack` it has none, so the Stack's
23
+ * gap is the only space under it.
24
+ * While `loading` it is the owner of the wait: what it has is drawn and an empty title is a bone.
25
+ */
26
+ export declare function PageHeader(props: PageHeaderProps & Passthrough): ReactElement;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useWait } from "./layoutWait.js";
3
+ import { LoadingScope } from "./skeleton.js";
4
+ import { Lead, PageHeading } from "./typography.js";
5
+ /** The header block without its bottom margin; PageHeader adds the margin (a `Stack` child drops it). */
6
+ export function PageHeaderContent({ breadcrumbs, title, description, actions, tabs, className, loading, loadingLabel, ...rest }) {
7
+ const wait = useWait(loading, loadingLabel);
8
+ return (_jsx(LoadingScope, { loading: wait.loading, children: _jsxs("div", { ...rest, ...wait.attrs, "data-page-header": "", className: className, children: [breadcrumbs && _jsx("div", { className: "mb-2", children: breadcrumbs }), _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [_jsxs("div", { className: "min-w-0", children: [_jsx(PageHeading, { children: title }), description && (_jsx("div", { className: "mt-2 max-w-[60ch]", children: _jsx(Lead, { children: description }) }))] }), actions && _jsx("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: actions })] }), tabs && _jsx("div", { className: "mt-4", children: tabs }), wait.label] }) }));
9
+ }
10
+ /**
11
+ * The top of a page: breadcrumbs, title, description, actions and tabs. Its fixed bottom margin puts
12
+ * every page's first block at the same y; as a direct child of a `Stack` it has none, so the Stack's
13
+ * gap is the only space under it.
14
+ * While `loading` it is the owner of the wait: what it has is drawn and an empty title is a bone.
15
+ */
16
+ export function PageHeader(props) {
17
+ return _jsx(PageHeaderContent, { ...props, className: "mb-8" });
18
+ }
@@ -0,0 +1,100 @@
1
+ import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode } from "react";
2
+ import { type PageHeaderProps } from "./PageHeader.js";
3
+ import { type StackGap } from "./Stack.js";
4
+ import type { Passthrough, Unstyled } from "./props.js";
5
+ export { CardGrid } from "./CardGrid.js";
6
+ import { type LoadingProps } from "./skeleton.js";
7
+ /** A list page: header, an optional `filters` slot, then the list, or `empty` when there are no children. While `loading` it owns the wait and passes it to everything inside, the header too. With no children yet it draws a card of row bones, never `empty`. */
8
+ export declare function ListLayout({ filters, empty, children, breadcrumbs, title, description, actions, tabs, loading, loadingLabel, ...rest }: PageHeaderProps & {
9
+ /** A row between the header and the list, e.g. a `Fieldset` of chips or an `Input type="search"`. */
10
+ filters?: ReactNode;
11
+ /** Shown in place of `children` when there are none (no rows, an empty array, `null`): an `EmptyState`. */
12
+ empty?: ReactNode;
13
+ children?: ReactNode;
14
+ } & Passthrough): ReactElement;
15
+ /**
16
+ * A detail page: header, then `children` (two thirds from `lg`) beside `aside` (one third), which
17
+ * stacks below on a smaller screen: a `SideColumn asideWidth="third"` under a `PageHeader`. `sticky` keeps the aside in view from `lg` as a long page
18
+ * scrolls: it sticks under AppShell's header and, if it is taller than the room left, scrolls
19
+ * itself so its end stays reachable. While `loading` it owns the wait and passes it to everything inside, the header too.
20
+ */
21
+ export declare function DetailLayout({ aside, asideLabel, sticky, children, breadcrumbs, title, description, actions, tabs, loading, loadingLabel, ...rest }: PageHeaderProps & {
22
+ /** The side column: one third from `lg`, below `children` on a smaller screen. */
23
+ aside: ReactNode;
24
+ /** Names the aside's landmark (`aria-label`), so a page with another complementary landmark can tell them apart. It does not fold the aside. Left out, the aside is unnamed. */
25
+ asideLabel?: string | undefined;
26
+ /**
27
+ * From `lg`, keeps the aside in view under the header as the page scrolls; an aside taller than
28
+ * the screen scrolls inside itself. Off by default, since an aside of ordinary cards may be
29
+ * taller than the screen. Below `lg` the aside stacks as ever.
30
+ * @default false
31
+ */
32
+ sticky?: boolean | undefined;
33
+ children: ReactNode;
34
+ } & Passthrough): ReactElement;
35
+ /** A form page: header (no header `actions`), then a `max-w-3xl` column that starts at the Container's start edge (it is not re-centred), with an `actions` row at the end. `error` is the submit's failure, a danger `Callout` (an alert) directly above that row. Other props go on the `<form>`. While `loading` it owns the wait and passes it to everything inside, the header too. */
36
+ export declare function FormLayout({ actions, error, children, breadcrumbs, title, description, tabs, loading, loadingLabel, ...form }: Omit<PageHeaderProps, "actions"> & {
37
+ /** The row at the end of the form: its submit and cancel buttons. */
38
+ actions?: ReactNode;
39
+ /**
40
+ * What went wrong with the whole submit (the server refused it, no connection), announced as an
41
+ * alert directly above the `actions`. An error about one field is that `Field`'s `error`.
42
+ */
43
+ error?: ReactNode;
44
+ children: ReactNode;
45
+ } & Unstyled<Omit<ComponentPropsWithoutRef<"form">, "title">>): ReactElement;
46
+ /**
47
+ * A text page: header, then `children` stacked `gap` apart (`md` by default), all in one column that
48
+ * starts at the Container's start edge (it is not re-centred, so the title does not jump). `width`
49
+ * sets the column: `narrow` (`max-w-3xl`, the default) is a reading measure; `wide` (`max-w-5xl`) and
50
+ * `full` (the Container's whole width) suit a page that is not long prose, such as a pricing page.
51
+ * Paragraphs (`Text`) and the header's lede keep their own reading measure whatever the width.
52
+ * Unlike `FormLayout` the header sits inside the column, so its `actions` stay beside the text
53
+ * instead of at the Container's far edge. While `loading` it owns the wait and passes it to everything inside, the header too.
54
+ */
55
+ export declare function ProseLayout({ width, gap, children, breadcrumbs, title, description, actions, tabs, loading, loadingLabel, ...rest }: PageHeaderProps & {
56
+ /**
57
+ * The space between blocks: `xs` gap-2, `sm` gap-4, `md` gap-6, `lg` gap-8, `xl` gap-12 (gap-16 from `sm`).
58
+ * @default md
59
+ */
60
+ gap?: StackGap | undefined;
61
+ /**
62
+ * The column's width: `narrow` max-w-3xl, `wide` max-w-5xl, `full` the Container's width.
63
+ * @default narrow
64
+ */
65
+ width?: "narrow" | "wide" | "full" | undefined;
66
+ children?: ReactNode;
67
+ } & Passthrough): ReactElement;
68
+ /**
69
+ * Edge-to-edge `children` with an optional `aside` at the end (`lg:w-72`) that stacks below on a smaller
70
+ * screen. Render it in `<AppShell bleed>`. It deliberately breaks the shared start edge: a viewer
71
+ * that needs the whole width has no Container of its own, so `children` start at the viewport's
72
+ * start edge. `padded` gives them the Container's padding instead (`px-4`, `sm:px-6`, `py-8`), for
73
+ * a page of ordinary content beside a full-height `aside`. A `bar` is a `StickyBar` above both: the
74
+ * full width, on the surface with a bottom line, sticking under AppShell's header as the page scrolls.
75
+ * While `loading` it owns the wait and passes it to everything inside, the header too.
76
+ */
77
+ export declare function FullBleedLayout({ bar, aside, asideLabel, padded, children, loading, loadingLabel, ...rest }: {
78
+ /** A full-width row above `children` and `aside` that sticks under the header, e.g. a viewer's title and actions. `padded` does not pad it. */
79
+ bar?: ReactNode;
80
+ /** A side column on the right (`lg:w-72`) on a tinted surface; below `lg` it stacks under `children`. */
81
+ aside?: ReactNode;
82
+ /** Names the `<aside>` landmark (`aria-label`). Left out, it is unnamed. */
83
+ asideLabel?: string | undefined;
84
+ /**
85
+ * Pads `children` as the Container pads every other page. Off, they run to the viewport's edges.
86
+ * A notice in the column is a plain `Callout` in a `Stack`, never a `Callout banner`.
87
+ */
88
+ padded?: boolean | undefined;
89
+ children: ReactNode;
90
+ } & LoadingProps & Passthrough): ReactElement;
91
+ /** A narrow card (`max-w-md`) centred in the Container at a fixed offset from the top, for sign-in, landing, not-found and error pages. The one layout that does not share the start edge. While `loading` it owns the wait and passes it to everything inside, the header too. */
92
+ export declare function CenteredLayout({ mark, title, description, children, loading, loadingLabel, ...rest }: {
93
+ /** Drawn first in the card, above the title, e.g. a large status numeral. Not a heading. */
94
+ mark?: ReactNode;
95
+ /** The card's `h1`. */
96
+ title: ReactNode;
97
+ /** A muted line under the title. */
98
+ description?: ReactNode;
99
+ children?: ReactNode;
100
+ } & LoadingProps & Passthrough): ReactElement;