@discourser/design-system 0.22.0 → 0.22.2

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 (33) hide show
  1. package/dist/{chunk-VJN7TIGL.js → chunk-GLPWI7OF.js} +3 -3
  2. package/dist/chunk-GLPWI7OF.js.map +1 -0
  3. package/dist/{chunk-IGCGVSG4.cjs → chunk-NN4YW27E.cjs} +3 -3
  4. package/dist/chunk-NN4YW27E.cjs.map +1 -0
  5. package/dist/figma-codex.json +2 -2
  6. package/dist/index.cjs +4 -4
  7. package/dist/index.js +1 -1
  8. package/dist/languages/transform.d.ts +1 -1
  9. package/dist/preset/index.cjs +2 -2
  10. package/dist/preset/index.js +1 -1
  11. package/dist/stories/foundations/components/ColorSwatch.d.ts +1 -15
  12. package/dist/stories/foundations/components/ColorSwatch.d.ts.map +1 -1
  13. package/dist/stories/foundations/components/ElevationCard.d.ts +3 -6
  14. package/dist/stories/foundations/components/ElevationCard.d.ts.map +1 -1
  15. package/dist/stories/foundations/components/SpacingBox.d.ts.map +1 -1
  16. package/dist/stories/foundations/components/TypeSpecimen.d.ts +2 -1
  17. package/dist/stories/foundations/components/TypeSpecimen.d.ts.map +1 -1
  18. package/package.json +4 -3
  19. package/src/languages/transform.ts +1 -1
  20. package/src/stories/foundations/Borders.stories.tsx +138 -0
  21. package/src/stories/foundations/ColorScale.stories.tsx +737 -0
  22. package/src/stories/foundations/Colors.mdx +2 -131
  23. package/src/stories/foundations/Elevation.mdx +26 -45
  24. package/src/stories/foundations/Motion.stories.tsx +306 -0
  25. package/src/stories/foundations/Shape.stories.tsx +159 -0
  26. package/src/stories/foundations/Spacing.mdx +24 -25
  27. package/src/stories/foundations/Typography.mdx +93 -79
  28. package/src/stories/foundations/components/ColorSwatch.tsx +72 -109
  29. package/src/stories/foundations/components/ElevationCard.tsx +19 -22
  30. package/src/stories/foundations/components/SpacingBox.tsx +15 -2
  31. package/src/stories/foundations/components/TypeSpecimen.tsx +20 -21
  32. package/dist/chunk-IGCGVSG4.cjs.map +0 -1
  33. package/dist/chunk-VJN7TIGL.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
- import { ColorSwatch, TonalSwatch, SemanticSwatch } from './components/ColorSwatch';
3
- import { material3Language } from '../../languages/material3.language';
2
+ import { SemanticSwatch } from './components/ColorSwatch';
4
3
 
5
4
  <Meta title="Foundations/Colors" />
6
5
 
@@ -18,67 +17,7 @@ Material Design 3 uses a three-tiered color system:
18
17
 
19
18
  ## Tonal Palettes
20
19
 
