datocms-react-ui 2.1.4 → 3.0.1-alpha.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 (135) hide show
  1. package/dist/cjs/Button/styles.module.css.json +1 -1
  2. package/dist/cjs/ButtonGroup/Button/styles.module.css.json +1 -1
  3. package/dist/cjs/ButtonGroup/Group/styles.module.css.json +1 -1
  4. package/dist/cjs/Canvas/index.js +181 -276
  5. package/dist/cjs/Canvas/index.js.map +1 -1
  6. package/dist/cjs/Canvas/styles.module.css.json +1 -1
  7. package/dist/cjs/ContextInspector/styles.module.css.json +1 -1
  8. package/dist/cjs/Dropdown/styles.module.css.json +1 -1
  9. package/dist/cjs/FieldError/styles.module.css.json +1 -1
  10. package/dist/cjs/FieldHint/styles.module.css.json +1 -1
  11. package/dist/cjs/FormLabel/styles.module.css.json +1 -1
  12. package/dist/cjs/HotKey/styles.module.css.json +1 -1
  13. package/dist/cjs/Section/styles.module.css.json +1 -1
  14. package/dist/cjs/SelectInput/index.js +41 -22
  15. package/dist/cjs/SelectInput/index.js.map +1 -1
  16. package/dist/cjs/SidebarPanel/index.js +4 -11
  17. package/dist/cjs/SidebarPanel/index.js.map +1 -1
  18. package/dist/cjs/SidebarPanel/styles.module.css.json +1 -1
  19. package/dist/cjs/Spinner/styles.module.css.json +1 -1
  20. package/dist/cjs/SplitView/SplitViewSash/styles.module.css.json +1 -1
  21. package/dist/cjs/SwitchField/styles.module.css.json +1 -1
  22. package/dist/cjs/SwitchInput/styles.module.css.json +1 -1
  23. package/dist/cjs/TextInput/styles.module.css.json +1 -1
  24. package/dist/cjs/TextareaInput/styles.module.css.json +1 -1
  25. package/dist/cjs/Toolbar/Button/styles.module.css.json +1 -1
  26. package/dist/cjs/Toolbar/Toolbar/index.js +3 -3
  27. package/dist/cjs/Toolbar/Toolbar/styles.module.css.json +1 -1
  28. package/dist/cjs/Tooltip/TooltipContent/styles.module.css.json +1 -1
  29. package/dist/cjs/Tooltip/TooltipDelayGroup/index.js +2 -2
  30. package/dist/cjs/VerticalSplit/index.js +4 -4
  31. package/dist/cjs/VerticalSplit/styles.module.css.json +1 -1
  32. package/dist/cjs/generateStyleFromCtx/index.js +133 -2
  33. package/dist/cjs/generateStyleFromCtx/index.js.map +1 -1
  34. package/dist/cjs/icons.js +8 -8
  35. package/dist/cjs/icons.js.map +1 -1
  36. package/dist/esm/Button/styles.module.css.json +1 -1
  37. package/dist/esm/ButtonGroup/Button/styles.module.css.json +1 -1
  38. package/dist/esm/ButtonGroup/Group/styles.module.css.json +1 -1
  39. package/dist/esm/Canvas/index.d.ts +181 -276
  40. package/dist/esm/Canvas/index.js +181 -276
  41. package/dist/esm/Canvas/index.js.map +1 -1
  42. package/dist/esm/Canvas/styles.module.css.json +1 -1
  43. package/dist/esm/ContextInspector/styles.module.css.json +1 -1
  44. package/dist/esm/Dropdown/styles.module.css.json +1 -1
  45. package/dist/esm/FieldError/styles.module.css.json +1 -1
  46. package/dist/esm/FieldHint/styles.module.css.json +1 -1
  47. package/dist/esm/FormLabel/styles.module.css.json +1 -1
  48. package/dist/esm/HotKey/styles.module.css.json +1 -1
  49. package/dist/esm/Section/styles.module.css.json +1 -1
  50. package/dist/esm/SelectInput/index.js +41 -22
  51. package/dist/esm/SelectInput/index.js.map +1 -1
  52. package/dist/esm/SidebarPanel/index.d.ts +2 -2
  53. package/dist/esm/SidebarPanel/index.js +4 -11
  54. package/dist/esm/SidebarPanel/index.js.map +1 -1
  55. package/dist/esm/SidebarPanel/styles.module.css.json +1 -1
  56. package/dist/esm/Spinner/styles.module.css.json +1 -1
  57. package/dist/esm/SplitView/SplitViewSash/styles.module.css.json +1 -1
  58. package/dist/esm/SwitchField/styles.module.css.json +1 -1
  59. package/dist/esm/SwitchInput/styles.module.css.json +1 -1
  60. package/dist/esm/TextInput/styles.module.css.json +1 -1
  61. package/dist/esm/TextareaInput/styles.module.css.json +1 -1
  62. package/dist/esm/Toolbar/Button/styles.module.css.json +1 -1
  63. package/dist/esm/Toolbar/Toolbar/index.d.ts +3 -3
  64. package/dist/esm/Toolbar/Toolbar/index.js +3 -3
  65. package/dist/esm/Toolbar/Toolbar/styles.module.css.json +1 -1
  66. package/dist/esm/Tooltip/TooltipContent/styles.module.css.json +1 -1
  67. package/dist/esm/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
  68. package/dist/esm/Tooltip/TooltipDelayGroup/index.js +2 -2
  69. package/dist/esm/VerticalSplit/index.d.ts +4 -4
  70. package/dist/esm/VerticalSplit/index.js +4 -4
  71. package/dist/esm/VerticalSplit/styles.module.css.json +1 -1
  72. package/dist/esm/generateStyleFromCtx/index.js +133 -2
  73. package/dist/esm/generateStyleFromCtx/index.js.map +1 -1
  74. package/dist/esm/icons.js +8 -8
  75. package/dist/esm/icons.js.map +1 -1
  76. package/dist/types/Canvas/index.d.ts +181 -276
  77. package/dist/types/SidebarPanel/index.d.ts +2 -2
  78. package/dist/types/Toolbar/Toolbar/index.d.ts +3 -3
  79. package/dist/types/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
  80. package/dist/types/VerticalSplit/index.d.ts +4 -4
  81. package/package.json +3 -3
  82. package/src/Button/styles.module.css +19 -19
  83. package/src/Button/styles.module.css.json +1 -1
  84. package/src/ButtonGroup/Button/styles.module.css +15 -17
  85. package/src/ButtonGroup/Button/styles.module.css.json +1 -1
  86. package/src/ButtonGroup/Group/styles.module.css +1 -1
  87. package/src/ButtonGroup/Group/styles.module.css.json +1 -1
  88. package/src/Canvas/index.tsx +181 -276
  89. package/src/Canvas/styles.module.css +75 -16
  90. package/src/Canvas/styles.module.css.json +1 -1
  91. package/src/ContextInspector/styles.module.css +10 -10
  92. package/src/ContextInspector/styles.module.css.json +1 -1
  93. package/src/Dropdown/styles.module.css +30 -28
  94. package/src/Dropdown/styles.module.css.json +1 -1
  95. package/src/FieldError/styles.module.css +1 -1
  96. package/src/FieldError/styles.module.css.json +1 -1
  97. package/src/FieldHint/styles.module.css +1 -1
  98. package/src/FieldHint/styles.module.css.json +1 -1
  99. package/src/FormLabel/styles.module.css +2 -2
  100. package/src/FormLabel/styles.module.css.json +1 -1
  101. package/src/HotKey/styles.module.css +1 -1
  102. package/src/HotKey/styles.module.css.json +1 -1
  103. package/src/Section/styles.module.css +8 -8
  104. package/src/Section/styles.module.css.json +1 -1
  105. package/src/SelectInput/index.tsx +53 -26
  106. package/src/SidebarPanel/index.tsx +4 -29
  107. package/src/SidebarPanel/styles.module.css +6 -6
  108. package/src/SidebarPanel/styles.module.css.json +1 -1
  109. package/src/Spinner/styles.module.css +1 -1
  110. package/src/Spinner/styles.module.css.json +1 -1
  111. package/src/SplitView/SplitViewSash/styles.module.css +7 -7
  112. package/src/SplitView/SplitViewSash/styles.module.css.json +1 -1
  113. package/src/SwitchField/styles.module.css +1 -1
  114. package/src/SwitchField/styles.module.css.json +1 -1
  115. package/src/SwitchInput/styles.module.css +16 -13
  116. package/src/SwitchInput/styles.module.css.json +1 -1
  117. package/src/TextInput/styles.module.css +13 -11
  118. package/src/TextInput/styles.module.css.json +1 -1
  119. package/src/TextareaInput/styles.module.css +13 -11
  120. package/src/TextareaInput/styles.module.css.json +1 -1
  121. package/src/Toolbar/Button/styles.module.css +4 -4
  122. package/src/Toolbar/Button/styles.module.css.json +1 -1
  123. package/src/Toolbar/Toolbar/index.tsx +3 -3
  124. package/src/Toolbar/Toolbar/styles.module.css +2 -2
  125. package/src/Toolbar/Toolbar/styles.module.css.json +1 -1
  126. package/src/Tooltip/TooltipContent/styles.module.css +2 -2
  127. package/src/Tooltip/TooltipContent/styles.module.css.json +1 -1
  128. package/src/Tooltip/TooltipDelayGroup/index.tsx +2 -2
  129. package/src/VerticalSplit/index.tsx +4 -4
  130. package/src/VerticalSplit/styles.module.css +7 -11
  131. package/src/VerticalSplit/styles.module.css.json +1 -1
  132. package/src/generateStyleFromCtx/index.ts +153 -0
  133. package/src/icons.tsx +8 -0
  134. package/styles.css +29 -1
  135. package/types.json +517 -389
