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
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# Tag filter
|
|
2
|
+
|
|
3
|
+
A person filters a list by a tag, and adds, renames and deletes the tags themselves.
|
|
4
|
+
|
|
5
|
+
## Do
|
|
6
|
+
|
|
7
|
+
- Use a row of `Tag` with `variant="contained"` and `size="medium"` in a `Cluster`. Put 'All' first, then each tag. The row wraps.
|
|
8
|
+
- Mark the chosen one with `state="selected"`. A clickable `Tag` is a toggle and reports `aria-pressed`.
|
|
9
|
+
- Choose Tags over a `SegmentedControl`. A `SegmentedControl` is for a fixed set of two to four, as in the case 'Range switch'. It cannot grow, wrap or hold a field.
|
|
10
|
+
- Show one More `IconButton` after the selected tag: `ariaLabel="More actions for tag Design"`. The row gets one extra stop, not one for each tag.
|
|
11
|
+
- Open a navigable menu from it: `<Popover returnFocus>` around `<Menu navigable aria-label="Tag actions">` with 'Rename', then a danger 'Delete'.
|
|
12
|
+
- Rename in place, as the case 'Rename' says. The row becomes a field with `aria-label="Rename tag Design"`. Enter and a click away save, and Escape cancels.
|
|
13
|
+
- Add a tag with an 'Add Tag' Button that turns the row into the same field, with `aria-label="New tag name"`. The new tag is chosen once it is added.
|
|
14
|
+
- Show a name that is taken under the field with `error` and `errorText`, and keep what the person typed.
|
|
15
|
+
- Confirm Delete in a small Modal, as the case 'Delete confirm' says: 'Cancel' first, then a danger 'Delete'.
|
|
16
|
+
- Say where the items go: 'Its 3 items stay in All, with no tag.' Name the tag in a toast when it is gone.
|
|
17
|
+
- Put focus on the More button after Rename or Cancel, and on 'Add Tag' after a delete, since the tag and its More button are gone.
|
|
18
|
+
|
|
19
|
+
## Don't
|
|
20
|
+
|
|
21
|
+
- Do not use a `SegmentedControl` for tags that people add and delete.
|
|
22
|
+
- Do not delete the items with their tag.
|
|
23
|
+
- Do not say 'Are you sure?' in the confirm. Say what is deleted and where the items go.
|
|
24
|
+
- Do not add a 'Delete' that has no confirm. A tag may be on many items.
|
|
25
|
+
- Do not leave the row on a tag that was just deleted. It goes back to All.
|
|
26
|
+
|
|
27
|
+
## Example: Row of toggle Tags
|
|
28
|
+
|
|
29
|
+
Uses: `Button`, `Center`, `Cluster`, `EmptyBox`, `Heading`, `IconButton`, `Menu`, `MenuItem`, `Modal`, `Paragraph`, `Popover`, `Stack`, `TableCell`, `TableContainer`, `TableRow`, `Tag`, `TextField`, `Toaster`, `Tooltip`, `dismissToast`, `toast`
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
'use client';
|
|
33
|
+
import { useEffect, useRef, useState } from 'react';
|
|
34
|
+
import Toaster, { toast, dismissToast } from 'oneslash-design-system/components/toaster';
|
|
35
|
+
import Modal from 'oneslash-design-system/components/modal';
|
|
36
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
37
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
38
|
+
import TextField from 'oneslash-design-system/components/textField';
|
|
39
|
+
import Tag from 'oneslash-design-system/components/tag';
|
|
40
|
+
import Button from 'oneslash-design-system/components/button';
|
|
41
|
+
import IconButton from 'oneslash-design-system/components/iconButton';
|
|
42
|
+
import Tooltip from 'oneslash-design-system/components/tooltip';
|
|
43
|
+
import Popover from 'oneslash-design-system/components/popover';
|
|
44
|
+
import Menu from 'oneslash-design-system/components/menu';
|
|
45
|
+
import MenuItem from 'oneslash-design-system/components/menuItem';
|
|
46
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
47
|
+
import TableContainer from 'oneslash-design-system/components/tableContainer';
|
|
48
|
+
import TableRow from 'oneslash-design-system/components/tableRow';
|
|
49
|
+
import TableCell from 'oneslash-design-system/components/tableCell';
|
|
50
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
51
|
+
|
|
52
|
+
// A real app reads these from the server. 'All' is not a tag: it shows every item.
|
|
53
|
+
type Item = { id: string; title: string; tagId: string | null };
|
|
54
|
+
const firstTags = [
|
|
55
|
+
{ id: 'design', name: 'Design' },
|
|
56
|
+
{ id: 'research', name: 'Research' },
|
|
57
|
+
{ id: 'ideas', name: 'Ideas' },
|
|
58
|
+
];
|
|
59
|
+
const firstItems: Item[] = [
|
|
60
|
+
{ id: 'i1', title: 'Pricing page teardown', tagId: 'research' },
|
|
61
|
+
{ id: 'i2', title: 'Color tokens for dark mode', tagId: 'design' },
|
|
62
|
+
{ id: 'i3', title: 'Onboarding checklist patterns', tagId: 'design' },
|
|
63
|
+
{ id: 'i4', title: 'Interview notes, March', tagId: 'research' },
|
|
64
|
+
{ id: 'i5', title: 'A weekly digest email', tagId: 'ideas' },
|
|
65
|
+
{ id: 'i6', title: 'Keyboard shortcut cheat sheet', tagId: null },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
// What the field is for: a new tag, or the selected tag's new name.
|
|
69
|
+
type Editing = 'add' | 'rename' | null;
|
|
70
|
+
|
|
71
|
+
export default function TagFilterTags() {
|
|
72
|
+
const [tags, setTags] = useState(firstTags);
|
|
73
|
+
const [items, setItems] = useState(firstItems);
|
|
74
|
+
// null is 'All'.
|
|
75
|
+
const [selected, setSelected] = useState<string | null>('design');
|
|
76
|
+
const [editing, setEditing] = useState<Editing>(null);
|
|
77
|
+
const [draft, setDraft] = useState('');
|
|
78
|
+
const [taken, setTaken] = useState(false);
|
|
79
|
+
const [menuAnchor, setMenuAnchor] = useState<HTMLElement | null>(null);
|
|
80
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
81
|
+
const [confirming, setConfirming] = useState(false);
|
|
82
|
+
const [deleting, setDeleting] = useState(false);
|
|
83
|
+
// The tag the confirm is about, kept until the Modal is closed, so its text stays while it fades out.
|
|
84
|
+
const [doomed, setDoomed] = useState<{ name: string; count: number }>({ name: '', count: 0 });
|
|
85
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
86
|
+
const toastIds = useRef<string[]>([]);
|
|
87
|
+
const moreButton = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
|
|
88
|
+
const addButton = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
|
|
89
|
+
// Enter and Escape end the edit before the field goes away, so its blur must not save again.
|
|
90
|
+
const ended = useRef(false);
|
|
91
|
+
// Where focus goes after the next render, once the element it goes to is on screen.
|
|
92
|
+
const focusNext = useRef<() => void>();
|
|
93
|
+
|
|
94
|
+
const tag = tags.find((t) => t.id === selected);
|
|
95
|
+
const shown = selected === null ? items : items.filter((i) => i.tagId === selected);
|
|
96
|
+
const nameOf = (tagId: string | null) => tags.find((t) => t.id === tagId)?.name ?? 'No tag';
|
|
97
|
+
|
|
98
|
+
// On unmount it stops the request and closes every toast it opened.
|
|
99
|
+
useEffect(() => () => {
|
|
100
|
+
clearTimeout(timer.current);
|
|
101
|
+
toastIds.current.forEach((id) => dismissToast(id));
|
|
102
|
+
toastIds.current = [];
|
|
103
|
+
}, []);
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const move = focusNext.current;
|
|
107
|
+
focusNext.current = undefined;
|
|
108
|
+
move?.();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
function startEditing(kind: 'add' | 'rename') {
|
|
112
|
+
ended.current = false;
|
|
113
|
+
setDraft(kind === 'rename' && tag ? tag.name : '');
|
|
114
|
+
setTaken(false);
|
|
115
|
+
setEditing(kind);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Enter and a click away save. An empty or unchanged name cancels. A name that is taken stays in the field with
|
|
119
|
+
// the error, so what the person typed is not lost. `byKey` is true for Enter, where focus goes back to where it was.
|
|
120
|
+
function finish(byKey: boolean) {
|
|
121
|
+
if (ended.current || !editing) return;
|
|
122
|
+
const name = draft.trim();
|
|
123
|
+
const unchanged = editing === 'rename' && name === tag?.name;
|
|
124
|
+
if (!name || unchanged) return cancel(byKey);
|
|
125
|
+
if (tags.some((t) => !(editing === 'rename' && t.id === selected) && t.name.toLowerCase() === name.toLowerCase())) {
|
|
126
|
+
setTaken(true);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
ended.current = true;
|
|
130
|
+
// A real app sends the name to the server here and shows it at once.
|
|
131
|
+
if (editing === 'rename') {
|
|
132
|
+
setTags((list) => list.map((t) => (t.id === selected ? { ...t, name } : t)));
|
|
133
|
+
} else {
|
|
134
|
+
const id = `tag-${name.toLowerCase().replace(/\s+/g, '-')}`;
|
|
135
|
+
setTags((list) => [...list, { id, name }]);
|
|
136
|
+
setSelected(id);
|
|
137
|
+
}
|
|
138
|
+
leave(byKey);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function cancel(byKey: boolean) {
|
|
142
|
+
if (ended.current) return;
|
|
143
|
+
ended.current = true;
|
|
144
|
+
leave(byKey);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function leave(byKey: boolean) {
|
|
148
|
+
const kind = editing;
|
|
149
|
+
setEditing(null);
|
|
150
|
+
setTaken(false);
|
|
151
|
+
if (byKey) focusNext.current = () => (kind === 'rename' ? moreButton.current : addButton.current)?.focus();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function openMenu(anchorEl: HTMLElement) {
|
|
155
|
+
setMenuAnchor(anchorEl);
|
|
156
|
+
setMenuOpen((o) => !o);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// The menu closes on any choice. Its Popover gives focus back to the More button.
|
|
160
|
+
function rename() {
|
|
161
|
+
setMenuOpen(false);
|
|
162
|
+
startEditing('rename');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function askToDelete() {
|
|
166
|
+
setMenuOpen(false);
|
|
167
|
+
if (tag) setDoomed({ name: tag.name, count: items.filter((i) => i.tagId === tag.id).length });
|
|
168
|
+
setConfirming(true);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// 'Cancel' ends the confirm; the More button is still there, so focus goes back to it.
|
|
172
|
+
function keepTag() {
|
|
173
|
+
if (deleting) return;
|
|
174
|
+
setConfirming(false);
|
|
175
|
+
focusNext.current = () => moreButton.current?.focus();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// The items keep their place in 'All' and lose the tag. The tag and its More button are gone, so focus goes to 'Add Tag'.
|
|
179
|
+
function confirmDelete() {
|
|
180
|
+
if (deleting || !tag) return;
|
|
181
|
+
const gone = tag;
|
|
182
|
+
setDeleting(true);
|
|
183
|
+
// Stands in for the request to the server.
|
|
184
|
+
timer.current = setTimeout(() => {
|
|
185
|
+
setDeleting(false);
|
|
186
|
+
setConfirming(false);
|
|
187
|
+
setTags((list) => list.filter((t) => t.id !== gone.id));
|
|
188
|
+
setItems((list) => list.map((i) => (i.tagId === gone.id ? { ...i, tagId: null } : i)));
|
|
189
|
+
setSelected(null);
|
|
190
|
+
toastIds.current.push(toast({ type: 'success', message: `${gone.name} tag deleted.` }));
|
|
191
|
+
focusNext.current = () => addButton.current?.focus();
|
|
192
|
+
}, 1200);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<Center width="page">
|
|
197
|
+
{/* A real app mounts one Toaster near its root. */}
|
|
198
|
+
<Toaster />
|
|
199
|
+
<Stack gap="large">
|
|
200
|
+
<Heading level={1} size="h5">Reading list</Heading>
|
|
201
|
+
{editing ? (
|
|
202
|
+
// The row of tags becomes the field, as the case 'Rename' says for a name that is on screen. Enter and a click away save, Escape cancels.
|
|
203
|
+
<TextField
|
|
204
|
+
key={editing}
|
|
205
|
+
id="tag-filter-name"
|
|
206
|
+
size="small"
|
|
207
|
+
autoFocus
|
|
208
|
+
aria-label={editing === 'rename' ? `Rename tag ${tag?.name}` : 'New tag name'}
|
|
209
|
+
placeholder={editing === 'add' ? 'Tag name' : undefined}
|
|
210
|
+
value={draft}
|
|
211
|
+
error={taken}
|
|
212
|
+
errorText="A tag with this name already exists."
|
|
213
|
+
onChange={(e) => {
|
|
214
|
+
setDraft(e.target.value);
|
|
215
|
+
setTaken(false);
|
|
216
|
+
}}
|
|
217
|
+
onKeyDown={(e) => {
|
|
218
|
+
if (e.key === 'Enter') {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
finish(true);
|
|
221
|
+
} else if (e.key === 'Escape') {
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
cancel(true);
|
|
224
|
+
}
|
|
225
|
+
}}
|
|
226
|
+
onBlur={() => finish(false)}
|
|
227
|
+
/>
|
|
228
|
+
) : (
|
|
229
|
+
// Tags that people add, rename and delete are not a fixed short set, so they are toggle Tags in a row that wraps.
|
|
230
|
+
<Cluster gap="small">
|
|
231
|
+
<Tag variant="contained" size="medium" label="All" state={selected === null ? 'selected' : 'enabled'} onClick={() => setSelected(null)} />
|
|
232
|
+
{tags.map((t) => (
|
|
233
|
+
<Tag key={t.id} variant="contained" size="medium" label={t.name} state={t.id === selected ? 'selected' : 'enabled'} onClick={() => setSelected(t.id)} />
|
|
234
|
+
))}
|
|
235
|
+
{/* One More button, for the tag that is selected, so the row has one extra stop and not one per tag. */}
|
|
236
|
+
{tag && (
|
|
237
|
+
<Tooltip title="More">
|
|
238
|
+
<IconButton
|
|
239
|
+
ref={moreButton}
|
|
240
|
+
color="iconOnly"
|
|
241
|
+
state={menuOpen ? 'selected' : 'enabled'}
|
|
242
|
+
size="small"
|
|
243
|
+
iconName="Ellipsis"
|
|
244
|
+
ariaLabel={`More actions for tag ${tag.name}`}
|
|
245
|
+
aria-haspopup="menu"
|
|
246
|
+
aria-expanded={menuOpen}
|
|
247
|
+
onClick={(e: { currentTarget: HTMLElement }) => openMenu(e.currentTarget)}
|
|
248
|
+
/>
|
|
249
|
+
</Tooltip>
|
|
250
|
+
)}
|
|
251
|
+
<Button ref={addButton} size="small" type="tertiary" state="enabled" label="Add Tag" decoIcon="Plus" onClickButton={() => startEditing('add')} />
|
|
252
|
+
</Cluster>
|
|
253
|
+
)}
|
|
254
|
+
{shown.length > 0 ? (
|
|
255
|
+
<TableContainer>
|
|
256
|
+
{shown.map((i) => (
|
|
257
|
+
<TableRow key={i.id}>
|
|
258
|
+
<TableCell>{i.title}</TableCell>
|
|
259
|
+
<TableCell width="120px">{nameOf(i.tagId)}</TableCell>
|
|
260
|
+
</TableRow>
|
|
261
|
+
))}
|
|
262
|
+
</TableContainer>
|
|
263
|
+
) : (
|
|
264
|
+
<EmptyBox size="small" icon="Tag" text={`No items tagged '${tag?.name}'`} secondText="Items you tag appear here." />
|
|
265
|
+
)}
|
|
266
|
+
</Stack>
|
|
267
|
+
<Popover open={menuOpen} anchorEl={menuAnchor} onClose={() => setMenuOpen(false)} returnFocus>
|
|
268
|
+
<Menu navigable aria-label="Tag actions" width={180}>
|
|
269
|
+
<MenuItem size="small" iconName="Pencil" label="Rename" onClick={rename} />
|
|
270
|
+
{/* Delete is last, and danger. */}
|
|
271
|
+
<MenuItem size="small" color="danger" iconName="Trash2" label="Delete" onClick={askToDelete} />
|
|
272
|
+
</Menu>
|
|
273
|
+
</Popover>
|
|
274
|
+
<Modal
|
|
275
|
+
isOpen={confirming}
|
|
276
|
+
size="small"
|
|
277
|
+
title="Delete Tag"
|
|
278
|
+
onClose={keepTag}
|
|
279
|
+
actions={
|
|
280
|
+
<>
|
|
281
|
+
<Button size="small" type="tertiary" state={deleting ? 'disabled' : 'enabled'} label="Cancel" onClickButton={keepTag} />
|
|
282
|
+
<Button size="small" type="primary" color="danger" state="enabled" label="Delete" loading={deleting} onClickButton={confirmDelete} />
|
|
283
|
+
</>
|
|
284
|
+
}
|
|
285
|
+
>
|
|
286
|
+
<Paragraph measure="none">{`This deletes the tag '${doomed.name}'.`}</Paragraph>
|
|
287
|
+
<Paragraph tone="secondary" size="body2" measure="none">
|
|
288
|
+
{doomed.count === 1 ? 'Its 1 item stays in All, with no tag.' : `Its ${doomed.count} items stay in All, with no tag.`}
|
|
289
|
+
</Paragraph>
|
|
290
|
+
</Modal>
|
|
291
|
+
</Center>
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Native
|
|
297
|
+
|
|
298
|
+
On Apple use a horizontal `ScrollView` of toggle `Button`s, with a `.contextMenu` on each tag: Rename, then Delete in the `.destructive` role, which asks in a `confirmationDialog`. On Android use `FilterChip`s in a `LazyRow`.
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A person asks to delete something large that cannot be brought back, such as a workspace or an account.
|
|
4
4
|
|
|
5
|
-
**Not built yet:** Commentify matches its phrase with any case and ignores spaces around it, and labels its Button 'Deleting…' while it runs. Scindo labels its Button 'Deleting...' on the web and on Apple. On the web its Delete Workspace Modal shows a failed request as a red caption written by hand.
|
|
6
|
-
|
|
7
5
|
## Do
|
|
8
6
|
|
|
9
7
|
- Ask for typing only when the loss is permanent and large, such as a workspace with everything in it, or an account.
|
|
@@ -218,5 +216,3 @@ export default function TypeToConfirmInline() {
|
|
|
218
216
|
## Native
|
|
219
217
|
|
|
220
218
|
On Apple use an `.alert` with a `TextField` in it. Put the action in the `.destructive` role and disable it until the text matches.
|
|
221
|
-
|
|
222
|
-
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TypingAndStatusLine(): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
import { useState } from 'react';
|
|
12
|
+
import Message from '../../components/message';
|
|
13
|
+
import UserImage from '../../components/userImage';
|
|
14
|
+
import TimeStamp from '../../components/timeStamp';
|
|
15
|
+
import Heading from '../../components/heading';
|
|
16
|
+
import Paragraph from '../../components/paragraph';
|
|
17
|
+
import Composer from '../../components/composer';
|
|
18
|
+
import { Center, Stack } from '../../components/layout';
|
|
19
|
+
// A real app reads this from the session.
|
|
20
|
+
var me = 'Dana Lee';
|
|
21
|
+
var firstThread = [
|
|
22
|
+
{ id: 'm1', from: 'Omar Reyes', at: new Date('2025-01-15T11:38:00Z'), text: 'Is the launch email going out today?' },
|
|
23
|
+
{ id: 'm2', from: me, at: new Date('2025-01-15T11:40:00Z'), text: 'Ben has the final copy. Ben, can you confirm?' },
|
|
24
|
+
];
|
|
25
|
+
export default function TypingAndStatusLine() {
|
|
26
|
+
var _a = useState(firstThread), thread = _a[0], setThread = _a[1];
|
|
27
|
+
var _b = useState(''), text = _b[0], setText = _b[1];
|
|
28
|
+
function send() {
|
|
29
|
+
// A real app sends the message to the server here and shows it at once.
|
|
30
|
+
setThread(function (rows) { return __spreadArray(__spreadArray([], rows, true), [{ id: "m".concat(rows.length + 1), from: me, at: new Date(), text: text.trim() }], false); });
|
|
31
|
+
setText('');
|
|
32
|
+
}
|
|
33
|
+
return (<Center width="page">
|
|
34
|
+
<Stack gap="large">
|
|
35
|
+
<Heading level={1} size="h5">Launch plan</Heading>
|
|
36
|
+
{/* A real app gives the list that holds the rows role="log". */}
|
|
37
|
+
<Stack gap="small">
|
|
38
|
+
{thread.map(function (m) { return (<Message key={m.id} aria-label={m.from} avatar={<UserImage userHandle={m.from} decorative/>} name={m.from} meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time"/>}>
|
|
39
|
+
<Paragraph measure="none">{m.text}</Paragraph>
|
|
40
|
+
</Message>); })}
|
|
41
|
+
</Stack>
|
|
42
|
+
<Stack gap="small">
|
|
43
|
+
{/* One person typing. Two: 'Ben and Omar are typing…'. Three or more: 'Ben and 2 others are typing…'.
|
|
44
|
+
A real app removes the line a few seconds after the last keystroke. It is not a live region. */}
|
|
45
|
+
<Paragraph size="caption" tone="secondary" measure="none">Ben is typing…</Paragraph>
|
|
46
|
+
<Composer id="typing-and-status-message" aria-label="Message" placeholder="Message the team" value={text} onChange={setText} onSubmit={send}/>
|
|
47
|
+
</Stack>
|
|
48
|
+
</Stack>
|
|
49
|
+
</Center>);
|
|
50
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Typing line
|
|
2
|
+
|
|
3
|
+
Other people in the thread are writing a message that has not arrived yet.
|
|
4
|
+
|
|
5
|
+
## Do
|
|
6
|
+
|
|
7
|
+
- Show one line just above the Composer, in small secondary text: `<Paragraph size="caption" tone="secondary">`.
|
|
8
|
+
- Name one person by first name: 'Ben is typing…'.
|
|
9
|
+
- Name two people: 'Ben and Omar are typing…'.
|
|
10
|
+
- Name the first person and count the rest when three or more type: 'Ben and 2 others are typing…'.
|
|
11
|
+
- End the line with an ellipsis, one character.
|
|
12
|
+
- Remove the line a few seconds after the last keystroke, or when the message arrives.
|
|
13
|
+
- Leave out the person who is reading.
|
|
14
|
+
- Show an agent at work with its progress row, not as typing. The case 'Agent at work' has the pattern.
|
|
15
|
+
- Keep the line out of a live region. It changes too often to read aloud.
|
|
16
|
+
|
|
17
|
+
## Don't
|
|
18
|
+
|
|
19
|
+
- Do not say an agent is typing.
|
|
20
|
+
- Do not list every name when three or more people type.
|
|
21
|
+
|
|
22
|
+
## Example: Line above the composer
|
|
23
|
+
|
|
24
|
+
Uses: `Center`, `Composer`, `Heading`, `Message`, `Paragraph`, `Stack`, `TimeStamp`, `UserImage`
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
'use client';
|
|
28
|
+
import { useState } from 'react';
|
|
29
|
+
import Message from 'oneslash-design-system/components/message';
|
|
30
|
+
import UserImage from 'oneslash-design-system/components/userImage';
|
|
31
|
+
import TimeStamp from 'oneslash-design-system/components/timeStamp';
|
|
32
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
33
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
34
|
+
import Composer from 'oneslash-design-system/components/composer';
|
|
35
|
+
import { Center, Stack } from 'oneslash-design-system/components/layout';
|
|
36
|
+
|
|
37
|
+
// A real app reads this from the session.
|
|
38
|
+
const me = 'Dana Lee';
|
|
39
|
+
|
|
40
|
+
type Row = { id: string; from: string; at: Date; text: string };
|
|
41
|
+
|
|
42
|
+
const firstThread: Row[] = [
|
|
43
|
+
{ id: 'm1', from: 'Omar Reyes', at: new Date('2025-01-15T11:38:00Z'), text: 'Is the launch email going out today?' },
|
|
44
|
+
{ id: 'm2', from: me, at: new Date('2025-01-15T11:40:00Z'), text: 'Ben has the final copy. Ben, can you confirm?' },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export default function TypingAndStatusLine() {
|
|
48
|
+
const [thread, setThread] = useState(firstThread);
|
|
49
|
+
const [text, setText] = useState('');
|
|
50
|
+
|
|
51
|
+
function send() {
|
|
52
|
+
// A real app sends the message to the server here and shows it at once.
|
|
53
|
+
setThread((rows) => [...rows, { id: `m${rows.length + 1}`, from: me, at: new Date(), text: text.trim() }]);
|
|
54
|
+
setText('');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Center width="page">
|
|
59
|
+
<Stack gap="large">
|
|
60
|
+
<Heading level={1} size="h5">Launch plan</Heading>
|
|
61
|
+
{/* A real app gives the list that holds the rows role="log". */}
|
|
62
|
+
<Stack gap="small">
|
|
63
|
+
{thread.map((m) => (
|
|
64
|
+
<Message
|
|
65
|
+
key={m.id}
|
|
66
|
+
aria-label={m.from}
|
|
67
|
+
avatar={<UserImage userHandle={m.from} decorative />}
|
|
68
|
+
name={m.from}
|
|
69
|
+
meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time" />}
|
|
70
|
+
>
|
|
71
|
+
<Paragraph measure="none">{m.text}</Paragraph>
|
|
72
|
+
</Message>
|
|
73
|
+
))}
|
|
74
|
+
</Stack>
|
|
75
|
+
<Stack gap="small">
|
|
76
|
+
{/* One person typing. Two: 'Ben and Omar are typing…'. Three or more: 'Ben and 2 others are typing…'.
|
|
77
|
+
A real app removes the line a few seconds after the last keystroke. It is not a live region. */}
|
|
78
|
+
<Paragraph size="caption" tone="secondary" measure="none">Ben is typing…</Paragraph>
|
|
79
|
+
<Composer
|
|
80
|
+
id="typing-and-status-message"
|
|
81
|
+
aria-label="Message"
|
|
82
|
+
placeholder="Message the team"
|
|
83
|
+
value={text}
|
|
84
|
+
onChange={setText}
|
|
85
|
+
onSubmit={send}
|
|
86
|
+
/>
|
|
87
|
+
</Stack>
|
|
88
|
+
</Stack>
|
|
89
|
+
</Center>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A person closes or leaves something they changed and did not save.
|
|
4
4
|
|
|
5
|
-
**Not built yet:** Scindo on the web guards no unsaved changes. It drops the changes to a document when the person chooses Cancel, with no question.
|
|
6
|
-
|
|
7
5
|
## Do
|
|
8
6
|
|
|
9
7
|
- Ask only when there are changes. With nothing changed, close at once.
|
|
@@ -235,5 +233,3 @@ export default function UnsavedChangesDiscard() {
|
|
|
235
233
|
## Native
|
|
236
234
|
|
|
237
235
|
On macOS a document window that closes with changes asks with the system alert: 'Save', 'Don't Save' and 'Cancel'. When the product cannot save, use a `confirmationDialog` with 'Discard' in the `.destructive` role and 'Keep Editing' in the `.cancel` role.
|
|
238
|
-
|
|
239
|
-
Seen in: Scindo.
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A person reaches something their plan does not include, or a limit of their plan.
|
|
4
4
|
|
|
5
|
-
**Not built yet:** Scindo's upgrade prompt on the web is an overlay built by hand that does not close on Escape, is titled 'Upgrade Required' and shows Upgrade to everyone. Commentify's upgrade Modal labels its Buttons 'Maybe Later' and 'Upgrade'.
|
|
6
|
-
|
|
7
5
|
## Do
|
|
8
6
|
|
|
9
7
|
- Say what is locked and which plan unlocks it: 'Exporting to PDF is part of the Pro plan.'
|
|
@@ -170,5 +168,3 @@ export default function UpgradePromptInline() {
|
|
|
170
168
|
## Native
|
|
171
169
|
|
|
172
170
|
On Apple show the notice in place, with an Upgrade Button only for admins. It opens the plan sheet in the app, never a link to a web page.
|
|
173
|
-
|
|
174
|
-
Seen in: Commentify, Scindo.
|