@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.
- package/brand-knowledge.json +451 -0
- package/knowledge/accordion.md +135 -0
- package/knowledge/activity-rings.md +123 -0
- package/knowledge/alert.md +184 -0
- package/knowledge/answer-actions.md +217 -0
- package/knowledge/aspect-ratio.md +82 -0
- package/knowledge/avatar.md +158 -0
- package/knowledge/badge.md +172 -0
- package/knowledge/bar-graph.md +167 -0
- package/knowledge/bento-grid.md +115 -0
- package/knowledge/blockquote.md +153 -0
- package/knowledge/box-list.md +177 -0
- package/knowledge/bullet-list.md +128 -0
- package/knowledge/button-group.md +179 -0
- package/knowledge/button.md +231 -0
- package/knowledge/calendar.md +168 -0
- package/knowledge/card.md +321 -0
- package/knowledge/cards-nav.md +170 -0
- package/knowledge/chain-of-thought.md +164 -0
- package/knowledge/chat-container.md +135 -0
- package/knowledge/chat-message.md +224 -0
- package/knowledge/checkbox-card.md +172 -0
- package/knowledge/checkbox.md +111 -0
- package/knowledge/citations.md +241 -0
- package/knowledge/combobox.md +265 -0
- package/knowledge/countdown-pill.md +153 -0
- package/knowledge/cta.md +118 -0
- package/knowledge/data-list.md +173 -0
- package/knowledge/data-table.md +220 -0
- package/knowledge/dialog.md +249 -0
- package/knowledge/drawer.md +236 -0
- package/knowledge/dropdown-menu.md +238 -0
- package/knowledge/dropzone.md +153 -0
- package/knowledge/email-chips-input.md +161 -0
- package/knowledge/empty-state.md +106 -0
- package/knowledge/entity-header.md +166 -0
- package/knowledge/feature-grid.md +120 -0
- package/knowledge/feedback-bar.md +127 -0
- package/knowledge/footer.md +116 -0
- package/knowledge/heading.md +189 -0
- package/knowledge/hero.md +361 -0
- package/knowledge/input-button.md +187 -0
- package/knowledge/input-group.md +185 -0
- package/knowledge/input.md +256 -0
- package/knowledge/inset.md +177 -0
- package/knowledge/kpi-card.md +206 -0
- package/knowledge/list-nav.md +181 -0
- package/knowledge/logo-cloud.md +102 -0
- package/knowledge/media-gallery.md +158 -0
- package/knowledge/message-actions.md +175 -0
- package/knowledge/nav-sidebar.md +225 -0
- package/knowledge/number-stepper.md +159 -0
- package/knowledge/page-header.md +109 -0
- package/knowledge/pagination.md +225 -0
- package/knowledge/popover.md +159 -0
- package/knowledge/pricing.md +132 -0
- package/knowledge/progress.md +156 -0
- package/knowledge/prompt-input.md +337 -0
- package/knowledge/prompt-suggestions.md +168 -0
- package/knowledge/quota-bar.md +160 -0
- package/knowledge/quote.md +116 -0
- package/knowledge/radio-card.md +172 -0
- package/knowledge/radio-group.md +135 -0
- package/knowledge/reasoning.md +142 -0
- package/knowledge/search.md +131 -0
- package/knowledge/section-nav.md +162 -0
- package/knowledge/segmented-control.md +181 -0
- package/knowledge/select-button.md +205 -0
- package/knowledge/select.md +210 -0
- package/knowledge/separator.md +75 -0
- package/knowledge/shimmer-text.md +140 -0
- package/knowledge/sidebar.md +227 -0
- package/knowledge/skeleton.md +142 -0
- package/knowledge/slider.md +133 -0
- package/knowledge/slideshow.md +159 -0
- package/knowledge/source.md +156 -0
- package/knowledge/spinner.md +120 -0
- package/knowledge/stat-strip.md +128 -0
- package/knowledge/stats.md +117 -0
- package/knowledge/step-indicator.md +157 -0
- package/knowledge/switch.md +88 -0
- package/knowledge/table.md +190 -0
- package/knowledge/tabs.md +169 -0
- package/knowledge/testimonials.md +115 -0
- package/knowledge/text-link.md +192 -0
- package/knowledge/text.md +194 -0
- package/knowledge/thinking-bar.md +115 -0
- package/knowledge/thinking-steps.md +140 -0
- package/knowledge/toaster.md +127 -0
- package/knowledge/toggle.md +113 -0
- package/knowledge/tool-call-card.md +241 -0
- package/knowledge/tooltip.md +120 -0
- package/knowledge/top-nav.md +138 -0
- package/knowledge.json +19854 -0
- package/package.json +94 -4
- package/src/components/accordion.stories.tsx +46 -0
- package/src/components/accordion.tsx +74 -0
- package/src/components/activity-rings.stories.tsx +73 -0
- package/src/components/activity-rings.tsx +121 -0
- package/src/components/alert.stories.tsx +43 -0
- package/src/components/alert.tsx +132 -0
- package/src/components/answer-actions.stories.tsx +54 -0
- package/src/components/answer-actions.test.tsx +37 -0
- package/src/components/answer-actions.tsx +313 -0
- package/src/components/aspect-ratio.stories.tsx +32 -0
- package/src/components/aspect-ratio.tsx +5 -0
- package/src/components/avatar.stories.tsx +40 -0
- package/src/components/avatar.tsx +154 -0
- package/src/components/badge.stories.tsx +27 -0
- package/src/components/badge.tsx +63 -0
- package/src/components/bar-graph.stories.tsx +28 -0
- package/src/components/bar-graph.tsx +204 -0
- package/src/components/bento-grid.stories.tsx +23 -0
- package/src/components/bento-grid.tsx +67 -0
- package/src/components/blockquote.stories.tsx +28 -0
- package/src/components/blockquote.tsx +88 -0
- package/src/components/box-list.stories.tsx +25 -0
- package/src/components/box-list.tsx +108 -0
- package/src/components/bullet-list.stories.tsx +22 -0
- package/src/components/bullet-list.tsx +101 -0
- package/src/components/button-group.stories.tsx +31 -0
- package/src/components/button-group.tsx +156 -0
- package/src/components/button.stories.tsx +66 -0
- package/src/components/button.test.ts +17 -0
- package/src/components/button.tsx +139 -0
- package/src/components/calendar.stories.tsx +25 -0
- package/src/components/calendar.tsx +367 -0
- package/src/components/card.stories.tsx +44 -0
- package/src/components/card.tsx +392 -0
- package/src/components/cards-nav.stories.tsx +35 -0
- package/src/components/cards-nav.tsx +115 -0
- package/src/components/chain-of-thought.stories.tsx +67 -0
- package/src/components/chain-of-thought.test.tsx +50 -0
- package/src/components/chain-of-thought.tsx +170 -0
- package/src/components/chat-container.stories.tsx +47 -0
- package/src/components/chat-container.test.tsx +49 -0
- package/src/components/chat-container.tsx +222 -0
- package/src/components/chat-message.stories.tsx +52 -0
- package/src/components/chat-message.test.tsx +36 -0
- package/src/components/chat-message.tsx +163 -0
- package/src/components/checkbox-card.stories.tsx +27 -0
- package/src/components/checkbox-card.tsx +200 -0
- package/src/components/checkbox.stories.tsx +26 -0
- package/src/components/checkbox.tsx +61 -0
- package/src/components/citations.stories.tsx +64 -0
- package/src/components/citations.test.tsx +61 -0
- package/src/components/citations.tsx +220 -0
- package/src/components/combobox.stories.tsx +184 -0
- package/src/components/combobox.test.tsx +82 -0
- package/src/components/combobox.tsx +407 -0
- package/src/components/countdown-pill.stories.tsx +24 -0
- package/src/components/countdown-pill.tsx +129 -0
- package/src/components/cta.stories.tsx +29 -0
- package/src/components/cta.tsx +52 -0
- package/src/components/data-list.stories.tsx +50 -0
- package/src/components/data-list.test.tsx +35 -0
- package/src/components/data-list.tsx +181 -0
- package/src/components/data-table.stories.tsx +29 -0
- package/src/components/data-table.tsx +200 -0
- package/src/components/dialog.stories.tsx +42 -0
- package/src/components/dialog.tsx +200 -0
- package/src/components/drawer.stories.tsx +48 -0
- package/src/components/drawer.tsx +385 -0
- package/src/components/dropdown-menu.stories.tsx +41 -0
- package/src/components/dropdown-menu.tsx +252 -0
- package/src/components/dropzone.stories.tsx +19 -0
- package/src/components/dropzone.tsx +250 -0
- package/src/components/email-chips-input.stories.tsx +135 -0
- package/src/components/email-chips-input.tsx +210 -0
- package/src/components/empty-state.stories.tsx +22 -0
- package/src/components/empty-state.tsx +35 -0
- package/src/components/entity-header.stories.tsx +43 -0
- package/src/components/entity-header.test.tsx +35 -0
- package/src/components/entity-header.tsx +92 -0
- package/src/components/feature-grid.stories.tsx +25 -0
- package/src/components/feature-grid.tsx +87 -0
- package/src/components/feedback-bar.stories.tsx +25 -0
- package/src/components/feedback-bar.test.tsx +24 -0
- package/src/components/feedback-bar.tsx +62 -0
- package/src/components/footer.stories.tsx +23 -0
- package/src/components/footer.tsx +78 -0
- package/src/components/heading.stories.tsx +45 -0
- package/src/components/heading.test.tsx +22 -0
- package/src/components/heading.tsx +77 -0
- package/src/components/hero.stories.tsx +38 -0
- package/src/components/hero.tsx +498 -0
- package/src/components/input-button.stories.tsx +19 -0
- package/src/components/input-button.tsx +112 -0
- package/src/components/input-group.stories.tsx +38 -0
- package/src/components/input-group.tsx +157 -0
- package/src/components/input.stories.tsx +31 -0
- package/src/components/input.tsx +284 -0
- package/src/components/inset.stories.tsx +29 -0
- package/src/components/inset.tsx +70 -0
- package/src/components/kpi-card.stories.tsx +29 -0
- package/src/components/kpi-card.tsx +284 -0
- package/src/components/list-nav.stories.tsx +22 -0
- package/src/components/list-nav.tsx +145 -0
- package/src/components/logo-cloud.stories.tsx +23 -0
- package/src/components/logo-cloud.tsx +42 -0
- package/src/components/media-gallery.stories.tsx +25 -0
- package/src/components/media-gallery.tsx +347 -0
- package/src/components/message-actions.stories.tsx +45 -0
- package/src/components/message-actions.test.tsx +32 -0
- package/src/components/message-actions.tsx +119 -0
- package/src/components/nav-sidebar.stories.tsx +58 -0
- package/src/components/nav-sidebar.test.tsx +54 -0
- package/src/components/nav-sidebar.tsx +462 -0
- package/src/components/number-stepper.stories.tsx +19 -0
- package/src/components/number-stepper.tsx +158 -0
- package/src/components/page-header.stories.tsx +25 -0
- package/src/components/page-header.tsx +64 -0
- package/src/components/pagination.stories.tsx +110 -0
- package/src/components/pagination.test.tsx +46 -0
- package/src/components/pagination.tsx +144 -0
- package/src/components/popover.stories.tsx +26 -0
- package/src/components/popover.tsx +62 -0
- package/src/components/pricing.stories.tsx +42 -0
- package/src/components/pricing.tsx +130 -0
- package/src/components/progress.stories.tsx +22 -0
- package/src/components/progress.tsx +189 -0
- package/src/components/prompt-input.stories.tsx +62 -0
- package/src/components/prompt-input.test.tsx +106 -0
- package/src/components/prompt-input.tsx +343 -0
- package/src/components/prompt-suggestions.stories.tsx +53 -0
- package/src/components/prompt-suggestions.test.tsx +37 -0
- package/src/components/prompt-suggestions.tsx +122 -0
- package/src/components/quota-bar.stories.tsx +19 -0
- package/src/components/quota-bar.tsx +191 -0
- package/src/components/quote.stories.tsx +18 -0
- package/src/components/quote.tsx +43 -0
- package/src/components/radio-card.stories.tsx +27 -0
- package/src/components/radio-card.tsx +225 -0
- package/src/components/radio-group.stories.tsx +32 -0
- package/src/components/radio-group.tsx +68 -0
- package/src/components/reasoning.stories.tsx +50 -0
- package/src/components/reasoning.test.tsx +48 -0
- package/src/components/reasoning.tsx +143 -0
- package/src/components/search.stories.tsx +18 -0
- package/src/components/search.tsx +133 -0
- package/src/components/section-nav.stories.tsx +59 -0
- package/src/components/section-nav.test.tsx +36 -0
- package/src/components/section-nav.tsx +146 -0
- package/src/components/segmented-control.stories.tsx +22 -0
- package/src/components/segmented-control.tsx +301 -0
- package/src/components/select-button.stories.tsx +27 -0
- package/src/components/select-button.tsx +174 -0
- package/src/components/select.stories.tsx +27 -0
- package/src/components/select.tsx +198 -0
- package/src/components/separator.stories.tsx +22 -0
- package/src/components/separator.tsx +23 -0
- package/src/components/shimmer-text.stories.tsx +23 -0
- package/src/components/shimmer-text.test.tsx +35 -0
- package/src/components/shimmer-text.tsx +43 -0
- package/src/components/sidebar.stories.tsx +25 -0
- package/src/components/sidebar.tsx +234 -0
- package/src/components/skeleton.stories.tsx +22 -0
- package/src/components/skeleton.tsx +96 -0
- package/src/components/slider.stories.tsx +20 -0
- package/src/components/slider.tsx +176 -0
- package/src/components/slideshow.stories.tsx +30 -0
- package/src/components/slideshow.tsx +291 -0
- package/src/components/source.stories.tsx +32 -0
- package/src/components/source.test.tsx +40 -0
- package/src/components/source.tsx +161 -0
- package/src/components/spinner.stories.tsx +19 -0
- package/src/components/spinner.tsx +76 -0
- package/src/components/stat-strip.stories.tsx +36 -0
- package/src/components/stat-strip.test.tsx +25 -0
- package/src/components/stat-strip.tsx +85 -0
- package/src/components/stats.stories.tsx +24 -0
- package/src/components/stats.tsx +83 -0
- package/src/components/step-indicator.stories.tsx +18 -0
- package/src/components/step-indicator.test.tsx +18 -0
- package/src/components/step-indicator.tsx +286 -0
- package/src/components/switch.stories.tsx +26 -0
- package/src/components/switch.tsx +32 -0
- package/src/components/table.stories.tsx +38 -0
- package/src/components/table.tsx +220 -0
- package/src/components/tabs.stories.tsx +25 -0
- package/src/components/tabs.tsx +276 -0
- package/src/components/testimonials.stories.tsx +22 -0
- package/src/components/testimonials.tsx +109 -0
- package/src/components/text-link.stories.tsx +47 -0
- package/src/components/text-link.test.tsx +18 -0
- package/src/components/text-link.tsx +88 -0
- package/src/components/text.stories.tsx +49 -0
- package/src/components/text.tsx +105 -0
- package/src/components/thinking-bar.stories.tsx +19 -0
- package/src/components/thinking-bar.test.tsx +27 -0
- package/src/components/thinking-bar.tsx +64 -0
- package/src/components/thinking-steps.stories.tsx +44 -0
- package/src/components/thinking-steps.test.tsx +42 -0
- package/src/components/thinking-steps.tsx +92 -0
- package/src/components/toaster.stories.tsx +80 -0
- package/src/components/toaster.tsx +36 -0
- package/src/components/toggle.stories.tsx +21 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tool-call-card.stories.tsx +97 -0
- package/src/components/tool-call-card.test.tsx +88 -0
- package/src/components/tool-call-card.tsx +231 -0
- package/src/components/tooltip.stories.tsx +25 -0
- package/src/components/tooltip.tsx +43 -0
- package/src/components/top-nav.stories.tsx +20 -0
- package/src/components/top-nav.tsx +76 -0
- package/src/docs/Colors.stories.tsx +192 -0
- package/src/docs/GettingStarted.mdx +72 -0
- package/src/docs/Mcp.mdx +52 -0
- package/src/docs/Typography.stories.tsx +114 -0
- package/src/hooks/use-in-view.ts +32 -0
- package/src/hooks/use-reduced-motion.ts +26 -0
- package/src/index.ts +343 -0
- package/src/lib/cn.test.ts +67 -0
- package/src/lib/cn.ts +81 -0
- package/src/lib/motion.ts +109 -0
- package/src/lib/prefix-utilities.test.ts +56 -0
- package/src/lib/prefix-utilities.ts +50 -0
- package/src/styles/base.css +489 -0
- package/src/styles/motion.css +69 -0
- package/src/styles/overrides.css +44 -0
- package/src/styles/typography.css +173 -0
- package/src/theme/theme.css +391 -0
- package/src/theme/tokens.ts +29 -0
- package/src/theme/types.ts +26 -0
- 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)} />`.
|