agnosticui-cli 2.0.0-alpha.2 → 2.0.0-alpha.21
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/README.md +124 -1170
- package/dist/cli.js +70 -28
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +25 -34
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +243 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +145 -110
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.js +4 -4
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/playbook.d.ts +3 -0
- package/dist/commands/playbook.d.ts.map +1 -0
- package/dist/commands/playbook.js +189 -0
- package/dist/commands/playbook.js.map +1 -0
- package/dist/commands/remove.js +2 -2
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/storybook.d.ts +3 -0
- package/dist/commands/storybook.d.ts.map +1 -0
- package/dist/commands/storybook.js +144 -0
- package/dist/commands/storybook.js.map +1 -0
- package/dist/commands/sync.d.ts +1 -4
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +41 -33
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/view.d.ts +3 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +109 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/types/index.d.ts +24 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +3 -0
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/npm.d.ts +13 -0
- package/dist/utils/npm.d.ts.map +1 -0
- package/dist/utils/npm.js +62 -0
- package/dist/utils/npm.js.map +1 -0
- package/dist/utils/stories.d.ts +11 -0
- package/dist/utils/stories.d.ts.map +1 -0
- package/dist/utils/stories.js +661 -0
- package/dist/utils/stories.js.map +1 -0
- package/dist/utils/viewer.d.ts +4 -0
- package/dist/utils/viewer.d.ts.map +1 -0
- package/dist/utils/viewer.js +1067 -0
- package/dist/utils/viewer.js.map +1 -0
- package/package.json +7 -5
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Component classification sets
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
const TEXT_CHILD_COMPONENTS = new Set([
|
|
5
|
+
'Alert', 'Badge', 'BadgeFx', 'Button', 'ButtonFx', 'Card',
|
|
6
|
+
'Kbd', 'Link', 'Mark', 'MessageBubble', 'Tag',
|
|
7
|
+
]);
|
|
8
|
+
// Components with an `open` prop that are invisible until triggered
|
|
9
|
+
const OPEN_CONTROLLED_COMPONENTS = new Set([
|
|
10
|
+
'Dialog', 'Drawer', 'Toast', 'Collapsible',
|
|
11
|
+
]);
|
|
12
|
+
// Components that need a sample data array above `meta`
|
|
13
|
+
const REQUIRED_ARRAY_COMPONENTS = new Set([
|
|
14
|
+
'Combobox',
|
|
15
|
+
]);
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Storybook config generators
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
export function generateStorybookMain(framework) {
|
|
20
|
+
let frameworkPkg;
|
|
21
|
+
let storybookImportType;
|
|
22
|
+
if (framework === 'react') {
|
|
23
|
+
frameworkPkg = '@storybook/react-vite';
|
|
24
|
+
storybookImportType = '@storybook/react-vite';
|
|
25
|
+
}
|
|
26
|
+
else if (framework === 'vue') {
|
|
27
|
+
frameworkPkg = '@storybook/vue3-vite';
|
|
28
|
+
storybookImportType = '@storybook/vue3-vite';
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
frameworkPkg = '@storybook/web-components-vite';
|
|
32
|
+
storybookImportType = '@storybook/web-components-vite';
|
|
33
|
+
}
|
|
34
|
+
return `import type { StorybookConfig } from '${storybookImportType}';
|
|
35
|
+
import type { InlineConfig } from 'vite';
|
|
36
|
+
|
|
37
|
+
const config: StorybookConfig = {
|
|
38
|
+
stories: [
|
|
39
|
+
'../src/components/ag/**/*.mdx',
|
|
40
|
+
'../src/components/ag/**/*.stories.@(js|jsx|mjs|ts|tsx)',
|
|
41
|
+
],
|
|
42
|
+
addons: [
|
|
43
|
+
'@storybook/addon-docs',
|
|
44
|
+
'@storybook/addon-a11y',
|
|
45
|
+
],
|
|
46
|
+
framework: '${frameworkPkg}',
|
|
47
|
+
async viteFinal(config): Promise<InlineConfig> {
|
|
48
|
+
// Remove noDiscovery so Storybook can pre-bundle its own dependencies.
|
|
49
|
+
// The main app uses noDiscovery for performance, but Storybook needs discovery on.
|
|
50
|
+
if (config.optimizeDeps) {
|
|
51
|
+
config.optimizeDeps.noDiscovery = false;
|
|
52
|
+
}
|
|
53
|
+
return config;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export default config;
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
export function generateStorybookPreview(framework, componentsRelPath) {
|
|
60
|
+
let previewImportPkg;
|
|
61
|
+
if (framework === 'react') {
|
|
62
|
+
previewImportPkg = '@storybook/react';
|
|
63
|
+
}
|
|
64
|
+
else if (framework === 'vue') {
|
|
65
|
+
previewImportPkg = '@storybook/vue3';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
previewImportPkg = '@storybook/web-components';
|
|
69
|
+
}
|
|
70
|
+
// componentsRelPath is relative from .storybook/ to src/components/ag
|
|
71
|
+
// The CSS imports in preview.ts are relative to .storybook/
|
|
72
|
+
const cssPath = `${componentsRelPath}/styles`;
|
|
73
|
+
return `import type { Preview } from '${previewImportPkg}';
|
|
74
|
+
import '${cssPath}/ag-tokens.css';
|
|
75
|
+
import '${cssPath}/ag-tokens-dark.css';
|
|
76
|
+
|
|
77
|
+
const preview: Preview = {
|
|
78
|
+
parameters: {
|
|
79
|
+
controls: {
|
|
80
|
+
matchers: {
|
|
81
|
+
color: /(background|color)$/i,
|
|
82
|
+
date: /Date$/i,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
a11y: {
|
|
86
|
+
test: 'todo',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default preview;
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// argTypes registry
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
const ARGTYPES = {
|
|
98
|
+
Alert: ` argTypes: {
|
|
99
|
+
variant: {
|
|
100
|
+
control: 'select',
|
|
101
|
+
options: ['', 'success', 'warning', 'danger', 'info'],
|
|
102
|
+
},
|
|
103
|
+
bordered: { control: 'boolean' },
|
|
104
|
+
rounded: { control: 'boolean' },
|
|
105
|
+
borderedLeft: { control: 'boolean' },
|
|
106
|
+
dismissible: { control: 'boolean' },
|
|
107
|
+
},`,
|
|
108
|
+
Avatar: ` argTypes: {
|
|
109
|
+
size: {
|
|
110
|
+
control: 'select',
|
|
111
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
112
|
+
},
|
|
113
|
+
shape: {
|
|
114
|
+
control: 'select',
|
|
115
|
+
options: ['circle', 'square', 'rounded'],
|
|
116
|
+
},
|
|
117
|
+
variant: {
|
|
118
|
+
control: 'select',
|
|
119
|
+
options: ['', 'primary', 'success', 'warning', 'danger'],
|
|
120
|
+
},
|
|
121
|
+
},`,
|
|
122
|
+
Badge: ` argTypes: {
|
|
123
|
+
variant: {
|
|
124
|
+
control: 'select',
|
|
125
|
+
options: ['default', 'success', 'warning', 'danger', 'primary', 'info', 'neutral', 'monochrome'],
|
|
126
|
+
},
|
|
127
|
+
size: {
|
|
128
|
+
control: 'select',
|
|
129
|
+
options: ['xs', 'sm', 'md'],
|
|
130
|
+
},
|
|
131
|
+
dot: { control: 'boolean' },
|
|
132
|
+
interactive: { control: 'boolean' },
|
|
133
|
+
},`,
|
|
134
|
+
Button: ` argTypes: {
|
|
135
|
+
variant: {
|
|
136
|
+
control: 'select',
|
|
137
|
+
options: ['', 'primary', 'secondary', 'success', 'warning', 'danger', 'monochrome'],
|
|
138
|
+
},
|
|
139
|
+
size: {
|
|
140
|
+
control: 'select',
|
|
141
|
+
options: ['x-sm', 'sm', 'md', 'lg', 'xl'],
|
|
142
|
+
},
|
|
143
|
+
shape: {
|
|
144
|
+
control: 'select',
|
|
145
|
+
options: ['', 'capsule', 'rounded', 'circle', 'square', 'rounded-square'],
|
|
146
|
+
},
|
|
147
|
+
bordered: { control: 'boolean' },
|
|
148
|
+
ghost: { control: 'boolean' },
|
|
149
|
+
disabled: { control: 'boolean' },
|
|
150
|
+
loading: { control: 'boolean' },
|
|
151
|
+
fullWidth: { control: 'boolean' },
|
|
152
|
+
},`,
|
|
153
|
+
Combobox: ` argTypes: {
|
|
154
|
+
size: {
|
|
155
|
+
control: 'select',
|
|
156
|
+
options: ['small', 'default', 'large'],
|
|
157
|
+
},
|
|
158
|
+
filterMode: {
|
|
159
|
+
control: 'select',
|
|
160
|
+
options: ['startsWith', 'contains', 'none'],
|
|
161
|
+
},
|
|
162
|
+
disabled: { control: 'boolean' },
|
|
163
|
+
clearable: { control: 'boolean' },
|
|
164
|
+
multiple: { control: 'boolean' },
|
|
165
|
+
loading: { control: 'boolean' },
|
|
166
|
+
invalid: { control: 'boolean' },
|
|
167
|
+
errorMessage: { control: 'text' },
|
|
168
|
+
helpText: { control: 'text' },
|
|
169
|
+
},`,
|
|
170
|
+
Dialog: ` argTypes: {
|
|
171
|
+
open: { control: 'boolean' },
|
|
172
|
+
showCloseButton: { control: 'boolean' },
|
|
173
|
+
noCloseOnEscape: { control: 'boolean' },
|
|
174
|
+
noCloseOnBackdrop: { control: 'boolean' },
|
|
175
|
+
heading: { control: 'text' },
|
|
176
|
+
description: { control: 'text' },
|
|
177
|
+
drawerPosition: {
|
|
178
|
+
control: 'select',
|
|
179
|
+
options: [undefined, 'start', 'end', 'top', 'bottom'],
|
|
180
|
+
},
|
|
181
|
+
},`,
|
|
182
|
+
Drawer: ` argTypes: {
|
|
183
|
+
open: { control: 'boolean' },
|
|
184
|
+
showCloseButton: { control: 'boolean' },
|
|
185
|
+
heading: { control: 'text' },
|
|
186
|
+
description: { control: 'text' },
|
|
187
|
+
position: {
|
|
188
|
+
control: 'select',
|
|
189
|
+
options: ['start', 'end', 'top', 'bottom'],
|
|
190
|
+
},
|
|
191
|
+
},`,
|
|
192
|
+
IconButton: ` argTypes: {
|
|
193
|
+
variant: {
|
|
194
|
+
control: 'select',
|
|
195
|
+
options: ['primary', 'secondary', 'success', 'warning', 'danger', 'ghost', 'monochrome'],
|
|
196
|
+
},
|
|
197
|
+
size: {
|
|
198
|
+
control: 'select',
|
|
199
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
200
|
+
},
|
|
201
|
+
disabled: { control: 'boolean' },
|
|
202
|
+
loading: { control: 'boolean' },
|
|
203
|
+
},`,
|
|
204
|
+
Input: ` argTypes: {
|
|
205
|
+
type: {
|
|
206
|
+
control: 'select',
|
|
207
|
+
options: ['text', 'email', 'password', 'number', 'search', 'tel', 'url'],
|
|
208
|
+
},
|
|
209
|
+
size: {
|
|
210
|
+
control: 'select',
|
|
211
|
+
options: ['small', 'default', 'large'],
|
|
212
|
+
},
|
|
213
|
+
disabled: { control: 'boolean' },
|
|
214
|
+
readonly: { control: 'boolean' },
|
|
215
|
+
invalid: { control: 'boolean' },
|
|
216
|
+
required: { control: 'boolean' },
|
|
217
|
+
label: { control: 'text' },
|
|
218
|
+
placeholder: { control: 'text' },
|
|
219
|
+
errorMessage: { control: 'text' },
|
|
220
|
+
helpText: { control: 'text' },
|
|
221
|
+
},`,
|
|
222
|
+
Kbd: ` argTypes: {
|
|
223
|
+
bordered: { control: 'boolean' },
|
|
224
|
+
background: { control: 'boolean' },
|
|
225
|
+
},`,
|
|
226
|
+
Link: ` argTypes: {
|
|
227
|
+
variant: {
|
|
228
|
+
control: 'select',
|
|
229
|
+
options: ['', 'primary', 'success', 'warning', 'danger', 'monochrome'],
|
|
230
|
+
},
|
|
231
|
+
disabled: { control: 'boolean' },
|
|
232
|
+
},`,
|
|
233
|
+
Progress: ` argTypes: {
|
|
234
|
+
value: { control: { type: 'number', min: 0, max: 100 } },
|
|
235
|
+
max: { control: { type: 'number' } },
|
|
236
|
+
size: {
|
|
237
|
+
control: 'select',
|
|
238
|
+
options: ['small', 'medium', 'large'],
|
|
239
|
+
},
|
|
240
|
+
},`,
|
|
241
|
+
ProgressRing: ` argTypes: {
|
|
242
|
+
value: { control: { type: 'number', min: 0, max: 100 } },
|
|
243
|
+
size: {
|
|
244
|
+
control: 'select',
|
|
245
|
+
options: ['small', 'medium', 'large'],
|
|
246
|
+
},
|
|
247
|
+
variant: {
|
|
248
|
+
control: 'select',
|
|
249
|
+
options: ['primary', 'success', 'warning', 'danger', 'info'],
|
|
250
|
+
},
|
|
251
|
+
},`,
|
|
252
|
+
Rating: ` argTypes: {
|
|
253
|
+
value: { control: { type: 'number', min: 0, max: 5 } },
|
|
254
|
+
readonly: { control: 'boolean' },
|
|
255
|
+
allowClear: { control: 'boolean' },
|
|
256
|
+
},`,
|
|
257
|
+
Select: ` argTypes: {
|
|
258
|
+
size: {
|
|
259
|
+
control: 'select',
|
|
260
|
+
options: ['small', 'default', 'large'],
|
|
261
|
+
},
|
|
262
|
+
disabled: { control: 'boolean' },
|
|
263
|
+
multiple: { control: 'boolean' },
|
|
264
|
+
invalid: { control: 'boolean' },
|
|
265
|
+
required: { control: 'boolean' },
|
|
266
|
+
},`,
|
|
267
|
+
Slider: ` argTypes: {
|
|
268
|
+
min: { control: { type: 'number' } },
|
|
269
|
+
max: { control: { type: 'number' } },
|
|
270
|
+
disabled: { control: 'boolean' },
|
|
271
|
+
readonly: { control: 'boolean' },
|
|
272
|
+
size: {
|
|
273
|
+
control: 'select',
|
|
274
|
+
options: ['small', 'default', 'large'],
|
|
275
|
+
},
|
|
276
|
+
},`,
|
|
277
|
+
SkeletonLoader: ` argTypes: {
|
|
278
|
+
variant: {
|
|
279
|
+
control: 'select',
|
|
280
|
+
options: ['text', 'avatar', 'button', 'card', 'custom'],
|
|
281
|
+
},
|
|
282
|
+
effect: {
|
|
283
|
+
control: 'select',
|
|
284
|
+
options: ['shimmer', 'pulse', 'none'],
|
|
285
|
+
},
|
|
286
|
+
},`,
|
|
287
|
+
Spinner: ` argTypes: {
|
|
288
|
+
size: {
|
|
289
|
+
control: 'select',
|
|
290
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
291
|
+
},
|
|
292
|
+
},`,
|
|
293
|
+
Tag: ` argTypes: {
|
|
294
|
+
uppercase: { control: 'boolean' },
|
|
295
|
+
removable: { control: 'boolean' },
|
|
296
|
+
},`,
|
|
297
|
+
Timeline: ` argTypes: {
|
|
298
|
+
orientation: {
|
|
299
|
+
control: 'select',
|
|
300
|
+
options: ['vertical', 'horizontal'],
|
|
301
|
+
},
|
|
302
|
+
variant: {
|
|
303
|
+
control: 'select',
|
|
304
|
+
options: ['', 'primary', 'success', 'warning', 'danger', 'monochrome'],
|
|
305
|
+
},
|
|
306
|
+
compact: { control: 'boolean' },
|
|
307
|
+
},`,
|
|
308
|
+
Toast: ` argTypes: {
|
|
309
|
+
open: { control: 'boolean' },
|
|
310
|
+
type: {
|
|
311
|
+
control: 'select',
|
|
312
|
+
options: ['info', 'success', 'warning', 'danger'],
|
|
313
|
+
},
|
|
314
|
+
position: {
|
|
315
|
+
control: 'select',
|
|
316
|
+
options: ['top-right', 'top-left', 'bottom-right', 'bottom-left', 'top-center', 'bottom-center'],
|
|
317
|
+
},
|
|
318
|
+
autoDismiss: { control: 'boolean' },
|
|
319
|
+
showCloseButton: { control: 'boolean' },
|
|
320
|
+
bordered: { control: 'boolean' },
|
|
321
|
+
rounded: { control: 'boolean' },
|
|
322
|
+
},`,
|
|
323
|
+
Toggle: ` argTypes: {
|
|
324
|
+
size: {
|
|
325
|
+
control: 'select',
|
|
326
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
327
|
+
},
|
|
328
|
+
variant: {
|
|
329
|
+
control: 'select',
|
|
330
|
+
options: ['default', 'success', 'warning', 'danger', 'monochrome'],
|
|
331
|
+
},
|
|
332
|
+
disabled: { control: 'boolean' },
|
|
333
|
+
readonly: { control: 'boolean' },
|
|
334
|
+
invalid: { control: 'boolean' },
|
|
335
|
+
},`,
|
|
336
|
+
};
|
|
337
|
+
// ---------------------------------------------------------------------------
|
|
338
|
+
// Default args registry
|
|
339
|
+
// ---------------------------------------------------------------------------
|
|
340
|
+
const DEFAULT_ARGS = {
|
|
341
|
+
Button: ` args: {
|
|
342
|
+
children: 'Button',
|
|
343
|
+
},`,
|
|
344
|
+
Dialog: ` args: {
|
|
345
|
+
heading: 'Dialog title',
|
|
346
|
+
description: 'Supporting description text goes here.',
|
|
347
|
+
showCloseButton: true,
|
|
348
|
+
},`,
|
|
349
|
+
Drawer: ` args: {
|
|
350
|
+
heading: 'Drawer',
|
|
351
|
+
showCloseButton: true,
|
|
352
|
+
},`,
|
|
353
|
+
Combobox: ` args: {
|
|
354
|
+
options: FRUITS,
|
|
355
|
+
label: 'Fruit',
|
|
356
|
+
placeholder: 'Select a fruit...',
|
|
357
|
+
id: 'combobox-story',
|
|
358
|
+
},`,
|
|
359
|
+
Alert: ` args: {
|
|
360
|
+
children: 'This is an alert message.',
|
|
361
|
+
},`,
|
|
362
|
+
Badge: ` args: {
|
|
363
|
+
children: '5',
|
|
364
|
+
},`,
|
|
365
|
+
BadgeFx: ` args: {
|
|
366
|
+
children: 'BadgeFx',
|
|
367
|
+
},`,
|
|
368
|
+
ButtonFx: ` args: {
|
|
369
|
+
children: 'ButtonFx',
|
|
370
|
+
},`,
|
|
371
|
+
Card: ` args: {
|
|
372
|
+
children: 'Card content goes here.',
|
|
373
|
+
},`,
|
|
374
|
+
Kbd: ` args: {
|
|
375
|
+
children: 'Ctrl',
|
|
376
|
+
},`,
|
|
377
|
+
Link: ` args: {
|
|
378
|
+
children: 'Link text',
|
|
379
|
+
href: '#',
|
|
380
|
+
},`,
|
|
381
|
+
Mark: ` args: {
|
|
382
|
+
children: 'Highlighted text',
|
|
383
|
+
},`,
|
|
384
|
+
MessageBubble: ` args: {
|
|
385
|
+
children: 'Hello there!',
|
|
386
|
+
},`,
|
|
387
|
+
Tag: ` args: {
|
|
388
|
+
children: 'Tag label',
|
|
389
|
+
},`,
|
|
390
|
+
Toast: ` args: {
|
|
391
|
+
children: <span>Toast notification message</span>,
|
|
392
|
+
},`,
|
|
393
|
+
};
|
|
394
|
+
// ---------------------------------------------------------------------------
|
|
395
|
+
// Extra named stories per component
|
|
396
|
+
// ---------------------------------------------------------------------------
|
|
397
|
+
function getExtraStories(name) {
|
|
398
|
+
if (name === 'Button') {
|
|
399
|
+
return `
|
|
400
|
+
export const Variants: Story = {
|
|
401
|
+
render: () => (
|
|
402
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
403
|
+
<ReactButton>Default</ReactButton>
|
|
404
|
+
<ReactButton variant="primary">Primary</ReactButton>
|
|
405
|
+
<ReactButton variant="secondary">Secondary</ReactButton>
|
|
406
|
+
<ReactButton variant="success">Success</ReactButton>
|
|
407
|
+
<ReactButton variant="warning">Warning</ReactButton>
|
|
408
|
+
<ReactButton variant="danger">Danger</ReactButton>
|
|
409
|
+
<ReactButton variant="monochrome">Monochrome</ReactButton>
|
|
410
|
+
</div>
|
|
411
|
+
),
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
export const Sizes: Story = {
|
|
415
|
+
render: () => (
|
|
416
|
+
<div style={{ display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'wrap' }}>
|
|
417
|
+
<ReactButton size="x-sm">x-sm</ReactButton>
|
|
418
|
+
<ReactButton size="sm">sm</ReactButton>
|
|
419
|
+
<ReactButton size="md">md</ReactButton>
|
|
420
|
+
<ReactButton size="lg">lg</ReactButton>
|
|
421
|
+
<ReactButton size="xl">xl</ReactButton>
|
|
422
|
+
</div>
|
|
423
|
+
),
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export const Bordered: Story = {
|
|
427
|
+
render: () => (
|
|
428
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
429
|
+
<ReactButton bordered>Default</ReactButton>
|
|
430
|
+
<ReactButton variant="primary" bordered>Primary</ReactButton>
|
|
431
|
+
<ReactButton variant="success" bordered>Success</ReactButton>
|
|
432
|
+
<ReactButton variant="danger" bordered>Danger</ReactButton>
|
|
433
|
+
</div>
|
|
434
|
+
),
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
export const Disabled: Story = { args: { variant: 'primary', disabled: true } };
|
|
438
|
+
export const Loading: Story = { args: { variant: 'primary', loading: true } };
|
|
439
|
+
`;
|
|
440
|
+
}
|
|
441
|
+
if (name === 'Dialog') {
|
|
442
|
+
return `
|
|
443
|
+
export const OpenByDefault: Story = {
|
|
444
|
+
args: { open: true },
|
|
445
|
+
render: (args) => <DialogDemo {...args} />,
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
export const DrawerEnd: Story = {
|
|
449
|
+
args: { heading: 'Drawer (end)', drawerPosition: 'end' },
|
|
450
|
+
render: (args) => <DialogDemo {...args} />,
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
export const DrawerStart: Story = {
|
|
454
|
+
args: { heading: 'Drawer (start)', drawerPosition: 'start' },
|
|
455
|
+
render: (args) => <DialogDemo {...args} />,
|
|
456
|
+
};
|
|
457
|
+
`;
|
|
458
|
+
}
|
|
459
|
+
if (name === 'Combobox') {
|
|
460
|
+
return `
|
|
461
|
+
export const WithContainsFilter: Story = {
|
|
462
|
+
args: { filterMode: 'contains', placeholder: 'Type to filter...' },
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export const Clearable: Story = {
|
|
466
|
+
args: { clearable: true, defaultValue: 'apple' },
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export const Multiple: Story = {
|
|
470
|
+
args: {
|
|
471
|
+
multiple: true,
|
|
472
|
+
placeholder: 'Select multiple fruits...',
|
|
473
|
+
clearable: true,
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
export const Invalid: Story = {
|
|
478
|
+
args: {
|
|
479
|
+
invalid: true,
|
|
480
|
+
errorMessage: 'Please select a valid option.',
|
|
481
|
+
},
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
export const Disabled: Story = {
|
|
485
|
+
args: { disabled: true, defaultValue: 'banana' },
|
|
486
|
+
};
|
|
487
|
+
`;
|
|
488
|
+
}
|
|
489
|
+
return '';
|
|
490
|
+
}
|
|
491
|
+
// ---------------------------------------------------------------------------
|
|
492
|
+
// Per-component story generator (React only)
|
|
493
|
+
// ---------------------------------------------------------------------------
|
|
494
|
+
export function generateReactStory(name) {
|
|
495
|
+
const lines = [];
|
|
496
|
+
// Imports
|
|
497
|
+
lines.push(`import type { Meta, StoryObj } from '@storybook/react';`);
|
|
498
|
+
if (OPEN_CONTROLLED_COMPONENTS.has(name) && name !== 'Collapsible') {
|
|
499
|
+
lines.push(`import { useState } from 'react';`);
|
|
500
|
+
}
|
|
501
|
+
if (name === 'Dialog') {
|
|
502
|
+
lines.push(`import { ReactDialog, DialogHeader, DialogFooter } from './ReactDialog';`);
|
|
503
|
+
lines.push(`import { ReactButton } from '../../Button/react/ReactButton';`);
|
|
504
|
+
}
|
|
505
|
+
else if (name === 'Drawer') {
|
|
506
|
+
lines.push(`import { ReactDrawer } from './ReactDrawer';`);
|
|
507
|
+
lines.push(`import { ReactButton } from '../../Button/react/ReactButton';`);
|
|
508
|
+
}
|
|
509
|
+
else if (name === 'Toast') {
|
|
510
|
+
lines.push(`import { ReactToast } from './ReactToast';`);
|
|
511
|
+
lines.push(`import { ReactButton } from '../../Button/react/ReactButton';`);
|
|
512
|
+
}
|
|
513
|
+
else if (REQUIRED_ARRAY_COMPONENTS.has(name)) {
|
|
514
|
+
lines.push(`import { React${name} } from './React${name}';`);
|
|
515
|
+
lines.push(`import type { ComboboxOption } from './React${name}';`);
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
lines.push(`import { React${name} } from './React${name}';`);
|
|
519
|
+
}
|
|
520
|
+
lines.push('');
|
|
521
|
+
// Sample data for Combobox
|
|
522
|
+
if (name === 'Combobox') {
|
|
523
|
+
lines.push(`const FRUITS: ComboboxOption[] = [`);
|
|
524
|
+
lines.push(` { value: 'apple', label: 'Apple' },`);
|
|
525
|
+
lines.push(` { value: 'banana', label: 'Banana' },`);
|
|
526
|
+
lines.push(` { value: 'cherry', label: 'Cherry' },`);
|
|
527
|
+
lines.push(` { value: 'grape', label: 'Grape' },`);
|
|
528
|
+
lines.push(` { value: 'mango', label: 'Mango' },`);
|
|
529
|
+
lines.push(` { value: 'orange', label: 'Orange' },`);
|
|
530
|
+
lines.push(`];`);
|
|
531
|
+
lines.push('');
|
|
532
|
+
}
|
|
533
|
+
// Meta object
|
|
534
|
+
const argTypes = ARGTYPES[name] ?? '';
|
|
535
|
+
const defaultArgs = DEFAULT_ARGS[name] ?? '';
|
|
536
|
+
const metaParts = [];
|
|
537
|
+
metaParts.push(` title: 'AgnosticUI/${name}',`);
|
|
538
|
+
metaParts.push(` component: React${name},`);
|
|
539
|
+
metaParts.push(` tags: ['autodocs'],`);
|
|
540
|
+
if (argTypes) {
|
|
541
|
+
metaParts.push(argTypes);
|
|
542
|
+
}
|
|
543
|
+
if (defaultArgs) {
|
|
544
|
+
metaParts.push(defaultArgs);
|
|
545
|
+
}
|
|
546
|
+
lines.push(`const meta = {`);
|
|
547
|
+
lines.push(metaParts.join('\n'));
|
|
548
|
+
lines.push(`} satisfies Meta<typeof React${name}>;`);
|
|
549
|
+
lines.push('');
|
|
550
|
+
lines.push(`export default meta;`);
|
|
551
|
+
lines.push(`type Story = StoryObj<typeof meta>;`);
|
|
552
|
+
lines.push('');
|
|
553
|
+
// Open-controlled component wrappers
|
|
554
|
+
if (name === 'Dialog') {
|
|
555
|
+
lines.push(`// Dialog needs open state - wrap in a controller so the story is interactive.`);
|
|
556
|
+
lines.push(`function DialogDemo(props: React.ComponentProps<typeof ReactDialog>) {`);
|
|
557
|
+
lines.push(` const [open, setOpen] = useState(props.open ?? false);`);
|
|
558
|
+
lines.push(` return (`);
|
|
559
|
+
lines.push(` <>`);
|
|
560
|
+
lines.push(` <ReactButton variant="primary" onClick={() => setOpen(true)}>`);
|
|
561
|
+
lines.push(` Open Dialog`);
|
|
562
|
+
lines.push(` </ReactButton>`);
|
|
563
|
+
lines.push(` <ReactDialog`);
|
|
564
|
+
lines.push(` {...props}`);
|
|
565
|
+
lines.push(` open={open}`);
|
|
566
|
+
lines.push(` onDialogClose={() => setOpen(false)}`);
|
|
567
|
+
lines.push(` onDialogCancel={() => setOpen(false)}`);
|
|
568
|
+
lines.push(` >`);
|
|
569
|
+
lines.push(` <DialogHeader>`);
|
|
570
|
+
lines.push(` <p>Dialog body content goes here. You can put any React content inside.</p>`);
|
|
571
|
+
lines.push(` </DialogHeader>`);
|
|
572
|
+
lines.push(` <DialogFooter>`);
|
|
573
|
+
lines.push(` <ReactButton onClick={() => setOpen(false)}>Cancel</ReactButton>`);
|
|
574
|
+
lines.push(` <ReactButton variant="primary" onClick={() => setOpen(false)}>`);
|
|
575
|
+
lines.push(` Confirm`);
|
|
576
|
+
lines.push(` </ReactButton>`);
|
|
577
|
+
lines.push(` </DialogFooter>`);
|
|
578
|
+
lines.push(` </ReactDialog>`);
|
|
579
|
+
lines.push(` </>`);
|
|
580
|
+
lines.push(` );`);
|
|
581
|
+
lines.push(`}`);
|
|
582
|
+
lines.push('');
|
|
583
|
+
lines.push(`export const Default: Story = {`);
|
|
584
|
+
lines.push(` render: (args) => <DialogDemo {...args} />,`);
|
|
585
|
+
lines.push(`};`);
|
|
586
|
+
}
|
|
587
|
+
else if (name === 'Drawer') {
|
|
588
|
+
lines.push(`// Drawer needs open state - wrap in a controller so the story is interactive.`);
|
|
589
|
+
lines.push(`function DrawerDemo(props: React.ComponentProps<typeof ReactDrawer>) {`);
|
|
590
|
+
lines.push(` const [open, setOpen] = useState(props.open ?? false);`);
|
|
591
|
+
lines.push(` return (`);
|
|
592
|
+
lines.push(` <>`);
|
|
593
|
+
lines.push(` <ReactButton variant="primary" onClick={() => setOpen(true)}>`);
|
|
594
|
+
lines.push(` Open Drawer`);
|
|
595
|
+
lines.push(` </ReactButton>`);
|
|
596
|
+
lines.push(` <ReactDrawer`);
|
|
597
|
+
lines.push(` {...props}`);
|
|
598
|
+
lines.push(` open={open}`);
|
|
599
|
+
lines.push(` onDrawerClose={() => setOpen(false)}`);
|
|
600
|
+
lines.push(` onDrawerCancel={() => setOpen(false)}`);
|
|
601
|
+
lines.push(` >`);
|
|
602
|
+
lines.push(` <div style={{ padding: '1rem' }}>Drawer content goes here.</div>`);
|
|
603
|
+
lines.push(` </ReactDrawer>`);
|
|
604
|
+
lines.push(` </>`);
|
|
605
|
+
lines.push(` );`);
|
|
606
|
+
lines.push(`}`);
|
|
607
|
+
lines.push('');
|
|
608
|
+
lines.push(`export const Default: Story = {`);
|
|
609
|
+
lines.push(` render: (args) => <DrawerDemo {...args} />,`);
|
|
610
|
+
lines.push(`};`);
|
|
611
|
+
}
|
|
612
|
+
else if (name === 'Toast') {
|
|
613
|
+
lines.push(`// Toast needs open state - wrap in a controller so the story is interactive.`);
|
|
614
|
+
lines.push(`function ToastDemo(props: React.ComponentProps<typeof ReactToast>) {`);
|
|
615
|
+
lines.push(` const [open, setOpen] = useState(props.open ?? false);`);
|
|
616
|
+
lines.push(` return (`);
|
|
617
|
+
lines.push(` <>`);
|
|
618
|
+
lines.push(` <ReactButton variant="primary" onClick={() => setOpen(true)}>`);
|
|
619
|
+
lines.push(` Show Toast`);
|
|
620
|
+
lines.push(` </ReactButton>`);
|
|
621
|
+
lines.push(` <ReactToast`);
|
|
622
|
+
lines.push(` {...props}`);
|
|
623
|
+
lines.push(` open={open}`);
|
|
624
|
+
lines.push(` onToastClose={() => setOpen(false)}`);
|
|
625
|
+
lines.push(` >`);
|
|
626
|
+
lines.push(` <span>Toast notification message</span>`);
|
|
627
|
+
lines.push(` </ReactToast>`);
|
|
628
|
+
lines.push(` </>`);
|
|
629
|
+
lines.push(` );`);
|
|
630
|
+
lines.push(`}`);
|
|
631
|
+
lines.push('');
|
|
632
|
+
lines.push(`export const Default: Story = {`);
|
|
633
|
+
lines.push(` render: (args) => <ToastDemo {...args} />,`);
|
|
634
|
+
lines.push(`};`);
|
|
635
|
+
}
|
|
636
|
+
else if (name === 'Collapsible') {
|
|
637
|
+
lines.push(`export const Default: Story = {`);
|
|
638
|
+
lines.push(` render: () => (`);
|
|
639
|
+
lines.push(` <React${name}>`);
|
|
640
|
+
lines.push(` <span slot="summary">Toggle details</span>`);
|
|
641
|
+
lines.push(` <div>Collapsible content goes here.</div>`);
|
|
642
|
+
lines.push(` </React${name}>`);
|
|
643
|
+
lines.push(` ),`);
|
|
644
|
+
lines.push(`};`);
|
|
645
|
+
}
|
|
646
|
+
else if (TEXT_CHILD_COMPONENTS.has(name)) {
|
|
647
|
+
lines.push(`export const Default: Story = {};`);
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
lines.push(`export const Default: Story = {`);
|
|
651
|
+
lines.push(` args: {},`);
|
|
652
|
+
lines.push(`};`);
|
|
653
|
+
}
|
|
654
|
+
// Extra stories
|
|
655
|
+
const extras = getExtraStories(name);
|
|
656
|
+
if (extras) {
|
|
657
|
+
lines.push(extras);
|
|
658
|
+
}
|
|
659
|
+
return lines.join('\n') + '\n';
|
|
660
|
+
}
|
|
661
|
+
//# sourceMappingURL=stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../src/utils/stories.ts"],"names":[],"mappings":"AAQA,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAE9E,MAAM,qBAAqB,GAAG,IAAI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iC,CAAC,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,GAAG,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QAC/D,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,GAAG,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;SAAM,IAAI,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,gBAAgB;IAChB,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgnosticUIConfig } from '../types/index.js';
|
|
2
|
+
export declare function detectThemeFile(componentsAbsPath: string): boolean;
|
|
3
|
+
export declare function generateViewerApp(config: AgnosticUIConfig, viewerPath: string, cwd: string): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/utils/viewer.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA6JrE,wBAAgB,eAAe,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAElE;AAy5BD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|