@shohojdhara/atomix 0.3.5 → 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 (173) 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 +61 -66
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.js +47 -31
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.js +47 -31
  12. package/dist/forms.js.map +1 -1
  13. package/dist/heavy.js +47 -31
  14. package/dist/heavy.js.map +1 -1
  15. package/dist/index.d.ts +1841 -1633
  16. package/dist/index.esm.js +4975 -4113
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +5151 -4290
  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 +1572 -1442
  23. package/dist/theme.js +4816 -4080
  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 +65 -31
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
  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/ButtonGroup.stories.tsx +315 -0
  38. package/src/components/Button/ButtonGroup.tsx +67 -0
  39. package/src/components/Button/index.ts +2 -0
  40. package/src/components/Callout/Callout.stories.tsx +8 -6
  41. package/src/components/Card/Card.stories.tsx +82 -28
  42. package/src/components/Chart/AnimatedChart.tsx +0 -1
  43. package/src/components/Chart/AreaChart.tsx +0 -1
  44. package/src/components/Chart/BarChart.tsx +0 -1
  45. package/src/components/Chart/BubbleChart.tsx +0 -1
  46. package/src/components/Chart/CandlestickChart.tsx +0 -1
  47. package/src/components/Chart/Chart.stories.tsx +5 -7
  48. package/src/components/Chart/Chart.tsx +0 -16
  49. package/src/components/Chart/ChartRenderer.tsx +1 -1
  50. package/src/components/Chart/DonutChart.tsx +0 -1
  51. package/src/components/Chart/FunnelChart.tsx +0 -1
  52. package/src/components/Chart/GaugeChart.tsx +0 -1
  53. package/src/components/Chart/HeatmapChart.tsx +0 -1
  54. package/src/components/Chart/LineChart.tsx +0 -1
  55. package/src/components/Chart/MultiAxisChart.tsx +0 -1
  56. package/src/components/Chart/PieChart.tsx +0 -1
  57. package/src/components/Chart/RadarChart.tsx +0 -1
  58. package/src/components/Chart/ScatterChart.tsx +0 -1
  59. package/src/components/Chart/WaterfallChart.tsx +0 -1
  60. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
  61. package/src/components/DataTable/DataTable.stories.tsx +23 -16
  62. package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
  63. package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
  64. package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
  65. package/src/components/Footer/Footer.stories.tsx +8 -6
  66. package/src/components/Footer/FooterLink.tsx +9 -2
  67. package/src/components/Form/Checkbox.stories.tsx +7 -0
  68. package/src/components/Form/Form.stories.tsx +7 -0
  69. package/src/components/Form/FormGroup.stories.tsx +9 -1
  70. package/src/components/Form/Input.stories.tsx +69 -16
  71. package/src/components/Form/Radio.stories.tsx +9 -1
  72. package/src/components/Form/Select.stories.tsx +9 -1
  73. package/src/components/Form/Textarea.stories.tsx +10 -2
  74. package/src/components/Hero/Hero.stories.tsx +7 -0
  75. package/src/components/List/List.stories.tsx +7 -0
  76. package/src/components/Messages/Messages.stories.tsx +8 -7
  77. package/src/components/Modal/Modal.stories.tsx +17 -6
  78. package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
  79. package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
  80. package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
  81. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
  82. package/src/components/Pagination/Pagination.stories.tsx +188 -111
  83. package/src/components/Pagination/Pagination.tsx +83 -3
  84. package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
  85. package/src/components/Popover/Popover.stories.tsx +191 -115
  86. package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
  87. package/src/components/Progress/Progress.stories.tsx +79 -49
  88. package/src/components/Rating/Rating.stories.tsx +109 -84
  89. package/src/components/River/River.stories.tsx +194 -114
  90. package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
  91. package/src/components/Slider/Slider.stories.tsx +7 -0
  92. package/src/components/Spinner/Spinner.stories.tsx +15 -11
  93. package/src/components/Steps/Steps.stories.tsx +132 -98
  94. package/src/components/Tabs/Tabs.stories.tsx +163 -112
  95. package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
  96. package/src/components/Todo/Todo.stories.tsx +38 -12
  97. package/src/components/Toggle/Toggle.stories.tsx +61 -28
  98. package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
  99. package/src/components/Upload/Upload.stories.tsx +122 -84
  100. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
  101. package/src/components/index.ts +1 -0
  102. package/src/lib/composables/useAtomixGlass.ts +2 -3
  103. package/src/lib/composables/useNavbar.ts +0 -10
  104. package/src/lib/config/loader.ts +2 -1
  105. package/src/lib/constants/components.ts +10 -0
  106. package/src/lib/hooks/useComponentCustomization.ts +1 -1
  107. package/src/lib/theme/README.md +174 -0
  108. package/src/lib/theme/adapters/index.ts +31 -0
  109. package/src/lib/theme/adapters/themeAdapter.ts +287 -0
  110. package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
  111. package/src/lib/theme/config/configLoader.ts +254 -0
  112. package/src/lib/theme/config/loader.ts +37 -48
  113. package/src/lib/theme/config/types.ts +2 -2
  114. package/src/lib/theme/config/validator.ts +15 -91
  115. package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
  116. package/src/lib/theme/constants/index.ts +8 -0
  117. package/src/lib/theme/core/ThemeRegistry.ts +19 -6
  118. package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
  119. package/src/lib/theme/core/composeTheme.ts +155 -0
  120. package/src/lib/theme/core/createTheme.ts +94 -0
  121. package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
  122. package/src/lib/theme/core/index.ts +5 -19
  123. package/src/lib/theme/devtools/Comparator.tsx +346 -22
  124. package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
  125. package/src/lib/theme/devtools/Inspector.tsx +335 -51
  126. package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
  127. package/src/lib/theme/devtools/Preview.tsx +471 -221
  128. package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
  129. package/src/lib/theme/devtools/index.ts +14 -4
  130. package/src/lib/theme/devtools/useHistory.ts +130 -0
  131. package/src/lib/theme/errors/index.ts +12 -0
  132. package/src/lib/theme/generators/cssFile.ts +79 -0
  133. package/src/lib/theme/generators/generateCSS.ts +89 -0
  134. package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
  135. package/src/lib/theme/generators/index.ts +19 -0
  136. package/src/lib/theme/i18n/rtl.ts +5 -6
  137. package/src/lib/theme/index.ts +120 -15
  138. package/src/lib/theme/runtime/ThemeApplicator.ts +52 -111
  139. package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
  140. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +1 -1
  141. package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
  142. package/src/lib/theme/runtime/index.ts +1 -2
  143. package/src/lib/theme/runtime/useTheme.ts +1 -2
  144. package/src/lib/theme/test/testTheme.ts +385 -0
  145. package/src/lib/theme/tokens/index.ts +12 -0
  146. package/src/lib/theme/tokens/tokens.ts +721 -0
  147. package/src/lib/theme/types.ts +6 -42
  148. package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
  149. package/src/lib/theme/utils/index.ts +11 -0
  150. package/src/lib/theme/utils/injectCSS.ts +90 -0
  151. package/src/lib/theme/utils/themeHelpers.ts +78 -0
  152. package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
  153. package/src/lib/theme-tools.ts +7 -8
  154. package/src/lib/types/components.ts +40 -130
  155. package/src/lib/utils/componentUtils.ts +1 -1
  156. package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
  157. package/src/styles/02-tools/_tools.button.scss +66 -79
  158. package/src/styles/06-components/_components.atomix-glass.scss +13 -3
  159. package/src/styles/06-components/_components.pagination.scss +88 -0
  160. package/scripts/sync-theme-config.js +0 -309
  161. package/src/lib/theme/composeTheme.ts +0 -370
  162. package/src/lib/theme/core/ThemeCache.ts +0 -283
  163. package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
  164. package/src/lib/theme/core/ThemeEngine.ts +0 -665
  165. package/src/lib/theme/createThemeFromConfig.ts +0 -132
  166. package/src/lib/theme/devtools/CLI.ts +0 -364
  167. package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
  168. package/src/lib/theme/runtime/ThemeManager.ts +0 -446
  169. package/src/styles/03-generic/_generated-root.css +0 -26
  170. package/src/themes/README.md +0 -442
  171. package/src/themes/themes.config.js +0 -68
  172. /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
  173. /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
@@ -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 => (
@@ -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' },