@shohojdhara/atomix 0.5.0 → 0.5.2
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/atomix.config.ts +12 -0
- package/build-tools/webpack-loader.js +5 -4
- package/dist/atomix.css +230 -83
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/webpack-loader.js +5 -4
- package/dist/charts.d.ts +24 -23
- package/dist/charts.js +271 -369
- package/dist/charts.js.map +1 -1
- package/dist/config.d.ts +624 -0
- package/dist/config.js +59 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +3 -2
- package/dist/core.js +342 -382
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +4 -6
- package/dist/forms.js +233 -334
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +11 -2
- package/dist/heavy.js +406 -445
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +109 -65
- package/dist/index.esm.js +654 -748
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +621 -717
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js +59 -60
- package/dist/layout.js.map +1 -1
- package/dist/theme.js +4 -4
- package/dist/theme.js.map +1 -1
- package/package.json +24 -9
- package/scripts/atomix-cli.js +15 -1
- package/scripts/cli/__tests__/complexity-utils.test.js +24 -0
- package/scripts/cli/__tests__/detector.test.js +50 -0
- package/scripts/cli/__tests__/template-engine.test.js +23 -0
- package/scripts/cli/__tests__/test-setup.js +1 -133
- package/scripts/cli/commands/doctor.js +15 -3
- package/scripts/cli/commands/generate.js +113 -51
- package/scripts/cli/internal/ai-engine.js +30 -10
- package/scripts/cli/internal/complexity-utils.js +60 -0
- package/scripts/cli/internal/component-validator.js +49 -16
- package/scripts/cli/internal/generator.js +89 -36
- package/scripts/cli/internal/hook-generator.js +5 -2
- package/scripts/cli/internal/itcss-generator.js +16 -12
- package/scripts/cli/templates/next-templates.js +81 -30
- package/scripts/cli/templates/storybook-templates.js +12 -2
- package/scripts/cli/utils/detector.js +45 -7
- package/scripts/cli/utils/diagnostics.js +78 -0
- package/scripts/cli/utils/telemetry.js +13 -0
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +188 -128
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +63 -91
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +153 -201
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +9 -6
- package/src/components/AtomixGlass/glass-utils.ts +51 -1
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +52 -46
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +573 -236
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +88 -41
- package/src/components/AtomixGlass/stories/argTypes.ts +19 -19
- package/src/components/AtomixGlass/stories/shared-components.tsx +7 -12
- package/src/components/AtomixGlass/stories/types.ts +3 -3
- package/src/components/Button/Button.tsx +114 -57
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +11 -8
- package/src/components/EdgePanel/EdgePanel.tsx +119 -115
- package/src/components/Form/Select.tsx +4 -4
- package/src/components/List/List.tsx +4 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +6 -6
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +4 -2
- package/src/components/Rating/Rating.tsx +4 -2
- package/src/components/SectionIntro/SectionIntro.tsx +4 -2
- package/src/components/Steps/Steps.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Testimonial/Testimonial.tsx +4 -2
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/layouts/CssGrid/CssGrid.stories.tsx +464 -0
- package/src/layouts/CssGrid/CssGrid.tsx +215 -0
- package/src/layouts/CssGrid/index.ts +8 -0
- package/src/layouts/CssGrid/scripts/CssGrid.js +284 -0
- package/src/layouts/CssGrid/scripts/index.js +43 -0
- package/src/layouts/Grid/scripts/Container.js +139 -0
- package/src/layouts/Grid/scripts/Grid.js +184 -0
- package/src/layouts/Grid/scripts/GridCol.js +273 -0
- package/src/layouts/Grid/scripts/Row.js +154 -0
- package/src/layouts/Grid/scripts/index.js +48 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +71 -59
- package/src/lib/composables/atomix-glass/useGlassSize.ts +1 -1
- package/src/lib/composables/useAccordion.ts +5 -5
- package/src/lib/composables/useAtomixGlass.ts +111 -74
- package/src/lib/composables/useAtomixGlassStyles.ts +0 -2
- package/src/lib/composables/useBarChart.ts +2 -2
- package/src/lib/composables/useChart.ts +3 -2
- package/src/lib/composables/useChartToolbar.ts +48 -66
- package/src/lib/composables/useDataTable.ts +1 -1
- package/src/lib/composables/useDatePicker.ts +2 -2
- package/src/lib/composables/useEdgePanel.ts +45 -54
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -5
- package/src/lib/composables/usePhotoViewer.ts +2 -3
- package/src/lib/composables/usePieChart.ts +1 -1
- package/src/lib/composables/usePopover.ts +151 -139
- package/src/lib/composables/useSideMenu.ts +28 -41
- package/src/lib/composables/useSlider.ts +2 -6
- package/src/lib/composables/useTooltip.ts +2 -2
- package/src/lib/config/index.ts +39 -0
- package/src/lib/constants/components.ts +1 -0
- package/src/lib/theme/devtools/Comparator.tsx +1 -1
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +1 -1
- package/src/lib/theme/runtime/ThemeProvider.tsx +1 -1
- package/src/lib/types/components.ts +1 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.atomix-glass.scss +174 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +42 -6
- package/src/styles/02-tools/_tools.glass.scss +6 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +162 -24
- package/src/styles/06-components/_components.atomix-glass.scss +160 -99
- package/scripts/cli/__tests__/README.md +0 -81
- package/scripts/cli/__tests__/basic.test.js +0 -116
- package/scripts/cli/__tests__/clean.test.js +0 -278
- package/scripts/cli/__tests__/component-generator.test.js +0 -332
- package/scripts/cli/__tests__/component-validator.test.js +0 -433
- package/scripts/cli/__tests__/generator.test.js +0 -613
- package/scripts/cli/__tests__/glass-motion.test.js +0 -256
- package/scripts/cli/__tests__/integration.test.js +0 -938
- package/scripts/cli/__tests__/migrate.test.js +0 -74
- package/scripts/cli/__tests__/security.test.js +0 -206
- package/scripts/cli/__tests__/theme-bridge.test.js +0 -507
- package/scripts/cli/__tests__/token-manager.test.js +0 -251
- package/scripts/cli/__tests__/token-provider.test.js +0 -361
- package/scripts/cli/__tests__/utils.test.js +0 -165
- package/src/components/AtomixGlass/stories/AnimationTests.stories.tsx +0 -95
- package/src/components/AtomixGlass/stories/CardExamples.stories.tsx +0 -212
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +0 -131
- package/src/components/AtomixGlass/stories/DashboardExamples.stories.tsx +0 -348
- package/src/components/AtomixGlass/stories/EcommerceExamples.stories.tsx +0 -410
- package/src/components/AtomixGlass/stories/FormExamples.stories.tsx +0 -436
- package/src/components/AtomixGlass/stories/HeroExamples.stories.tsx +0 -264
- package/src/components/AtomixGlass/stories/InteractivePlayground.stories.tsx +0 -247
- package/src/components/AtomixGlass/stories/MobileUIExamples.stories.tsx +0 -418
- package/src/components/AtomixGlass/stories/ModalExamples.stories.tsx +0 -402
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +0 -1082
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +0 -497
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +0 -103
- package/src/components/AtomixGlass/stories/PresetGallery.stories.tsx +0 -335
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +0 -395
- package/src/components/AtomixGlass/stories/WidgetExamples.stories.tsx +0 -441
- package/src/components/TypedButton/TypedButton.stories.tsx +0 -59
- package/src/components/TypedButton/TypedButton.tsx +0 -39
- package/src/components/TypedButton/index.ts +0 -2
- package/src/lib/composables/useBreadcrumb.ts +0 -81
- package/src/lib/composables/useChartInteractions.ts +0 -123
- package/src/lib/composables/useChartPerformance.ts +0 -347
- package/src/lib/composables/useDropdown.ts +0 -338
- package/src/lib/composables/useModal.ts +0 -110
- package/src/lib/composables/useTypedButton.ts +0 -66
- package/src/lib/hooks/usePerformanceMonitor.ts +0 -148
- package/src/lib/utils/displacement-generator.ts +0 -92
- package/src/lib/utils/memoryMonitor.ts +0 -191
- package/src/styles/01-settings/_settings.testtypecheck.scss +0 -53
- package/src/styles/01-settings/_settings.typedbutton.scss +0 -53
- package/src/styles/06-components/_components.testbutton.scss +0 -212
- package/src/styles/06-components/_components.testtypecheck.scss +0 -212
- package/src/styles/06-components/_components.typedbutton.scss +0 -212
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Utilities Tests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
6
|
-
import {
|
|
7
|
-
validatePath,
|
|
8
|
-
validateComponentName,
|
|
9
|
-
validateThemeName,
|
|
10
|
-
sanitizeInput,
|
|
11
|
-
fileExists,
|
|
12
|
-
AtomixCLIError
|
|
13
|
-
} from '../utils.js';
|
|
14
|
-
import { mkdtemp, rm, writeFile } from 'fs/promises';
|
|
15
|
-
import { join } from 'path';
|
|
16
|
-
import { tmpdir } from 'os';
|
|
17
|
-
|
|
18
|
-
describe('CLI Utils', () => {
|
|
19
|
-
let tempDir;
|
|
20
|
-
|
|
21
|
-
beforeEach(async () => {
|
|
22
|
-
tempDir = await mkdtemp(join(tmpdir(), 'atomix-test-'));
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
afterEach(async () => {
|
|
26
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('validatePath', () => {
|
|
30
|
-
it('should accept valid relative paths', () => {
|
|
31
|
-
const result = validatePath('./src/components', tempDir);
|
|
32
|
-
expect(result.isValid).toBe(true);
|
|
33
|
-
expect(result.safePath != null ? result.safePath : '').toMatch(/src\/components/);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should reject paths outside project directory', () => {
|
|
37
|
-
const result = validatePath('../../etc/passwd', tempDir);
|
|
38
|
-
expect(result.isValid).toBe(false);
|
|
39
|
-
expect(result.error).toMatch(/outside|traversal/);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should reject sensitive files', () => {
|
|
43
|
-
const result = validatePath('.env', tempDir);
|
|
44
|
-
expect(result.isValid).toBe(false);
|
|
45
|
-
expect(result.error).toContain('sensitive path');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should handle absolute paths within project', () => {
|
|
49
|
-
const validPath = join(tempDir, 'src', 'components');
|
|
50
|
-
const result = validatePath(validPath, tempDir);
|
|
51
|
-
expect(result.isValid).toBe(true);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should normalize paths correctly', () => {
|
|
55
|
-
const result = validatePath('./src/../src/components', tempDir);
|
|
56
|
-
expect(result.isValid).toBe(true);
|
|
57
|
-
expect(result.safePath != null ? result.safePath : '').toMatch(/src\/components/);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('validateComponentName', () => {
|
|
62
|
-
it('should accept valid PascalCase names', () => {
|
|
63
|
-
const validNames = ['Button', 'CardHeader', 'ModalDialog', 'FormInput'];
|
|
64
|
-
|
|
65
|
-
validNames.forEach(name => {
|
|
66
|
-
const result = validateComponentName(name);
|
|
67
|
-
expect(result.isValid).toBe(true);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should reject invalid names', () => {
|
|
72
|
-
const invalidNames = ['123Button', '', '1', 'Component', 'React'];
|
|
73
|
-
|
|
74
|
-
invalidNames.forEach(name => {
|
|
75
|
-
const result = validateComponentName(name);
|
|
76
|
-
expect(result.isValid).toBe(false);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should reject reserved words', () => {
|
|
81
|
-
const reservedWords = ['Component', 'React', 'Fragment', 'Suspense'];
|
|
82
|
-
|
|
83
|
-
reservedWords.forEach(name => {
|
|
84
|
-
const result = validateComponentName(name);
|
|
85
|
-
expect(result.isValid).toBe(false);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
describe('validateThemeName', () => {
|
|
91
|
-
it('should accept valid kebab-case names', () => {
|
|
92
|
-
const validNames = ['dark-theme', 'light', 'high-contrast', 'custom-brand'];
|
|
93
|
-
|
|
94
|
-
validNames.forEach(name => {
|
|
95
|
-
const result = validateThemeName(name);
|
|
96
|
-
expect(result.isValid).toBe(true);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should reject invalid theme names', () => {
|
|
101
|
-
const invalidNames = ['DarkTheme', 'theme_dark', 'Theme-Dark', '123theme', ''];
|
|
102
|
-
|
|
103
|
-
invalidNames.forEach(name => {
|
|
104
|
-
const result = validateThemeName(name);
|
|
105
|
-
expect(result.isValid).toBe(false);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe('sanitizeInput', () => {
|
|
111
|
-
it('should remove dangerous shell characters', () => {
|
|
112
|
-
const dangerousInputs = [
|
|
113
|
-
'test; rm -rf /',
|
|
114
|
-
'input && malicious-command',
|
|
115
|
-
'command | pipe',
|
|
116
|
-
'`substitution`',
|
|
117
|
-
'$(command)',
|
|
118
|
-
'input > /dev/null',
|
|
119
|
-
'"quoted"',
|
|
120
|
-
"'singlequoted'",
|
|
121
|
-
'" $(whoami) "',
|
|
122
|
-
"' ; rm -rf / '"
|
|
123
|
-
];
|
|
124
|
-
|
|
125
|
-
dangerousInputs.forEach(input => {
|
|
126
|
-
const sanitized = sanitizeInput(input);
|
|
127
|
-
expect(sanitized).not.toMatch(/[;&|`$<>\\"']/);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('should preserve safe characters', () => {
|
|
132
|
-
const safeInput = 'Button-Component_123';
|
|
133
|
-
const sanitized = sanitizeInput(safeInput);
|
|
134
|
-
expect(sanitized).toBe(safeInput);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
describe('fileExists', () => {
|
|
139
|
-
it('should return true for existing files', async () => {
|
|
140
|
-
const testFile = join(tempDir, 'test.txt');
|
|
141
|
-
await writeFile(testFile, 'test content');
|
|
142
|
-
|
|
143
|
-
const exists = await fileExists(testFile);
|
|
144
|
-
expect(exists).toBe(true);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it('should return false for non-existing files', async () => {
|
|
148
|
-
const nonExistent = join(tempDir, 'nonexistent.txt');
|
|
149
|
-
const exists = await fileExists(nonExistent);
|
|
150
|
-
expect(exists).toBe(false);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
describe('AtomixCLIError', () => {
|
|
155
|
-
it('should create error with code and suggestions', () => {
|
|
156
|
-
const suggestions = ['Use PascalCase', 'Start with letter'];
|
|
157
|
-
const error = new AtomixCLIError('Invalid name', 'INVALID_NAME', suggestions);
|
|
158
|
-
|
|
159
|
-
expect(error.message).toBe('Invalid name');
|
|
160
|
-
expect(error.code).toBe('INVALID_NAME');
|
|
161
|
-
expect(error.suggestions).toEqual(suggestions);
|
|
162
|
-
expect(error.name).toBe('AtomixCLIError');
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Quick Test Story for Phase 1 Animations
|
|
3
|
-
*
|
|
4
|
-
* This is a minimal test to verify the animation pipeline is working
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
-
import { AtomixGlass } from '../AtomixGlass';
|
|
9
|
-
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Testing/Phase 1 Animation Quick Test',
|
|
12
|
-
component: AtomixGlass,
|
|
13
|
-
parameters: {
|
|
14
|
-
layout: 'centered',
|
|
15
|
-
},
|
|
16
|
-
tags: ['!autodocs'], // Exclude from production docs - test stories only
|
|
17
|
-
argTypes: {
|
|
18
|
-
withTimeAnimation: { control: 'boolean' },
|
|
19
|
-
animationSpeed: { control: { type: 'range', min: 0.1, max: 5.0, step: 0.1 } },
|
|
20
|
-
distortionOctaves: { control: { type: 'range', min: 1, max: 8, step: 1 } },
|
|
21
|
-
distortionQuality: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['low', 'medium', 'high', 'ultra']
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
} satisfies Meta<typeof AtomixGlass>;
|
|
27
|
-
|
|
28
|
-
export default meta;
|
|
29
|
-
type Story = StoryObj<typeof meta>;
|
|
30
|
-
|
|
31
|
-
// Default test with animations enabled
|
|
32
|
-
export const Animated: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
children: (
|
|
35
|
-
<div style={{ padding: '40px', color: 'white', textAlign: 'center' }}>
|
|
36
|
-
<h2>Phase 1 Animation Test</h2>
|
|
37
|
-
<p>If you see flowing liquid glass effects, it's working!</p>
|
|
38
|
-
</div>
|
|
39
|
-
),
|
|
40
|
-
mode: 'shader',
|
|
41
|
-
withTimeAnimation: true,
|
|
42
|
-
animationSpeed: 1.0,
|
|
43
|
-
distortionOctaves: 4,
|
|
44
|
-
distortionQuality: 'high',
|
|
45
|
-
displacementScale: 30,
|
|
46
|
-
blurAmount: 8,
|
|
47
|
-
saturation: 180,
|
|
48
|
-
aberrationIntensity: 3,
|
|
49
|
-
// Dark background to make effects visible
|
|
50
|
-
style: {
|
|
51
|
-
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// Comparison: Same config without animations
|
|
57
|
-
export const Static: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
...Animated.args,
|
|
60
|
-
withTimeAnimation: false,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Speed comparison
|
|
65
|
-
export const FastAnimation: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
...Animated.args,
|
|
68
|
-
animationSpeed: 3.0,
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const SlowAnimation: Story = {
|
|
73
|
-
args: {
|
|
74
|
-
...Animated.args,
|
|
75
|
-
animationSpeed: 0.3,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// High complexity FBM
|
|
80
|
-
export const HighDetailFBM: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
...Animated.args,
|
|
83
|
-
distortionOctaves: 7,
|
|
84
|
-
distortionQuality: 'ultra',
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// Mobile optimized (low quality)
|
|
89
|
-
export const MobileOptimized: Story = {
|
|
90
|
-
args: {
|
|
91
|
-
...Animated.args,
|
|
92
|
-
distortionOctaves: 2,
|
|
93
|
-
distortionQuality: 'low',
|
|
94
|
-
},
|
|
95
|
-
};
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CardExamples.stories.tsx
|
|
3
|
-
*
|
|
4
|
-
* Card-based layouts and content containers using AtomixGlass.
|
|
5
|
-
* Perfect for dashboards, profiles, and content grids.
|
|
6
|
-
*
|
|
7
|
-
* @package Atomix
|
|
8
|
-
* @component AtomixGlass
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
12
|
-
import AtomixGlass from '../AtomixGlass';
|
|
13
|
-
import { BackgroundWrapper, backgroundImages, StoryErrorBoundary } from './shared-components';
|
|
14
|
-
import { baseArgTypes } from './argTypes';
|
|
15
|
-
|
|
16
|
-
import { Button } from '../../Button';
|
|
17
|
-
import { Badge } from '../../Badge';
|
|
18
|
-
import { Avatar } from '../../Avatar';
|
|
19
|
-
import { Icon } from '../../Icon/Icon';
|
|
20
|
-
|
|
21
|
-
const meta: Meta<typeof AtomixGlass> = {
|
|
22
|
-
title: 'Components/AtomixGlass/Examples/Card Examples',
|
|
23
|
-
component: AtomixGlass,
|
|
24
|
-
parameters: {
|
|
25
|
-
layout: 'centered',
|
|
26
|
-
docs: {
|
|
27
|
-
description: {
|
|
28
|
-
component:
|
|
29
|
-
'Card-based examples demonstrating AtomixGlass for content containers, profiles, and dashboard elements.',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
tags: ['!autodocs'],
|
|
34
|
-
argTypes: {
|
|
35
|
-
...baseArgTypes,
|
|
36
|
-
children: { control: false },
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export default meta;
|
|
41
|
-
type Story = StoryObj<typeof AtomixGlass>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Profile Card
|
|
45
|
-
*
|
|
46
|
-
* User profile card with avatar and social links.
|
|
47
|
-
*/
|
|
48
|
-
export const ProfileCard: Story = {
|
|
49
|
-
render: () => (
|
|
50
|
-
<StoryErrorBoundary>
|
|
51
|
-
<BackgroundWrapper backgroundImage={backgroundImages[1]} overlay overlayOpacity={0.3}>
|
|
52
|
-
<div style={{ maxWidth: '400px' }}>
|
|
53
|
-
<AtomixGlass
|
|
54
|
-
displacementScale={70}
|
|
55
|
-
blurAmount={0.5}
|
|
56
|
-
saturation={140}
|
|
57
|
-
borderRadius={24}
|
|
58
|
-
mode="standard"
|
|
59
|
-
padding="32px"
|
|
60
|
-
>
|
|
61
|
-
<div className="u-text-center u-text-white">
|
|
62
|
-
<Avatar
|
|
63
|
-
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop"
|
|
64
|
-
alt="User avatar"
|
|
65
|
-
size="xl"
|
|
66
|
-
className="u-mb-4"
|
|
67
|
-
/>
|
|
68
|
-
<h3 className="u-mt-0 u-text-xl u-font-bold u-mb-2">Sarah Johnson</h3>
|
|
69
|
-
<p className="u-text-sm u-opacity-90 u-mb-4">Senior Product Designer</p>
|
|
70
|
-
<Badge variant="secondary" className="u-mb-4">
|
|
71
|
-
Available for hire
|
|
72
|
-
</Badge>
|
|
73
|
-
<div className="u-flex u-gap-2 u-justify-center u-flex-wrap" style={{ gap: '12px' }}>
|
|
74
|
-
<Button glass size="sm" variant="primary">
|
|
75
|
-
Follow
|
|
76
|
-
</Button>
|
|
77
|
-
<Button glass size="sm" variant="outline-light">
|
|
78
|
-
Message
|
|
79
|
-
</Button>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</AtomixGlass>
|
|
83
|
-
</div>
|
|
84
|
-
</BackgroundWrapper>
|
|
85
|
-
</StoryErrorBoundary>
|
|
86
|
-
),
|
|
87
|
-
parameters: {
|
|
88
|
-
docs: {
|
|
89
|
-
description: {
|
|
90
|
-
story: 'User profile card with avatar, badges, and action buttons.',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Stats Card
|
|
98
|
-
*
|
|
99
|
-
* Dashboard statistics card with icon and metrics.
|
|
100
|
-
*/
|
|
101
|
-
export const StatsCard: Story = {
|
|
102
|
-
render: () => (
|
|
103
|
-
<StoryErrorBoundary>
|
|
104
|
-
<BackgroundWrapper backgroundImage={backgroundImages[3]}>
|
|
105
|
-
<div style={{ maxWidth: '320px' }}>
|
|
106
|
-
<AtomixGlass
|
|
107
|
-
displacementScale={60}
|
|
108
|
-
blurAmount={0.4}
|
|
109
|
-
saturation={130}
|
|
110
|
-
borderRadius={20}
|
|
111
|
-
mode="standard"
|
|
112
|
-
padding="28px"
|
|
113
|
-
>
|
|
114
|
-
<div className="u-text-white">
|
|
115
|
-
<div className="u-flex u-items-center u-justify-between u-mb-3">
|
|
116
|
-
<div
|
|
117
|
-
style={{
|
|
118
|
-
width: '48px',
|
|
119
|
-
height: '48px',
|
|
120
|
-
borderRadius: '12px',
|
|
121
|
-
background: 'rgba(99, 102, 241, 0.2)',
|
|
122
|
-
display: 'flex',
|
|
123
|
-
alignItems: 'center',
|
|
124
|
-
justifyContent: 'center',
|
|
125
|
-
fontSize: '24px',
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
📊
|
|
129
|
-
</div>
|
|
130
|
-
<Badge variant="success">+12.5%</Badge>
|
|
131
|
-
</div>
|
|
132
|
-
<p className="u-text-sm u-opacity-80 u-mb-1">Total Revenue</p>
|
|
133
|
-
<h3 className="u-mt-0 u-text-3xl u-font-bold u-mb-2">$48,295</h3>
|
|
134
|
-
<p className="u-text-xs u-opacity-70">Compared to $42,890 last month</p>
|
|
135
|
-
</div>
|
|
136
|
-
</AtomixGlass>
|
|
137
|
-
</div>
|
|
138
|
-
</BackgroundWrapper>
|
|
139
|
-
</StoryErrorBoundary>
|
|
140
|
-
),
|
|
141
|
-
parameters: {
|
|
142
|
-
docs: {
|
|
143
|
-
description: {
|
|
144
|
-
story: 'Dashboard statistics card displaying metrics with trend indicators.',
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Content Card
|
|
152
|
-
*
|
|
153
|
-
* Blog post or article preview card.
|
|
154
|
-
*/
|
|
155
|
-
export const ContentCard: Story = {
|
|
156
|
-
render: () => (
|
|
157
|
-
<StoryErrorBoundary>
|
|
158
|
-
<BackgroundWrapper backgroundImage={backgroundImages[6]}>
|
|
159
|
-
<div style={{ maxWidth: '420px' }}>
|
|
160
|
-
<AtomixGlass
|
|
161
|
-
displacementScale={65}
|
|
162
|
-
blurAmount={0.5}
|
|
163
|
-
saturation={135}
|
|
164
|
-
borderRadius={20}
|
|
165
|
-
mode="standard"
|
|
166
|
-
padding="0"
|
|
167
|
-
>
|
|
168
|
-
<div className="u-text-white">
|
|
169
|
-
<div
|
|
170
|
-
style={{
|
|
171
|
-
height: '200px',
|
|
172
|
-
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
173
|
-
borderRadius: '20px 20px 0 0',
|
|
174
|
-
display: 'flex',
|
|
175
|
-
alignItems: 'center',
|
|
176
|
-
justifyContent: 'center',
|
|
177
|
-
fontSize: '64px',
|
|
178
|
-
}}
|
|
179
|
-
aria-hidden="true"
|
|
180
|
-
>
|
|
181
|
-
🎨
|
|
182
|
-
</div>
|
|
183
|
-
<div style={{ padding: '24px' }}>
|
|
184
|
-
<div className="u-flex u-items-center u-gap-2 u-mb-3">
|
|
185
|
-
<Badge variant="primary">Design</Badge>
|
|
186
|
-
<span className="u-text-xs u-opacity-70">5 min read</span>
|
|
187
|
-
</div>
|
|
188
|
-
<h3 className="u-mt-0 u-text-xl u-font-bold u-mb-2">
|
|
189
|
-
The Future of Glass Morphism in UI Design
|
|
190
|
-
</h3>
|
|
191
|
-
<p className="u-text-sm u-opacity-80 u-line-height-relaxed u-mb-4">
|
|
192
|
-
Exploring how glass morphism continues to shape modern interface design trends
|
|
193
|
-
and user expectations.
|
|
194
|
-
</p>
|
|
195
|
-
<Button glass size="sm" variant="outline-light" className="u-w-full">
|
|
196
|
-
Read Article
|
|
197
|
-
</Button>
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
200
|
-
</AtomixGlass>
|
|
201
|
-
</div>
|
|
202
|
-
</BackgroundWrapper>
|
|
203
|
-
</StoryErrorBoundary>
|
|
204
|
-
),
|
|
205
|
-
parameters: {
|
|
206
|
-
docs: {
|
|
207
|
-
description: {
|
|
208
|
-
story: 'Content card for blog posts or articles with category badge and call-to-action.',
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Customization.stories.tsx
|
|
3
|
-
*
|
|
4
|
-
* Stories showcasing customization options and integration with other components.
|
|
5
|
-
*
|
|
6
|
-
* @package Atomix
|
|
7
|
-
* @component AtomixGlass
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
12
|
-
import AtomixGlass from '../AtomixGlass';
|
|
13
|
-
import Button from '../../Button/Button';
|
|
14
|
-
import Badge from '../../Badge/Badge';
|
|
15
|
-
import { BackgroundWrapper, backgroundImages } from './shared-components';
|
|
16
|
-
import { Icon } from '../../Icon/Icon'; // Assuming Icon is used or might be useful, added from Examples
|
|
17
|
-
|
|
18
|
-
const meta: Meta<typeof AtomixGlass> = {
|
|
19
|
-
title: 'Components/AtomixGlass/Features/Customization',
|
|
20
|
-
component: AtomixGlass,
|
|
21
|
-
parameters: {
|
|
22
|
-
layout: 'fullscreen',
|
|
23
|
-
docs: {
|
|
24
|
-
description: {
|
|
25
|
-
component:
|
|
26
|
-
'Examples of how to customize AtomixGlass with styles and integrate it with other Atomix components.',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default meta;
|
|
33
|
-
type Story = StoryObj<typeof AtomixGlass>;
|
|
34
|
-
|
|
35
|
-
export const WithCustomStyling: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
children: (
|
|
38
|
-
<div className="u-text-center">
|
|
39
|
-
<h2 className="u-text-4 u-font-semibold u-mb-4 u-text-white">Custom Styled Glass</h2>
|
|
40
|
-
<p className="u-text-base u-mb-6 u-text-white">
|
|
41
|
-
This glass uses custom styling properties.
|
|
42
|
-
</p>
|
|
43
|
-
<Button
|
|
44
|
-
variant="primary"
|
|
45
|
-
className="u-rounded-lg u-py-3 u-px-6"
|
|
46
|
-
style={{ boxShadow: '0 5px 15px rgba(0,0,0,0.2)' }}
|
|
47
|
-
>
|
|
48
|
-
Premium Effect
|
|
49
|
-
</Button>
|
|
50
|
-
</div>
|
|
51
|
-
),
|
|
52
|
-
displacementScale: 70,
|
|
53
|
-
blurAmount: 0.4,
|
|
54
|
-
saturation: 160,
|
|
55
|
-
aberrationIntensity: 1.8,
|
|
56
|
-
borderRadius: 30,
|
|
57
|
-
padding: '40px',
|
|
58
|
-
style: {
|
|
59
|
-
width: '100%',
|
|
60
|
-
maxWidth: '400px',
|
|
61
|
-
margin: '0 auto',
|
|
62
|
-
boxShadow: '0 10px 30px rgba(0,0,0,0.3)',
|
|
63
|
-
transition: 'transform 0.3s ease-in-out',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
render: args => (
|
|
67
|
-
<BackgroundWrapper backgroundImage={backgroundImages[2]}>
|
|
68
|
-
<div className="u-flex u-justify-center u-items-center u-w-full u-h-full">
|
|
69
|
-
<AtomixGlass {...args} />
|
|
70
|
-
</div>
|
|
71
|
-
</BackgroundWrapper>
|
|
72
|
-
),
|
|
73
|
-
parameters: {
|
|
74
|
-
docs: {
|
|
75
|
-
description: {
|
|
76
|
-
story:
|
|
77
|
-
'Shows how to customize the AtomixGlass component with additional CSS styles and enhanced interactivity.',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const WithOtherComponents: Story = {
|
|
84
|
-
parameters: {
|
|
85
|
-
docs: {
|
|
86
|
-
description: {
|
|
87
|
-
story:
|
|
88
|
-
'Demonstrates how AtomixGlass integrates with other components in the design system.',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
render: () => {
|
|
93
|
-
return (
|
|
94
|
-
<BackgroundWrapper backgroundImage={backgroundImages[0]}>
|
|
95
|
-
<div className="u-flex u-items-center u-justify-center u-w-full u-h-full">
|
|
96
|
-
<AtomixGlass
|
|
97
|
-
displacementScale={85}
|
|
98
|
-
blurAmount={0.6}
|
|
99
|
-
saturation={170}
|
|
100
|
-
aberrationIntensity={2.2}
|
|
101
|
-
elasticity={0.18}
|
|
102
|
-
borderRadius={28}
|
|
103
|
-
padding="36px"
|
|
104
|
-
className="u-w-11/12 u-max-w-2xl"
|
|
105
|
-
>
|
|
106
|
-
<div className="u-mb-6">
|
|
107
|
-
<h2 className="u-m-0 u-text-white u-text-28 u-mb-2">Integrated UI</h2>
|
|
108
|
-
<p className="u-m-0 u-text-white u-opacity-90">
|
|
109
|
-
Glass effect with multiple components
|
|
110
|
-
</p>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<div className="u-flex u-flex-col u-gap-4 u-items-center">
|
|
114
|
-
<Button variant="primary" glass className="u-w-full">
|
|
115
|
-
Primary Action
|
|
116
|
-
</Button>
|
|
117
|
-
<Button variant="secondary" glass className="u-w-full">
|
|
118
|
-
Secondary Action
|
|
119
|
-
</Button>
|
|
120
|
-
|
|
121
|
-
<div className="u-flex u-gap-3 u-mt-4">
|
|
122
|
-
<Badge variant="success" label="Success" glass />
|
|
123
|
-
<Badge variant="warning" label="Warning" glass />
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</AtomixGlass>
|
|
127
|
-
</div>
|
|
128
|
-
</BackgroundWrapper>
|
|
129
|
-
);
|
|
130
|
-
},
|
|
131
|
-
};
|