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
package/README.md CHANGED
@@ -70,13 +70,13 @@ import SectionIntro from 'oneslash-design-system/components/sectionIntro';
70
70
 
71
71
  ## Design cases
72
72
 
73
- A case is one design situation with oneSlash's answer to it. A rule case has one answer, such as "an agent asks before a risky action". A design case has one to four options, each with a line on when to use it and a working example built only from this package. 2.17.0 has 56: ten rules and 46 design cases for auth pages, confirms and modals, states, chat and agent interfaces.
73
+ A case is one design situation with oneSlash's answer to it. A rule case has one answer, such as "an agent asks before a risky action". A design case has one to four options, each with a line on when to use it and a working example built only from this package. 2.19.0 has 85: twelve rules and 73 design cases for auth pages, confirms and modals, states, chat and agent interfaces, settings and menus, shells and navigation.
74
74
 
75
75
  - `oneslash-design-system/cases.json` lists every case with its rule text, options, Do and Don't lines, and the source of each example.
76
76
  - `oneslash-design-system/cases/<id>.md` is one case as text, and `oneslash-design-system/cases/<id>/<option>.jsx` is the example itself.
77
77
  - The Cases section of [DESIGN.md](./dist/DESIGN.md) is the same list for an agent to read.
78
78
 
79
- The source is `cases/<id>/case.js` plus one `.tsx` file per option. `npm run build` checks each example uses only ODS parts and writes the files above.
79
+ The source is `cases/<id>/case.js` plus one `.tsx` file per option. `npm run build` checks each example uses only ODS parts and writes the files above. Which products follow a case (`notBuiltYet`, `seenIn`) stays in the repo and is not published; a published field or example that names a product fails the build.
80
80
 
81
81
  ## Releasing
82
82
 
package/dist/DESIGN.md CHANGED
@@ -292,14 +292,18 @@ For each web component, the table gives the native control to use. System contro
292
292
  | ODS | SwiftUI | Compose | Note |
293
293
  | --- | --- | --- | --- |
294
294
  | alert | `ODSBanner` for an inline message; `.alert` for one that needs a decision | `OdsBanner` for an inline message; `AlertDialog` for one that needs a decision | ODS has no native toast: on Android use `Snackbar` in a `SnackbarHost`. |
295
+ | appShell | `NavigationSplitView` with the sidebar, the content and an `.inspector`; on iPhone a `NavigationStack`, or a `TabView` of five places or fewer | `NavigationSuiteScaffold`; on a phone a `ModalNavigationDrawer` around a `Scaffold` | The split view collapses to a stack on iPhone and shows and hides the sidebar itself. The skip link is web only. |
295
296
  | button | `Button` with `.odsProminentButton()` for accent (`.odsProminentButton(.glass)` for the glass style), `.bordered` for primary | `Button`, `OutlinedButton` | Tertiary and text-only: `.borderless` / `TextButton`. On Apple, apply `.odsProminentButton()` to every prominent button. Under `odsTheme` the label of a `.borderedProminent` or `.glassProminent` button takes `text.primary`, not the system white, which is below 4.5:1 on the accent in default dark, forest light, forest dark, clay dark, indigo light, indigo dark, wine light, wine dark. In forest light it is the same color as the fill, so the label cannot be seen. The modifier keeps the system style and sets the label to `accent.contrast`. Compose needs nothing: `onPrimary` is `accent.contrast`. |
296
297
  | brandIcon | the provider's own button where one exists (`SignInWithAppleButton`), else an asset in the app | an asset in the app | |
297
298
  | checkBox | `Toggle` (switch on iOS, `.toggleStyle(.checkbox)` on macOS) | `Checkbox` | |
298
299
  | composer | `TextField(_:text:axis: .vertical)` with `.lineLimit(1...6)` over a toolbar `HStack` of the tool `Button`s and a send `Button` | `OutlinedTextField` with `maxLines = 6` over a `Row` of the tool `IconButton`s and a send `IconButton` | On iPhone and Android, Return adds a line and the send button sends. While an agent works, send becomes Stop. |
300
+ | copyField | A `LabeledContent` row with the value in a `Text` (`.textSelection(.enabled)`) and a `Button` that sets `UIPasteboard` / `NSPasteboard` | An `OutlinedTextField` with `readOnly = true` and a `trailingIcon` `TextButton` that calls `LocalClipboard` | Show "Copied" for 2 seconds only after the write succeeds. Announce it for VoiceOver / TalkBack. A secret shown once gets the line under it. |
301
+ | drawer | `.sheet` with `.presentationDetents` on iPhone; `.inspector` on iPad and Mac | `ModalNavigationDrawer` for `side="start"`; `ModalBottomSheet` for `side="end"` | The system sheet, inspector and drawer handle the scrim, swipe to close and focus. `ModalBottomSheet` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
299
302
  | emptyBox | `ContentUnavailableView` | `OdsEmptyState` | The system has this control on Apple, so ODS adds no part there. Material has none, so ODS does. |
300
303
  | factsRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `LabeledContent` rows in a `Form` / `ListItem` rows. |
301
304
  | figure | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: an `Image` with a caption `Text` in the caption text style. |
302
305
  | fileChip | A capsule `Label` (`.labelStyle(.titleAndIcon)`) with the file icon, the name and size, and a `Button` with `xmark.circle.fill` to remove it | An `InputChip` with a `trailingIcon` that removes it | An uploading chip gets a `ProgressView`; a failed one an alert symbol, not color alone. Say the state in the VoiceOver / TalkBack label. |
306
+ | formField | A `Section` in a `Form`: the control carries its own label, `footer:` holds the help or error text | The field's `label`, `supportingText` and `isError` on an `OutlinedTextField`; a `Column` with a supporting `Text` for other controls | On Apple the system ties the label to the control; do not add one. Say the error in the VoiceOver / TalkBack text, not color alone. |
303
307
  | form | `Form` | A `Column` of fields; submit from the keyboard action | On Apple the system lays the fields out; do not add spacing. |
304
308
  | heading | `Text` with the type role's text style and `.accessibilityAddTraits(.isHeader)` | `Text` with the type role's `MaterialTheme.typography` style and `Modifier.semantics { heading() }` | |
305
309
  | icon | `Image(systemName:)` (SF Symbols) | Material Symbols | |
