@shohojdhara/atomix 0.3.5 → 0.3.7

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 (182) hide show
  1. package/README.md +101 -199
  2. package/atomix.config.ts +241 -0
  3. package/dist/atomix.css +260 -179
  4. package/dist/atomix.css.map +1 -1
  5. package/dist/atomix.min.css +250 -179
  6. package/dist/atomix.min.css.map +1 -1
  7. package/dist/charts.js +69 -166
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.js +184 -263
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.js +55 -131
  12. package/dist/forms.js.map +1 -1
  13. package/dist/heavy.js +184 -263
  14. package/dist/heavy.js.map +1 -1
  15. package/dist/index.d.ts +1831 -1657
  16. package/dist/index.esm.js +4497 -4318
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +4510 -4328
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.min.js +1 -1
  21. package/dist/index.min.js.map +1 -1
  22. package/dist/theme.d.ts +1431 -1472
  23. package/dist/theme.js +4175 -4138
  24. package/dist/theme.js.map +1 -1
  25. package/package.json +6 -20
  26. package/src/components/Accordion/Accordion.stories.tsx +50 -17
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +128 -322
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +12 -5
  29. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
  30. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
  31. package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
  32. package/src/components/Avatar/Avatar.stories.tsx +7 -0
  33. package/src/components/Badge/Badge.stories.tsx +91 -13
  34. package/src/components/Block/Block.stories.tsx +7 -23
  35. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
  36. package/src/components/Button/Button.stories.tsx +141 -22
  37. package/src/components/Button/Button.tsx +85 -167
  38. package/src/components/Button/ButtonGroup.stories.tsx +315 -0
  39. package/src/components/Button/ButtonGroup.tsx +67 -0
  40. package/src/components/Button/index.ts +2 -0
  41. package/src/components/Callout/Callout.stories.tsx +8 -6
  42. package/src/components/Card/Card.stories.tsx +82 -28
  43. package/src/components/Chart/AnimatedChart.tsx +0 -1
  44. package/src/components/Chart/AreaChart.tsx +0 -1
  45. package/src/components/Chart/BarChart.tsx +0 -1
  46. package/src/components/Chart/BubbleChart.tsx +0 -1
  47. package/src/components/Chart/CandlestickChart.tsx +0 -1
  48. package/src/components/Chart/Chart.stories.tsx +5 -7
  49. package/src/components/Chart/Chart.tsx +0 -16
  50. package/src/components/Chart/ChartRenderer.tsx +1 -1
  51. package/src/components/Chart/DonutChart.tsx +0 -1
  52. package/src/components/Chart/FunnelChart.tsx +0 -1
  53. package/src/components/Chart/GaugeChart.tsx +0 -1
  54. package/src/components/Chart/HeatmapChart.tsx +0 -1
  55. package/src/components/Chart/LineChart.tsx +0 -1
  56. package/src/components/Chart/MultiAxisChart.tsx +0 -1
  57. package/src/components/Chart/PieChart.tsx +0 -1
  58. package/src/components/Chart/RadarChart.tsx +0 -1
  59. package/src/components/Chart/ScatterChart.tsx +0 -1
  60. package/src/components/Chart/WaterfallChart.tsx +0 -1
  61. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
  62. package/src/components/DataTable/DataTable.stories.tsx +23 -16
  63. package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
  64. package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
  65. package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
  66. package/src/components/Footer/Footer.stories.tsx +8 -6
  67. package/src/components/Footer/FooterLink.tsx +9 -2
  68. package/src/components/Form/Checkbox.stories.tsx +7 -0
  69. package/src/components/Form/Form.stories.tsx +7 -0
  70. package/src/components/Form/FormGroup.stories.tsx +9 -1
  71. package/src/components/Form/Input.stories.tsx +69 -16
  72. package/src/components/Form/Radio.stories.tsx +9 -1
  73. package/src/components/Form/Select.stories.tsx +9 -1
  74. package/src/components/Form/Textarea.stories.tsx +10 -2
  75. package/src/components/Hero/Hero.stories.tsx +7 -0
  76. package/src/components/List/List.stories.tsx +7 -0
  77. package/src/components/Messages/Messages.stories.tsx +8 -7
  78. package/src/components/Modal/Modal.stories.tsx +17 -6
  79. package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
  80. package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
  81. package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
  82. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
  83. package/src/components/Pagination/Pagination.stories.tsx +188 -111
  84. package/src/components/Pagination/Pagination.tsx +83 -3
  85. package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
  86. package/src/components/Popover/Popover.stories.tsx +191 -115
  87. package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
  88. package/src/components/Progress/Progress.stories.tsx +79 -49
  89. package/src/components/Rating/Rating.stories.tsx +109 -84
  90. package/src/components/River/River.stories.tsx +194 -114
  91. package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
  92. package/src/components/Slider/Slider.stories.tsx +7 -0
  93. package/src/components/Spinner/Spinner.stories.tsx +15 -11
  94. package/src/components/Steps/Steps.stories.tsx +132 -98
  95. package/src/components/Tabs/Tabs.stories.tsx +163 -112
  96. package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
  97. package/src/components/Todo/Todo.stories.tsx +38 -12
  98. package/src/components/Toggle/Toggle.stories.tsx +61 -28
  99. package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
  100. package/src/components/Upload/Upload.stories.tsx +122 -84
  101. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
  102. package/src/components/index.ts +1 -0
  103. package/src/lib/composables/useAtomixGlass.ts +9 -10
  104. package/src/lib/composables/useNavbar.ts +0 -10
  105. package/src/lib/config/loader.ts +4 -4
  106. package/src/lib/constants/components.ts +17 -0
  107. package/src/lib/hooks/useComponentCustomization.ts +1 -1
  108. package/src/lib/hooks/usePerformanceMonitor.ts +1 -1
  109. package/src/lib/hooks/useThemeTokens.ts +105 -0
  110. package/src/lib/theme/README.md +174 -0
  111. package/src/lib/theme/adapters/index.ts +31 -0
  112. package/src/lib/theme/adapters/themeAdapter.ts +287 -0
  113. package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
  114. package/src/lib/theme/config/configLoader.ts +95 -0
  115. package/src/lib/theme/config/loader.ts +37 -54
  116. package/src/lib/theme/config/types.ts +2 -2
  117. package/src/lib/theme/config/validator.ts +15 -91
  118. package/src/lib/theme/{constants.ts → constants/constants.ts} +1 -19
  119. package/src/lib/theme/constants/index.ts +8 -0
  120. package/src/lib/theme/core/ThemeRegistry.ts +75 -266
  121. package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
  122. package/src/lib/theme/core/composeTheme.ts +105 -0
  123. package/src/lib/theme/core/createTheme.ts +108 -0
  124. package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +12 -8
  125. package/src/lib/theme/core/index.ts +19 -19
  126. package/src/lib/theme/devtools/Comparator.tsx +346 -22
  127. package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
  128. package/src/lib/theme/devtools/Inspector.tsx +335 -51
  129. package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
  130. package/src/lib/theme/devtools/Preview.tsx +471 -221
  131. package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
  132. package/src/lib/theme/devtools/index.ts +14 -4
  133. package/src/lib/theme/devtools/useHistory.ts +130 -0
  134. package/src/lib/theme/{errors.ts → errors/errors.ts} +1 -1
  135. package/src/lib/theme/errors/index.ts +12 -0
  136. package/src/lib/theme/generators/cssFile.ts +79 -0
  137. package/src/lib/theme/generators/generateCSS.ts +89 -0
  138. package/src/lib/theme/generators/generateCSSNested.ts +130 -0
  139. package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
  140. package/src/lib/theme/generators/index.ts +25 -0
  141. package/src/lib/theme/i18n/rtl.ts +5 -6
  142. package/src/lib/theme/index.ts +149 -19
  143. package/src/lib/theme/runtime/ThemeApplicator.ts +53 -112
  144. package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
  145. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +5 -5
  146. package/src/lib/theme/runtime/ThemeProvider.tsx +266 -282
  147. package/src/lib/theme/runtime/index.ts +2 -2
  148. package/src/lib/theme/runtime/useTheme.ts +1 -2
  149. package/src/lib/theme/runtime/useThemeTokens.ts +131 -0
  150. package/src/lib/theme/test/testTheme.ts +385 -0
  151. package/src/lib/theme/tokens/index.ts +12 -0
  152. package/src/lib/theme/tokens/tokens.ts +721 -0
  153. package/src/lib/theme/types.ts +6 -42
  154. package/src/lib/theme/utils/componentTheming.ts +132 -0
  155. package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
  156. package/src/lib/theme/utils/index.ts +11 -0
  157. package/src/lib/theme/utils/injectCSS.ts +90 -0
  158. package/src/lib/theme/utils/naming.ts +100 -0
  159. package/src/lib/theme/utils/themeHelpers.ts +78 -0
  160. package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +7 -7
  161. package/src/lib/theme-tools.ts +7 -8
  162. package/src/lib/types/components.ts +40 -130
  163. package/src/lib/utils/componentUtils.ts +2 -2
  164. package/src/lib/utils/memoryMonitor.ts +3 -3
  165. package/src/lib/utils/themeNaming.ts +135 -0
  166. package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
  167. package/src/styles/02-tools/_tools.button.scss +66 -79
  168. package/src/styles/06-components/_components.atomix-glass.scss +13 -3
  169. package/src/styles/06-components/_components.pagination.scss +88 -0
  170. package/scripts/sync-theme-config.js +0 -309
  171. package/src/lib/theme/composeTheme.ts +0 -370
  172. package/src/lib/theme/core/ThemeCache.ts +0 -283
  173. package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
  174. package/src/lib/theme/core/ThemeEngine.ts +0 -665
  175. package/src/lib/theme/createThemeFromConfig.ts +0 -132
  176. package/src/lib/theme/devtools/CLI.ts +0 -364
  177. package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
  178. package/src/lib/theme/runtime/ThemeManager.ts +0 -446
  179. package/src/styles/03-generic/_generated-root.css +0 -26
  180. package/src/themes/README.md +0 -442
  181. package/src/themes/themes.config.js +0 -68
  182. /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
