@twoux/ui 0.0.0-stage → 0.1.1

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 (325) hide show
  1. package/LICENSE.md +61 -0
  2. package/LICENSES/Apache-2.0.txt +202 -0
  3. package/NOTICE.md +64 -0
  4. package/README.md +211 -2
  5. package/SHADCN-DIFF.md +228 -0
  6. package/agent/AGENTS.md +358 -0
  7. package/agent/docs-md/accessibility.md +49 -0
  8. package/agent/docs-md/action-catalogue.md +81 -0
  9. package/agent/docs-md/actions.md +74 -0
  10. package/agent/docs-md/agent-activity-log.md +70 -0
  11. package/agent/docs-md/agent-permissions.md +82 -0
  12. package/agent/docs-md/agent-run.md +90 -0
  13. package/agent/docs-md/agents-on-behalf.md +74 -0
  14. package/agent/docs-md/ai-column.md +85 -0
  15. package/agent/docs-md/ai-origin-label.md +70 -0
  16. package/agent/docs-md/announcing-features.md +73 -0
  17. package/agent/docs-md/answer-actions.md +81 -0
  18. package/agent/docs-md/app-shell.md +114 -0
  19. package/agent/docs-md/artifact-card.md +89 -0
  20. package/agent/docs-md/ask-on-screen.md +72 -0
  21. package/agent/docs-md/assistant-page.md +100 -0
  22. package/agent/docs-md/assistant-panel.md +142 -0
  23. package/agent/docs-md/avatar.md +82 -0
  24. package/agent/docs-md/banner.md +106 -0
  25. package/agent/docs-md/board.md +163 -0
  26. package/agent/docs-md/breadcrumb.md +89 -0
  27. package/agent/docs-md/breakdown-table.md +97 -0
  28. package/agent/docs-md/bulk-action-bar.md +112 -0
  29. package/agent/docs-md/button.md +293 -0
  30. package/agent/docs-md/card.md +115 -0
  31. package/agent/docs-md/change-list.md +99 -0
  32. package/agent/docs-md/change-request.md +166 -0
  33. package/agent/docs-md/chart-area.md +87 -0
  34. package/agent/docs-md/chart-bar.md +100 -0
  35. package/agent/docs-md/chart-box-plot.md +88 -0
  36. package/agent/docs-md/chart-bullet.md +89 -0
  37. package/agent/docs-md/chart-candlestick.md +112 -0
  38. package/agent/docs-md/chart-card-line.md +120 -0
  39. package/agent/docs-md/chart-donut.md +90 -0
  40. package/agent/docs-md/chart-drill-down.md +72 -0
  41. package/agent/docs-md/chart-funnel.md +71 -0
  42. package/agent/docs-md/chart-heatmap.md +76 -0
  43. package/agent/docs-md/chart-histogram.md +81 -0
  44. package/agent/docs-md/chart-map.md +165 -0
  45. package/agent/docs-md/chart-mixed.md +88 -0
  46. package/agent/docs-md/chart-price.md +92 -0
  47. package/agent/docs-md/chart-radial-bars.md +109 -0
  48. package/agent/docs-md/chart-radial-lines.md +111 -0
  49. package/agent/docs-md/chart-sankey.md +104 -0
  50. package/agent/docs-md/chart-scatter.md +87 -0
  51. package/agent/docs-md/chart-share-bar.md +89 -0
  52. package/agent/docs-md/chart-treemap.md +98 -0
  53. package/agent/docs-md/chart-waterfall.md +93 -0
  54. package/agent/docs-md/checkbox.md +131 -0
  55. package/agent/docs-md/choosing-selection-control.md +71 -0
  56. package/agent/docs-md/citations-sources.md +79 -0
  57. package/agent/docs-md/citing-sources.md +63 -0
  58. package/agent/docs-md/clarify-before-acting.md +69 -0
  59. package/agent/docs-md/clarifying-question.md +92 -0
  60. package/agent/docs-md/code-block.md +174 -0
  61. package/agent/docs-md/colours.md +87 -0
  62. package/agent/docs-md/columns-menu.md +140 -0
  63. package/agent/docs-md/combobox.md +161 -0
  64. package/agent/docs-md/command-palette.md +126 -0
  65. package/agent/docs-md/confidence-note.md +87 -0
  66. package/agent/docs-md/configurable-dashboard.md +76 -0
  67. package/agent/docs-md/confirmation-dialog.md +93 -0
  68. package/agent/docs-md/connected-tools.md +80 -0
  69. package/agent/docs-md/connector-picker.md +127 -0
  70. package/agent/docs-md/consistency.md +53 -0
  71. package/agent/docs-md/content-density.md +61 -0
  72. package/agent/docs-md/conversation-history.md +78 -0
  73. package/agent/docs-md/create-record.md +80 -0
  74. package/agent/docs-md/csv-import.md +88 -0
  75. package/agent/docs-md/dashboard-items.md +78 -0
  76. package/agent/docs-md/data-export.md +61 -0
  77. package/agent/docs-md/data-grid.md +137 -0
  78. package/agent/docs-md/data-vis-colours.md +76 -0
  79. package/agent/docs-md/data-visualisation.md +76 -0
  80. package/agent/docs-md/date-picker.md +178 -0
  81. package/agent/docs-md/delete-record.md +75 -0
  82. package/agent/docs-md/dense-table.md +495 -0
  83. package/agent/docs-md/design-tokens.md +53 -0
  84. package/agent/docs-md/disabled-read-only.md +75 -0
  85. package/agent/docs-md/drag-and-drop.md +74 -0
  86. package/agent/docs-md/dropdown-menu.md +137 -0
  87. package/agent/docs-md/edit-record.md +73 -0
  88. package/agent/docs-md/empty-loading-error.md +78 -0
  89. package/agent/docs-md/empty-state.md +128 -0
  90. package/agent/docs-md/error-messages.md +75 -0
  91. package/agent/docs-md/error-state.md +123 -0
  92. package/agent/docs-md/export-menu.md +86 -0
  93. package/agent/docs-md/feedback-prompt.md +88 -0
  94. package/agent/docs-md/field-mapping.md +78 -0
  95. package/agent/docs-md/file-drop.md +110 -0
  96. package/agent/docs-md/filter-bar.md +138 -0
  97. package/agent/docs-md/filter-panel.md +103 -0
  98. package/agent/docs-md/filtering-search.md +79 -0
  99. package/agent/docs-md/follow-ups-starters.md +79 -0
  100. package/agent/docs-md/form-validation.md +95 -0
  101. package/agent/docs-md/generated-columns.md +65 -0
  102. package/agent/docs-md/generated-drafts-files.md +71 -0
  103. package/agent/docs-md/grouped-list.md +89 -0
  104. package/agent/docs-md/guide-cue.md +170 -0
  105. package/agent/docs-md/help-panel.md +103 -0
  106. package/agent/docs-md/help-system.md +74 -0
  107. package/agent/docs-md/iconography.md +49 -0
  108. package/agent/docs-md/inbox.md +108 -0
  109. package/agent/docs-md/inline-editing-validation.md +80 -0
  110. package/agent/docs-md/inline-input-in-answer.md +70 -0
  111. package/agent/docs-md/items-palette.md +116 -0
  112. package/agent/docs-md/keyboard-model.md +47 -0
  113. package/agent/docs-md/keyboard-navigation.md +68 -0
  114. package/agent/docs-md/keyboard-shortcut-hint.md +87 -0
  115. package/agent/docs-md/keyboard-shortcut-sheet.md +90 -0
  116. package/agent/docs-md/labelling-ai-output.md +66 -0
  117. package/agent/docs-md/layout.md +47 -0
  118. package/agent/docs-md/list-table.md +254 -0
  119. package/agent/docs-md/loading-skeleton.md +91 -0
  120. package/agent/docs-md/managing-agents.md +71 -0
  121. package/agent/docs-md/message-composer.md +105 -0
  122. package/agent/docs-md/migrating.md +49 -0
  123. package/agent/docs-md/motion.md +93 -0
  124. package/agent/docs-md/navigation.md +76 -0
  125. package/agent/docs-md/notification-channels.md +65 -0
  126. package/agent/docs-md/notifications-decision.md +100 -0
  127. package/agent/docs-md/onboarding-step.md +114 -0
  128. package/agent/docs-md/order-book.md +108 -0
  129. package/agent/docs-md/page-header.md +96 -0
  130. package/agent/docs-md/pagination.md +88 -0
  131. package/agent/docs-md/pane-layout.md +105 -0
  132. package/agent/docs-md/period-comparison.md +66 -0
  133. package/agent/docs-md/plan-card.md +120 -0
  134. package/agent/docs-md/popover-rules.md +88 -0
  135. package/agent/docs-md/prompt-editor.md +90 -0
  136. package/agent/docs-md/propose-apply.md +65 -0
  137. package/agent/docs-md/provider-logo.md +97 -0
  138. package/agent/docs-md/radio.md +83 -0
  139. package/agent/docs-md/ranked-list.md +102 -0
  140. package/agent/docs-md/reasoning-progress.md +72 -0
  141. package/agent/docs-md/record-detail.md +71 -0
  142. package/agent/docs-md/regenerating-answers.md +70 -0
  143. package/agent/docs-md/run-status-bar.md +94 -0
  144. package/agent/docs-md/saved-tasks-schedules.md +63 -0
  145. package/agent/docs-md/saved-views.md +149 -0
  146. package/agent/docs-md/saving-views.md +68 -0
  147. package/agent/docs-md/scheduler.md +258 -0
  148. package/agent/docs-md/secondary-panels.md +72 -0
  149. package/agent/docs-md/segmented-control.md +88 -0
  150. package/agent/docs-md/selection-bulk-actions.md +70 -0
  151. package/agent/docs-md/separator.md +75 -0
  152. package/agent/docs-md/setup-checklist.md +92 -0
  153. package/agent/docs-md/shape-elevation.md +55 -0
  154. package/agent/docs-md/sheet-grid.md +211 -0
  155. package/agent/docs-md/side-panel.md +134 -0
  156. package/agent/docs-md/sign-in.md +114 -0
  157. package/agent/docs-md/spacing.md +55 -0
  158. package/agent/docs-md/split-button.md +100 -0
  159. package/agent/docs-md/stat-compare.md +82 -0
  160. package/agent/docs-md/static-dashboard.md +75 -0
  161. package/agent/docs-md/status-badge.md +140 -0
  162. package/agent/docs-md/step-card.md +75 -0
  163. package/agent/docs-md/stepper.md +92 -0
  164. package/agent/docs-md/suggested-changes.md +91 -0
  165. package/agent/docs-md/switch.md +78 -0
  166. package/agent/docs-md/table-settings.md +81 -0
  167. package/agent/docs-md/tabs.md +85 -0
  168. package/agent/docs-md/tag-input.md +108 -0
  169. package/agent/docs-md/tag.md +79 -0
  170. package/agent/docs-md/task-builder.md +87 -0
  171. package/agent/docs-md/team-instructions.md +72 -0
  172. package/agent/docs-md/templates-gallery.md +85 -0
  173. package/agent/docs-md/text-input.md +160 -0
  174. package/agent/docs-md/thinking-steps.md +89 -0
  175. package/agent/docs-md/timeline.md +189 -0
  176. package/agent/docs-md/timestamp.md +84 -0
  177. package/agent/docs-md/timestamps.md +70 -0
  178. package/agent/docs-md/toast.md +117 -0
  179. package/agent/docs-md/tooltip.md +90 -0
  180. package/agent/docs-md/typography.md +62 -0
  181. package/agent/docs-md/undo-destructive.md +66 -0
  182. package/agent/docs-md/unsaved-changes.md +71 -0
  183. package/agent/docs-md/usage-meter.md +80 -0
  184. package/agent/docs-md/user-feedback.md +71 -0
  185. package/agent/docs-md/voice-and-tone.md +60 -0
  186. package/agent/docs-md/why-choice.md +93 -0
  187. package/agent/docs-md/workspace-onboarding.md +74 -0
  188. package/agent/docs-md/writing.md +48 -0
  189. package/agent/llms-full.txt +18369 -0
  190. package/agent/llms.txt +198 -0
  191. package/agent/skills/twoux-audit/SKILL.md +49 -0
  192. package/agent/skills/twoux-build/SKILL.md +39 -0
  193. package/agent/skills/twoux-design/SKILL.md +54 -0
  194. package/agent/skills/twoux-write/SKILL.md +32 -0
  195. package/bin/check.mjs +123 -0
  196. package/bin/docs.mjs +24 -0
  197. package/bin/guard.mjs +27 -0
  198. package/bin/init.mjs +113 -0
  199. package/bin/knowledge.mjs +87 -0
  200. package/bin/mcp.mjs +116 -0
  201. package/bin/theme.mjs +168 -0
  202. package/bin/twoux.mjs +25 -0
  203. package/package.json +80 -3
  204. package/registry/jobs.json +1028 -0
  205. package/registry/palette.json +770 -0
  206. package/registry/rules.json +913 -0
  207. package/src/components/agent-review.tsx +364 -0
  208. package/src/components/ai-basics.tsx +212 -0
  209. package/src/components/ai-work.tsx +304 -0
  210. package/src/components/ai.tsx +227 -0
  211. package/src/components/alert-dialog.tsx +203 -0
  212. package/src/components/alert.tsx +86 -0
  213. package/src/components/avatar.tsx +114 -0
  214. package/src/components/badge.tsx +59 -0
  215. package/src/components/board.tsx +397 -0
  216. package/src/components/breadcrumb.tsx +114 -0
  217. package/src/components/button-group.tsx +90 -0
  218. package/src/components/button.tsx +109 -0
  219. package/src/components/calendar.tsx +247 -0
  220. package/src/components/card.tsx +102 -0
  221. package/src/components/chart-map.tsx +336 -0
  222. package/src/components/charts-more.tsx +1331 -0
  223. package/src/components/charts-radial.tsx +328 -0
  224. package/src/components/charts.tsx +390 -0
  225. package/src/components/checkbox.tsx +40 -0
  226. package/src/components/code.tsx +139 -0
  227. package/src/components/collapsible.tsx +37 -0
  228. package/src/components/combobox.tsx +339 -0
  229. package/src/components/command-extras.tsx +11 -0
  230. package/src/components/command.tsx +196 -0
  231. package/src/components/data-grid.tsx +213 -0
  232. package/src/components/data-table.tsx +334 -0
  233. package/src/components/data-views.tsx +740 -0
  234. package/src/components/date-picker.tsx +686 -0
  235. package/src/components/dense-table.tsx +207 -0
  236. package/src/components/dialog.tsx +162 -0
  237. package/src/components/dropdown-menu.tsx +264 -0
  238. package/src/components/empty.tsx +114 -0
  239. package/src/components/feedback-prompt.tsx +80 -0
  240. package/src/components/field.tsx +254 -0
  241. package/src/components/fields.tsx +112 -0
  242. package/src/components/flow.tsx +840 -0
  243. package/src/components/guide-cue.tsx +273 -0
  244. package/src/components/inbox.tsx +113 -0
  245. package/src/components/input-group.tsx +176 -0
  246. package/src/components/input.tsx +26 -0
  247. package/src/components/kbd.tsx +34 -0
  248. package/src/components/label.tsx +27 -0
  249. package/src/components/labels.tsx +176 -0
  250. package/src/components/motion.tsx +136 -0
  251. package/src/components/onboarding.tsx +454 -0
  252. package/src/components/order-book.tsx +185 -0
  253. package/src/components/pane-layout.tsx +417 -0
  254. package/src/components/popover.tsx +96 -0
  255. package/src/components/provider-logos.data.ts +49 -0
  256. package/src/components/radio-group.tsx +52 -0
  257. package/src/components/scheduler.tsx +997 -0
  258. package/src/components/segmented-control.tsx +28 -0
  259. package/src/components/select.tsx +195 -0
  260. package/src/components/separator.tsx +31 -0
  261. package/src/components/sheet.tsx +148 -0
  262. package/src/components/shell.tsx +426 -0
  263. package/src/components/shortcut-sheet.tsx +83 -0
  264. package/src/components/skeleton.tsx +18 -0
  265. package/src/components/sonner.tsx +107 -0
  266. package/src/components/spinner.tsx +13 -0
  267. package/src/components/split-button.tsx +58 -0
  268. package/src/components/stepper.tsx +78 -0
  269. package/src/components/switch.tsx +43 -0
  270. package/src/components/table.tsx +126 -0
  271. package/src/components/tabs.tsx +118 -0
  272. package/src/components/tag-input.tsx +253 -0
  273. package/src/components/textarea.tsx +21 -0
  274. package/src/components/theme.tsx +80 -0
  275. package/src/components/timeline.tsx +408 -0
  276. package/src/components/toggle-group.tsx +87 -0
  277. package/src/components/toggle.tsx +54 -0
  278. package/src/components/tooltip.tsx +65 -0
  279. package/src/components/workspace-actions.tsx +294 -0
  280. package/src/components/workspace-import.tsx +465 -0
  281. package/src/components/workspace.tsx +1884 -0
  282. package/src/index.ts +80 -0
  283. package/src/lib/active-indicator.tsx +53 -0
  284. package/src/lib/chart-kit.tsx +72 -0
  285. package/src/lib/cn.ts +6 -0
  286. package/src/lib/shortcuts.tsx +61 -0
  287. package/src/lib/workspace.tsx +10 -0
  288. package/src/shadcn/alert-dialog.tsx +196 -0
  289. package/src/shadcn/alert.tsx +65 -0
  290. package/src/shadcn/avatar.tsx +108 -0
  291. package/src/shadcn/badge.tsx +47 -0
  292. package/src/shadcn/breadcrumb.tsx +108 -0
  293. package/src/shadcn/button-group.tsx +83 -0
  294. package/src/shadcn/button.tsx +63 -0
  295. package/src/shadcn/calendar.tsx +220 -0
  296. package/src/shadcn/card.tsx +91 -0
  297. package/src/shadcn/checkbox.tsx +31 -0
  298. package/src/shadcn/collapsible.tsx +33 -0
  299. package/src/shadcn/command.tsx +184 -0
  300. package/src/shadcn/dialog.tsx +158 -0
  301. package/src/shadcn/dropdown-menu.tsx +256 -0
  302. package/src/shadcn/empty.tsx +103 -0
  303. package/src/shadcn/field.tsx +248 -0
  304. package/src/shadcn/input-group.tsx +170 -0
  305. package/src/shadcn/input.tsx +20 -0
  306. package/src/shadcn/kbd.tsx +28 -0
  307. package/src/shadcn/label.tsx +23 -0
  308. package/src/shadcn/popover.tsx +88 -0
  309. package/src/shadcn/radio-group.tsx +44 -0
  310. package/src/shadcn/select.tsx +189 -0
  311. package/src/shadcn/separator.tsx +27 -0
  312. package/src/shadcn/sheet.tsx +142 -0
  313. package/src/shadcn/skeleton.tsx +13 -0
  314. package/src/shadcn/sonner.tsx +40 -0
  315. package/src/shadcn/switch.tsx +34 -0
  316. package/src/shadcn/table.tsx +115 -0
  317. package/src/shadcn/tabs.tsx +90 -0
  318. package/src/shadcn/textarea.tsx +17 -0
  319. package/src/shadcn/toggle-group.tsx +83 -0
  320. package/src/shadcn/toggle.tsx +46 -0
  321. package/src/shadcn/tooltip.tsx +56 -0
  322. package/src/styles/palette.css +127 -0
  323. package/src/styles/theme.css +35 -0
  324. package/src/styles/twoux.css +236 -0
  325. package/theme.json +14 -0
