oneslash-design-system 2.16.0 → 2.18.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.
- package/README.md +2 -2
- package/dist/DESIGN.md +56 -17
- package/dist/cases/accept-invite/signed-in.jsx +1 -1
- package/dist/cases/accept-invite/signed-out.jsx +1 -1
- package/dist/cases/accept-invite.md +3 -7
- package/dist/cases/account-menu/menu.d.ts +1 -0
- package/dist/cases/account-menu/menu.jsx +99 -0
- package/dist/cases/account-menu.md +164 -0
- package/dist/cases/agent-asks-before-risky-action.md +0 -4
- package/dist/cases/agent-cancels-when-unanswered.md +0 -4
- package/dist/cases/agent-options/cards.d.ts +1 -0
- package/dist/cases/agent-options/cards.jsx +91 -0
- package/dist/cases/agent-options.md +164 -0
- package/dist/cases/agent-pending-reply/steps.d.ts +1 -0
- package/dist/cases/agent-pending-reply/steps.jsx +149 -0
- package/dist/cases/agent-pending-reply/streaming.d.ts +1 -0
- package/dist/cases/agent-pending-reply/streaming.jsx +146 -0
- package/dist/cases/agent-pending-reply.md +428 -0
- package/dist/cases/agent-plan-proposal/changes.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/changes.jsx +224 -0
- package/dist/cases/agent-plan-proposal/steps.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/steps.jsx +211 -0
- package/dist/cases/agent-plan-proposal.md +652 -0
- package/dist/cases/agent-question/choices.d.ts +1 -0
- package/dist/cases/agent-question/choices.jsx +132 -0
- package/dist/cases/agent-question/free-text.d.ts +1 -0
- package/dist/cases/agent-question/free-text.jsx +81 -0
- package/dist/cases/agent-question.md +334 -0
- package/dist/cases/agent-refuses-clearly.md +0 -4
- package/dist/cases/agent-says-what-it-is.md +0 -2
- package/dist/cases/agent-settings/form.d.ts +1 -0
- package/dist/cases/agent-settings/form.jsx +164 -0
- package/dist/cases/agent-settings.md +259 -0
- package/dist/cases/agent-shows-progress.md +0 -2
- package/dist/cases/agent-shows-sources.md +2 -4
- package/dist/cases/api-keys/list.d.ts +1 -0
- package/dist/cases/api-keys/list.jsx +162 -0
- package/dist/cases/api-keys.md +229 -0
- package/dist/cases/artifact-card/card.d.ts +1 -0
- package/dist/cases/artifact-card/card.jsx +45 -0
- package/dist/cases/artifact-card.md +99 -0
- package/dist/cases/auth-gate-loading.md +0 -4
- package/dist/cases/check-your-email.md +0 -4
- package/dist/cases/collapsible-search/popover.d.ts +1 -0
- package/dist/cases/collapsible-search/popover.jsx +74 -0
- package/dist/cases/collapsible-search.md +143 -0
- package/dist/cases/composer-limit/notice-with-action.d.ts +1 -0
- package/dist/cases/composer-limit/notice-with-action.jsx +87 -0
- package/dist/cases/composer-limit/notice.d.ts +1 -0
- package/dist/cases/composer-limit/notice.jsx +84 -0
- package/dist/cases/composer-limit.md +282 -0
- package/dist/cases/confirm-destructive-action.md +0 -4
- package/dist/cases/confirm-dialogs.md +0 -4
- package/dist/cases/conversation-starters/chips.d.ts +1 -0
- package/dist/cases/conversation-starters/chips.jsx +69 -0
- package/dist/cases/conversation-starters/none.d.ts +1 -0
- package/dist/cases/conversation-starters/none.jsx +45 -0
- package/dist/cases/conversation-starters.md +204 -0
- package/dist/cases/create-modal.md +0 -4
- package/dist/cases/danger-zone/collapsed.d.ts +1 -0
- package/dist/cases/danger-zone/collapsed.jsx +75 -0
- package/dist/cases/danger-zone/shown.d.ts +1 -0
- package/dist/cases/danger-zone/shown.jsx +95 -0
- package/dist/cases/danger-zone.md +263 -0
- package/dist/cases/device-login.md +0 -4
- package/dist/cases/email-confirmed.md +0 -4
- package/dist/cases/empty-list.md +0 -4
- package/dist/cases/empty-lists.md +0 -4
- package/dist/cases/empty-not-set-up.md +0 -4
- package/dist/cases/empty-search.md +0 -4
- package/dist/cases/error-page.md +0 -4
- package/dist/cases/feedback-form.md +0 -4
- package/dist/cases/filter-menu/presets.d.ts +1 -0
- package/dist/cases/filter-menu/presets.jsx +53 -0
- package/dist/cases/filter-menu/with-clear.d.ts +1 -0
- package/dist/cases/filter-menu/with-clear.jsx +56 -0
- package/dist/cases/filter-menu.md +204 -0
- package/dist/cases/forgot-password.md +0 -4
- package/dist/cases/form-errors.md +0 -4
- package/dist/cases/import-checklist.md +0 -4
- package/dist/cases/inline-form-feedback.md +0 -4
- package/dist/cases/integrations-list/nested.d.ts +1 -0
- package/dist/cases/integrations-list/nested.jsx +164 -0
- package/dist/cases/integrations-list/rows.d.ts +1 -0
- package/dist/cases/integrations-list/rows.jsx +134 -0
- package/dist/cases/integrations-list.md +379 -0
- package/dist/cases/invite-member.md +0 -4
- package/dist/cases/load-failure.md +0 -4
- package/dist/cases/log-out-confirm.md +0 -4
- package/dist/cases/login-page.md +0 -4
- package/dist/cases/members-list/rows.d.ts +1 -0
- package/dist/cases/members-list/rows.jsx +318 -0
- package/dist/cases/members-list/table.d.ts +1 -0
- package/dist/cases/members-list/table.jsx +351 -0
- package/dist/cases/members-list.md +799 -0
- package/dist/cases/mention-list/in-composer.d.ts +1 -0
- package/dist/cases/mention-list/in-composer.jsx +169 -0
- package/dist/cases/mention-list.md +248 -0
- package/dist/cases/message-actions/hover-toolbar.d.ts +1 -0
- package/dist/cases/message-actions/hover-toolbar.jsx +229 -0
- package/dist/cases/message-actions/menu.d.ts +1 -0
- package/dist/cases/message-actions/menu.jsx +258 -0
- package/dist/cases/message-actions.md +647 -0
- package/dist/cases/message-attachments/in-composer.d.ts +1 -0
- package/dist/cases/message-attachments/in-composer.jsx +134 -0
- package/dist/cases/message-attachments/in-message.d.ts +1 -0
- package/dist/cases/message-attachments/in-message.jsx +46 -0
- package/dist/cases/message-attachments.md +306 -0
- package/dist/cases/message-composer/plain.d.ts +1 -0
- package/dist/cases/message-composer/plain.jsx +57 -0
- package/dist/cases/message-composer/with-tools.d.ts +1 -0
- package/dist/cases/message-composer/with-tools.jsx +182 -0
- package/dist/cases/message-composer.md +352 -0
- package/dist/cases/message-edit/in-place.d.ts +1 -0
- package/dist/cases/message-edit/in-place.jsx +99 -0
- package/dist/cases/message-edit.md +175 -0
- package/dist/cases/message-reactions/chips.d.ts +1 -0
- package/dist/cases/message-reactions/chips.jsx +118 -0
- package/dist/cases/message-reactions/quick-pick.d.ts +1 -0
- package/dist/cases/message-reactions/quick-pick.jsx +155 -0
- package/dist/cases/message-reactions.md +367 -0
- package/dist/cases/message-row/grouped.d.ts +1 -0
- package/dist/cases/message-row/grouped.jsx +56 -0
- package/dist/cases/message-row/person-and-agent.d.ts +1 -0
- package/dist/cases/message-row/person-and-agent.jsx +41 -0
- package/dist/cases/message-row.md +185 -0
- package/dist/cases/not-found-page.md +0 -4
- package/dist/cases/notification-menu/menu.d.ts +1 -0
- package/dist/cases/notification-menu/menu.jsx +74 -0
- package/dist/cases/notification-menu.md +135 -0
- package/dist/cases/oauth-consent.md +0 -4
- package/dist/cases/on-off-settings/list.d.ts +1 -0
- package/dist/cases/on-off-settings/list.jsx +97 -0
- package/dist/cases/on-off-settings.md +116 -0
- package/dist/cases/overflow-menu/in-a-header.d.ts +1 -0
- package/dist/cases/overflow-menu/in-a-header.jsx +128 -0
- package/dist/cases/overflow-menu/on-a-row.d.ts +1 -0
- package/dist/cases/overflow-menu/on-a-row.jsx +183 -0
- package/dist/cases/overflow-menu.md +410 -0
- package/dist/cases/profile-form/form.d.ts +1 -0
- package/dist/cases/profile-form/form.jsx +153 -0
- package/dist/cases/profile-form.md +236 -0
- package/dist/cases/quick-switcher/modal.d.ts +1 -0
- package/dist/cases/quick-switcher/modal.jsx +114 -0
- package/dist/cases/quick-switcher.md +205 -0
- package/dist/cases/range-switch/segmented.d.ts +1 -0
- package/dist/cases/range-switch/segmented.jsx +30 -0
- package/dist/cases/range-switch.md +67 -0
- package/dist/cases/rename.md +0 -4
- package/dist/cases/reply-feedback/thumbs.d.ts +1 -0
- package/dist/cases/reply-feedback/thumbs.jsx +191 -0
- package/dist/cases/reply-feedback/with-reason.d.ts +1 -0
- package/dist/cases/reply-feedback/with-reason.jsx +221 -0
- package/dist/cases/reply-feedback.md +548 -0
- package/dist/cases/reply-sources/cards.d.ts +1 -0
- package/dist/cases/reply-sources/cards.jsx +83 -0
- package/dist/cases/reply-sources/tag-only.d.ts +1 -0
- package/dist/cases/reply-sources/tag-only.jsx +45 -0
- package/dist/cases/reply-sources.md +243 -0
- package/dist/cases/route-loading.md +0 -2
- package/dist/cases/scope-picker/menu.d.ts +1 -0
- package/dist/cases/scope-picker/menu.jsx +47 -0
- package/dist/cases/scope-picker.md +97 -0
- package/dist/cases/set-new-password.md +0 -4
- package/dist/cases/settings-page/side-nav.d.ts +1 -0
- package/dist/cases/settings-page/side-nav.jsx +171 -0
- package/dist/cases/settings-page/top-tabs.d.ts +1 -0
- package/dist/cases/settings-page/top-tabs.jsx +129 -0
- package/dist/cases/settings-page.md +378 -0
- package/dist/cases/settings-save.md +35 -0
- package/dist/cases/sign-up-page.md +1 -5
- package/dist/cases/slash-command-list/in-composer.d.ts +1 -0
- package/dist/cases/slash-command-list/in-composer.jsx +162 -0
- package/dist/cases/slash-command-list.md +243 -0
- package/dist/cases/success-feedback.md +1 -5
- package/dist/cases/tag-filter/tags.d.ts +1 -0
- package/dist/cases/tag-filter/tags.jsx +226 -0
- package/dist/cases/tag-filter.md +298 -0
- package/dist/cases/type-to-confirm.md +0 -4
- package/dist/cases/typing-and-status/line.d.ts +1 -0
- package/dist/cases/typing-and-status/line.jsx +50 -0
- package/dist/cases/typing-and-status.md +92 -0
- package/dist/cases/unsaved-changes-guard.md +0 -4
- package/dist/cases/upgrade-prompt.md +0 -4
- package/dist/cases.json +2331 -294
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +2 -2
- package/dist/components/button.d.ts +3 -2
- package/dist/components/button.jsx +14 -9
- package/dist/components/checkBox.d.ts +5 -1
- package/dist/components/checkBox.jsx +2 -2
- package/dist/components/composer.d.ts +74 -0
- package/dist/components/composer.jsx +122 -0
- package/dist/components/copyField.d.ts +20 -0
- package/dist/components/copyField.jsx +99 -0
- package/dist/components/fileChip.d.ts +33 -0
- package/dist/components/fileChip.jsx +61 -0
- package/dist/components/formField.d.ts +34 -0
- package/dist/components/formField.jsx +28 -0
- package/dist/components/heading.d.ts +3 -1
- package/dist/components/heading.jsx +2 -2
- package/dist/components/iconButton.d.ts +3 -3
- package/dist/components/iconButton.jsx +9 -7
- package/dist/components/layout.d.ts +7 -1
- package/dist/components/layout.jsx +5 -2
- package/dist/components/menu.d.ts +21 -0
- package/dist/components/menu.jsx +27 -3
- package/dist/components/menuItem.d.ts +12 -2
- package/dist/components/menuItem.jsx +6 -5
- package/dist/components/message.d.ts +28 -0
- package/dist/components/message.jsx +25 -0
- package/dist/components/navigation.d.ts +9 -1
- package/dist/components/navigation.jsx +15 -3
- package/dist/components/paragraph.d.ts +3 -1
- package/dist/components/paragraph.jsx +2 -2
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.jsx +35 -9
- package/dist/components/radioGroup.d.ts +12 -1
- package/dist/components/radioGroup.jsx +20 -9
- package/dist/components/segmentedControl.d.ts +22 -0
- package/dist/components/segmentedControl.jsx +54 -0
- package/dist/components/select.d.ts +5 -1
- package/dist/components/select.jsx +2 -2
- package/dist/components/settingsSection.d.ts +31 -0
- package/dist/components/settingsSection.jsx +58 -0
- package/dist/components/slidingIndicator.d.ts +50 -0
- package/dist/components/slidingIndicator.jsx +102 -0
- package/dist/components/sourceCard.d.ts +23 -0
- package/dist/components/sourceCard.jsx +56 -0
- package/dist/components/stepList.d.ts +17 -0
- package/dist/components/stepList.jsx +79 -0
- package/dist/components/switch.d.ts +25 -0
- package/dist/components/switch.jsx +55 -0
- package/dist/components/tab.jsx +5 -11
- package/dist/components/tabsContainer.jsx +5 -67
- package/dist/components/tag.d.ts +9 -1
- package/dist/components/tag.jsx +6 -4
- package/dist/components/textField.d.ts +12 -2
- package/dist/components/textField.jsx +11 -4
- package/dist/components/textarea.d.ts +5 -1
- package/dist/components/textarea.jsx +6 -21
- package/dist/components/useHotkey.d.ts +7 -0
- package/dist/components/useHotkey.js +24 -0
- package/dist/components/userImage.d.ts +9 -1
- package/dist/components/userImage.jsx +10 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/internal/autoGrow.d.ts +11 -0
- package/dist/internal/autoGrow.js +28 -0
- package/dist/internal/composer.d.ts +16 -0
- package/dist/internal/composer.js +18 -0
- package/dist/internal/copyField.d.ts +5 -0
- package/dist/internal/copyField.js +61 -0
- package/dist/internal/hotkey.d.ts +16 -0
- package/dist/internal/hotkey.js +20 -0
- package/dist/internal/menu.d.ts +6 -0
- package/dist/internal/menu.js +31 -0
- package/dist/internal/switch.d.ts +5 -0
- package/dist/internal/switch.js +9 -0
- package/dist/native-mapping.json +62 -1
- package/dist/stories/Button.stories.d.ts +1 -0
- package/dist/stories/Button.stories.jsx +17 -1
- package/dist/stories/Cases.generated.stories.d.ts +53 -0
- package/dist/stories/Cases.generated.stories.jsx +106 -0
- package/dist/stories/Composer.stories.d.ts +23 -0
- package/dist/stories/Composer.stories.jsx +121 -0
- package/dist/stories/CopyField.stories.d.ts +11 -0
- package/dist/stories/CopyField.stories.jsx +65 -0
- package/dist/stories/FileChip.stories.d.ts +7 -0
- package/dist/stories/FileChip.stories.jsx +35 -0
- package/dist/stories/FormField.stories.d.ts +6 -0
- package/dist/stories/FormField.stories.jsx +44 -0
- package/dist/stories/IconButton.stories.d.ts +1 -0
- package/dist/stories/IconButton.stories.jsx +18 -1
- package/dist/stories/Menu.stories.d.ts +4 -0
- package/dist/stories/Menu.stories.jsx +46 -1
- package/dist/stories/MenuItem.stories.d.ts +1 -0
- package/dist/stories/MenuItem.stories.jsx +8 -0
- package/dist/stories/Message.stories.d.ts +10 -0
- package/dist/stories/Message.stories.jsx +77 -0
- package/dist/stories/Navigation.stories.d.ts +1 -0
- package/dist/stories/Navigation.stories.jsx +17 -1
- package/dist/stories/PageComponents.stories.d.ts +1 -0
- package/dist/stories/PageComponents.stories.jsx +21 -0
- package/dist/stories/RadioGroup.stories.d.ts +2 -0
- package/dist/stories/RadioGroup.stories.jsx +40 -1
- package/dist/stories/SegmentedControl.stories.d.ts +8 -0
- package/dist/stories/SegmentedControl.stories.jsx +33 -0
- package/dist/stories/SettingsSection.stories.d.ts +11 -0
- package/dist/stories/SettingsSection.stories.jsx +64 -0
- package/dist/stories/SourceCard.stories.d.ts +8 -0
- package/dist/stories/SourceCard.stories.jsx +33 -0
- package/dist/stories/StepList.stories.d.ts +8 -0
- package/dist/stories/StepList.stories.jsx +35 -0
- package/dist/stories/Switch.stories.d.ts +14 -0
- package/dist/stories/Switch.stories.jsx +87 -0
- package/dist/stories/TextField.stories.d.ts +1 -0
- package/dist/stories/TextField.stories.jsx +13 -0
- package/dist/stories/UserImage.stories.d.ts +2 -0
- package/dist/stories/UserImage.stories.jsx +19 -0
- package/package.json +8 -3
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.
|
|
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.18.0 has 74: eleven rules and 63 design cases for auth pages, confirms and modals, states, chat and agent interfaces, settings and menus.
|
|
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
|
@@ -295,9 +295,13 @@ For each web component, the table gives the native control to use. System contro
|
|
|
295
295
|
| 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
296
|
| brandIcon | the provider's own button where one exists (`SignInWithAppleButton`), else an asset in the app | an asset in the app | |
|
|
297
297
|
| checkBox | `Toggle` (switch on iOS, `.toggleStyle(.checkbox)` on macOS) | `Checkbox` | |
|
|
298
|
+
| 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. |
|
|
299
|
+
| 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. |
|
|
298
300
|
| emptyBox | `ContentUnavailableView` | `OdsEmptyState` | The system has this control on Apple, so ODS adds no part there. Material has none, so ODS does. |
|
|
299
301
|
| factsRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `LabeledContent` rows in a `Form` / `ListItem` rows. |
|
|
300
302
|
| 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. |
|
|
303
|
+
| 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. |
|
|
304
|
+
| 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. |
|
|
301
305
|
| form | `Form` | A `Column` of fields; submit from the keyboard action | On Apple the system lays the fields out; do not add spacing. |
|
|
302
306
|
| 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() }` | |
|
|
303
307
|
| icon | `Image(systemName:)` (SF Symbols) | Material Symbols | |
|
|
@@ -311,6 +315,7 @@ For each web component, the table gives the native control to use. System contro
|
|
|
311
315
|
| loadingScreen | `ProgressView` | `CircularProgressIndicator` | |
|
|
312
316
|
| menu | `Menu` or `.contextMenu` | `DropdownMenu` | |
|
|
313
317
|
| menuItem | `Button` inside a `Menu` | `DropdownMenuItem` | In a sidebar: a `List` row / `NavigationDrawerItem`. |
|
|
318
|
+
| message | An `HStack` with `ODSAvatar` and a `VStack` of the header and the body | A `Row` with `OdsAvatar` and a `Column` of the header and the body | SwiftUI and Compose have no message row. Mark an agent with `ODSTag` / `OdsTag` after its name. |
|
|
314
319
|
| modal | `.sheet` or `.alert` | `ModalBottomSheet` or `AlertDialog` | `ModalBottomSheet` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
|
|
315
320
|
| navigation | `NavigationSplitView` with a sidebar `List` | `NavigationRail` or `ModalNavigationDrawer` with `NavigationDrawerItem` | |
|
|
316
321
|
| numberedRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: rows of a `List` / `ListItem`s. |
|
|
@@ -318,10 +323,15 @@ For each web component, the table gives the native control to use. System contro
|
|
|
318
323
|
| pageShell | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `NavigationStack` / `Scaffold`. |
|
|
319
324
|
| paragraph | `Text` with `.font(.body)` | `Text` with `MaterialTheme.typography.bodyLarge` | |
|
|
320
325
|
| popover | `.popover` | `DropdownMenu` | Larger anchored content on Android: `ModalBottomSheet`. |
|
|
321
|
-
| radioGroup | `Picker` (`.inline` on iOS, `.radioGroup` on macOS) | `RadioButton`s in a `Column` with `Modifier.selectableGroup()` |
|
|
326
|
+
| 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. |
|
|
322
327
|
| 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`. |
|
|
328
|
+
| 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. |
|
|
323
329
|
| select | `Picker` or `Menu` | `ExposedDropdownMenuBox` | |
|
|
330
|
+
| 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`. |
|
|
331
|
+
| 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. |
|
|
332
|
+
| 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. |
|
|
324
333
|
| surface | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: a `Form` section or `GroupBox` / `Card`. |
|
|
334
|
+
| 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. |
|
|
325
335
|
| tab | `TabView` or segmented `Picker` | `PrimaryTabRow` | One `Tab` inside `TabView` or one segment / one `Tab`. `TabRow` is deprecated in Material 3. |
|
|
326
336
|
| tableCell | A `TableColumn` content view | `Text` in a `Row` with `Modifier.weight` | Material 3 has no table. |
|
|
327
337
|
| tableContainer | `Table` | `LazyColumn` of `Row`s | Material 3 has no table. A compact-width iPhone `Table` shows only its first column. |
|
|
@@ -384,8 +394,6 @@ The agent is about to do something that changes shared work or is hard to undo.
|
|
|
384
394
|
|
|
385
395
|
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.
|
|
386
396
|
|
|
387
|
-
**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.
|
|
388
|
-
|
|
389
397
|
File: cases/agent-asks-before-risky-action.md
|
|
390
398
|
|
|
391
399
|
### An agent cancels and reports when nobody answers
|
|
@@ -394,8 +402,6 @@ The agent has asked a question or proposed an action, and nobody answers.
|
|
|
394
402
|
|
|
395
403
|
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.
|
|
396
404
|
|
|
397
|
-
**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.
|
|
398
|
-
|
|
399
405
|
File: cases/agent-cancels-when-unanswered.md
|
|
400
406
|
|
|
401
407
|
### An agent refuses clearly
|
|
@@ -404,8 +410,6 @@ The product will not let the agent answer a request, for example because the wor
|
|
|
404
410
|
|
|
405
411
|
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.
|
|
406
412
|
|
|
407
|
-
**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.
|
|
408
|
-
|
|
409
413
|
File: cases/agent-refuses-clearly.md
|
|
410
414
|
|
|
411
415
|
### An agent says what it is
|
|
@@ -428,7 +432,7 @@ File: cases/agent-shows-progress.md
|
|
|
428
432
|
|
|
429
433
|
The agent answers from things it read: documents, files, chat, tasks, or a connected service such as a code host or a design tool.
|
|
430
434
|
|
|
431
|
-
Answer: Under the reply, the agent lists what it used. A small tag names the kinds of source, such as 'From Chat · Knowledge base', and one card per source shows its title, its kind and where it lives. Each card opens the source. A reply that used no sources shows no sources section.
|
|
435
|
+
Answer: Under the reply, the agent lists what it used. A small tag names the kinds of source, such as 'From Chat · Knowledge base', and one card per source shows its title, its kind and where it lives. Each card opens the source. A reply that used no sources shows no sources section. When the reply read only the messages already on screen above it, the Tag alone is enough.
|
|
432
436
|
|
|
433
437
|
File: cases/agent-shows-sources.md
|
|
434
438
|
|
|
@@ -438,8 +442,6 @@ An action a person takes themselves needs their yes before it happens. An action
|
|
|
438
442
|
|
|
439
443
|
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.
|
|
440
444
|
|
|
441
|
-
**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.
|
|
442
|
-
|
|
443
445
|
File: cases/confirm-dialogs.md
|
|
444
446
|
|
|
445
447
|
### An empty list says what will fill it
|
|
@@ -448,8 +450,6 @@ A list, table or pane has nothing to show.
|
|
|
448
450
|
|
|
449
451
|
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.
|
|
450
452
|
|
|
451
|
-
**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.
|
|
452
|
-
|
|
453
453
|
File: cases/empty-lists.md
|
|
454
454
|
|
|
455
455
|
### A form error shows next to the problem
|
|
@@ -458,27 +458,43 @@ A form was submitted and something is wrong.
|
|
|
458
458
|
|
|
459
459
|
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()`.
|
|
460
460
|
|
|
461
|
-
**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.
|
|
462
|
-
|
|
463
461
|
File: cases/form-errors.md
|
|
464
462
|
|
|
463
|
+
### A setting saves in place, or with one Save Button
|
|
464
|
+
|
|
465
|
+
A person changes a setting.
|
|
466
|
+
|
|
467
|
+
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.
|
|
468
|
+
|
|
469
|
+
File: cases/settings-save.md
|
|
470
|
+
|
|
465
471
|
### Success shows where the person is looking
|
|
466
472
|
|
|
467
473
|
Something the person did has worked.
|
|
468
474
|
|
|
469
|
-
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 a Button sends an email again, it reads 'Sent' for 2 seconds. The message names the thing and does not say 'successfully'.
|
|
470
|
-
|
|
471
|
-
**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'.
|
|
475
|
+
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'.
|
|
472
476
|
|
|
473
477
|
File: cases/success-feedback.md
|
|
474
478
|
|
|
475
479
|
| Case | When | File |
|
|
476
480
|
| --- | --- | --- |
|
|
477
481
|
| Invite link page | A person opens an invite link to join a workspace. | cases/accept-invite.md |
|
|
482
|
+
| Account menu | A person opens a menu for their own account to change settings, get help or log out. | cases/account-menu.md |
|
|
483
|
+
| 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
|
+
| 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
|
+
| Plan proposal | The agent is about to change shared work and needs the person to approve it first. | cases/agent-plan-proposal.md |
|
|
486
|
+
| 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 |
|
|
487
|
+
| 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 |
|
|
488
|
+
| 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 |
|
|
489
|
+
| Document card | The agent made a document for the person, such as a plan or a report. | cases/artifact-card.md |
|
|
478
490
|
| 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 |
|
|
479
491
|
| Check your email | A person signed up, and the product sent a link to confirm their email. | cases/check-your-email.md |
|
|
492
|
+
| 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 |
|
|
493
|
+
| 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 |
|
|
480
494
|
| Delete confirm | A person asks to delete or remove something, and it cannot be undone. | cases/confirm-destructive-action.md |
|
|
495
|
+
| Conversation starters | A thread has no messages yet, and the person may not know what to write first. | cases/conversation-starters.md |
|
|
481
496
|
| 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 |
|
|
497
|
+
| 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 |
|
|
482
498
|
| 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 |
|
|
483
499
|
| Email confirmed | A person opened the link that confirms their email. | cases/email-confirmed.md |
|
|
484
500
|
| Empty list | A list has loaded, and there is nothing in it yet. | cases/empty-list.md |
|
|
@@ -486,19 +502,42 @@ File: cases/success-feedback.md
|
|
|
486
502
|
| Empty search | A search or a filter finds nothing. | cases/empty-search.md |
|
|
487
503
|
| Error page | Something broke while showing a page, and the app cannot show it. | cases/error-page.md |
|
|
488
504
|
| Feedback form | A person sends feedback about the product from inside it. | cases/feedback-form.md |
|
|
505
|
+
| Filter menu | A person narrows a list by one choice, such as a date range, or turns the filter off. | cases/filter-menu.md |
|
|
489
506
|
| Forgot password | A person cannot remember their password and asks for a link to set a new one. | cases/forgot-password.md |
|
|
490
507
|
| Import checklist | A person picks which items to bring in from another place, such as pages from a wiki. | cases/import-checklist.md |
|
|
491
508
|
| 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 |
|
|
509
|
+
| Integrations | A person connects the product to other tools, sees which ones are connected and disconnects them. | cases/integrations-list.md |
|
|
492
510
|
| Member invite | A person invites someone to join a workspace. | cases/invite-member.md |
|
|
493
511
|
| Load failure | A list or a section could not load. | cases/load-failure.md |
|
|
494
512
|
| Log-out confirm | A person chooses Log Out. | cases/log-out-confirm.md |
|
|
495
513
|
| Login page | A person who already has an account opens the product and is not logged in. | cases/login-page.md |
|
|
514
|
+
| Members | An admin sees who is in the workspace, changes their roles, removes people and invites more. | cases/members-list.md |
|
|
515
|
+
| Mention list | A person types @ in the message box to name someone, or the agent. | cases/mention-list.md |
|
|
516
|
+
| Message actions | A person acts on one message: reacts to it, copies it, edits or deletes it. | cases/message-actions.md |
|
|
517
|
+
| Attachments | A person adds files to a message, and people open the files in a message that was sent. | cases/message-attachments.md |
|
|
518
|
+
| Message composer | A person writes a message at the bottom of a thread. | cases/message-composer.md |
|
|
519
|
+
| Message edit | A person changes the text of a message they sent. | cases/message-edit.md |
|
|
520
|
+
| Reactions | People answer a message with an emoji instead of a reply. | cases/message-reactions.md |
|
|
521
|
+
| Message row | A thread shows messages from people, and sometimes from an agent. | cases/message-row.md |
|
|
496
522
|
| Page not found | A person opens a link to a page that does not exist. | cases/not-found-page.md |
|
|
523
|
+
| Notification setting | A person chooses how much a channel or a thread notifies them. | cases/notification-menu.md |
|
|
497
524
|
| 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 |
|
|
525
|
+
| On and off settings | A person turns things on and off, such as which notifications they get. | cases/on-off-settings.md |
|
|
526
|
+
| 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 |
|
|
527
|
+
| Profile | A person changes how they appear and how they sign in: their picture, their name and their password. | cases/profile-form.md |
|
|
528
|
+
| 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 |
|
|
529
|
+
| 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 |
|
|
498
530
|
| Rename | A person renames something, such as a project or a channel. | cases/rename.md |
|
|
531
|
+
| Reply feedback | The agent has replied, and the person can say whether the reply helped. | cases/reply-feedback.md |
|
|
532
|
+
| Reply sources | The agent answered from things it read, and the person may want to check them. | cases/reply-sources.md |
|
|
499
533
|
| Page loading | A page or a pane is loading, and there is nothing to show yet. | cases/route-loading.md |
|
|
534
|
+
| Scope picker | A person chooses where a search or a question looks, such as one workspace or all of them. | cases/scope-picker.md |
|
|
500
535
|
| Set new password | A person opened the link to reset their password and now chooses a new one. | cases/set-new-password.md |
|
|
536
|
+
| Settings page | A person opens the settings of the product and looks for one area, such as Profile or Billing. | cases/settings-page.md |
|
|
501
537
|
| Sign-up page | A person who has no account yet opens the product and wants one. | cases/sign-up-page.md |
|
|
538
|
+
| Command list | A person types / at the start of the message box to run a command. | cases/slash-command-list.md |
|
|
539
|
+
| Tag filter | A person filters a list by a tag, and adds, renames and deletes the tags themselves. | cases/tag-filter.md |
|
|
502
540
|
| 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 |
|
|
541
|
+
| Typing line | Other people in the thread are writing a message that has not arrived yet. | cases/typing-and-status.md |
|
|
503
542
|
| Unsaved changes | A person closes or leaves something they changed and did not save. | cases/unsaved-changes-guard.md |
|
|
504
543
|
| Upgrade prompt | A person reaches something their plan does not include, or a limit of their plan. | cases/upgrade-prompt.md |
|
|
@@ -42,7 +42,7 @@ export default function AcceptInviteSignedIn() {
|
|
|
42
42
|
<Stack gap="medium">
|
|
43
43
|
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
44
44
|
<Cluster gap="small">
|
|
45
|
-
<UserImage userHandle="Dana Lee"/>
|
|
45
|
+
<UserImage userHandle="Dana Lee" decorative/>
|
|
46
46
|
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
47
47
|
</Cluster>
|
|
48
48
|
{/* An open link names no address, so the page shows only the workspace and the role. */}
|
|
@@ -18,7 +18,7 @@ export default function AcceptInviteSignedOut() {
|
|
|
18
18
|
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
19
19
|
{/* 'Invited by' shows on every invite. */}
|
|
20
20
|
<Cluster gap="small">
|
|
21
|
-
<UserImage userHandle="Dana Lee"/>
|
|
21
|
+
<UserImage userHandle="Dana Lee" decorative/>
|
|
22
22
|
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
23
23
|
</Cluster>
|
|
24
24
|
{/* The address sentence shows only when the invite is tied to an address, and the address is masked: anyone who holds the link sees this page.
|
|
@@ -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".
|
|
@@ -59,7 +57,7 @@ export default function AcceptInviteSignedOut() {
|
|
|
59
57
|
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
60
58
|
{/* 'Invited by' shows on every invite. */}
|
|
61
59
|
<Cluster gap="small">
|
|
62
|
-
<UserImage userHandle="Dana Lee" />
|
|
60
|
+
<UserImage userHandle="Dana Lee" decorative />
|
|
63
61
|
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
64
62
|
</Cluster>
|
|
65
63
|
{/* The address sentence shows only when the invite is tied to an address, and the address is masked: anyone who holds the link sees this page.
|
|
@@ -138,7 +136,7 @@ export default function AcceptInviteSignedIn() {
|
|
|
138
136
|
<Stack gap="medium">
|
|
139
137
|
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
140
138
|
<Cluster gap="small">
|
|
141
|
-
<UserImage userHandle="Dana Lee" />
|
|
139
|
+
<UserImage userHandle="Dana Lee" decorative />
|
|
142
140
|
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
143
141
|
</Cluster>
|
|
144
142
|
{/* An open link names no address, so the page shows only the workspace and the role. */}
|
|
@@ -156,6 +154,4 @@ export default function AcceptInviteSignedIn() {
|
|
|
156
154
|
|
|
157
155
|
## Native
|
|
158
156
|
|
|
159
|
-
On Apple,
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AgentOptionsCards(): import("react").JSX.Element;
|