21
- Each palette contains 13 tones (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 100). Lower numbers are darker, higher numbers are lighter.
22
-
23
- ### Primary
24
-
25
- The primary palette is derived from TastyMakers green (#63A002).
26
-
27
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
28
- {Object.entries(material3Language.colors.primary).map(([tone, value]) => (
29
- <TonalSwatch key={tone} paletteName="primary" tone={Number(tone)} value={value} />
30
- ))}
31
- </div>
32
-
33
- ### Secondary
34
-
35
- Supporting colors that complement the primary palette.
36
-
37
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
38
- {Object.entries(material3Language.colors.secondary).map(([tone, value]) => (
39
- <TonalSwatch key={tone} paletteName="secondary" tone={Number(tone)} value={value} />
40
- ))}
41
- </div>
42
-
43
- ### Tertiary
44
-
45
- Additional accent colors for variety and visual interest.
46
-
47
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
48
- {Object.entries(material3Language.colors.tertiary).map(([tone, value]) => (
49
- <TonalSwatch key={tone} paletteName="tertiary" tone={Number(tone)} value={value} />
50
- ))}
51
- </div>
52
-
53
- ### Neutral
54
-
55
- For backgrounds, surfaces, and other neutral elements.
56
-
57
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
58
- {Object.entries(material3Language.colors.neutral).map(([tone, value]) => (
59
- <TonalSwatch key={tone} paletteName="neutral" tone={Number(tone)} value={value} />
60
- ))}
61
- </div>
62
-
63
- ### Neutral Variant
64
-
65
- Alternative neutral colors with subtle color temperature.
66
-
67
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
68
- {Object.entries(material3Language.colors.neutralVariant).map(([tone, value]) => (
69
- <TonalSwatch key={tone} paletteName="neutralVariant" tone={Number(tone)} value={value} />
70
- ))}
71
- </div>
72
-
73
- ### Error
74
-
75
- For error states, alerts, and destructive actions.
76
-
77
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(13, 1fr)', gap: '2px', marginBottom: '32px' }}>
78
- {Object.entries(material3Language.colors.error).map(([tone, value]) => (
79
- <TonalSwatch key={tone} paletteName="error" tone={Number(tone)} value={value} />
80
- ))}
81
- </div>
20
+ > **These are internal pipeline values.** Tonal palette steps (0–100) are used to build the Radix-scale and semantic tokens they are not Panda CSS tokens and should never be used directly in components. To see the usable color vocabulary, open **Foundations Color Scale** in the sidebar.
82
21
 
83
22
  ---
84
23
 
@@ -91,26 +30,18 @@ Semantic tokens are context-aware colors that automatically adapt to light and d
91
30
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
92
31
  <SemanticSwatch
93
32
  name="primary"
94
- lightValue={material3Language.semantic.primary}
95
- darkValue={material3Language.semanticDark.primary}
96
33
  description="Primary brand color for key actions and emphasis"
97
34
  />
98
35
  <SemanticSwatch
99
36
  name="onPrimary"
100
- lightValue={material3Language.semantic.onPrimary}
101
- darkValue={material3Language.semanticDark.onPrimary}
102
37
  description="Text/icons on primary color"
103
38
  />
104
39
  <SemanticSwatch
105
40
  name="primaryContainer"
106
- lightValue={material3Language.semantic.primaryContainer}
107
- darkValue={material3Language.semanticDark.primaryContainer}
108
41
  description="Container for primary elements"
109
42
  />
110
43
  <SemanticSwatch
111
44
  name="onPrimaryContainer"
112
- lightValue={material3Language.semantic.onPrimaryContainer}
113
- darkValue={material3Language.semanticDark.onPrimaryContainer}
114
45
  description="Text/icons on primary container"
115
46
  />
116
47
  </div>
@@ -120,26 +51,18 @@ Semantic tokens are context-aware colors that automatically adapt to light and d
120
51
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
121
52
  <SemanticSwatch
122
53
  name="secondary"
123
- lightValue={material3Language.semantic.secondary}
124
- darkValue={material3Language.semanticDark.secondary}
125
54
  description="Secondary actions and less prominent elements"
126
55
  />
127
56
  <SemanticSwatch
128
57
  name="onSecondary"
129
- lightValue={material3Language.semantic.onSecondary}
130
- darkValue={material3Language.semanticDark.onSecondary}
131
58
  description="Text/icons on secondary color"
132
59
  />
133
60
  <SemanticSwatch
134
61
  name="secondaryContainer"
135
- lightValue={material3Language.semantic.secondaryContainer}
136
- darkValue={material3Language.semanticDark.secondaryContainer}
137
62
  description="Container for secondary elements"
138
63
  />
139
64
  <SemanticSwatch
140
65
  name="onSecondaryContainer"
141
- lightValue={material3Language.semantic.onSecondaryContainer}
142
- darkValue={material3Language.semanticDark.onSecondaryContainer}
143
66
  description="Text/icons on secondary container"
144
67
  />
145
68
  </div>
@@ -149,26 +72,18 @@ Semantic tokens are context-aware colors that automatically adapt to light and d
149
72
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
150
73
  <SemanticSwatch
151
74
  name="tertiary"
152
- lightValue={material3Language.semantic.tertiary}
153
- darkValue={material3Language.semanticDark.tertiary}
154
75
  description="Contrasting accent color for visual interest"
155
76
  />
156
77
  <SemanticSwatch
157
78
  name="onTertiary"
158
- lightValue={material3Language.semantic.onTertiary}
159
- darkValue={material3Language.semanticDark.onTertiary}
160
79
  description="Text/icons on tertiary color"
161
80
  />
162
81
  <SemanticSwatch
163
82
  name="tertiaryContainer"
164
- lightValue={material3Language.semantic.tertiaryContainer}
165
- darkValue={material3Language.semanticDark.tertiaryContainer}
166
83
  description="Container for tertiary elements"
167
84
  />
168
85
  <SemanticSwatch
169
86
  name="onTertiaryContainer"
170
- lightValue={material3Language.semantic.onTertiaryContainer}
171
- darkValue={material3Language.semanticDark.onTertiaryContainer}
172
87
  description="Text/icons on tertiary container"
173
88
  />
174
89
  </div>
@@ -178,26 +93,18 @@ Semantic tokens are context-aware colors that automatically adapt to light and d
178
93
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
179
94
  <SemanticSwatch
180
95
  name="error"
181
- lightValue={material3Language.semantic.error}
182
- darkValue={material3Language.semanticDark.error}
183
96
  description="Error states and destructive actions"
184
97
  />
185
98
  <SemanticSwatch
186
99
  name="onError"
187
- lightValue={material3Language.semantic.onError}
188
- darkValue={material3Language.semanticDark.onError}
189
100
  description="Text/icons on error color"
190
101
  />
191
102
  <SemanticSwatch
192
103
  name="errorContainer"
193
- lightValue={material3Language.semantic.errorContainer}
194
- darkValue={material3Language.semanticDark.errorContainer}
195
104
  description="Container for error messages"
196
105
  />
197
106
  <SemanticSwatch
198
107
  name="onErrorContainer"
199
- lightValue={material3Language.semantic.onErrorContainer}
200
- darkValue={material3Language.semanticDark.onErrorContainer}
201
108
  description="Text/icons on error container"
202
109
  />
203
110
  </div>
@@ -207,26 +114,18 @@ Semantic tokens are context-aware colors that automatically adapt to light and d
207
114
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
208
115
  <SemanticSwatch
209
116
  name="surface"
210
- lightValue={material3Language.semantic.surface}
211
- darkValue={material3Language.semanticDark.surface}
212
117
  description="Base surface color for cards and containers"
213
118
  />
214
119
  <SemanticSwatch
215
120
  name="onSurface"
216
- lightValue={material3Language.semantic.onSurface}
217
- darkValue={material3Language.semanticDark.onSurface}
218
121
  description="Primary text and icons on surface"
219
122
  />
220
123
  <SemanticSwatch
221
124
  name="surfaceVariant"
222
- lightValue={material3Language.semantic.surfaceVariant}
223
- darkValue={material3Language.semanticDark.surfaceVariant}
224
125
  description="Alternative surface for variety"
225
126
  />
226
127
  <SemanticSwatch
227
128
  name="onSurfaceVariant"
228
- lightValue={material3Language.semantic.onSurfaceVariant}
229
- darkValue={material3Language.semanticDark.onSurfaceVariant}
230
129
  description="Text/icons on surface variant"
231
130
  />
232
131
  </div>
@@ -238,32 +137,22 @@ M3 provides 5 surface container levels for creating subtle depth without elevati
238
137
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
239
138
  <SemanticSwatch
240
139
  name="surfaceContainerLowest"
241
- lightValue={material3Language.semantic.surfaceContainerLowest}
242
- darkValue={material3Language.semanticDark.surfaceContainerLowest}
243
140
  description="Lowest container level"
244
141
  />
245
142
  <SemanticSwatch
246
143
  name="surfaceContainerLow"
247
- lightValue={material3Language.semantic.surfaceContainerLow}
248
- darkValue={material3Language.semanticDark.surfaceContainerLow}
249
144
  description="Low container level"
250
145
  />
251
146
  <SemanticSwatch
252
147
  name="surfaceContainer"
253
- lightValue={material3Language.semantic.surfaceContainer}
254
- darkValue={material3Language.semanticDark.surfaceContainer}
255
148
  description="Default container level"
256
149
  />
257
150
  <SemanticSwatch
258
151
  name="surfaceContainerHigh"
259
- lightValue={material3Language.semantic.surfaceContainerHigh}
260
- darkValue={material3Language.semanticDark.surfaceContainerHigh}
261
152
  description="High container level"
262
153
  />
263
154
  <SemanticSwatch
264
155
  name="surfaceContainerHighest"
265
- lightValue={material3Language.semantic.surfaceContainerHighest}
266
- darkValue={material3Language.semanticDark.surfaceContainerHighest}
267
156
  description="Highest container level"
268
157
  />
269
158
  </div>
@@ -273,14 +162,10 @@ M3 provides 5 surface container levels for creating subtle depth without elevati
273
162
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
274
163
  <SemanticSwatch
275
164
  name="outline"
276
- lightValue={material3Language.semantic.outline}
277
- darkValue={material3Language.semanticDark.outline}
278
165
  description="Important borders and dividers"
279
166
  />
280
167
  <SemanticSwatch
281
168
  name="outlineVariant"
282
- lightValue={material3Language.semantic.outlineVariant}
283
- darkValue={material3Language.semanticDark.outlineVariant}
284
169
  description="Decorative borders and dividers"
285
170
  />
286
171
  </div>
@@ -290,20 +175,14 @@ M3 provides 5 surface container levels for creating subtle depth without elevati
290
175
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
291
176
  <SemanticSwatch
292
177
  name="inverseSurface"
293
- lightValue={material3Language.semantic.inverseSurface}
294
- darkValue={material3Language.semanticDark.inverseSurface}
295
178
  description="Inverted surface (e.g., tooltips, snackbars)"
296
179
  />
297
180
  <SemanticSwatch
298
181
  name="inverseOnSurface"
299
- lightValue={material3Language.semantic.inverseOnSurface}
300
- darkValue={material3Language.semanticDark.inverseOnSurface}
301
182
  description="Text on inverse surface"
302
183
  />
303
184
  <SemanticSwatch
304
185
  name="inversePrimary"
305
- lightValue={material3Language.semantic.inversePrimary}
306
- darkValue={material3Language.semanticDark.inversePrimary}
307
186
  description="Primary color on inverse surface"
308
187
  />
309
188
  </div>
@@ -313,26 +192,18 @@ M3 provides 5 surface container levels for creating subtle depth without elevati
313
192
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '24px', marginBottom: '32px' }}>
314
193
  <SemanticSwatch
