shadcn-glass-ui 1.0.11 → 2.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.
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 +1 -1
  19. package/dist/r/avatar-glass.json +1 -1
  20. package/dist/r/circular-metric-glass.json +1 -1
  21. package/dist/r/circular-progress-glass.json +1 -1
  22. package/dist/r/combobox-glass.json +1 -1
  23. package/dist/r/flag-alert-glass.json +1 -1
  24. package/dist/r/flags-section-glass.json +1 -1
  25. package/dist/r/insight-card-glass.json +26 -0
  26. package/dist/r/interactive-card.json +1 -1
  27. package/dist/r/language-bar-glass.json +1 -1
  28. package/dist/r/metric-card-glass.json +3 -2
  29. package/dist/r/metrics-grid-glass.json +1 -1
  30. package/dist/r/modal-glass.json +1 -1
  31. package/dist/r/progress-glass.json +1 -1
  32. package/dist/r/registry.json +19 -1
  33. package/dist/r/segmented-control-glass.json +1 -1
  34. package/dist/r/sparkline-glass.json +26 -0
  35. package/dist/r/stepper-glass.json +41 -0
  36. package/dist/r/tabs-glass.json +1 -1
  37. package/dist/r/trust-score-card-glass.json +1 -1
  38. package/dist/r/year-card-glass.json +1 -1
  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 +20 -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,579 @@
