@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.
- package/CHANGELOG.md +20 -0
- package/build-tools/EXAMPLES.md +372 -0
- package/build-tools/README.md +242 -0
- package/build-tools/__tests__/error-handler.test.js +230 -0
- package/build-tools/__tests__/index.test.js +141 -0
- package/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/build-tools/__tests__/utils.test.js +161 -0
- package/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/build-tools/error-handler.js +308 -0
- package/build-tools/index.d.ts +43 -0
- package/build-tools/index.js +88 -0
- package/build-tools/package.json +67 -0
- package/build-tools/rollup-plugin.js +236 -0
- package/build-tools/types.d.ts +163 -0
- package/build-tools/utils.js +203 -0
- package/build-tools/vite-plugin.js +161 -0
- package/build-tools/webpack-loader.js +123 -0
- package/dist/atomix.css +203 -90
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +3 -3
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/EXAMPLES.md +372 -0
- package/dist/build-tools/README.md +242 -0
- package/dist/build-tools/__tests__/error-handler.test.js +230 -0
- package/dist/build-tools/__tests__/index.test.js +141 -0
- package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/dist/build-tools/__tests__/utils.test.js +161 -0
- package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/dist/build-tools/error-handler.js +308 -0
- package/dist/build-tools/index.d.ts +43 -0
- package/dist/build-tools/index.js +88 -0
- package/dist/build-tools/package.json +67 -0
- package/dist/build-tools/rollup-plugin.js +236 -0
- package/dist/build-tools/types.d.ts +163 -0
- package/dist/build-tools/utils.js +203 -0
- package/dist/build-tools/vite-plugin.js +161 -0
- package/dist/build-tools/webpack-loader.js +123 -0
- package/dist/charts.d.ts +1 -1
- package/dist/charts.js +86 -57
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +136 -112
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +2 -5
- package/dist/forms.js +140 -128
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +136 -112
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +9 -61
- package/dist/index.esm.js +237 -286
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +250 -299
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +23 -8
- package/scripts/atomix-cli.js +170 -73
- package/scripts/cli/__tests__/README.md +81 -0
- package/scripts/cli/__tests__/basic.test.js +115 -0
- package/scripts/cli/__tests__/component-generator.test.js +332 -0
- package/scripts/cli/__tests__/integration.test.js +327 -0
- package/scripts/cli/__tests__/test-setup.js +133 -0
- package/scripts/cli/__tests__/token-manager.test.js +251 -0
- package/scripts/cli/__tests__/utils.test.js +161 -0
- package/scripts/cli/component-generator.js +253 -299
- package/scripts/cli/dependency-checker.js +355 -0
- package/scripts/cli/interactive-init.js +46 -5
- package/scripts/cli/template-manager.js +0 -2
- package/scripts/cli/templates/common-templates.js +636 -0
- package/scripts/cli/templates/composable-templates.js +148 -126
- package/scripts/cli/templates/index.js +23 -16
- package/scripts/cli/templates/project-templates.js +151 -23
- package/scripts/cli/templates/react-templates.js +280 -210
- package/scripts/cli/templates/scss-templates.js +90 -91
- package/scripts/cli/templates/testing-templates.js +206 -27
- package/scripts/cli/templates/testing-utils.js +278 -0
- package/scripts/cli/templates/types-templates.js +70 -56
- package/scripts/cli/theme-bridge.js +8 -2
- package/scripts/cli/token-manager.js +318 -206
- package/scripts/cli/utils.js +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +369 -870
- package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
- package/src/components/AtomixGlass/glass-utils.ts +2 -2
- package/src/components/AtomixGlass/shader-utils.ts +5 -0
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
- package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
- package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
- package/src/components/Avatar/Avatar.stories.tsx +213 -1
- package/src/components/Badge/Badge.stories.tsx +121 -362
- package/src/components/Block/Block.stories.tsx +21 -12
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
- package/src/components/Button/Button.stories.tsx +463 -1126
- package/src/components/Button/Button.test.tsx +107 -0
- package/src/components/Button/Button.tsx +46 -50
- package/src/components/Button/ButtonGroup.stories.tsx +373 -217
- package/src/components/Callout/Callout.stories.tsx +289 -634
- package/src/components/Card/Card.stories.tsx +248 -68
- package/src/components/Chart/Chart.stories.tsx +150 -8
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
- package/src/components/Countdown/Countdown.stories.tsx +115 -8
- package/src/components/DataTable/DataTable.stories.tsx +346 -146
- package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
- package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
- package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
- package/src/components/Footer/Footer.stories.tsx +392 -328
- package/src/components/Form/Checkbox.stories.tsx +140 -6
- package/src/components/Form/Checkbox.test.tsx +63 -0
- package/src/components/Form/Checkbox.tsx +87 -51
- package/src/components/Form/Form.stories.tsx +119 -20
- package/src/components/Form/FormGroup.stories.tsx +127 -4
- package/src/components/Form/Radio.stories.tsx +140 -5
- package/src/components/Form/Select.stories.tsx +140 -8
- package/src/components/Form/Textarea.stories.tsx +149 -6
- package/src/components/Hero/Hero.stories.tsx +333 -32
- package/src/components/List/List.stories.tsx +141 -3
- package/src/components/Modal/Modal.stories.tsx +181 -42
- package/src/components/Popover/Popover.stories.tsx +448 -98
- package/src/components/Progress/Progress.stories.tsx +167 -5
- package/src/components/River/River.stories.tsx +1 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
- package/src/components/Spinner/Spinner.stories.tsx +102 -8
- package/src/components/Steps/Steps.stories.tsx +172 -43
- package/src/components/Tabs/Tabs.stories.tsx +136 -10
- package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
- package/src/components/Todo/Todo.stories.tsx +198 -9
- package/src/components/Toggle/Toggle.stories.tsx +126 -39
- package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
- package/src/components/Upload/Upload.stories.tsx +113 -24
- package/src/lib/README.md +2 -2
- package/src/lib/__tests__/theme-tools.test.ts +193 -0
- package/src/lib/composables/index.ts +2 -2
- package/src/lib/composables/useAtomixGlass.ts +28 -56
- package/src/lib/composables/useChartExport.ts +2 -7
- package/src/lib/composables/useDataTable.ts +46 -29
- package/src/lib/constants/components.ts +9 -32
- package/src/lib/theme/devtools/CLI.ts +1 -1
- package/src/lib/types/components.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +45 -0
- package/src/lib/utils/csv.ts +17 -0
- package/src/lib/utils/dataTableExport.ts +1 -10
- package/src/styles/01-settings/_index.scss +2 -1
- package/src/styles/01-settings/_settings.accordion.scss +28 -7
- package/src/styles/01-settings/_settings.colors.scss +11 -11
- package/src/styles/01-settings/_settings.typography.scss +5 -5
- package/src/styles/02-tools/_tools.utility-api.scss +14 -0
- package/src/styles/06-components/_components.accordion.scss +56 -14
- package/src/styles/06-components/_components.checkbox.scss +23 -17
- package/src/styles/99-utilities/_index.scss +2 -0
- package/src/styles/99-utilities/_utilities.scss +3 -1
- package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
- package/themes/dark-complementary/README.md +98 -0
- package/themes/dark-complementary/index.scss +158 -0
- package/themes/default-light/README.md +81 -0
- package/themes/default-light/index.scss +154 -0
- package/themes/high-contrast/README.md +105 -0
- package/themes/high-contrast/index.scss +172 -0
- package/themes/test-theme/README.md +38 -0
- package/themes/test-theme/index.scss +47 -0
- package/scripts/cli/templates-original-backup.js +0 -1655
- package/scripts/cli/templates_backup.js +0 -684
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
- package/src/lib/composables/useButton.ts +0 -93
- 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 { Progress } from './Progress';
|
|
4
5
|
import { THEME_COLORS, SIZES } from '../../lib/constants/components';
|
|
5
6
|
|
|
@@ -10,8 +11,61 @@ const meta = {
|
|
|
10
11
|
layout: 'centered',
|
|
11
12
|
docs: {
|
|
12
13
|
description: {
|
|
13
|
-
component:
|
|
14
|
-
|
|
14
|
+
component: `
|
|
15
|
+
# Progress
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
Progress displays the completion status of a task or process. It provides visual feedback on progress through a horizontal bar that fills based on a percentage value. Progress bars support multiple variants, sizes, and can be used to show loading states, form completion, or any incremental process.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- Multiple color variants (primary, secondary, success, warning, error, etc.)
|
|
24
|
+
- Multiple size options (sm, md, lg)
|
|
25
|
+
- Percentage-based value tracking
|
|
26
|
+
- Accessible design
|
|
27
|
+
- Responsive behavior
|
|
28
|
+
- Smooth transitions
|
|
29
|
+
|
|
30
|
+
## Accessibility
|
|
31
|
+
|
|
32
|
+
- Screen reader: Progress value announced appropriately
|
|
33
|
+
- ARIA support: Proper roles and properties for progress bar
|
|
34
|
+
- Keyboard support: Accessible via keyboard navigation
|
|
35
|
+
- Focus management: Focus indicators maintained for interactive elements
|
|
36
|
+
|
|
37
|
+
## Usage Examples
|
|
38
|
+
|
|
39
|
+
### Basic Usage
|
|
40
|
+
|
|
41
|
+
\`\`\`tsx
|
|
42
|
+
<Progress value={50} />
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
### With Variant and Size
|
|
46
|
+
|
|
47
|
+
\`\`\`tsx
|
|
48
|
+
<Progress
|
|
49
|
+
value={75}
|
|
50
|
+
variant="success"
|
|
51
|
+
size="lg"
|
|
52
|
+
/>
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
## API Reference
|
|
56
|
+
|
|
57
|
+
### Props
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
| ---- | ---- | ------- | ----------- |
|
|
61
|
+
| value | number | 0 | The progress value as a percentage (0-100) |
|
|
62
|
+
| variant | ThemeColor | 'primary' | The color variant of the progress bar |
|
|
63
|
+
| size | 'sm' \\| 'md' \\| 'lg' | 'md' | The size of the progress bar |
|
|
64
|
+
| animated | boolean | false | Whether to animate the progress bar |
|
|
65
|
+
| striped | boolean | false | Whether to apply striped styling |
|
|
66
|
+
| label | string | - | Optional label to display with the progress |
|
|
67
|
+
| max | number | 100 | The maximum value for the progress bar |
|
|
68
|
+
`,
|
|
15
69
|
},
|
|
16
70
|
},
|
|
17
71
|
},
|
|
@@ -27,19 +81,60 @@ const meta = {
|
|
|
27
81
|
value: {
|
|
28
82
|
control: { type: 'range', min: 0, max: 100 },
|
|
29
83
|
description: 'The progress value as a percentage (0-100)',
|
|
30
|
-
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: 'number' },
|
|
86
|
+
defaultValue: { summary: 0 },
|
|
87
|
+
},
|
|
31
88
|
},
|
|
32
89
|
variant: {
|
|
33
90
|
control: { type: 'select' },
|
|
34
91
|
options: THEME_COLORS,
|
|
35
92
|
description: 'The color variant of the progress bar',
|
|
36
|
-
|
|
93
|
+
table: {
|
|
94
|
+
type: { summary: 'ThemeColor' },
|
|
95
|
+
defaultValue: { summary: 'primary' },
|
|
96
|
+
},
|
|
37
97
|
},
|
|
38
98
|
size: {
|
|
39
99
|
control: { type: 'select' },
|
|
40
100
|
options: SIZES,
|
|
41
101
|
description: 'The size of the progress bar',
|
|
42
|
-
|
|
102
|
+
table: {
|
|
103
|
+
type: { summary: '"sm" | "md" | "lg"' },
|
|
104
|
+
defaultValue: { summary: 'md' },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
animated: {
|
|
108
|
+
control: 'boolean',
|
|
109
|
+
description: 'Whether to animate the progress bar',
|
|
110
|
+
table: {
|
|
111
|
+
type: { summary: 'boolean' },
|
|
112
|
+
defaultValue: { summary: false },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
striped: {
|
|
116
|
+
control: 'boolean',
|
|
117
|
+
description: 'Whether to apply striped styling',
|
|
118
|
+
table: {
|
|
119
|
+
type: { summary: 'boolean' },
|
|
120
|
+
defaultValue: { summary: false },
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
label: {
|
|
124
|
+
control: 'text',
|
|
125
|
+
description: 'Optional label to display with the progress',
|
|
126
|
+
table: {
|
|
127
|
+
type: { summary: 'string' },
|
|
128
|
+
defaultValue: { summary: '-' },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
max: {
|
|
132
|
+
control: 'number',
|
|
133
|
+
description: 'The maximum value for the progress bar',
|
|
134
|
+
table: {
|
|
135
|
+
type: { summary: 'number' },
|
|
136
|
+
defaultValue: { summary: 100 },
|
|
137
|
+
},
|
|
43
138
|
},
|
|
44
139
|
},
|
|
45
140
|
} satisfies Meta<typeof Progress>;
|
|
@@ -47,6 +142,73 @@ const meta = {
|
|
|
47
142
|
export default meta;
|
|
48
143
|
type Story = StoryObj<typeof meta>;
|
|
49
144
|
|
|
145
|
+
export const BasicUsage: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
value: 50,
|
|
148
|
+
variant: 'primary',
|
|
149
|
+
size: 'md',
|
|
150
|
+
},
|
|
151
|
+
parameters: {
|
|
152
|
+
docs: {
|
|
153
|
+
description: {
|
|
154
|
+
story: 'Basic progress bar with default settings.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const AllVariants: Story = {
|
|
161
|
+
render: () => (
|
|
162
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
163
|
+
<div><strong>Primary:</strong> <Progress value={75} variant="primary" /></div>
|
|
164
|
+
<div><strong>Secondary:</strong> <Progress value={60} variant="secondary" /></div>
|
|
165
|
+
<div><strong>Success:</strong> <Progress value={100} variant="success" /></div>
|
|
166
|
+
<div><strong>Warning:</strong> <Progress value={45} variant="warning" /></div>
|
|
167
|
+
<div><strong>Error:</strong> <Progress value={30} variant="error" /></div>
|
|
168
|
+
</div>
|
|
169
|
+
),
|
|
170
|
+
parameters: {
|
|
171
|
+
docs: {
|
|
172
|
+
description: {
|
|
173
|
+
story: 'Progress bars with all available color variants.',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const AllSizes: Story = {
|
|
180
|
+
render: () => (
|
|
181
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
182
|
+
<div><strong>Small:</strong> <Progress value={60} size="sm" /></div>
|
|
183
|
+
<div><strong>Medium:</strong> <Progress value={70} size="md" /></div>
|
|
184
|
+
<div><strong>Large:</strong> <Progress value={80} size="lg" /></div>
|
|
185
|
+
</div>
|
|
186
|
+
),
|
|
187
|
+
parameters: {
|
|
188
|
+
docs: {
|
|
189
|
+
description: {
|
|
190
|
+
story: 'Progress bars with all available sizes.',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const WithLabel: Story = {
|
|
197
|
+
args: {
|
|
198
|
+
value: 75,
|
|
199
|
+
variant: 'primary',
|
|
200
|
+
size: 'md',
|
|
201
|
+
label: 'Processing files: 75%',
|
|
202
|
+
},
|
|
203
|
+
parameters: {
|
|
204
|
+
docs: {
|
|
205
|
+
description: {
|
|
206
|
+
story: 'Progress bar with a label showing current value.',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
|
|
50
212
|
// Default Progress
|
|
51
213
|
export const Default: Story = {
|
|
52
214
|
args: {
|
|
@@ -199,7 +199,7 @@ export const CustomTitle: Story = {
|
|
|
199
199
|
</div>
|
|
200
200
|
),
|
|
201
201
|
args: {
|
|
202
|
-
title: <h1 className="c-river__title u-text-gradient">Custom Title with Gradient</h1>,
|
|
202
|
+
title: <h1 className="c-river__title u-text-gradient-primary">Custom Title with Gradient</h1>,
|
|
203
203
|
text: 'The sun had set, leaving the sky painted in shades of orange and pink as the stars twinkled above. The air was filled with the sound of crickets and the rustle of leaves in the gentle breeze.',
|
|
204
204
|
actions: (
|
|
205
205
|
<a href="#" className="c-btn u-pl-0">
|
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
import { SectionIntro } from './SectionIntro';
|
|
4
4
|
import { SIZES } from '../../lib/constants/components';
|
|
5
|
+
import { fn } from '@storybook/test';
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/SectionIntro',
|
|
@@ -17,33 +18,129 @@ const meta = {
|
|
|
17
18
|
},
|
|
18
19
|
tags: ['autodocs'],
|
|
19
20
|
argTypes: {
|
|
20
|
-
title: {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
title: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Main title text (supports ReactNode)',
|
|
24
|
+
table: {
|
|
25
|
+
type: { summary: 'ReactNode' },
|
|
26
|
+
defaultValue: { summary: 'undefined' },
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Label text displayed above the title (supports ReactNode)',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'ReactNode' },
|
|
34
|
+
defaultValue: { summary: 'undefined' },
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
description: 'Description text content (supports ReactNode)',
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: 'ReactNode' },
|
|
42
|
+
defaultValue: { summary: 'undefined' },
|
|
43
|
+
}
|
|
44
|
+
},
|
|
23
45
|
alignment: {
|
|
24
|
-
control: { type: '
|
|
46
|
+
control: { type: 'radio', options: ['left', 'center', 'right'] },
|
|
25
47
|
options: ['left', 'center', 'right'],
|
|
26
48
|
description: 'Text alignment',
|
|
49
|
+
table: {
|
|
50
|
+
type: { summary: '"left" | "center" | "right"' },
|
|
51
|
+
defaultValue: { summary: 'left' },
|
|
52
|
+
}
|
|
27
53
|
},
|
|
28
54
|
size: {
|
|
29
|
-
control: { type: '
|
|
55
|
+
control: { type: 'radio', options: SIZES },
|
|
30
56
|
options: SIZES,
|
|
31
57
|
description: 'Size variant',
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: '"sm" | "md" | "lg"' },
|
|
60
|
+
defaultValue: { summary: 'md' },
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
skeleton: {
|
|
64
|
+
control: 'boolean',
|
|
65
|
+
description: 'Show skeleton loading state',
|
|
66
|
+
table: {
|
|
67
|
+
type: { summary: 'boolean' },
|
|
68
|
+
defaultValue: { summary: false },
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
showOverlay: {
|
|
72
|
+
control: 'boolean',
|
|
73
|
+
description: 'Whether to show an overlay on the background',
|
|
74
|
+
table: {
|
|
75
|
+
type: { summary: 'boolean' },
|
|
76
|
+
defaultValue: { summary: false },
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
actions: {
|
|
80
|
+
control: { type: 'text' },
|
|
81
|
+
description: 'Call to action elements (supports ReactNode)',
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: 'ReactNode' },
|
|
84
|
+
defaultValue: { summary: 'undefined' },
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
backgroundImageSrc: {
|
|
88
|
+
control: 'text',
|
|
89
|
+
description: 'URL for the background image',
|
|
90
|
+
table: {
|
|
91
|
+
type: { summary: 'string' },
|
|
92
|
+
defaultValue: { summary: 'undefined' },
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
imageSrc: {
|
|
96
|
+
control: 'text',
|
|
97
|
+
description: 'URL for the foreground image',
|
|
98
|
+
table: {
|
|
99
|
+
type: { summary: 'string' },
|
|
100
|
+
defaultValue: { summary: 'undefined' },
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
imageAlt: {
|
|
104
|
+
control: 'text',
|
|
105
|
+
description: 'Alt text for the image',
|
|
106
|
+
table: {
|
|
107
|
+
type: { summary: 'string' },
|
|
108
|
+
defaultValue: { summary: 'Section image' },
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
className: {
|
|
112
|
+
control: 'text',
|
|
113
|
+
description: 'Additional CSS class',
|
|
114
|
+
table: {
|
|
115
|
+
type: { summary: 'string' },
|
|
116
|
+
defaultValue: { summary: '' },
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
style: {
|
|
120
|
+
control: 'object',
|
|
121
|
+
description: 'Custom style object for the section intro',
|
|
122
|
+
table: {
|
|
123
|
+
type: { summary: 'CSSProperties' },
|
|
124
|
+
defaultValue: { summary: '{}' },
|
|
125
|
+
}
|
|
32
126
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
127
|
+
},
|
|
128
|
+
args: {
|
|
129
|
+
title: 'Our Mission',
|
|
130
|
+
label: 'About Us',
|
|
131
|
+
text: 'We are dedicated to creating beautiful, functional, and accessible components that help developers build amazing websites and applications.',
|
|
132
|
+
alignment: 'left',
|
|
133
|
+
size: 'md',
|
|
134
|
+
// Adding a mock function for any potential event handling
|
|
135
|
+
onClick: fn(),
|
|
39
136
|
},
|
|
40
137
|
} satisfies Meta<typeof SectionIntro>;
|
|
41
138
|
|
|
42
139
|
export default meta;
|
|
43
140
|
type Story = StoryObj<typeof meta>;
|
|
44
141
|
|
|
45
|
-
//
|
|
46
|
-
export const
|
|
142
|
+
// Basic usage example
|
|
143
|
+
export const BasicUsage: Story = {
|
|
47
144
|
args: {
|
|
48
145
|
title: 'Our Mission',
|
|
49
146
|
label: 'About Us',
|
|
@@ -51,89 +148,174 @@ export const Default: Story = {
|
|
|
51
148
|
alignment: 'left',
|
|
52
149
|
size: 'md',
|
|
53
150
|
},
|
|
151
|
+
parameters: {
|
|
152
|
+
docs: {
|
|
153
|
+
description: {
|
|
154
|
+
story: 'Basic usage of the SectionIntro component with title, label, and text.'
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
54
158
|
};
|
|
55
159
|
|
|
56
|
-
//
|
|
160
|
+
// With actions example
|
|
57
161
|
export const WithActions: Story = {
|
|
58
162
|
args: {
|
|
59
|
-
|
|
163
|
+
title: 'Ready to get started?',
|
|
164
|
+
label: 'Take Action',
|
|
165
|
+
text: 'Join thousands of satisfied users who have transformed their workflow with our components.',
|
|
166
|
+
alignment: 'center',
|
|
167
|
+
size: 'md',
|
|
60
168
|
actions: (
|
|
61
|
-
<div className="u-flex u-gap-
|
|
62
|
-
<Button label="
|
|
63
|
-
<Button label="
|
|
169
|
+
<div className="u-flex u-gap-4">
|
|
170
|
+
<Button label="Get Started" />
|
|
171
|
+
<Button label="Learn More" variant="secondary" />
|
|
64
172
|
</div>
|
|
65
173
|
),
|
|
66
174
|
},
|
|
175
|
+
parameters: {
|
|
176
|
+
docs: {
|
|
177
|
+
description: {
|
|
178
|
+
story: 'SectionIntro with call-to-action buttons.'
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
67
182
|
};
|
|
68
183
|
|
|
69
|
-
// Center-aligned
|
|
70
|
-
export const
|
|
184
|
+
// Center-aligned example
|
|
185
|
+
export const CenterAligned: Story = {
|
|
71
186
|
args: {
|
|
72
|
-
|
|
73
|
-
|
|
187
|
+
title: 'Discover Our Vision',
|
|
188
|
+
label: 'Our Vision',
|
|
74
189
|
text: 'We are dedicated to creating beautiful, functional, and accessible components that help developers build amazing websites and applications.',
|
|
190
|
+
alignment: 'center',
|
|
191
|
+
size: 'md',
|
|
75
192
|
},
|
|
193
|
+
parameters: {
|
|
194
|
+
docs: {
|
|
195
|
+
description: {
|
|
196
|
+
story: 'Center-aligned SectionIntro content.'
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
76
200
|
};
|
|
77
201
|
|
|
78
|
-
// Right-aligned
|
|
202
|
+
// Right-aligned example
|
|
79
203
|
export const RightAligned: Story = {
|
|
80
204
|
args: {
|
|
81
|
-
|
|
82
|
-
|
|
205
|
+
title: 'Our Approach',
|
|
206
|
+
label: 'Methodology',
|
|
83
207
|
text: 'We are dedicated to creating beautiful, functional, and accessible components that help developers build amazing websites and applications.',
|
|
208
|
+
alignment: 'right',
|
|
209
|
+
size: 'md',
|
|
84
210
|
},
|
|
211
|
+
parameters: {
|
|
212
|
+
docs: {
|
|
213
|
+
description: {
|
|
214
|
+
story: 'Right-aligned SectionIntro content.'
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
85
218
|
};
|
|
86
219
|
|
|
87
|
-
// With background image
|
|
88
|
-
export const
|
|
220
|
+
// With background image example
|
|
221
|
+
export const WithBackgroundImage: Story = {
|
|
89
222
|
args: {
|
|
90
|
-
...Default.args,
|
|
91
|
-
backgroundImageSrc:
|
|
92
|
-
'https://images.unsplash.com/photo-1557682250-33bd709cbe85?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80',
|
|
93
|
-
showOverlay: true,
|
|
94
|
-
alignment: 'center',
|
|
95
223
|
title: 'Discover Our Vision',
|
|
96
224
|
label: 'About Us',
|
|
97
225
|
text: 'We are dedicated to creating beautiful, functional, and accessible components that help developers build amazing websites and applications.',
|
|
226
|
+
alignment: 'center',
|
|
227
|
+
size: 'md',
|
|
228
|
+
backgroundImageSrc:
|
|
229
|
+
'https://images.unsplash.com/photo-1557682250-33bd709cbe85?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80',
|
|
230
|
+
showOverlay: true,
|
|
98
231
|
},
|
|
232
|
+
parameters: {
|
|
233
|
+
docs: {
|
|
234
|
+
description: {
|
|
235
|
+
story: 'SectionIntro with a background image and overlay.'
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
99
239
|
};
|
|
100
240
|
|
|
101
|
-
// With image
|
|
102
|
-
export const
|
|
241
|
+
// With foreground image example
|
|
242
|
+
export const WithForegroundImage: Story = {
|
|
103
243
|
args: {
|
|
104
|
-
|
|
244
|
+
title: 'Team Collaboration',
|
|
245
|
+
label: 'Our Team',
|
|
246
|
+
text: 'We are dedicated to creating beautiful, functional, and accessible components that help developers build amazing websites and applications.',
|
|
247
|
+
alignment: 'left',
|
|
248
|
+
size: 'md',
|
|
105
249
|
imageSrc:
|
|
106
250
|
'https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80',
|
|
107
251
|
imageAlt: 'Team collaboration',
|
|
108
252
|
},
|
|
253
|
+
parameters: {
|
|
254
|
+
docs: {
|
|
255
|
+
description: {
|
|
256
|
+
story: 'SectionIntro with a foreground image.'
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
109
260
|
};
|
|
110
261
|
|
|
111
|
-
// Small size
|
|
112
|
-
export const
|
|
262
|
+
// Small size example
|
|
263
|
+
export const SmallSize: Story = {
|
|
113
264
|
args: {
|
|
114
|
-
|
|
265
|
+
title: 'Compact View',
|
|
266
|
+
label: 'Small Size',
|
|
267
|
+
text: 'This is a smaller version of the SectionIntro component.',
|
|
268
|
+
alignment: 'left',
|
|
115
269
|
size: 'sm',
|
|
116
270
|
},
|
|
271
|
+
parameters: {
|
|
272
|
+
docs: {
|
|
273
|
+
description: {
|
|
274
|
+
story: 'Small-sized SectionIntro for compact layouts.'
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
117
278
|
};
|
|
118
279
|
|
|
119
|
-
// Large size
|
|
120
|
-
export const
|
|
280
|
+
// Large size example
|
|
281
|
+
export const LargeSize: Story = {
|
|
121
282
|
args: {
|
|
122
|
-
|
|
283
|
+
title: 'Impressive Header',
|
|
284
|
+
label: 'Large Size',
|
|
285
|
+
text: 'This is a larger version of the SectionIntro component suitable for hero sections and prominent displays.',
|
|
286
|
+
alignment: 'center',
|
|
123
287
|
size: 'lg',
|
|
124
288
|
},
|
|
289
|
+
parameters: {
|
|
290
|
+
docs: {
|
|
291
|
+
description: {
|
|
292
|
+
story: 'Large-sized SectionIntro for prominent displays.'
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
125
296
|
};
|
|
126
297
|
|
|
127
|
-
// Skeleton loading state
|
|
128
|
-
export const
|
|
298
|
+
// Skeleton loading state example
|
|
299
|
+
export const SkeletonLoading: Story = {
|
|
129
300
|
args: {
|
|
130
|
-
|
|
301
|
+
title: 'Loading Content',
|
|
302
|
+
label: 'Please Wait',
|
|
303
|
+
text: 'Content is being loaded...',
|
|
304
|
+
alignment: 'left',
|
|
305
|
+
size: 'md',
|
|
131
306
|
skeleton: true,
|
|
132
307
|
},
|
|
308
|
+
parameters: {
|
|
309
|
+
docs: {
|
|
310
|
+
description: {
|
|
311
|
+
story: 'Skeleton loading state of the SectionIntro component.'
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
133
315
|
};
|
|
134
316
|
|
|
135
|
-
// Full example
|
|
136
|
-
export const
|
|
317
|
+
// Full featured example
|
|
318
|
+
export const FullFeaturedExample: Story = {
|
|
137
319
|
args: {
|
|
138
320
|
title: 'Building the Future Together',
|
|
139
321
|
label: 'Our Vision',
|
|
@@ -143,11 +325,21 @@ export const FullExample: Story = {
|
|
|
143
325
|
backgroundImageSrc:
|
|
144
326
|
'https://images.unsplash.com/photo-1579546929518-9e396f3cc809?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80',
|
|
145
327
|
showOverlay: true,
|
|
328
|
+
imageSrc:
|
|
329
|
+
'https://images.unsplash.com/photo-1468436139062-f6fdfcd1e6cd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80',
|
|
330
|
+
imageAlt: 'Mountain landscape',
|
|
146
331
|
actions: (
|
|
147
|
-
<div className="u-flex u-
|
|
332
|
+
<div className="u-flex u-justify-center u-gap-4">
|
|
148
333
|
<Button label="Get Started" size="lg" />
|
|
149
334
|
<Button label="Learn More" size="lg" variant="secondary" />
|
|
150
335
|
</div>
|
|
151
336
|
),
|
|
152
337
|
},
|
|
153
|
-
|
|
338
|
+
parameters: {
|
|
339
|
+
docs: {
|
|
340
|
+
description: {
|
|
341
|
+
story: 'Full featured SectionIntro with all options enabled.'
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|