oneslash-design-system 2.17.0 → 2.19.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 (282) hide show
  1. package/README.md +2 -2
  2. package/dist/DESIGN.md +55 -14
  3. package/dist/cases/accept-invite.md +1 -5
  4. package/dist/cases/account-menu/menu.d.ts +1 -0
  5. package/dist/cases/account-menu/menu.jsx +99 -0
  6. package/dist/cases/account-menu.md +164 -0
  7. package/dist/cases/agent-asks-before-risky-action.md +0 -4
  8. package/dist/cases/agent-cancels-when-unanswered.md +0 -4
  9. package/dist/cases/agent-options.md +0 -4
  10. package/dist/cases/agent-pending-reply.md +0 -4
  11. package/dist/cases/agent-plan-proposal.md +0 -4
  12. package/dist/cases/agent-question.md +0 -4
  13. package/dist/cases/agent-refuses-clearly.md +0 -4
  14. package/dist/cases/agent-says-what-it-is.md +0 -2
  15. package/dist/cases/agent-settings/form.d.ts +1 -0
  16. package/dist/cases/agent-settings/form.jsx +164 -0
  17. package/dist/cases/agent-settings.md +259 -0
  18. package/dist/cases/agent-shows-progress.md +0 -2
  19. package/dist/cases/agent-shows-sources.md +0 -2
  20. package/dist/cases/api-keys/list.d.ts +1 -0
  21. package/dist/cases/api-keys/list.jsx +162 -0
  22. package/dist/cases/api-keys.md +229 -0
  23. package/dist/cases/app-shell/sidebar.d.ts +1 -0
  24. package/dist/cases/app-shell/sidebar.jsx +124 -0
  25. package/dist/cases/app-shell/top-tabs.d.ts +1 -0
  26. package/dist/cases/app-shell/top-tabs.jsx +106 -0
  27. package/dist/cases/app-shell.md +364 -0
  28. package/dist/cases/artifact-card/card.jsx +32 -6
  29. package/dist/cases/artifact-card.md +55 -11
  30. package/dist/cases/auth-gate-loading.md +0 -4
  31. package/dist/cases/check-your-email.md +0 -4
  32. package/dist/cases/collapsible-search/popover.d.ts +1 -0
  33. package/dist/cases/collapsible-search/popover.jsx +74 -0
  34. package/dist/cases/collapsible-search.md +143 -0
  35. package/dist/cases/composer-limit.md +0 -4
  36. package/dist/cases/confirm-destructive-action.md +0 -4
  37. package/dist/cases/confirm-dialogs.md +0 -4
  38. package/dist/cases/conversation-starters.md +0 -4
  39. package/dist/cases/create-modal.md +0 -4
  40. package/dist/cases/danger-zone/collapsed.d.ts +1 -0
  41. package/dist/cases/danger-zone/collapsed.jsx +75 -0
  42. package/dist/cases/danger-zone/shown.d.ts +1 -0
  43. package/dist/cases/danger-zone/shown.jsx +95 -0
  44. package/dist/cases/danger-zone.md +263 -0
  45. package/dist/cases/device-login.md +0 -4
  46. package/dist/cases/email-confirmed.md +0 -4
  47. package/dist/cases/empty-list.md +0 -4
  48. package/dist/cases/empty-lists.md +0 -4
  49. package/dist/cases/empty-not-set-up.md +0 -4
  50. package/dist/cases/empty-search.md +0 -4
  51. package/dist/cases/error-page/in-shell.jsx +26 -17
  52. package/dist/cases/error-page.md +42 -25
  53. package/dist/cases/feedback-form.md +0 -4
  54. package/dist/cases/filter-menu/presets.d.ts +1 -0
  55. package/dist/cases/filter-menu/presets.jsx +53 -0
  56. package/dist/cases/filter-menu/with-clear.d.ts +1 -0
  57. package/dist/cases/filter-menu/with-clear.jsx +56 -0
  58. package/dist/cases/filter-menu.md +204 -0
  59. package/dist/cases/forgot-password.md +0 -4
  60. package/dist/cases/form-errors.md +0 -4
  61. package/dist/cases/import-checklist.md +0 -4
  62. package/dist/cases/inline-form-feedback.md +0 -4
  63. package/dist/cases/integrations-list/nested.d.ts +1 -0
  64. package/dist/cases/integrations-list/nested.jsx +164 -0
  65. package/dist/cases/integrations-list/rows.d.ts +1 -0
  66. package/dist/cases/integrations-list/rows.jsx +134 -0
  67. package/dist/cases/integrations-list.md +379 -0
  68. package/dist/cases/invite-member.md +0 -4
  69. package/dist/cases/load-failure.md +0 -4
  70. package/dist/cases/log-out-confirm.md +0 -4
  71. package/dist/cases/login-page.md +0 -4
  72. package/dist/cases/master-detail/list-then-page.d.ts +1 -0
  73. package/dist/cases/master-detail/list-then-page.jsx +65 -0
  74. package/dist/cases/master-detail/split.d.ts +1 -0
  75. package/dist/cases/master-detail/split.jsx +49 -0
  76. package/dist/cases/master-detail.md +213 -0
  77. package/dist/cases/members-list/rows.d.ts +1 -0
  78. package/dist/cases/members-list/rows.jsx +318 -0
  79. package/dist/cases/members-list/table.d.ts +1 -0
  80. package/dist/cases/members-list/table.jsx +351 -0
  81. package/dist/cases/members-list.md +799 -0
  82. package/dist/cases/mention-list.md +0 -4
  83. package/dist/cases/message-actions.md +0 -4
  84. package/dist/cases/message-attachments.md +0 -4
  85. package/dist/cases/message-composer.md +0 -4
  86. package/dist/cases/message-edit.md +0 -4
  87. package/dist/cases/message-reactions.md +0 -4
  88. package/dist/cases/message-row.md +0 -4
  89. package/dist/cases/mobile-menu/links.d.ts +1 -0
  90. package/dist/cases/mobile-menu/links.jsx +24 -0
  91. package/dist/cases/mobile-menu/sections.d.ts +1 -0
  92. package/dist/cases/mobile-menu/sections.jsx +61 -0
  93. package/dist/cases/mobile-menu.md +170 -0
  94. package/dist/cases/not-found-page/in-shell.jsx +26 -17
  95. package/dist/cases/not-found-page.md +41 -24
  96. package/dist/cases/notification-menu/menu.d.ts +1 -0
  97. package/dist/cases/notification-menu/menu.jsx +74 -0
  98. package/dist/cases/notification-menu.md +135 -0
  99. package/dist/cases/oauth-consent.md +0 -4
  100. package/dist/cases/on-off-settings/list.d.ts +1 -0
  101. package/dist/cases/on-off-settings/list.jsx +97 -0
  102. package/dist/cases/on-off-settings.md +116 -0
  103. package/dist/cases/on-this-page/aside.d.ts +1 -0
  104. package/dist/cases/on-this-page/aside.jsx +39 -0
  105. package/dist/cases/on-this-page.md +80 -0
  106. package/dist/cases/overflow-menu/in-a-header.d.ts +1 -0
  107. package/dist/cases/overflow-menu/in-a-header.jsx +128 -0
  108. package/dist/cases/overflow-menu/on-a-row.d.ts +1 -0
  109. package/dist/cases/overflow-menu/on-a-row.jsx +183 -0
  110. package/dist/cases/overflow-menu.md +410 -0
  111. package/dist/cases/page-header/actions.d.ts +1 -0
  112. package/dist/cases/page-header/actions.jsx +65 -0
  113. package/dist/cases/page-header/sub-page.d.ts +1 -0
  114. package/dist/cases/page-header/sub-page.jsx +37 -0
  115. package/dist/cases/page-header.md +195 -0
  116. package/dist/cases/phone-navigation.md +32 -0
  117. package/dist/cases/profile-form/form.d.ts +1 -0
  118. package/dist/cases/profile-form/form.jsx +153 -0
  119. package/dist/cases/profile-form.md +236 -0
  120. package/dist/cases/quick-switcher/modal.d.ts +1 -0
  121. package/dist/cases/quick-switcher/modal.jsx +114 -0
  122. package/dist/cases/quick-switcher.md +205 -0
  123. package/dist/cases/range-switch/segmented.d.ts +1 -0
  124. package/dist/cases/range-switch/segmented.jsx +30 -0
  125. package/dist/cases/range-switch.md +67 -0
  126. package/dist/cases/rename.md +0 -4
  127. package/dist/cases/reply-feedback.md +0 -4
  128. package/dist/cases/reply-sources.md +0 -4
  129. package/dist/cases/route-loading/region.jsx +27 -18
  130. package/dist/cases/route-loading.md +42 -23
  131. package/dist/cases/scope-picker/menu.d.ts +1 -0
  132. package/dist/cases/scope-picker/menu.jsx +47 -0
  133. package/dist/cases/scope-picker.md +97 -0
  134. package/dist/cases/set-new-password.md +0 -4
  135. package/dist/cases/settings-page/side-nav.d.ts +1 -0
  136. package/dist/cases/settings-page/side-nav.jsx +171 -0
  137. package/dist/cases/settings-page/top-tabs.d.ts +1 -0
  138. package/dist/cases/settings-page/top-tabs.jsx +129 -0
  139. package/dist/cases/settings-page.md +378 -0
  140. package/dist/cases/settings-save.md +35 -0
  141. package/dist/cases/side-pane/beside.d.ts +1 -0
  142. package/dist/cases/side-pane/beside.jsx +79 -0
  143. package/dist/cases/side-pane/over.d.ts +1 -0
  144. package/dist/cases/side-pane/over.jsx +58 -0
  145. package/dist/cases/side-pane.md +238 -0
  146. package/dist/cases/sidebar-nav/flat.d.ts +1 -0
  147. package/dist/cases/sidebar-nav/flat.jsx +81 -0
  148. package/dist/cases/sidebar-nav/nested.d.ts +1 -0
  149. package/dist/cases/sidebar-nav/nested.jsx +122 -0
  150. package/dist/cases/sidebar-nav.md +261 -0
  151. package/dist/cases/sign-up-page.md +1 -5
  152. package/dist/cases/site-footer/columns.d.ts +1 -0
  153. package/dist/cases/site-footer/columns.jsx +51 -0
  154. package/dist/cases/site-footer/simple.d.ts +1 -0
  155. package/dist/cases/site-footer/simple.jsx +24 -0
  156. package/dist/cases/site-footer.md +133 -0
  157. package/dist/cases/site-header/links.d.ts +1 -0
  158. package/dist/cases/site-header/links.jsx +26 -0
  159. package/dist/cases/site-header/sections.d.ts +1 -0
  160. package/dist/cases/site-header/sections.jsx +64 -0
  161. package/dist/cases/site-header.md +183 -0
  162. package/dist/cases/slash-command-list.md +0 -4
  163. package/dist/cases/success-feedback.md +0 -4
  164. package/dist/cases/tag-filter/tags.d.ts +1 -0
  165. package/dist/cases/tag-filter/tags.jsx +226 -0
  166. package/dist/cases/tag-filter.md +298 -0
  167. package/dist/cases/theme-switcher/menu.d.ts +1 -0
  168. package/dist/cases/theme-switcher/menu.jsx +47 -0
  169. package/dist/cases/theme-switcher/segmented.d.ts +1 -0
  170. package/dist/cases/theme-switcher/segmented.jsx +26 -0
  171. package/dist/cases/theme-switcher.md +149 -0
  172. package/dist/cases/type-to-confirm.md +0 -4
  173. package/dist/cases/typing-and-status.md +0 -4
  174. package/dist/cases/unsaved-changes-guard.md +0 -4
  175. package/dist/cases/upgrade-prompt.md +0 -4
  176. package/dist/cases.json +1737 -315
  177. package/dist/components/alert.d.ts +3 -1
  178. package/dist/components/alert.jsx +2 -2
  179. package/dist/components/appShell.d.ts +44 -0
  180. package/dist/components/appShell.jsx +121 -0
  181. package/dist/components/button.jsx +5 -2
  182. package/dist/components/checkBox.d.ts +5 -1
  183. package/dist/components/checkBox.jsx +2 -2
  184. package/dist/components/copyField.d.ts +20 -0
  185. package/dist/components/copyField.jsx +99 -0
  186. package/dist/components/drawer.d.ts +31 -0
  187. package/dist/components/drawer.jsx +121 -0
  188. package/dist/components/formField.d.ts +34 -0
  189. package/dist/components/formField.jsx +28 -0
  190. package/dist/components/heading.d.ts +5 -1
  191. package/dist/components/heading.jsx +2 -2
  192. package/dist/components/link.d.ts +6 -1
  193. package/dist/components/link.jsx +11 -3
  194. package/dist/components/menu.jsx +2 -2
  195. package/dist/components/menuItem.d.ts +10 -2
  196. package/dist/components/menuItem.jsx +4 -3
  197. package/dist/components/modal.jsx +12 -23
  198. package/dist/components/navigation.d.ts +9 -1
  199. package/dist/components/navigation.jsx +15 -3
  200. package/dist/components/onThisPage.d.ts +29 -0
  201. package/dist/components/onThisPage.jsx +151 -0
  202. package/dist/components/pageShell.d.ts +7 -1
  203. package/dist/components/pageShell.jsx +14 -1
  204. package/dist/components/popover.jsx +4 -0
  205. package/dist/components/radioGroup.d.ts +5 -1
  206. package/dist/components/radioGroup.jsx +2 -2
  207. package/dist/components/segmentedControl.d.ts +22 -0
  208. package/dist/components/segmentedControl.jsx +54 -0
  209. package/dist/components/select.d.ts +5 -1
  210. package/dist/components/select.jsx +2 -2
  211. package/dist/components/settingsSection.d.ts +36 -0
  212. package/dist/components/settingsSection.jsx +65 -0
  213. package/dist/components/sidePane.d.ts +32 -0
  214. package/dist/components/sidePane.jsx +128 -0
  215. package/dist/components/siteFooter.d.ts +24 -0
  216. package/dist/components/siteFooter.jsx +48 -0
  217. package/dist/components/siteHeader.d.ts +55 -0
  218. package/dist/components/siteHeader.jsx +125 -0
  219. package/dist/components/slidingIndicator.d.ts +50 -0
  220. package/dist/components/slidingIndicator.jsx +102 -0
  221. package/dist/components/switch.d.ts +25 -0
  222. package/dist/components/switch.jsx +55 -0
  223. package/dist/components/tab.jsx +5 -11
  224. package/dist/components/tabsContainer.jsx +5 -67
  225. package/dist/components/textField.d.ts +12 -2
  226. package/dist/components/textField.jsx +11 -4
  227. package/dist/components/textarea.d.ts +5 -1
  228. package/dist/components/textarea.jsx +3 -3
  229. package/dist/components/titleBar.d.ts +17 -0
  230. package/dist/components/titleBar.jsx +17 -0
  231. package/dist/components/useHotkey.d.ts +7 -0
  232. package/dist/components/useHotkey.js +24 -0
  233. package/dist/index.d.ts +13 -0
  234. package/dist/index.js +13 -0
  235. package/dist/internal/copyField.d.ts +5 -0
  236. package/dist/internal/copyField.js +61 -0
  237. package/dist/internal/hotkey.d.ts +16 -0
  238. package/dist/internal/hotkey.js +20 -0
  239. package/dist/internal/overlayStack.d.ts +24 -0
  240. package/dist/internal/overlayStack.js +71 -0
  241. package/dist/internal/resize.d.ts +9 -0
  242. package/dist/internal/resize.js +31 -0
  243. package/dist/internal/scrollSpy.d.ts +24 -0
  244. package/dist/internal/scrollSpy.js +53 -0
  245. package/dist/internal/siteBrand.d.ts +6 -0
  246. package/dist/internal/siteBrand.jsx +11 -0
  247. package/dist/internal/switch.d.ts +5 -0
  248. package/dist/internal/switch.js +9 -0
  249. package/dist/native-mapping.json +72 -0
  250. package/dist/stories/AppShell.stories.d.ts +15 -0
  251. package/dist/stories/AppShell.stories.jsx +137 -0
  252. package/dist/stories/Cases.generated.stories.d.ts +42 -0
  253. package/dist/stories/Cases.generated.stories.jsx +84 -0
  254. package/dist/stories/CopyField.stories.d.ts +11 -0
  255. package/dist/stories/CopyField.stories.jsx +65 -0
  256. package/dist/stories/Drawer.stories.d.ts +10 -0
  257. package/dist/stories/Drawer.stories.jsx +123 -0
  258. package/dist/stories/FormField.stories.d.ts +6 -0
  259. package/dist/stories/FormField.stories.jsx +44 -0
  260. package/dist/stories/Link.stories.d.ts +1 -0
  261. package/dist/stories/Link.stories.jsx +8 -0
  262. package/dist/stories/Navigation.stories.d.ts +1 -0
  263. package/dist/stories/Navigation.stories.jsx +17 -1
  264. package/dist/stories/OnThisPage.stories.d.ts +10 -0
  265. package/dist/stories/OnThisPage.stories.jsx +105 -0
  266. package/dist/stories/SegmentedControl.stories.d.ts +8 -0
  267. package/dist/stories/SegmentedControl.stories.jsx +33 -0
  268. package/dist/stories/SettingsSection.stories.d.ts +12 -0
  269. package/dist/stories/SettingsSection.stories.jsx +91 -0
  270. package/dist/stories/SidePane.stories.d.ts +6 -0
  271. package/dist/stories/SidePane.stories.jsx +37 -0
  272. package/dist/stories/SiteFooter.stories.d.ts +7 -0
  273. package/dist/stories/SiteFooter.stories.jsx +63 -0
  274. package/dist/stories/SiteHeader.stories.d.ts +10 -0
  275. package/dist/stories/SiteHeader.stories.jsx +94 -0
  276. package/dist/stories/Switch.stories.d.ts +14 -0
  277. package/dist/stories/Switch.stories.jsx +87 -0
  278. package/dist/stories/TextField.stories.d.ts +1 -0
  279. package/dist/stories/TextField.stories.jsx +13 -0
  280. package/dist/stories/TitleBar.stories.d.ts +6 -0
  281. package/dist/stories/TitleBar.stories.jsx +34 -0
  282. package/package.json +5 -1