@@ -34,283 +34,188 @@ export type CanvasProps = {
34
34
  };
35
35
 
36
36
  /**
37
- * @example Color palette CSS variables
37
+ * @example Semantic color token CSS variables
38
38
  *
39
- * Within the `Canvas` component, a color palette is made available as a set of
40
- * CSS variables, allowing you to conform to the theme of the current
41
- * environment:
39
+ * Inside `Canvas`, the host exposes a full semantic color palette as CSS
40
+ * custom properties. Components should reference these tokens directly
41
+ * they adapt to the user's active theme (including dark mode)
42
+ * automatically.
43
+ *
44
+ * ### How to read a token name
45
+ *
46
+ * ```
47
+ * --color--{property} // standalone (one -- after color)
48
+ * --color--{context}--{property} // context pair (two -- after color)
49
+ * ```
50
+ *
51
+ * **Properties** — `surface` (backgrounds), `ink` (text/icons),
52
+ * `border` (1px lines), `outline` (focus rings), plus `fill` / `track`
53
+ * for progress bars.
54
+ *
55
+ * **Standalone** tokens work on any neutral page. **Contexts** are
56
+ * self-contained environments: always pair a `surface` with the `ink`,
57
+ * `border`, and hover states from the *same* context. Never mix — e.g.
58
+ * don't put `--color--primary--ink` on `--color--danger--surface`.
59
+ *
60
+ * Non-color tokens `--shadow--elevated` / `--shadow--float` /
61
+ * `--shadow--ambient` are ready-made `box-shadow` composites.
42
62
  *
43
63
  * ```js
44
64
  * <Canvas ctx={ctx}>
45
- * <Section title="Text colors">
46
- * <table>
47
- * <tbody>
48
- * <tr>
49
- * <td>
50
- * <code>--base-body-color</code>
51
- * </td>
52
- * <td width="30%">
53
- * <div
54
- * style={{
55
- * width: '30px',
56
- * height: '30px',
57
- * background: 'var(--base-body-color)',
58
- * }}
59
- * />
60
- * </td>
65
+ * <Section title="Standalone — use on any neutral page">
66
+ * <table><tbody>
67
+ * {[
68
+ * ['--color--surface', 'Default page background'],
69
+ * ['--color--surface-hover', 'Hovered row / list item'],
70
+ * ['--color--surface-muted', 'Muted section / card background'],
71
+ * ['--color--ink', 'Primary text'],
72
+ * ['--color--ink-subtle', 'Secondary text / captions'],
73
+ * ['--color--ink-hover', 'Text under hover'],
74
+ * ['--color--ink-muted', 'De-emphasized text'],
75
+ * ['--color--ink-placeholder', 'Input placeholder text'],
76
+ * ['--color--ink-primary', 'Brand-highlighted text / icons'],
77
+ * ['--color--ink-accent', 'Links / accent text'],
78
+ * ['--color--ink-disabled', 'Disabled text'],
79
+ * ['--color--border', 'Default 1px border'],
80
+ * ['--color--border-hover', 'Border under hover'],
81
+ * ].map(([t, d]) => (
82
+ * <tr key={t}>
83
+ * <td><code>{t}</code></td>
84
+ * <td style={{ color: 'var(--color--ink-subtle)' }}>{d}</td>
85
+ * <td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td>
61
86
  * </tr>
62
- * <tr>
63
- * <td>
64
- * <code>--light-body-color</code>
65
- * </td>
66
- * <td width="30%">
67
- * <div
68
- * style={{
69
- * width: '30px',
70
- * height: '30px',
71
- * background: 'var(--light-body-color)',
72
- * }}
73
- * />
74
- * </td>
75
- * </tr>
76
- * <tr>
77
- * <td>
78
- * <code>--placeholder-body-color</code>
79
- * </td>
80
- * <td width="30%">
81
- * <div
82
- * style={{
83
- * width: '30px',
84
- * height: '30px',
85
- * background: 'var(--placeholder-body-color)',
86
- * }}
87
- * />
88
- * </td>
89
- * </tr>
90
- * </tbody>
91
- * </table>
87
+ * ))}
88
+ * </tbody></table>
92
89
  * </Section>
93
- * <Section title="UI colors">
94
- * <table>
95
- * <tbody>
96
- * <tr>
97
- * <td>
98
- * <code>--light-bg-color</code>
99
- * </td>
100
- * <td width="30%">
101
- * <div
102
- * style={{
103
- * width: '30px',
104
- * height: '30px',
105
- * background: 'var(--light-bg-color)',
106
- * }}
107
- * />
108
- * </td>
109
- * </tr>
110
- * <tr>
111
- * <td>
112
- * <code>--lighter-bg-color</code>
113
- * </td>
114
- * <td width="30%">
115
- * <div
116
- * style={{
117
- * width: '30px',
118
- * height: '30px',
119
- * background: 'var(--lighter-bg-color)',
120
- * }}
121
- * />
122
- * </td>
123
- * </tr>
124
- * <tr>
125
- * <td>
126
- * <code>--disabled-bg-color</code>
127
- * </td>
128
- * <td width="30%">
129
- * <div
130
- * style={{
131
- * width: '30px',
132
- * height: '30px',
133
- * background: 'var(--disabled-bg-color)',
134
- * }}
135
- * />
136
- * </td>
137
- * </tr>
138
- * <tr>
139
- * <td>
140
- * <code>--border-color</code>
141
- * </td>
142
- * <td width="30%">
143
- * <div
144
- * style={{
145
- * width: '30px',
146
- * height: '30px',
147
- * background: 'var(--border-color)',
148
- * }}
149
- * />
150
- * </td>
151
- * </tr>
152
- * <tr>
153
- * <td>
154
- * <code>--darker-border-color</code>
155
- * </td>
156
- * <td width="30%">
157
- * <div
158
- * style={{
159
- * width: '30px',
160
- * height: '30px',
161
- * background: 'var(--darker-border-color)',
162
- * }}
163
- * />
164
- * </td>
165
- * </tr>
166
- * <tr>
167
- * <td>
168
- * <code>--alert-color</code>
169
- * </td>
170
- * <td width="30%">
171
- * <div
172
- * style={{
173
- * width: '30px',
174
- * height: '30px',
175
- * background: 'var(--alert-color)',
176
- * }}
177
- * />
178
- * </td>
179
- * </tr>
180
- * <tr>
181
- * <td>
182
- * <code>--warning-color</code>
183
- * </td>
184
- * <td width="30%">
185
- * <div
186
- * style={{
187
- * width: '30px',
188
- * height: '30px',
189
- * background: 'var(--warning-color)',
190
- * }}
191
- * />
192
- * </td>
193
- * </tr>
194
- * <tr>
195
- * <td>
196
- * <code>--notice-color</code>
197
- * </td>
198
- * <td width="30%">
199
- * <div
200
- * style={{
201
- * width: '30px',
202
- * height: '30px',
203
- * background: 'var(--notice-color)',
204
- * }}
205
- * />
206
- * </td>
207
- * </tr>
208
- * <tr>
209
- * <td>
210
- * <code>--warning-bg-color</code>
211
- * </td>
212
- * <td width="30%">
213
- * <div
214
- * style={{
215
- * width: '30px',
216
- * height: '30px',
217
- * background: 'var(--warning-bg-color)',
218
- * }}
219
- * />
220
- * </td>
221
- * </tr>
222
- * <tr>
223
- * <td>
224
- * <code>--add-color</code>
225
- * </td>
226
- * <td width="30%">
227
- * <div
228
- * style={{
229
- * width: '30px',
230
- * height: '30px',
231
- * background: 'var(--add-color)',
232
- * }}
233
- * />
234
- * </td>
235
- * </tr>
236
- * <tr>
237
- * <td>
238
- * <code>--remove-color</code>
239
- * </td>
240
- * <td width="30%">
241
- * <div
242
- * style={{
243
- * width: '30px',
244
- * height: '30px',
245
- * background: 'var(--remove-color)',
246
- * }}
247
- * />
248
- * </td>
249
- * </tr>
250
- * </tbody>
251
- * </table>
90
+ *
91
+ * <Section title="Context: raised — modals, dropdowns, popovers">
92
+ * <table><tbody>
93
+ * {['--color--raised--surface', '--color--raised--surface-hover', '--color--raised--surface-active']
94
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
95
+ * </tbody></table>
252
96
  * </Section>
253
- * <Section title="Project-specific colors">
254
- * <table>
255
- * <tbody>
256
- * <tr>
257
- * <td>
258
- * <code>--accent-color</code>
259
- * </td>
260
- * <td width="30%">
261
- * <div
262
- * style={{
263
- * width: '30px',
264
- * height: '30px',
265
- * background: 'var(--accent-color)',
266
- * }}
267
- * />
268
- * </td>
269
- * </tr>
270
- * <tr>
271
- * <td>
272
- * <code>--primary-color</code>
273
- * </td>
274
- * <td width="30%">
275
- * <div
276
- * style={{
277
- * width: '30px',
278
- * height: '30px',
279
- * background: 'var(--primary-color)',
280
- * }}
281
- * />
282
- * </td>
283
- * </tr>
284
- * <tr>
285
- * <td>
286
- * <code>--light-color</code>
287
- * </td>
288
- * <td width="30%">
289
- * <div
290
- * style={{
291
- * width: '30px',
292
- * height: '30px',
293
- * background: 'var(--light-color)',
294
- * }}
295
- * />
296
- * </td>
297
- * </tr>
298
- * <tr>
299
- * <td>
300
- * <code>--dark-color</code>
301
- * </td>
302
- * <td width="30%">
303
- * <div
304
- * style={{
305
- * width: '30px',
306
- * height: '30px',
307
- * background: 'var(--dark-color)',
308
- * }}
309
- * />
310
- * </td>
311
- * </tr>
312
- * </tbody>
313
- * </table>
97
+ *
98
+ * <Section title="Context: primary — main call-to-action buttons, badges, nav">
99
+ * <table><tbody>
100
+ * {['--color--primary--surface', '--color--primary--surface-hover', '--color--primary--surface-active', '--color--primary--surface-muted', '--color--primary--ink', '--color--primary--border']
101
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
102
+ * </tbody></table>
103
+ * </Section>
104
+ *
105
+ * <Section title="Context: tinted — subtle brand-tinted surfaces">
106
+ * <table><tbody>
107
+ * {['--color--tinted--surface', '--color--tinted--surface-hover', '--color--tinted--surface-active', '--color--tinted--ink']
108
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
109
+ * </tbody></table>
110
+ * </Section>
111
+ *
112
+ * <Section title="Context: accent, selected, disabled, danger, enterprise">
113
+ * <table><tbody>
114
+ * {['--color--accent--surface', '--color--accent--ink',
115
+ * '--color--selected--surface', '--color--selected--ink', '--color--selected--border',
116
+ * '--color--disabled--surface', '--color--disabled--ink',
117
+ * '--color--danger--surface', '--color--danger--ink',
118
+ * '--color--enterprise--surface']
119
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
120
+ * </tbody></table>
121
+ * </Section>
122
+ *
123
+ * <Section title="Context: focus — focus rings and outlines">
124
+ * <table><tbody>
125
+ * {['--color--focus--border', '--color--focus--outline']
126
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
127
+ * </tbody></table>
128
+ * </Section>
129
+ *
130
+ * <Section title="Feedback — validation and form states">
131
+ * <table><tbody>
132
+ * {['--color--feedback-fail--ink', '--color--feedback-fail--border', '--color--feedback-fail--outline',
133
+ * '--color--feedback-warning--ink', '--color--feedback-warning--surface', '--color--feedback-warning--border',
134
+ * '--color--feedback-success--ink', '--color--feedback-success--border']
135
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
136
+ * </tbody></table>
137
+ * </Section>
138
+ *
139
+ * <Section title="Context: highlight — rich text inline highlights">
140
+ * <table><tbody>
141
+ * {['--color--highlight--surface']
142
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
143
+ * </tbody></table>
144
+ * </Section>
145
+ *
146
+ * <Section title="Diffs — content versioning (added / removed / changed)">
147
+ * <table><tbody>
148
+ * {['--color--diff-added--surface', '--color--diff-removed--surface', '--color--diff-changed--surface',
149
+ * '--color--diff-added--surface-subtle', '--color--diff-removed--surface-subtle', '--color--diff-changed--surface-subtle',
150
+ * '--color--diff-added--outline-subtle', '--color--diff-removed--outline-subtle', '--color--diff-changed--outline-subtle',
151
+ * '--color--diff-changed--border', '--color--diff-changed--border-negative']
152
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
153
+ * </tbody></table>
154
+ * </Section>
155
+ *
156
+ * <Section title="Status — publishing workflow badges (ink-only)">
157
+ * <table><tbody>
158
+ * {['--color--status-draft--ink', '--color--status-outdated--ink', '--color--status-published--ink']
159
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td><span style={{ color: `var(${t})`, fontWeight: 'bold' }}>Sample text</span></td></tr>))}
160
+ * </tbody></table>
161
+ * </Section>
162
+ *
163
+ * <Section title="Backdrop & overlay — scrims and floating UI">
164
+ * <table><tbody>
165
+ * {['--color--backdrop--surface', '--color--backdrop--ink',
166
+ * '--color--overlay--surface', '--color--overlay--surface-subtle', '--color--overlay--ink']
167
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
168
+ * </tbody></table>
169
+ * </Section>
170
+ *
171
+ * <Section title="Stacked — dark layered UI (uploaders, media players)">
172
+ * <p>Stacked gives you three layers of depth (base → surface → raised) plus buttons, borders and a translucent fill. Use it when a dark inline panel needs internal hierarchy.</p>
173
+ * <table><tbody>
174
+ * {['--color--stacked--surface-base', '--color--stacked--surface', '--color--stacked--surface-raised',
175
+ * '--color--stacked--surface-hover', '--color--stacked--surface-translucent',
176
+ * '--color--stacked--surface-button', '--color--stacked--surface-button-active',
177
+ * '--color--stacked--ink', '--color--stacked--ink-subtle', '--color--stacked--border']
178
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
179
+ * </tbody></table>
180
+ * </Section>
181
+ *
182
+ * <Section title="Progress — bar track and fill">
183
+ * <table><tbody>
184
+ * {['--color--progress--track', '--color--progress--fill', '--color--progress--fill-hover']
185
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
186
+ * </tbody></table>
187
+ * </Section>
188
+ *
189
+ * <Section title="Tooltip — small dark floating labels">
190
+ * <table><tbody>
191
+ * {['--color--tooltip--surface', '--color--tooltip--surface-hover', '--color--tooltip--ink', '--color--tooltip--ink-subtle']
192
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
193
+ * </tbody></table>
194
+ * </Section>
195
+ *
196
+ * <Section title="Code — dark code blocks, logs, error traces">
197
+ * <table><tbody>
198
+ * {['--color--code--surface', '--color--code--ink']
199
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
200
+ * </tbody></table>
201
+ * </Section>
202
+ *
203
+ * <Section title="Shadow colors and scrollbar">
204
+ * <table><tbody>
205
+ * {['--color--shadow-subtle', '--color--shadow', '--color--shadow-strong', '--color--scrollbar']
206
+ * .map((t) => (<tr key={t}><td><code>{t}</code></td><td width="40"><div style={{ width: '30px', height: '30px', background: `var(${t})`, border: '1px solid var(--color--border)' }} /></td></tr>))}
207
+ * </tbody></table>
208
+ * </Section>
209
+ *
210
+ * <Section title="Shadow composites — drop-in box-shadow values">
211
+ * <div style={{ display: 'flex', gap: 'var(--spacing-l)', padding: 'var(--spacing-l)' }}>
212
+ * {['--shadow--elevated', '--shadow--float', '--shadow--ambient'].map((t) => (
213
+ * <div key={t} style={{ textAlign: 'center' }}>
214
+ * <div style={{ width: '80px', height: '80px', background: 'var(--color--surface)', borderRadius: '4px', boxShadow: `var(${t})` }} />
215
+ * <code style={{ display: 'block', marginTop: 'var(--spacing-s)', fontSize: 'var(--font-size-xs)' }}>{t}</code>
216
+ * </div>
217
+ * ))}
218
+ * </div>
314
219
  * </Section>
315
220
  * </Canvas>;
316
221
  * ```
@@ -443,7 +348,7 @@ export type CanvasProps = {
443
348
  * <td>
444
349
  * <div
445
350
  * style={{
446
- * background: 'var(--accent-color)',
351
+ * background: 'var(--color--accent--surface)',
447
352
  * width: 'var(--spacing-s)',
448
353
  * height: 'var(--spacing-s)',
449
354
  * }}
@@ -457,7 +362,7 @@ export type CanvasProps = {
457
362
  * <td>
458
363
  * <div
459
364
  * style={{
460
- * background: 'var(--accent-color)',
365
+ * background: 'var(--color--accent--surface)',
461
366
  * width: 'var(--spacing-m)',
462
367
  * height: 'var(--spacing-m)',
463
368
  * }}
@@ -471,7 +376,7 @@ export type CanvasProps = {
471
376
  * <td>
472
377
  * <div
473
378
  * style={{
474
- * background: 'var(--accent-color)',
379
+ * background: 'var(--color--accent--surface)',
475
380
  * width: 'var(--spacing-l)',
476
381
  * height: 'var(--spacing-l)',
477
382
  * }}
@@ -485,7 +390,7 @@ export type CanvasProps = {
485
390
  * <td>
486
391
  * <div
487
392
  * style={{
488
- * background: 'var(--accent-color)',
393
+ * background: 'var(--color--accent--surface)',
489
394
  * width: 'var(--spacing-xl)',
490
395
  * height: 'var(--spacing-xl)',
491
396
  * }}
@@ -499,7 +404,7 @@ export type CanvasProps = {
499
404
  * <td>
500
405
  * <div
501
406
  * style={{
502
- * background: 'var(--accent-color)',
407
+ * background: 'var(--color--accent--surface)',
503
408
  * width: 'var(--spacing-xxl)',
504
409
  * height: 'var(--spacing-xxl)',
505
410
  * }}
@@ -513,7 +418,7 @@ export type CanvasProps = {
513
418
  * <td>
514
419
  * <div
515
420
  * style={{
516
- * background: 'var(--accent-color)',
421
+ * background: 'var(--color--accent--surface)',
517
422
  * width: 'var(--spacing-xxxl)',
518
423
  * height: 'var(--spacing-xxxl)',
519
424
  * }}
@@ -1,33 +1,89 @@
1
1
  .themeVariables {
2
- /* Colors */
2
+ /**
3
+ * @deprecated LEGACY COLOR VARIABLES — DO NOT USE IN NEW CODE.
4
+ *
5
+ * The color variables below are kept strictly for backward compatibility
6
+ * with third-party plugins authored before the semantic color token
7
+ * system. Each one now resolves to its closest semantic token (so it
8
+ * follows the active theme, including dark mode), falling back to the
9
+ * original hardcoded light-mode value if the token is unavailable.
10
+ *
11
+ * The colors in this block will be removed in a future major version.
12
+ * Migrate to the `--color--*` semantic tokens (see the `Canvas` JSDoc
13
+ * for the full list). The non-color tokens further below (fonts, spacing,
14
+ * font-sizes, easings) are stable and will remain.
15
+ */
16
+ /* Colors (deprecated) */
3
17
  --base-body-color-rgb-components: 52, 54, 58;