@@ -317,16 +321,23 @@ For each web component, the table gives the native control to use. System contro
317
321
  | modal | `.sheet` or `.alert` | `ModalBottomSheet` or `AlertDialog` | `ModalBottomSheet` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
318
322
  | navigation | `NavigationSplitView` with a sidebar `List` | `NavigationRail` or `ModalNavigationDrawer` with `NavigationDrawerItem` | |
319
323
  | numberedRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: rows of a `List` / `ListItem`s. |
324
+ | onThisPage | Not applicable: web page pattern | Not applicable: web page pattern | A site is web only. A long screen is a `List` in sections. |
320
325
  | pageHeader | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `.navigationTitle` / `TopAppBar`. |
321
326
  | pageShell | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `NavigationStack` / `Scaffold`. |
322
327
  | paragraph | `Text` with `.font(.body)` | `Text` with `MaterialTheme.typography.bodyLarge` | |
323
328
  | popover | `.popover` | `DropdownMenu` | Larger anchored content on Android: `ModalBottomSheet`. |
324
329
  | radioGroup | `Picker` (`.inline` on iOS, `.radioGroup` on macOS) | `RadioButton`s in a `Column` with `Modifier.selectableGroup()` | `variant="card"`: each option is a bordered card with the radio in it, a `Picker` with custom rows on iOS / selectable `Card`s with a `RadioButton` in a `selectableGroup` on Android. |
325
330
  | sectionIntro | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: a `Section` header in a `List` or `Form` / a heading `Text`. |
331
+ | segmentedControl | `Picker` with `.pickerStyle(.segmented)` | `SingleChoiceSegmentedButtonRow` with `SegmentedButton` | It sets a value on the same screen. To switch panels use `TabView` / `PrimaryTabRow`. Give the picker an accessibility label. |
326
332
  | select | `Picker` or `Menu` | `ExposedDropdownMenuBox` | |
333
+ | settingsSection | A `Section` with a header `Text` and footer `Text` in a grouped `Form` | A `Column` with a title `Text`, a supporting `Text` and the controls under a `HorizontalDivider` | A danger zone gets its own `Section` with the error color on the header. Settings Columns is a screen layout: one column on a phone. For Settings Layout, on a phone the nav is its own screen, pushed with `NavigationStack` / `NavHost`. `navWidth="wide"` (a list beside its detail) is a `NavigationSplitView` list column / `ListDetailPaneScaffold`. |
334
+ | sidePane | `.inspector(isPresented:)` with `.inspectorColumnWidth(min:ideal:max:)` | `SupportingPaneScaffold` | The system resizes the inspector on iPad and Mac and shows it as a sheet on iPhone. `SupportingPaneScaffold` is in the Material 3 adaptive library and needs `@OptIn(ExperimentalMaterial3AdaptiveApi::class)`. |
335
+ | siteFooter | Not applicable: web page pattern | Not applicable: web page pattern | A site is web only. An app has no footer: its links live in Settings, as rows. |
336
+ | siteHeader | Not applicable: web page pattern | Not applicable: web page pattern | A site is web only. In an app: `NavigationStack` with a toolbar, and a `TabView` or `NavigationSuiteScaffold` for the places. |
327
337
  | sourceCard | `Link` or `Button` with a `Label` (icon, title) and the meta as a secondary line | A `Card` with `onClick`, or a `ListItem` with a leading `Icon` | With no destination it is a plain `Label`, not a button. |
328
338
  | stepList | A `List` of `Label`s with an SF Symbol per status (`circle`, `checkmark.circle.fill`, `xmark.circle.fill`, `minus.circle`); `ProgressView` for the running one | A `Column` of `ListItem`s with an `Icon` per status; `CircularProgressIndicator` for the running one | Give each row a status text for VoiceOver / TalkBack, not color alone. |
329
339
  | surface | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: a `Form` section or `GroupBox` / `Card`. |
340
+ | switch | `Toggle` in a `Form` row (`.toggleStyle(.switch)`); the description is the row's secondary line | `Switch` in a `ListItem` with `trailingContent` | While a change saves, disable the control or show a `ProgressView` / `CircularProgressIndicator` beside it and put the value back if it fails. |
330
341
  | tab | `TabView` or segmented `Picker` | `PrimaryTabRow` | One `Tab` inside `TabView` or one segment / one `Tab`. `TabRow` is deprecated in Material 3. |
331
342
  | tableCell | A `TableColumn` content view | `Text` in a `Row` with `Modifier.weight` | Material 3 has no table. |
332
343
  | tableContainer | `Table` | `LazyColumn` of `Row`s | Material 3 has no table. A compact-width iPhone `Table` shows only its first column. |
@@ -338,6 +349,7 @@ For each web component, the table gives the native control to use. System contro
338
349
  | textarea | `TextField(_:text:axis: .vertical)` or `TextEditor` | `OutlinedTextField` with `minLines` | |
339
350
  | textField | `TextField` (`SecureField` for passwords) | `OutlinedTextField` or `TextField` | |
340
351
  | timeStamp | `Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`) | `Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime` | |
352
+ | titleBar | `.navigationTitle` with `.toolbar` items | `TopAppBar` with `navigationIcon` and `actions` | The main action stays in the toolbar; the rest go in a `Menu` / an overflow `DropdownMenu`. |
341
353
  | toaster | `ODSBanner` for an inline message; a system banner (a local notification) when the app is not in front | `Snackbar` in a `SnackbarHost` | SwiftUI has no toast, so ODS adds none: show the message in the screen. |
342
354
  | tooltip | `.help` | `TooltipBox` | `.help` shows on pointer hover only. `TooltipBox` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
343
355
  | userImage | `ODSAvatar` | `OdsAvatar` | Load the picture yourself and pass it as an `Image` / a `Painter`. |
@@ -389,8 +401,6 @@ The agent is about to do something that changes shared work or is hard to undo.
389
401
 
390
402
  Answer: An action is risky when it changes shared work or is hard to undo. In a product that works with code, that includes opening or merging a pull request, deleting files, closing an issue and rolling back a release. Carrying out a plan of several changes is risky too. Before a risky action the agent stops and posts a card with the exact action: every step it will take, or the changes themselves, which the person can open. The agent does nothing until the person presses the approve button.
391
403
 