@@ -1,22 +1,25 @@
1
- import { Meta, StoryFn } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import React, { useState } from 'react';
3
3
  import { Upload } from './Upload';
4
+ import { SIZES } from '../../lib/constants/components';
4
5
 
5
- export default {
6
+ const meta = {
6
7
  title: 'Components/Upload',
7
8
  component: Upload,
8
9
  parameters: {
10
+ layout: 'centered',
9
11
  docs: {
10
12
  description: {
11
13
  component:
12
- 'A modern file upload component with drag & drop functionality, progress tracking, and multiple size variants.',
14
+ 'The Upload component provides a modern file upload interface with drag & drop functionality, progress tracking, file preview, and validation. It supports single and multiple file uploads, custom file size limits, and provides visual feedback throughout the upload process. Ideal for forms requiring file attachments or media uploads.',
13
15
  },
14
16
  },
15
17
  },
18
+ tags: ['autodocs'],
16
19
  argTypes: {
17
20
  size: {
18
21
  control: { type: 'select' },
19
- options: ['sm', 'md', 'lg'],
22
+ options: SIZES,
20
23
  defaultValue: 'md',
21
24
  description: 'Size variant of the upload component',
22
25
  },
@@ -56,33 +59,37 @@ export default {
56
59
  description: 'Helper text displayed below the button',
57
60
  },
58
61
  },
59
- } as Meta<typeof Upload>;
62
+ } satisfies Meta<typeof Upload>;
60
63
 
