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,291 @@
1
+ # Dependencies Documentation
2
+
3
+ This document provides comprehensive information about the key dependencies used in the shadcn-glass-ui-library project.
4
+
5
+ ## Core Framework & Build Tools
6
+
7
+ ### React 19.2
8
+ **Version:** 19.2.0
9
+ **Purpose:** UI library foundation
10
+ **Official Docs:** [react.dev](https://react.dev/)
11
+
12
+ **Key Features:**
13
+ - **React Server Components** - Production-ready and stable in React 19. Render components ahead of time before bundling in a separate environment from client app or SSR server. Can run once at build time on CI server or per-request using a web server. Libraries can now target React 19 with `react-server` export condition for Full-stack React Architecture support.
14
+ - **Server Actions** - Stable feature for replacing traditional REST/GraphQL APIs in frameworks like Next.js and Remix. Note: `"use server"` directive is for Server Actions, not Server Components (which have no directive).
15
+ - **React Compiler** - Production-ready compiler automating performance optimizations, eliminating manual memoization with `useMemo` and `useCallback`
16
+ - **`use()` API** - Read resources in render, allowing promise reading with automatic Suspense integration
17
+ - **Document Metadata Support** - Native support for rendering `<title>`, `<link>`, and `<meta>` tags with automatic hoisting to `<head>`
18
+ - **Framework Integration** - Server Components stable for use in frameworks but bundler/framework APIs don't follow semver and may break between React 19.x minors
19
+
20
+ **References:**
21
+ - [React 19 Documentation](https://react.dev/blog/2024/12/05/react-19)
22
+ - [React Server Components Reference](https://react.dev/reference/rsc/server-components)
23
+
24
+ ### Vite 7 (rolldown-vite)
25
+ **Version:** 7.2.5 (rolldown-vite)
26
+ **Purpose:** Build tool and development server
27
+ **Official Docs:** [vite.dev](https://vite.dev/)
28
+
29
+ **About Rolldown:**
30
+ - **Rust-based Next-Gen Bundler** - High-performance JavaScript bundler developed by VoidZero as part of Vite's modernization strategy
31
+ - **Drop-in Replacement** - Available today via `rolldown-vite` package with Rollup-compatible API
32
+ - **Unification** - Replaces both esbuild (dependency pre-bundling) and Rollup (production builds) with single bundler
33
+ - **Performance Gains:**
34
+ - **3-16x faster** production builds vs JavaScript bundlers
35
+ - **100x reduction** in memory usage
36
+ - GitLab: 2.5 minutes → 40 seconds (100x less memory)
37
+ - Excalidraw: 22.9 seconds → 1.4 seconds (16x faster)
38
+ - **Future Default** - Will eventually become default bundler for Vite, particularly beneficial for larger projects
39
+ - **Dev/Build Consistency** - Eliminates inconsistencies between development and production by using same bundler
40
+
41
+ **Vite Evolution:**
42
+ - Vite 4.3: Significant dev server performance improvements
43
+ - Vite 5.1: 8s → 5.35s load time for 10K modules (bundle-less approach)
44
+ - Vite 7: Rolldown integration for unified, high-performance bundling
45
+
46
+ **References:**
47
+ - [Vite Rolldown Integration Guide](https://vite.dev/guide/rolldown)
48
+ - [Announcing Rolldown-Vite](https://voidzero.dev/posts/announcing-rolldown-vite)
49
+ - [Report Issues](https://github.com/vitejs/rolldown-vite)
50
+
51
+ ### TypeScript 5.9
52
+ **Version:** ~5.9.3
53
+ **Purpose:** Type safety and developer experience
54
+ **Configuration:** Strict mode enabled
55
+
56
+ ## Styling Framework
57
+
58
+ ### Tailwind CSS 4.1
59
+ **Version:** 4.1.17
60
+ **Purpose:** Utility-first CSS framework
61
+ **Official Docs:** [tailwindcss.com](https://tailwindcss.com/)
62
+
63
+ **Major v4 Features:**
64
+ - **Performance Breakthrough:**
65
+ - **5x faster** full builds vs v3
66
+ - **100x faster** incremental builds (measured in microseconds, not seconds)
67
+ - Significant reduction in build time impact for CSS modules
68
+ - **CSS-First Configuration:**
69
+ - No more `tailwind.config.js` - all customizations in CSS using `@import`
70
+ - Use `@reference` to import theme definitions into CSS modules without duplication
71
+ - Migration: Replace `@tailwind` directives with standard CSS `@import` statements
72
+ - **Automatic Content Detection** - Zero configuration, automatic template file discovery
73
+ - **CSS Variables by Default** - All design tokens available as CSS variables for runtime access
74
+ - **Modern Web Platform:**
75
+ - Built on cascade layers, `@property`, and `color-mix()`
76
+ - Browser targets: Safari 16.4+, Chrome 111+, Firefox 128+ (March 2023+)
77
+ - Native support for container queries, `@starting-style`, popovers
78
+ - Wide-gamut color space support
79
+ - **First-Party Vite Plugin** - Tight integration via `@tailwindcss/vite` for optimal performance
80
+
81
+ **Breaking Changes from v3:**
82
+ - CSS modules require explicit `@reference` imports for theme access
83
+ - Preflight updates: placeholder color, button cursor, dialog centering, `hidden` attribute priority
84
+ - No `@tailwind` directives - use standard CSS imports
85
+
86
+ **Packages:**
87
+ - `tailwindcss@4.1.17` - Core framework
88
+ - `@tailwindcss/vite@4.1.17` - Vite integration plugin
89
+ - `@tailwindcss/postcss@4.1.17` - PostCSS plugin
90
+
91
+ **References:**
92
+ - [Tailwind CSS v4.0 Release](https://tailwindcss.com/blog/tailwindcss-v4)
93
+ - [Upgrade Guide](https://tailwindcss.com/docs/upgrade-guide)
94
+
95
+ ## Development Tools
96
+
97
+ ### Storybook 10.1
98
+ **Version:** 10.1.0
99
+ **Purpose:** Component development workshop
100
+ **Official Docs:** [storybook.js.org](https://storybook.js.org/)
101
+
102
+ **Key Features:**
103
+ - **ESM-only Distribution** - 29% smaller install size (on top of 50% savings from v9), all packages use ESM-only format
104
+ - **Module Automocking** - Automatic mocking of API calls and services for easier component testing in isolation
105
+ - **Typesafe CSF Factories** - Enhanced type safety and autocompletion for React component stories
106
+ - **Enhanced Tag Filtering** - Improved sidebar organization with tag-based filtering, exclusion, and configuration
107
+ - **Vitest Integration** - Native Vitest addon transforms stories into Vitest tests, run with browser mode
108
+ - **Framework Support** - Next 16 and Vitest 4 support, Svelte async components
109
+ - **Ecosystem** - Extensible through presets and addons for documentation, a11y testing, design tools, test runners
110
+
111
+ **Testing Capabilities:**
112
+ - **Storybook Test** - Real-time testing via Vitest addon with automatic story-to-test transformation
113
+ - **composeStories API** - Reuse development stories as test fixtures, eliminating duplication
114
+ - **Unified Workflow** - Same component examples for development, testing, and documentation
115
+
116
+ **Breaking Changes (v9 → v10):**
117
+ - Main configuration (`.storybook/main.js|ts`) must be valid ESM
118
+ - Node 20.19+ or 22.12+ now required (was 20.16+ or 22.19+)
119
+ - Vitest setup file (`.storybook/vitest.setup.ts`) can be removed with CSF Next upgrade
120
+
121
+ **Installed Addons:**
122
+ - `@storybook/addon-a11y@10.1.0` - Accessibility testing with Axe
123
+ - `@storybook/addon-docs@10.1.0` - Documentation generation
124
+ - `@storybook/addon-vitest@10.1.0` - Vitest integration for component testing
125
+ - `@storybook/addon-mcp@0.1.3` - MCP integration
126
+ - `@chromatic-com/storybook@4.1.3` - Visual regression testing
127
+
128
+ **Node Requirements:** Node 20.19+, 22.12+, or 24+
129
+
130
+ **References:**
131
+ - [Storybook 10 Release](https://storybook.js.org/blog/storybook-10/)
132
+ - [Migration Guide](https://storybook.js.org/docs/releases/migration-guide)
133
+
134
+ ### Vitest 4.0
135
+ **Version:** 4.0.14
136
+ **Purpose:** Testing framework
137
+ **Official Docs:** [vitest.dev](https://vitest.dev/)
138
+
139
+ **Key Features:**
140
+ - **Stable Browser Mode** - Test UI components in real browsers (Playwright/WebDriver/Preview). Removed `experimental` tag. Separate provider packages: `@vitest/browser-playwright`, `@vitest/browser-webdriverio`, `@vitest/browser-preview`
141
+ - **Visual Regression Testing:**
142
+ - `toMatchScreenshot` assertion for screenshot comparison
143
+ - `toBeInViewport` matcher using IntersectionObserver API
144
+ - Screenshot storage in `__screenshots__/` directories
145
+ - Update baselines with `--update` flag
146
+ - **Playwright Traces Integration:**
147
+ - First-class trace support via `trace` config option
148
+ - Trace modes: `off`, `on`, `on-first-retry`, `on-all-retries`, `retain-on-failure`
149
+ - Traces available as annotations in reporters (e.g., HTML reporter)
150
+ - View traces with Playwright Trace Viewer for CI debugging
151
+ - **Enhanced Debugging:**
152
+ - "Debug Test" button in VSCode extension for browser tests
153
+ - `--inspect` flag support (playwright/webdriverio)
154
+ - Automatic `trackUnhandledErrors` disable during debugging
155
+ - **Architecture:** Tests run natively in browser (vs Playwright component tests running in Node.js with remote browser control)
156
+
157
+ **CI Configuration:**
158
+ - **Playwright:** Use `npx playwright install --with-deps --only-shell`
159
+ - **WebdriverIO:** Use browser setup actions (e.g., `@browser-actions/setup-chrome`)
160
+
161
+ **Installed Packages:**
162
+ - `vitest@4.0.14` - Core testing framework
163
+ - `@vitest/browser-playwright@4.0.14` - Browser testing with Playwright
164
+ - `@vitest/coverage-v8@4.0.14` - Code coverage with V8
165
+ - `@testing-library/react@16.3.0` - React testing utilities
166
+
167
+ **Breaking Changes:**
168
+ - Browser mode providers now require separate packages
169
+ - See [Migration Guide](https://vitest.dev/guide/migration.html) for detailed changes
170
+
171
+ **References:**
172
+ - [Vitest 4.0 Release](https://vitest.dev/blog/vitest-4)
173
+ - [Visual Regression Testing Guide](https://vitest.dev/guide/browser/visual-regression-testing)
174
+ - [Announcing Vitest 4.0](https://voidzero.dev/posts/announcing-vitest-4)
175
+
176
+ ## UI Component Libraries
177
+
178
+ ### shadcn/ui
179
+ **Version:** 3.5.0
180
+ **Purpose:** Accessible component primitives
181
+ **Official Docs:** [ui.shadcn.com](https://ui.shadcn.com/)
182
+
183
+ **Configuration:**
184
+ - Style: `new-york`
185
+ - Components path: `@/components/ui`
186
+ - Utils path: `@/lib/utils`
187
+ - Icon library: `lucide-react@0.555.0`
188
+ - CSS variables: Enabled with `neutral` base color
189
+
190
+ ### Lucide React
191
+ **Version:** 0.555.0
192
+ **Purpose:** Icon library
193
+ **Official Docs:** [lucide.dev](https://lucide.dev/)
194
+
195
+ ## Utility Libraries
196
+
197
+ ### Class Utilities
198
+ - `clsx@2.1.1` - Conditional className construction
199
+ - `tailwind-merge@3.4.0` - Tailwind class merging without conflicts
200
+ - `class-variance-authority@0.7.1` - CVA for variant-based styling
201
+
202
+ **Combined Usage:** The `cn()` utility in [src/lib/utils.ts](src/lib/utils.ts) combines `clsx` and `tailwind-merge` for optimal className handling.
203
+
204
+ ## Code Quality & Linting
205
+
206
+ ### ESLint 9.39
207
+ **Configuration:** Flat config format
208
+ **Plugins:**
209
+ - `@eslint/js@9.39.1` - Core ESLint rules
210
+ - `typescript-eslint@8.46.4` - TypeScript linting
211
+ - `eslint-plugin-react-hooks@7.0.1` - React hooks rules
212
+ - `eslint-plugin-react-refresh@0.4.24` - React refresh rules
213
+ - `eslint-plugin-storybook@10.1.0` - Storybook-specific rules
214
+
215
+ ### Prettier
216
+ **Version:** 3.7.1
217
+ **Purpose:** Code formatting
218
+
219
+ ## Development Dependencies
220
+
221
+ ### Build & Dev Tools
222
+ - `@vitejs/plugin-react@5.1.1` - Vite React plugin with Fast Refresh
223
+ - `postcss@8.5.6` - CSS transformations
224
+ - `sass@1.94.2` - Sass preprocessing
225
+
226
+ ### Testing Infrastructure
227
+ - `playwright@1.57.0` - End-to-end browser testing
228
+ - `@testing-library/react@16.3.0` - React component testing utilities
229
+
230
+ ### Type Definitions
231
+ - `@types/react@19.2.5` - React type definitions
232
+ - `@types/react-dom@19.2.3` - React DOM type definitions
233
+ - `@types/node@24.10.1` - Node.js type definitions
234
+
235
+ ## Version Requirements
236
+
237
+ **Node.js:** 20.16+, 22.19+, or 24+ (required for Storybook 10 ESM-only)
238
+ **npm:** Latest stable version recommended
239
+
240
+ ## Package Manager Configuration
241
+
242
+ The project uses npm with package overrides to ensure `rolldown-vite` is used consistently:
243
+
244
+ ```json
245
+ "overrides": {
246
+ "vite": "npm:rolldown-vite@7.2.5"
247
+ }
248
+ ```
249
+
250
+ ## Dependency Management Best Practices
251
+
252
+ 1. **Version Pinning:** All dependencies use specific versions (with `^` for minor updates)
253
+ 2. **Regular Updates:** Review dependency updates monthly, test thoroughly
254
+ 3. **Security:** Run `npm audit` regularly to check for vulnerabilities
255
+ 4. **Bundle Size:** Monitor bundle size impact when adding new dependencies
256
+ 5. **Tree Shaking:** Prefer ESM packages for better tree shaking
257
+
258
+ ## Performance Metrics
259
+
260
+ Based on the current dependency stack:
261
+ - **Build Time:** 3-16x faster production builds with Rolldown vs traditional Rollup/JavaScript bundlers
262
+ - **Memory Usage:** 100x reduction vs traditional bundlers (real-world examples: GitLab 2.5min → 40sec)
263
+ - **CSS Build Performance:**
264
+ - Full builds: 5x faster than Tailwind v3
265
+ - Incremental builds: 100x faster (measured in microseconds)
266
+ - **Dev Server:** Near-instant start with Vite's on-demand compilation
267
+ - **Install Size:** 29% smaller with Storybook 10 ESM-only distribution
268
+ - **Bundle Size:** Optimized through automatic tree shaking and unified Rolldown bundling
269
+
270
+ ## Future Considerations
271
+
272
+ - **React 19.x:** Monitor patch releases for bug fixes. Note that Server Components bundler/framework APIs may break between minors (19.x) - pin version if building framework support
273
+ - **Vite/Rolldown:** Rolldown will eventually become default bundler for Vite. Track development for further performance optimizations and ecosystem compatibility
274
+ - **Tailwind CSS 4.x:** Watch for updates to modern CSS features, browser support expansion, and performance improvements
275
+ - **Storybook 10.x:** Follow releases for experimental features (new test syntax, RSC testing) and ecosystem improvements
276
+ - **Vitest 4.x:** Monitor updates for browser mode enhancements, visual regression testing improvements, and new assertion helpers
277
+ - **Browser Support:** Current stack requires modern browsers (Chrome 111+, Safari 16.4+, Firefox 128+). Consider compatibility mode if older browser support needed
278
+
279
+ ## Migration Notes
280
+
281
+ ### Key Breaking Changes to Be Aware Of:
282
+ 1. **Storybook 10:** Requires Node 20.19+/22.12+/24+, ESM-only main configuration
283
+ 2. **Tailwind v4:** No `@tailwind` directives (use `@import`), CSS modules need `@reference` imports
284
+ 3. **Vitest 4:** Browser mode providers require separate packages
285
+ 4. **React 19:** Server Components stable, but bundler APIs may break between minors
286
+
287
+ ---
288
+
289
+ **Last Updated:** 2025-11-28
290
+ **Document Version:** 2.0.0
291
+ **Data Sources:** Official documentation via Context7 MCP
@@ -0,0 +1,324 @@
1
+ # Visual Testing Guide
2
+
3
+ This guide explains how to work with visual regression tests in this project.
4
+
5
+ ## Overview
6
+
7
+ The project uses **Vitest 4.0 browser mode** with **Playwright** for visual regression testing. All reference screenshots are generated on **Linux (ubuntu-latest)** in CI to ensure consistency across environments.
8
+
9
+ **Key Points:**
10
+ - ✅ Reference screenshots are generated on Linux
11
+ - ✅ All platforms use the same screenshot files (no `-darwin`/`-linux` suffixes)
12
+ - ✅ Automatic workflow for updating screenshots
13
+ - ✅ Cross-platform tolerance configured (8% pixel mismatch allowed)
14
+
15
+ ## Running Tests Locally
16
+
17
+ ### Run all visual tests
18
+ ```bash
19
+ npm run test:visual:ci
20
+ ```
21
+
22
+ ### Update screenshots locally (for reference only)
23
+ ```bash
24
+ npm run test:visual:update
25
+ ```
26
+
27
+ **⚠️ IMPORTANT:** Do NOT commit screenshots generated on macOS. Always use the GitHub Actions workflow to generate production screenshots.
28
+
29
+ **Cleaning local screenshots:**
30
+ If you accidentally generated screenshots locally, use this script to remove them:
31
+ ```bash
32
+ ./scripts/clean-local-screenshots.sh
33
+ ```
34
+
35
+ **Protection:** A pre-commit hook automatically blocks commits of new screenshots from non-Linux platforms. If you see this error:
36
+ ```
37
+ ❌ ERROR: Cannot commit visual test screenshots from Darwin
38
+ ```
39
+ This is working as intended. Use the GitHub Actions workflow instead.
40
+
41
+ ## Updating Reference Screenshots
42
+
43
+ When you modify UI components and need to update screenshots:
44
+
45
+ ### Option 1: Using GitHub CLI (Recommended)
46
+ ```bash
47
+ gh workflow run update-screenshots.yml
48
+ ```
49
+
50
+ ### Option 2: Via GitHub Web UI
51
+ 1. Go to **Actions** → **Update Visual Test Screenshots**
52
+ 2. Click **Run workflow**
53
+ 3. Optionally provide a custom commit message
54
+ 4. Click **Run workflow**
55
+
56
+ The workflow will:
57
+ 1. Delete existing screenshots
58
+ 2. Generate new screenshots on Linux (ubuntu-latest)
59
+ 3. Commit and push changes automatically
60
+ 4. Upload screenshots as artifacts
61
+
62
+ ### Monitoring Workflow Progress
63
+ ```bash
64
+ # Check workflow status
65
+ gh run list --workflow=update-screenshots.yml --limit 1
66
+
67
+ # View workflow logs
68
+ gh run view <run-id> --log
69
+ ```
70
+
71
+ ## Configuration
72
+
73
+ ### Visual Test Thresholds
74
+
75
+ **File:** `vite.config.ts`
76
+
77
+ ```typescript
78
+ comparatorOptions: {
79
+ threshold: 0.05, // Allow 5% color difference (macOS vs Linux)
80
+ allowedMismatchedPixelRatio: 0.08, // Allow 8% pixel mismatch
81
+ }
82
+ ```
83
+
84
+ These tolerances account for:
85
+ - Font rendering differences between macOS and Linux
86
+ - Subpixel anti-aliasing variations
87
+ - Minor layout shifts (1-2px height differences)
88
+
89
+ ### Screenshot Naming
90
+
91
+ Screenshots use a unified naming pattern:
92
+ ```
93
+ {test-name}-{theme}-chromium.png
94
+ ```
95
+
96
+ Example: `button-primary-glass-chromium.png`
97
+
98
+ **No platform suffixes** (`-darwin`, `-linux`) are added.
99
+
100
+ ## Test Structure
101
+
102
+ ### Visual Test Locations
103
+ ```
104
+ src/components/__visual__/
105
+ ├── components.visual.test.tsx # Individual component tests
106
+ ├── componentshowcase.visual.test.tsx # ComponentShowcase demo page (55 tests)
107
+ ├── desktop.visual.test.tsx # DesktopShowcase demo page (80+ tests)
108
+ ├── mobileshowcase.visual.test.tsx # MobileShowcase demo page
109
+ ├── phase2-components.visual.test.tsx # Phase 2 components
110
+ ├── projects-list.visual.test.tsx # ProjectsList component
111
+ └── __screenshots__/ # Reference screenshots (603 files)
112
+ ```
113
+
114
+ ### Screenshot Organization
115
+ ```
116
+ src/components/__visual__/__screenshots__/
117
+ ├── components.visual.test.tsx/
118
+ │ ├── alert-error-aurora-chromium.png
119
+ │ ├── alert-error-glass-chromium.png
120
+ │ ├── alert-error-light-chromium.png
121
+ │ └── ...
122
+ ├── desktop.visual.test.tsx/
123
+ └── ...
124
+ ```
125
+
126
+ ## Git Pre-commit Hook
127
+
128
+ The repository includes a pre-commit hook that prevents accidentally committing screenshots generated on non-Linux platforms.
129
+
130
+ **Setup (Automatic):**
131
+
132
+ The hook is located at `.git/hooks/pre-commit` and should work automatically. If you encounter issues:
133
+
134
+ ```bash
135
+ # Ensure Git is using the correct hooks directory
136
+ git config --unset core.hookspath
137
+
138
+ # Verify hook is executable
139
+ chmod +x .git/hooks/pre-commit
140
+ ```
141
+
142
+ **How it works:**
143
+ - Blocks commits of new `.png` files in `__screenshots__/` directories
144
+ - Only allows commits from Linux (CI environment)
145
+ - Shows helpful error message with instructions
146
+
147
+ **Bypassing the hook (not recommended):**
148
+ ```bash
149
+ git commit --no-verify # Skip all git hooks
150
+ ```
151
+
152
+ Only bypass if you're sure you're committing Linux-generated screenshots.
153
+
154
+ ## CI/CD Integration
155
+
156
+ ### Automatic Testing
157
+
158
+ Visual tests run automatically on every push/PR:
159
+
160
+ **File:** `.github/workflows/ci.yml`
161
+
162
+ ```yaml
163
+ - name: Run visual regression tests
164
+ run: npm run test:visual:ci
165
+ ```
166
+
167
+ ### Manual Screenshot Updates
168
+
169
+ **File:** `.github/workflows/update-screenshots.yml`
170
+
171
+ Workflow features:
172
+ - ✅ Manual trigger only (`workflow_dispatch`)
173
+ - ✅ Runs on Linux (ubuntu-latest)
174
+ - ✅ Deletes old screenshots before regeneration
175
+ - ✅ Commits and pushes changes automatically
176
+ - ✅ Uploads screenshots as artifacts (30-day retention)
177
+ - ✅ Custom commit message support
178
+
179
+ ## Troubleshooting
180
+
181
+ ### Tests Fail After Component Changes
182
+
183
+ **Symptoms:**
184
+ - CI shows screenshot mismatches
185
+ - Error: "Screenshot does not match the stored reference"
186
+ - Pixel ratio > 0.08 or dimension differences
187
+
188
+ **Solution:**
189
+ 1. Review the changes to ensure they're intentional
190
+ 2. Run the screenshot update workflow:
191
+ ```bash
192
+ gh workflow run update-screenshots.yml -f commit_message="chore: update screenshots after [your change]"
193
+ ```
194
+ 3. Wait for the workflow to complete
195
+ 4. Trigger CI with an empty commit if needed:
196
+ ```bash
197
+ git commit --allow-empty -m "chore: verify visual tests"
198
+ git push
199
+ ```
200
+
201
+ ### Local Screenshots Don't Match CI
202
+
203
+ **Symptoms:**
204
+ - Tests pass locally but fail in CI
205
+ - Opposite: tests fail locally but pass in CI
206
+
207
+ **Cause:**
208
+ - Platform differences (macOS vs Linux)
209
+ - Font rendering variations
210
+ - Different screenshot generation environment
211
+
212
+ **Solution:**
213
+ - **DO NOT** commit local screenshots from macOS
214
+ - Always use the GitHub Actions workflow
215
+ - Linux screenshots are the source of truth
216
+
217
+ ### Workflow Fails to Commit
218
+
219
+ **Symptoms:**
220
+ - Workflow succeeds but no new commit appears
221
+ - Error: "Updates were rejected"
222
+
223
+ **Cause:**
224
+ - Race condition: new commits pushed while workflow was running
225
+
226
+ **Solution:**
227
+ - Workflow includes `git pull --rebase` before push
228
+ - If still failing, manually re-run the workflow
229
+
230
+ ## Best Practices
231
+
232
+ ### When to Update Screenshots
233
+
234
+ Update screenshots when:
235
+ - ✅ Intentional UI changes (new features, design updates)
236
+ - ✅ Component refactoring that affects rendering
237
+ - ✅ Theme or styling changes
238
+ - ✅ Breaking changes in dependencies (React, Tailwind, etc.)
239
+
240
+ Do NOT update screenshots for:
241
+ - ❌ Random pixel differences without code changes
242
+ - ❌ Flaky tests (investigate root cause first)
243
+ - ❌ Local development screenshots
244
+
245
+ ### Reviewing Screenshot Changes
246
+
247
+ Before approving screenshot updates:
248
+
249
+ 1. **Download artifacts** from the workflow run
250
+ 2. **Compare** old vs new screenshots visually
251
+ 3. **Verify** changes are intentional and expected
252
+ 4. **Check** that all themes (glass, light, aurora) are consistent
253
+
254
+ ### Writing New Visual Tests
255
+
256
+ ```typescript
257
+ import { test, expect } from '@vitest/browser/context';
258
+
259
+ test('MyComponent - default state - glass theme', async () => {
260
+ const { page } = await import('@vitest/browser/context');
261
+
262
+ // Render component
263
+ const container = page.locator('[data-testid="my-component"]');
264
+
265
+ // Take screenshot
266
+ await expect(container).toMatchScreenshot('my-component-default-glass');
267
+ });
268
+ ```
269
+
270
+ **Naming convention:**
271
+ - Use descriptive names: `{component}-{variant}-{theme}`
272
+ - Include theme: `glass`, `light`, `aurora`
273
+ - Use kebab-case
274
+
275
+ ## Statistics
276
+
277
+ **Current Coverage:**
278
+ - **582 visual tests** (as of v1.0.0)
279
+ - **603 reference screenshots**
280
+ - **99.5% pass rate** in CI
281
+ - **3 themes tested:** glass, light, aurora
282
+
283
+ ## Related Documentation
284
+
285
+ - [CLAUDE.md](../CLAUDE.md) - Project overview and architecture
286
+ - [DEPENDENCIES.md](../DEPENDENCIES.md) - Tech stack details
287
+ - [visual-tests-audit.md](./visual-tests-audit.md) - Detailed test audit
288
+ - [Migration Guides](./migration/) - Component API changes
289
+
290
+ ## Workflow Reference
291
+
292
+ ### Update Screenshots Workflow
293
+
294
+ **Trigger:**
295
+ ```bash
296
+ gh workflow run update-screenshots.yml
297
+ ```
298
+
299
+ **With custom message:**
300
+ ```bash
301
+ gh workflow run update-screenshots.yml -f commit_message="chore: update screenshots after AlertGlass refactor"
302
+ ```
303
+
304
+ **Check status:**
305
+ ```bash
306
+ gh run list --workflow=update-screenshots.yml --limit 1
307
+ ```
308
+
309
+ **View logs:**
310
+ ```bash
311
+ gh run view <run-id> --log
312
+ ```
313
+
314
+ **Download artifacts:**
315
+ ```bash
316
+ gh run download <run-id> -n visual-test-screenshots
317
+ ```
318
+
319
+ ---
320
+
321
+ **Last Updated:** 2025-12-05
322
+ **Vitest Version:** 4.0
323
+ **Playwright Version:** Latest
324
+ **Node Version:** 20.16+, 22.19+, or 24+
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "shadcn-glass-ui",
3
3
  "private": false,
4
- "version": "1.0.11",
5
- "description": "Glassmorphism UI library for React - AI-friendly with 55+ components, strict TypeScript, and comprehensive docs",
4
+ "version": "2.0.0",
5
+ "description": "Glassmorphism UI library for React - AI-friendly with 58 components, strict TypeScript, and comprehensive docs",
6
6
  "author": "Yhooi2",
7
7
  "license": "MIT",
8
8
  "keywords": [
@@ -13,6 +13,9 @@
13
13
  "tailwind",
14
14
  "components",
15
15
  "design-system",
16
+ "design-tokens",
17
+ "oklch",
18
+ "css-variables",
16
19
  "typescript",
17
20
  "ai-friendly",
18
21
  "claude-code",
@@ -35,6 +38,9 @@
35
38
  "main": "./dist/index.cjs",
36
39
  "module": "./dist/index.js",
37
40
  "types": "./dist/index.d.ts",
41
+ "bin": {
42
+ "shadcn-glass-ui": "./dist/cli/index.js"
43
+ },
38
44
  "exports": {
39
45
  ".": {
40
46
  "import": {
@@ -90,6 +96,8 @@
90
96
  },
91
97
  "files": [
92
98
  "dist",
99
+ "docs",
100
+ "context7.json",
93
101
  "README.md",
94
102
  "LICENSE",
95
103
  "CHANGELOG.md"
@@ -136,7 +144,8 @@
136
144
  "audit:design-system": "npm run test:compliance:run && npm run test:compliance:source",
137
145
  "generate:registry": "tsx scripts/generate-registry.ts",
138
146
  "docs:api": "typedoc",
139
- "docs:api:watch": "typedoc --watch"
147
+ "docs:api:watch": "typedoc --watch",
148
+ "prepare": "husky"
140
149
  },
141
150
  "dependencies": {
142
151
  "@radix-ui/react-avatar": "^1.1.11",
@@ -158,9 +167,11 @@
158
167
  "class-variance-authority": "^0.7.1",
159
168
  "clsx": "^2.1.1",
160
169
  "cmdk": "^1.1.1",
170
+ "framer-motion": "^12.23.26",
161
171
  "lucide-react": "^0.555.0",
162
172
  "next-themes": "^0.4.6",
163
173
  "postcss": "^8.5.6",
174
+ "recharts": "^3.5.1",
164
175
  "sonner": "^2.0.7",
165
176
  "tailwind-merge": "^3.4.0",
166
177
  "tailwindcss": "^4.0.0"
@@ -189,7 +200,9 @@
189
200
  "eslint-plugin-storybook": "^10.1.0",
190
201
  "glob": "^13.0.0",
191
202
  "globals": "^16.5.0",
203
+ "husky": "^9.1.7",
192
204
  "jsdom": "^27.2.0",
205
+ "lint-staged": "^16.2.7",
193
206
  "playwright": "^1.57.0",
194
207
  "prettier": "3.7.1",
195
208
  "react": "^19.2.0",