shadcn-glass-ui 2.0.12 → 2.1.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 (59) hide show
  1. package/CHANGELOG.md +218 -5
  2. package/README.md +132 -43
  3. package/context7.json +2 -1
  4. package/dist/cli/index.cjs +1 -1
  5. package/dist/components.cjs +4 -4
  6. package/dist/components.d.ts +103 -29
  7. package/dist/components.js +1 -1
  8. package/dist/demo-screenshot-aurora.png +0 -0
  9. package/dist/demo-screenshot.png +0 -0
  10. package/dist/demo-screenshot.png.zip +0 -0
  11. package/dist/hooks.cjs +2 -2
  12. package/dist/index.cjs +5 -5
  13. package/dist/index.js +28 -28
  14. package/dist/index.js.map +1 -1
  15. package/dist/r/ai-card-glass.json +1 -1
  16. package/dist/r/avatar-glass.json +1 -1
  17. package/dist/r/badge-glass.json +1 -1
  18. package/dist/r/button-glass.json +1 -1
  19. package/dist/r/combobox-glass.json +1 -1
  20. package/dist/r/registry.json +2 -2
  21. package/dist/r/repository-card-glass.json +2 -1
  22. package/dist/r/slider-glass.json +4 -5
  23. package/dist/r/toggle-glass.json +2 -2
  24. package/dist/r/year-card-glass.json +1 -1
  25. package/dist/shadcn-glass-ui.css +1 -1
  26. package/dist/{theme-context-DNe_2vWJ.cjs → theme-context-BHXYJ4RE.cjs} +2 -2
  27. package/dist/{theme-context-DNe_2vWJ.cjs.map → theme-context-BHXYJ4RE.cjs.map} +1 -1
  28. package/dist/themes.cjs +1 -1
  29. package/dist/{trust-score-card-glass-Dgu46oWI.cjs → trust-score-card-glass-CGXmOIfq.cjs} +850 -150
  30. package/dist/trust-score-card-glass-CGXmOIfq.cjs.map +1 -0
  31. package/dist/{trust-score-card-glass-A7kas5OS.js → trust-score-card-glass-L9g0qamo.js} +1182 -482
  32. package/dist/trust-score-card-glass-L9g0qamo.js.map +1 -0
  33. package/dist/{use-focus-BRkQtQCj.cjs → use-focus-CeNHOiBa.cjs} +2 -2
  34. package/dist/{use-focus-BRkQtQCj.cjs.map → use-focus-CeNHOiBa.cjs.map} +1 -1
  35. package/dist/{use-wallpaper-tint-CfShPBo2.cjs → use-wallpaper-tint-Bt2G3g1v.cjs} +2 -2
  36. package/dist/{use-wallpaper-tint-CfShPBo2.cjs.map → use-wallpaper-tint-Bt2G3g1v.cjs.map} +1 -1
  37. package/dist/{utils-BXN7AcRu.cjs → utils-LYxxWvUn.cjs} +2 -2
  38. package/dist/{utils-BXN7AcRu.cjs.map → utils-LYxxWvUn.cjs.map} +1 -1
  39. package/dist/utils.cjs +1 -1
  40. package/docs/ADVANCED_PATTERNS.md +584 -0
  41. package/docs/AI_USAGE.md +135 -611
  42. package/docs/BEST_PRACTICES.md +2 -2
  43. package/docs/BREAKING_CHANGES.md +242 -0
  44. package/docs/COMPONENTS_CATALOG.md +8 -8
  45. package/docs/EXPORTS_STRUCTURE.md +3 -3
  46. package/docs/GETTING_STARTED.md +13 -8
  47. package/docs/PUBLISHING.md +1 -1
  48. package/docs/REGISTRY_SUMMARY.md +2 -2
  49. package/docs/REGISTRY_USAGE.md +1 -1
  50. package/docs/api/README.md +11 -11
  51. package/docs/api/interfaces/BadgeGlassProps.md +21 -14
  52. package/docs/api/interfaces/ButtonGlassProps.md +37 -30
  53. package/package.json +4 -3
  54. package/dist/trust-score-card-glass-A7kas5OS.js.map +0 -1
  55. package/dist/trust-score-card-glass-Dgu46oWI.cjs.map +0 -1
  56. package/dist/vite.svg +0 -1
  57. package/docs/migration/modal-glass-compound-api.md +0 -458
  58. package/docs/migration/select-to-combobox.md +0 -386
  59. package/docs/migration/tabs-glass-compound-api.md +0 -579
package/docs/AI_USAGE.md CHANGED
@@ -3,7 +3,9 @@
3
3
  This guide is specifically for **AI assistants** (Claude Code, GitHub Copilot, GPT-based tools)
4
4
  helping users integrate shadcn-glass-ui into their projects.
5
5
 
6
- ## 🎯 Quick Decision Tree
6
+ **Version:** 2.0.0+ (v1.x support removed)
7
+
8
+ ## Quick Decision Tree
7
9
 
8
10
  ### When a user asks "I want to use shadcn-glass-ui"
9
11
 
@@ -13,18 +15,18 @@ helping users integrate shadcn-glass-ui into their projects.
13
15
  Is this an existing shadcn/ui project?
14
16
 
15
17
  ├─ YES → Use shadcn CLI (Option A)
16
- Best for: Existing shadcn/ui projects
17
- Benefits: Automatic dependency resolution, familiar workflow
18
+ │ Best for: Existing shadcn/ui projects
19
+ │ Benefits: Automatic dependency resolution, familiar workflow
18
20
 
19
21
  └─ NO → Is this a new project?
20
22
 
21
23
  ├─ YES → Use npm package (Option B)
22
- Best for: New projects without shadcn/ui
23
- Benefits: Faster setup, pre-built components
24
+ │ Best for: New projects without shadcn/ui
25
+ │ Benefits: Faster setup, pre-built components
24
26
 
