@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
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Creating Your Template File
|
|
2
|
+
|
|
3
|
+
This guide walks you through creating a Figma Make template step-by-step.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
**Time Required:** 1-2 hours (first time)
|
|
8
|
+
|
|
9
|
+
**Steps:**
|
|
10
|
+
1. Create a new Figma Make file
|
|
11
|
+
2. Install the design system package
|
|
12
|
+
3. Verify installation
|
|
13
|
+
4. Add guidelines (covered in next document)
|
|
14
|
+
5. Add example code (covered in separate document)
|
|
15
|
+
6. Test the setup
|
|
16
|
+
7. Publish as template (covered in separate document)
|
|
17
|
+
|
|
18
|
+
## Step 1: Create a New Figma Make File
|
|
19
|
+
|
|
20
|
+
### 1.1 Access Figma Make
|
|
21
|
+
|
|
22
|
+
1. Go to https://figma.com/
|
|
23
|
+
2. Log in with your Figma account
|
|
24
|
+
3. You should see your files dashboard
|
|
25
|
+
|
|
26
|
+
### 1.2 Create New File
|
|
27
|
+
|
|
28
|
+
**Option A: From Dashboard**
|
|
29
|
+
1. Click **Create new** (top-left or center)
|
|
30
|
+
2. Select **Figma Make file**
|
|
31
|
+
3. Wait for the file to load (may take 10-30 seconds)
|
|
32
|
+
|
|
33
|
+
**Option B: Direct URL**
|
|
34
|
+
1. Navigate to: https://figma.com/make
|
|
35
|
+
2. Click **New file** or **Create new**
|
|
36
|
+
|
|
37
|
+
### 1.3 Name Your File
|
|
38
|
+
|
|
39
|
+
1. Click on the file name at the top (default: "Untitled")
|
|
40
|
+
2. Rename to: `Discourser Design System Template`
|
|
41
|
+
3. Press Enter to save
|
|
42
|
+
|
|
43
|
+
**💡 Tip:** Use a clear, descriptive name. This will be visible when published as a template.
|
|
44
|
+
|
|
45
|
+
## Step 2: Understand the Figma Make Interface
|
|
46
|
+
|
|
47
|
+
Before proceeding, familiarize yourself with the interface:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
┌─────────────────────────────────────────────────────┐
|
|
51
|
+
│ Figma Make Interface │
|
|
52
|
+
├─────────────────────────────────────────────────────┤
|
|
53
|
+
│ Top Bar │
|
|
54
|
+
│ ├── File name │
|
|
55
|
+
│ ├── Share button (for publishing template) │
|
|
56
|
+
│ └── Preview button (test your app) │
|
|
57
|
+
├─────────────────────────────────────────────────────┤
|
|
58
|
+
│ Left Sidebar │
|
|
59
|
+
│ ├── Chat (AI assistant) │
|
|
60
|
+
│ ├── Code (file explorer) │
|
|
61
|
+
│ └── Assets (design assets) │
|
|
62
|
+
├─────────────────────────────────────────────────────┤
|
|
63
|
+
│ Main Area │
|
|
64
|
+
│ ├── Code editor (top/left) │
|
|
65
|
+
│ └── Preview (bottom/right) │
|
|
66
|
+
└─────────────────────────────────────────────────────┘
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Key Sections:**
|
|
70
|
+
- **Chat:** Where you talk to the AI
|
|
71
|
+
- **Code:** Where you view/edit files
|
|
72
|
+
- **Preview:** Where you see the running app
|
|
73
|
+
|
|
74
|
+
## Step 3: Install the Design System Package
|
|
75
|
+
|
|
76
|
+
You have two methods to install the package. Choose one:
|
|
77
|
+
|
|
78
|
+
### Method A: Using AI Chat (Recommended)
|
|
79
|
+
|
|
80
|
+
1. Click **Chat** in the left sidebar
|
|
81
|
+
2. Type the following message:
|
|
82
|
+
```
|
|
83
|
+
install @discourser/design-system
|
|
84
|
+
```
|
|
85
|
+
3. Press Enter
|
|
86
|
+
4. Wait for the AI to install the package (10-30 seconds)
|
|
87
|
+
5. Check for confirmation message
|
|
88
|
+
|
|
89
|
+
**Expected response:**
|
|
90
|
+
> "I've installed @discourser/design-system for you."
|
|
91
|
+
|
|
92
|
+
### Method B: Manual Installation
|
|
93
|
+
|
|
94
|
+
1. Click **Code** in the left sidebar
|
|
95
|
+
2. Find and click **package.json**
|
|
96
|
+
3. Locate the `"dependencies"` section
|
|
97
|
+
4. Add the package:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"react": "^19.0.0",
|
|
102
|
+
"react-dom": "^19.0.0",
|
|
103
|
+
"@discourser/design-system": "^0.1.7"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
5. Save the file (Cmd+S / Ctrl+S)
|
|
108
|
+
6. Wait for automatic installation
|
|
109
|
+
|
|
110
|
+
**💡 Tip:** Method A (AI Chat) is easier and less error-prone.
|
|
111
|
+
|
|
112
|
+
## Step 4: Verify Package Installation
|
|
113
|
+
|
|
114
|
+
### 4.1 Check package.json
|
|
115
|
+
|
|
116
|
+
1. Click **Code** → **package.json**
|
|
117
|
+
2. Verify `@discourser/design-system` appears in dependencies:
|
|
118
|
+
```json
|
|
119
|
+
"@discourser/design-system": "^0.1.7"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 4.2 Check node_modules
|
|
123
|
+
|
|
124
|
+
1. In the Code panel, expand **node_modules/**
|
|
125
|
+
2. Look for **@discourser/** folder
|
|
126
|
+
3. Expand it to find **design-system/**
|
|
127
|
+
|
|
128
|
+
**If you see the folder:** ✅ Installation successful!
|
|
129
|
+
**If you don't see it:** ⚠️ Try reinstalling or check the console for errors.
|
|
130
|
+
|
|
131
|
+
### 4.3 Test Import
|
|
132
|
+
|
|
133
|
+
1. Click **Code** → **src/** → **App.tsx**
|
|
134
|
+
2. At the top of the file, add:
|
|
135
|
+
```tsx
|
|
136
|
+
import { Button } from '@discourser/design-system';
|
|
137
|
+
```
|
|
138
|
+
3. Check for TypeScript errors
|
|
139
|
+
4. If no red squiggles appear: ✅ Package accessible!
|
|
140
|
+
|
|
141
|
+
## Step 5: Create Basic Test Component
|
|
142
|
+
|
|
143
|
+
Let's verify the design system works by creating a simple test:
|
|
144
|
+
|
|
145
|
+
### 5.1 Edit App.tsx
|
|
146
|
+
|
|
147
|
+
1. Click **Code** → **src/** → **App.tsx**
|
|
148
|
+
2. Replace the entire contents with:
|
|
149
|
+
```tsx
|
|
150
|
+
import { Button, Card } from '@discourser/design-system';
|
|
151
|
+
|
|
152
|
+
export default function App() {
|
|
153
|
+
return (
|
|
154
|
+
<div style={{ padding: '2rem' }}>
|
|
155
|
+
<Card variant="elevated">
|
|
156
|
+
<div style={{ padding: '1.5rem' }}>
|
|
157
|
+
<h1>Discourser Design System</h1>
|
|
158
|
+
<p>Template is working!</p>
|
|
159
|
+
<Button variant="filled">Test Button</Button>
|
|
160
|
+
</div>
|
|
161
|
+
</Card>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
3. Save the file (Cmd+S / Ctrl+S)
|
|
167
|
+
|
|
168
|
+
### 5.2 Preview the App
|
|
169
|
+
|
|
170
|
+
1. Click **Preview** button (top-right)
|
|
171
|
+
2. Wait for the app to compile and load
|
|
172
|
+
3. You should see:
|
|
173
|
+
- A white page with padding
|
|
174
|
+
- An elevated card
|
|
175
|
+
- "Discourser Design System" heading
|
|
176
|
+
- "Template is working!" text
|
|
177
|
+
- A blue filled button labeled "Test Button"
|
|
178
|
+
|
|
179
|
+
**If you see this:** ✅ Design system is working!
|
|
180
|
+
**If you see errors:** ⚠️ See troubleshooting below.
|
|
181
|
+
|
|
182
|
+
## Step 6: Verify Styles are Loading
|
|
183
|
+
|
|
184
|
+
### 6.1 Check Button Styling
|
|
185
|
+
|
|
186
|
+
The Button component should have:
|
|
187
|
+
- ✅ Blue/green primary color background
|
|
188
|
+
- ✅ White text
|
|
189
|
+
- ✅ Rounded corners (fully rounded pill shape)
|
|
190
|
+
- ✅ Padding on left and right
|
|
191
|
+
|
|
192
|
+
**If button looks like plain HTML:**
|
|
193
|
+
⚠️ Styles may not be loading. See troubleshooting.
|
|
194
|
+
|
|
195
|
+
### 6.2 Check Card Styling
|
|
196
|
+
|
|
197
|
+
The Card component should have:
|
|
198
|
+
- ✅ White or light background
|
|
199
|
+
- ✅ Subtle shadow (elevated variant)
|
|
200
|
+
- ✅ Rounded corners
|
|
201
|
+
- ✅ Proper spacing
|
|
202
|
+
|
|
203
|
+
## Step 7: Set Up Project Structure
|
|
204
|
+
|
|
205
|
+
Before adding guidelines, let's ensure proper structure:
|
|
206
|
+
|
|
207
|
+
### 7.1 Verify Required Folders Exist
|
|
208
|
+
|
|
209
|
+
Check the Code panel for these folders:
|
|
210
|
+
- ✅ `src/` - Source code
|
|
211
|
+
- ✅ `public/` - Static assets
|
|
212
|
+
- ✅ `guidelines/` - **This is where we'll add documentation**
|
|
213
|
+
|
|
214
|
+
**If `guidelines/` doesn't exist:**
|
|
215
|
+
1. Right-click in the file explorer
|
|
216
|
+
2. Select **Create new folder**
|
|
217
|
+
3. Name it: `guidelines`
|
|
218
|
+
|
|
219
|
+
### 7.2 Check Configuration Files
|
|
220
|
+
|
|
221
|
+
These should exist automatically:
|
|
222
|
+
- ✅ `package.json` - Dependencies
|
|
223
|
+
- ✅ `tsconfig.json` - TypeScript config
|
|
224
|
+
- ✅ `vite.config.ts` - Build config
|
|
225
|
+
- ✅ `index.html` - Entry point
|
|
226
|
+
|
|
227
|
+
## Troubleshooting
|
|
228
|
+
|
|
229
|
+
### Package Installation Failed
|
|
230
|
+
|
|
231
|
+
**Symptoms:**
|
|
232
|
+
- Package not in package.json
|
|
233
|
+
- node_modules/@discourser doesn't exist
|
|
234
|
+
- Import errors
|
|
235
|
+
|
|
236
|
+
**Solutions:**
|
|
237
|
+
1. Try the other installation method (AI chat vs manual)
|
|
238
|
+
2. Check your internet connection
|
|
239
|
+
3. Verify the package exists on npm: `npm view @discourser/design-system`
|
|
240
|
+
4. Try reloading the Figma Make file
|
|
241
|
+
5. Create a new file and try again
|
|
242
|
+
|
|
243
|
+
### Styles Not Loading
|
|
244
|
+
|
|
245
|
+
**Symptoms:**
|
|
246
|
+
- Components look like plain HTML
|
|
247
|
+
- No colors or styling
|
|
248
|
+
- Button is unstyled
|
|
249
|
+
|
|
250
|
+
**Solutions:**
|
|
251
|
+
1. Check that the import is correct: `import { Button } from '@discourser/design-system'`
|
|
252
|
+
2. Reload the preview
|
|
253
|
+
3. Clear cache and reload
|
|
254
|
+
4. Check browser console for CSS errors (F12 → Console)
|
|
255
|
+
5. Verify package version is latest: Update package.json to `^0.1.7`
|
|
256
|
+
|
|
257
|
+
### TypeScript Errors
|
|
258
|
+
|
|
259
|
+
**Symptoms:**
|
|
260
|
+
- Red squiggly lines under imports
|
|
261
|
+
- "Cannot find module" errors
|
|
262
|
+
|
|
263
|
+
**Solutions:**
|
|
264
|
+
1. Wait 10-20 seconds for TypeScript to update
|
|
265
|
+
2. Reload the Figma Make file
|
|
266
|
+
3. Check package.json has the package listed
|
|
267
|
+
4. Verify node_modules/@discourser/design-system exists
|
|
268
|
+
5. Restart TypeScript server (if option available)
|
|
269
|
+
|
|
270
|
+
### Preview Not Loading
|
|
271
|
+
|
|
272
|
+
**Symptoms:**
|
|
273
|
+
- Preview shows blank screen
|
|
274
|
+
- Preview shows error message
|
|
275
|
+
- Preview won't compile
|
|
276
|
+
|
|
277
|
+
**Solutions:**
|
|
278
|
+
1. Check browser console for errors (F12)
|
|
279
|
+
2. Check terminal/output panel for build errors
|
|
280
|
+
3. Verify App.tsx syntax is correct
|
|
281
|
+
4. Try removing recent changes
|
|
282
|
+
5. Reload preview
|
|
283
|
+
|
|
284
|
+
## Checkpoint: What You Should Have Now
|
|
285
|
+
|
|
286
|
+
Before proceeding to add guidelines, verify:
|
|
287
|
+
|
|
288
|
+
- [x] Figma Make file created and named
|
|
289
|
+
- [x] `@discourser/design-system` installed in package.json
|
|
290
|
+
- [x] Package visible in node_modules/
|
|
291
|
+
- [x] Test component renders correctly
|
|
292
|
+
- [x] Styles are loading properly
|
|
293
|
+
- [x] Preview shows working app
|
|
294
|
+
- [x] `guidelines/` folder exists
|
|
295
|
+
|
|
296
|
+
**If all checkboxes are checked:** ✅ Proceed to next step!
|
|
297
|
+
|
|
298
|
+
**If any are missing:** ⚠️ Review the relevant section above.
|
|
299
|
+
|
|
300
|
+
## What's Next?
|
|
301
|
+
|
|
302
|
+
Now that your Figma Make file is set up with the design system package, it's time to add the guidelines that will teach Figma Make's AI how to use it.
|
|
303
|
+
|
|
304
|
+
**Next:** [Adding Guidelines](./04-adding-guidelines.md) →
|
|
305
|
+
|
|
306
|
+
**Previous:** [Prerequisites](./02-prerequisites.md) ←
|