@@ -0,0 +1,261 @@
1
+ # Sidebar with sections and counts
2
+
3
+ A person looks down the sidebar for a place, and for what has something new in it.
4
+
5
+ ## Do
6
+
7
+ - Follow the rule 'On a phone, a sidebar opens as a drawer and a list opens its detail'.
8
+ - Build it as a `Navigation` with `aria-label="Main"`, and put the places in `NavigationGroup`s with a short `label`, such as 'Mail' and 'Tasks'.
9
+ - Make each place a `MenuItem` with an `href`. Mark the open one with `isSelected` and `aria-current="page"`.
10
+ - Show the count of what has not been read, never a total, as a `tag` with `variant="textOnly"`.
11
+ - Put the count in the row's name too: `aria-label="Inbox, 3 unread"`. Start the name with the visible label.
12
+ - Show nothing at zero. Opening a place reads it, so its count goes away.
13
+ - Put 'New Task' at the top of its group, as a `MenuItem` with `role="button"`. The new task opens at the top of the group.
14
+ - Make the row that holds the others a `MenuItem` with `role="button"`, `aria-expanded` and a chevron in `iconRight`. Name it for the place: 'Acme'.
15
+ - Keep a place the person closed closed when they return. Save it for the person, such as in local storage or their profile.
16
+ - Show the sum of what is unread under a closed place on its own row, so nothing unread is out of sight.
17
+ - Show a place inside another with `level={2}` on its `MenuItem`, and keep its own icon.
18
+ - Give each 'New Task' a name that says where it goes: `aria-label="New task in Acme"`. In a phone menu, close the menu in its `onClick`, since a button row does not close it.
19
+
20
+ ## Don't
21
+
22
+ - Do not show a total of everything, such as every task. A count is what needs the person.
23
+ - Do not show '0'. Leave the count out.
24
+ - Do not color a count red, even for a mention. A count is quiet text.
25
+ - Do not close a place with no sign of what is inside it. A closed place keeps its count.
26
+ - Do not close a place without `aria-expanded` on its row.
27
+
28
+ ## Option: One list in a few groups
29
+
30
+ Use when: Each place is one row, and the places fall into a few groups.
31
+
32
+ Uses: `Center`, `MenuItem`, `Navigation`, `NavigationGroup`, `Paragraph`, `Stack`
33
+
34
+ ```tsx
35
+ 'use client';
36
+ import { useState } from 'react';
37
+ import Navigation, { NavigationGroup } from 'oneslash-design-system/components/navigation';
38
+ import MenuItem from 'oneslash-design-system/components/menuItem';
39
+ import Paragraph from 'oneslash-design-system/components/paragraph';
40
+ import { Center, Stack } from 'oneslash-design-system/components/layout';
41
+
42
+ type Place = { id: string; label: string; icon: string; group: string };
43
+
44
+ const initialPlaces: Place[] = [
45
+ { id: 'inbox', label: 'Inbox', icon: 'Inbox', group: 'Mail' },
46
+ { id: 'mentions', label: 'Mentions', icon: 'AtSign', group: 'Mail' },
47
+ { id: 'sent', label: 'Sent', icon: 'Send', group: 'Mail' },
48
+ { id: 'launch', label: 'Launch plan', icon: 'ListChecks', group: 'Tasks' },
49
+ { id: 'review', label: 'Design review', icon: 'ListChecks', group: 'Tasks' },
50
+ { id: 'pricing', label: 'Pricing page', icon: 'ListChecks', group: 'Tasks' },
51
+ ];
52
+
53
+ const groups = ['Mail', 'Tasks'];
54
+
55
+ // What has not been read, by place. A place with none has no entry, and shows no count.
56
+ const initialUnread: Record<string, number> = { inbox: 3, mentions: 1, launch: 2 };
57
+
58
+ export default function SidebarNavFlat() {
59
+ const [places, setPlaces] = useState(initialPlaces);
60
+ const [currentId, setCurrentId] = useState('sent');
61
+ const [unread, setUnread] = useState(initialUnread);
62
+ const [created, setCreated] = useState(0);
63
+
64
+ const current = places.find((p) => p.id === currentId) ?? places[0];
65
+
66
+ // Opening a place reads it, so its count goes away.
67
+ function open(id: string) {
68
+ setCurrentId(id);
69
+ setUnread((u) => ({ ...u, [id]: 0 }));
70
+ }
71
+
72
+ // The new task goes to the top of its group, and opens.
73
+ function newTask() {
74
+ const id = `new-${created + 1}`;
75
+ setCreated(created + 1);
76
+ setPlaces((all) => [{ id, label: `New task ${created + 1}`, icon: 'ListChecks', group: 'Tasks' }, ...all]);
77
+ setCurrentId(id);
78
+ }
79
+
80
+ return (
81
+ <Center>
82
+ <Stack gap="large">
83
+ <Navigation aria-label="Main">
84
+ {groups.map((group) => (
85
+ <NavigationGroup key={group} label={group}>
86
+ {group === 'Tasks' && <MenuItem size="small" iconName="Plus" label="New Task" role="button" onClick={newTask} />}
87
+ {places.filter((p) => p.group === group).map((p) => {
88
+ const count = unread[p.id] ?? 0;
89
+ return (
90
+ <MenuItem
91
+ key={p.id}
92
+ size="small"
93
+ label={p.label}
94
+ iconName={p.icon}
95
+ href={`/${p.id}`}
96
+ isSelected={p.id === current.id}
97
+ aria-current={p.id === current.id ? 'page' : undefined}
98
+ // A count is what has not been read, as quiet text. Nothing shows at zero, and the name says the count.
99
+ tag={count > 0 ? { label: String(count), variant: 'textOnly' } : undefined}
100
+ aria-label={count > 0 ? `${p.label}, ${count} unread` : undefined}
101
+ onClick={(event: { preventDefault: () => void }) => {
102
+ // A real app lets the link go to its page. The example keeps the choice in state.
103
+ event.preventDefault();
104
+ open(p.id);
105
+ }}
106
+ />
107
+ );
108
+ })}
109
+ </NavigationGroup>
110
+ ))}
111
+ </Navigation>
112
+ <Paragraph tone="secondary" size="body2" measure="none">You are in {current.label}.</Paragraph>
113
+ </Stack>
114
+ </Center>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ## Option: Places that hold places
120
+
121
+ Use when: A place holds others, such as a workspace and its tasks, and the person wants to hide what they do not use.
122
+
123
+ Uses: `Center`, `MenuItem`, `Navigation`, `NavigationGroup`, `Paragraph`, `Stack`
124
+
125
+ ```tsx
126
+ 'use client';
127
+ import { useEffect, useState } from 'react';
128
+ import Navigation, { NavigationGroup } from 'oneslash-design-system/components/navigation';
129
+ import MenuItem from 'oneslash-design-system/components/menuItem';
130
+ import Paragraph from 'oneslash-design-system/components/paragraph';
131
+ import { Center, Stack } from 'oneslash-design-system/components/layout';
132
+
133
+ type Task = { id: string; label: string };
134
+ type Workspace = { id: string; name: string; tasks: Task[] };
135
+
136
+ const initialWorkspaces: Workspace[] = [
137
+ {
138
+ id: 'acme',
139
+ name: 'Acme',
140
+ tasks: [
141
+ { id: 'launch', label: 'Launch plan' },
142
+ { id: 'pricing', label: 'Pricing page' },
143
+ ],
144
+ },
145
+ {
146
+ id: 'studio',
147
+ name: 'Side Studio',
148
+ tasks: [
149
+ { id: 'logo', label: 'New logo' },
150
+ { id: 'site', label: 'Landing page' },
151
+ ],
152
+ },
153
+ ];
154
+
155
+ // What has not been read, by place. A place with none has no entry, and shows no count.
156
+ const initialUnread: Record<string, number> = { pricing: 2, site: 1 };
157
+
158
+ const STORAGE_KEY = 'sidebar-nav-hidden-groups';
159
+
160
+ export default function SidebarNavNested() {
161
+ const [workspaces, setWorkspaces] = useState(initialWorkspaces);
162
+ const [currentId, setCurrentId] = useState('launch');
163
+ const [unread, setUnread] = useState(initialUnread);
164
+ const [created, setCreated] = useState(0);
165
+ // The groups the person hid. They stay hidden when the person comes back, so a real app saves them per person.
166
+ const [hiddenGroups, setHiddenGroups] = useState<string[]>([]);
167
+
168
+ // Read after the first render, so the server and the browser start from the same page.
169
+ useEffect(() => {
170
+ try {
171
+ const saved = JSON.parse(localStorage.getItem(STORAGE_KEY) ?? '[]');
172
+ if (Array.isArray(saved)) setHiddenGroups(saved.filter((id) => typeof id === 'string'));
173
+ } catch {
174
+ // Storage can be blocked. The groups then start shown.
175
+ }
176
+ }, []);
177
+
178
+ function toggleGroup(id: string) {
179
+ const next = hiddenGroups.includes(id) ? hiddenGroups.filter((g) => g !== id) : [...hiddenGroups, id];
180
+ setHiddenGroups(next);
181
+ try {
182
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
183
+ } catch {
184
+ // Storage can be blocked. The choice then lasts until the page closes.
185
+ }
186
+ }
187
+
188
+ function open(id: string) {
189
+ setCurrentId(id);
190
+ setUnread((u) => ({ ...u, [id]: 0 }));
191
+ }
192
+
193
+ // The new task goes to the top of its group, and opens.
194
+ function newTask(workspaceId: string) {
195
+ const id = `new-${created + 1}`;
196
+ setCreated(created + 1);
197
+ setWorkspaces((all) => all.map((w) => (w.id === workspaceId ? { ...w, tasks: [{ id, label: `New task ${created + 1}` }, ...w.tasks] } : w)));
198
+ setCurrentId(id);
199
+ }
200
+
201
+ const currentName = workspaces.flatMap((w) => w.tasks).find((t) => t.id === currentId)?.label ?? '';
202
+
203
+ return (
204
+ <Center>
205
+ <Stack gap="large">
206
+ <Navigation aria-label="Main">
207
+ <NavigationGroup label="Workspaces">
208
+ {workspaces.map((w) => {
209
+ const hidden = hiddenGroups.includes(w.id);
210
+ // A closed place keeps its count, on its own row, so nothing unread is out of sight.
211
+ const hiddenUnread = hidden ? w.tasks.reduce((sum, t) => sum + (unread[t.id] ?? 0), 0) : 0;
212
+ return (
213
+ <Stack key={w.id} gap="small">
214
+ {/* The row that holds the others shows or hides them. It keeps its name; aria-expanded says which. */}
215
+ <MenuItem
216
+ size="small"
217
+ label={w.name}
218
+ iconName="Building2"
219
+ iconRight={hidden ? 'ChevronRight' : 'ChevronDown'}
220
+ role="button"
221
+ aria-expanded={!hidden}
222
+ // A closed place keeps its count here, and the name says it.
223
+ tag={hiddenUnread > 0 ? { label: String(hiddenUnread), variant: 'textOnly' } : undefined}
224
+ aria-label={hiddenUnread > 0 ? `${w.name}, ${hiddenUnread} unread` : undefined}
225
+ onClick={() => toggleGroup(w.id)}
226
+ />
227
+ {/* Each workspace has its own New Task, so its name says which. In a phone menu, close the menu in this onClick. */}
228
+ {!hidden && <MenuItem size="small" level={2} iconName="Plus" label="New Task" aria-label={`New task in ${w.name}`} role="button" onClick={() => newTask(w.id)} />}
229
+ {!hidden && w.tasks.map((t) => (
230
+ <MenuItem
231
+ key={t.id}
232
+ size="small"
233
+ label={t.label}
234
+ level={2}
235
+ iconName="ListChecks"
236
+ href={`/${w.id}/${t.id}`}
237
+ isSelected={t.id === currentId}
238
+ aria-current={t.id === currentId ? 'page' : undefined}
239
+ tag={(unread[t.id] ?? 0) > 0 ? { label: String(unread[t.id]), variant: 'textOnly' } : undefined}
240
+ aria-label={(unread[t.id] ?? 0) > 0 ? `${t.label}, ${unread[t.id]} unread` : undefined}
241
+ onClick={(event: { preventDefault: () => void }) => {
242
+ event.preventDefault();
243
+ open(t.id);
244
+ }}
245
+ />
246
+ ))}
247
+ </Stack>
248
+ );
249
+ })}
250
+ </NavigationGroup>
251
+ </Navigation>
252
+ <Paragraph tone="secondary" size="body2" measure="none">You are in {currentName}.</Paragraph>
253
+ </Stack>
254
+ </Center>
255
+ );
256
+ }
257
+ ```
258
+
259
+ ## Native
260
+
261
+ On Apple use a sidebar `List` with `Section`s, a `.badge(count)` on each row, and a `DisclosureGroup` for places that hold places. On Android use a navigation drawer with a `Badge`.
@@ -2,8 +2,6 @@
2
2
 
3
3
  A person who has no account yet opens the product and wants one.
4
4
 
5
- **Not built yet:** Commentify and Scindo on the web replace the form with a spinner while creating the account. Neither says a password rule on its sign-up page. Their reset pages accept 6 characters and say 'Password must be at least 6 characters.' only after it is broken. Commentify asks for the first and last name in two fields.
6
-
7
5
  ## Do
8
6
 
9
7
  - Ask only for what the account needs: name, email and password.
@@ -473,6 +471,4 @@ export default function SignUpProviderFirst() {
473
471
 
474
472
  ## Native
475
473
 
476
- On Apple, Scindo opens the web sign-up page with a `Link`. A sign-up built in the app uses `SignInWithAppleButton` for Apple, a grouped form for the fields, and system buttons.
477
-
478
- Seen in: Commentify, Scindo.
474
+ On Apple, the app opens the web sign-up page with a `Link`. A sign-up built in the app uses `SignInWithAppleButton` for Apple, a grouped form for the fields, and system buttons.
@@ -0,0 +1 @@
1
+ export default function SiteFooterColumns(): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import SiteFooter from '../../components/siteFooter';
3
+ import Heading from '../../components/heading';
4
+ import Paragraph from '../../components/paragraph';
5
+ import { Center, Stack } from '../../components/layout';
6
+ var columns = [
7
+ {
8
+ title: 'Product',
9
+ links: [
10
+ { label: 'Features', href: '#features' },
11
+ { label: 'Pricing', href: '#pricing' },
12
+ { label: 'Changelog', href: '#changelog' },
13
+ { label: 'Docs', href: '#docs' },
14
+ ],
15
+ },
16
+ {
17
+ title: 'Company',
18
+ links: [
19
+ { label: 'About', href: '#about' },
20
+ { label: 'Blog', href: '#blog' },
21
+ { label: 'Contact', href: '#contact' },
22
+ ],
23
+ },
24
+ {
25
+ title: 'Follow',
26
+ links: [
27
+ { label: 'GitHub', href: 'https://github.com/acme/acme', external: true },
28
+ { label: 'Newsletter', href: 'https://acme.example/newsletter', external: true },
29
+ ],
30
+ },
31
+ {
32
+ title: 'Legal',
33
+ links: [
34
+ { label: 'Terms', href: '#terms' },
35
+ { label: 'Privacy', href: '#privacy' },
36
+ ],
37
+ },
38
+ ];
39
+ export default function SiteFooterColumns() {
40
+ return (<>
41
+ {/* A real page puts its content in PageShell, then SiteFooter. Center keeps the footer in view here. */}
42
+ <Center width="page">
43
+ <Stack gap="large">
44
+ <Heading level={1} size="h5">About Acme</Heading>
45
+ <Paragraph tone="secondary" measure="none">Acme helps small teams share files and decide together.</Paragraph>
46
+ </Stack>
47
+ </Center>
48
+ {/* Groups of links, two across on a phone and four across from md. The legal line is last. */}
49
+ <SiteFooter brand={{ href: '#top', name: 'Acme' }} columns={columns} legal="© 2026 Acme. All rights reserved."/>
50
+ </>);
51
+ }
@@ -0,0 +1 @@
1
+ export default function SiteFooterSimple(): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ import SiteFooter from '../../components/siteFooter';
3
+ import Heading from '../../components/heading';
4
+ import Paragraph from '../../components/paragraph';
5
+ import { Center, Stack } from '../../components/layout';
6
+ var links = [
7
+ { label: 'Pricing', href: '#pricing' },
8
+ { label: 'Changelog', href: '#changelog' },
9
+ { label: 'Privacy', href: '#privacy' },
10
+ { label: 'GitHub', href: 'https://github.com/acme/acme', external: true },
11
+ ];
12
+ export default function SiteFooterSimple() {
13
+ return (<>
14
+ {/* A real page puts its content in PageShell, then SiteFooter. Center keeps the footer in view here. */}
15
+ <Center width="page">
16
+ <Stack gap="large">
17
+ <Heading level={1} size="h5">Changelog</Heading>
18
+ <Paragraph tone="secondary" measure="none">Version 2.4 adds shared folders. Ben Carter wrote the notes.</Paragraph>
19
+ </Stack>
20
+ </Center>
21
+ {/* A few links in one row that wraps, then the legal line last. */}
22
+ <SiteFooter brand={{ href: '#top', name: 'Acme' }} links={links} legal="© 2026 Acme. Released under the MIT License."/>
23
+ </>);
24
+ }
@@ -0,0 +1,133 @@
1
+ # Site footer
2
+
3
+ A person reaches the end of a site's page and looks for the pages that are not in the header, and who runs the site.
4
+
5
+ ## Do
6
+
7
+ - Use `SiteFooter` at the end of the page, after `PageShell`. It is a `<footer>` with a `<nav aria-label="Footer">`.
8
+ - Pass the brand, so the person can go home, and the links. Use `links` for a few and `columns` for many.
9
+ - Give each column a short `title`, such as 'Product', 'Company' and 'Legal'. A phone shows two columns across and a wide window up to four.
10
+ - Put the legal line last, in `legal`: the year and the name, and the license if there is one, such as '© 2026 Acme. Released under the MIT License.'
11
+ - Mark a link to another site with `external`. It opens in a new tab and the icon and the hidden words '(opens in a new tab)' say so.
12
+ - Keep the footer to links and the legal line. It holds every page the header leaves out, in plain words.
13
+
14
+ ## Don't
15
+
16
+ - Do not put a sales pitch, a heading or a Button in the footer. Use a call to action band above it.
17
+ - Do not open an external link in a new tab without saying so.
18
+ - Do not repeat a long sentence of the page in the footer.
19
+ - Do not hide a link on a phone. The columns sit two across.
20
+ - Do not put the legal line before the links.
21
+
22
+ ## Option: A row of links
23
+
24
+ Use when: The site has a few links to show.
25
+
26
+ Uses: `Center`, `Heading`, `Paragraph`, `SiteFooter`, `Stack`
27
+
28
+ ```tsx
29
+ 'use client';
30
+ import SiteFooter from 'oneslash-design-system/components/siteFooter';
31
+ import Heading from 'oneslash-design-system/components/heading';
32
+ import Paragraph from 'oneslash-design-system/components/paragraph';
33
+ import { Center, Stack } from 'oneslash-design-system/components/layout';
34
+
35
+ const links = [
36
+ { label: 'Pricing', href: '#pricing' },
37
+ { label: 'Changelog', href: '#changelog' },
38
+ { label: 'Privacy', href: '#privacy' },
39
+ { label: 'GitHub', href: 'https://github.com/acme/acme', external: true },
40
+ ];
41
+
42
+ export default function SiteFooterSimple() {
43
+ return (
44
+ <>
45
+ {/* A real page puts its content in PageShell, then SiteFooter. Center keeps the footer in view here. */}
46
+ <Center width="page">
47
+ <Stack gap="large">
48
+ <Heading level={1} size="h5">Changelog</Heading>
49
+ <Paragraph tone="secondary" measure="none">Version 2.4 adds shared folders. Ben Carter wrote the notes.</Paragraph>
50
+ </Stack>
51
+ </Center>
52
+ {/* A few links in one row that wraps, then the legal line last. */}
53
+ <SiteFooter
54
+ brand={{ href: '#top', name: 'Acme' }}
55
+ links={links}
56
+ legal="© 2026 Acme. Released under the MIT License."
57
+ />
58
+ </>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ## Option: Links in groups
64
+
65
+ Use when: The site has many links that fall into groups, such as product, company and legal.
66
+
67
+ Uses: `Center`, `Heading`, `Paragraph`, `SiteFooter`, `Stack`
68
+
69
+ ```tsx
70
+ 'use client';
71
+ import SiteFooter from 'oneslash-design-system/components/siteFooter';
72
+ import Heading from 'oneslash-design-system/components/heading';
73
+ import Paragraph from 'oneslash-design-system/components/paragraph';
74
+ import { Center, Stack } from 'oneslash-design-system/components/layout';
75
+
76
+ const columns = [
77
+ {
78
+ title: 'Product',
79
+ links: [
80
+ { label: 'Features', href: '#features' },
81
+ { label: 'Pricing', href: '#pricing' },
82
+ { label: 'Changelog', href: '#changelog' },
83
+ { label: 'Docs', href: '#docs' },
84
+ ],
85
+ },
86
+ {
87
+ title: 'Company',
88
+ links: [
89
+ { label: 'About', href: '#about' },
90
+ { label: 'Blog', href: '#blog' },
91
+ { label: 'Contact', href: '#contact' },
92
+ ],
93
+ },
94
+ {
95
+ title: 'Follow',
96
+ links: [
97
+ { label: 'GitHub', href: 'https://github.com/acme/acme', external: true },
98
+ { label: 'Newsletter', href: 'https://acme.example/newsletter', external: true },
99
+ ],
100
+ },
101
+ {
102
+ title: 'Legal',
103
+ links: [
104
+ { label: 'Terms', href: '#terms' },
105
+ { label: 'Privacy', href: '#privacy' },
106
+ ],
107
+ },
108
+ ];
109
+
110
+ export default function SiteFooterColumns() {
111
+ return (
112
+ <>
113
+ {/* A real page puts its content in PageShell, then SiteFooter. Center keeps the footer in view here. */}
114
+ <Center width="page">
115
+ <Stack gap="large">
116
+ <Heading level={1} size="h5">About Acme</Heading>
117
+ <Paragraph tone="secondary" measure="none">Acme helps small teams share files and decide together.</Paragraph>
118
+ </Stack>
119
+ </Center>
120
+ {/* Groups of links, two across on a phone and four across from md. The legal line is last. */}
121
+ <SiteFooter
122
+ brand={{ href: '#top', name: 'Acme' }}
123
+ columns={columns}
124
+ legal="© 2026 Acme. All rights reserved."
125
+ />
126
+ </>
127
+ );
128
+ }
129
+ ```
130
+
131
+ ## Native
132
+
133
+ On Apple and Android an app has no footer. Put the links in a settings or an About screen, as a `List` of rows.
@@ -0,0 +1 @@
1
+ export default function SiteHeaderLinks(): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+ import SiteHeader from '../../components/siteHeader';
3
+ import PageShell from '../../components/pageShell';
4
+ import Button from '../../components/button';
5
+ import Heading from '../../components/heading';
6
+ import Paragraph from '../../components/paragraph';
7
+ import { Stack } from '../../components/layout';
8
+ var links = [
9
+ { label: 'Features', href: '#features' },
10
+ { label: 'Pricing', href: '#pricing', current: true },
11
+ { label: 'Changelog', href: '#changelog' },
12
+ { label: 'Docs', href: '#docs' },
13
+ ];
14
+ export default function SiteHeaderLinks() {
15
+ return (<>
16
+ {/* From md the links are a row in the bar. Below md they and 'Log In' are in the Menu; Sign Up stays beside it. */}
17
+ <SiteHeader brand={{ href: '#top', name: 'Acme' }} links={links} actions={<Button size="medium" type="tertiary" state="enabled" label="Log In" href="#log-in"/>} phoneAction={<Button size="medium" type="primary" state="enabled" label="Sign Up" href="#sign-up"/>} mainId="site-header-main"/>
18
+ {/* The skip link goes here: the id matches mainId, and tabIndex -1 lets focus move in. */}
19
+ <PageShell id="site-header-main" tabIndex={-1}>
20
+ <Stack gap="large">
21
+ <Heading level={1} size="h5">Pricing</Heading>
22
+ <Paragraph tone="secondary" measure="none">Acme is free for up to three people. Add more people when your team grows.</Paragraph>
23
+ </Stack>
24
+ </PageShell>
25
+ </>);
26
+ }
@@ -0,0 +1 @@
1
+ export default function SiteHeaderSections(): import("react").JSX.Element;
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+ import { useState } from 'react';
3
+ import SiteHeader from '../../components/siteHeader';
4
+ import TabsContainer from '../../components/tabsContainer';
5
+ import Tab from '../../components/tab';
6
+ import IconButton from '../../components/iconButton';
7
+ import Tooltip from '../../components/tooltip';
8
+ import Popover from '../../components/popover';
9
+ import Menu from '../../components/menu';
10
+ import MenuItem from '../../components/menuItem';
11
+ import PageShell from '../../components/pageShell';
12
+ import Heading from '../../components/heading';
13
+ import Paragraph from '../../components/paragraph';
14
+ import { Stack } from '../../components/layout';
15
+ // Four sections, one short word each. Each holds many pages.
16
+ var sections = [
17
+ { id: 'start', label: 'Start', page: 'Start here' },
18
+ { id: 'guides', label: 'Guides', page: 'Guides' },
19
+ { id: 'reference', label: 'API', page: 'API reference' },
20
+ { id: 'updates', label: 'News', page: 'News' },
21
+ ];
22
+ var modes = [
23
+ { value: 'light', label: 'Light', icon: 'Sun' },
24
+ { value: 'dark', label: 'Dark', icon: 'Moon' },
25
+ { value: 'system', label: 'System', icon: 'Monitor' },
26
+ ];
27
+ export default function SiteHeaderSections() {
28
+ var _a, _b;
29
+ var _c = useState('guides'), sectionId = _c[0], setSectionId = _c[1];
30
+ var _d = useState('system'), mode = _d[0], setMode = _d[1];
31
+ var _e = useState(null), anchor = _e[0], setAnchor = _e[1];
32
+ var _f = useState(false), open = _f[0], setOpen = _f[1];
33
+ var section = (_a = sections.find(function (s) { return s.id === sectionId; })) !== null && _a !== void 0 ? _a : sections[0];
34
+ var current = (_b = modes.find(function (m) { return m.value === mode; })) !== null && _b !== void 0 ? _b : modes[2];
35
+ // A real app passes the router from its framework, such as Next's useRouter(). Here it sets the open section.
36
+ var router = { push: function (url) { var _a; return setSectionId((_a = url.split('/').pop()) !== null && _a !== void 0 ? _a : 'start'); } };
37
+ return (<>
38
+ {/* The brand, then search and the theme menu as `phoneAction`, so they stay in the bar at every width. The section Tabs are `nav`, a second row of the bar. */}
39
+ <SiteHeader brand={{ href: '#top', name: 'Acme Docs' }} links={[]} phoneAction={<>
40
+ <Tooltip title="Search">
41
+ <IconButton color="iconOnly" state="enabled" size="medium" iconName="Search" ariaLabel="Search"/>
42
+ </Tooltip>
43
+ <Tooltip title={"Theme: ".concat(current.label)}>
44
+ <IconButton color="iconOnly" state={open ? 'selected' : 'enabled'} size="medium" iconName={current.icon} ariaLabel={"Theme: ".concat(current.label)} aria-haspopup="menu" aria-expanded={open} onClick={function (e) {
45
+ setAnchor(e.currentTarget);
46
+ setOpen(function (o) { return !o; });
47
+ }}/>
48
+ </Tooltip>
49
+ </>} nav={<TabsContainer fill>
50
+ {sections.map(function (s) { return (<Tab key={s.id} label={s.label} href={"/".concat(s.id)} router={router} isSelected={s.id === section.id} onClickTab={function () { return setSectionId(s.id); }}/>); })}
51
+ </TabsContainer>} mainId="site-header-sections-main"/>
52
+ <PageShell id="site-header-sections-main" tabIndex={-1}>
53
+ <Stack gap="large">
54
+ <Heading level={1} size="h5">{section.page}</Heading>
55
+ <Paragraph tone="secondary" measure="none">The pages in {section.label} are listed beside this page on a wide screen, and in the menu on a phone.</Paragraph>
56
+ </Stack>
57
+ </PageShell>
58
+ <Popover open={open} anchorEl={anchor} onClose={function () { return setOpen(false); }} returnFocus>
59
+ <Menu navigable aria-label="Theme" width={180}>
60
+ {modes.map(function (m) { return (<MenuItem key={m.value} size="small" iconName={m.icon} label={m.label} isSelected={m.value === mode} role="menuitemradio" onClick={function () { setMode(m.value); setOpen(false); }}/>); })}
61
+ </Menu>
62
+ </Popover>
63
+ </>);
64
+ }