oneslash-design-system 2.18.0 → 2.20.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 (227) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +54 -5
  3. package/dist/cases/app-shell/sidebar.d.ts +1 -0
  4. package/dist/cases/app-shell/sidebar.jsx +124 -0
  5. package/dist/cases/app-shell/top-tabs.d.ts +1 -0
  6. package/dist/cases/app-shell/top-tabs.jsx +106 -0
  7. package/dist/cases/app-shell.md +364 -0
  8. package/dist/cases/artifact-card/card.jsx +32 -6
  9. package/dist/cases/artifact-card.md +55 -7
  10. package/dist/cases/billing-page/billed-elsewhere.d.ts +1 -0
  11. package/dist/cases/billing-page/billed-elsewhere.jsx +28 -0
  12. package/dist/cases/billing-page/self-serve.d.ts +1 -0
  13. package/dist/cases/billing-page/self-serve.jsx +134 -0
  14. package/dist/cases/billing-page.md +247 -0
  15. package/dist/cases/breakdown-list/bars.d.ts +1 -0
  16. package/dist/cases/breakdown-list/bars.jsx +47 -0
  17. package/dist/cases/breakdown-list/table.d.ts +1 -0
  18. package/dist/cases/breakdown-list/table.jsx +69 -0
  19. package/dist/cases/breakdown-list.md +158 -0
  20. package/dist/cases/composer-limit/notice-with-action.jsx +3 -3
  21. package/dist/cases/composer-limit/notice.jsx +3 -3
  22. package/dist/cases/composer-limit.md +8 -8
  23. package/dist/cases/dashboard/numbers-first.d.ts +1 -0
  24. package/dist/cases/dashboard/numbers-first.jsx +165 -0
  25. package/dist/cases/dashboard/work-first.d.ts +1 -0
  26. package/dist/cases/dashboard/work-first.jsx +165 -0
  27. package/dist/cases/dashboard.md +507 -0
  28. package/dist/cases/data-table-page/all-rows.d.ts +1 -0
  29. package/dist/cases/data-table-page/all-rows.jsx +226 -0
  30. package/dist/cases/data-table-page/paged.d.ts +1 -0
  31. package/dist/cases/data-table-page/paged.jsx +284 -0
  32. package/dist/cases/data-table-page.md +771 -0
  33. package/dist/cases/error-page/in-shell.jsx +26 -17
  34. package/dist/cases/error-page.md +42 -21
  35. package/dist/cases/invoice-list/table.d.ts +1 -0
  36. package/dist/cases/invoice-list/table.jsx +64 -0
  37. package/dist/cases/invoice-list/with-upcoming.d.ts +1 -0
  38. package/dist/cases/invoice-list/with-upcoming.jsx +75 -0
  39. package/dist/cases/invoice-list.md +237 -0
  40. package/dist/cases/load-failure/inline.jsx +2 -2
  41. package/dist/cases/load-failure.md +2 -2
  42. package/dist/cases/master-detail/list-then-page.d.ts +1 -0
  43. package/dist/cases/master-detail/list-then-page.jsx +65 -0
  44. package/dist/cases/master-detail/split.d.ts +1 -0
  45. package/dist/cases/master-detail/split.jsx +49 -0
  46. package/dist/cases/master-detail.md +213 -0
  47. package/dist/cases/members-list/rows.jsx +2 -1
  48. package/dist/cases/members-list/table.jsx +8 -9
  49. package/dist/cases/members-list.md +12 -13
  50. package/dist/cases/mobile-menu/links.d.ts +1 -0
  51. package/dist/cases/mobile-menu/links.jsx +24 -0
  52. package/dist/cases/mobile-menu/sections.d.ts +1 -0
  53. package/dist/cases/mobile-menu/sections.jsx +61 -0
  54. package/dist/cases/mobile-menu.md +170 -0
  55. package/dist/cases/not-found-page/in-shell.jsx +26 -17
  56. package/dist/cases/not-found-page.md +41 -20
  57. package/dist/cases/number-format.md +36 -0
  58. package/dist/cases/on-this-page/aside.d.ts +1 -0
  59. package/dist/cases/on-this-page/aside.jsx +39 -0
  60. package/dist/cases/on-this-page.md +80 -0
  61. package/dist/cases/page-header/actions.d.ts +1 -0
  62. package/dist/cases/page-header/actions.jsx +65 -0
  63. package/dist/cases/page-header/sub-page.d.ts +1 -0
  64. package/dist/cases/page-header/sub-page.jsx +37 -0
  65. package/dist/cases/page-header.md +195 -0
  66. package/dist/cases/paged-card/pager.d.ts +1 -0
  67. package/dist/cases/paged-card/pager.jsx +41 -0
  68. package/dist/cases/paged-card/see-all.d.ts +1 -0
  69. package/dist/cases/paged-card/see-all.jsx +34 -0
  70. package/dist/cases/paged-card.md +147 -0
  71. package/dist/cases/payment-method/none.d.ts +1 -0
  72. package/dist/cases/payment-method/none.jsx +17 -0
  73. package/dist/cases/payment-method/on-file.d.ts +1 -0
  74. package/dist/cases/payment-method/on-file.jsx +92 -0
  75. package/dist/cases/payment-method.md +182 -0
  76. package/dist/cases/phone-navigation.md +32 -0
  77. package/dist/cases/plan-change-confirm/blocked.d.ts +1 -0
  78. package/dist/cases/plan-change-confirm/blocked.jsx +48 -0
  79. package/dist/cases/plan-change-confirm/downgrade.d.ts +1 -0
  80. package/dist/cases/plan-change-confirm/downgrade.jsx +52 -0
  81. package/dist/cases/plan-change-confirm/upgrade.d.ts +1 -0
  82. package/dist/cases/plan-change-confirm/upgrade.jsx +51 -0
  83. package/dist/cases/plan-change-confirm.md +261 -0
  84. package/dist/cases/plan-picker/cards.d.ts +1 -0
  85. package/dist/cases/plan-picker/cards.jsx +97 -0
  86. package/dist/cases/plan-picker/list.d.ts +1 -0
  87. package/dist/cases/plan-picker/list.jsx +103 -0
  88. package/dist/cases/plan-picker.md +297 -0
  89. package/dist/cases/range-switch/segmented.jsx +11 -7
  90. package/dist/cases/range-switch.md +16 -11
  91. package/dist/cases/route-loading/region.jsx +27 -18
  92. package/dist/cases/route-loading.md +42 -21
  93. package/dist/cases/settings-page/top-tabs.jsx +4 -3
  94. package/dist/cases/settings-page.md +5 -4
  95. package/dist/cases/side-pane/beside.d.ts +1 -0
  96. package/dist/cases/side-pane/beside.jsx +79 -0
  97. package/dist/cases/side-pane/over.d.ts +1 -0
  98. package/dist/cases/side-pane/over.jsx +58 -0
  99. package/dist/cases/side-pane.md +238 -0
  100. package/dist/cases/sidebar-nav/flat.d.ts +1 -0
  101. package/dist/cases/sidebar-nav/flat.jsx +81 -0
  102. package/dist/cases/sidebar-nav/nested.d.ts +1 -0
  103. package/dist/cases/sidebar-nav/nested.jsx +122 -0
  104. package/dist/cases/sidebar-nav.md +261 -0
  105. package/dist/cases/site-footer/columns.d.ts +1 -0
  106. package/dist/cases/site-footer/columns.jsx +51 -0
  107. package/dist/cases/site-footer/simple.d.ts +1 -0
  108. package/dist/cases/site-footer/simple.jsx +24 -0
  109. package/dist/cases/site-footer.md +133 -0
  110. package/dist/cases/site-header/links.d.ts +1 -0
  111. package/dist/cases/site-header/links.jsx +26 -0
  112. package/dist/cases/site-header/sections.d.ts +1 -0
  113. package/dist/cases/site-header/sections.jsx +64 -0
  114. package/dist/cases/site-header.md +183 -0
  115. package/dist/cases/stat-row/featured.d.ts +1 -0
  116. package/dist/cases/stat-row/featured.jsx +17 -0
  117. package/dist/cases/stat-row/tiles.d.ts +1 -0
  118. package/dist/cases/stat-row/tiles.jsx +34 -0
  119. package/dist/cases/stat-row.md +104 -0
  120. package/dist/cases/status-label/dot.d.ts +1 -0
  121. package/dist/cases/status-label/dot.jsx +39 -0
  122. package/dist/cases/status-label/text.d.ts +1 -0
  123. package/dist/cases/status-label/text.jsx +44 -0
  124. package/dist/cases/status-label.md +143 -0
  125. package/dist/cases/theme-switcher/menu.d.ts +1 -0
  126. package/dist/cases/theme-switcher/menu.jsx +47 -0
  127. package/dist/cases/theme-switcher/segmented.d.ts +1 -0
  128. package/dist/cases/theme-switcher/segmented.jsx +26 -0
  129. package/dist/cases/theme-switcher.md +149 -0
  130. package/dist/cases/upgrade-prompt/inline.jsx +4 -2
  131. package/dist/cases/upgrade-prompt/modal.jsx +2 -1
  132. package/dist/cases/upgrade-prompt.md +10 -6
  133. package/dist/cases/usage-meters/by-person.d.ts +1 -0
  134. package/dist/cases/usage-meters/by-person.jsx +72 -0
  135. package/dist/cases/usage-meters/meters.d.ts +1 -0
  136. package/dist/cases/usage-meters/meters.jsx +49 -0
  137. package/dist/cases/usage-meters/with-cap.d.ts +1 -0
  138. package/dist/cases/usage-meters/with-cap.jsx +73 -0
  139. package/dist/cases/usage-meters.md +303 -0
  140. package/dist/cases.json +1756 -172
  141. package/dist/components/appShell.d.ts +44 -0
  142. package/dist/components/appShell.jsx +121 -0
  143. package/dist/components/button.d.ts +1 -1
  144. package/dist/components/button.jsx +11 -5
  145. package/dist/components/drawer.d.ts +31 -0
  146. package/dist/components/drawer.jsx +121 -0
  147. package/dist/components/formatNumber.d.ts +25 -0
  148. package/dist/components/formatNumber.js +125 -0
  149. package/dist/components/heading.d.ts +3 -1
  150. package/dist/components/heading.jsx +2 -2
  151. package/dist/components/iconButton.jsx +12 -7
  152. package/dist/components/link.d.ts +6 -1
  153. package/dist/components/link.jsx +11 -3
  154. package/dist/components/menuItem.d.ts +7 -1
  155. package/dist/components/menuItem.jsx +4 -3
  156. package/dist/components/modal.jsx +12 -23
  157. package/dist/components/onThisPage.d.ts +29 -0
  158. package/dist/components/onThisPage.jsx +151 -0
  159. package/dist/components/pageShell.d.ts +7 -1
  160. package/dist/components/pageShell.jsx +14 -1
  161. package/dist/components/pagination.d.ts +28 -0
  162. package/dist/components/pagination.jsx +89 -0
  163. package/dist/components/popover.jsx +4 -0
  164. package/dist/components/progress.d.ts +33 -0
  165. package/dist/components/progress.jsx +50 -0
  166. package/dist/components/settingsSection.d.ts +6 -1
  167. package/dist/components/settingsSection.jsx +10 -3
  168. package/dist/components/sidePane.d.ts +32 -0
  169. package/dist/components/sidePane.jsx +128 -0
  170. package/dist/components/siteFooter.d.ts +24 -0
  171. package/dist/components/siteFooter.jsx +48 -0
  172. package/dist/components/siteHeader.d.ts +55 -0
  173. package/dist/components/siteHeader.jsx +125 -0
  174. package/dist/components/skeleton.d.ts +21 -0
  175. package/dist/components/skeleton.jsx +41 -0
  176. package/dist/components/statTile.d.ts +32 -0
  177. package/dist/components/statTile.jsx +61 -0
  178. package/dist/components/tableContainer.d.ts +5 -1
  179. package/dist/components/tableContainer.jsx +9 -1
  180. package/dist/components/tableHeaderCell.d.ts +3 -1
  181. package/dist/components/tableHeaderCell.jsx +2 -2
  182. package/dist/components/titleBar.d.ts +19 -0
  183. package/dist/components/titleBar.jsx +18 -0
  184. package/dist/index.d.ts +12 -0
  185. package/dist/index.js +12 -0
  186. package/dist/internal/overlayStack.d.ts +24 -0
  187. package/dist/internal/overlayStack.js +71 -0
  188. package/dist/internal/resize.d.ts +9 -0
  189. package/dist/internal/resize.js +31 -0
  190. package/dist/internal/scrollSpy.d.ts +24 -0
  191. package/dist/internal/scrollSpy.js +53 -0
  192. package/dist/internal/siteBrand.d.ts +6 -0
  193. package/dist/internal/siteBrand.jsx +11 -0
  194. package/dist/native-mapping.json +69 -3
  195. package/dist/stories/AppShell.stories.d.ts +15 -0
  196. package/dist/stories/AppShell.stories.jsx +137 -0
  197. package/dist/stories/Button.stories.d.ts +1 -0
  198. package/dist/stories/Button.stories.jsx +19 -1
  199. package/dist/stories/Cases.generated.stories.d.ts +45 -0
  200. package/dist/stories/Cases.generated.stories.jsx +90 -0
  201. package/dist/stories/Drawer.stories.d.ts +10 -0
  202. package/dist/stories/Drawer.stories.jsx +123 -0
  203. package/dist/stories/Link.stories.d.ts +1 -0
  204. package/dist/stories/Link.stories.jsx +8 -0
  205. package/dist/stories/OnThisPage.stories.d.ts +10 -0
  206. package/dist/stories/OnThisPage.stories.jsx +105 -0
  207. package/dist/stories/Pagination.stories.d.ts +9 -0
  208. package/dist/stories/Pagination.stories.jsx +75 -0
  209. package/dist/stories/Progress.stories.d.ts +9 -0
  210. package/dist/stories/Progress.stories.jsx +43 -0
  211. package/dist/stories/SettingsSection.stories.d.ts +1 -0
  212. package/dist/stories/SettingsSection.stories.jsx +27 -0
  213. package/dist/stories/SidePane.stories.d.ts +6 -0
  214. package/dist/stories/SidePane.stories.jsx +37 -0
  215. package/dist/stories/SiteFooter.stories.d.ts +7 -0
  216. package/dist/stories/SiteFooter.stories.jsx +63 -0
  217. package/dist/stories/SiteHeader.stories.d.ts +10 -0
  218. package/dist/stories/SiteHeader.stories.jsx +94 -0
  219. package/dist/stories/Skeleton.stories.d.ts +7 -0
  220. package/dist/stories/Skeleton.stories.jsx +27 -0
  221. package/dist/stories/StatTile.stories.d.ts +10 -0
  222. package/dist/stories/StatTile.stories.jsx +55 -0
  223. package/dist/stories/Table.stories.d.ts +1 -0
  224. package/dist/stories/Table.stories.jsx +49 -1
  225. package/dist/stories/TitleBar.stories.d.ts +7 -0
  226. package/dist/stories/TitleBar.stories.jsx +41 -0
  227. package/package.json +5 -1
