@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.
Files changed (75) hide show
  1. package/dist/figma-codex.json +2 -2
  2. package/docs/CSS_USAGE.md +235 -0
  3. package/docs/FIGMA_MAKE_SETUP.md +339 -0
  4. package/docs/GUIDELINES_REVIEW.md +728 -0
  5. package/docs/MAINTAINER_CHECKLIST.md +265 -0
  6. package/docs/TESTING_QUICK_REFERENCE.md +159 -0
  7. package/docs/TESTING_TOKENS.md +340 -0
  8. package/docs/active-stories/README.md +29 -0
  9. package/docs/active-stories/STORY-006a-figma-translation-foundations.md +324 -0
  10. package/docs/active-stories/STORY-006b-figma-translation-components.md +201 -0
  11. package/docs/active-stories/STORY-006c-figma-translation-layout-extension.md +258 -0
  12. package/docs/active-stories/STORY-008-kai-sidecar-fragments.md +137 -0
  13. package/docs/active-stories/STORY-011-verify-translation-docs.md +182 -0
  14. package/docs/archive/ARCHITECTURE-discourser-design-system.md +448 -0
  15. package/docs/claude-feed-back/ARCHITECTURE_DIAGRAM.md +243 -0
  16. package/docs/claude-feed-back/STYLING_VERIFICATION.md +89 -0
  17. package/docs/claude-feed-back/TEST_RESULTS.md +182 -0
  18. package/docs/context-share/ELEVATION_FIX_PLAN.md +903 -0
  19. package/docs/context-share/STORY-001-VALIDATION-PASSED.md +192 -0
  20. package/docs/context-share/STORY-002-IMPLEMENTATION-COMPLETE.md +161 -0
  21. package/docs/context-share/STORYBOOK_MCP_STRATEGY.md +867 -0
  22. package/docs/context-share/TESTING_GAPS_FILLED.md +353 -0
  23. package/docs/context-share/TOKEN_TESTING_SUMMARY.md +388 -0
  24. package/docs/context-share/code-connect-prompt.md +90 -0
  25. package/docs/context-share/dds-autonomous-pipeline.md +765 -0
  26. package/docs/context-share/fix-checkbox-radio-tokens.md +145 -0
  27. package/docs/context-share/icon-component-prompt.md +154 -0
  28. package/docs/context-share/icons/Audience.svg +3 -0
  29. package/docs/context-share/icons/AudioSpeaker.svg +3 -0
  30. package/docs/context-share/icons/BookmarkPlus.svg +3 -0
  31. package/docs/context-share/icons/ClipBoard.svg +8 -0
  32. package/docs/context-share/icons/DiscourserLogo.svg +4 -0
  33. package/docs/context-share/icons/ExitStudio.svg +4 -0
  34. package/docs/context-share/icons/Microphone.svg +5 -0
  35. package/docs/context-share/icons/NotebookPen.svg +3 -0
  36. package/docs/context-share/icons/PausePlay.svg +5 -0
  37. package/docs/context-share/icons/Play.svg +4 -0
  38. package/docs/context-share/icons/Record.svg +6 -0
  39. package/docs/context-share/icons/RepeatQuestion.svg +3 -0
  40. package/docs/context-share/icons/ScrollText.svg +3 -0
  41. package/docs/context-share/icons/Sparkles.svg +3 -0
  42. package/docs/context-share/icons/Speech.svg +3 -0
  43. package/docs/context-share/icons/StopPlay.svg +4 -0
  44. package/docs/context-share/icons/Timer.svg +3 -0
  45. package/docs/context-share/icons/UserProfile.svg +3 -0
  46. package/docs/context-share/m3-token-pipeline-audit.md +125 -0
  47. package/docs/context-share/storybook-mcp-kai-agent-revised-summary.md +211 -0
  48. package/docs/discourser-design-system-prd.md +3698 -0
  49. package/docs/figma-captures/01-typography.png +0 -0
  50. package/docs/figma-captures/02-button-iconbutton.png +0 -0
  51. package/docs/figma-captures/03-form-inputs.png +0 -0
  52. package/docs/figma-captures/04-form-controls.png +0 -0
  53. package/docs/figma-captures/05-data-display.png +0 -0
  54. package/docs/figma-captures/06-feedback.png +0 -0
  55. package/docs/figma-captures/07-overlays.png +0 -0
  56. package/docs/figma-captures/08-navigation-layout.png +0 -0
  57. package/docs/figma-captures/09-custom-components.png +0 -0
  58. package/docs/figma-captures/10-scenario-queue.png +0 -0
  59. package/docs/figma-captures/11-icon-library.png +0 -0
  60. package/docs/figma-make-docs/01-understanding-templates.md +235 -0
  61. package/docs/figma-make-docs/02-prerequisites.md +266 -0
  62. package/docs/figma-make-docs/03-creating-template.md +306 -0
  63. package/docs/figma-make-docs/04-adding-guidelines.md +448 -0
  64. package/docs/figma-make-docs/05-example-starter-code.md +590 -0
  65. package/docs/figma-make-docs/06-publishing-template.md +417 -0
  66. package/docs/figma-make-docs/07-maintenance.md +536 -0
  67. package/docs/figma-make-docs/08-faq.md +490 -0
  68. package/docs/figma-make-docs/README.md +95 -0
  69. package/docs/material-theme.json +418 -0
  70. package/docs/plans/2026-03-12-figma-token-export-rewrite.md +504 -0
  71. package/docs/plans/2026-03-12-step7-panda-token-resolution-design.md +119 -0
  72. package/docs/plans/2026-03-12-step7-panda-token-resolution.md +993 -0
  73. package/docs/token-name-mapping.json +850 -0
  74. package/docs/token-name-mapping.md +251 -0
  75. package/package.json +3 -2
