@tanstack/devtools-ui 0.6.0 → 0.7.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 (59) hide show
  1. package/dist/assets/BricolageGrotesque-Bold-BIJrwikb.ttf +0 -0
  2. package/dist/assets/Inter-latin-BwkfbSeq.woff2 +0 -0
  3. package/dist/esm/assets/fonts/BricolageGrotesque-Bold.js +6 -0
  4. package/dist/esm/assets/fonts/BricolageGrotesque-Bold.js.map +1 -0
  5. package/dist/esm/assets/fonts/Inter-latin.js +6 -0
  6. package/dist/esm/assets/fonts/Inter-latin.js.map +1 -0
  7. package/dist/esm/components/button.js +1 -1
  8. package/dist/esm/components/button.js.map +1 -1
  9. package/dist/esm/components/checkbox.js +13 -7
  10. package/dist/esm/components/checkbox.js.map +1 -1
  11. package/dist/esm/components/header.js +1 -1
  12. package/dist/esm/components/header.js.map +1 -1
  13. package/dist/esm/components/icons.d.ts +1 -1
  14. package/dist/esm/components/icons.js +4 -8
  15. package/dist/esm/components/icons.js.map +1 -1
  16. package/dist/esm/components/input.js +14 -7
  17. package/dist/esm/components/input.js.map +1 -1
  18. package/dist/esm/components/logo.js +1 -1
  19. package/dist/esm/components/logo.js.map +1 -1
  20. package/dist/esm/components/main-panel.js +1 -1
  21. package/dist/esm/components/main-panel.js.map +1 -1
  22. package/dist/esm/components/section.js +1 -1
  23. package/dist/esm/components/section.js.map +1 -1
  24. package/dist/esm/components/select.js +22 -11
  25. package/dist/esm/components/select.js.map +1 -1
  26. package/dist/esm/components/tag.js +1 -1
  27. package/dist/esm/components/tag.js.map +1 -1
  28. package/dist/esm/components/theme.js +12 -2
  29. package/dist/esm/components/theme.js.map +1 -1
  30. package/dist/esm/components/tree.js +108 -56
  31. package/dist/esm/components/tree.js.map +1 -1
  32. package/dist/esm/internal.d.ts +2 -0
  33. package/dist/esm/internal.js +2 -0
  34. package/dist/esm/styles/semantic-theme.d.ts +420 -0
  35. package/dist/esm/styles/semantic-theme.js +283 -0
  36. package/dist/esm/styles/semantic-theme.js.map +1 -0
  37. package/dist/esm/styles/use-styles.d.ts +2 -0
  38. package/dist/esm/styles/use-styles.js +300 -368
  39. package/dist/esm/styles/use-styles.js.map +1 -1
  40. package/package.json +12 -3
  41. package/src/assets/fonts/OFL-Bricolage-Grotesque.txt +93 -0
  42. package/src/assets/fonts/OFL-Inter.txt +92 -0
  43. package/src/components/button.tsx +1 -1
  44. package/src/components/checkbox.tsx +6 -2
  45. package/src/components/header.tsx +7 -1
  46. package/src/components/icons.tsx +5 -5
  47. package/src/components/input.tsx +12 -3
  48. package/src/components/logo.tsx +1 -0
  49. package/src/components/main-panel.tsx +1 -0
  50. package/src/components/section.tsx +10 -2
  51. package/src/components/select.tsx +27 -8
  52. package/src/components/tag.tsx +5 -1
  53. package/src/components/theme.tsx +9 -1
  54. package/src/components/tree.tsx +90 -23
  55. package/src/internal.ts +11 -0
  56. package/src/styles/semantic-theme.ts +345 -0
  57. package/src/styles/use-styles.ts +315 -307
  58. package/dist/esm/styles/tokens.js +0 -301
  59. package/dist/esm/styles/tokens.js.map +0 -1
@@ -1,215 +1,33 @@
1
+ import { resolveSemanticTheme } from "./semantic-theme.js";
1
2
  import { createTheme } from "../components/theme.js";
2
- import { tokens } from "./tokens.js";
3
3
  import { createEffect, createSignal } from "solid-js";
4
4
  import * as goober from "goober";
5
5
  //#region src/styles/use-styles.ts
