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.
Files changed (301) hide show
  1. package/README.md +2 -2
  2. package/dist/DESIGN.md +56 -17
  3. package/dist/cases/accept-invite/signed-in.jsx +1 -1
  4. package/dist/cases/accept-invite/signed-out.jsx +1 -1
  5. package/dist/cases/accept-invite.md +3 -7
  6. package/dist/cases/account-menu/menu.d.ts +1 -0
  7. package/dist/cases/account-menu/menu.jsx +99 -0
  8. package/dist/cases/account-menu.md +164 -0
  9. package/dist/cases/agent-asks-before-risky-action.md +0 -4
  10. package/dist/cases/agent-cancels-when-unanswered.md +0 -4
  11. package/dist/cases/agent-options/cards.d.ts +1 -0
  12. package/dist/cases/agent-options/cards.jsx +91 -0
  13. package/dist/cases/agent-options.md +164 -0
  14. package/dist/cases/agent-pending-reply/steps.d.ts +1 -0
  15. package/dist/cases/agent-pending-reply/steps.jsx +149 -0
  16. package/dist/cases/agent-pending-reply/streaming.d.ts +1 -0
  17. package/dist/cases/agent-pending-reply/streaming.jsx +146 -0
  18. package/dist/cases/agent-pending-reply.md +428 -0
  19. package/dist/cases/agent-plan-proposal/changes.d.ts +1 -0
  20. package/dist/cases/agent-plan-proposal/changes.jsx +224 -0
  21. package/dist/cases/agent-plan-proposal/steps.d.ts +1 -0
  22. package/dist/cases/agent-plan-proposal/steps.jsx +211 -0
  23. package/dist/cases/agent-plan-proposal.md +652 -0
  24. package/dist/cases/agent-question/choices.d.ts +1 -0
  25. package/dist/cases/agent-question/choices.jsx +132 -0
  26. package/dist/cases/agent-question/free-text.d.ts +1 -0
  27. package/dist/cases/agent-question/free-text.jsx +81 -0
  28. package/dist/cases/agent-question.md +334 -0
  29. package/dist/cases/agent-refuses-clearly.md +0 -4
  30. package/dist/cases/agent-says-what-it-is.md +0 -2
  31. package/dist/cases/agent-settings/form.d.ts +1 -0
  32. package/dist/cases/agent-settings/form.jsx +164 -0
  33. package/dist/cases/agent-settings.md +259 -0
  34. package/dist/cases/agent-shows-progress.md +0 -2
  35. package/dist/cases/agent-shows-sources.md +2 -4
  36. package/dist/cases/api-keys/list.d.ts +1 -0
  37. package/dist/cases/api-keys/list.jsx +162 -0
  38. package/dist/cases/api-keys.md +229 -0
  39. package/dist/cases/artifact-card/card.d.ts +1 -0
  40. package/dist/cases/artifact-card/card.jsx +45 -0
  41. package/dist/cases/artifact-card.md +99 -0
  42. package/dist/cases/auth-gate-loading.md +0 -4
  43. package/dist/cases/check-your-email.md +0 -4
  44. package/dist/cases/collapsible-search/popover.d.ts +1 -0
  45. package/dist/cases/collapsible-search/popover.jsx +74 -0
  46. package/dist/cases/collapsible-search.md +143 -0
  47. package/dist/cases/composer-limit/notice-with-action.d.ts +1 -0
  48. package/dist/cases/composer-limit/notice-with-action.jsx +87 -0
  49. package/dist/cases/composer-limit/notice.d.ts +1 -0
  50. package/dist/cases/composer-limit/notice.jsx +84 -0
  51. package/dist/cases/composer-limit.md +282 -0
  52. package/dist/cases/confirm-destructive-action.md +0 -4
  53. package/dist/cases/confirm-dialogs.md +0 -4
  54. package/dist/cases/conversation-starters/chips.d.ts +1 -0
  55. package/dist/cases/conversation-starters/chips.jsx +69 -0
  56. package/dist/cases/conversation-starters/none.d.ts +1 -0
  57. package/dist/cases/conversation-starters/none.jsx +45 -0
  58. package/dist/cases/conversation-starters.md +204 -0
  59. package/dist/cases/create-modal.md +0 -4
  60. package/dist/cases/danger-zone/collapsed.d.ts +1 -0
  61. package/dist/cases/danger-zone/collapsed.jsx +75 -0
  62. package/dist/cases/danger-zone/shown.d.ts +1 -0
  63. package/dist/cases/danger-zone/shown.jsx +95 -0
  64. package/dist/cases/danger-zone.md +263 -0
  65. package/dist/cases/device-login.md +0 -4
  66. package/dist/cases/email-confirmed.md +0 -4
  67. package/dist/cases/empty-list.md +0 -4
  68. package/dist/cases/empty-lists.md +0 -4
  69. package/dist/cases/empty-not-set-up.md +0 -4
  70. package/dist/cases/empty-search.md +0 -4
  71. package/dist/cases/error-page.md +0 -4
  72. package/dist/cases/feedback-form.md +0 -4
  73. package/dist/cases/filter-menu/presets.d.ts +1 -0
  74. package/dist/cases/filter-menu/presets.jsx +53 -0
  75. package/dist/cases/filter-menu/with-clear.d.ts +1 -0
  76. package/dist/cases/filter-menu/with-clear.jsx +56 -0
  77. package/dist/cases/filter-menu.md +204 -0
  78. package/dist/cases/forgot-password.md +0 -4
  79. package/dist/cases/form-errors.md +0 -4
  80. package/dist/cases/import-checklist.md +0 -4
  81. package/dist/cases/inline-form-feedback.md +0 -4
  82. package/dist/cases/integrations-list/nested.d.ts +1 -0
  83. package/dist/cases/integrations-list/nested.jsx +164 -0
  84. package/dist/cases/integrations-list/rows.d.ts +1 -0
  85. package/dist/cases/integrations-list/rows.jsx +134 -0
  86. package/dist/cases/integrations-list.md +379 -0
  87. package/dist/cases/invite-member.md +0 -4
  88. package/dist/cases/load-failure.md +0 -4
  89. package/dist/cases/log-out-confirm.md +0 -4
  90. package/dist/cases/login-page.md +0 -4
  91. package/dist/cases/members-list/rows.d.ts +1 -0
  92. package/dist/cases/members-list/rows.jsx +318 -0
  93. package/dist/cases/members-list/table.d.ts +1 -0
  94. package/dist/cases/members-list/table.jsx +351 -0
  95. package/dist/cases/members-list.md +799 -0
  96. package/dist/cases/mention-list/in-composer.d.ts +1 -0
  97. package/dist/cases/mention-list/in-composer.jsx +169 -0
  98. package/dist/cases/mention-list.md +248 -0
  99. package/dist/cases/message-actions/hover-toolbar.d.ts +1 -0
  100. package/dist/cases/message-actions/hover-toolbar.jsx +229 -0
  101. package/dist/cases/message-actions/menu.d.ts +1 -0
  102. package/dist/cases/message-actions/menu.jsx +258 -0
  103. package/dist/cases/message-actions.md +647 -0
  104. package/dist/cases/message-attachments/in-composer.d.ts +1 -0
  105. package/dist/cases/message-attachments/in-composer.jsx +134 -0
  106. package/dist/cases/message-attachments/in-message.d.ts +1 -0
  107. package/dist/cases/message-attachments/in-message.jsx +46 -0
  108. package/dist/cases/message-attachments.md +306 -0
  109. package/dist/cases/message-composer/plain.d.ts +1 -0
  110. package/dist/cases/message-composer/plain.jsx +57 -0
  111. package/dist/cases/message-composer/with-tools.d.ts +1 -0
  112. package/dist/cases/message-composer/with-tools.jsx +182 -0
  113. package/dist/cases/message-composer.md +352 -0
  114. package/dist/cases/message-edit/in-place.d.ts +1 -0
  115. package/dist/cases/message-edit/in-place.jsx +99 -0
  116. package/dist/cases/message-edit.md +175 -0
  117. package/dist/cases/message-reactions/chips.d.ts +1 -0
  118. package/dist/cases/message-reactions/chips.jsx +118 -0
  119. package/dist/cases/message-reactions/quick-pick.d.ts +1 -0
  120. package/dist/cases/message-reactions/quick-pick.jsx +155 -0
  121. package/dist/cases/message-reactions.md +367 -0
  122. package/dist/cases/message-row/grouped.d.ts +1 -0
  123. package/dist/cases/message-row/grouped.jsx +56 -0
  124. package/dist/cases/message-row/person-and-agent.d.ts +1 -0
  125. package/dist/cases/message-row/person-and-agent.jsx +41 -0
  126. package/dist/cases/message-row.md +185 -0
  127. package/dist/cases/not-found-page.md +0 -4
  128. package/dist/cases/notification-menu/menu.d.ts +1 -0
  129. package/dist/cases/notification-menu/menu.jsx +74 -0
  130. package/dist/cases/notification-menu.md +135 -0
  131. package/dist/cases/oauth-consent.md +0 -4
  132. package/dist/cases/on-off-settings/list.d.ts +1 -0
  133. package/dist/cases/on-off-settings/list.jsx +97 -0
  134. package/dist/cases/on-off-settings.md +116 -0
  135. package/dist/cases/overflow-menu/in-a-header.d.ts +1 -0
  136. package/dist/cases/overflow-menu/in-a-header.jsx +128 -0
  137. package/dist/cases/overflow-menu/on-a-row.d.ts +1 -0
  138. package/dist/cases/overflow-menu/on-a-row.jsx +183 -0
  139. package/dist/cases/overflow-menu.md +410 -0
  140. package/dist/cases/profile-form/form.d.ts +1 -0
  141. package/dist/cases/profile-form/form.jsx +153 -0
  142. package/dist/cases/profile-form.md +236 -0
  143. package/dist/cases/quick-switcher/modal.d.ts +1 -0
  144. package/dist/cases/quick-switcher/modal.jsx +114 -0
  145. package/dist/cases/quick-switcher.md +205 -0
  146. package/dist/cases/range-switch/segmented.d.ts +1 -0
  147. package/dist/cases/range-switch/segmented.jsx +30 -0
  148. package/dist/cases/range-switch.md +67 -0
  149. package/dist/cases/rename.md +0 -4
  150. package/dist/cases/reply-feedback/thumbs.d.ts +1 -0
  151. package/dist/cases/reply-feedback/thumbs.jsx +191 -0
  152. package/dist/cases/reply-feedback/with-reason.d.ts +1 -0
  153. package/dist/cases/reply-feedback/with-reason.jsx +221 -0
  154. package/dist/cases/reply-feedback.md +548 -0
  155. package/dist/cases/reply-sources/cards.d.ts +1 -0
  156. package/dist/cases/reply-sources/cards.jsx +83 -0
  157. package/dist/cases/reply-sources/tag-only.d.ts +1 -0
  158. package/dist/cases/reply-sources/tag-only.jsx +45 -0
  159. package/dist/cases/reply-sources.md +243 -0
  160. package/dist/cases/route-loading.md +0 -2
  161. package/dist/cases/scope-picker/menu.d.ts +1 -0
  162. package/dist/cases/scope-picker/menu.jsx +47 -0
  163. package/dist/cases/scope-picker.md +97 -0
  164. package/dist/cases/set-new-password.md +0 -4
  165. package/dist/cases/settings-page/side-nav.d.ts +1 -0
  166. package/dist/cases/settings-page/side-nav.jsx +171 -0
  167. package/dist/cases/settings-page/top-tabs.d.ts +1 -0
  168. package/dist/cases/settings-page/top-tabs.jsx +129 -0
  169. package/dist/cases/settings-page.md +378 -0
  170. package/dist/cases/settings-save.md +35 -0
  171. package/dist/cases/sign-up-page.md +1 -5
  172. package/dist/cases/slash-command-list/in-composer.d.ts +1 -0
  173. package/dist/cases/slash-command-list/in-composer.jsx +162 -0
  174. package/dist/cases/slash-command-list.md +243 -0
  175. package/dist/cases/success-feedback.md +1 -5
  176. package/dist/cases/tag-filter/tags.d.ts +1 -0
  177. package/dist/cases/tag-filter/tags.jsx +226 -0
  178. package/dist/cases/tag-filter.md +298 -0
  179. package/dist/cases/type-to-confirm.md +0 -4
  180. package/dist/cases/typing-and-status/line.d.ts +1 -0
  181. package/dist/cases/typing-and-status/line.jsx +50 -0
  182. package/dist/cases/typing-and-status.md +92 -0
  183. package/dist/cases/unsaved-changes-guard.md +0 -4
  184. package/dist/cases/upgrade-prompt.md +0 -4
  185. package/dist/cases.json +2331 -294
  186. package/dist/components/alert.d.ts +3 -1
  187. package/dist/components/alert.jsx +2 -2
  188. package/dist/components/button.d.ts +3 -2
  189. package/dist/components/button.jsx +14 -9
  190. package/dist/components/checkBox.d.ts +5 -1
  191. package/dist/components/checkBox.jsx +2 -2
  192. package/dist/components/composer.d.ts +74 -0
  193. package/dist/components/composer.jsx +122 -0
  194. package/dist/components/copyField.d.ts +20 -0
  195. package/dist/components/copyField.jsx +99 -0
  196. package/dist/components/fileChip.d.ts +33 -0
  197. package/dist/components/fileChip.jsx +61 -0
  198. package/dist/components/formField.d.ts +34 -0
  199. package/dist/components/formField.jsx +28 -0
  200. package/dist/components/heading.d.ts +3 -1
  201. package/dist/components/heading.jsx +2 -2
  202. package/dist/components/iconButton.d.ts +3 -3
  203. package/dist/components/iconButton.jsx +9 -7
  204. package/dist/components/layout.d.ts +7 -1
  205. package/dist/components/layout.jsx +5 -2
  206. package/dist/components/menu.d.ts +21 -0
  207. package/dist/components/menu.jsx +27 -3
  208. package/dist/components/menuItem.d.ts +12 -2
  209. package/dist/components/menuItem.jsx +6 -5
  210. package/dist/components/message.d.ts +28 -0
  211. package/dist/components/message.jsx +25 -0
  212. package/dist/components/navigation.d.ts +9 -1
  213. package/dist/components/navigation.jsx +15 -3
  214. package/dist/components/paragraph.d.ts +3 -1
  215. package/dist/components/paragraph.jsx +2 -2
  216. package/dist/components/popover.d.ts +7 -1
  217. package/dist/components/popover.jsx +35 -9
  218. package/dist/components/radioGroup.d.ts +12 -1
  219. package/dist/components/radioGroup.jsx +20 -9
  220. package/dist/components/segmentedControl.d.ts +22 -0
  221. package/dist/components/segmentedControl.jsx +54 -0
  222. package/dist/components/select.d.ts +5 -1
  223. package/dist/components/select.jsx +2 -2
  224. package/dist/components/settingsSection.d.ts +31 -0
  225. package/dist/components/settingsSection.jsx +58 -0
  226. package/dist/components/slidingIndicator.d.ts +50 -0
  227. package/dist/components/slidingIndicator.jsx +102 -0
  228. package/dist/components/sourceCard.d.ts +23 -0
  229. package/dist/components/sourceCard.jsx +56 -0
  230. package/dist/components/stepList.d.ts +17 -0
  231. package/dist/components/stepList.jsx +79 -0
  232. package/dist/components/switch.d.ts +25 -0
  233. package/dist/components/switch.jsx +55 -0
  234. package/dist/components/tab.jsx +5 -11
  235. package/dist/components/tabsContainer.jsx +5 -67
  236. package/dist/components/tag.d.ts +9 -1
  237. package/dist/components/tag.jsx +6 -4
  238. package/dist/components/textField.d.ts +12 -2
  239. package/dist/components/textField.jsx +11 -4
  240. package/dist/components/textarea.d.ts +5 -1
  241. package/dist/components/textarea.jsx +6 -21
  242. package/dist/components/useHotkey.d.ts +7 -0
  243. package/dist/components/useHotkey.js +24 -0
  244. package/dist/components/userImage.d.ts +9 -1
  245. package/dist/components/userImage.jsx +10 -3
  246. package/dist/index.d.ts +6 -0
  247. package/dist/index.js +6 -0
  248. package/dist/internal/autoGrow.d.ts +11 -0
  249. package/dist/internal/autoGrow.js +28 -0
  250. package/dist/internal/composer.d.ts +16 -0
  251. package/dist/internal/composer.js +18 -0
  252. package/dist/internal/copyField.d.ts +5 -0
  253. package/dist/internal/copyField.js +61 -0
  254. package/dist/internal/hotkey.d.ts +16 -0
  255. package/dist/internal/hotkey.js +20 -0
  256. package/dist/internal/menu.d.ts +6 -0
  257. package/dist/internal/menu.js +31 -0
  258. package/dist/internal/switch.d.ts +5 -0
  259. package/dist/internal/switch.js +9 -0
  260. package/dist/native-mapping.json +62 -1
  261. package/dist/stories/Button.stories.d.ts +1 -0
  262. package/dist/stories/Button.stories.jsx +17 -1
  263. package/dist/stories/Cases.generated.stories.d.ts +53 -0
  264. package/dist/stories/Cases.generated.stories.jsx +106 -0
  265. package/dist/stories/Composer.stories.d.ts +23 -0
  266. package/dist/stories/Composer.stories.jsx +121 -0
  267. package/dist/stories/CopyField.stories.d.ts +11 -0
  268. package/dist/stories/CopyField.stories.jsx +65 -0
  269. package/dist/stories/FileChip.stories.d.ts +7 -0
  270. package/dist/stories/FileChip.stories.jsx +35 -0
  271. package/dist/stories/FormField.stories.d.ts +6 -0
  272. package/dist/stories/FormField.stories.jsx +44 -0
  273. package/dist/stories/IconButton.stories.d.ts +1 -0
  274. package/dist/stories/IconButton.stories.jsx +18 -1
  275. package/dist/stories/Menu.stories.d.ts +4 -0
  276. package/dist/stories/Menu.stories.jsx +46 -1
  277. package/dist/stories/MenuItem.stories.d.ts +1 -0
  278. package/dist/stories/MenuItem.stories.jsx +8 -0
  279. package/dist/stories/Message.stories.d.ts +10 -0
  280. package/dist/stories/Message.stories.jsx +77 -0
  281. package/dist/stories/Navigation.stories.d.ts +1 -0
  282. package/dist/stories/Navigation.stories.jsx +17 -1
  283. package/dist/stories/PageComponents.stories.d.ts +1 -0
  284. package/dist/stories/PageComponents.stories.jsx +21 -0
  285. package/dist/stories/RadioGroup.stories.d.ts +2 -0
  286. package/dist/stories/RadioGroup.stories.jsx +40 -1
  287. package/dist/stories/SegmentedControl.stories.d.ts +8 -0
  288. package/dist/stories/SegmentedControl.stories.jsx +33 -0
  289. package/dist/stories/SettingsSection.stories.d.ts +11 -0
  290. package/dist/stories/SettingsSection.stories.jsx +64 -0
  291. package/dist/stories/SourceCard.stories.d.ts +8 -0
  292. package/dist/stories/SourceCard.stories.jsx +33 -0
  293. package/dist/stories/StepList.stories.d.ts +8 -0
  294. package/dist/stories/StepList.stories.jsx +35 -0
  295. package/dist/stories/Switch.stories.d.ts +14 -0
  296. package/dist/stories/Switch.stories.jsx +87 -0
  297. package/dist/stories/TextField.stories.d.ts +1 -0
  298. package/dist/stories/TextField.stories.jsx +13 -0
  299. package/dist/stories/UserImage.stories.d.ts +2 -0
  300. package/dist/stories/UserImage.stories.jsx +19 -0
  301. package/package.json +8 -3
