@shohojdhara/atomix 0.6.0 → 0.6.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.
@@ -1,215 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { DesignTokensCustomizer } from './DesignTokensCustomizer';
3
- import { useState } from 'react';
4
-
5
- // Enhanced preview components
6
- const PreviewContainer = ({
7
- title,
8
- description,
9
- children,
10
- }: {
11
- title?: string;
12
- description?: string;
13
- children: React.ReactNode;
14
- }) => (
15
- <div className="story-preview-container">
16
- {title && <h3 className="story-preview-title">{title}</h3>}
17
- {description && <p className="story-preview-description">{description}</p>}
18
- <div className="story-preview-content">{children}</div>
19
- </div>
20
- );
21
-
22
- const meta: Meta<typeof DesignTokensCustomizer> = {
23
- title: 'DevTools/DesignTokensCustomizer',
24
- component: DesignTokensCustomizer,
25
- parameters: {
26
- layout: 'fullscreen',
27
- docs: {
28
- description: {
29
- component: 'Interactive design tokens customization tool for real-time theme adjustments.',
30
- },
31
- },
32
- },
33
- };
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof DesignTokensCustomizer>;
37
-
38
- // Basic Usage
39
- export const Default: Story = {
40
- render: () => (
41
- <PreviewContainer
42
- title="Design Tokens Customizer"
43
- description="Interactive tool for customizing design tokens in real-time"
44
- >
45
- <DesignTokensCustomizer />
46
- </PreviewContainer>
47
- ),
48
- parameters: {
49
- docs: {
50
- description: {
51
- story: 'The default design tokens customizer with all standard controls and features.',
52
- },
53
- },
54
- },
55
- };
56
-
57
- // With Custom Configuration
58
- export const WithCustomConfig: Story = {
59
- render: () => {
60
- const customConfig = {
61
- colors: {
62
- primary: '#667eea',
63
- secondary: '#764ba2',
64
- accent: '#f093fb',
65
- },
66
- spacing: {
67
- small: '8px',
68
- medium: '16px',
69
- large: '24px',
70
- },
71
- typography: {
72
- fontFamily: 'Inter, sans-serif',
73
- fontSize: '16px',
74
- fontWeight: '400',
75
- },
76
- };
77
-
78
- return (
79
- <PreviewContainer
80
- title="Custom Configuration"
81
- description="Design tokens customizer with predefined custom configuration"
82
- >
83
- <DesignTokensCustomizer initialConfig={customConfig} />
84
- </PreviewContainer>
85
- );
86
- },
87
- };
88
-
89
- // Theme Preview Mode
90
- export const ThemePreview: Story = {
91
- render: () => (
92
- <PreviewContainer
93
- title="Theme Preview Mode"
94
- description="Customizer with live theme preview components"
95
- >
96
- <div className="theme-preview-layout">
97
- <div className="customizer-panel">
98
- <DesignTokensCustomizer />
99
- </div>
100
- <div className="preview-panel">
101
- <div className="preview-components">
102
- <button className="preview-button">Primary Button</button>
103
- <button className="preview-button secondary">Secondary Button</button>
104
- <div className="preview-card">
105
- <h3>Preview Card</h3>
106
- <p>This card updates in real-time with your token changes.</p>
107
- <input className="preview-input" placeholder="Type to see styling" />
108
- </div>
109
- <div className="preview-colors">
110
- <div className="color-swatch primary"></div>
111
- <div className="color-swatch secondary"></div>
112
- <div className="color-swatch accent"></div>
113
- </div>
114
- </div>
115
- </div>
116
- </div>
117
- </PreviewContainer>
118
- ),
119
- parameters: {
120
- viewport: {
121
- viewports: {
122
- desktop: {
123
- name: 'Desktop',
124
- styles: { width: '1200px', height: '800px' },
125
- },
126
- },
127
- defaultViewport: 'desktop',
128
- },
129
- },
130
- };
131
-
132
- // Compact Mode
133
- export const Compact: Story = {
134
- render: () => (
135
- <PreviewContainer
136
- title="Compact Mode"
137
- description="Space-efficient customizer for smaller screens"
138
- >
139
- <DesignTokensCustomizer compact={true} />
140
- </PreviewContainer>
141
- ),
142
- parameters: {
143
- viewport: {
144
- viewports: {
145
- mobile: {
146
- name: 'Mobile',
147
- styles: { width: '375px', height: '667px' },
148
- },
149
- },
150
- defaultViewport: 'mobile',
151
- },
152
- },
153
- };
154
-
155
- // With Export Options
156
- export const WithExport: Story = {
157
- render: () => {
158
- const [exportData, setExportData] = useState('');
159
-
160
- const handleExport = (tokens: any) => {
161
- setExportData(JSON.stringify(tokens, null, 2));
162
- };
163
-
164
- return (
165
- <PreviewContainer
166
- title="With Export Options"
167
- description="Customizer with export functionality for sharing themes"
168
- >
169
- <div className="export-workflow">
170
- <DesignTokensCustomizer onExport={handleExport} />
171
- {exportData && (
172
- <div className="export-output">
173
- <h4>Exported Theme Data:</h4>
174
- <pre>{exportData}</pre>
175
- <button
176
- onClick={() => navigator.clipboard.writeText(exportData)}
177
- className="copy-button"
178
- >
179
- Copy to Clipboard
180
- </button>
181
- </div>
182
- )}
183
- </div>
184
- </PreviewContainer>
185
- );
186
- },
187
- };
188
-
189
- // Interactive Tutorial
190
- export const InteractiveTutorial: Story = {
191
- render: () => (
192
- <PreviewContainer
193
- title="Interactive Tutorial"
194
- description="Guided tour of the design tokens customizer features"
195
- >
196
- <div className="tutorial-container">
197
- <div className="tutorial-steps">
198
- <div className="tutorial-step active">
199
- <h4>Step 1: Explore Color Tokens</h4>
200
- <p>Click on the Colors section to customize your primary and secondary colors.</p>
201
- </div>
202
- <div className="tutorial-step">
203
- <h4>Step 2: Adjust Typography</h4>
204
- <p>Modify font sizes, weights, and line heights for better readability.</p>
205
- </div>
206
- <div className="tutorial-step">
207
- <h4>Step 3: Configure Spacing</h4>
208
- <p>Set consistent spacing values for margins and padding.</p>
209
- </div>
210
- </div>
211
- <DesignTokensCustomizer />
212
- </div>
213
- </PreviewContainer>
214
- ),
215
- };