@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shohojdhara/atomix",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Atomix Design System - A modern component library for web applications",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -86,16 +86,6 @@
86
86
  "import": "./dist/theme.js",
87
87
  "default": "./dist/theme.js"
88
88
  },
89
- "./themes/*": {
90
- "import": "./dist/themes/*.css",
91
- "require": "./dist/themes/*.css",
92
- "default": "./dist/themes/*.css"
93
- },
94
- "./themes/*.min": {
95
- "import": "./dist/themes/*.min.css",
96
- "require": "./dist/themes/*.min.css",
97
- "default": "./dist/themes/*.min.css"
98
- },
99
89
  "./charts": {
100
90
  "types": "./dist/charts.d.ts",
101
91
  "import": "./dist/charts.js",
@@ -233,11 +223,10 @@
233
223
  "changeset": "changeset",
234
224
  "typecheck": "tsc --noEmit",
235
225
  "attw": "attw --pack",
236
- "sync:config": "npx tsx scripts/sync-theme-config-ts.ts",
237
226
  "sync:tokens": "npx tsx scripts/generate-tokens.ts",
238
227
  "validate:config": "npx tsx scripts/validate-config-sync.ts",
239
- "prebuild": "npm run sync:config && npm run validate:config",
240
- "prebuild:with-tokens": "npm run sync:config && npm run sync:tokens && npm run validate:config",
228
+ "prebuild": "npm run validate:config",
229
+ "prebuild:with-tokens": "npm run sync:tokens && npm run validate:config",
241
230
  "verify:build": "node scripts/verify-build.js",
242
231
  "test:build": "node scripts/test-build.js",
243
232
  "prepublishOnly": "npm run clean && npm run build && npm run attw",
@@ -245,16 +234,13 @@
245
234
  },
246
235
  "files": [
247
236
  "dist/**/*",
248
- "dist/themes/**/*",
249
237
  "src/styles/**/*",
250
238
  "src/components/**/*",
251
239
  "src/lib/**/*",
252
240
  "src/layouts/**/*",
253
- "src/themes/**/*",
254
241
  "scripts/atomix-cli.js",
255
- "scripts/sync-theme-config.js",
256
242
  "scripts/cli/**/*",
257
- "theme.config.ts",
243
+ "atomix.config.ts",
258
244
  "README.md",
259
245
  "LICENSE",
260
246
  "CHANGELOG.md"
@@ -296,9 +282,9 @@
296
282
  },
297
283
  "engines": {
298
284
  "node": ">=18.0.0",
299
- "npm": ">=8.0.0"
285
+ "npm": ">=8.0.0 <11.0.0 || >=11.7.0"
300
286
  },
301
287
  "publishConfig": {
302
288
  "access": "public"
303
289
  }
304
- }
290
+ }
@@ -4,6 +4,9 @@ import { Accordion } from './Accordion';
4
4
  import { ACCORDION } from '../../lib/constants/components';
5
5
  import type { AtomixGlassProps } from '../../lib/types/components';
6
6
 
7
+ // Helper type for glass props in stories (without children requirement)
8
+ type GlassProps = boolean | Omit<AtomixGlassProps, 'children'>;
9
+
7
10
  // Extract class names without the leading dots
8
11
  const ACCORDION_CLASS = ACCORDION.SELECTORS.ACCORDION.replace('.', '');
9
12
  const HEADER_CLASS = ACCORDION.SELECTORS.HEADER.replace('.', '');
@@ -24,15 +27,18 @@ const meta = {
24
27
  },
25
28
  },
26
29
  },