@@ -0,0 +1,87 @@
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 { useRef, useState } from 'react';
12
+ import { Bot } from 'lucide-react';
13
+ import Message from '../../components/message';
14
+ import UserImage from '../../components/userImage';
15
+ import TimeStamp from '../../components/timeStamp';
16
+ import Heading from '../../components/heading';
17
+ import Paragraph from '../../components/paragraph';
18
+ import Composer from '../../components/composer';
19
+ import Alert from '../../components/alert';
20
+ import Button from '../../components/button';
21
+ import IconButton from '../../components/iconButton';
22
+ import Tooltip from '../../components/tooltip';
23
+ import { Center, Cluster, Stack } from '../../components/layout';
24
+ // A real app passes the router from its framework, such as Next's useRouter().
25
+ var router = { push: function (url) { return console.info("Go to ".concat(url)); } };
26
+ // A real app reads this from the session.
27
+ var me = 'Dana Lee';
28
+ var firstThread = [
29
+ { id: 'm1', from: 'Ben Carter', at: new Date('2025-01-15T11:40:00Z'), text: 'The pricing page is live.' },
30
+ { id: 'm2', from: 'Omar Reyes', at: new Date('2025-01-15T11:42:00Z'), text: 'Who writes the launch email?' },
31
+ ];
32
+ var FIVE_MINUTES = 5 * 60 * 1000;
33
+ // A follow-on row: the same sender as the row above, less than 5 minutes later and on the same day.
34
+ function followsOn(rows, i) {
35
+ var prev = rows[i - 1];
36
+ return (!!prev &&
37
+ prev.from === rows[i].from &&
38
+ rows[i].at.getTime() - prev.at.getTime() < FIVE_MINUTES &&
39
+ rows[i].at.toDateString() === prev.at.toDateString());
40
+ }
41
+ export default function ComposerLimitNoticeWithAction() {
42
+ var _a = useState(firstThread), thread = _a[0], setThread = _a[1];
43
+ var _b = useState(''), text = _b[0], setText = _b[1];
44
+ // Opens on the notice, as if the workspace just used its last AI agent response of the month.
45
+ var _c = useState(true), showNotice = _c[0], setShowNotice = _c[1];
46
+ var field = useRef(null);
47
+ // 'Not Now' goes away with the notice, so focus goes to the message box.
48
+ function notNow() {
49
+ var _a;
50
+ setShowNotice(false);
51
+ (_a = field.current) === null || _a === void 0 ? void 0 : _a.focus();
52
+ }
53
+ // The agent cannot be called, but messages to people still send.
54
+ function send() {
55
+ // A real app sends the message to the server here and shows it at once.
56
+ setThread(function (rows) { return __spreadArray(__spreadArray([], rows, true), [{ id: "m".concat(rows.length + 1), from: me, at: new Date(), text: text.trim() }], false); });
57
+ setText('');
58
+ }
59
+ return (<Center width="page">
60
+ <Stack gap="large">
61
+ <Heading level={1} size="h5">Launch plan</Heading>
62
+ {/* A real app gives the list that holds the rows role="log". */}
63
+ <Stack gap="small">
64
+ {thread.map(function (m, i) { return (<Message key={m.id} aria-label={m.from} compact={followsOn(thread, i)} avatar={<UserImage userHandle={m.from} decorative/>} name={m.from} meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time"/>}>
65
+ <Paragraph measure="none">{m.text}</Paragraph>
66
+ </Message>); })}
67
+ </Stack>
68
+ <Composer ref={field} id="composer-limit-action-message" aria-label="Message"
69
+ // After 'Not Now' the placeholder says when agent replies start again.
70
+ placeholder={showNotice ? 'Message the team' : 'Message the team. Agent replies start again on December 1.'} value={text} onChange={setText} onSubmit={send}
71
+ // A standing condition: no close button on the Alert, and no auto-dismiss. 'Not Now' closes it.
72
+ // This person can change the plan, so they get the button that lifts the limit. Alert has no action slot.
73
+ above={showNotice ? (<Stack gap="small">
74
+ <Alert type="warning" variant="inline" autoDismiss={false} message="You've used all 50 AI agent responses this month." secondMessage="They start again on December 1. The Pro plan gives Acme Design 1,000 AI agent responses a month."/>
75
+ <Cluster gap="small">
76
+ <Button size="small" type="tertiary" state="enabled" label="Not Now" onClickButton={notNow}/>
77
+ <Button size="small" type="primary" state="enabled" label="Upgrade to Pro" onClickButton={function () { return router.push('/settings/billing?plan=pro'); }}/>
78
+ </Cluster>
79
+ </Stack>) : undefined} tools={
80
+ // It stays pressable while the limit stands, as the case 'Upgrade prompt' says: pressing it shows the notice
81
+ // again. It does not turn on until the limit is lifted.
82
+ <Tooltip title="Mention the agent">
83
+ <IconButton color="iconOnly" state="enabled" size="small" icon={Bot} ariaLabel="Mention the agent" aria-pressed={false} onClick={function () { return setShowNotice(true); }}/>
84
+ </Tooltip>}/>
85
+ </Stack>
86
+ </Center>);
87
+ }
@@ -0,0 +1 @@
1
+ export default function ComposerLimitNotice(): import("react").JSX.Element;
@@ -0,0 +1,84 @@
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 { useRef, useState } from 'react';
12
+ import { Bot } from 'lucide-react';
13
+ import Message from '../../components/message';
14
+ import UserImage from '../../components/userImage';
15
+ import TimeStamp from '../../components/timeStamp';
16
+ import Heading from '../../components/heading';
17
+ import Paragraph from '../../components/paragraph';
18
+ import Composer from '../../components/composer';
19
+ import Alert from '../../components/alert';
20
+ import Button from '../../components/button';
21
+ import IconButton from '../../components/iconButton';
22
+ import Tooltip from '../../components/tooltip';
23
+ import { Center, Cluster, Stack } from '../../components/layout';
24
+ // A real app reads this from the session.
25
+ var me = 'Dana Lee';
26
+ var firstThread = [
27
+ { id: 'm1', from: 'Ben Carter', at: new Date('2025-01-15T11:40:00Z'), text: 'The pricing page is live.' },
28
+ { id: 'm2', from: 'Omar Reyes', at: new Date('2025-01-15T11:42:00Z'), text: 'Who writes the launch email?' },
29
+ ];
30
+ var FIVE_MINUTES = 5 * 60 * 1000;
31
+ // A follow-on row: the same sender as the row above, less than 5 minutes later and on the same day.
32
+ function followsOn(rows, i) {
33
+ var prev = rows[i - 1];
34
+ return (!!prev &&
35
+ prev.from === rows[i].from &&
36
+ rows[i].at.getTime() - prev.at.getTime() < FIVE_MINUTES &&
37
+ rows[i].at.toDateString() === prev.at.toDateString());
38
+ }
39
+ export default function ComposerLimitNotice() {
40
+ var _a = useState(firstThread), thread = _a[0], setThread = _a[1];
41
+ var _b = useState(''), text = _b[0], setText = _b[1];
42
+ // Opens on the notice, as if the workspace just used its last AI agent response of the month.
43
+ var _c = useState(true), showNotice = _c[0], setShowNotice = _c[1];
44
+ var field = useRef(null);
45
+ // 'Not Now' goes away with the notice, so focus goes to the message box.
46
+ function notNow() {
47
+ var _a;
48
+ setShowNotice(false);
49
+ (_a = field.current) === null || _a === void 0 ? void 0 : _a.focus();
50
+ }
51
+ // The agent cannot be called, but messages to people still send.
52
+ function send() {
53
+ // A real app sends the message to the server here and shows it at once.
54
+ setThread(function (rows) { return __spreadArray(__spreadArray([], rows, true), [{ id: "m".concat(rows.length + 1), from: me, at: new Date(), text: text.trim() }], false); });
55
+ setText('');
56
+ }
57
+ return (<Center width="page">
58
+ <Stack gap="large">
59
+ <Heading level={1} size="h5">Launch plan</Heading>
60
+ {/* A real app gives the list that holds the rows role="log". */}
61
+ <Stack gap="small">
62
+ {thread.map(function (m, i) { return (<Message key={m.id} aria-label={m.from} compact={followsOn(thread, i)} avatar={<UserImage userHandle={m.from} decorative/>} name={m.from} meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time"/>}>
63
+ <Paragraph measure="none">{m.text}</Paragraph>
64
+ </Message>); })}
65
+ </Stack>
66
+ <Composer ref={field} id="composer-limit-notice-message" aria-label="Message"
67
+ // After 'Not Now' the placeholder says when agent replies start again.
68
+ placeholder={showNotice ? 'Message the team' : 'Message the team. Agent replies start again on December 1.'} value={text} onChange={setText} onSubmit={send}
69
+ // A standing condition: no close button on the Alert, and no auto-dismiss. 'Not Now' closes it.
70
+ // This person cannot change the plan, so it says who can. Everyone can close a refusal. Alert has no action slot.
71
+ above={showNotice ? (<Stack gap="small">
72
+ <Alert type="warning" variant="inline" autoDismiss={false} message="You've used all 50 AI agent responses this month." secondMessage="They start again on December 1. Ask a workspace admin to upgrade Acme Design to Pro for more replies."/>
73
+ <Cluster gap="small">
74
+ <Button size="small" type="tertiary" state="enabled" label="Not Now" onClickButton={notNow}/>
75
+ </Cluster>
76
+ </Stack>) : undefined} tools={
77
+ // It stays pressable while the limit stands, as the case 'Upgrade prompt' says: pressing it shows the notice
78
+ // again. It does not turn on until the limit is lifted.
79
+ <Tooltip title="Mention the agent">
80
+ <IconButton color="iconOnly" state="enabled" size="small" icon={Bot} ariaLabel="Mention the agent" aria-pressed={false} onClick={function () { return setShowNotice(true); }}/>
81
+ </Tooltip>}/>
82
+ </Stack>
83
+ </Center>);
84
+ }
@@ -0,0 +1,282 @@
1
+ # Composer at a limit
2
+
3
+ The agent cannot be called from the composer because the workspace reached a limit, such as its agent replies for the month.
4
+
5
+ ## Do
6
+
7
+ - Follow the rule 'An agent refuses clearly' word for word: "You've used all 50 AI agent responses this month."
8
+ - Put the notice in the Composer's `above` slot: `<Alert variant="inline" autoDismiss={false}>`, with no close button on the Alert itself.
9
+ - Say when it resets and who can change it: 'Ask a workspace admin to upgrade Acme Design to Pro for more replies.'
10
+ - Give everyone 'Not Now', a tertiary Button, so the refusal can be closed. Put the Buttons in a `Cluster` under the Alert.
11
+ - Give a person who can lift the limit the action after 'Not Now', as a primary Button, such as 'Upgrade to Pro'.
12
+ - Keep the agent toggle pressable while the limit stands, as the case 'Upgrade prompt' says. Pressing it shows the notice again, and it does not turn on.
13
+ - Say in the placeholder when agent replies start again, once the person chose 'Not Now'.
14
+ - Move focus to the message box after 'Not Now', since the Button that had it is gone.
15
+ - Keep the field and send working, so messages to people still go.
16
+ - Follow the case 'Upgrade prompt' for a limit reached anywhere outside the message box.
17
+
18
+ ## Don't
19
+
20
+ - Do not disable the whole Composer. Only the agent is refused.
21
+ - Do not hide or disable the agent toggle. The person presses it and learns why it does not work.
22
+ - Do not show the upgrade Button to someone who cannot upgrade.
23
+ - Do not show a general error, or a toast that goes away, for a limit.
24
+ - Do not cover the thread with a Modal when the agent is refused.
25
+
26
+ ## Option: Notice
27
+
28
+ Use when: The person cannot lift the limit.
29
+
30
+ Uses: `Alert`, `Button`, `Center`, `Cluster`, `Composer`, `Heading`, `IconButton`, `Message`, `Paragraph`, `Stack`, `TimeStamp`, `Tooltip`, `UserImage`
31
+
32
+ ```tsx
33
+ 'use client';
34
+ import { useRef, useState } from 'react';
35
+ import { Bot } from 'lucide-react';
36
+ import Message from 'oneslash-design-system/components/message';
37
+ import UserImage from 'oneslash-design-system/components/userImage';
38
+ import TimeStamp from 'oneslash-design-system/components/timeStamp';
39
+ import Heading from 'oneslash-design-system/components/heading';
40
+ import Paragraph from 'oneslash-design-system/components/paragraph';
41
+ import Composer from 'oneslash-design-system/components/composer';
42
+ import Alert from 'oneslash-design-system/components/alert';
43
+ import Button from 'oneslash-design-system/components/button';
44
+ import IconButton from 'oneslash-design-system/components/iconButton';
45
+ import Tooltip from 'oneslash-design-system/components/tooltip';
46
+ import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
47
+
48
+ // A real app reads this from the session.
49
+ const me = 'Dana Lee';
50
+
51
+ type Row = { id: string; from: string; at: Date; text: string };
52
+
53
+ const firstThread: Row[] = [
54
+ { id: 'm1', from: 'Ben Carter', at: new Date('2025-01-15T11:40:00Z'), text: 'The pricing page is live.' },
55
+ { id: 'm2', from: 'Omar Reyes', at: new Date('2025-01-15T11:42:00Z'), text: 'Who writes the launch email?' },
56
+ ];
57
+
58
+ const FIVE_MINUTES = 5 * 60 * 1000;
59
+
60
+ // A follow-on row: the same sender as the row above, less than 5 minutes later and on the same day.
61
+ function followsOn(rows: Row[], i: number) {
62
+ const prev = rows[i - 1];
63
+ return (
64
+ !!prev &&
65
+ prev.from === rows[i].from &&
66
+ rows[i].at.getTime() - prev.at.getTime() < FIVE_MINUTES &&
67
+ rows[i].at.toDateString() === prev.at.toDateString()
68
+ );
69
+ }
70
+
71
+ export default function ComposerLimitNotice() {
72
+ const [thread, setThread] = useState(firstThread);
73
+ const [text, setText] = useState('');
74
+ // Opens on the notice, as if the workspace just used its last AI agent response of the month.
75
+ const [showNotice, setShowNotice] = useState(true);
76
+ const field = useRef<HTMLTextAreaElement>(null);
77
+
78
+ // 'Not Now' goes away with the notice, so focus goes to the message box.
79
+ function notNow() {
80
+ setShowNotice(false);
81
+ field.current?.focus();
82
+ }
83
+
84
+ // The agent cannot be called, but messages to people still send.
85
+ function send() {
86
+ // A real app sends the message to the server here and shows it at once.
87
+ setThread((rows) => [...rows, { id: `m${rows.length + 1}`, from: me, at: new Date(), text: text.trim() }]);
88
+ setText('');
89
+ }
90
+
91
+ return (
92
+ <Center width="page">
93
+ <Stack gap="large">
94
+ <Heading level={1} size="h5">Launch plan</Heading>
95
+ {/* A real app gives the list that holds the rows role="log". */}
96
+ <Stack gap="small">
97
+ {thread.map((m, i) => (
98
+ <Message
99
+ key={m.id}
100
+ aria-label={m.from}
101
+ compact={followsOn(thread, i)}
102
+ avatar={<UserImage userHandle={m.from} decorative />}
103
+ name={m.from}
104
+ meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time" />}
105
+ >
106
+ <Paragraph measure="none">{m.text}</Paragraph>
107
+ </Message>
108
+ ))}
109
+ </Stack>
110
+ <Composer
111
+ ref={field}
112
+ id="composer-limit-notice-message"
113
+ aria-label="Message"
114
+ // After 'Not Now' the placeholder says when agent replies start again.
115
+ placeholder={showNotice ? 'Message the team' : 'Message the team. Agent replies start again on December 1.'}
116
+ value={text}
117
+ onChange={setText}
118
+ onSubmit={send}
119
+ // A standing condition: no close button on the Alert, and no auto-dismiss. 'Not Now' closes it.
120
+ // This person cannot change the plan, so it says who can. Everyone can close a refusal. Alert has no action slot.
121
+ above={
122
+ showNotice ? (
123
+ <Stack gap="small">
124
+ <Alert
125
+ type="warning"
126
+ variant="inline"
127
+ autoDismiss={false}
128
+ message="You've used all 50 AI agent responses this month."
129
+ secondMessage="They start again on December 1. Ask a workspace admin to upgrade Acme Design to Pro for more replies."
130
+ />
131
+ <Cluster gap="small">
132
+ <Button size="small" type="tertiary" state="enabled" label="Not Now" onClickButton={notNow} />
133
+ </Cluster>
134
+ </Stack>
135
+ ) : undefined
136
+ }
137
+ tools={
138
+ // It stays pressable while the limit stands, as the case 'Upgrade prompt' says: pressing it shows the notice
139
+ // again. It does not turn on until the limit is lifted.
140
+ <Tooltip title="Mention the agent">
141
+ <IconButton color="iconOnly" state="enabled" size="small" icon={Bot} ariaLabel="Mention the agent" aria-pressed={false} onClick={() => setShowNotice(true)} />
142
+ </Tooltip>
143
+ }
144
+ />
145
+ </Stack>
146
+ </Center>
147
+ );
148
+ }
149
+ ```
150
+
151
+ ## Option: Notice with an action
152
+
153
+ Use when: The person can lift the limit.
154
+
155
+ Uses: `Alert`, `Button`, `Center`, `Cluster`, `Composer`, `Heading`, `IconButton`, `Message`, `Paragraph`, `Stack`, `TimeStamp`, `Tooltip`, `UserImage`
156
+
157
+ ```tsx
158
+ 'use client';
159
+ import { useRef, useState } from 'react';
160
+ import { Bot } from 'lucide-react';
161
+ import Message from 'oneslash-design-system/components/message';
162
+ import UserImage from 'oneslash-design-system/components/userImage';
163
+ import TimeStamp from 'oneslash-design-system/components/timeStamp';
164
+ import Heading from 'oneslash-design-system/components/heading';
165
+ import Paragraph from 'oneslash-design-system/components/paragraph';
166
+ import Composer from 'oneslash-design-system/components/composer';
167
+ import Alert from 'oneslash-design-system/components/alert';
168
+ import Button from 'oneslash-design-system/components/button';
169
+ import IconButton from 'oneslash-design-system/components/iconButton';
170
+ import Tooltip from 'oneslash-design-system/components/tooltip';
171
+ import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
172
+
173
+ // A real app passes the router from its framework, such as Next's useRouter().
174
+ const router = { push: (url: string) => console.info(`Go to ${url}`) };
175
+
176
+ // A real app reads this from the session.
177
+ const me = 'Dana Lee';
178
+
179
+ type Row = { id: string; from: string; at: Date; text: string };
180
+
181
+ const firstThread: Row[] = [
182
+ { id: 'm1', from: 'Ben Carter', at: new Date('2025-01-15T11:40:00Z'), text: 'The pricing page is live.' },
183
+ { id: 'm2', from: 'Omar Reyes', at: new Date('2025-01-15T11:42:00Z'), text: 'Who writes the launch email?' },
184
+ ];
185
+
186
+ const FIVE_MINUTES = 5 * 60 * 1000;
187
+
188
+ // A follow-on row: the same sender as the row above, less than 5 minutes later and on the same day.
189
+ function followsOn(rows: Row[], i: number) {
190
+ const prev = rows[i - 1];
191
+ return (
192
+ !!prev &&
193
+ prev.from === rows[i].from &&
194
+ rows[i].at.getTime() - prev.at.getTime() < FIVE_MINUTES &&
195
+ rows[i].at.toDateString() === prev.at.toDateString()
196
+ );
197
+ }
198
+
199
+ export default function ComposerLimitNoticeWithAction() {
200
+ const [thread, setThread] = useState(firstThread);
201
+ const [text, setText] = useState('');
202
+ // Opens on the notice, as if the workspace just used its last AI agent response of the month.
203
+ const [showNotice, setShowNotice] = useState(true);
204
+ const field = useRef<HTMLTextAreaElement>(null);
205
+
206
+ // 'Not Now' goes away with the notice, so focus goes to the message box.
207
+ function notNow() {
208
+ setShowNotice(false);
209
+ field.current?.focus();
210
+ }
211
+
212
+ // The agent cannot be called, but messages to people still send.
213
+ function send() {
214
+ // A real app sends the message to the server here and shows it at once.
215
+ setThread((rows) => [...rows, { id: `m${rows.length + 1}`, from: me, at: new Date(), text: text.trim() }]);
216
+ setText('');
217
+ }
218
+
219
+ return (
220
+ <Center width="page">
221
+ <Stack gap="large">
222
+ <Heading level={1} size="h5">Launch plan</Heading>
223
+ {/* A real app gives the list that holds the rows role="log". */}
224
+ <Stack gap="small">
225
+ {thread.map((m, i) => (
226
+ <Message
227
+ key={m.id}
228
+ aria-label={m.from}
229
+ compact={followsOn(thread, i)}
230
+ avatar={<UserImage userHandle={m.from} decorative />}
231
+ name={m.from}
232
+ meta={<TimeStamp createdAt={m.at} dateFormat="absolute" data="time" />}
233
+ >
234
+ <Paragraph measure="none">{m.text}</Paragraph>
235
+ </Message>
236
+ ))}
237
+ </Stack>
238
+ <Composer
239
+ ref={field}
240
+ id="composer-limit-action-message"
241
+ aria-label="Message"
242
+ // After 'Not Now' the placeholder says when agent replies start again.
243
+ placeholder={showNotice ? 'Message the team' : 'Message the team. Agent replies start again on December 1.'}
244
+ value={text}
245
+ onChange={setText}
246
+ onSubmit={send}
247
+ // A standing condition: no close button on the Alert, and no auto-dismiss. 'Not Now' closes it.
248
+ // This person can change the plan, so they get the button that lifts the limit. Alert has no action slot.
249
+ above={
250
+ showNotice ? (
251
+ <Stack gap="small">
252
+ <Alert
253
+ type="warning"
254
+ variant="inline"
255
+ autoDismiss={false}
256
+ message="You've used all 50 AI agent responses this month."
257
+ secondMessage="They start again on December 1. The Pro plan gives Acme Design 1,000 AI agent responses a month."
258
+ />
259
+ <Cluster gap="small">
260
+ <Button size="small" type="tertiary" state="enabled" label="Not Now" onClickButton={notNow} />
261
+ <Button size="small" type="primary" state="enabled" label="Upgrade to Pro" onClickButton={() => router.push('/settings/billing?plan=pro')} />
262
+ </Cluster>
263
+ </Stack>
264
+ ) : undefined
265
+ }
266
+ tools={
267
+ // It stays pressable while the limit stands, as the case 'Upgrade prompt' says: pressing it shows the notice
268
+ // again. It does not turn on until the limit is lifted.
269
+ <Tooltip title="Mention the agent">
270
+ <IconButton color="iconOnly" state="enabled" size="small" icon={Bot} ariaLabel="Mention the agent" aria-pressed={false} onClick={() => setShowNotice(true)} />
271
+ </Tooltip>
272
+ }
273
+ />
274
+ </Stack>
275
+ </Center>
276
+ );
277
+ }
278
+ ```
279
+
280
+ ## Native
281
+
282
+ On Apple the notice is a row above the composer, with an Upgrade or Change Budget Cap button for admins and never a link to a web page.
@@ -2,8 +2,6 @@
2
2
 