6
- var buttonVariantColors = {
7
- primary: {
8
- bg: {
9
- light: tokens.colors.gray[900],
10
- dark: tokens.colors.gray[100]
11
- },
12
- hover: {
13
- light: tokens.colors.gray[800],
14
- dark: tokens.colors.gray[200]
15
- },
16
- active: {
17
- light: tokens.colors.gray[700],
18
- dark: tokens.colors.gray[300]
19
- },
20
- text: {
21
- light: "#fff",
22
- dark: tokens.colors.gray[900]
23
- },
24
- border: {
25
- light: tokens.colors.gray[800],
26
- dark: tokens.colors.gray[200]
27
- },
28
- outline: {
29
- light: tokens.colors.gray[900],
30
- dark: tokens.colors.gray[100]
31
- },
32
- outlineHover: {
33
- light: tokens.colors.gray[800],
34
- dark: tokens.colors.gray[200]
35
- }
36
- },
37
- secondary: {
38
- bg: {
39
- light: tokens.colors.gray[100],
40
- dark: tokens.colors.gray[100]
41
- },
42
- hover: {
43
- light: tokens.colors.gray[200],
44
- dark: tokens.colors.gray[200]
45
- },
46
- active: {
47
- light: tokens.colors.gray[300],
48
- dark: tokens.colors.gray[300]
49
- },
50
- text: {
51
- light: tokens.colors.gray[900],
52
- dark: tokens.colors.gray[900]
53
- },
54
- border: {
55
- light: tokens.colors.gray[300],
56
- dark: tokens.colors.gray[300]
57
- },
58
- outline: {
59
- light: tokens.colors.gray[700],
60
- dark: tokens.colors.gray[300]
61
- },
62
- outlineHover: {
63
- light: tokens.colors.gray[800],
64
- dark: tokens.colors.gray[200]
65
- }
66
- },
67
- info: {
68
- bg: {
69
- light: tokens.colors.blue[500],
70
- dark: tokens.colors.blue[500]
71
- },
72
- hover: {
73
- light: tokens.colors.blue[600],
74
- dark: tokens.colors.blue[600]
75
- },
76
- active: {
77
- light: tokens.colors.blue[700],
78
- dark: tokens.colors.blue[700]
79
- },
80
- text: {
81
- light: "#fff",
82
- dark: "#fff"
83
- },
84
- border: {
85
- light: tokens.colors.blue[500],
86
- dark: tokens.colors.blue[500]
87
- },
88
- outline: {
89
- light: tokens.colors.blue[700],
90
- dark: tokens.colors.blue[300]
91
- },
92
- outlineHover: {
93
- light: tokens.colors.blue[600],
94
- dark: tokens.colors.blue[200]
95
- }
96
- },
97
- warning: {
98
- bg: {
99
- light: tokens.colors.yellow[500],
100
- dark: tokens.colors.yellow[500]
101
- },
102
- hover: {
103
- light: tokens.colors.yellow[600],
104
- dark: tokens.colors.yellow[600]
105
- },
106
- active: {
107
- light: tokens.colors.yellow[700],
108
- dark: tokens.colors.yellow[700]
109
- },
110
- text: {
111
- light: "#fff",
112
- dark: "#fff"
113
- },
114
- border: {
115
- light: tokens.colors.yellow[500],
116
- dark: tokens.colors.yellow[500]
117
- },
118
- outline: {
119
- light: tokens.colors.yellow[700],
120
- dark: tokens.colors.yellow[300]
121
- },
122
- outlineHover: {
123
- light: tokens.colors.yellow[600],
124
- dark: tokens.colors.yellow[200]
125
- }
126
- },
127
- danger: {
128
- bg: {
129
- light: tokens.colors.red[500],
130
- dark: tokens.colors.red[500]
131
- },
132
- hover: {
133
- light: tokens.colors.red[600],
134
- dark: tokens.colors.red[600]
135
- },
136
- active: {
137
- light: tokens.colors.red[700],
138
- dark: tokens.colors.red[700]
139
- },
140
- text: {
141
- light: "#fff",
142
- dark: "#fff"
143
- },
144
- border: {
145
- light: tokens.colors.red[500],
146
- dark: tokens.colors.red[500]
147
- },
148
- outline: {
149
- light: tokens.colors.red[700],
150
- dark: tokens.colors.red[300]
151
- },
152
- outlineHover: {
153
- light: tokens.colors.red[600],
154
- dark: tokens.colors.red[200]
155
- }
156
- },
157
- success: {
158
- bg: {
159
- light: tokens.colors.green[500],
160
- dark: tokens.colors.green[500]
161
- },
162
- hover: {
163
- light: tokens.colors.green[600],
164
- dark: tokens.colors.green[600]
165
- },
166
- active: {
167
- light: tokens.colors.green[700],
168
- dark: tokens.colors.green[700]
169
- },
170
- text: {
171
- light: "#fff",
172
- dark: "#fff"
173
- },
174
- border: {
175
- light: tokens.colors.green[500],
176
- dark: tokens.colors.green[500]
177
- },
178
- outline: {
179
- light: tokens.colors.green[700],
180
- dark: tokens.colors.green[300]
181
- },
182
- outlineHover: {
183
- light: tokens.colors.green[600],
184
- dark: tokens.colors.green[200]
185
- }
186
- }
187
- };
188
6
  var css = goober.css;
