@shohojdhara/atomix 0.3.4 → 0.3.6

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 (237) hide show
  1. package/README.md +101 -199
  2. package/atomix.config.ts +241 -0
  3. package/dist/atomix.css +269 -189
  4. package/dist/atomix.css.map +1 -0
  5. package/dist/atomix.min.css +15179 -11
  6. package/dist/atomix.min.css.map +1 -0
  7. package/dist/charts.d.ts +1929 -0
  8. package/dist/charts.js +6477 -0
  9. package/dist/charts.js.map +1 -0
  10. package/dist/core.d.ts +1289 -0
  11. package/dist/core.js +3373 -0
  12. package/dist/core.js.map +1 -0
  13. package/dist/forms.d.ts +1085 -0
  14. package/dist/forms.js +2466 -0
  15. package/dist/forms.js.map +1 -0
  16. package/dist/heavy.d.ts +636 -0
  17. package/dist/heavy.js +4566 -0
  18. package/dist/heavy.js.map +1 -0
  19. package/dist/index.d.ts +5171 -4792
  20. package/dist/index.esm.js +6098 -4563
  21. package/dist/index.esm.js.map +1 -1
  22. package/dist/index.js +6291 -4747
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.min.js +1 -1
  25. package/dist/index.min.js.map +1 -1
  26. package/dist/layout.d.ts +300 -0
  27. package/dist/layout.js +336 -0
  28. package/dist/layout.js.map +1 -0
  29. package/dist/theme.d.ts +2122 -0
  30. package/dist/theme.js +6084 -0
  31. package/dist/theme.js.map +1 -0
  32. package/package.json +59 -27
  33. package/scripts/atomix-cli.js +544 -16
  34. package/scripts/cli/__tests__/cli-commands.test.js +204 -0
  35. package/scripts/cli/__tests__/utils.test.js +201 -0
  36. package/scripts/cli/__tests__/vitest.config.js +26 -0
  37. package/scripts/cli/interactive-init.js +1 -1
  38. package/scripts/cli/token-manager.js +32 -7
  39. package/scripts/cli/utils.js +347 -0
  40. package/src/components/Accordion/Accordion.stories.tsx +50 -17
  41. package/src/components/Accordion/Accordion.tsx +5 -54
  42. package/src/components/Accordion/index.ts +1 -1
  43. package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
  44. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
  45. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
  46. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
  47. package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
  48. package/src/components/Avatar/Avatar.stories.tsx +7 -0
  49. package/src/components/Avatar/Avatar.tsx +3 -3
  50. package/src/components/Badge/Badge.stories.tsx +91 -13
  51. package/src/components/Badge/Badge.tsx +3 -3
  52. package/src/components/Block/Block.stories.tsx +7 -23
  53. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
  54. package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
  55. package/src/components/Button/Button.stories.tsx +141 -22
  56. package/src/components/Button/ButtonGroup.stories.tsx +315 -0
  57. package/src/components/Button/ButtonGroup.tsx +67 -0
  58. package/src/components/Button/index.ts +2 -0
  59. package/src/components/Callout/Callout.stories.tsx +8 -6
  60. package/src/components/Card/Card.stories.tsx +82 -28
  61. package/src/components/Card/ElevationCard.tsx +1 -1
  62. package/src/components/Chart/AnimatedChart.tsx +19 -18
  63. package/src/components/Chart/AreaChart.tsx +5 -2
  64. package/src/components/Chart/BarChart.tsx +1 -1
  65. package/src/components/Chart/BubbleChart.tsx +6 -6
  66. package/src/components/Chart/CandlestickChart.tsx +0 -1
  67. package/src/components/Chart/Chart.stories.tsx +5 -7
  68. package/src/components/Chart/Chart.tsx +0 -16
  69. package/src/components/Chart/ChartRenderer.tsx +1 -1
  70. package/src/components/Chart/ChartToolbar.tsx +1 -0
  71. package/src/components/Chart/DonutChart.tsx +0 -1
  72. package/src/components/Chart/FunnelChart.tsx +1 -2
  73. package/src/components/Chart/GaugeChart.tsx +0 -1
  74. package/src/components/Chart/HeatmapChart.tsx +0 -1
  75. package/src/components/Chart/LineChart.tsx +0 -1
  76. package/src/components/Chart/MultiAxisChart.tsx +0 -1
  77. package/src/components/Chart/PieChart.tsx +0 -1
  78. package/src/components/Chart/RadarChart.tsx +19 -13
  79. package/src/components/Chart/ScatterChart.tsx +3 -4
  80. package/src/components/Chart/TreemapChart.tsx +2 -1
  81. package/src/components/Chart/WaterfallChart.tsx +0 -2
  82. package/src/components/Chart/types.ts +12 -2
  83. package/src/components/Chart/utils.ts +4 -3
  84. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
  85. package/src/components/DataTable/DataTable.stories.tsx +23 -16
  86. package/src/components/DataTable/DataTable.tsx +3 -3
  87. package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
  88. package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
  89. package/src/components/Dropdown/Dropdown.tsx +12 -9
  90. package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
  91. package/src/components/Footer/Footer.stories.tsx +8 -6
  92. package/src/components/Footer/FooterLink.tsx +9 -2
  93. package/src/components/Footer/FooterSection.tsx +3 -3
  94. package/src/components/Form/Checkbox.stories.tsx +7 -0
  95. package/src/components/Form/Checkbox.tsx +3 -3
  96. package/src/components/Form/Form.stories.tsx +7 -0
  97. package/src/components/Form/FormGroup.stories.tsx +9 -1
  98. package/src/components/Form/Input.stories.tsx +69 -16
  99. package/src/components/Form/Input.tsx +4 -2
  100. package/src/components/Form/Radio.stories.tsx +9 -1
  101. package/src/components/Form/Radio.tsx +3 -3
  102. package/src/components/Form/Select.stories.tsx +9 -1
  103. package/src/components/Form/Select.tsx +3 -3
  104. package/src/components/Form/Textarea.stories.tsx +10 -2
  105. package/src/components/Form/Textarea.tsx +4 -2
  106. package/src/components/Hero/Hero.stories.tsx +7 -0
  107. package/src/components/List/List.stories.tsx +10 -3
  108. package/src/components/List/List.tsx +3 -3
  109. package/src/components/List/ListGroup.tsx +3 -1
  110. package/src/components/Messages/Messages.stories.tsx +8 -7
  111. package/src/components/Modal/Modal.stories.tsx +17 -6
  112. package/src/components/Modal/Modal.tsx +3 -3
  113. package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
  114. package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
  115. package/src/components/Navigation/Menu/Menu.tsx +9 -3
  116. package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
  117. package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
  118. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
  119. package/src/components/Pagination/Pagination.stories.tsx +188 -111
  120. package/src/components/Pagination/Pagination.tsx +88 -7
  121. package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
  122. package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
  123. package/src/components/Popover/Popover.stories.tsx +191 -115
  124. package/src/components/Popover/Popover.tsx +4 -4
  125. package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
  126. package/src/components/Progress/Progress.stories.tsx +79 -49
  127. package/src/components/Progress/Progress.tsx +6 -2
  128. package/src/components/Rating/Rating.stories.tsx +109 -84
  129. package/src/components/Rating/Rating.tsx +5 -2
  130. package/src/components/River/River.stories.tsx +194 -114
  131. package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
  132. package/src/components/Slider/Slider.stories.tsx +7 -0
  133. package/src/components/Slider/Slider.tsx +10 -9
  134. package/src/components/Spinner/Spinner.stories.tsx +15 -11
  135. package/src/components/Spinner/Spinner.tsx +3 -3
  136. package/src/components/Steps/Steps.stories.tsx +132 -98
  137. package/src/components/Tabs/Tabs.stories.tsx +163 -112
  138. package/src/components/Tabs/Tabs.tsx +3 -3
  139. package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
  140. package/src/components/Todo/Todo.stories.tsx +38 -12
  141. package/src/components/Toggle/Toggle.stories.tsx +61 -28
  142. package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
  143. package/src/components/Tooltip/Tooltip.tsx +3 -3
  144. package/src/components/Upload/Upload.stories.tsx +122 -84
  145. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
  146. package/src/components/index.ts +6 -2
  147. package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
  148. package/src/lib/composables/useAtomixGlass.ts +2 -3
  149. package/src/lib/composables/useChartPerformance.ts +102 -78
  150. package/src/lib/composables/useChartScale.ts +10 -0
  151. package/src/lib/composables/useHero.ts +9 -2
  152. package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
  153. package/src/lib/composables/useNavbar.ts +0 -10
  154. package/src/lib/composables/useSideMenu.ts +1 -0
  155. package/src/lib/composables/useVideoPlayer.ts +3 -2
  156. package/src/lib/config/loader.ts +57 -14
  157. package/src/lib/constants/components.ts +10 -0
  158. package/src/lib/hooks/index.ts +0 -1
  159. package/src/lib/hooks/useComponentCustomization.ts +11 -15
  160. package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
  161. package/src/lib/patterns/index.ts +2 -2
  162. package/src/lib/patterns/slots.tsx +2 -2
  163. package/src/lib/theme/README.md +174 -0
  164. package/src/lib/theme/adapters/index.ts +31 -0
  165. package/src/lib/theme/adapters/themeAdapter.ts +287 -0
  166. package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
  167. package/src/lib/theme/config/configLoader.ts +254 -0
  168. package/src/lib/theme/config/loader.ts +37 -48
  169. package/src/lib/theme/config/types.ts +2 -2
  170. package/src/lib/theme/config/validator.ts +15 -91
  171. package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
  172. package/src/lib/theme/constants/index.ts +8 -0
  173. package/src/lib/theme/core/ThemeRegistry.ts +19 -6
  174. package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
  175. package/src/lib/theme/core/composeTheme.ts +155 -0
  176. package/src/lib/theme/core/createTheme.ts +94 -0
  177. package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
  178. package/src/lib/theme/core/index.ts +5 -19
  179. package/src/lib/theme/devtools/Comparator.tsx +346 -22
  180. package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
  181. package/src/lib/theme/devtools/Inspector.tsx +335 -51
  182. package/src/lib/theme/devtools/LiveEditor.tsx +489 -112
  183. package/src/lib/theme/devtools/Preview.tsx +471 -221
  184. package/src/lib/theme/{core → devtools}/ThemeValidator.ts +6 -3
  185. package/src/lib/theme/devtools/index.ts +14 -4
  186. package/src/lib/theme/devtools/useHistory.ts +130 -0
  187. package/src/lib/theme/errors/index.ts +12 -0
  188. package/src/lib/theme/generators/cssFile.ts +79 -0
  189. package/src/lib/theme/generators/generateCSS.ts +89 -0
  190. package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +4 -14
  191. package/src/lib/theme/generators/index.ts +19 -0
  192. package/src/lib/theme/i18n/rtl.ts +7 -7
  193. package/src/lib/theme/index.ts +120 -15
  194. package/src/lib/theme/runtime/ThemeApplicator.ts +53 -95
  195. package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
  196. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +4 -4
  197. package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
  198. package/src/lib/theme/runtime/index.ts +1 -2
  199. package/src/lib/theme/runtime/useTheme.ts +1 -2
  200. package/src/lib/theme/test/testTheme.ts +385 -0
  201. package/src/lib/theme/tokens/index.ts +12 -0
  202. package/src/lib/theme/tokens/tokens.ts +721 -0
  203. package/src/lib/theme/types.ts +6 -42
  204. package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
  205. package/src/lib/theme/utils/index.ts +11 -0
  206. package/src/lib/theme/utils/injectCSS.ts +90 -0
  207. package/src/lib/theme/utils/themeHelpers.ts +78 -0
  208. package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
  209. package/src/lib/theme-tools.ts +8 -9
  210. package/src/lib/types/components.ts +93 -34
  211. package/src/lib/types/partProps.ts +0 -16
  212. package/src/lib/utils/componentUtils.ts +1 -1
  213. package/src/lib/utils/fontPreloader.ts +148 -0
  214. package/src/lib/utils/index.ts +11 -0
  215. package/src/lib/utils/memoryMonitor.ts +189 -0
  216. package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
  217. package/src/styles/01-settings/_settings.fonts.scss +2 -5
  218. package/src/styles/02-tools/_tools.button.scss +66 -79
  219. package/src/styles/06-components/_components.atomix-glass.scss +13 -3
  220. package/src/styles/06-components/_components.navbar.scss +0 -6
  221. package/src/styles/06-components/_components.pagination.scss +88 -0
  222. package/scripts/build-themes.js +0 -208
  223. package/scripts/sync-theme-config.js +0 -309
  224. package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
  225. package/src/lib/theme/composeTheme.ts +0 -370
  226. package/src/lib/theme/core/ThemeCache.ts +0 -283
  227. package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
  228. package/src/lib/theme/core/ThemeEngine.ts +0 -657
  229. package/src/lib/theme/createThemeFromConfig.ts +0 -132
  230. package/src/lib/theme/devtools/CLI.ts +0 -364
  231. package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
  232. package/src/lib/theme/runtime/ThemeManager.ts +0 -442
  233. package/src/styles/03-generic/_generated-root.css +0 -5
  234. package/src/themes/README.md +0 -442
  235. package/src/themes/themes.config.js +0 -35
  236. /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
  237. /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
