shadcn-glass-ui 1.0.10 → 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.
- package/CHANGELOG.md +259 -16
- package/README.md +248 -28
- package/context7.json +58 -0
- package/dist/cli/index.cjs +470 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.ts +18 -0
- package/dist/cli/index.js +469 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/components.cjs +4 -4
- package/dist/components.d.ts +153 -22
- package/dist/components.js +2 -2
- package/dist/hooks.cjs +2 -2
- package/dist/index.cjs +872 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -2390
- package/dist/index.js +844 -3
- package/dist/index.js.map +1 -1
- package/dist/r/ai-card-glass.json +5 -12
- package/dist/r/avatar-glass.json +5 -15
- package/dist/r/circular-metric-glass.json +5 -11
- package/dist/r/circular-progress-glass.json +5 -12
- package/dist/r/combobox-glass.json +5 -13
- package/dist/r/flag-alert-glass.json +5 -11
- package/dist/r/flags-section-glass.json +5 -12
- package/dist/r/insight-card-glass.json +17 -0
- package/dist/r/interactive-card.json +5 -12
- package/dist/r/language-bar-glass.json +5 -11
- package/dist/r/metric-card-glass.json +6 -13
- package/dist/r/metrics-grid-glass.json +5 -11
- package/dist/r/modal-glass.json +5 -15
- package/dist/r/popover-glass.json +1 -1
- package/dist/r/progress-glass.json +5 -13
- package/dist/r/registry.json +20 -2
- package/dist/r/segmented-control-glass.json +5 -11
- package/dist/r/sparkline-glass.json +17 -0
- package/dist/r/stepper-glass.json +33 -0
- package/dist/r/tabs-glass.json +4 -9
- package/dist/r/trust-score-card-glass.json +5 -12
- package/dist/r/year-card-glass.json +5 -13
- package/dist/shadcn-glass-ui.css +1 -1
- package/dist/{theme-context-XtasSxRT.cjs → theme-context-CVW50BKW.cjs} +2 -2
- package/dist/{theme-context-XtasSxRT.cjs.map → theme-context-CVW50BKW.cjs.map} +1 -1
- package/dist/themes.cjs +1 -1
- package/dist/trust-score-card-glass-BcZbul0P.js +26895 -0
- package/dist/trust-score-card-glass-BcZbul0P.js.map +1 -0
- package/dist/trust-score-card-glass-r3qM09Jp.cjs +27689 -0
- package/dist/trust-score-card-glass-r3qM09Jp.cjs.map +1 -0
- package/dist/{use-focus-BbpE2qGq.cjs → use-focus-ZE8ozmZE.cjs} +2 -2
- package/dist/{use-focus-BbpE2qGq.cjs.map → use-focus-ZE8ozmZE.cjs.map} +1 -1
- package/dist/{use-wallpaper-tint-CIqtoETa.cjs → use-wallpaper-tint-BuS80tbN.cjs} +2 -2
- package/dist/{use-wallpaper-tint-CIqtoETa.cjs.map → use-wallpaper-tint-BuS80tbN.cjs.map} +1 -1
- package/dist/{utils-CGCOTvxT.js → utils-CcyeqpKQ.js} +1 -1
- package/dist/{utils-CGCOTvxT.js.map → utils-CcyeqpKQ.js.map} +1 -1
- package/dist/{utils-CriE74ig.cjs → utils-DLXayspX.cjs} +2 -2
- package/dist/{utils-CriE74ig.cjs.map → utils-DLXayspX.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/docs/AI_IMPROVEMENTS_COMPLETE.md +574 -0
- package/docs/AI_USAGE.md +1328 -0
- package/docs/API_PATTERNS_COMPARISON.md +418 -0
- package/docs/BEST_PRACTICES.md +800 -0
- package/docs/COMPLIANCE_CHECKLIST.md +307 -0
- package/docs/COMPLIANCE_TESTING.md +436 -0
- package/docs/COMPONENTS_CATALOG.md +1076 -0
- package/docs/CSS_VARIABLES_AUDIT.md +306 -0
- package/docs/CSS_VARIABLES_REFACTORING_PLAN.md +330 -0
- package/docs/EXPORTS_MAP.json +875 -0
- package/docs/EXPORTS_STRUCTURE.md +729 -0
- package/docs/GETTING_STARTED.md +655 -0
- package/docs/METRIC_CARD_API_REDESIGN.md +354 -0
- package/docs/PRIMITIVE_MAPPING.md +404 -0
- package/docs/PUBLISHING.md +593 -0
- package/docs/REGISTRY_SUMMARY.md +96 -0
- package/docs/REGISTRY_USAGE.md +339 -0
- package/docs/SECURITY.md +117 -0
- package/docs/THEME_CREATION_GUIDE.md +455 -0
- package/docs/TOKEN_ARCHITECTURE.md +365 -0
- package/docs/announcements/v1.0.5-devto.md +363 -0
- package/docs/announcements/v1.0.5-reddit.md +115 -0
- package/docs/announcements/v1.0.5-twitter.md +70 -0
- package/docs/api/README.md +725 -0
- package/docs/api/functions/ThemeProvider.md +21 -0
- package/docs/api/functions/cn.md +27 -0
- package/docs/api/functions/getNextTheme.md +21 -0
- package/docs/api/functions/getThemeConfig.md +21 -0
- package/docs/api/functions/useFocus.md +53 -0
- package/docs/api/functions/useHover.md +47 -0
- package/docs/api/functions/useResponsive.md +31 -0
- package/docs/api/functions/useTheme.md +15 -0
- package/docs/api/functions/useWallpaperTint.md +36 -0
- package/docs/api/globals.md +139 -0
- package/docs/api/interfaces/AlertGlassProps.md +131 -0
- package/docs/api/interfaces/AvatarGlassProps.md +114 -0
- package/docs/api/interfaces/BadgeGlassProps.md +118 -0
- package/docs/api/interfaces/ButtonGlassProps.md +179 -0
- package/docs/api/interfaces/CheckboxGlassProps.md +125 -0
- package/docs/api/interfaces/DropdownGlassProps.md +123 -0
- package/docs/api/interfaces/DropdownItem.md +53 -0
- package/docs/api/interfaces/GlassCardProps.md +151 -0
- package/docs/api/interfaces/InputGlassProps.md +169 -0
- package/docs/api/interfaces/NotificationGlassProps.md +67 -0
- package/docs/api/interfaces/ProgressGlassProps.md +49 -0
- package/docs/api/interfaces/SkeletonGlassProps.md +41 -0
- package/docs/api/interfaces/SliderGlassProps.md +107 -0
- package/docs/api/interfaces/TabItem.md +25 -0
- package/docs/api/interfaces/ThemeConfig.md +25 -0
- package/docs/api/interfaces/ThemeContextValue.md +47 -0
- package/docs/api/interfaces/ToggleGlassProps.md +59 -0
- package/docs/api/interfaces/TooltipGlassProps.md +119 -0
- package/docs/api/type-aliases/AlertType.md +11 -0
- package/docs/api/type-aliases/AlertVariant.md +11 -0
- package/docs/api/type-aliases/AvatarSize.md +11 -0
- package/docs/api/type-aliases/AvatarStatus.md +13 -0
- package/docs/api/type-aliases/BadgeSize.md +11 -0
- package/docs/api/type-aliases/BadgeVariant.md +11 -0
- package/docs/api/type-aliases/ButtonGlassSize.md +11 -0
- package/docs/api/type-aliases/ButtonGlassVariant.md +11 -0
- package/docs/api/type-aliases/DropdownAlign.md +11 -0
- package/docs/api/type-aliases/GlowType.md +11 -0
- package/docs/api/type-aliases/InputGlassSize.md +11 -0
- package/docs/api/type-aliases/IntensityType.md +11 -0
- package/docs/api/type-aliases/ModalSize.md +11 -0
- package/docs/api/type-aliases/NotificationType.md +11 -0
- package/docs/api/type-aliases/PaddingType.md +11 -0
- package/docs/api/type-aliases/ProgressGradient.md +11 -0
- package/docs/api/type-aliases/ProgressSize.md +11 -0
- package/docs/api/type-aliases/SkeletonVariant.md +11 -0
- package/docs/api/type-aliases/Theme.md +11 -0
- package/docs/api/type-aliases/ToggleGlassSize.md +11 -0
- package/docs/api/type-aliases/TooltipPosition.md +11 -0
- package/docs/api/variables/AICardGlass.md +11 -0
- package/docs/api/variables/AlertGlass.md +11 -0
- package/docs/api/variables/AvatarGlass.md +11 -0
- package/docs/api/variables/BadgeGlass.md +11 -0
- package/docs/api/variables/BaseProgressGlass.md +11 -0
- package/docs/api/variables/ButtonGlass.md +11 -0
- package/docs/api/variables/CareerStatsGlass.md +11 -0
- package/docs/api/variables/CareerStatsHeaderGlass.md +11 -0
- package/docs/api/variables/CheckboxGlass.md +11 -0
- package/docs/api/variables/CircularMetricGlass.md +22 -0
- package/docs/api/variables/CircularProgressGlass.md +11 -0
- package/docs/api/variables/ComboBoxGlass.md +27 -0
- package/docs/api/variables/ContributionMetricsGlass.md +11 -0
- package/docs/api/variables/DropdownGlass.md +11 -0
- package/docs/api/variables/ExpandableHeaderGlass.md +11 -0
- package/docs/api/variables/FlagAlertGlass.md +11 -0
- package/docs/api/variables/FlagsSectionGlass.md +11 -0
- package/docs/api/variables/FormFieldWrapper.md +44 -0
- package/docs/api/variables/GlassCard.md +11 -0
- package/docs/api/variables/HeaderBrandingGlass.md +11 -0
- package/docs/api/variables/HeaderNavGlass.md +11 -0
- package/docs/api/variables/IconButtonGlass.md +11 -0
- package/docs/api/variables/InputGlass.md +11 -0
- package/docs/api/variables/InteractiveCard.md +45 -0
- package/docs/api/variables/LanguageBarGlass.md +11 -0
- package/docs/api/variables/MetricCardGlass.md +11 -0
- package/docs/api/variables/MetricsGridGlass.md +11 -0
- package/docs/api/variables/ModalGlass.md +72 -0
- package/docs/api/variables/NotificationGlass.md +11 -0
- package/docs/api/variables/PopoverGlass.md +11 -0
- package/docs/api/variables/ProfileAvatarGlass.md +11 -0
- package/docs/api/variables/ProfileHeaderGlass.md +11 -0
- package/docs/api/variables/ProgressGlass.md +11 -0
- package/docs/api/variables/ProjectsListGlass.md +11 -0
- package/docs/api/variables/RainbowProgressGlass.md +11 -0
- package/docs/api/variables/RepositoryCardGlass.md +11 -0
- package/docs/api/variables/RepositoryHeaderGlass.md +11 -0
- package/docs/api/variables/RepositoryMetadataGlass.md +11 -0
- package/docs/api/variables/SearchBoxGlass.md +11 -0
- package/docs/api/variables/SegmentedControlGlass.md +11 -0
- package/docs/api/variables/SkeletonGlass.md +11 -0
- package/docs/api/variables/SliderGlass.md +11 -0
- package/docs/api/variables/SortDropdownGlass.md +11 -0
- package/docs/api/variables/StatItemGlass.md +11 -0
- package/docs/api/variables/StatusIndicatorGlass.md +11 -0
- package/docs/api/variables/THEMES.md +11 -0
- package/docs/api/variables/THEME_CONFIG.md +11 -0
- package/docs/api/variables/TabsGlass.md +52 -0
- package/docs/api/variables/ThemeToggleGlass.md +11 -0
- package/docs/api/variables/ToggleGlass.md +11 -0
- package/docs/api/variables/TooltipGlass.md +11 -0
- package/docs/api/variables/TouchTarget.md +35 -0
- package/docs/api/variables/TrustScoreCardGlass.md +11 -0
- package/docs/api/variables/TrustScoreDisplayGlass.md +11 -0
- package/docs/api/variables/UserInfoGlass.md +11 -0
- package/docs/api/variables/UserStatsLineGlass.md +11 -0
- package/docs/api/variables/YearCardGlass.md +11 -0
- package/docs/api/variables/alertVariants.md +21 -0
- package/docs/api/variables/avatarSizes.md +21 -0
- package/docs/api/variables/badgeVariants.md +21 -0
- package/docs/api/variables/buttonGlassVariants.md +21 -0
- package/docs/api/variables/cardIntensity.md +21 -0
- package/docs/api/variables/dropdownAlign.md +21 -0
- package/docs/api/variables/inputVariants.md +21 -0
- package/docs/api/variables/modalSizes.md +21 -0
- package/docs/api/variables/notificationVariants.md +21 -0
- package/docs/api/variables/progressSizes.md +21 -0
- package/docs/api/variables/shadcnAlertVariants.md +21 -0
- package/docs/api/variables/shadcnBadgeVariants.md +21 -0
- package/docs/api/variables/shadcnButtonVariants.md +21 -0
- package/docs/api/variables/skeletonVariants.md +21 -0
- package/docs/api/variables/statusSizes.md +21 -0
- package/docs/api/variables/toggleSizes.md +21 -0
- package/docs/api/variables/tooltipPositions.md +21 -0
- package/docs/design-system/UI_DESIGN.md +628 -0
- package/docs/migration/CSS_VARIABLES_MIGRATION_2.0.md +325 -0
- package/docs/migration/modal-glass-compound-api.md +458 -0
- package/docs/migration/select-to-combobox.md +386 -0
- package/docs/migration/tabs-glass-compound-api.md +579 -0
- package/docs/technical/DEPENDENCIES.md +291 -0
- package/docs/visual-testing-guide.md +324 -0
- package/package.json +16 -3
- package/dist/trust-score-card-glass-CNcQveNY.cjs +0 -8231
- package/dist/trust-score-card-glass-CNcQveNY.cjs.map +0 -1
- package/dist/trust-score-card-glass-CowcDyxH.js +0 -7795
- package/dist/trust-score-card-glass-CowcDyxH.js.map +0 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# CSS Variables Migration Guide: v1.x → v2.0.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Version 2.0.0 removes deprecated metric color variables in favor of semantic naming aligned with
|
|
6
|
+
shadcn/ui standards.
|
|
7
|
+
|
|
8
|
+
### Why This Change?
|
|
9
|
+
|
|
10
|
+
- **Semantic Clarity**: Color names (emerald, amber, blue, red) → semantic roles (success, warning,
|
|
11
|
+
default, destructive)
|
|
12
|
+
- **shadcn/ui Compatibility**: Aligns with shadcn/ui variant naming conventions
|
|
13
|
+
- **Consistency**: Matches AlertGlass/BadgeGlass/ButtonGlass variant prop values
|
|
14
|
+
- **Token Architecture**: Part of the 3-layer token system migration
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Breaking Changes
|
|
19
|
+
|
|
20
|
+
### Complete Variable Mapping
|
|
21
|
+
|
|
22
|
+
| Deprecated (v1.x - REMOVED) | Replacement (v2.0+) | Use Case |
|
|
23
|
+
| --------------------------- | ----------------------------- | --------------------------- |
|
|
24
|
+
| `--metric-emerald-bg` | `--metric-success-bg` | Positive metric backgrounds |
|
|
25
|
+
| `--metric-emerald-text` | `--metric-success-text` | Success metric text |
|
|
26
|
+
| `--metric-emerald-border` | `--metric-success-border` | Success metric borders |
|
|
27
|
+
| `--metric-emerald-glow` | `--metric-success-glow` | Success glow effects |
|
|
28
|
+
| `--metric-amber-bg` | `--metric-warning-bg` | Warning metric backgrounds |
|
|
29
|
+
| `--metric-amber-text` | `--metric-warning-text` | Warning metric text |
|
|
30
|
+
| `--metric-amber-border` | `--metric-warning-border` | Warning borders |
|
|
31
|
+
| `--metric-amber-glow` | `--metric-warning-glow` | Warning glow effects |
|
|
32
|
+
| `--metric-blue-bg` | `--metric-default-bg` | Neutral metric backgrounds |
|
|
33
|
+
| `--metric-blue-text` | `--metric-default-text` | Default metric text |
|
|
34
|
+
| `--metric-blue-border` | `--metric-default-border` | Default borders |
|
|
35
|
+
| `--metric-blue-glow` | `--metric-default-glow` | Default glow effects |
|
|
36
|
+
| `--metric-red-bg` | `--metric-destructive-bg` | Error/danger backgrounds |
|
|
37
|
+
| `--metric-red-text` | `--metric-destructive-text` | Error/danger text |
|
|
38
|
+
| `--metric-red-border` | `--metric-destructive-border` | Error/danger borders |
|
|
39
|
+
| `--metric-red-glow` | `--metric-destructive-glow` | Error/danger glow effects |
|
|
40
|
+
|
|
41
|
+
**Total affected variables:** 16 (4 color families × 4 properties each)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Automated Migration
|
|
46
|
+
|
|
47
|
+
### Step 1: Find Affected Files
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Search your codebase for deprecated variables
|
|
51
|
+
grep -rn "metric-emerald\|metric-amber\|metric-blue\|metric-red" src/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Step 2: Automated Replacement
|
|
55
|
+
|
|
56
|
+
#### macOS/BSD
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
find src/ -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.css" -o -name "*.scss" \) -exec sed -i '' \
|
|
60
|
+
-e 's/--metric-emerald-/--metric-success-/g' \
|
|
61
|
+
-e 's/--metric-amber-/--metric-warning-/g' \
|
|
62
|
+
-e 's/--metric-blue-/--metric-default-/g' \
|
|
63
|
+
-e 's/--metric-red-/--metric-destructive-/g' \
|
|
64
|
+
{} +
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Linux
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
find src/ -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.css" -o -name "*.scss" \) -exec sed -i \
|
|
71
|
+
-e 's/--metric-emerald-/--metric-success-/g' \
|
|
72
|
+
-e 's/--metric-amber-/--metric-warning-/g' \
|
|
73
|
+
-e 's/--metric-blue-/--metric-default-/g' \
|
|
74
|
+
-e 's/--metric-red-/--metric-destructive-/g' \
|
|
75
|
+
{} +
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Windows (PowerShell)
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
Get-ChildItem -Path src\ -Include *.tsx,*.ts,*.css,*.scss -Recurse | ForEach-Object {
|
|
82
|
+
(Get-Content $_.FullName) `
|
|
83
|
+
-replace '--metric-emerald-', '--metric-success-' `
|
|
84
|
+
-replace '--metric-amber-', '--metric-warning-' `
|
|
85
|
+
-replace '--metric-blue-', '--metric-default-' `
|
|
86
|
+
-replace '--metric-red-', '--metric-destructive-' |
|
|
87
|
+
Set-Content $_.FullName
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 3: Verify Changes
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run typecheck # TypeScript validation
|
|
95
|
+
npm run lint # ESLint checks
|
|
96
|
+
npm test # Run test suite
|
|
97
|
+
npm run build # Production build test
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Manual Migration Examples
|
|
103
|
+
|
|
104
|
+
### Example 1: Custom CSS
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
/* ❌ v1.x (REMOVED in v2.0) */
|
|
108
|
+
.metric-card-success {
|
|
109
|
+
background: var(--metric-emerald-bg);
|
|
110
|
+
color: var(--metric-emerald-text);
|
|
111
|
+
border: 1px solid var(--metric-emerald-border);
|
|
112
|
+
box-shadow: var(--metric-emerald-glow);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ✅ v2.0+ */
|
|
116
|
+
.metric-card-success {
|
|
117
|
+
background: var(--metric-success-bg);
|
|
118
|
+
color: var(--metric-success-text);
|
|
119
|
+
border: 1px solid var(--metric-success-border);
|
|
120
|
+
box-shadow: var(--metric-success-glow);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Example 2: Tailwind Arbitrary Values
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
/* ❌ v1.x */
|
|
128
|
+
<div className="bg-[var(--metric-amber-bg)] text-[var(--metric-amber-text)]">
|
|
129
|
+
Warning Metric
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
/* ✅ v2.0+ */
|
|
133
|
+
<div className="bg-[var(--metric-warning-bg)] text-[var(--metric-warning-text)]">
|
|
134
|
+
Warning Metric
|
|
135
|
+
</div>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Example 3: Inline Styles
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
/* ❌ v1.x */
|
|
142
|
+
<div style={{
|
|
143
|
+
background: 'var(--metric-blue-bg)',
|
|
144
|
+
color: 'var(--metric-blue-text)',
|
|
145
|
+
border: '1px solid var(--metric-blue-border)'
|
|
146
|
+
}}>
|
|
147
|
+
Default Metric
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
/* ✅ v2.0+ */
|
|
151
|
+
<div style={{
|
|
152
|
+
background: 'var(--metric-default-bg)',
|
|
153
|
+
color: 'var(--metric-default-text)',
|
|
154
|
+
border: '1px solid var(--metric-default-border)'
|
|
155
|
+
}}>
|
|
156
|
+
Default Metric
|
|
157
|
+
</div>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Example 4: Styled Components / Emotion
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
/* ❌ v1.x */
|
|
164
|
+
const StyledMetric = styled.div`
|
|
165
|
+
background: var(--metric-red-bg);
|
|
166
|
+
color: var(--metric-red-text);
|
|
167
|
+
box-shadow: var(--metric-red-glow);
|
|
168
|
+
`;
|
|
169
|
+
|
|
170
|
+
/* ✅ v2.0+ */
|
|
171
|
+
const StyledMetric = styled.div`
|
|
172
|
+
background: var(--metric-destructive-bg);
|
|
173
|
+
color: var(--metric-destructive-text);
|
|
174
|
+
box-shadow: var(--metric-destructive-glow);
|
|
175
|
+
`;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Migration Checklist
|
|
181
|
+
|
|
182
|
+
- [ ] Search codebase for deprecated variables:
|
|
183
|
+
`grep -rn "metric-emerald|metric-amber|metric-blue|metric-red" src/`
|
|
184
|
+
- [ ] Run automated replacement script (or manual find-replace in IDE)
|
|
185
|
+
- [ ] Verify TypeScript compilation: `npm run typecheck`
|
|
186
|
+
- [ ] Run linter: `npm run lint`
|
|
187
|
+
- [ ] Run test suite: `npm test`
|
|
188
|
+
- [ ] Test production build: `npm run build`
|
|
189
|
+
- [ ] Visual regression testing (if applicable)
|
|
190
|
+
- [ ] Manual testing of affected components
|
|
191
|
+
- [ ] Update custom theme files (if any)
|
|
192
|
+
- [ ] Commit changes with clear message: `chore: migrate CSS variables to v2.0.0 semantic naming`
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Timeline
|
|
197
|
+
|
|
198
|
+
| Version | Status | Deprecated Variables |
|
|
199
|
+
| -------------------- | ------------ | ------------------------------------------------ |
|
|
200
|
+
| **v1.0.0 - v1.0.11** | ✅ Supported | Work via CSS aliases (with deprecation warnings) |
|
|
201
|
+
| **v2.0.0** | 🚀 Current | ❌ **REMOVED** (breaking change) |
|
|
202
|
+
| **v2.1.0+** | ⏭️ Future | Only semantic variables supported |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Affected Components
|
|
207
|
+
|
|
208
|
+
The following components may use metric color variables in custom implementations:
|
|
209
|
+
|
|
210
|
+
### Library Components (Already Migrated)
|
|
211
|
+
|
|
212
|
+
- MetricCardGlass ✅
|
|
213
|
+
- CircularMetricGlass ✅
|
|
214
|
+
- MetricsGridGlass ✅
|
|
215
|
+
- YearCardGlass (with sparkline metrics) ✅
|
|
216
|
+
|
|
217
|
+
### User Code (Requires Migration)
|
|
218
|
+
|
|
219
|
+
- Custom dashboard components ⚠️
|
|
220
|
+
- Custom metric displays ⚠️
|
|
221
|
+
- Custom themes using metric variables ⚠️
|
|
222
|
+
- Any component referencing `--metric-emerald-*`, `--metric-amber-*`, `--metric-blue-*`,
|
|
223
|
+
`--metric-red-*`
|
|
224
|
+
|
|
225
|
+
**Note:** shadcn-glass-ui v2.0.0 library code is already migrated. This guide is for **your code**
|
|
226
|
+
that may reference these variables.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## IDE-Specific Migration
|
|
231
|
+
|
|
232
|
+
### VS Code
|
|
233
|
+
|
|
234
|
+
1. Open Find & Replace (Cmd/Ctrl + Shift + H)
|
|
235
|
+
2. Enable regex mode (.\*icon)
|
|
236
|
+
3. Search: `--metric-(emerald|amber|blue|red)-`
|
|
237
|
+
4. Replace with corresponding semantic names manually
|
|
238
|
+
|
|
239
|
+
### WebStorm / IntelliJ IDEA
|
|
240
|
+
|
|
241
|
+
1. Edit → Find → Replace in Path (Cmd/Ctrl + Shift + R)
|
|
242
|
+
2. Enable regex mode
|
|
243
|
+
3. Use same pattern as VS Code
|
|
244
|
+
|
|
245
|
+
### Vim / Neovim
|
|
246
|
+
|
|
247
|
+
```vim
|
|
248
|
+
:%s/--metric-emerald-/--metric-success-/gc
|
|
249
|
+
:%s/--metric-amber-/--metric-warning-/gc
|
|
250
|
+
:%s/--metric-blue-/--metric-default-/gc
|
|
251
|
+
:%s/--metric-red-/--metric-destructive-/gc
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Troubleshooting
|
|
257
|
+
|
|
258
|
+
### Issue: Variables not working after migration
|
|
259
|
+
|
|
260
|
+
**Cause:** Browser CSS cache not cleared
|
|
261
|
+
|
|
262
|
+
**Fix:**
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Hard refresh in browser
|
|
266
|
+
# Chrome/Firefox: Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows/Linux)
|
|
267
|
+
|
|
268
|
+
# Or clear browser cache manually
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Issue: Theme colors look wrong after migration
|
|
272
|
+
|
|
273
|
+
**Cause:** Custom theme file still using old variables
|
|
274
|
+
|
|
275
|
+
**Fix:** Check custom theme files (if any) and update them:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
grep -r "metric-emerald\|metric-amber\|metric-blue\|metric-red" src/styles/
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Issue: Build fails after migration
|
|
282
|
+
|
|
283
|
+
**Cause:** Missed some occurrences in template literals or computed styles
|
|
284
|
+
|
|
285
|
+
**Fix:** Search more thoroughly:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Search in all file types
|
|
289
|
+
grep -rn "metric-emerald\|metric-amber\|metric-blue\|metric-red" .
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Related Documentation
|
|
295
|
+
|
|
296
|
+
- **[Token Architecture Guide](../TOKEN_ARCHITECTURE.md)** - Complete 3-layer token system
|
|
297
|
+
documentation
|
|
298
|
+
- **[Theme Creation Guide](../THEME_CREATION_GUIDE.md)** - Create custom themes in 15 minutes
|
|
299
|
+
- **[CSS Variables Audit](../CSS_VARIABLES_AUDIT.md)** - Complete list of 296+ variables per theme
|
|
300
|
+
- **[CHANGELOG](../../CHANGELOG.md)** - Full version history
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Need Help?
|
|
305
|
+
|
|
306
|
+
- 📖 [Token Architecture Guide](../TOKEN_ARCHITECTURE.md)
|
|
307
|
+
- 🎨 [Theme Creation Guide](../THEME_CREATION_GUIDE.md)
|
|
308
|
+
- 🐛 [Report Issues](https://github.com/Yhooi2/shadcn-glass-ui-library/issues)
|
|
309
|
+
- 💬 [Discussions](https://github.com/Yhooi2/shadcn-glass-ui-library/discussions)
|
|
310
|
+
- 📧 [Contact Support](https://github.com/Yhooi2/shadcn-glass-ui-library/issues/new/choose)
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Migration Success Stories
|
|
315
|
+
|
|
316
|
+
> "The automated script worked perfectly! Migrated our entire codebase in under 5 minutes." -
|
|
317
|
+
> Anonymous User
|
|
318
|
+
|
|
319
|
+
> "The semantic naming makes much more sense. Should have been this way from the start!" - Developer
|
|
320
|
+
> Feedback
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
**Last Updated:** 2025-12-11 **Version:** 2.0.0 **Migration Difficulty:** Easy (automated script
|
|
325
|
+
provided) **Estimated Time:** 5-15 minutes depending on codebase size
|