4
- --base-body-color: rgb(var(--base-body-color-rgb-components));
18
+ --base-body-color: var(
19
+ --color--ink,
20
+ rgb(var(--base-body-color-rgb-components))
21
+ );
5
22
  --light-body-color-rgb-components: 132, 132, 132;
6
- --light-body-color: rgb(var(--light-body-color-rgb-components));
23
+ --light-body-color: var(
24
+ --color--ink-subtle,
25
+ rgb(var(--light-body-color-rgb-components))
26
+ );
7
27
  --placeholder-body-color-rgb-components: 198, 198, 198;
8
- --placeholder-body-color: rgb(var(--placeholder-body-color-rgb-components));
28
+ --placeholder-body-color: var(
29
+ --color--ink-placeholder,
30
+ rgb(var(--placeholder-body-color-rgb-components))
31
+ );
9
32
  --light-bg-color-rgb-components: 245, 245, 245;
10
- --light-bg-color: rgb(var(--light-bg-color-rgb-components));
33
+ --light-bg-color: var(
34
+ --color--surface-muted,
35
+ rgb(var(--light-bg-color-rgb-components))
36
+ );
11
37
  --lighter-bg-color-rgb-components: 248, 248, 248;
12
- --lighter-bg-color: rgb(var(--lighter-bg-color-rgb-components));
38
+ --lighter-bg-color: var(
39
+ --color--surface-muted,
40
+ rgb(var(--lighter-bg-color-rgb-components))
41
+ );
13
42
  --disabled-bg-color-rgb-components: 237, 237, 237;