25
27
  └─ NO → Use manual copy (Option C)
26
- Best for: Custom setups, learning internals
27
- Benefits: Full control, no dependencies on npm/registry
28
+ Best for: Custom setups, learning internals
29
+ Benefits: Full control, no dependencies on npm/registry
28
30
  ```
29
31
 
30
32
  ---
@@ -64,7 +66,7 @@ npx shadcn@latest add @shadcn-glass-ui/button-glass
64
66
  ```tsx
65
67
  import { ButtonGlass } from '@/components/glass/ui/button-glass';
66
68
 
67
- <ButtonGlass variant="primary">Click me</ButtonGlass>;
69
+ <ButtonGlass variant="default">Click me</ButtonGlass>;
68
70
  ```
69
71
 
70
72
  ### Common Issues
@@ -158,7 +160,7 @@ function App() {
158
160
  ```tsx
159
161
  import { ButtonGlass, InputGlass } from 'shadcn-glass-ui';
160
162
 
161
- <ButtonGlass variant="primary">Click me</ButtonGlass>
163
+ <ButtonGlass variant="default">Click me</ButtonGlass>
162
164
  <InputGlass placeholder="Enter text..." />
163
165
  ```
164
166
 
@@ -243,7 +245,7 @@ curl -o src/lib/utils.ts \
243
245
 
244
246
  ---
245
247
 
246
- ## 🧠 AI Assistant Workflow
248
+ ## AI Assistant Workflow
247
249
 
248
250
  ### When user says: "Add a button to my app"
249
251
 
@@ -268,7 +270,7 @@ import { ButtonGlass } from 'shadcn-glass-ui';
268
270
 
269
271
  function MyComponent() {
270
272
  return (
271
- <ButtonGlass variant="primary" size="md" onClick={() => console.log('Clicked!')}>
273
+ <ButtonGlass variant="default" size="default" onClick={() => console.log('Clicked!')}>
272
274
  Click me
273
275
  </ButtonGlass>
274
276
  );
@@ -294,7 +296,7 @@ function App() {
294
296
 
295
297
  ---
296
298
 
297
- ## 📦 Component Selection Guide
299
+ ## Component Selection Guide
298
300
 
299
301
  ### Minimal Starter Kit (5 components)
300
302
 
@@ -352,378 +354,127 @@ npx shadcn@latest add \
352
354
 
353
355
  ---
354
356
 
355
- ## 🚨 Migration from v0.x to v1.0
357
+ ## v2.0.0 API Reference
358
+
359
+ ### Component APIs (100% shadcn/ui Compatible)
356
360
 
357
- ### Breaking Changes Summary
361
+ v2.0.0 achieves **complete API compatibility with shadcn/ui**.
358
362
 
359
- **1. ButtonGlass: `variant="danger"` removed**
363
+ #### ButtonGlass
360
364
 
361
365
  ```tsx
362
- // v0.x
363
- <ButtonGlass variant="danger">Delete</ButtonGlass>
366
+ // Available variants
367
+ <ButtonGlass variant="default">Default</ButtonGlass>
368
+ <ButtonGlass variant="secondary">Secondary</ButtonGlass>
369
+ <ButtonGlass variant="destructive">Destructive</ButtonGlass>
370
+ <ButtonGlass variant="outline">Outline</ButtonGlass>
371
+ <ButtonGlass variant="ghost">Ghost</ButtonGlass>
372
+ <ButtonGlass variant="link">Link</ButtonGlass>
364
373
 
365
- // v1.0
366
- <ButtonGlass variant="destructive">Delete</ButtonGlass>
374
+ // Available sizes
375
+ <ButtonGlass size="default">Default</ButtonGlass>
376
+ <ButtonGlass size="sm">Small</ButtonGlass>
377
+ <ButtonGlass size="lg">Large</ButtonGlass>
378
+ <ButtonGlass size="icon">Icon Only</ButtonGlass>
367
379
  ```
368
380
 
369
- **2. AlertGlass: `type` → `variant`**
381
+ #### ToggleGlass
370
382
 
371
383
  ```tsx
372
- // v0.x
373
- <AlertGlass type="error" title="Error">Message</AlertGlass>
374
-
375
- // ✅ v1.0
376
- <AlertGlass variant="destructive" title="Error">Message</AlertGlass>
384
+ // Uses pressed/onPressedChange (shadcn/ui pattern)
385
+ <ToggleGlass pressed={isOn} onPressedChange={(pressed) => setIsOn(pressed)} />
377
386
  ```
378
387
 
379
- **3. SelectGlass removed → Use ComboBoxGlass**
388
+ #### SliderGlass
380
389
 
381
390
  ```tsx
382
- // v0.x
383
- <SelectGlass options={options} value={value} onChange={setValue} />
391
+ // Uses array values (Radix UI pattern)
392
+ <SliderGlass value={[50]} onValueChange={(val) => setValue(val[0])} />
384
393
 
385
- // v1.0
386
- <ComboBoxGlass options={options} value={value} onChange={setValue} />
394
+ // Range slider support
395
+ <SliderGlass value={[25, 75]} onValueChange={setRange} />
387
396
  ```
388
397
 
389
- **4. ModalGlass: Legacy API removed**
398
+ #### ComboBoxGlass
390
399
 
391
400
  ```tsx
392
- // v0.x
393
- <ModalGlass isOpen={true} onClose={() => {}} title="Test">
394
- Content
395
- </ModalGlass>
401
+ // Uses onValueChange (shadcn/ui pattern)
402
+ <ComboBoxGlass options={options} value={value} onValueChange={setValue} />
403
+ ```
396
404
 
397
- // v1.0 (Compound API)
398
- <ModalGlass.Root open={true} onOpenChange={() => {}}>
405
+ #### AlertGlass (Compound Component)
406
+
407
+ ```tsx
408
+ <AlertGlass variant="destructive">
409
+ <AlertGlassTitle>Error</AlertGlassTitle>
410
+ <AlertGlassDescription>Something went wrong</AlertGlassDescription>
411
+ </AlertGlass>
412
+ ```
413
+
414
+ #### ModalGlass (Compound Component)
415
+
416
+ ```tsx
417
+ <ModalGlass.Root open={open} onOpenChange={setOpen}>
399
418
  <ModalGlass.Overlay />
