@discourser/design-system 0.22.2 → 0.22.4
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/dist/figma-codex.json +2 -2
- package/docs/CSS_USAGE.md +235 -0
- package/docs/FIGMA_MAKE_SETUP.md +339 -0
- package/docs/GUIDELINES_REVIEW.md +728 -0
- package/docs/MAINTAINER_CHECKLIST.md +265 -0
- package/docs/TESTING_QUICK_REFERENCE.md +159 -0
- package/docs/TESTING_TOKENS.md +340 -0
- package/docs/active-stories/README.md +29 -0
- package/docs/active-stories/STORY-006a-figma-translation-foundations.md +324 -0
- package/docs/active-stories/STORY-006b-figma-translation-components.md +201 -0
- package/docs/active-stories/STORY-006c-figma-translation-layout-extension.md +258 -0
- package/docs/active-stories/STORY-008-kai-sidecar-fragments.md +137 -0
- package/docs/active-stories/STORY-011-verify-translation-docs.md +182 -0
- package/docs/archive/ARCHITECTURE-discourser-design-system.md +448 -0
- package/docs/claude-feed-back/ARCHITECTURE_DIAGRAM.md +243 -0
- package/docs/claude-feed-back/STYLING_VERIFICATION.md +89 -0
- package/docs/claude-feed-back/TEST_RESULTS.md +182 -0
- package/docs/context-share/ELEVATION_FIX_PLAN.md +903 -0
- package/docs/context-share/STORY-001-VALIDATION-PASSED.md +192 -0
- package/docs/context-share/STORY-002-IMPLEMENTATION-COMPLETE.md +161 -0
- package/docs/context-share/STORYBOOK_MCP_STRATEGY.md +867 -0
- package/docs/context-share/TESTING_GAPS_FILLED.md +353 -0
- package/docs/context-share/TOKEN_TESTING_SUMMARY.md +388 -0
- package/docs/context-share/code-connect-prompt.md +90 -0
- package/docs/context-share/dds-autonomous-pipeline.md +765 -0
- package/docs/context-share/fix-checkbox-radio-tokens.md +145 -0
- package/docs/context-share/icon-component-prompt.md +154 -0
- package/docs/context-share/icons/Audience.svg +3 -0
- package/docs/context-share/icons/AudioSpeaker.svg +3 -0
- package/docs/context-share/icons/BookmarkPlus.svg +3 -0
- package/docs/context-share/icons/ClipBoard.svg +8 -0
- package/docs/context-share/icons/DiscourserLogo.svg +4 -0
- package/docs/context-share/icons/ExitStudio.svg +4 -0
- package/docs/context-share/icons/Microphone.svg +5 -0
- package/docs/context-share/icons/NotebookPen.svg +3 -0
- package/docs/context-share/icons/PausePlay.svg +5 -0
- package/docs/context-share/icons/Play.svg +4 -0
- package/docs/context-share/icons/Record.svg +6 -0
- package/docs/context-share/icons/RepeatQuestion.svg +3 -0
- package/docs/context-share/icons/ScrollText.svg +3 -0
- package/docs/context-share/icons/Sparkles.svg +3 -0
- package/docs/context-share/icons/Speech.svg +3 -0
- package/docs/context-share/icons/StopPlay.svg +4 -0
- package/docs/context-share/icons/Timer.svg +3 -0
- package/docs/context-share/icons/UserProfile.svg +3 -0
- package/docs/context-share/m3-token-pipeline-audit.md +125 -0
- package/docs/context-share/storybook-mcp-kai-agent-revised-summary.md +211 -0
- package/docs/discourser-design-system-prd.md +3698 -0
- package/docs/figma-captures/01-typography.png +0 -0
- package/docs/figma-captures/02-button-iconbutton.png +0 -0
- package/docs/figma-captures/03-form-inputs.png +0 -0
- package/docs/figma-captures/04-form-controls.png +0 -0
- package/docs/figma-captures/05-data-display.png +0 -0
- package/docs/figma-captures/06-feedback.png +0 -0
- package/docs/figma-captures/07-overlays.png +0 -0
- package/docs/figma-captures/08-navigation-layout.png +0 -0
- package/docs/figma-captures/09-custom-components.png +0 -0
- package/docs/figma-captures/10-scenario-queue.png +0 -0
- package/docs/figma-captures/11-icon-library.png +0 -0
- package/docs/figma-make-docs/01-understanding-templates.md +235 -0
- package/docs/figma-make-docs/02-prerequisites.md +266 -0
- package/docs/figma-make-docs/03-creating-template.md +306 -0
- package/docs/figma-make-docs/04-adding-guidelines.md +448 -0
- package/docs/figma-make-docs/05-example-starter-code.md +590 -0
- package/docs/figma-make-docs/06-publishing-template.md +417 -0
- package/docs/figma-make-docs/07-maintenance.md +536 -0
- package/docs/figma-make-docs/08-faq.md +490 -0
- package/docs/figma-make-docs/README.md +95 -0
- package/docs/material-theme.json +418 -0
- package/docs/plans/2026-03-12-figma-token-export-rewrite.md +504 -0
- package/docs/plans/2026-03-12-step7-panda-token-resolution-design.md +119 -0
- package/docs/plans/2026-03-12-step7-panda-token-resolution.md +993 -0
- package/docs/token-name-mapping.json +850 -0
- package/docs/token-name-mapping.md +251 -0
- package/package.json +3 -2
package/dist/figma-codex.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"packageName": "@discourser/design-system",
|
|
4
|
-
"generatedAt": "2026-03-
|
|
5
|
-
"gitHash": "
|
|
4
|
+
"generatedAt": "2026-03-14T18:14:13.010Z",
|
|
5
|
+
"gitHash": "50bebdde",
|
|
6
6
|
"figmaFiles": {
|
|
7
7
|
"GaHmFfmvO4loUzuZS4TgEz": {
|
|
8
8
|
"fileKey": "GaHmFfmvO4loUzuZS4TgEz"
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Using Pre-compiled CSS
|
|
2
|
+
|
|
3
|
+
As of version 0.4.1, `@discourser/design-system` ships with pre-compiled CSS for easy integration with any project.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @discourser/design-system react react-dom
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Basic Usage
|
|
14
|
+
|
|
15
|
+
Simply import the pre-compiled CSS and start using components:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
// Import the pre-compiled CSS (do this once in your app entry point)
|
|
19
|
+
import '@discourser/design-system/styles.css';
|
|
20
|
+
|
|
21
|
+
// Import components
|
|
22
|
+
import { Button, Card, Input } from '@discourser/design-system';
|
|
23
|
+
|
|
24
|
+
function App() {
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<Card variant="elevated">
|
|
28
|
+
<h1>Welcome</h1>
|
|
29
|
+
<Input label="Email" type="email" />
|
|
30
|
+
<Button variant="filled">Submit</Button>
|
|
31
|
+
</Card>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Theme Support
|
|
38
|
+
|
|
39
|
+
The pre-compiled CSS includes both light and dark theme support. Set the `data-theme` attribute on your HTML element:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
// Light theme (default)
|
|
43
|
+
<html data-theme="light">
|
|
44
|
+
<body>
|
|
45
|
+
<App />
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
48
|
+
|
|
49
|
+
// Dark theme
|
|
50
|
+
<html data-theme="dark">
|
|
51
|
+
<body>
|
|
52
|
+
<App />
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You can toggle themes dynamically:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
function ThemeToggle() {
|
|
61
|
+
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
65
|
+
}, [theme]);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
|
|
69
|
+
Toggle Theme
|
|
70
|
+
</Button>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## What's Included
|
|
76
|
+
|
|
77
|
+
The pre-compiled `styles.css` file (144KB) includes:
|
|
78
|
+
|
|
79
|
+
- ✅ All semantic color tokens (primary, surface, onPrimary, etc.)
|
|
80
|
+
- ✅ All typography tokens (displayLarge through labelSmall)
|
|
81
|
+
- ✅ All spacing tokens (none through xxxl)
|
|
82
|
+
- ✅ All component recipes (button, card, dialog, input, etc.)
|
|
83
|
+
- ✅ Light and dark theme support via `[data-theme="light"]` and `[data-theme="dark"]`
|
|
84
|
+
- ✅ CSS reset and base styles
|
|
85
|
+
- ✅ Material Design 3 design tokens
|
|
86
|
+
|
|
87
|
+
## Advanced Usage
|
|
88
|
+
|
|
89
|
+
### Using Styled System (Advanced)
|
|
90
|
+
|
|
91
|
+
For advanced styling needs, you can still import the Panda CSS styled system:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { css } from '@discourser/design-system/styled-system/css';
|
|
95
|
+
import { Button } from '@discourser/design-system';
|
|
96
|
+
|
|
97
|
+
const customStyle = css({
|
|
98
|
+
bg: 'primary',
|
|
99
|
+
color: 'onPrimary',
|
|
100
|
+
padding: 'lg',
|
|
101
|
+
borderRadius: 'md'
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
function CustomButton() {
|
|
105
|
+
return <Button className={customStyle}>Custom Styled Button</Button>;
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Without Pre-compiled CSS
|
|
110
|
+
|
|
111
|
+
If you prefer to use Panda CSS's runtime styles (for dynamic styling), you can skip importing `styles.css` and use the styled system directly. However, you'll need to set up Panda CSS in your project with `panda codegen`.
|
|
112
|
+
|
|
113
|
+
## Integration Examples
|
|
114
|
+
|
|
115
|
+
### Vite
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
// main.tsx
|
|
119
|
+
import '@discourser/design-system/styles.css';
|
|
120
|
+
import { createRoot } from 'react-dom/client';
|
|
121
|
+
import App from './App';
|
|
122
|
+
|
|
123
|
+
createRoot(document.getElementById('root')!).render(<App />);
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Next.js (App Router)
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
// app/layout.tsx
|
|
130
|
+
import '@discourser/design-system/styles.css';
|
|
131
|
+
|
|
132
|
+
export default function RootLayout({
|
|
133
|
+
children,
|
|
134
|
+
}: {
|
|
135
|
+
children: React.ReactNode;
|
|
136
|
+
}) {
|
|
137
|
+
return (
|
|
138
|
+
<html lang="en" data-theme="light">
|
|
139
|
+
<body>{children}</body>
|
|
140
|
+
</html>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Next.js (Pages Router)
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// pages/_app.tsx
|
|
149
|
+
import '@discourser/design-system/styles.css';
|
|
150
|
+
import type { AppProps } from 'next/app';
|
|
151
|
+
|
|
152
|
+
export default function App({ Component, pageProps }: AppProps) {
|
|
153
|
+
return <Component {...pageProps} />;
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Figma Make Integration
|
|
158
|
+
|
|
159
|
+
The pre-compiled CSS enables seamless integration with Figma Make. Simply install the package and it will automatically use the pre-compiled styles for AI-generated designs.
|
|
160
|
+
|
|
161
|
+
## File Size
|
|
162
|
+
|
|
163
|
+
The pre-compiled CSS file is optimized and includes only the styles you need:
|
|
164
|
+
|
|
165
|
+
- **Size**: 144KB (uncompressed)
|
|
166
|
+
- **Gzipped**: ~20-25KB (estimated)
|
|
167
|
+
- **Includes**: All tokens, recipes, and theme styles
|
|
168
|
+
|
|
169
|
+
## Migration from Runtime CSS
|
|
170
|
+
|
|
171
|
+
If you were previously using runtime Panda CSS:
|
|
172
|
+
|
|
173
|
+
**Before:**
|
|
174
|
+
```tsx
|
|
175
|
+
// Had to run panda codegen
|
|
176
|
+
import { css } from '../styled-system/css';
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**After:**
|
|
180
|
+
```tsx
|
|
181
|
+
// Just import the pre-compiled CSS
|
|
182
|
+
import '@discourser/design-system/styles.css';
|
|
183
|
+
import { Button } from '@discourser/design-system';
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
No more build step required!
|
|
187
|
+
|
|
188
|
+
## Troubleshooting
|
|
189
|
+
|
|
190
|
+
### Components don't have styles
|
|
191
|
+
|
|
192
|
+
Make sure you've imported the CSS at the top of your application:
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import '@discourser/design-system/styles.css'; // Add this!
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Theme not working
|
|
199
|
+
|
|
200
|
+
Ensure the `data-theme` attribute is set on your HTML element:
|
|
201
|
+
|
|
202
|
+
```html
|
|
203
|
+
<html data-theme="light"> <!-- or "dark" -->
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### CSS conflicts with other libraries
|
|
207
|
+
|
|
208
|
+
The design system uses CSS layers to prevent conflicts:
|
|
209
|
+
|
|
210
|
+
```css
|
|
211
|
+
@layer reset, base, tokens, recipes, utilities;
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
If you still have conflicts, you may need to adjust your CSS loading order.
|
|
215
|
+
|
|
216
|
+
## Package Exports
|
|
217
|
+
|
|
218
|
+
The package exports the following:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
".": "./dist/index.js",
|
|
223
|
+
"./styles.css": "./dist/styles.css",
|
|
224
|
+
"./styled-system": "./styled-system/index.mjs",
|
|
225
|
+
"./styled-system/css": "./styled-system/css/index.mjs",
|
|
226
|
+
"./styled-system/tokens": "./styled-system/tokens/index.mjs",
|
|
227
|
+
"./styled-system/recipes": "./styled-system/recipes/index.mjs"
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Questions?
|
|
232
|
+
|
|
233
|
+
- **Documentation**: See the [guidelines folder](./guidelines/) for complete component documentation
|
|
234
|
+
- **GitHub**: https://github.com/Tasty-Maker-Studio/Discourser-Design-System
|
|
235
|
+
- **Issues**: https://github.com/Tasty-Maker-Studio/Discourser-Design-System/issues
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Figma Make Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide walks you through integrating the Discourser Design System with Figma Make for AI-powered design generation.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Figma Make allows AI to generate designs using your design system package and guidelines. This integration enables you to:
|
|
8
|
+
|
|
9
|
+
- Generate UI components following your design system patterns
|
|
10
|
+
- Ensure AI-generated designs use proper tokens and components
|
|
11
|
+
- Test design variations quickly
|
|
12
|
+
- Maintain consistency across AI-generated designs
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Figma account with access to Figma Make
|
|
17
|
+
- Node.js 18+ and npm/pnpm installed
|
|
18
|
+
- Design system published to npm (v0.3.1+)
|
|
19
|
+
|
|
20
|
+
## Step 1: Publish Updated Package
|
|
21
|
+
|
|
22
|
+
The guidelines folder must be included in the npm package for Figma Make to access them.
|
|
23
|
+
|
|
24
|
+
### 1.1 Verify Changes
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd /Users/willstreeter/WebstormProjects/vibe-coding/shifu-project/Discourser-Design-System
|
|
28
|
+
|
|
29
|
+
# Verify guidelines are in package.json files array
|
|
30
|
+
cat package.json | grep -A 3 '"files"'
|
|
31
|
+
# Should show: "dist", "styled-system", "guidelines"
|
|
32
|
+
|
|
33
|
+
# Verify changeset exists
|
|
34
|
+
ls .changeset/*.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 1.2 Create Pull Request
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Stage changes
|
|
41
|
+
git add package.json .changeset/add-guidelines-to-package.md
|
|
42
|
+
|
|
43
|
+
# Commit changes
|
|
44
|
+
git commit -m "$(cat <<'EOF'
|
|
45
|
+
feat: add guidelines to npm package for Figma Make
|
|
46
|
+
|
|
47
|
+
- Include guidelines folder in published package
|
|
48
|
+
- Enable Figma Make integration with AI guidelines
|
|
49
|
+
- Support AI-powered design generation
|
|
50
|
+
|
|
51
|
+
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
52
|
+
EOF
|
|
53
|
+
)"
|
|
54
|
+
|
|
55
|
+
# Push to branch
|
|
56
|
+
git push origin feat/figma-make-integration
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 1.3 Merge and Publish
|
|
60
|
+
|
|
61
|
+
1. Create PR on GitHub
|
|
62
|
+
2. Merge PR to main
|
|
63
|
+
3. Release workflow will create version bump PR
|
|
64
|
+
4. Merge version bump PR to trigger npm publish
|
|
65
|
+
5. Verify package published with guidelines:
|
|
66
|
+
```bash
|
|
67
|
+
npm view @discourser/design-system
|
|
68
|
+
# Check "files" list includes "guidelines"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Step 2: Set Up in Figma Make
|
|
72
|
+
|
|
73
|
+
### 2.1 Access Figma Make
|
|
74
|
+
|
|
75
|
+
1. Open Figma Desktop or Web App
|
|
76
|
+
2. Navigate to **File → Make**
|
|
77
|
+
3. Select **Bring your design system**
|
|
78
|
+
|
|
79
|
+
### 2.2 Connect NPM Package
|
|
80
|
+
|
|
81
|
+
1. In the Figma Make interface:
|
|
82
|
+
- Click **Add npm package**
|
|
83
|
+
- Enter package name: `@discourser/design-system`
|
|
84
|
+
- Select version: `latest` (should be 0.3.1+)
|
|
85
|
+
- Click **Install**
|
|
86
|
+
|
|
87
|
+
2. Wait for package installation (may take 1-2 minutes)
|
|
88
|
+
|
|
89
|
+
3. Figma Make will automatically detect:
|
|
90
|
+
- `guidelines/Guidelines.md` as entry point
|
|
91
|
+
- Component documentation in `guidelines/components/`
|
|
92
|
+
- Token documentation in `guidelines/design-tokens/`
|
|
93
|
+
|
|
94
|
+
### 2.3 Verify Installation
|
|
95
|
+
|
|
96
|
+
Check that Figma Make shows:
|
|
97
|
+
|
|
98
|
+
- ✅ Package installed: `@discourser/design-system@0.3.1`
|
|
99
|
+
- ✅ Guidelines detected: `guidelines/Guidelines.md`
|
|
100
|
+
- ✅ Components found: Button, Card, Dialog, Input, IconButton, Switch
|
|
101
|
+
- ✅ Tokens found: Colors, Typography, Spacing, Elevation
|
|
102
|
+
|
|
103
|
+
## Step 3: Test AI Generation
|
|
104
|
+
|
|
105
|
+
### 3.1 Create Test File
|
|
106
|
+
|
|
107
|
+
1. In Figma Make, create a new file
|
|
108
|
+
2. The AI should now have access to your design system
|
|
109
|
+
|
|
110
|
+
### 3.2 Test Prompts
|
|
111
|
+
|
|
112
|
+
Try these prompts to test the integration:
|
|
113
|
+
|
|
114
|
+
#### Basic Component Test
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Create a login form using the Discourser design system with:
|
|
118
|
+
- Email input field
|
|
119
|
+
- Password input field
|
|
120
|
+
- Submit button (filled variant)
|
|
121
|
+
- "Forgot password?" link button (text variant)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Expected result:
|
|
125
|
+
|
|
126
|
+
- Uses `<Input>` component with proper labels
|
|
127
|
+
- Uses `<Button>` components with correct variants
|
|
128
|
+
- Follows spacing guidelines
|
|
129
|
+
- Uses semantic color tokens
|
|
130
|
+
|
|
131
|
+
#### Color Token Test
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Create a Card component with:
|
|
135
|
+
- Primary color header
|
|
136
|
+
- Surface container background
|
|
137
|
+
- Elevated variant
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Expected result:
|
|
141
|
+
|
|
142
|
+
- Uses `<Card variant="elevated">`
|
|
143
|
+
- Header uses `bg: 'primary'` and `color: 'onPrimary'`
|
|
144
|
+
- Proper surface container elevation
|
|
145
|
+
|
|
146
|
+
#### Complex Layout Test
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Create a settings page with:
|
|
150
|
+
- Page heading
|
|
151
|
+
- Three sections using Cards
|
|
152
|
+
- Each section has switches for toggle options
|
|
153
|
+
- Save and Cancel buttons at bottom
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Expected result:
|
|
157
|
+
|
|
158
|
+
- Uses proper component hierarchy
|
|
159
|
+
- Consistent spacing throughout
|
|
160
|
+
- Correct button hierarchy (filled for Save, outlined for Cancel)
|
|
161
|
+
- Switch components with proper labels
|
|
162
|
+
|
|
163
|
+
### 3.3 Validation Checklist
|
|
164
|
+
|
|
165
|
+
After each generation, verify:
|
|
166
|
+
|
|
167
|
+
- [ ] Components imported from `@discourser/design-system`
|
|
168
|
+
- [ ] No native HTML elements used (no `<button>`, `<input>`, etc.)
|
|
169
|
+
- [ ] Color tokens are semantic (no hex values)
|
|
170
|
+
- [ ] Proper variant selection (filled for primary, outlined for secondary)
|
|
171
|
+
- [ ] Labels provided for all inputs
|
|
172
|
+
- [ ] Spacing uses design tokens
|
|
173
|
+
- [ ] Theme support works (data-theme attribute)
|
|
174
|
+
|
|
175
|
+
## Step 4: Common Issues and Solutions
|
|
176
|
+
|
|
177
|
+
### Issue: Guidelines Not Found
|
|
178
|
+
|
|
179
|
+
**Symptom:** Figma Make shows "No guidelines detected"
|
|
180
|
+
|
|
181
|
+
**Solutions:**
|
|
182
|
+
|
|
183
|
+
1. Verify package version is 0.3.1+
|
|
184
|
+
2. Check npm package contents:
|
|
185
|
+
```bash
|
|
186
|
+
npm pack @discourser/design-system --dry-run
|
|
187
|
+
```
|
|
188
|
+
3. Reinstall package in Figma Make
|
|
189
|
+
4. Try manually specifying guidelines path: `guidelines/Guidelines.md`
|
|
190
|
+
|
|
191
|
+
### Issue: AI Not Following Guidelines
|
|
192
|
+
|
|
193
|
+
**Symptom:** AI generates code with wrong patterns (native HTML, hex colors, etc.)
|
|
194
|
+
|
|
195
|
+
**Solutions:**
|
|
196
|
+
|
|
197
|
+
1. Be more explicit in prompts: "Use the Discourser design system components"
|
|
198
|
+
2. Add constraints: "Do not use native HTML elements"
|
|
199
|
+
3. Reference specific guideline sections: "Follow the button guidelines for variant selection"
|
|
200
|
+
4. Check if Guidelines.md is being read by AI (ask it to summarize the guidelines)
|
|
201
|
+
|
|
202
|
+
### Issue: Components Not Importing
|
|
203
|
+
|
|
204
|
+
**Symptom:** Generated code has import errors
|
|
205
|
+
|
|
206
|
+
**Solutions:**
|
|
207
|
+
|
|
208
|
+
1. Verify React peer dependencies: `react>=19.0.0`, `react-dom>=19.0.0`
|
|
209
|
+
2. Check package exports in package.json
|
|
210
|
+
3. Ensure generated imports match export structure:
|
|
211
|
+
```typescript
|
|
212
|
+
// Correct
|
|
213
|
+
import { Button } from '@discourser/design-system';
|
|
214
|
+
import { css } from '@discourser/design-system/styled-system/css';
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Issue: Wrong Semantic Tokens
|
|
218
|
+
|
|
219
|
+
**Symptom:** AI uses wrong token names or hex values
|
|
220
|
+
|
|
221
|
+
**Solutions:**
|
|
222
|
+
|
|
223
|
+
1. Reference color guidelines: "Follow the color token guidelines"
|
|
224
|
+
2. Be specific: "Use primary and onPrimary semantic tokens"
|
|
225
|
+
3. Check if `design-tokens/colors.md` is accessible
|
|
226
|
+
|
|
227
|
+
## Step 5: Advanced Usage
|
|
228
|
+
|
|
229
|
+
### Creating Templates
|
|
230
|
+
|
|
231
|
+
Once your design system works in Figma Make, create reusable templates:
|
|
232
|
+
|
|
233
|
+
1. Generate a well-structured component
|
|
234
|
+
2. Save as template in Figma Make
|
|
235
|
+
3. Name clearly: "Login Form - Discourser DS"
|
|
236
|
+
4. Add description with key patterns used
|
|
237
|
+
5. Share with team
|
|
238
|
+
|
|
239
|
+
### Iterating on Designs
|
|
240
|
+
|
|
241
|
+
Use Figma Make's iteration features:
|
|
242
|
+
|
|
243
|
+
1. Generate initial design
|
|
244
|
+
2. Request variations: "Make it more compact"
|
|
245
|
+
3. Refine: "Use tonal variant for secondary action"
|
|
246
|
+
4. Export final code
|
|
247
|
+
|
|
248
|
+
### Team Onboarding
|
|
249
|
+
|
|
250
|
+
Use Figma Make as teaching tool:
|
|
251
|
+
|
|
252
|
+
1. New team members can explore design system through AI
|
|
253
|
+
2. Generate examples to understand patterns
|
|
254
|
+
3. Learn proper component usage through generated code
|
|
255
|
+
4. Build familiarity with token system
|
|
256
|
+
|
|
257
|
+
## Guidelines Structure Reference
|
|
258
|
+
|
|
259
|
+
Your guidelines are already optimally structured for Figma Make:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
guidelines/
|
|
263
|
+
├── Guidelines.md # Entry point (REQUIRED)
|
|
264
|
+
├── overview-components.md # Component overview
|
|
265
|
+
├── design-tokens/ # Token documentation
|
|
266
|
+
│ ├── colors.md # Semantic color tokens
|
|
267
|
+
│ ├── typography.md # Text styles
|
|
268
|
+
│ ├── spacing.md # Space scale
|
|
269
|
+
│ └── elevation.md # Elevation system
|
|
270
|
+
└── components/ # Component documentation
|
|
271
|
+
├── button.md # Button component
|
|
272
|
+
├── card.md # Card component
|
|
273
|
+
├── dialog.md # Dialog component
|
|
274
|
+
├── icon-button.md # IconButton component
|
|
275
|
+
├── input.md # Input component
|
|
276
|
+
└── switch.md # Switch component
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Best Practices
|
|
280
|
+
|
|
281
|
+
### Writing Effective Prompts
|
|
282
|
+
|
|
283
|
+
✅ **Good Prompts:**
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
Create a user profile card using Discourser design system:
|
|
287
|
+
- Card with elevated variant
|
|
288
|
+
- Avatar image (use placeholder)
|
|
289
|
+
- Name as heading size md
|
|
290
|
+
- Bio text with onSurfaceVariant color
|
|
291
|
+
- Edit button with outlined variant
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
❌ **Poor Prompts:**
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
Make a profile card
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Monitoring AI Behavior
|
|
301
|
+
|
|
302
|
+
Track how well AI follows guidelines:
|
|
303
|
+
|
|
304
|
+
- Document patterns AI handles well
|
|
305
|
+
- Note areas where AI deviates
|
|
306
|
+
- Update guidelines to address gaps
|
|
307
|
+
- Share findings with team
|
|
308
|
+
|
|
309
|
+
### Continuous Improvement
|
|
310
|
+
|
|
311
|
+
Improve integration over time:
|
|
312
|
+
|
|
313
|
+
1. Collect examples of good/bad AI generations
|
|
314
|
+
2. Identify guideline gaps
|
|
315
|
+
3. Enhance component documentation
|
|
316
|
+
4. Add more DO/DON'T examples
|
|
317
|
+
5. Republish package with improvements
|
|
318
|
+
|
|
319
|
+
## Resources
|
|
320
|
+
|
|
321
|
+
- Figma Make Documentation: https://developers.figma.com/docs/code
|
|
322
|
+
- Package on npm: https://www.npmjs.com/package/@discourser/design-system
|
|
323
|
+
- Repository: https://github.com/Tasty-Maker-Studio/Discourser-Design-System
|
|
324
|
+
- Storybook: https://discourser-design-system.netlify.app/
|
|
325
|
+
|
|
326
|
+
## Support
|
|
327
|
+
|
|
328
|
+
For issues or questions:
|
|
329
|
+
|
|
330
|
+
1. Check guidelines in `/guidelines` directory
|
|
331
|
+
2. Review Figma Make documentation
|
|
332
|
+
3. Open issue on GitHub
|
|
333
|
+
4. Contact maintainers
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
**Last Updated:** 2026-01-12
|
|
338
|
+
**Package Version:** 0.3.1
|
|
339
|
+
**Figma Make Support:** Yes
|