@shohojdhara/atomix 0.3.14 → 0.3.15

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/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +43 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +67 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +203 -90
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +3 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +43 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +67 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +9 -61
  53. package/dist/index.esm.js +237 -286
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +250 -299
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/package.json +23 -8
  60. package/scripts/atomix-cli.js +170 -73
  61. package/scripts/cli/__tests__/README.md +81 -0
  62. package/scripts/cli/__tests__/basic.test.js +115 -0
  63. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  64. package/scripts/cli/__tests__/integration.test.js +327 -0
  65. package/scripts/cli/__tests__/test-setup.js +133 -0
  66. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  67. package/scripts/cli/__tests__/utils.test.js +161 -0
  68. package/scripts/cli/component-generator.js +253 -299
  69. package/scripts/cli/dependency-checker.js +355 -0
  70. package/scripts/cli/interactive-init.js +46 -5
  71. package/scripts/cli/template-manager.js +0 -2
  72. package/scripts/cli/templates/common-templates.js +636 -0
  73. package/scripts/cli/templates/composable-templates.js +148 -126
  74. package/scripts/cli/templates/index.js +23 -16
  75. package/scripts/cli/templates/project-templates.js +151 -23
  76. package/scripts/cli/templates/react-templates.js +280 -210
  77. package/scripts/cli/templates/scss-templates.js +90 -91
  78. package/scripts/cli/templates/testing-templates.js +206 -27
  79. package/scripts/cli/templates/testing-utils.js +278 -0
  80. package/scripts/cli/templates/types-templates.js +70 -56
  81. package/scripts/cli/theme-bridge.js +8 -2
  82. package/scripts/cli/token-manager.js +318 -206
  83. package/scripts/cli/utils.js +0 -1
  84. package/src/components/Accordion/Accordion.stories.tsx +369 -870
  85. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  86. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  87. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  88. package/src/components/AtomixGlass/glass-utils.ts +2 -2
  89. package/src/components/AtomixGlass/shader-utils.ts +5 -0
  90. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  91. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  92. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  93. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  94. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  95. package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
  96. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
  97. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  98. package/src/components/Avatar/Avatar.stories.tsx +213 -1
  99. package/src/components/Badge/Badge.stories.tsx +121 -362
  100. package/src/components/Block/Block.stories.tsx +21 -12
  101. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
  102. package/src/components/Button/Button.stories.tsx +463 -1126
  103. package/src/components/Button/Button.test.tsx +107 -0
  104. package/src/components/Button/Button.tsx +46 -50
  105. package/src/components/Button/ButtonGroup.stories.tsx +373 -217
  106. package/src/components/Callout/Callout.stories.tsx +289 -634
  107. package/src/components/Card/Card.stories.tsx +248 -68
  108. package/src/components/Chart/Chart.stories.tsx +150 -8
  109. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
  110. package/src/components/Countdown/Countdown.stories.tsx +115 -8
  111. package/src/components/DataTable/DataTable.stories.tsx +346 -146
  112. package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
  113. package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
  114. package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
  115. package/src/components/Footer/Footer.stories.tsx +392 -328
  116. package/src/components/Form/Checkbox.stories.tsx +140 -6
  117. package/src/components/Form/Checkbox.test.tsx +63 -0
  118. package/src/components/Form/Checkbox.tsx +87 -51
  119. package/src/components/Form/Form.stories.tsx +119 -20
  120. package/src/components/Form/FormGroup.stories.tsx +127 -4
  121. package/src/components/Form/Radio.stories.tsx +140 -5
  122. package/src/components/Form/Select.stories.tsx +140 -8
  123. package/src/components/Form/Textarea.stories.tsx +149 -6
  124. package/src/components/Hero/Hero.stories.tsx +333 -32
  125. package/src/components/List/List.stories.tsx +141 -3
  126. package/src/components/Modal/Modal.stories.tsx +181 -42
  127. package/src/components/Popover/Popover.stories.tsx +448 -98
  128. package/src/components/Progress/Progress.stories.tsx +167 -5
  129. package/src/components/River/River.stories.tsx +1 -1
  130. package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
  131. package/src/components/Spinner/Spinner.stories.tsx +102 -8
  132. package/src/components/Steps/Steps.stories.tsx +172 -43
  133. package/src/components/Tabs/Tabs.stories.tsx +136 -10
  134. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  135. package/src/components/Todo/Todo.stories.tsx +198 -9
  136. package/src/components/Toggle/Toggle.stories.tsx +126 -39
  137. package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
  138. package/src/components/Upload/Upload.stories.tsx +113 -24
  139. package/src/lib/README.md +2 -2
  140. package/src/lib/__tests__/theme-tools.test.ts +193 -0
  141. package/src/lib/composables/index.ts +2 -2
  142. package/src/lib/composables/useAtomixGlass.ts +28 -56
  143. package/src/lib/composables/useChartExport.ts +2 -7
  144. package/src/lib/composables/useDataTable.ts +46 -29
  145. package/src/lib/constants/components.ts +9 -32
  146. package/src/lib/theme/devtools/CLI.ts +1 -1
  147. package/src/lib/types/components.ts +1 -1
  148. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  149. package/src/lib/utils/csv.ts +17 -0
  150. package/src/lib/utils/dataTableExport.ts +1 -10
  151. package/src/styles/01-settings/_index.scss +2 -1
  152. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  153. package/src/styles/01-settings/_settings.colors.scss +11 -11
  154. package/src/styles/01-settings/_settings.typography.scss +5 -5
  155. package/src/styles/02-tools/_tools.utility-api.scss +14 -0
  156. package/src/styles/06-components/_components.accordion.scss +56 -14
  157. package/src/styles/06-components/_components.checkbox.scss +23 -17
  158. package/src/styles/99-utilities/_index.scss +2 -0
  159. package/src/styles/99-utilities/_utilities.scss +3 -1
  160. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  161. package/themes/dark-complementary/README.md +98 -0
  162. package/themes/dark-complementary/index.scss +158 -0
  163. package/themes/default-light/README.md +81 -0
  164. package/themes/default-light/index.scss +154 -0
  165. package/themes/high-contrast/README.md +105 -0
  166. package/themes/high-contrast/index.scss +172 -0
  167. package/themes/test-theme/README.md +38 -0
  168. package/themes/test-theme/index.scss +47 -0
  169. package/scripts/cli/templates-original-backup.js +0 -1655
  170. package/scripts/cli/templates_backup.js +0 -684
  171. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  172. package/src/lib/composables/useButton.ts +0 -93
  173. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
