@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,14 +1,28 @@
1
1
  import React from 'react';
2
- import { StoryFn, Meta } from '@storybook/react';
3
- import { fn } from '@storybook/test';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import type { AtomixGlassProps } from '../../lib/types/components';
4
4
  import { Tabs } from './Tabs';
5
5
 
6
- export default {
6
+ // Helper type for glass props in stories (without children requirement)
7
+ type GlassProps = boolean | Omit<AtomixGlassProps, 'children'>;
8
+
9
+ const meta = {
7
10
  title: 'Components/Tabs',
8
11
  component: Tabs,
12
+ parameters: {
13
+ layout: 'padded',
14
+ docs: {
15
+ description: {
16
+ component:
17
+ 'The Tabs component organizes content into multiple panels accessible via tab navigation. It provides a clean interface for switching between different views or sections of content. Tabs support keyboard navigation and can include rich content in each panel.',
18
+ },
19
+ },
20
+ },
21
+ tags: ['autodocs'],
9
22
  argTypes: {
10
23
  activeIndex: {
11
24
  control: { type: 'number' },
25
+ description: 'The index of the currently active tab',
12
26
  defaultValue: 0,
13
27
  },
14
28
  glass: {
@@ -16,123 +30,157 @@ export default {
16
30
  description: 'Enable glass morphism effect',
17
31
  },
18
32
  },
19
- } as Meta<typeof Tabs>;
33
+ } satisfies Meta<typeof Tabs>;
20
34
 
21
- const Template: StoryFn<typeof Tabs> = args => (
22
- <div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
23
- <Tabs {...args} />
24
- </div>
25
- );
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
26
37
 
27
- export const Default = Template.bind({});
28
- Default.args = {
29
- items: [
30
- {
31
- label: 'Tab 1',
32
- content: <p>This is the content for Tab 1. Default tab content.</p>,
33
- },
34
- {
35
- label: 'Tab 2',
36
- content: <p>This is the content for Tab 2. It contains different information.</p>,
37
- },
38
- {
39
- label: 'Tab 3',
40
- content: <p>This is the content for Tab 3. Another unique content section.</p>,
41
- },
42
- ],
43
- activeIndex: 0,
38
+ /**
39
+ * Default tabs component with three tabs.
40
+ */
41
+ export const Default: Story = {
42
+ render: args => (
43
+ <div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
44
+ <Tabs {...args} />
45
+ </div>
46
+ ),
47
+ args: {
48
+ items: [
49
+ {
50
+ label: 'Tab 1',
51
+ content: <p>This is the content for Tab 1. Default tab content.</p>,
52
+ },
53
+ {
54
+ label: 'Tab 2',
55
+ content: <p>This is the content for Tab 2. It contains different information.</p>,
56
+ },
57
+ {
58
+ label: 'Tab 3',
59
+ content: <p>This is the content for Tab 3. Another unique content section.</p>,
60
+ },
61
+ ],
62
+ activeIndex: 0,
63
+ },
44
64
  };
45
65
 
46
- export const WithDifferentActiveTab = Template.bind({});
47
- WithDifferentActiveTab.args = {
48
- items: [
49
- {
50
- label: 'Tab 1',
51
- content: <p>This is the content for Tab 1.</p>,
52
- },
53
- {
54
- label: 'Tab 2',
55
- content: <p>This is the content for Tab 2. It's initially active.</p>,
56
- },
57
- {
58
- label: 'Tab 3',
59
- content: <p>This is the content for Tab 3.</p>,
60
- },
61
- ],
62
- activeIndex: 1,
66
+ /**
67
+ * Tabs with a different tab initially active (Tab 2).
68
+ */
69
+ export const WithDifferentActiveTab: Story = {
70
+ render: args => (
71
+ <div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
72
+ <Tabs {...args} />
73
+ </div>
74
+ ),
75
+ args: {
76
+ items: [
77
+ {
78
+ label: 'Tab 1',
79
+ content: <p>This is the content for Tab 1.</p>,
80
+ },
81
+ {
82
+ label: 'Tab 2',
83
+ content: <p>This is the content for Tab 2. It's initially active.</p>,
84
+ },
85
+ {
86
+ label: 'Tab 3',
87
+ content: <p>This is the content for Tab 3.</p>,
88
+ },
89
+ ],
90
+ activeIndex: 1,
91
+ },
63
92
  };
64
93
 
65
- export const WithRichContent = Template.bind({});
66
- WithRichContent.args = {
67
- items: [
68
- {
69
- label: 'Features',
70
- content: (
71
- <div>
72
- <h3>Key Features</h3>
73
- <ul>
74
- <li>Responsive design</li>
75
- <li>Accessible navigation</li>
76
- <li>Smooth transitions</li>
77
- </ul>
78
- </div>
79
- ),
80
- },
81
- {
82
- label: 'Specifications',
83
- content: (
84
- <div>
85
- <h3>Technical Specifications</h3>
86
- <table style={{ width: '100%', borderCollapse: 'collapse' }}>
87
- <thead>
88
- <tr>
89
- <th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
90
- Property
91
- </th>
92
- <th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
93
- Value
94
- </th>
95
- </tr>
96
- </thead>
97
- <tbody>
98
- <tr>
99
- <td style={{ border: '1px solid #ddd', padding: '8px' }}>Size</td>
100
- <td style={{ border: '1px solid #ddd', padding: '8px' }}>Medium</td>
101
- </tr>
102
- <tr>
103
- <td style={{ border: '1px solid #ddd', padding: '8px' }}>Material</td>
104
- <td style={{ border: '1px solid #ddd', padding: '8px' }}>Aluminum</td>
105
- </tr>
106
- </tbody>
107
- </table>
108
- </div>
109
- ),
94
+ /**
95
+ * Tabs with rich content including headings, lists, and tables.
96
+ */
97
+ export const WithRichContent: Story = {
98
+ parameters: {
99
+ docs: {
100
+ description: {
101
+ story: 'Demonstrates tabs containing rich HTML content including headings, lists, and tables, showing the flexibility of the tabs component.',
102
+ },
110
103
  },
111
- {
112
- label: 'Reviews',
113
- content: (
114
- <div>
115
- <h3>Customer Reviews</h3>
116
- <div style={{ padding: '10px', marginBottom: '10px', backgroundColor: '#f9f9f9' }}>
117
- <p style={{ marginBottom: '5px' }}>
118
- <strong>John D.</strong> ★★★★★
119
- </p>
120
- <p>Great product, highly recommended!</p>
104
+ },
105
+ render: args => (
106
+ <div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
107
+ <Tabs {...args} />
108
+ </div>
109
+ ),
110
+ args: {
111
+ items: [
112
+ {
113
+ label: 'Features',
114
+ content: (
115
+ <div>
116
+ <h3>Key Features</h3>
117
+ <ul>
118
+ <li>Responsive design</li>
119
+ <li>Accessible navigation</li>
120
+ <li>Smooth transitions</li>
121
+ </ul>
121
122
  </div>
122
- <div style={{ padding: '10px', backgroundColor: '#f9f9f9' }}>
123
- <p style={{ marginBottom: '5px' }}>
124
- <strong>Sarah T.</strong> ★★★★☆
125
- </p>
126
- <p>Very good quality and fast shipping.</p>
123
+ ),
124
+ },
125
+ {
126
+ label: 'Specifications',
127
+ content: (
128
+ <div>
129
+ <h3>Technical Specifications</h3>
130
+ <table style={{ width: '100%', borderCollapse: 'collapse' }}>
131
+ <thead>
132
+ <tr>
133
+ <th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
134
+ Property
135
+ </th>
136
+ <th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
137
+ Value
138
+ </th>
139
+ </tr>
140
+ </thead>
141
+ <tbody>
142
+ <tr>
143
+ <td style={{ border: '1px solid #ddd', padding: '8px' }}>Size</td>
144
+ <td style={{ border: '1px solid #ddd', padding: '8px' }}>Medium</td>
145
+ </tr>
146
+ <tr>
147
+ <td style={{ border: '1px solid #ddd', padding: '8px' }}>Material</td>
148
+ <td style={{ border: '1px solid #ddd', padding: '8px' }}>Aluminum</td>
149
+ </tr>
150
+ </tbody>
151
+ </table>
127
152
  </div>
128
- </div>
129
- ),
130
- },
131
- ],
132
- activeIndex: 0,
153
+ ),
154
+ },
155
+ {
156
+ label: 'Reviews',
157
+ content: (
158
+ <div>
159
+ <h3>Customer Reviews</h3>
160
+ <div style={{ padding: '10px', marginBottom: '10px', backgroundColor: '#f9f9f9' }}>
161
+ <p style={{ marginBottom: '5px' }}>
162
+ <strong>John D.</strong> ★★★★★
163
+ </p>
164
+ <p>Great product, highly recommended!</p>
165
+ </div>
166
+ <div style={{ padding: '10px', backgroundColor: '#f9f9f9' }}>
167
+ <p style={{ marginBottom: '5px' }}>
168
+ <strong>Sarah T.</strong> ★★★★☆
169
+ </p>
170
+ <p>Very good quality and fast shipping.</p>
171
+ </div>
172
+ </div>
173
+ ),
174
+ },
175
+ ],
176
+ activeIndex: 0,
177
+ },
133
178
  };
134
179
 
135
- export const Glass = {
180
+ /**
181
+ * Tabs with glass morphism effect enabled.
182
+ */
183
+ export const Glass: Story = {
136
184
  args: {
137
185
  items: [
138
186
  {
@@ -170,7 +218,10 @@ export const Glass = {
170
218
  ),
171
219
  };
172
220
 
173
- export const GlassCustom = {
221
+ /**
222
+ * Tabs with custom glass morphism settings.
223
+ */
224
+ export const GlassCustom: Story = {
174
225
  args: {
175
226
  items: [
176
227
  {
@@ -193,9 +244,9 @@ export const GlassCustom = {
193
244
  saturation: 200,
194
245
  aberrationIntensity: 0.8,
195
246
  cornerRadius: 12,
196
- },
247
+ } as GlassProps,
197
248
  },
198
- render: (args: any) => (
249
+ render: args => (
199
250
  <div
200
251
  style={{
201
252
  background:
@@ -1,103 +1,145 @@
1
1
  import React from 'react';
2
- import { StoryFn, Meta } from '@storybook/react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
3
  import { Testimonial } from './Testimonial';
4
- import type { TestimonialProps } from './Testimonial';
5
4
 
6
- export default {
5
+ const meta = {
7
6
  title: 'Components/Testimonial',
8
7
  component: Testimonial,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'The Testimonial component displays customer reviews, quotes, or endorsements with author information and avatars. It supports multiple sizes, skeleton loading states, and can display rich content. Testimonials are ideal for showcasing social proof, customer feedback, or featured quotes on landing pages and marketing sites.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs'],
9
18
  argTypes: {
10
19
  size: {
11
20
  control: { type: 'select', options: ['', 'sm', 'lg'] },
12
- defaultValue: '',
21
+ description: 'Size variant of the testimonial',
13
22
  },
14
23
  skeleton: {
15
- control: { type: 'boolean' },
16
- defaultValue: false,
24
+ control: 'boolean',
25
+ description: 'Whether to show skeleton loading state',
17
26
  },
18
27
  },
19
- } as Meta<typeof Testimonial>;
28
+ } satisfies Meta<typeof Testimonial>;
20
29
 
21
- const Template: StoryFn<typeof Testimonial> = args => (
22
- <div style={{ padding: '30px' }}>
23
- <Testimonial {...args} />
24
- </div>
25
- );
30
+ export default meta;
31
+ type Story = StoryObj<typeof meta>;
26
32
 
27
33
  // Default testimonial
28
- export const Default = Template.bind({});
29
- Default.args = {
30
- quote:
31
- 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
32
- author: {
33
- name: 'Emily Rodriguez',
34
- role: 'Software Engineer, Acme',
35
- avatarSrc:
36
- 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
37
- avatarAlt: 'Emily Rodriguez',
34
+ export const Default: Story = {
35
+ render: args => (
36
+ <div style={{ padding: '30px' }}>
37
+ <Testimonial {...args} />
38
+ </div>
39
+ ),
40
+ args: {
41
+ quote:
42
+ 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
43
+ author: {
44
+ name: 'Emily Rodriguez',
45
+ role: 'Software Engineer, Acme',
46
+ avatarSrc:
47
+ 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
48
+ avatarAlt: 'Emily Rodriguez',
49
+ },
50
+ size: '',
38
51
  },
39
- size: '',
40
52
  };
41
53
 
42
54
  // Large testimonial
43
- export const Large = Template.bind({});
44
- Large.args = {
45
- quote:
46
- 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
47
- author: {
48
- name: 'Emily Rodriguez',
49
- role: 'Software Engineer, Acme',
50
- avatarSrc:
51
- 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
52
- avatarAlt: 'Emily Rodriguez',
55
+ export const Large: Story = {
56
+ render: args => (
57
+ <div style={{ padding: '30px' }}>
58
+ <Testimonial {...args} />
59
+ </div>
60
+ ),
61
+ args: {
62
+ quote:
63
+ 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
64
+ author: {
65
+ name: 'Emily Rodriguez',
66
+ role: 'Software Engineer, Acme',
67
+ avatarSrc:
68
+ 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
69
+ avatarAlt: 'Emily Rodriguez',
70
+ },
71
+ size: 'lg',
53
72
  },
54
- size: 'lg',
55
73
  };
56
74
 
57
75
  // Small testimonial
58
- export const Small = Template.bind({});
59
- Small.args = {
60
- quote:
61
- 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
62
- author: {
63
- name: 'Emily Rodriguez',
64
- role: 'Software Engineer, Acme',
65
- avatarSrc:
66
- 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
67
- avatarAlt: 'Emily Rodriguez',
76
+ export const Small: Story = {
77
+ render: args => (
78
+ <div style={{ padding: '30px' }}>
79
+ <Testimonial {...args} />
80
+ </div>
81
+ ),
82
+ args: {
83
+ quote:
84
+ 'The intuitive interface, seamless syncing across devices, and helpful features have made me more productive than ever before.',
85
+ author: {
86
+ name: 'Emily Rodriguez',
87
+ role: 'Software Engineer, Acme',
88
+ avatarSrc:
89
+ 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
90
+ avatarAlt: 'Emily Rodriguez',
91
+ },
92
+ size: 'sm',
68
93
  },
69
- size: 'sm',
70
94
  };
71
95
 
72
96
  // Skeleton loading state
73
- export const Skeleton = Template.bind({});
74
- Skeleton.args = {
75
- skeleton: true,
76
- size: '',
97
+ export const Skeleton: Story = {
98
+ render: args => (
99
+ <div style={{ padding: '30px' }}>
100
+ <Testimonial {...args} />
101
+ </div>
102
+ ),
103
+ args: {
104
+ skeleton: true,
105
+ size: '',
106
+ },
77
107
  };
78
108
 
79
109
  // Large skeleton
80
- export const LargeSkeleton = Template.bind({});
81
- LargeSkeleton.args = {
82
- skeleton: true,
83
- size: 'lg',
110
+ export const LargeSkeleton: Story = {
111
+ render: args => (
112
+ <div style={{ padding: '30px' }}>
113
+ <Testimonial {...args} />
114
+ </div>
115
+ ),
116
+ args: {
117
+ skeleton: true,
118
+ size: 'lg',
119
+ },
84
120
  };
85
121
 
86
122
  // With rich content in quote
87
- export const RichContent = Template.bind({});
88
- RichContent.args = {
89
- quote: (
90
- <>
91
- <p>"I feel more in charge of my schedule and less overwhelmed. Highly recommended for</p>
92
- <p>professionals and anyone aiming to enhance their productivity."</p>
93
- </>
123
+ export const RichContent: Story = {
124
+ render: args => (
125
+ <div style={{ padding: '30px' }}>
126
+ <Testimonial {...args} />
127
+ </div>
94
128
  ),
95
- author: {
96
- name: 'John Smith',
97
- role: 'Product Manager, XYZ Corp',
98
- avatarSrc:
99
- 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3',
100
- avatarAlt: 'John Smith',
129
+ args: {
130
+ quote: (
131
+ <>
132
+ <p>"I feel more in charge of my schedule and less overwhelmed. Highly recommended for</p>
133
+ <p>professionals and anyone aiming to enhance their productivity."</p>
134
+ </>
135
+ ),
136
+ author: {
137
+ name: 'John Smith',
138
+ role: 'Product Manager, XYZ Corp',
139
+ avatarSrc:
140
+ 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?q=80&w=3000&auto=format&fit=crop&ixlib=rb-4.0.3',
141
+ avatarAlt: 'John Smith',
142
+ },
101
143
  },
102
144
  };
103
145
 
@@ -150,7 +192,9 @@ const TestimonialGrid: React.FC = () => {
150
192
  );
151
193
  };
152
194
 
153
- export const TestimonialGridLayout: StoryFn<typeof Testimonial> = () => <TestimonialGrid />;
195
+ export const TestimonialGridLayout: Story = {
196
+ render: () => <TestimonialGrid />,
197
+ };
154
198
 
155
199
  // Testimonial with image
156
200
  const TestimonialWithImage: React.FC = () => {
@@ -177,4 +221,6 @@ const TestimonialWithImage: React.FC = () => {
177
221
  );
178
222
  };
179
223
 
180
- export const WithImage: StoryFn<typeof Testimonial> = () => <TestimonialWithImage />;
224
+ export const WithImage: Story = {
225
+ render: () => <TestimonialWithImage />,
226
+ };
@@ -1,30 +1,56 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { generateUUID } from '../../lib/utils';
3
3
  import { Todo } from './Todo';
4
+ import { SIZES } from '../../lib/constants/components';
4
5
 
5
- const meta: Meta<typeof Todo> = {
6
+ const meta = {
6
7
  title: 'Components/Todo',
7
8
  component: Todo,
8
9
  parameters: {
9
10
  layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component:
14
+ 'The Todo component provides a complete todo list interface with the ability to add, complete, and manage tasks. It supports multiple sizes, can show or hide completed items, and provides a clean interface for task management. Ideal for task tracking, project management, or any scenario requiring a simple todo list.',
15
+ },
16
+ },
10
17
  },
18
+ tags: ['autodocs'],
11
19
  argTypes: {
12
- items: { control: 'object' },
13
- title: { control: 'text' },
14
-
20
+ items: {
21
+ control: 'object',
22
+ description: 'Array of todo items',
23
+ },
24
+ title: {
25
+ control: 'text',
26
+ description: 'Title of the todo list',
27
+ },
15
28
  size: {
16
29
  control: { type: 'select' },
17
- options: ['sm', 'md', 'lg'],
30
+ options: SIZES,
31
+ description: 'Size of the todo component',
32
+ },
33
+ placeholder: {
34
+ control: 'text',
35
+ description: 'Placeholder text for the input field',
36
+ },
37
+ showCompleted: {
38
+ control: 'boolean',
39
+ description: 'Whether to show completed items',
40
+ },
41
+ className: {
42
+ control: 'text',
43
+ description: 'Additional CSS class names',
44
+ },
45
+ disabled: {
46
+ control: 'boolean',
47
+ description: 'Whether the todo list is disabled',
18
48
  },
19
- placeholder: { control: 'text' },
20
- showCompleted: { control: 'boolean' },
21
- className: { control: 'text' },
22
- disabled: { control: 'boolean' },
23
49
  },
24
- };
50
+ } satisfies Meta<typeof Todo>;
25
51
 
26
52
  export default meta;
27
- type Story = StoryObj<typeof Todo>;
53
+ type Story = StoryObj<typeof meta>;
28
54
 
29
55
  export const Default: Story = {
30
56
  args: {