392
- **Not built yet:** In Scindo the agent asks before carrying out a plan, opening a pull request and merging one. It does not yet ask before deleting files, closing an issue or rolling back a release.
393
-
394
404
  File: cases/agent-asks-before-risky-action.md
395
405
 
396
406
  ### An agent cancels and reports when nobody answers
@@ -399,8 +409,6 @@ The agent has asked a question or proposed an action, and nobody answers.
399
409
 
400
410
  Answer: The agent never takes silence as a yes: while a question or proposal waits, it does nothing that depends on the answer. Each product sets the waiting time and shows it on the waiting card. When the time is up, the agent cancels the request, marks the card Cancelled, and posts one line saying what it did not do. The agent may write a plan that lists the unanswered questions as open questions. It may not carry out anything that depends on an answer.
401
411
 
402
- **Not built yet:** No product cancels a waiting request on its own yet. In Scindo a request waits until a person answers, cancels or skips it, and the waiting time is not decided.
403
-
404
412
  File: cases/agent-cancels-when-unanswered.md
405
413
 
406
414
  ### An agent refuses clearly
@@ -409,8 +417,6 @@ The product will not let the agent answer a request, for example because the wor
409
417
 
410
418
  Answer: The refusal says in one plain sentence which limit was reached, and either who can change it or when to try again. A person who can lift the limit gets the one button that does it, such as Upgrade or Change Budget Cap. When an admin can lift the limit, everyone else is told to ask a workspace admin. A limit that passes with time says when to try again instead.
411
419
 
412
- **Not built yet:** Scindo on the web does not follow this yet: it shows the Upgrade button to everyone. Scindo's Apple app shows it only to admins.
413
-
414
420
  File: cases/agent-refuses-clearly.md
415
421
 
416
422
  ### An agent says what it is
@@ -443,8 +449,6 @@ An action a person takes themselves needs their yes before it happens. An action
443
449
 
444
450
  Answer: A confirm is a Modal with `size="small"`. Its title names the action in Title Case, such as 'Delete Project'. The body says in one or two sentences what will happen and what is kept. Two Buttons sit in the Modal's `actions`. 'Cancel' comes first, a `<Button type="tertiary" size="small">`. Then comes the action, a `<Button type="primary" size="small">` labelled in Title Case with the same verb as the title. When the action destroys or removes something, the action Button also has `color="danger"`. One case differs: 'Unsaved changes'. Its guard may have three Buttons, 'Cancel', "Don't Save" and 'Save', in that order. When it has two, its safe Button reads 'Keep Editing'. Escape and a click outside the Modal mean Cancel. While the request runs, the action Button is `loading` and keeps its label, and 'Cancel' is `state="disabled"`. The Modal stays open. It still calls `onClose` on Escape or a click outside, and the page ignores that call until the request ends. If the request fails, the Modal stays open and shows an inline error Alert at the top of its body, as the rule 'A form error shows next to the problem' says. When the action works, the Modal closes. If the thing is still on screen, the change shows where it is. If the thing is gone, a toast names it, as the rule 'Success shows where the person is looking' says.
445
451
 
446
- **Not built yet:** No Commentify confirm Modal uses `color="danger"`, and two of them label Cancel 'No'. Scindo on the web makes Cancel a secondary Button in some confirms and a tertiary one in others. It leaves its Delete Task and Remove Member confirms uncolored. Scindo on the web revokes an API key, and Commentify revokes an agent client, with no confirm.
447
-
448
452
  File: cases/confirm-dialogs.md
449
453
 
450
454
  ### An empty list says what will fill it
@@ -453,8 +457,6 @@ A list, table or pane has nothing to show.
453
457
 
454
458
  Answer: Use `EmptyBox`, never a bare line of text. Its `size` is `large` when the list fills the whole region and `small` inside a section. The `text` says what is empty, in the person's words and in sentence case: 'No saved comments'. The `secondText` says what will appear here or what to do. When the person can fix it, pass the Button as `action`. The action Button is primary when it fills the list or tries again, and secondary when it is 'Clear Search'. An empty search shows the words searched for and a 'Clear Search' Button. A failed load is not an empty list: say that loading failed and offer a 'Try Again' Button. `EmptyBox` may hold that message, with 'Try Again' as its `action`, but never the empty text.
455
459
 
456
- **Not built yet:** Scindo on the web uses `EmptyBox` in three places and bare text elsewhere, such as 'No API keys yet.' Commentify uses `EmptyBox` in most lists and bare text in a few. Commentify admin and jinhwankim.com show bare text. No product passes an `action` yet.
457
-
458
460
  File: cases/empty-lists.md
459
461
 
460
462
  ### A form error shows next to the problem
@@ -463,34 +465,52 @@ A form was submitted and something is wrong.
463
465
 
464
466
  Answer: A problem with one field shows under that field, through the field's `error` and `errorText`. A problem with the whole request shows above the fields in `<Alert type="error" variant="inline" showCloseButton>`, so it stays until the person closes it or submits again. Its `onClose` clears the message; if it does not, the Alert comes back. While the request runs, the submit Button is `loading` and keeps its label. The form keeps what the person typed. The next submit clears the old messages. Messages are in sentence case. It is never a colored caption written by hand, and never the browser's `alert()`.
465
467
 
466
- **Not built yet:** Commentify writes red captions by hand on its consent screen and in its Figma import dialog. Scindo on the web does the same in its dialogs, such as renaming a workspace or a task. Commentify uses the browser's `alert()` in three files, and Scindo on the web in one.
467
-
468
468
  File: cases/form-errors.md
469
469
 