400
419
  <ModalGlass.Content>
401
420
  <ModalGlass.Header>
402
- <ModalGlass.Title>Test</ModalGlass.Title>
421
+ <ModalGlass.Title>My Modal</ModalGlass.Title>
403
422
  <ModalGlass.Close />
404
423
  </ModalGlass.Header>
405
- <ModalGlass.Body>Content</ModalGlass.Body>
424
+ <ModalGlass.Body>Content here</ModalGlass.Body>
406
425
  </ModalGlass.Content>
407
426
  </ModalGlass.Root>
408
427
  ```
409
428
 
410
- ### Migration Workflow for AI
411
-
412
- **When user shows code with legacy API:**
413
-
414
- 1. **Identify the version**
415
- - Check `package.json` for version number
416
- - Look for `variant="danger"` or `type="error"` → v0.x
417
-
418
- 2. **Suggest upgrade**
419
-
420
- ```bash
421
- npm install shadcn-glass-ui@latest
422
- ```
423
-
424
- 3. **Provide migration code**
425
- - Show side-by-side before/after
426
- - Explain why it changed (shadcn/ui compatibility)
427
-
428
- 4. **Update all usages**
429
- - Search project for old patterns
430
- - Replace systematically
431
-
432
- ---
433
-
434
- ## 🚨 v2.0.0 Breaking Changes (CSS Variables)
435
-
436
- ### Overview
437
-
438
- **v2.0.0 removes deprecated metric color CSS variables** in favor of semantic naming aligned with
439
- shadcn/ui conventions.
440
-
441
- **Impact:** Custom themes, inline styles, or Tailwind arbitrary values using old metric variables
442
- will break.
443
-
444
- **Migration time:** ~5-10 minutes (automated script provided)
445
-
446
- ### Removed CSS Variables
429
+ #### TabsGlass (Compound Component)
447
430
 
448
- | Removed (v1.x) | Replacement (v2.0+) | Semantic Meaning | Use Case |
449
- | ------------------------- | ----------------------------- | ------------------ | ---------------- |
450
- | `--metric-emerald-bg` | `--metric-success-bg` | Success background | Positive metrics |
451
- | `--metric-emerald-text` | `--metric-success-text` | Success text | Positive values |
452
- | `--metric-emerald-border` | `--metric-success-border` | Success border | Success cards |
453
- | `--metric-emerald-glow` | `--metric-success-glow` | Success glow | Hover effects |
454
- | `--metric-amber-bg` | `--metric-warning-bg` | Warning background | Warning metrics |
455
- | `--metric-amber-text` | `--metric-warning-text` | Warning text | Alert values |
456
- | `--metric-amber-border` | `--metric-warning-border` | Warning border | Warning cards |
457
- | `--metric-amber-glow` | `--metric-warning-glow` | Warning glow | Hover effects |
458
- | `--metric-blue-bg` | `--metric-default-bg` | Default background | Neutral metrics |
459
- | `--metric-blue-text` | `--metric-default-text` | Default text | Normal values |
460
- | `--metric-blue-border` | `--metric-default-border` | Default border | Neutral cards |
461
- | `--metric-blue-glow` | `--metric-default-glow` | Default glow | Hover effects |
462
- | `--metric-red-bg` | `--metric-destructive-bg` | Error background | Error metrics |
463
- | `--metric-red-text` | `--metric-destructive-text` | Error text | Error values |
464
- | `--metric-red-border` | `--metric-destructive-border` | Error border | Error cards |
465
- | `--metric-red-glow` | `--metric-destructive-glow` | Error glow | Hover effects |
466
-
467
- **Total affected:** 16 variables (4 color families × 4 properties)
468
-
469
- ### Why This Change?
470
-
471
- 1. **Semantic Clarity** - Color names (emerald, amber) → semantic roles (success, warning)
472
- 2. **shadcn/ui Alignment** - Matches AlertGlass, BadgeGlass, ButtonGlass variant naming
473
- 3. **Consistency** - All components now use same semantic vocabulary
474
- 4. **3-Layer Token System** - Part of v2.0.0 token architecture migration
475
-
476
- ### Automated Migration
431
+ ```tsx
432
+ <TabsGlass.Root value={activeTab} onValueChange={setActiveTab}>
433
+ <TabsGlass.List>
434
+ <TabsGlass.Trigger value="overview">Overview</TabsGlass.Trigger>
435
+ <TabsGlass.Trigger value="settings">Settings</TabsGlass.Trigger>
436
+ </TabsGlass.List>
477
437
 
478
- **Step 1: Find affected files**
438
+ <TabsGlass.Content value="overview">
439
+ <OverviewPanel />
440
+ </TabsGlass.Content>
479
441
 
480
- ```bash
481
- grep -rn "metric-emerald\|metric-amber\|metric-blue\|metric-red" src/
442
+ <TabsGlass.Content value="settings">
443
+ <SettingsPanel />
444
+ </TabsGlass.Content>
445
+ </TabsGlass.Root>
482
446
  ```
483
447
 
484
- **Step 2: Automated replacement**
448
+ ### CSS Variables (Semantic Naming)
485
449
 