315
194
  name="background"
316
- lightValue={material3Language.semantic.background}
317
- darkValue={material3Language.semanticDark.background}
318
195
  description="Page background color"
319
196
  />
320
197
  <SemanticSwatch
321
198
  name="onBackground"
322
- lightValue={material3Language.semantic.onBackground}
323
- darkValue={material3Language.semanticDark.onBackground}
324
199
  description="Text/icons on background"
325
200
  />
326
201
  <SemanticSwatch
327
202
  name="scrim"
328
- lightValue={material3Language.semantic.scrim}
329
- darkValue={material3Language.semanticDark.scrim}
330
203
  description="Overlay for modals and dialogs"
331
204
  />
332
205
  <SemanticSwatch
333
206
  name="shadow"
334
- lightValue={material3Language.semantic.shadow}
335
- darkValue={material3Language.semanticDark.shadow}
336
207
  description="Shadow color for elevation"
337
208
  />
338
209
  </div>
@@ -1,6 +1,5 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
- import { ElevationGrid } from './components/ElevationCard';
3
- import { material3Language } from '../../languages/material3.language';
2
+ import { ElevationGrid, elevationClasses } from './components/ElevationCard';
4
3
 
5
4
  <Meta title="Foundations/Elevation" />
6
5
 
@@ -39,7 +38,7 @@ This architecture allows the design language to be swapped by changing which bas
39
38
 
