shadcn-glass-ui 1.0.11 → 2.0.0

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 (215) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/README.md +174 -17
  3. package/context7.json +58 -0
  4. package/dist/cli/index.cjs +470 -0
  5. package/dist/cli/index.cjs.map +1 -0
  6. package/dist/cli/index.d.ts +18 -0
  7. package/dist/cli/index.js +469 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/components.cjs +4 -4
  10. package/dist/components.d.ts +153 -22
  11. package/dist/components.js +2 -2
  12. package/dist/hooks.cjs +2 -2
  13. package/dist/index.cjs +872 -5
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +0 -2390
  16. package/dist/index.js +844 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/r/ai-card-glass.json +5 -12
  19. package/dist/r/avatar-glass.json +5 -15
  20. package/dist/r/circular-metric-glass.json +5 -11
  21. package/dist/r/circular-progress-glass.json +5 -12
  22. package/dist/r/combobox-glass.json +5 -13
  23. package/dist/r/flag-alert-glass.json +5 -11
  24. package/dist/r/flags-section-glass.json +5 -12
  25. package/dist/r/insight-card-glass.json +17 -0
  26. package/dist/r/interactive-card.json +5 -12
  27. package/dist/r/language-bar-glass.json +5 -11
  28. package/dist/r/metric-card-glass.json +6 -13
  29. package/dist/r/metrics-grid-glass.json +5 -11
  30. package/dist/r/modal-glass.json +5 -15
  31. package/dist/r/progress-glass.json +5 -13
  32. package/dist/r/registry.json +20 -2
  33. package/dist/r/segmented-control-glass.json +5 -11
  34. package/dist/r/sparkline-glass.json +17 -0
  35. package/dist/r/stepper-glass.json +33 -0
  36. package/dist/r/tabs-glass.json +4 -9
  37. package/dist/r/trust-score-card-glass.json +5 -12
  38. package/dist/r/year-card-glass.json +5 -13
  39. package/dist/shadcn-glass-ui.css +1 -1
  40. package/dist/{theme-context-XtasSxRT.cjs → theme-context-CVW50BKW.cjs} +2 -2
  41. package/dist/{theme-context-XtasSxRT.cjs.map → theme-context-CVW50BKW.cjs.map} +1 -1
  42. package/dist/themes.cjs +1 -1
  43. package/dist/trust-score-card-glass-BcZbul0P.js +26895 -0
  44. package/dist/trust-score-card-glass-BcZbul0P.js.map +1 -0
  45. package/dist/trust-score-card-glass-r3qM09Jp.cjs +27689 -0
  46. package/dist/trust-score-card-glass-r3qM09Jp.cjs.map +1 -0
  47. package/dist/{use-focus-BbpE2qGq.cjs → use-focus-ZE8ozmZE.cjs} +2 -2
  48. package/dist/{use-focus-BbpE2qGq.cjs.map → use-focus-ZE8ozmZE.cjs.map} +1 -1
  49. package/dist/{use-wallpaper-tint-CIqtoETa.cjs → use-wallpaper-tint-BuS80tbN.cjs} +2 -2
  50. package/dist/{use-wallpaper-tint-CIqtoETa.cjs.map → use-wallpaper-tint-BuS80tbN.cjs.map} +1 -1
  51. package/dist/{utils-CGCOTvxT.js → utils-CcyeqpKQ.js} +1 -1
  52. package/dist/{utils-CGCOTvxT.js.map → utils-CcyeqpKQ.js.map} +1 -1
  53. package/dist/{utils-CriE74ig.cjs → utils-DLXayspX.cjs} +2 -2
  54. package/dist/{utils-CriE74ig.cjs.map → utils-DLXayspX.cjs.map} +1 -1
  55. package/dist/utils.cjs +1 -1
  56. package/dist/utils.js +1 -1
  57. package/docs/AI_IMPROVEMENTS_COMPLETE.md +574 -0
  58. package/docs/AI_USAGE.md +1328 -0
  59. package/docs/API_PATTERNS_COMPARISON.md +418 -0
  60. package/docs/BEST_PRACTICES.md +800 -0
  61. package/docs/COMPLIANCE_CHECKLIST.md +307 -0
  62. package/docs/COMPLIANCE_TESTING.md +436 -0
  63. package/docs/COMPONENTS_CATALOG.md +1076 -0
  64. package/docs/CSS_VARIABLES_AUDIT.md +306 -0
  65. package/docs/CSS_VARIABLES_REFACTORING_PLAN.md +330 -0
  66. package/docs/EXPORTS_MAP.json +875 -0
  67. package/docs/EXPORTS_STRUCTURE.md +729 -0
  68. package/docs/GETTING_STARTED.md +655 -0
  69. package/docs/METRIC_CARD_API_REDESIGN.md +354 -0
  70. package/docs/PRIMITIVE_MAPPING.md +404 -0
  71. package/docs/PUBLISHING.md +593 -0
  72. package/docs/REGISTRY_SUMMARY.md +96 -0
  73. package/docs/REGISTRY_USAGE.md +339 -0
  74. package/docs/SECURITY.md +117 -0
  75. package/docs/THEME_CREATION_GUIDE.md +455 -0
  76. package/docs/TOKEN_ARCHITECTURE.md +365 -0
  77. package/docs/announcements/v1.0.5-devto.md +363 -0
  78. package/docs/announcements/v1.0.5-reddit.md +115 -0
  79. package/docs/announcements/v1.0.5-twitter.md +70 -0
  80. package/docs/api/README.md +725 -0
  81. package/docs/api/functions/ThemeProvider.md +21 -0
  82. package/docs/api/functions/cn.md +27 -0
  83. package/docs/api/functions/getNextTheme.md +21 -0
  84. package/docs/api/functions/getThemeConfig.md +21 -0
  85. package/docs/api/functions/useFocus.md +53 -0
  86. package/docs/api/functions/useHover.md +47 -0
  87. package/docs/api/functions/useResponsive.md +31 -0
  88. package/docs/api/functions/useTheme.md +15 -0
  89. package/docs/api/functions/useWallpaperTint.md +36 -0
  90. package/docs/api/globals.md +139 -0
  91. package/docs/api/interfaces/AlertGlassProps.md +131 -0
  92. package/docs/api/interfaces/AvatarGlassProps.md +114 -0
  93. package/docs/api/interfaces/BadgeGlassProps.md +118 -0
  94. package/docs/api/interfaces/ButtonGlassProps.md +179 -0
  95. package/docs/api/interfaces/CheckboxGlassProps.md +125 -0
  96. package/docs/api/interfaces/DropdownGlassProps.md +123 -0
  97. package/docs/api/interfaces/DropdownItem.md +53 -0
  98. package/docs/api/interfaces/GlassCardProps.md +151 -0
  99. package/docs/api/interfaces/InputGlassProps.md +169 -0
  100. package/docs/api/interfaces/NotificationGlassProps.md +67 -0
  101. package/docs/api/interfaces/ProgressGlassProps.md +49 -0
  102. package/docs/api/interfaces/SkeletonGlassProps.md +41 -0
  103. package/docs/api/interfaces/SliderGlassProps.md +107 -0
  104. package/docs/api/interfaces/TabItem.md +25 -0
  105. package/docs/api/interfaces/ThemeConfig.md +25 -0
  106. package/docs/api/interfaces/ThemeContextValue.md +47 -0
  107. package/docs/api/interfaces/ToggleGlassProps.md +59 -0
  108. package/docs/api/interfaces/TooltipGlassProps.md +119 -0
  109. package/docs/api/type-aliases/AlertType.md +11 -0
  110. package/docs/api/type-aliases/AlertVariant.md +11 -0
  111. package/docs/api/type-aliases/AvatarSize.md +11 -0
  112. package/docs/api/type-aliases/AvatarStatus.md +13 -0
  113. package/docs/api/type-aliases/BadgeSize.md +11 -0
  114. package/docs/api/type-aliases/BadgeVariant.md +11 -0
  115. package/docs/api/type-aliases/ButtonGlassSize.md +11 -0
  116. package/docs/api/type-aliases/ButtonGlassVariant.md +11 -0
  117. package/docs/api/type-aliases/DropdownAlign.md +11 -0
  118. package/docs/api/type-aliases/GlowType.md +11 -0
  119. package/docs/api/type-aliases/InputGlassSize.md +11 -0
  120. package/docs/api/type-aliases/IntensityType.md +11 -0
  121. package/docs/api/type-aliases/ModalSize.md +11 -0
  122. package/docs/api/type-aliases/NotificationType.md +11 -0
  123. package/docs/api/type-aliases/PaddingType.md +11 -0
  124. package/docs/api/type-aliases/ProgressGradient.md +11 -0
  125. package/docs/api/type-aliases/ProgressSize.md +11 -0
  126. package/docs/api/type-aliases/SkeletonVariant.md +11 -0
  127. package/docs/api/type-aliases/Theme.md +11 -0
  128. package/docs/api/type-aliases/ToggleGlassSize.md +11 -0
  129. package/docs/api/type-aliases/TooltipPosition.md +11 -0
  130. package/docs/api/variables/AICardGlass.md +11 -0
  131. package/docs/api/variables/AlertGlass.md +11 -0
  132. package/docs/api/variables/AvatarGlass.md +11 -0
  133. package/docs/api/variables/BadgeGlass.md +11 -0
  134. package/docs/api/variables/BaseProgressGlass.md +11 -0
  135. package/docs/api/variables/ButtonGlass.md +11 -0
  136. package/docs/api/variables/CareerStatsGlass.md +11 -0
  137. package/docs/api/variables/CareerStatsHeaderGlass.md +11 -0
  138. package/docs/api/variables/CheckboxGlass.md +11 -0
  139. package/docs/api/variables/CircularMetricGlass.md +22 -0
  140. package/docs/api/variables/CircularProgressGlass.md +11 -0
  141. package/docs/api/variables/ComboBoxGlass.md +27 -0
  142. package/docs/api/variables/ContributionMetricsGlass.md +11 -0
  143. package/docs/api/variables/DropdownGlass.md +11 -0
  144. package/docs/api/variables/ExpandableHeaderGlass.md +11 -0
  145. package/docs/api/variables/FlagAlertGlass.md +11 -0
  146. package/docs/api/variables/FlagsSectionGlass.md +11 -0
  147. package/docs/api/variables/FormFieldWrapper.md +44 -0
  148. package/docs/api/variables/GlassCard.md +11 -0
  149. package/docs/api/variables/HeaderBrandingGlass.md +11 -0
  150. package/docs/api/variables/HeaderNavGlass.md +11 -0
  151. package/docs/api/variables/IconButtonGlass.md +11 -0
  152. package/docs/api/variables/InputGlass.md +11 -0
  153. package/docs/api/variables/InteractiveCard.md +45 -0
  154. package/docs/api/variables/LanguageBarGlass.md +11 -0
  155. package/docs/api/variables/MetricCardGlass.md +11 -0
  156. package/docs/api/variables/MetricsGridGlass.md +11 -0
  157. package/docs/api/variables/ModalGlass.md +72 -0
  158. package/docs/api/variables/NotificationGlass.md +11 -0
  159. package/docs/api/variables/PopoverGlass.md +11 -0
  160. package/docs/api/variables/ProfileAvatarGlass.md +11 -0
  161. package/docs/api/variables/ProfileHeaderGlass.md +11 -0
  162. package/docs/api/variables/ProgressGlass.md +11 -0
  163. package/docs/api/variables/ProjectsListGlass.md +11 -0
  164. package/docs/api/variables/RainbowProgressGlass.md +11 -0
  165. package/docs/api/variables/RepositoryCardGlass.md +11 -0
  166. package/docs/api/variables/RepositoryHeaderGlass.md +11 -0
  167. package/docs/api/variables/RepositoryMetadataGlass.md +11 -0
  168. package/docs/api/variables/SearchBoxGlass.md +11 -0
  169. package/docs/api/variables/SegmentedControlGlass.md +11 -0
  170. package/docs/api/variables/SkeletonGlass.md +11 -0
  171. package/docs/api/variables/SliderGlass.md +11 -0
  172. package/docs/api/variables/SortDropdownGlass.md +11 -0
  173. package/docs/api/variables/StatItemGlass.md +11 -0
  174. package/docs/api/variables/StatusIndicatorGlass.md +11 -0
  175. package/docs/api/variables/THEMES.md +11 -0
  176. package/docs/api/variables/THEME_CONFIG.md +11 -0
  177. package/docs/api/variables/TabsGlass.md +52 -0
  178. package/docs/api/variables/ThemeToggleGlass.md +11 -0
  179. package/docs/api/variables/ToggleGlass.md +11 -0
  180. package/docs/api/variables/TooltipGlass.md +11 -0
  181. package/docs/api/variables/TouchTarget.md +35 -0
  182. package/docs/api/variables/TrustScoreCardGlass.md +11 -0
  183. package/docs/api/variables/TrustScoreDisplayGlass.md +11 -0
  184. package/docs/api/variables/UserInfoGlass.md +11 -0
  185. package/docs/api/variables/UserStatsLineGlass.md +11 -0
  186. package/docs/api/variables/YearCardGlass.md +11 -0
  187. package/docs/api/variables/alertVariants.md +21 -0
  188. package/docs/api/variables/avatarSizes.md +21 -0
  189. package/docs/api/variables/badgeVariants.md +21 -0
  190. package/docs/api/variables/buttonGlassVariants.md +21 -0
  191. package/docs/api/variables/cardIntensity.md +21 -0
  192. package/docs/api/variables/dropdownAlign.md +21 -0
  193. package/docs/api/variables/inputVariants.md +21 -0
  194. package/docs/api/variables/modalSizes.md +21 -0
  195. package/docs/api/variables/notificationVariants.md +21 -0
  196. package/docs/api/variables/progressSizes.md +21 -0
  197. package/docs/api/variables/shadcnAlertVariants.md +21 -0
  198. package/docs/api/variables/shadcnBadgeVariants.md +21 -0
  199. package/docs/api/variables/shadcnButtonVariants.md +21 -0
  200. package/docs/api/variables/skeletonVariants.md +21 -0
  201. package/docs/api/variables/statusSizes.md +21 -0
  202. package/docs/api/variables/toggleSizes.md +21 -0
  203. package/docs/api/variables/tooltipPositions.md +21 -0
  204. package/docs/design-system/UI_DESIGN.md +628 -0
  205. package/docs/migration/CSS_VARIABLES_MIGRATION_2.0.md +325 -0
  206. package/docs/migration/modal-glass-compound-api.md +458 -0
  207. package/docs/migration/select-to-combobox.md +386 -0
  208. package/docs/migration/tabs-glass-compound-api.md +579 -0
  209. package/docs/technical/DEPENDENCIES.md +291 -0
  210. package/docs/visual-testing-guide.md +324 -0
  211. package/package.json +16 -3
  212. package/dist/trust-score-card-glass-CNcQveNY.cjs +0 -8231
  213. package/dist/trust-score-card-glass-CNcQveNY.cjs.map +0 -1
  214. package/dist/trust-score-card-glass-CowcDyxH.js +0 -7795
  215. package/dist/trust-score-card-glass-CowcDyxH.js.map +0 -1
