@discourser/design-system 0.22.1 → 0.22.3
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/{chunk-VJN7TIGL.js → chunk-GLPWI7OF.js} +3 -3
- package/dist/chunk-GLPWI7OF.js.map +1 -0
- package/dist/{chunk-IGCGVSG4.cjs → chunk-NN4YW27E.cjs} +3 -3
- package/dist/chunk-NN4YW27E.cjs.map +1 -0
- package/dist/figma-codex.json +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +1 -1
- package/dist/languages/transform.d.ts +1 -1
- package/dist/preset/index.cjs +2 -2
- package/dist/preset/index.js +1 -1
- package/dist/stories/foundations/components/ColorSwatch.d.ts +1 -15
- package/dist/stories/foundations/components/ColorSwatch.d.ts.map +1 -1
- package/dist/stories/foundations/components/ElevationCard.d.ts +3 -6
- package/dist/stories/foundations/components/ElevationCard.d.ts.map +1 -1
- package/dist/stories/foundations/components/SpacingBox.d.ts.map +1 -1
- package/dist/stories/foundations/components/TypeSpecimen.d.ts +2 -1
- package/dist/stories/foundations/components/TypeSpecimen.d.ts.map +1 -1
- 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 +6 -4
- package/src/languages/transform.ts +1 -1
- package/src/stories/foundations/Borders.stories.tsx +138 -0
- package/src/stories/foundations/ColorScale.stories.tsx +737 -0
- package/src/stories/foundations/Colors.mdx +2 -131
- package/src/stories/foundations/Elevation.mdx +26 -45
- package/src/stories/foundations/Motion.stories.tsx +306 -0
- package/src/stories/foundations/Shape.stories.tsx +159 -0
- package/src/stories/foundations/Spacing.mdx +24 -25
- package/src/stories/foundations/Typography.mdx +93 -79
- package/src/stories/foundations/components/ColorSwatch.tsx +72 -109
- package/src/stories/foundations/components/ElevationCard.tsx +19 -22
- package/src/stories/foundations/components/SpacingBox.tsx +15 -2
- package/src/stories/foundations/components/TypeSpecimen.tsx +20 -21
- package/dist/chunk-IGCGVSG4.cjs.map +0 -1
- package/dist/chunk-VJN7TIGL.js.map +0 -1
|
@@ -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
|