486
- ```bash
487
- # macOS/BSD sed
488
- find src/ -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.css" -o -name "*.scss" \) -exec sed -i '' \
489
- -e 's/--metric-emerald-/--metric-success-/g' \
490
- -e 's/--metric-amber-/--metric-warning-/g' \
491
- -e 's/--metric-blue-/--metric-default-/g' \
492
- -e 's/--metric-red-/--metric-destructive-/g' \
493
- {} +
494
-
495
- # Linux sed
496
- find src/ -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.css" -o -name "*.scss" \) -exec sed -i \
497
- -e 's/--metric-emerald-/--metric-success-/g' \
498
- -e 's/--metric-amber-/--metric-warning-/g' \
499
- -e 's/--metric-blue-/--metric-default-/g' \
500
- -e 's/--metric-red-/--metric-destructive-/g' \
501
- {} +
502
- ```
503
-
504
- **Step 3: Verify changes**
450
+ v2.0.0 uses semantic CSS variable names:
505
451
 
506
- ```bash
507
- npm run typecheck # TypeScript validation
508
- npm run lint # ESLint checks
509
- npm test # Run test suite
510
- npm run build # Production build test
452
+ ```css
453
+ /* Semantic metric colors */
454
+ --metric-success-bg, --metric-success-text, --metric-success-border, --metric-success-glow
455
+ --metric-warning-bg, --metric-warning-text, --metric-warning-border, --metric-warning-glow
456
+ --metric-default-bg, --metric-default-text, --metric-default-border, --metric-default-glow
457
+ --metric-destructive-bg, --metric-destructive-text, --metric-destructive-border, --metric-destructive-glow
511
458
  ```
512
459
 
513
- ### Manual Migration Examples
514
-
515
- **Example 1: Custom CSS**
460
+ For custom styling, always use semantic tokens:
516
461
 
517
462
  ```css