1
+ # TabsGlass 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
+ ✅ **Content co-location** - Define tab content alongside triggers
13
+ ✅ **Radix UI patterns** - Industry-standard tab component architecture
14
+ ✅ **Better composition** - Mix tabs with other components easily
15
+ ✅ **Type safety** - Enhanced TypeScript inference for tab values
16
+ ✅ **Flexibility** - Custom layouts, icons, badges in tab triggers
17
+ ✅ **Accessibility** - Improved ARIA attributes and keyboard navigation
18
+
19
+ ---
20
+
21
+ ## API Comparison
22
+
23
+ ### Legacy API (Removed in v1.0.0)
24
+
25
+ ```tsx
26
+ <TabsGlass
27
+ tabs={[
28
+ { id: 'overview', label: 'Overview' },
29
+ { id: 'analytics', label: 'Analytics' },
30
+ { id: 'settings', label: 'Settings' }
31
+ ]}
32
+ activeTab={activeTab}
33
+ onChange={setActiveTab}
34
+ />
35
+ ```
36
+
37
+ **Limitations:**
38
+ - Tab content must be rendered separately
39
+ - Cannot add icons/badges to tabs easily
40
+ - Limited customization of tab triggers
41
+
42
+ ### Compound API (Recommended)
43
+
44
+ ```tsx
45
+ <TabsGlass.Root value={activeTab} onValueChange={setActiveTab}>
46
+ <TabsGlass.List>
47
+ <TabsGlass.Trigger value="overview">
48
+ <LayoutDashboard className="w-4 h-4 mr-2" />
49
+ Overview
50
+ </TabsGlass.Trigger>
51
+ <TabsGlass.Trigger value="analytics">
52
+ <BarChart className="w-4 h-4 mr-2" />
53
+ Analytics
54
+ <Badge className="ml-2">New</Badge>
55
+ </TabsGlass.Trigger>
56
+ <TabsGlass.Trigger value="settings">
57
+ <Settings className="w-4 h-4 mr-2" />
58
+ Settings
59
+ </TabsGlass.Trigger>
60
+ </TabsGlass.List>
61
+
62
+ <TabsGlass.Content value="overview">
63
+ <DashboardOverview />
64
+ </TabsGlass.Content>
65
+
66
+ <TabsGlass.Content value="analytics">
67
+ <AnalyticsPanel />
68
+ </TabsGlass.Content>
69
+
70
+ <TabsGlass.Content value="settings">
71
+ <SettingsPanel />
72
+ </TabsGlass.Content>
73
+ </TabsGlass.Root>
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Migration Examples
79
+
80
+ ### Example 1: Basic Tabs
81
+
82
+ **Before (Legacy):**
83
+ ```tsx
84
+ import { TabsGlass } from '@/components/glass/ui/tabs-glass';
85
+
86
+ function MyComponent() {
87
+ const [tab, setTab] = useState('profile');
88
+
89
+ return (
90
+ <>
91
+ <TabsGlass
92
+ tabs={[
93
+ { id: 'profile', label: 'Profile' },
94
+ { id: 'settings', label: 'Settings' }
95
+ ]}
96
+ activeTab={tab}
97
+ onChange={setTab}
98
+ />
99
+
100
+ {/* Content rendered separately */}
101
+ {tab === 'profile' && <ProfileContent />}
102
+ {tab === 'settings' && <SettingsContent />}
103
+ </>
104
+ );
105
+ }
106
+ ```
107
+
108
+ **After (Compound):**
109
+ ```tsx
110
+ import { TabsGlass } from '@/components/glass/ui/tabs-glass';
111
+
112
+ function MyComponent() {
113
+ const [tab, setTab] = useState('profile');
114
+
115
+ return (
116
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
117
+ <TabsGlass.List>
118
+ <TabsGlass.Trigger value="profile">Profile</TabsGlass.Trigger>
119
+ <TabsGlass.Trigger value="settings">Settings</TabsGlass.Trigger>
120
+ </TabsGlass.List>
121
+
122
+ <TabsGlass.Content value="profile">
123
+ <ProfileContent />
124
+ </TabsGlass.Content>
125
+
126
+ <TabsGlass.Content value="settings">
127
+ <SettingsContent />
128
+ </TabsGlass.Content>
129
+ </TabsGlass.Root>
130
+ );
131
+ }
132
+ ```
133
+
134
+ ---
135
+
136
+ ### Example 2: Tabs with Icons
137
+
138
+ **Before (Legacy - Difficult):**
139
+ ```tsx
140
+ <TabsGlass
141
+ tabs={[
142
+ { id: 'home', label: '🏠 Home' }, // Emoji workaround
143
+ { id: 'stats', label: '📊 Stats' }
144
+ ]}
145
+ activeTab={tab}
146
+ onChange={setTab}
147
+ />
148
+ ```
149
+
150
+ **After (Compound - Natural):**
151
+ ```tsx
152
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
153
+ <TabsGlass.List>
154
+ <TabsGlass.Trigger value="home">
155
+ <Home className="w-4 h-4 mr-2" />
156
+ Home
157
+ </TabsGlass.Trigger>
158
+ <TabsGlass.Trigger value="stats">
159
+ <TrendingUp className="w-4 h-4 mr-2" />
160
+ Stats
161
+ </TabsGlass.Trigger>
162
+ </TabsGlass.List>
163
+
164
+ <TabsGlass.Content value="home">
165
+ <HomePage />
166
+ </TabsGlass.Content>
167
+
168
+ <TabsGlass.Content value="stats">
169
+ <StatsPage />
170
+ </TabsGlass.Content>
171
+ </TabsGlass.Root>
172
+ ```
173
+
174
+ ---
175
+
176
+ ### Example 3: Tabs with Badges and Counters
177
+
178
+ **Before (Legacy - Not Possible):**
179
+ ```tsx
180
+ // Cannot add badges to individual tabs easily
181
+ <TabsGlass
182
+ tabs={[
183
+ { id: 'inbox', label: 'Inbox (5)' }, // Text only
184
+ { id: 'sent', label: 'Sent' }
185
+ ]}
186
+ activeTab={tab}
187
+ onChange={setTab}
188
+ />
189
+ ```
190
+
191
+ **After (Compound - Full Control):**
192
+ ```tsx
193
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
194
+ <TabsGlass.List>
195
+ <TabsGlass.Trigger value="inbox">
196
+ <Inbox className="w-4 h-4 mr-2" />
197
+ Inbox
198
+ <Badge variant="destructive" className="ml-2">
199
+ 5
200
+ </Badge>
201
+ </TabsGlass.Trigger>
202
+ <TabsGlass.Trigger value="sent">
203
+ <Send className="w-4 h-4 mr-2" />
204
+ Sent
205
+ </TabsGlass.Trigger>
206
+ </TabsGlass.List>
207
+
208
+ <TabsGlass.Content value="inbox">
209
+ <InboxMessages unread={5} />
210
+ </TabsGlass.Content>
211
+
212
+ <TabsGlass.Content value="sent">
213
+ <SentMessages />
214
+ </TabsGlass.Content>
215
+ </TabsGlass.Root>
216
+ ```
217
+
218
+ ---
219
+
220
+ ### Example 4: Vertical Tabs Layout
221
+
222
+ **Before (Legacy - Not Supported):**
223
+ ```tsx
224
+ // Vertical layout not available in legacy API
225
+ ```
226
+
227
+ **After (Compound - Custom Layout):**
228
+ ```tsx
229
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
230
+ <div className="flex gap-4">
231
+ {/* Vertical tab list */}
232
+ <TabsGlass.List className="flex-col w-48">
233
+ <TabsGlass.Trigger value="general">General</TabsGlass.Trigger>
234
+ <TabsGlass.Trigger value="security">Security</TabsGlass.Trigger>
235
+ <TabsGlass.Trigger value="privacy">Privacy</TabsGlass.Trigger>
236
+ </TabsGlass.List>
237
+
238
+ {/* Content area */}
239
+ <div className="flex-1">
240
+ <TabsGlass.Content value="general">
241
+ <GeneralSettings />
242
+ </TabsGlass.Content>
243
+
244
+ <TabsGlass.Content value="security">
245
+ <SecuritySettings />
246
+ </TabsGlass.Content>
247
+
248
+ <TabsGlass.Content value="privacy">
249
+ <PrivacySettings />
250
+ </TabsGlass.Content>
251
+ </div>
252
+ </div>
253
+ </TabsGlass.Root>
254
+ ```
255
+
256
+ ---
257
+
258
+ ### Example 5: Dynamic Tabs
259
+
260
+ **Before (Legacy):**
261
+ ```tsx
262
+ const dynamicTabs = projects.map(p => ({
263
+ id: p.id,
264
+ label: p.name
265
+ }));
266
+
267
+ <TabsGlass
268
+ tabs={dynamicTabs}
269
+ activeTab={selectedProject}
270
+ onChange={setSelectedProject}
271
+ />
272
+
273
+ {/* Render content separately */}
274
+ {projects.map(project => (
275
+ project.id === selectedProject && (
276
+ <ProjectDetails key={project.id} project={project} />
277
+ )
278
+ ))}
279
+ ```
280
+
281
+ **After (Compound - Cleaner):**
282
+ ```tsx
283
+ <TabsGlass.Root value={selectedProject} onValueChange={setSelectedProject}>
284
+ <TabsGlass.List>
285
+ {projects.map(project => (
286
+ <TabsGlass.Trigger key={project.id} value={project.id}>
287
+ {project.name}
288
+ </TabsGlass.Trigger>
289
+ ))}
290
+ </TabsGlass.List>
291
+
292
+ {projects.map(project => (
293
+ <TabsGlass.Content key={project.id} value={project.id}>
294
+ <ProjectDetails project={project} />
295
+ </TabsGlass.Content>
296
+ ))}
297
+ </TabsGlass.Root>
298
+ ```
299
+
300
+ ---
301
+
302
+ ## Component API Reference
303
+
304
+ ### TabsGlass.Root
305
+
306
+ **Props:**
307
+ - `value: string` - Currently active tab value
308
+ - `onValueChange: (value: string) => void` - Called when tab changes
309
+ - `defaultValue?: string` - Initial tab value (uncontrolled)
310
+ - `children: ReactNode` - Must contain `TabsGlass.List` and `TabsGlass.Content` components
311
+ - `className?: string` - Custom classes
312
+
313
+ **Example:**
314
+ ```tsx
315
+ <TabsGlass.Root value="overview" onValueChange={setTab}>
316
+ {/* children */}
317
+ </TabsGlass.Root>
318
+ ```
319
+
320
+ ### TabsGlass.List
321
+
322
+ **Props:**
323
+ - `className?: string` - Custom classes for tab list container
324
+ - `children: ReactNode` - `TabsGlass.Trigger` components
325
+ - Standard HTML div attributes
326
+
327
+ **Default styles:** Horizontal flexbox layout with gap
328
+
329
+ **Example:**
330
+ ```tsx
331
+ <TabsGlass.List className="justify-center">
332
+ <TabsGlass.Trigger value="tab1">Tab 1</TabsGlass.Trigger>
333
+ <TabsGlass.Trigger value="tab2">Tab 2</TabsGlass.Trigger>
334
+ </TabsGlass.List>
335
+ ```
336
+
337
+ ### TabsGlass.Trigger
338
+
339
+ **Props:**
340
+ - `value: string` - **Required** - Tab identifier
341
+ - `disabled?: boolean` - Disable tab
342
+ - `className?: string` - Custom classes
343
+ - `children: ReactNode` - Tab label (text, icons, badges, etc.)
344
+ - Standard HTML button attributes
345
+
346
+ **States:**
347
+ - Active: When `value` matches `TabsGlass.Root`'s `value`
348
+ - Hover: Glass effect with glow
349
+ - Focus: Keyboard navigation support
350
+ - Disabled: Grayed out, not clickable
351
+
352
+ **Example:**
353
+ ```tsx
354
+ <TabsGlass.Trigger value="settings" disabled={!isAdmin}>
355
+ <Settings className="w-4 h-4 mr-2" />
356
+ Settings
357
+ {isNew && <Badge className="ml-2">New</Badge>}
358
+ </TabsGlass.Trigger>
359
+ ```
360
+
361
+ ### TabsGlass.Content
362
+
363
+ **Props:**
364
+ - `value: string` - **Required** - Must match a `TabsGlass.Trigger` value
365
+ - `className?: string` - Custom classes
366
+ - `children: ReactNode` - Content to show when tab is active
367
+ - Standard HTML div attributes
368
+
369
+ **Behavior:**
370
+ - Only visible when `value` matches active tab
371
+ - Smooth fade-in animation
372
+ - Preserves content in DOM (unmounted when inactive)
373
+
374
+ **Example:**
375
+ ```tsx
376
+ <TabsGlass.Content value="analytics" className="p-6">
377
+ <AnalyticsDashboard />
378
+ </TabsGlass.Content>
379
+ ```
380
+
381
+ ---
382
+
383
+ ## Benefits by Use Case
384
+
385
+ ### 1. **Dashboard with Multiple Views**
386
+ ```tsx
387
+ <TabsGlass.Root value={view} onValueChange={setView}>
388
+ <TabsGlass.List>
389
+ <TabsGlass.Trigger value="overview">
390
+ <LayoutDashboard className="w-4 h-4 mr-2" />
391
+ Overview
392
+ </TabsGlass.Trigger>
393
+ <TabsGlass.Trigger value="sales">
394
+ <DollarSign className="w-4 h-4 mr-2" />
395
+ Sales
396
+ <Badge className="ml-2">{salesCount}</Badge>
397
+ </TabsGlass.Trigger>
398
+ </TabsGlass.List>
399
+
400
+ <TabsGlass.Content value="overview">
401
+ <OverviewDashboard />
402
+ </TabsGlass.Content>
403
+
404
+ <TabsGlass.Content value="sales">
405
+ <SalesDashboard />
406
+ </TabsGlass.Content>
407
+ </TabsGlass.Root>
408
+ ```
409
+
410
+ ### 2. **Settings Page with Sections**
411
+ ```tsx
412
+ <TabsGlass.Root value={section} onValueChange={setSection}>
413
+ <TabsGlass.List className="border-b border-white/10 pb-2">
414
+ <TabsGlass.Trigger value="profile">Profile</TabsGlass.Trigger>
415
+ <TabsGlass.Trigger value="notifications">Notifications</TabsGlass.Trigger>
416
+ <TabsGlass.Trigger value="billing">Billing</TabsGlass.Trigger>
417
+ </TabsGlass.List>
418
+
419
+ <div className="py-6">
420
+ <TabsGlass.Content value="profile">
421
+ <ProfileForm />
422
+ </TabsGlass.Content>
423
+ {/* ... */}
424
+ </div>
425
+ </TabsGlass.Root>
426
+ ```
427
+
428
+ ### 3. **Product Details with Tabs**
429
+ ```tsx
430
+ <TabsGlass.Root value={detailTab} onValueChange={setDetailTab}>
431
+ <TabsGlass.List>
432
+ <TabsGlass.Trigger value="description">Description</TabsGlass.Trigger>
433
+ <TabsGlass.Trigger value="specs">Specs</TabsGlass.Trigger>
434
+ <TabsGlass.Trigger value="reviews">
435
+ Reviews
436
+ <Badge className="ml-2">{reviewCount}</Badge>
437
+ </TabsGlass.Trigger>
438
+ </TabsGlass.List>
439
+
440
+ <TabsGlass.Content value="description">
441
+ <ProductDescription />
442
+ </TabsGlass.Content>
443
+ {/* ... */}
444
+ </TabsGlass.Root>
445
+ ```
446
+
447
+ ---
448
+
449
+ ## Migration Timeline
450
+
451
+ | Version | Status | Notes |
452
+ |---------|--------|-------|
453
+ | **v0.x** | ✅ Both APIs supported | Legacy API fully functional |
454
+ | **v1.0.0** | 🔥 Legacy removed | Only Compound API available |
455
+
456
+ **Note:** Legacy API was removed in v1.0.0. Use the Compound API as shown above.
457
+
458
+ ---
459
+
460
+ ## Performance Notes
461
+
462
+ - ✅ **Content preservation** - Tab content stays mounted (no re-render on switch)
463
+ - ✅ **Lazy rendering** - Can implement lazy loading for heavy content
464
+ - ✅ **Bundle size** - Compound API adds ~150 bytes (negligible)
465
+ - ✅ **Animation** - Smooth transitions with CSS transforms
466
+
467
+ ---
468
+
469
+ ## Accessibility
470
+
471
+ The Compound API enhances accessibility:
472
+
473
+ - ✅ `TabsGlass.Root` provides ARIA context (`role="tablist"`)
474
+ - ✅ `TabsGlass.Trigger` has `role="tab"`, `aria-selected`, `aria-controls`
475
+ - ✅ `TabsGlass.Content` has `role="tabpanel"`, `aria-labelledby`
476
+ - ✅ Keyboard navigation: Arrow keys to switch tabs, Enter/Space to activate
477
+ - ✅ Focus management: Automatic focus on active tab
478
+
479
+ ---
480
+
481
+ ## Common Pitfalls
482
+
483
+ ### ❌ Mismatched Values
484
+ ```tsx
485
+ // Wrong - value mismatch
486
+ <TabsGlass.Trigger value="profile">Profile</TabsGlass.Trigger>
487
+ <TabsGlass.Content value="user">...</TabsGlass.Content>
488
+ ```
489
+
490
+ ```tsx
491
+ // Correct - matching values
492
+ <TabsGlass.Trigger value="profile">Profile</TabsGlass.Trigger>
493
+ <TabsGlass.Content value="profile">...</TabsGlass.Content>
494
+ ```
495
+
496
+ ### ❌ Missing TabsGlass.List
497
+ ```tsx
498
+ // Wrong - triggers without List wrapper
499
+ <TabsGlass.Root>
500
+ <TabsGlass.Trigger value="tab1">Tab 1</TabsGlass.Trigger>
501
+ </TabsGlass.Root>
502
+ ```
503
+
504
+ ```tsx
505
+ // Correct
506
+ <TabsGlass.Root>
507
+ <TabsGlass.List>
508
+ <TabsGlass.Trigger value="tab1">Tab 1</TabsGlass.Trigger>
509
+ </TabsGlass.List>
510
+ </TabsGlass.Root>
511
+ ```
512
+
513
+ ### ❌ Forgetting onValueChange
514
+ ```tsx
515
+ // Wrong - uncontrolled without defaultValue
516
+ <TabsGlass.Root value={tab}>
517
+ {/* ... */}
518
+ </TabsGlass.Root>
519
+ ```
520
+
521
+ ```tsx
522
+ // Correct - controlled
523
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
524
+ {/* ... */}
525
+ </TabsGlass.Root>
526
+
527
+ // Or uncontrolled with defaultValue
528
+ <TabsGlass.Root defaultValue="overview">
529
+ {/* ... */}
530
+ </TabsGlass.Root>
531
+ ```
532
+
533
+ ---
534
+
535
+ ## Advanced Patterns
536
+
537
+ ### Lazy Loading Content
538
+ ```tsx
539
+ <TabsGlass.Root value={tab} onValueChange={setTab}>
540
+ <TabsGlass.List>
541
+ <TabsGlass.Trigger value="heavy">Heavy Data</TabsGlass.Trigger>
542
+ </TabsGlass.List>
543
+
544
+ <TabsGlass.Content value="heavy">
545
+ {tab === 'heavy' && <HeavyDataComponent />}
546
+ </TabsGlass.Content>
547
+ </TabsGlass.Root>
548
+ ```
549
+
550
+ ### Custom Active Indicator
551
+ ```tsx
552
+ <TabsGlass.List className="relative">
553
+ {tabs.map(t => (
554
+ <TabsGlass.Trigger key={t.value} value={t.value}>
555
+ {t.label}
556
+ </TabsGlass.Trigger>
557
+ ))}
558
+
559
+ {/* Custom animated indicator */}
560
+ <motion.div
561
+ className="absolute bottom-0 h-0.5 bg-gradient-to-r from-purple-500 to-pink-500"
562
+ layoutId="activeTab"
563
+ />
564
+ </TabsGlass.List>
565
+ ```
566
+
567
+ ---
568
+
569
+ ## Need Help?
570
+
571
+ - 📖 See [Storybook examples](http://localhost:6006/?path=/story/components-tabsglass--compound-api)
572
+ - 💬 Ask in [GitHub Discussions](https://github.com/your-org/shadcn-glass-ui-library/discussions)
573
+ - 🐛 Report issues in [GitHub Issues](https://github.com/your-org/shadcn-glass-ui-library/issues)
574
+
575
+ ---
576
+
577
+ **Last updated:** 2025-12-05
578
+ **Status:** ✅ Ready for migration
579
+ **Backward compatibility:** Maintained until v5.0