@@ -118,6 +118,12 @@ export function AtomixGlass({
118
118
  opacity0: number;
119
119
  } | null>(null);
120
120
 
121
+ // Cache RGB color values from design tokens
122
+ const rgbCacheRef = useRef<{
123
+ whiteRgb: string;
124
+ blackRgb: string;
125
+ } | null>(null);
126
+
121
127
  // Use composable hook for all state and logic
122
128
  const {
123
129
  isHovered,
@@ -161,35 +167,63 @@ export function AtomixGlass({
161
167
 
162
168
  // Read CSS custom properties once on mount and cache them
163
169
  useEffect(() => {
164
- if (typeof window !== 'undefined' && glassRef.current && !opacityCacheRef.current) {
170
+ if (typeof window !== 'undefined' && glassRef.current) {
165
171
  try {
166
172
  const computedStyle = window.getComputedStyle(glassRef.current);
167
- const opacity50Value = computedStyle.getPropertyValue('--atomix-opacity-50').trim();
168
- const opacity40Value = computedStyle.getPropertyValue('--atomix-opacity-40').trim();
169
- const opacity80Value = computedStyle.getPropertyValue('--atomix-opacity-80').trim();
170
- const opacity0Value = computedStyle.getPropertyValue('--atomix-opacity-0').trim();
171
-
172
- // Parse opacity values, handling 0 correctly (use NaN check instead of falsy check)
173
- const parseOpacity = (value: string, defaultValue: number): number => {
174
- if (!value) return defaultValue;
175
- const parsed = parseFloat(value);
176
- return isNaN(parsed) ? defaultValue : parsed;
177
- };
178
-
179
- opacityCacheRef.current = {
180
- opacity50: parseOpacity(opacity50Value, 0.5),
181
- opacity40: parseOpacity(opacity40Value, 0.4),
182
- opacity80: parseOpacity(opacity80Value, 0.8),
183
- opacity0: parseOpacity(opacity0Value, 0),
184
- };
173
+
174
+ // Cache opacity values
175
+ if (!opacityCacheRef.current) {
176
+ const opacity50Value = computedStyle.getPropertyValue('--atomix-opacity-50').trim();
177
+ const opacity40Value = computedStyle.getPropertyValue('--atomix-opacity-40').trim();
178
+ const opacity80Value = computedStyle.getPropertyValue('--atomix-opacity-80').trim();
179
+ const opacity0Value = computedStyle.getPropertyValue('--atomix-opacity-0').trim();
180
+
181
+ // Parse opacity values, handling 0 correctly (use NaN check instead of falsy check)
182
+ const parseOpacity = (value: string, defaultValue: number): number => {
183
+ if (!value) return defaultValue;
184
+ const parsed = parseFloat(value);
185
+ return isNaN(parsed) ? defaultValue : parsed;
186
+ };
187
+
188
+ opacityCacheRef.current = {
189
+ opacity50: parseOpacity(opacity50Value, 0.5),
190
+ opacity40: parseOpacity(opacity40Value, 0.4),
191
+ opacity80: parseOpacity(opacity80Value, 0.8),
192
+ opacity0: parseOpacity(opacity0Value, 0),
193
+ };
194
+ }
195
+
196
+ // Cache RGB color values from design tokens
197
+ if (!rgbCacheRef.current) {
198
+ // Try to read from design tokens, fallback to defaults
199
+ const whiteRgbValue = computedStyle.getPropertyValue('--atomix-light-rgb').trim() ||
200
+ computedStyle.getPropertyValue('--atomix-white-rgb').trim() ||
201
+ '';
202
+ const blackRgbValue = computedStyle.getPropertyValue('--atomix-dark-rgb').trim() ||
203
+ computedStyle.getPropertyValue('--atomix-black-rgb').trim() ||
204
+ '';
205
+
206
+ rgbCacheRef.current = {
207
+ whiteRgb: whiteRgbValue || '255, 255, 255', // Fallback to white RGB
208
+ blackRgb: blackRgbValue || '0, 0, 0', // Fallback to black RGB
209
+ };
210
+ }
185
211
  } catch (error) {
186
212
  // Fallback to defaults if reading fails
187
- opacityCacheRef.current = {
188
- opacity50: 0.5,
189
- opacity40: 0.4,
190
- opacity80: 0.8,
191
- opacity0: 0,
192
- };
213
+ if (!opacityCacheRef.current) {
214
+ opacityCacheRef.current = {
215
+ opacity50: 0.5,
216
+ opacity40: 0.4,
217
+ opacity80: 0.8,
218
+ opacity0: 0,
219
+ };
220
+ }
221
+ if (!rgbCacheRef.current) {
222
+ rgbCacheRef.current = {
223
+ whiteRgb: '255, 255, 255',
224
+ blackRgb: '0, 0, 0',
225
+ };
226
+ }
193
227
  }
194
228
  }
195
229
  }, []);
@@ -393,12 +427,12 @@ export function AtomixGlass({
393
427
 
394
428
  const glassVars = useMemo(() => {
395
429
  // RGB color values for rgba() functions
396
- // Note: CSS doesn't support rgba(var(--rgb), opacity) syntax, so we use direct values
397
- // These values align with design tokens: --atomix-white-rgb and --atomix-black-rgb
398
- // The actual RGB values are defined in SCSS and should match these fallbacks
399
- // TODO: Consider reading from CSS custom properties if browser support improves
400
- const whiteColor = '255, 255, 255'; // Matches --atomix-white-rgb design token
401
- const blackColor = '0, 0, 0'; // Matches --atomix-black-rgb design token
430
+ // Note: CSS doesn't support rgba(var(--rgb), opacity) syntax - this is a CSS specification
431
+ // limitation, not a browser support issue. We read RGB values from design tokens at mount
432
+ // and cache them for performance. Falls back to defaults if tokens are not available.
433
+ // Uses design tokens: --atomix-light-rgb / --atomix-white-rgb and --atomix-dark-rgb / --atomix-black-rgb
434
+ const whiteColor = rgbCacheRef.current?.whiteRgb || '255, 255, 255';
435
+ const blackColor = rgbCacheRef.current?.blackRgb || '0, 0, 0';
402
436
 
403
437
  return {
404
438
  // Standard CSS custom properties for dynamic values
@@ -130,10 +130,17 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
130
130
  },
131
131
  ref
132
132
  ) => {
133
- // Use React's useId() for SSR compatibility
134
- // Note: In Next.js, IDs may differ between server and client
135
- // We'll suppress hydration warnings on elements that use this ID
136
- const filterId = useId();
133
+ // Generate a stable, deterministic ID for SSR compatibility
134
+ // React's useId() should produce the same ID on server and client for the same
135
+ // component position in the tree. We use useState to ensure the ID is only
136
+ // generated once and remains stable across renders.
137
+ const baseId = useId();
138
+ const [filterId] = useState(() => {
139
+ // Normalize the ID to ensure it's valid and consistent
140
+ // Remove colons (which useId() uses) and ensure it starts with a letter
141
+ const normalizedId = baseId.replace(/:/g, '-').replace(/^[^a-z]/i, 'atomix-');
142
+ return `atomix-glass-filter-${normalizedId}`;
143
+ });
137
144
 
138
145
  const [shaderMapUrl, setShaderMapUrl] = useState<string>('');
139
146
  const shaderGeneratorRef = useRef<any>(null);
@@ -124,7 +124,7 @@ See documentation for detailed examples of each mode.`,
124
124
  },
125
125
  },
126
126
  mode: {
127
- control: 'select',
127
+ control: { type: 'select' },
128
128
  options: ['standard', 'polar', 'prominent', 'shader'],
129
129
  description: 'Glass effect mode (default: "standard")',
130
130
  table: { defaultValue: { summary: '"standard"' } },
@@ -446,37 +446,6 @@ const backgroundImages = [
446
446
  'https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
447
447
  ];
448
448
 
449
- /**
450
- * Legacy backgrounds object for backward compatibility
451
- * @deprecated Use backgroundImages array instead
452
- */
453
- const backgrounds = {
454
- // Office and workspace environments
455
- blueGradient: backgroundImages[0], // Modern office interior
456
- purpleGradient: backgroundImages[1], // Mountain landscape
457
- greenGradient: backgroundImages[3], // Forest path
458
-
459
- // Apple-inspired natural scenes
460
- macosWallpaper: backgroundImages[1], // Mountain landscape
461
- iosWallpaper: backgroundImages[4], // Ocean waves
462
-
463
- // Nature scenes
464
- mountains: backgroundImages[1], // Mountain landscape
465
- ocean: backgroundImages[4], // Ocean waves
466
-
467
- // Urban environments
468
- cityNight: backgroundImages[2], // Urban cityscape
469
- cityDay: backgroundImages[5], // Modern architecture
470
-
471
- // Interior spaces
472
- abstract1: backgroundImages[6], // Cozy café interior
473
- abstract2: backgroundImages[9], // Modern library
474
-
475
- // Video backgrounds
476
- videoBackground:
477
- 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
478
- };
479
-
480
449
  /**
481
450
  * Default showcase of the AtomixGlass component
482
451
  *
@@ -11,7 +11,7 @@ import React from 'react';
11
11
  import { useState, useEffect } from 'react';
12
12
  import { Meta, StoryObj } from '@storybook/react';
13
13
  import AtomixGlass from '../AtomixGlass';
14
- import { BackgroundWrapper, backgrounds, backgroundImages } from './shared-components';
14
+ import { BackgroundWrapper, backgroundImages } from './shared-components';
15
15
 
16
16
  import { Button } from '../../Button';
17
17
  import { Badge } from '../../Badge';
@@ -181,7 +181,7 @@ export const VideoBackground: Story = {
181
181
  zIndex: -1,
182
182
  }}
183
183
  >
184
- <source src={backgrounds.videoBackground} type="video/mp4" />
184
+ <source src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4" />
185
185
  </video>
186
186
 
187
187
  <div
@@ -106,37 +106,6 @@ export const backgroundImages = [
106
106
  'https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
107
107
  ];
108
108
 
109
- /**
110
- * Legacy backgrounds object for backward compatibility
111
- * @deprecated Use backgroundImages array instead
112
- */
113
- export const backgrounds = {
114
- // Office and workspace environments
115
- blueGradient: backgroundImages[0], // Modern office interior
116
- purpleGradient: backgroundImages[1], // Mountain landscape
117
- greenGradient: backgroundImages[3], // Forest path
118
-
119
- // Apple-inspired natural scenes
120
- macosWallpaper: backgroundImages[1], // Mountain landscape
121
- iosWallpaper: backgroundImages[4], // Ocean waves
122
-
123
- // Nature scenes
124
- mountains: backgroundImages[1], // Mountain landscape
125
- ocean: backgroundImages[4], // Ocean waves
126
-
127
- // Urban environments
128
- cityNight: backgroundImages[2], // Urban cityscape
129
- cityDay: backgroundImages[5], // Modern architecture
130
-
131
- // Interior spaces
132
- abstract1: backgroundImages[6], // Cozy café interior
133
- abstract2: backgroundImages[9], // Modern library
134
-
135
- // Video backgrounds
136
- videoBackground:
137
- 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
138
- };
139
-
140
109
  /**
141
110
  * BackgroundWrapper Component Implementation
142
111
  *
@@ -8,7 +8,14 @@ const meta = {
8
8
  component: Avatar,
9
9
  parameters: {
10
10
  layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component:
14
+ 'The Avatar component displays user profile images, initials, or icons. It provides a consistent way to represent users throughout the application. Avatars support various sizes, can be circular or square, and gracefully handle missing images by showing initials or icons.',
15
+ },
16
+ },
11
17
  },
18
+ tags: ['autodocs'],
12
19
  argTypes: {
13
20
  src: {
14
21
  control: 'text',
@@ -1,9 +1,9 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, memo } from 'react';
2
2
  import { AvatarProps } from '../../lib/types/components';
3
3
  import { AVATAR } from '../../lib/constants/components';
4
4
  import { Icon } from '../Icon/Icon';
5
5
 
6
- export const Avatar: React.FC<AvatarProps> = ({
6
+ export const Avatar: React.FC<AvatarProps> = memo(({
7
7
  src,
8
8
  alt = 'Avatar',
9
9
  initials,
@@ -62,7 +62,7 @@ export const Avatar: React.FC<AvatarProps> = ({
62
62
  )}
63
63
  </div>
64
64
  );
65
- };
65
+ });
66
66
 
67
67
  Avatar.displayName = 'Avatar';
68
68
 
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Meta, StoryObj } from '@storybook/react';
2
3
  import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
3
4
  import { BADGE, SIZES, THEME_COLORS } from '../../lib/constants/components';
@@ -11,17 +12,26 @@ const meta = {
11
12
  component: Badge,
12
13
  parameters: {
13
14
  layout: 'centered',
15
+ docs: {
16
+ description: {
17
+ component:
18
+ 'The Badge component displays small pieces of information, status indicators, or labels. It supports multiple variants, sizes, and can include icons. Badges are ideal for highlighting important information or showing status.',
19
+ },
20
+ },
14
21
  },
22
+ tags: ['autodocs'],
15
23
  argTypes: {
16
24
  variant: {
17
25
  control: { type: 'select' },
18
26
  options: THEME_COLORS,
19
27
  description: 'The visual style of the badge',
28
+ defaultValue: 'primary',
20
29
  },
21
30
  size: {
22
31
  control: { type: 'select' },
23
32
  options: SIZES,
24
33
  description: 'The size of the badge',
34
+ defaultValue: 'md',
25
35
  },
26
36
  disabled: {
27
37
  control: 'boolean',
@@ -60,7 +70,9 @@ const Icon = () => (
60
70
  </svg>
61
71
  );
62
72
 
63
- // Basic Badges
73
+ /**
74
+ * Primary badge variant - the main badge style.
75
+ */
64
76
  export const Primary: Story = {
65
77
  args: {
66
78
  label: 'Primary',
@@ -69,6 +81,9 @@ export const Primary: Story = {
69
81
  },
70
82
  };
71
83
 
84
+ /**
85
+ * Secondary badge variant - used for secondary information.
86
+ */
72
87
  export const Secondary: Story = {
73
88
  args: {
74
89
  label: 'Secondary',
@@ -77,6 +92,9 @@ export const Secondary: Story = {
77
92
  },
78
93
  };
79
94
 
95
+ /**
96
+ * Success badge variant - indicates successful or positive status.
97
+ */
80
98
  export const Success: Story = {
81
99
  args: {
82
100
  label: 'Success',
@@ -85,6 +103,9 @@ export const Success: Story = {
85
103
  },
86
104
  };
87
105
 
106
+ /**
107
+ * Info badge variant - used for informational status.
108
+ */
88
109
  export const Info: Story = {
89
110
  args: {
90
111
  label: 'Info',
@@ -93,6 +114,9 @@ export const Info: Story = {
93
114
  },
94
115
  };
95
116
 
117
+ /**
118
+ * Warning badge variant - indicates caution or warning status.
119
+ */
96
120
  export const Warning: Story = {
97
121
  args: {
98
122
  label: 'Warning',
@@ -101,7 +125,10 @@ export const Warning: Story = {
101
125
  },
102
126
  };
103
127
 
104
- export const error: Story = {
128
+ /**
129
+ * Error badge variant - indicates error or critical status.
130
+ */
131
+ export const Error: Story = {
105
132
  args: {
106
133
  label: 'Error',
107
134
  variant: 'error',
@@ -109,6 +136,9 @@ export const error: Story = {
109
136
  },
110
137
  };
111
138
 
139
+ /**
140
+ * Light badge variant - light color scheme.
141
+ */
112
142
  export const Light: Story = {
113
143
  args: {
114
144
  label: 'Light',
@@ -117,6 +147,9 @@ export const Light: Story = {
117
147
  },
118
148
  };
119
149
 
150
+ /**
151
+ * Dark badge variant - dark color scheme.
152
+ */
120
153
  export const Dark: Story = {
121
154
  args: {
122
155
  label: 'Dark',
@@ -125,7 +158,9 @@ export const Dark: Story = {
125
158
  },
126
159
  };
127
160
 
128
- // Badge Sizes
161
+ /**
162
+ * Small size badge variant.
163
+ */
129
164
  export const Small: Story = {
130
165
  args: {
131
166
  label: 'Small',
@@ -134,6 +169,9 @@ export const Small: Story = {
134
169
  },
135
170
  };
136
171
 
172
+ /**
173
+ * Medium size badge variant (default).
174
+ */
137
175
  export const Medium: Story = {
138
176
  args: {
139
177
  label: 'Medium',
@@ -142,6 +180,9 @@ export const Medium: Story = {
142
180
  },
143
181
  };
144
182
 
183
+ /**
184
+ * Large size badge variant.
185
+ */
145
186
  export const Large: Story = {
146
187
  args: {
147
188
  label: 'Large',
@@ -150,7 +191,9 @@ export const Large: Story = {
150
191
  },
151
192
  };
152
193
 
153
- // States
194
+ /**
195
+ * Disabled badge state - non-interactive badge.
196
+ */
154
197
  export const Disabled: Story = {
155
198
  args: {
156
199
  label: 'Disabled',
@@ -160,7 +203,9 @@ export const Disabled: Story = {
160
203
  },
161
204
  };
162
205
 
163
- // With Icon
206
+ /**
207
+ * Badge with icon - displays an icon alongside the label.
208
+ */
164
209
  export const WithIcon: Story = {
165
210
  args: {
166
211
  label: 'With Icon',
@@ -170,12 +215,21 @@ export const WithIcon: Story = {
170
215
  },
171
216
  };
172
217
 
173
- // Group of Badge Variants
218
+ /**
219
+ * Showcase of all badge color variants in a single view.
220
+ */
174
221
  export const AllVariants: Story = {
175
222
  args: {
176
223
  label: 'Badge',
177
224
  variant: 'primary',
178
225
  },
226
+ parameters: {
227
+ docs: {
228
+ description: {
229
+ story: 'Displays all available badge color variants for easy comparison and selection.',
230
+ },
231
+ },
232
+ },
179
233
  render: () => (
180
234
  <div className="u-d-flex u-flex-wrap u-gap-2">
181
235
  {THEME_COLORS.map(color => (
@@ -185,12 +239,21 @@ export const AllVariants: Story = {
185
239
  ),
186
240
  };
187
241
 
188
- // Group of Badge Sizes
242
+ /**
243
+ * Showcase of all badge sizes (small, medium, large) in a single view.
244
+ */
189
245
  export const AllSizes: Story = {
190
246
  args: {
191
247
  label: 'Badge',
192
248
  variant: 'primary',
193
249
  },
250
+ parameters: {
251
+ docs: {
252
+ description: {
253
+ story: 'Compares all available badge sizes to help choose the appropriate size for your use case.',
254
+ },
255
+ },
256
+ },
194
257
  render: () => (
195
258
  <div className="u-d-flex u-align-items-center u-gap-2">
196
259
  <Badge label="Small" variant="primary" size="sm" />
@@ -200,7 +263,9 @@ export const AllSizes: Story = {
200
263
  ),
201
264
  };
202
265
 
203
- // With different content
266
+ /**
267
+ * Badge examples with different content types (numeric, status, with icons).
268
+ */
204
269
  export const WithDifferentContent: Story = {
205
270
  args: {
206
271
  label: 'Badge with different content',
@@ -241,11 +306,20 @@ export const WithDifferentContent: Story = {
241
306
  ),
242
307
  };
243
308
 
244
- // Usage examples
309
+ /**
310
+ * Real-world usage examples showing badges in navigation, cards, and lists.
311
+ */
245
312
  export const UsageExamples: Story = {
246
313
  args: {
247
314
  label: 'Usage examples',
248
315
  },
316
+ parameters: {
317
+ docs: {
318
+ description: {
319
+ story: 'Practical examples demonstrating how badges can be used in real-world scenarios such as navigation menus, product cards, and task lists.',
320
+ },
321
+ },
322
+ },
249
323
  render: () => (
250
324
  <div className="u-d-flex u-flex-column u-gap-6 u-max-width-80">
251
325
  <div>
@@ -308,7 +382,9 @@ export const UsageExamples: Story = {
308
382
  ),
309
383
  };
310
384
 
311
- // Theme-aware demo showing badges in both light and dark mode side by side
385
+ /**
386
+ * Theme-aware badges demonstrating how they adapt to different theme modes.
387
+ */
312
388
  export const ThemeAwareBadges: Story = {
313
389
  args: {
314
390
  label: 'Badge',
@@ -359,7 +435,7 @@ export const ThemeAwareBadges: Story = {
359
435
  </div>
360
436
  <div className="u-d-flex u-align-items-center u-gap-2">
361
437
  <span className="u-d-inline-block" style={{ width: '120px' }}>
362
- error:
438
+ Error:
363
439
  </span>
364
440
  <Badge label="Failed" variant="error" />
365
441
  </div>
@@ -375,7 +451,9 @@ export const ThemeAwareBadges: Story = {
375
451
  ),
376
452
  };
377
453
 
378
- // Glass Variants
454
+ /**
455
+ * Badge with glass morphism effect - primary variant.
456
+ */
379
457
  export const GlassPrimary: Story = {
380
458
  args: {
381
459
  label: 'Glass Primary',
@@ -540,7 +618,7 @@ export const GlassCustomSettings: Story = {
540
618
  aberrationIntensity: 1,
541
619
  cornerRadius: 16,
542
620
  mode: 'polar',
543
- },
621
+ } as any,
544
622
  },
545
623
  decorators: [
546
624
  Story => (
@@ -1,10 +1,10 @@
1
- import React, { useRef } from 'react';
1
+ import React, { useRef, memo } from 'react';
2
2
  import { useBadge } from '../../lib/composables/useBadge';
3
3
  import { BADGE } from '../../lib/constants/components';
4
4
  import { BadgeProps } from '../../lib/types/components';
5
5
  import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
6
6
 
7
- export const Badge: React.FC<BadgeProps> = ({
7
+ export const Badge: React.FC<BadgeProps> = memo(({
8
8
  label,
9
9
  variant = 'primary',
10
10
  size = 'md',
@@ -53,7 +53,7 @@ export const Badge: React.FC<BadgeProps> = ({
53
53
  }
54
54
 
55
55
  return badgeElement;
56
- };
56
+ });
57
57
 
58
58
  Badge.displayName = 'Badge';
59
59
 
@@ -5,43 +5,27 @@ import { Button } from '../Button/Button';
5
5
  import { Card } from '../Card/Card';
6
6
  import { Block } from './Block';
7
7
 
8
- const meta: Meta<typeof Block> = {
8
+ const meta = {
9
9
  title: 'Components/Block',
10
10
  component: Block,
11
11
  parameters: {
12
12
  layout: 'fullscreen',
13
13
  docs: {
14
14
  description: {
15
- component: `
16
- The Block component is a flexible layout container designed for creating consistent section layouts.
17
- It provides standardized spacing, background variants, and container behavior for organizing content
18
- into distinct sections or blocks.
19
-
20
- ## Key Features
21
- - **Flexible spacing**: Multiple spacing sizes (xs, sm, md, lg, xl, none)
22
- - **Background variants**: Transparent, subtle, muted, primary, secondary, accent
23
- - **Container integration**: Built-in Container support for responsive layouts
24
- - **Semantic HTML**: Configurable as section, div, article, aside, or main
25
- - **Full-width support**: Option for edge-to-edge content
26
-
27
- ## Usage Guidelines
28
- Use Block components to:
29
- - Create consistent section spacing across pages
30
- - Group related content with appropriate backgrounds
31
- - Build hero sections, content areas, and feature blocks
32
- - Maintain visual hierarchy and rhythm in layouts
33
- `,
15
+ component:
16
+ 'The Block component is a flexible layout container designed for creating consistent section layouts. It provides standardized spacing, background variants, and container behavior for organizing content into distinct sections or blocks. Blocks are ideal for hero sections, content areas, feature blocks, and maintaining visual hierarchy.',
34
17
  },
35
18
  },
36
19
  },
20
+ tags: ['autodocs'],
37
21
  argTypes: {
38
22
  as: {
39
- control: 'select',
23
+ control: { type: 'select' },
40
24
  options: ['section', 'div', 'article', 'aside', 'main'],
41
25
  description: 'The HTML element to render as',
42
26
  },
43
27
  spacing: {
44
- control: 'select',
28
+ control: { type: 'select' },
45
29
  options: ['xs', 'sm', 'md', 'lg', 'xl', 'none'],
46
30
  description: 'Vertical padding size',
47
31
  },
@@ -54,7 +38,7 @@ Use Block components to:
54
38
  description: 'Content to render within the block',
55
39
  },
56
40
  },
57
- };
41
+ } satisfies Meta<typeof Block>;
58
42
 
59
43
  export default meta;
60
44
  type Story = StoryObj<typeof meta>;
@@ -7,7 +7,14 @@ const meta = {
7
7
  component: Breadcrumb,
8
8
  parameters: {
9
9
  layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'The Breadcrumb component provides navigation context by showing the current page location within a site hierarchy. It helps users understand where they are and provides quick navigation to parent pages. Breadcrumbs support custom dividers, icons, and are fully accessible.',
14
+ },
15
+ },
10
16
  },
17
+ tags: ['autodocs'],
11
18
  argTypes: {
12
19
  items: { control: 'object' },
13
20
  divider: { control: 'text' },