oneslash-design-system 2.19.0 → 2.21.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 (264) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +62 -5
  3. package/dist/cases/about-page/profile.d.ts +1 -0
  4. package/dist/cases/about-page/profile.jsx +64 -0
  5. package/dist/cases/about-page.md +114 -0
  6. package/dist/cases/admin-inbox/list.d.ts +1 -0
  7. package/dist/cases/admin-inbox/list.jsx +104 -0
  8. package/dist/cases/admin-inbox/split.d.ts +1 -0
  9. package/dist/cases/admin-inbox/split.jsx +68 -0
  10. package/dist/cases/admin-inbox.md +254 -0
  11. package/dist/cases/api-keys.md +1 -1
  12. package/dist/cases/billing-page/billed-elsewhere.d.ts +1 -0
  13. package/dist/cases/billing-page/billed-elsewhere.jsx +28 -0
  14. package/dist/cases/billing-page/self-serve.d.ts +1 -0
  15. package/dist/cases/billing-page/self-serve.jsx +134 -0
  16. package/dist/cases/billing-page.md +247 -0
  17. package/dist/cases/blog-index/cards.d.ts +1 -0
  18. package/dist/cases/blog-index/cards.jsx +45 -0
  19. package/dist/cases/blog-index/list.d.ts +1 -0
  20. package/dist/cases/blog-index/list.jsx +46 -0
  21. package/dist/cases/blog-index.md +160 -0
  22. package/dist/cases/breakdown-list/bars.d.ts +1 -0
  23. package/dist/cases/breakdown-list/bars.jsx +47 -0
  24. package/dist/cases/breakdown-list/table.d.ts +1 -0
  25. package/dist/cases/breakdown-list/table.jsx +69 -0
  26. package/dist/cases/breakdown-list.md +158 -0
  27. package/dist/cases/changelog/by-month.d.ts +1 -0
  28. package/dist/cases/changelog/by-month.jsx +70 -0
  29. package/dist/cases/changelog/one-page.d.ts +1 -0
  30. package/dist/cases/changelog/one-page.jsx +70 -0
  31. package/dist/cases/changelog.md +200 -0
  32. package/dist/cases/code-sample/block.d.ts +1 -0
  33. package/dist/cases/code-sample/block.jsx +19 -0
  34. package/dist/cases/code-sample/command.d.ts +1 -0
  35. package/dist/cases/code-sample/command.jsx +17 -0
  36. package/dist/cases/code-sample.md +96 -0
  37. package/dist/cases/composer-limit/notice-with-action.jsx +3 -3
  38. package/dist/cases/composer-limit/notice.jsx +3 -3
  39. package/dist/cases/composer-limit.md +8 -8
  40. package/dist/cases/contact-page/form.d.ts +1 -0
  41. package/dist/cases/contact-page/form.jsx +83 -0
  42. package/dist/cases/contact-page/links.d.ts +1 -0
  43. package/dist/cases/contact-page/links.jsx +19 -0
  44. package/dist/cases/contact-page.md +142 -0
  45. package/dist/cases/dashboard/numbers-first.d.ts +1 -0
  46. package/dist/cases/dashboard/numbers-first.jsx +165 -0
  47. package/dist/cases/dashboard/work-first.d.ts +1 -0
  48. package/dist/cases/dashboard/work-first.jsx +165 -0
  49. package/dist/cases/dashboard.md +507 -0
  50. package/dist/cases/data-table-page/all-rows.d.ts +1 -0
  51. package/dist/cases/data-table-page/all-rows.jsx +226 -0
  52. package/dist/cases/data-table-page/paged.d.ts +1 -0
  53. package/dist/cases/data-table-page/paged.jsx +284 -0
  54. package/dist/cases/data-table-page.md +771 -0
  55. package/dist/cases/docs-component-page/reference.d.ts +1 -0
  56. package/dist/cases/docs-component-page/reference.jsx +93 -0
  57. package/dist/cases/docs-component-page.md +144 -0
  58. package/dist/cases/faq/accordion.d.ts +1 -0
  59. package/dist/cases/faq/accordion.jsx +25 -0
  60. package/dist/cases/faq/open-list.d.ts +1 -0
  61. package/dist/cases/faq/open-list.jsx +27 -0
  62. package/dist/cases/faq.md +110 -0
  63. package/dist/cases/feature-grid/cards.d.ts +1 -0
  64. package/dist/cases/feature-grid/cards.jsx +33 -0
  65. package/dist/cases/feature-grid/rows.d.ts +1 -0
  66. package/dist/cases/feature-grid/rows.jsx +30 -0
  67. package/dist/cases/feature-grid.md +132 -0
  68. package/dist/cases/image-viewer/gallery.d.ts +1 -0
  69. package/dist/cases/image-viewer/gallery.jsx +32 -0
  70. package/dist/cases/image-viewer/single.d.ts +1 -0
  71. package/dist/cases/image-viewer/single.jsx +25 -0
  72. package/dist/cases/image-viewer.md +123 -0
  73. package/dist/cases/invoice-list/table.d.ts +1 -0
  74. package/dist/cases/invoice-list/table.jsx +64 -0
  75. package/dist/cases/invoice-list/with-upcoming.d.ts +1 -0
  76. package/dist/cases/invoice-list/with-upcoming.jsx +75 -0
  77. package/dist/cases/invoice-list.md +237 -0
  78. package/dist/cases/landing-hero/centered.d.ts +1 -0
  79. package/dist/cases/landing-hero/centered.jsx +22 -0
  80. package/dist/cases/landing-hero/split.d.ts +1 -0
  81. package/dist/cases/landing-hero/split.jsx +30 -0
  82. package/dist/cases/landing-hero.md +114 -0
  83. package/dist/cases/legal-page/sections.d.ts +1 -0
  84. package/dist/cases/legal-page/sections.jsx +61 -0
  85. package/dist/cases/legal-page.md +96 -0
  86. package/dist/cases/load-failure/inline.jsx +2 -2
  87. package/dist/cases/load-failure.md +2 -2
  88. package/dist/cases/long-form-page/article.d.ts +1 -0
  89. package/dist/cases/long-form-page/article.jsx +58 -0
  90. package/dist/cases/long-form-page/with-contents.d.ts +1 -0
  91. package/dist/cases/long-form-page/with-contents.jsx +41 -0
  92. package/dist/cases/long-form-page.md +170 -0
  93. package/dist/cases/members-list/rows.jsx +2 -1
  94. package/dist/cases/members-list/table.jsx +8 -9
  95. package/dist/cases/members-list.md +12 -13
  96. package/dist/cases/message-actions/hover-toolbar.jsx +11 -8
  97. package/dist/cases/message-actions/menu.jsx +10 -7
  98. package/dist/cases/message-actions.md +19 -13
  99. package/dist/cases/message-attachments/in-composer.jsx +2 -2
  100. package/dist/cases/message-attachments/in-message.jsx +16 -11
  101. package/dist/cases/message-attachments.md +29 -17
  102. package/dist/cases/number-format.md +36 -0
  103. package/dist/cases/one-main-action.md +33 -0
  104. package/dist/cases/overflow-menu/in-a-header.jsx +9 -6
  105. package/dist/cases/overflow-menu/on-a-row.jsx +9 -6
  106. package/dist/cases/overflow-menu.md +16 -10
  107. package/dist/cases/page-end/cta-band.d.ts +1 -0
  108. package/dist/cases/page-end/cta-band.jsx +24 -0
  109. package/dist/cases/page-end/next-link.d.ts +1 -0
  110. package/dist/cases/page-end/next-link.jsx +18 -0
  111. package/dist/cases/page-end.md +88 -0
  112. package/dist/cases/paged-card/pager.d.ts +1 -0
  113. package/dist/cases/paged-card/pager.jsx +41 -0
  114. package/dist/cases/paged-card/see-all.d.ts +1 -0
  115. package/dist/cases/paged-card/see-all.jsx +34 -0
  116. package/dist/cases/paged-card.md +147 -0
  117. package/dist/cases/password-gate/inline.d.ts +1 -0
  118. package/dist/cases/password-gate/inline.jsx +94 -0
  119. package/dist/cases/password-gate/modal.d.ts +1 -0
  120. package/dist/cases/password-gate/modal.jsx +81 -0
  121. package/dist/cases/password-gate/page.d.ts +1 -0
  122. package/dist/cases/password-gate/page.jsx +82 -0
  123. package/dist/cases/password-gate.md +351 -0
  124. package/dist/cases/payment-method/none.d.ts +1 -0
  125. package/dist/cases/payment-method/none.jsx +17 -0
  126. package/dist/cases/payment-method/on-file.d.ts +1 -0
  127. package/dist/cases/payment-method/on-file.jsx +92 -0
  128. package/dist/cases/payment-method.md +182 -0
  129. package/dist/cases/plan-change-confirm/blocked.d.ts +1 -0
  130. package/dist/cases/plan-change-confirm/blocked.jsx +48 -0
  131. package/dist/cases/plan-change-confirm/downgrade.d.ts +1 -0
  132. package/dist/cases/plan-change-confirm/downgrade.jsx +52 -0
  133. package/dist/cases/plan-change-confirm/upgrade.d.ts +1 -0
  134. package/dist/cases/plan-change-confirm/upgrade.jsx +51 -0
  135. package/dist/cases/plan-change-confirm.md +261 -0
  136. package/dist/cases/plan-picker/cards.d.ts +1 -0
  137. package/dist/cases/plan-picker/cards.jsx +97 -0
  138. package/dist/cases/plan-picker/list.d.ts +1 -0
  139. package/dist/cases/plan-picker/list.jsx +103 -0
  140. package/dist/cases/plan-picker.md +297 -0
  141. package/dist/cases/pricing-section/cards.d.ts +1 -0
  142. package/dist/cases/pricing-section/cards.jsx +40 -0
  143. package/dist/cases/pricing-section.md +85 -0
  144. package/dist/cases/product-cards/grid.d.ts +1 -0
  145. package/dist/cases/product-cards/grid.jsx +20 -0
  146. package/dist/cases/product-cards.md +71 -0
  147. package/dist/cases/range-switch/segmented.jsx +11 -7
  148. package/dist/cases/range-switch.md +16 -11
  149. package/dist/cases/reply-feedback/thumbs.jsx +11 -8
  150. package/dist/cases/reply-feedback/with-reason.jsx +11 -8
  151. package/dist/cases/reply-feedback.md +20 -14
  152. package/dist/cases/section-index/cards.d.ts +1 -0
  153. package/dist/cases/section-index/cards.jsx +25 -0
  154. package/dist/cases/section-index/list.d.ts +1 -0
  155. package/dist/cases/section-index/list.jsx +56 -0
  156. package/dist/cases/section-index.md +140 -0
  157. package/dist/cases/settings-page/top-tabs.jsx +4 -3
  158. package/dist/cases/settings-page.md +5 -4
  159. package/dist/cases/site-header.md +1 -1
  160. package/dist/cases/site-search/dialog.d.ts +1 -0
  161. package/dist/cases/site-search/dialog.jsx +131 -0
  162. package/dist/cases/site-search.md +176 -0
  163. package/dist/cases/stat-row/featured.d.ts +1 -0
  164. package/dist/cases/stat-row/featured.jsx +17 -0
  165. package/dist/cases/stat-row/tiles.d.ts +1 -0
  166. package/dist/cases/stat-row/tiles.jsx +34 -0
  167. package/dist/cases/stat-row.md +104 -0
  168. package/dist/cases/status-label/dot.d.ts +1 -0
  169. package/dist/cases/status-label/dot.jsx +39 -0
  170. package/dist/cases/status-label/text.d.ts +1 -0
  171. package/dist/cases/status-label/text.jsx +44 -0
  172. package/dist/cases/status-label.md +143 -0
  173. package/dist/cases/tabbed-panels/tabs.d.ts +1 -0
  174. package/dist/cases/tabbed-panels/tabs.jsx +40 -0
  175. package/dist/cases/tabbed-panels.md +81 -0
  176. package/dist/cases/upgrade-prompt/inline.jsx +4 -2
  177. package/dist/cases/upgrade-prompt/modal.jsx +2 -1
  178. package/dist/cases/upgrade-prompt.md +10 -6
  179. package/dist/cases/usage-meters/by-person.d.ts +1 -0
  180. package/dist/cases/usage-meters/by-person.jsx +72 -0
  181. package/dist/cases/usage-meters/meters.d.ts +1 -0
  182. package/dist/cases/usage-meters/meters.jsx +49 -0
  183. package/dist/cases/usage-meters/with-cap.d.ts +1 -0
  184. package/dist/cases/usage-meters/with-cap.jsx +73 -0
  185. package/dist/cases/usage-meters.md +303 -0
  186. package/dist/cases.json +2178 -97
  187. package/dist/components/accordion.d.ts +31 -0
  188. package/dist/components/accordion.jsx +103 -0
  189. package/dist/components/button.d.ts +1 -1
  190. package/dist/components/button.jsx +11 -5
  191. package/dist/components/codeBlock.d.ts +26 -0
  192. package/dist/components/codeBlock.jsx +101 -0
  193. package/dist/components/formatNumber.d.ts +25 -0
  194. package/dist/components/formatNumber.js +125 -0
  195. package/dist/components/iconButton.jsx +12 -7
  196. package/dist/components/lightbox.d.ts +31 -0
  197. package/dist/components/lightbox.jsx +161 -0
  198. package/dist/components/linkCard.d.ts +10 -1
  199. package/dist/components/linkCard.jsx +32 -6
  200. package/dist/components/modal.d.ts +10 -2
  201. package/dist/components/modal.jsx +17 -12
  202. package/dist/components/pageHeader.jsx +1 -1
  203. package/dist/components/pagination.d.ts +28 -0
  204. package/dist/components/pagination.jsx +89 -0
  205. package/dist/components/progress.d.ts +33 -0
  206. package/dist/components/progress.jsx +50 -0
  207. package/dist/components/searchDialog.d.ts +44 -0
  208. package/dist/components/searchDialog.jsx +152 -0
  209. package/dist/components/skeleton.d.ts +21 -0
  210. package/dist/components/skeleton.jsx +41 -0
  211. package/dist/components/statTile.d.ts +32 -0
  212. package/dist/components/statTile.jsx +61 -0
  213. package/dist/components/tab.d.ts +5 -1
  214. package/dist/components/tab.jsx +2 -2
  215. package/dist/components/tabPanel.d.ts +16 -0
  216. package/dist/components/tabPanel.jsx +12 -0
  217. package/dist/components/tableContainer.d.ts +5 -1
  218. package/dist/components/tableContainer.jsx +9 -1
  219. package/dist/components/tableHeaderCell.d.ts +3 -1
  220. package/dist/components/tableHeaderCell.jsx +2 -2
  221. package/dist/components/tabsContainer.d.ts +5 -1
  222. package/dist/components/tabsContainer.jsx +2 -2
  223. package/dist/components/titleBar.d.ts +3 -1
  224. package/dist/components/titleBar.jsx +4 -3
  225. package/dist/index.d.ts +10 -0
  226. package/dist/index.js +10 -0
  227. package/dist/internal/accordion.d.ts +4 -0
  228. package/dist/internal/accordion.js +53 -0
  229. package/dist/internal/combobox.d.ts +20 -0
  230. package/dist/internal/combobox.js +28 -0
  231. package/dist/internal/highlight.d.ts +5 -0
  232. package/dist/internal/highlight.js +18 -0
  233. package/dist/native-mapping.json +57 -3
  234. package/dist/stories/Accordion.stories.d.ts +11 -0
  235. package/dist/stories/Accordion.stories.jsx +93 -0
  236. package/dist/stories/Button.stories.d.ts +1 -0
  237. package/dist/stories/Button.stories.jsx +19 -1
  238. package/dist/stories/Cases.generated.stories.d.ts +60 -0
  239. package/dist/stories/Cases.generated.stories.jsx +120 -0
  240. package/dist/stories/CodeBlock.stories.d.ts +12 -0
  241. package/dist/stories/CodeBlock.stories.jsx +65 -0
  242. package/dist/stories/Lightbox.stories.d.ts +8 -0
  243. package/dist/stories/Lightbox.stories.jsx +40 -0
  244. package/dist/stories/LinkCard.stories.d.ts +6 -0
  245. package/dist/stories/LinkCard.stories.jsx +17 -0
  246. package/dist/stories/PageHeader.stories.d.ts +2 -0
  247. package/dist/stories/PageHeader.stories.jsx +13 -0
  248. package/dist/stories/Pagination.stories.d.ts +9 -0
  249. package/dist/stories/Pagination.stories.jsx +75 -0
  250. package/dist/stories/Progress.stories.d.ts +9 -0
  251. package/dist/stories/Progress.stories.jsx +43 -0
  252. package/dist/stories/SearchDialog.stories.d.ts +17 -0
  253. package/dist/stories/SearchDialog.stories.jsx +111 -0
  254. package/dist/stories/Skeleton.stories.d.ts +7 -0
  255. package/dist/stories/Skeleton.stories.jsx +27 -0
  256. package/dist/stories/StatTile.stories.d.ts +10 -0
  257. package/dist/stories/StatTile.stories.jsx +55 -0
  258. package/dist/stories/TabPanel.stories.d.ts +7 -0
  259. package/dist/stories/TabPanel.stories.jsx +31 -0
  260. package/dist/stories/Table.stories.d.ts +1 -0
  261. package/dist/stories/Table.stories.jsx +49 -1
  262. package/dist/stories/TitleBar.stories.d.ts +1 -0
  263. package/dist/stories/TitleBar.stories.jsx +7 -0
  264. package/package.json +5 -1