@@ -0,0 +1,87 @@
1
+ # Task builder
2
+
3
+ Repeated tasks written as a sentence with editable slots that reuse filter values, with Run blocked until every required slot is filled.
4
+
5
+ Kind: component · Group: AI and agents · Status: built, import from @twoux/ui
6
+
7
+ ## When to use
8
+
9
+ - Tasks people run often with the same shape, such as "Find Live listings under 3% and draft new titles for hiring managers".
10
+ - When the inputs map to filters already in TwoUX, so slots reuse those values.
11
+ - When an answer should be saved and rerun on a schedule.
12
+
13
+ ## When not to use
14
+
15
+ - A one-off question. Use the Message composer (message-composer).
16
+ - A prompt that runs per row with typed outputs. Use the Prompt editor (prompt-editor).
17
+ - Browsing ready-made tasks. Use the Templates gallery (templates-gallery).
18
+
19
+ ## Structure
20
+
21
+ 1. Sentence with slots (dashed when empty, filled when set)
22
+ 2. Actions (Schedule, Save as task, Run ⌘↵)
23
+ 3. Inline error naming the empty slot
24
+
25
+ ## Guidelines
26
+
27
+ - Make the critical slots prominent and say which can be left empty.
28
+ - An empty slot is dashed and blocks Run; the message says which slot.
29
+ - Filled slots show as regular text; empty ones as placeholders.
30
+ - Do not overload the sentence with slots.
31
+ - Scheduled runs notify before they act and land in the Inbox when they need approval.
32
+ - An empty slot shows its field name in italics in a dashed box; once filled it shows the value as normal text.
33
+ - The popover field label matches the slot name exactly, so people know which slot they are editing.
34
+ - Slots hold one value each. Status belongs in a badge and several related values in a key-value list, not in slots.
35
+
36
+ ## Content
37
+
38
+ - Write the sentence as an instruction in plain words; slot placeholders match the filter field names.
39
+ - Error: "Choose who gets the titles before you run this."
40
+
41
+ ## Accessibility
42
+
43
+ - Each slot is a button whose name includes the slot and value ("Status: Live") (SC 4.1.2).
44
+ - Slots open a menu or listbox following the menu button pattern.
45
+ - The disabled Run has its reason in text next to it (SC 3.3.1, 3.3.2).
46
+ - Dashed versus solid is not the only cue; empty slots show placeholder text (SC 1.4.1).
47
+
48
+ ## Keyboard
49
+
50
+ | Keys | Action |
51
+ |---|---|
52
+ | Tab | Move between slots |
53
+ | Enter / Space | Open a slot's options |
54
+ | ⌘↵ / Ctrl+Enter | Run when all required slots are filled |
55
+
56
+ ## Examples
57
+
58
+ ### weekly
59
+
60
+ ```tsx
61
+ import { TaskBuilder, toast } from "@twoux/ui";
62
+ import { useState } from "react";
63
+
64
+ export const meta = { title: "A task written as a sentence", description: "Slots are dashed until set. Run (⌘↵) is blocked while a required slot is empty, and the message names it.", order: 1 };
65
+
66
+ export default function Example() {
67
+ const [v, setV] = useState<Record<string, string>>({ when: "Every Monday" });
68
+ return (
69
+ <div className="w-full max-w-xl">
70
+ <TaskBuilder
71
+ value={v}
72
+ onChange={setV}
73
+ onRun={() => toast.success("Task started")}
74
+ onSave={() => toast("Saved as a task")}
75
+ onSchedule={() => toast("Scheduled")}
76
+ parts={[{ id: "when", placeholder: "When", options: ["Every Monday", "Every day at 9:00", "Once"], required: true }, ", summarise", { id: "which", placeholder: "which listings", options: ["listings closing this week", "listings with no applicants", "all open listings"], required: true }, "and send it to", { id: "who", placeholder: "who", options: ["me", "the hiring managers", "#hiring on Slack"], required: true }, "."]}
77
+ />
78
+ </div>
79
+ );
80
+ }
81
+ ```
82
+
83
+ ## Related
84
+
85
+ - Templates gallery
86
+ - Prompt editor with fields
87
+ - Agent run timeline
@@ -0,0 +1,72 @@
1
+ # Team instructions and files
2
+
3
+ Shared instructions and files set once for the workspace, visible and editable, and named in the assistant's empty state and citations when used.
4
+
5
+ Kind: component · Group: AI and agents · Status: built, import from @twoux/ui
6
+
7
+ ## When to use
8
+
9
+ - Rules the assistant should always follow for the team, such as UK English or never contacting candidates without asking.
10
+ - Reference files such as salary bands or hiring policy that answers should cite.
11
+
12
+ ## When not to use
13
+
14
+ - Personal preferences for one person. Use writing style in the Message composer (message-composer).
15
+ - Rules that grant or block actions. Use Agent permissions (agent-permissions).
16
+
17
+ ## Structure
18
+
19
+ 1. Instructions card (text, Edit, set by and scope)
20
+ 2. Files card (file list, Add a file)
21
+ 3. Privacy note
22
+
23
+ ## Guidelines
24
+
25
+ - Shared context is visible and editable, not hidden in a system prompt.
26
+ - Show who set it and that it applies to everyone in the workspace.
27
+ - The empty state says it is in use ("Using team instructions and 3 files").
28
+ - Answers cite the file when they rely on it.
29
+ - Keep conversations private unless shared.
30
+
31
+ ## Content
32
+
33
+ - Instructions are short imperatives in plain English.
34
+ - Scope line: "Set by Rahul S. · applies to everyone in TwoUX".
35
+
36
+ ## Accessibility
37
+
38
+ - Edit and Add a file are icon buttons with names (SC 4.1.2).
39
+ - Card headings label each section (SC 2.4.6, 1.3.1).
40
+
41
+ ## Keyboard
42
+
43
+ | Keys | Action |
44
+ |---|---|
45
+ | Tab | Move to Edit or Add a file |
46
+ | Enter | Edit instructions or add a file |
47
+
48
+ ## Examples
49
+
50
+ ### instructions
51
+
52
+ ```tsx
53
+ import { TeamInstructions, toast } from "@twoux/ui";
54
+ import { useState } from "react";
55
+
56
+ export const meta = { title: "Shared context, visible", description: "Instructions and files the assistant reads for everyone, shown with who set them. Edit in place.", order: 1 };
57
+
58
+ export default function Example() {
59
+ const [text, setText] = useState("Write in UK English. Always state the salary range. Never comment on age, nationality or gaps in employment.");
60
+ return (
61
+ <div className="w-full max-w-lg">
62
+ <TeamInstructions text={text} setBy="Priya Shah" files={[{ name: "Salary bands 2026.pdf", size: "220 KB" }, { name: "Hiring handbook.docx", size: "1.4 MB" }]} onSave={(t) => { setText(t); toast.success("Instructions saved"); }} onAddFile={() => toast("Choose a file")} />
63
+ </div>
64
+ );
65
+ }
66
+ ```
67
+
68
+ ## Related
69
+
70
+ - Assistant side panel
71
+ - Citations and sources
72
+ - Connected tools
@@ -0,0 +1,85 @@
1
+ # Templates gallery
2
+
3
+ A dialog with categories on the left, search on top and cards that say what each template does and which tools it uses; picking one opens it as a draft task.
4
+
5
+ Kind: component · Group: AI and agents · Status: built, import from @twoux/ui
6
+
7
+ ## When to use
8
+
9
+ - Starting a new task from a proven pattern, such as sourcing or reporting.
10
+ - Showing what agents can do to people who have not used them.
11
+
12
+ ## When not to use
13
+
14
+ - Running a saved task you already use. Use / in the Message composer (message-composer).
15
+ - Quick prompts in the empty state. Use starters (follow-ups-starters).
16
+
17
+ ## Structure
18
+
19
+ 1. Category nav with search
20
+ 2. Heading and Close
21
+ 3. Template cards (name, what it does, tools used)
22
+
23
+ ## Guidelines
24
+
25
+ - Picking a template opens it as a draft task, never runs it.
26
+ - Cards say what the template does and which tools it uses.
27
+ - Search and categories make browsing easy.
28
+ - Expose the inputs the template needs before running.
29
+ - Curate and retire templates so the gallery stays current.
30
+
31
+ ## Content
32
+
33
+ - Names are tasks ("Find hiring managers for open roles").
34
+ - Descriptions say the outcome in one line.
35
+
36
+ ## Accessibility
37
+
38
+ - The gallery is a dialog labelled "Start from a template"; focus moves in on open, Esc closes and focus returns (APG dialog).
39
+ - The category nav marks the current item with aria-current (SC 4.1.2, 1.3.1).
40
+ - Search announces the number of matching templates (SC 4.1.3).
41
+
42
+ ## Keyboard
43
+
44
+ | Keys | Action |
45
+ |---|---|
46
+ | Tab | Move between search, categories and cards |
47
+ | Enter | Open the template as a draft |
48
+ | Esc | Close the gallery |
49
+
50
+ ## Examples
51
+
52
+ ### gallery
53
+
54
+ ```tsx
55
+ import { Button, TemplatesGallery, toast } from "@twoux/ui";
56
+ import { useState } from "react";
57
+
58
+ export const meta = { title: "Start from a template", description: "Categories, search and cards that say what each template does and which tools it uses. Picking one opens a draft task; it never runs.", order: 1 };
59
+
60
+ export default function Example() {
61
+ const [open, setOpen] = useState(false);
62
+ return (
63
+ <>
64
+ <Button variant="outline" onClick={() => setOpen(true)}>Browse templates</Button>
65
+ <TemplatesGallery
66
+ open={open}
67
+ onOpenChange={setOpen}
68
+ onPick={(t) => { setOpen(false); toast(`Opened “${t.name}” as a draft`); }}
69
+ templates={[
70
+ { id: "1", name: "Weekly pipeline summary", does: "Summarises new applicants and stage changes every Monday.", tools: ["Listings", "Slack"], category: "Reporting" },
71
+ { id: "2", name: "Listings at risk", does: "Finds listings closing soon with few applicants and proposes extensions.", tools: ["Listings"], category: "Listings" },
72
+ { id: "3", name: "Interview slots", does: "Suggests interview times from interviewers' calendars.", tools: ["Calendar"], category: "Interviews" },
73
+ { id: "4", name: "Job description review", does: "Checks a draft for salary, inclusive language and length.", tools: ["Listings", "Team files"], category: "Listings" },
74
+ ]}
75
+ />
76
+ </>
77
+ );
78
+ }
79
+ ```
80
+
81
+ ## Related
82
+
83
+ - Task builder
84
+ - Prompt editor with fields
85
+ - Follow-ups and starters
@@ -0,0 +1,160 @@
1
+ # Text input
2
+
3
+ Lets people type a single line of text, such as a job title, a salary or a search term.
4
+
5
+ Kind: component · Group: Actions and inputs · Status: built, import from @twoux/ui
6
+
7
+ ## When to use
8
+
9
+ - For short free text that cannot be listed in advance: job title, salary, a reference number. For dates use the Date picker (date-picker).
10
+ - For search inside a view, with a search icon and an accessible label.
11
+ - With a prefix or suffix for units the person should not type: £ and per year.
12
+
13
+ ## When not to use
14
+
15
+ - To pick one option from a short known list. Use Radio buttons (up to seven) or a select.
16
+ - For a yes/no setting. Use a Checkbox or Switch.
17
+ - For choosing from existing categories. Use Combobox (combobox) so people choose instead of type; for several free values use Tag input (tag-input).
18
+
19
+ ## Structure
20
+
21
+ 1. Label
22
+ 2. Required marker (optional)
23
+ 3. Field with prefix/suffix (optional)
24
+ 4. Hint text (optional)
25
+ 5. Error message (when invalid)
26
+
27
+ ## Guidelines
28
+
29
+ - 32px high, 6px radius, 13px text. Label sits above the field, left-aligned, 6px gap.
30
+ - Hint text sits under the field and stays visible while typing. Use it for format and examples.
31
+ - No placeholder in place of a label. Use placeholders only for a short example, or not at all.
32
+ - Focus shows an primary border and a soft 3px ring. Invalid shows a red border plus a text message under the field.
33
+ - Check the value when the person leaves the field, not while they type. Clear the error as soon as the value is fixed.
34
+ - Accept common variations (18000, 18,000, £18k) and convert them, then show the cleaned value.
35
+
36
+ ## Content
37
+
38
+ - Labels are short nouns in sentence case without a colon: Job title, Salary, Closing date.
39
+ - Hint text says why or in what format: Shown on the listing and in search results.
40
+ - Mark required fields with an asterisk after the label.
41
+ - Error text uses UK English and says how to fix it: Enter at least £23,400.
42
+
43
+ ## Accessibility
44
+
45
+ - Every field has a visible label tied to it with for/id. A placeholder is not a label.
46
+ - Link hint and error to the field with aria-describedby; set aria-invalid="true" when it fails.
47
+ - Field border needs 3:1 against the surface; typed text and hint text 4.5:1.
48
+ - The asterisk is decorative (aria-hidden). Use the required attribute so screen readers announce it.
49
+ - Error is not shown by colour alone: red border plus written message.
50
+
51
+ ## Keyboard
52
+
53
+ | Keys | Action |
54
+ |---|---|
55
+ | Tab / Shift+Tab | Move into and out of the field |
56
+ | / | Focus the search field of the current view (single-key shortcut, can be turned off) |
57
+ | Esc | Leave the search field |
58
+
59
+ ## Examples
60
+
61
+ ### affixes
62
+
63
+ ```tsx
64
+ import { InputGroup, InputGroupAddon, InputGroupInput, Kbd, TextField } from "@twoux/ui";
65
+ import { Search } from "lucide-react";
66
+
67
+ export const meta = { title: "Prefix and suffix", description: "Units, currency and icons sit inside the field so the value reads as one thing. Built on shadcn's InputGroup.", order: 2 };
68
+
69
+ export default function Example() {
70
+ return (
71
+ <div className="grid w-80 gap-4">
72
+ <TextField label="Salary" prefix="£" suffix="per year" defaultValue="32,000" inputMode="numeric" />
73
+ <InputGroup>
74
+ <InputGroupAddon><Search /></InputGroupAddon>
75
+ <InputGroupInput aria-label="Search listings" placeholder="Search listings" />
76
+ <InputGroupAddon align="inline-end"><Kbd>/</Kbd></InputGroupAddon>
77
+ </InputGroup>
78
+ </div>
79
+ );
80
+ }
81
+ ```
82
+
83
+ ### field
84
+
85
+ ```tsx
86
+ import { TextField } from "@twoux/ui";
87
+
88
+ export const meta = { title: "With label and hint", description: "Every input has a visible label. The hint says what good input looks like. TextField links label, hint and error to the input for screen readers.", order: 1 };
89
+
90
+ export default function Example() {
91
+ return (
92
+ <div className="grid w-80 gap-4">
93
+ <TextField label="Job title" hint="Shown on the listing and in search results." required defaultValue="Junior Product Designer" />
94
+ <TextField label="Hiring manager" optional placeholder="Search people" />
95
+ </div>
96
+ );
97
+ }
98
+ ```
99
+
100
+ ### password
101
+
102
+ ```tsx
103
+ import { InputGroupButton, TextField } from "@twoux/ui";
104
+ import { Eye, EyeOff } from "lucide-react";
105
+ import { useState } from "react";
106
+
107
+ export const meta = { title: "Password with live feedback", description: "Type to see the message switch from what is missing to a green confirmation. The show and hide button names its action for screen readers. Pattern from Clerk.", order: 4 };
108
+
109
+ export default function Example() {
110
+ const [value, setValue] = useState("correct-horse-42");
111
+ const [show, setShow] = useState(false);
112
+ const ok = value.length >= 8;
113
+ return (
114
+ <div className="w-80">
115
+ <TextField
116
+ label="Password"
117
+ type={show ? "text" : "password"}
118
+ value={value}
119
+ onChange={(e) => setValue(e.target.value)}
120
+ error={value && !ok ? "Use 8 or more characters." : undefined}
121
+ success={ok ? "Your password meets the requirements." : undefined}
122
+ suffix={
123
+ <InputGroupButton size="icon-xs" aria-label={show ? "Hide password" : "Show password"} onClick={() => setShow((s) => !s)}>
124
+ {show ? <EyeOff /> : <Eye />}
125
+ </InputGroupButton>
126
+ }
127
+ />
128
+ </div>
129
+ );
130
+ }
131
+ ```
132
+
133
+ ### states
134
+
135
+ ```tsx
136
+ import { TextField } from "@twoux/ui";
137
+
138
+ export const meta = { title: "States", description: "Error replaces the hint and says how to fix it. Disabled fields keep their value readable.", order: 3 };
139
+
140
+ export default function Example() {
141
+ return (
142
+ <div className="grid w-80 gap-4">
143
+ <TextField label="Salary" prefix="£" defaultValue="18,000" required error="Enter at least £23,400, the UK minimum for a full-time role." />
144
+ <TextField label="Listing ID" defaultValue="LST-1041" disabled />
145
+ </div>
146
+ );
147
+ }
148
+ ```
149
+
150
+ ## Related
151
+
152
+ - Form validation
153
+ - Date picker
154
+ - Combobox
155
+ - Tag input
156
+ - Tooltip
157
+ - Keyboard shortcut hint
158
+ - Sign in
159
+ - Onboarding step
160
+ - File drop
@@ -0,0 +1,89 @@
1
+ # Thinking and steps
2
+
3
+ A row that shows what the assistant is doing in words with a running timer, then collapses to "Thought for 2.1s · 4 steps" and expands on request.
4
+
5
+ Kind: component · Group: AI and agents · Status: built, import from @twoux/ui
6
+
7
+ ## When to use
8
+
9
+ - Any response that takes more than about a second, so people know what is happening instead of watching a bare spinner.
10
+ - When the answer depends on what was read: steps say "Read 2 listings and 3,000 views" so people can judge scope.
11
+ - Keeping the reasoning in the history after the answer arrives, so it can be checked later.
12
+
13
+ ## When not to use
14
+
15
+ - Responses under a second. Stream the answer directly; short loading states flicker.
16
+ - Multi-step agent work that changes records. Use the Agent run timeline (agent-run) with states and Stop.
17
+ - Progress of applying approved changes. Use the Step card (step-card).
18
+
19
+ ## Structure
20
+
21
+ 1. Header (status mark, "Thinking", timer)
22
+ 2. Step list (short title and one line of detail each)
23
+ 3. Collapsed summary button ("Thought for Xs · N steps")
24
+
25
+ ## Guidelines
26
+
27
+ - Say the current step in words ("Reading 9 listings"), never only an animation.
28
+ - Show a running timer while thinking. When the answer starts, collapse to "Thought for 2.1s · 4 steps" with a check.
29
+ - Each step has a short title and one line of detail. Keep plan, execution and evidence apart.
30
+ - If the person answered clarifying questions, add a step "Using your answers" with their choices.
31
+ - Stopping during thinking marks the header "Stopped" and removes unfinished steps; nothing is changed.
32
+
33
+ ## Content
34
+
35
+ - Use present participles for running steps ("Reading listings", "Comparing with the board median") and past tense once done.
36
+ - Include counts and time: "Read 2 listings and 3,000 views · 4s".
37
+ - Do not write "Thinking deeply" or anything that implies a person or magic.
38
+
39
+ ## Accessibility
40
+
41
+ - The thinking row is a polite live region; announce each step title, not the timer ticks (SC 4.1.3).
42
+ - The running timer updates in parallel with other content, so Stop must be available (SC 2.2.2); the pulse animation is decorative and stops when done.
43
+ - The collapsed summary is a disclosure button with aria-expanded; Enter or Space toggles the steps.
44
+ - Step states use an icon shape as well as colour (SC 1.4.1).
45
+
46
+ ## Keyboard
47
+
48
+ | Keys | Action |
49
+ |---|---|
50
+ | Enter / Space | Expand or collapse finished steps |
51
+ | Tab | Move to the summary button |
52
+
53
+ ## Examples
54
+
55
+ ### steps
56
+
57
+ ```tsx
58
+ import { Button, ThinkingSteps } from "@twoux/ui";
59
+ import { useEffect, useState } from "react";
60
+
61
+ export const meta = { title: "Say what it is doing", description: "The current step in words with a running timer, never only an animation. When the answer starts, it collapses to a summary you can open.", order: 1 };
62
+
63
+ const STEPS = [{ title: "Reading 24 listings", detail: "Open and closing soon" }, { title: "Comparing applicants with last quarter" }, { title: "Checking salary bands", detail: "Against the 2026 bands file" }, { title: "Writing the answer" }];
64
+
65
+ export default function Example() {
66
+ const [n, setN] = useState(1);
67
+ const [t, setT] = useState(0);
68
+ const done = n > STEPS.length;
69
+ useEffect(() => {
70
+ if (done) return;
71
+ const i = setInterval(() => setT((x) => x + 0.1), 100);
72
+ const s = setTimeout(() => setN((x) => x + 1), 700);
73
+ return () => { clearInterval(i); clearTimeout(s); };
74
+ }, [n, done]);
75
+ return (
76
+ <div className="grid w-full max-w-md gap-3">
77
+ <ThinkingSteps done={done} seconds={t} steps={STEPS.slice(0, Math.min(n, STEPS.length))} />
78
+ <Button variant="outline" size="sm" className="justify-self-start" onClick={() => { setN(1); setT(0); }}>Replay</Button>
79
+ </div>
80
+ );
81
+ }
82
+ ```
83
+
84
+ ## Related
85
+
86
+ - Assistant side panel
87
+ - Agent run timeline
88
+ - Step card
89
+ - Clarifying question card