@adres/mgda-ui 0.0.0-stage → 0.0.2

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,231 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: button
6
+ sourceFile: packages/design-system/src/components/button.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: Button
14
+ kind: component
15
+ typeText: "ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>"
16
+ - name: ButtonProps
17
+ kind: type
18
+ - name: buttonVariants
19
+ kind: variants
20
+ typeText: "TVReturnType<{ variant: { primary: string[]; secondary: string[]; outline: string[]; ghost: string[]; destructive: string[]; accent: string[]; }; size: { sm: \"ax:h-2xl ax:px-sm ax:rounded-(--button-radius) ax:text-sm\"; ....[truncated]"
21
+ primaryExport: Button
22
+ subcomponents: []
23
+ props:
24
+ Button:
25
+ - name: asChild
26
+ type: boolean
27
+ required: false
28
+ declaredIn: self
29
+ doc: "When true, renders the child element instead of a button (e.g. for `<Link>`)."
30
+ - name: aurora
31
+ type: boolean
32
+ required: false
33
+ declaredIn: self
34
+ doc: "Decorative \"aurora\" - two soft, blurred orbs (primary + accent) drifting behind the label for a modern, glowing look. Designed for the `primary` variant. Ignored with `asChild` (it needs to inject its own children)."
35
+ - name: elevated
36
+ type: boolean
37
+ required: false
38
+ declaredIn: self
39
+ variantKey: true
40
+ - name: size
41
+ type: "\"icon\" | \"icon-lg\" | \"icon-sm\" | \"lg\" | \"md\" | \"sm\""
42
+ required: false
43
+ declaredIn: self
44
+ variantKey: true
45
+ - name: variant
46
+ type: "\"accent\" | \"destructive\" | \"ghost\" | \"outline\" | \"primary\" | \"secondary\""
47
+ required: false
48
+ declaredIn: self
49
+ variantKey: true
50
+ extendsProps:
51
+ - "React.ButtonHTMLAttributes<HTMLButtonElement>"
52
+ - "VariantProps<typeof buttonVariants>"
53
+ variants:
54
+ variant:
55
+ kind: enum
56
+ options:
57
+ - primary
58
+ - secondary
59
+ - outline
60
+ - ghost
61
+ - destructive
62
+ - accent
63
+ default: primary
64
+ on: Button
65
+ size:
66
+ kind: enum
67
+ options:
68
+ - sm
69
+ - md
70
+ - lg
71
+ - icon-sm
72
+ - icon
73
+ - icon-lg
74
+ default: md
75
+ on: Button
76
+ elevated:
77
+ kind: boolean
78
+ default: false
79
+ on: Button
80
+ variantSource: tv
81
+ compoundVariants:
82
+ - variant: primary
83
+ elevated: true
84
+ - variant: destructive
85
+ elevated: true
86
+ sizeMaps: []
87
+ dataSlots:
88
+ - button
89
+ dependsOn:
90
+ internal: []
91
+ lib:
92
+ - cn
93
+ hooks: []
94
+ external:
95
+ - "@radix-ui/react-slot"
96
+ - react
97
+ - tailwind-variants
98
+ contexts: []
99
+ stories:
100
+ - exportName: Primary
101
+ id: components-button--primary
102
+ - exportName: Secondary
103
+ id: components-button--secondary
104
+ - exportName: Outline
105
+ id: components-button--outline
106
+ - exportName: Destructive
107
+ id: components-button--destructive
108
+ - exportName: Elevated
109
+ id: components-button--elevated
110
+ - exportName: Large
111
+ id: components-button--large
112
+ - exportName: IconSizes
113
+ id: components-button--icon-sizes
114
+ storybookTitle: Components/Button
115
+ docsId: components-button--documentation
116
+ argTypeOptions:
117
+ variant:
118
+ - primary
119
+ - secondary
120
+ - outline
121
+ - ghost
122
+ - destructive
123
+ - accent
124
+ size:
125
+ - sm
126
+ - md
127
+ - lg
128
+ - icon-sm
129
+ - icon
130
+ - icon-lg
131
+ resolvedCleanly: true
132
+ contractHash: "28e136dac512"
133
+ factsHash: "444fb0558a09"
134
+ # >>> AUTHORED - humans own everything below this line. <<<
135
+ status: stable
136
+ summary: "The primary interactive control: fires an action or navigates."
137
+ useWhen:
138
+ - "the user triggers an action - submit, save, delete, open a dialog"
139
+ - "you need a link that must read as a button (pair with asChild)"
140
+ - "an icon-only affordance sits in a dense toolbar or table row"
141
+ useInstead:
142
+ - id: button-group
143
+ when: "several related actions sit together and read as one control"
144
+ - id: toggle
145
+ when: "the control carries persistent on/off state instead of firing an action"
146
+ - id: badge
147
+ when: "it only labels status and is not interactive"
148
+ - id: text-link
149
+ when: "it should read as a text link, inline or standalone; Button has no link variant"
150
+ related:
151
+ - button-group
152
+ - input-button
153
+ - select-button
154
+ - toggle
155
+ tokens:
156
+ - "--button-radius"
157
+ - "--primary-weaker"
158
+ - "--primary-weak"
159
+ - "--primary-strong"
160
+ - "--primary-foreground"
161
+ - "--secondary-weaker"
162
+ - "--secondary-strong"
163
+ - "--secondary-foreground"
164
+ - "--destructive-weaker"
165
+ - "--destructive-foreground"
166
+ - "--accent-weak"
167
+ - "--accent-foreground"
168
+ - "--border"
169
+ - "--muted"
170
+ - "--ring"
171
+ a11y:
172
+ notes:
173
+ - "The focus-visible ring is built into the base classes. Overriding it through className removes the only visible keyboard affordance."
174
+ - "disabled applies pointer-events-none, so a tooltip or popover wrapping a disabled button never receives the hover or focus event that would open it. Wrap a disabled button in a container if it needs an explanation."
175
+ requiredProps:
176
+ - "aria-label is required when size is icon-sm, icon or icon-lg, because there is no text node to name the control"
177
+ keyboard:
178
+ - "Native button semantics: Enter and Space activate, and it takes part in tab order automatically."
179
+ - "asChild hands semantics to the child, so rendering an anchor makes it a link. Screen readers will announce a link, and Space will no longer activate it."
180
+ radixHandles: false
181
+ pitfalls:
182
+ - "aurora is silently ignored when asChild is set, because Slot cannot accept the decorative children it injects."
183
+ - "elevated only changes anything on the primary and destructive variants. It is wired through compoundVariants, so on outline, ghost, secondary and accent it is accepted and does nothing."
184
+ - "The aurora orbs are positioned with physical offsets (left, right), so they do not mirror under RTL."
185
+ - "Pick the icon size that matches its neighbours' height (icon-sm beside sm controls, icon-lg beside lg) rather than shrinking icon with a size-* className."
186
+ - "There is no link variant. For anything that should read as a text link use TextLink, which also styles a <button> through asChild when the link-looking control is an action."
187
+ rtl: "Base layout is safe (flex with gap), but the aurora orbs use physical left/right offsets and will not mirror. Prefer aurora off for RTL surfaces until those offsets move to logical properties."
188
+ brandNotes: "Variants name a role, never a colour, so a brand re-skins all six by redefining --primary, --secondary, --accent and --destructive. Corner radius comes from --button-radius, which some brands set to a pill."
189
+ canonicalSnippet: |
190
+ import { Button } from "@adres/mgda-ui"
191
+
192
+ <Button variant="primary" size="md" onClick={handleSave}>
193
+ Save changes
194
+ </Button>
195
+ reviewedAt: 2026-10-05
196
+ reviewedAgainstContractHash: "28e136dac512"
197
+ ---
198
+
199
+ ## Usage
200
+
201
+ Button is the most leveraged primitive in the system, so it is also the one where a
202
+ wrong default spreads fastest. Reach for `primary` once per view: it marks the single
203
+ action you want taken. Everything else is `secondary`, `outline` or `ghost`.
204
+
205
+ The six variants describe **role, not colour**. That is what lets a brand re-skin
206
+ every button by redefining a handful of semantic variables, and it is why hardcoding
207
+ a colour on a Button is always a mistake.
208
+
209
+ Sizes follow a type-and-touch ladder rather than a visual whim: `sm` for dense rows,
210
+ `md` (the default) for ordinary body buttons, `lg` for marketing calls to action.
211
+ Icon-only controls get a matching square per height: `icon-sm` (32px) beside `sm`,
212
+ `icon` (40px) beside `md`, and `icon-lg` (48px) beside `lg`.
213
+
214
+ ### Composing with links
215
+
216
+ `asChild` renders the child element instead of a `button`, which is how a framework
217
+ `Link` gets button styling without nesting interactive elements:
218
+
219
+ ```tsx
220
+ <Button asChild variant="outline">
221
+ <Link href="/settings">Settings</Link>
222
+ </Button>
223
+ ```
224
+
225
+ Note what this changes: the accessible role becomes a link, so Space stops
226
+ activating it. Use it for navigation, not for actions.
227
+
228
+ ### Decoration
229
+
230
+ `aurora` adds blurred orbs behind the label. It is designed for `primary`, and it is
231
+ deliberately inert under `asChild`. Treat it as a marketing flourish, not a state.
@@ -0,0 +1,168 @@
1
+ ---
2
+ # >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
3
+ derived:
4
+ schemaVersion: 1
5
+ id: calendar
6
+ sourceFile: packages/design-system/src/components/calendar.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: Calendar
14
+ kind: component
15
+ typeText: "ForwardRefExoticComponent<CalendarProps & RefAttributes<HTMLDivElement>>"
16
+ - name: CalendarMode
17
+ kind: type
18
+ - name: CalendarProps
19
+ kind: type
20
+ - name: CalendarValue
21
+ kind: type
22
+ - name: DateRange
23
+ kind: type
24
+ primaryExport: Calendar
25
+ subcomponents: []
26
+ props:
27
+ Calendar:
28
+ - name: defaultMonth
29
+ type: Date
30
+ required: false
31
+ declaredIn: self
32
+ - name: defaultValue
33
+ type: CalendarValue
34
+ required: false
35
+ declaredIn: self
36
+ doc: "Uncontrolled initial selection."
37
+ - name: isDateDisabled
38
+ type: "((date: Date) => boolean)"
39
+ required: false
40
+ declaredIn: self
41
+ doc: "Return true to disable a specific day (evaluated after min/max)."
42
+ - name: locale
43
+ type: string
44
+ required: false
45
+ declaredIn: self
46
+ doc: "BCP-47 locale for month/weekday names + first weekday. Defaults to the runtime locale."
47
+ - name: max
48
+ type: Date
49
+ required: false
50
+ declaredIn: self
51
+ - name: min
52
+ type: Date
53
+ required: false
54
+ declaredIn: self
55
+ doc: "Selectable bounds (inclusive)."
56
+ - name: mode
57
+ type: CalendarMode
58
+ required: false
59
+ declaredIn: self
60
+ doc: "Selection mode. `single` picks one date; `range` picks a start→end span."
61
+ - name: month
62
+ type: Date
63
+ required: false
64
+ declaredIn: self
65
+ doc: "Controlled displayed month (any day within it)."
66
+ - name: onMonthChange
67
+ type: "((month: Date) => void)"
68
+ required: false
69
+ declaredIn: self
70
+ - name: onValueChange
71
+ type: "((value: CalendarValue) => void)"
72
+ required: false
73
+ declaredIn: self
74
+ - name: showOutsideDays
75
+ type: boolean
76
+ required: false
77
+ declaredIn: self
78
+ doc: "Render leading/trailing days from adjacent months (muted). Default true."
79
+ - name: value
80
+ type: CalendarValue
81
+ required: false
82
+ declaredIn: self
83
+ doc: "Controlled selection. `Date | undefined` in single mode, `DateRange` in range mode."
84
+ - name: weekStartsOn
85
+ type: "0 | 1 | 2 | 3 | 4 | 5 | 6"
86
+ required: false
87
+ declaredIn: self
88
+ doc: "0 = Sunday ... 6 = Saturday. Defaults to the locale's first weekday (Mon fallback)."
89
+ extendsProps:
90
+ - "Omit<React.HTMLAttributes<HTMLDivElement>, \"defaultValue\" | \"onChange\">"
91
+ variants:
92
+ mode:
93
+ kind: enum
94
+ options:
95
+ - single
96
+ - range
97
+ default: single
98
+ on: Calendar
99
+ variantSource: prop-union
100
+ compoundVariants: []
101
+ sizeMaps: []
102
+ dataSlots: []
103
+ dependsOn:
104
+ internal: []
105
+ lib:
106
+ - cn
107
+ hooks: []
108
+ external:
109
+ - lucide-react
110
+ - react
111
+ contexts: []
112
+ stories:
113
+ - exportName: Default
114
+ id: components-calendar--default
115
+ - exportName: Range
116
+ id: components-calendar--range
117
+ storybookTitle: Components/Calendar
118
+ docsId: components-calendar--documentation
119
+ argTypeOptions: {}
120
+ resolvedCleanly: true
121
+ contractHash: "90dc8c204fb0"
122
+ factsHash: "399bec69481a"
123
+ # >>> AUTHORED - humans own everything below this line. <<<
124
+ status: stable
125
+ summary: "A single-day or date-range picker grid with full keyboard navigation, locale-aware names, and RTL-aware arrow keys."
126
+ useWhen:
127
+ - "picking one date, or a start-to-end range, directly in the UI rather than typing it into a text field"
128
+ a11y:
129
+ notes:
130
+ - "The grid uses role=\"grid\"/\"row\"/\"columnheader\"/\"gridcell\" with a single roving tabIndex - only the focused day is tabbable, so Tab moves in and out of the whole grid once and arrow keys move within it, the standard grid-navigation pattern."
131
+ - "aria-live=\"polite\" on the month caption announces month changes from the nav buttons or PageUp/PageDown, so a screen reader user hears which month they landed on without re-reading the grid."
132
+ - "Arrow-key direction is read from the resolved CSS direction, not just a locale or dir prop passed to Calendar - it stays correct even when RTL comes from a wrapping dir=\"rtl\" ancestor."
133
+ keyboard:
134
+ - "Arrow keys move by day or week; Home/End jump to the start/end of the visible row; PageUp/PageDown move by month, and with Shift by year; Enter/Space selects the focused day."
135
+ radixHandles: false
136
+ pitfalls:
137
+ - "value's shape depends on mode: a bare Date in \"single\" mode, a { from, to } DateRange in \"range\" mode - mismatching the two does not throw, it just makes the selection state behave unpredictably at runtime."
138
+ - "The very first render always uses a fixed \"en\" locale, even without an explicit locale prop - the real navigator.language locale only applies after mount, to avoid an SSR/client hydration mismatch. Expect a brief flash of English month/weekday names on load when locale is unset."
139
+ - "min/max only disable day selection and grey out the prev/next month buttons - they do not clamp an already-set value or defaultValue that falls outside those bounds."
140
+ - "In range mode, clicking a day once the range is already complete (both from and to set) starts a brand-new range from that day rather than moving either end - there is no API-level way to just adjust one end of an existing range."
141
+ canonicalSnippet: |
142
+ import { Calendar } from "@adres/mgda-ui"
143
+
144
+ <Calendar
145
+ mode="range"
146
+ value={range}
147
+ onValueChange={setRange}
148
+ min={new Date()}
149
+ />
150
+ reviewedAt: 2026-08-31
151
+ reviewedAgainstContractHash: "90dc8c204fb0"
152
+ ---
153
+
154
+ ## Usage
155
+
156
+ `Calendar` is a self-contained day-grid picker - reach for it when the
157
+ interaction is picking a date (or a range) directly in the UI, not typing one
158
+ into a text field. It has no Radix dependency; keyboard navigation, roving
159
+ focus, and range logic are all hand-rolled inside the component.
160
+
161
+ `mode="single"` (default) picks one `Date`; `mode="range"` picks a
162
+ `{ from, to }` span, with `to` staying `undefined` mid-selection. Keep the
163
+ `value` shape in sync with `mode` - the two are not interchangeable.
164
+
165
+ Locale drives both the weekday and month names and the default first weekday
166
+ (`weekStartsOn` overrides it). `min`/`max` disable out-of-range days and grey
167
+ out the prev/next month buttons once every day in that direction is disabled,
168
+ but they do not clamp an already-set `value` that falls outside the bounds.