@@ -0,0 +1,458 @@
1
+ # ModalGlass Compound API Migration Guide
2
+
3
+ **Version:** v1.0.0
4
+ **Status:** ⚠️ Legacy API removed - Compound API only
5
+
6
+ ---
7
+
8
+ ## Why Migrate?
9
+
10
+ The new **Compound Component API** provides:
11
+
12
+ ✅ **Better composition** - Build complex modals with fine-grained control
13
+ ✅ **Radix UI patterns** - Follows industry-standard component architecture
14
+ ✅ **More control** - Customize each part independently
15
+ ✅ **Easier styling** - Target specific sections without prop drilling
16
+ ✅ **Type safety** - Better TypeScript inference for each sub-component
17
+ ✅ **Accessibility** - Enhanced ARIA attributes and keyboard navigation
18
+
19
+ ---
20
+
21
+ ## API Comparison
22
+
23
+ ### Legacy API (Removed in v1.0.0)
24
+
25
+ ```tsx
26
+ <ModalGlass
27
+ isOpen={open}
28
+ onClose={() => setOpen(false)}
29
+ title="Confirm Action"
30
+ description="Are you sure you want to proceed?"
31
+ size="md"
32
+ >
33
+ <p>Modal body content goes here</p>
34
+ <div className="flex gap-2">
35
+ <ButtonGlass variant="outline" onClick={() => setOpen(false)}>
36
+ Cancel
37
+ </ButtonGlass>
38
+ <ButtonGlass onClick={handleConfirm}>
39
+ Confirm
40
+ </ButtonGlass>
41
+ </div>
42
+ </ModalGlass>
43
+ ```
44
+
45
+ ### Compound API (Recommended)
46
+
47
+ ```tsx
48
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
49
+ <ModalGlass.Overlay />
50
+ <ModalGlass.Content size="md">
51
+ <ModalGlass.Header>
52
+ <ModalGlass.Title>Confirm Action</ModalGlass.Title>
53
+ <ModalGlass.Description>
54
+ Are you sure you want to proceed?
55
+ </ModalGlass.Description>
56
+ <ModalGlass.Close />
57
+ </ModalGlass.Header>
58
+
59
+ <ModalGlass.Body>
60
+ <p>Modal body content goes here</p>
61
+ </ModalGlass.Body>
62
+
63
+ <ModalGlass.Footer>
64
+ <ButtonGlass variant="outline" onClick={() => setOpen(false)}>
65
+ Cancel
66
+ </ButtonGlass>
67
+ <ButtonGlass onClick={handleConfirm}>
68
+ Confirm
69
+ </ButtonGlass>
70
+ </ModalGlass.Footer>
71
+ </ModalGlass.Content>
72
+ </ModalGlass.Root>
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Migration Examples
78
+
79
+ ### Example 1: Basic Modal
80
+
81
+ **Before (Legacy):**
82
+ ```tsx
83
+ import { ModalGlass } from '@/components/glass/ui/modal-glass';
84
+
85
+ function MyComponent() {
86
+ const [open, setOpen] = useState(false);
87
+
88
+ return (
89
+ <ModalGlass
90
+ isOpen={open}
91
+ onClose={() => setOpen(false)}
92
+ title="Welcome"
93
+ >
94
+ <p>Welcome to our application!</p>
95
+ </ModalGlass>
96
+ );
97
+ }
98
+ ```
99
+
100
+ **After (Compound):**
101
+ ```tsx
102
+ import { ModalGlass } from '@/components/glass/ui/modal-glass';
103
+
104
+ function MyComponent() {
105
+ const [open, setOpen] = useState(false);
106
+
107
+ return (
108
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
109
+ <ModalGlass.Overlay />
110
+ <ModalGlass.Content>
111
+ <ModalGlass.Header>
112
+ <ModalGlass.Title>Welcome</ModalGlass.Title>
113
+ <ModalGlass.Close />
114
+ </ModalGlass.Header>
115
+ <ModalGlass.Body>
116
+ <p>Welcome to our application!</p>
117
+ </ModalGlass.Body>
118
+ </ModalGlass.Content>
119
+ </ModalGlass.Root>
120
+ );
121
+ }
122
+ ```
123
+
124
+ ---
125
+
126
+ ### Example 2: Modal with Footer Actions
127
+
128
+ **Before (Legacy):**
129
+ ```tsx
130
+ <ModalGlass
131
+ isOpen={isDeleteOpen}
132
+ onClose={() => setIsDeleteOpen(false)}
133
+ title="Delete Item"
134
+ description="This action cannot be undone."
135
+ >
136
+ <div className="space-y-4">
137
+ <p>Are you sure you want to delete this item?</p>
138
+ <div className="flex justify-end gap-2">
139
+ <ButtonGlass
140
+ variant="outline"
141
+ onClick={() => setIsDeleteOpen(false)}
142
+ >
143
+ Cancel
144
+ </ButtonGlass>
145
+ <ButtonGlass
146
+ variant="destructive"
147
+ onClick={handleDelete}
148
+ >
149
+ Delete
150
+ </ButtonGlass>
151
+ </div>
152
+ </div>
153
+ </ModalGlass>
154
+ ```
155
+
156
+ **After (Compound):**
157
+ ```tsx
158
+ <ModalGlass.Root open={isDeleteOpen} onOpenChange={setIsDeleteOpen}>
159
+ <ModalGlass.Overlay />
160
+ <ModalGlass.Content>
161
+ <ModalGlass.Header>
162
+ <ModalGlass.Title>Delete Item</ModalGlass.Title>
163
+ <ModalGlass.Description>
164
+ This action cannot be undone.
165
+ </ModalGlass.Description>
166
+ <ModalGlass.Close />
167
+ </ModalGlass.Header>
168
+
169
+ <ModalGlass.Body>
170
+ <p>Are you sure you want to delete this item?</p>
171
+ </ModalGlass.Body>
172
+
173
+ <ModalGlass.Footer className="justify-end">
174
+ <ButtonGlass
175
+ variant="outline"
176
+ onClick={() => setIsDeleteOpen(false)}
177
+ >
178
+ Cancel
179
+ </ButtonGlass>
180
+ <ButtonGlass
181
+ variant="destructive"
182
+ onClick={handleDelete}
183
+ >
184
+ Delete
185
+ </ButtonGlass>
186
+ </ModalGlass.Footer>
187
+ </ModalGlass.Content>
188
+ </ModalGlass.Root>
189
+ ```
190
+
191
+ ---
192
+
193
+ ### Example 3: Modal with Custom Styling
194
+
195
+ **Before (Legacy):**
196
+ ```tsx
197
+ <ModalGlass
198
+ isOpen={open}
199
+ onClose={() => setOpen(false)}
200
+ title="Settings"
201
+ className="max-w-2xl"
202
+ >
203
+ <div className="p-6">
204
+ <SettingsForm />
205
+ </div>
206
+ </ModalGlass>
207
+ ```
208
+
209
+ **After (Compound - More Control):**
210
+ ```tsx
211
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
212
+ <ModalGlass.Overlay className="bg-black/60" />
213
+ <ModalGlass.Content size="lg" className="max-w-2xl">
214
+ <ModalGlass.Header className="border-b border-white/10">
215
+ <ModalGlass.Title className="text-2xl">Settings</ModalGlass.Title>
216
+ <ModalGlass.Close />
217
+ </ModalGlass.Header>
218
+
219
+ <ModalGlass.Body className="p-6">
220
+ <SettingsForm />
221
+ </ModalGlass.Body>
222
+ </ModalGlass.Content>
223
+ </ModalGlass.Root>
224
+ ```
225
+
226
+ ---
227
+
228
+ ### Example 4: Modal Without Header/Footer
229
+
230
+ **Before (Legacy):**
231
+ ```tsx
232
+ <ModalGlass
233
+ isOpen={open}
234
+ onClose={() => setOpen(false)}
235
+ >
236
+ <ImageGallery images={images} />
237
+ </ModalGlass>
238
+ ```
239
+
240
+ **After (Compound - Flexible):**
241
+ ```tsx
242
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
243
+ <ModalGlass.Overlay />
244
+ <ModalGlass.Content size="xl">
245
+ {/* No header - just body */}
246
+ <ModalGlass.Body className="p-0">
247
+ <ImageGallery images={images} />
248
+ {/* Optional: Add close button in top-right corner */}
249
+ <button
250
+ onClick={() => setOpen(false)}
251
+ className="absolute top-4 right-4 p-2 rounded-lg bg-black/50"
252
+ >
253
+ <X className="w-4 h-4" />
254
+ </button>
255
+ </ModalGlass.Body>
256
+ </ModalGlass.Content>
257
+ </ModalGlass.Root>
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Component API Reference
263
+
264
+ ### ModalGlass.Root
265
+
266
+ **Props:**
267
+ - `open: boolean` - Controlled open state
268
+ - `onOpenChange: (open: boolean) => void` - Called when modal should open/close
269
+ - `children: ReactNode` - Must contain `ModalGlass.Content`
270
+
271
+ ### ModalGlass.Overlay
272
+
273
+ **Props:**
274
+ - `className?: string` - Custom classes for overlay
275
+ - Standard HTML div attributes
276
+
277
+ **Default behavior:**
278
+ - Click to close
279
+ - Backdrop blur effect
280
+
281
+ ### ModalGlass.Content
282
+
283
+ **Props:**
284
+ - `size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'` - Modal size
285
+ - `className?: string` - Custom classes
286
+ - `children: ReactNode` - Modal content
287
+ - Standard HTML div attributes
288
+
289
+ ### ModalGlass.Header
290
+
291
+ **Props:**
292
+ - `className?: string` - Custom classes
293
+ - `children: ReactNode` - Header content
294
+ - Standard HTML div attributes
295
+
296
+ **Typical children:** `Title`, `Description`, `Close`
297
+
298
+ ### ModalGlass.Title
299
+
300
+ **Props:**
301
+ - `className?: string` - Custom classes
302
+ - `children: ReactNode` - Title text
303
+ - Standard HTML heading attributes
304
+
305
+ ### ModalGlass.Description
306
+
307
+ **Props:**
308
+ - `className?: string` - Custom classes
309
+ - `children: ReactNode` - Description text
310
+ - Standard HTML paragraph attributes
311
+
312
+ ### ModalGlass.Body
313
+
314
+ **Props:**
315
+ - `className?: string` - Custom classes
316
+ - `children: ReactNode` - Body content
317
+ - Standard HTML div attributes
318
+
319
+ ### ModalGlass.Footer
320
+
321
+ **Props:**
322
+ - `className?: string` - Custom classes
323
+ - `children: ReactNode` - Footer content (typically buttons)
324
+ - Standard HTML div attributes
325
+
326
+ ### ModalGlass.Close
327
+
328
+ **Props:**
329
+ - `className?: string` - Custom classes
330
+ - Standard HTML button attributes
331
+
332
+ **Default:** Renders X icon button
333
+
334
+ ---
335
+
336
+ ## Benefits by Use Case
337
+
338
+ ### 1. **Complex Forms**
339
+ Compound API makes it easier to add custom headers, sections, and footers:
340
+ ```tsx
341
+ <ModalGlass.Root>
342
+ <ModalGlass.Content>
343
+ <ModalGlass.Header>
344
+ <ModalGlass.Title>Multi-Step Form</ModalGlass.Title>
345
+ <div className="flex gap-2">
346
+ <Badge>Step {step}/3</Badge>
347
+ </div>
348
+ </ModalGlass.Header>
349
+ {/* ... */}
350
+ </ModalGlass.Content>
351
+ </ModalGlass.Root>
352
+ ```
353
+
354
+ ### 2. **Custom Layouts**
355
+ Skip header/footer when you don't need them:
356
+ ```tsx
357
+ <ModalGlass.Root>
358
+ <ModalGlass.Content>
359
+ <ModalGlass.Body className="p-0">
360
+ <VideoPlayer />
361
+ </ModalGlass.Body>
362
+ </ModalGlass.Content>
363
+ </ModalGlass.Root>
364
+ ```
365
+
366
+ ### 3. **Advanced Styling**
367
+ Target specific parts independently:
368
+ ```tsx
369
+ <ModalGlass.Root>
370
+ <ModalGlass.Overlay className="bg-gradient-to-br from-purple-900/50" />
371
+ <ModalGlass.Content className="shadow-2xl">
372
+ <ModalGlass.Header className="bg-gradient-to-r from-purple-500">
373
+ {/* ... */}
374
+ </ModalGlass.Header>
375
+ </ModalGlass.Content>
376
+ </ModalGlass.Root>
377
+ ```
378
+
379
+ ---
380
+
381
+ ## Migration Timeline
382
+
383
+ | Version | Status | Notes |
384
+ |---------|--------|-------|
385
+ | **v0.x** | ✅ Both APIs supported | Legacy API fully functional |
386
+ | **v1.0.0** | 🔥 Legacy removed | Only Compound API available |
387
+
388
+ **Note:** Legacy API was removed in v1.0.0. Use the Compound API as shown above.
389
+
390
+ ---
391
+
392
+ ## Performance Notes
393
+
394
+ - ✅ **No performance difference** - Both APIs render the same DOM structure
395
+ - ✅ **Bundle size** - Compound API adds ~200 bytes (negligible)
396
+ - ✅ **Tree shaking** - Unused sub-components are removed in production builds
397
+
398
+ ---
399
+
400
+ ## Accessibility
401
+
402
+ The Compound API enhances accessibility:
403
+
404
+ - ✅ `ModalGlass.Title` automatically sets `aria-labelledby`
405
+ - ✅ `ModalGlass.Description` automatically sets `aria-describedby`
406
+ - ✅ `ModalGlass.Close` has proper `aria-label="Close modal"`
407
+ - ✅ Keyboard navigation (Escape, Tab) works identically
408
+
409
+ ---
410
+
411
+ ## Common Pitfalls
412
+
413
+ ### ❌ Forgetting ModalGlass.Root
414
+ ```tsx
415
+ // Wrong - will not work
416
+ <ModalGlass.Content>
417
+ {/* ... */}
418
+ </ModalGlass.Content>
419
+ ```
420
+
421
+ ```tsx
422
+ // Correct
423
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
424
+ <ModalGlass.Content>
425
+ {/* ... */}
426
+ </ModalGlass.Content>
427
+ </ModalGlass.Root>
428
+ ```
429
+
430
+ ### ❌ Missing Overlay
431
+ ```tsx
432
+ // Works but no backdrop
433
+ <ModalGlass.Root>
434
+ <ModalGlass.Content>{/* ... */}</ModalGlass.Content>
435
+ </ModalGlass.Root>
436
+ ```
437
+
438
+ ```tsx
439
+ // Add overlay for backdrop
440
+ <ModalGlass.Root>
441
+ <ModalGlass.Overlay />
442
+ <ModalGlass.Content>{/* ... */}</ModalGlass.Content>
443
+ </ModalGlass.Root>
444
+ ```
445
+
446
+ ---
447
+
448
+ ## Need Help?
449
+
450
+ - 📖 See [Storybook examples](http://localhost:6006/?path=/story/components-modalglass--compound-api)
451
+ - 💬 Ask in [GitHub Discussions](https://github.com/your-org/shadcn-glass-ui-library/discussions)
452
+ - 🐛 Report issues in [GitHub Issues](https://github.com/your-org/shadcn-glass-ui-library/issues)
453
+
454
+ ---
455
+
456
+ **Last updated:** 2025-12-05
457
+ **Status:** ✅ Ready for migration
458
+ **Backward compatibility:** Maintained until v5.0