+ import { fn } from '@storybook/test';
3
4
  import { Toggle } from './Toggle';
4
5
 
5
6
  const meta = {
@@ -9,8 +10,61 @@ const meta = {
9
10
  layout: 'centered',
10
11
  docs: {
11
12
  description: {
12
- component:
13
- 'The Toggle component provides an on/off switch control for binary choices. It offers a more visually distinct alternative to checkboxes for settings, preferences, or feature toggles. Toggles support disabled states and can include glass morphism effects.',
13
+ component: `
14
+ # Toggle
15
+
16
+ ## Overview
17
+
18
+ Toggle provides an on/off switch control for binary choices. It offers a more visually distinct alternative to checkboxes for settings, preferences, or feature toggles. Toggles support disabled states and can include glass morphism effects.
19
+
20
+ ## Features
21
+
22
+ - On/off state control
23
+ - Uncontrolled and controlled usage
24
+ - Disabled state
25
+ - Glass morphism effect
26
+ - Accessible design
27
+ - Responsive behavior
28
+
29
+ ## Accessibility
30
+
31
+ - Keyboard support: Toggle with Space or Enter key
32
+ - Screen reader: State changes announced appropriately
33
+ - ARIA support: Proper roles and properties for toggle components
34
+ - Focus management: Visible focus indicators maintained
35
+
36
+ ## Usage Examples
37
+
38
+ ### Basic Usage
39
+
40
+ \`\`\`tsx
41
+ <Toggle
42
+ defaultChecked={false}
43
+ onChange={(checked) => console.log(checked)}
44
+ />
45
+ \`\`\`
46
+
47
+ ### Controlled Usage
48
+
49
+ \`\`\`tsx
50
+ <Toggle
51
+ checked={isEnabled}
52
+ onChange={setEnabled}
53
+ />
54
+ \`\`\`
55
+
56
+ ## API Reference
57
+
58
+ ### Props
59
+
60
+ | Prop | Type | Default | Description |
61
+ | ---- | ---- | ------- | ----------- |
62
+ | defaultChecked | boolean | false | Whether the toggle is initially on (uncontrolled) |
63
+ | checked | boolean | - | Whether the toggle is on (controlled) |
64
+ | onChange | (checked: boolean) => void | - | Callback when the toggle state changes |
65
+ | disabled | boolean | false | Whether the toggle is disabled |
66
+ | glass | boolean | false | Enable glass morphism effect |
67
+ `,
14
68
  },
15
69
  },
16
70
  },
@@ -19,11 +73,18 @@ const meta = {
19
73
  defaultChecked: {
20
74
  control: { type: 'boolean' },
21
75
  description: 'Whether the toggle is initially on (uncontrolled)',
22
- defaultValue: false,
76
+ table: {
77
+ type: { summary: 'boolean' },
78
+ defaultValue: { summary: false },
79
+ },
23
80
  },
24
81
  checked: {
25
82
  control: { type: 'boolean' },
26
83
  description: 'Whether the toggle is on (controlled)',
84
+ table: {
85
+ type: { summary: 'boolean' },
86
+ defaultValue: { summary: '-' },
87
+ },
27
88
  },
28
89
  onChange: {
29
90
  action: 'changed',
@@ -32,11 +93,18 @@ const meta = {
32
93
  disabled: {
33
94
  control: { type: 'boolean' },
34
95
  description: 'Whether the toggle is disabled',
35
- defaultValue: false,
96
+ table: {
97
+ type: { summary: 'boolean' },
98
+ defaultValue: { summary: false },
99
+ },
36
100
  },
37
101
  glass: {
38
102
  control: 'boolean',
39
103
  description: 'Enable glass morphism effect',
104
+ table: {
105
+ type: { summary: 'boolean' },
106
+ defaultValue: { summary: false },
107
+ },
40
108
  },
41
109
  },
42
110
  } satisfies Meta<typeof Toggle>;
@@ -44,7 +112,7 @@ const meta = {
44
112
  export default meta;
45
113
  type Story = StoryObj<typeof meta>;
46
114
 
47
- export const Default: Story = {
115
+ export const BasicUsage: Story = {
48
116
  render: args => (
49
117
  <div style={{ display: 'flex', justifyContent: 'center', padding: '30px' }}>
50
118
  <Toggle {...args} />
@@ -54,11 +122,15 @@ export const Default: Story = {
54
122
  defaultChecked: false,
55
123
  disabled: false,
56
124
  },
125
+ parameters: {
126
+ docs: {
127
+ description: {
128
+ story: 'Basic toggle with default settings.',
129
+ },
130
+ },
131
+ },
57
132
  };
58
133
 
59
- /**
60
- * Controlled Toggle using checked and onChange.
61
- */
62
134
  export const Controlled: Story = {
63
135
  render: () => {
64
136
  const [isChecked, setIsChecked] = React.useState(false);
@@ -69,6 +141,13 @@ export const Controlled: Story = {
69
141
  </div>
70
142
  );
71
143
  },
144
+ parameters: {
145
+ docs: {
146
+ description: {
147
+ story: 'Controlled toggle using checked and onChange.',
148
+ },
149
+ },
150
+ },
72
151
  };
73
152
 
74
153
  export const InitiallyOn: Story = {
@@ -81,53 +160,61 @@ export const InitiallyOn: Story = {
81
160
  defaultChecked: true,
82
161
  disabled: false,
83
162
  },
163
+ parameters: {
164
+ docs: {
165
+ description: {
166
+ story: 'Toggle that starts in the "on" position.',
167
+ },
168
+ },
169
+ },
84
170
  };
85
171
 
86
- export const Disabled: Story = {
87
- render: args => (
88
- <div style={{ display: 'flex', justifyContent: 'center', padding: '30px' }}>
89
- <Toggle {...args} />
172
+ export const DisabledStates: Story = {
173
+ render: () => (
174
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '2rem', padding: '30px' }}>
175
+ <div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
176
+ <Toggle disabled={true} checked={false} />
177
+ <span>Disabled Off</span>
178
+ </div>
179
+ <div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
180
+ <Toggle disabled={true} checked={true} />
181
+ <span>Disabled On</span>
182
+ </div>
90
183
  </div>
91
184
  ),
92
- args: {
93
- defaultChecked: false,
94
- disabled: true,
185
+ parameters: {
186
+ docs: {
187
+ description: {
188
+ story: 'Toggle in both disabled states (off and on).',
189
+ },
190
+ },
95
191
  },
96
192
  };
97
193
 
98
- export const DisabledOn: Story = {
194
+ export const WithGlassEffect: Story = {
99
195
  render: args => (
100
- <div style={{ display: 'flex', justifyContent: 'center', padding: '30px' }}>
196
+ <div style={{
197
+ display: 'flex',
198
+ justifyContent: 'center',
199
+ padding: '30px',
200
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
201
+ minHeight: '200px'
202
+ }}>
101
203
  <Toggle {...args} />
102
204
  </div>
103
205
  ),
104
- args: {
105
- defaultChecked: true,
106
- disabled: true,
107
- },
108
- };
109
-
110
- export const Glass: Story = {
111
206
  args: {
112
207
  defaultChecked: false,
113
208
  disabled: false,
114
209
  glass: true,
115
210
  },
116
- render: (args: any) => (
117
- <div
118
- style={{
119
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
120
- padding: '3rem',
121
- borderRadius: '12px',
122
- minHeight: '200px',
123
- display: 'flex',
124
- alignItems: 'center',
125
- justifyContent: 'center',
126
- }}
127
- >
128
- <Toggle {...args} />
129
- </div>
130
- ),
211
+ parameters: {
212
+ docs: {
213
+ description: {
214
+ story: 'Toggle with glass morphism effect applied.',
215
+ },
216
+ },
217
+ },
131
218
  };
132
219
 
133
220
  export const GlassOn: Story = {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
+ import { fn } from '@storybook/test';
3
4
  import type { AtomixGlassProps } from '../../lib/types/components';
4
5
  import { Tooltip } from './Tooltip';
5
6
 
@@ -13,8 +14,69 @@ const meta = {
13
14
  layout: 'fullscreen',
14
15
  docs: {
15
16
  description: {
16
- component:
17
- 'The Tooltip component displays contextual information when users hover over or click on an element. It supports multiple positions, triggers, and can include rich content. Tooltips are useful for providing additional context without cluttering the interface.',
17
+ component: `
18
+ # Tooltip
19
+
20
+ ## Overview
21
+
22
+ Tooltip displays contextual information when users hover over or click on an element. It supports multiple positions, triggers, and can include rich content. Tooltips are useful for providing additional context without cluttering the interface.
23
+
24
+ ## Features
25
+
26
+ - Multiple position options (top, bottom, left, right with corners)
27
+ - Hover and click triggers
28
+ - Configurable delays and offsets
29
+ - Glass morphism effect
30
+ - Rich content support
31
+ - Accessible design
32
+ - Responsive behavior
33
+
34
+ ## Accessibility
35
+
36
+ - Screen reader: Tooltip content announced appropriately
37
+ - ARIA support: Proper roles and properties for tooltip components
38
+ - Keyboard support: Accessible via keyboard navigation
39
+ - Focus management: Maintains focus on trigger element
40
+
41
+ ## Usage Examples
42
+
43
+ ### Basic Usage
44
+
45
+ \`\`\`tsx
46
+ <Tooltip
47
+ content="Tooltip text"
48
+ position="top"
49
+ >
50
+ <button>Hover me</button>
51
+ </Tooltip>
52
+ \`\`\`
53
+
54
+ ### With Glass Effect
55
+
56
+ \`\`\`tsx
57
+ <Tooltip
58
+ content="Tooltip text"
59
+ position="top"
60
+ glass={true}
61
+ >
62
+ <button>Hover me</button>
63
+ </Tooltip>
64
+ \`\`\`
65
+
66
+ ## API Reference
67
+
68
+ ### Props
69
+
70
+ | Prop | Type | Default | Description |
71
+ | ---- | ---- | ------- | ----------- |
72
+ | position | Position | 'top' | Position of the tooltip relative to the trigger |
73
+ | trigger | 'hover' \\| 'click' | 'hover' | How the tooltip is triggered |
74
+ | delay | number | 200 | Delay in milliseconds before showing tooltip |
75
+ | offset | number | 10 | Offset distance from the trigger element |
76
+ | glass | boolean \\| GlassProps | false | Enable glass morphism effect |
77
+ | content | ReactNode | - | Content to display in the tooltip |
78
+ | children | ReactNode | - | Trigger element for the tooltip |
79
+ `,
18
80
  },
19
81
  },
20
82
  },
@@ -32,24 +94,52 @@ const meta = {
32
94
  'bottom-left',
33
95
  'bottom-right',
34
96
  ],
35
- defaultValue: 'top',
97
+ description: 'Position of the tooltip relative to the trigger',
98
+ table: {
99
+ type: { summary: 'Position' },
100
+ defaultValue: { summary: 'top' },
101
+ },
36
102
  },
37
103
  trigger: {
38
104
  control: { type: 'select' },
39
105
  options: ['hover', 'click'],
40
- defaultValue: 'hover',
106
+ description: 'How the tooltip is triggered',
107
+ table: {
108
+ type: { summary: '"hover" | "click"' },
109
+ defaultValue: { summary: 'hover' },
110
+ },
41
111
  },
42
112
  delay: {
43
113
  control: { type: 'number' },
44
- defaultValue: 200,
114
+ description: 'Delay in milliseconds before showing tooltip',
115
+ table: {
116
+ type: { summary: 'number' },
117
+ defaultValue: { summary: 200 },
118
+ },
45
119
  },
46
120
  offset: {
47
121
  control: { type: 'number' },
48
- defaultValue: 10,
122
+ description: 'Offset distance from the trigger element',
123
+ table: {
124
+ type: { summary: 'number' },
125
+ defaultValue: { summary: 10 },
126
+ },
49
127
  },
50
128
  glass: {
51
129
  control: { type: 'boolean' },
52
130
  description: 'Enable glass morphism effect',
131
+ table: {
132
+ type: { summary: 'boolean | GlassProps' },
133
+ defaultValue: { summary: false },
134
+ },
135
+ },
136
+ content: {
137
+ control: 'object',
138
+ description: 'Content to display in the tooltip',
139
+ table: {
140
+ type: { summary: 'ReactNode' },
141
+ defaultValue: { summary: '-' },
142
+ },
53
143
  },
54
144
  },
55
145
  } satisfies Meta<typeof Tooltip>;
@@ -57,8 +147,7 @@ const meta = {
57
147
  export default meta;
58
148
  type Story = StoryObj<typeof meta>;
59
149
 
60
- // Default Tooltip
61
- export const Default: Story = {
150
+ export const BasicUsage: Story = {
62
151
  render: args => (
63
152
  <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
64
153
  <Tooltip {...args}>
@@ -71,6 +160,13 @@ export const Default: Story = {
71
160
  position: 'top',
72
161
  trigger: 'hover',
73
162
  } as any,
163
+ parameters: {
164
+ docs: {
165
+ description: {
166
+ story: 'Default tooltip with top position and hover trigger.',
167
+ },
168
+ },
169
+ },
74
170
  };
75
171
 
76
172
  export const ClickTrigger: Story = {
@@ -86,117 +182,111 @@ export const ClickTrigger: Story = {
86
182
  position: 'top',
87
183
  trigger: 'click',
88
184
  } as any,
185
+ parameters: {
186
+ docs: {
187
+ description: {
188
+ story: 'Tooltip with click trigger instead of hover.',
189
+ },
190
+ },
191
+ },
89
192
  };
90
193
 
91
- export const BottomPosition: Story = {
92
- render: args => (
93
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
94
- <Tooltip {...args}>
95
- <button className="c-btn c-btn--primary">Hover me</button>
96
- </Tooltip>
97
- </div>
98
- ),
99
- args: {
100
- content: <p className="u-mb-0">This tooltip appears below the trigger</p>,
101
- position: 'bottom',
102
- } as any,
103
- };
104
-
105
- export const LeftPosition: Story = {
106
- render: args => (
107
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
108
- <Tooltip {...args}>
109
- <button className="c-btn c-btn--primary">Hover me</button>
110
- </Tooltip>
111
- </div>
112
- ),
113
- args: {
114
- content: <p className="u-mb-0">This tooltip appears to the left</p>,
115
- position: 'left',
116
- } as any,
117
- };
118
-
119
- export const RightPosition: Story = {
120
- render: args => (
121
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
122
- <Tooltip {...args}>
123
- <button className="c-btn c-btn--primary">Hover me</button>
124
- </Tooltip>
125
- </div>
126
- ),
127
- args: {
128
- content: <p className="u-mb-0">This tooltip appears to the right</p>,
129
- position: 'right',
130
- } as any,
131
- };
132
-
133
- export const WithIcon: Story = {
134
- render: args => (
135
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
136
- <Tooltip {...args}>
137
- <i className="icon-lux-info" style={{ fontSize: '24px', cursor: 'pointer' }}></i>
138
- </Tooltip>
139
- </div>
140
- ),
141
- args: {
142
- content: <p className="u-mb-0">Tooltips work great with icons</p>,
143
- position: 'top',
144
- } as any,
145
- };
146
-
147
- export const CustomDelay: Story = {
148
- render: args => (
149
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
150
- <Tooltip {...args}>
151
- <button className="c-btn c-btn--primary">Hover me (500ms delay)</button>
152
- </Tooltip>
194
+ export const AllPositions: Story = {
195
+ render: () => (
196
+ <div style={{
197
+ display: 'grid',
198
+ gridTemplateColumns: 'repeat(3, 1fr)',
199
+ gap: '20px',
200
+ padding: '50px',
201
+ alignItems: 'center',
202
+ justifyItems: 'center',
203
+ height: '500px'
204
+ }}>
205
+ <div>
206
+ <Tooltip content="Top Left Tooltip">
207
+ <button className="c-btn c-btn--primary">Top Left</button>
208
+ </Tooltip>
209
+ </div>
210
+ <div>
211
+ <Tooltip content="Top Tooltip" position="top">
212
+ <button className="c-btn c-btn--primary">Top</button>
213
+ </Tooltip>
214
+ </div>
215
+ <div>
216
+ <Tooltip content="Top Right Tooltip" position="top-right">
217
+ <button className="c-btn c-btn--primary">Top Right</button>
218
+ </Tooltip>
219
+ </div>
220
+
221
+ <div>
222
+ <Tooltip content="Left Tooltip" position="left">
223
+ <button className="c-btn c-btn--primary">Left</button>
224
+ </Tooltip>
225
+ </div>
226
+
227
+ <div style={{ textAlign: 'center' }}>
228
+ <p>All tooltip positions</p>
229
+ </div>
230
+
231
+ <div>
232
+ <Tooltip content="Right Tooltip" position="right">
233
+ <button className="c-btn c-btn--primary">Right</button>
234
+ </Tooltip>
235
+ </div>
236
+
237
+ <div>
238
+ <Tooltip content="Bottom Left Tooltip" position="bottom-left">
239
+ <button className="c-btn c-btn--primary">Bottom Left</button>
240
+ </Tooltip>
241
+ </div>
242
+ <div>
243
+ <Tooltip content="Bottom Tooltip" position="bottom">
244
+ <button className="c-btn c-btn--primary">Bottom</button>
245
+ </Tooltip>
246
+ </div>
247
+ <div>
248
+ <Tooltip content="Bottom Right Tooltip" position="bottom-right">
249
+ <button className="c-btn c-btn--primary">Bottom Right</button>
250
+ </Tooltip>
251
+ </div>
153
252
  </div>
154
253
  ),
155
- args: {
156
- content: <p className="u-mb-0">This tooltip has a longer delay</p>,
157
- position: 'top',
158
- delay: 500,
159
- } as any,
254
+ parameters: {
255
+ docs: {
256
+ description: {
257
+ story: 'All available tooltip positions demonstrated.',
258
+ },
259
+ },
260
+ },
160
261
  };
161
262
 
162
- export const CustomOffset: Story = {
263
+ export const WithGlassEffect: Story = {
163
264
  render: args => (
164
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
265
+ <div style={{
266
+ display: 'flex',
267
+ justifyContent: 'center',
268
+ padding: '100px',
269
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
270
+ minHeight: '300px'
271
+ }}>
165
272
  <Tooltip {...args}>
166
273
  <button className="c-btn c-btn--primary">Hover me</button>
167
274
  </Tooltip>
168
275
  </div>
169
276
  ),
170
277
  args: {
171
- content: <p className="u-mb-0">This tooltip has a larger offset from the trigger</p>,
278
+ content: <p className="u-mb-0">Tooltip with glass effect applied</p>,
172
279
  position: 'top',
173
- offset: 20,
174
- } as any,
175
- };
176
-
177
- export const RichContent: Story = {
178
- render: args => (
179
- <div style={{ display: 'flex', justifyContent: 'center', padding: '100px' }}>
180
- <Tooltip {...args}>
181
- <button className="c-btn c-btn--primary">Click for rich content</button>
182
- </Tooltip>
183
- </div>
184
- ),
185
- args: {
186
- content: (
187
- <div>
188
- <h4 style={{ marginTop: 0, marginBottom: '8px' }}>Rich Tooltip Content</h4>
189
- <ul style={{ margin: 0, paddingLeft: '16px' }}>
190
- <li>Supports HTML content</li>
191
- <li>Can include multiple elements</li>
192
- <li>Helpful for complex information</li>
193
- </ul>
194
- </div>
195
- ),
196
- position: 'bottom',
197
- trigger: 'click',
198
- offset: 15,
280
+ trigger: 'hover',
281
+ glass: true,
199
282
  } as any,
283
+ parameters: {
284
+ docs: {
285
+ description: {
286
+ story: 'Tooltip with glass morphism effect applied.',
287
+ },
288
+ },
289
+ },
200
290
  };
201
291
 
202
292
  /**