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,354 @@
1
+ # MetricCardGlass API Redesign
2
+
3
+ ## Goal
4
+
5
+ Make `MetricCardGlass` fully compatible with **shadcn/ui patterns** and **consistent** with other
6
+ Glass UI library components.
7
+
8
+ ---
9
+
10
+ ## 📋 Analysis of Existing Glass UI Patterns
11
+
12
+ ### 1. Variant System Pattern
13
+
14
+ All components follow a unified variant system:
15
+
16
+ #### AlertGlass
17
+
18
+ ```tsx
19
+ variant?: 'default' | 'destructive' | 'success' | 'warning'
20
+ // ^^^^^^^^ ^^^^^^^^^^^^ shadcn/ui compatible
21
+ // ^^^^^^^^ ^^^^^^^^ Glass UI extensions
22
+ ```
23
+
24
+ #### BadgeGlass
25
+
26
+ ```tsx
27
+ variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'info'
28
+ // ^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^ shadcn/ui
29
+ // ^^^^^^^^ ^^^^^^^^ ^^^^^ Glass UI
30
+ ```
31
+
32
+ #### ButtonGlass
33
+
34
+ ```tsx
35
+ variant?: 'primary' | 'secondary' | 'ghost' | 'destructive' | 'success' | 'text'
36
+ // ^^^^^^^^ ^^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^^^^ shadcn/ui-like
37
+ // ^^^^^^^^^ Glass UI
38
+ ```
39
+
40
+ **Conclusion:** Uses `variant` prop with base shadcn/ui variants + extensions.
41
+
42
+ ---
43
+
44
+ ### 2. CSS Variables Pattern
45
+
46
+ All components use CSS variables for styling:
47
+
48
+ ```tsx
49
+ // AlertGlass
50
+ const variantStyles: Record<AlertVariant, AlertStyleVars> = {
51
+ default: {
52
+ bg: 'var(--alert-default-bg)',
53
+ border: 'var(--alert-default-border)',
54
+ text: 'var(--alert-default-text)',
55
+ },
56
+ destructive: { ... },
57
+ success: { ... },
58
+ };
59
+ ```
60
+
61
+ **Conclusion:** Each variant has corresponding CSS variables in the format
62
+ `--component-variant-property`.
63
+
64
+ ---
65
+
66
+ ### 3. Props Interface Pattern
67
+
68
+ Standard structure:
69
+
70
+ ```tsx
71
+ export interface ComponentProps
72
+ extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof componentVariants> {
73
+ // Required props
74
+ readonly label: string;
75
+ readonly value: string | number;
76
+
77
+ // Optional extensions
78
+ readonly icon?: ReactNode;
79
+ readonly variant?: Variant;
80
+ readonly size?: Size;
81
+ }
82
+ ```
83
+
84
+ **Conclusion:** Uses `readonly`, extends `HTMLAttributes`, integrates with CVA
85
+ (class-variance-authority).
86
+
87
+ ---
88
+
89
+ ## 🔍 Analysis of Current MetricCardGlass API
90
+
91
+ ### Problems:
92
+
93
+ 1. **❌ No `variant` system**
94
+ - Uses custom `color` instead of standard `variant`
95
+ - Colors: `'emerald' | 'amber' | 'blue' | 'red'` don't match shadcn/ui
96
+
97
+ 2. **❌ Complex data model**
98
+ - `value` as percentage 0-100 + `valueFormatter` - unintuitive
99
+ - Requires math for displaying real values
100
+
101
+ 3. **❌ Incompatible with shadcn/ui**
102
+ - Uses `label` instead of standard `title` from shadcn/ui Card
103
+ - No `description` support
104
+
105
+ 4. **❌ `trend` object too complex**
106
+ - Requires `{ value: number, direction: 'up' | 'down', label?: string }`
107
+ - shadcn/ui typically uses a simple `change` string
108
+
109
+ ---
110
+
111
+ ## ✅ Proposed Solution
112
+
113
+ ### New API (v2.0)
114
+
115
+ ```tsx
116
+ // ========================================
117
+ // TYPES
118
+ // ========================================
119
+
120
+ export type MetricVariant =
121
+ | 'default' // shadcn/ui base
122
+ | 'secondary' // shadcn/ui base
123
+ | 'success' // Glass UI extension
124
+ | 'warning' // Glass UI extension
125
+ | 'destructive'; // shadcn/ui base
126
+
127
+ export type TrendDirection = 'up' | 'down' | 'neutral';
128
+
129
+ export interface MetricChange {
130
+ /** Change value (e.g., 12.5 for +12.5%) */
131
+ readonly value: number;
132
+ /** Trend direction */
133
+ readonly direction?: TrendDirection;
134
+ /** Optional period label (e.g., "vs last month") */
135
+ readonly period?: string;
136
+ }
137
+
138
+ export interface MetricCardGlassProps
139
+ extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof metricCardVariants> {
140
+ // ========================================
141
+ // CORE PROPS (shadcn/ui compatible)
142
+ // ========================================
143
+
144
+ /** Metric title (shadcn/ui Card: title) */
145
+ readonly title: string;
146
+
147
+ /** Display value (shadcn/ui Card: value) */
148
+ readonly value: string | number;
149
+
150
+ /** Optional description (shadcn/ui Card: description) */
151
+ readonly description?: string;
152
+
153
+ /** Change indicator (shadcn/ui: change) */
154
+ readonly change?: string | number | MetricChange;
155
+
156
+ /** Semantic variant (shadcn/ui: variant) */
157
+ readonly variant?: MetricVariant;
158
+
159
+ // ========================================
160
+ // GLASS UI EXTENSIONS
161
+ // ========================================
162
+
163
+ /** Icon to display */
164
+ readonly icon?: ReactNode;
165
+
166
+ /** Data for sparkline visualization */
167
+ readonly sparklineData?: readonly number[];
168
+
169
+ /** Show sparkline chart */
170
+ readonly showSparkline?: boolean;
171
+
172
+ /** Show progress bar (value must be 0-100) */
173
+ readonly showProgress?: boolean;
174
+
175
+ /** Progress percentage (0-100, separate from display value) */
176
+ readonly progress?: number;
177
+ }
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 📝 Usage Examples
183
+
184
+ ### Simple variant (shadcn/ui style)
185
+
186
+ ```tsx
187
+ <MetricCardGlass
188
+ title="Total Revenue"
189
+ value="$45,231"
190
+ change="+12.5%"
191
+ variant="success"
192
+ icon={<DollarSign />}
193
+ />
194
+ ```
195
+
196
+ ### With detailed change object
197
+
198
+ ```tsx
199
+ <MetricCardGlass
200
+ title="Total Revenue"
201
+ value="$45,231"
202
+ change={{
203
+ value: 12.5,
204
+ direction: 'up',
205
+ period: 'vs last month',
206
+ }}
207
+ variant="success"
208
+ icon={<DollarSign />}
209
+ />
210
+ ```
211
+
212
+ ### With progress and sparkline (Glass UI extensions)
213
+
214
+ ```tsx
215
+ <MetricCardGlass
216
+ title="Completion Rate"
217
+ value="85%"
218
+ description="Project progress"
219
+ change="+5.2%"
220
+ variant="success"
221
+ progress={85}
222
+ sparklineData={[70, 75, 78, 80, 82, 84, 85]}
223
+ showProgress
224
+ showSparkline
225
+ />
226
+ ```
227
+
228
+ ### Backward Compatibility (optional)
229
+
230
+ To support the old API, aliases can be added:
231
+
232
+ ```tsx
233
+ <MetricCardGlass
234
+ label="Total Revenue" // ⚠️ deprecated, use title
235
+ value={75}
236
+ valueFormatter={(v) => `$${v}`} // ⚠️ deprecated, use value directly
237
+ color="emerald" // ⚠️ deprecated, use variant="success"
238
+ />
239
+ ```
240
+
241
+ ---
242
+
243
+ ## 🎨 Mapping: old API → new API
244
+
245
+ | Old API | New API | Note |
246
+ | ----------------------------- | -------------------------- | ------------------------------------- |
247
+ | `label` | `title` | shadcn/ui standard |
248
+ | `value: number (0-100)` | `value: string \| number` | Simplification |
249
+ | `valueFormatter` | — | Removed, format before passing |
250
+ | `valueSuffix` | `description` | shadcn/ui standard |
251
+ | `color: 'emerald'` | `variant: 'success'` | Unification |
252
+ | `color: 'amber'` | `variant: 'warning'` | Unification |
253
+ | `color: 'blue'` | `variant: 'default'` | Unification |
254
+ | `color: 'red'` | `variant: 'destructive'` | Unification |
255
+ | `trend: { value, direction }` | `change: string \| object` | Simplification |
256
+ | — | `progress: number` | New: separation of value and progress |
257
+
258
+ ---
259
+
260
+ ## 🛠 CSS Variables Structure
261
+
262
+ Following the library pattern:
263
+
264
+ ```css
265
+ /* glass-theme.css */
266
+
267
+ /* Default variant */
268
+ --metric-default-bg: rgba(255, 255, 255, 0.08);
269
+ --metric-default-border: rgba(255, 255, 255, 0.15);
270
+ --metric-default-text: var(--text-primary);
271
+ --metric-default-glow: 0 0 20px rgba(59, 130, 246, 0.3);
272
+
273
+ /* Success variant (emerald) */
274
+ --metric-success-bg: rgba(16, 185, 129, 0.08);
275
+ --metric-success-border: rgba(16, 185, 129, 0.25);
276
+ --metric-success-text: rgb(52, 211, 153);
277
+ --metric-success-glow: 0 0 20px rgba(16, 185, 129, 0.3);
278
+
279
+ /* Warning variant (amber) */
280
+ --metric-warning-bg: rgba(245, 158, 11, 0.08);
281
+ --metric-warning-border: rgba(245, 158, 11, 0.25);
282
+ --metric-warning-text: rgb(251, 191, 36);
283
+ --metric-warning-glow: 0 0 20px rgba(245, 158, 11, 0.3);
284
+
285
+ /* Destructive variant (red/rose) */
286
+ --metric-destructive-bg: rgba(244, 63, 94, 0.08);
287
+ --metric-destructive-border: rgba(244, 63, 94, 0.25);
288
+ --metric-destructive-text: rgb(251, 113, 133);
289
+ --metric-destructive-glow: 0 0 20px rgba(244, 63, 94, 0.3);
290
+ ```
291
+
292
+ ---
293
+
294
+ ## 🎯 Advantages of New API
295
+
296
+ ### 1. **shadcn/ui compatibility** ✅
297
+
298
+ - Uses standard props: `title`, `value`, `description`, `variant`
299
+ - Can easily be replaced with shadcn/ui Card without API changes
300
+
301
+ ### 2. **Consistency with the library** ✅
302
+
303
+ - Follows `AlertGlass`, `BadgeGlass`, `ButtonGlass` patterns
304
+ - Uses unified `variant` system
305
+ - CSS variables in unified format
306
+
307
+ ### 3. **Ease of use** ✅
308
+
309
+ - No need for `valueFormatter` and math
310
+ - Simple string `change="+12.5%"` instead of object
311
+ - Clear separation of `value` (display) and `progress` (0-100)
312
+
313
+ ### 4. **Flexibility** ✅
314
+
315
+ - Supports both simple strings and objects for `change`
316
+ - Optional Glass UI extensions (sparkline, progress)
317
+ - Backward compatibility through aliases (optional)
318
+
319
+ ---
320
+
321
+ ## 🚀 Migration Plan
322
+
323
+ ### Step 1: Create new component
324
+
325
+ - [ ] Create `metric-card-glass-v2.tsx` with new API
326
+ - [ ] Add CVA variants to `metric-card-glass-variants.ts`
327
+ - [ ] Add CSS variables to `glass-theme.css`
328
+
329
+ ### Step 2: Testing
330
+
331
+ - [ ] Create stories for new API
332
+ - [ ] Add unit tests
333
+ - [ ] Add visual regression tests
334
+
335
+ ### Step 3: Migration
336
+
337
+ - [ ] Update `dashboard.stories.tsx`
338
+ - [ ] Update other usages
339
+ - [ ] Add deprecation warnings for old API
340
+
341
+ ### Step 4: Documentation
342
+
343
+ - [ ] Update Storybook docs
344
+ - [ ] Add migration guide
345
+ - [ ] Update README
346
+
347
+ ---
348
+
349
+ ## 📚 References
350
+
351
+ - [Card - shadcn/ui](https://ui.shadcn.com/docs/components/card)
352
+ - [The Anatomy of shadcn/ui Components | Vercel Academy](https://vercel.com/academy/shadcn-ui/extending-shadcn-ui-with-custom-components)
353
+ - [Shadcn UI Dashboard Widgets](https://shadcnstore.com/blocks/application/widgets)
354
+ - [Stat Cards - Shadcn UI Kit](https://shadcnuikit.com/components/cards/stat)