@adres/mgda-ui 0.0.0-stage → 0.0.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/brand-knowledge.json +451 -0
  2. package/knowledge/accordion.md +135 -0
  3. package/knowledge/activity-rings.md +123 -0
  4. package/knowledge/alert.md +184 -0
  5. package/knowledge/answer-actions.md +217 -0
  6. package/knowledge/aspect-ratio.md +82 -0
  7. package/knowledge/avatar.md +158 -0
  8. package/knowledge/badge.md +172 -0
  9. package/knowledge/bar-graph.md +167 -0
  10. package/knowledge/bento-grid.md +115 -0
  11. package/knowledge/blockquote.md +153 -0
  12. package/knowledge/box-list.md +177 -0
  13. package/knowledge/bullet-list.md +128 -0
  14. package/knowledge/button-group.md +179 -0
  15. package/knowledge/button.md +231 -0
  16. package/knowledge/calendar.md +168 -0
  17. package/knowledge/card.md +321 -0
  18. package/knowledge/cards-nav.md +170 -0
  19. package/knowledge/chain-of-thought.md +164 -0
  20. package/knowledge/chat-container.md +135 -0
  21. package/knowledge/chat-message.md +224 -0
  22. package/knowledge/checkbox-card.md +172 -0
  23. package/knowledge/checkbox.md +111 -0
  24. package/knowledge/citations.md +241 -0
  25. package/knowledge/combobox.md +265 -0
  26. package/knowledge/countdown-pill.md +153 -0
  27. package/knowledge/cta.md +118 -0
  28. package/knowledge/data-list.md +173 -0
  29. package/knowledge/data-table.md +220 -0
  30. package/knowledge/dialog.md +249 -0
  31. package/knowledge/drawer.md +236 -0
  32. package/knowledge/dropdown-menu.md +238 -0
  33. package/knowledge/dropzone.md +153 -0
  34. package/knowledge/email-chips-input.md +161 -0
  35. package/knowledge/empty-state.md +106 -0
  36. package/knowledge/entity-header.md +166 -0
  37. package/knowledge/feature-grid.md +120 -0
  38. package/knowledge/feedback-bar.md +127 -0
  39. package/knowledge/footer.md +116 -0
  40. package/knowledge/heading.md +189 -0
  41. package/knowledge/hero.md +361 -0
  42. package/knowledge/input-button.md +187 -0
  43. package/knowledge/input-group.md +185 -0
  44. package/knowledge/input.md +256 -0
  45. package/knowledge/inset.md +177 -0
  46. package/knowledge/kpi-card.md +206 -0
  47. package/knowledge/list-nav.md +181 -0
  48. package/knowledge/logo-cloud.md +102 -0
  49. package/knowledge/media-gallery.md +158 -0
  50. package/knowledge/message-actions.md +175 -0
  51. package/knowledge/nav-sidebar.md +225 -0
  52. package/knowledge/number-stepper.md +159 -0
  53. package/knowledge/page-header.md +109 -0
  54. package/knowledge/pagination.md +225 -0
  55. package/knowledge/popover.md +159 -0
  56. package/knowledge/pricing.md +132 -0
  57. package/knowledge/progress.md +156 -0
  58. package/knowledge/prompt-input.md +337 -0
  59. package/knowledge/prompt-suggestions.md +168 -0
  60. package/knowledge/quota-bar.md +160 -0
  61. package/knowledge/quote.md +116 -0
  62. package/knowledge/radio-card.md +172 -0
  63. package/knowledge/radio-group.md +135 -0
  64. package/knowledge/reasoning.md +142 -0
  65. package/knowledge/search.md +131 -0
  66. package/knowledge/section-nav.md +162 -0
  67. package/knowledge/segmented-control.md +181 -0
  68. package/knowledge/select-button.md +205 -0
  69. package/knowledge/select.md +210 -0
  70. package/knowledge/separator.md +75 -0
  71. package/knowledge/shimmer-text.md +140 -0
  72. package/knowledge/sidebar.md +227 -0
  73. package/knowledge/skeleton.md +142 -0
  74. package/knowledge/slider.md +133 -0
  75. package/knowledge/slideshow.md +159 -0
  76. package/knowledge/source.md +156 -0
  77. package/knowledge/spinner.md +120 -0
  78. package/knowledge/stat-strip.md +128 -0
  79. package/knowledge/stats.md +117 -0
  80. package/knowledge/step-indicator.md +157 -0
  81. package/knowledge/switch.md +88 -0
  82. package/knowledge/table.md +190 -0
  83. package/knowledge/tabs.md +169 -0
  84. package/knowledge/testimonials.md +115 -0
  85. package/knowledge/text-link.md +192 -0
  86. package/knowledge/text.md +194 -0
  87. package/knowledge/thinking-bar.md +115 -0
  88. package/knowledge/thinking-steps.md +140 -0
  89. package/knowledge/toaster.md +127 -0
  90. package/knowledge/toggle.md +113 -0
  91. package/knowledge/tool-call-card.md +241 -0
  92. package/knowledge/tooltip.md +120 -0
  93. package/knowledge/top-nav.md +138 -0
  94. package/knowledge.json +19854 -0
  95. package/package.json +94 -4
  96. package/src/components/accordion.stories.tsx +46 -0
  97. package/src/components/accordion.tsx +74 -0
  98. package/src/components/activity-rings.stories.tsx +73 -0
  99. package/src/components/activity-rings.tsx +121 -0
  100. package/src/components/alert.stories.tsx +43 -0
  101. package/src/components/alert.tsx +132 -0
  102. package/src/components/answer-actions.stories.tsx +54 -0
  103. package/src/components/answer-actions.test.tsx +37 -0
  104. package/src/components/answer-actions.tsx +313 -0
  105. package/src/components/aspect-ratio.stories.tsx +32 -0
  106. package/src/components/aspect-ratio.tsx +5 -0
  107. package/src/components/avatar.stories.tsx +40 -0
  108. package/src/components/avatar.tsx +154 -0
  109. package/src/components/badge.stories.tsx +27 -0
  110. package/src/components/badge.tsx +63 -0
  111. package/src/components/bar-graph.stories.tsx +28 -0
  112. package/src/components/bar-graph.tsx +204 -0
  113. package/src/components/bento-grid.stories.tsx +23 -0
  114. package/src/components/bento-grid.tsx +67 -0
  115. package/src/components/blockquote.stories.tsx +28 -0
  116. package/src/components/blockquote.tsx +88 -0
  117. package/src/components/box-list.stories.tsx +25 -0
  118. package/src/components/box-list.tsx +108 -0
  119. package/src/components/bullet-list.stories.tsx +22 -0
  120. package/src/components/bullet-list.tsx +101 -0
  121. package/src/components/button-group.stories.tsx +31 -0
  122. package/src/components/button-group.tsx +156 -0
  123. package/src/components/button.stories.tsx +66 -0
  124. package/src/components/button.test.ts +17 -0
  125. package/src/components/button.tsx +139 -0
  126. package/src/components/calendar.stories.tsx +25 -0
  127. package/src/components/calendar.tsx +367 -0
  128. package/src/components/card.stories.tsx +44 -0
  129. package/src/components/card.tsx +392 -0
  130. package/src/components/cards-nav.stories.tsx +35 -0
  131. package/src/components/cards-nav.tsx +115 -0
  132. package/src/components/chain-of-thought.stories.tsx +67 -0
  133. package/src/components/chain-of-thought.test.tsx +50 -0
  134. package/src/components/chain-of-thought.tsx +170 -0
  135. package/src/components/chat-container.stories.tsx +47 -0
  136. package/src/components/chat-container.test.tsx +49 -0
  137. package/src/components/chat-container.tsx +222 -0
  138. package/src/components/chat-message.stories.tsx +52 -0
  139. package/src/components/chat-message.test.tsx +36 -0
  140. package/src/components/chat-message.tsx +163 -0
  141. package/src/components/checkbox-card.stories.tsx +27 -0
  142. package/src/components/checkbox-card.tsx +200 -0
  143. package/src/components/checkbox.stories.tsx +26 -0
  144. package/src/components/checkbox.tsx +61 -0
  145. package/src/components/citations.stories.tsx +64 -0
  146. package/src/components/citations.test.tsx +61 -0
  147. package/src/components/citations.tsx +220 -0
  148. package/src/components/combobox.stories.tsx +184 -0
  149. package/src/components/combobox.test.tsx +82 -0
  150. package/src/components/combobox.tsx +407 -0
  151. package/src/components/countdown-pill.stories.tsx +24 -0
  152. package/src/components/countdown-pill.tsx +129 -0
  153. package/src/components/cta.stories.tsx +29 -0
  154. package/src/components/cta.tsx +52 -0
  155. package/src/components/data-list.stories.tsx +50 -0
  156. package/src/components/data-list.test.tsx +35 -0
  157. package/src/components/data-list.tsx +181 -0
  158. package/src/components/data-table.stories.tsx +29 -0
  159. package/src/components/data-table.tsx +200 -0
  160. package/src/components/dialog.stories.tsx +42 -0
  161. package/src/components/dialog.tsx +200 -0
  162. package/src/components/drawer.stories.tsx +48 -0
  163. package/src/components/drawer.tsx +385 -0
  164. package/src/components/dropdown-menu.stories.tsx +41 -0
  165. package/src/components/dropdown-menu.tsx +252 -0
  166. package/src/components/dropzone.stories.tsx +19 -0
  167. package/src/components/dropzone.tsx +250 -0
  168. package/src/components/email-chips-input.stories.tsx +135 -0
  169. package/src/components/email-chips-input.tsx +210 -0
  170. package/src/components/empty-state.stories.tsx +22 -0
  171. package/src/components/empty-state.tsx +35 -0
  172. package/src/components/entity-header.stories.tsx +43 -0
  173. package/src/components/entity-header.test.tsx +35 -0
  174. package/src/components/entity-header.tsx +92 -0
  175. package/src/components/feature-grid.stories.tsx +25 -0
  176. package/src/components/feature-grid.tsx +87 -0
  177. package/src/components/feedback-bar.stories.tsx +25 -0
  178. package/src/components/feedback-bar.test.tsx +24 -0
  179. package/src/components/feedback-bar.tsx +62 -0
  180. package/src/components/footer.stories.tsx +23 -0
  181. package/src/components/footer.tsx +78 -0
  182. package/src/components/heading.stories.tsx +45 -0
  183. package/src/components/heading.test.tsx +22 -0
  184. package/src/components/heading.tsx +77 -0
  185. package/src/components/hero.stories.tsx +38 -0
  186. package/src/components/hero.tsx +498 -0
  187. package/src/components/input-button.stories.tsx +19 -0
  188. package/src/components/input-button.tsx +112 -0
  189. package/src/components/input-group.stories.tsx +38 -0
  190. package/src/components/input-group.tsx +157 -0
  191. package/src/components/input.stories.tsx +31 -0
  192. package/src/components/input.tsx +284 -0
  193. package/src/components/inset.stories.tsx +29 -0
  194. package/src/components/inset.tsx +70 -0
  195. package/src/components/kpi-card.stories.tsx +29 -0
  196. package/src/components/kpi-card.tsx +284 -0
  197. package/src/components/list-nav.stories.tsx +22 -0
  198. package/src/components/list-nav.tsx +145 -0
  199. package/src/components/logo-cloud.stories.tsx +23 -0
  200. package/src/components/logo-cloud.tsx +42 -0
  201. package/src/components/media-gallery.stories.tsx +25 -0
  202. package/src/components/media-gallery.tsx +347 -0
  203. package/src/components/message-actions.stories.tsx +45 -0
  204. package/src/components/message-actions.test.tsx +32 -0
  205. package/src/components/message-actions.tsx +119 -0
  206. package/src/components/nav-sidebar.stories.tsx +58 -0
  207. package/src/components/nav-sidebar.test.tsx +54 -0
  208. package/src/components/nav-sidebar.tsx +462 -0
  209. package/src/components/number-stepper.stories.tsx +19 -0
  210. package/src/components/number-stepper.tsx +158 -0
  211. package/src/components/page-header.stories.tsx +25 -0
  212. package/src/components/page-header.tsx +64 -0
  213. package/src/components/pagination.stories.tsx +110 -0
  214. package/src/components/pagination.test.tsx +46 -0
  215. package/src/components/pagination.tsx +144 -0
  216. package/src/components/popover.stories.tsx +26 -0
  217. package/src/components/popover.tsx +62 -0
  218. package/src/components/pricing.stories.tsx +42 -0
  219. package/src/components/pricing.tsx +130 -0
  220. package/src/components/progress.stories.tsx +22 -0
  221. package/src/components/progress.tsx +189 -0
  222. package/src/components/prompt-input.stories.tsx +62 -0
  223. package/src/components/prompt-input.test.tsx +106 -0
  224. package/src/components/prompt-input.tsx +343 -0
  225. package/src/components/prompt-suggestions.stories.tsx +53 -0
  226. package/src/components/prompt-suggestions.test.tsx +37 -0
  227. package/src/components/prompt-suggestions.tsx +122 -0
  228. package/src/components/quota-bar.stories.tsx +19 -0
  229. package/src/components/quota-bar.tsx +191 -0
  230. package/src/components/quote.stories.tsx +18 -0
  231. package/src/components/quote.tsx +43 -0
  232. package/src/components/radio-card.stories.tsx +27 -0
  233. package/src/components/radio-card.tsx +225 -0
  234. package/src/components/radio-group.stories.tsx +32 -0
  235. package/src/components/radio-group.tsx +68 -0
  236. package/src/components/reasoning.stories.tsx +50 -0
  237. package/src/components/reasoning.test.tsx +48 -0
  238. package/src/components/reasoning.tsx +143 -0
  239. package/src/components/search.stories.tsx +18 -0
  240. package/src/components/search.tsx +133 -0
  241. package/src/components/section-nav.stories.tsx +59 -0
  242. package/src/components/section-nav.test.tsx +36 -0
  243. package/src/components/section-nav.tsx +146 -0
  244. package/src/components/segmented-control.stories.tsx +22 -0
  245. package/src/components/segmented-control.tsx +301 -0
  246. package/src/components/select-button.stories.tsx +27 -0
  247. package/src/components/select-button.tsx +174 -0
  248. package/src/components/select.stories.tsx +27 -0
  249. package/src/components/select.tsx +198 -0
  250. package/src/components/separator.stories.tsx +22 -0
  251. package/src/components/separator.tsx +23 -0
  252. package/src/components/shimmer-text.stories.tsx +23 -0
  253. package/src/components/shimmer-text.test.tsx +35 -0
  254. package/src/components/shimmer-text.tsx +43 -0
  255. package/src/components/sidebar.stories.tsx +25 -0
  256. package/src/components/sidebar.tsx +234 -0
  257. package/src/components/skeleton.stories.tsx +22 -0
  258. package/src/components/skeleton.tsx +96 -0
  259. package/src/components/slider.stories.tsx +20 -0
  260. package/src/components/slider.tsx +176 -0
  261. package/src/components/slideshow.stories.tsx +30 -0
  262. package/src/components/slideshow.tsx +291 -0
  263. package/src/components/source.stories.tsx +32 -0
  264. package/src/components/source.test.tsx +40 -0
  265. package/src/components/source.tsx +161 -0
  266. package/src/components/spinner.stories.tsx +19 -0
  267. package/src/components/spinner.tsx +76 -0
  268. package/src/components/stat-strip.stories.tsx +36 -0
  269. package/src/components/stat-strip.test.tsx +25 -0
  270. package/src/components/stat-strip.tsx +85 -0
  271. package/src/components/stats.stories.tsx +24 -0
  272. package/src/components/stats.tsx +83 -0
  273. package/src/components/step-indicator.stories.tsx +18 -0
  274. package/src/components/step-indicator.test.tsx +18 -0
  275. package/src/components/step-indicator.tsx +286 -0
  276. package/src/components/switch.stories.tsx +26 -0
  277. package/src/components/switch.tsx +32 -0
  278. package/src/components/table.stories.tsx +38 -0
  279. package/src/components/table.tsx +220 -0
  280. package/src/components/tabs.stories.tsx +25 -0
  281. package/src/components/tabs.tsx +276 -0
  282. package/src/components/testimonials.stories.tsx +22 -0
  283. package/src/components/testimonials.tsx +109 -0
  284. package/src/components/text-link.stories.tsx +47 -0
  285. package/src/components/text-link.test.tsx +18 -0
  286. package/src/components/text-link.tsx +88 -0
  287. package/src/components/text.stories.tsx +49 -0
  288. package/src/components/text.tsx +105 -0
  289. package/src/components/thinking-bar.stories.tsx +19 -0
  290. package/src/components/thinking-bar.test.tsx +27 -0
  291. package/src/components/thinking-bar.tsx +64 -0
  292. package/src/components/thinking-steps.stories.tsx +44 -0
  293. package/src/components/thinking-steps.test.tsx +42 -0
  294. package/src/components/thinking-steps.tsx +92 -0
  295. package/src/components/toaster.stories.tsx +80 -0
  296. package/src/components/toaster.tsx +36 -0
  297. package/src/components/toggle.stories.tsx +21 -0
  298. package/src/components/toggle.tsx +103 -0
  299. package/src/components/tool-call-card.stories.tsx +97 -0
  300. package/src/components/tool-call-card.test.tsx +88 -0
  301. package/src/components/tool-call-card.tsx +231 -0
  302. package/src/components/tooltip.stories.tsx +25 -0
  303. package/src/components/tooltip.tsx +43 -0
  304. package/src/components/top-nav.stories.tsx +20 -0
  305. package/src/components/top-nav.tsx +76 -0
  306. package/src/docs/Colors.stories.tsx +192 -0
  307. package/src/docs/GettingStarted.mdx +72 -0
  308. package/src/docs/Mcp.mdx +52 -0
  309. package/src/docs/Typography.stories.tsx +114 -0
  310. package/src/hooks/use-in-view.ts +32 -0
  311. package/src/hooks/use-reduced-motion.ts +26 -0
  312. package/src/index.ts +343 -0
  313. package/src/lib/cn.test.ts +67 -0
  314. package/src/lib/cn.ts +81 -0
  315. package/src/lib/motion.ts +109 -0
  316. package/src/lib/prefix-utilities.test.ts +56 -0
  317. package/src/lib/prefix-utilities.ts +50 -0
  318. package/src/styles/base.css +489 -0
  319. package/src/styles/motion.css +69 -0
  320. package/src/styles/overrides.css +44 -0
  321. package/src/styles/typography.css +173 -0
  322. package/src/theme/theme.css +391 -0
  323. package/src/theme/tokens.ts +29 -0
  324. package/src/theme/types.ts +26 -0
  325. package/README.md +0 -3