189
7
  var stylesFactory = (theme) => {
190
- const { colors, font, size, border } = tokens;
191
- const { fontFamily } = font;
8
+ const semantic = resolveSemanticTheme(theme);
192
9
  const t = (light, dark) => theme === "light" ? light : dark;
193
10
  const buildButtonVariant = (variant) => {
194
- const v = buttonVariantColors[variant];
195
- const outlineColor = t(v.outline.light, v.outline.dark);
196
- const outlineHoverColor = t(v.outlineHover.light, v.outlineHover.dark);
197
- const solidBg = t(v.bg.light, v.bg.dark);
198
- const solidHover = t(v.hover.light, v.hover.dark);
199
- const solidActive = t(v.active.light, v.active.dark);
200
- const solidText = t(v.text.light, v.text.dark);
201
- const solidBorder = t(v.border.light, v.border.dark);
11
+ const statusRole = variant === "danger" ? "error" : variant === "primary" || variant === "secondary" ? "neutral" : variant;
12
+ const status = semantic.color.status[statusRole];
13
+ const outlineColor = status.text;
14
+ const outlineHoverColor = status.text;
15
+ const solidBg = status.solidFill;
16
+ const solidHover = status.border;
17
+ const solidActive = status.solidFill;
18
+ const solidText = status.onFill;
19
+ const solidBorder = status.border;
202
20
  return {
203
21
  ghost: css`
204
22
  background: transparent;
205
23
  color: ${outlineColor};
206
24
  border-color: transparent;
207
25
  &:hover {
208
- background: ${t(colors.gray[100], colors.darkGray[800])};
26
+ background: ${semantic.color.state.hover};
209
27
  color: ${outlineHoverColor};
210
28
  }
211
29
  &:active {
212
- background: ${t(colors.gray[200], colors.darkGray[700])};
30
+ background: ${semantic.color.state.pressed};
213
31
  color: ${outlineHoverColor};
214
32
  }
215
33
  `,
@@ -218,12 +36,12 @@ var stylesFactory = (theme) => {
218
36
  color: ${outlineColor};
219
37
  border-color: ${outlineColor};
220
38
  &:hover {
221
- background: ${t(colors.gray[50], colors.darkGray[800])};
39
+ background: ${semantic.color.state.hover};
222
40
  color: ${outlineHoverColor};
223
41
  border-color: ${outlineHoverColor};
224
42
  }
225
43
  &:active {
226
- background: ${t(colors.gray[100], colors.darkGray[700])};
44
+ background: ${semantic.color.state.pressed};
227
45
  color: ${outlineHoverColor};
228
46
  border-color: ${outlineHoverColor};
229
47
  }
@@ -235,12 +53,12 @@ var stylesFactory = (theme) => {
235
53
  &:hover {
236
54
  background: ${solidHover};
237
55
  border-color: ${solidHover};
238
- box-shadow: ${t(tokens.shadow.xs("rgb(0 0 0 / 0.12)"), tokens.shadow.xs("rgb(0 0 0 / 0.5)"))};
56
+ box-shadow: ${semantic.shadow.xs};
239
57
  }
240
58
  &:active {
241
59
  background: ${solidActive};
242
60
  border-color: ${solidActive};
243
- box-shadow: ${t(tokens.shadow.inner("rgb(0 0 0 / 0.2)"), tokens.shadow.inner("rgb(0 0 0 / 0.6)"))};
61
+ box-shadow: ${semantic.shadow.sm};
244
62
  }
245
63
  `
246
64
  };
@@ -254,6 +72,10 @@ var stylesFactory = (theme) => {
254
72
  success: buildButtonVariant("success")
255
73
  };
256
74
  const wrapperSize = 320;
75
+ const legacyTagColor = (color) => {
76
+ const semanticRole = color === "red" ? "error" : color === "yellow" ? "warning" : color === "green" ? "success" : color === "blue" || color === "cyan" || color === "teal" ? "info" : "neutral";
77
+ return semantic.color.status[semanticRole].solidFill;
78
+ };
257
79
  return {
258
80
  logo: css`
259
81
  cursor: pointer;
@@ -261,10 +83,10 @@ var stylesFactory = (theme) => {
261
83
  flex-direction: column;
262
84
  background-color: transparent;
263
85
  border: none;
264
- width: ${size[12]};
265
- height: ${size[12]};
266
- font-family: ${fontFamily.sans};
267
- gap: ${tokens.size[.5]};
86
+ width: 48px;
87
+ height: 48px;
88
+ font-family: ${semantic.font.body};
89
+ gap: ${semantic.gap.tight};
268
90
  padding: 0;
269
91
  &:hover {
270
92
  opacity: 0.7;
@@ -275,50 +97,77 @@ var stylesFactory = (theme) => {
275
97
  max-width: ${wrapperSize}px;
276
98
  display: flex;
277
99
  flex-direction: column;
278
- gap: 0.375rem;
100
+ gap: ${semantic.gap.tight};
279
101
  `,
280
102
  selectContainer: css`
281
103
  width: 100%;
104
+ &::selection,
105
+ & *::selection {
106
+ background: ${semantic.color.state.selectionFill};
107
+ color: ${semantic.color.state.selectionText};
108
+ }
282
109
  `,
283
110
  selectLabel: css`
284
- font-size: 0.875rem;
285
- font-weight: 500;
286
- color: ${t(colors.gray[900], colors.gray[100])};
111
+ font: ${semantic.type.labelSm.weight} ${semantic.type.labelSm.size} /
112
+ ${semantic.type.labelSm.lineHeight} ${semantic.font.body};
113
+ letter-spacing: ${semantic.type.labelSm.tracking};
114
+ color: ${semantic.color.text.primary};
287
115
  text-align: left;
288
116
  `,
289
117
  selectDescription: css`
290
- font-size: 0.8rem;
291
- color: ${t(colors.gray[500], colors.gray[400])};
118
+ font: ${semantic.type.bodyXs.weight} ${semantic.type.bodyXs.size} /
119
+ ${semantic.type.bodyXs.lineHeight} ${semantic.font.body};
120
+ color: ${semantic.color.text.secondary};
292
121
  margin: 0;
293
- line-height: 1.3;
294
122
  text-align: left;
295
123
  `,
296
124
  select: css`
125
+ /* The platform chevron is drawn in the OS accent, which reads as foreign
126
+ next to the rest of the panel — draw our own from currentColor instead
127
+ so it follows the theme. */
297
128
  appearance: none;
129
+ -webkit-appearance: none;
298
130
  width: 100%;
299
- padding: 0.5rem 3rem 0.5rem 0.75rem;
300
- border-radius: 0.375rem;
301
- background-color: ${t(colors.gray[50], colors.darkGray[800])};
302
- color: ${t(colors.gray[900], colors.gray[100])};
303
- border: 1px solid ${t(colors.gray[200], colors.gray[800])};
304
- font-size: 0.875rem;
305
- transition: all 0.15s ease;
306
- cursor: pointer;
307
-
308
- /* Custom arrow */
309
- background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
131
+ box-sizing: border-box;
132
+ padding: ${semantic.padding.controlBlock} 28px
133
+ ${semantic.padding.controlBlock} ${semantic.padding.controlInline};
134
+ border-radius: ${semantic.radius.control};
135
+ background-color: ${semantic.color.surface.elevated};
136
+ background-image:
137
+ linear-gradient(45deg, transparent 50%, currentColor 50%),
138
+ linear-gradient(135deg, currentColor 50%, transparent 50%);
139
+ background-position:
140
+ right 14px center,
141
+ right 9px center;
142
+ background-size:
143
+ 5px 5px,
144
+ 5px 5px;
310
145
  background-repeat: no-repeat;
311
- background-position: right 0.75rem center;
312
- background-size: 1.25rem;
146
+ color: ${semantic.color.text.primary};
147
+ border: 1px solid ${semantic.color.border.control};
148
+ font: ${semantic.type.bodySm.weight} ${semantic.type.bodySm.size} /
149
+ ${semantic.type.bodySm.lineHeight} ${semantic.font.body};
150
+ transition:
151
+ border-color 0.15s ease,
152
+ background-color 0.15s ease;
153
+ cursor: pointer;
313
154
 
314
155
  &:hover {
315
- border-color: ${t(colors.gray[300], colors.gray[700])};
156
+ border-color: ${semantic.color.border.focus};
316
157
  }
317
158
 
318
- &:focus {
319
- outline: none;
320
- border-color: ${colors.gray[400]};
321
- box-shadow: 0 0 0 3px ${t(colors.gray[200], colors.gray[800])};
159
+ &:focus-visible {
160
+ outline: 2px solid ${semantic.color.border.focus};
161
+ outline-offset: 2px;
162
+ }
163
+ /* The custom chevron is decorative; let the platform draw its own when
164
+ the user forces system colours. */
165
+ @media (forced-colors: active) {
166
+ appearance: auto;
167
+ background-image: none;
168
+ }
169
+ @media (prefers-reduced-motion: reduce) {
170
+ transition: none;
322
171
  }
323
172
  `,
324
173
  inputWrapper: css`
@@ -326,117 +175,134 @@ var stylesFactory = (theme) => {
326
175
  max-width: ${wrapperSize}px;
327
176
  display: flex;
328
177
  flex-direction: column;
329
- gap: 0.375rem;
178
+ gap: ${semantic.gap.tight};
330
179
  `,
331
180
  inputContainer: css`
332
181
  width: 100%;
182
+ &::selection,
183
+ & *::selection {
184
+ background: ${semantic.color.state.selectionFill};
185
+ color: ${semantic.color.state.selectionText};
186
+ }
333
187
  `,
334
188
  inputLabel: css`
335
- font-size: 0.875rem;
336
- font-weight: 500;
337
- color: ${t(colors.gray[900], colors.gray[100])};
189
+ font: ${semantic.type.labelSm.weight} ${semantic.type.labelSm.size} /
190
+ ${semantic.type.labelSm.lineHeight} ${semantic.font.body};
191
+ letter-spacing: ${semantic.type.labelSm.tracking};
192
+ color: ${semantic.color.text.primary};
338
193
  text-align: left;
339
194
  `,
340
195
  inputDescription: css`
341
- font-size: 0.8rem;
342
- color: ${t(colors.gray[500], colors.gray[400])};
196
+ font: ${semantic.type.bodyXs.weight} ${semantic.type.bodyXs.size} /
197
+ ${semantic.type.bodyXs.lineHeight} ${semantic.font.body};
198
+ color: ${semantic.color.text.secondary};
343
199
  margin: 0;
344
- line-height: 1.3;
345
200
  text-align: left;
346
201
  `,
347
202
  input: css`
348
203
  appearance: none;
349
204
  box-sizing: border-box;
350
205
  width: 100%;
351
- padding: 0.5rem 0.75rem;
352
- border-radius: 0.375rem;
353
- background-color: ${t(colors.gray[50], colors.darkGray[800])};
354
- color: ${t(colors.gray[900], colors.gray[100])};
355
- border: 1px solid ${t(colors.gray[200], colors.gray[800])};
356
- font-size: 0.875rem;
357
- font-family: ${fontFamily.mono};
206
+ padding: ${semantic.padding.controlBlock}
207
+ ${semantic.padding.controlInline};
208
+ border-radius: ${semantic.radius.control};
209
+ background-color: ${semantic.color.surface.elevated};
210
+ color: ${semantic.color.text.primary};
211
+ border: 1px solid ${semantic.color.border.control};
212
+ font: ${semantic.type.bodySm.weight} ${semantic.type.bodySm.size} /
213
+ ${semantic.type.bodySm.lineHeight} ${semantic.font.body};
358
214
  transition: all 0.15s ease;
359
215
 
360
216
  &::placeholder {
361
- color: ${t(colors.gray[400], colors.gray[500])};
217
+ color: ${semantic.color.text.secondary};
362
218
  }
363
219
 
364
220
  &:hover {
365
- border-color: ${t(colors.gray[300], colors.gray[700])};
221
+ border-color: ${semantic.color.border.focus};
366
222
  }
367
223
 
368
224
  &:focus {
369
- outline: none;
370
- border-color: ${t(colors.gray[400], colors.gray[600])};
371
- box-shadow: 0 0 0 3px ${t(colors.gray[200], colors.gray[800])};
225
+ outline: 2px solid ${semantic.color.border.focus};
226
+ outline-offset: 2px;
372
227
  }
373
228
  `,
374
229
  checkboxWrapper: css`
375
230
  display: flex;
376
231
  align-items: flex-start;
377
- gap: 0.75rem;
232
+ gap: ${semantic.gap.control};
378
233
  cursor: pointer;
379
234
  user-select: none;
380
- padding: 0.375rem;
381
- border-radius: 0.375rem;
235
+ padding: ${semantic.padding.controlBlock}
236
+ ${semantic.padding.controlInline};
237
+ border-radius: ${semantic.radius.control};
382
238
  transition: background-color 0.15s ease;
383
239
 
384
240
  &:hover {
385
- background-color: ${t(colors.gray[50], colors.darkGray[900])};
241
+ background-color: ${semantic.color.state.hover};
386
242
  }
387
243
  `,
388
244
  checkboxContainer: css`
389
245
  width: 100%;
246
+ &::selection,
247
+ & *::selection {
248
+ background: ${semantic.color.state.selectionFill};
249
+ color: ${semantic.color.state.selectionText};
250
+ }
390
251
  `,
391
252
  checkboxLabelContainer: css`
392
253
  display: flex;
393
254
  flex-direction: column;
394
- gap: 0.25rem;
255
+ gap: ${semantic.gap.tight};
395
256
  flex: 1;
396
257
  `,
397
258
  checkbox: css`
398
259
  appearance: none;
399
- width: 1.25rem;
400
- height: 1.25rem;
401
- border: 2px solid ${t(colors.gray[300], colors.gray[700])};
402
- border-radius: 0.25rem;
403
- background-color: ${t(colors.gray[50], colors.darkGray[800])};
260
+ width: ${semantic.space[4]};
261
+ height: ${semantic.space[4]};
262
+ border: 2px solid ${semantic.color.border.control};
263
+ border-radius: ${semantic.radius.control};
264
+ background-color: ${semantic.color.surface.elevated};
404
265
  display: grid;
405
266
  place-items: center;
406
267
  transition: all 0.15s ease;
407
268
  flex-shrink: 0;
408
- margin-top: 0.125rem;
269
+ margin-top: ${semantic.space[1]};
409
270
 
410
271
  &:hover {
411
- border-color: ${t(colors.gray[400], colors.gray[600])};
272
+ border-color: ${semantic.color.border.focus};
273
+ }
274
+
275
+ &:focus-visible {
276
+ outline: 2px solid ${semantic.color.border.focus};
277
+ outline-offset: 2px;
412
278
  }
413
279
 
414
280
  &:checked {
415
- background-color: ${t(colors.gray[900], colors.gray[100])};
416
- border-color: ${t(colors.gray[900], colors.gray[100])};
281
+ background-color: ${semantic.color.state.selectionFill};
282
+ border-color: ${semantic.color.state.selectionFill};
417
283
  }
418
284
 
419
285
  &:checked::after {
420
286
  content: '';
421
- width: 0.4rem;
422
- height: 0.6rem;
423
- border: solid ${t("#fff", colors.gray[900])};
287
+ width: ${semantic.space[1]};
288
+ height: ${semantic.space[2]};
289
+ border: solid ${semantic.color.state.selectionText};
424
290
  border-width: 0 2px 2px 0;
425
291
  transform: rotate(45deg);
426
292
  margin-top: -3px;
427
293
  }
428
294
  `,
429
295
  checkboxLabel: css`
430
- color: ${t(colors.gray[900], colors.gray[100])};
431
- font-size: 0.875rem;
432
- font-weight: 500;
433
- line-height: 1.4;
296
+ color: ${semantic.color.text.primary};
297
+ font: ${semantic.type.labelSm.weight} ${semantic.type.labelSm.size} /
298
+ ${semantic.type.labelSm.lineHeight} ${semantic.font.body};
299
+ letter-spacing: ${semantic.type.labelSm.tracking};
434
300
  text-align: left;
435
301
  `,
436
302
  checkboxDescription: css`
437
- color: ${t(colors.gray[500], colors.gray[400])};
438
- font-size: 0.8rem;
439
- line-height: 1.3;
303
+ color: ${semantic.color.text.secondary};
304
+ font: ${semantic.type.bodyXs.weight} ${semantic.type.bodyXs.size} /
305
+ ${semantic.type.bodyXs.lineHeight} ${semantic.font.body};
440
306
  text-align: left;
441
307
  `,
442
308
  button: {
@@ -444,20 +310,29 @@ var stylesFactory = (theme) => {
444
310
  display: inline-flex;
445
311
  align-items: center;
446
312
  justify-content: center;
447
- font-family: ${tokens.font.fontFamily.sans};
448
- font-size: 0.8rem;
449
- font-weight: 500;
450
- border-radius: 0.375rem;
451
- padding: 0.375rem 0.75rem;
313
+ font-family: ${semantic.font.body};
314
+ font-size: ${semantic.type.bodyXs.size};
315
+ line-height: ${semantic.type.bodyXs.lineHeight};
316
+ font-weight: ${semantic.type.labelSm.weight};
317
+ border-radius: ${semantic.radius.control};
318
+ padding: ${semantic.padding.controlBlock}
319
+ ${semantic.padding.controlInline};
452
320
  cursor: pointer;
453
321
  transition:
454
322
  background 0.15s,
455
323
  color 0.15s,
456
324
  border 0.15s,
457
325
  box-shadow 0.15s;
458
- outline: none;
326
+ &:focus-visible {
327
+ outline: 2px solid ${semantic.color.border.focus};
328
+ outline-offset: 2px;
329
+ }
459
330
  border-width: 1px;
460
331
  border-style: solid;
332
+ &:disabled {
333
+ cursor: not-allowed;
334
+ opacity: 0.6;
335
+ }
461
336
  `,
462
337
  variant(variant, outline, ghost) {
463
338
  const v = buttonVariants[variant];
@@ -468,77 +343,94 @@ var stylesFactory = (theme) => {
468
343
  },
469
344
  tag: {
470
345
  dot: (color) => css`
471
- width: ${tokens.size[1.5]};
472
- height: ${tokens.size[1.5]};
473
- border-radius: ${tokens.border.radius.full};
474
- background-color: ${t(tokens.colors[color][500], tokens.colors[color][500])};
346
+ width: ${semantic.space[1]};
347
+ height: ${semantic.space[1]};
348
+ border-radius: 9999px;
349
+ background-color: ${legacyTagColor(color)};
475
350
  `,
476
351
  base: css`
477
352
  display: flex;
478
- gap: ${tokens.size[1.5]};
353
+ gap: ${semantic.gap.tight};
479
354
  box-sizing: border-box;
480
- height: ${tokens.size[6.5]};
481
- background: ${t(colors.gray[50], colors.darkGray[500])};
482
- color: ${t(colors.gray[700], colors.gray[300])};
483
- border-radius: ${tokens.border.radius.sm};
484
- font-size: ${font.size.sm};
485
- padding: ${tokens.size[1]};
486
- padding-left: ${tokens.size[1.5]};
355
+ background: ${semantic.color.surface.subtle};
356
+ color: ${semantic.color.text.primary};
357
+ border-radius: ${semantic.radius.control};
358
+ font-size: ${semantic.type.bodyXs.size};
359
+ line-height: ${semantic.type.bodyXs.lineHeight};
360
+ font-family: ${semantic.font.body};
361
+ padding: ${semantic.padding.controlBlock}
362
+ ${semantic.padding.controlInline};
487
363
  align-items: center;
488
- font-weight: ${font.weight.medium};
489
- border: ${t("1px solid " + colors.gray[300], "1px solid transparent")};
364
+ font-weight: ${semantic.type.labelSm.weight};
365
+ border: 1px solid ${semantic.color.border.control};
490
366
  user-select: none;
491
367
  position: relative;
368
+ &::selection,
369
+ & *::selection {
370
+ background: ${semantic.color.state.selectionFill};
371
+ color: ${semantic.color.state.selectionText};
372
+ }
492
373
  &:focus-visible {
493
374
  outline-offset: 2px;
494
- outline: 2px solid ${t(colors.blue[700], colors.blue[800])};
375
+ outline: 2px solid ${semantic.color.border.focus};
495
376
  }
496
377
  `,
497
378
  label: css`
498
- font-size: ${font.size.xs};
379
+ font-size: ${semantic.type.bodyXs.size};
380
+ line-height: ${semantic.type.bodyXs.lineHeight};
381
+ font-family: ${semantic.font.body};
382
+ letter-spacing: ${semantic.type.labelSm.tracking};
499
383
  `,
500
384
  count: css`
501
- font-size: ${font.size.xs};
502
- padding: 0 5px;
385
+ font-size: ${semantic.type.bodyXs.size};
386
+ padding: 0 ${semantic.space[1]};
503
387
  display: flex;
504
388
  align-items: center;
505
389
  justify-content: center;
506
- color: ${t(colors.gray[500], colors.gray[400])};
507
- background-color: ${t(colors.gray[200], colors.darkGray[300])};
508
- border-radius: 2px;
390
+ color: ${semantic.color.text.secondary};
391
+ background-color: ${semantic.color.state.hover};
392
+ border-radius: ${semantic.radius.control};
393
+ line-height: ${semantic.type.bodyXs.lineHeight};
394
+ font-family: ${semantic.font.body};
509
395
  font-variant-numeric: tabular-nums;
510
- height: ${tokens.size[4.5]};
396
+ min-height: ${semantic.space[4]};
511
397
  `
512
398
  },
513
399
  tree: {
514
400
  info: css`
515
- color: ${t(colors.gray[500], colors.gray[500])};
516
- font-size: ${font.size.xs};
517
- margin-right: ${size[1]};
401
+ color: ${semantic.color.text.secondary};
402
+ font-size: ${semantic.type.bodyXs.size};
403
+ margin-right: ${semantic.space[1]};
518
404
  `,
519
405
  actionButton: css`
520
406
  background-color: transparent;
521
- color: ${t(colors.gray[500], colors.gray[500])};
407
+ color: ${semantic.color.text.secondary};
522
408
  border: none;
523
409
  display: inline-flex;
524
410
  padding: 0;
525
411
  align-items: center;
526
412
  justify-content: center;
527
413
  cursor: pointer;
528
- width: ${size[3]};
529
- height: ${size[3]};
414
+ width: ${semantic.space[3]};
415
+ height: ${semantic.space[3]};
530
416
  position: relative;
531
417
  z-index: 1;
532
418
 
533
419
  &:hover svg {
534
- color: ${t(colors.gray[600], colors.gray[400])};
420
+ color: ${semantic.color.text.primary};
535
421
  }
536
422
 
537
423
  &:focus-visible {
538
- border-radius: ${border.radius.xs};
539
- outline: 2px solid ${t(colors.blue[700], colors.blue[800])};
424
+ border-radius: ${semantic.radius.control};
425
+ outline: 2px solid ${semantic.color.border.focus};
540
426
  outline-offset: 2px;
541
427
  }
428
+ `,
429
+ actionSuccess: css`
430
+ color: ${semantic.color.status.success.text};
431
+ `,
432
+ actionError: css`
433
+ color: ${semantic.color.status.error.text};
542
434
  `,
543
435
  expanderContainer: css`
544
436
  position: relative;
@@ -549,36 +441,41 @@ var stylesFactory = (theme) => {
549
441
  left: -16px;
550
442
  top: 3px;
551
443
  & path {
552
- stroke: ${t(colors.blue[400], colors.blue[300])};
444
+ stroke: ${semantic.color.text.link};
553
445
  }
554
446
  & svg {
555
- width: ${size[3]};
556
- height: ${size[3]};
447
+ width: ${semantic.space[3]};
448
+ height: ${semantic.space[3]};
557
449
  }
558
450
 
559
451
  display: inline-flex;
560
452
  align-items: center;
561
453
  transition: all 0.1s ease;
454
+ &:focus-visible {
455
+ border-radius: ${semantic.radius.control};
456
+ outline: 2px solid ${semantic.color.border.focus};
457
+ outline-offset: 2px;
458
+ }
562
459
  `,
563
460
  expandedLine: (hasBorder) => css`
564
461
  display: block;
565
- padding-left: 0.75rem;
566
- margin-left: -0.7rem;
567
- ${hasBorder ? `border-left: 1px solid ${t(colors.blue[400], colors.blue[300])};` : ""}
462
+ padding-left: ${semantic.space[3]};
463
+ margin-left: -${semantic.space[3]};
464
+ ${hasBorder ? `border-left: 1px solid ${semantic.color.border.decorative};` : ""}
568
465
  `,
569
466
  collapsible: css`
570
467
  cursor: pointer;
571
468
  transition: all 0.2s ease;
572
469
  &:hover {
573
- background-color: ${t(colors.gray[100], colors.darkGray[700])};
574
- border-radius: ${tokens.border.radius.sm};
575
- padding: 0 ${tokens.size[1]};
470
+ background-color: ${semantic.color.state.hover};
471
+ border-radius: ${semantic.radius.control};
472
+ padding: 0 ${semantic.space[1]};
576
473
  }
577
474
  `,
578
475
  actions: css`
579
476
  display: inline-flex;
580
- margin-left: ${size[2]};
581
- gap: ${size[2]};
477
+ margin-left: ${semantic.space[2]};
478
+ gap: ${semantic.gap.control};
582
479
  align-items: center;
583
480
  & svg {
584
481
  height: 12px;
@@ -586,33 +483,43 @@ var stylesFactory = (theme) => {
586
483
  }
587
484
  `,
588
485
  valueCollapsed: css`
589
- color: ${t(colors.gray[500], colors.gray[400])};
486
+ color: ${semantic.color.text.secondary};
590
487
  `,
591
488
  valueFunction: css`
592
- color: ${t(colors.cyan[500], colors.cyan[400])};
489
+ color: ${semantic.color.syntax.keyword};
593
490
  `,
594
491
  valueString: css`
595
- color: ${t(colors.green[500], colors.green[400])};
492
+ color: ${semantic.color.syntax.string};
596
493
  `,
597
494
  valueNumber: css`
598
- color: ${t(colors.yellow[500], colors.yellow[400])};
495
+ color: ${semantic.color.syntax.number};
599
496
  `,
600
497
  valueBoolean: css`
601
- color: ${t(colors.pink[500], colors.pink[400])};
498
+ color: ${semantic.color.syntax.keyword};
602
499
  `,
603
500
  valueNull: css`
604
- color: ${t(colors.gray[500], colors.gray[400])};
501
+ color: ${semantic.color.syntax.comment};
605
502
  font-style: italic;
606
503
  `,
607
504
  valueKey: css`
608
- color: ${t(colors.blue[400], colors.blue[300])};
505
+ color: ${semantic.color.syntax.property};
609
506
  `,
610
507
  valueBraces: css`
611
- color: ${colors.gray[500]};
508
+ color: ${semantic.color.syntax.punctuation};
612
509
  `,
613
510
  valueContainer: (isRoot) => css`
614
511
  display: block;
615
- margin-left: ${isRoot ? "0" : "1rem"};
512
+ font-family: ${semantic.font.mono};
513
+ &::selection,
514
+ & *::selection {
515
+ background: ${semantic.color.state.selectionFill};
516
+ color: ${semantic.color.state.selectionText};
517
+ }
518
+ & [data-tsd-syntax]::selection {
519
+ background: ${semantic.color.syntax.selectionFill};
520
+ color: ${semantic.color.syntax.selectionText};
521
+ }
522
+ margin-left: ${isRoot ? "0" : semantic.space[4]};
616
523
 
617
524
  &:not(:hover) .actions {
618
525
  display: none;
@@ -628,21 +535,28 @@ var stylesFactory = (theme) => {
628
535
  display: flex;
629
536
  justify-content: space-between;
630
537
  align-items: center;
631
- padding: ${tokens.size[2]} ${tokens.size[2.5]};
632
- gap: ${tokens.size[2.5]};
633
- border-bottom: ${t(colors.gray[300], colors.darkGray[500])} 1px solid;
538
+ &::selection,
539
+ & *::selection {
540
+ background: ${semantic.color.state.selectionFill};
541
+ color: ${semantic.color.state.selectionText};
542
+ }
543
+ padding: ${semantic.space[2]} ${semantic.space[3]};
544
+ gap: ${semantic.gap.control};
545
+ background: ${semantic.color.surface.elevated};
546
+ color: ${semantic.color.text.primary};
547
+ border-bottom: ${semantic.color.border.decorative} 1px solid;
634
548
  align-items: center;
635
549
  `,
636
550
  logoAndToggleContainer: css`
637
551
  display: flex;
638
- gap: ${tokens.size[3]};
552
+ gap: ${semantic.gap.section};
639
553
  align-items: center;
640
554
  & > button {
641
555
  padding: 0;
642
556
  background: transparent;
643
557
  border: none;
644
558
  display: flex;
645
- gap: ${size[.5]};
559
+ gap: ${semantic.gap.tight};
646
560
  flex-direction: column;
647
561
  }
648
562
  `,
@@ -652,54 +566,61 @@ var stylesFactory = (theme) => {
652
566
  flex-direction: column;
653
567
  background-color: transparent;
654
568
  border: none;
655
- gap: ${tokens.size[.5]};
569
+ gap: ${semantic.gap.tight};
656
570
  padding: 0;
657
571
  &:hover {
658
572
  opacity: 0.7;
659
573
  }
660
574
  &:focus-visible {
661
- outline-offset: 4px;
662
- border-radius: ${border.radius.xs};
663
- outline: 2px solid ${colors.blue[800]};
575
+ outline-offset: 2px;
576
+ border-radius: ${semantic.radius.control};
577
+ outline: 2px solid ${semantic.color.border.focus};
664
578
  }
665
579
  `,
666
580
  tanstackLogo: css`
667
- font-size: ${font.size.md};
668
- font-weight: ${font.weight.bold};
669
- line-height: ${font.lineHeight.xs};
581
+ font-size: ${semantic.type.headingPane.size};
582
+ line-height: ${semantic.type.headingPane.lineHeight};
583
+ font-family: ${semantic.font.display};
584
+ font-weight: ${semantic.type.headingPane.weight};
670
585
  white-space: nowrap;
671
- color: ${t(colors.gray[700], colors.gray[300])};
586
+ color: ${semantic.color.text.primary};
672
587
  `,
673
588
  flavorLogo: (flavorLight, flavorDark) => css`
674
- font-weight: ${font.weight.semibold};
675
- font-size: ${font.size.xs};
676
- background: linear-gradient(to right, ${t(flavorLight, flavorDark)});
677
- background-clip: text;
678
- -webkit-background-clip: text;
679
- line-height: 1;
680
- -webkit-text-fill-color: transparent;
589
+ font-weight: ${semantic.type.labelSm.weight};
590
+ font-size: ${semantic.type.labelSm.size};
591
+ line-height: ${semantic.type.labelSm.lineHeight};
592
+ font-family: ${semantic.font.body};
593
+ letter-spacing: ${semantic.type.labelSm.tracking};
594
+ color: ${t(flavorLight, flavorDark)};
681
595
  white-space: nowrap;
682
596
  `
683
597
  },
684
598
  section: {
685
599
  main: css`
686
- margin-bottom: 1.5rem;
687
- padding: 1rem;
688
- background-color: ${t(colors.gray[50], colors.darkGray[800])};
689
- border: 1px solid ${t(colors.gray[200], colors.gray[800])};
690
- border-radius: 0.5rem;
691
- box-shadow: none;
600
+ margin-bottom: ${semantic.space[4]};
601
+ padding: ${semantic.space[4]};
602
+ background-color: ${semantic.color.surface.subtle};
603
+ border: 1px solid ${semantic.color.border.decorative};
604
+ border-radius: ${semantic.radius.overlay};
605
+ box-shadow: ${semantic.shadow.xs};
606
+ &::selection,
607
+ & *::selection {
608
+ background: ${semantic.color.state.selectionFill};
609
+ color: ${semantic.color.state.selectionText};
610
+ }
692
611
  `,
693
612
  title: css`
694
- font-size: 1rem;
695
- font-weight: 600;
696
- color: ${t(colors.gray[900], colors.gray[100])};
697
- margin: 0 0 0.75rem 0;
698
- padding-bottom: 0.5rem;
699
- border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])};
613
+ font-size: ${semantic.type.headingPane.size};
614
+ line-height: ${semantic.type.headingPane.lineHeight};
615
+ font-weight: ${semantic.type.headingPane.weight};
616
+ color: ${semantic.color.text.primary};
617
+ font-family: ${semantic.font.display};
618
+ margin: 0 0 ${semantic.space[3]} 0;
619
+ padding-bottom: ${semantic.space[2]};
620
+ border-bottom: 1px solid ${semantic.color.border.decorative};
700
621
  display: flex;
701
622
  align-items: center;
702
- gap: 0.5rem;
623
+ gap: ${semantic.gap.control};
703
624
  text-align: left;
704
625
  `,
705
626
  icon: css`
@@ -709,21 +630,32 @@ var stylesFactory = (theme) => {
709
630
  height: 100%;
710
631
  width: 100%;
711
632
  }
712
- color: ${t(colors.gray[700], colors.gray[400])};
633
+ color: ${semantic.color.text.secondary};
713
634
  `,
714
635
  description: css`
715
- color: ${t(colors.gray[500], colors.gray[400])};
716
- font-size: 0.8rem;
717
- margin: 0 0 1rem 0;
718
- line-height: 1.4;
636
+ color: ${semantic.color.text.secondary};
637
+ font: ${semantic.type.bodyXs.weight} ${semantic.type.bodyXs.size} /
638
+ ${semantic.type.bodyXs.lineHeight} ${semantic.font.body};
639
+ margin: 0 0 ${semantic.space[4]} 0;
719
640
  text-align: left;
720
641
  `
721
642
  },
722
643
  mainPanel: { panel: (withPadding) => css`
723
- padding: ${withPadding ? tokens.size[3] : 0};
724
- background: ${t(colors.gray[50], colors.darkGray[700])};
644
+ /* space[4] keeps the panel's own gutter equal to the workbench gutter,
645
+ so a destination's content lines up with the tab strip above it. */
646
+ padding: ${withPadding ? semantic.space[4] : 0};
647
+ background: ${semantic.color.surface.workspace};
648
+ color: ${semantic.color.text.primary};
725
649
  overflow-y: auto;
650
+ /* Keep a scroll gesture inside the devtools instead of chaining it on
651
+ to the host page once this panel hits its end. */
652
+ overscroll-behavior: contain;
726
653
  height: 100%;
654
+ &::selection,
655
+ & *::selection {
656
+ background: ${semantic.color.state.selectionFill};
657
+ color: ${semantic.color.state.selectionText};
658
+ }
727
659
  ` }
728
660
  };
729
661
  };