oneslash-design-system 2.15.0 → 2.17.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 +100 -73
- 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/agent-options/cards.d.ts +1 -0
- package/dist/cases/agent-options/cards.jsx +91 -0
- package/dist/cases/agent-options.md +168 -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 +432 -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 +656 -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 +338 -0
- package/dist/cases/agent-shows-sources.md +2 -2
- 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 +103 -0
- 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/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 +286 -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/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 +208 -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/mention-list/in-composer.d.ts +1 -0
- package/dist/cases/mention-list/in-composer.jsx +169 -0
- package/dist/cases/mention-list.md +252 -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 +651 -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 +310 -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 +356 -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 +179 -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 +371 -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 +189 -0
- 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/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 +552 -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 +247 -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/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 +247 -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/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 +96 -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 +3138 -59
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +6 -4
- package/dist/components/button.d.ts +3 -2
- package/dist/components/button.jsx +9 -7
- package/dist/components/composer.d.ts +74 -0
- package/dist/components/composer.jsx +122 -0
- package/dist/components/emptyBox.d.ts +6 -1
- package/dist/components/emptyBox.jsx +4 -2
- package/dist/components/fileChip.d.ts +33 -0
- package/dist/components/fileChip.jsx +61 -0
- package/dist/components/heading.d.ts +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/loadingScreen.d.ts +5 -1
- package/dist/components/loadingScreen.jsx +4 -2
- package/dist/components/menu.d.ts +21 -0
- package/dist/components/menu.jsx +27 -3
- package/dist/components/menuItem.d.ts +9 -1
- package/dist/components/menuItem.jsx +5 -4
- package/dist/components/message.d.ts +28 -0
- package/dist/components/message.jsx +25 -0
- package/dist/components/modal.d.ts +2 -1
- package/dist/components/modal.jsx +20 -8
- 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 +9 -1
- package/dist/components/radioGroup.jsx +20 -9
- package/dist/components/select.d.ts +2 -1
- package/dist/components/select.jsx +4 -2
- 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/tab.jsx +3 -2
- package/dist/components/tabsContainer.d.ts +4 -1
- package/dist/components/tabsContainer.jsx +7 -3
- package/dist/components/tag.d.ts +9 -1
- package/dist/components/tag.jsx +6 -4
- package/dist/components/textField.d.ts +5 -1
- package/dist/components/textField.jsx +7 -3
- package/dist/components/textarea.jsx +3 -18
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.jsx +103 -0
- package/dist/components/userImage.d.ts +9 -1
- package/dist/components/userImage.jsx +10 -3
- package/dist/internal/alert.d.ts +4 -0
- package/dist/internal/alert.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/menu.d.ts +6 -0
- package/dist/internal/menu.js +31 -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 +38 -1
- package/dist/stories/Alert.stories.d.ts +1 -0
- package/dist/stories/Alert.stories.jsx +16 -0
- 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 +82 -0
- package/dist/stories/Cases.generated.stories.jsx +164 -0
- package/dist/stories/Composer.stories.d.ts +23 -0
- package/dist/stories/Composer.stories.jsx +121 -0
- package/dist/stories/EmptyBox.stories.d.ts +2 -0
- package/dist/stories/EmptyBox.stories.jsx +16 -0
- package/dist/stories/FileChip.stories.d.ts +7 -0
- package/dist/stories/FileChip.stories.jsx +35 -0
- package/dist/stories/Heading.stories.d.ts +6 -0
- package/dist/stories/Heading.stories.jsx +10 -0
- package/dist/stories/IconButton.stories.d.ts +1 -0
- package/dist/stories/IconButton.stories.jsx +18 -1
- package/dist/stories/LoadingScreen.stories.d.ts +1 -0
- package/dist/stories/LoadingScreen.stories.jsx +8 -0
- 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/Modal.stories.d.ts +2 -0
- package/dist/stories/Modal.stories.jsx +36 -0
- package/dist/stories/PageComponents.stories.d.ts +1 -0
- package/dist/stories/PageComponents.stories.jsx +21 -0
- package/dist/stories/RadioGroup.stories.d.ts +3 -0
- package/dist/stories/RadioGroup.stories.jsx +54 -1
- package/dist/stories/Select.stories.d.ts +1 -0
- package/dist/stories/Select.stories.jsx +14 -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/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/dist/stories/UserImage.stories.d.ts +2 -0
- package/dist/stories/UserImage.stories.jsx +19 -0
- package/package.json +4 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import Modal from '../../components/modal';
|
|
4
|
+
import Heading from '../../components/heading';
|
|
5
|
+
import Paragraph from '../../components/paragraph';
|
|
6
|
+
import Form from '../../components/form';
|
|
7
|
+
import TextField from '../../components/textField';
|
|
8
|
+
import Button from '../../components/button';
|
|
9
|
+
import { Center, Cluster, Stack } from '../../components/layout';
|
|
10
|
+
// Names the server already has. Type one to see the request fail.
|
|
11
|
+
var takenNames = ['website refresh', 'hiring plan', 'office move'];
|
|
12
|
+
export default function RenameModal() {
|
|
13
|
+
var _a = useState('Q3 plan'), name = _a[0], setName = _a[1];
|
|
14
|
+
// Opens on the Modal, as if the person just chose Rename Project.
|
|
15
|
+
var _b = useState(true), open = _b[0], setOpen = _b[1];
|
|
16
|
+
var _c = useState('Q3 plan'), draft = _c[0], setDraft = _c[1];
|
|
17
|
+
var _d = useState(''), nameError = _d[0], setNameError = _d[1];
|
|
18
|
+
var _e = useState(false), saving = _e[0], setSaving = _e[1];
|
|
19
|
+
var timer = useRef();
|
|
20
|
+
// Stops the request if the example goes away before it ends.
|
|
21
|
+
useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
|
|
22
|
+
var next = draft.trim();
|
|
23
|
+
var canRename = next !== '' && next !== name;
|
|
24
|
+
function handleOpen() {
|
|
25
|
+
setDraft(name);
|
|
26
|
+
setNameError('');
|
|
27
|
+
setOpen(true);
|
|
28
|
+
}
|
|
29
|
+
// Escape, a click outside and Cancel all close it, except while the request runs.
|
|
30
|
+
function handleClose() {
|
|
31
|
+
if (saving)
|
|
32
|
+
return;
|
|
33
|
+
setOpen(false);
|
|
34
|
+
}
|
|
35
|
+
function handleRename() {
|
|
36
|
+
if (saving || !canRename)
|
|
37
|
+
return;
|
|
38
|
+
setNameError('');
|
|
39
|
+
setSaving(true);
|
|
40
|
+
// Stands in for the request to the server.
|
|
41
|
+
timer.current = setTimeout(function () {
|
|
42
|
+
setSaving(false);
|
|
43
|
+
if (takenNames.includes(next.toLowerCase())) {
|
|
44
|
+
setNameError("A project named '".concat(next, "' already exists. Choose another name."));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setName(next);
|
|
48
|
+
setOpen(false);
|
|
49
|
+
}, 1200);
|
|
50
|
+
}
|
|
51
|
+
return (<Center width="page">
|
|
52
|
+
<Stack gap="medium">
|
|
53
|
+
<Heading level={1} size="h5">{name}</Heading>
|
|
54
|
+
<Paragraph tone="secondary" size="body2" measure="none">12 tasks. Updated 2 days ago by Dana Lee.</Paragraph>
|
|
55
|
+
{/* A real app often opens Rename from a menu on the project. */}
|
|
56
|
+
<Cluster>
|
|
57
|
+
<Button size="small" type="secondary" state="enabled" label="Rename Project" onClickButton={handleOpen}/>
|
|
58
|
+
</Cluster>
|
|
59
|
+
</Stack>
|
|
60
|
+
<Modal isOpen={open} size="small" initialFocus="body" title="Rename Project" onClose={handleClose} actions={<>
|
|
61
|
+
<Button size="small" type="tertiary" state={saving ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose}/>
|
|
62
|
+
<Button size="small" type="primary" state={canRename ? 'enabled' : 'disabled'} label="Rename" loading={saving} onClickButton={handleRename}/>
|
|
63
|
+
</>}>
|
|
64
|
+
{/* The Form lets Enter in the field rename too. */}
|
|
65
|
+
<Form aria-label="Rename project" onSubmit={handleRename}>
|
|
66
|
+
<TextField id="rename-name" label="Project name" value={draft} disabled={saving} error={Boolean(nameError)} errorText={nameError} onChange={function (e) { setDraft(e.target.value); setNameError(''); }}/>
|
|
67
|
+
</Form>
|
|
68
|
+
</Modal>
|
|
69
|
+
</Center>);
|
|
70
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Rename
|
|
2
|
+
|
|
3
|
+
A person renames something, such as a project or a channel.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Commentify's two renames disagree on what leaving the field does: a project name cancels, a tag name saves. Scindo on the web labels its rename Modals' action 'Save', shows 'Saving...' while it runs, and writes a taken name as a red caption by hand.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Title the Modal 'Rename' and the thing, such as 'Rename Project', and give its action the same verb: 'Rename'.
|
|
10
|
+
- Keep 'Rename' `state="disabled"` while the name is empty or unchanged.
|
|
11
|
+
- Save on Enter too: put the field in a `Form`.
|
|
12
|
+
- Show a name that is taken under the field, with `error` and `errorText`, and keep the Modal open.
|
|
13
|
+
- Focus the field with `autoFocus` when the name becomes a field in place.
|
|
14
|
+
- Save on Enter and when the person leaves the field. Cancel on Escape, and when the name is empty.
|
|
15
|
+
|
|
16
|
+
## Don't
|
|
17
|
+
|
|
18
|
+
- Do not label the Modal's action 'Save' or 'OK'.
|
|
19
|
+
- Do not show a toast after a rename. The new name shows where the old one was.
|
|
20
|
+
- Do not save an empty name.
|
|
21
|
+
- Do not drop what the person typed when they leave the field.
|
|
22
|
+
|
|
23
|
+
## Option: Rename in a Modal
|
|
24
|
+
|
|
25
|
+
Use when: Rename is opened from a menu or from far away from the name.
|
|
26
|
+
|
|
27
|
+
Uses: `Button`, `Center`, `Cluster`, `Form`, `Heading`, `Modal`, `Paragraph`, `Stack`, `TextField`
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
'use client';
|
|
31
|
+
import { useEffect, useRef, useState } from 'react';
|
|
32
|
+
import Modal from 'oneslash-design-system/components/modal';
|
|
33
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
34
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
35
|
+
import Form from 'oneslash-design-system/components/form';
|
|
36
|
+
import TextField from 'oneslash-design-system/components/textField';
|
|
37
|
+
import Button from 'oneslash-design-system/components/button';
|
|
38
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
39
|
+
|
|
40
|
+
// Names the server already has. Type one to see the request fail.
|
|
41
|
+
const takenNames = ['website refresh', 'hiring plan', 'office move'];
|
|
42
|
+
|
|
43
|
+
export default function RenameModal() {
|
|
44
|
+
const [name, setName] = useState('Q3 plan');
|
|
45
|
+
// Opens on the Modal, as if the person just chose Rename Project.
|
|
46
|
+
const [open, setOpen] = useState(true);
|
|
47
|
+
const [draft, setDraft] = useState('Q3 plan');
|
|
48
|
+
const [nameError, setNameError] = useState('');
|
|
49
|
+
const [saving, setSaving] = useState(false);
|
|
50
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
51
|
+
|
|
52
|
+
// Stops the request if the example goes away before it ends.
|
|
53
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
54
|
+
|
|
55
|
+
const next = draft.trim();
|
|
56
|
+
const canRename = next !== '' && next !== name;
|
|
57
|
+
|
|
58
|
+
function handleOpen() {
|
|
59
|
+
setDraft(name);
|
|
60
|
+
setNameError('');
|
|
61
|
+
setOpen(true);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Escape, a click outside and Cancel all close it, except while the request runs.
|
|
65
|
+
function handleClose() {
|
|
66
|
+
if (saving) return;
|
|
67
|
+
setOpen(false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function handleRename() {
|
|
71
|
+
if (saving || !canRename) return;
|
|
72
|
+
setNameError('');
|
|
73
|
+
setSaving(true);
|
|
74
|
+
// Stands in for the request to the server.
|
|
75
|
+
timer.current = setTimeout(() => {
|
|
76
|
+
setSaving(false);
|
|
77
|
+
if (takenNames.includes(next.toLowerCase())) {
|
|
78
|
+
setNameError(`A project named '${next}' already exists. Choose another name.`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
setName(next);
|
|
82
|
+
setOpen(false);
|
|
83
|
+
}, 1200);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<Center width="page">
|
|
88
|
+
<Stack gap="medium">
|
|
89
|
+
<Heading level={1} size="h5">{name}</Heading>
|
|
90
|
+
<Paragraph tone="secondary" size="body2" measure="none">12 tasks. Updated 2 days ago by Dana Lee.</Paragraph>
|
|
91
|
+
{/* A real app often opens Rename from a menu on the project. */}
|
|
92
|
+
<Cluster>
|
|
93
|
+
<Button size="small" type="secondary" state="enabled" label="Rename Project" onClickButton={handleOpen} />
|
|
94
|
+
</Cluster>
|
|
95
|
+
</Stack>
|
|
96
|
+
<Modal
|
|
97
|
+
isOpen={open}
|
|
98
|
+
size="small"
|
|
99
|
+
initialFocus="body"
|
|
100
|
+
title="Rename Project"
|
|
101
|
+
onClose={handleClose}
|
|
102
|
+
actions={
|
|
103
|
+
<>
|
|
104
|
+
<Button size="small" type="tertiary" state={saving ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose} />
|
|
105
|
+
<Button size="small" type="primary" state={canRename ? 'enabled' : 'disabled'} label="Rename" loading={saving} onClickButton={handleRename} />
|
|
106
|
+
</>
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
{/* The Form lets Enter in the field rename too. */}
|
|
110
|
+
<Form aria-label="Rename project" onSubmit={handleRename}>
|
|
111
|
+
<TextField id="rename-name" label="Project name" value={draft} disabled={saving} error={Boolean(nameError)} errorText={nameError} onChange={(e) => { setDraft(e.target.value); setNameError(''); }} />
|
|
112
|
+
</Form>
|
|
113
|
+
</Modal>
|
|
114
|
+
</Center>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Option: Rename in place
|
|
120
|
+
|
|
121
|
+
Use when: The name is on screen, and it becomes a field.
|
|
122
|
+
|
|
123
|
+
Uses: `Center`, `Cluster`, `Heading`, `IconButton`, `Paragraph`, `Stack`, `TextField`, `Tooltip`
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
'use client';
|
|
127
|
+
import { useRef, useState } from 'react';
|
|
128
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
129
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
130
|
+
import TextField from 'oneslash-design-system/components/textField';
|
|
131
|
+
import IconButton from 'oneslash-design-system/components/iconButton';
|
|
132
|
+
import Tooltip from 'oneslash-design-system/components/tooltip';
|
|
133
|
+
import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
134
|
+
|
|
135
|
+
export default function RenameInline() {
|
|
136
|
+
const [name, setName] = useState('Q3 plan');
|
|
137
|
+
// Opens with the name as a field, as if the person just chose Rename.
|
|
138
|
+
const [editing, setEditing] = useState(true);
|
|
139
|
+
const [draft, setDraft] = useState('Q3 plan');
|
|
140
|
+
// Enter and Escape end the edit before the field goes away, so its blur must not save again.
|
|
141
|
+
const ended = useRef(false);
|
|
142
|
+
|
|
143
|
+
function startEditing() {
|
|
144
|
+
ended.current = false;
|
|
145
|
+
setDraft(name);
|
|
146
|
+
setEditing(true);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function save() {
|
|
150
|
+
if (ended.current) return;
|
|
151
|
+
ended.current = true;
|
|
152
|
+
const next = draft.trim();
|
|
153
|
+
// An empty or unchanged name cancels: there is nothing to send.
|
|
154
|
+
// Otherwise a real app sends the new name to the server here and shows it at once.
|
|
155
|
+
if (next && next !== name) setName(next);
|
|
156
|
+
setEditing(false);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function cancel() {
|
|
160
|
+
if (ended.current) return;
|
|
161
|
+
ended.current = true;
|
|
162
|
+
setEditing(false);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Center width="page">
|
|
167
|
+
<Stack gap="medium">
|
|
168
|
+
{editing ? (
|
|
169
|
+
<TextField
|
|
170
|
+
id="rename-inline-name"
|
|
171
|
+
label="Project name"
|
|
172
|
+
value={draft}
|
|
173
|
+
autoFocus
|
|
174
|
+
onChange={(e) => setDraft(e.target.value)}
|
|
175
|
+
onKeyDown={(e) => {
|
|
176
|
+
if (e.key === 'Enter') {
|
|
177
|
+
e.preventDefault();
|
|
178
|
+
save();
|
|
179
|
+
} else if (e.key === 'Escape') {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
cancel();
|
|
182
|
+
}
|
|
183
|
+
}}
|
|
184
|
+
onBlur={save}
|
|
185
|
+
/>
|
|
186
|
+
) : (
|
|
187
|
+
<Cluster gap="small">
|
|
188
|
+
<Heading level={1} size="h5">{name}</Heading>
|
|
189
|
+
<Tooltip title="Rename">
|
|
190
|
+
<IconButton color="iconOnly" state="enabled" size="small" iconName="Pencil" ariaLabel="Rename project" onClick={startEditing} />
|
|
191
|
+
</Tooltip>
|
|
192
|
+
</Cluster>
|
|
193
|
+
)}
|
|
194
|
+
<Paragraph tone="secondary" size="body2" measure="none">12 tasks. Updated 2 days ago by Dana Lee.</Paragraph>
|
|
195
|
+
</Stack>
|
|
196
|
+
</Center>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Native
|
|
202
|
+
|
|
203
|
+
On Apple rename in place in a list with a `TextField` and `.onSubmit`. Use an `.alert` with a `TextField` when the name is not on screen.
|
|
204
|
+
|
|
205
|
+
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ReplyFeedbackThumbs(): import("react").JSX.Element;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Bot } from 'lucide-react';
|
|
4
|
+
import Message from '../../components/message';
|
|
5
|
+
import UserImage from '../../components/userImage';
|
|
6
|
+
import Tag from '../../components/tag';
|
|
7
|
+
import TimeStamp from '../../components/timeStamp';
|
|
8
|
+
import Heading from '../../components/heading';
|
|
9
|
+
import Paragraph from '../../components/paragraph';
|
|
10
|
+
import Button from '../../components/button';
|
|
11
|
+
import IconButton from '../../components/iconButton';
|
|
12
|
+
import Tooltip from '../../components/tooltip';
|
|
13
|
+
import StepList from '../../components/stepList';
|
|
14
|
+
import { Center, Cluster, Stack } from '../../components/layout';
|
|
15
|
+
var agentName = 'Acme Agent';
|
|
16
|
+
var request = { from: 'Dana Lee', at: new Date('2025-01-15T11:40:00Z'), text: 'What changed in the new plans?' };
|
|
17
|
+
var firstRepliedAt = new Date('2025-01-15T11:41:00Z');
|
|
18
|
+
// Each Regenerate writes the next version of the reply.
|
|
19
|
+
var replies = [
|
|
20
|
+
'Pro goes from $12 to $15 a month. There is a new Team plan at $25 per seat, and the Free plan stays the same.',
|
|
21
|
+
'Two things changed. Pro now costs $15 a month instead of $12, and the new Team plan costs $25 per seat.',
|
|
22
|
+
];
|
|
23
|
+
// Each step in plain words: what the agent is doing now, and what it did once the step is done.
|
|
24
|
+
var plan = [
|
|
25
|
+
{ doing: 'Reading the thread', done: 'Read the thread' },
|
|
26
|
+
{ doing: 'Writing a new reply', done: 'Wrote a new reply' },
|
|
27
|
+
];
|
|
28
|
+
function stepsUpTo(current) {
|
|
29
|
+
return plan.slice(0, current + 1).map(function (s, i) { return (i < current ? { label: s.done, status: 'done' } : { label: s.doing, status: 'running' }); });
|
|
30
|
+
}
|
|
31
|
+
function secondsLine(seconds) {
|
|
32
|
+
return "Working for ".concat(seconds, " ").concat(seconds === 1 ? 'second' : 'seconds');
|
|
33
|
+
}
|
|
34
|
+
// The agent's marks, as the rule 'An agent says what it is' says. While a new reply is written there is
|
|
35
|
+
// no time to show: the old reply's time would be wrong for it.
|
|
36
|
+
function agentMeta(at) {
|
|
37
|
+
return (<>
|
|
38
|
+
<Tag variant="contained" size="small" label="Agent"/>
|
|
39
|
+
{at && <TimeStamp createdAt={at} dateFormat="absolute" data="time"/>}
|
|
40
|
+
<Paragraph size="caption" tone="secondary" measure="none">Model name</Paragraph>
|
|
41
|
+
</>);
|
|
42
|
+
}
|
|
43
|
+
export default function ReplyFeedbackThumbs() {
|
|
44
|
+
var _a = useState(null), thumb = _a[0], setThumb = _a[1];
|
|
45
|
+
var _b = useState(false), thanks = _b[0], setThanks = _b[1];
|
|
46
|
+
var _c = useState(false), copied = _c[0], setCopied = _c[1];
|
|
47
|
+
var _d = useState(0), version = _d[0], setVersion = _d[1];
|
|
48
|
+
// Each version of the reply has its own time: a regenerated reply shows when it was written.
|
|
49
|
+
var _e = useState(firstRepliedAt), repliedAt = _e[0], setRepliedAt = _e[1];
|
|
50
|
+
var _f = useState('reply'), phase = _f[0], setPhase = _f[1];
|
|
51
|
+
var _g = useState(0), current = _g[0], setCurrent = _g[1];
|
|
52
|
+
var _h = useState(0), seconds = _h[0], setSeconds = _h[1];
|
|
53
|
+
var _j = useState(false), stopped = _j[0], setStopped = _j[1];
|
|
54
|
+
var thanksTimer = useRef();
|
|
55
|
+
var copyTimer = useRef();
|
|
56
|
+
var tick = useRef();
|
|
57
|
+
var step = useRef();
|
|
58
|
+
var cancel = useRef();
|
|
59
|
+
var regenerateButton = useRef(null);
|
|
60
|
+
var stopButton = useRef(null);
|
|
61
|
+
// Where focus goes after the next render, once the element it goes to is on screen.
|
|
62
|
+
var focusNext = useRef();
|
|
63
|
+
// The clipboard answers later; by then the example may be gone.
|
|
64
|
+
var mounted = useRef(true);
|
|
65
|
+
// On unmount it stops every timer and the run.
|
|
66
|
+
useEffect(function () { return function () {
|
|
67
|
+
mounted.current = false;
|
|
68
|
+
clearTimeout(thanksTimer.current);
|
|
69
|
+
clearTimeout(copyTimer.current);
|
|
70
|
+
clearInterval(tick.current);
|
|
71
|
+
clearTimeout(step.current);
|
|
72
|
+
clearTimeout(cancel.current);
|
|
73
|
+
}; }, []);
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
var move = focusNext.current;
|
|
76
|
+
focusNext.current = undefined;
|
|
77
|
+
move === null || move === void 0 ? void 0 : move();
|
|
78
|
+
});
|
|
79
|
+
var reply = replies[version];
|
|
80
|
+
// Pressing a thumb marks it, pressing it again clears it, and the other thumb moves the mark.
|
|
81
|
+
// A real app sends the mark to the server; the thanks is the only confirmation.
|
|
82
|
+
function mark(next) {
|
|
83
|
+
var value = thumb === next ? null : next;
|
|
84
|
+
setThumb(value);
|
|
85
|
+
clearTimeout(thanksTimer.current);
|
|
86
|
+
setThanks(value !== null);
|
|
87
|
+
if (value !== null)
|
|
88
|
+
thanksTimer.current = setTimeout(function () { return setThanks(false); }, 2000);
|
|
89
|
+
}
|
|
90
|
+
function copy() {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(reply).then(function () {
|
|
93
|
+
if (!mounted.current)
|
|
94
|
+
return;
|
|
95
|
+
setCopied(true);
|
|
96
|
+
clearTimeout(copyTimer.current);
|
|
97
|
+
copyTimer.current = setTimeout(function () { return setCopied(false); }, 2000);
|
|
98
|
+
}, function () { });
|
|
99
|
+
}
|
|
100
|
+
function endRun() {
|
|
101
|
+
clearInterval(tick.current);
|
|
102
|
+
clearTimeout(step.current);
|
|
103
|
+
setPhase('reply');
|
|
104
|
+
// 'Stop' is gone and the buttons are back, so focus returns to Regenerate.
|
|
105
|
+
focusNext.current = function () { var _a; return (_a = regenerateButton.current) === null || _a === void 0 ? void 0 : _a.focus(); };
|
|
106
|
+
}
|
|
107
|
+
// Stands in for the agent's run: one step every 1.5 seconds.
|
|
108
|
+
function advance(at) {
|
|
109
|
+
step.current = setTimeout(function () {
|
|
110
|
+
if (at === plan.length - 1) {
|
|
111
|
+
setVersion(function (v) { return (v + 1) % replies.length; });
|
|
112
|
+
setRepliedAt(new Date());
|
|
113
|
+
setThumb(null);
|
|
114
|
+
endRun();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
setCurrent(at + 1);
|
|
118
|
+
advance(at + 1);
|
|
119
|
+
}, 1500);
|
|
120
|
+
}
|
|
121
|
+
// The reply's row turns into the agent's progress row, as the case 'Agent at work' shows.
|
|
122
|
+
function regenerate() {
|
|
123
|
+
clearTimeout(thanksTimer.current);
|
|
124
|
+
setThanks(false);
|
|
125
|
+
setStopped(false);
|
|
126
|
+
setCurrent(0);
|
|
127
|
+
setSeconds(0);
|
|
128
|
+
setPhase('running');
|
|
129
|
+
tick.current = setInterval(function () { return setSeconds(function (s) { return s + 1; }); }, 1000);
|
|
130
|
+
advance(0);
|
|
131
|
+
// Regenerate had focus and is gone; 'Stop' takes its place.
|
|
132
|
+
focusNext.current = function () { var _a; return (_a = stopButton.current) === null || _a === void 0 ? void 0 : _a.focus(); };
|
|
133
|
+
}
|
|
134
|
+
// Stop asks the server to end the run. The reply stays as it was.
|
|
135
|
+
function stop() {
|
|
136
|
+
if (phase !== 'running')
|
|
137
|
+
return;
|
|
138
|
+
clearTimeout(step.current);
|
|
139
|
+
setPhase('stopping');
|
|
140
|
+
// Stands in for the request to the server.
|
|
141
|
+
cancel.current = setTimeout(function () {
|
|
142
|
+
setStopped(true);
|
|
143
|
+
endRun();
|
|
144
|
+
}, 1200);
|
|
145
|
+
}
|
|
146
|
+
var working = phase !== 'reply';
|
|
147
|
+
return (<Center width="page">
|
|
148
|
+
<Stack gap="large">
|
|
149
|
+
<Heading level={1} size="h5">Pricing</Heading>
|
|
150
|
+
{/* A real app gives the list that holds the rows role="log". */}
|
|
151
|
+
<Stack gap="small">
|
|
152
|
+
<Message aria-label={request.from} avatar={<UserImage userHandle={request.from} decorative/>} name={request.from} meta={<TimeStamp createdAt={request.at} dateFormat="absolute" data="time"/>}>
|
|
153
|
+
<Paragraph measure="none">{request.text}</Paragraph>
|
|
154
|
+
</Message>
|
|
155
|
+
<Message aria-label={"".concat(agentName, ", agent")} avatar={<UserImage userHandle={agentName} icon={Bot} decorative/>} name={agentName} meta={agentMeta(working ? undefined : repliedAt)} footer={working ? (
|
|
156
|
+
// The only Stop, on the row for the whole run. It shows loading while the run is stopping.
|
|
157
|
+
<Cluster>
|
|
158
|
+
<Button ref={stopButton} size="small" type="secondary" state="enabled" label="Stop" loading={phase === 'stopping'} onClickButton={stop}/>
|
|
159
|
+
</Cluster>) : (
|
|
160
|
+
// One reply is on screen, so 'reply' is enough in the names. With several, each name says which reply.
|
|
161
|
+
<Cluster gap="small">
|
|
162
|
+
<Tooltip title="Mark as helpful">
|
|
163
|
+
<IconButton color="iconOnly" state={thumb === 'up' ? 'selected' : 'enabled'} size="small" iconName="ThumbsUp" ariaLabel="Mark reply as helpful" aria-pressed={thumb === 'up'} onClick={function () { return mark('up'); }}/>
|
|
164
|
+
</Tooltip>
|
|
165
|
+
<Tooltip title="Mark as not helpful">
|
|
166
|
+
<IconButton color="iconOnly" state={thumb === 'down' ? 'selected' : 'enabled'} size="small" iconName="ThumbsDown" ariaLabel="Mark reply as not helpful" aria-pressed={thumb === 'down'} onClick={function () { return mark('down'); }}/>
|
|
167
|
+
</Tooltip>
|
|
168
|
+
<Tooltip title={copied ? 'Copied' : 'Copy'}>
|
|
169
|
+
<IconButton color="iconOnly" state="enabled" size="small" iconName={copied ? 'Check' : 'Copy'} ariaLabel={copied ? 'Copied' : 'Copy reply'} onClick={copy}/>
|
|
170
|
+
</Tooltip>
|
|
171
|
+
{/* Only on the latest reply. */}
|
|
172
|
+
<Tooltip title="Regenerate">
|
|
173
|
+
<IconButton ref={regenerateButton} color="iconOnly" state="enabled" size="small" iconName="RefreshCw" ariaLabel="Regenerate reply" onClick={regenerate}/>
|
|
174
|
+
</Tooltip>
|
|
175
|
+
{/* A real app wraps the thanks in a polite live region. */}
|
|
176
|
+
{thanks && <Paragraph size="caption" tone="secondary" measure="none">Thanks. This helps the agent improve.</Paragraph>}
|
|
177
|
+
</Cluster>)}>
|
|
178
|
+
{working ? (
|
|
179
|
+
// A real app wraps this part in a polite live region, since StepList has none.
|
|
180
|
+
<Stack gap="medium">
|
|
181
|
+
<Paragraph size="caption" tone="secondary" measure="none">{secondsLine(seconds)}</Paragraph>
|
|
182
|
+
<StepList aria-label="Acme Agent's steps" steps={stepsUpTo(current)}/>
|
|
183
|
+
</Stack>) : (<Stack gap="small">
|
|
184
|
+
<Paragraph measure="none">{reply}</Paragraph>
|
|
185
|
+
{stopped && <Paragraph size="caption" tone="secondary" measure="none">Stopped. Nothing was changed.</Paragraph>}
|
|
186
|
+
</Stack>)}
|
|
187
|
+
</Message>
|
|
188
|
+
</Stack>
|
|
189
|
+
</Stack>
|
|
190
|
+
</Center>);
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ReplyFeedbackWithReason(): import("react").JSX.Element;
|