14
- --disabled-bg-color: rgb(var(--disabled-bg-color-rgb-components));
43
+ --disabled-bg-color: var(
44
+ --color--disabled--surface,
45
+ rgb(var(--disabled-bg-color-rgb-components))
46
+ );
15
47
  --border-color-rgb-components: 240, 240, 240;
16
- --border-color: rgb(var(--border-color-rgb-components));
48
+ --border-color: var(
49
+ --color--border,
50
+ rgb(var(--border-color-rgb-components))
51
+ );
17
52
  --darker-border-color-rgb-components: 215, 215, 215;
18
- --darker-border-color: rgb(var(--darker-border-color-rgb-components));
53
+ --darker-border-color: var(
54
+ --color--border-hover,
55
+ rgb(var(--darker-border-color-rgb-components))
56
+ );
19
57
  --alert-color-rgb-components: 255, 94, 73;
20
- --alert-color: rgb(var(--alert-color-rgb-components));
58
+ --alert-color: var(
59
+ --color--feedback-fail--ink,
60
+ rgb(var(--alert-color-rgb-components))
61
+ );
21
62
  --warning-color-rgb-components: 255, 215, 0;
22
- --warning-color: rgb(var(--warning-color-rgb-components));
63
+ --warning-color: var(
64
+ --color--feedback-warning--ink,
65
+ rgb(var(--warning-color-rgb-components))
66
+ );
23
67
  --notice-color-rgb-components: 70, 215, 0;