@@ -0,0 +1,265 @@
1
+ # Maintainer Checklist: Enable Branching Strategy
2
+
3
+ This checklist guides maintainers through activating the branching strategy enforcement.
4
+
5
+ ## Prerequisites
6
+
7
+ - [ ] You have maintainer/admin access to the repository
8
+ - [ ] You have reviewed BRANCHING_STRATEGY.md
9
+ - [ ] You have reviewed docs/BRANCH_PROTECTION_SETUP.md
10
+
11
+ ## Steps to Enable
12
+
13
+ ### 1. Create `dev` Branch
14
+
15
+ - [ ] Checkout and pull latest `main` branch
16
+ ```bash
17
+ git checkout main
18
+ git pull origin main
19
+ ```
20
+
21
+ - [ ] Create and push `dev` branch
22
+ ```bash
23
+ git checkout -b dev
24
+ git push -u origin dev
25
+ ```
26
+
27
+ - [ ] Verify `dev` branch exists on GitHub
28
+ - Go to repository → Code → Branch dropdown
29
+ - Should see both `main` and `dev`
30
+
31
+ ### 2. Configure Branch Protection: `main`
32
+
33
+ Go to: **Settings → Branches → Add rule**
34
+
35
+ - [ ] Branch name pattern: `main`
36
+
37
+ #### Pull Request Settings
38
+ - [ ] ✅ Require a pull request before merging
39
+ - [ ] ✅ Require approvals: `1` (or more)
40
+ - [ ] ✅ Dismiss stale pull request approvals when new commits are pushed
41
+ - [ ] ✅ Require review from Code Owners (if using CODEOWNERS)
42
+
43
+ #### Status Check Settings
44
+ - [ ] ✅ Require status checks to pass before merging
45
+ - [ ] ✅ Require branches to be up to date before merging
46
+ - [ ] Add status checks (search and select):
47
+ - [ ] `Test & Build`
48
+ - [ ] `Validate Branching Strategy`
49
+
50
+ #### Additional Protection
51
+ - [ ] ✅ Require conversation resolution before merging
52
+ - [ ] ✅ Do not allow bypassing the above settings
53
+ - [ ] ✅ Restrict who can push to matching branches
54
+ - [ ] Add: Maintainers team or specific users
55
+
56
+ #### Optional (Recommended)
57
+ - [ ] ✅ Require signed commits
58
+ - [ ] ✅ Require linear history
59
+
60
+ - [ ] Click **Create** or **Save changes**
61
+
62
+ ### 3. Configure Branch Protection: `dev`
63
+
64
+ Go to: **Settings → Branches → Add rule**
65
+
66
+ - [ ] Branch name pattern: `dev`
67
+
68
+ #### Pull Request Settings
69
+ - [ ] ✅ Require a pull request before merging
70
+ - [ ] ✅ Require approvals: `1` (recommended)
71
+
72
+ #### Status Check Settings
73
+ - [ ] ✅ Require status checks to pass before merging
74
+ - [ ] ✅ Require branches to be up to date before merging
75
+ - [ ] Add status check:
76
+ - [ ] `Test & Build`
77
+
78
+ #### Additional Protection
79
+ - [ ] ✅ Require conversation resolution before merging
80
+
81
+ - [ ] Click **Create** or **Save changes**
82
+
83
+ ### 4. Configure GitHub Actions Permissions
84
+
85
+ Go to: **Settings → Actions → General**
86
+
87
+ #### Workflow permissions
88
+ - [ ] ✅ Read and write permissions
89
+
90
+ #### Pull Requests
91
+ - [ ] ✅ Allow GitHub Actions to create and approve pull requests
92
+
93
+ - [ ] Click **Save**
94
+
95
+ ### 5. Optional: Set Default Branch
96
+
97
+ Consider whether `dev` should be the default branch:
98
+
99
+ **Pros of `dev` as default:**
100
+ - New PRs default to `dev` (correct target)
101
+ - Clone defaults to `dev` (where work happens)
102
+
103
+ **Pros of `main` as default:**
104
+ - External users expect `main`
105
+ - Releases/docs typically reference `main`
106
+ - GitHub Pages may use `main`
107
+
108
+ To change default:
109
+ - [ ] Go to **Settings → Branches**
110
+ - [ ] Under "Default branch", click switch icon
111
+ - [ ] Select `dev` or keep `main`
112
+ - [ ] Click **Update**
113
+
114
+ **Recommendation:** Keep `main` as default for external visibility.
115
+
116
+ ### 6. Test the Configuration
117
+
118
+ #### Test 1: Feature → Dev (should work)
119
+ - [ ] Create test branch from dev
120
+ ```bash
121
+ git checkout dev
122
+ git pull origin dev
123
+ git checkout -b feature/test-workflow
124
+ echo "test" >> test.txt
125
+ git add test.txt
126
+ git commit -m "test: verify workflow"
127
+ git push -u origin feature/test-workflow
128
+ ```
129
+ - [ ] Open PR: `feature/test-workflow` → `dev`
130
+ - [ ] Verify status check `Test & Build` runs
131
+ - [ ] Verify PR can be merged (if approvals configured, get approval first)
132
+ - [ ] Merge PR or close without merging
133
+
134
+ #### Test 2: Feature → Main (should fail)
135
+ - [ ] Open PR: `feature/test-workflow` → `main`
136
+ - [ ] Verify status check `Validate Branching Strategy` appears
137
+ - [ ] Verify it fails with error message about requiring dev branch
138
+ - [ ] Read the error message - should be clear and helpful
139
+ - [ ] Close the PR
140
+
141
+ #### Test 3: Dev → Main (should work)
142
+ - [ ] Open PR: `dev` → `main`
143
+ - [ ] Verify status check `Validate Branching Strategy` passes
144
+ - [ ] Verify status check `Test & Build` runs
145
+ - [ ] Verify PR can be merged
146
+ - [ ] Close the PR (don't merge unless you want to)
147
+
148
+ #### Test 4: Clean up
149
+ - [ ] Delete test branch
150
+ ```bash
151
+ git checkout dev
152
+ git branch -d feature/test-workflow
153
+ git push origin --delete feature/test-workflow
154
+ ```
155
+ - [ ] Remove test.txt if it was merged
156
+ ```bash
157
+ git rm test.txt
158
+ git commit -m "chore: remove test file"
159
+ git push origin dev
160
+ ```
161
+
162
+ ### 7. Communicate Changes
163
+
164
+ - [ ] Announce branching strategy to team
165
+ - Share link to BRANCHING_STRATEGY.md
166
+ - Share link to docs/BRANCHING_QUICK_REFERENCE.md
167
+ - Explain the change in workflow (dev-first)
168
+
169
+ - [ ] Update any existing documentation
170
+ - Project wikis
171
+ - Onboarding guides
172
+ - Team documentation
173
+
174
+ - [ ] Handle existing open PRs
175
+ - Review open PRs targeting `main`
176
+ - Ask authors to retarget to `dev` if needed
177
+ - Or merge/close if appropriate
178
+
179
+ ### 8. Monitor and Adjust
180
+
181
+ First few weeks:
182
+ - [ ] Watch for confusion or questions
183
+ - [ ] Help developers adjust to new workflow
184
+ - [ ] Update documentation based on feedback
185
+ - [ ] Consider adjusting approval requirements if needed
186
+
187
+ ## Troubleshooting
188
+
189
+ ### Status checks not appearing
190
+
191
+ **Issue:** Required status checks don't show up in PR
192
+
193
+ **Solution:**
194
+ 1. The checks must run at least once before they can be added as required
195
+ 2. Open a test PR to trigger the workflows
196
+ 3. After checks appear, go back to branch protection settings
197
+ 4. Search for the exact check name and add it
198
+ 5. Save the rule
199
+
200
+ ### Can't find status check names
201
+
202
+ **Issue:** Don't know exact name to require
203
+
204
+ **Solution:**
205
+ 1. Open any recent PR
206
+ 2. Scroll to bottom where checks appear
207
+ 3. Note the exact names (case-sensitive)
208
+ 4. Use those names in branch protection settings
209
+
210
+ ### Developers can't push to dev
211
+
212
+ **Issue:** Even with PR merged, can't push to dev
213
+
214
+ **Solution:**
215
+ 1. This is expected - dev is protected too
216
+ 2. All changes go through PRs
217
+ 3. If direct push is needed (rare), temporarily disable protection
218
+ 4. Make push, then re-enable protection
219
+
220
+ ### Changesets bot issues
221
+
222
+ **Issue:** Changesets bot can't create PRs
223
+
224
+ **Solution:**
225
+ 1. Verify Actions permissions: Settings → Actions → General
226
+ 2. Enable "Allow GitHub Actions to create and approve pull requests"
227
+ 3. Check that release.yml has correct permissions:
228
+ ```yaml
229
+ permissions:
230
+ contents: write
231
+ pull-requests: write
232
+ id-token: write
233
+ ```
234
+
235
+ ## Verification
236
+
237
+ After completing all steps:
238
+
239
+ - [ ] ✅ `dev` branch exists
240
+ - [ ] ✅ `main` branch is protected
241
+ - [ ] ✅ `dev` branch is protected
242
+ - [ ] ✅ GitHub Actions permissions configured
243
+ - [ ] ✅ Test 1 passed (feature → dev works)
244
+ - [ ] ✅ Test 2 passed (feature → main fails)
245
+ - [ ] ✅ Test 3 passed (dev → main works)
246
+ - [ ] ✅ Team has been notified
247
+ - [ ] ✅ Documentation is updated
248
+
249
+ ## Success!
250
+
251
+ If all checkboxes are checked, the branching strategy is now active! 🎉
252
+
253
+ ## Resources
254
+
255
+ - [BRANCHING_STRATEGY.md](../BRANCHING_STRATEGY.md) - Strategy documentation
256
+ - [docs/BRANCH_PROTECTION_SETUP.md](../docs/BRANCH_PROTECTION_SETUP.md) - Detailed setup
257
+ - [docs/BRANCHING_QUICK_REFERENCE.md](../docs/BRANCHING_QUICK_REFERENCE.md) - Quick guide
258
+ - [docs/BRANCHING_IMPLEMENTATION_SUMMARY.md](../docs/BRANCHING_IMPLEMENTATION_SUMMARY.md) - What was implemented
259
+
260
+ ## Questions?
261
+
262
+ If you encounter issues not covered here:
263
+ 1. Check docs/BRANCH_PROTECTION_SETUP.md
264
+ 2. Review GitHub Actions workflow logs
265
+ 3. Open an issue or discussion
@@ -0,0 +1,159 @@
1
+ # Token Testing Quick Reference
2
+
3
+ ## Run Tests
4
+
5
+ ```bash
6
+ # Run all shadow token tests
7
+ pnpm test shadows --run
8
+
9
+ # Watch mode (auto-rerun on changes)
10
+ pnpm test shadows
11
+
12
+ # Run with UI
13
+ pnpm test:ui
14
+ ```
15
+
16
+ ## Test Results ✅
17
+
18
+ ```
19
+ ✓ src/preset/__tests__/shadows.test.ts (11 tests) 18ms
20
+ ✓ src/languages/__tests__/transform.test.ts (9 tests) 14ms
21
+ ✓ src/preset/recipes/__tests__/recipe-shadows.test.ts (16 tests) 22ms
22
+ ✓ src/preset/__tests__/token-resolution.test.ts (14 tests) 22ms
23
+
24
+ Test Files 4 passed (4)
25
+ Tests 50 passed (50)
26
+ ```
27
+
28
+ ## What These Tests Verify
29
+
30
+ ### 1. Shadow Token Architecture ✅ (11 tests)
31
+ - Semantic tokens (xs-2xl) correctly reference base tokens (level1-5)
32
+ - Utility tokens (inset, focus-underline, inset-border) remain independent
33
+ - No hardcoded Park UI values in semantic elevation tokens
34
+ - All required tokens exist, no unexpected tokens
35
+
36
+ ### 2. Transform Tests ✅ (9 tests)
37
+ - Base tokens (level0-5) created from elevation.levels
38
+ - M3 shadow values preserved exactly
39
+ - Shadow values follow M3 dual-layer pattern
40
+ - Elevation progression is correct (level1 < level5)
41
+ - Transform function doesn't mutate source data
42
+
43
+ ### 3. Recipe Token Usage ✅ (16 tests)
44
+ - All component recipes use semantic tokens (xs, sm, md, lg, xl, 2xl)
45
+ - **Zero** recipes use base tokens (level0-5) directly
46
+ - Button elevated variant: sm (default), md (hover), xs (active)
47
+ - STORY-003: Input/Textarea use focus-underline, RadioGroup uses inset-border
48
+ - No inline var(--shadow-color) strings in recipes
49
+
50
+ ### 4. Integration Tests ✅ (14 tests)
51
+ - Preset includes both base and semantic shadow tokens
52
+ - Token references are valid (no broken chains)
53
+ - No circular token references
54
+ - Inset token remains independent (STORY-002 requirement)
55
+ - System-wide check: ALL recipes avoid base token usage
56
+
57
+ ## Adding Tests for New Components
58
+
59
+ ### When you create a new component with shadows:
60
+
61
+ **1. Import the recipe** in `recipe-shadows.test.ts`:
62
+ ```ts
63
+ import { yourNewComponent } from '../your-new-component';
64
+ ```
65
+
66
+ **2. Add test**:
67
+ ```ts
68
+ it('yourNewComponent recipe should use semantic tokens', () => {
69
+ const shadowValue = yourNewComponent.boxShadow;
70
+ expect(shadowValue).toMatch(/^(xs|sm|md|lg|xl|2xl)$/);
71
+ });
72
+ ```
73
+
74
+ **3. Add to anti-pattern check**:
75
+ ```ts
76
+ const recipes = {
77
+ button,
78
+ card,
79
+ // ... existing recipes
80
+ yourNewComponent, // Add here
81
+ };
82
+ ```
83
+
84
+ ## Adding New Shadow Tokens
85
+
86
+ ### When you add a new semantic token:
87
+
88
+ **1. Update `shadows.ts`**:
89
+ ```ts
90
+ export const shadows = defineSemanticTokens.shadows({
91
+ // ... existing tokens
92
+ xxl: {
93
+ value: '{shadows.level5}',
94
+ },
95
+ });
96
+ ```
97
+
98
+ **2. Update test** in `shadows.test.ts`:
99
+ ```ts
100
+ it('xxl should reference shadows.level5', () => {
101
+ expect(shadows.xxl.value).toBe('{shadows.level5}');
102
+ });
103
+
104
+ // Update coverage test
105
+ const requiredTokens = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', 'xxl', 'inset'];
106
+ const allowedTokens = [...requiredTokens, 'focus-underline', 'inset-border'];
107
+ ```
108
+
109
+ **3. Run tests**:
110
+ ```bash
111
+ pnpm test shadows --run
112
+ ```
113
+
114
+ ## Common Test Failures
115
+
116
+ ### ❌ "expected allowedTokens to include 'new-token'"
117
+ **Fix:** Add the new token to `allowedTokens` array in `shadows.test.ts`
118
+
119
+ ### ❌ "recipeString matches /level[0-5]/"
120
+ **Fix:** Recipe is using base tokens directly. Change to semantic tokens:
121
+ ```ts
122
+ // ❌ Bad
123
+ boxShadow: 'level2'
124
+
125
+ // ✅ Good
126
+ boxShadow: 'sm'
127
+ ```
128
+
129
+ ### ❌ "Cannot read properties of undefined (reading 'slots')"
130
+ **Fix:** Recipe structure is different. Check if it's a slot recipe or simple recipe:
131
+ ```ts
132
+ // For slot recipes
133
+ const content = recipe.slots?.content;
134
+
135
+ // For simple recipes
136
+ const shadow = recipe.boxShadow;
137
+ ```
138
+
139
+ ## CI/CD Integration
140
+
141
+ These tests run automatically on:
142
+ - ✅ Pre-commit hook
143
+ - ✅ GitHub Actions CI
144
+ - ✅ Pull request checks
145
+
146
+ **Never skip these tests** - they prevent token architecture regressions!
147
+
148
+ ## Benefits
149
+
150
+ - **5-10 second feedback** - No need to rebuild Panda or check Storybook
151
+ - **Prevents regressions** - Catches broken token chains immediately
152
+ - **Documents architecture** - Tests show correct patterns
153
+ - **Enables refactoring** - Safely change token values with confidence
154
+
155
+ ## Related Docs
156
+
157
+ - [Full Testing Guide](./TESTING_TOKENS.md)
158
+ - [STORY-002 Implementation](./context-share/STORY-002-IMPLEMENTATION-COMPLETE.md)
159
+ - [Three-Layer Architecture](../CLAUDE.md#architecture)