oneslash-design-system 2.15.0 → 2.16.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 +6 -1
- package/dist/DESIGN.md +75 -71
- package/dist/cases/accept-invite/signed-in.d.ts +1 -0
- package/dist/cases/accept-invite/signed-in.jsx +57 -0
- package/dist/cases/accept-invite/signed-out.d.ts +1 -0
- package/dist/cases/accept-invite/signed-out.jsx +33 -0
- package/dist/cases/accept-invite.md +161 -0
- package/dist/cases/agent-asks-before-risky-action.md +1 -1
- package/dist/cases/agent-cancels-when-unanswered.md +1 -1
- package/dist/cases/auth-gate-loading/spinner-with-line.d.ts +1 -0
- package/dist/cases/auth-gate-loading/spinner-with-line.jsx +10 -0
- package/dist/cases/auth-gate-loading/spinner.d.ts +1 -0
- package/dist/cases/auth-gate-loading/spinner.jsx +10 -0
- package/dist/cases/auth-gate-loading.md +70 -0
- package/dist/cases/check-your-email/alert-on-login.d.ts +1 -0
- package/dist/cases/check-your-email/alert-on-login.jsx +78 -0
- package/dist/cases/check-your-email/page.d.ts +1 -0
- package/dist/cases/check-your-email/page.jsx +49 -0
- package/dist/cases/check-your-email.md +184 -0
- package/dist/cases/confirm-destructive-action/inline.d.ts +1 -0
- package/dist/cases/confirm-destructive-action/inline.jsx +69 -0
- package/dist/cases/confirm-destructive-action/modal.d.ts +1 -0
- package/dist/cases/confirm-destructive-action/modal.jsx +66 -0
- package/dist/cases/confirm-destructive-action.md +211 -0
- package/dist/cases/confirm-dialogs.md +36 -0
- package/dist/cases/create-modal/quick.d.ts +1 -0
- package/dist/cases/create-modal/quick.jsx +80 -0
- package/dist/cases/create-modal/with-settings.d.ts +1 -0
- package/dist/cases/create-modal/with-settings.jsx +99 -0
- package/dist/cases/create-modal.md +244 -0
- package/dist/cases/device-login/popup.d.ts +1 -0
- package/dist/cases/device-login/popup.jsx +14 -0
- package/dist/cases/device-login/provider-first.d.ts +1 -0
- package/dist/cases/device-login/provider-first.jsx +98 -0
- package/dist/cases/device-login.md +171 -0
- package/dist/cases/email-confirmed/alert-on-login.d.ts +1 -0
- package/dist/cases/email-confirmed/alert-on-login.jsx +78 -0
- package/dist/cases/email-confirmed/page.d.ts +1 -0
- package/dist/cases/email-confirmed/page.jsx +21 -0
- package/dist/cases/email-confirmed.md +151 -0
- package/dist/cases/empty-list/region.d.ts +1 -0
- package/dist/cases/empty-list/region.jsx +13 -0
- package/dist/cases/empty-list/section.d.ts +1 -0
- package/dist/cases/empty-list/section.jsx +17 -0
- package/dist/cases/empty-list.md +77 -0
- package/dist/cases/empty-lists.md +35 -0
- package/dist/cases/empty-not-set-up/action.d.ts +1 -0
- package/dist/cases/empty-not-set-up/action.jsx +16 -0
- package/dist/cases/empty-not-set-up/pointer.d.ts +1 -0
- package/dist/cases/empty-not-set-up/pointer.jsx +13 -0
- package/dist/cases/empty-not-set-up.md +88 -0
- package/dist/cases/empty-search/clear-search.d.ts +1 -0
- package/dist/cases/empty-search/clear-search.jsx +29 -0
- package/dist/cases/empty-search.md +77 -0
- package/dist/cases/error-page/full-page.d.ts +1 -0
- package/dist/cases/error-page/full-page.jsx +19 -0
- package/dist/cases/error-page/in-shell.d.ts +1 -0
- package/dist/cases/error-page/in-shell.jsx +39 -0
- package/dist/cases/error-page.md +107 -0
- package/dist/cases/feedback-form/modal.d.ts +1 -0
- package/dist/cases/feedback-form/modal.jsx +89 -0
- package/dist/cases/feedback-form.md +139 -0
- package/dist/cases/forgot-password/in-place.d.ts +1 -0
- package/dist/cases/forgot-password/in-place.jsx +155 -0
- package/dist/cases/forgot-password/own-page.d.ts +1 -0
- package/dist/cases/forgot-password/own-page.jsx +99 -0
- package/dist/cases/forgot-password.md +328 -0
- package/dist/cases/form-errors.md +32 -0
- package/dist/cases/import-checklist/modal.d.ts +1 -0
- package/dist/cases/import-checklist/modal.jsx +125 -0
- package/dist/cases/import-checklist.md +188 -0
- package/dist/cases/inline-form-feedback/button-label.d.ts +1 -0
- package/dist/cases/inline-form-feedback/button-label.jsx +54 -0
- package/dist/cases/inline-form-feedback/inline-alert.d.ts +1 -0
- package/dist/cases/inline-form-feedback/inline-alert.jsx +49 -0
- package/dist/cases/inline-form-feedback/toast.d.ts +1 -0
- package/dist/cases/inline-form-feedback/toast.jsx +66 -0
- package/dist/cases/inline-form-feedback.md +237 -0
- package/dist/cases/invite-member/by-email.d.ts +1 -0
- package/dist/cases/invite-member/by-email.jsx +98 -0
- package/dist/cases/invite-member/by-link.d.ts +1 -0
- package/dist/cases/invite-member/by-link.jsx +122 -0
- package/dist/cases/invite-member.md +321 -0
- package/dist/cases/load-failure/inline.d.ts +1 -0
- package/dist/cases/load-failure/inline.jsx +52 -0
- package/dist/cases/load-failure/region.d.ts +1 -0
- package/dist/cases/load-failure/region.jsx +34 -0
- package/dist/cases/load-failure.md +155 -0
- package/dist/cases/log-out-confirm/modal.d.ts +1 -0
- package/dist/cases/log-out-confirm/modal.jsx +57 -0
- package/dist/cases/log-out-confirm.md +106 -0
- package/dist/cases/login-page/centered.jsx +10 -7
- package/dist/cases/login-page/email-only.jsx +11 -8
- package/dist/cases/login-page/provider-first.jsx +12 -9
- package/dist/cases/login-page/split.jsx +11 -8
- package/dist/cases/login-page.md +58 -41
- package/dist/cases/not-found-page/full-page.d.ts +1 -0
- package/dist/cases/not-found-page/full-page.jsx +16 -0
- package/dist/cases/not-found-page/in-shell.d.ts +1 -0
- package/dist/cases/not-found-page/in-shell.jsx +36 -0
- package/dist/cases/not-found-page.md +98 -0
- package/dist/cases/oauth-consent/simple.d.ts +1 -0
- package/dist/cases/oauth-consent/simple.jsx +73 -0
- package/dist/cases/oauth-consent/with-scope.d.ts +1 -0
- package/dist/cases/oauth-consent/with-scope.jsx +89 -0
- package/dist/cases/oauth-consent.md +233 -0
- package/dist/cases/rename/inline.d.ts +1 -0
- package/dist/cases/rename/inline.jsx +58 -0
- package/dist/cases/rename/modal.d.ts +1 -0
- package/dist/cases/rename/modal.jsx +70 -0
- package/dist/cases/rename.md +205 -0
- package/dist/cases/route-loading/full-screen.d.ts +1 -0
- package/dist/cases/route-loading/full-screen.jsx +8 -0
- package/dist/cases/route-loading/region.d.ts +1 -0
- package/dist/cases/route-loading/region.jsx +26 -0
- package/dist/cases/route-loading.md +84 -0
- package/dist/cases/set-new-password/form.d.ts +1 -0
- package/dist/cases/set-new-password/form.jsx +130 -0
- package/dist/cases/set-new-password/invalid-link.d.ts +1 -0
- package/dist/cases/set-new-password/invalid-link.jsx +50 -0
- package/dist/cases/set-new-password.md +247 -0
- package/dist/cases/sign-up-page/centered.d.ts +1 -0
- package/dist/cases/sign-up-page/centered.jsx +124 -0
- package/dist/cases/sign-up-page/provider-first.d.ts +1 -0
- package/dist/cases/sign-up-page/provider-first.jsx +124 -0
- package/dist/cases/sign-up-page/split.d.ts +1 -0
- package/dist/cases/sign-up-page/split.jsx +134 -0
- package/dist/cases/sign-up-page.md +478 -0
- package/dist/cases/success-feedback.md +35 -0
- package/dist/cases/type-to-confirm/inline.d.ts +1 -0
- package/dist/cases/type-to-confirm/inline.jsx +69 -0
- package/dist/cases/type-to-confirm/modal.d.ts +1 -0
- package/dist/cases/type-to-confirm/modal.jsx +73 -0
- package/dist/cases/type-to-confirm.md +222 -0
- package/dist/cases/unsaved-changes-guard/discard.d.ts +1 -0
- package/dist/cases/unsaved-changes-guard/discard.jsx +81 -0
- package/dist/cases/unsaved-changes-guard/save-or-discard.d.ts +1 -0
- package/dist/cases/unsaved-changes-guard/save-or-discard.jsx +85 -0
- package/dist/cases/unsaved-changes-guard.md +239 -0
- package/dist/cases/upgrade-prompt/inline.d.ts +1 -0
- package/dist/cases/upgrade-prompt/inline.jsx +52 -0
- package/dist/cases/upgrade-prompt/modal.d.ts +1 -0
- package/dist/cases/upgrade-prompt/modal.jsx +43 -0
- package/dist/cases/upgrade-prompt.md +174 -0
- package/dist/cases.json +1856 -39
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +6 -4
- package/dist/components/emptyBox.d.ts +6 -1
- package/dist/components/emptyBox.jsx +4 -2
- package/dist/components/heading.d.ts +2 -2
- package/dist/components/loadingScreen.d.ts +5 -1
- package/dist/components/loadingScreen.jsx +4 -2
- package/dist/components/modal.d.ts +2 -1
- package/dist/components/modal.jsx +20 -8
- package/dist/components/radioGroup.d.ts +2 -1
- package/dist/components/radioGroup.jsx +2 -2
- package/dist/components/select.d.ts +2 -1
- package/dist/components/select.jsx +4 -2
- package/dist/components/tab.jsx +3 -2
- package/dist/components/tabsContainer.d.ts +4 -1
- package/dist/components/tabsContainer.jsx +7 -3
- package/dist/components/textField.d.ts +5 -1
- package/dist/components/textField.jsx +7 -3
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.jsx +103 -0
- package/dist/internal/alert.d.ts +4 -0
- package/dist/internal/alert.js +6 -0
- package/dist/internal/modal.d.ts +2 -0
- package/dist/internal/modal.js +21 -0
- package/dist/internal/toaster.d.ts +19 -0
- package/dist/internal/toaster.js +50 -0
- package/dist/native-mapping.json +6 -0
- package/dist/stories/Alert.stories.d.ts +1 -0
- package/dist/stories/Alert.stories.jsx +16 -0
- package/dist/stories/Cases.generated.stories.d.ts +52 -0
- package/dist/stories/Cases.generated.stories.jsx +104 -0
- package/dist/stories/EmptyBox.stories.d.ts +2 -0
- package/dist/stories/EmptyBox.stories.jsx +16 -0
- package/dist/stories/Heading.stories.d.ts +6 -0
- package/dist/stories/Heading.stories.jsx +10 -0
- package/dist/stories/LoadingScreen.stories.d.ts +1 -0
- package/dist/stories/LoadingScreen.stories.jsx +8 -0
- package/dist/stories/Modal.stories.d.ts +2 -0
- package/dist/stories/Modal.stories.jsx +36 -0
- package/dist/stories/RadioGroup.stories.d.ts +1 -0
- package/dist/stories/RadioGroup.stories.jsx +14 -0
- package/dist/stories/Select.stories.d.ts +1 -0
- package/dist/stories/Select.stories.jsx +14 -0
- package/dist/stories/TabsContainer.stories.d.ts +1 -0
- package/dist/stories/TabsContainer.stories.jsx +12 -0
- package/dist/stories/TextField.stories.d.ts +2 -0
- package/dist/stories/TextField.stories.jsx +22 -0
- package/dist/stories/Toaster.stories.d.ts +6 -0
- package/dist/stories/Toaster.stories.jsx +29 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,11 @@ The package ships Tailwind class names, CSS variables and untranspiled `.jsx`. E
|
|
|
34
34
|
|
|
35
35
|
Use class names that mean the same thing in Tailwind v3 and v4 inside components, since apps on both versions compile them.
|
|
36
36
|
|
|
37
|
+
Mount `<Toaster />` (from `oneslash-design-system/components/toaster`) once, near the app root.
|
|
38
|
+
Call `toast('Saved')` from client code (event handlers and effects), not from a Server Component or a server action; it closes itself after 5 seconds.
|
|
39
|
+
An error toast, `toast({ type: 'error', message })`, stays until the person closes it.
|
|
40
|
+
A toast pauses its timer while the pointer or focus is on it.
|
|
41
|
+
|
|
37
42
|
## Using the design system in a native app
|
|
38
43
|
|
|
39
44
|
The Swift package `OneSlashDesign` (iOS 26 and macOS 26 and later) is this repository: `https://github.com/oneSlash-app/design-system`.
|
|
@@ -65,7 +70,7 @@ import SectionIntro from 'oneslash-design-system/components/sectionIntro';
|
|
|
65
70
|
|
|
66
71
|
## Design cases
|
|
67
72
|
|
|
68
|
-
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
|
|
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.16.0 has 38: ten rules and 28 design cases for auth pages, confirms and modals, and empty, failed and loading states.
|
|
69
74
|
|
|
70
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.
|
|
71
76
|
- `oneslash-design-system/cases/<id>.md` is one case as text, and `oneslash-design-system/cases/<id>/<option>.jsx` is the example itself.
|
package/dist/DESIGN.md
CHANGED
|
@@ -333,6 +333,7 @@ For each web component, the table gives the native control to use. System contro
|
|
|
333
333
|
| textarea | `TextField(_:text:axis: .vertical)` or `TextEditor` | `OutlinedTextField` with `minLines` | |
|
|
334
334
|
| textField | `TextField` (`SecureField` for passwords) | `OutlinedTextField` or `TextField` | |
|
|
335
335
|
| timeStamp | `Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`) | `Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime` | |
|
|
336
|
+
| 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. |
|
|
336
337
|
| tooltip | `.help` | `TooltipBox` | `.help` shows on pointer hover only. `TooltipBox` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
|
|
337
338
|
| userImage | `ODSAvatar` | `OdsAvatar` | Load the picture yourself and pass it as an `Image` / a `Painter`. |
|
|
338
339
|
|
|
@@ -373,9 +374,9 @@ A style is named `<part>.<variant>.<color or state>`. Each piece of it takes one
|
|
|
373
374
|
|
|
374
375
|
## Cases
|
|
375
376
|
|
|
376
|
-
A case answers one design question the way oneSlash does, such as how to lay out a login page or how an agent asks before a risky action. A rule gives one answer
|
|
377
|
+
A case answers one design question the way oneSlash does, such as how to lay out a login page or how an agent asks before a risky action. A rule gives one answer. Its answer is printed here; its reasons and its do and don't lines are in the file it names.
|
|
377
378
|
|
|
378
|
-
A design case has
|
|
379
|
+
A design case has one to four options, each with a working example. Open the file named in the table for the one you need. In an app, import a component like this: `import Button from 'oneslash-design-system/components/button'`.
|
|
379
380
|
|
|
380
381
|
### An agent asks before a risky action
|
|
381
382
|
|
|
@@ -385,19 +386,7 @@ Answer: An action is risky when it changes shared work or is hard to undo. In a
|
|
|
385
386
|
|
|
386
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.
|
|
387
388
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
Do:
|
|
391
|
-
- List every step in the card, in the order the agent will do them.
|
|
392
|
-
- Offer a way to see the full changes, such as a View Changes button, before the approve button is pressed.
|
|
393
|
-
- Let the person edit the plan or cancel it, not only approve it.
|
|
394
|
-
- Once decided, mark the card Approved or Cancelled and remove its buttons.
|
|
395
|
-
|
|
396
|
-
Don't:
|
|
397
|
-
- Do not carry out a risky action before the person approves it.
|
|
398
|
-
- Do not replace the steps or the changes with a one-line summary.
|
|
399
|
-
- Do not let the agent write the label of an approve or merge button.
|
|
400
|
-
- Do not let a second click on a decided card approve or cancel it again.
|
|
389
|
+
File: cases/agent-asks-before-risky-action.md
|
|
401
390
|
|
|
402
391
|
### An agent cancels and reports when nobody answers
|
|
403
392
|
|
|
@@ -407,17 +396,7 @@ Answer: The agent never takes silence as a yes: while a question or proposal wai
|
|
|
407
396
|
|
|
408
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.
|
|
409
398
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
Do:
|
|
413
|
-
- Keep the card and its buttons open until someone answers or the request is cancelled.
|
|
414
|
-
- Notify the person who asked when the agent needs their answer.
|
|
415
|
-
- When a request is cancelled, mark the card Cancelled and post one line on what was not done.
|
|
416
|
-
- List questions asked before a plan that nobody answered as open questions in that plan.
|
|
417
|
-
|
|
418
|
-
Don't:
|
|
419
|
-
- Do not treat no answer as approval.
|
|
420
|
-
- Do not cancel a request without saying so in the thread.
|
|
399
|
+
File: cases/agent-cancels-when-unanswered.md
|
|
421
400
|
|
|
422
401
|
### An agent refuses clearly
|
|
423
402
|
|
|
@@ -427,17 +406,7 @@ Answer: The refusal says in one plain sentence which limit was reached, and eith
|
|
|
427
406
|
|
|
428
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.
|
|
429
408
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
Do:
|
|
433
|
-
- Say which limit was reached, with the number when there is one: 'You've used all 50 AI agent responses this month.'
|
|
434
|
-
- Say who can change it, or when to try again: 'Try again in a minute.'
|
|
435
|
-
- Show the button that lifts the limit only to a person allowed to use it.
|
|
436
|
-
- Let the person close the refusal without acting, with a button such as 'Not Now'.
|
|
437
|
-
|
|
438
|
-
Don't:
|
|
439
|
-
- Do not show a general error message for a refusal.
|
|
440
|
-
- Do not show an Upgrade button to someone who cannot upgrade.
|
|
409
|
+
File: cases/agent-refuses-clearly.md
|
|
441
410
|
|
|
442
411
|
### An agent says what it is
|
|
443
412
|
|
|
@@ -445,17 +414,7 @@ The agent posts in a thread where people also write, or replies to a person.
|
|
|
445
414
|
|
|
446
415
|
Answer: Every agent message has marks no person's message has. It shows an icon avatar instead of a photo, and the agent's own name. When the product knows which model wrote the reply, it shows the model name in small text next to the time. An agent the workspace connects from outside gets a plain bot icon, not the product's logo.
|
|
447
416
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
Do:
|
|
451
|
-
- Show the agent with an icon avatar, never a photo or an initial.
|
|
452
|
-
- Name the agent in the message header: its role or given name, or 'Agent' when it has none.
|
|
453
|
-
- Show the model name next to the time when the product knows it.
|
|
454
|
-
- Show the product's logo on the product's own agent and a plain bot icon on an agent from outside, so people see whose agent it is.
|
|
455
|
-
|
|
456
|
-
Don't:
|
|
457
|
-
- Do not show a photo for an agent, even when one is set.
|
|
458
|
-
- Do not show the product's logo on an agent the product does not run.
|
|
417
|
+
File: cases/agent-says-what-it-is.md
|
|
459
418
|
|
|
460
419
|
### An agent shows its progress
|
|
461
420
|
|
|
@@ -463,18 +422,7 @@ The agent is working on a request and its reply is not ready yet.
|
|
|
463
422
|
|
|
464
423
|
Answer: While it works, the agent shows a live row in the thread, where its reply will appear: its name, the model, the seconds so far, the steps it has finished with a check mark, and the step it is on now in plain words, such as 'Reading file'. A Stop button stays on that row for the whole run. When the run is stopped, the agent posts a short note that it stopped.
|
|
465
424
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
Do:
|
|
469
|
-
- Show the progress row in the thread, where the reply will appear.
|
|
470
|
-
- Name the current step in plain words, such as 'Reading file' or 'Editing code'.
|
|
471
|
-
- Keep finished steps in view, each with a check mark.
|
|
472
|
-
- Keep a Stop button on the row for the whole run.
|
|
473
|
-
|
|
474
|
-
Don't:
|
|
475
|
-
- Do not show a spinner with no words.
|
|
476
|
-
- Do not hide the Stop button while the agent writes its reply.
|
|
477
|
-
- Do not say the agent stopped before the run has really ended.
|
|
425
|
+
File: cases/agent-shows-progress.md
|
|
478
426
|
|
|
479
427
|
### An agent shows its sources
|
|
480
428
|
|
|
@@ -482,19 +430,75 @@ The agent answers from things it read: documents, files, chat, tasks, or a conne
|
|
|
482
430
|
|
|
483
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.
|
|
484
432
|
|
|
485
|
-
|
|
433
|
+
File: cases/agent-shows-sources.md
|
|
434
|
+
|
|
435
|
+
### A confirm says exactly what will happen
|
|
436
|
+
|
|
437
|
+
An action a person takes themselves needs their yes before it happens. An action the agent wants to take follows the rule 'An agent asks before a risky action', a card in the conversation, not this one.
|
|
438
|
+
|
|
439
|
+
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
|
+
|
|
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
|
+
File: cases/confirm-dialogs.md
|
|
444
|
+
|
|
445
|
+
### An empty list says what will fill it
|
|
446
|
+
|
|
447
|
+
A list, table or pane has nothing to show.
|
|
448
|
+
|
|
449
|
+
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
|
+
|
|
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
|
+
File: cases/empty-lists.md
|
|
454
|
+
|
|
455
|
+
### A form error shows next to the problem
|
|
456
|
+
|
|
457
|
+
A form was submitted and something is wrong.
|
|
458
|
+
|
|
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
|
+
|
|
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
|
+
File: cases/form-errors.md
|
|
464
|
+
|
|
465
|
+
### Success shows where the person is looking
|
|
466
|
+
|
|
467
|
+
Something the person did has worked.
|
|
468
|
+
|
|
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'.
|
|
486
470
|
|
|
487
|
-
|
|
488
|
-
- Put the sources directly under the reply they support.
|
|
489
|
-
- Show each source as a card with its title and where it lives, such as the space name or the date.
|
|
490
|
-
- Make each card open the source itself, in the product or on the service it came from.
|
|
491
|
-
- Show the first six sources and a 'Show N more' button for the rest.
|
|
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'.
|
|
492
472
|
|
|
493
|
-
|
|
494
|
-
- Do not show a sources section when the reply used no sources.
|
|
495
|
-
- Do not show source cards on a person's message.
|
|
496
|
-
- Do not link a source card to any site other than the product or the service the source came from.
|
|
473
|
+
File: cases/success-feedback.md
|
|
497
474
|
|
|
498
475
|
| Case | When | File |
|
|
499
476
|
| --- | --- | --- |
|
|
500
|
-
|
|
|
477
|
+
| Invite link page | A person opens an invite link to join a workspace. | cases/accept-invite.md |
|
|
478
|
+
| 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
|
+
| Check your email | A person signed up, and the product sent a link to confirm their email. | cases/check-your-email.md |
|
|
480
|
+
| Delete confirm | A person asks to delete or remove something, and it cannot be undone. | cases/confirm-destructive-action.md |
|
|
481
|
+
| 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 |
|
|
482
|
+
| 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
|
+
| Email confirmed | A person opened the link that confirms their email. | cases/email-confirmed.md |
|
|
484
|
+
| Empty list | A list has loaded, and there is nothing in it yet. | cases/empty-list.md |
|
|
485
|
+
| Empty until set up | A pane is empty because something it needs is not set up yet, such as a connected account. | cases/empty-not-set-up.md |
|
|
486
|
+
| Empty search | A search or a filter finds nothing. | cases/empty-search.md |
|
|
487
|
+
| Error page | Something broke while showing a page, and the app cannot show it. | cases/error-page.md |
|
|
488
|
+
| Feedback form | A person sends feedback about the product from inside it. | cases/feedback-form.md |
|
|
489
|
+
| Forgot password | A person cannot remember their password and asks for a link to set a new one. | cases/forgot-password.md |
|
|
490
|
+
| Import checklist | A person picks which items to bring in from another place, such as pages from a wiki. | cases/import-checklist.md |
|
|
491
|
+
| 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 |
|
|
492
|
+
| Member invite | A person invites someone to join a workspace. | cases/invite-member.md |
|
|
493
|
+
| Load failure | A list or a section could not load. | cases/load-failure.md |
|
|
494
|
+
| Log-out confirm | A person chooses Log Out. | cases/log-out-confirm.md |
|
|
495
|
+
| Login page | A person who already has an account opens the product and is not logged in. | cases/login-page.md |
|
|
496
|
+
| Page not found | A person opens a link to a page that does not exist. | cases/not-found-page.md |
|
|
497
|
+
| 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 |
|
|
498
|
+
| Rename | A person renames something, such as a project or a channel. | cases/rename.md |
|
|
499
|
+
| Page loading | A page or a pane is loading, and there is nothing to show yet. | cases/route-loading.md |
|
|
500
|
+
| Set new password | A person opened the link to reset their password and now chooses a new one. | cases/set-new-password.md |
|
|
501
|
+
| Sign-up page | A person who has no account yet opens the product and wants one. | cases/sign-up-page.md |
|
|
502
|
+
| 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 |
|
|
503
|
+
| Unsaved changes | A person closes or leaves something they changed and did not save. | cases/unsaved-changes-guard.md |
|
|
504
|
+
| Upgrade prompt | A person reaches something their plan does not include, or a limit of their plan. | cases/upgrade-prompt.md |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AcceptInviteSignedIn(): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import Image from '../../components/image';
|
|
4
|
+
import Heading from '../../components/heading';
|
|
5
|
+
import Paragraph from '../../components/paragraph';
|
|
6
|
+
import UserImage from '../../components/userImage';
|
|
7
|
+
import Button from '../../components/button';
|
|
8
|
+
import LoadingScreen from '../../components/loadingScreen';
|
|
9
|
+
import { Center, Cluster, Stack } from '../../components/layout';
|
|
10
|
+
// The product's mark. A real app passes its own file.
|
|
11
|
+
var productMark = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
12
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
13
|
+
var router = { push: function (url) { return console.info("Go to ".concat(url)); } };
|
|
14
|
+
// The invite's own page, so switching accounts brings the person back here to join.
|
|
15
|
+
var next = encodeURIComponent('/invite/7f3k2q');
|
|
16
|
+
// A real app passes the address of the account that is logged in.
|
|
17
|
+
var address = 'ada@example.com';
|
|
18
|
+
export default function AcceptInviteSignedIn() {
|
|
19
|
+
var _a = useState(false), joining = _a[0], setJoining = _a[1];
|
|
20
|
+
var _b = useState(false), joined = _b[0], setJoined = _b[1];
|
|
21
|
+
var timer = useRef();
|
|
22
|
+
// Stops the request if the example goes away before it ends.
|
|
23
|
+
useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
|
|
24
|
+
function handleJoin() {
|
|
25
|
+
if (joining)
|
|
26
|
+
return;
|
|
27
|
+
setJoining(true);
|
|
28
|
+
// Stands in for the request to the server.
|
|
29
|
+
timer.current = setTimeout(function () {
|
|
30
|
+
setJoining(false);
|
|
31
|
+
setJoined(true);
|
|
32
|
+
}, 1200);
|
|
33
|
+
}
|
|
34
|
+
// Joined: a real app opens the workspace as soon as it can.
|
|
35
|
+
if (joined) {
|
|
36
|
+
return (<Center fill>
|
|
37
|
+
<LoadingScreen label="Opening Acme Design…"/>
|
|
38
|
+
</Center>);
|
|
39
|
+
}
|
|
40
|
+
return (<Center fill>
|
|
41
|
+
<Image src={productMark} alt="Acme" width={40} height={40}/>
|
|
42
|
+
<Stack gap="medium">
|
|
43
|
+
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
44
|
+
<Cluster gap="small">
|
|
45
|
+
<UserImage userHandle="Dana Lee"/>
|
|
46
|
+
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
47
|
+
</Cluster>
|
|
48
|
+
{/* An open link names no address, so the page shows only the workspace and the role. */}
|
|
49
|
+
<Paragraph tone="secondary" measure="none">You will join as a member.</Paragraph>
|
|
50
|
+
</Stack>
|
|
51
|
+
<Stack gap="large">
|
|
52
|
+
<Paragraph tone="secondary" size="body2" measure="none">Joining as {address}</Paragraph>
|
|
53
|
+
<Button size="medium" type="primary" state="enabled" label="Join Acme Design" loading={joining} onClickButton={handleJoin}/>
|
|
54
|
+
<Button size="medium" type="textOnly" state={joining ? 'disabled' : 'enabled'} label="Not You? Switch Account" onClickButton={function () { return router.push("/login?next=".concat(next)); }}/>
|
|
55
|
+
</Stack>
|
|
56
|
+
</Center>);
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AcceptInviteSignedOut(): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Image from '../../components/image';
|
|
3
|
+
import Heading from '../../components/heading';
|
|
4
|
+
import Paragraph from '../../components/paragraph';
|
|
5
|
+
import UserImage from '../../components/userImage';
|
|
6
|
+
import Button from '../../components/button';
|
|
7
|
+
import { Center, Cluster, Stack } from '../../components/layout';
|
|
8
|
+
// The product's mark. A real app passes its own file.
|
|
9
|
+
var productMark = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
10
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
11
|
+
var router = { push: function (url) { return console.info("Go to ".concat(url)); } };
|
|
12
|
+
// The invite's own page, so login and sign-up bring the person back here to join.
|
|
13
|
+
var next = encodeURIComponent('/invite/7f3k2q');
|
|
14
|
+
export default function AcceptInviteSignedOut() {
|
|
15
|
+
return (<Center fill>
|
|
16
|
+
<Image src={productMark} alt="Acme" width={40} height={40}/>
|
|
17
|
+
<Stack gap="medium">
|
|
18
|
+
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
19
|
+
{/* 'Invited by' shows on every invite. */}
|
|
20
|
+
<Cluster gap="small">
|
|
21
|
+
<UserImage userHandle="Dana Lee"/>
|
|
22
|
+
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
23
|
+
</Cluster>
|
|
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.
|
|
25
|
+
An open link shows nothing in its place, only the workspace and the role: 'You will join as a member.' */}
|
|
26
|
+
<Paragraph tone="secondary" measure="none">You will join as a member. This invite is for a***@example.com, so log in or sign up with that address.</Paragraph>
|
|
27
|
+
</Stack>
|
|
28
|
+
<Stack gap="medium">
|
|
29
|
+
<Button size="medium" type="primary" state="enabled" label="Log In" onClickButton={function () { return router.push("/login?next=".concat(next)); }}/>
|
|
30
|
+
<Button size="medium" type="secondary" state="enabled" label="Sign Up" onClickButton={function () { return router.push("/sign-up?next=".concat(next)); }}/>
|
|
31
|
+
</Stack>
|
|
32
|
+
</Center>);
|
|
33
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Invite link page
|
|
2
|
+
|
|
3
|
+
A person opens an invite link to join a workspace.
|
|
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
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Name the workspace in a `Heading` with `level={1}`: "You're invited to Acme Design".
|
|
10
|
+
- Say the role the person joins as.
|
|
11
|
+
- Show who invited the person, 'Invited by Dana Lee', on every invite. It builds trust, and it is not secret.
|
|
12
|
+
- Say which address the invite is for, masked, such as 'a***@example.com', only when the invite is tied to an address.
|
|
13
|
+
- Offer 'Log In' as the primary Button and 'Sign Up' as the secondary one, and bring the person back to the invite after either.
|
|
14
|
+
- Join with no screen when the invite is tied to the verified address of the person who is logged in, and land them in the workspace.
|
|
15
|
+
- Show one screen with a 'Join Acme Design' Button when the invite is an open link and the person is logged in.
|
|
16
|
+
- Name the account that will join on that screen, 'Joining as ada@example.com', with a text-only 'Not You? Switch Account'.
|
|
17
|
+
- Show an expired link with a heading, one line and one Button: 'Invite link expired', 'Ask the person who invited you to send a new link.', 'Go Home'.
|
|
18
|
+
- Show a link for another account with a heading, one line and one Button: 'This invite is for a different account', 'You are logged in as ada@example.com. This invite is for d***@example.com.', 'Switch Account'. Say the logged-in address in full and the invited one masked.
|
|
19
|
+
- Show a full workspace with a heading, one line and one Button: 'This workspace is full', 'Ask an admin of Acme Design to make room.', 'Go Home'.
|
|
20
|
+
- Show `LoadingScreen` with `label="Checking invite…"` while the invite is checked, as in 'Login check loading'.
|
|
21
|
+
|
|
22
|
+
## Don't
|
|
23
|
+
|
|
24
|
+
- Do not show the invite to a person whose verified address it is tied to. Join and go on.
|
|
25
|
+
- Do not show the full invited address to whoever holds the link.
|
|
26
|
+
- Do not show the login form before the invite is checked.
|
|
27
|
+
- Do not remember the invite before the person chooses to log in or sign up, so an old link does not take over a later login.
|
|
28
|
+
|
|
29
|
+
## Option: Logged out
|
|
30
|
+
|
|
31
|
+
Use when: The person is not logged in.
|
|
32
|
+
|
|
33
|
+
Uses: `Button`, `Center`, `Cluster`, `Heading`, `Image`, `Paragraph`, `Stack`, `UserImage`
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
'use client';
|
|
37
|
+
import Image from 'oneslash-design-system/components/image';
|
|
38
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
39
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
40
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
41
|
+
import Button from 'oneslash-design-system/components/button';
|
|
42
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
43
|
+
|
|
44
|
+
// The product's mark. A real app passes its own file.
|
|
45
|
+
const productMark =
|
|
46
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
47
|
+
|
|
48
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
49
|
+
const router = { push: (url: string) => console.info(`Go to ${url}`) };
|
|
50
|
+
|
|
51
|
+
// The invite's own page, so login and sign-up bring the person back here to join.
|
|
52
|
+
const next = encodeURIComponent('/invite/7f3k2q');
|
|
53
|
+
|
|
54
|
+
export default function AcceptInviteSignedOut() {
|
|
55
|
+
return (
|
|
56
|
+
<Center fill>
|
|
57
|
+
<Image src={productMark} alt="Acme" width={40} height={40} />
|
|
58
|
+
<Stack gap="medium">
|
|
59
|
+
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
60
|
+
{/* 'Invited by' shows on every invite. */}
|
|
61
|
+
<Cluster gap="small">
|
|
62
|
+
<UserImage userHandle="Dana Lee" />
|
|
63
|
+
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
64
|
+
</Cluster>
|
|
65
|
+
{/* 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.
|
|
66
|
+
An open link shows nothing in its place, only the workspace and the role: 'You will join as a member.' */}
|
|
67
|
+
<Paragraph tone="secondary" measure="none">You will join as a member. This invite is for a***@example.com, so log in or sign up with that address.</Paragraph>
|
|
68
|
+
</Stack>
|
|
69
|
+
<Stack gap="medium">
|
|
70
|
+
<Button size="medium" type="primary" state="enabled" label="Log In" onClickButton={() => router.push(`/login?next=${next}`)} />
|
|
71
|
+
<Button size="medium" type="secondary" state="enabled" label="Sign Up" onClickButton={() => router.push(`/sign-up?next=${next}`)} />
|
|
72
|
+
</Stack>
|
|
73
|
+
</Center>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Option: Logged in, open link
|
|
79
|
+
|
|
80
|
+
Use when: The person is logged in and the link is open to anyone who has it.
|
|
81
|
+
|
|
82
|
+
Uses: `Button`, `Center`, `Cluster`, `Heading`, `Image`, `LoadingScreen`, `Paragraph`, `Stack`, `UserImage`
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
'use client';
|
|
86
|
+
import { useEffect, useRef, useState } from 'react';
|
|
87
|
+
import Image from 'oneslash-design-system/components/image';
|
|
88
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
89
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
90
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
91
|
+
import Button from 'oneslash-design-system/components/button';
|
|
92
|
+
import LoadingScreen from 'oneslash-design-system/components/loadingScreen';
|
|
93
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
94
|
+
|
|
95
|
+
// The product's mark. A real app passes its own file.
|
|
96
|
+
const productMark =
|
|
97
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
98
|
+
|
|
99
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
100
|
+
const router = { push: (url: string) => console.info(`Go to ${url}`) };
|
|
101
|
+
|
|
102
|
+
// The invite's own page, so switching accounts brings the person back here to join.
|
|
103
|
+
const next = encodeURIComponent('/invite/7f3k2q');
|
|
104
|
+
|
|
105
|
+
// A real app passes the address of the account that is logged in.
|
|
106
|
+
const address = 'ada@example.com';
|
|
107
|
+
|
|
108
|
+
export default function AcceptInviteSignedIn() {
|
|
109
|
+
const [joining, setJoining] = useState(false);
|
|
110
|
+
const [joined, setJoined] = useState(false);
|
|
111
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
112
|
+
|
|
113
|
+
// Stops the request if the example goes away before it ends.
|
|
114
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
115
|
+
|
|
116
|
+
function handleJoin() {
|
|
117
|
+
if (joining) return;
|
|
118
|
+
setJoining(true);
|
|
119
|
+
// Stands in for the request to the server.
|
|
120
|
+
timer.current = setTimeout(() => {
|
|
121
|
+
setJoining(false);
|
|
122
|
+
setJoined(true);
|
|
123
|
+
}, 1200);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Joined: a real app opens the workspace as soon as it can.
|
|
127
|
+
if (joined) {
|
|
128
|
+
return (
|
|
129
|
+
<Center fill>
|
|
130
|
+
<LoadingScreen label="Opening Acme Design…" />
|
|
131
|
+
</Center>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<Center fill>
|
|
137
|
+
<Image src={productMark} alt="Acme" width={40} height={40} />
|
|
138
|
+
<Stack gap="medium">
|
|
139
|
+
<Heading level={1} size="h5">You're invited to Acme Design</Heading>
|
|
140
|
+
<Cluster gap="small">
|
|
141
|
+
<UserImage userHandle="Dana Lee" />
|
|
142
|
+
<Paragraph size="body2" measure="none">Invited by Dana Lee</Paragraph>
|
|
143
|
+
</Cluster>
|
|
144
|
+
{/* An open link names no address, so the page shows only the workspace and the role. */}
|
|
145
|
+
<Paragraph tone="secondary" measure="none">You will join as a member.</Paragraph>
|
|
146
|
+
</Stack>
|
|
147
|
+
<Stack gap="large">
|
|
148
|
+
<Paragraph tone="secondary" size="body2" measure="none">Joining as {address}</Paragraph>
|
|
149
|
+
<Button size="medium" type="primary" state="enabled" label="Join Acme Design" loading={joining} onClickButton={handleJoin} />
|
|
150
|
+
<Button size="medium" type="textOnly" state={joining ? 'disabled' : 'enabled'} label="Not You? Switch Account" onClickButton={() => router.push(`/login?next=${next}`)} />
|
|
151
|
+
</Stack>
|
|
152
|
+
</Center>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Native
|
|
158
|
+
|
|
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.
|
|
@@ -17,7 +17,7 @@ A person can only approve what they can see, and an agent's mistake in shared wo
|
|
|
17
17
|
- List every step in the card, in the order the agent will do them.
|
|
18
18
|
- Offer a way to see the full changes, such as a View Changes button, before the approve button is pressed.
|
|
19
19
|
- Let the person edit the plan or cancel it, not only approve it.
|
|
20
|
-
-
|
|
20
|
+
- Mark the card Approved or Cancelled once it is decided, and remove its buttons.
|
|
21
21
|
|
|
22
22
|
## Don't
|
|
23
23
|
|
|
@@ -16,7 +16,7 @@ An agent that acts on silence does work nobody approved, and one that waits fore
|
|
|
16
16
|
|
|
17
17
|
- Keep the card and its buttons open until someone answers or the request is cancelled.
|
|
18
18
|
- Notify the person who asked when the agent needs their answer.
|
|
19
|
-
-
|
|
19
|
+
- Mark the card Cancelled when a request is cancelled, and post one line on what was not done.
|
|
20
20
|
- List questions asked before a plan that nobody answered as open questions in that plan.
|
|
21
21
|
|
|
22
22
|
## Don't
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AuthGateLoadingSpinnerWithLine(): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import LoadingScreen from '../../components/loadingScreen';
|
|
3
|
+
import { Center } from '../../components/layout';
|
|
4
|
+
// Shown while a step that can take longer than a second runs, before the app knows where to send the person.
|
|
5
|
+
// A real app swaps it for the next page as soon as the step ends.
|
|
6
|
+
export default function AuthGateLoadingSpinnerWithLine() {
|
|
7
|
+
return (<Center fill>
|
|
8
|
+
<LoadingScreen label="Checking invite…"/>
|
|
9
|
+
</Center>);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AuthGateLoadingSpinner(): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import LoadingScreen from '../../components/loadingScreen';
|
|
3
|
+
import { Center } from '../../components/layout';
|
|
4
|
+
// Shown while the app checks the session, before it knows whether to show the page or the login form.
|
|
5
|
+
// A real app swaps it for the page, or goes to the login page, as soon as the check ends.
|
|
6
|
+
export default function AuthGateLoadingSpinner() {
|
|
7
|
+
return (<Center fill>
|
|
8
|
+
<LoadingScreen />
|
|
9
|
+
</Center>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Login check loading
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Scindo on the web shows 'Please wait' under the step while it checks an invite, and a small spinner instead of `LoadingScreen` while onboarding checks for a workspace.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Show the spinner from the first render, before anything else, as `LoadingScreen` in `Center` with `fill`.
|
|
10
|
+
- Replace the spinner with the page, or go to the login page, as soon as the check ends.
|
|
11
|
+
- Show no text when the wait is normally under about a second.
|
|
12
|
+
- Name the step in `LoadingScreen`'s `label` when it can take longer than about a second: `label="Checking invite…"`.
|
|
13
|
+
- Use the same screen as the full-screen spinner in 'Page loading': `LoadingScreen` alone in `Center` with `fill`.
|
|
14
|
+
|
|
15
|
+
## Don't
|
|
16
|
+
|
|
17
|
+
- Do not show the login form, or the page, before the check ends. It flashes and then goes away.
|
|
18
|
+
- Do not write a line that names no step, such as 'Loading…' or 'Please wait'.
|
|
19
|
+
- Do not put a line under a spinner whose wait is normally under about a second.
|
|
20
|
+
- Do not put more than one line under the spinner, or write it in a separate Paragraph.
|
|
21
|
+
|
|
22
|
+
## Option: Spinner
|
|
23
|
+
|
|
24
|
+
Use when: The wait is normally under about a second, such as reading the session.
|
|
25
|
+
|
|
26
|
+
Uses: `Center`, `LoadingScreen`
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
'use client';
|
|
30
|
+
import LoadingScreen from 'oneslash-design-system/components/loadingScreen';
|
|
31
|
+
import { Center } from 'oneslash-design-system/components/layout';
|
|
32
|
+
|
|
33
|
+
// Shown while the app checks the session, before it knows whether to show the page or the login form.
|
|
34
|
+
// A real app swaps it for the page, or goes to the login page, as soon as the check ends.
|
|
35
|
+
export default function AuthGateLoadingSpinner() {
|
|
36
|
+
return (
|
|
37
|
+
<Center fill>
|
|
38
|
+
<LoadingScreen />
|
|
39
|
+
</Center>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Option: Spinner with a line
|
|
45
|
+
|
|
46
|
+
Use when: A named step can take longer than about a second, such as 'Checking invite…' or 'Joining workspace…'.
|
|
47
|
+
|
|
48
|
+
Uses: `Center`, `LoadingScreen`
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
'use client';
|
|
52
|
+
import LoadingScreen from 'oneslash-design-system/components/loadingScreen';
|
|
53
|
+
import { Center } from 'oneslash-design-system/components/layout';
|
|
54
|
+
|
|
55
|
+
// Shown while a step that can take longer than a second runs, before the app knows where to send the person.
|
|
56
|
+
// A real app swaps it for the next page as soon as the step ends.
|
|
57
|
+
export default function AuthGateLoadingSpinnerWithLine() {
|
|
58
|
+
return (
|
|
59
|
+
<Center fill>
|
|
60
|
+
<LoadingScreen label="Checking invite…" />
|
|
61
|
+
</Center>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Native
|
|
67
|
+
|
|
68
|
+
On Apple use `ProgressView()` centered in the window, with a label only for a named step that can take longer.
|
|
69
|
+
|
|
70
|
+
Seen in: Commentify admin, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CheckYourEmailAlertOnLogin(): import("react").JSX.Element;
|