40
39
  ## Elevation Scale
41
40
 
42
- <ElevationGrid elevations={material3Language.elevation.levels} />
41
+ <ElevationGrid />
43
42
 
44
43
  ---
45
44
 
@@ -143,35 +142,26 @@ Elevation works differently in dark themes:
143
142
  borderRadius: '8px',
144
143
  marginBottom: '32px'
145
144
  }}>
146
- <div style={{
147
- padding: '24px',
148
- backgroundColor: '#fff',
149
- borderRadius: '12px',
150
- boxShadow: material3Language.elevation.levels.level0,
151
- textAlign: 'center'
152
- }}>
145
+ <div
146
+ className={elevationClasses['level0']}
147
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
148
+ >
153
149
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 0</div>
154
150
  <div style={{ fontSize: '12px', color: '#666' }}>Flat surface</div>
155
151
  </div>
156
152
 
157
- <div style={{
158
- padding: '24px',
159
- backgroundColor: '#fff',
160
- borderRadius: '12px',
161
- boxShadow: material3Language.elevation.levels.level1,
162
- textAlign: 'center'
163
- }}>
153
+ <div
154
+ className={elevationClasses['level1']}
155
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
156
+ >
164
157
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 1</div>
165
158
  <div style={{ fontSize: '12px', color: '#666' }}>Subtle depth</div>