24
- --notice-color: rgb(var(--notice-color-rgb-components));
68
+ --notice-color: var(
69
+ --color--feedback-success--ink,
70
+ rgb(var(--notice-color-rgb-components))
71
+ );
25
72
  --warning-bg-color-rgb-components: 255, 255, 229;
26
- --warning-bg-color: rgb(var(--warning-bg-color-rgb-components));
73
+ --warning-bg-color: var(
74
+ --color--feedback-warning--surface,
75
+ rgb(var(--warning-bg-color-rgb-components))
76
+ );
27
77
  --add-color-rgb-components: 76, 176, 109;
28
- --add-color: rgb(var(--add-color-rgb-components));
78
+ --add-color: var(
79
+ --color--diff-added--surface,
80
+ rgb(var(--add-color-rgb-components))
81
+ );
29
82
  --remove-color-rgb-components: 235, 87, 106;
30
- --remove-color: rgb(var(--remove-color-rgb-components));
83
+ --remove-color: var(
84
+ --color--diff-removed--surface,
85
+ rgb(var(--remove-color-rgb-components))
86
+ );
31
87
 
32
88
  /* Fonts */
33
89
  --base-font-family:
@@ -39,6 +95,7 @@
39
95
  --font-weight-bold: 500;
40
96
 
41
97
  /* Spacing */
