@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,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: dialog
|
|
6
|
+
sourceFile: packages/design-system/src/components/dialog.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-overlays
|
|
9
|
+
categoryFromBarrel: web-app-overlays
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Dialog
|
|
14
|
+
kind: component
|
|
15
|
+
radixSource: "@radix-ui/react-dialog#Root"
|
|
16
|
+
typeText: "FC<DialogProps>"
|
|
17
|
+
- name: DialogClose
|
|
18
|
+
kind: component
|
|
19
|
+
radixSource: "@radix-ui/react-dialog#Close"
|
|
20
|
+
typeText: "ForwardRefExoticComponent<DialogCloseProps & RefAttributes<HTMLButtonElement>>"
|
|
21
|
+
- name: DialogContent
|
|
22
|
+
kind: component
|
|
23
|
+
typeText: "ForwardRefExoticComponent<DialogContentProps & RefAttributes<HTMLDivElement>>"
|
|
24
|
+
- name: DialogContentProps
|
|
25
|
+
kind: type
|
|
26
|
+
- name: DialogDescription
|
|
27
|
+
kind: component
|
|
28
|
+
typeText: "ForwardRefExoticComponent<Omit<DialogDescriptionProps & RefAttributes<HTMLParagraphElement>, \"ref\"> & RefAttributes<HTMLParagraphElement>>"
|
|
29
|
+
- name: DialogFooter
|
|
30
|
+
kind: component
|
|
31
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
32
|
+
- name: DialogHeader
|
|
33
|
+
kind: component
|
|
34
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
35
|
+
- name: DialogOverlay
|
|
36
|
+
kind: component
|
|
37
|
+
typeText: "ForwardRefExoticComponent<Omit<DialogOverlayProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
38
|
+
- name: DialogPortal
|
|
39
|
+
kind: component
|
|
40
|
+
radixSource: "@radix-ui/react-dialog#Portal"
|
|
41
|
+
typeText: "FC<DialogPortalProps>"
|
|
42
|
+
- name: DialogSize
|
|
43
|
+
kind: type
|
|
44
|
+
- name: DialogTitle
|
|
45
|
+
kind: component
|
|
46
|
+
typeText: "ForwardRefExoticComponent<Omit<DialogTitleProps & RefAttributes<HTMLHeadingElement>, \"ref\"> & RefAttributes<HTMLHeadingElement>>"
|
|
47
|
+
- name: DialogTrigger
|
|
48
|
+
kind: component
|
|
49
|
+
radixSource: "@radix-ui/react-dialog#Trigger"
|
|
50
|
+
typeText: "ForwardRefExoticComponent<DialogTriggerProps & RefAttributes<HTMLButtonElement>>"
|
|
51
|
+
primaryExport: Dialog
|
|
52
|
+
subcomponents:
|
|
53
|
+
- DialogClose
|
|
54
|
+
- DialogContent
|
|
55
|
+
- DialogDescription
|
|
56
|
+
- DialogFooter
|
|
57
|
+
- DialogHeader
|
|
58
|
+
- DialogOverlay
|
|
59
|
+
- DialogPortal
|
|
60
|
+
- DialogTitle
|
|
61
|
+
- DialogTrigger
|
|
62
|
+
props:
|
|
63
|
+
DialogContent:
|
|
64
|
+
- name: size
|
|
65
|
+
type: DialogSize
|
|
66
|
+
required: false
|
|
67
|
+
declaredIn: self
|
|
68
|
+
extendsProps: []
|
|
69
|
+
variants:
|
|
70
|
+
size:
|
|
71
|
+
kind: enum
|
|
72
|
+
options:
|
|
73
|
+
- sm
|
|
74
|
+
- md
|
|
75
|
+
- lg
|
|
76
|
+
default: md
|
|
77
|
+
on: DialogContent
|
|
78
|
+
variantSource: prop-union
|
|
79
|
+
compoundVariants: []
|
|
80
|
+
sizeMaps:
|
|
81
|
+
- CLOSE_ICON
|
|
82
|
+
- DESCRIPTION_SIZE
|
|
83
|
+
- FOOTER_MT
|
|
84
|
+
- GAP
|
|
85
|
+
- MAX_WIDTH
|
|
86
|
+
- PADDING
|
|
87
|
+
- TITLE_SIZE
|
|
88
|
+
dataSlots: []
|
|
89
|
+
dependsOn:
|
|
90
|
+
internal: []
|
|
91
|
+
lib:
|
|
92
|
+
- cn
|
|
93
|
+
hooks: []
|
|
94
|
+
external:
|
|
95
|
+
- "@radix-ui/react-dialog"
|
|
96
|
+
- lucide-react
|
|
97
|
+
- react
|
|
98
|
+
contexts:
|
|
99
|
+
- name: DialogSizeContext
|
|
100
|
+
type: DialogSize
|
|
101
|
+
default: md
|
|
102
|
+
stories:
|
|
103
|
+
- exportName: Default
|
|
104
|
+
id: components-dialog--default
|
|
105
|
+
storybookTitle: Components/Dialog
|
|
106
|
+
docsId: components-dialog--documentation
|
|
107
|
+
argTypeOptions: {}
|
|
108
|
+
resolvedCleanly: true
|
|
109
|
+
contractHash: "033e8fe255cf"
|
|
110
|
+
factsHash: "7355195a3254"
|
|
111
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
112
|
+
status: stable
|
|
113
|
+
summary: "A modal overlay for a focused task the user must finish or dismiss."
|
|
114
|
+
useWhen:
|
|
115
|
+
- "confirming a destructive action before it happens"
|
|
116
|
+
- "a short form that should not lose the page behind it"
|
|
117
|
+
- "the user must decide something before continuing"
|
|
118
|
+
useInstead:
|
|
119
|
+
- id: drawer
|
|
120
|
+
when: "the content is long or form-heavy, especially on mobile, where a side or bottom sheet gives more room"
|
|
121
|
+
- id: popover
|
|
122
|
+
when: "the content is a small non-blocking detail anchored to the trigger"
|
|
123
|
+
- id: dropdown-menu
|
|
124
|
+
when: "you are offering a list of actions rather than a task"
|
|
125
|
+
- id: toaster
|
|
126
|
+
when: "you are reporting a result and the user does not need to respond"
|
|
127
|
+
related:
|
|
128
|
+
- drawer
|
|
129
|
+
- popover
|
|
130
|
+
- dropdown-menu
|
|
131
|
+
- button
|
|
132
|
+
composesWith:
|
|
133
|
+
- button
|
|
134
|
+
- input
|
|
135
|
+
- select
|
|
136
|
+
tokens:
|
|
137
|
+
- "--card"
|
|
138
|
+
- "--border"
|
|
139
|
+
- "--foreground"
|
|
140
|
+
- "--ring"
|
|
141
|
+
- "--motion-base"
|
|
142
|
+
- "--motion-ease-out"
|
|
143
|
+
a11y:
|
|
144
|
+
notes:
|
|
145
|
+
- "Radix supplies the whole modal contract: focus trap, focus restore to the trigger, Escape to close, click-outside, scroll lock, and aria-modal."
|
|
146
|
+
- "A DialogTitle is required. Radix warns when Content has no accessible name, and screen reader users get an unnamed dialog."
|
|
147
|
+
- "The built-in close button already carries an sr-only \"Close\" label, so it does not need one adding."
|
|
148
|
+
- "Entry animation is suppressed under prefers-reduced-motion via motion-reduce:animate-none."
|
|
149
|
+
requiredProps:
|
|
150
|
+
- "DialogTitle inside DialogContent, even if you visually hide it"
|
|
151
|
+
keyboard:
|
|
152
|
+
- "Escape closes. Tab cycles within the dialog only. Focus returns to the trigger on close."
|
|
153
|
+
- "DialogClose can wrap any button to make it dismiss the dialog, which is preferable to wiring onClick to setOpen yourself."
|
|
154
|
+
radixHandles: true
|
|
155
|
+
pitfalls:
|
|
156
|
+
- "DialogContent already renders DialogPortal and DialogOverlay internally. Wrapping it in your own DialogPortal or rendering a sibling DialogOverlay produces a double portal or two stacked scrims that darken twice. Both are exported for escape hatches, not for normal composition."
|
|
157
|
+
- "DialogContent also injects its own close button in the top corner. Adding another icon button there gives the user two X controls."
|
|
158
|
+
- "size lives only on DialogContent and reaches DialogTitle, DialogDescription and DialogFooter through context. Passing size to Dialog, DialogHeader, or the title itself does nothing and is silently ignored."
|
|
159
|
+
- "DialogFooter is flex-col-reverse below the sm breakpoint. The primary action should be last in the DOM so it lands on top on mobile and right-most on desktop. Putting it first inverts on small screens."
|
|
160
|
+
- "DialogHeader is the one part that does not read the size context, so its internal gap stays fixed while the rest of the dialog scales."
|
|
161
|
+
subcomponentNotes:
|
|
162
|
+
DialogContent: "Owns size, and is the only place to set it. Renders its own portal, overlay and close button."
|
|
163
|
+
DialogFooter: "Reads size from context for its top margin. Reverses order on mobile, so DOM order matters."
|
|
164
|
+
DialogHeader: "Plain flex column. Does not scale with size."
|
|
165
|
+
DialogOverlay: "Exported for escape hatches only. DialogContent already renders one."
|
|
166
|
+
DialogPortal: "Exported for escape hatches only. DialogContent already renders one."
|
|
167
|
+
rtl: "Safe. Positioning is centred with transforms and the close button uses logical right-md, which mirrors correctly."
|
|
168
|
+
brandNotes: "The scrim uses --foreground at 40 percent in light and switches to black in dark, because --foreground inverts and would otherwise tint the scrim whitish. A brand changing --foreground affects the scrim in light mode only."
|
|
169
|
+
canonicalSnippet: |
|
|
170
|
+
import {
|
|
171
|
+
Dialog,
|
|
172
|
+
DialogTrigger,
|
|
173
|
+
DialogContent,
|
|
174
|
+
DialogHeader,
|
|
175
|
+
DialogTitle,
|
|
176
|
+
DialogDescription,
|
|
177
|
+
DialogFooter,
|
|
178
|
+
DialogClose,
|
|
179
|
+
Button,
|
|
180
|
+
} from "@adres/mgda-ui"
|
|
181
|
+
|
|
182
|
+
<Dialog>
|
|
183
|
+
<DialogTrigger asChild>
|
|
184
|
+
<Button variant="destructive">Delete project</Button>
|
|
185
|
+
</DialogTrigger>
|
|
186
|
+
<DialogContent size="sm">
|
|
187
|
+
<DialogHeader>
|
|
188
|
+
<DialogTitle>Delete this project?</DialogTitle>
|
|
189
|
+
<DialogDescription>
|
|
190
|
+
This removes every file in it. The action cannot be undone.
|
|
191
|
+
</DialogDescription>
|
|
192
|
+
</DialogHeader>
|
|
193
|
+
<DialogFooter>
|
|
194
|
+
<DialogClose asChild>
|
|
195
|
+
<Button variant="outline">Cancel</Button>
|
|
196
|
+
</DialogClose>
|
|
197
|
+
<Button variant="destructive">Delete</Button>
|
|
198
|
+
</DialogFooter>
|
|
199
|
+
</DialogContent>
|
|
200
|
+
</Dialog>
|
|
201
|
+
reviewedAt: 2026-08-19
|
|
202
|
+
reviewedAgainstContractHash: 033e8fe255cf
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Usage
|
|
206
|
+
|
|
207
|
+
Dialog blocks the page, so it is the most expensive interruption in the system. Use it
|
|
208
|
+
when the user genuinely cannot continue without deciding, and prefer `Drawer` whenever
|
|
209
|
+
the content is long enough to scroll.
|
|
210
|
+
|
|
211
|
+
Radix owns all the modal behaviour, which means the accessibility work is already done
|
|
212
|
+
and should not be re-implemented. What this component adds on top is a size scale and
|
|
213
|
+
the brand-bound surface.
|
|
214
|
+
|
|
215
|
+
`size` is the only variant, and it does more than set a width. It selects the max
|
|
216
|
+
width, interior padding, content gap, title and description type scale, close icon
|
|
217
|
+
size, and footer top margin, all from parallel maps keyed on the same value. That is
|
|
218
|
+
why adding a new size means touching seven maps in one file, which `sizeMaps` in the
|
|
219
|
+
derived facts records.
|
|
220
|
+
|
|
221
|
+
### Sizes
|
|
222
|
+
|
|
223
|
+
| Size | Max width | Intended for |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| `sm` | 320px | compact confirmations and alerts |
|
|
226
|
+
| `md` | 448px, the default | typical form dialogs |
|
|
227
|
+
| `lg` | 768px | wide or multi-column content |
|
|
228
|
+
|
|
229
|
+
## Anatomy
|
|
230
|
+
|
|
231
|
+
`Dialog` is a compound component. Four parts are bare Radix re-exports, and six are
|
|
232
|
+
styled wrappers.
|
|
233
|
+
|
|
234
|
+
| Part | Role |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| `Dialog` | Radix `Root`. Holds open state. |
|
|
237
|
+
| `DialogTrigger` | Radix `Trigger`. Use `asChild` to wrap your own Button. |
|
|
238
|
+
| `DialogContent` | The panel. **Sets `size`**, and renders its own portal, overlay and close button. |
|
|
239
|
+
| `DialogHeader` | Groups title and description. |
|
|
240
|
+
| `DialogTitle` | Required for an accessible name. Scales with `size`. |
|
|
241
|
+
| `DialogDescription` | Supporting text. Scales with `size`. |
|
|
242
|
+
| `DialogFooter` | The action row. Reverses order on mobile. |
|
|
243
|
+
| `DialogClose` | Radix `Close`. Wrap a Button with `asChild` to dismiss. |
|
|
244
|
+
| `DialogPortal` | Escape hatch. Already rendered by `DialogContent`. |
|
|
245
|
+
| `DialogOverlay` | Escape hatch. Already rendered by `DialogContent`. |
|
|
246
|
+
|
|
247
|
+
The nesting that matters: `size` on `DialogContent` flows through
|
|
248
|
+
`DialogSizeContext` to the title, description and footer. Nothing else in the file
|
|
249
|
+
surfaces that relationship, which is why it is worth stating here.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: drawer
|
|
6
|
+
sourceFile: packages/design-system/src/components/drawer.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-overlays
|
|
9
|
+
categoryFromBarrel: web-app-overlays
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Drawer
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "({ open: controlledOpen, onOpenChange, defaultOpen, children, ...props }: DrawerProps) => Element"
|
|
16
|
+
- name: DrawerBody
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
19
|
+
- name: DrawerClose
|
|
20
|
+
kind: component
|
|
21
|
+
radixSource: "@radix-ui/react-dialog#Close"
|
|
22
|
+
typeText: "ForwardRefExoticComponent<DialogCloseProps & RefAttributes<HTMLButtonElement>>"
|
|
23
|
+
- name: DrawerContent
|
|
24
|
+
kind: component
|
|
25
|
+
typeText: "ForwardRefExoticComponent<DrawerContentProps & RefAttributes<HTMLDivElement>>"
|
|
26
|
+
- name: DrawerContentProps
|
|
27
|
+
kind: type
|
|
28
|
+
- name: DrawerDescription
|
|
29
|
+
kind: component
|
|
30
|
+
typeText: "ForwardRefExoticComponent<Omit<DialogDescriptionProps & RefAttributes<HTMLParagraphElement>, \"ref\"> & RefAttributes<HTMLParagraphElement>>"
|
|
31
|
+
- name: DrawerFooter
|
|
32
|
+
kind: component
|
|
33
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
34
|
+
- name: DrawerHeader
|
|
35
|
+
kind: component
|
|
36
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>"
|
|
37
|
+
- name: DrawerProps
|
|
38
|
+
kind: type
|
|
39
|
+
- name: DrawerSide
|
|
40
|
+
kind: type
|
|
41
|
+
- name: DrawerSize
|
|
42
|
+
kind: type
|
|
43
|
+
- name: DrawerTitle
|
|
44
|
+
kind: component
|
|
45
|
+
typeText: "ForwardRefExoticComponent<Omit<DialogTitleProps & RefAttributes<HTMLHeadingElement>, \"ref\"> & RefAttributes<HTMLHeadingElement>>"
|
|
46
|
+
- name: DrawerTrigger
|
|
47
|
+
kind: component
|
|
48
|
+
radixSource: "@radix-ui/react-dialog#Trigger"
|
|
49
|
+
typeText: "ForwardRefExoticComponent<DialogTriggerProps & RefAttributes<HTMLButtonElement>>"
|
|
50
|
+
primaryExport: Drawer
|
|
51
|
+
subcomponents:
|
|
52
|
+
- DrawerBody
|
|
53
|
+
- DrawerClose
|
|
54
|
+
- DrawerContent
|
|
55
|
+
- DrawerDescription
|
|
56
|
+
- DrawerFooter
|
|
57
|
+
- DrawerHeader
|
|
58
|
+
- DrawerTitle
|
|
59
|
+
- DrawerTrigger
|
|
60
|
+
props:
|
|
61
|
+
DrawerContent:
|
|
62
|
+
- name: backdrop
|
|
63
|
+
type: boolean
|
|
64
|
+
required: false
|
|
65
|
+
declaredIn: self
|
|
66
|
+
doc: "Show the translucent backdrop. Default: true."
|
|
67
|
+
- name: side
|
|
68
|
+
type: DrawerSide
|
|
69
|
+
required: false
|
|
70
|
+
declaredIn: self
|
|
71
|
+
- name: size
|
|
72
|
+
type: DrawerSize
|
|
73
|
+
required: false
|
|
74
|
+
declaredIn: self
|
|
75
|
+
extendsProps:
|
|
76
|
+
- "React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>"
|
|
77
|
+
variants:
|
|
78
|
+
side:
|
|
79
|
+
kind: enum
|
|
80
|
+
options:
|
|
81
|
+
- left
|
|
82
|
+
- right
|
|
83
|
+
- bottom
|
|
84
|
+
- top
|
|
85
|
+
default: right
|
|
86
|
+
on: DrawerContent
|
|
87
|
+
size:
|
|
88
|
+
kind: enum
|
|
89
|
+
options:
|
|
90
|
+
- sm
|
|
91
|
+
- md
|
|
92
|
+
- lg
|
|
93
|
+
default: md
|
|
94
|
+
on: DrawerContent
|
|
95
|
+
variantSource: prop-union
|
|
96
|
+
compoundVariants: []
|
|
97
|
+
sizeMaps:
|
|
98
|
+
- DESCRIPTION_SIZE
|
|
99
|
+
- DRAG_BY_SIDE
|
|
100
|
+
- END_HEIGHT
|
|
101
|
+
- SIDE_WIDTH
|
|
102
|
+
- TITLE_SIZE
|
|
103
|
+
dataSlots: []
|
|
104
|
+
dependsOn:
|
|
105
|
+
internal: []
|
|
106
|
+
lib:
|
|
107
|
+
- cn
|
|
108
|
+
- motion
|
|
109
|
+
hooks:
|
|
110
|
+
- use-reduced-motion
|
|
111
|
+
external:
|
|
112
|
+
- "@radix-ui/react-dialog"
|
|
113
|
+
- lucide-react
|
|
114
|
+
- motion/react
|
|
115
|
+
- react
|
|
116
|
+
contexts:
|
|
117
|
+
- name: DrawerSizeContext
|
|
118
|
+
type: DrawerSize
|
|
119
|
+
default: md
|
|
120
|
+
- name: DrawerOpenContext
|
|
121
|
+
type: DrawerOpenContextValue
|
|
122
|
+
default: null
|
|
123
|
+
stories:
|
|
124
|
+
- exportName: Default
|
|
125
|
+
id: components-drawer--default
|
|
126
|
+
storybookTitle: Components/Drawer
|
|
127
|
+
docsId: components-drawer--documentation
|
|
128
|
+
argTypeOptions: {}
|
|
129
|
+
resolvedCleanly: true
|
|
130
|
+
contractHash: "6af2f793ca6c"
|
|
131
|
+
factsHash: c4fc32424690
|
|
132
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
133
|
+
status: stable
|
|
134
|
+
summary: "A side-anchored (or bottom/top) sliding panel built on Radix Dialog, with drag-to-dismiss and independent enter/exit motion."
|
|
135
|
+
useWhen:
|
|
136
|
+
- "showing a detail panel, filter set, or form alongside the page rather than fully blocking it, especially content long enough to scroll"
|
|
137
|
+
- "a mobile-style bottom sheet is the right pattern (side=\"bottom\")"
|
|
138
|
+
useInstead:
|
|
139
|
+
- id: dialog
|
|
140
|
+
when: "the content is a compact, blocking decision that does not need to slide in from an edge or scroll at length"
|
|
141
|
+
- id: popover
|
|
142
|
+
when: "the content is small and anchored to a specific trigger element, not a full edge-to-edge panel"
|
|
143
|
+
related:
|
|
144
|
+
- dialog
|
|
145
|
+
- popover
|
|
146
|
+
tokens:
|
|
147
|
+
- "--card"
|
|
148
|
+
- "--border"
|
|
149
|
+
- "--foreground"
|
|
150
|
+
- "--muted-foreground"
|
|
151
|
+
- "--ring"
|
|
152
|
+
a11y:
|
|
153
|
+
notes:
|
|
154
|
+
- "Built on Radix Dialog, so it inherits accessible dialog semantics (focus trap, Escape to close, focus restore on close) even though it looks and animates like a custom sheet."
|
|
155
|
+
- "DrawerTitle is required for an accessible name, the same as Dialog - there is no visual-only alternative that also satisfies screen readers."
|
|
156
|
+
- "The built-in close button already includes a visually-hidden \"Close\" label - it does not need (or use) an aria-label passed to DrawerContent."
|
|
157
|
+
keyboard:
|
|
158
|
+
- "Escape closes, same as the underlying Radix Dialog. Drag-to-dismiss is a pointer/touch-only affordance with no keyboard equivalent - Escape remains the way to close via keyboard."
|
|
159
|
+
radixHandles: true
|
|
160
|
+
pitfalls:
|
|
161
|
+
- "DrawerContent forces its own mount/unmount via forceMount plus AnimatePresence to run motion/react's exit animation - fighting that mounting model (e.g. conditionally rendering DrawerContent yourself) breaks the slide-out animation."
|
|
162
|
+
- "The drag handle affordance only renders for side=\"bottom\"/\"top\" - left/right panels support the same drag-to-close gesture functionally but show no visible handle, since an edge-swipe is the expected gesture there instead."
|
|
163
|
+
- "size drives four separate maps at once (width or height, drag behavior, title scale, description scale) - adding a new size means touching all of them, the same pattern Dialog's size maps use."
|
|
164
|
+
- "Reduced-motion does not just shorten the animation, it also disables drag-to-dismiss entirely - a reduced-motion user closes exclusively via the close button, backdrop click, or Escape."
|
|
165
|
+
canonicalSnippet: |
|
|
166
|
+
import {
|
|
167
|
+
Button,
|
|
168
|
+
Drawer,
|
|
169
|
+
DrawerBody,
|
|
170
|
+
DrawerClose,
|
|
171
|
+
DrawerContent,
|
|
172
|
+
DrawerFooter,
|
|
173
|
+
DrawerHeader,
|
|
174
|
+
DrawerTitle,
|
|
175
|
+
DrawerTrigger,
|
|
176
|
+
} from "@adres/mgda-ui"
|
|
177
|
+
|
|
178
|
+
<Drawer>
|
|
179
|
+
<DrawerTrigger asChild>
|
|
180
|
+
<Button>Open filters</Button>
|
|
181
|
+
</DrawerTrigger>
|
|
182
|
+
<DrawerContent side="right" size="md">
|
|
183
|
+
<DrawerHeader>
|
|
184
|
+
<DrawerTitle>Filters</DrawerTitle>
|
|
185
|
+
</DrawerHeader>
|
|
186
|
+
<DrawerBody>
|
|
187
|
+
<p>Drawer content goes here.</p>
|
|
188
|
+
</DrawerBody>
|
|
189
|
+
<DrawerFooter>
|
|
190
|
+
<DrawerClose asChild>
|
|
191
|
+
<Button variant="outline">Close</Button>
|
|
192
|
+
</DrawerClose>
|
|
193
|
+
</DrawerFooter>
|
|
194
|
+
</DrawerContent>
|
|
195
|
+
</Drawer>
|
|
196
|
+
reviewedAt: 2026-09-29
|
|
197
|
+
reviewedAgainstContractHash: "6af2f793ca6c"
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Usage
|
|
201
|
+
|
|
202
|
+
`Drawer` slides a panel in from an edge (`side="right"` by default, or
|
|
203
|
+
`"left"`/`"top"`/`"bottom"`) rather than blocking the page in place - reach for
|
|
204
|
+
it over `Dialog` when the content is long enough to scroll, or needs the extra
|
|
205
|
+
room a full-height/width panel gives. `side="bottom"` is the mobile-style
|
|
206
|
+
bottom-sheet pattern, and shows a drag handle affordance that `left`/`right`
|
|
207
|
+
panels intentionally omit (they rely on an edge-swipe gesture instead).
|
|
208
|
+
|
|
209
|
+
Every side supports drag-to-dismiss automatically - a user can drag the panel
|
|
210
|
+
back off-screen past a distance or velocity threshold. `size` (`sm`/`md`/`lg`)
|
|
211
|
+
scales width (for `left`/`right`) or max-height (for `top`/`bottom`) together
|
|
212
|
+
with the title and description type scale, mirroring how `Dialog`'s `size`
|
|
213
|
+
works.
|
|
214
|
+
|
|
215
|
+
Set `backdrop={false}` on `DrawerContent` to suppress the translucent scrim
|
|
216
|
+
when the drawer should not visually block the rest of the page.
|
|
217
|
+
|
|
218
|
+
## Anatomy
|
|
219
|
+
|
|
220
|
+
`Drawer` is a compound component built directly on Radix Dialog's parts.
|
|
221
|
+
|
|
222
|
+
| Part | Role |
|
|
223
|
+
| --- | --- |
|
|
224
|
+
| `Drawer` | Root. Wraps Radix `Dialog.Root` and mirrors open state into its own context so `DrawerContent` can run independent `motion/react` exit animations. |
|
|
225
|
+
| `DrawerTrigger` | Opens the drawer. Use `asChild` to wrap a real `Button`. |
|
|
226
|
+
| `DrawerContent` | The sliding panel. Sets `side`, `size`, and `backdrop`; renders its own portal, backdrop, drag handling, and close button. |
|
|
227
|
+
| `DrawerHeader` | Groups the title and description, reserving space for the close button. |
|
|
228
|
+
| `DrawerTitle` | Required for an accessible name. Scales with `size`. |
|
|
229
|
+
| `DrawerDescription` | Supporting text. Scales with `size`. |
|
|
230
|
+
| `DrawerBody` | The scrollable content area between header and footer. |
|
|
231
|
+
| `DrawerFooter` | The action row. |
|
|
232
|
+
| `DrawerClose` | Radix `Close`. Wrap a `Button` with `asChild` to dismiss. |
|
|
233
|
+
|
|
234
|
+
The nesting that matters: `size` on `DrawerContent` flows through
|
|
235
|
+
`DrawerSizeContext` to the title and description, the same pattern `Dialog`
|
|
236
|
+
uses for its own size-driven type scale.
|