@discourser/design-system 0.22.4 → 0.24.0

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 (71) hide show
  1. package/dist/{chunk-GLPWI7OF.js → chunk-HN2IHIMR.js} +13 -7
  2. package/dist/chunk-HN2IHIMR.js.map +1 -0
  3. package/dist/{chunk-NN4YW27E.cjs → chunk-KIJKNZ73.cjs} +13 -7
  4. package/dist/chunk-KIJKNZ73.cjs.map +1 -0
  5. package/dist/{chunk-NU6GI57K.js → chunk-VN2QX6S7.js} +437 -3
  6. package/dist/chunk-VN2QX6S7.js.map +1 -0
  7. package/dist/{chunk-WSJLKVXZ.cjs → chunk-VOH2QELR.cjs} +441 -2
  8. package/dist/chunk-VOH2QELR.cjs.map +1 -0
  9. package/dist/components/Icons/AppleLoginIcon.d.ts +6 -0
  10. package/dist/components/Icons/AppleLoginIcon.d.ts.map +1 -0
  11. package/dist/components/Icons/ChevronUpDownIcon.d.ts +6 -0
  12. package/dist/components/Icons/ChevronUpDownIcon.d.ts.map +1 -0
  13. package/dist/components/Icons/GoogleLoginIcon.d.ts +6 -0
  14. package/dist/components/Icons/GoogleLoginIcon.d.ts.map +1 -0
  15. package/dist/components/Icons/LoginIcon.d.ts +6 -0
  16. package/dist/components/Icons/LoginIcon.d.ts.map +1 -0
  17. package/dist/components/Icons/LogoutIcon.d.ts +6 -0
  18. package/dist/components/Icons/LogoutIcon.d.ts.map +1 -0
  19. package/dist/components/Icons/index.d.ts +5 -0
  20. package/dist/components/Icons/index.d.ts.map +1 -1
  21. package/dist/components/SettingsPopover/SettingsPopover.d.ts +3 -0
  22. package/dist/components/SettingsPopover/SettingsPopover.d.ts.map +1 -0
  23. package/dist/components/SettingsPopover/index.d.ts +3 -0
  24. package/dist/components/SettingsPopover/index.d.ts.map +1 -0
  25. package/dist/components/SettingsPopover/types.d.ts +30 -0
  26. package/dist/components/SettingsPopover/types.d.ts.map +1 -0
  27. package/dist/components/divider/divider.d.ts +9 -0
  28. package/dist/components/divider/divider.d.ts.map +1 -0
  29. package/dist/components/divider/index.d.ts +2 -0
  30. package/dist/components/divider/index.d.ts.map +1 -0
  31. package/dist/components/index.cjs +89 -69
  32. package/dist/components/index.d.ts +5 -0
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/components/index.js +1 -1
  35. package/dist/contracts/design-language.contract.d.ts +2 -0
  36. package/dist/contracts/design-language.contract.d.ts.map +1 -1
  37. package/dist/figma-codex.json +2 -2
  38. package/dist/index.cjs +93 -73
  39. package/dist/index.js +2 -2
  40. package/dist/languages/material3.language.d.ts.map +1 -1
  41. package/dist/languages/transform.d.ts +1 -0
  42. package/dist/languages/transform.d.ts.map +1 -1
  43. package/dist/preset/index.cjs +2 -2
  44. package/dist/preset/index.js +1 -1
  45. package/package.json +5 -1
  46. package/src/components/Icons/AppleLoginIcon.tsx +21 -0
  47. package/src/components/Icons/ChevronUpDownIcon.tsx +23 -0
  48. package/src/components/Icons/GoogleLoginIcon.tsx +36 -0
  49. package/src/components/Icons/LoginIcon.tsx +71 -0
  50. package/src/components/Icons/LogoutIcon.tsx +43 -0
  51. package/src/components/Icons/index.ts +8 -0
  52. package/src/components/SettingsPopover/SettingsPopover.test.tsx +256 -0
  53. package/src/components/SettingsPopover/SettingsPopover.tsx +159 -0
  54. package/src/components/SettingsPopover/index.ts +2 -0
  55. package/src/components/SettingsPopover/types.ts +37 -0
  56. package/src/components/divider/divider.tsx +125 -0
  57. package/src/components/divider/index.ts +1 -0
  58. package/src/components/index.ts +14 -0
  59. package/src/contracts/design-language.contract.ts +3 -1
  60. package/src/languages/material3.language.ts +55 -45
  61. package/src/languages/transform.ts +3 -0
  62. package/src/stories/foundations/Typography.mdx +5 -2
  63. package/dist/chunk-GLPWI7OF.js.map +0 -1
  64. package/dist/chunk-NN4YW27E.cjs.map +0 -1
  65. package/dist/chunk-NU6GI57K.js.map +0 -1
  66. package/dist/chunk-WSJLKVXZ.cjs.map +0 -1
  67. package/docs/context-share/STORY-001-VALIDATION-PASSED.md +0 -192
  68. package/docs/context-share/STORY-002-IMPLEMENTATION-COMPLETE.md +0 -161
  69. package/docs/context-share/STORYBOOK_MCP_STRATEGY.md +0 -867
  70. package/docs/context-share/m3-token-pipeline-audit.md +0 -125
  71. package/docs/context-share/storybook-mcp-kai-agent-revised-summary.md +0 -211