@@ -8,3 +8,4 @@ export declare const Error: Story;
8
8
  export declare const Warning: Story;
9
9
  export declare const Success: Story;
10
10
  export declare const AllColors: Story;
11
+ export declare const AnnounceNewTab: Story;
@@ -57,3 +57,11 @@ export var AllColors = {
57
57
  <Link href="https://example.com" color="success">Success</Link>
58
58
  </div>); },
59
59
  };
60
+ // A link that opens a new tab says so: a small icon and the hidden words '(opens in a new tab)'
61
+ export var AnnounceNewTab = {
62
+ render: function () { return (<div style={{ display: "flex", gap: "16px" }}>
63
+ <Link href="https://example.com" announceNewTab>Terms of Use</Link>
64
+ <Link href="/pricing" openInNewTab announceNewTab size="body2">Pricing</Link>
65
+ <Link href="/pricing" announceNewTab>Not a new tab</Link>
66
+ </div>); },
67
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import OnThisPage from "../components/onThisPage";
3
+ declare const meta: Meta<typeof OnThisPage>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof OnThisPage>;
6
+ export declare const LongPage: Story;
7
+ export declare const Probe: Story;
8
+ export declare const HeaderProbe: Story;
9
+ export declare const HashProbe: Story;
10
+ export declare const HashScrolledProbe: Story;
@@ -0,0 +1,105 @@
1
+ import React, { useLayoutEffect } from "react";
2
+ import OnThisPage from "../components/onThisPage";
3
+ import SiteHeader from "../components/siteHeader";
4
+ import PageShell from "../components/pageShell";
5
+ import Heading from "../components/heading";
6
+ import Paragraph from "../components/paragraph";
7
+ var meta = {
8
+ title: "Components/OnThisPage",
9
+ component: OnThisPage,
10
+ parameters: { layout: "fullscreen" },
11
+ };
12
+ export default meta;
13
+ var Bleed = function (_a) {
14
+ var children = _a.children;
15
+ return <div style={{ margin: "-1rem" }}>{children}</div>;
16
+ };
17
+ var items = [
18
+ { id: "overview", label: "Overview" },
19
+ { id: "set-up", label: "Set up" },
20
+ { id: "invite-people", label: "Invite people", level: 3 },
21
+ { id: "billing", label: "Billing" },
22
+ { id: "close-account", label: "Close your account" },
23
+ ];
24
+ // The first sections are tall; the last two are short, so neither can ever scroll up to the top
25
+ var heights = ["70vh", "70vh", "70vh", "160px", "120px"];
26
+ var Sections = function () { return (<>
27
+ {items.map(function (item, i) { return (<section key={item.id} style={{ minHeight: heights[i] }}>
28
+ <Heading level={item.level === 3 ? 3 : 2} size={item.level === 3 ? "h6" : "h5"} id={item.id}>
29
+ {item.label}
30
+ </Heading>
31
+ <Paragraph tone="secondary">Dana Lee set up Acme for the team. Ben Carter and Omar Reyes join next week.</Paragraph>
32
+ </section>); })}
33
+ </>); };
34
+ // The marker beside the current heading, on a page in two columns
35
+ export var LongPage = {
36
+ render: function () { return (<Bleed>
37
+ <div style={{ display: "flex", gap: "32px", padding: "32px", alignItems: "flex-start" }}>
38
+ <div style={{ flex: 1, minWidth: 0 }}>
39
+ <Sections />
40
+ </div>
41
+ <div style={{ position: "sticky", top: "32px", width: "220px", flexShrink: 0 }}>
42
+ <OnThisPage items={items}/>
43
+ </div>
44
+ </div>
45
+ </Bleed>); },
46
+ };
47
+ // For tests/interactions.spec.ts only: PageShell's aside from xl, a long page with a short last section
48
+ export var Probe = {
49
+ tags: ["!dev", "!autodocs", "test-only"],
50
+ render: function () { return (<Bleed>
51
+ <PageShell id="main" aside={<OnThisPage items={items}/>}>
52
+ <Sections />
53
+ </PageShell>
54
+ </Bleed>); },
55
+ };
56
+ // For tests/interactions.spec.ts only: a SiteHeader above PageShell's aside and OnThisPage
57
+ export var HeaderProbe = {
58
+ tags: ["!dev", "!autodocs", "test-only"],
59
+ render: function () { return (<Bleed>
60
+ <SiteHeader brand={{ href: "/", name: "Acme" }} links={[{ label: "Docs", href: "#docs", current: true }, { label: "Pricing", href: "#pricing" }]}/>
61
+ <PageShell id="main" tabIndex={-1} aside={<OnThisPage items={items}/>}>
62
+ <style>{"h2, h3 { scroll-margin-top: var(--os-header-offset, 0px); }"}</style>
63
+ <Sections />
64
+ </PageShell>
65
+ </Bleed>); },
66
+ };
67
+ // Does what the browser does on a server-rendered page: jump to the #hash before any effect runs, so before
68
+ // SiteHeader has set --os-header-offset (a layout effect runs before every passive effect)
69
+ // With scrolledOn, the person then scrolls to the end, still before the header publishes
70
+ var JumpToHash = function (_a) {
71
+ var _b = _a.scrolledOn, scrolledOn = _b === void 0 ? false : _b;
72
+ useLayoutEffect(function () {
73
+ var _a;
74
+ var id = decodeURIComponent(window.location.hash.slice(1));
75
+ if (id)
76
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "start", behavior: "instant" });
77
+ if (scrolledOn)
78
+ window.scrollTo({ top: document.documentElement.scrollHeight, behavior: "instant" });
79
+ }, [scrolledOn]);
80
+ return null;
81
+ };
82
+ // For tests/interactions.spec.ts only: HeaderProbe opened with a #hash, with the headings on the page before the header publishes
83
+ export var HashProbe = {
84
+ tags: ["!dev", "!autodocs", "test-only"],
85
+ render: function () { return (<Bleed>
86
+ <SiteHeader brand={{ href: "/", name: "Acme" }} links={[{ label: "Docs", href: "#docs", current: true }, { label: "Pricing", href: "#pricing" }]}/>
87
+ <PageShell id="main" tabIndex={-1} aside={<OnThisPage items={items}/>}>
88
+ <style>{"h2, h3 { scroll-margin-top: var(--os-header-offset, 0px); }"}</style>
89
+ <Sections />
90
+ </PageShell>
91
+ <JumpToHash />
92
+ </Bleed>); },
93
+ };
94
+ // For tests/interactions.spec.ts only: HashProbe, but scrolled on past the #hash heading before the header publishes
95
+ export var HashScrolledProbe = {
96
+ tags: ["!dev", "!autodocs", "test-only"],
97
+ render: function () { return (<Bleed>
98
+ <SiteHeader brand={{ href: "/", name: "Acme" }} links={[{ label: "Docs", href: "#docs", current: true }, { label: "Pricing", href: "#pricing" }]}/>
99
+ <PageShell id="main" tabIndex={-1} aside={<OnThisPage items={items}/>}>
100
+ <style>{"h2, h3 { scroll-margin-top: var(--os-header-offset, 0px); }"}</style>
101
+ <Sections />
102
+ </PageShell>
103
+ <JumpToHash scrolledOn/>
104
+ </Bleed>); },
105
+ };
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Pagination from "../components/pagination";
3
+ declare const meta: Meta<typeof Pagination>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Pagination>;
6
+ export declare const Default: Story;
7
+ export declare const Compact: Story;
8
+ export declare const Probe: Story;
9
+ export declare const ScrollProbe: Story;
@@ -0,0 +1,75 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import React, { useState } from "react";
11
+ import Pagination from "../components/pagination";
12
+ var meta = {
13
+ title: "Components/Pagination",
14
+ component: Pagination,
15
+ argTypes: {
16
+ page: { control: "number" },
17
+ pageCount: { control: "number" },
18
+ "aria-label": { control: "text" },
19
+ variant: { control: "select", options: ["default", "compact"] },
20
+ scrollTargetId: { control: "text" },
21
+ },
22
+ decorators: [function (Story) { return <div style={{ width: 360, padding: 16 }}><Story /></div>; }],
23
+ };
24
+ export default meta;
25
+ function Demo(props) {
26
+ var _a = useState(props.page), page = _a[0], setPage = _a[1];
27
+ return <Pagination {...props} page={page} onPageChange={setPage}/>;
28
+ }
29
+ export var Default = {
30
+ args: { page: 3, pageCount: 12 },
31
+ render: function (args) { return <Demo {...args}/>; },
32
+ };
33
+ export var Compact = {
34
+ args: { page: 2, pageCount: 5, variant: "compact", "aria-label": "Invoice pages" },
35
+ render: function (args) { return <Demo {...args}/>; },
36
+ };
37
+ // For tests/interactions.spec.ts only: starts on `page` of `pageCount` and prints every page it is asked for
38
+ function ProbeDemo(_a) {
39
+ var first = _a.page, pageCount = _a.pageCount;
40
+ var _b = useState(first), page = _b[0], setPage = _b[1];
41
+ var _c = useState([]), calls = _c[0], setCalls = _c[1];
42
+ return (<div>
43
+ <button type="button">Before</button>
44
+ <Pagination page={page} pageCount={pageCount} onPageChange={function (p) {
45
+ setPage(p);
46
+ setCalls(function (c) { return __spreadArray(__spreadArray([], c, true), [p], false); });
47
+ }}/>
48
+ <p data-testid="calls">{calls.join(",")}</p>
49
+ </div>);
50
+ }
51
+ export var Probe = {
52
+ tags: ["!dev", "!autodocs", "test-only"],
53
+ args: { page: 1, pageCount: 500 },
54
+ render: function (args) { return <ProbeDemo page={args.page} pageCount={args.pageCount}/>; },
55
+ };
56
+ // For tests/interactions.spec.ts only: the table (here a heading) is far below the controls, so a press scrolls to it.
57
+ // The buttons change the page and the count from outside, which must not scroll.
58
+ function ScrollProbeDemo(_a) {
59
+ var first = _a.page, firstCount = _a.pageCount;
60
+ var _b = useState(first), page = _b[0], setPage = _b[1];
61
+ var _c = useState(firstCount), count = _c[0], setCount = _c[1];
62
+ return (<div>
63
+ <button type="button" onClick={function () { return setPage(1); }}>Reset page</button>
64
+ <button type="button" onClick={function () { return setCount(2); }}>Fewer pages</button>
65
+ <Pagination page={page} pageCount={count} onPageChange={setPage} scrollTargetId="pagination-probe-table"/>
66
+ <div style={{ height: 2400 }}/>
67
+ <h2 id="pagination-probe-table">Table</h2>
68
+ <div style={{ height: 2400 }}/>
69
+ </div>);
70
+ }
71
+ export var ScrollProbe = {
72
+ tags: ["!dev", "!autodocs", "test-only"],
73
+ args: { page: 1, pageCount: 5 },
74
+ render: function (args) { return <ScrollProbeDemo page={args.page} pageCount={args.pageCount}/>; },
75
+ };
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Progress from "../components/progress";
3
+ declare const meta: Meta<typeof Progress>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Progress>;
6
+ export declare const Default: Story;
7
+ export declare const Levels: Story;
8
+ export declare const NoLimit: Story;
9
+ export declare const Share: Story;
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import Progress from "../components/progress";
3
+ var meta = {
4
+ title: "Components/Progress",
5
+ component: Progress,
6
+ argTypes: {
7
+ label: { control: "text" },
8
+ value: { control: "number" },
9
+ max: { control: "number" },
10
+ valueText: { control: "text" },
11
+ unit: { control: "text" },
12
+ kind: { control: "select", options: ["limit", "share"] },
13
+ warnAt: { control: "number" },
14
+ hideLabel: { control: "boolean" },
15
+ size: { control: "select", options: ["small", "medium"] },
16
+ },
17
+ decorators: [function (Story) { return <div style={{ width: 360 }}><Story /></div>; }],
18
+ };
19
+ export default meta;
20
+ export var Default = {
21
+ args: { id: "progress-default", label: "Responses", value: 500, max: 1000, unit: "responses" },
22
+ };
23
+ // Below the warning share, near the limit, at the limit, and over it
24
+ export var Levels = {
25
+ render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
26
+ <Progress id="progress-levels-ok" label="Responses" value={500} max={1000} unit="responses"/>
27
+ <Progress id="progress-levels-warn" label="Seats" value={85} max={100} unit="seats" size="small"/>
28
+ <Progress id="progress-levels-limit" label="Storage" value={1000} max={1000} unit="MB"/>
29
+ <Progress id="progress-levels-over" label="Responses" value={1240} max={1000} unit="responses"/>
30
+ </div>); },
31
+ };
32
+ export var NoLimit = {
33
+ args: { id: "progress-nolimit", label: "Responses", value: 340, max: null, unit: "responses" },
34
+ };
35
+ // A part of a total: the main color and no status words, even for most of the total or all of it
36
+ export var Share = {
37
+ render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
38
+ <Progress id="progress-share-part" kind="share" label="Atlas Large" value={512} max={1240} unit="responses"/>
39
+ <Progress id="progress-share-most" kind="share" label="Birch 4" value={1100} max={1240} unit="responses"/>
40
+ <Progress id="progress-share-all" kind="share" label="Atlas Medium" value={1240} max={1240} unit="responses"/>
41
+ <Progress id="progress-share-small" kind="share" label="Elm" value={4} max={1240} unit="responses"/>
42
+ </div>); },
43
+ };
@@ -9,3 +9,4 @@ export declare const Layout: Story;
9
9
  export declare const LayoutStrictMode: StoryObj<{
10
10
  initialOpen: boolean;
11
11
  }>;