30
+ tags: ['autodocs'],
27
31
  argTypes: {
28
32
  iconPosition: {
29
33
  control: { type: 'radio' },
30
34
  options: ['right', 'left'],
31
35
  description: 'Position of the icon',
36
+ defaultValue: 'right',
32
37
  },
33
38
  defaultOpen: {
34
39
  control: 'boolean',
35
40
  description: 'Whether the accordion is initially open',
41
+ defaultValue: false,
36
42
  },
37
43
  disabled: {
38
44
  control: 'boolean',
@@ -56,7 +62,9 @@ const meta = {
56
62
  export default meta;
57
63
  type Story = StoryObj<typeof meta>;
58
64
 
59
- // Default Accordion (Closed)
65
+ /**
66
+ * Default accordion in closed state.
67
+ */
60
68
  export const Default: Story = {
61
69
  args: {
62
70
  title: 'Accordion Title',
@@ -64,7 +72,9 @@ export const Default: Story = {
64
72
  },
65
73
  };
66
74
 
67
- // Open Accordion
75
+ /**
76
+ * Accordion in open state by default.
77
+ */
68
78
  export const Open: Story = {
69
79
  args: {
70
80
  title: 'Open Accordion',
@@ -73,7 +83,9 @@ export const Open: Story = {
73
83
  },
74
84
  };
75
85
 
76
- // Disabled Accordion
86
+ /**
87
+ * Disabled accordion - non-interactive state.
88
+ */
77
89
  export const Disabled: Story = {
78
90
  args: {
79
91
  title: 'Disabled Accordion',
@@ -82,7 +94,9 @@ export const Disabled: Story = {
82
94
  },
83
95
  };
84
96
 
85
- // Icon on Left
97
+ /**
98
+ * Accordion with icon positioned on the left side.
99
+ */
86
100
  export const IconLeft: Story = {
87
101
  args: {
88
102
  title: 'Icon on Left',
@@ -91,7 +105,9 @@ export const IconLeft: Story = {
91
105
  },
92
106
  };
93
107
 
94
- // Custom Icon
108
+ /**
109
+ * Accordion with custom icon instead of default chevron.
110
+ */
95
111
  export const CustomIcon: Story = {
96
112
  args: {
97
113
  title: 'Custom Icon',
@@ -118,7 +134,9 @@ export const CustomIcon: Story = {
118
134
  },
119
135
  };
120
136
 
121
- // Accordion Group
137
+ /**
138
+ * Multiple accordions grouped together.
139
+ */
122
140
  export const AccordionGroup: Story = {
123
141
  args: {
124
142
  title: 'Accordion Group',
@@ -150,12 +168,21 @@ export const AccordionGroup: Story = {
150
168
  ),
151
169
  };
152
170
 
153
- // All Variants
171
+ /**
172
+ * Showcase of all accordion variants and states.
173
+ */
154
174
  export const AllVariants: Story = {
155
175
  args: {
156
176
  title: 'All Variants',
157
177
  children: <p>See render function for all variants</p>,
158
178
  },
179
+ parameters: {
180
+ docs: {
181
+ description: {
182
+ story: 'Comprehensive showcase of all accordion variants including default, open, disabled, icon positions, and custom icons.',
183
+ },
184
+ },
185
+ },
159
186
  render: () => (
160
187
  <div>
161
188
  <h2>All Accordion Variants</h2>
@@ -246,7 +273,9 @@ export const AllVariants: Story = {
246
273
  ),
247
274
  };
248
275
 
249
- // Controlled Accordion
276
+ /**
277
+ * Controlled accordion using external state management.
278
+ */
250
279
  export const Controlled: Story = {
251
280
  args: {
252
281
  title: 'Controlled Accordion',
@@ -275,7 +304,9 @@ export const Controlled: Story = {
275
304
  },
276
305
  };
277
306
 
278
- // Glass Variant
307
+ /**
308
+ * Accordion with glass morphism effect enabled.
309
+ */
279
310
  export const Glass: Story = {
280
311
  args: {
281
312
  title: 'Glass Accordion',
@@ -312,7 +343,9 @@ export const Glass: Story = {
312
343
  },
313
344
  };
314
345
 
315
- // Glass with Custom Settings
346
+ /**
347
+ * Accordion with custom glass morphism settings.
348
+ */
316
349
  export const GlassCustom: Story = {
317
350
  args: {
318
351
  title: 'Custom Glass Accordion',
@@ -322,7 +355,7 @@ export const GlassCustom: Story = {
322
355
  blurAmount: 3,
323
356
  saturation: 60,
324
357
  mode: 'polar',
325
- } as AtomixGlassProps as any,
358
+ } as GlassProps,
326
359
  },
327
360
  render: args => (
328
361
  <div
@@ -505,7 +538,7 @@ export const GlassModePolar: Story = {
505
538
  blurAmount: 1.5,
506
539
  saturation: 180,
507
540
  aberrationIntensity: 3,
508
- } as any,
541
+ } as GlassProps,
509
542
  },
510
543
  render: args => (
511
544
  <div
@@ -550,7 +583,7 @@ export const GlassModeProminent: Story = {
550
583
  blurAmount: 2.5,
551
584
  saturation: 200,
552
585
  aberrationIntensity: 4,
553
- } as any,
586
+ } as GlassProps,
554
587
  },
555
588
  render: args => (
556
589
  <div
@@ -595,7 +628,7 @@ export const GlassModeShader: Story = {
595
628
  displacementScale: 70,
596
629
  blurAmount: 1.8,
597
630
  saturation: 170,
598
- } as any,
631
+ } as GlassProps,
599
632
  },
600
633
  render: args => (
601
634
  <div
@@ -700,7 +733,7 @@ export const AllGlassModesComparison: Story = {
700
733
  blurAmount: 1.5,
701
734
  saturation: 180,
702
735
  aberrationIntensity: 3,
703
- } as any
736
+ } as GlassProps
704
737
  }
705
738
  >
706
739
  <p>Radial distortion effects emanating from the center point.</p>
@@ -728,7 +761,7 @@ export const AllGlassModesComparison: Story = {
728
761
  blurAmount: 2.5,
729
762
  saturation: 200,
730
763
  aberrationIntensity: 4,
731
- } as any
764
+ } as GlassProps
732
765
  }
733
766
  >
734
767
  <p>Enhanced distortion with maximum depth and visual impact.</p>
@@ -756,7 +789,7 @@ export const AllGlassModesComparison: Story = {
756
789
  displacementScale: 70,
757
790
  blurAmount: 1.8,
758
791
  saturation: 170,
759
- } as any
792
+ } as GlassProps
760
793
  }
761
794
  >
762
795
  <p>GPU-accelerated liquid glass with smooth animations.</p>