470
+ ### On a phone, a sidebar opens as a drawer and a list opens its detail
471
+
472
+ A layout with a sidebar, a list beside its detail, or a side pane meets a phone screen.
473
+
474
+ Answer: An app's sidebar opens in a `Drawer` from the start side, from a 'Menu' `IconButton` at the start of a top bar that names the place. `AppShell` does this. The Drawer closes on a choice, on Close, on Escape, on the scrim and when the window widens. A list beside its detail becomes two screens: the list, then the detail with a Back Button named for the list, as `SettingsLayout` does. A settings nav is such a list. A side pane takes the whole content area and has Close. It is never squeezed beside the content. A site's links go into the same kind of menu, and one main action may stay in the bar. Nothing is hidden on a phone without a way to reach it. There is no bottom tab bar on the web.
475
+
476
+ File: cases/phone-navigation.md
477
+
478
+ ### A setting saves in place, or with one Save Button
479
+
480
+ A person changes a setting.
481
+
482
+ Answer: A control that stands alone saves as soon as it changes: a `Switch`, a choice in a `RadioGroup` or a `Select`, or a picture the person chooses. It shows nothing on success, because the control already shows the new value. While the request runs it is busy: a `Switch` takes `busy`, and a `RadioGroup` or `Select` is disabled. If the save fails, the control goes back to its old value and says why next to itself: in a Switch's `error`, in the error line of its `FormField`, or in an inline error `Alert` under a control with no visible label, such as a role in a row. A group of fields that belong together, such as a name, a profile, instructions or a budget, has one Save Button for the whole group. The Button is `loading` while it saves, keeps its label, then reads 'Saved' for 2 seconds. It is disabled while nothing has changed. A group that fails to save follows the rule 'A form error shows next to the problem'. Leaving with unsaved changes follows the case 'Unsaved changes'. Never mix both in one group: a Switch beside a Save Button leaves the person unsure which one is saved. Never show a toast for a setting saved in place. The one exception is a setting chosen from a menu: the menu closes, so a failed save shows in a toast and the control goes back to its old value. A person who cannot change a setting sees it read-only, with one line that says who can change it.
483
+
484
+ File: cases/settings-save.md
485
+
470
486
  ### Success shows where the person is looking
471
487
 
472
488
  Something the person did has worked.
473
489
 
474
490
  Answer: The feedback depends on where the result shows. A Button that is `loading` keeps its label, and the spinner shows that it is working. Only success changes a label, and there are three success labels: 'Saved', 'Copied' and 'Sent', each for 2 seconds. When a form saves in place, its Button is `loading`, then reads 'Saved' for 2 seconds, then its own label again. There is no toast. Sometimes the result is somewhere else or gone. Something was deleted, sent, moved or duplicated somewhere else, or a long job has finished. Then call `toast({ type: 'success', message: '…' })` with one short sentence in the past tense, in sentence case. It closes after 5 seconds. When something is copied to the clipboard, a Button reads 'Copied' for 2 seconds, and an IconButton swaps its icon to `Check` for 2 seconds. When Copy is a menu item, the menu closes, so a toast says 'Message copied.' instead. When a Button sends an email again, it reads 'Sent' for 2 seconds. The message names the thing and does not say 'successfully'.
475
491
 
476
- **Not built yet:** Scindo on the web has no toast. It shows success in five ways: a 'Saved' Button label, a green caption, an inline Alert, a thank-you that replaces a dialog and a 'Copied' label. The timed ones clear after 1.5, 2, 3 or 4 seconds. Commentify shows toasts through `Alert`, one at a time, and many of them say 'successfully'.
477
-
478
492
  File: cases/success-feedback.md
479
493
 
480
494
  | Case | When | File |
481
495
  | --- | --- | --- |
482
496
  | Invite link page | A person opens an invite link to join a workspace. | cases/accept-invite.md |
497
+ | Account menu | A person opens a menu for their own account to change settings, get help or log out. | cases/account-menu.md |
483
498
  | Agent options | The agent sees two to four ways forward and needs the person to pick one. These are ways forward for the agent's own work. For a fact or a decision only the person has, see the case 'Agent question'. | cases/agent-options.md |
484
499
  | Agent at work | The agent is working on a request in the thread, and its reply is not ready yet. | cases/agent-pending-reply.md |
485
500
  | Plan proposal | The agent is about to change shared work and needs the person to approve it first. | cases/agent-plan-proposal.md |
486
501
  | Agent question | The agent needs an answer from the person before it can go on. It needs a fact or a decision only the person has. For ways forward in its own work, see the case 'Agent options'. | cases/agent-question.md |
502
+ | Agent settings | An admin sets which model the agent uses, how it picks one, what it should know about the team and how much it may spend. | cases/agent-settings.md |
503
+ | API keys | A person makes keys that let a script or a service use the product as them, and revokes keys they no longer use. | cases/api-keys.md |
504
+ | App shell | A person opens the product and moves between its places, such as Inbox, Tasks and Settings, from every page. | cases/app-shell.md |
487
505
  | Document card | The agent made a document for the person, such as a plan or a report. | cases/artifact-card.md |
488
506
  | Login check loading | The app is checking whether the person is logged in, or running a step such as checking an invite, before it knows what to show. | cases/auth-gate-loading.md |
489
507
  | Check your email | A person signed up, and the product sent a link to confirm their email. | cases/check-your-email.md |
508
+ | Collapsible search | A person filters a list by a word, and the list should keep its room when they are not typing. | cases/collapsible-search.md |
490
509
  | Composer at a limit | The agent cannot be called from the composer because the workspace reached a limit, such as its agent replies for the month. | cases/composer-limit.md |
491
510
  | Delete confirm | A person asks to delete or remove something, and it cannot be undone. | cases/confirm-destructive-action.md |
492
511
  | Conversation starters | A thread has no messages yet, and the person may not know what to write first. | cases/conversation-starters.md |
493
512
  | Create modal | A person creates something new, such as a project or a task, and it needs a name before it exists. | cases/create-modal.md |
513
+ | Danger zone | A settings page offers actions that are hard or impossible to undo, such as deleting an account or a workspace, or leaving one. | cases/danger-zone.md |
494
514
  | Device login | A CLI, an editor or another app opened the browser so the person can log in, and the login must reach that app. | cases/device-login.md |
495
515
  | Email confirmed | A person opened the link that confirms their email. | cases/email-confirmed.md |
496
516
  | Empty list | A list has loaded, and there is nothing in it yet. | cases/empty-list.md |
@@ -498,13 +518,17 @@ File: cases/success-feedback.md
498
518
  | Empty search | A search or a filter finds nothing. | cases/empty-search.md |
499
519
  | Error page | Something broke while showing a page, and the app cannot show it. | cases/error-page.md |
500
520
  | Feedback form | A person sends feedback about the product from inside it. | cases/feedback-form.md |
521
+ | Filter menu | A person narrows a list by one choice, such as a date range, or turns the filter off. | cases/filter-menu.md |
501
522
  | Forgot password | A person cannot remember their password and asks for a link to set a new one. | cases/forgot-password.md |