12
+ export declare const ListDetail: Story;
@@ -7,6 +7,7 @@ import Button from "../components/button";
7
7
  import Paragraph from "../components/paragraph";
8
8
  import Navigation, { NavigationGroup } from "../components/navigation";
9
9
  import MenuItem from "../components/menuItem";
10
+ import TitleBar from "../components/titleBar";
10
11
  var meta = {
11
12
  title: "Components/SettingsSection",
12
13
  component: SettingsSection,
@@ -62,3 +63,29 @@ export var LayoutStrictMode = {
62
63
  <LayoutProbe {...args}/>
63
64
  </React.StrictMode>); },
64
65
  };
66
+ // A list beside its detail: the wide nav column holds rows, and on a phone the list is the page and
67
+ // a row opens its detail with a Back Button, the same drill-in as the settings nav.
68
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): there only the list shows.
69
+ var threads = [
70
+ { id: "launch", from: "Ben Carter", subject: "Launch plan for the home page" },
71
+ { id: "screens", from: "Omar Reyes", subject: "New screens by Friday" },
72
+ { id: "pricing", from: "Ben Carter", subject: "Pricing table copy" },
73
+ ];
74
+ function ListDetailBox() {
75
+ var _a = React.useState(false), open = _a[0], setOpen = _a[1];
76
+ var _b = React.useState("launch"), current = _b[0], setCurrent = _b[1];
77
+ var thread = threads.find(function (t) { return t.id === current; });
78
+ return (<SettingsLayout navWidth="wide" showContent={open} back={<Button type="tertiary" size="small" state="enabled" label="Back to Inbox" decoIcon="ChevronLeft" onClickButton={function () { return setOpen(false); }}/>} nav={<Navigation aria-label="Inbox">
79
+ {threads.map(function (t) { return (<MenuItem key={t.id} size="small" label={t.from} secondLabel={t.subject} role="button" isSelected={t.id === current} aria-current={t.id === current ? "page" : undefined} onClick={function () {
80
+ setCurrent(t.id);
81
+ setOpen(true);
82
+ }}/>); })}
83
+ </Navigation>}>
84
+ <TitleBar title={thread.subject}/>
85
+ <Paragraph>{thread.from}: the details are in the brief. Reply here when you have read it.</Paragraph>
86
+ </SettingsLayout>);
87
+ }
88
+ export var ListDetail = {
89
+ tags: ["shell"],
90
+ render: function () { return <ListDetailBox />; },
91
+ };
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SidePane from "../components/sidePane";
3
+ declare const meta: Meta<typeof SidePane>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SidePane>;
6
+ export declare const Resizable: Story;
@@ -0,0 +1,37 @@
1
+ import React, { useState } from "react";
2
+ import SidePane from "../components/sidePane";
3
+ import IconButton from "../components/iconButton";
4
+ import Paragraph from "../components/paragraph";
5
+ import TitleBar from "../components/titleBar";
6
+ var meta = {
7
+ title: "Components/SidePane",
8
+ component: SidePane,
9
+ parameters: { layout: "fullscreen" },
10
+ };
11
+ export default meta;
12
+ // A page with a document open beside it. From lg up the pane's start edge is a handle: drag it, or
13
+ // focus it and press the arrow keys (16px a step), Home and End.
14
+ function ResizableBox() {
15
+ var _a = useState(true), open = _a[0], setOpen = _a[1];
16
+ var _b = useState(448), width = _b[0], setWidth = _b[1];
17
+ return (<div style={{ margin: "-1rem", display: "flex", height: "100dvh" }}>
18
+ {/* Below lg the open pane takes the page's place, as in AppShell */}
19
+ <div style={{ flex: 1, minWidth: 0, padding: "24px" }} className={open ? "hidden lg:block" : undefined}>
20
+ <TitleBar title="Launch plan" actions={<IconButton color="iconOnly" state={open ? "selected" : "enabled"} size="medium" iconName="FileText" ariaLabel="Brief" aria-expanded={open} onClick={function () { return setOpen(true); }}/>}/>
21
+ <div style={{ marginTop: "16px" }}>
22
+ <Paragraph tone="secondary">Ben Carter: the brief is in the pane. Leave notes on anything that needs a change.</Paragraph>
23
+ </div>
24
+ </div>
25
+ {open && (<SidePane title="Brief" onClose={function () { return setOpen(false); }} width={width} onWidthChange={setWidth}>
26
+ <div style={{ display: "flex", flexDirection: "column", gap: "12px" }}>
27
+ <Paragraph measure="none">Acme ships the new home page on Friday. Omar Reyes owns the copy and Dana Lee the screens.</Paragraph>
28
+ <Paragraph measure="none" tone="secondary">The pane stays beside the page, so the thread and the brief read together.</Paragraph>
29
+ </div>
30
+ </SidePane>)}
31
+ </div>);
32
+ }
33
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): there the pane takes the whole width
34
+ export var Resizable = {
35
+ tags: ["shell"],
36
+ render: function () { return <ResizableBox />; },
37
+ };
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SiteFooter from "../components/siteFooter";
3
+ declare const meta: Meta<typeof SiteFooter>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SiteFooter>;
6
+ export declare const Columns: Story;
7
+ export declare const Simple: Story;
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import SiteFooter from "../components/siteFooter";
3
+ var meta = {
4
+ title: "Components/SiteFooter",
5
+ component: SiteFooter,
6
+ parameters: { layout: "fullscreen" },
7
+ };
8
+ export default meta;
9
+ var Bleed = function (_a) {
10
+ var children = _a.children;
11
+ return <div style={{ margin: "-1rem" }}>{children}</div>;
12
+ };
13
+ var brand = { href: "/", name: "Acme" };
14
+ var columns = [
15
+ {
16
+ title: "Product",
17
+ links: [
18
+ { label: "Features", href: "#features" },
19
+ { label: "Pricing", href: "#pricing" },
20
+ { label: "Changelog", href: "#changelog" },
21
+ ],
22
+ },
23
+ {
24
+ title: "Company",
25
+ links: [
26
+ { label: "About", href: "#about" },
27
+ { label: "Careers", href: "#careers" },
28
+ { label: "Contact", href: "#contact" },
29
+ ],
30
+ },
31
+ {
32
+ title: "Resources",
33
+ links: [
34
+ { label: "Documentation", href: "#documentation" },
35
+ { label: "Status", href: "https://status.example.com", external: true },
36
+ ],
37
+ },
38
+ {
39
+ title: "Legal",
40
+ links: [
41
+ { label: "Privacy", href: "#privacy" },
42
+ { label: "Terms of Use", href: "#terms" },
43
+ ],
44
+ },
45
+ ];
46
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): two columns across
47
+ export var Columns = {
48
+ tags: ["shell"],
49
+ render: function () { return (<Bleed>
50
+ <SiteFooter brand={brand} columns={columns} legal="© 2026 Acme"/>
51
+ </Bleed>); },
52
+ };
53
+ export var Simple = {
54
+ tags: ["shell"],
55
+ render: function () { return (<Bleed>
56
+ <SiteFooter links={[
57
+ { label: "Privacy", href: "#privacy" },
58
+ { label: "Terms of Use", href: "#terms" },
59
+ { label: "Status", href: "https://status.example.com", external: true },
60
+ { label: "Contact", href: "#contact" },
61
+ ]} legal="© 2026 Acme"/>
62
+ </Bleed>); },
63
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import SiteHeader from "../components/siteHeader";
3
+ declare const meta: Meta<typeof SiteHeader>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SiteHeader>;
6
+ export declare const Links: Story;
7
+ export declare const Phone: Story;
8
+ export declare const LongLabels: Story;
9
+ export declare const Probe: Story;
10
+ export declare const UnmountProbe: Story;
@@ -0,0 +1,94 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import SiteHeader from "../components/siteHeader";
3
+ import Button from "../components/button";
4
+ import Paragraph from "../components/paragraph";
5
+ var meta = {
6
+ title: "Components/SiteHeader",
7
+ component: SiteHeader,
8
+ parameters: { layout: "fullscreen" },
9
+ };
10
+ export default meta;
11
+ // The story frame pads its content; a site header is the top of a page, so it takes the padding back
12
+ var Bleed = function (_a) {
13
+ var children = _a.children;
14
+ return <div style={{ margin: "-1rem" }}>{children}</div>;
15
+ };
16
+ // A square mark for Acme, inline so the story needs no network
17
+ var logo = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='28' viewBox='0 0 96 28'%3E%3Crect width='28' height='28' rx='7' fill='%23336' /%3E%3Ctext x='36' y='21' font-family='sans-serif' font-size='18' font-weight='700' fill='%23336'%3EAcme%3C/text%3E%3C/svg%3E";
18
+ var brand = { href: "/", name: "Acme", src: logo, width: 96, height: 28 };
19
+ var links = [
20
+ { label: "Features", href: "#features", current: true },
21
+ { label: "Pricing", href: "#pricing" },
22
+ { label: "Documentation", href: "#documentation" },
23
+ { label: "Changelog", href: "#changelog" },
24
+ { label: "Company", href: "#company" },
25
+ ];
26
+ // Log In is secondary: in the menu below md. Sign Up is the main action: in the bar at every width.
27
+ var actions = <Button size="medium" type="tertiary" state="enabled" label="Log In" href="#log-in"/>;
28
+ var phoneAction = <Button size="medium" type="primary" state="enabled" label="Sign Up" href="#sign-up"/>;
29
+ var longLinks = [
30
+ { label: "Product Features", href: "#features", current: true },
31
+ { label: "Pricing and Plans", href: "#pricing" },
32
+ { label: "Documentation", href: "#documentation" },
33
+ { label: "Release Changelog", href: "#changelog" },
34
+ { label: "About the Company", href: "#company" },
35
+ ];
36
+ var Page = function () { return (<div style={{ padding: "24px", display: "flex", flexDirection: "column", gap: "12px" }}>
37
+ <Paragraph tone="secondary">Ship the launch plan this week. Ben Carter has the new screens.</Paragraph>
38
+ </div>); };
39
+ // Also shot at 375px by tests/stories.spec.ts (the "shell" tag): the brand, Menu and one action in the bar
40
+ export var Links = {
41
+ tags: ["shell"],
42
+ render: function () { return (<Bleed>
43
+ <SiteHeader brand={brand} links={links} actions={actions} phoneAction={phoneAction}/>
44
+ <Page />
45
+ </Bleed>); },
46
+ };
47
+ // Opens the menu once the page is up, so the story shows it
48
+ var OpenMenu = function (_a) {
49
+ var children = _a.children;
50
+ useEffect(function () {
51
+ var _a;
52
+ (_a = document.querySelector('button[aria-label="Menu"]')) === null || _a === void 0 ? void 0 : _a.click();
53
+ }, []);
54
+ return <>{children}</>;
55
+ };
56
+ // Shot at 375px only (the "phone" tag): the menu open, with the links and the other action
57
+ export var Phone = {
58
+ tags: ["phone"],
59
+ render: function () { return (<Bleed>
60
+ <OpenMenu>
61
+ <SiteHeader brand={brand} links={links} actions={actions} phoneAction={phoneAction}/>
62
+ <Page />
63
+ </OpenMenu>
64
+ </Bleed>); },
65
+ };
66
+ // Shot at 768px only (the "tablet" tag): the full bar from md, with long labels
67
+ export var LongLabels = {
68
+ tags: ["tablet"],
69
+ render: function () { return (<Bleed>
70
+ <SiteHeader brand={brand} links={longLinks} actions={actions} phoneAction={phoneAction}/>
71
+ <Page />
72
+ </Bleed>); },
73
+ };
74
+ // For tests/interactions.spec.ts only: five links with long labels and two actions, checked at 375px and 768px
75
+ export var Probe = {
76
+ tags: ["!dev", "!autodocs", "test-only"],
77
+ render: function () { return (<Bleed>
78
+ <SiteHeader brand={brand} links={longLinks} actions={actions} phoneAction={phoneAction}/>
79
+ <main id="main" tabIndex={-1}>
80
+ <Page />
81
+ </main>
82
+ </Bleed>); },
83
+ };
84
+ // For tests/interactions.spec.ts only: a Button that removes the header, so the test sees --os-header-offset go with it
85
+ export var UnmountProbe = {
86
+ tags: ["!dev", "!autodocs", "test-only"],
87
+ render: function Render() {
88
+ var _a = useState(true), shown = _a[0], setShown = _a[1];
89
+ return (<Bleed>
90
+ {shown && <SiteHeader brand={brand} links={links}/>}
91
+ <Button size="medium" type="secondary" state="enabled" label="Remove Header" onClickButton={function () { return setShown(false); }}/>
92
+ </Bleed>);
93
+ },
94
+ };
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Skeleton from "../components/skeleton";
3
+ declare const meta: Meta<typeof Skeleton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Skeleton>;
6
+ export declare const Default: Story;
7
+ export declare const Shapes: Story;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import Skeleton from "../components/skeleton";
3
+ var meta = {
4
+ title: "Components/Skeleton",
5
+ component: Skeleton,
6
+ argTypes: {
7
+ variant: { control: "select", options: ["text", "block", "circle"] },
8
+ width: { control: "select", options: ["full", "large", "medium", "small"] },
9
+ height: { control: "select", options: ["small", "medium", "large"] },
10
+ lines: { control: "number" },
11
+ label: { control: "text" },
12
+ },
13
+ decorators: [function (Story) { return <div style={{ width: 360 }}><Story /></div>; }],
14
+ };
15
+ export default meta;
16
+ export var Default = { args: { label: "Loading invoices" } };
17
+ // The three shapes, with a stack of text lines and each block height
18
+ export var Shapes = {
19
+ render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
20
+ <Skeleton lines={3}/>
21
+ <Skeleton variant="circle"/>
22
+ <Skeleton variant="block" height="small" width="large"/>
23
+ <Skeleton variant="block" height="medium" width="medium"/>
24
+ <Skeleton variant="block" height="large" width="small"/>
25
+ <Skeleton label="Loading invoices"/>
26
+ </div>); },
27
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import StatTile from "../components/statTile";
3
+ declare const meta: Meta<typeof StatTile>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof StatTile>;
6
+ export declare const Default: Story;
7
+ export declare const Row: Story;
8
+ export declare const RowPhone: Story;
9
+ export declare const States: Story;
10
+ export declare const Large: Story;