@@ -1,125 +0,0 @@
1
- # M3 Token Pipeline Audit Report
2
-
3
- > **Date:** 2026-02-10
4
- > **Codebase:** Discourser Design System
5
- > **Scope:** Full Material 3 token pipeline — from `material-theme.json` through transforms, bridge files, preset, `panda.config.ts`, and generated `styled-system` output.
6
-
7
- ---
8
-
9
- ## Executive Summary
10
-
11
- The pipeline is **mostly healthy** after the recent fixes. Shadow token chaining works correctly, error/red DEFAULT tokens resolve properly, and the three palettes with Radix bridge files (primary, neutral/gray, error/red) have complete 1-12, a1-a12, and semantic variant (solid/subtle/surface/outline/plain) coverage in both light and dark modes.
12
-
13
- **Three issues found** — one is a significant gap, one is a minor discrepancy, and one is a question for you to decide on.
14
-
15
- ---
16
-
17
- ## Findings
18
-
19
- ### 🔴 Finding 1: Secondary and Tertiary Have No Radix Bridge Files
20
-
21
- **Severity: Significant gap**
22
-
23
- The `src/preset/colors/` directory contains bridge files for primary, neutral, and error — but **no `m3-secondary.ts` or `m3-tertiary.ts`**. The colors index only exports:
24
-
25
- ```ts
26
- export const colors = {
27
- primary, // ← has bridge (1-12, a1-a12, solid/subtle/surface/outline/plain)
28
- neutral, // ← has bridge
29
- error, // ← has bridge
30
- gray: neutral, // alias
31
- red: error, // alias
32
- };
33
- ```
34
-
35
- **What exists for secondary/tertiary:** Only M3 tonal palette values (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 100) from the language transform, plus M3 semantic tokens (secondary, secondary.container, onSecondary, onSecondary.container) from `semantic-tokens.ts`.
36
-
37
- **What's missing:** The Radix-scale bridge (1-12 solid scale, a1-a12 alpha scale) and all Park UI semantic variants (solid.bg, solid.fg, subtle.bg, surface.bg, outline.bg, plain.bg, etc.).
38
-
39
- **Impact:** Any Park UI component using `colorPalette="secondary"` or `colorPalette="tertiary"` will fail to resolve tokens like `colorPalette.9`, `colorPalette.solid.bg`, etc. If no components currently use these palettes, this is latent. But Kai (or any developer) would hit this the moment they try to use secondary/tertiary with a Park UI recipe.
40
-
41
- **Fix:** Create `m3-secondary.ts` and `m3-tertiary.ts` following the exact pattern of `m3-primary.ts`, then add them to the colors index with appropriate aliases.
42
-
43
- ---
44
-
45
- ### 🟡 Finding 2: `border` Token Discrepancy Between `panda.config.ts` and Preset
46
-
47
- **Severity: Minor — functionally OK, architecturally inconsistent**
48
-
49
- In `panda.config.ts`, the border token has **both** a root-level value and nested children:
50
-
51
- ```ts
52
- border: {
53
- value: { base: '{colors.gray.6}', _dark: '{colors.gray.6}' }, // root value ✅
54
- default: { value: { base: '{colors.gray.6}', _dark: '{colors.gray.6}' } },
55
- muted: { value: { base: '{colors.gray.4}', _dark: '{colors.gray.4}' } },
56
- },
57
- ```
58
-
59
- In `src/preset/index.ts`, it has **only** nested children (no root value):
60
-
61
- ```ts
62
- border: {
63
- default: { value: { base: '{colors.gray.6}', _dark: '{colors.gray.6}' } },
64
- muted: { value: { base: '{colors.gray.4}', _dark: '{colors.gray.4}' } },
65
- },
66
- ```
67
-
68
- **Generated output:** Only `colors.border` exists as a CSS variable. `colors.border.default` and `colors.border.muted` do **not** appear in `styled-system/tokens/index.mjs`. This means `panda.config.ts` is the one that ran codegen, and the root value took precedence — the nested children got merged/flattened.
69
-
70
- **Impact:** Nobody currently references `border.default` or `border.muted` in any recipe or component (confirmed by grep). Park UI upstream also defines border as a simple flat token. So functionally this is fine. But the preset definition (which would be what gets published as a package) differs from the local config, and the nested structure isn't generating separate tokens.
71
-
72
- **Fix:** Align the two files. Recommendation: match Park UI upstream — make border a flat token with just a root value. Remove the unused `default` and `muted` nesting from both files.
73
-
74
- ---
75
-
76
- ### 🟢 Finding 3: Confirmed Working — Shadow Token Chaining
77
-
78
- The recent elevation fix is fully operational:
79
-
80
- ```
81
- shadows.xs → resolves to → var(--shadows-level1)
82
- shadows.sm → resolves to → var(--shadows-level2)
83
- shadows.md → resolves to → var(--shadows-level3)
84
- shadows.lg → resolves to → var(--shadows-level4)
85
- shadows.xl → resolves to → var(--shadows-level5)
86
- shadows.2xl → resolves to → var(--shadows-level5)
87
- ```
88
-
89
- No recipes reference `level` tokens directly. No raw hex colors found in any recipe. The three-layer architecture (M3 base → Park UI semantic → component) is intact.
90
-
91
- ---
92
-
93
- ### 🟢 Finding 4: Confirmed Working — Error/Red DEFAULT Resolution
94
-
95
- `m3-error.ts` has a proper DEFAULT key:
96
-
97
- ```ts
98
- DEFAULT: { value: { base: m3[40], _dark: m3[80] } },
99
- ```
100
-
101
- Generated output shows both `colors.error` and `colors.red` resolve to CSS variables. The alias chain `red → error → m3 tonal palette` is intact.
102
-
103
- ---
104
-
105
- ### 🟢 Finding 5: M3 Semantic Tokens — No Nesting Issues
106
-
107
- All M3 semantic tokens in `semantic-tokens.ts` use proper `DEFAULT` keys where they have children (surface.DEFAULT + surface.container, onSurface.DEFAULT + onSurface.variant, etc.). No orphaned nested structures without root values.
108
-
109
- The `outline` token (M3 semantic: outline.DEFAULT, outline.variant) does **not** collide with the per-palette `outline` semantic variant (primary.outline.bg, error.outline.bg, etc.) because they're at different paths in the token tree.
110
-
111
- ---
112
-
113
- ## Items I Could NOT Verify (Require Running in the Project)
114
-
115
- - **`pnpm panda codegen` for fresh warnings** — The generated output I audited may be stale. Running codegen would confirm zero `Missing token` warnings.
116
- - **`pnpm test`** — Couldn't execute tests remotely. Test files exist for the language transform and should be run to confirm.
117
-
118
- ---
119
-
120
- ## Recommendation: Priority Order
121
-
122
- 1. **Create secondary/tertiary bridge files** — This is the real gap. Until these exist, those palettes are incomplete for Park UI consumption.
123
- 2. **Align border token structure** — Quick cleanup, flatten to match Park UI upstream.
124
- 3. **Run `pnpm panda codegen` and `pnpm test`** — Confirm clean output after any changes.
125
- 4. **Consider whether secondary/tertiary need aliases** (like `gray → neutral` and `red → error`) — depends on whether Park UI recipes ever reference these by alternate names.
@@ -1,211 +0,0 @@
1
- # Storybook MCP + Kai Agent Research — Revised Summary
2
-
3
- > **Date:** 2026-02-10
4
- > **Purpose:** Carry-forward context for next conversation session
5
- > **Start next chat with:** "Continuing Storybook MCP + Kai agent research — here's the revised summary"
6
-
7
- ---
8
-
9
- ## What We're Building
10
-
11
- A Design Engineer BMAD agent ("Kai") that uses Storybook MCP as its single source of truth for the Discourser Design System, replacing the failed Figma-MCP-direct-to-code approach.
12
-
13
- ```
14
- Figma MCP → visual intent only
15
-
16
- Kai (Design Engineer Agent)
17
-
18
- Storybook MCP (consolidated source)
19
- ├── Components (Ark UI / Park UI)
20
- ├── Layout Patterns (Panda CSS)
21
- ├── Tokens (semantic + visual)
22
- └── Composition Guides
23
-
24
- Design Implementation Spec → Dev Agent (Amelia)
25
- ```
26
-
27
- ---
28
-
29
- ## Critical Discovery: Storybook Already at 10.2.8
30
-
31
- You upgraded Storybook to **10.2.8** (well past the 10.1.0 minimum for component manifest). This changes the timeline significantly — the SB upgrade phase is **already done**.
32
-
33
- ---
34
-
35
- ## Current Storybook Inventory (Verified Live at localhost:6006)
36
-
37
- ### Components WITH Stories (.stories.tsx) — 17 components
38
- All have Docs page + interactive controls + props table via docgen:
39
-
40
- | Component | Stories | Notes |
41
- |-----------|---------|-------|
42
- | **Avatar** | Has stories | — |
43
- | **Badge** | Has stories | — |
44
- | **Button** | Default, All Variants, Color Palettes, All Sizes, Loading States, Disabled | Props: variant, size, colorPalette, loading, disabled. Docgen working. |
45
- | **Card** | Basic, All Variants, With Image | — |
46
- | **Checkbox** | Has stories (under Form) | — |
47
- | **Dialog** | Default, Sizes, Placement, Long Content | Compound component (Ark UI) — stories work |
48
- | **IconButton** | Has stories | — |
49
- | **Input** | Has stories (under Form) | — |
50
- | **InputGroup** | Has stories (under Form) | — |
51
- | **Progress** | Has stories | — |
52
- | **RadioGroup** | Has stories (under Form) | — |
53
- | **Select** | Default, Sizes, Disabled, With Groups | — |
54
- | **Slider** | Has stories | — |
55
- | **Stepper** | Default, All Visual States, Sizes, Color Palettes, Interactive Demo, Linear Navigation, Vertical, Numbers Only | Comprehensive. Critical for onboarding. |
56
- | **Switch** | Has stories | — |
57
- | **Tabs** | Has stories | — |
58
- | **Toast** | Has stories | — |
59
-
60
- ### Docs-Only Sections (MDX, no .stories.tsx)
61
- | Section | Contents |
62
- |---------|----------|
63
- | **Layout** | Docs-only folder |
64
- | **Form** | Grouping folder for Checkbox, Input, InputGroup, RadioGroup, Textarea |
65
- | **Typography** | Docs-only |
66
- | **Overlay** | Docs-only folder |
67
- | **Feedback** | Docs-only folder |
68
- | **Textarea** | Under Form group |
69
-
70
- ### Documentation Section
71
- | Area | Contents |
72
- |------|----------|
73
- | **Figma Make** | Figma template guides |
74
- | **Guidelines** | ~25 per-component implementation guides (99-Button, 99-Card, etc.) with decision trees, right/wrong patterns, import paths, variant tables, props reference, code examples |
75
- | **Claude Skills** | Context engineering files for Claude Code |
76
-
77
- ### Foundations (MDX docs)
78
- - Colors, Elevation, Spacing, Typography
79
-
80
- ### Key Observations
81
- 1. **Component stories already exist** — the original audit's "zero component stories" finding was outdated. This eliminates the biggest blocker.
82
- 2. **Docgen is working** — props tables auto-generate with descriptions (e.g., colorPalette shows "Color palette (M3 colors)").
83
- 3. **Guidelines section is the token bridge** — the 99-Button guide already documents variants, visual characteristics, and the M3 connection. This partially addresses the "TokenBridge.mdx" need.
84
- 4. **Compound components work** — Dialog stories render correctly despite Ark UI's Root/Trigger/Content pattern.
85
-
86
- ---
87
-
88
- ## What's NOT Done Yet
89
-
90
- 1. **`@storybook/addon-mcp` not installed** — `/mcp` endpoint returns "Not Found"
91
- 2. **`experimentalComponentsManifest` not enabled** — `/manifests/components.html` returns "Not Found"
92
- 3. **Kai agent YAML not written**
93
- 4. **Design Implementation Spec format not defined**
94
-
95
- ---
96
-
97
- ## Revised Phases
98
-
99
- ### Original Phases (from audit)
100
- | Phase | What | Status |
101
- |-------|------|--------|
102
- | 0 | Fix shadow token ambiguity | Still needed |
103
- | 1 | Create component stories | **DONE** — 17 components have stories |
104
- | 2 | Create TokenBridge.mdx | **Partially done** — Guidelines section covers much of this |
105
- | 3 | Add missing foundation docs | Still needed (Radii, layer styles) |
106
- | 4 | Upgrade Storybook 8→9 | **DONE** — already at 10.2.8 |
107
-
108
- ### Revised Phases
109
-
110
- | Phase | What | Effort | Why |
111
- |-------|------|--------|-----|
112
- | **0** | Install `@storybook/addon-mcp` + enable `experimentalComponentsManifest` | Small | Unlocks MCP endpoint. SB 10.2.8 already supports it. |
113
- | **1** | Verify component manifest output | Small | Confirm docgen data flows through `/manifests/components.json`. Test compound component (Dialog) representation. |
114
- | **2** | Fix shadow token ambiguity | Small | `level1-5` vs `lg` — consolidate vocabulary |
115
- | **3** | Add missing foundation docs (Radii, layer styles) | Medium | Complete token documentation for Kai |
116
- | **4** | Define Kai agent YAML + Design Implementation Spec format | Medium | The agent definition and its output contract |
117
- | **5** | Evaluate Guidelines coverage gaps | Low priority | Guidelines already cover most components. Identify any missing entries for new components. |
118
-
119
- **Phases 1 and 4 (original) are eliminated.** The biggest blockers are gone.
120
-
121
- ---
122
-
123
- ## Storybook MCP Addon — Version Requirements (Researched)
124
-
125
- | Capability | Min SB Version | Your Version | Status |
126
- |------------|---------------|--------------|--------|
127
- | Dev toolset (story URLs, build instructions) | 9.1.16 | 10.2.8 | ✅ Ready |
128
- | Docs toolset (component manifest, props, examples) | 10.1.0 | 10.2.8 | ✅ Ready (needs feature flag) |
129
- | Node.js requirement | 24+ | TBD | Verify |
130
-
131
- ### To enable:
132
- ```ts
133
- // .storybook/main.ts
134
- export default {
135
- addons: ['@storybook/addon-mcp'],
136
- features: {
137
- experimentalComponentsManifest: true,
138
- // Optional: experimentalCodeExamples: true,
139
- },
140
- };
141
- ```
142
-
143
- ### Two MCP toolsets:
144
- 1. **Dev toolset**: `get-ui-building-instructions`, `get-stories-urls` — needs .stories.tsx files ✅ (exist)
145
- 2. **Docs toolset**: `list-all-components`, `get-component-details` — needs component manifest ✅ (SB version supports it)
146
-
147
- ---
148
-
149
- ## Kai Agent — Structural Patterns (from existing BMAD agents)
150
-
151
- Analyzed `dev_agent.yaml` and `tea_agent.yaml`:
152
-
153
- ```yaml
154
- agent:
155
- webskip: true # Used by dev and tea agents
156
- metadata:
157
- id: "_bmad/bmm/agents/{name}.md"
158
- name: {PersonaName}
159
- title: {Role}
160
- icon: {emoji}
161
- module: bmm
162
- hasSidecar: false
163
- persona:
164
- role: {description}
165
- identity: {core purpose}
166
- communication_style: {voice}
167
- principles: |
168
- - Bullet list of core principles
169
- critical_actions:
170
- - "Mandatory behaviors with specific file paths"
171
- menu:
172
- - trigger: {XX} or fuzzy match on {keyword}
173
- workflow: "{project-root}/_bmad/bmm/workflows/{path}/workflow.yaml"
174
- description: "[XX] Name: Description"
175
- ```
176
-
177
- Key patterns: Dev agent is ultra-succinct, file-path oriented, strict test requirements. TEA agent uses knowledge fragment loading via index CSV. Both have `critical_actions` that run before any work.
178
-
179
- ---
180
-
181
- ## Panda CSS + Storybook Compatibility Notes
182
-
183
- - Vite builder: PostCSS config must use array syntax: `plugins: [require('@pandacss/dev/postcss')()]`
184
- - Import generated CSS in `.storybook/preview.ts`: `import '../src/index.css'`
185
- - Add Storybook files to panda.config.ts include: `"./stories/**/*.{js,jsx,ts,tsx}"`
186
- - Use `staticCss` to pre-generate recipe variants for Storybook
187
- - Use `.raw()` marker for args that need Panda style detection
188
-
189
- ---
190
-
191
- ## Open Questions for Next Session
192
-
193
- 1. **Node.js version** — Is Node 24+ available in your dev environment? Required for addon-mcp.
194
- 2. **Component manifest with Ark UI compounds** — Does Dialog.Root/Trigger/Content pattern generate useful docgen data through the manifest? (Needs hands-on test after Phase 0)
195
- 3. **Kai agent output format** — What should a "Design Implementation Spec" look like to feed the Dev agent?
196
- 4. **Guidelines coverage** — Are there gaps between the 25 Guidelines entries and the 17 storied components?
197
-
198
- ---
199
-
200
- ## Key Files
201
-
202
- | File | Location | Purpose |
203
- |------|----------|---------|
204
- | Storybook config | `.storybook/main.ts` | Add addon-mcp + feature flag here |
205
- | Token source | `src/preset/` | Colors, semantic-tokens, shadows, text-styles, layer-styles |
206
- | Recipes | `src/preset/recipes/` | 30 recipes |
207
- | Components | `src/components/` | 27 components |
208
- | Stories | Alongside components (verified working) | .stories.tsx files |
209
- | Foundation docs | `src/stories/foundations/` | Colors, Typography, Spacing, Elevation MDX |
210
- | Guidelines | Under Documentation section | 25+ component implementation guides |
211
- | Repo | `Tasty-Maker-Studio/Discourser-Design-System` v0.13.0+ | — |