502
523
  | Import checklist | A person picks which items to bring in from another place, such as pages from a wiki. | cases/import-checklist.md |
503
524
  | Form feedback | A person submits a small form, such as a settings field, and the request ends. The three options are the three outcomes of one save: it worked in place, it failed, or the result is elsewhere. | cases/inline-form-feedback.md |
525
+ | Integrations | A person connects the product to other tools, sees which ones are connected and disconnects them. | cases/integrations-list.md |
504
526
  | Member invite | A person invites someone to join a workspace. | cases/invite-member.md |
505
527
  | Load failure | A list or a section could not load. | cases/load-failure.md |
506
528
  | Log-out confirm | A person chooses Log Out. | cases/log-out-confirm.md |
507
529
  | Login page | A person who already has an account opens the product and is not logged in. | cases/login-page.md |
530
+ | List and detail | A person opens an item from a list, such as a message or a report, and reads or acts on it. | cases/master-detail.md |
531
+ | Members | An admin sees who is in the workspace, changes their roles, removes people and invites more. | cases/members-list.md |
508
532
  | Mention list | A person types @ in the message box to name someone, or the agent. | cases/mention-list.md |
509
533
  | Message actions | A person acts on one message: reacts to it, copies it, edits or deletes it. | cases/message-actions.md |
510
534
  | Attachments | A person adds files to a message, and people open the files in a message that was sent. | cases/message-attachments.md |
@@ -512,15 +536,32 @@ File: cases/success-feedback.md
512
536
  | Message edit | A person changes the text of a message they sent. | cases/message-edit.md |
513
537
  | Reactions | People answer a message with an emoji instead of a reply. | cases/message-reactions.md |
514
538
  | Message row | A thread shows messages from people, and sometimes from an agent. | cases/message-row.md |
539
+ | Menu on a phone | A site's links and actions do not fit in the bar on a phone, and the person still needs to reach every one. | cases/mobile-menu.md |
515
540
  | Page not found | A person opens a link to a page that does not exist. | cases/not-found-page.md |
541
+ | Notification setting | A person chooses how much a channel or a thread notifies them. | cases/notification-menu.md |
516
542
  | OAuth consent | Another app, such as a CLI or an MCP client, asks to act for a person who is logged in, and the person must allow it. | cases/oauth-consent.md |
543
+ | On and off settings | A person turns things on and off, such as which notifications they get. | cases/on-off-settings.md |
544
+ | On this page | A person reads a long page and wants to see its sections, jump to one and know which one they are in. | cases/on-this-page.md |
545
+ | More menu | A person opens a menu of less common actions, behind one button, for a thing or for the page. | cases/overflow-menu.md |
546
+ | Page header with actions | A page names itself at the top and offers what the person can do with it. | cases/page-header.md |
547
+ | Profile | A person changes how they appear and how they sign in: their picture, their name and their password. | cases/profile-form.md |
548
+ | Quick switcher | A person jumps to a channel, task or document by typing part of its name, from anywhere in the product. | cases/quick-switcher.md |
549
+ | Range switch | A person changes the time range of a chart or a list on the same page, such as Week, Month or Quarter. | cases/range-switch.md |
517
550
  | Rename | A person renames something, such as a project or a channel. | cases/rename.md |
518
551
  | Reply feedback | The agent has replied, and the person can say whether the reply helped. | cases/reply-feedback.md |
519
552
  | Reply sources | The agent answered from things it read, and the person may want to check them. | cases/reply-sources.md |
520
553
  | Page loading | A page or a pane is loading, and there is nothing to show yet. | cases/route-loading.md |
554
+ | Scope picker | A person chooses where a search or a question looks, such as one workspace or all of them. | cases/scope-picker.md |
521
555
  | Set new password | A person opened the link to reset their password and now chooses a new one. | cases/set-new-password.md |
556
+ | Settings page | A person opens the settings of the product and looks for one area, such as Profile or Billing. | cases/settings-page.md |
557
+ | Side pane | A person opens more about the page, such as its members, its history or a document, without leaving the page. | cases/side-pane.md |
558
+ | Sidebar with sections and counts | A person looks down the sidebar for a place, and for what has something new in it. | cases/sidebar-nav.md |
522
559
  | Sign-up page | A person who has no account yet opens the product and wants one. | cases/sign-up-page.md |
560
+ | Site footer | 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. | cases/site-footer.md |
561
+ | Site header | A site's pages name the site at the top and show the person where to go and what to do next. | cases/site-header.md |
523
562
  | Command list | A person types / at the start of the message box to run a command. | cases/slash-command-list.md |
563
+ | Tag filter | A person filters a list by a tag, and adds, renames and deletes the tags themselves. | cases/tag-filter.md |
564
+ | Theme switcher | A person chooses between a light page, a dark page, or the one their device uses. | cases/theme-switcher.md |
524
565
  | Type to confirm | A person asks to delete something large that cannot be brought back, such as a workspace or an account. | cases/type-to-confirm.md |
525
566
  | Typing line | Other people in the thread are writing a message that has not arrived yet. | cases/typing-and-status.md |
526
567
  | Unsaved changes | A person closes or leaves something they changed and did not save. | cases/unsaved-changes-guard.md |
@@ -2,8 +2,6 @@
2
2
 
3
3
  A person opens an invite link to join a workspace.
4
4
 
5
- **Not built yet:** Scindo on the web labels its Buttons 'Log in' and 'Create account' in sentence case, and shows 'Please wait' under its spinner. Its wrong-account Button reads 'Sign out and switch accounts'.
6
-
7
5
  ## Do
8
6
 
9
7
  - Name the workspace in a `Heading` with `level={1}`: "You're invited to Acme Design".