166
159
  </div>
167
160
 
168
- <div style={{
169
- padding: '24px',
170
- backgroundColor: '#fff',
171
- borderRadius: '12px',
172
- boxShadow: material3Language.elevation.levels.level2,
173
- textAlign: 'center'
174
- }}>
161
+ <div
162
+ className={elevationClasses['level2']}
163
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
164
+ >
175
165
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 2</div>
176
166
  <div style={{ fontSize: '12px', color: '#666' }}>Moderate depth</div>
177
167
  </div>
@@ -187,35 +177,26 @@ Elevation works differently in dark themes:
187
177
  backgroundColor: '#f5f5f5',
188
178
  borderRadius: '8px'
189
179
  }}>
190
- <div style={{
191
- padding: '24px',
192
- backgroundColor: '#fff',
193
- borderRadius: '12px',
194
- boxShadow: material3Language.elevation.levels.level3,
195
- textAlign: 'center'
196
- }}>
180
+ <div
181
+ className={elevationClasses['level3']}
182
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
183
+ >
197
184
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 3</div>
198
185
  <div style={{ fontSize: '12px', color: '#666' }}>Prominent float</div>
199
186
  </div>
200
187
 
201
- <div style={{
202
- padding: '24px',
203
- backgroundColor: '#fff',
204
- borderRadius: '12px',
205
- boxShadow: material3Language.elevation.levels.level4,
206
- textAlign: 'center'
207
- }}>
188
+ <div
189
+ className={elevationClasses['level4']}
190
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
191
+ >
208
192
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 4</div>
209
193
  <div style={{ fontSize: '12px', color: '#666' }}>High elevation</div>
210
194
  </div>
211
195
 
212
- <div style={{
213
- padding: '24px',
214
- backgroundColor: '#fff',
215
- borderRadius: '12px',
216
- boxShadow: material3Language.elevation.levels.level5,
217
- textAlign: 'center'
218
- }}>
196
+ <div
197
+ className={elevationClasses['level5']}
198
+ style={{ padding: '24px', backgroundColor: '#fff', borderRadius: '12px', textAlign: 'center' }}
199
+ >
219
200
  <div style={{ fontWeight: '600', marginBottom: '8px' }}>Level 5</div>
220
201
  <div style={{ fontSize: '12px', color: '#666' }}>Highest elevation</div>
221
202
  </div>