@tpitre/story-ui 2.2.0 → 2.3.1
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/.env.sample +82 -11
- package/README.md +89 -0
- package/dist/cli/deploy.d.ts +17 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +696 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +26 -2
- package/dist/cli/setup.d.ts +11 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +437 -110
- package/dist/mcp-server/index.d.ts +2 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +120 -2
- package/dist/mcp-server/mcp-stdio-server.d.ts +3 -0
- package/dist/mcp-server/mcp-stdio-server.d.ts.map +1 -0
- package/dist/mcp-server/mcp-stdio-server.js +8 -1
- package/dist/mcp-server/routes/claude.d.ts +3 -0
- package/dist/mcp-server/routes/claude.d.ts.map +1 -0
- package/dist/mcp-server/routes/claude.js +60 -23
- package/dist/mcp-server/routes/components.d.ts +4 -0
- package/dist/mcp-server/routes/components.d.ts.map +1 -0
- package/dist/mcp-server/routes/frameworks.d.ts +38 -0
- package/dist/mcp-server/routes/frameworks.d.ts.map +1 -0
- package/dist/mcp-server/routes/frameworks.js +183 -0
- package/dist/mcp-server/routes/generateStory.d.ts +3 -0
- package/dist/mcp-server/routes/generateStory.d.ts.map +1 -0
- package/dist/mcp-server/routes/generateStory.js +160 -76
- package/dist/mcp-server/routes/generateStoryStream.d.ts +12 -0
- package/dist/mcp-server/routes/generateStoryStream.d.ts.map +1 -0
- package/dist/mcp-server/routes/generateStoryStream.js +947 -0
- package/dist/mcp-server/routes/hybridStories.d.ts +18 -0
- package/dist/mcp-server/routes/hybridStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/mcpRemote.d.ts +14 -0
- package/dist/mcp-server/routes/mcpRemote.d.ts.map +1 -0
- package/dist/mcp-server/routes/mcpRemote.js +489 -0
- package/dist/mcp-server/routes/memoryStories.d.ts +26 -0
- package/dist/mcp-server/routes/memoryStories.d.ts.map +1 -0
- package/dist/mcp-server/routes/providers.d.ts +89 -0
- package/dist/mcp-server/routes/providers.d.ts.map +1 -0
- package/dist/mcp-server/routes/providers.js +369 -0
- package/dist/mcp-server/routes/storySync.d.ts +26 -0
- package/dist/mcp-server/routes/storySync.d.ts.map +1 -0
- package/dist/mcp-server/routes/streamTypes.d.ts +110 -0
- package/dist/mcp-server/routes/streamTypes.d.ts.map +1 -0
- package/dist/mcp-server/routes/streamTypes.js +18 -0
- package/dist/mcp-server/sessionManager.d.ts +50 -0
- package/dist/mcp-server/sessionManager.d.ts.map +1 -0
- package/dist/story-generator/componentBlacklist.d.ts +21 -0
- package/dist/story-generator/componentBlacklist.d.ts.map +1 -0
- package/dist/story-generator/componentDiscovery.d.ts +28 -0
- package/dist/story-generator/componentDiscovery.d.ts.map +1 -0
- package/dist/story-generator/componentRegistryGenerator.d.ts +49 -0
- package/dist/story-generator/componentRegistryGenerator.d.ts.map +1 -0
- package/dist/story-generator/componentRegistryGenerator.js +205 -0
- package/dist/story-generator/configLoader.d.ts +33 -0
- package/dist/story-generator/configLoader.d.ts.map +1 -0
- package/dist/story-generator/considerationsLoader.d.ts +32 -0
- package/dist/story-generator/considerationsLoader.d.ts.map +1 -0
- package/dist/story-generator/documentation-sources.d.ts +28 -0
- package/dist/story-generator/documentation-sources.d.ts.map +1 -0
- package/dist/story-generator/documentationLoader.d.ts +64 -0
- package/dist/story-generator/documentationLoader.d.ts.map +1 -0
- package/dist/story-generator/dynamicPackageDiscovery.d.ts +97 -0
- package/dist/story-generator/dynamicPackageDiscovery.d.ts.map +1 -0
- package/dist/story-generator/enhancedComponentDiscovery.d.ts +125 -0
- package/dist/story-generator/enhancedComponentDiscovery.d.ts.map +1 -0
- package/dist/story-generator/enhancedComponentDiscovery.js +111 -11
- package/dist/story-generator/framework-adapters/angular-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/angular-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/angular-adapter.js +427 -0
- package/dist/story-generator/framework-adapters/base-adapter.d.ts +75 -0
- package/dist/story-generator/framework-adapters/base-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/base-adapter.js +147 -0
- package/dist/story-generator/framework-adapters/framework-detector.d.ts +55 -0
- package/dist/story-generator/framework-adapters/framework-detector.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/framework-detector.js +323 -0
- package/dist/story-generator/framework-adapters/index.d.ts +97 -0
- package/dist/story-generator/framework-adapters/index.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/index.js +198 -0
- package/dist/story-generator/framework-adapters/react-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/react-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/react-adapter.js +316 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.d.ts +40 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/svelte-adapter.js +372 -0
- package/dist/story-generator/framework-adapters/types.d.ts +182 -0
- package/dist/story-generator/framework-adapters/types.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/types.js +8 -0
- package/dist/story-generator/framework-adapters/vue-adapter.d.ts +36 -0
- package/dist/story-generator/framework-adapters/vue-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/vue-adapter.js +336 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.d.ts +54 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.d.ts.map +1 -0
- package/dist/story-generator/framework-adapters/web-components-adapter.js +387 -0
- package/dist/story-generator/generateStory.d.ts +7 -0
- package/dist/story-generator/generateStory.d.ts.map +1 -0
- package/dist/story-generator/gitignoreManager.d.ts +50 -0
- package/dist/story-generator/gitignoreManager.d.ts.map +1 -0
- package/dist/story-generator/imageProcessor.d.ts +80 -0
- package/dist/story-generator/imageProcessor.d.ts.map +1 -0
- package/dist/story-generator/imageProcessor.js +391 -0
- package/dist/story-generator/inMemoryStoryService.d.ts +89 -0
- package/dist/story-generator/inMemoryStoryService.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/base-provider.d.ts +36 -0
- package/dist/story-generator/llm-providers/base-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/base-provider.js +135 -0
- package/dist/story-generator/llm-providers/claude-provider.d.ts +23 -0
- package/dist/story-generator/llm-providers/claude-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/claude-provider.js +414 -0
- package/dist/story-generator/llm-providers/gemini-provider.d.ts +24 -0
- package/dist/story-generator/llm-providers/gemini-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/gemini-provider.js +406 -0
- package/dist/story-generator/llm-providers/index.d.ts +63 -0
- package/dist/story-generator/llm-providers/index.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/index.js +169 -0
- package/dist/story-generator/llm-providers/openai-provider.d.ts +24 -0
- package/dist/story-generator/llm-providers/openai-provider.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/openai-provider.js +458 -0
- package/dist/story-generator/llm-providers/settings-manager.d.ts +75 -0
- package/dist/story-generator/llm-providers/settings-manager.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/settings-manager.js +173 -0
- package/dist/story-generator/llm-providers/story-llm-service.d.ts +79 -0
- package/dist/story-generator/llm-providers/story-llm-service.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/story-llm-service.js +240 -0
- package/dist/story-generator/llm-providers/types.d.ts +153 -0
- package/dist/story-generator/llm-providers/types.d.ts.map +1 -0
- package/dist/story-generator/llm-providers/types.js +8 -0
- package/dist/story-generator/logger.d.ts +14 -0
- package/dist/story-generator/logger.d.ts.map +1 -0
- package/dist/story-generator/logger.js +96 -29
- package/dist/story-generator/postProcessStory.d.ts +6 -0
- package/dist/story-generator/postProcessStory.d.ts.map +1 -0
- package/dist/story-generator/productionGitignoreManager.d.ts +91 -0
- package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -0
- package/dist/story-generator/promptGenerator.d.ts +48 -0
- package/dist/story-generator/promptGenerator.d.ts.map +1 -0
- package/dist/story-generator/promptGenerator.js +186 -1
- package/dist/story-generator/storyHistory.d.ts +44 -0
- package/dist/story-generator/storyHistory.d.ts.map +1 -0
- package/dist/story-generator/storySync.d.ts +68 -0
- package/dist/story-generator/storySync.d.ts.map +1 -0
- package/dist/story-generator/storyTracker.d.ts +48 -0
- package/dist/story-generator/storyTracker.d.ts.map +1 -0
- package/dist/story-generator/storyValidator.d.ts +6 -0
- package/dist/story-generator/storyValidator.d.ts.map +1 -0
- package/dist/story-generator/universalDesignSystemAdapter.d.ts +68 -0
- package/dist/story-generator/universalDesignSystemAdapter.d.ts.map +1 -0
- package/dist/story-generator/universalDesignSystemAdapter.js +138 -1
- package/dist/story-generator/urlRedirectService.d.ts +21 -0
- package/dist/story-generator/urlRedirectService.d.ts.map +1 -0
- package/dist/story-generator/validateStory.d.ts +19 -0
- package/dist/story-generator/validateStory.d.ts.map +1 -0
- package/dist/story-generator/validateStory.js +6 -2
- package/dist/story-generator/visionPrompts.d.ts +88 -0
- package/dist/story-generator/visionPrompts.d.ts.map +1 -0
- package/dist/story-generator/visionPrompts.js +462 -0
- package/dist/story-ui.config.d.ts +78 -0
- package/dist/story-ui.config.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.d.ts +4 -0
- package/dist/templates/StoryUI/StoryUIPanel.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.js +1874 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts +18 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.d.ts.map +1 -0
- package/dist/templates/StoryUI/StoryUIPanel.stories.js +37 -0
- package/dist/templates/StoryUI/index.d.ts +3 -0
- package/dist/templates/StoryUI/index.d.ts.map +1 -0
- package/dist/templates/StoryUI/index.js +2 -0
- package/package.json +17 -3
- package/templates/StoryUI/StoryUIPanel.tsx +1960 -384
- package/templates/StoryUI/index.tsx +1 -1
- package/templates/StoryUI/manager.tsx +264 -0
- package/templates/production-app/.env.example +11 -0
- package/templates/production-app/index.html +66 -0
- package/templates/production-app/package.json +30 -0
- package/templates/production-app/public/favicon.svg +5 -0
- package/templates/production-app/src/App.tsx +1560 -0
- package/templates/production-app/src/LivePreviewRenderer.tsx +420 -0
- package/templates/production-app/src/componentRegistry.ts +315 -0
- package/templates/production-app/src/considerations.ts +16 -0
- package/templates/production-app/src/index.css +284 -0
- package/templates/production-app/src/main.tsx +25 -0
- package/templates/production-app/tsconfig.json +32 -0
- package/templates/production-app/tsconfig.node.json +11 -0
- package/templates/production-app/vite.config.ts +83 -0
- package/templates/react-import-rule.json +2 -2
- package/dist/index.js +0 -12
- package/dist/story-ui.config.loader.js +0 -205
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Registry
|
|
3
|
+
*
|
|
4
|
+
* AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
5
|
+
* This file is generated at build time by story-ui
|
|
6
|
+
*
|
|
7
|
+
* It exports all components from your component library
|
|
8
|
+
* for use in the live preview renderer.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This is a sample/placeholder registry for development.
|
|
11
|
+
* When you run `story-ui deploy`, this file will be regenerated
|
|
12
|
+
* with your actual component library imports.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React from 'react';
|
|
16
|
+
|
|
17
|
+
// Sample placeholder components for development/testing
|
|
18
|
+
// These will be replaced with actual component imports from your library
|
|
19
|
+
|
|
20
|
+
const PlaceholderButton: React.FC<{
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
variant?: 'filled' | 'outline' | 'subtle' | 'light';
|
|
23
|
+
color?: string;
|
|
24
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
}> = ({ children, variant = 'filled', color = '#6366f1', size = 'md', disabled, onClick }) => {
|
|
28
|
+
const sizes = {
|
|
29
|
+
xs: { padding: '4px 8px', fontSize: '11px' },
|
|
30
|
+
sm: { padding: '6px 12px', fontSize: '12px' },
|
|
31
|
+
md: { padding: '8px 16px', fontSize: '14px' },
|
|
32
|
+
lg: { padding: '10px 20px', fontSize: '16px' },
|
|
33
|
+
xl: { padding: '12px 24px', fontSize: '18px' },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const baseStyles: React.CSSProperties = {
|
|
37
|
+
...sizes[size],
|
|
38
|
+
borderRadius: '6px',
|
|
39
|
+
fontWeight: 500,
|
|
40
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
41
|
+
opacity: disabled ? 0.5 : 1,
|
|
42
|
+
transition: 'all 150ms ease',
|
|
43
|
+
border: 'none',
|
|
44
|
+
fontFamily: 'inherit',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const variantStyles: Record<string, React.CSSProperties> = {
|
|
48
|
+
filled: { backgroundColor: color, color: 'white' },
|
|
49
|
+
outline: { backgroundColor: 'transparent', border: `1px solid ${color}`, color },
|
|
50
|
+
subtle: { backgroundColor: `${color}20`, color },
|
|
51
|
+
light: { backgroundColor: `${color}15`, color },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<button
|
|
56
|
+
style={{ ...baseStyles, ...variantStyles[variant] }}
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
onClick={onClick}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const PlaceholderCard: React.FC<{
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
shadow?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
68
|
+
padding?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
69
|
+
radius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
70
|
+
withBorder?: boolean;
|
|
71
|
+
}> = ({ children, shadow = 'sm', padding = 'md', radius = 'md', withBorder = false }) => {
|
|
72
|
+
const paddings = { xs: '8px', sm: '12px', md: '16px', lg: '24px', xl: '32px' };
|
|
73
|
+
const radii = { xs: '4px', sm: '6px', md: '8px', lg: '12px', xl: '16px' };
|
|
74
|
+
const shadows = {
|
|
75
|
+
xs: '0 1px 2px rgba(0,0,0,0.05)',
|
|
76
|
+
sm: '0 1px 3px rgba(0,0,0,0.1)',
|
|
77
|
+
md: '0 4px 6px rgba(0,0,0,0.1)',
|
|
78
|
+
lg: '0 10px 15px rgba(0,0,0,0.1)',
|
|
79
|
+
xl: '0 20px 25px rgba(0,0,0,0.15)',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
style={{
|
|
85
|
+
backgroundColor: '#1e1e1e',
|
|
86
|
+
padding: paddings[padding],
|
|
87
|
+
borderRadius: radii[radius],
|
|
88
|
+
boxShadow: shadows[shadow],
|
|
89
|
+
border: withBorder ? '1px solid #27272a' : 'none',
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
{children}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const PlaceholderText: React.FC<{
|
|
98
|
+
children?: React.ReactNode;
|
|
99
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
100
|
+
weight?: number;
|
|
101
|
+
color?: string;
|
|
102
|
+
align?: 'left' | 'center' | 'right';
|
|
103
|
+
}> = ({ children, size = 'md', weight = 400, color, align = 'left' }) => {
|
|
104
|
+
const sizes = { xs: '11px', sm: '13px', md: '14px', lg: '16px', xl: '18px' };
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<p
|
|
108
|
+
style={{
|
|
109
|
+
fontSize: sizes[size],
|
|
110
|
+
fontWeight: weight,
|
|
111
|
+
color: color || '#fafafa',
|
|
112
|
+
textAlign: align,
|
|
113
|
+
margin: 0,
|
|
114
|
+
lineHeight: 1.5,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{children}
|
|
118
|
+
</p>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const PlaceholderTitle: React.FC<{
|
|
123
|
+
children?: React.ReactNode;
|
|
124
|
+
order?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
125
|
+
color?: string;
|
|
126
|
+
align?: 'left' | 'center' | 'right';
|
|
127
|
+
}> = ({ children, order = 1, color, align = 'left' }) => {
|
|
128
|
+
const sizes = {
|
|
129
|
+
1: '32px',
|
|
130
|
+
2: '28px',
|
|
131
|
+
3: '24px',
|
|
132
|
+
4: '20px',
|
|
133
|
+
5: '18px',
|
|
134
|
+
6: '16px',
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const Tag = `h${order}` as keyof JSX.IntrinsicElements;
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<Tag
|
|
141
|
+
style={{
|
|
142
|
+
fontSize: sizes[order],
|
|
143
|
+
fontWeight: 700,
|
|
144
|
+
color: color || '#fafafa',
|
|
145
|
+
textAlign: align,
|
|
146
|
+
margin: 0,
|
|
147
|
+
lineHeight: 1.25,
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{children}
|
|
151
|
+
</Tag>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const PlaceholderStack: React.FC<{
|
|
156
|
+
children?: React.ReactNode;
|
|
157
|
+
spacing?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
158
|
+
align?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
|
|
159
|
+
}> = ({ children, spacing = 'md', align = 'stretch' }) => {
|
|
160
|
+
const spacings = { xs: '4px', sm: '8px', md: '16px', lg: '24px', xl: '32px' };
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div
|
|
164
|
+
style={{
|
|
165
|
+
display: 'flex',
|
|
166
|
+
flexDirection: 'column',
|
|
167
|
+
gap: spacings[spacing],
|
|
168
|
+
alignItems: align,
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
{children}
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const PlaceholderGroup: React.FC<{
|
|
177
|
+
children?: React.ReactNode;
|
|
178
|
+
spacing?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
179
|
+
justify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
|
|
180
|
+
align?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
|
|
181
|
+
wrap?: 'wrap' | 'nowrap';
|
|
182
|
+
}> = ({ children, spacing = 'md', justify = 'flex-start', align = 'center', wrap = 'wrap' }) => {
|
|
183
|
+
const spacings = { xs: '4px', sm: '8px', md: '16px', lg: '24px', xl: '32px' };
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<div
|
|
187
|
+
style={{
|
|
188
|
+
display: 'flex',
|
|
189
|
+
flexDirection: 'row',
|
|
190
|
+
gap: spacings[spacing],
|
|
191
|
+
justifyContent: justify,
|
|
192
|
+
alignItems: align,
|
|
193
|
+
flexWrap: wrap,
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{children}
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const PlaceholderBadge: React.FC<{
|
|
202
|
+
children?: React.ReactNode;
|
|
203
|
+
color?: string;
|
|
204
|
+
variant?: 'filled' | 'outline' | 'light';
|
|
205
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
206
|
+
}> = ({ children, color = '#6366f1', variant = 'light', size = 'md' }) => {
|
|
207
|
+
const sizes = {
|
|
208
|
+
xs: { padding: '2px 6px', fontSize: '10px' },
|
|
209
|
+
sm: { padding: '3px 8px', fontSize: '11px' },
|
|
210
|
+
md: { padding: '4px 10px', fontSize: '12px' },
|
|
211
|
+
lg: { padding: '5px 12px', fontSize: '13px' },
|
|
212
|
+
xl: { padding: '6px 14px', fontSize: '14px' },
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const variantStyles: Record<string, React.CSSProperties> = {
|
|
216
|
+
filled: { backgroundColor: color, color: 'white' },
|
|
217
|
+
outline: { backgroundColor: 'transparent', border: `1px solid ${color}`, color },
|
|
218
|
+
light: { backgroundColor: `${color}20`, color },
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<span
|
|
223
|
+
style={{
|
|
224
|
+
...sizes[size],
|
|
225
|
+
...variantStyles[variant],
|
|
226
|
+
borderRadius: '9999px',
|
|
227
|
+
fontWeight: 500,
|
|
228
|
+
display: 'inline-flex',
|
|
229
|
+
alignItems: 'center',
|
|
230
|
+
justifyContent: 'center',
|
|
231
|
+
}}
|
|
232
|
+
>
|
|
233
|
+
{children}
|
|
234
|
+
</span>
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const PlaceholderTextInput: React.FC<{
|
|
239
|
+
label?: string;
|
|
240
|
+
placeholder?: string;
|
|
241
|
+
value?: string;
|
|
242
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
243
|
+
disabled?: boolean;
|
|
244
|
+
error?: string;
|
|
245
|
+
description?: string;
|
|
246
|
+
}> = ({ label, placeholder, value, onChange, disabled, error, description }) => {
|
|
247
|
+
return (
|
|
248
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
|
|
249
|
+
{label && (
|
|
250
|
+
<label style={{ fontSize: '14px', fontWeight: 500, color: '#fafafa' }}>
|
|
251
|
+
{label}
|
|
252
|
+
</label>
|
|
253
|
+
)}
|
|
254
|
+
{description && (
|
|
255
|
+
<span style={{ fontSize: '12px', color: '#71717a' }}>{description}</span>
|
|
256
|
+
)}
|
|
257
|
+
<input
|
|
258
|
+
type="text"
|
|
259
|
+
placeholder={placeholder}
|
|
260
|
+
value={value}
|
|
261
|
+
onChange={onChange}
|
|
262
|
+
disabled={disabled}
|
|
263
|
+
style={{
|
|
264
|
+
padding: '8px 12px',
|
|
265
|
+
fontSize: '14px',
|
|
266
|
+
borderRadius: '6px',
|
|
267
|
+
border: `1px solid ${error ? '#ef4444' : '#27272a'}`,
|
|
268
|
+
backgroundColor: '#1a1a1a',
|
|
269
|
+
color: '#fafafa',
|
|
270
|
+
outline: 'none',
|
|
271
|
+
opacity: disabled ? 0.5 : 1,
|
|
272
|
+
}}
|
|
273
|
+
/>
|
|
274
|
+
{error && <span style={{ fontSize: '12px', color: '#ef4444' }}>{error}</span>}
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// Component registry - maps component names to their implementations
|
|
280
|
+
// This will be replaced with actual component imports at build time
|
|
281
|
+
export const componentRegistry: Record<string, React.ComponentType<any>> = {
|
|
282
|
+
Button: PlaceholderButton,
|
|
283
|
+
Card: PlaceholderCard,
|
|
284
|
+
Text: PlaceholderText,
|
|
285
|
+
Title: PlaceholderTitle,
|
|
286
|
+
Stack: PlaceholderStack,
|
|
287
|
+
Group: PlaceholderGroup,
|
|
288
|
+
Badge: PlaceholderBadge,
|
|
289
|
+
TextInput: PlaceholderTextInput,
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// List of available component names
|
|
293
|
+
export const availableComponents = [
|
|
294
|
+
'Button',
|
|
295
|
+
'Card',
|
|
296
|
+
'Text',
|
|
297
|
+
'Title',
|
|
298
|
+
'Stack',
|
|
299
|
+
'Group',
|
|
300
|
+
'Badge',
|
|
301
|
+
'TextInput',
|
|
302
|
+
];
|
|
303
|
+
|
|
304
|
+
// Export React for use in compiled code
|
|
305
|
+
export { React };
|
|
306
|
+
|
|
307
|
+
// Helper to get a component by name
|
|
308
|
+
export function getComponent(name: string): React.ComponentType<any> | undefined {
|
|
309
|
+
return componentRegistry[name];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Check if a component exists
|
|
313
|
+
export function hasComponent(name: string): boolean {
|
|
314
|
+
return name in componentRegistry;
|
|
315
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Considerations - Template File
|
|
3
|
+
*
|
|
4
|
+
* This file is replaced during build with design-system-specific
|
|
5
|
+
* instructions from your story-ui-considerations.md file.
|
|
6
|
+
*
|
|
7
|
+
* To customize AI behavior:
|
|
8
|
+
* 1. Create story-ui-considerations.md in your project root
|
|
9
|
+
* 2. Define your design system's rules, patterns, and common mistakes
|
|
10
|
+
* 3. Run the build - this file gets auto-generated
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Default empty considerations - replaced during build
|
|
14
|
+
export const aiConsiderations = '';
|
|
15
|
+
|
|
16
|
+
export const hasConsiderations = false;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production App Global Styles
|
|
3
|
+
*
|
|
4
|
+
* Dark theme styles for the Story UI production app.
|
|
5
|
+
* Provides a modern, Lovable/Bolt-inspired aesthetic.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* Reset */
|
|
9
|
+
*, *::before, *::after {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Root variables */
|
|
16
|
+
:root {
|
|
17
|
+
/* Dark theme colors */
|
|
18
|
+
--color-bg-primary: #0a0a0a;
|
|
19
|
+
--color-bg-secondary: #111111;
|
|
20
|
+
--color-bg-tertiary: #1a1a1a;
|
|
21
|
+
--color-bg-elevated: #1e1e1e;
|
|
22
|
+
--color-bg-hover: #262626;
|
|
23
|
+
|
|
24
|
+
/* Text colors */
|
|
25
|
+
--color-text-primary: #fafafa;
|
|
26
|
+
--color-text-secondary: #a1a1a1;
|
|
27
|
+
--color-text-tertiary: #71717a;
|
|
28
|
+
--color-text-muted: #52525b;
|
|
29
|
+
|
|
30
|
+
/* Accent colors */
|
|
31
|
+
--color-accent-primary: #6366f1;
|
|
32
|
+
--color-accent-primary-hover: #4f46e5;
|
|
33
|
+
--color-accent-secondary: #8b5cf6;
|
|
34
|
+
|
|
35
|
+
/* Status colors */
|
|
36
|
+
--color-success: #22c55e;
|
|
37
|
+
--color-error: #ef4444;
|
|
38
|
+
--color-warning: #f59e0b;
|
|
39
|
+
--color-info: #3b82f6;
|
|
40
|
+
|
|
41
|
+
/* Border colors */
|
|
42
|
+
--color-border: #27272a;
|
|
43
|
+
--color-border-subtle: #1f1f1f;
|
|
44
|
+
--color-border-focus: #6366f1;
|
|
45
|
+
|
|
46
|
+
/* Spacing */
|
|
47
|
+
--spacing-xs: 4px;
|
|
48
|
+
--spacing-sm: 8px;
|
|
49
|
+
--spacing-md: 16px;
|
|
50
|
+
--spacing-lg: 24px;
|
|
51
|
+
--spacing-xl: 32px;
|
|
52
|
+
--spacing-2xl: 48px;
|
|
53
|
+
|
|
54
|
+
/* Border radius */
|
|
55
|
+
--radius-sm: 4px;
|
|
56
|
+
--radius-md: 8px;
|
|
57
|
+
--radius-lg: 12px;
|
|
58
|
+
--radius-xl: 16px;
|
|
59
|
+
--radius-full: 9999px;
|
|
60
|
+
|
|
61
|
+
/* Transitions */
|
|
62
|
+
--transition-fast: 150ms ease;
|
|
63
|
+
--transition-normal: 200ms ease;
|
|
64
|
+
--transition-slow: 300ms ease;
|
|
65
|
+
|
|
66
|
+
/* Shadows */
|
|
67
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
68
|
+
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
|
|
69
|
+
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
|
|
70
|
+
--shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
|
|
71
|
+
|
|
72
|
+
/* Typography */
|
|
73
|
+
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
74
|
+
--font-mono: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
|
|
75
|
+
|
|
76
|
+
--font-size-xs: 11px;
|
|
77
|
+
--font-size-sm: 13px;
|
|
78
|
+
--font-size-md: 14px;
|
|
79
|
+
--font-size-lg: 16px;
|
|
80
|
+
--font-size-xl: 18px;
|
|
81
|
+
--font-size-2xl: 24px;
|
|
82
|
+
--font-size-3xl: 32px;
|
|
83
|
+
|
|
84
|
+
--line-height-tight: 1.25;
|
|
85
|
+
--line-height-normal: 1.5;
|
|
86
|
+
--line-height-relaxed: 1.75;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Base styles */
|
|
90
|
+
html {
|
|
91
|
+
font-size: 16px;
|
|
92
|
+
-webkit-font-smoothing: antialiased;
|
|
93
|
+
-moz-osx-font-smoothing: grayscale;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
body {
|
|
97
|
+
font-family: var(--font-sans);
|
|
98
|
+
font-size: var(--font-size-md);
|
|
99
|
+
line-height: var(--line-height-normal);
|
|
100
|
+
color: var(--color-text-primary);
|
|
101
|
+
background-color: var(--color-bg-primary);
|
|
102
|
+
min-height: 100vh;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
#root {
|
|
107
|
+
height: 100vh;
|
|
108
|
+
width: 100vw;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Scrollbar styling */
|
|
113
|
+
::-webkit-scrollbar {
|
|
114
|
+
width: 8px;
|
|
115
|
+
height: 8px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
::-webkit-scrollbar-track {
|
|
119
|
+
background: var(--color-bg-secondary);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
::-webkit-scrollbar-thumb {
|
|
123
|
+
background: var(--color-border);
|
|
124
|
+
border-radius: var(--radius-full);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
::-webkit-scrollbar-thumb:hover {
|
|
128
|
+
background: var(--color-text-tertiary);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Selection styling */
|
|
132
|
+
::selection {
|
|
133
|
+
background-color: var(--color-accent-primary);
|
|
134
|
+
color: white;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Focus styles */
|
|
138
|
+
:focus-visible {
|
|
139
|
+
outline: 2px solid var(--color-border-focus);
|
|
140
|
+
outline-offset: 2px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Button reset */
|
|
144
|
+
button {
|
|
145
|
+
font-family: inherit;
|
|
146
|
+
font-size: inherit;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
border: none;
|
|
149
|
+
background: none;
|
|
150
|
+
color: inherit;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Input reset */
|
|
154
|
+
input, textarea {
|
|
155
|
+
font-family: inherit;
|
|
156
|
+
font-size: inherit;
|
|
157
|
+
color: inherit;
|
|
158
|
+
background: transparent;
|
|
159
|
+
border: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
input::placeholder,
|
|
163
|
+
textarea::placeholder {
|
|
164
|
+
color: var(--color-text-tertiary);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Link reset */
|
|
168
|
+
a {
|
|
169
|
+
color: var(--color-accent-primary);
|
|
170
|
+
text-decoration: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
a:hover {
|
|
174
|
+
text-decoration: underline;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Code styling */
|
|
178
|
+
code {
|
|
179
|
+
font-family: var(--font-mono);
|
|
180
|
+
font-size: 0.9em;
|
|
181
|
+
background-color: var(--color-bg-tertiary);
|
|
182
|
+
padding: 2px 6px;
|
|
183
|
+
border-radius: var(--radius-sm);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
pre {
|
|
187
|
+
font-family: var(--font-mono);
|
|
188
|
+
font-size: var(--font-size-sm);
|
|
189
|
+
background-color: var(--color-bg-tertiary);
|
|
190
|
+
padding: var(--spacing-md);
|
|
191
|
+
border-radius: var(--radius-md);
|
|
192
|
+
overflow-x: auto;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
pre code {
|
|
196
|
+
background: none;
|
|
197
|
+
padding: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* Utility classes */
|
|
201
|
+
.sr-only {
|
|
202
|
+
position: absolute;
|
|
203
|
+
width: 1px;
|
|
204
|
+
height: 1px;
|
|
205
|
+
padding: 0;
|
|
206
|
+
margin: -1px;
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
clip: rect(0, 0, 0, 0);
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
border: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Animation keyframes */
|
|
214
|
+
@keyframes fadeIn {
|
|
215
|
+
from {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
to {
|
|
219
|
+
opacity: 1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@keyframes slideUp {
|
|
224
|
+
from {
|
|
225
|
+
opacity: 0;
|
|
226
|
+
transform: translateY(10px);
|
|
227
|
+
}
|
|
228
|
+
to {
|
|
229
|
+
opacity: 1;
|
|
230
|
+
transform: translateY(0);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@keyframes pulse {
|
|
235
|
+
0%, 100% {
|
|
236
|
+
opacity: 1;
|
|
237
|
+
}
|
|
238
|
+
50% {
|
|
239
|
+
opacity: 0.5;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@keyframes spin {
|
|
244
|
+
from {
|
|
245
|
+
transform: rotate(0deg);
|
|
246
|
+
}
|
|
247
|
+
to {
|
|
248
|
+
transform: rotate(360deg);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.animate-fade-in {
|
|
253
|
+
animation: fadeIn var(--transition-normal) ease-out;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.animate-slide-up {
|
|
257
|
+
animation: slideUp var(--transition-normal) ease-out;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.animate-pulse {
|
|
261
|
+
animation: pulse 2s infinite;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.animate-spin {
|
|
265
|
+
animation: spin 1s linear infinite;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* Loading dots animation */
|
|
269
|
+
@keyframes loadingDots {
|
|
270
|
+
0%, 20% {
|
|
271
|
+
content: '.';
|
|
272
|
+
}
|
|
273
|
+
40% {
|
|
274
|
+
content: '..';
|
|
275
|
+
}
|
|
276
|
+
60%, 100% {
|
|
277
|
+
content: '...';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.loading-dots::after {
|
|
282
|
+
content: '.';
|
|
283
|
+
animation: loadingDots 1.5s infinite;
|
|
284
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production App Entry Point
|
|
3
|
+
*
|
|
4
|
+
* This is the main entry point for the Story UI production app.
|
|
5
|
+
* It renders the main App component which provides the Lovable/Bolt-style
|
|
6
|
+
* interface for generating and previewing UI components.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import ReactDOM from 'react-dom/client';
|
|
11
|
+
import App from './App';
|
|
12
|
+
import './index.css';
|
|
13
|
+
|
|
14
|
+
// Mount the app
|
|
15
|
+
const rootElement = document.getElementById('root');
|
|
16
|
+
|
|
17
|
+
if (!rootElement) {
|
|
18
|
+
throw new Error('Root element not found. Make sure there is a <div id="root"></div> in your HTML.');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ReactDOM.createRoot(rootElement).render(
|
|
22
|
+
<React.StrictMode>
|
|
23
|
+
<App />
|
|
24
|
+
</React.StrictMode>
|
|
25
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
/* Path aliases */
|
|
24
|
+
"baseUrl": ".",
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["./src/*"],
|
|
27
|
+
"@components/*": ["./src/components/*"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"include": ["src"],
|
|
31
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
32
|
+
}
|