@@ -156,6 +154,4 @@ export default function AcceptInviteSignedIn() {
156
154
 
157
155
  ## Native
158
156
 
159
- On Apple, Scindo joins from a sheet with the invite link or code in a field. 'Cancel' and 'Join' sit in the toolbar. While it checks the invite, a small `ProgressView` sits beside a line naming the step.
160
-
161
- Seen in: Scindo.
157
+ On Apple, joining works from a sheet with the invite link or code in a field. 'Cancel' and 'Join' sit in the toolbar. While it checks the invite, a small `ProgressView` sits beside a line naming the step.
@@ -0,0 +1 @@
1
+ export default function AccountMenuExample(): import("react").JSX.Element;
@@ -0,0 +1,99 @@
1
+ 'use client';
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import Modal from '../../components/modal';
4
+ import Heading from '../../components/heading';
5
+ import Paragraph from '../../components/paragraph';
6
+ import Button from '../../components/button';
7
+ import UserImage from '../../components/userImage';
8
+ import Popover from '../../components/popover';
9
+ import Menu from '../../components/menu';
10
+ import MenuItem from '../../components/menuItem';
11
+ import Line from '../../components/line';
12
+ import { Center, Cluster, Stack } from '../../components/layout';
13
+ // A real app reads this from the session.
14
+ var me = 'Dana Lee';
15
+ export default function AccountMenuExample() {
16
+ var _a = useState('Home'), view = _a[0], setView = _a[1];
17
+ var _b = useState(null), anchor = _b[0], setAnchor = _b[1];
18
+ var _c = useState(false), open = _c[0], setOpen = _c[1];
19
+ var _d = useState(false), confirming = _d[0], setConfirming = _d[1];
20
+ var _e = useState(false), loggingOut = _e[0], setLoggingOut = _e[1];
21
+ var _f = useState(false), loggedOut = _f[0], setLoggedOut = _f[1];
22
+ var timer = useRef();
23
+ var trigger = useRef(null);
24
+ // Where focus goes after the next render, once the element it goes to is on screen.
25
+ var focusNext = useRef();
26
+ // Stops the request if the example goes away before it ends.
27
+ useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
28
+ useEffect(function () {
29
+ var move = focusNext.current;
30
+ focusNext.current = undefined;
31
+ move === null || move === void 0 ? void 0 : move();
32
+ });
33
+ function toggle(anchorEl) {
34
+ setAnchor(anchorEl);
35
+ setOpen(function (o) { return !o; });
36
+ }
37
+ // The menu closes on any choice. Its Popover gives focus back to the trigger.
38
+ function go(next) {
39
+ setOpen(false);
40
+ setView(next);
41
+ }
42
+ // The confirm is the one in the case 'Log-out confirm'. Its Modal opens while the menu fades, so the Modal cannot
43
+ // take focus back from the menu item: 'Cancel' sends it to the trigger.
44
+ function askToLogOut() {
45
+ setOpen(false);
46
+ setConfirming(true);
47
+ }
48
+ function cancel() {
49
+ if (loggingOut)
50
+ return;
51
+ setConfirming(false);
52
+ focusNext.current = function () { var _a; return (_a = trigger.current) === null || _a === void 0 ? void 0 : _a.focus(); };
53
+ }
54
+ function logOut() {
55
+ if (loggingOut)
56
+ return;
57
+ setLoggingOut(true);
58
+ // Stands in for the request to the server.
59
+ timer.current = setTimeout(function () {
60
+ setLoggingOut(false);
61
+ setConfirming(false);
62
+ setLoggedOut(true);
63
+ }, 1200);
64
+ }
65
+ // A real app goes to its login page here. The example shows a short logged-out page instead.
66
+ if (loggedOut) {
67
+ return (<Center fill>
68
+ <Heading level={1} size="h5">You are logged out</Heading>
69
+ <Cluster>
70
+ <Button size="medium" type="primary" state="enabled" label="Log In" onClickButton={function () { setLoggedOut(false); setView('Home'); }}/>
71
+ </Cluster>
72
+ </Center>);
73
+ }
74
+ return (<Center width="page">
75
+ <Stack gap="large">
76
+ <Cluster justify="between">
77
+ <Heading level={1} size="h5">Acme</Heading>
78
+ {/* The avatar and the name are the trigger. The avatar sits beside the same name, so it is not read aloud. */}
79
+ <Button ref={trigger} size="small" type="tertiary" state={open ? 'selected' : 'enabled'} label={me} decoIcon={<UserImage userHandle={me} size={20} decorative/>} aria-label={"".concat(me, ", account menu")} aria-haspopup="menu" aria-expanded={open} onClickButton={function (e) { return toggle(e.currentTarget); }}/>
80
+ </Cluster>
81
+ <Paragraph tone="secondary" size="body2" measure="none">{view === 'Home' ? 'Logged in as dana@example.com.' : "You opened ".concat(view, ".")}</Paragraph>
82
+ </Stack>
83
+ <Popover open={open} anchorEl={anchor} onClose={function () { return setOpen(false); }} returnFocus>
84
+ <Menu navigable aria-label="Account" width={200}>
85
+ <MenuItem size="small" iconName="Settings" label="Settings" onClick={function () { return go('Settings'); }}/>
86
+ <MenuItem size="small" iconName="CircleHelp" label="Help" onClick={function () { return go('Help'); }}/>
87
+ <Line />
88
+ {/* Log Out is last. It destroys nothing, so it is a plain item, not a danger one. */}
89
+ <MenuItem size="small" iconName="LogOut" label="Log Out" onClick={askToLogOut}/>
90
+ </Menu>
91
+ </Popover>
92
+ <Modal isOpen={confirming} size="small" title="Log Out" onClose={cancel} actions={<>
93
+ <Button size="small" type="tertiary" state={loggingOut ? 'disabled' : 'enabled'} label="Cancel" onClickButton={cancel}/>
94
+ <Button size="small" type="primary" state="enabled" label="Log Out" loading={loggingOut} onClickButton={logOut}/>
95
+ </>}>
96
+ <Paragraph measure="none">You will need to log in again to use Acme on this device.</Paragraph>
97
+ </Modal>
98
+ </Center>);
99
+ }
@@ -0,0 +1,164 @@
1
+ # Account menu
2
+
3
+ A person opens a menu for their own account to change settings, get help or log out.
4
+
5
+ ## Do
6
+
7
+ - Use a small tertiary `Button` whose label is the person's name, with their `UserImage` as `decoIcon`: `decoIcon={<UserImage userHandle={name} size={20} decorative />}`.
8
+ - Make the avatar `decorative`. It sits beside the same name, so a screen reader reads the name once.
9
+ - Give the Button an `aria-label` that starts with the visible name: 'Dana Lee, account menu'.
10
+ - Set `aria-haspopup="menu"` and `aria-expanded` on the Button, and `state="selected"` while the menu is open.
11
+ - Open `<Popover returnFocus>` around `<Menu navigable aria-label="Account">` with 'Settings' and 'Help', then a `Line`, then 'Log Out' last.
12
+ - Use `onClick` items. A navigable menu's arrow keys skip an item with `href`.
13
+ - Leave 'Log Out' a plain item. It destroys nothing.
14
+ - Confirm 'Log Out' as the case 'Log-out confirm' says, in a small Modal. 'Cancel' puts focus back on the Button.
15
+
16
+ ## Don't
17
+
18
+ - Do not show only the avatar as the trigger when the name fits. The name says whose account it is.
19
+ - Do not give the avatar its own name beside the same name.
20
+ - Do not use 'Sign Out'. The words are 'Log In' and 'Log Out'.
21
+ - Do not give 'Log Out' `color="danger"`.
22
+ - Do not open the menu when the page loads.
23
+
24
+ ## Example: Avatar and name with a menu
25
+
26
+ Uses: `Button`, `Center`, `Cluster`, `Heading`, `Line`, `Menu`, `MenuItem`, `Modal`, `Paragraph`, `Popover`, `Stack`, `UserImage`
27
+
28
+ ```tsx
29
+ 'use client';
30
+ import { useEffect, useRef, useState } from 'react';
31
+ import Modal from 'oneslash-design-system/components/modal';
32
+ import Heading from 'oneslash-design-system/components/heading';
33
+ import Paragraph from 'oneslash-design-system/components/paragraph';
34
+ import Button from 'oneslash-design-system/components/button';
35
+ import UserImage from 'oneslash-design-system/components/userImage';
36
+ import Popover from 'oneslash-design-system/components/popover';
37
+ import Menu from 'oneslash-design-system/components/menu';
38
+ import MenuItem from 'oneslash-design-system/components/menuItem';
39
+ import Line from 'oneslash-design-system/components/line';
40
+ import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
41
+
42
+ // A real app reads this from the session.
43
+ const me = 'Dana Lee';
44
+
45
+ export default function AccountMenuExample() {
46
+ const [view, setView] = useState('Home');
47
+ const [anchor, setAnchor] = useState<HTMLElement | null>(null);
48
+ const [open, setOpen] = useState(false);
49
+ const [confirming, setConfirming] = useState(false);
50
+ const [loggingOut, setLoggingOut] = useState(false);
51
+ const [loggedOut, setLoggedOut] = useState(false);
52
+ const timer = useRef<ReturnType<typeof setTimeout>>();
53
+ const trigger = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
54
+ // Where focus goes after the next render, once the element it goes to is on screen.
55
+ const focusNext = useRef<() => void>();
56
+
57
+ // Stops the request if the example goes away before it ends.
58
+ useEffect(() => () => clearTimeout(timer.current), []);
59
+
60
+ useEffect(() => {
61
+ const move = focusNext.current;
62
+ focusNext.current = undefined;
63
+ move?.();
64
+ });
65
+
66
+ function toggle(anchorEl: HTMLElement) {
67
+ setAnchor(anchorEl);
68
+ setOpen((o) => !o);
69
+ }
70
+
71
+ // The menu closes on any choice. Its Popover gives focus back to the trigger.
72
+ function go(next: string) {
73
+ setOpen(false);
74
+ setView(next);
75
+ }
76
+
77
+ // The confirm is the one in the case 'Log-out confirm'. Its Modal opens while the menu fades, so the Modal cannot
78
+ // take focus back from the menu item: 'Cancel' sends it to the trigger.
79
+ function askToLogOut() {
80
+ setOpen(false);
81
+ setConfirming(true);
82
+ }
83
+
84
+ function cancel() {
85
+ if (loggingOut) return;
86
+ setConfirming(false);
87
+ focusNext.current = () => trigger.current?.focus();
88
+ }
89
+
90
+ function logOut() {
91
+ if (loggingOut) return;
92
+ setLoggingOut(true);
93
+ // Stands in for the request to the server.
94
+ timer.current = setTimeout(() => {
95
+ setLoggingOut(false);
96
+ setConfirming(false);
97
+ setLoggedOut(true);
98
+ }, 1200);
99
+ }
100
+
101
+ // A real app goes to its login page here. The example shows a short logged-out page instead.
102
+ if (loggedOut) {
103
+ return (
104
+ <Center fill>
105
+ <Heading level={1} size="h5">You are logged out</Heading>
106
+ <Cluster>
107
+ <Button size="medium" type="primary" state="enabled" label="Log In" onClickButton={() => { setLoggedOut(false); setView('Home'); }} />
108
+ </Cluster>
109
+ </Center>
110
+ );
111
+ }
112
+
113
+ return (
114
+ <Center width="page">
115
+ <Stack gap="large">
116
+ <Cluster justify="between">
117
+ <Heading level={1} size="h5">Acme</Heading>
118
+ {/* The avatar and the name are the trigger. The avatar sits beside the same name, so it is not read aloud. */}
119
+ <Button
120
+ ref={trigger}
121
+ size="small"
122
+ type="tertiary"
123
+ state={open ? 'selected' : 'enabled'}
124
+ label={me}
125
+ decoIcon={<UserImage userHandle={me} size={20} decorative />}
126
+ aria-label={`${me}, account menu`}
127
+ aria-haspopup="menu"
128
+ aria-expanded={open}
129
+ onClickButton={(e: { currentTarget: HTMLElement }) => toggle(e.currentTarget)}
130
+ />
131
+ </Cluster>
132
+ <Paragraph tone="secondary" size="body2" measure="none">{view === 'Home' ? 'Logged in as dana@example.com.' : `You opened ${view}.`}</Paragraph>
133
+ </Stack>
134
+ <Popover open={open} anchorEl={anchor} onClose={() => setOpen(false)} returnFocus>
135
+ <Menu navigable aria-label="Account" width={200}>
136
+ <MenuItem size="small" iconName="Settings" label="Settings" onClick={() => go('Settings')} />
137
+ <MenuItem size="small" iconName="CircleHelp" label="Help" onClick={() => go('Help')} />
138
+ <Line />
139
+ {/* Log Out is last. It destroys nothing, so it is a plain item, not a danger one. */}
140
+ <MenuItem size="small" iconName="LogOut" label="Log Out" onClick={askToLogOut} />
141
+ </Menu>
142
+ </Popover>
143
+ <Modal
144
+ isOpen={confirming}
145
+ size="small"
146
+ title="Log Out"
147
+ onClose={cancel}
148
+ actions={
149
+ <>
150
+ <Button size="small" type="tertiary" state={loggingOut ? 'disabled' : 'enabled'} label="Cancel" onClickButton={cancel} />
151
+ <Button size="small" type="primary" state="enabled" label="Log Out" loading={loggingOut} onClickButton={logOut} />
152
+ </>
153
+ }
154
+ >
155
+ <Paragraph measure="none">You will need to log in again to use Acme on this device.</Paragraph>
156
+ </Modal>
157
+ </Center>
158
+ );
159
+ }
160
+ ```
161
+
162
+ ## Native
163
+
164
+ On Apple use a toolbar `Menu` with a `Label` of the person's name, or the sidebar's account row. Put 'Log Out' last, and leave out the `.destructive` role. On Android use an avatar `IconButton` with a `DropdownMenu`.
@@ -6,8 +6,6 @@ The agent is about to do something that changes shared work or is hard to undo.
6
6
 
7
7
  An action is risky when it changes shared work or is hard to undo. In a product that works with code, that includes opening or merging a pull request, deleting files, closing an issue and rolling back a release. Carrying out a plan of several changes is risky too. Before a risky action the agent stops and posts a card with the exact action: every step it will take, or the changes themselves, which the person can open. The agent does nothing until the person presses the approve button.
8
8
 
9
- **Not built yet:** In Scindo the agent asks before carrying out a plan, opening a pull request and merging one. It does not yet ask before deleting files, closing an issue or rolling back a release.
10
-
11
9
  ## Why
12
10
 
13
11
  A person can only approve what they can see, and an agent's mistake in shared work costs other people.
@@ -25,5 +23,3 @@ A person can only approve what they can see, and an agent's mistake in shared wo
25
23
  - Do not replace the steps or the changes with a one-line summary.
26
24
  - Do not let the agent write the label of an approve or merge button.
27
25
  - Do not let a second click on a decided card approve or cancel it again.
28
-
29
- Seen in: Scindo.
@@ -6,8 +6,6 @@ The agent has asked a question or proposed an action, and nobody answers.
6
6
 
7
7
  The agent never takes silence as a yes: while a question or proposal waits, it does nothing that depends on the answer. Each product sets the waiting time and shows it on the waiting card. When the time is up, the agent cancels the request, marks the card Cancelled, and posts one line saying what it did not do. The agent may write a plan that lists the unanswered questions as open questions. It may not carry out anything that depends on an answer.
8
8
 
9
- **Not built yet:** No product cancels a waiting request on its own yet. In Scindo a request waits until a person answers, cancels or skips it, and the waiting time is not decided.
10
-
11
9
  ## Why
12
10
 
13
11
  An agent that acts on silence does work nobody approved, and one that waits forever leaves work stuck without saying so.
@@ -23,5 +21,3 @@ An agent that acts on silence does work nobody approved, and one that waits fore
23
21
 
24
22
  - Do not treat no answer as approval.
25
23
  - Do not cancel a request without saying so in the thread.
26
-
27
- Seen in: Scindo.
@@ -2,8 +2,6 @@
2
2
 
3
3
  The agent sees two to four ways forward and needs the person to pick one. These are ways forward for the agent's own work. For a fact or a decision only the person has, see the case 'Agent question'.
4
4
 
5
- **Not built yet:** Scindo's options card labels its button 'Confirm Selection', which reads 'Confirming...' while it loads, and marks a decided card 'Selected'. With no recommended option it preselects the first one. Scindo's Apple app shows no options card.
6
-
7
5
  ## Do
8
6
 
9
7
  - Put the card in the agent's `Message`, in a `Surface` with the question as its heading.
@@ -164,5 +162,3 @@ export default function AgentOptionsCards() {
164
162
  );
165
163
  }
