@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,192 @@
1
+ # STORY-001 Validation Report — PASSED ✅
2
+
3
+ **Date:** 2026-02-10
4
+ **Validator:** Claude Code (corrected by user)
5
+ **Script:** `scripts/test-storybook-mcp.sh`
6
+
7
+ ## Executive Summary
8
+
9
+ **STORY-001 PASSES all acceptance criteria.** The Storybook MCP server successfully provides queryable documentation for AI agents through TWO manifest files:
10
+
11
+ 1. **components.json** (125KB) - Component stories and react-docgen output
12
+ 2. **docs.json** (1.1MB) - **Full MDX documentation content** ← **This was initially missed**
13
+
14
+ ## Initial Error & Correction
15
+
16
+ ### What Went Wrong
17
+ The initial validation script ONLY checked `components.json` and concluded the MCP server was unsuitable because react-docgen failed on Ark UI compound components. **This conclusion was wrong.**
18
+
19
+ ### What Was Missed
20
+ The script completely ignored `storybook-static/manifests/docs.json`, which contains **57 full MDX documentation files** with:
21
+ - Complete component implementation guidelines (37 entries)
22
+ - Decision trees for component selection
23
+ - Correct vs wrong TypeScript code patterns
24
+ - Compound component APIs (Dialog.Root, Dialog.Trigger, etc.)
25
+ - Foundation documentation (Colors, Typography, Spacing, Elevation)
26
+ - Token references and semantic usage
27
+ - Skills documentation for AI agents
28
+
29
+ ### User Correction
30
+ The user correctly identified that the `@storybook/addon-mcp` exposes 4 MCP tools, not 2:
31
+
32
+ **Dev toolset:**
33
+ 1. `get_ui_building_instructions` - Story writing guidelines
34
+ 2. `preview-stories` - Visual verification URLs
35
+
36
+ **Docs toolset (enabled via `experimentalComponentsManifest: true`):**
37
+ 3. `list-all-documentation` - Lists ALL components AND standalone docs
38
+ 4. `get-documentation` - Returns documentation from **BOTH** manifests
39
+
40
+ The `get-documentation` tool checks BOTH manifests and returns whichever matches the requested ID.
41
+
42
+ ## Validation Results
43
+
44
+ ### ✅ Component Manifest (react-docgen)
45
+
46
+ | Component | Stories | Props | react-docgen Status |
47
+ |-----------|---------|-------|---------------------|
48
+ | Dialog | 4 | 0 | ❌ "No component definition found" (expected) |
49
+ | Select | 4 | 0 | ⚠️ No props extracted (expected) |
50
+ | Popover | 4 | 4 | ⚠️ Wrong component (Button props) |
51
+ | Accordion | 4 | 4 | ⚠️ Wrong component (Button props) |
52
+
53
+ **Verdict:** react-docgen fails on Ark UI compound components (withContext HOCs). This is **expected and documented behavior**. Story code snippets work perfectly.
54
+
55
+ ### ✅ Docs Manifest (MDX Content) — THE CRITICAL PART
56
+
57
+ | Documentation Type | Count | Example Sizes |
58
+ |--------------------|-------|---------------|
59
+ | Component guidelines | 37 | Select: 52,057 chars<br>Popover: 38,555 chars<br>Dialog: 30,847 chars<br>Typography: 20,048 chars |
60
+ | Foundation docs | 4 | Colors: 13,106 chars<br>Typography: 10,616 chars |
61
+ | Skills docs | 6 | Component patterns, Design language, Panda recipes |
62
+ | Other docs | 10 | Figma Make guides, Examples |
63
+ | **Total** | **57** | **1.1MB of MDX content** |
64
+
65
+ #### Dialog Documentation Sample
66
+
67
+ ```typescript
68
+ // ✅ Use Dialog for critical confirmations
69
+ <Dialog.Root open={open} onOpenChange={setOpen}>
70
+ <Dialog.Trigger>
71
+ <Button variant="filled">Delete Account</Button>
72
+ </Dialog.Trigger>
73
+ <Dialog.Content>
74
+ <Dialog.Title>Delete Account?</Dialog.Title>
75
+ <Dialog.Description>This action cannot be undone.</Dialog.Description>
76
+ <Dialog.CloseTrigger>
77
+ <Button variant="text">Cancel</Button>
78
+ </Dialog.CloseTrigger>
79
+ </Dialog.Content>
80
+ </Dialog.Root>
81
+
82
+ // ❌ Don't use Dialog for navigation - use Drawer
83
+ <Dialog.Root>
84
+ <Dialog.Content>
85
+ <nav>...</nav>
86
+ </Dialog.Content>
87
+ </Dialog.Root> // Wrong - navigation shouldn't be modal
88
+ ```
89
+
90
+ **Verdict:** The MDX documentation provides **richer information than auto-generated prop tables** ever could. This includes:
91
+ - ✅ Decision trees (when to use Dialog vs Drawer vs Popover vs Tooltip)
92
+ - ✅ Full TypeScript examples with correct/wrong patterns
93
+ - ✅ Exact import paths (`import { Dialog } from '@discourser/design-system'`)
94
+ - ✅ Compound component APIs (all sub-components documented)
95
+ - ✅ Size variants and use cases
96
+ - ✅ Accessibility requirements
97
+ - ✅ Token references and semantic usage
98
+
99
+ ## STORY-001 Acceptance Criteria Assessment
100
+
101
+ | Criterion | Status | Details |
102
+ |-----------|--------|---------|
103
+ | MCP addon installed and configured | ✅ PASS | `@storybook/addon-mcp` in `.storybook/main.ts`<br>`experimentalComponentsManifest: true` enabled |
104
+ | Component stories have code snippets | ✅ PASS | 24 components with 4 stories each (avg)<br>Full TypeScript examples in `stories[].snippet` |
105
+ | react-docgen props for compound components | ⚠️ EXPECTED FAIL | Known limitation: react-docgen can't parse `withContext` HOCs |
106
+ | **MDX docs are queryable via MCP** | ✅ PASS | **57 documentation entries in `docs.json`** |
107
+ | **Component guidelines have full content** | ✅ PASS | **37 component guidelines with 10K-52K chars each** |
108
+ | **Foundation docs accessible** | ✅ PASS | **Colors, Typography, Spacing, Elevation all present** |
109
+
110
+ ## Overall Verdict
111
+
112
+ ### ✅ **STORY-001 PASSED**
113
+
114
+ **Reason:** The MCP server provides **exactly what Kai needs** through the docs manifest:
115
+ 1. The `get-documentation` tool serves content from BOTH manifests
116
+ 2. When react-docgen fails (expected), hand-written MDX docs provide richer information
117
+ 3. Dialog doc: 30K+ chars with decision trees, patterns, APIs
118
+ 4. Select doc: 52K+ chars with comprehensive guidance
119
+ 5. AI agents get **contextual guidance**, not just type signatures
120
+
121
+ ## Implications for Kai Agent Initiative
122
+
123
+ ### Risks Mitigated
124
+ ✅ **Original risk:** "MCP endpoint may not provide useful docgen for compound components"
125
+ ✅ **Resolution:** MDX documentation IS queryable and provides superior guidance
126
+
127
+ ### Architecture Validation
128
+ ✅ **Storybook as single source of truth** — Confirmed working
129
+ ✅ **MCP as query interface** — Confirmed working
130
+ ✅ **Kai can consume both stories and docs** — Confirmed possible
131
+
132
+ ### Next Steps
133
+ 1. ✅ Mark STORY-001 as PASSED
134
+ 2. ✅ Kai can query `get-documentation` for component guidance
135
+ 3. ✅ Phase 1 Panda CSS Layout MDX docs will auto-appear in manifest
136
+ 4. ✅ Kai's sidecar knowledge may not need to duplicate Storybook content
137
+
138
+ ## Key Documentation by Component
139
+
140
+ ```bash
141
+ # Component guidelines (selection)
142
+ documentation-guidelines-99-select--docs 52,057 chars
143
+ documentation-guidelines-99-popover--docs 38,555 chars
144
+ documentation-guidelines-99-dialog--docs 30,847 chars
145
+ documentation-guidelines-99-accordion--docs 25,221 chars
146
+ documentation-guidelines-99-typography--docs 20,048 chars
147
+ documentation-guidelines-99-colors--docs 15,091 chars
148
+ documentation-guidelines-99-icon-button--docs 14,661 chars
149
+ documentation-guidelines-99-button--docs 13,398 chars
150
+
151
+ # Foundation docs
152
+ foundations-colors--docs 13,106 chars
153
+ foundations-typography--docs 10,616 chars
154
+ foundations-elevation--docs 8,443 chars
155
+ foundations-spacing--docs 7,892 chars
156
+
157
+ # Skills docs
158
+ documentation-claude-skills-99-panda-recipes 12,334 chars
159
+ documentation-claude-skills-99-component-patterns 11,567 chars
160
+ documentation-claude-skills-99-design-language 9,823 chars
161
+ ```
162
+
163
+ ## Lessons Learned
164
+
165
+ 1. **Always check ALL manifest files** — Don't assume one manifest tells the whole story
166
+ 2. **Read the source code** — The `@storybook/mcp` source shows TWO manifests are loaded
167
+ 3. **MDX > auto-generated docs** — Hand-written guidelines provide context that type inference can't
168
+ 4. **Compound components need different strategies** — react-docgen limitations are well-known; MDX is the solution
169
+
170
+ ## Files Generated
171
+
172
+ - `tmp/mcp-test-results/components.json` - Component manifest (125KB)
173
+ - `tmp/mcp-test-results/docs.json` - **Docs manifest (1.1MB)** ← The important one
174
+ - `tmp/mcp-test-results/*-sample.txt` - Content previews
175
+
176
+ ## Verification Command
177
+
178
+ ```bash
179
+ # Run the corrected validation test
180
+ ./scripts/test-storybook-mcp.sh
181
+
182
+ # Manually verify docs.json content
183
+ jq -r '.docs["documentation-guidelines-99-dialog--docs"].content' \
184
+ storybook-static/manifests/docs.json | head -100
185
+
186
+ # List all documentation entries
187
+ jq -r '.docs | keys[]' storybook-static/manifests/docs.json
188
+ ```
189
+
190
+ ---
191
+
192
+ **Conclusion:** The Storybook MCP server is **fully functional** for the Kai agent initiative. The initial assessment was incorrect because it only examined half of what the MCP server provides. With both manifests validated, STORY-001 acceptance criteria are met.
@@ -0,0 +1,161 @@
1
+ # STORY-002: Shadow Token Architecture Fix — COMPLETE ✅
2
+
3
+ ## Summary
4
+ Successfully unified the shadow token system by chaining semantic tokens (xs-2xl) to M3 base tokens (level0-5), eliminating the parallel Park UI shadow system.
5
+
6
+ ## Changes Implemented
7
+
8
+ ### 1. `src/preset/shadows.ts` ✅
9
+ **Before:** Independent Park UI shadow values with hardcoded colors
10
+ ```ts
11
+ xs: { value: { base: '0px 1px 2px {colors.neutral.a6}...' } }
12
+ sm: { value: { base: '0px 2px 4px {colors.neutral.a4}...' } }
13
+ ```
14
+
15
+ **After:** Semantic tokens chained to M3 base tokens
16
+ ```ts
17
+ xs: { value: '{shadows.level1}' }
18
+ sm: { value: '{shadows.level2}' }
19
+ md: { value: '{shadows.level3}' }
20
+ lg: { value: '{shadows.level4}' }
21
+ xl: { value: '{shadows.level5}' }
22
+ '2xl': { value: '{shadows.level5}' }
23
+ ```
24
+
25
+ **Result:** Semantic tokens now reference base M3 elevation values, creating proper token chain.
26
+
27
+ ### 2. `src/preset/recipes/button.ts` ✅
28
+ **Changes:** Switched from base tokens to semantic tokens (3 lines)
29
+ - Line 108: `boxShadow: 'level2'` → `boxShadow: 'sm'`
30
+ - Line 112: `boxShadow: 'level3'` → `boxShadow: 'md'`
31
+ - Line 115: `boxShadow: 'level1'` → `boxShadow: 'xs'`
32
+
33
+ **Result:** Button recipe now uses semantic tokens consistently with other components.
34
+
35
+ ### 3. `src/stories/foundations/Elevation.mdx` ✅
36
+ **Added:** Three-layer architecture explanation
37
+ - Layer 1: Base tokens (level0-5) from M3 spec
38
+ - Layer 2: Semantic tokens (xs-2xl) referencing base tokens
39
+ - Layer 3: Component usage with semantic tokens only
40
+
41
+ **Updated:** All code examples to use semantic tokens
42
+ - Interactive states: `level1`/`level2` → `xs`/`sm`
43
+ - Basic elevation: `level1` → `xs`
44
+ - Interactive button: `level1`/`level2`/`level3` → `xs`/`sm`/`md`
45
+ - Modal overlay: `level3` → `md`
46
+
47
+ ## Verification Results
48
+
49
+ ### ✅ Build Successful
50
+ ```bash
51
+ $ pnpm build:panda
52
+ ✔️ styled-system/css
53
+ ✔️ styled-system/tokens
54
+ ✔️ styled-system/patterns
55
+ ✔️ styled-system/recipes
56
+ ✔️ styled-system/jsx
57
+ ```
58
+
59
+ ### ✅ No Base Tokens in Recipes
60
+ ```bash
61
+ $ grep -r "boxShadow: 'level" src/preset/recipes/
62
+ # Returns: 0 results ✓
63
+ ```
64
+
65
+ ### ✅ Files Unchanged (as required)
66
+ - `src/languages/transform.ts` — Line 27 still registers shadows from elevation.levels
67
+ - `src/languages/material3.language.ts` — elevation.levels (level0-5) unchanged
68
+ - `src/preset/shadows.ts` — inset token preserved (lines 30-35)
69
+ - DesignLanguageContract — No changes
70
+ - DTCG scripts/pipeline — No changes
71
+
72
+ ## Components Requiring Visual Verification
73
+
74
+ **15 components use shadows** and should be verified in Storybook (light + dark themes):
75
+
76
+ 1. **button** — Uses xs/sm/md (elevated variant)
77
+ 2. **card** — Uses lg
78
+ 3. **dialog** — Uses lg
79
+ 4. **drawer** — Uses lg
80
+ 5. **input** — Uses custom shadow (unchanged)
81
+ 6. **popover** — Uses lg
82
+ 7. **radio-group** — Uses custom inset shadow (unchanged)
83
+ 8. **select** — Uses md
84
+ 9. **skeleton** — Uses none (unchanged)
85
+ 10. **slider** — Uses xs
86
+ 11. **switch** — Uses xs
87
+ 12. **tabs** — Uses custom inset shadow (unchanged)
88
+ 13. **textarea** — Uses custom shadow (unchanged)
89
+ 14. **toast** — Uses lg
90
+ 15. **tooltip** — Uses sm
91
+
92
+ ### Visual Check Instructions
93
+ ```bash
94
+ pnpm dev # Start Storybook at localhost:6006
95
+ ```
96
+
97
+ For each component above:
98
+ 1. Open component story in Storybook
99
+ 2. Check light theme — shadows should match M3 elevation levels
100
+ 3. Check dark theme — shadows should match M3 elevation levels
101
+ 4. Verify interactive states (hover/active) show appropriate shadow changes
102
+
103
+ ## Token Architecture Flow
104
+
105
+ ```
106
+ Material3Language (material3.language.ts)
107
+
108
+ elevation.levels.level0-5 (M3 shadow values)
109
+
110
+ transform.ts (line 27: shadows: objectToTokens(language.elevation.levels))
111
+
112
+ Base Tokens (level0-5 registered in Panda)
113
+
114
+ shadows.ts (semantic tokens reference base tokens)
115
+
116
+ Semantic Tokens (xs→level1, sm→level2, md→level3, lg→level4, xl/2xl→level5)
117
+
118
+ Component Recipes (button, card, dialog, etc.)
119
+
120
+ React Components
121
+ ```
122
+
123
+ ## Acceptance Criteria Status
124
+
125
+ | # | Criterion | Status |
126
+ |---|-----------|--------|
127
+ | 1 | shadows.ts updated with token references | ✅ Complete |
128
+ | 2 | inset token unchanged | ✅ Verified |
129
+ | 3 | Button recipe updated (level→semantic) | ✅ Complete |
130
+ | 4 | grep -r "boxShadow: 'level" returns 0 | ✅ Verified |
131
+ | 5 | transform.ts UNCHANGED | ✅ Verified |
132
+ | 6 | DesignLanguageContract UNCHANGED | ✅ Verified |
133
+ | 7 | DTCG scripts UNCHANGED | ✅ Verified |
134
+ | 8 | pnpm build:panda succeeds | ✅ Passed |
135
+ | 9 | Visual regression check needed | ⏳ Pending user verification |
136
+ | 10 | Elevation.mdx updated | ✅ Complete |
137
+
138
+ ## Next Steps
139
+
140
+ 1. **User Action Required:** Run `pnpm dev` and perform visual verification of all 15 components listed above
141
+ 2. Test in both light and dark themes
142
+ 3. Verify interactive states (hover, active) show proper elevation changes
143
+ 4. Once verified, commit changes with message:
144
+ ```
145
+ fix: unify shadow token architecture - chain semantic to M3 base tokens
146
+
147
+ - Update semantic tokens (xs-2xl) to reference M3 base tokens (level0-5)
148
+ - Switch button recipe from base tokens to semantic tokens
149
+ - Update Elevation.mdx with three-layer architecture docs
150
+ - Remove all direct base token usage from component recipes
151
+
152
+ Implements STORY-002
153
+ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
154
+ ```
155
+
156
+ ## Benefits
157
+
158
+ - **Single source of truth:** All shadows now derive from M3 elevation spec
159
+ - **Swappable design language:** Can replace M3 with another system by changing base token values
160
+ - **Consistent naming:** Components use meaningful semantic names (xs-2xl) not arbitrary levels
161
+ - **Maintainable:** Changes to elevation values only need updates in one place (material3.language.ts)