98
+ --spacing-xs: calc(0.25 * 12 * 0.0625rem);
42
99
  --spacing-s: calc(0.5 * 12 * 0.0625rem);
43
100
  --spacing-m: calc(1 * 12 * 0.0625rem);
44
101
  --spacing-l: calc(2 * 12 * 0.0625rem);
@@ -46,6 +103,7 @@
46
103
  --spacing-xxl: calc(5 * 12 * 0.0625rem);
47
104
  --spacing-xxxl: calc(8 * 12 * 0.0625rem);
48
105
 
106
+ --negative-spacing-xs: calc(-0.25 * 12 * 0.0625rem);
49
107
  --negative-spacing-s: calc(-0.5 * 12 * 0.0625rem);
50
108
  --negative-spacing-m: calc(-1 * 12 * 0.0625rem);
51
109
  --negative-spacing-l: calc(-2 * 12 * 0.0625rem);
@@ -71,7 +129,8 @@
71
129
  font-family: var(--base-font-family);
72
130
  -webkit-text-size-adjust: 100%;
73
131
  line-height: 1.5;
74
- color: var(--base-body-color);
132
+ color: var(--color--ink);
133
+ background: var(--color--surface);
75
134
  font-size: var(--font-size-m);
76
135
  text-rendering: optimizeLegibility;
77
136
  }
@@ -1 +1 @@
1
- {"themeVariables":"_themeVariables_2dr1w_1","canvas":"_canvas_2dr1w_70"}
1
+ {"themeVariables":"_themeVariables_fb3bs_1","canvas":"_canvas_fb3bs_128"}