61
- const Template: StoryFn<typeof Upload> = args => (
62
- <div style={{ padding: '30px', maxWidth: '600px' }}>
63
- <Upload {...args} />
64
- </div>
65
- );
64
+ export default meta;
65
+ type Story = StoryObj<typeof meta>;
66
66
 
67
67
  // Default upload component
68
- export const Default = Template.bind({});
69
- Default.args = {
70
- size: 'md',
71
- title: 'Drag and Drop files here',
72
- supportedFilesText: 'Files supported: PDF, XSLS, JPEG, PNG, Scanner',
73
- buttonText: 'Choose File',
74
- helperText: 'Maximum size: 5MB',
75
- };
76
- Default.parameters = {
77
- docs: {
78
- description: {
79
- story: 'The default upload component with medium size and standard styling.',
68
+ export const Default: Story = {
69
+ render: args => (
70
+ <div style={{ padding: '30px', maxWidth: '600px' }}>
71
+ <Upload {...args} />
72
+ </div>
73
+ ),
74
+ args: {
75
+ size: 'md',
76
+ title: 'Drag and Drop files here',
77
+ supportedFilesText: 'Files supported: PDF, XSLS, JPEG, PNG, Scanner',
78
+ buttonText: 'Choose File',
79
+ helperText: 'Maximum size: 5MB',
80
+ },
81
+ parameters: {
82
+ docs: {
83
+ description: {
84
+ story: 'The default upload component with medium size and standard styling.',
85
+ },
80
86
  },
81
87
  },
82
88
  };
83
89
 
84
90
  // Size Variants
85
- export const SizeVariants: StoryFn<typeof Upload> = () => (
91
+ export const SizeVariants: Story = {
92
+ render: () => (
86
93
  <div style={{ padding: '30px' }}>
87
94
  <div style={{ marginBottom: '40px' }}>
88
95
  <h3 style={{ marginBottom: '20px', fontSize: '18px', fontWeight: '600' }}>Small Size</h3>
@@ -125,25 +132,36 @@ export const SizeVariants: StoryFn<typeof Upload> = () => (
125
132
  </div>
126
133
  </div>
127
134
  </div>
128
- );
129
- SizeVariants.parameters = {
130
- docs: {
131
- description: {
132
- story: 'Upload component in different sizes: small (sm), medium (md), and large (lg).',
135
+ ),
136
+ parameters: {
137
+ docs: {
138
+ description: {
139
+ story: 'Upload component in different sizes: small (sm), medium (md), and large (lg).',
140
+ },
133
141
  },
134
142
  },
135
143
  };
136
144
 
137
145
  // Disabled state
138
- export const Disabled = Template.bind({});
139
- Disabled.args = {
140
- ...Default.args,
141
- disabled: true,
142
- };
143
- Disabled.parameters = {
144
- docs: {
145
- description: {
146
- story: 'Upload component in disabled state with reduced opacity and no interactions.',
146
+ export const Disabled: Story = {
147
+ render: args => (
148
+ <div style={{ padding: '30px', maxWidth: '600px' }}>
149
+ <Upload {...args} />
150
+ </div>
151
+ ),
152
+ args: {
153
+ size: 'md',
154
+ title: 'Drag and Drop files here',
155
+ supportedFilesText: 'Files supported: PDF, XSLS, JPEG, PNG, Scanner',
156
+ buttonText: 'Choose File',
157
+ helperText: 'Maximum size: 5MB',
158
+ disabled: true,
159
+ },
160
+ parameters: {
161
+ docs: {
162
+ description: {
163
+ story: 'Upload component in disabled state with reduced opacity and no interactions.',
164
+ },
147
165
  },
148
166
  },
149
167
  };
@@ -299,54 +317,71 @@ const WithStateControls: React.FC = () => {
299
317
  );
300
318
  };
301
319
 
302
- export const WithControls: StoryFn<typeof Upload> = () => <WithStateControls />;
303
- WithControls.parameters = {
304
- docs: {
305
- description: {
306
- story:
307
- 'Interactive example showing different upload states: default, uploading with progress, success, and error states.',
320
+ export const WithControls: Story = {
321
+ render: () => <WithStateControls />,
322
+ parameters: {
323
+ docs: {
324
+ description: {
325
+ story:
326
+ 'Interactive example showing different upload states: default, uploading with progress, success, and error states.',
327
+ },
308
328
  },
309
329
  },
310
330
  };
311
331
 
312
332
  // Custom Icon
313
- export const CustomIcon = Template.bind({});
314
- CustomIcon.args = {
315
- ...Default.args,
316
- icon: <i className="icon-lux-upload-cloud"></i>,
317
- title: 'Upload your documents',
318
- supportedFilesText: 'Drag files here or click to browse',
319
- };
320
- CustomIcon.parameters = {
321
- docs: {
322
- description: {
323
- story: 'Upload component with a custom icon and personalized text content.',
333
+ export const CustomIcon: Story = {
334
+ render: args => (
335
+ <div style={{ padding: '30px', maxWidth: '600px' }}>
336
+ <Upload {...args} />
337
+ </div>
338
+ ),
339
+ args: {
340
+ size: 'md',
341
+ title: 'Upload your documents',
342
+ supportedFilesText: 'Drag files here or click to browse',
343
+ buttonText: 'Choose File',
344
+ helperText: 'Maximum size: 5MB',
345
+ icon: <i className="icon-lux-upload-cloud"></i>,
346
+ },
347
+ parameters: {
348
+ docs: {
349
+ description: {
350
+ story: 'Upload component with a custom icon and personalized text content.',
351
+ },
324
352
  },
325
353
  },
326
354
  };
327
355
 
328
356
  // Multiple file upload
329
- export const MultipleFiles = Template.bind({});
330
- MultipleFiles.args = {
331
- ...Default.args,
332
- multiple: true,
333
- buttonText: 'Choose Files',
334
- title: 'Upload multiple files',
335
- supportedFilesText: 'Select multiple files at once',
336
- helperText: 'Maximum size: 5MB per file',
337
- };
338
- MultipleFiles.parameters = {
339
- docs: {
340
- description: {
341
- story: 'Upload component configured to accept multiple files at once.',
357
+ export const MultipleFiles: Story = {
358
+ render: args => (
359
+ <div style={{ padding: '30px', maxWidth: '600px' }}>
360
+ <Upload {...args} />
361
+ </div>
362
+ ),
363
+ args: {
364
+ size: 'md',
365
+ multiple: true,
366
+ buttonText: 'Choose Files',
367
+ title: 'Upload multiple files',
368
+ supportedFilesText: 'Select multiple files at once',
369
+ helperText: 'Maximum size: 5MB per file',
370
+ },
371
+ parameters: {
372
+ docs: {
373
+ description: {
374
+ story: 'Upload component configured to accept multiple files at once.',
375
+ },
342
376
  },
343
377
  },
344
378
  };
345
379
 
346
380
  // Drag and Drop Demo
347
- export const DragDropDemo: StoryFn<typeof Upload> = () => {
348
- const [dragState, setDragState] = useState<'idle' | 'dragging'>('idle');
349
- const [uploadedFiles, setUploadedFiles] = useState<string[]>([]);
381
+ export const DragDropDemo: Story = {
382
+ render: () => {
383
+ const [dragState, setDragState] = useState<'idle' | 'dragging'>('idle');
384
+ const [uploadedFiles, setUploadedFiles] = useState<string[]>([]);
350
385
 
351
386
  const handleFileSelect = (files: File[]) => {
352
387
  const fileNames = files.map(file => file.name);
@@ -415,20 +450,22 @@ export const DragDropDemo: StoryFn<typeof Upload> = () => {
415
450
  </div>
416
451
  )}
417
452
  </div>
418
- );
419
- };
420
- DragDropDemo.parameters = {
421
- docs: {
422
- description: {
423
- story:
424
- 'Interactive demonstration of drag & drop functionality with visual feedback and file tracking.',
453
+ );
454
+ },
455
+ parameters: {
456
+ docs: {
457
+ description: {
458
+ story:
459
+ 'Interactive demonstration of drag & drop functionality with visual feedback and file tracking.',
460
+ },
425
461
  },
426
462
  },
427
463
  };
428
464
 
429
465
  // Different File Types
430
- export const FileTypeRestrictions: StoryFn<typeof Upload> = () => (
431
- <div style={{ padding: '30px' }}>
466
+ export const FileTypeRestrictions: Story = {
467
+ render: () => (
468
+ <div style={{ padding: '30px' }}>
432
469
  <div style={{ marginBottom: '40px' }}>
433
470
  <h3 style={{ marginBottom: '20px', fontSize: '18px', fontWeight: '600' }}>Images Only</h3>
434
471
  <div style={{ maxWidth: '500px' }}>
@@ -462,11 +499,12 @@ export const FileTypeRestrictions: StoryFn<typeof Upload> = () => (
462
499
  </div>
463
500
  </div>
464
501
  </div>
465
- );
466
- FileTypeRestrictions.parameters = {
467
- docs: {
468
- description: {
469
- story: 'Upload components configured for specific file types with appropriate messaging.',
502
+ ),
503
+ parameters: {
504
+ docs: {
505
+ description: {
506
+ story: 'Upload components configured for specific file types with appropriate messaging.',
507
+ },
470
508
  },
471
509
  },
472
510
  };
@@ -9,10 +9,10 @@
9
9
  * @component VideoPlayer
10
10
  */
11
11
 
12
- import { Meta, StoryObj } from '@storybook/react';
12
+ import type { Meta, StoryObj } from '@storybook/react';
13
+ import { fn } from '@storybook/test';
13
14
  import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
14
15
  import React from 'react';
15
- import { fn } from '@storybook/test';
16
16
  import { VideoPlayerProps } from '../../lib/types/components';
17
17
  import { VideoPlayer } from './VideoPlayer';
18
18
  import type { RefObject } from 'react';
@@ -23,31 +23,15 @@ import type { RefObject } from 'react';
23
23
  * This defines the component's metadata, documentation, and controls
24
24
  * for the Storybook interface.
25
25
  */
26
- const meta: Meta<typeof VideoPlayer> = {
26
+ const meta = {
27
27
  title: 'Components/VideoPlayer',
28
28
  component: VideoPlayer,
29
29
  parameters: {
30
30
  layout: 'centered',
31
31
  docs: {
32
32
  description: {
33
- component: `
34
- # VideoPlayer Component
35
-
36
- An advanced, modern video player with comprehensive features, accessibility support, and optional glass morphism effects. Supports both regular video files and YouTube embeds with seamless integration.
37
-
38
- ## Key Features
33
+ component: `The VideoPlayer component provides an advanced, modern video player with comprehensive features including custom controls, YouTube integration, glass morphism effects, and full accessibility support. It supports both regular video files and YouTube embeds with seamless auto-detection and provides a rich, interactive viewing experience.
39
34
 
40
- ### 🎥 **Dual Video Support**
41
- - **Regular Videos**: Native HTML5 video with custom controls
42
- - **YouTube Integration**: Seamless YouTube embedding with auto-detection
43
-
44
- ### ✨ **Glass Morphism Effects**
45
- - **Configurable Glass Overlay**: Optional frosted glass effects with AtomixGlass integration
46
- - **Custom Content Support**: Interactive overlays and call-to-action elements
47
- - **Multiple Glass Modes**: Standard, polar, prominent, and shader effects
48
-
49
- ### 🎛️ **Advanced Controls**
50
- - **Custom UI**: Modern, responsive control interface
51
35
  - **Quality Selection**: Multiple video resolution options
52
36
  - **Playback Speed**: Adjustable speed controls (0.25x to 4x)
53
37
  - **Subtitle Support**: Multi-language subtitle tracks with WebVTT
@@ -69,8 +53,7 @@ An advanced, modern video player with comprehensive features, accessibility supp
69
53
  ### 📱 **Multi-Platform**
70
54
  - **Cross-Browser**: Works on all modern browsers
71
55
  - **Mobile Optimized**: Touch-friendly controls and responsive layout
72
- - **Performance**: Optimized for smooth playback and effects
73
- `,
56
+ - **Performance**: Optimized for smooth playback and effects`,
74
57
  },
75
58
  },
76
59
  },
@@ -164,10 +147,10 @@ An advanced, modern video player with comprehensive features, accessibility supp
164
147
  description: 'Additional CSS class names',
165
148
  },
166
149
  },
167
- };
150
+ } satisfies Meta<typeof VideoPlayer>;
168
151
 
169
152
  export default meta;
170
- type Story = StoryObj<VideoPlayerProps>;
153
+ type Story = StoryObj<typeof meta>;
171
154
 
172
155
  /**
173
156
  * Background Wrapper Component
@@ -9,6 +9,7 @@ export { default as Badge, type BadgeProps } from './Badge/Badge';
9
9
  export { default as Block, type BlockProps } from './Block';
10
10
  export { default as Breadcrumb, type BreadcrumbProps } from './Breadcrumb/Breadcrumb';
11
11
  export { default as Button, type ButtonProps } from './Button/Button';
12
+ export { default as ButtonGroup, type ButtonGroupProps } from './Button/ButtonGroup';
12
13
  export { default as Callout, type CalloutProps } from './Callout/Callout';
13
14
  export { default as Card, type CardProps } from './Card/Card';
14
15
  // Card sub-components
@@ -309,14 +309,14 @@ export function useAtomixGlass({
309
309
  // timestamp: new Date().toISOString(),
310
310
  // });
311
311
  // }
312
- } else if (process.env.NODE_ENV !== 'production' && debugCornerRadius) {
312
+ } else if ((typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') && debugCornerRadius) {
313
313
  // console.log(
314
314
  // '[AtomixGlass] No corner radius found, using default:',
315
315
  // CONSTANTS.DEFAULT_CORNER_RADIUS
316
316
  // );
317
317
  }
318
318
  } catch (error) {
319
- if (process.env.NODE_ENV !== 'production' && debugCornerRadius) {
319
+ if ((typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') && debugCornerRadius) {
320
320
  console.error('[AtomixGlass] Error extracting corner radius:', error);
321
321
  }
322
322
  }
@@ -412,7 +412,7 @@ export function useAtomixGlass({
412
412
  }
413
413
  } catch (styleError) {
414
414
  // Silently continue if getting computed style fails for this element
415
- if (process.env.NODE_ENV === 'development') {
415
+ if (typeof process === 'undefined' || process.env?.NODE_ENV === 'development') {
416
416
  console.debug('AtomixGlass: Error getting computed style for element:', styleError);
417
417
  }
418
418
  }
@@ -484,7 +484,7 @@ export function useAtomixGlass({
484
484
  }
485
485
  } catch (error) {
486
486
  // Enhanced error logging with context
487
- if (process.env.NODE_ENV === 'development') {
487
+ if (typeof process === 'undefined' || process.env?.NODE_ENV === 'development') {
488
488
  console.warn('AtomixGlass: Error detecting background brightness:', error);
489
489
  }
490
490
  const result = false;
@@ -607,7 +607,7 @@ export function useAtomixGlass({
607
607
  setInternalMouseOffset(newOffset);
608
608
  setInternalGlobalMousePosition(globalPos);
609
609
 
610
- if (process.env.NODE_ENV !== 'production' && enablePerformanceMonitoring) {
610
+ if ((typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') && enablePerformanceMonitoring) {
611
611
  const endTime = performance.now();
612
612
  const duration = endTime - startTime;
613
613
  // if (duration > 5) {
@@ -964,7 +964,7 @@ export function useAtomixGlass({
964
964
  };
965
965
 
966
966
  // Debug logging
967
- if (process.env.NODE_ENV !== 'production' && debugOverLight) {
967
+ if ((typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') && debugOverLight) {
968
968
  console.log('[AtomixGlass] OverLight Config:', {
969
969
  isOverLight,
970
970
  config: {
@@ -996,7 +996,7 @@ export function useAtomixGlass({
996
996
  }
997
997
 
998
998
  // Debug logging for non-object configs
999
- if (process.env.NODE_ENV !== 'production' && debugOverLight) {
999
+ if ((typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') && debugOverLight) {
1000
1000
  console.log('[AtomixGlass] OverLight Config:', {
1001
1001
  isOverLight,
1002
1002
  configType: typeof overLight === 'boolean' ? (overLight ? 'true' : 'false') : overLight,
@@ -1037,10 +1037,9 @@ export function useAtomixGlass({
1037
1037
  [onClick]
1038
1038
  );
1039
1039
 
1040
- // No-op handler for backward compatibility (mouse tracking now handled by shared tracker)
1040
+ // Mouse tracking is now handled by shared global tracker
1041
1041
  const handleMouseMove = useCallback((_e: MouseEvent) => {
1042
- // Mouse tracking is now handled by shared global tracker
1043
- // This handler is kept for backward compatibility with existing code
1042
+ // Mouse tracking handled by shared global tracker
1044
1043
  }, []);
1045
1044
 
1046
1045
  return {
@@ -269,20 +269,10 @@ export function useNavDropdown(initialProps?: Partial<NavDropdownProps>) {
269
269
  return isFixedBottom ? 'CaretUp' : 'CaretDown';
270
270
  };
271
271
 
272
- // Keeping this for backward compatibility
273
- const getIconClass = (isMegaMenu: boolean = false): string => {
274
- console.warn(
275
- 'getIconClass is deprecated. Please use the Icon component directly with the getIconName function.'
276
- );
277
- const isFixedBottom = isInFixedBottomNavbar();
278
- return `c-nav__icon ${isFixedBottom ? 'icon-lux-caret-up' : 'icon-lux-caret-down'}`;
279
- };
280
-
281
272
  return {
282
273
  defaultProps,
283
274
  generateDropdownMenuClass,
284
275
  isInFixedBottomNavbar,
285
- getIconClass,
286
276
  getIconName,
287
277
  };
288
278
  }
@@ -19,9 +19,10 @@ import type { AtomixConfig } from './index';
19
19
  * @example
20
20
  * ```typescript
21
21
  * import { loadAtomixConfig } from '@shohojdhara/atomix/config';
22
+ * import { createTheme } from '@shohojdhara/atomix/theme';
22
23
  *
23
24
  * const config = loadAtomixConfig();
24
- * const theme = createThemeFromConfig(config);
25
+ * const theme = createTheme(config.theme?.tokens || {});
25
26
  * ```
26
27
  */
27
28
  export function loadAtomixConfig(
@@ -45,7 +46,7 @@ export function loadAtomixConfig(
45
46
  // In browser environments, config loading is not supported
46
47
  if (typeof window !== 'undefined') {
47
48
  if (required) {
48
- throw new Error('Config loading not supported in browser environment');
49
+ throw new Error('loadAtomixConfig: Not available in browser environment. Config loading requires Node.js/SSR environment.');
49
50
  }
50
51
  return defaultConfig;
51
52
  }
@@ -143,5 +144,4 @@ export function resolveConfigPath(): string | null {
143
144
  return null;
144
145
  }
145
146
 
146
- export default loadAtomixConfig;
147
-
147
+ export default loadAtomixConfig;
@@ -32,6 +32,13 @@ export const CLASS_PREFIX = {
32
32
  /**
33
33
  * Button-specific constants
34
34
  */
35
+ export const THEME_NAMING = {
36
+ BUTTON_PREFIX: 'btn',
37
+ ICON_ELEMENT: 'icon',
38
+ LABEL_ELEMENT: 'label',
39
+ SPINNER_ELEMENT: 'spinner',
40
+ };
41
+
35
42
  export const BUTTON = {
36
43
  BASE_CLASS: 'c-btn',
37
44
  ICON_CLASS: 'c-btn__icon',
@@ -48,6 +55,16 @@ export const BUTTON = {
48
55
  },
49
56
  };
50
57
 
58
+ /**
59
+ * ButtonGroup-specific constants
60
+ */
61
+ export const BUTTON_GROUP = {
62
+ BASE_CLASS: 'c-btn-group',
63
+ CLASSES: {
64
+ BASE: 'c-btn-group',
65
+ },
66
+ };
67
+
51
68
  /**
52
69
  * Callout-specific constants
53
70
  */
@@ -9,7 +9,7 @@ import { useMemo } from 'react';
9
9
  import { useTheme } from '../theme/runtime/useTheme';
10
10
  import type { ComponentPartsMap } from '../types/partProps';
11
11
  import type { ComponentCSSVariables } from '../constants/cssVariables';
12
- import { mergeCSSVars } from '../theme/cssVariableMapper';
12
+ import { mergeCSSVars } from '../theme/adapters/cssVariableMapper';
13
13
  import { mergePartStyles } from '../types/partProps';
14
14
  import { mergeClassNames } from '../utils/componentUtils';
15
15
 
@@ -77,7 +77,7 @@ export interface UsePerformanceMonitorOptions {
77
77
  export function usePerformanceMonitor(options: UsePerformanceMonitorOptions) {
78
78
  const {
79
79
  componentName,
80
- logToConsole = process.env.NODE_ENV === 'development',
80
+ logToConsole = (typeof process === 'undefined' || process.env?.NODE_ENV === 'development'),
81
81
  warnThreshold = 16,
82
82
  onMetrics,
83
83
  } = options;
@@ -0,0 +1,105 @@
1
+ import { useContext } from 'react';
2
+ import { ThemeContext } from '../theme/runtime/ThemeContext';
3
+ import { useTheme } from '../theme/runtime/useTheme';
4
+
5
+ /**
6
+ * Standardized hook for accessing theme tokens in components
7
+ *
8
+ * Provides consistent access to theme values across all components
9
+ * using either CSS custom properties or theme object values.
10
+ */
11
+ export function useThemeTokens() {
12
+ const { theme, activeTheme } = useTheme();
13
+
14
+ // Helper function to get CSS variable value
15
+ const getToken = useCallback((tokenName: string, fallback?: string) => {
16
+ if (typeof window === 'undefined') return fallback || '';
17
+
18
+ const cssVarName = `--atomix-${tokenName}`;
19
+ const computedStyle = getComputedStyle(document.documentElement);
20
+ return computedStyle.getPropertyValue(cssVarName).trim() || fallback || '';
21
+ }, []);
22
+
23
+ // Helper function to get theme object value
24
+ const getThemeValue = useCallback((path: string, fallback?: any) => {
25
+ if (!activeTheme) return fallback;
26
+
27
+ // Navigate through nested theme object using dot notation
28
+ return path.split('.').reduce((obj, key) => obj?.[key], activeTheme) || fallback;
29
+ }, [activeTheme]);
30
+
31
+ // Return unified API for accessing theme values
32
+ return {
33
+ theme,
34
+ activeTheme,
35
+ getToken,
36
+ getThemeValue,
37
+ // Commonly used tokens with fallbacks
38
+ colors: {
39
+ primary: getToken('primary', '#3b82f6'),
40
+ secondary: getToken('secondary', '#10b981'),
41
+ error: getToken('error', '#ef4444'),
42
+ success: getToken('success', '#22c55e'),
43
+ warning: getToken('warning', '#eab308'),
44
+ info: getToken('info', '#3b82f6'),
45
+ light: getToken('light', '#f9fafb'),
46
+ dark: getToken('dark', '#111827'),
47
+ },
48
+ spacing: {
49
+ 1: getToken('spacing-1', '0.25rem'),
50
+ 2: getToken('spacing-2', '0.5rem'),
51
+ 3: getToken('spacing-3', '0.75rem'),
52
+ 4: getToken('spacing-4', '1rem'),
53
+ 5: getToken('spacing-5', '1.25rem'),
54
+ 6: getToken('spacing-6', '1.5rem'),
55
+ 8: getToken('spacing-8', '2rem'),
56
+ 10: getToken('spacing-10', '2.5rem'),
57
+ 12: getToken('spacing-12', '3rem'),
58
+ 16: getToken('spacing-16', '4rem'),
59
+ 20: getToken('spacing-20', '5rem'),
60
+ },
61
+ borderRadius: {
62
+ sm: getToken('border-radius-sm', '0.25rem'),
63
+ md: getToken('border-radius-md', '0.5rem'),
64
+ lg: getToken('border-radius-lg', '0.75rem'),
65
+ xl: getToken('border-radius-xl', '1rem'),
66
+ full: getToken('border-radius-full', '9999px'),
67
+ },
68
+ typography: {
69
+ fontFamily: {
70
+ sans: getToken('font-sans-serif', 'Inter, system-ui, sans-serif'),
71
+ serif: getToken('font-serif', 'Georgia, serif'),
72
+ mono: getToken('font-monospace', 'Fira Code, monospace'),
73
+ },
74
+ fontSize: {
75
+ xs: getToken('font-size-xs', '0.75rem'),
76
+ sm: getToken('font-size-sm', '0.875rem'),
77
+ md: getToken('font-size-md', '1rem'),
78
+ lg: getToken('font-size-lg', '1.125rem'),
79
+ xl: getToken('font-size-xl', '1.25rem'),
80
+ '2xl': getToken('font-size-2xl', '1.5rem'),
81
+ '3xl': getToken('font-size-3xl', '1.875rem'),
82
+ '4xl': getToken('font-size-4xl', '2.25rem'),
83
+ },
84
+ fontWeight: {
85
+ light: getToken('font-weight-light', '300'),
86
+ normal: getToken('font-weight-normal', '400'),
87
+ medium: getToken('font-weight-medium', '500'),
88
+ semibold: getToken('font-weight-semibold', '600'),
89
+ bold: getToken('font-weight-bold', '700'),
90
+ },
91
+ },
92
+ shadows: {
93
+ sm: getToken('box-shadow-sm', '0 1px 2px 0 rgba(0, 0, 0, 0.05)'),
94
+ md: getToken('box-shadow-md', '0 4px 6px -1px rgba(0, 0, 0, 0.1)'),
95
+ lg: getToken('box-shadow-lg', '0 10px 15px -3px rgba(0, 0, 0, 0.1)'),
96
+ xl: getToken('box-shadow-xl', '0 20px 25px -5px rgba(0, 0, 0, 0.1)'),
97
+ inset: getToken('box-shadow-inset', 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)'),
98
+ },
99
+ transitions: {
100
+ fast: getToken('transition-fast', '150ms'),
101
+ base: getToken('transition-base', '200ms'),
102
+ slow: getToken('transition-slow', '300ms'),
103
+ },
104
+ };
105
+ }