3
3
  A person asks to delete or remove something, and it cannot be undone.
4
4
 
5
- **Not built yet:** Commentify's Delete project confirm is not danger-colored and asks a question in its body. Scindo on the web confirms removing a saved card in place, but asks 'Are you sure?' and labels its Buttons 'Confirm' and 'No'.
6
-
7
5
  ## Do
8
6
 
9
7
  - Follow the rule 'A confirm says exactly what will happen' for the Modal: `size="small"`, 'Cancel' first, then the action with `color="danger"`.
@@ -207,5 +205,3 @@ export default function ConfirmDestructiveActionInline() {
207
205
  ## Native
208
206
 
209
207
  On Apple use a system `confirmationDialog` or `.alert`, with the action in the `.destructive` role and 'Cancel' in the `.cancel` role.
210
-
211
- Seen in: Commentify, Scindo.
@@ -6,8 +6,6 @@ An action a person takes themselves needs their yes before it happens. An action
6
6
 
7
7
  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.
8
8
 
9
- **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.
10
-
11
9
  ## Why
12
10
 
13
11
  A confirm is the last chance to stop a mistake. It has to say exactly what will happen, and the safe choice has to be easy to find.
@@ -32,5 +30,3 @@ A confirm is the last chance to stop a mistake. It has to say exactly what will
32
30
  ## Native
33
31
 
34
32
  On Apple use a system `confirmationDialog` or `.alert`, with the action in the `.destructive` role when it destroys or removes something. Never build a sheet by hand for a confirm.
35
-
36
- Seen in: Commentify, Scindo.
@@ -0,0 +1 @@
1
+ export default function ConversationStartersChips(): import("react").JSX.Element;
@@ -0,0 +1,69 @@
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 { useEffect, useRef, 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 EmptyBox from '../../components/emptyBox';
19
+ import Tag from '../../components/tag';
20
+ import { Center, Cluster, Stack } from '../../components/layout';
21
+ // A real app reads this from the session.
22
+ var me = 'Dana Lee';
23
+ var agentName = 'Acme Agent';
24
+ // Things to ask, in the person's words.
25
+ var starters = [
26
+ 'Summarize the launch plan',
27
+ 'Draft the launch email',
28
+ 'List what is still open',
29
+ 'Check the pricing page for mistakes',
30
+ ];
31
+ export default function ConversationStartersChips() {
32
+ var _a = useState([]), thread = _a[0], setThread = _a[1];
33
+ var _b = useState(''), text = _b[0], setText = _b[1];
34
+ // Set when a starter fills the field; the effect below focuses it with the caret at the end.
35
+ var _c = useState(0), filled = _c[0], setFilled = _c[1];
36
+ var field = useRef(null);
37
+ useEffect(function () {
38
+ if (!filled || !field.current)
39
+ return;
40
+ var end = field.current.value.length;
41
+ field.current.focus();
42
+ field.current.setSelectionRange(end, end);
43
+ }, [filled]);
44
+ // Fills the field and does not send: the person can change it first.
45
+ function fillWith(starter) {
46
+ setText(starter);
47
+ setFilled(function (n) { return n + 1; });
48
+ }
49
+ function send() {
50
+ // A real app sends the message to the agent here and shows it at once.
51
+ setThread(function (rows) { return __spreadArray(__spreadArray([], rows, true), [{ id: "m".concat(rows.length + 1), from: me, at: new Date(), text: text.trim() }], false); });
52
+ setText('');
53
+ }
54
+ return (<Center width="page">
55
+ <Stack gap="large">
56
+ <Heading level={1} size="h5">{"Ask ".concat(agentName)}</Heading>
57
+ {thread.length === 0 ? (<EmptyBox size="large" icon="MessageCircle" text="No messages yet" secondText={"Ask ".concat(agentName, " about the launch, or start with one of these.")} action={<Cluster gap="small">
58
+ {starters.map(function (s) { return (<Tag key={s} variant="contained" size="small" label={s} toggle={false} onClick={function () { return fillWith(s); }}/>); })}
59
+ </Cluster>}/>) : (
60
+ // A real app gives the list that holds the rows role="log".
61
+ <Stack gap="small">
62
+ {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"/>}>
63
+ <Paragraph measure="none">{m.text}</Paragraph>
64
+ </Message>); })}
65
+ </Stack>)}
66
+ <Composer ref={field} id="conversation-starters-chips-message" aria-label="Message" placeholder={"Message ".concat(agentName)} value={text} onChange={setText} onSubmit={send}/>
67
+ </Stack>
68
+ </Center>);
69
+ }
@@ -0,0 +1 @@
1
+ export default function ConversationStartersNone(): import("react").JSX.Element;
@@ -0,0 +1,45 @@
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 EmptyBox from '../../components/emptyBox';
19
+ import { Center, Stack } from '../../components/layout';
20
+ // A real app reads this from the session.
21
+ var me = 'Dana Lee';
22
+ export default function ConversationStartersNone() {
23
+ var _a = useState([]), thread = _a[0], setThread = _a[1];
24
+ var _b = useState(''), text = _b[0], setText = _b[1];
25
+ function send() {
26
+ // A real app sends the message to the server here and shows it at once.
27
+ setThread(function (rows) { return __spreadArray(__spreadArray([], rows, true), [{ id: "m".concat(rows.length + 1), from: me, at: new Date(), text: text.trim() }], false); });
28
+ setText('');
29
+ }
30
+ return (<Center width="page">
31
+ <Stack gap="large">
32
+ <Heading level={1} size="h5">Launch plan</Heading>
33
+ {thread.length === 0 ? (
34
+ // A thread between people: no starters, and secondText says what to do.
35
+ <EmptyBox size="large" icon="MessageCircle" text="No messages yet" secondText="Send the first message to the team in Launch plan."/>) : (
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
+ <Composer id="conversation-starters-none-message" aria-label="Message" placeholder="Message the team" value={text} onChange={setText} onSubmit={send}/>
43
+ </Stack>
44
+ </Center>);
45
+ }