166
164
  ```
167
-
168
- Seen in: Scindo.
@@ -2,8 +2,6 @@
2
2
 
3
3
  The agent is working on a request in the thread, and its reply is not ready yet.
4
4
 
5
- **Not built yet:** Scindo on the web shows no 'Agent' tag on the progress row, its Stop is an icon button with a cross, and its current step is a blinking dot. Scindo's Apple app shows no progress row: while the agent works, Send turns into Stop.
6
-
7
5
  ## Do
8
6
 
9
7
  - Follow the rule 'An agent shows its progress': one row in the thread, where the reply will appear.
@@ -428,5 +426,3 @@ export default function AgentPendingReplyStreaming() {
428
426
  );
429
427
  }
430
428
  ```
431
-
432
- Seen in: Scindo.
@@ -2,8 +2,6 @@
2
2
 
3
3
  The agent is about to change shared work and needs the person to approve it first.
4
4
 
5
- **Not built yet:** Scindo's plan button reads 'Proceed' and comes first, and its buttons change label while loading, such as 'Proceeding...' and 'Cancelling...'. Its plan card has no View Changes button and shows no waiting time. Scindo's Apple app shows no plan card.
6
-
7
5
  ## Do
8
6
 
9
7
  - Follow the rule 'An agent asks before a risky action': the agent does nothing until the person presses 'Approve'.
@@ -652,5 +650,3 @@ export default function AgentPlanProposalChanges() {
652
650
  );
653
651
  }
654
652
  ```
655
-
656
- Seen in: Scindo.
@@ -2,8 +2,6 @@
2
2
 
3
3
  The agent needs an answer from the person before it can go on. It needs a fact or a decision only the person has. For ways forward in its own work, see the case 'Agent options'.
4
4
 
5
- **Not built yet:** A waiting question in Scindo never times out: it stays open until someone answers or skips it. Its answer button reads 'Submit', and its buttons read 'Submitting...' and 'Skipping...' while they load. With no recommended answer it preselects the first one. Scindo's Apple app shows no question card.
6
-
7
5
  ## Do
8
6
 
9
7
  - Put the card in the agent's `Message`, in a `Surface` with the question as its heading.
@@ -334,5 +332,3 @@ export default function AgentQuestionFreeText() {
334
332
  );
335
333
  }
336
334
  ```
337
-
338
- Seen in: Scindo.