@@ -63,14 +63,17 @@ export default function ReplyFeedbackThumbs() {
63
63
  // The clipboard answers later; by then the example may be gone.
64
64
  var mounted = useRef(true);
65
65
  // On unmount it stops every timer and the run.
66
- useEffect(function () { return function () {
67
- mounted.current = false;
68
- clearTimeout(thanksTimer.current);
69
- clearTimeout(copyTimer.current);
70
- clearInterval(tick.current);
71
- clearTimeout(step.current);
72
- clearTimeout(cancel.current);
73
- }; }, []);
66
+ useEffect(function () {
67
+ mounted.current = true;
68
+ return function () {
69
+ mounted.current = false;
70
+ clearTimeout(thanksTimer.current);
71
+ clearTimeout(copyTimer.current);
72
+ clearInterval(tick.current);
73
+ clearTimeout(step.current);
74
+ clearTimeout(cancel.current);
75
+ };
76
+ }, []);
74
77
  useEffect(function () {
75
78
  var move = focusNext.current;
76
79
  focusNext.current = undefined;
@@ -69,14 +69,17 @@ export default function ReplyFeedbackWithReason() {
69
69
  // The clipboard answers later; by then the example may be gone.
70
70
  var mounted = useRef(true);
71
71
  // On unmount it stops every timer and the run.
72
- useEffect(function () { return function () {
73
- mounted.current = false;
74
- clearTimeout(thanksTimer.current);
75
- clearTimeout(copyTimer.current);
76
- clearInterval(tick.current);
77
- clearTimeout(step.current);
78
- clearTimeout(cancel.current);
79
- }; }, []);
72
+ useEffect(function () {
73
+ mounted.current = true;
74
+ return function () {
75
+ mounted.current = false;
76
+ clearTimeout(thanksTimer.current);
77
+ clearTimeout(copyTimer.current);
78
+ clearInterval(tick.current);
79
+ clearTimeout(step.current);
80
+ clearTimeout(cancel.current);
81
+ };
82
+ }, []);
80
83
  useEffect(function () {
81
84
  var move = focusNext.current;
82
85
  focusNext.current = undefined;
@@ -117,13 +117,16 @@ export default function ReplyFeedbackThumbs() {
117
117
  const mounted = useRef(true);
118
118
 
119
119
  // On unmount it stops every timer and the run.
120
- useEffect(() => () => {
121
- mounted.current = false;
122
- clearTimeout(thanksTimer.current);
123
- clearTimeout(copyTimer.current);
124
- clearInterval(tick.current);
125
- clearTimeout(step.current);
126
- clearTimeout(cancel.current);
120
+ useEffect(() => {
121
+ mounted.current = true;
122
+ return () => {
123
+ mounted.current = false;
124
+ clearTimeout(thanksTimer.current);
125
+ clearTimeout(copyTimer.current);
126
+ clearInterval(tick.current);
127
+ clearTimeout(step.current);
128
+ clearTimeout(cancel.current);
129
+ };
127
130
  }, []);
128
131
 
129
132
  useEffect(() => {
@@ -364,13 +367,16 @@ export default function ReplyFeedbackWithReason() {
364
367
  const mounted = useRef(true);
365
368
 
366
369
  // On unmount it stops every timer and the run.
367
- useEffect(() => () => {
368
- mounted.current = false;
369
- clearTimeout(thanksTimer.current);
370
- clearTimeout(copyTimer.current);
371
- clearInterval(tick.current);
372
- clearTimeout(step.current);
373
- clearTimeout(cancel.current);
370
+ useEffect(() => {
371
+ mounted.current = true;
372
+ return () => {
373
+ mounted.current = false;
374
+ clearTimeout(thanksTimer.current);
375
+ clearTimeout(copyTimer.current);
376
+ clearInterval(tick.current);
377
+ clearTimeout(step.current);
378
+ clearTimeout(cancel.current);
379
+ };
374
380
  }, []);
375
381
 
376
382
  useEffect(() => {
@@ -0,0 +1 @@
1
+ export default function SectionIndexCards(): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import PageShell from '../../components/pageShell';
3
+ import PageHeader from '../../components/pageHeader';
4
+ import LinkCard from '../../components/linkCard';
5
+ import { Grid, Stack } from '../../components/layout';
6
+ // Six places, each with a line that says what is there. A real site lists its own pages.
7
+ var guides = [
8
+ { id: 'start', title: 'Get started', line: 'Name your workspace and add the first people.' },
9
+ { id: 'channels', title: 'Channels', line: 'One place for the talk about each subject.' },
10
+ { id: 'tasks', title: 'Tasks', line: 'Give work an owner and a due date.' },
11
+ { id: 'notes', title: 'Notes', line: 'Write a decision once and find it later.' },
12
+ { id: 'agent', title: 'The agent', line: 'Ask a question and see the sources it used.' },
13
+ { id: 'billing', title: 'Plans and billing', line: 'Change plan and download invoices.' },
14
+ ];
15
+ export default function SectionIndexCards() {
16
+ return (<PageShell>
17
+ <Stack gap="giant">
18
+ <PageHeader level={1} title="Guides" lede="How to do each thing in Acme, one page for each."/>
19
+ {/* Three across from md, one on a phone. Every card is one link, named by its title and its line. */}
20
+ <Grid columns={3}>
21
+ {guides.map(function (g) { return (<LinkCard key={g.id} href={"#".concat(g.id)} title={g.title} description={g.line}/>); })}
22
+ </Grid>
23
+ </Stack>
24
+ </PageShell>);
25
+ }
@@ -0,0 +1 @@
1
+ export default function SectionIndexList(): import("react").JSX.Element;
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+ import PageShell from '../../components/pageShell';
3
+ import PageHeader from '../../components/pageHeader';
4
+ import SectionIntro from '../../components/sectionIntro';
5
+ import Link from '../../components/link';
6
+ import List from '../../components/list';
7
+ import Paragraph from '../../components/paragraph';
8
+ import { PageSection, Stack } from '../../components/layout';
9
+ // Many places, in groups. A real site builds this from its own list of pages.
10
+ var groups = [
11
+ {
12
+ id: 'section-index-start',
13
+ name: 'Start here',
14
+ pages: [
15
+ { id: 'workspace', title: 'Make a workspace', line: 'Name it and choose a plan.' },
16
+ { id: 'invite', title: 'Invite people', line: 'Invite by email and choose what each person can do.' },
17
+ { id: 'tour', title: 'A tour of Acme', line: 'Channels, tasks, notes and the agent in one page.' },
18
+ ],
19
+ },
20
+ {
21
+ id: 'section-index-work',
22
+ name: 'Everyday work',
23
+ pages: [
24
+ { id: 'channels', title: 'Channels', line: 'One place for the talk about each subject.' },
25
+ { id: 'threads', title: 'Threads', line: 'Reply to one message without filling the channel.' },
26
+ { id: 'tasks', title: 'Tasks', line: 'Give work an owner and a due date.' },
27
+ { id: 'notes', title: 'Notes', line: 'Write a decision once and find it later.' },
28
+ { id: 'search', title: 'Search', line: 'Find a message, a note or a file from one box.' },
29
+ ],
30
+ },
31
+ {
32
+ id: 'section-index-admin',
33
+ name: 'Run a workspace',
34
+ pages: [
35
+ { id: 'members', title: 'Members and roles', line: 'Who can read, write and change settings.' },
36
+ { id: 'billing', title: 'Plans and billing', line: 'Change plan and download invoices.' },
37
+ { id: 'export', title: 'Export your notes', line: 'Take a note or a whole workspace as PDF.' },
38
+ { id: 'delete', title: 'Delete a workspace', line: 'What is removed, and what you can get back.' },
39
+ ],
40
+ },
41
+ ];
42
+ export default function SectionIndexList() {
43
+ return (<PageShell>
44
+ <Stack gap="giant">
45
+ <PageHeader level={1} title="Guides" lede="How to do each thing in Acme, one page for each."/>
46
+ {groups.map(function (group) { return (<PageSection key={group.id} gap="xlarge">
47
+ {/* The group's name is the level 2 heading. Each link has its line under it. */}
48
+ <SectionIntro id={group.id} name={group.name}/>
49
+ <List items={group.pages.map(function (p) { return (<Stack key={p.id} gap="small">
50
+ <Link href={"#".concat(p.id)} size="subtitle1">{p.title}</Link>
51
+ <Paragraph tone="secondary" size="body2" measure="none">{p.line}</Paragraph>
52
+ </Stack>); })}/>
53
+ </PageSection>); })}
54
+ </Stack>
55
+ </PageShell>);
56
+ }
@@ -0,0 +1,140 @@
1
+ # Section index
2
+
3
+ A section of a site, such as the guides, has its own first page that shows the places inside it, so a person can pick one.
4
+
5
+ ## Do
6
+
7
+ - Use `PageHeader` with `level={1}`: the section's name is the one level 1 heading, with a `lede` of one sentence.
8
+ - Put the places in a `Grid columns={3}` for `cards`: three across from the medium breakpoint, one on a phone. Make each a `LinkCard` with a `title` and a `description` of one short line.
9
+ - Write the title as the name of the page it goes to, and the description as what a person finds there, not as a call to action.
10
+ - Keep a card that leaves the site, a `LinkCard` with `external`, in a group of its own, so a person is not sent away by surprise.
11
+ - Group the places under level 2 `SectionIntro`s for `list`, and put the places of each group in a `List`, each a `Link` with `size="subtitle1"` and a `Paragraph` line under it. Put the places a new person needs first.
12
+ - Order the places the way a person does the work, not alphabetically, unless there are more than about twenty.
13
+ - Pass `image` to the `LinkCard` when a place has an image, with alt text that says what it shows, or `alt=""` when the title says it all.
14
+
15
+ ## Don't
16
+
17
+ - Do not put more than about nine cards in a grid. A person cannot compare more, so use `list`.
18
+ - Do not repeat the section name in every title.
19
+ - Do not write a description that repeats its title.
20
+ - Do not make a card out of a place with nothing in it yet. Leave it out until it has a page.
21
+ - Do not wrap a `LinkCard` in a second link or put a Button inside it.
22
+
23
+ ## Option: Cards with a line each
24
+
25
+ Use when: Up to about nine places, each with a short line that says what is there.
26
+
27
+ Uses: `Grid`, `LinkCard`, `PageHeader`, `PageShell`, `Stack`
28
+
29
+ ```tsx
30
+ 'use client';
31
+ import PageShell from 'oneslash-design-system/components/pageShell';
32
+ import PageHeader from 'oneslash-design-system/components/pageHeader';
33
+ import LinkCard from 'oneslash-design-system/components/linkCard';
34
+ import { Grid, Stack } from 'oneslash-design-system/components/layout';
35
+
36
+ // Six places, each with a line that says what is there. A real site lists its own pages.
37
+ const guides = [
38
+ { id: 'start', title: 'Get started', line: 'Name your workspace and add the first people.' },
39
+ { id: 'channels', title: 'Channels', line: 'One place for the talk about each subject.' },
40
+ { id: 'tasks', title: 'Tasks', line: 'Give work an owner and a due date.' },
41
+ { id: 'notes', title: 'Notes', line: 'Write a decision once and find it later.' },
42
+ { id: 'agent', title: 'The agent', line: 'Ask a question and see the sources it used.' },
43
+ { id: 'billing', title: 'Plans and billing', line: 'Change plan and download invoices.' },
44
+ ];
45
+
46
+ export default function SectionIndexCards() {
47
+ return (
48
+ <PageShell>
49
+ <Stack gap="giant">
50
+ <PageHeader level={1} title="Guides" lede="How to do each thing in Acme, one page for each." />
51
+ {/* Three across from md, one on a phone. Every card is one link, named by its title and its line. */}
52
+ <Grid columns={3}>
53
+ {guides.map((g) => (
54
+ <LinkCard key={g.id} href={`#${g.id}`} title={g.title} description={g.line} />
55
+ ))}
56
+ </Grid>
57
+ </Stack>
58
+ </PageShell>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ## Option: A list of links in groups
64
+
65
+ Use when: More places than nine, or names that say enough without a line of their own.
66
+
67
+ Uses: `Link`, `List`, `PageHeader`, `PageSection`, `PageShell`, `Paragraph`, `SectionIntro`, `Stack`
68
+
69
+ ```tsx
70
+ 'use client';
71
+ import PageShell from 'oneslash-design-system/components/pageShell';
72
+ import PageHeader from 'oneslash-design-system/components/pageHeader';
73
+ import SectionIntro from 'oneslash-design-system/components/sectionIntro';
74
+ import Link from 'oneslash-design-system/components/link';
75
+ import List from 'oneslash-design-system/components/list';
76
+ import Paragraph from 'oneslash-design-system/components/paragraph';
77
+ import { PageSection, Stack } from 'oneslash-design-system/components/layout';
78
+
79
+ // Many places, in groups. A real site builds this from its own list of pages.
80
+ const groups = [
81
+ {
82
+ id: 'section-index-start',
83
+ name: 'Start here',
84
+ pages: [
85
+ { id: 'workspace', title: 'Make a workspace', line: 'Name it and choose a plan.' },
86
+ { id: 'invite', title: 'Invite people', line: 'Invite by email and choose what each person can do.' },
87
+ { id: 'tour', title: 'A tour of Acme', line: 'Channels, tasks, notes and the agent in one page.' },
88
+ ],
89
+ },
90
+ {
91
+ id: 'section-index-work',
92
+ name: 'Everyday work',
93
+ pages: [
94
+ { id: 'channels', title: 'Channels', line: 'One place for the talk about each subject.' },
95
+ { id: 'threads', title: 'Threads', line: 'Reply to one message without filling the channel.' },
96
+ { id: 'tasks', title: 'Tasks', line: 'Give work an owner and a due date.' },
97
+ { id: 'notes', title: 'Notes', line: 'Write a decision once and find it later.' },
98
+ { id: 'search', title: 'Search', line: 'Find a message, a note or a file from one box.' },
99
+ ],
100
+ },
101
+ {
102
+ id: 'section-index-admin',
103
+ name: 'Run a workspace',
104
+ pages: [
105
+ { id: 'members', title: 'Members and roles', line: 'Who can read, write and change settings.' },
106
+ { id: 'billing', title: 'Plans and billing', line: 'Change plan and download invoices.' },
107
+ { id: 'export', title: 'Export your notes', line: 'Take a note or a whole workspace as PDF.' },
108
+ { id: 'delete', title: 'Delete a workspace', line: 'What is removed, and what you can get back.' },
109
+ ],
110
+ },
111
+ ];
112
+
113
+ export default function SectionIndexList() {
114
+ return (
115
+ <PageShell>
116
+ <Stack gap="giant">
117
+ <PageHeader level={1} title="Guides" lede="How to do each thing in Acme, one page for each." />
118
+ {groups.map((group) => (
119
+ <PageSection key={group.id} gap="xlarge">
120
+ {/* The group's name is the level 2 heading. Each link has its line under it. */}
121
+ <SectionIntro id={group.id} name={group.name} />
122
+ <List
123
+ items={group.pages.map((p) => (
124
+ <Stack key={p.id} gap="small">
125
+ <Link href={`#${p.id}`} size="subtitle1">{p.title}</Link>
126
+ <Paragraph tone="secondary" size="body2" measure="none">{p.line}</Paragraph>
127
+ </Stack>
128
+ ))}
129
+ />
130
+ </PageSection>
131
+ ))}
132
+ </Stack>
133
+ </PageShell>
134
+ );
135
+ }
136
+ ```
137
+
138
+ ## Native
139
+
140
+ On Apple use a `List` of `NavigationLink` rows with a subtitle, grouped in `Section`s. On Android use a `LazyColumn` of list items with supporting text, or a grid of cards for a few places.
@@ -22,6 +22,7 @@ import Button from '../../components/button';
22
22
  import TabsContainer from '../../components/tabsContainer';
23
23
  import Tab from '../../components/tab';
24
24
  import SettingsSection, { SettingsColumns } from '../../components/settingsSection';
25
+ import { formatMoney } from '../../components/formatNumber';
25
26
  import { Center, Cluster, Stack } from '../../components/layout';
26
27
  // Four areas or fewer, each named with one short word, so the tabs fit on a phone. Each tab is a page of its own in a real app, so it has an `href`.
27
28
  var areas = [
@@ -29,7 +30,7 @@ var areas = [
29
30
  { id: 'notifications', label: 'Notifications' },
30
31
  { id: 'billing', label: 'Billing' },
31
32
  ];
32
- var invoices = ['January 2025, $40.00', 'December 2024, $40.00', 'November 2024, $40.00'];
33
+ var invoices = ["November 2026, ".concat(formatMoney(24)), "October 2026, ".concat(formatMoney(24)), "September 2026, ".concat(formatMoney(24))];
33
34
  export default function SettingsPageTopTabs() {
34
35
  var _a = useState('profile'), area = _a[0], setArea = _a[1];
35
36
  var _b = useState('Dana Lee'), savedName = _b[0], setSavedName = _b[1];
@@ -108,8 +109,8 @@ export default function SettingsPageTopTabs() {
108
109
  </SettingsSection>
109
110
  </SettingsColumns>);
110
111
  var billing = (<SettingsColumns>
111
- <SettingsSection id="settings-page-tabs-plan" title="Plan" description="Team plan, 5 seats.">
112
- <Paragraph size="body2" measure="none">Renews on January 15. Only owners can change the plan.</Paragraph>
112
+ <SettingsSection id="settings-page-tabs-plan" title="Plan" description="Pro plan, 3 members.">
113
+ <Paragraph size="body2" measure="none">Renews on Dec 1, 2026. Only owners can change the plan.</Paragraph>
113
114
  </SettingsSection>
114
115
  <SettingsSection id="settings-page-tabs-invoices" title="Invoices" description="The last three months.">
115
116
  <List items={invoices} size="body2"/>
@@ -28,7 +28,7 @@ A person opens the settings of the product and looks for one area, such as Profi
28
28
 
29
29
  Use when: Four areas or fewer, with short names that fit on a phone.
30
30
 
31
- Uses: `Button`, `Center`, `Cluster`, `Form`, `FormField`, `Heading`, `List`, `Paragraph`, `SettingsColumns`, `SettingsSection`, `Stack`, `Switch`, `Tab`, `TabsContainer`, `TextField`
31
+ Uses: `Button`, `Center`, `Cluster`, `Form`, `FormField`, `Heading`, `List`, `Paragraph`, `SettingsColumns`, `SettingsSection`, `Stack`, `Switch`, `Tab`, `TabsContainer`, `TextField`, `formatMoney`
32
32
 
33
33
  ```tsx
34
34
  'use client';
@@ -44,6 +44,7 @@ import Button from 'oneslash-design-system/components/button';
44
44
  import TabsContainer from 'oneslash-design-system/components/tabsContainer';
45
45
  import Tab from 'oneslash-design-system/components/tab';
46
46
  import SettingsSection, { SettingsColumns } from 'oneslash-design-system/components/settingsSection';
47
+ import { formatMoney } from 'oneslash-design-system/components/formatNumber';
47
48
  import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
48
49
 
49
50
  type Area = 'profile' | 'notifications' | 'billing';
@@ -55,7 +56,7 @@ const areas: { id: Area; label: string }[] = [
55
56
  { id: 'billing', label: 'Billing' },
56
57
  ];
57
58
 
58
- const invoices = ['January 2025, $40.00', 'December 2024, $40.00', 'November 2024, $40.00'];
59
+ const invoices = [`November 2026, ${formatMoney(24)}`, `October 2026, ${formatMoney(24)}`, `September 2026, ${formatMoney(24)}`];
59
60
 
60
61
  export default function SettingsPageTopTabs() {
61
62
  const [area, setArea] = useState<Area>('profile');
@@ -136,8 +137,8 @@ export default function SettingsPageTopTabs() {
136
137
 
137
138
  const billing = (
138
139
  <SettingsColumns>
139
- <SettingsSection id="settings-page-tabs-plan" title="Plan" description="Team plan, 5 seats.">
140
- <Paragraph size="body2" measure="none">Renews on January 15. Only owners can change the plan.</Paragraph>
140
+ <SettingsSection id="settings-page-tabs-plan" title="Plan" description="Pro plan, 3 members.">
141
+ <Paragraph size="body2" measure="none">Renews on Dec 1, 2026. Only owners can change the plan.</Paragraph>
141
142
  </SettingsSection>
142
143
  <SettingsSection id="settings-page-tabs-invoices" title="Invoices" description="The last three months.">
143
144
  <List items={invoices} size="body2" />
@@ -12,7 +12,7 @@ A site's pages name the site at the top and show the person where to go and what
12
12
  - Give a site with sections one `TabsContainer` of `Tab`s with `href`, four sections or fewer and one short word each. Pass it as `nav` to `SiteHeader` with `links` empty: it is a second row of the bar at every width.
13
13
  - Pass search and the theme menu as `phoneAction`, so they stay at the end of the bar on a phone. With no `links` and no `actions` there is no menu.
14
14
  - Keep the section tabs in the bar, so no section is hidden. On a phone, put the pages of the open section in a menu, as the case 'Menu on a phone' shows in 'Sections with their pages'.
15
- - Open the theme menu as the case 'Theme switcher' says, and name the search `IconButton` 'Search'.
15
+ - Open the theme menu as the case 'Theme switcher' says, and open search as the case 'Site search' says.
16
16
 
17
17
  ## Don't
18
18
 
@@ -0,0 +1 @@
1
+ export default function SiteSearchDialog(): import("react").JSX.Element;
@@ -0,0 +1,131 @@
1
+ 'use client';
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ import { useEffect, useRef, useState } from 'react';
25
+ import SiteHeader from '../../components/siteHeader';
26
+ import SearchDialog from '../../components/searchDialog';
27
+ import useHotkey from '../../components/useHotkey';
28
+ import Button from '../../components/button';
29
+ import PageShell from '../../components/pageShell';
30
+ import Heading from '../../components/heading';
31
+ import Paragraph from '../../components/paragraph';
32
+ import { Stack } from '../../components/layout';
33
+ // A real site asks its server, which has every page. These are the pages of a made-up docs site.
34
+ var entries = [
35
+ { id: 'button', group: 'Components', title: 'Button', secondLabel: 'Components', href: '#button', iconName: 'MousePointerClick', text: 'The control that starts an action, in four sizes.' },
36
+ { id: 'tag', group: 'Components', title: 'Tag', secondLabel: 'Components', href: '#tag', iconName: 'Tag', text: 'A short label for a state, such as Paid or Draft.' },
37
+ { id: 'tabs', group: 'Components', title: 'Tabs', secondLabel: 'Components', href: '#tabs', iconName: 'PanelTop', text: 'Switch between views of one thing on one page.' },
38
+ { id: 'table', group: 'Components', title: 'Table', secondLabel: 'Components', href: '#table', iconName: 'Table', text: 'Rows and columns that scroll inside their own region.' },
39
+ { id: 'accordion', group: 'Components', title: 'Accordion', secondLabel: 'Components', href: '#accordion', iconName: 'ChevronsUpDown', text: 'Headings that open a panel under them.' },
40
+ { id: 'faq', group: 'Cases', title: 'FAQ', secondLabel: 'Cases', href: '#faq', iconName: 'CircleHelp', text: 'Answer the questions a visitor asks before signing up.' },
41
+ { id: 'pricing', group: 'Cases', title: 'Pricing section', secondLabel: 'Cases', href: '#pricing', iconName: 'CreditCard', text: 'Show the plans side by side with one price each.' },
42
+ { id: 'login', group: 'Cases', title: 'Login page', secondLabel: 'Cases', href: '#login', iconName: 'LogIn', text: 'Let a person log in with an email or a provider.' },
43
+ { id: 'tabbed', group: 'Cases', title: 'Tabbed panels', secondLabel: 'Cases', href: '#tabbed', iconName: 'PanelTop', text: 'Four views of one thing, and a visitor reads one.' },
44
+ ];
45
+ var SEARCH_MS = 300;
46
+ // A stand-in for the request. A real site calls its server here and may fail.
47
+ function searchPages(query, keep) {
48
+ return new Promise(function (resolve) {
49
+ keep(setTimeout(function () {
50
+ var words = query.toLowerCase().split(/\s+/).filter(Boolean);
51
+ var found = entries.filter(function (e) { return words.every(function (w) { return "".concat(e.title, " ").concat(e.text).toLowerCase().includes(w); }); });
52
+ var groups = ['Components', 'Cases']
53
+ .map(function (label) { return ({ label: label, items: found.filter(function (e) { return e.group === label; }).map(function (_a) {
54
+ var group = _a.group, text = _a.text, item = __rest(_a, ["group", "text"]);
55
+ return (__assign(__assign({}, item), { excerpt: text }));
56
+ }) }); })
57
+ .filter(function (g) { return g.items.length > 0; });
58
+ resolve(groups);
59
+ }, SEARCH_MS));
60
+ });
61
+ }
62
+ // Visited pages, most recent first. A real site keeps them for the person.
63
+ var recent = entries.slice(0, 3).map(function (_a) {
64
+ var group = _a.group, text = _a.text, item = __rest(_a, ["group", "text"]);
65
+ return item;
66
+ });
67
+ export default function SiteSearchDialog() {
68
+ var _a = useState(false), open = _a[0], setOpen = _a[1];
69
+ var _b = useState(''), query = _b[0], setQuery = _b[1];
70
+ var _c = useState([]), groups = _c[0], setGroups = _c[1];
71
+ var _d = useState('idle'), status = _d[0], setStatus = _d[1];
72
+ // Each request has a number; only the newest one may answer.
73
+ var latest = useRef(0);
74
+ var timer = useRef();
75
+ useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
76
+ function run(next) {
77
+ var id = ++latest.current;
78
+ if (next.trim() === '') {
79
+ setStatus('idle');
80
+ setGroups([]);
81
+ return;
82
+ }
83
+ setStatus('loading');
84
+ // An older request's timer is cleared, so only one is ever pending and unmount clears it
85
+ searchPages(next, function (t) {
86
+ clearTimeout(timer.current);
87
+ timer.current = t;
88
+ })
89
+ .then(function (found) {
90
+ // A reply for an older query is dropped
91
+ if (id !== latest.current)
92
+ return;
93
+ setGroups(found);
94
+ setStatus('done');
95
+ })
96
+ .catch(function () {
97
+ if (id !== latest.current)
98
+ return;
99
+ setStatus('error');
100
+ });
101
+ }
102
+ function change(next) {
103
+ setQuery(next);
104
+ run(next);
105
+ }
106
+ function show() {
107
+ setQuery('');
108
+ run('');
109
+ setOpen(true);
110
+ }
111
+ // Cmd+K, or Ctrl+K on Windows, from anywhere on the page except a text field
112
+ useHotkey('k', function () {
113
+ if (!open)
114
+ show();
115
+ });
116
+ return (<>
117
+ {/* The Search Button is the main action of the bar, so it stays beside the brand at every width. */}
118
+ <SiteHeader brand={{ href: '#top', name: 'Acme' }} links={[
119
+ { label: 'Guides', href: '#guides' },
120
+ { label: 'Components', href: '#components', current: true },
121
+ { label: 'Cases', href: '#cases' },
122
+ ]} phoneAction={<Button size="medium" type="secondary" state="enabled" label="Search" decoIcon="Search" aria-haspopup="dialog" aria-keyshortcuts="Meta+K Control+K" onClickButton={show}/>} mainId="site-search-main"/>
123
+ <PageShell id="site-search-main" tabIndex={-1}>
124
+ <Stack gap="large">
125
+ <Heading level={1} size="h5">Components</Heading>
126
+ <Paragraph tone="secondary" measure="none">Press Cmd+K, or Ctrl+K on Windows, to search every page.</Paragraph>
127
+ </Stack>
128
+ </PageShell>
129
+ <SearchDialog isOpen={open} onClose={function () { return setOpen(false); }} query={query} onQueryChange={change} groups={groups} status={status} onRetry={function () { return run(query); }} recent={recent} placeholder="Search components and cases"/>
130
+ </>);
131
+ }