@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,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.
|