@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
@@ -4,6 +4,7 @@ import {
4
4
  createSignal,
5
5
  useContext as getContext,
6
6
  } from 'solid-js'
7
+ import { ensureDevtoolsStyles } from '../styles/semantic-theme'
7
8
  import type { Accessor, JSX } from 'solid-js'
8
9
 
9
10
  export type TanStackDevtoolsTheme = 'light' | 'dark'
@@ -22,9 +23,16 @@ export const ThemeContextProvider = (props: {
22
23
  createEffect(() => {
23
24
  setTheme(props.theme)
24
25
  })
26
+ const [container, setContainer] = createSignal<HTMLSpanElement>()
27
+ createEffect(() => {
28
+ const element = container()
29
+ if (element) ensureDevtoolsStyles(element.ownerDocument)
30
+ })
25
31
  return (
26
32
  <ThemeContext.Provider value={{ theme, setTheme }}>
27
- {props.children}
33
+ <span ref={setContainer} style={{ display: 'contents' }}>
34
+ {props.children}
35
+ </span>
28
36
  </ThemeContext.Provider>
29
37
  )
30
38
  }
@@ -7,6 +7,7 @@ import { createStyles, css } from '../styles/use-styles'
7
7
 
8
8
  // icons
9
9
  import { CopiedCopier, Copier, ErrorCopier } from './icons'
10
+ import { createTheme } from './theme'
10
11
 
11
12
  // utils
12
13
  import type { CollapsiblePaths } from '../utils/deep-keys'
@@ -52,11 +53,14 @@ function JsonValue(props: {
52
53
  const styles = createStyles()
53
54
 
54
55
  return (
55
- <span class={styles().tree.valueContainer(props.isRoot ?? false)}>
56
+ <span
57
+ data-tsd-surface={props.isRoot ? '' : undefined}
58
+ class={styles().tree.valueContainer(props.isRoot ?? false)}
59
+ >
56
60
  {props.keyName &&
57
61
  typeof props.value !== 'object' &&
58
62
  !Array.isArray(props.value) && (
59
- <span class={styles().tree.valueKey}>
63
+ <span data-tsd-syntax="property" class={styles().tree.valueKey}>
60
64
  &quot;{props.keyName}&quot;:{' '}
61
65
  </span>
62
66
  )}
@@ -64,7 +68,7 @@ function JsonValue(props: {
64
68
  {(() => {
65
69
  if (typeof props.value === 'string') {
66
70
  return (
67
- <span class={styles().tree.valueString}>
71
+ <span data-tsd-syntax="string" class={styles().tree.valueString}>
68
72
  &quot;{props.value}&quot;
69
73
  </span>
70
74
  )
@@ -72,29 +76,39 @@ function JsonValue(props: {
72
76
 
73
77
  if (typeof props.value === 'number') {
74
78
  return (
75
- <span class={styles().tree.valueNumber}>{String(props.value)}</span>
79
+ <span data-tsd-syntax="number" class={styles().tree.valueNumber}>
80
+ {String(props.value)}
81
+ </span>
76
82
  )
77
83
  }
78
84
 
79
85
  if (typeof props.value === 'boolean') {
80
86
  return (
81
- <span class={styles().tree.valueBoolean}>
87
+ <span data-tsd-syntax="keyword" class={styles().tree.valueBoolean}>
82
88
  {String(props.value)}
83
89
  </span>
84
90
  )
85
91
  }
86
92
 
87
93
  if (props.value === null) {
88
- return <span class={styles().tree.valueNull}>null</span>
94
+ return (
95
+ <span data-tsd-syntax="keyword" class={styles().tree.valueNull}>
96
+ null
97
+ </span>
98
+ )
89
99
  }
90
100
 
91
101
  if (props.value === undefined) {
92
- return <span class={styles().tree.valueNull}>undefined</span>
102
+ return (
103
+ <span data-tsd-syntax="keyword" class={styles().tree.valueNull}>
104
+ undefined
105
+ </span>
106
+ )
93
107
  }
94
108
 
95
109
  if (typeof props.value === 'function') {
96
110
  return (
97
- <span class={styles().tree.valueFunction}>
111
+ <span data-tsd-syntax="keyword" class={styles().tree.valueFunction}>
98
112
  {String(props.value)}
99
113
  </span>
100
114
  )
@@ -137,7 +151,11 @@ function JsonValue(props: {
137
151
  <CopyButton value={props.value} />
138
152
  </div>
139
153
  )}
140
- {props.isLastKey || props.isRoot ? '' : <span>,</span>}
154
+ {props.isLastKey || props.isRoot ? (
155
+ ''
156
+ ) : (
157
+ <span data-tsd-syntax="punctuation">,</span>
158
+ )}
141
159
  </span>
142
160
  )
143
161
  }
@@ -163,12 +181,17 @@ const ArrayValue = (props: {
163
181
  return (
164
182
  <span class={styles().tree.expanderContainer}>
165
183
  {props.keyName && (
166
- <span class={clsx(styles().tree.valueKey, styles().tree.collapsible)}>
184
+ <span
185
+ data-tsd-syntax="property"
186
+ class={clsx(styles().tree.valueKey, styles().tree.collapsible)}
187
+ >
167
188
  &quot;{props.keyName}&quot;:{' '}
168
189
  </span>
169
190
  )}
170
191
 
171
- <span class={styles().tree.valueBraces}>[]</span>
192
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
193
+ []
194
+ </span>
172
195
  </span>
173
196
  )
174
197
  }
@@ -186,6 +209,7 @@ const ArrayValue = (props: {
186
209
  e.stopImmediatePropagation()
187
210
  setExpanded(!expanded())
188
211
  }}
212
+ data-tsd-syntax="property"
189
213
  class={clsx(styles().tree.valueKey, styles().tree.collapsible)}
190
214
  >
191
215
  &quot;{props.keyName}&quot;:{' '}
@@ -193,10 +217,15 @@ const ArrayValue = (props: {
193
217
  </span>
194
218
  )}
195
219
 
196
- <span class={styles().tree.valueBraces}>[</span>
220
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
221
+ [
222
+ </span>
197
223
 
198
224
  <Show when={expanded()}>
199
- <span class={styles().tree.expandedLine(Boolean(props.keyName))}>
225
+ <span
226
+ data-tsd-separator={props.keyName ? '' : undefined}
227
+ class={styles().tree.expandedLine(Boolean(props.keyName))}
228
+ >
200
229
  <For each={props.value}>
201
230
  {(item, i) => {
202
231
  const isLastKey = i() === props.value.length - 1
@@ -219,6 +248,7 @@ const ArrayValue = (props: {
219
248
 
220
249
  <Show when={!expanded()}>
221
250
  <span
251
+ data-tsd-syntax="comment"
222
252
  onClick={(e) => {
223
253
  e.stopPropagation()
224
254
  e.stopImmediatePropagation()
@@ -229,7 +259,9 @@ const ArrayValue = (props: {
229
259
  {`...`}
230
260
  </span>
231
261
  </Show>
232
- <span class={styles().tree.valueBraces}>]</span>
262
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
263
+ ]
264
+ </span>
233
265
  </span>
234
266
  )
235
267
  }
@@ -258,12 +290,15 @@ const ObjectValue = (props: {
258
290
  return (
259
291
  <span class={styles().tree.expanderContainer}>
260
292
  {props.keyName && (
261
- <span class={clsx(styles().tree.valueKey, styles().tree.collapsible)}>
293
+ <span
294
+ data-tsd-syntax="property"
295
+ class={clsx(styles().tree.valueKey, styles().tree.collapsible)}
296
+ >
262
297
  &quot;{props.keyName}&quot;:{' '}
263
298
  </span>
264
299
  )}
265
300
 
266
- <span class={styles().tree.valueBraces}>
301
+ <span data-tsd-syntax="string" class={styles().tree.valueBraces}>
267
302
  {dayjs(props.value).format(
268
303
  props.config?.dateFormat ? props.config.dateFormat : 'DDMMMYY',
269
304
  )}
@@ -276,12 +311,17 @@ const ObjectValue = (props: {
276
311
  return (
277
312
  <span class={styles().tree.expanderContainer}>
278
313
  {props.keyName && (
279
- <span class={clsx(styles().tree.valueKey, styles().tree.collapsible)}>
314
+ <span
315
+ data-tsd-syntax="property"
316
+ class={clsx(styles().tree.valueKey, styles().tree.collapsible)}
317
+ >
280
318
  &quot;{props.keyName}&quot;:{' '}
281
319
  </span>
282
320
  )}
283
321
 
284
- <span class={styles().tree.valueBraces}>{'{}'}</span>
322
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
323
+ {'{}'}
324
+ </span>
285
325
  </span>
286
326
  )
287
327
  }
@@ -302,6 +342,7 @@ const ObjectValue = (props: {
302
342
  e.stopImmediatePropagation()
303
343
  setExpanded(!expanded())
304
344
  }}
345
+ data-tsd-syntax="property"
305
346
  class={clsx(styles().tree.valueKey, styles().tree.collapsible)}
306
347
  >
307
348
  &quot;{props.keyName}&quot;:{' '}
@@ -309,10 +350,15 @@ const ObjectValue = (props: {
309
350
  </span>
310
351
  )}
311
352
 
312
- <span class={styles().tree.valueBraces}>{'{'}</span>
353
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
354
+ {'{'}
355
+ </span>
313
356
 
314
357
  <Show when={expanded()}>
315
- <span class={styles().tree.expandedLine(Boolean(props.keyName))}>
358
+ <span
359
+ data-tsd-separator={props.keyName ? '' : undefined}
360
+ class={styles().tree.expandedLine(Boolean(props.keyName))}
361
+ >
316
362
  <For each={keys}>
317
363
  {(k) => (
318
364
  <>
@@ -335,6 +381,7 @@ const ObjectValue = (props: {
335
381
 
336
382
  <Show when={!expanded()}>
337
383
  <span
384
+ data-tsd-syntax="comment"
338
385
  onClick={(e) => {
339
386
  e.stopPropagation()
340
387
  e.stopImmediatePropagation()
@@ -346,7 +393,9 @@ const ObjectValue = (props: {
346
393
  </span>
347
394
  </Show>
348
395
 
349
- <span class={styles().tree.valueBraces}>{'}'}</span>
396
+ <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}>
397
+ {'}'}
398
+ </span>
350
399
  </span>
351
400
  )
352
401
  }
@@ -355,10 +404,13 @@ type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy'
355
404
 
356
405
  const CopyButton = (props: { value: unknown }) => {
357
406
  const styles = createStyles()
407
+ const { theme } = createTheme()
358
408
  const [copyState, setCopyState] = createSignal<CopyState>('NoCopy')
359
409
 
360
410
  return (
361
411
  <button
412
+ data-tsd-control
413
+ data-copy-state={copyState()}
362
414
  class={styles().tree.actionButton}
363
415
  title="Copy object to clipboard"
364
416
  aria-label={`${
@@ -397,10 +449,14 @@ const CopyButton = (props: { value: unknown }) => {
397
449
  <Copier />
398
450
  </Match>
399
451
  <Match when={copyState() === 'SuccessCopy'}>
400
- <CopiedCopier theme={'dark'} />
452
+ <span class={styles().tree.actionSuccess}>
453
+ <CopiedCopier theme={theme()} />
454
+ </span>
401
455
  </Match>
402
456
  <Match when={copyState() === 'ErrorCopy'}>
403
- <ErrorCopier />
457
+ <span class={styles().tree.actionError}>
458
+ <ErrorCopier />
459
+ </span>
404
460
  </Match>
405
461
  </Switch>
406
462
  </button>
@@ -411,7 +467,18 @@ const Expander = (props: { expanded: boolean; onClick: () => void }) => {
411
467
  const styles = createStyles()
412
468
  return (
413
469
  <span
470
+ data-tsd-control
471
+ role="button"
472
+ tabIndex={0}
473
+ aria-expanded={props.expanded}
474
+ aria-label={props.expanded ? 'Collapse value' : 'Expand value'}
414
475
  onClick={props.onClick}
476
+ onKeyDown={(event) => {
477
+ if (event.key === 'Enter' || event.key === ' ') {
478
+ event.preventDefault()
479
+ props.onClick()
480
+ }
481
+ }}
415
482
  class={clsx(
416
483
  styles().tree.expander,
417
484
  css`
@@ -0,0 +1,11 @@
1
+ export {
2
+ DEVTOOLS_FONT_STYLE_ID,
3
+ DEVTOOLS_FORCED_COLORS_STYLE_ID,
4
+ devtoolsFontCss,
5
+ forcedColorsCss,
6
+ ensureDevtoolsFonts,
7
+ ensureDevtoolsStyles,
8
+ resolveSemanticTheme,
9
+ semanticThemes,
10
+ } from './styles/semantic-theme'
11
+ export type { SemanticTheme, StatusRole } from './styles/semantic-theme'
@@ -0,0 +1,345 @@
1
+ import bricolageGrotesqueUrl from '../assets/fonts/BricolageGrotesque-Bold.ttf?url&no-inline'
2
+ import interUrl from '../assets/fonts/Inter-latin.woff2?url&no-inline'
3
+ import type { TanStackDevtoolsTheme } from '../components/theme'
4
+
5
+ export const DEVTOOLS_FONT_STYLE_ID = 'tanstack-devtools-fonts'
6
+ export const DEVTOOLS_FORCED_COLORS_STYLE_ID = 'tanstack-devtools-forced-colors'
7
+
8
+ export const forcedColorsCss = `
9
+ @media (forced-colors: active) {
10
+ [data-tsd-surface] { forced-color-adjust: auto; background: Canvas; color: CanvasText; }
11
+ [data-tsd-control] { forced-color-adjust: auto; background: ButtonFace; color: ButtonText; border-color: ButtonText; }
12
+ [data-tsd-selected="true"] { background: Highlight; color: HighlightText; border-color: HighlightText; }
13
+ [data-tsd-separator] { border-color: CanvasText; }
14
+ [data-tsd-separator="resize"] { border: 1px solid CanvasText; }
15
+ [data-tsd-control]:focus-visible { outline: 2px solid ButtonText; outline-offset: 2px; }
16
+ }`
17
+
18
+ export const devtoolsFontCss = `
19
+ @font-face {
20
+ font-family: 'Bricolage Grotesque';
21
+ src: url('${bricolageGrotesqueUrl}') format('truetype');
22
+ font-style: normal;
23
+ font-weight: 700;
24
+ font-display: swap;
25
+ }
26
+ @font-face {
27
+ font-family: 'Inter';
28
+ src: url('${interUrl}') format('woff2');
29
+ font-style: normal;
30
+ font-weight: 100 900;
31
+ font-display: swap;
32
+ }`
33
+
34
+ export function ensureDevtoolsFonts(targetDocument: Document): void {
35
+ if (targetDocument.getElementById(DEVTOOLS_FONT_STYLE_ID)) return
36
+
37
+ const style = targetDocument.createElement('style')
38
+ style.id = DEVTOOLS_FONT_STYLE_ID
39
+ style.textContent = devtoolsFontCss
40
+ targetDocument.head.append(style)
41
+ }
42
+
43
+ export function ensureDevtoolsStyles(targetDocument: Document): void {
44
+ ensureDevtoolsFonts(targetDocument)
45
+ if (targetDocument.getElementById(DEVTOOLS_FORCED_COLORS_STYLE_ID)) return
46
+ const style = targetDocument.createElement('style')
47
+ style.id = DEVTOOLS_FORCED_COLORS_STYLE_ID
48
+ style.textContent = forcedColorsCss
49
+ targetDocument.head.append(style)
50
+ }
51
+
52
+ export type StatusRole = 'success' | 'warning' | 'error' | 'info' | 'neutral'
53
+
54
+ type DeepReadonly<T> = T extends (...args: Array<never>) => unknown
55
+ ? T
56
+ : T extends object
57
+ ? { readonly [Key in keyof T]: DeepReadonly<T[Key]> }
58
+ : T
59
+
60
+ export type SemanticTheme = DeepReadonly<{
61
+ font: {
62
+ display: string
63
+ body: string
64
+ mono: string
65
+ }
66
+ space: { 1: '4px'; 2: '8px'; 3: '12px'; 4: '16px' }
67
+ gap: {
68
+ tight: '4px'
69
+ control: '8px'
70
+ section: '12px'
71
+ sectionLarge: '16px'
72
+ }
73
+ padding: { controlBlock: '6px'; controlInline: '8px' }
74
+ type: {
75
+ bodyXs: { size: '12px'; lineHeight: '17px'; weight: 400 }
76
+ bodySm: { size: '14px'; lineHeight: '20px'; weight: 400 }
77
+ bodyMd: { size: '16px'; lineHeight: '24px'; weight: 300 }
78
+ labelSm: {
79
+ size: '12px'
80
+ lineHeight: '14px'
81
+ weight: 500
82
+ tracking: '0.5px'
83
+ }
84
+ headingCompact: { size: '14px'; lineHeight: '18px'; weight: 700 }
85
+ headingPane: { size: '16px'; lineHeight: '21px'; weight: 700 }
86
+ }
87
+ radius: { control: '4px'; group: '6px'; overlay: '8px' }
88
+ shadow: { xs: string; sm: string; overlay: string }
89
+ motion: { strip: '120ms'; graceMs: 400 }
90
+ color: {
91
+ surface: {
92
+ app: string
93
+ workspace: string
94
+ subtle: string
95
+ elevated: string
96
+ brand: string
97
+ }
98
+ text: {
99
+ primary: string
100
+ secondary: string
101
+ muted: string
102
+ mutedOnBrand: string
103
+ inverse: string
104
+ link: string
105
+ }
106
+ border: { decorative: string; control: string; focus: string }
107
+ state: {
108
+ hover: string
109
+ pressed: string
110
+ selectionFill: string
111
+ selectionText: string
112
+ }
113
+ status: Record<
114
+ StatusRole,
115
+ {
116
+ subtleFill: string
117
+ border: string
118
+ text: string
119
+ solidFill: string
120
+ onFill: string
121
+ }
122
+ >
123
+ syntax: {
124
+ keyword: string
125
+ string: string
126
+ number: string
127
+ comment: string
128
+ property: string
129
+ punctuation: string
130
+ selectionFill: string
131
+ selectionText: string
132
+ }
133
+ }
134
+ }>
135
+
136
+ function deepFreeze<const TValue extends object>(value: TValue) {
137
+ for (const nestedValue of Object.values(value)) {
138
+ if (nestedValue !== null && typeof nestedValue === 'object') {
139
+ deepFreeze(nestedValue)
140
+ }
141
+ }
142
+
143
+ return Object.freeze(value)
144
+ }
145
+
146
+ const commonTheme = {
147
+ font: {
148
+ display: "'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif",
149
+ body: "'Inter', ui-sans-serif, system-ui, sans-serif",
150
+ mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
151
+ },
152
+ space: { 1: '4px', 2: '8px', 3: '12px', 4: '16px' },
153
+ gap: {
154
+ tight: '4px',
155
+ control: '8px',
156
+ section: '12px',
157
+ sectionLarge: '16px',
158
+ },
159
+ padding: { controlBlock: '6px', controlInline: '8px' },
160
+ type: {
161
+ bodyXs: { size: '12px', lineHeight: '17px', weight: 400 },
162
+ bodySm: { size: '14px', lineHeight: '20px', weight: 400 },
163
+ bodyMd: { size: '16px', lineHeight: '24px', weight: 300 },
164
+ labelSm: {
165
+ size: '12px',
166
+ lineHeight: '14px',
167
+ weight: 500,
168
+ tracking: '0.5px',
169
+ },
170
+ headingCompact: {
171
+ size: '14px',
172
+ lineHeight: '18px',
173
+ weight: 700,
174
+ },
175
+ headingPane: { size: '16px', lineHeight: '21px', weight: 700 },
176
+ },
177
+ radius: { control: '4px', group: '6px', overlay: '8px' },
178
+ shadow: {
179
+ xs: '0 1px 2px rgba(0,0,0,0.03)',
180
+ sm: '0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03)',
181
+ overlay: '0 25px 50px -12px rgba(0,0,0,0.20)',
182
+ },
183
+ motion: { strip: '120ms', graceMs: 400 },
184
+ } satisfies Omit<SemanticTheme, 'color'>
185
+
186
+ export const semanticThemes = deepFreeze({
187
+ light: {
188
+ ...commonTheme,
189
+ color: {
190
+ surface: {
191
+ app: '#ffffff',
192
+ workspace: '#ffffff',
193
+ subtle: '#fafafa',
194
+ elevated: '#ffffff',
195
+ brand: '#eeebd4',
196
+ },
197
+ text: {
198
+ primary: '#111111',
199
+ secondary: '#3e3529',
200
+ muted: '#756c5b',
201
+ mutedOnBrand: '#3e3529',
202
+ inverse: '#ffffff',
203
+ link: '#003e53',
204
+ },
205
+ border: {
206
+ decorative: '#eeebd4',
207
+ control: '#756c5b',
208
+ focus: '#003e53',
209
+ },
210
+ state: {
211
+ hover: '#1111110f',
212
+ pressed: '#1111111f',
213
+ selectionFill: '#3e3529',
214
+ selectionText: '#ffffff',
215
+ },
216
+ status: {
217
+ success: {
218
+ subtleFill: '#d8f0da',
219
+ border: '#1d4226',
220
+ text: '#1d4226',
221
+ solidFill: '#1d4226',
222
+ onFill: '#ffffff',
223
+ },
224
+ warning: {
225
+ subtleFill: '#fef6cc',
226
+ border: '#624a00',
227
+ text: '#624a00',
228
+ solidFill: '#624a00',
229
+ onFill: '#ffffff',
230
+ },
231
+ error: {
232
+ subtleFill: '#f9d8c4',
233
+ border: '#5f1a06',
234
+ text: '#5f1a06',
235
+ solidFill: '#5f1a06',
236
+ onFill: '#ffffff',
237
+ },
238
+ info: {
239
+ subtleFill: '#d8f0f3',
240
+ border: '#003e53',
241
+ text: '#003e53',
242
+ solidFill: '#003e53',
243
+ onFill: '#ffffff',
244
+ },
245
+ neutral: {
246
+ subtleFill: '#eeebd4',
247
+ border: '#756c5b',
248
+ text: '#3e3529',
249
+ solidFill: '#3e3529',
250
+ onFill: '#ffffff',
251
+ },
252
+ },
253
+ syntax: {
254
+ keyword: '#5f1a06',
255
+ string: '#1d4226',
256
+ number: '#541f5d',
257
+ comment: '#756c5b',
258
+ property: '#003e53',
259
+ punctuation: '#3e3529',
260
+ selectionFill: '#d8f0f3',
261
+ selectionText: '#003e53',
262
+ },
263
+ },
264
+ },
265
+ dark: {
266
+ ...commonTheme,
267
+ color: {
268
+ surface: {
269
+ app: '#111111',
270
+ workspace: '#1f1f1f',
271
+ subtle: '#1b1b1b',
272
+ elevated: '#2b2b2b',
273
+ brand: '#111111',
274
+ },
275
+ text: {
276
+ primary: '#ffffff',
277
+ secondary: '#aea691',
278
+ muted: '#aea691',
279
+ mutedOnBrand: '#aea691',
280
+ inverse: '#111111',
281
+ link: '#9cd5e2',
282
+ },
283
+ border: { decorative: '#2d2d2d', control: '#aea691', focus: '#61adbf' },
284
+ state: {
285
+ hover: '#ffffff14',
286
+ pressed: '#ffffff1f',
287
+ selectionFill: '#c5c3bf',
288
+ selectionText: '#111111',
289
+ },
290
+ status: {
291
+ success: {
292
+ subtleFill: '#1d4226',
293
+ border: '#69bc75',
294
+ text: '#a2e1a9',
295
+ solidFill: '#69bc75',
296
+ onFill: '#111111',
297
+ },
298
+ warning: {
299
+ subtleFill: '#624a00',
300
+ border: '#f4d648',
301
+ text: '#fae884',
302
+ solidFill: '#f4d648',
303
+ onFill: '#111111',
304
+ },
305
+ error: {
306
+ subtleFill: '#5f1a06',
307
+ border: '#e06e49',
308
+ text: '#edaa8d',
309
+ solidFill: '#e06e49',
310
+ onFill: '#111111',
311
+ },
312
+ info: {
313
+ subtleFill: '#003e53',
314
+ border: '#61adbf',
315
+ text: '#9cd5e2',
316
+ solidFill: '#61adbf',
317
+ onFill: '#111111',
318
+ },
319
+ neutral: {
320
+ subtleFill: '#2b2b2b',
321
+ border: '#aea691',
322
+ text: '#c5c3bf',
323
+ solidFill: '#c5c3bf',
324
+ onFill: '#111111',
325
+ },
326
+ },
327
+ syntax: {
328
+ keyword: '#e06e49',
329
+ string: '#69bc75',
330
+ number: '#c56dcf',
331
+ comment: '#aea691',
332
+ property: '#61adbf',
333
+ punctuation: '#c5c3bf',
334
+ selectionFill: '#003e53',
335
+ selectionText: '#ffffff',
336
+ },
337
+ },
338
+ },
339
+ } as const satisfies Record<TanStackDevtoolsTheme, SemanticTheme>)
340
+
341
+ export function resolveSemanticTheme(
342
+ theme: TanStackDevtoolsTheme,
343
+ ): SemanticTheme {
344
+ return semanticThemes[theme]
345
+ }