@@ -0,0 +1,140 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: thinking-steps
6
+ sourceFile: packages/design-system/src/components/thinking-steps.tsx
7
+ client: true
8
+ category: web-app-ai
9
+ categoryFromBarrel: web-app-ai
10
+ barrelExported: true
11
+ importPath: "@adres/mgda-ui"
12
+ exports:
13
+ - name: StreamingCursor
14
+ kind: component
15
+ typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>"
16
+ - name: ThinkingStep
17
+ kind: type
18
+ - name: ThinkingSteps
19
+ kind: component
20
+ typeText: "ForwardRefExoticComponent<ThinkingStepsProps & RefAttributes<HTMLDivElement>>"
21
+ - name: ThinkingStepsProps
22
+ kind: type
23
+ - name: thinkingStepsSummary
24
+ kind: function
25
+ typeText: "({ running, done, total }: { running: boolean; done: number; total: number; }) => string"
26
+ - name: ThinkingStepStatus
27
+ kind: type
28
+ primaryExport: ThinkingSteps
29
+ subcomponents:
30
+ - StreamingCursor
31
+ props:
32
+ ThinkingSteps:
33
+ - name: running
34
+ type: boolean
35
+ required: true
36
+ declaredIn: self
37
+ doc: "True while the assistant is still working; the list opens and the summary shimmers."
38
+ - name: steps
39
+ type: "ThinkingStep[]"
40
+ required: true
41
+ declaredIn: self
42
+ doc: "Steps to show so far, in order. Leave out steps that have not started."
43
+ - name: total
44
+ type: number
45
+ required: false
46
+ declaredIn: self
47
+ doc: "Steps planned in all, for \"step 2 of 4\". Defaults to `steps.length`."
48
+ extendsProps:
49
+ - "Omit<React.HTMLAttributes<HTMLDivElement>, \"dir\">"
50
+ variants: {}
51
+ variantSource: none
52
+ compoundVariants: []
53
+ sizeMaps: []
54
+ dataSlots:
55
+ - streaming-cursor
56
+ - thinking-steps
57
+ dependsOn:
58
+ internal:
59
+ - shimmer-text
60
+ lib:
61
+ - cn
62
+ hooks: []
63
+ external:
64
+ - lucide-react
65
+ - react
66
+ contexts: []
67
+ stories:
68
+ - exportName: Running
69
+ id: components-thinkingsteps--running
70
+ - exportName: Done
71
+ id: components-thinkingsteps--done
72
+ - exportName: Cursor
73
+ id: components-thinkingsteps--cursor
74
+ storybookTitle: Components/ThinkingSteps
75
+ docsId: components-thinkingsteps--documentation
76
+ argTypeOptions: {}
77
+ resolvedCleanly: true
78
+ contractHash: eb86f6ca5461
79
+ factsHash: "460b11735eb4"
80
+ # >>> AUTHORED - humans own everything below this line. <<<
81
+ status: beta
82
+ summary: "Shows what an assistant is doing before it answers: a muted one-line summary that toggles the step list, shimmering while running and folded away once done. StreamingCursor marks text still being written."
83
+ useWhen:
84
+ - "an assistant runs searches or tools before answering and people should see progress"
85
+ - "a finished answer should keep a record of the steps it took, folded away"
86
+ - "streamed text needs a caret at the point it is still being written (StreamingCursor)"
87
+ useInstead:
88
+ - id: step-indicator
89
+ when: "the steps are a form or wizard the person moves through"
90
+ - id: progress
91
+ when: "only a percentage matters, not named steps"
92
+ related:
93
+ - chat-message
94
+ - shimmer-text
95
+ - skeleton
96
+ a11y:
97
+ notes:
98
+ - "The summary is a button with aria-expanded and aria-controls, so the step list toggles with Enter or Space."
99
+ - "Each step's label says whether it is done or running; the shimmer is decorative and stops under reduced motion."
100
+ - "Announce phase changes (working, writing, done) in a separate polite live region; the summary itself is not live."
101
+ - "StreamingCursor is aria-hidden."
102
+ radixHandles: false
103
+ pitfalls:
104
+ - "Pass only steps that have started; future steps belong in total, not steps."
105
+ - "Word labels by tense: present while running (\"Searching listings\"), past once done (\"Searched 128 listings\")."
106
+ - "The list follows running: it reopens when running turns true again, overriding a manual close."
107
+ canonicalSnippet: |
108
+ import { ThinkingSteps } from "@adres/mgda-ui"
109
+
110
+ <ThinkingSteps
111
+ running={working}
112
+ total={3}
113
+ steps={[
114
+ { label: "Searched 128 listings", status: "done" },
115
+ { label: "Comparing registered sales", status: "running" },
116
+ ]}
117
+ />
118
+ reviewedAt: 2026-10-06
119
+ reviewedAgainstContractHash: "eb86f6ca5461"
120
+ ---
121
+
122
+ ## Usage
123
+
124
+ `ThinkingSteps` sits at the top of an assistant turn while it works. The
125
+ muted summary reads "Working, step 2 of 3" with a shimmer while `running`,
126
+ then "Used 3 steps" once done; its chevron toggles the step list, which hangs
127
+ off a thin rule. The list opens while running and folds away when finished;
128
+ people can reopen it. Pass the steps that have
129
+ started, each with a `label` and a `status` of `done` or `running`, and
130
+ `total` for the planned count. `thinkingStepsSummary` returns the header text
131
+ for custom layouts.
132
+
133
+ The shimmer is `ShimmerText`, its own component, for other in-progress text.
134
+ `StreamingCursor` is a small blinking block to place at the end of text that
135
+ is still streaming; it stops blinking under reduced motion.
136
+
137
+ ## Anatomy
138
+
139
+ - `ThinkingSteps` - summary toggle and an ordered step list beside a thin rule.
140
+ - `StreamingCursor` - decorative caret for streaming text.
@@ -0,0 +1,127 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: toaster
6
+ sourceFile: packages/design-system/src/components/toaster.tsx
7
+ client: true
8
+ category: web-app-feedback
9
+ categoryFromBarrel: web-app-feedback
10
+ barrelExported: true
11
+ importPath: "@adres/mgda-ui"
12
+ exports:
13
+ - name: toast
14
+ kind: function
15
+ typeText: "((message: titleT, data?: ExternalToast | undefined) => string | number) & { success: (message: string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | ... 5 more ... | undefined...[truncated]"
16
+ - name: Toaster
17
+ kind: component
18
+ typeText: "() => Element"
19
+ primaryExport: Toaster
20
+ subcomponents: []
21
+ props: {}
22
+ extendsProps: []
23
+ variants: {}
24
+ variantSource: none
25
+ compoundVariants: []
26
+ sizeMaps: []
27
+ dataSlots: []
28
+ dependsOn:
29
+ internal: []
30
+ lib: []
31
+ hooks: []
32
+ external:
33
+ - react
34
+ - sonner
35
+ contexts: []
36
+ stories:
37
+ - exportName: Default
38
+ id: components-toaster--default
39
+ - exportName: WithDescription
40
+ id: components-toaster--with-description
41
+ - exportName: Success
42
+ id: components-toaster--success
43
+ - exportName: Error
44
+ id: components-toaster--error
45
+ - exportName: Action
46
+ id: components-toaster--action
47
+ storybookTitle: Components/Toaster
48
+ docsId: components-toaster--documentation
49
+ argTypeOptions: {}
50
+ resolvedCleanly: true
51
+ contractHash: "53b4d1a7ef2b"
52
+ factsHash: c989fa2a8c82
53
+ # >>> AUTHORED - humans own everything below this line. <<<
54
+ status: stable
55
+ summary: "The app-level toast host, mounted once, plus the toast() function that fires them."
56
+ useWhen:
57
+ - "confirming a background action succeeded or failed without interrupting the user"
58
+ - "reporting the result of something the user has already moved on from"
59
+ useInstead:
60
+ - id: alert
61
+ when: "the message belongs to a region of the page and must stay visible"
62
+ - id: dialog
63
+ when: "the user has to acknowledge or decide something before continuing"
64
+ - id: empty-state
65
+ when: "you are explaining why a surface has no content"
66
+ related:
67
+ - alert
68
+ - dialog
69
+ - spinner
70
+ tokens:
71
+ - "--card"
72
+ - "--card-foreground"
73
+ - "--border"
74
+ - "--foreground"
75
+ - "--muted"
76
+ - "--muted-foreground"
77
+ - "--primary"
78
+ - "--primary-foreground"
79
+ a11y:
80
+ notes:
81
+ - "sonner renders the stack in an aria-live region, so announcements happen without extra work."
82
+ - "A toast disappears on a timer, so it must never be the only place a message appears. Anything the user has to act on belongs in Alert or Dialog."
83
+ - "Toast text has to stand alone. \"Saved\" announced out of context says nothing about what was saved."
84
+ requiredProps:
85
+ - "none: Toaster takes no props at all"
86
+ keyboard:
87
+ - "The close button is keyboard reachable. Focus is deliberately not moved to the toast when it appears, which is correct for a non-blocking notification."
88
+ radixHandles: false
89
+ pitfalls:
90
+ - "Toaster accepts no props. Position (bottom-right), richColors (off) and the close button are hardcoded, so an app cannot move or restyle toasts by passing anything. Changing that means editing the design system."
91
+ - "Mount Toaster exactly once, near the app root. A second mount produces duplicate toasts from a single toast() call, which is easy to do by accident by adding it to a layout that is itself nested."
92
+ - "toast is a plain function re-exported from sonner, not a component. Import it from @adres/mgda-ui so the app does not take its own sonner dependency that could drift to a different version."
93
+ - "Calling toast() during a server render does nothing. It needs a client component and a mounted Toaster."
94
+ rtl: "sonner positions the stack with physical right and bottom offsets, so toasts stay bottom-right under RTL rather than mirroring. Acceptable today, but worth revisiting with the i18n work."
95
+ brandNotes: "Toast surfaces bind to the brand through classNames on the card, border, muted and primary tokens, so a brand re-skins them by redefining those. richColors is deliberately off so sonner's own palette never overrides brand tokens."
96
+ canonicalSnippet: |
97
+ import { Toaster, toast } from "@adres/mgda-ui"
98
+
99
+ // Once, near the app root:
100
+ <Toaster />
101
+
102
+ // Then from any client component:
103
+ toast.success("Changes saved")
104
+ reviewedAt: 2026-08-19
105
+ reviewedAgainstContractHash: 53b4d1a7ef2b
106
+ ---
107
+
108
+ ## Usage
109
+
110
+ Toaster is two things with one import: a host you mount once, and the `toast()`
111
+ function you call from anywhere.
112
+
113
+ It is deliberately closed. Position, colour strategy and the close button are decided
114
+ by the design system rather than the app, so toasts look identical across every
115
+ consuming surface and every brand. If you find yourself wanting a prop here, the
116
+ question to ask is whether the whole system should change, not this one screen.
117
+
118
+ Everything visual is bound to semantic tokens through sonner's `classNames`, and
119
+ `richColors` is off precisely so sonner's built-in palette can never win over a
120
+ brand's.
121
+
122
+ ### Choosing a toast over an alert
123
+
124
+ A toast is for something already finished, where the user does not need to respond.
125
+ The moment the message needs to persist, be acted on, or be found again later, it is
126
+ an `Alert` (page or region level) or a `Dialog` (blocking). Being on a timer is the
127
+ whole point, and also the whole limitation.
@@ -0,0 +1,113 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: toggle
6
+ sourceFile: packages/design-system/src/components/toggle.tsx
7
+ client: true
8
+ category: web-app-form-controls
9
+ categoryFromBarrel: web-app-form-controls
10
+ barrelExported: true
11
+ importPath: "@adres/mgda-ui"
12
+ exports:
13
+ - name: Toggle
14
+ kind: component
15
+ typeText: "ForwardRefExoticComponent<ToggleProps & RefAttributes<HTMLButtonElement>>"
16
+ - name: ToggleProps
17
+ kind: type
18
+ - name: ToggleSize
19
+ kind: type
20
+ primaryExport: Toggle
21
+ subcomponents: []
22
+ props:
23
+ Toggle:
24
+ - name: label
25
+ type: ReactNode
26
+ required: false
27
+ declaredIn: self
28
+ doc: "Optional caption rendered to the inline-start (left) of the switch. When set, the switch and text are wrapped in a <label> so the text is clickable and names the control - no separate `aria-label` needed."
29
+ - name: labelClassName
30
+ type: string
31
+ required: false
32
+ declaredIn: self
33
+ doc: "Classes for the wrapping <label> (only used when `label` is set). `className` still targets the switch track itself."
34
+ - name: size
35
+ type: ToggleSize
36
+ required: false
37
+ declaredIn: self
38
+ extendsProps:
39
+ - "React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>"
40
+ variants:
41
+ size:
42
+ kind: enum
43
+ options:
44
+ - sm
45
+ - md
46
+ - lg
47
+ default: md
48
+ on: Toggle
49
+ variantSource: prop-union
50
+ compoundVariants: []
51
+ sizeMaps:
52
+ - THUMB
53
+ - THUMB_TRANSLATE
54
+ - TRACK
55
+ dataSlots:
56
+ - toggle-label
57
+ dependsOn:
58
+ internal: []
59
+ lib:
60
+ - cn
61
+ hooks: []
62
+ external:
63
+ - "@radix-ui/react-switch"
64
+ - react
65
+ contexts: []
66
+ stories:
67
+ - exportName: Default
68
+ id: components-toggle--default
69
+ storybookTitle: Components/Toggle
70
+ docsId: components-toggle--documentation
71
+ argTypeOptions: {}
72
+ resolvedCleanly: true
73
+ contractHash: "6bd837db3ae8"
74
+ factsHash: a4a364bb1ace
75
+ # >>> AUTHORED - humans own everything below this line. <<<
76
+ status: stable
77
+ summary: "A binary on/off switch (built on Radix Switch), with an optional inline caption label."
78
+ useWhen:
79
+ - "an immediate on/off setting that takes effect right away, such as a settings toggle"
80
+ useInstead:
81
+ - id: checkbox
82
+ when: "the control is a form-bound selection to submit, not an immediate setting"
83
+ related:
84
+ - checkbox
85
+ a11y:
86
+ notes:
87
+ - "Passing label wraps the switch and text in a real label element, giving the control an accessible name and a larger clickable hit target for free - prefer this over a separate visual caption plus a manual aria-label."
88
+ - "Without label, the bare switch has no accessible name of its own - pair it with your own aria-label or a separate label pointing at it when composing a custom layout."
89
+ keyboard:
90
+ - "Native Radix switch semantics - Space toggles it; it takes part in tab order automatically."
91
+ radixHandles: true
92
+ pitfalls:
93
+ - "className targets the switch track itself even when label is set - use labelClassName to style the wrapping label element, not className, or the caption's layout will not change."
94
+ - "A separate, unexported Switch component still exists in source (switch.tsx) on the same Radix primitive, but it is not barrel-exported and has none of Toggle's size or label features - Toggle is the one to use; Switch cannot even be imported from the package."
95
+ - "size's default is \"md\", matching Button/Input's naming, but Checkbox's equivalent middle size is instead called \"base\" - the two sibling boolean controls do not share size vocabulary."
96
+ canonicalSnippet: |
97
+ import { Toggle } from "@adres/mgda-ui"
98
+
99
+ <Toggle label="Enable notifications" checked={enabled} onCheckedChange={setEnabled} />
100
+ reviewedAt: 2026-08-31
101
+ reviewedAgainstContractHash: "6bd837db3ae8"
102
+ ---
103
+
104
+ ## Usage
105
+
106
+ `Toggle` is for a setting that takes effect immediately - not a value that
107
+ waits to be submitted with a form (reach for `Checkbox` for that instead).
108
+
109
+ Pass `label` for a captioned control: the text renders to the left of the
110
+ switch, and the two are wrapped in a real `label` element so the text is
111
+ clickable and names the control with no separate `aria-label` needed. Omit
112
+ `label` to render the bare switch and compose your own layout, such as a
113
+ settings row with `justify-between` and a label elsewhere in the row.
@@ -0,0 +1,241 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: tool-call-card
6
+ sourceFile: packages/design-system/src/components/tool-call-card.tsx
7
+ client: true
8
+ category: web-app-ai
9
+ categoryFromBarrel: web-app-ai
10
+ barrelExported: true
11
+ importPath: "@adres/mgda-ui"
12
+ exports:
13
+ - name: formatToolValue
14
+ kind: function
15
+ typeText: "(value: unknown) => ReactNode"
16
+ - name: TOOL_CALL_STATUS
17
+ kind: const
18
+ typeText: "Record<ToolCallStatus, { label: string; variant: NonNullable<\"default\" | \"success\" | \"warning\" | \"destructive\" | \"secondary\" | \"outline\" | \"muted\" | \"accent\" | null | undefined>; }>"
19
+ - name: ToolCallCard
20
+ kind: component
21
+ typeText: "ForwardRefExoticComponent<ToolCallCardProps & RefAttributes<HTMLDivElement>>"
22
+ - name: ToolCallCardProps
23
+ kind: type
24
+ - name: ToolCallField
25
+ kind: type
26
+ - name: toolCallNeedsAttention
27
+ kind: function
28
+ typeText: "\"awaiting-approval\" | (status: ToolCallStatus) => status is \"error\""
29
+ - name: ToolCallStatus
30
+ kind: type
31
+ - name: ToolPart
32
+ kind: type
33
+ - name: ToolPartCardProps
34
+ kind: type
35
+ - name: toolPartToCallCard
36
+ kind: function
37
+ typeText: "(part: ToolPart) => ToolPartCardProps"
38
+ primaryExport: ToolCallCard
39
+ subcomponents: []
40
+ props:
41
+ ToolCallCard:
42
+ - name: callId
43
+ type: string
44
+ required: false
45
+ declaredIn: self
46
+ doc: "The call's id, shown small at the foot of the details for support and debugging."
47
+ - name: children
48
+ type: ReactNode
49
+ required: false
50
+ declaredIn: self
51
+ doc: "The approval body shown while `awaiting-approval`, in place of the fields."
52
+ - name: compact
53
+ type: boolean
54
+ required: false
55
+ declaredIn: self
56
+ doc: "Tighter header for a run of several calls."
57
+ - name: defaultOpen
58
+ type: boolean
59
+ required: false
60
+ declaredIn: self
61
+ doc: "Whether the body starts open. Defaults to open while awaiting approval or after an error."
62
+ - name: durationMs
63
+ type: number
64
+ required: false
65
+ declaredIn: self
66
+ doc: "Shown once the call succeeds."
67
+ - name: error
68
+ type: string
69
+ required: false
70
+ declaredIn: self
71
+ doc: "Shown when the call fails, with Retry when `onRetry` is set."
72
+ - name: icon
73
+ type: "ElementType<any, keyof IntrinsicElements>"
74
+ required: true
75
+ declaredIn: self
76
+ doc: "The tool's icon; replaced by a spinner while running."
77
+ - name: input
78
+ type: "ToolCallField[]"
79
+ required: false
80
+ declaredIn: self
81
+ - name: onCancel
82
+ type: "(() => void)"
83
+ required: false
84
+ declaredIn: self
85
+ doc: "Adds Cancel while running."
86
+ - name: onRetry
87
+ type: "(() => void)"
88
+ required: false
89
+ declaredIn: self
90
+ - name: output
91
+ type: "ToolCallField[]"
92
+ required: false
93
+ declaredIn: self
94
+ doc: "Shown once the call succeeds."
95
+ - name: status
96
+ type: ToolCallStatus
97
+ required: true
98
+ declaredIn: self
99
+ - name: subtitle
100
+ type: string
101
+ required: false
102
+ declaredIn: self
103
+ doc: "One line under the title: the result summary, or why it stopped."
104
+ - name: title
105
+ type: string
106
+ required: true
107
+ declaredIn: self
108
+ doc: "What the call does in plain words, in the tense of its status (\"Searching listings\", \"Searched listings\")."
109
+ - name: toolName
110
+ type: string
111
+ required: false
112
+ declaredIn: self
113
+ doc: "The technical tool name, shown in mono from `sm` up."
114
+ extendsProps:
115
+ - "Omit<React.HTMLAttributes<HTMLDivElement>, \"title\">"
116
+ variants:
117
+ status:
118
+ kind: enum
119
+ options:
120
+ - success
121
+ - error
122
+ - running
123
+ - awaiting-approval
124
+ - declined
125
+ - cancelled
126
+ default: null
127
+ on: ToolCallCard
128
+ variantSource: prop-union
129
+ compoundVariants: []
130
+ sizeMaps:
131
+ - TOOL_CALL_STATUS
132
+ - TOOL_PART_STATUS
133
+ dataSlots:
134
+ - tool-call-card
135
+ dependsOn:
136
+ internal:
137
+ - alert
138
+ - badge
139
+ - button
140
+ - spinner
141
+ - text
142
+ lib:
143
+ - cn
144
+ hooks: []
145
+ external:
146
+ - lucide-react
147
+ - react
148
+ contexts: []
149
+ stories:
150
+ - exportName: Success
151
+ id: components-toolcallcard--success
152
+ - exportName: Running
153
+ id: components-toolcallcard--running
154
+ - exportName: Failed
155
+ id: components-toolcallcard--failed
156
+ - exportName: AwaitingApproval
157
+ id: components-toolcallcard--awaiting-approval
158
+ - exportName: Compact
159
+ id: components-toolcallcard--compact
160
+ - exportName: FromAiSdkToolPart
161
+ id: components-toolcallcard--from-ai-sdk-tool-part
162
+ storybookTitle: Components/ToolCallCard
163
+ docsId: components-toolcallcard--documentation
164
+ argTypeOptions:
165
+ status:
166
+ - awaiting-approval
167
+ - running
168
+ - success
169
+ - error
170
+ - declined
171
+ - cancelled
172
+ resolvedCleanly: true
173
+ contractHash: c4d73f54fa01
174
+ factsHash: "88de79332830"
175
+ # >>> AUTHORED - humans own everything below this line. <<<
176
+ status: beta
177
+ summary: "One tool call made by an assistant: what it did in plain words, live status, and its inputs and results as labelled fields on demand, with an approval step for calls that change something."
178
+ useWhen:
179
+ - "an assistant calls a tool (search, lookup, booking) and people should see what it did"
180
+ - "a tool with side effects needs the person to approve, change or decline it first"
181
+ - "a tool call failed and should say why and offer Retry"
182
+ - "several calls in one turn should show as compact rows"
183
+ useInstead:
184
+ - id: thinking-steps
185
+ when: "only a short list of what the assistant did matters, not each call's inputs and results"
186
+ - id: alert
187
+ when: "a message about the conversation, not a single tool call"
188
+ related:
189
+ - chat-message
190
+ - thinking-steps
191
+ a11y:
192
+ notes:
193
+ - "The status badge is a polite live region, so status changes are announced."
194
+ - "The details toggle has aria-expanded and aria-controls and names the call (\"Show details for Searched listings\")."
195
+ - "The card is aria-busy while running; the spinner and tool icon are decorative."
196
+ - "Approval and errors open the body automatically so the decision or error is reachable."
197
+ radixHandles: false
198
+ pitfalls:
199
+ - "Word the title in the tense of its status; only use the past tense once the call succeeded."
200
+ - "Pass an approval body as children; without it, awaiting-approval shows the inputs with no way to decide."
201
+ - "Results and duration only show on success; error text only shows on error."
202
+ - "toolPartToCallCard titles the call from its tool id; pass your own plain-words title in the right tense when you have one."
203
+ canonicalSnippet: |
204
+ import { ToolCallCard } from "@adres/mgda-ui"
205
+ import { Search } from "lucide-react"
206
+
207
+ <ToolCallCard
208
+ icon={Search}
209
+ title="Searched listings"
210
+ toolName="search_listings"
211
+ status="success"
212
+ subtitle="12 townhouses under AED 5M"
213
+ durationMs={1400}
214
+ input={[{ label: "Community", value: "Yas Island" }]}
215
+ output={[{ label: "Matches", value: "12" }]}
216
+ />
217
+ reviewedAt: 2026-10-06
218
+ reviewedAgainstContractHash: "c4d73f54fa01"
219
+ ---
220
+
221
+ ## Usage
222
+
223
+ `ToolCallCard` shows one call in a light bordered card. The header has the
224
+ tool's `icon` (a spinner while running), a plain-words `title`, the technical `toolName`, a one-line
225
+ `subtitle`, the duration once done, and a status badge for `awaiting-approval`,
226
+ `running`, `success`, `error`, `declined` or `cancelled`. The chevron opens the
227
+ body with `input` and, after success, `output` as key and value lines in a
228
+ bordered mono box. On error
229
+ the body leads with `error` and a Retry button (`onRetry`). While running,
230
+ `onCancel` adds Cancel.
231
+
232
+ For tools with side effects, pass the approval UI (what will happen, Approve,
233
+ Decline, any editable choice) as `children`; it replaces the fields while
234
+ `awaiting-approval`. Use `compact` for a run of several calls in one turn.
235
+ `TOOL_CALL_STATUS` and `toolCallNeedsAttention` are exported for custom rows.
236
+
237
+ Using the Vercel AI SDK? `toolPartToCallCard(part)` maps a tool part to
238
+ props: its `state` to `status`, `input` and `output` records to fields (nested
239
+ values pretty-printed as JSON), `errorText` to `error` and `toolCallId` to
240
+ `callId`, shown at the foot of the details. Pass the `icon` yourself:
241
+ `<ToolCallCard icon={Search} {...toolPartToCallCard(part)} />`.