@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,321 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: card
|
|
6
|
+
sourceFile: packages/design-system/src/components/card.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-core-primitives
|
|
9
|
+
categoryFromBarrel: web-app-core-primitives
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Card
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
- name: CardBanner
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<CardBannerProps & RefAttributes<HTMLDivElement>>"
|
|
19
|
+
- name: CardBannerProps
|
|
20
|
+
kind: type
|
|
21
|
+
- name: cardCn
|
|
22
|
+
kind: function
|
|
23
|
+
typeText: "(variant?: CardVariant, padding?: CardPadding, extra?: string | undefined) => string"
|
|
24
|
+
- name: CardContent
|
|
25
|
+
kind: component
|
|
26
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
27
|
+
- name: CardDescription
|
|
28
|
+
kind: component
|
|
29
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & RefAttributes<HTMLParagraphElement>>"
|
|
30
|
+
- name: CardElevation
|
|
31
|
+
kind: type
|
|
32
|
+
- name: CardFooter
|
|
33
|
+
kind: component
|
|
34
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
35
|
+
- name: CardGap
|
|
36
|
+
kind: type
|
|
37
|
+
- name: CardHeader
|
|
38
|
+
kind: component
|
|
39
|
+
typeText: "ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>"
|
|
40
|
+
- name: CardHeaderProps
|
|
41
|
+
kind: type
|
|
42
|
+
- name: CardHeaderSize
|
|
43
|
+
kind: type
|
|
44
|
+
- name: CardPadding
|
|
45
|
+
kind: type
|
|
46
|
+
- name: CardProps
|
|
47
|
+
kind: type
|
|
48
|
+
- name: CardTitle
|
|
49
|
+
kind: component
|
|
50
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & RefAttributes<HTMLHeadingElement>>"
|
|
51
|
+
- name: CardVariant
|
|
52
|
+
kind: type
|
|
53
|
+
primaryExport: Card
|
|
54
|
+
subcomponents:
|
|
55
|
+
- CardBanner
|
|
56
|
+
- CardContent
|
|
57
|
+
- CardDescription
|
|
58
|
+
- CardFooter
|
|
59
|
+
- CardHeader
|
|
60
|
+
- CardTitle
|
|
61
|
+
props:
|
|
62
|
+
Card:
|
|
63
|
+
- name: borderless
|
|
64
|
+
type: boolean
|
|
65
|
+
required: false
|
|
66
|
+
declaredIn: self
|
|
67
|
+
doc: "When true, removes the border and shadow from the card."
|
|
68
|
+
- name: elevation
|
|
69
|
+
type: CardElevation
|
|
70
|
+
required: false
|
|
71
|
+
declaredIn: self
|
|
72
|
+
doc: "Surface elevation - bundles a background fill with a shadow into one level, overriding the variant's own background and shadow (the variant's border, if any, is kept). Reads the brand-themeable --elevation-* tokens. level0 - transparent, flat level1 - translucent surface (50%), flat level2 - solid surface + subtle shadow level3 - solid surface + stronger shadow Left unset, the card keeps its variant's default (brand-themeable) chrome."
|
|
73
|
+
- name: gap
|
|
74
|
+
type: CardGap
|
|
75
|
+
required: false
|
|
76
|
+
declaredIn: self
|
|
77
|
+
doc: "When set, makes the card a vertical flex column with the given gap between children. sm=12px md=16px lg=20px xl=24px"
|
|
78
|
+
- name: hoverEffect
|
|
79
|
+
type: "\"lift\" | \"scale\""
|
|
80
|
+
required: false
|
|
81
|
+
declaredIn: self
|
|
82
|
+
doc: "Hover animation style when `interactive` is true. \"scale\" (default) - a light zoom (1.03×) that raises the shadow one level · \"lift\" - translates up 4px"
|
|
83
|
+
- name: interactive
|
|
84
|
+
type: boolean
|
|
85
|
+
required: false
|
|
86
|
+
declaredIn: self
|
|
87
|
+
doc: "When true, the card zooms subtly on hover. Disabled by reduced-motion preference."
|
|
88
|
+
- name: padding
|
|
89
|
+
type: CardPadding
|
|
90
|
+
required: false
|
|
91
|
+
declaredIn: self
|
|
92
|
+
doc: "Padding inside the card. All responsive variants scale from their mobile floor up to the named size at XL (1280px+), one step per breakpoint. Fixed: none · sm(12px) · md(16px) Responsive: lg(→20px) · xl(→24px) · 2xl(→32px) · 3xl(→40px) · 4xl(→48px)"
|
|
93
|
+
- name: sectioned
|
|
94
|
+
type: boolean
|
|
95
|
+
required: false
|
|
96
|
+
declaredIn: self
|
|
97
|
+
doc: "Split the card into a muted header band with a content section beneath it. The card's own padding is dropped and each sub-component (CardHeader / CardContent / CardFooter) supplies its own padding instead; the header runs full-bleed with `bg-muted` + a bottom divider, its top corners rounded by the card's own radius."
|
|
98
|
+
- name: variant
|
|
99
|
+
type: CardVariant
|
|
100
|
+
required: false
|
|
101
|
+
declaredIn: self
|
|
102
|
+
doc: "Visual treatment of the card surface."
|
|
103
|
+
CardBanner:
|
|
104
|
+
- name: size
|
|
105
|
+
type: CardHeaderSize
|
|
106
|
+
required: false
|
|
107
|
+
declaredIn: self
|
|
108
|
+
doc: "Sizes the band - its padding and the nested CardTitle / CardDescription type tokens (and the matching CardContent/CardFooter padding). xs=t-h6 · sm=t-h5 · md=t-h4 · lg=t-h3 (default) · xl=t-h2."
|
|
109
|
+
CardHeader:
|
|
110
|
+
- name: size
|
|
111
|
+
type: CardHeaderSize
|
|
112
|
+
required: false
|
|
113
|
+
declaredIn: self
|
|
114
|
+
doc: "Sizes the header - its bottom padding and the nested CardTitle / CardDescription type tokens. xs=t-h6 · sm=t-h5 · md=t-h4 · lg=t-h3 (default) · xl=t-h2. Leave unset to keep the legacy defaults (t-h3 / t-body-sm)."
|
|
115
|
+
extendsProps:
|
|
116
|
+
- "React.HTMLAttributes<HTMLDivElement>"
|
|
117
|
+
variants:
|
|
118
|
+
variant:
|
|
119
|
+
kind: enum
|
|
120
|
+
options:
|
|
121
|
+
- default
|
|
122
|
+
- ghost
|
|
123
|
+
- surface
|
|
124
|
+
default: default
|
|
125
|
+
on: Card
|
|
126
|
+
padding:
|
|
127
|
+
kind: enum
|
|
128
|
+
options:
|
|
129
|
+
- none
|
|
130
|
+
- sm
|
|
131
|
+
- md
|
|
132
|
+
- lg
|
|
133
|
+
- xl
|
|
134
|
+
- "2xl"
|
|
135
|
+
- "3xl"
|
|
136
|
+
- "4xl"
|
|
137
|
+
default: xl
|
|
138
|
+
on: Card
|
|
139
|
+
gap:
|
|
140
|
+
kind: enum
|
|
141
|
+
options:
|
|
142
|
+
- sm
|
|
143
|
+
- md
|
|
144
|
+
- lg
|
|
145
|
+
- xl
|
|
146
|
+
default: null
|
|
147
|
+
on: Card
|
|
148
|
+
elevation:
|
|
149
|
+
kind: enum
|
|
150
|
+
options:
|
|
151
|
+
- none
|
|
152
|
+
- sm
|
|
153
|
+
- xs
|
|
154
|
+
- level0
|
|
155
|
+
- level1
|
|
156
|
+
- level2
|
|
157
|
+
- level3
|
|
158
|
+
default: null
|
|
159
|
+
on: Card
|
|
160
|
+
hoverEffect:
|
|
161
|
+
kind: enum
|
|
162
|
+
options:
|
|
163
|
+
- lift
|
|
164
|
+
- scale
|
|
165
|
+
default: scale
|
|
166
|
+
on: Card
|
|
167
|
+
size:
|
|
168
|
+
kind: enum
|
|
169
|
+
options:
|
|
170
|
+
- sm
|
|
171
|
+
- md
|
|
172
|
+
- xs
|
|
173
|
+
- lg
|
|
174
|
+
- xl
|
|
175
|
+
default: lg
|
|
176
|
+
on: CardBanner
|
|
177
|
+
variantSource: prop-union
|
|
178
|
+
compoundVariants: []
|
|
179
|
+
sizeMaps:
|
|
180
|
+
- CARD_ELEVATION
|
|
181
|
+
- CARD_GAP
|
|
182
|
+
- CARD_PADDING
|
|
183
|
+
- CARD_VARIANT
|
|
184
|
+
- CARD_VARIANT_BORDER
|
|
185
|
+
- HEADER_DESC
|
|
186
|
+
- HEADER_PADDING
|
|
187
|
+
- HEADER_PADDING_BOTTOM
|
|
188
|
+
- HEADER_TITLE
|
|
189
|
+
- INSET_STYLE
|
|
190
|
+
- SECTION_PADDING
|
|
191
|
+
dataSlots: []
|
|
192
|
+
dependsOn:
|
|
193
|
+
internal: []
|
|
194
|
+
lib:
|
|
195
|
+
- cn
|
|
196
|
+
- motion
|
|
197
|
+
hooks:
|
|
198
|
+
- use-reduced-motion
|
|
199
|
+
external:
|
|
200
|
+
- motion/react
|
|
201
|
+
- react
|
|
202
|
+
contexts:
|
|
203
|
+
- name: CardSectionContext
|
|
204
|
+
type: CardSectionContextValue
|
|
205
|
+
default: null
|
|
206
|
+
- name: CardHeaderTypeContext
|
|
207
|
+
type: CardHeaderType
|
|
208
|
+
default: null
|
|
209
|
+
stories:
|
|
210
|
+
- exportName: Default
|
|
211
|
+
id: components-card--default
|
|
212
|
+
- exportName: Sectioned
|
|
213
|
+
id: components-card--sectioned
|
|
214
|
+
storybookTitle: Components/Card
|
|
215
|
+
docsId: components-card--documentation
|
|
216
|
+
argTypeOptions: {}
|
|
217
|
+
resolvedCleanly: true
|
|
218
|
+
contractHash: "1f3bd733ecba"
|
|
219
|
+
factsHash: f2c41c7738d2
|
|
220
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
221
|
+
status: stable
|
|
222
|
+
summary: "The general-purpose surface container: a bordered or elevated box with optional header, content, and footer sections."
|
|
223
|
+
useWhen:
|
|
224
|
+
- "grouping related content into a discrete, bordered surface - a list item, a dashboard tile, a settings row"
|
|
225
|
+
- "building a structured content block with a title, body, and an optional footer action (CardHeader/CardContent/CardFooter)"
|
|
226
|
+
- "the card itself should react to hover as a clickable unit (interactive)"
|
|
227
|
+
useInstead:
|
|
228
|
+
- id: dialog
|
|
229
|
+
when: "the content should interrupt the page as a focused, blocking task rather than sit inline"
|
|
230
|
+
related:
|
|
231
|
+
- inset
|
|
232
|
+
composesWith:
|
|
233
|
+
- button
|
|
234
|
+
- badge
|
|
235
|
+
tokens:
|
|
236
|
+
- "--card"
|
|
237
|
+
- "--card-foreground"
|
|
238
|
+
- "--card-border-color"
|
|
239
|
+
- "--card-shadow"
|
|
240
|
+
- "--border"
|
|
241
|
+
- "--elevation-0-surface"
|
|
242
|
+
- "--elevation-1-surface"
|
|
243
|
+
- "--elevation-2-surface"
|
|
244
|
+
- "--elevation-3-surface"
|
|
245
|
+
a11y:
|
|
246
|
+
notes:
|
|
247
|
+
- "Card renders a plain div (or motion.div when interactive) with no implicit role - if it is genuinely clickable, wrap the surface in a real button or link, or add your own role and keyboard handler. interactive only adds a hover animation, not semantics or a click handler."
|
|
248
|
+
- "interactive is automatically disabled under the OS reduced-motion preference, but the card still needs its own real click affordance regardless of that preference."
|
|
249
|
+
keyboard:
|
|
250
|
+
- "No built-in keyboard handling - interactive is purely a hover/motion effect, not a focusable control."
|
|
251
|
+
radixHandles: false
|
|
252
|
+
pitfalls:
|
|
253
|
+
- "elevation overrides the variant's background and shadow entirely, keeping only its border - setting both variant=\"surface\" and elevation=\"level2\" does not blend; elevation always wins for surface and shadow."
|
|
254
|
+
- "sectioned drops the card's own padding and hands it to CardHeader/CardBanner/CardContent/CardFooter instead - adding padding via className on the Card root under sectioned does nothing, since the padding class is stripped."
|
|
255
|
+
- "gap only affects Card's own direct children and does nothing when sectioned, since sectioned switches Card to a plain flex column without the gap utility."
|
|
256
|
+
- "hoverEffect is read even when interactive is false, but has no visible effect until interactive is true - setting it alone does nothing."
|
|
257
|
+
canonicalSnippet: |
|
|
258
|
+
import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@adres/mgda-ui"
|
|
259
|
+
|
|
260
|
+
<Card className="ax:max-w-sm">
|
|
261
|
+
<CardHeader>
|
|
262
|
+
<CardTitle>Project overview</CardTitle>
|
|
263
|
+
<CardDescription>Track progress across your team.</CardDescription>
|
|
264
|
+
</CardHeader>
|
|
265
|
+
<CardContent>
|
|
266
|
+
<p>12 tasks completed this week.</p>
|
|
267
|
+
</CardContent>
|
|
268
|
+
<CardFooter>
|
|
269
|
+
<Button size="sm">View details</Button>
|
|
270
|
+
</CardFooter>
|
|
271
|
+
</Card>
|
|
272
|
+
reviewedAt: 2026-08-31
|
|
273
|
+
reviewedAgainstContractHash: "1f3bd733ecba"
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Usage
|
|
277
|
+
|
|
278
|
+
`Card` is the default surface for grouping related content - `variant` picks
|
|
279
|
+
the chrome (`default` bordered-with-shadow, `surface` a flatter bordered
|
|
280
|
+
background, `ghost` no chrome at all), and `padding` scales the interior
|
|
281
|
+
space, most sizes growing responsively up to a fixed value at the `xl`
|
|
282
|
+
breakpoint.
|
|
283
|
+
|
|
284
|
+
Reach for `elevation` instead of `variant` when the surface needs to read as
|
|
285
|
+
sitting at a specific depth (a popover-like tile, a raised dashboard card) -
|
|
286
|
+
it bundles a background and shadow into one brand-themeable level and takes
|
|
287
|
+
over from the variant's own background/shadow.
|
|
288
|
+
|
|
289
|
+
Set `interactive` when the whole card is a single clickable unit (e.g. it
|
|
290
|
+
navigates on click) - it adds a subtle hover animation (`hoverEffect="scale"`
|
|
291
|
+
by default, or `"lift"`), automatically disabled under reduced-motion. It does
|
|
292
|
+
not add any semantics or a click handler by itself.
|
|
293
|
+
|
|
294
|
+
Set `sectioned` to split the card into a full-bleed header band
|
|
295
|
+
(`CardHeader` or `CardBanner`) and separately-padded `CardContent`/
|
|
296
|
+
`CardFooter` sections - use this when the header needs a different background
|
|
297
|
+
than the body, rather than the default single-padding-box layout.
|
|
298
|
+
|
|
299
|
+
### Sizes and structure
|
|
300
|
+
|
|
301
|
+
`CardHeader`'s and `CardBanner`'s `size` prop scales their own padding and the
|
|
302
|
+
type of a nested `CardTitle`/`CardDescription` together, so pick a `size` once
|
|
303
|
+
per header rather than styling the title text directly.
|
|
304
|
+
|
|
305
|
+
## Anatomy
|
|
306
|
+
|
|
307
|
+
`Card` is a compound component: the root plus six section parts.
|
|
308
|
+
|
|
309
|
+
| Part | Role |
|
|
310
|
+
| --- | --- |
|
|
311
|
+
| `Card` | The surface. Owns `variant`, `padding`, `gap`, `elevation`, `interactive`, and `sectioned`. |
|
|
312
|
+
| `CardHeader` | The default header: title + description stacked, with bottom padding before the content. Use inside a non-`sectioned` card, or a `sectioned` one that doesn't need a distinct band background. |
|
|
313
|
+
| `CardBanner` | The full-bleed, muted header band for a `sectioned` card. Its `size` drives the matching `CardContent`/`CardFooter` padding. |
|
|
314
|
+
| `CardTitle` | An `h3` by default; its type scale comes from the nearest `CardHeader`/`CardBanner`'s `size` via context. |
|
|
315
|
+
| `CardDescription` | Supporting text; same context-driven type scale as `CardTitle`. |
|
|
316
|
+
| `CardContent` | The body. Picks up section padding automatically when the card is `sectioned`. |
|
|
317
|
+
| `CardFooter` | The action row. Divided from the content with a top border when `sectioned`. |
|
|
318
|
+
|
|
319
|
+
`CardHeaderTypeContext` and `CardSectionContext` are why `CardTitle` and
|
|
320
|
+
`CardContent` never need their own `size`/padding props - both read them from
|
|
321
|
+
the nearest header ancestor.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: cards-nav
|
|
6
|
+
sourceFile: packages/design-system/src/components/cards-nav.tsx
|
|
7
|
+
client: false
|
|
8
|
+
category: web-app-layout-navigation
|
|
9
|
+
categoryFromBarrel: web-app-layout-navigation
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: CardsNav
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "({ items, as, size, textSize, overline, newTab, className }: CardsNavProps) => Element"
|
|
16
|
+
- name: CardsNavItem
|
|
17
|
+
kind: type
|
|
18
|
+
- name: CardsNavProps
|
|
19
|
+
kind: type
|
|
20
|
+
- name: CardsNavSize
|
|
21
|
+
kind: type
|
|
22
|
+
primaryExport: CardsNav
|
|
23
|
+
subcomponents: []
|
|
24
|
+
props:
|
|
25
|
+
CardsNav:
|
|
26
|
+
- name: as
|
|
27
|
+
type: "ElementType<any, keyof IntrinsicElements>"
|
|
28
|
+
required: false
|
|
29
|
+
declaredIn: self
|
|
30
|
+
doc: "Element rendered for each card. Default `\"a\"`; pass a router `Link` (e.g. Next.js) for client-side navigation."
|
|
31
|
+
- name: className
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
declaredIn: self
|
|
35
|
+
doc: "Extra classes applied to each card."
|
|
36
|
+
- name: items
|
|
37
|
+
type: "CardsNavItem[]"
|
|
38
|
+
required: true
|
|
39
|
+
declaredIn: self
|
|
40
|
+
- name: newTab
|
|
41
|
+
type: boolean
|
|
42
|
+
required: false
|
|
43
|
+
declaredIn: self
|
|
44
|
+
doc: "Open links in a new tab (adds `target=\"_blank\"` + safe `rel`). Use for external destinations. Default false."
|
|
45
|
+
- name: overline
|
|
46
|
+
type: boolean
|
|
47
|
+
required: false
|
|
48
|
+
declaredIn: self
|
|
49
|
+
doc: "Show the top overline row - a per-item `overline` or, failing that, a two-digit ordinal. Default false."
|
|
50
|
+
- name: size
|
|
51
|
+
type: CardsNavSize
|
|
52
|
+
required: false
|
|
53
|
+
declaredIn: self
|
|
54
|
+
doc: "Card padding. Default \"md\"."
|
|
55
|
+
- name: textSize
|
|
56
|
+
type: CardsNavSize
|
|
57
|
+
required: false
|
|
58
|
+
declaredIn: self
|
|
59
|
+
doc: "Title + description type scale. Default \"md\"."
|
|
60
|
+
extendsProps: []
|
|
61
|
+
variants:
|
|
62
|
+
size:
|
|
63
|
+
kind: enum
|
|
64
|
+
options:
|
|
65
|
+
- sm
|
|
66
|
+
- md
|
|
67
|
+
- lg
|
|
68
|
+
default: md
|
|
69
|
+
on: CardsNav
|
|
70
|
+
textSize:
|
|
71
|
+
kind: enum
|
|
72
|
+
options:
|
|
73
|
+
- sm
|
|
74
|
+
- md
|
|
75
|
+
- lg
|
|
76
|
+
default: md
|
|
77
|
+
on: CardsNav
|
|
78
|
+
variantSource: prop-union
|
|
79
|
+
compoundVariants: []
|
|
80
|
+
sizeMaps:
|
|
81
|
+
- SIZE
|
|
82
|
+
- TEXT
|
|
83
|
+
dataSlots: []
|
|
84
|
+
dependsOn:
|
|
85
|
+
internal: []
|
|
86
|
+
lib:
|
|
87
|
+
- cn
|
|
88
|
+
hooks: []
|
|
89
|
+
external:
|
|
90
|
+
- lucide-react
|
|
91
|
+
- react
|
|
92
|
+
contexts: []
|
|
93
|
+
stories:
|
|
94
|
+
- exportName: Default
|
|
95
|
+
id: components-cardsnav--default
|
|
96
|
+
- exportName: WithOverline
|
|
97
|
+
id: components-cardsnav--with-overline
|
|
98
|
+
storybookTitle: Components/CardsNav
|
|
99
|
+
docsId: components-cardsnav--documentation
|
|
100
|
+
argTypeOptions: {}
|
|
101
|
+
resolvedCleanly: true
|
|
102
|
+
contractHash: "250c6ed200bc"
|
|
103
|
+
factsHash: "1dd2c9e70be1"
|
|
104
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
105
|
+
status: stable
|
|
106
|
+
summary: "A set of navigational cards - title, optional description, hover arrow - for a small set of prominent destinations."
|
|
107
|
+
useWhen:
|
|
108
|
+
- "a handful of top-level destinations that deserve a bigger, more prominent target than a list row (e.g. a docs landing page's sections)"
|
|
109
|
+
- "each destination benefits from a short supporting description, not just a label"
|
|
110
|
+
- "a numbered/eyebrow'd set of steps or categories (turn on overline)"
|
|
111
|
+
useInstead:
|
|
112
|
+
- id: list-nav
|
|
113
|
+
when: "the destinations are numerous or dense - a compact row list reads better than a grid of cards"
|
|
114
|
+
- id: kpi-card
|
|
115
|
+
when: "the cards report a metric rather than link somewhere"
|
|
116
|
+
related:
|
|
117
|
+
- list-nav
|
|
118
|
+
- sidebar
|
|
119
|
+
composesWith: []
|
|
120
|
+
tokens:
|
|
121
|
+
- "--border"
|
|
122
|
+
- "--card"
|
|
123
|
+
- "--primary"
|
|
124
|
+
- "--primary-foreground"
|
|
125
|
+
- "--muted-foreground"
|
|
126
|
+
- "--neutral-weaker"
|
|
127
|
+
a11y:
|
|
128
|
+
notes:
|
|
129
|
+
- "CardsNav is a server component (no \"use client\") - it renders a fragment of plain anchors with no client-side state, so it drops into a server component tree with no extra opt-in."
|
|
130
|
+
- "Renders no wrapping element - place the returned cards inside your own grid or flex container so focus order follows your intended reading order, not the array order alone."
|
|
131
|
+
- "The trailing arrow icon is aria-hidden implicitly (decorative), so the accessible name of each card comes entirely from title (and description is not read as part of the link name)."
|
|
132
|
+
requiredProps:
|
|
133
|
+
- "each item needs title and href; description, overline, and accent are optional"
|
|
134
|
+
keyboard:
|
|
135
|
+
- "Renders a real <a> (or the element passed via as) per item, so it's reachable and activatable via native link semantics with no extra wiring."
|
|
136
|
+
radixHandles: false
|
|
137
|
+
pitfalls:
|
|
138
|
+
- "CardsNav renders a fragment, not a grid - forgetting to wrap it in a grid/flex container with your own gap and column count leaves the cards stacked with no layout at all."
|
|
139
|
+
- "overline falls back to a zero-padded index (01, 02, ...) only when the prop is true and an item's own overline is unset - leaving overline off entirely means per-item overline/accent are silently unused."
|
|
140
|
+
- "accent only tints the overline text color - it has no effect when overline is false, since the overline row isn't rendered at all."
|
|
141
|
+
rtl: "The trailing arrow has an explicit rtl:-scale-x-100 to point the correct direction; the rest of the layout uses flex with gap, which mirrors automatically."
|
|
142
|
+
canonicalSnippet: |
|
|
143
|
+
import { CardsNav, type CardsNavItem } from "@adres/mgda-ui"
|
|
144
|
+
|
|
145
|
+
const sections: CardsNavItem[] = [
|
|
146
|
+
{ title: "Getting started", description: "Install and configure the SDK.", href: "/docs/start" },
|
|
147
|
+
{ title: "Components", description: "Browse the full component library.", href: "/docs/components" },
|
|
148
|
+
{ title: "Theming", description: "Customize tokens for your brand.", href: "/docs/theming" },
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
<div className="ax:grid ax:grid-cols-1 ax:gap-md ax:sm:grid-cols-3">
|
|
152
|
+
<CardsNav overline items={sections} />
|
|
153
|
+
</div>
|
|
154
|
+
reviewedAt: 2026-08-31
|
|
155
|
+
reviewedAgainstContractHash: "250c6ed200bc"
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Usage
|
|
159
|
+
|
|
160
|
+
CardsNav renders a set of navigational cards from a plain `items` array -
|
|
161
|
+
title, optional description, and a trailing arrow that leans toward the
|
|
162
|
+
inline-end on hover. It deliberately renders no wrapper element (just a
|
|
163
|
+
fragment), so the grid or flex layout - column count, gap, responsive
|
|
164
|
+
breakpoints - stays entirely with the consumer.
|
|
165
|
+
|
|
166
|
+
Turn on `overline` to show a numbered or per-item eyebrow line above the
|
|
167
|
+
title, useful for a "01 / 02 / 03" step or category feel; per-item `accent`
|
|
168
|
+
tints just that overline color. Pass `as={Link}` (or any router link
|
|
169
|
+
component) instead of the default `<a>` for client-side navigation, and
|
|
170
|
+
`newTab` when a destination is external.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: chain-of-thought
|
|
6
|
+
sourceFile: packages/design-system/src/components/chain-of-thought.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: ChainOfThought
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<ChainOfThoughtProps & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
- name: ChainOfThoughtContent
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<ChainOfThoughtContentProps & RefAttributes<HTMLDivElement>>"
|
|
19
|
+
- name: ChainOfThoughtContentProps
|
|
20
|
+
kind: type
|
|
21
|
+
- name: ChainOfThoughtItem
|
|
22
|
+
kind: component
|
|
23
|
+
typeText: "ForwardRefExoticComponent<ChainOfThoughtItemProps & RefAttributes<HTMLDivElement>>"
|
|
24
|
+
- name: ChainOfThoughtItemProps
|
|
25
|
+
kind: type
|
|
26
|
+
- name: ChainOfThoughtProps
|
|
27
|
+
kind: type
|
|
28
|
+
- name: ChainOfThoughtStep
|
|
29
|
+
kind: component
|
|
30
|
+
typeText: "ForwardRefExoticComponent<ChainOfThoughtStepProps & RefAttributes<HTMLDivElement>>"
|
|
31
|
+
- name: ChainOfThoughtStepProps
|
|
32
|
+
kind: type
|
|
33
|
+
- name: ChainOfThoughtTrigger
|
|
34
|
+
kind: component
|
|
35
|
+
typeText: "ForwardRefExoticComponent<ChainOfThoughtTriggerProps & RefAttributes<HTMLButtonElement>>"
|
|
36
|
+
- name: ChainOfThoughtTriggerProps
|
|
37
|
+
kind: type
|
|
38
|
+
primaryExport: ChainOfThought
|
|
39
|
+
subcomponents:
|
|
40
|
+
- ChainOfThoughtContent
|
|
41
|
+
- ChainOfThoughtItem
|
|
42
|
+
- ChainOfThoughtStep
|
|
43
|
+
- ChainOfThoughtTrigger
|
|
44
|
+
props:
|
|
45
|
+
ChainOfThoughtStep:
|
|
46
|
+
- name: defaultOpen
|
|
47
|
+
type: boolean
|
|
48
|
+
required: false
|
|
49
|
+
declaredIn: self
|
|
50
|
+
- name: onOpenChange
|
|
51
|
+
type: "((open: boolean) => void)"
|
|
52
|
+
required: false
|
|
53
|
+
declaredIn: self
|
|
54
|
+
- name: open
|
|
55
|
+
type: boolean
|
|
56
|
+
required: false
|
|
57
|
+
declaredIn: self
|
|
58
|
+
ChainOfThoughtTrigger:
|
|
59
|
+
- name: icon
|
|
60
|
+
type: ReactNode
|
|
61
|
+
required: false
|
|
62
|
+
declaredIn: self
|
|
63
|
+
doc: "Replaces the default dot. Swaps to a chevron on hover and focus unless `swapIconOnHover` is false."
|
|
64
|
+
- name: swapIconOnHover
|
|
65
|
+
type: boolean
|
|
66
|
+
required: false
|
|
67
|
+
declaredIn: self
|
|
68
|
+
extendsProps: []
|
|
69
|
+
variants: {}
|
|
70
|
+
variantSource: none
|
|
71
|
+
compoundVariants: []
|
|
72
|
+
sizeMaps: []
|
|
73
|
+
dataSlots:
|
|
74
|
+
- chain-of-thought
|
|
75
|
+
- chain-of-thought-content
|
|
76
|
+
- chain-of-thought-item
|
|
77
|
+
- chain-of-thought-step
|
|
78
|
+
dependsOn:
|
|
79
|
+
internal: []
|
|
80
|
+
lib:
|
|
81
|
+
- cn
|
|
82
|
+
hooks: []
|
|
83
|
+
external:
|
|
84
|
+
- lucide-react
|
|
85
|
+
- react
|
|
86
|
+
contexts:
|
|
87
|
+
- name: StepContext
|
|
88
|
+
type: StepContextValue
|
|
89
|
+
default: null
|
|
90
|
+
stories:
|
|
91
|
+
- exportName: Basic
|
|
92
|
+
id: components-chainofthought--basic
|
|
93
|
+
- exportName: WithIcons
|
|
94
|
+
id: components-chainofthought--with-icons
|
|
95
|
+
storybookTitle: Components/ChainOfThought
|
|
96
|
+
docsId: components-chainofthought--documentation
|
|
97
|
+
argTypeOptions: {}
|
|
98
|
+
resolvedCleanly: true
|
|
99
|
+
contractHash: a5581b2b9569
|
|
100
|
+
factsHash: "06ef4463d8b2"
|
|
101
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
102
|
+
status: beta
|
|
103
|
+
summary: "The reasoning behind an assistant answer as a vertical chain of collapsible steps, joined by a thin rule, each expanding to its detail."
|
|
104
|
+
useWhen:
|
|
105
|
+
- "an assistant answer should show how it got there, step by step, with detail behind each step"
|
|
106
|
+
- "each reasoning step has findings, sources or notes worth reading on demand"
|
|
107
|
+
useInstead:
|
|
108
|
+
- id: thinking-steps
|
|
109
|
+
when: "only live progress matters: a running summary over a flat list of step labels"
|
|
110
|
+
- id: accordion
|
|
111
|
+
when: "the sections are content, not the steps of a line of reasoning"
|
|
112
|
+
related:
|
|
113
|
+
- chat-message
|
|
114
|
+
- citations
|
|
115
|
+
a11y:
|
|
116
|
+
notes:
|
|
117
|
+
- "Each trigger is a button with aria-expanded and aria-controls, so a step toggles with Enter or Space."
|
|
118
|
+
- "The dot, icon, chevron and connecting rules are decorative and aria-hidden; the trigger text names the step."
|
|
119
|
+
- "With an icon, the chevron appears on hover and on keyboard focus, so the expand cue is never mouse-only."
|
|
120
|
+
radixHandles: false
|
|
121
|
+
pitfalls:
|
|
122
|
+
- "ChainOfThoughtTrigger and ChainOfThoughtContent must sit inside a ChainOfThoughtStep; they throw otherwise."
|
|
123
|
+
- "Content renders only while open, so do not rely on it being in the DOM for search or anchors."
|
|
124
|
+
- "Keep each trigger to one line naming the step; put findings in ChainOfThoughtItem, not the trigger."
|
|
125
|
+
canonicalSnippet: |
|
|
126
|
+
import {
|
|
127
|
+
ChainOfThought, ChainOfThoughtStep, ChainOfThoughtTrigger,
|
|
128
|
+
ChainOfThoughtContent, ChainOfThoughtItem,
|
|
129
|
+
} from "@adres/mgda-ui"
|
|
130
|
+
import { Search } from "lucide-react"
|
|
131
|
+
|
|
132
|
+
<ChainOfThought>
|
|
133
|
+
<ChainOfThoughtStep>
|
|
134
|
+
<ChainOfThoughtTrigger icon={<Search />}>Searched 128 listings</ChainOfThoughtTrigger>
|
|
135
|
+
<ChainOfThoughtContent>
|
|
136
|
+
<ChainOfThoughtItem>42 townhouses under AED 5M, 11 with a garden.</ChainOfThoughtItem>
|
|
137
|
+
</ChainOfThoughtContent>
|
|
138
|
+
</ChainOfThoughtStep>
|
|
139
|
+
</ChainOfThought>
|
|
140
|
+
reviewedAt: 2026-10-06
|
|
141
|
+
reviewedAgainstContractHash: a5581b2b9569
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Usage
|
|
145
|
+
|
|
146
|
+
`ChainOfThought` lays out the reasoning behind an answer as a vertical chain.
|
|
147
|
+
Each `ChainOfThoughtStep` has a one-line `ChainOfThoughtTrigger` and a
|
|
148
|
+
`ChainOfThoughtContent` that expands below it, holding `ChainOfThoughtItem`
|
|
149
|
+
lines of detail. A thin rule joins each step to the next and runs beside open
|
|
150
|
+
content; the last step ends the rule.
|
|
151
|
+
|
|
152
|
+
Steps start closed. Pass `defaultOpen` to start one open, or control it with
|
|
153
|
+
`open` and `onOpenChange`. The trigger shows a dot and a trailing chevron by
|
|
154
|
+
default. Pass `icon` to replace the dot; the icon then swaps to a chevron on
|
|
155
|
+
hover and focus, and `swapIconOnHover={false}` keeps the icon with a trailing
|
|
156
|
+
chevron instead.
|
|
157
|
+
|
|
158
|
+
## Anatomy
|
|
159
|
+
|
|
160
|
+
- `ChainOfThought` - the vertical chain of steps.
|
|
161
|
+
- `ChainOfThoughtStep` - one step; holds the open state and the rule to the next step.
|
|
162
|
+
- `ChainOfThoughtTrigger` - the one-line label with a dot or icon; toggles the step.
|
|
163
|
+
- `ChainOfThoughtContent` - the step's detail beside the continuing rule; rendered only while open.
|
|
164
|
+
- `ChainOfThoughtItem` - one muted line of detail.
|