518
- /* v1.x (REMOVED in v2.0.0) */
519
- .metric-card-success {
520
- background: var(--metric-emerald-bg);
521
- color: var(--metric-emerald-text);
522
- border: 1px solid var(--metric-emerald-border);
523
- box-shadow: var(--metric-emerald-glow);
463
+ /* DO use semantic tokens */
464
+ .my-component {
465
+ background: var(--semantic-primary);
466
+ color: var(--semantic-text);
524
467
  }
525
468
 
526
- /* v2.0+ */
527
- .metric-card-success {
528
- background: var(--metric-success-bg);
529
- color: var(--metric-success-text);
530
- border: 1px solid var(--metric-success-border);
531
- box-shadow: var(--metric-success-glow);
469
+ /* DON'T hardcode OKLCH values */
470
+ .my-component {
471
+ background: oklch(66.6% 0.159 303); /* NEVER do this */
532
472
  }
533
473
  ```
534
474
 
535
- **Example 2: Tailwind Arbitrary Values**
536
-
537
- ```tsx
538
- // ❌ v1.x
539
- <div className="bg-[var(--metric-amber-bg)] text-[var(--metric-amber-text)]">
540
- Warning
541
- </div>
542
-
543
- // ✅ v2.0+
544
- <div className="bg-[var(--metric-warning-bg)] text-[var(--metric-warning-text)]">
545
- Warning
546
- </div>
547
- ```
548
-
549
- **Example 3: Inline Styles**
550
-
551
- ```tsx
552
- // ❌ v1.x
553
- <div
554
- style={{
555
- background: 'var(--metric-blue-bg)',
556
- color: 'var(--metric-blue-text)',
557
- }}
558
- >
559
- Default
560
- </div>
561
-
562
- // ✅ v2.0+
563
- <div
564
- style={{
565
- background: 'var(--metric-default-bg)',
566
- color: 'var(--metric-default-text)',
567
- }}
568
- >
569
- Default
570
- </div>
571
- ```
572
-
573
- ### Affected Components
574
-
575
- The following components may use metric color variables in **user custom implementations**:
576
-
577
- - MetricCardGlass
578
- - CircularMetricGlass
579
- - MetricsGridGlass
580
- - YearCardGlass (with sparkline metrics)
581
- - Custom dashboard components
582
- - Custom metric displays
583
-
584
- **Note:** shadcn-glass-ui v2.0.0 library code is already migrated. This migration is only for **user
585
- code** that references these variables.
586
-
587
- ### AI Assistant Guidance
588
-
589
- **When user reports "CSS variable not defined" errors:**
590
-
591
- 1. **Check package version:**
592
-
593
- ```bash
594
- npm list shadcn-glass-ui
595
- # If v2.0.0+ → old metric variables removed
596
- ```
597
-
598
- 2. **Identify deprecated usage:**
599
-
600
- ```bash
601
- grep -rn "metric-emerald\|metric-amber\|metric-blue\|metric-red" src/
602
- ```
603
-
604
- 3. **Provide automated fix:**
605
-
606
- ```
607
- I see you're using deprecated CSS variables from v1.x.
608
- In v2.0.0, metric color variables were renamed to semantic names.
609
-
610
- Run this command to automatically migrate:
611
- [Provide bash script above]
612
-
613
- This will update all occurrences in your codebase.
614
- ```
615
-
616
- 4. **Explain why:**
617
- ```
618
- This change aligns with shadcn/ui naming conventions:
619
- - emerald → success (positive metrics)
620
- - amber → warning (alert metrics)
621
- - blue → default (neutral metrics)
622
- - red → destructive (error metrics)
623
- ```
624
-
625
- ### Common Error Messages
626
-
627
- **"CSS variable '--metric-emerald-bg' is not defined"**
628
-
629
- - **Cause:** Using v1.x variable name in v2.0.0+
630
- - **Fix:** Replace `--metric-emerald-bg` → `--metric-success-bg`
631
-
632
- **"Unexpected color in metric card"**
633
-
634
- - **Cause:** CSS fallback to default color due to undefined variable
635
- - **Fix:** Run automated migration script
636
-
637
- **"TypeScript error: Property '--metric-blue-text' does not exist"**
638
-
639
- - **Cause:** TypeScript strict mode detecting undefined CSS variable
640
- - **Fix:** Update to semantic naming (`--metric-default-text`)
641
-
642
- ### Token System (v2.0.0+)
643
-
644
- v2.0.0 introduces a **3-layer token architecture** that eliminates hardcoded colors:
645
-
646
- ```
647
- Layer 3: Component Tokens (--btn-primary-bg, --metric-success-bg)
648
- ↓ references
649
- Layer 2: Semantic Tokens (--semantic-primary, --semantic-success)
650
- ↓ references
651
- Layer 1: Primitive Tokens (--oklch-purple-500, --oklch-emerald-400)
652
- ```
653
-
654
- **Benefits:**
655
-
656
- - **207 primitive tokens** - Single source of truth for all OKLCH colors
657
- - **Zero hardcoded OKLCH** - 100% CSS variable coverage
658
- - **15-minute theme creation** - Was 2-3 hours before refactor
659
- - **Rapid theming** - 90% faster (2-3 hours → 10-15 minutes)
660
-
661
- **For AI Assistants:**
662
-
663
- When suggesting custom styling in v2.0.0+:
664
-
665
- 1. **NEVER suggest hardcoded OKLCH values:**
666
-
667
- ```css
668
- /* ❌ BAD */
669
- background: oklch(66.6% 0.159 303);
670
- ```
671
-
672
- 2. **ALWAYS use semantic tokens:**
673
-
674
- ```css
675
- /* ✅ GOOD */
676
- background: var(--semantic-primary);
677
- ```
678
-
679
- 3. **Check if needed primitive exists:**
680
- - Search `src/styles/tokens/oklch-primitives.css` for color
681
- - If not found, suggest adding to appropriate family
682
-
683
- 4. **Creating custom themes:**
684
- - Reference [THEME_CREATION_GUIDE.md](THEME_CREATION_GUIDE.md)
685
- - Only need ~50 lines of semantic mappings
686
- - Component tokens inherited automatically
687
-
688
- **Token Documentation:**
689
-
690
- - [TOKEN_ARCHITECTURE.md](TOKEN_ARCHITECTURE.md) - Complete 3-layer system guide
691
- - [THEME_CREATION_GUIDE.md](THEME_CREATION_GUIDE.md) - 15-minute theme creation
692
- - [CSS_VARIABLES_MIGRATION_2.0.md](migration/CSS_VARIABLES_MIGRATION_2.0.md) - Full migration guide
693
- - [PRIMITIVE_MAPPING.md](PRIMITIVE_MAPPING.md) - OKLCH primitive reference
694
-
695
- ### Migration Checklist
696
-
697
- - [ ] Search codebase for deprecated variables
698
- (`grep -rn "metric-emerald|metric-amber|metric-blue|metric-red"`)
699
- - [ ] Run automated replacement script
700
- - [ ] Verify TypeScript compilation (`npm run typecheck`)
701
- - [ ] Run linter (`npm run lint`)
702
- - [ ] Run test suite (`npm test`)
703
- - [ ] Test production build (`npm run build`)
704
- - [ ] Visual regression testing (if applicable)
705
- - [ ] Manual testing of affected components
706
- - [ ] Update custom theme files (if any)
707
- - [ ] Commit changes with message: `chore: migrate CSS variables to v2.0.0 semantic naming`
708
-
709
- ### Timeline
710
-
711
- | Version | Status | Deprecated Variables |
712
- | -------------------- | ------------ | ------------------------------------------------ |
713
- | **v1.0.0 - v1.0.11** | ✅ Supported | Work via CSS aliases (with deprecation warnings) |
714
- | **v2.0.0** | 🚀 Current | ❌ **REMOVED** (breaking change) |
715
- | **v2.1.0+** | ⏭️ Future | Only semantic variables supported |
716
-
717
- ### Need Help?
718
-
719
- - 📖 [Full Migration Guide](migration/CSS_VARIABLES_MIGRATION_2.0.md)
720
- - 🎨 [Token Architecture](TOKEN_ARCHITECTURE.md)
721
- - 🛠️ [Theme Creation Guide](THEME_CREATION_GUIDE.md)
722
- - 🐛 [Report Issues](https://github.com/Yhooi2/shadcn-glass-ui-library/issues)
723
-
724
475
  ---
725
476
 
726
- ## 🧪 Testing Components
477
+ ## Testing Components
727
478
 
728
479
  ### Verify Installation
729
480
 
@@ -731,16 +482,16 @@ When suggesting custom styling in v2.0.0+:
731
482
 
732
483
  ```tsx
733
484
  import { ButtonGlass } from 'shadcn-glass-ui';
734
- // No TypeScript errors → Package installed correctly
485
+ // No TypeScript errors → Package installed correctly
735
486
  ```
736
487
 
737
488
  **Test 2: Styles applied**
738
489
 
739
490
  ```tsx
740
491
  <div className="theme-glass p-8">
741
- <ButtonGlass variant="primary">Test</ButtonGlass>
492
+ <ButtonGlass variant="default">Test</ButtonGlass>
742
493
  </div>
743
- // Button should have glass effect → CSS loaded correctly
494
+ // Button should have glass effect → CSS loaded correctly
744
495
  ```
745
496
 
746
497
  **Test 3: Theme switching**
@@ -757,12 +508,12 @@ function Test() {
757
508
  </>
758
509
  );
759
510
  }
760
- // Clicking buttons changes theme → Theme system works
511
+ // Clicking buttons changes theme → Theme system works
761
512
  ```
762
513
 
763
514
  ---
764
515
 
765
- ## 🔍 Debugging Common Issues
516
+ ## Debugging Common Issues
766
517
 
767
518
  ### Issue 1: "Cannot find module 'shadcn-glass-ui'"
768
519
 
@@ -826,7 +577,7 @@ function App() {
826
577
 
827
578
  ---
828
579
 
829
- ## 🖥️ CLI Commands
580
+ ## CLI Commands
830
581
 
831
582
  Explore components directly from the command line:
832
583
 
@@ -848,197 +599,46 @@ npx shadcn-glass-ui list --level=1
848
599
  npx shadcn-glass-ui --help
849
600
  ```
850
601
 
851
- **Output for `npx shadcn-glass-ui info ButtonGlass`:**
852
-
853
- ```
854
- ButtonGlass
855
- ──────────────────────────────────────────────────
856
-
857
- Description:
858
- Primary action button with glassmorphism effects
859
-
860
- Category: core
861
- Level: L1
862
- Type: component
863
- Props: ButtonGlassProps
864
-
865
- Variants:
866
- • default
867
- • secondary
868
- • destructive
869
- • ghost
870
-
871
- Sizes:
872
- • sm
873
- • md
874
- • lg
875
-
876
- ✓ shadcn/ui compatible
877
- ✓ Supports asChild pattern
878
-
879
- Usage Example:
880
- ─────────────────────
881
-
882
- import { ButtonGlass } from 'shadcn-glass-ui';
883
-
884
- <ButtonGlass variant="default" size="sm">
885
- {/* Content here */}
886
- </ButtonGlass>
887
- ```
888
-
889
602
  ---
890
603
 
891
- ## 🌐 Context7 MCP Integration
604
+ ## Context7 MCP Integration
892
605
 
893
606
  This library is indexed on [Context7](https://context7.com/yhooi2/shadcn-glass-ui-library) for AI
894
- assistant discoverability. AI assistants can automatically fetch documentation, code examples, and
895
- component specifications through the Context7 MCP server.
896
-
897
- ### What is Context7?
898
-
899
- Context7 is a library indexing service that makes open-source libraries discoverable and accessible
900
- to AI coding assistants through the Model Context Protocol (MCP). When an AI assistant has Context7
901
- MCP configured, it can:
902
-
903
- - 🔍 **Search** for libraries by name or functionality
904
- - 📖 **Fetch** up-to-date documentation automatically
905
- - 💡 **Access** code examples and best practices
906
- - 🎯 **Apply** library-specific rules and conventions
907
- - 🔄 **Track** version history and breaking changes
607
+ assistant discoverability.
908
608
 
909
609
  ### Using Context7 MCP
910
610
 
911
- #### Step 1: Resolve Library ID
912
-
913
- First, resolve the library name to get the Context7-compatible ID:
914
-
915
611
  ```
612
+ // Resolve library ID
916
613
  mcp__context7__resolve-library-id shadcn-glass-ui
917
- ```
918
-
919
- **Returns:** `/yhooi2/shadcn-glass-ui-library`
614
+ // Returns: /yhooi2/shadcn-glass-ui-library
920
615
 
921
- #### Step 2: Fetch Documentation
922
-
923
- Once you have the library ID, fetch documentation for specific topics:
924
-
925
- ```
926
- // Get component API documentation
616
+ // Fetch documentation
927
617
  mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library --topic="ButtonGlass"
928
-
929
- // Get theming documentation
930
618
  mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library --topic="themes"
931
-
932
- // Get installation guide
933
- mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library --topic="installation"
934
-
935
- // Get token system documentation (v2.0.0+)
936
619
  mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library --topic="token architecture"
937
620
  ```
938
621
 
939
- #### Step 3: Access Specific Versions
940
-
941
- You can also fetch documentation for specific versions:
942
-
943
- ```
944
- // Get v2.0.0 documentation
945
- mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library/v2.0.0
946
-
947
- // Get v1.0.0 documentation (legacy)
948
- mcp__context7__get-library-docs /yhooi2/shadcn-glass-ui-library/v1.0.0
949
- ```
950
-
951
- ### Context7 Benefits for AI Development
952
-
953
- 1. **Always Up-to-Date** - Documentation syncs with latest releases via context7.json
954
- 2. **Version-Aware** - Access docs for any tagged version (v1.0.0, v2.0.0, etc.)
955
- 3. **Rule-Based Guidance** - 20+ library-specific rules prevent common mistakes
956
- 4. **Zero Configuration** - No manual doc downloads or context copying
957
- 5. **Fast Iteration** - AI assistants fetch examples instantly during development
958
-
959
- ### Context7 Rules (20 total)
960
-
961
- Key rules indexed for AI assistants:
622
+ ### Context7 Rules Summary
962
623
 
963
- **v2.0.0+ Breaking Changes:**
624
+ **Component API:**
964
625
 
965
- 1. Use `--metric-success-*` instead of `--metric-emerald-*` (REMOVED)
966
- 2. Use `--metric-warning-*` instead of `--metric-amber-*` (REMOVED)
967
- 3. Use `--metric-default-*` instead of `--metric-blue-*` (REMOVED)
968
- 4. Use `--metric-destructive-*` instead of `--metric-red-*` (REMOVED)
969
- 5. NEVER hardcode OKLCH values - use CSS variables from oklch-primitives.css
970
- 6. Use 3-layer token system: Primitive → Semantic → Component tokens
626
+ - Use `variant` prop (not `type`) for AlertGlass/NotificationGlass
627
+ - Use `variant="destructive"` (not `variant="danger"`) for ButtonGlass
628
+ - ModalGlass and TabsGlass use compound component API
629
+ - StepperGlass uses compound API: Root, Step, Title, Description, Indicator
630
+ - Use `asChild` prop for polymorphic rendering
971
631
 
972
- **Component API:** 7. Use `variant` prop instead of `type` for AlertGlass/NotificationGlass 8. Use
973
- `variant="destructive"` instead of `variant="danger"` for ButtonGlass 9. Always wrap components with
974
- ThemeProvider 10. ModalGlass and TabsGlass use compound component API 11. StepperGlass uses compound
975
- API: Root, Step, Title, Description, Indicator 12. Three themes: `glass`, `light`, `aurora` 13. Use
976
- `asChild` prop for polymorphic rendering 14. Memoize ComboBoxGlass options with `useMemo` 15. Use
977
- TooltipGlass with `aria-label` on icon buttons
632
+ **Theming:**
978
633
 
979
- **Theming:** 16. Create new themes in 15 minutes using THEME_CREATION_GUIDE.md 17. All 207 primitive
980
- tokens defined in src/styles/tokens/oklch-primitives.css 18. Reference TOKEN_ARCHITECTURE.md for
981
- token system documentation 19. Use exported hooks: useFocus, useHover, useResponsive,
982
- useWallpaperTint 20. StepperGlass supports linear mode (wizard pattern) - set linear prop
983
-
984
- Full rules available in [context7.json](../context7.json).
985
-
986
- ### Example: AI-Assisted Development with Context7
987
-
988
- **User Request:** "Add a stepper component to my checkout flow"
989
-
990
- **AI Assistant with Context7:**
991
-
992
- 1. Fetches StepperGlass documentation via MCP
993
- 2. Reads rules: "StepperGlass uses compound API", "supports linear mode"
994
- 3. Generates code following library conventions:
995
-
996
- ```tsx
997
- import { StepperGlass } from 'shadcn-glass-ui';
998
-
999
- function CheckoutFlow() {
1000
- const [currentStep, setCurrentStep] = useState(0);
1001
-
1002
- return (
1003
- <StepperGlass.Root value={currentStep} onValueChange={setCurrentStep} linear>
1004
- <StepperGlass.Step value={0}>
1005
- <StepperGlass.Indicator />
1006
- <StepperGlass.Title>Cart Review</StepperGlass.Title>
1007
- <StepperGlass.Description>Review your items</StepperGlass.Description>
1008
- </StepperGlass.Step>
1009
- {/* ... */}
1010
- </StepperGlass.Root>
1011
- );
1012
- }
1013
- ```
1014
-
1015
- **Without Context7:** AI might use incorrect API, miss linear mode, or suggest non-existent props.
1016
-
1017
- ### Configuring Context7 MCP
1018
-
1019
- To enable Context7 in your AI assistant (Claude Code, Cursor, etc.):
1020
-
1021
- 1. Install Context7 MCP server
1022
- 2. Add to MCP settings:
1023
- ```json
1024
- {
1025
- "mcpServers": {
1026
- "context7": {
1027
- "command": "npx",
1028
- "args": ["-y", "@context7/mcp-server"]
1029
- }
1030
- }
1031
- }
1032
- ```
1033
- 3. Restart your AI assistant
1034
-
1035
- See
1036
- [Context7 MCP Documentation](https://github.com/modelcontextprotocol/servers/tree/main/src/context7)
1037
- for details.
634
+ - Three themes: `glass`, `light`, `aurora`
635
+ - Always wrap with ThemeProvider
636
+ - Use semantic tokens, never hardcode OKLCH values
637
+ - 207 primitive tokens in `src/styles/tokens/oklch-primitives.css`
1038
638
 
1039
639
  ---
1040
640
 
1041
- ## 📚 Resources for AI Assistants
641
+ ## Resources for AI Assistants
1042
642
 
1043
643
  ### Quick Reference
1044
644
 
@@ -1046,7 +646,7 @@ for details.
1046
646
  - **Registry URL:** `https://raw.githubusercontent.com/Yhooi2/shadcn-glass-ui-library/main/public/r`
1047
647
  - **Registry namespace:** `@shadcn-glass-ui`
1048
648
  - **Context7 Library ID:** `/yhooi2/shadcn-glass-ui-library`
1049
- - **Component count:** 58 (includes StepperGlass in v2.0.0+)
649
+ - **Component count:** 57 (includes StepperGlass)
1050
650
  - **React version:** 18.0+ or 19.0+
1051
651
  - **Tailwind version:** 4.1+
1052
652
  - **Node version:** 20.16+, 22.19+, or 24+
@@ -1072,7 +672,7 @@ import { ThemeProvider } from '@/lib/theme-context';
1072
672
 
1073
673
  **ButtonGlass:**
1074
674
 
1075
- - `primary`, `secondary`, `outline`, `ghost`, `link`, `destructive`
675
+ - `default`, `secondary`, `outline`, `ghost`, `link`, `destructive`
1076
676
 
1077
677
  **BadgeGlass:**
1078
678
 
@@ -1089,9 +689,9 @@ import { ThemeProvider } from '@/lib/theme-context';
1089
689
 
1090
690
  ---
1091
691
 
1092
- ## 💡 Best Practices for AI Assistants
692
+ ## Best Practices for AI Assistants
1093
693
 
1094
- ### DO
694
+ ### DO
1095
695
 
1096
696
  1. **Check project setup first**
1097
697
  - Look for `package.json`
@@ -1113,43 +713,28 @@ import { ThemeProvider } from '@/lib/theme-context';
1113
713
  - Check variant names
1114
714
  - Ensure props exist
1115
715
 
1116
- 5. **Explain breaking changes**
1117
- - Show v0.x vs v1.0
1118
- - Explain why changed
1119
- - Provide migration path
1120
-
1121
- ### DON'T ❌
716
+ ### DON'T
1122
717
 
1123
718
  1. **Don't mix installation methods**
1124
719
 
1125
720
  ```tsx
1126
- // BAD: Mixing npm and shadcn CLI imports
721
+ // BAD: Mixing npm and shadcn CLI imports
1127
722
  import { ButtonGlass } from 'shadcn-glass-ui';
1128
723
  import { InputGlass } from '@/components/glass/ui/input-glass';
1129
724
 
1130
- // GOOD: Consistent imports
725
+ // GOOD: Consistent imports
1131
726
  import { ButtonGlass, InputGlass } from 'shadcn-glass-ui';
1132
727
  ```
1133
728
 
1134
- 2. **Don't use deprecated APIs**
1135
-
1136
- ```tsx
1137
- // ❌ BAD: v0.x API
1138
- <ButtonGlass variant="danger">Delete</ButtonGlass>
1139
-
1140
- // ✅ GOOD: v1.0 API
1141
- <ButtonGlass variant="destructive">Delete</ButtonGlass>
1142
- ```
1143
-
1144
- 3. **Don't skip theme setup**
729
+ 2. **Don't skip theme setup**
1145
730
 
1146
731
  ```tsx
1147
- // BAD: No theme provider
732
+ // BAD: No theme provider
1148
733
  function App() {
1149
734
  return <ButtonGlass>Click me</ButtonGlass>;
1150
735
  }
1151
736
 
1152
- // GOOD: With theme provider
737
+ // GOOD: With theme provider
1153
738
  function App() {
1154
739
  return (
1155
740
  <ThemeProvider defaultTheme="glass">
@@ -1159,15 +744,15 @@ import { ThemeProvider } from '@/lib/theme-context';
1159
744
  }
1160
745
  ```
1161
746
 
1162
- 4. **Don't forget CSS import**
747
+ 3. **Don't forget CSS import**
1163
748
 
1164
749
  ```css
1165
- /* BAD: Missing CSS import */
750
+ /* BAD: Missing CSS import */
1166
751
  @tailwind base;
1167
752
  @tailwind components;
1168
753
  @tailwind utilities;
1169
754
 
1170
- /* GOOD: Include glass styles */
755
+ /* GOOD: Include glass styles */
1171
756
  @tailwind base;
1172
757
  @tailwind components;
1173
758
  @tailwind utilities;
@@ -1176,51 +761,7 @@ import { ThemeProvider } from '@/lib/theme-context';
1176
761
 
1177
762
  ---
1178
763
 
1179
- ## 🎓 Learning Path for Users
1180
-
1181
- ### Beginner (Week 1)
1182
-
1183
- **Goal:** Get first component working
1184
-
1185
- 1. Install package
1186
- 2. Add ButtonGlass to app
1187
- 3. Set up theme provider
1188
- 4. Try 3 themes (glass, light, aurora)
1189
-
1190
- **Example project:**
1191
-
1192
- ```bash
1193
- npx create-vite@latest my-glass-app --template react-ts
1194
- cd my-glass-app
1195
- npm install shadcn-glass-ui react@19 react-dom@19 tailwindcss@4
1196
- # Follow Option B steps above
1197
- ```
1198
-
1199
- ### Intermediate (Week 2)
1200
-
1201
- **Goal:** Build a form
1202
-
1203
- 1. Add InputGlass, CheckboxGlass, ToggleGlass
1204
- 2. Create form validation
1205
- 3. Add AlertGlass for errors
1206
- 4. Use ModalGlass for confirmations
1207
-
1208
- **Example project:** Login form with validation
1209
-
1210
- ### Advanced (Week 3+)
1211
-
1212
- **Goal:** Build dashboard
1213
-
1214
- 1. Use composite components (MetricCardGlass, etc.)
1215
- 2. Create custom variants with CVA
1216
- 3. Build section components (HeaderNavGlass, etc.)
1217
- 4. Implement theme persistence
1218
-
1219
- **Example project:** Analytics dashboard with glassmorphism
1220
-
1221
- ---
1222
-
1223
- ## 🤖 Prompts for AI Assistants
764
+ ## Prompts for AI Assistants
1224
765
 
1225
766
  ### Prompt 1: "Help me install shadcn-glass-ui"
1226
767
 
@@ -1259,8 +800,8 @@ import { ButtonGlass } from 'shadcn-glass-ui';
1259
800
  function MyComponent() {
1260
801
  return (
1261
802
  <ButtonGlass
1262
- variant="primary"
1263
- size="md"
803
+ variant="default"
804
+ size="default"
1264
805
  onClick={() => alert('Clicked!')}
1265
806
  >
1266
807
  Click me
@@ -1271,7 +812,7 @@ function MyComponent() {
1271
812
 
1272
813
  Available variants:
1273
814
 
1274
- - primary (purple gradient)
815
+ - default (standard)
1275
816
  - secondary (muted)
1276
817
  - outline (border only)
1277
818
  - ghost (transparent)
@@ -1282,32 +823,15 @@ Available variants:
1282
823
 
1283
824
  ```
1284
825
 
1285
- ### Prompt 3: "Migrate from v0.x to v1.0"
1286
-
1287
- **Response template:**
1288
- ```
1289
-
1290
- I'll help you migrate to v1.0. Here are the breaking changes in your code:
1291
-
1292
- 1. [Identify deprecated APIs in user's code]
1293
- 2. [Provide replacement code]
1294
- 3. [Explain why changed]
1295
-
1296
- Updated code: [Show before/after comparison]
1297
-
1298
- After migration, test these components: [List affected components]
1299
-
1300
- ```
1301
-
1302
826
  ---
1303
827
 
1304
- ## 📞 Support Escalation
828
+ ## Support Escalation
1305
829
 
1306
830
  ### When to recommend reading docs
1307
831
 
1308
- - User wants to customize themes → [UI_DESIGN.md](design-system/UI_DESIGN.md)
1309
- - User wants to understand architecture → [CLAUDE.md](../CLAUDE.md)
1310
- - User wants to contribute → [CONTRIBUTING.md](../CONTRIBUTING.md)
832
+ - User wants to customize themes → [THEME_CREATION_GUIDE.md](THEME_CREATION_GUIDE.md)
833
+ - User wants to understand architecture → [TOKEN_ARCHITECTURE.md](TOKEN_ARCHITECTURE.md)
834
+ - User wants breaking changes info → [BREAKING_CHANGES.md](BREAKING_CHANGES.md)
1311
835
 
1312
836
  ### When to recommend Storybook
1313
837
 
@@ -1324,5 +848,5 @@ After migration, test these components: [List affected components]
1324
848
 
1325
849
  ---
1326
850
 
1327
- **Made for AI assistants by shadcn-glass-ui team** 🤖✨
851
+ **Made for AI assistants by shadcn-glass-ui team**
1328
852
  ```