@tanstack/query-devtools 5.108.0 → 5.108.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/{DevtoolsComponent-e0KiEsCw.js → DevtoolsComponent-BBTUIw3a.js} +2 -2
  2. package/build/DevtoolsComponent-CqaQIX_J.cjs +45 -0
  3. package/build/DevtoolsComponent-KaCCT4mO.js +3 -0
  4. package/build/DevtoolsComponent-KaCCT4mO.js.map +1 -0
  5. package/build/DevtoolsComponent-NOj66Dgq.cjs +2 -0
  6. package/build/DevtoolsPanelComponent-1en47poS.js +3 -0
  7. package/build/DevtoolsPanelComponent-1en47poS.js.map +1 -0
  8. package/build/DevtoolsPanelComponent-C6-KUZMt.cjs +2 -0
  9. package/build/{DevtoolsPanelComponent-D9e2k2ne.js → DevtoolsPanelComponent-DA61oPj3.js} +2 -2
  10. package/build/DevtoolsPanelComponent-DHv0HzmU.cjs +52 -0
  11. package/build/{DevtoolsSubscriptionsProvider-CtZ2t7t0.js → DevtoolsSubscriptionsProvider-Cl_PUkf2.js} +1636 -2295
  12. package/build/{DevtoolsSubscriptionsProvider-D9zXQvDq.cjs → DevtoolsSubscriptionsProvider-DC-V1gB8.cjs} +2520 -3173
  13. package/build/DevtoolsSubscriptionsProvider-DpHm90Dj.js +10 -0
  14. package/build/DevtoolsSubscriptionsProvider-DpHm90Dj.js.map +1 -0
  15. package/build/DevtoolsSubscriptionsProvider-gZwQB0lN.cjs +9 -0
  16. package/build/dev.cjs +30 -30
  17. package/build/dev.js +11 -11
  18. package/build/index.cjs +1 -1
  19. package/build/index.d.cts +26 -10
  20. package/build/index.d.cts.map +1 -1
  21. package/build/index.d.ts +26 -10
  22. package/build/index.d.ts.map +1 -1
  23. package/build/index.js +1 -1
  24. package/build/index.js.map +1 -1
  25. package/build/{utils-CzP8C7c0.cjs → web-BD1Jlb-z.cjs} +43 -1036
  26. package/build/web-BRnEZuZ3.cjs +2 -0
  27. package/build/{utils-D7iZi04l.js → web-BZdVkndN.js} +42 -939
  28. package/build/web-da-lPyZC.js +3 -0
  29. package/build/web-da-lPyZC.js.map +1 -0
  30. package/package.json +3 -5
  31. package/src/Devtools.tsx +127 -1712
  32. package/src/Explorer.tsx +78 -285
  33. package/src/TanstackQueryDevtools.tsx +19 -10
  34. package/src/TanstackQueryDevtoolsPanel.tsx +19 -10
  35. package/src/contexts/PiPContext.tsx +4 -31
  36. package/src/contexts/types.ts +2 -2
  37. package/src/global.d.ts +1 -0
  38. package/src/styles.css +2158 -0
  39. package/src/styles.ts +49 -0
  40. package/src/utils.tsx +0 -23
  41. package/build/DevtoolsComponent-BGJcHYi5.cjs +0 -2
  42. package/build/DevtoolsComponent-KSaqMRUY.cjs +0 -45
  43. package/build/DevtoolsComponent-u2WBBkWz.js +0 -3
  44. package/build/DevtoolsComponent-u2WBBkWz.js.map +0 -1
  45. package/build/DevtoolsPanelComponent-1kShldEU.cjs +0 -2
  46. package/build/DevtoolsPanelComponent-CpAkTR9C.cjs +0 -52
  47. package/build/DevtoolsPanelComponent-DKq0vg7C.js +0 -3
  48. package/build/DevtoolsPanelComponent-DKq0vg7C.js.map +0 -1
  49. package/build/DevtoolsSubscriptionsProvider-BQAD7Uyk.js +0 -1292
  50. package/build/DevtoolsSubscriptionsProvider-BQAD7Uyk.js.map +0 -1
  51. package/build/DevtoolsSubscriptionsProvider-B_iiu5dm.cjs +0 -1291
  52. package/build/utils-DC2pN79q.js +0 -3
  53. package/build/utils-DC2pN79q.js.map +0 -1
  54. package/build/utils-DJl-N7L2.cjs +0 -2
package/src/Devtools.tsx CHANGED
@@ -1,8 +1,6 @@
1
1
  import { DropdownMenu, RadioGroup } from '@kobalte/core'
2
2
  import { createResizeObserver } from '@solid-primitives/resize-observer'
3
3
  import { rankItem } from '@tanstack/match-sorter-utils'
4
- import { clsx as cx } from 'clsx'
5
- import * as goober from 'goober'
6
4
  import {
7
5
  For,
8
6
  Show,
@@ -59,6 +57,7 @@ import {
59
57
  Wifi,
60
58
  XCircle,
61
59
  } from './icons'
60
+ import { attachStyles, createThemed } from './styles'
62
61
  import { tokens } from './theme'
63
62
  import {
64
63
  convertRemToPixels,
@@ -196,13 +195,6 @@ export type DevtoolsComponentType = Component<QueryDevtoolsProps> & {
196
195
  * @returns The toggle button and the panel.
197
196
  */
198
197
  export const Devtools: Component<DevtoolsPanelProps> = (props) => {
199
- const theme = useTheme()
200
- const css = useQueryDevtoolsContext().shadowDOMTarget
201
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
202
- : goober.css
203
- const styles = createMemo(() => {
204
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
205
- })
206
198
  const pip = usePiPWindow()
207
199
 
208
200
  const buttonPosition = createMemo(() => {
@@ -226,6 +218,13 @@ export const Devtools: Component<DevtoolsPanelProps> = (props) => {
226
218
  })
227
219
 
228
220
  let transitionsContainerRef!: HTMLDivElement
221
+ onMount(() => {
222
+ attachStyles(
223
+ transitionsContainerRef,
224
+ useQueryDevtoolsContext().shadowDOMTarget,
225
+ )
226
+ })
227
+
229
228
  createEffect(() => {
230
229
  const root = transitionsContainerRef.parentElement as HTMLElement
231
230
  const height = props.localStore.height || DEFAULT_HEIGHT
@@ -273,48 +272,7 @@ export const Devtools: Component<DevtoolsPanelProps> = (props) => {
273
272
  </Show>
274
273
  <div
275
274
  // styles for animating the panel in and out
276
- class={cx(
277
- css`
278
- & .tsqd-panel-transition-exit-active,
279
- & .tsqd-panel-transition-enter-active {
280
- transition:
281
- opacity 0.3s,
282
- transform 0.3s;
283
- }
284
-
285
- & .tsqd-panel-transition-exit-to,
286
- & .tsqd-panel-transition-enter {
287
- ${
288
- position() === 'top' || position() === 'bottom'
289
- ? `transform: translateY(var(--tsqd-panel-height));`
290
- : `transform: translateX(var(--tsqd-panel-width));`
291
- }
292
- }
293
-
294
- & .tsqd-button-transition-exit-active,
295
- & .tsqd-button-transition-enter-active {
296
- transition:
297
- opacity 0.3s,
298
- transform 0.3s;
299
- opacity: 1;
300
- }
301
-
302
- & .tsqd-button-transition-exit-to,
303
- & .tsqd-button-transition-enter {
304
- transform: ${
305
- buttonPosition() === 'relative'
306
- ? `none;`
307
- : buttonPosition() === 'top-left'
308
- ? `translateX(-72px);`
309
- : buttonPosition() === 'top-right'
310
- ? `translateX(72px);`
311
- : `translateY(72px);`
312
- };
313
- opacity: 0;
314
- }
315
- `,
316
- 'tsqd-transitions-container',
317
- )}
275
+ class={`tsqd-style-transitions tsqd-style-transitions-${position() === 'top' || position() === 'bottom' ? 'vertical' : 'horizontal'} tsqd-style-transitions-button-${buttonPosition()} tsqd-transitions-container`}
318
276
  dir="ltr"
319
277
  ref={transitionsContainerRef}
320
278
  >
@@ -329,11 +287,7 @@ export const Devtools: Component<DevtoolsPanelProps> = (props) => {
329
287
  <TransitionGroup name="tsqd-button-transition">
330
288
  <Show when={!isOpen()}>
331
289
  <div
332
- class={cx(
333
- styles().devtoolsBtn,
334
- styles()[`devtoolsBtn-position-${buttonPosition()}`],
335
- 'tsqd-open-btn-container',
336
- )}
290
+ class={`tsqd-style-devtools-btn tsqd-style-devtools-btn-position-${buttonPosition()} tsqd-open-btn-container`}
337
291
  >
338
292
  <div aria-hidden="true">
339
293
  <TanstackLogo />
@@ -361,28 +315,12 @@ const PiPPanel: Component<{
361
315
 
362
316
  const pip = usePiPWindow()
363
317
  const theme = useTheme()
364
- const css = useQueryDevtoolsContext().shadowDOMTarget
365
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
366
- : goober.css
367
- const styles = createMemo(() => {
368
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
369
- })
318
+ const themed = createThemed(theme)
370
319
 
371
- const getPanelDynamicStyles = () => {
372
- const { colors } = tokens
373
- const t = (light: string, dark: string) =>
374
- theme() === 'dark' ? dark : light
375
- if (panelWidth() < secondBreakpoint) {
376
- return css`
377
- flex-direction: column;
378
- background-color: ${t(colors.gray[300], colors.gray[600])};
379
- `
380
- }
381
- return css`
382
- flex-direction: row;
383
- background-color: ${t(colors.gray[200], colors.darkGray[900])};
384
- `
385
- }
320
+ let panelRef!: HTMLDivElement
321
+ onMount(() => {
322
+ attachStyles(panelRef)
323
+ })
386
324
 
387
325
  createEffect(() => {
388
326
  const win = pip().pipWindow
@@ -404,6 +342,7 @@ const PiPPanel: Component<{
404
342
 
405
343
  return (
406
344
  <div
345
+ ref={panelRef}
407
346
  dir="ltr"
408
347
  style={{
409
348
  '--tsqd-font-size': '16px',
@@ -411,16 +350,7 @@ const PiPPanel: Component<{
411
350
  height: '100vh',
412
351
  width: '100vw',
413
352
  }}
414
- class={cx(
415
- styles().panel,
416
- getPanelDynamicStyles(),
417
- {
418
- [css`
419
- min-width: min-content;
420
- `]: panelWidth() < thirdBreakpoint,
421
- },
422
- 'tsqd-main-panel',
423
- )}
353
+ class={`${themed('tsqd-style-panel')} ${themed(panelWidth() < secondBreakpoint ? 'tsqd-style-panel-column' : 'tsqd-style-panel-row')} ${panelWidth() < thirdBreakpoint ? 'tsqd-style-panel-min-content' : ''} tsqd-main-panel`}
424
354
  >
425
355
  {props.children}
426
356
  </div>
@@ -439,16 +369,12 @@ export const ParentPanel: Component<{
439
369
  const { panelWidth, setPanelWidth } = useDevtoolsState()
440
370
 
441
371
  const theme = useTheme()
442
- const css = useQueryDevtoolsContext().shadowDOMTarget
443
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
444
- : goober.css
445
- const styles = createMemo(() => {
446
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
447
- })
372
+ const themed = createThemed(theme)
448
373
 
449
374
  let panelRef!: HTMLDivElement
450
375
 
451
376
  onMount(() => {
377
+ attachStyles(panelRef, useQueryDevtoolsContext().shadowDOMTarget)
452
378
  createResizeObserver(panelRef, ({ width }, el) => {
453
379
  if (el === panelRef) {
454
380
  setPanelWidth(width)
@@ -456,22 +382,6 @@ export const ParentPanel: Component<{
456
382
  })
457
383
  })
458
384
 
459
- const getPanelDynamicStyles = () => {
460
- const { colors } = tokens
461
- const t = (light: string, dark: string) =>
462
- theme() === 'dark' ? dark : light
463
- if (panelWidth() < secondBreakpoint) {
464
- return css`
465
- flex-direction: column;
466
- background-color: ${t(colors.gray[300], colors.gray[600])};
467
- `
468
- }
469
- return css`
470
- flex-direction: row;
471
- background-color: ${t(colors.gray[200], colors.darkGray[900])};
472
- `
473
- }
474
-
475
385
  return (
476
386
  <div
477
387
  dir="ltr"
@@ -479,16 +389,7 @@ export const ParentPanel: Component<{
479
389
  '--tsqd-font-size': '16px',
480
390
  }}
481
391
  ref={panelRef}
482
- class={cx(
483
- styles().parentPanel,
484
- getPanelDynamicStyles(),
485
- {
486
- [css`
487
- min-width: min-content;
488
- `]: panelWidth() < thirdBreakpoint,
489
- },
490
- 'tsqd-main-panel',
491
- )}
392
+ class={`${themed('tsqd-style-parent-panel')} ${themed(panelWidth() < secondBreakpoint ? 'tsqd-style-panel-column' : 'tsqd-style-panel-row')} ${panelWidth() < thirdBreakpoint ? 'tsqd-style-panel-min-content' : ''} tsqd-main-panel`}
492
393
  >
493
394
  {props.children}
494
395
  </div>
@@ -499,12 +400,7 @@ const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
499
400
  const { setSelectedQueryHash, panelWidth, setPanelWidth } = useDevtoolsState()
500
401
 
501
402
  const theme = useTheme()
502
- const css = useQueryDevtoolsContext().shadowDOMTarget
503
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
504
- : goober.css
505
- const styles = createMemo(() => {
506
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
507
- })
403
+ const themed = createThemed(theme)
508
404
 
509
405
  let closeBtnRef!: HTMLButtonElement
510
406
 
@@ -628,22 +524,6 @@ const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
628
524
  })
629
525
  })
630
526
 
631
- const getPanelDynamicStyles = () => {
632
- const { colors } = tokens
633
- const t = (light: string, dark: string) =>
634
- theme() === 'dark' ? dark : light
635
- if (panelWidth() < secondBreakpoint) {
636
- return css`
637
- flex-direction: column;
638
- background-color: ${t(colors.gray[300], colors.gray[600])};
639
- `
640
- }
641
- return css`
642
- flex-direction: row;
643
- background-color: ${t(colors.gray[200], colors.darkGray[900])};
644
- `
645
- }
646
-
647
527
  return (
648
528
  <aside
649
529
  // Some context for styles here
@@ -652,19 +532,7 @@ const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
652
532
  // -
653
533
  // min-width - When the panel is in the left or right position, the panel
654
534
  // width is set to min-content to allow the panel to shrink to the lowest possible width
655
- class={cx(
656
- styles().panel,
657
- styles()[`panel-position-${position()}`],
658
- getPanelDynamicStyles(),
659
- {
660
- [css`
661
- min-width: min-content;
662
- `]:
663
- panelWidth() < thirdBreakpoint &&
664
- (position() === 'right' || position() === 'left'),
665
- },
666
- 'tsqd-main-panel',
667
- )}
535
+ class={`${themed('tsqd-style-panel')} ${themed(`tsqd-style-panel-position-${position()}`)} ${themed(panelWidth() < secondBreakpoint ? 'tsqd-style-panel-column' : 'tsqd-style-panel-row')} ${panelWidth() < thirdBreakpoint && (position() === 'right' || position() === 'left') ? 'tsqd-style-panel-min-content' : ''} tsqd-main-panel`}
668
536
  style={{
669
537
  height:
670
538
  position() === 'bottom' || position() === 'top'
@@ -697,11 +565,7 @@ const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
697
565
  : Number(props.localStore.width || DEFAULT_WIDTH)
698
566
  }
699
567
  tabindex="0"
700
- class={cx(
701
- styles().dragHandle,
702
- styles()[`dragHandle-position-${position()}`],
703
- 'tsqd-drag-handle',
704
- )}
568
+ class={`${themed('tsqd-style-drag-handle')} tsqd-style-drag-handle-position-${position()} tsqd-drag-handle`}
705
569
  onMouseDown={handleDragStart}
706
570
  onKeyDown={(e) => {
707
571
  const step = 10
@@ -747,11 +611,7 @@ const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
747
611
  <button
748
612
  ref={closeBtnRef}
749
613
  aria-label="Close tanstack query devtools"
750
- class={cx(
751
- styles().closeBtn,
752
- styles()[`closeBtn-position-${position()}`],
753
- 'tsqd-minimize-btn',
754
- )}
614
+ class={`${themed('tsqd-style-close-btn')} ${themed(`tsqd-style-close-btn-position-${position()}`)} tsqd-minimize-btn`}
755
615
  onClick={() => props.setLocalStore('open', 'false')}
756
616
  >
757
617
  <ChevronDown />
@@ -784,12 +644,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
784
644
  setupMutationCacheSubscription()
785
645
  let containerRef!: HTMLDivElement
786
646
  const theme = useTheme()
787
- const css = useQueryDevtoolsContext().shadowDOMTarget
788
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
789
- : goober.css
790
- const styles = createMemo(() => {
791
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
792
- })
647
+ const themed = createThemed(theme)
793
648
 
794
649
  const pip = usePiPWindow()
795
650
 
@@ -994,9 +849,10 @@ export const ContentView: Component<ContentViewProps> = (props) => {
994
849
  props.setLocalStore('position', pos)
995
850
  }
996
851
 
997
- // Sets the Font Size variable on portal menu elements since they will be outside
998
- // the main panel container
999
- const setComputedVariables = (el: HTMLDivElement) => {
852
+ // Adds the styles and sets the font size variable on portal menu elements,
853
+ // since they are outside the main panel container
854
+ const setupPortal = (el: HTMLDivElement) => {
855
+ attachStyles(el)
1000
856
  const computedStyle = getComputedStyle(containerRef)
1001
857
  const variable = computedStyle.getPropertyValue('--tsqd-font-size')
1002
858
  el.style.setProperty('--tsqd-font-size', variable)
@@ -1006,28 +862,13 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1006
862
  <div
1007
863
  // When the panels are stacked we use the height style
1008
864
  // to divide the panels into two equal parts
1009
- class={cx(
1010
- styles().queriesContainer,
1011
- panelWidth() < secondBreakpoint &&
1012
- (selectedQueryHash() || selectedMutationId()) &&
1013
- css`
1014
- height: 50%;
1015
- max-height: 50%;
1016
- `,
1017
- panelWidth() < secondBreakpoint &&
1018
- !(selectedQueryHash() || selectedMutationId()) &&
1019
- css`
1020
- height: 100%;
1021
- max-height: 100%;
1022
- `,
1023
- 'tsqd-queries-container',
1024
- )}
865
+ class={`${themed('tsqd-style-queries-container')} ${panelWidth() < secondBreakpoint ? (selectedQueryHash() || selectedMutationId() ? 'tsqd-style-queries-container-half' : 'tsqd-style-queries-container-full') : ''} tsqd-queries-container`}
1025
866
  ref={containerRef}
1026
867
  >
1027
- <div class={cx(styles().row, 'tsqd-header')}>
1028
- <div class={styles().logoAndToggleContainer}>
868
+ <div class={`${themed('tsqd-style-row')} tsqd-header`}>
869
+ <div class="tsqd-style-logo-and-toggle-container">
1029
870
  <button
1030
- class={cx(styles().logo, 'tsqd-text-logo-container')}
871
+ class="tsqd-style-logo tsqd-text-logo-container"
1031
872
  onClick={() => {
1032
873
  if (!pip().pipWindow && !props.showPanelViewOnly) {
1033
874
  props.setLocalStore('open', 'false')
@@ -1040,22 +881,19 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1040
881
  aria-label="Close Tanstack query devtools"
1041
882
  >
1042
883
  <span
1043
- class={cx(styles().tanstackLogo, 'tsqd-text-logo-tanstack')}
884
+ class={`${themed('tsqd-style-tanstack-logo')} tsqd-text-logo-tanstack`}
1044
885
  >
1045
886
  TANSTACK
1046
887
  </span>
1047
888
  <span
1048
- class={cx(
1049
- styles().queryFlavorLogo,
1050
- 'tsqd-text-logo-query-flavor',
1051
- )}
889
+ class={`${themed('tsqd-style-query-flavor-logo')} tsqd-text-logo-query-flavor`}
1052
890
  >
1053
891
  {useQueryDevtoolsContext().queryFlavor} v
1054
892
  {useQueryDevtoolsContext().version}
1055
893
  </span>
1056
894
  </button>
1057
895
  <RadioGroup.Root
1058
- class={cx(styles().viewToggle)}
896
+ class={themed('tsqd-style-view-toggle')}
1059
897
  value={selectedView()}
1060
898
  aria-label="Toggle between queries and mutations view"
1061
899
  onChange={(value) => {
@@ -1092,13 +930,14 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1092
930
  <MutationStatusCount />
1093
931
  </Show>
1094
932
  </div>
1095
- <div class={cx(styles().row, 'tsqd-filters-actions-container')}>
1096
- <div class={cx(styles().filtersContainer, 'tsqd-filters-container')}>
933
+ <div
934
+ class={`${themed('tsqd-style-row')} tsqd-filters-actions-container`}
935
+ >
936
+ <div
937
+ class={`${themed('tsqd-style-filters-container')} tsqd-filters-container`}
938
+ >
1097
939
  <div
1098
- class={cx(
1099
- styles().filterInput,
1100
- 'tsqd-query-filter-textfield-container',
1101
- )}
940
+ class={`${themed('tsqd-style-filter-input')} tsqd-query-filter-textfield-container`}
1102
941
  >
1103
942
  <Search />
1104
943
  <input
@@ -1114,7 +953,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1114
953
  props.setLocalStore('mutationFilter', e.currentTarget.value)
1115
954
  }
1116
955
  }}
1117
- class={cx('tsqd-query-filter-textfield')}
956
+ class="tsqd-query-filter-textfield"
1118
957
  name="tsqd-query-filter-input"
1119
958
  value={
1120
959
  selectedView() === 'queries'
@@ -1125,10 +964,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1125
964
  <button
1126
965
  type="button"
1127
966
  onClick={cycleFilterScope}
1128
- class={cx(
1129
- styles().filterScopeBtn,
1130
- 'tsqd-query-filter-scope-btn',
1131
- )}
967
+ class={`${themed('tsqd-style-filter-scope-btn')} tsqd-query-filter-scope-btn`}
1132
968
  aria-label={`Filter scope: ${filterScopeLabels[filterScope()]}`}
1133
969
  title={`${filterScopeAriaLabels[selectedView()][filterScope()]}. Click to switch between key, data, and both.`}
1134
970
  data-scope={filterScope()}
@@ -1137,10 +973,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1137
973
  </button>
1138
974
  </div>
1139
975
  <div
1140
- class={cx(
1141
- styles().filterSelect,
1142
- 'tsqd-query-filter-sort-container',
1143
- )}
976
+ class={`${themed('tsqd-style-filter-select')} tsqd-query-filter-sort-container`}
1144
977
  >
1145
978
  <Show when={selectedView() === 'queries'}>
1146
979
  <select
@@ -1220,7 +1053,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1220
1053
  </button>
1221
1054
  </div>
1222
1055
 
1223
- <div class={cx(styles().actionsContainer, 'tsqd-actions-container')}>
1056
+ <div class="tsqd-style-actions-container tsqd-actions-container">
1224
1057
  <button
1225
1058
  onClick={() => {
1226
1059
  if (selectedView() === 'queries') {
@@ -1231,11 +1064,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1231
1064
  mutation_cache().clear()
1232
1065
  }
1233
1066
  }}
1234
- class={cx(
1235
- styles().actionsBtn,
1236
- 'tsqd-actions-btn',
1237
- 'tsqd-action-clear-cache',
1238
- )}
1067
+ class={`${themed('tsqd-style-actions-btn')} tsqd-actions-btn tsqd-action-clear-cache`}
1239
1068
  aria-label="Clear query cache"
1240
1069
  title={`Clear ${selectedView()} cache`}
1241
1070
  >
@@ -1243,12 +1072,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1243
1072
  </button>
1244
1073
  <button
1245
1074
  onClick={toggleOffline}
1246
- class={cx(
1247
- styles().actionsBtn,
1248
- offline() && styles().actionsBtnOffline,
1249
- 'tsqd-actions-btn',
1250
- 'tsqd-action-mock-offline-behavior',
1251
- )}
1075
+ class={`${themed('tsqd-style-actions-btn')} ${offline() ? themed('tsqd-style-actions-btn-offline') : ''} tsqd-actions-btn tsqd-action-mock-offline-behavior`}
1252
1076
  aria-label={`${
1253
1077
  offline()
1254
1078
  ? 'Unset offline mocking behavior'
@@ -1271,11 +1095,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1271
1095
  Number(props.localStore.height ?? 500),
1272
1096
  )
1273
1097
  }}
1274
- class={cx(
1275
- styles().actionsBtn,
1276
- 'tsqd-actions-btn',
1277
- 'tsqd-action-open-pip',
1278
- )}
1098
+ class={`${themed('tsqd-style-actions-btn')} tsqd-actions-btn tsqd-action-open-pip`}
1279
1099
  aria-label="Open in picture-in-picture mode"
1280
1100
  title="Open in picture-in-picture mode"
1281
1101
  >
@@ -1285,18 +1105,14 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1285
1105
 
1286
1106
  <DropdownMenu.Root gutter={4}>
1287
1107
  <DropdownMenu.Trigger
1288
- class={cx(
1289
- styles().actionsBtn,
1290
- 'tsqd-actions-btn',
1291
- 'tsqd-action-settings',
1292
- )}
1108
+ class={`${themed('tsqd-style-actions-btn')} tsqd-actions-btn tsqd-action-settings`}
1293
1109
  aria-label="Open settings menu"
1294
1110
  title="Open settings menu"
1295
1111
  >
1296
1112
  <Settings />
1297
1113
  </DropdownMenu.Trigger>
1298
1114
  <DropdownMenu.Portal
1299
- ref={(el) => setComputedVariables(el as HTMLDivElement)}
1115
+ ref={(el) => setupPortal(el as HTMLDivElement)}
1300
1116
  mount={
1301
1117
  pip().pipWindow
1302
1118
  ? pip().pipWindow!.document.body
@@ -1305,30 +1121,23 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1305
1121
  >
1306
1122
  <DropdownMenu.Content
1307
1123
  dir="ltr"
1308
- class={cx(styles().settingsMenu, 'tsqd-settings-menu')}
1124
+ class={`${themed('tsqd-style-settings-menu')} tsqd-settings-menu`}
1309
1125
  >
1310
1126
  <div
1311
- class={cx(
1312
- styles().settingsMenuHeader,
1313
- 'tsqd-settings-menu-header',
1314
- )}
1127
+ class={`${themed('tsqd-style-settings-menu-header')} tsqd-settings-menu-header`}
1315
1128
  >
1316
1129
  Settings
1317
1130
  </div>
1318
1131
  <Show when={!props.showPanelViewOnly}>
1319
1132
  <DropdownMenu.Sub overlap gutter={8} shift={-4}>
1320
1133
  <DropdownMenu.SubTrigger
1321
- class={cx(
1322
- styles().settingsSubTrigger,
1323
- 'tsqd-settings-menu-sub-trigger',
1324
- 'tsqd-settings-menu-sub-trigger-position',
1325
- )}
1134
+ class={`${themed('tsqd-style-settings-sub-trigger')} tsqd-settings-menu-sub-trigger tsqd-settings-menu-sub-trigger-position`}
1326
1135
  >
1327
1136
  <span>Position</span>
1328
1137
  <ChevronDown />
1329
1138
  </DropdownMenu.SubTrigger>
1330
1139
  <DropdownMenu.Portal
1331
- ref={(el) => setComputedVariables(el as HTMLDivElement)}
1140
+ ref={(el) => setupPortal(el as HTMLDivElement)}
1332
1141
  mount={
1333
1142
  pip().pipWindow
1334
1143
  ? pip().pipWindow!.document.body
@@ -1337,10 +1146,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1337
1146
  >
1338
1147
  <DropdownMenu.SubContent
1339
1148
  dir="ltr"
1340
- class={cx(
1341
- styles().settingsMenu,
1342
- 'tsqd-settings-submenu',
1343
- )}
1149
+ class={`${themed('tsqd-style-settings-menu')} tsqd-settings-submenu`}
1344
1150
  >
1345
1151
  <DropdownMenu.RadioGroup
1346
1152
  aria-label="Position settings"
@@ -1351,44 +1157,28 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1351
1157
  >
1352
1158
  <DropdownMenu.RadioItem
1353
1159
  value="top"
1354
- class={cx(
1355
- styles().settingsSubButton,
1356
- 'tsqd-settings-menu-position-btn',
1357
- 'tsqd-settings-menu-position-btn-top',
1358
- )}
1160
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-top`}
1359
1161
  >
1360
1162
  <span>Top</span>
1361
1163
  <ArrowUp />
1362
1164
  </DropdownMenu.RadioItem>
1363
1165
  <DropdownMenu.RadioItem
1364
1166
  value="bottom"
1365
- class={cx(
1366
- styles().settingsSubButton,
1367
- 'tsqd-settings-menu-position-btn',
1368
- 'tsqd-settings-menu-position-btn-bottom',
1369
- )}
1167
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-bottom`}
1370
1168
  >
1371
1169
  <span>Bottom</span>
1372
1170
  <ArrowDown />
1373
1171
  </DropdownMenu.RadioItem>
1374
1172
  <DropdownMenu.RadioItem
1375
1173
  value="left"
1376
- class={cx(
1377
- styles().settingsSubButton,
1378
- 'tsqd-settings-menu-position-btn',
1379
- 'tsqd-settings-menu-position-btn-left',
1380
- )}
1174
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-left`}
1381
1175
  >
1382
1176
  <span>Left</span>
1383
1177
  <ArrowLeft />
1384
1178
  </DropdownMenu.RadioItem>
1385
1179
  <DropdownMenu.RadioItem
1386
1180
  value="right"
1387
- class={cx(
1388
- styles().settingsSubButton,
1389
- 'tsqd-settings-menu-position-btn',
1390
- 'tsqd-settings-menu-position-btn-right',
1391
- )}
1181
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-right`}
1392
1182
  >
1393
1183
  <span>Right</span>
1394
1184
  <ArrowRight />
@@ -1400,17 +1190,13 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1400
1190
  </Show>
1401
1191
  <DropdownMenu.Sub overlap gutter={8} shift={-4}>
1402
1192
  <DropdownMenu.SubTrigger
1403
- class={cx(
1404
- styles().settingsSubTrigger,
1405
- 'tsqd-settings-menu-sub-trigger',
1406
- 'tsqd-settings-menu-sub-trigger-theme',
1407
- )}
1193
+ class={`${themed('tsqd-style-settings-sub-trigger')} tsqd-settings-menu-sub-trigger tsqd-settings-menu-sub-trigger-theme`}
1408
1194
  >
1409
1195
  <span>Theme</span>
1410
1196
  <ChevronDown />
1411
1197
  </DropdownMenu.SubTrigger>
1412
1198
  <DropdownMenu.Portal
1413
- ref={(el) => setComputedVariables(el as HTMLDivElement)}
1199
+ ref={(el) => setupPortal(el as HTMLDivElement)}
1414
1200
  mount={
1415
1201
  pip().pipWindow
1416
1202
  ? pip().pipWindow!.document.body
@@ -1419,10 +1205,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1419
1205
  >
1420
1206
  <DropdownMenu.SubContent
1421
1207
  dir="ltr"
1422
- class={cx(
1423
- styles().settingsMenu,
1424
- 'tsqd-settings-submenu',
1425
- )}
1208
+ class={`${themed('tsqd-style-settings-menu')} tsqd-settings-submenu`}
1426
1209
  >
1427
1210
  <DropdownMenu.RadioGroup
1428
1211
  value={props.localStore.theme_preference}
@@ -1433,33 +1216,21 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1433
1216
  >
1434
1217
  <DropdownMenu.RadioItem
1435
1218
  value="light"
1436
- class={cx(
1437
- styles().settingsSubButton,
1438
- 'tsqd-settings-menu-position-btn',
1439
- 'tsqd-settings-menu-position-btn-top',
1440
- )}
1219
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-top`}
1441
1220
  >
1442
1221
  <span>Light</span>
1443
1222
  <Sun />
1444
1223
  </DropdownMenu.RadioItem>
1445
1224
  <DropdownMenu.RadioItem
1446
1225
  value="dark"
1447
- class={cx(
1448
- styles().settingsSubButton,
1449
- 'tsqd-settings-menu-position-btn',
1450
- 'tsqd-settings-menu-position-btn-bottom',
1451
- )}
1226
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-bottom`}
1452
1227
  >
1453
1228
  <span>Dark</span>
1454
1229
  <Moon />
1455
1230
  </DropdownMenu.RadioItem>
1456
1231
  <DropdownMenu.RadioItem
1457
1232
  value="system"
1458
- class={cx(
1459
- styles().settingsSubButton,
1460
- 'tsqd-settings-menu-position-btn',
1461
- 'tsqd-settings-menu-position-btn-left',
1462
- )}
1233
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-left`}
1463
1234
  >
1464
1235
  <span>System</span>
1465
1236
  <Monitor />
@@ -1470,17 +1241,13 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1470
1241
  </DropdownMenu.Sub>
1471
1242
  <DropdownMenu.Sub overlap gutter={8} shift={-4}>
1472
1243
  <DropdownMenu.SubTrigger
1473
- class={cx(
1474
- styles().settingsSubTrigger,
1475
- 'tsqd-settings-menu-sub-trigger',
1476
- 'tsqd-settings-menu-sub-trigger-disabled-queries',
1477
- )}
1244
+ class={`${themed('tsqd-style-settings-sub-trigger')} tsqd-settings-menu-sub-trigger tsqd-settings-menu-sub-trigger-disabled-queries`}
1478
1245
  >
1479
1246
  <span>Disabled Queries</span>
1480
1247
  <ChevronDown />
1481
1248
  </DropdownMenu.SubTrigger>
1482
1249
  <DropdownMenu.Portal
1483
- ref={(el) => setComputedVariables(el as HTMLDivElement)}
1250
+ ref={(el) => setupPortal(el as HTMLDivElement)}
1484
1251
  mount={
1485
1252
  pip().pipWindow
1486
1253
  ? pip().pipWindow!.document.body
@@ -1489,10 +1256,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1489
1256
  >
1490
1257
  <DropdownMenu.SubContent
1491
1258
  dir="ltr"
1492
- class={cx(
1493
- styles().settingsMenu,
1494
- 'tsqd-settings-submenu',
1495
- )}
1259
+ class={`${themed('tsqd-style-settings-menu')} tsqd-settings-submenu`}
1496
1260
  >
1497
1261
  <DropdownMenu.RadioGroup
1498
1262
  value={hideDisabledQueries() ? 'true' : 'false'}
@@ -1503,11 +1267,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1503
1267
  >
1504
1268
  <DropdownMenu.RadioItem
1505
1269
  value="false"
1506
- class={cx(
1507
- styles().settingsSubButton,
1508
- 'tsqd-settings-menu-position-btn',
1509
- 'tsqd-settings-menu-position-btn-show',
1510
- )}
1270
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-show`}
1511
1271
  >
1512
1272
  <span>Show</span>
1513
1273
  <Show when={!hideDisabledQueries()}>
@@ -1516,11 +1276,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1516
1276
  </DropdownMenu.RadioItem>
1517
1277
  <DropdownMenu.RadioItem
1518
1278
  value="true"
1519
- class={cx(
1520
- styles().settingsSubButton,
1521
- 'tsqd-settings-menu-position-btn',
1522
- 'tsqd-settings-menu-position-btn-hide',
1523
- )}
1279
+ class={`${themed('tsqd-style-settings-sub-button')} tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-hide`}
1524
1280
  >
1525
1281
  <span>Hide</span>
1526
1282
  <Show when={hideDisabledQueries()}>
@@ -1542,10 +1298,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1542
1298
  <VirtualList
1543
1299
  each={queries()}
1544
1300
  getKey={(query) => query.queryHash}
1545
- class={cx(
1546
- styles().overflowQueryContainer,
1547
- 'tsqd-queries-overflow-container',
1548
- )}
1301
+ class="tsqd-style-overflow-query-container tsqd-queries-overflow-container"
1549
1302
  contentClass="tsqd-queries-container"
1550
1303
  >
1551
1304
  {(query) => <QueryRow query={query()} />}
@@ -1559,10 +1312,7 @@ export const ContentView: Component<ContentViewProps> = (props) => {
1559
1312
  <VirtualList
1560
1313
  each={mutations()}
1561
1314
  getKey={(mutation) => mutation.mutationId}
1562
- class={cx(
1563
- styles().overflowQueryContainer,
1564
- 'tsqd-mutations-overflow-container',
1565
- )}
1315
+ class="tsqd-style-overflow-query-container tsqd-mutations-overflow-container"
1566
1316
  contentClass="tsqd-mutations-container"
1567
1317
  >
1568
1318
  {(mutation) => <MutationRow mutation={mutation()} />}
@@ -1596,15 +1346,7 @@ const QueryRow: Component<{ query: Query }> = (props) => {
1596
1346
  const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState()
1597
1347
 
1598
1348
  const theme = useTheme()
1599
- const css = useQueryDevtoolsContext().shadowDOMTarget
1600
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1601
- : goober.css
1602
- const styles = createMemo(() => {
1603
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1604
- })
1605
-
1606
- const { colors, alpha } = tokens
1607
- const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
1349
+ const themed = createThemed(theme)
1608
1350
 
1609
1351
  const queryState = createSubscribeToQueryCacheBatcher(
1610
1352
  (queryCache) => queryCache().get(props.query.queryHash)?.state,
@@ -1647,23 +1389,6 @@ const QueryRow: Component<{ query: Query }> = (props) => {
1647
1389
  }),
1648
1390
  )
1649
1391
 
1650
- const getObserverCountColorStyles = () => {
1651
- if (color() === 'gray') {
1652
- return css`
1653
- background-color: ${t(colors[color()][200], colors[color()][700])};
1654
- color: ${t(colors[color()][700], colors[color()][300])};
1655
- `
1656
- }
1657
-
1658
- return css`
1659
- background-color: ${t(
1660
- colors[color()][200] + alpha[80],
1661
- colors[color()][900],
1662
- )};
1663
- color: ${t(colors[color()][800], colors[color()][300])};
1664
- `
1665
- }
1666
-
1667
1392
  return (
1668
1393
  <Show when={queryState()}>
1669
1394
  <button
@@ -1674,16 +1399,11 @@ const QueryRow: Component<{ query: Query }> = (props) => {
1674
1399
  : props.query.queryHash,
1675
1400
  )
1676
1401
  }
1677
- class={cx(
1678
- styles().queryRow,
1679
- selectedQueryHash() === props.query.queryHash &&
1680
- styles().selectedQueryRow,
1681
- 'tsqd-query-row',
1682
- )}
1402
+ class={`${themed('tsqd-style-query-row')} ${selectedQueryHash() === props.query.queryHash ? themed('tsqd-style-selected-query-row') : ''} tsqd-query-row`}
1683
1403
  aria-label={`Query key ${props.query.queryHash}${isDisabled() ? ', disabled' : ''}${isStatic() ? ', static' : ''}`}
1684
1404
  >
1685
1405
  <div
1686
- class={cx(getObserverCountColorStyles(), 'tsqd-query-observer-count')}
1406
+ class={`${themed(`tsqd-style-observer-count-${color()}`)} tsqd-query-observer-count`}
1687
1407
  >
1688
1408
  {observers()}
1689
1409
  </div>
@@ -1707,15 +1427,7 @@ const MutationRow: Component<{ mutation: Mutation }> = (props) => {
1707
1427
  const { selectedMutationId, setSelectedMutationId } = useDevtoolsState()
1708
1428
 
1709
1429
  const theme = useTheme()
1710
- const css = useQueryDevtoolsContext().shadowDOMTarget
1711
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1712
- : goober.css
1713
- const styles = createMemo(() => {
1714
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1715
- })
1716
-
1717
- const { colors, alpha } = tokens
1718
- const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
1430
+ const themed = createThemed(theme)
1719
1431
 
1720
1432
  const mutationState = createSubscribeToMutationCacheBatcher(
1721
1433
  () => props.mutation.state,
@@ -1736,23 +1448,6 @@ const MutationRow: Component<{ mutation: Mutation }> = (props) => {
1736
1448
  }),
1737
1449
  )
1738
1450
 
1739
- const getObserverCountColorStyles = () => {
1740
- if (color() === 'gray') {
1741
- return css`
1742
- background-color: ${t(colors[color()][200], colors[color()][700])};
1743
- color: ${t(colors[color()][700], colors[color()][300])};
1744
- `
1745
- }
1746
-
1747
- return css`
1748
- background-color: ${t(
1749
- colors[color()][200] + alpha[80],
1750
- colors[color()][900],
1751
- )};
1752
- color: ${t(colors[color()][800], colors[color()][300])};
1753
- `
1754
- }
1755
-
1756
1451
  return (
1757
1452
  <Show when={mutationState()}>
1758
1453
  <button
@@ -1763,18 +1458,13 @@ const MutationRow: Component<{ mutation: Mutation }> = (props) => {
1763
1458
  : props.mutation.mutationId,
1764
1459
  )
1765
1460
  }}
1766
- class={cx(
1767
- styles().queryRow,
1768
- selectedMutationId() === props.mutation.mutationId &&
1769
- styles().selectedQueryRow,
1770
- 'tsqd-query-row',
1771
- )}
1461
+ class={`${themed('tsqd-style-query-row')} ${selectedMutationId() === props.mutation.mutationId ? themed('tsqd-style-selected-query-row') : ''} tsqd-query-row`}
1772
1462
  aria-label={`Mutation submitted at ${new Date(
1773
1463
  props.mutation.state.submittedAt,
1774
1464
  ).toLocaleString()}`}
1775
1465
  >
1776
1466
  <div
1777
- class={cx(getObserverCountColorStyles(), 'tsqd-query-observer-count')}
1467
+ class={`${themed(`tsqd-style-observer-count-${color()}`)} tsqd-query-observer-count`}
1778
1468
  >
1779
1469
  <Show when={color() === 'purple'}>
1780
1470
  <PauseCircle />
@@ -1809,18 +1499,8 @@ const QueryStatusCount: Component = () => {
1809
1499
  return tally
1810
1500
  })
1811
1501
 
1812
- const theme = useTheme()
1813
- const css = useQueryDevtoolsContext().shadowDOMTarget
1814
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1815
- : goober.css
1816
- const styles = createMemo(() => {
1817
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1818
- })
1819
-
1820
1502
  return (
1821
- <div
1822
- class={cx(styles().queryStatusContainer, 'tsqd-query-status-container')}
1823
- >
1503
+ <div class="tsqd-style-query-status-container tsqd-query-status-container">
1824
1504
  <QueryStatus label="Fresh" color="green" count={counts().fresh} />
1825
1505
  <QueryStatus label="Fetching" color="blue" count={counts().fetching} />
1826
1506
  <QueryStatus label="Paused" color="purple" count={counts().paused} />
@@ -1839,18 +1519,8 @@ const MutationStatusCount: Component = () => {
1839
1519
  return tally
1840
1520
  })
1841
1521
 
1842
- const theme = useTheme()
1843
- const css = useQueryDevtoolsContext().shadowDOMTarget
1844
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1845
- : goober.css
1846
- const styles = createMemo(() => {
1847
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1848
- })
1849
-
1850
1522
  return (
1851
- <div
1852
- class={cx(styles().queryStatusContainer, 'tsqd-query-status-container')}
1853
- >
1523
+ <div class="tsqd-style-query-status-container tsqd-query-status-container">
1854
1524
  <QueryStatus label="Paused" color="purple" count={counts().purple} />
1855
1525
  <QueryStatus label="Pending" color="yellow" count={counts().yellow} />
1856
1526
  <QueryStatus label="Success" color="green" count={counts().green} />
@@ -1863,15 +1533,7 @@ const QueryStatus: Component<QueryStatusProps> = (props) => {
1863
1533
  const { selectedQueryHash, panelWidth } = useDevtoolsState()
1864
1534
 
1865
1535
  const theme = useTheme()
1866
- const css = useQueryDevtoolsContext().shadowDOMTarget
1867
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1868
- : goober.css
1869
- const styles = createMemo(() => {
1870
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1871
- })
1872
-
1873
- const { colors, alpha } = tokens
1874
- const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
1536
+ const themed = createThemed(theme)
1875
1537
 
1876
1538
  let tagRef!: HTMLButtonElement
1877
1539
 
@@ -1903,21 +1565,7 @@ const QueryStatus: Component<QueryStatusProps> = (props) => {
1903
1565
  disabled={showLabel()}
1904
1566
  ref={tagRef}
1905
1567
  aria-label={`${props.label}: ${props.count}`}
1906
- class={cx(
1907
- styles().queryStatusTag,
1908
- !showLabel() &&
1909
- css`
1910
- cursor: pointer;
1911
- &:hover {
1912
- background: ${t(
1913
- colors.gray[200],
1914
- colors.darkGray[400],
1915
- )}${alpha[80]};
1916
- }
1917
- `,
1918
- 'tsqd-query-status-tag',
1919
- `tsqd-query-status-tag-${props.label.toLowerCase()}`,
1920
- )}
1568
+ class={`${themed('tsqd-style-query-status-tag')} ${!showLabel() ? themed('tsqd-style-query-status-tag-clickable') : ''} tsqd-query-status-tag tsqd-query-status-tag-${props.label.toLowerCase()}`}
1921
1569
  {...(mouseOver() || focused()
1922
1570
  ? {
1923
1571
  'aria-describedby': 'tsqd-status-tooltip',
@@ -1928,47 +1576,22 @@ const QueryStatus: Component<QueryStatusProps> = (props) => {
1928
1576
  <div
1929
1577
  role="tooltip"
1930
1578
  id="tsqd-status-tooltip"
1931
- class={cx(styles().statusTooltip, 'tsqd-query-status-tooltip')}
1579
+ class={`${themed('tsqd-style-status-tooltip')} tsqd-query-status-tooltip`}
1932
1580
  >
1933
1581
  {props.label}
1934
1582
  </div>
1935
1583
  </Show>
1936
1584
  <span
1937
1585
  aria-hidden="true"
1938
- class={cx(
1939
- css`
1940
- width: ${tokens.size[1.5]};
1941
- height: ${tokens.size[1.5]};
1942
- border-radius: ${tokens.border.radius.full};
1943
- background-color: ${tokens.colors[props.color][500]};
1944
- `,
1945
- 'tsqd-query-status-tag-dot',
1946
- )}
1586
+ class={`tsqd-style-query-status-dot tsqd-style-query-status-dot-${props.color} tsqd-query-status-tag-dot`}
1947
1587
  />
1948
1588
  <Show when={showLabel()}>
1949
- <span
1950
- class={cx(
1951
- styles().queryStatusTagLabel,
1952
- 'tsqd-query-status-tag-label',
1953
- )}
1954
- >
1589
+ <span class="tsqd-style-query-status-tag-label tsqd-query-status-tag-label">
1955
1590
  {props.label}
1956
1591
  </span>
1957
1592
  </Show>
1958
1593
  <span
1959
- class={cx(
1960
- styles().queryStatusCount,
1961
- props.count > 0 &&
1962
- props.color !== 'gray' &&
1963
- css`
1964
- background-color: ${t(
1965
- colors[props.color][100],
1966
- colors[props.color][900],
1967
- )};
1968
- color: ${t(colors[props.color][700], colors[props.color][300])};
1969
- `,
1970
- 'tsqd-query-status-tag-count',
1971
- )}
1594
+ class={`${themed('tsqd-style-query-status-count')} ${props.count > 0 && props.color !== 'gray' ? themed(`tsqd-style-query-status-count-${props.color}`) : ''} tsqd-query-status-tag-count`}
1972
1595
  >
1973
1596
  {props.count}
1974
1597
  </span>
@@ -1980,15 +1603,7 @@ const QueryDetails = (props: { initialSearch?: string }) => {
1980
1603
  const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState()
1981
1604
 
1982
1605
  const theme = useTheme()
1983
- const css = useQueryDevtoolsContext().shadowDOMTarget
1984
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1985
- : goober.css
1986
- const styles = createMemo(() => {
1987
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1988
- })
1989
-
1990
- const { colors } = tokens
1991
- const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
1606
+ const themed = createThemed(theme)
1992
1607
 
1993
1608
  const queryClient = useQueryDevtoolsContext().client
1994
1609
 
@@ -2104,45 +1719,25 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2104
1719
  }
2105
1720
  })
2106
1721
 
2107
- const getQueryStatusColors = () => {
2108
- if (color() === 'gray') {
2109
- return css`
2110
- background-color: ${t(colors[color()][200], colors[color()][700])};
2111
- color: ${t(colors[color()][700], colors[color()][300])};
2112
- border-color: ${t(colors[color()][400], colors[color()][600])};
2113
- `
2114
- }
2115
- return css`
2116
- background-color: ${t(colors[color()][100], colors[color()][900])};
2117
- color: ${t(colors[color()][700], colors[color()][300])};
2118
- border-color: ${t(colors[color()][400], colors[color()][600])};
2119
- `
2120
- }
2121
-
2122
1722
  return (
2123
1723
  <Show when={activeQuery() && activeQueryState()}>
2124
1724
  <div
2125
- class={cx(styles().detailsContainer, 'tsqd-query-details-container')}
1725
+ class={`${themed('tsqd-style-details-container')} tsqd-query-details-container`}
2126
1726
  >
2127
1727
  <div
2128
1728
  role="heading"
2129
1729
  aria-level="2"
2130
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
1730
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2131
1731
  >
2132
1732
  Query Details
2133
1733
  </div>
2134
- <div
2135
- class={cx(
2136
- styles().detailsBody,
2137
- 'tsqd-query-details-summary-container',
2138
- )}
2139
- >
1734
+ <div class="tsqd-style-details-body tsqd-query-details-summary-container">
2140
1735
  <div class="tsqd-query-details-summary">
2141
1736
  <pre>
2142
1737
  <code>{displayValue(activeQuery()!.queryKey, true)}</code>
2143
1738
  </pre>
2144
1739
  <span
2145
- class={cx(styles().queryDetailsStatus, getQueryStatusColors())}
1740
+ class={`tsqd-style-query-details-status ${themed(`tsqd-style-details-status-${color()}`)}`}
2146
1741
  role="status"
2147
1742
  aria-live="polite"
2148
1743
  >
@@ -2163,43 +1758,26 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2163
1758
  <div
2164
1759
  role="heading"
2165
1760
  aria-level="2"
2166
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
1761
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2167
1762
  >
2168
1763
  Actions
2169
1764
  </div>
2170
1765
  <div
2171
- class={cx(
2172
- styles().actionsBody,
2173
- 'tsqd-query-details-actions-container',
2174
- )}
1766
+ class={`${themed('tsqd-style-actions-body')} tsqd-query-details-actions-container`}
2175
1767
  >
2176
1768
  <button
2177
- class={cx(
2178
- css`
2179
- color: ${t(colors.blue[600], colors.blue[400])};
2180
- `,
2181
- 'tsqd-query-details-actions-btn',
2182
- 'tsqd-query-details-action-refetch',
2183
- )}
1769
+ class={`${themed('tsqd-style-action-blue')} tsqd-query-details-actions-btn tsqd-query-details-action-refetch`}
2184
1770
  onClick={handleRefetch}
2185
1771
  disabled={statusLabel() === 'fetching'}
2186
1772
  >
2187
1773
  <span
2188
1774
  aria-hidden="true"
2189
- class={css`
2190
- background-color: ${t(colors.blue[600], colors.blue[400])};
2191
- `}
1775
+ class={themed('tsqd-style-action-dot-blue')}
2192
1776
  ></span>
2193
1777
  Refetch
2194
1778
  </button>
2195
1779
  <button
2196
- class={cx(
2197
- css`
2198
- color: ${t(colors.yellow[600], colors.yellow[400])};
2199
- `,
2200
- 'tsqd-query-details-actions-btn',
2201
- 'tsqd-query-details-action-invalidate',
2202
- )}
1780
+ class={`${themed('tsqd-style-action-yellow')} tsqd-query-details-actions-btn tsqd-query-details-action-invalidate`}
2203
1781
  onClick={() => {
2204
1782
  sendDevToolsEvent({
2205
1783
  type: 'INVALIDATE',
@@ -2214,20 +1792,12 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2214
1792
  >
2215
1793
  <span
2216
1794
  aria-hidden="true"
2217
- class={css`
2218
- background-color: ${t(colors.yellow[600], colors.yellow[400])};
2219
- `}
1795
+ class={themed('tsqd-style-action-dot-yellow')}
2220
1796
  ></span>
2221
1797
  Invalidate
2222
1798
  </button>
2223
1799
  <button
2224
- class={cx(
2225
- css`
2226
- color: ${t(colors.gray[600], colors.gray[300])};
2227
- `,
2228
- 'tsqd-query-details-actions-btn',
2229
- 'tsqd-query-details-action-reset',
2230
- )}
1800
+ class={`${themed('tsqd-style-action-gray')} tsqd-query-details-actions-btn tsqd-query-details-action-reset`}
2231
1801
  onClick={() => {
2232
1802
  sendDevToolsEvent({
2233
1803
  type: 'RESET',
@@ -2242,20 +1812,12 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2242
1812
  >
2243
1813
  <span
2244
1814
  aria-hidden="true"
2245
- class={css`
2246
- background-color: ${t(colors.gray[600], colors.gray[400])};
2247
- `}
1815
+ class={themed('tsqd-style-action-dot-gray')}
2248
1816
  ></span>
2249
1817
  Reset
2250
1818
  </button>
2251
1819
  <button
2252
- class={cx(
2253
- css`
2254
- color: ${t(colors.pink[500], colors.pink[400])};
2255
- `,
2256
- 'tsqd-query-details-actions-btn',
2257
- 'tsqd-query-details-action-remove',
2258
- )}
1820
+ class={`${themed('tsqd-style-action-pink')} tsqd-query-details-actions-btn tsqd-query-details-action-remove`}
2259
1821
  onClick={() => {
2260
1822
  sendDevToolsEvent({
2261
1823
  type: 'REMOVE',
@@ -2271,20 +1833,12 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2271
1833
  >
2272
1834
  <span
2273
1835
  aria-hidden="true"
2274
- class={css`
2275
- background-color: ${t(colors.pink[500], colors.pink[400])};
2276
- `}
1836
+ class={themed('tsqd-style-action-dot-pink')}
2277
1837
  ></span>
2278
1838
  Remove
2279
1839
  </button>
2280
1840
  <button
2281
- class={cx(
2282
- css`
2283
- color: ${t(colors.cyan[500], colors.cyan[400])};
2284
- `,
2285
- 'tsqd-query-details-actions-btn',
2286
- 'tsqd-query-details-action-loading',
2287
- )}
1841
+ class={`${themed('tsqd-style-action-cyan')} tsqd-query-details-actions-btn tsqd-query-details-action-loading`}
2288
1842
  disabled={restoringLoading()}
2289
1843
  onClick={() => {
2290
1844
  if (activeQuery()?.state.data === undefined) {
@@ -2321,21 +1875,13 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2321
1875
  >
2322
1876
  <span
2323
1877
  aria-hidden="true"
2324
- class={css`
2325
- background-color: ${t(colors.cyan[500], colors.cyan[400])};
2326
- `}
1878
+ class={themed('tsqd-style-action-dot-cyan')}
2327
1879
  ></span>
2328
1880
  {queryStatus() === 'pending' ? 'Restore' : 'Trigger'} Loading
2329
1881
  </button>
2330
1882
  <Show when={errorTypes().length === 0 || queryStatus() === 'error'}>
2331
1883
  <button
2332
- class={cx(
2333
- css`
2334
- color: ${t(colors.red[500], colors.red[400])};
2335
- `,
2336
- 'tsqd-query-details-actions-btn',
2337
- 'tsqd-query-details-action-error',
2338
- )}
1884
+ class={`${themed('tsqd-style-action-red')} tsqd-query-details-actions-btn tsqd-query-details-action-error`}
2339
1885
  onClick={() => {
2340
1886
  if (!activeQuery()!.state.error) {
2341
1887
  triggerError()
@@ -2353,9 +1899,7 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2353
1899
  >
2354
1900
  <span
2355
1901
  aria-hidden="true"
2356
- class={css`
2357
- background-color: ${t(colors.red[500], colors.red[400])};
2358
- `}
1902
+ class={themed('tsqd-style-action-dot-red')}
2359
1903
  ></span>
2360
1904
  {queryStatus() === 'error' ? 'Restore' : 'Trigger'} Error
2361
1905
  </button>
@@ -2364,17 +1908,11 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2364
1908
  when={!(errorTypes().length === 0 || queryStatus() === 'error')}
2365
1909
  >
2366
1910
  <div
2367
- class={cx(
2368
- styles().actionsSelect,
2369
- 'tsqd-query-details-actions-btn',
2370
- 'tsqd-query-details-action-error-multiple',
2371
- )}
1911
+ class={`${themed('tsqd-style-actions-select')} tsqd-query-details-actions-btn tsqd-query-details-action-error-multiple`}
2372
1912
  >
2373
1913
  <span
2374
1914
  aria-hidden="true"
2375
- class={css`
2376
- background-color: ${tokens.colors.red[400]};
2377
- `}
1915
+ class="tsqd-style-action-select-dot"
2378
1916
  ></span>
2379
1917
  Trigger Error
2380
1918
  <select
@@ -2402,7 +1940,7 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2402
1940
  <div
2403
1941
  role="heading"
2404
1942
  aria-level="2"
2405
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
1943
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2406
1944
  >
2407
1945
  Data {dataMode() === 'view' ? 'Explorer' : 'Editor'}
2408
1946
  </div>
@@ -2427,10 +1965,7 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2427
1965
  </Show>
2428
1966
  <Show when={dataMode() === 'edit'}>
2429
1967
  <form
2430
- class={cx(
2431
- styles().devtoolsEditForm,
2432
- 'tsqd-query-details-data-editor',
2433
- )}
1968
+ class={`${themed('tsqd-style-devtools-edit-form')} tsqd-query-details-data-editor`}
2434
1969
  onSubmit={(e) => {
2435
1970
  e.preventDefault()
2436
1971
  const formData = new FormData(e.currentTarget)
@@ -2450,35 +1985,25 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2450
1985
  <textarea
2451
1986
  name="data"
2452
1987
  aria-label="Edit query data as JSON"
2453
- class={styles().devtoolsEditTextarea}
1988
+ class={themed('tsqd-style-devtools-edit-textarea')}
2454
1989
  onFocus={() => setDataEditError(false)}
2455
1990
  data-error={dataEditError()}
2456
1991
  value={JSON.stringify(activeQueryStateData(), null, 2)}
2457
1992
  ></textarea>
2458
- <div class={styles().devtoolsEditFormActions}>
2459
- <span class={styles().devtoolsEditFormError}>
1993
+ <div class="tsqd-style-devtools-edit-form-actions">
1994
+ <span class={themed('tsqd-style-devtools-edit-form-error')}>
2460
1995
  {dataEditError() ? 'Invalid Value' : ''}
2461
1996
  </span>
2462
- <div class={styles().devtoolsEditFormActionContainer}>
1997
+ <div class="tsqd-style-devtools-edit-form-action-container">
2463
1998
  <button
2464
- class={cx(
2465
- styles().devtoolsEditFormAction,
2466
- css`
2467
- color: ${t(colors.gray[600], colors.gray[300])};
2468
- `,
2469
- )}
1999
+ class={`${themed('tsqd-style-devtools-edit-form-action')} ${themed('tsqd-style-action-gray')}`}
2470
2000
  type="button"
2471
2001
  onClick={() => setDataMode('view')}
2472
2002
  >
2473
2003
  Cancel
2474
2004
  </button>
2475
2005
  <button
2476
- class={cx(
2477
- styles().devtoolsEditFormAction,
2478
- css`
2479
- color: ${t(colors.blue[600], colors.blue[400])};
2480
- `,
2481
- )}
2006
+ class={`${themed('tsqd-style-devtools-edit-form-action')} ${themed('tsqd-style-action-blue')}`}
2482
2007
  >
2483
2008
  Save
2484
2009
  </button>
@@ -2489,7 +2014,7 @@ const QueryDetails = (props: { initialSearch?: string }) => {
2489
2014
  <div
2490
2015
  role="heading"
2491
2016
  aria-level="2"
2492
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2017
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2493
2018
  >
2494
2019
  Query Explorer
2495
2020
  </div>
@@ -2514,15 +2039,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2514
2039
  const { selectedMutationId } = useDevtoolsState()
2515
2040
 
2516
2041
  const theme = useTheme()
2517
- const css = useQueryDevtoolsContext().shadowDOMTarget
2518
- ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
2519
- : goober.css
2520
- const styles = createMemo(() => {
2521
- return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
2522
- })
2523
-
2524
- const { colors } = tokens
2525
- const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
2042
+ const themed = createThemed(theme)
2526
2043
 
2527
2044
  const isPaused = createSubscribeToMutationCacheBatcher((mutationCache) => {
2528
2045
  const mutations = mutationCache().getAll()
@@ -2562,39 +2079,19 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2562
2079
  ? props.initialSearch
2563
2080
  : undefined
2564
2081
 
2565
- const getQueryStatusColors = () => {
2566
- if (color() === 'gray') {
2567
- return css`
2568
- background-color: ${t(colors[color()][200], colors[color()][700])};
2569
- color: ${t(colors[color()][700], colors[color()][300])};
2570
- border-color: ${t(colors[color()][400], colors[color()][600])};
2571
- `
2572
- }
2573
- return css`
2574
- background-color: ${t(colors[color()][100], colors[color()][900])};
2575
- color: ${t(colors[color()][700], colors[color()][300])};
2576
- border-color: ${t(colors[color()][400], colors[color()][600])};
2577
- `
2578
- }
2579
-
2580
2082
  return (
2581
2083
  <Show when={activeMutation()}>
2582
2084
  <div
2583
- class={cx(styles().detailsContainer, 'tsqd-query-details-container')}
2085
+ class={`${themed('tsqd-style-details-container')} tsqd-query-details-container`}
2584
2086
  >
2585
2087
  <div
2586
2088
  role="heading"
2587
2089
  aria-level="2"
2588
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2090
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2589
2091
  >
2590
2092
  Mutation Details
2591
2093
  </div>
2592
- <div
2593
- class={cx(
2594
- styles().detailsBody,
2595
- 'tsqd-query-details-summary-container',
2596
- )}
2597
- >
2094
+ <div class="tsqd-style-details-body tsqd-query-details-summary-container">
2598
2095
  <div class="tsqd-query-details-summary">
2599
2096
  <pre>
2600
2097
  <code>
@@ -2607,7 +2104,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2607
2104
  </code>
2608
2105
  </pre>
2609
2106
  <span
2610
- class={cx(styles().queryDetailsStatus, getQueryStatusColors())}
2107
+ class={`tsqd-style-query-details-status ${themed(`tsqd-style-details-status-${color()}`)}`}
2611
2108
  role="status"
2612
2109
  aria-live="polite"
2613
2110
  >
@@ -2627,7 +2124,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2627
2124
  <div
2628
2125
  role="heading"
2629
2126
  aria-level="2"
2630
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2127
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2631
2128
  >
2632
2129
  Variables Details
2633
2130
  </div>
@@ -2648,7 +2145,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2648
2145
  <div
2649
2146
  role="heading"
2650
2147
  aria-level="2"
2651
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2148
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2652
2149
  >
2653
2150
  Context Details
2654
2151
  </div>
@@ -2667,7 +2164,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2667
2164
  <div
2668
2165
  role="heading"
2669
2166
  aria-level="2"
2670
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2167
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2671
2168
  >
2672
2169
  Data Explorer
2673
2170
  </div>
@@ -2688,7 +2185,7 @@ const MutationDetails = (props: { initialSearch?: string }) => {
2688
2185
  <div
2689
2186
  role="heading"
2690
2187
  aria-level="2"
2691
- class={cx(styles().detailsHeader, 'tsqd-query-details-header')}
2188
+ class={`${themed('tsqd-style-details-header')} tsqd-query-details-header`}
2692
2189
  >
2693
2190
  Mutations Explorer
2694
2191
  </div>
@@ -2841,1085 +2338,3 @@ const sendDevToolsEvent = ({
2841
2338
  })
2842
2339
  window.dispatchEvent(event)
2843
2340
  }
2844
-
2845
- const stylesFactory = (
2846
- theme: 'light' | 'dark',
2847
- css: (typeof goober)['css'],
2848
- ) => {
2849
- const { colors, font, size, alpha, shadow, border } = tokens
2850
-
2851
- const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
2852
-
2853
- return {
2854
- devtoolsBtn: css`
2855
- z-index: 100000;
2856
- position: fixed;
2857
- padding: 4px;
2858
- text-align: left;
2859
-
2860
- display: flex;
2861
- align-items: center;
2862
- justify-content: center;
2863
- border-radius: 9999px;
2864
- box-shadow: ${shadow.md()};
2865
- overflow: hidden;
2866
-
2867
- & div {
2868
- position: absolute;
2869
- top: -8px;
2870
- left: -8px;
2871
- right: -8px;
2872
- bottom: -8px;
2873
- border-radius: 9999px;
2874
- -webkit-transform: translateZ(0);
2875
- transform: translateZ(0);
2876
-
2877
- & svg {
2878
- position: absolute;
2879
- width: 100%;
2880
- height: 100%;
2881
- }
2882
- filter: blur(6px) saturate(1.2) contrast(1.1);
2883
- }
2884
-
2885
- &:focus-within {
2886
- outline-offset: 2px;
2887
- outline: 3px solid ${colors.green[600]};
2888
- }
2889
-
2890
- & button {
2891
- position: relative;
2892
- z-index: 1;
2893
- padding: 0;
2894
- border-radius: 9999px;
2895
- background-color: transparent;
2896
- border: none;
2897
- height: 40px;
2898
- display: flex;
2899
- width: 40px;
2900
- overflow: hidden;
2901
- cursor: pointer;
2902
- outline: none;
2903
- & svg {
2904
- position: absolute;
2905
- width: 100%;
2906
- height: 100%;
2907
- }
2908
- }
2909
- `,
2910
- panel: css`
2911
- position: fixed;
2912
- z-index: 9999;
2913
- display: flex;
2914
- gap: ${tokens.size[0.5]};
2915
- & * {
2916
- box-sizing: border-box;
2917
- text-transform: none;
2918
- }
2919
-
2920
- & *::-webkit-scrollbar {
2921
- width: 7px;
2922
- }
2923
-
2924
- & *::-webkit-scrollbar-track {
2925
- background: transparent;
2926
- }
2927
-
2928
- & *::-webkit-scrollbar-thumb {
2929
- background: ${t(colors.gray[300], colors.darkGray[200])};
2930
- }
2931
-
2932
- & *::-webkit-scrollbar-thumb:hover {
2933
- background: ${t(colors.gray[400], colors.darkGray[300])};
2934
- }
2935
- `,
2936
- parentPanel: css`
2937
- z-index: 9999;
2938
- display: flex;
2939
- height: 100%;
2940
- flex: 1 1 500px;
2941
- min-height: 0;
2942
- gap: ${tokens.size[0.5]};
2943
- & * {
2944
- box-sizing: border-box;
2945
- text-transform: none;
2946
- }
2947
-
2948
- & *::-webkit-scrollbar {
2949
- width: 7px;
2950
- }
2951
-
2952
- & *::-webkit-scrollbar-track {
2953
- background: transparent;
2954
- }
2955
-
2956
- & *::-webkit-scrollbar-thumb {
2957
- background: ${t(colors.gray[300], colors.darkGray[200])};
2958
- }
2959
-
2960
- & *::-webkit-scrollbar-thumb:hover {
2961
- background: ${t(colors.gray[400], colors.darkGray[300])};
2962
- }
2963
- `,
2964
- 'devtoolsBtn-position-bottom-right': css`
2965
- bottom: 12px;
2966
- right: 12px;
2967
- `,
2968
- 'devtoolsBtn-position-bottom-left': css`
2969
- bottom: 12px;
2970
- left: 12px;
2971
- `,
2972
- 'devtoolsBtn-position-top-left': css`
2973
- top: 12px;
2974
- left: 12px;
2975
- `,
2976
- 'devtoolsBtn-position-top-right': css`
2977
- top: 12px;
2978
- right: 12px;
2979
- `,
2980
- 'devtoolsBtn-position-relative': css`
2981
- position: relative;
2982
- `,
2983
- 'panel-position-top': css`
2984
- top: 0;
2985
- right: 0;
2986
- left: 0;
2987
- max-height: 90%;
2988
- min-height: ${size[14]};
2989
- border-bottom: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
2990
- `,
2991
- 'panel-position-bottom': css`
2992
- bottom: 0;
2993
- right: 0;
2994
- left: 0;
2995
- max-height: 90%;
2996
- min-height: ${size[14]};
2997
- border-top: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
2998
- `,
2999
- 'panel-position-right': css`
3000
- bottom: 0;
3001
- right: 0;
3002
- top: 0;
3003
- border-left: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3004
- max-width: 90%;
3005
- `,
3006
- 'panel-position-left': css`
3007
- bottom: 0;
3008
- left: 0;
3009
- top: 0;
3010
- border-right: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3011
- max-width: 90%;
3012
- `,
3013
- closeBtn: css`
3014
- position: absolute;
3015
- cursor: pointer;
3016
- z-index: 5;
3017
- display: flex;
3018
- align-items: center;
3019
- justify-content: center;
3020
- outline: none;
3021
- background-color: ${t(colors.gray[50], colors.darkGray[700])};
3022
- &:hover {
3023
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3024
- }
3025
- &:focus-visible {
3026
- outline: 2px solid ${colors.blue[600]};
3027
- }
3028
- & svg {
3029
- color: ${t(colors.gray[600], colors.gray[400])};
3030
- width: ${size[2]};
3031
- height: ${size[2]};
3032
- }
3033
- `,
3034
- 'closeBtn-position-top': css`
3035
- bottom: 0;
3036
- right: ${size[2]};
3037
- transform: translate(0, 100%);
3038
- border-right: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3039
- border-left: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3040
- border-top: none;
3041
- border-bottom: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3042
- border-radius: 0px 0px ${border.radius.sm} ${border.radius.sm};
3043
- padding: ${size[0.5]} ${size[1.5]} ${size[1]} ${size[1.5]};
3044
-
3045
- &::after {
3046
- content: ' ';
3047
- position: absolute;
3048
- bottom: 100%;
3049
- left: -${size[2.5]};
3050
- height: ${size[1.5]};
3051
- width: calc(100% + ${size[5]});
3052
- }
3053
-
3054
- & svg {
3055
- transform: rotate(180deg);
3056
- }
3057
- `,
3058
- 'closeBtn-position-bottom': css`
3059
- top: 0;
3060
- right: ${size[2]};
3061
- transform: translate(0, -100%);
3062
- border-right: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3063
- border-left: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3064
- border-top: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3065
- border-bottom: none;
3066
- border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
3067
- padding: ${size[1]} ${size[1.5]} ${size[0.5]} ${size[1.5]};
3068
-
3069
- &::after {
3070
- content: ' ';
3071
- position: absolute;
3072
- top: 100%;
3073
- left: -${size[2.5]};
3074
- height: ${size[1.5]};
3075
- width: calc(100% + ${size[5]});
3076
- }
3077
- `,
3078
- 'closeBtn-position-right': css`
3079
- bottom: ${size[2]};
3080
- left: 0;
3081
- transform: translate(-100%, 0);
3082
- border-right: none;
3083
- border-left: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3084
- border-top: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3085
- border-bottom: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3086
- border-radius: ${border.radius.sm} 0px 0px ${border.radius.sm};
3087
- padding: ${size[1.5]} ${size[0.5]} ${size[1.5]} ${size[1]};
3088
-
3089
- &::after {
3090
- content: ' ';
3091
- position: absolute;
3092
- left: 100%;
3093
- height: calc(100% + ${size[5]});
3094
- width: ${size[1.5]};
3095
- }
3096
-
3097
- & svg {
3098
- transform: rotate(-90deg);
3099
- }
3100
- `,
3101
- 'closeBtn-position-left': css`
3102
- bottom: ${size[2]};
3103
- right: 0;
3104
- transform: translate(100%, 0);
3105
- border-left: none;
3106
- border-right: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3107
- border-top: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3108
- border-bottom: ${t(colors.gray[400], colors.darkGray[300])} 1px solid;
3109
- border-radius: 0px ${border.radius.sm} ${border.radius.sm} 0px;
3110
- padding: ${size[1.5]} ${size[1]} ${size[1.5]} ${size[0.5]};
3111
-
3112
- &::after {
3113
- content: ' ';
3114
- position: absolute;
3115
- right: 100%;
3116
- height: calc(100% + ${size[5]});
3117
- width: ${size[1.5]};
3118
- }
3119
-
3120
- & svg {
3121
- transform: rotate(90deg);
3122
- }
3123
- `,
3124
- queriesContainer: css`
3125
- flex: 1 1 700px;
3126
- background-color: ${t(colors.gray[50], colors.darkGray[700])};
3127
- display: flex;
3128
- flex-direction: column;
3129
- & * {
3130
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3131
- }
3132
- `,
3133
- dragHandle: css`
3134
- position: absolute;
3135
- transition: background-color 0.125s ease;
3136
- &:hover {
3137
- background-color: ${colors.purple[400]}${t('', alpha[90])};
3138
- }
3139
- &:focus {
3140
- outline: none;
3141
- background-color: ${colors.purple[400]}${t('', alpha[90])};
3142
- }
3143
- &:focus-visible {
3144
- outline: 2px solid ${colors.blue[800]};
3145
- outline-offset: -2px;
3146
- background-color: ${colors.purple[400]}${t('', alpha[90])};
3147
- }
3148
- z-index: 4;
3149
- `,
3150
- 'dragHandle-position-top': css`
3151
- bottom: 0;
3152
- width: 100%;
3153
- height: 3px;
3154
- cursor: ns-resize;
3155
- `,
3156
- 'dragHandle-position-bottom': css`
3157
- top: 0;
3158
- width: 100%;
3159
- height: 3px;
3160
- cursor: ns-resize;
3161
- `,
3162
- 'dragHandle-position-right': css`
3163
- left: 0;
3164
- width: 3px;
3165
- height: 100%;
3166
- cursor: ew-resize;
3167
- `,
3168
- 'dragHandle-position-left': css`
3169
- right: 0;
3170
- width: 3px;
3171
- height: 100%;
3172
- cursor: ew-resize;
3173
- `,
3174
- row: css`
3175
- display: flex;
3176
- justify-content: space-between;
3177
- align-items: center;
3178
- padding: ${tokens.size[2]} ${tokens.size[2.5]};
3179
- gap: ${tokens.size[2.5]};
3180
- border-bottom: ${t(colors.gray[300], colors.darkGray[500])} 1px solid;
3181
- align-items: center;
3182
- & > button {
3183
- padding: 0;
3184
- background: transparent;
3185
- border: none;
3186
- display: flex;
3187
- gap: ${size[0.5]};
3188
- flex-direction: column;
3189
- }
3190
- `,
3191
- logoAndToggleContainer: css`
3192
- display: flex;
3193
- gap: ${tokens.size[3]};
3194
- align-items: center;
3195
- `,
3196
- logo: css`
3197
- cursor: pointer;
3198
- display: flex;
3199
- flex-direction: column;
3200
- background-color: transparent;
3201
- border: none;
3202
- gap: ${tokens.size[0.5]};
3203
- padding: 0px;
3204
- &:hover {
3205
- opacity: 0.7;
3206
- }
3207
- &:focus-visible {
3208
- outline-offset: 4px;
3209
- border-radius: ${border.radius.xs};
3210
- outline: 2px solid ${colors.blue[800]};
3211
- }
3212
- `,
3213
- tanstackLogo: css`
3214
- font-size: ${font.size.md};
3215
- font-weight: ${font.weight.bold};
3216
- line-height: ${font.lineHeight.xs};
3217
- white-space: nowrap;
3218
- color: ${t(colors.gray[600], colors.gray[300])};
3219
- `,
3220
- queryFlavorLogo: css`
3221
- font-weight: ${font.weight.semibold};
3222
- font-size: ${font.size.xs};
3223
- background: linear-gradient(
3224
- to right,
3225
- ${t('#ea4037, #ff9b11', '#dd524b, #e9a03b')}
3226
- );
3227
- background-clip: text;
3228
- -webkit-background-clip: text;
3229
- line-height: 1;
3230
- -webkit-text-fill-color: transparent;
3231
- white-space: nowrap;
3232
- `,
3233
- queryStatusContainer: css`
3234
- display: flex;
3235
- gap: ${tokens.size[2]};
3236
- height: min-content;
3237
- `,
3238
- queryStatusTag: css`
3239
- display: flex;
3240
- gap: ${tokens.size[1.5]};
3241
- box-sizing: border-box;
3242
- height: ${tokens.size[6.5]};
3243
- background: ${t(colors.gray[50], colors.darkGray[500])};
3244
- color: ${t(colors.gray[700], colors.gray[300])};
3245
- border-radius: ${tokens.border.radius.sm};
3246
- font-size: ${font.size.sm};
3247
- padding: ${tokens.size[1]};
3248
- padding-left: ${tokens.size[1.5]};
3249
- align-items: center;
3250
- font-weight: ${font.weight.medium};
3251
- border: ${t('1px solid ' + colors.gray[300], '1px solid transparent')};
3252
- user-select: none;
3253
- position: relative;
3254
- &:focus-visible {
3255
- outline-offset: 2px;
3256
- outline: 2px solid ${colors.blue[800]};
3257
- }
3258
- `,
3259
- queryStatusTagLabel: css`
3260
- font-size: ${font.size.xs};
3261
- `,
3262
- queryStatusCount: css`
3263
- font-size: ${font.size.xs};
3264
- padding: 0 5px;
3265
- display: flex;
3266
- align-items: center;
3267
- justify-content: center;
3268
- color: ${t(colors.gray[500], colors.gray[400])};
3269
- background-color: ${t(colors.gray[200], colors.darkGray[300])};
3270
- border-radius: 2px;
3271
- font-variant-numeric: tabular-nums;
3272
- height: ${tokens.size[4.5]};
3273
- `,
3274
- statusTooltip: css`
3275
- position: absolute;
3276
- z-index: 1;
3277
- background-color: ${t(colors.gray[50], colors.darkGray[500])};
3278
- top: 100%;
3279
- left: 50%;
3280
- transform: translate(-50%, calc(${tokens.size[2]}));
3281
- padding: ${tokens.size[0.5]} ${tokens.size[2]};
3282
- border-radius: ${tokens.border.radius.sm};
3283
- font-size: ${font.size.xs};
3284
- border: 1px solid ${t(colors.gray[400], colors.gray[600])};
3285
- color: ${t(colors['gray'][600], colors['gray'][300])};
3286
-
3287
- &::before {
3288
- top: 0px;
3289
- content: ' ';
3290
- display: block;
3291
- left: 50%;
3292
- transform: translate(-50%, -100%);
3293
- position: absolute;
3294
- border-color: transparent transparent
3295
- ${t(colors.gray[400], colors.gray[600])} transparent;
3296
- border-style: solid;
3297
- border-width: 7px;
3298
- /* transform: rotate(180deg); */
3299
- }
3300
-
3301
- &::after {
3302
- top: 0px;
3303
- content: ' ';
3304
- display: block;
3305
- left: 50%;
3306
- transform: translate(-50%, calc(-100% + 2px));
3307
- position: absolute;
3308
- border-color: transparent transparent
3309
- ${t(colors.gray[100], colors.darkGray[500])} transparent;
3310
- border-style: solid;
3311
- border-width: 7px;
3312
- }
3313
- `,
3314
- filtersContainer: css`
3315
- display: flex;
3316
- gap: ${tokens.size[2]};
3317
- & > button {
3318
- cursor: pointer;
3319
- padding: ${tokens.size[0.5]} ${tokens.size[1.5]} ${tokens.size[0.5]}
3320
- ${tokens.size[2]};
3321
- border-radius: ${tokens.border.radius.sm};
3322
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3323
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3324
- color: ${t(colors.gray[700], colors.gray[300])};
3325
- font-size: ${font.size.xs};
3326
- display: flex;
3327
- align-items: center;
3328
- line-height: ${font.lineHeight.sm};
3329
- gap: ${tokens.size[1.5]};
3330
- max-width: 160px;
3331
- &:focus-visible {
3332
- outline-offset: 2px;
3333
- border-radius: ${border.radius.xs};
3334
- outline: 2px solid ${colors.blue[800]};
3335
- }
3336
- & svg {
3337
- width: ${tokens.size[3]};
3338
- height: ${tokens.size[3]};
3339
- color: ${t(colors.gray[500], colors.gray[400])};
3340
- }
3341
- }
3342
- `,
3343
- filterInput: css`
3344
- padding: ${size[0.5]} ${size[2]};
3345
- border-radius: ${tokens.border.radius.sm};
3346
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3347
- display: flex;
3348
- box-sizing: content-box;
3349
- align-items: center;
3350
- gap: ${tokens.size[1.5]};
3351
- max-width: 160px;
3352
- min-width: 100px;
3353
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3354
- height: min-content;
3355
- color: ${t(colors.gray[600], colors.gray[400])};
3356
- & > svg {
3357
- width: ${size[3]};
3358
- height: ${size[3]};
3359
- }
3360
- & input {
3361
- font-size: ${font.size.xs};
3362
- width: 100%;
3363
- min-width: 0;
3364
- flex: 1;
3365
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3366
- border: none;
3367
- padding: 0;
3368
- line-height: ${font.lineHeight.sm};
3369
- color: ${t(colors.gray[700], colors.gray[300])};
3370
- &::placeholder {
3371
- color: ${t(colors.gray[700], colors.gray[300])};
3372
- }
3373
- &:focus {
3374
- outline: none;
3375
- }
3376
- }
3377
-
3378
- &:focus-within {
3379
- outline-offset: 2px;
3380
- border-radius: ${border.radius.xs};
3381
- outline: 2px solid ${colors.blue[800]};
3382
- }
3383
- `,
3384
- filterScopeBtn: css`
3385
- flex-shrink: 0;
3386
- cursor: pointer;
3387
- padding: 0 ${size[1]};
3388
- border-radius: ${border.radius.xs};
3389
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3390
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3391
- color: ${t(colors.gray[700], colors.gray[300])};
3392
- font-size: ${font.size.xs};
3393
- line-height: ${font.lineHeight.xs};
3394
- &[data-scope='data'],
3395
- &[data-scope='all'] {
3396
- border-color: ${t(colors.blue[300], colors.blue[700])};
3397
- background-color: ${t(colors.blue[100], colors.blue[900])};
3398
- color: ${t(colors.blue[700], colors.blue[300])};
3399
- }
3400
- &:focus-visible {
3401
- outline-offset: 2px;
3402
- outline: 2px solid ${colors.blue[800]};
3403
- }
3404
- `,
3405
- filterSelect: css`
3406
- padding: ${tokens.size[0.5]} ${tokens.size[2]};
3407
- border-radius: ${tokens.border.radius.sm};
3408
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3409
- display: flex;
3410
- align-items: center;
3411
- gap: ${tokens.size[1.5]};
3412
- box-sizing: content-box;
3413
- max-width: 160px;
3414
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3415
- height: min-content;
3416
- & > svg {
3417
- color: ${t(colors.gray[600], colors.gray[400])};
3418
- width: ${tokens.size[2]};
3419
- height: ${tokens.size[2]};
3420
- }
3421
- & > select {
3422
- appearance: none;
3423
- color: ${t(colors.gray[700], colors.gray[300])};
3424
- min-width: 100px;
3425
- line-height: ${font.lineHeight.sm};
3426
- font-size: ${font.size.xs};
3427
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3428
- border: none;
3429
- &:focus {
3430
- outline: none;
3431
- }
3432
- }
3433
- &:focus-within {
3434
- outline-offset: 2px;
3435
- border-radius: ${border.radius.xs};
3436
- outline: 2px solid ${colors.blue[800]};
3437
- }
3438
- `,
3439
- actionsContainer: css`
3440
- display: flex;
3441
- gap: ${tokens.size[2]};
3442
- `,
3443
- actionsBtn: css`
3444
- border-radius: ${tokens.border.radius.sm};
3445
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3446
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3447
- width: ${tokens.size[6.5]};
3448
- height: ${tokens.size[6.5]};
3449
- justify-content: center;
3450
- display: flex;
3451
- align-items: center;
3452
- gap: ${tokens.size[1.5]};
3453
- max-width: 160px;
3454
- cursor: pointer;
3455
- padding: 0;
3456
- &:hover {
3457
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3458
- }
3459
- & svg {
3460
- color: ${t(colors.gray[700], colors.gray[300])};
3461
- width: ${tokens.size[3]};
3462
- height: ${tokens.size[3]};
3463
- }
3464
- &:focus-visible {
3465
- outline-offset: 2px;
3466
- border-radius: ${border.radius.xs};
3467
- outline: 2px solid ${colors.blue[800]};
3468
- }
3469
- `,
3470
- actionsBtnOffline: css`
3471
- & svg {
3472
- stroke: ${t(colors.yellow[700], colors.yellow[500])};
3473
- fill: ${t(colors.yellow[700], colors.yellow[500])};
3474
- }
3475
- `,
3476
- overflowQueryContainer: css`
3477
- flex: 1;
3478
- min-height: 0;
3479
- overflow-y: auto;
3480
- & > div {
3481
- display: flex;
3482
- flex-direction: column;
3483
- }
3484
- `,
3485
- queryRow: css`
3486
- display: flex;
3487
- width: 100%;
3488
- align-items: center;
3489
- padding: 0;
3490
- border: none;
3491
- cursor: pointer;
3492
- color: ${t(colors.gray[700], colors.gray[300])};
3493
- background-color: ${t(colors.gray[50], colors.darkGray[700])};
3494
- line-height: 1;
3495
- &:focus {
3496
- outline: none;
3497
- }
3498
- &:focus-visible {
3499
- outline-offset: -2px;
3500
- border-radius: ${border.radius.xs};
3501
- outline: 2px solid ${colors.blue[800]};
3502
- }
3503
- &:hover .tsqd-query-hash {
3504
- background-color: ${t(colors.gray[200], colors.darkGray[600])};
3505
- }
3506
-
3507
- & .tsqd-query-observer-count {
3508
- padding: 0 ${tokens.size[1]};
3509
- user-select: none;
3510
- min-width: ${tokens.size[6.5]};
3511
- align-self: stretch;
3512
- display: flex;
3513
- align-items: center;
3514
- justify-content: center;
3515
- font-size: ${font.size.xs};
3516
- font-weight: ${font.weight.medium};
3517
- border-bottom-width: 1px;
3518
- border-bottom-style: solid;
3519
- border-bottom: 1px solid ${t(colors.gray[300], colors.darkGray[700])};
3520
- }
3521
- & .tsqd-query-hash {
3522
- user-select: text;
3523
- font-size: ${font.size.xs};
3524
- display: flex;
3525
- align-items: center;
3526
- min-height: ${tokens.size[6]};
3527
- flex: 1;
3528
- padding: ${tokens.size[1]} ${tokens.size[2]};
3529
- font-family:
3530
- ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
3531
- 'Liberation Mono', 'Courier New', monospace;
3532
- border-bottom: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3533
- text-align: left;
3534
- text-overflow: clip;
3535
- word-break: break-word;
3536
- }
3537
-
3538
- & .tsqd-query-disabled-indicator {
3539
- align-self: stretch;
3540
- display: flex;
3541
- align-items: center;
3542
- padding: 0 ${tokens.size[2]};
3543
- color: ${t(colors.gray[800], colors.gray[300])};
3544
- background-color: ${t(colors.gray[300], colors.darkGray[600])};
3545
- border-bottom: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3546
- font-size: ${font.size.xs};
3547
- }
3548
-
3549
- & .tsqd-query-static-indicator {
3550
- align-self: stretch;
3551
- display: flex;
3552
- align-items: center;
3553
- padding: 0 ${tokens.size[2]};
3554
- color: ${t(colors.teal[800], colors.teal[300])};
3555
- background-color: ${t(colors.teal[100], colors.teal[900])};
3556
- border-bottom: 1px solid ${t(colors.teal[300], colors.teal[700])};
3557
- font-size: ${font.size.xs};
3558
- }
3559
- `,
3560
- selectedQueryRow: css`
3561
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3562
- `,
3563
- detailsContainer: css`
3564
- flex: 1 1 700px;
3565
- background-color: ${t(colors.gray[50], colors.darkGray[700])};
3566
- color: ${t(colors.gray[700], colors.gray[300])};
3567
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3568
- display: flex;
3569
- flex-direction: column;
3570
- overflow-y: auto;
3571
- display: flex;
3572
- text-align: left;
3573
- `,
3574
- detailsHeader: css`
3575
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3576
- position: sticky;
3577
- top: 0;
3578
- z-index: 2;
3579
- background-color: ${t(colors.gray[200], colors.darkGray[600])};
3580
- padding: ${tokens.size[1.5]} ${tokens.size[2]};
3581
- font-weight: ${font.weight.medium};
3582
- font-size: ${font.size.xs};
3583
- line-height: ${font.lineHeight.xs};
3584
- text-align: left;
3585
- `,
3586
- detailsBody: css`
3587
- margin: ${tokens.size[1.5]} 0px ${tokens.size[2]} 0px;
3588
- & > div {
3589
- display: flex;
3590
- align-items: stretch;
3591
- padding: 0 ${tokens.size[2]};
3592
- line-height: ${font.lineHeight.sm};
3593
- justify-content: space-between;
3594
- & > span {
3595
- font-size: ${font.size.xs};
3596
- }
3597
- & > span:nth-child(2) {
3598
- font-variant-numeric: tabular-nums;
3599
- }
3600
- }
3601
-
3602
- & > div:first-child {
3603
- margin-bottom: ${tokens.size[1.5]};
3604
- }
3605
-
3606
- & code {
3607
- font-family:
3608
- ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
3609
- 'Liberation Mono', 'Courier New', monospace;
3610
- margin: 0;
3611
- font-size: ${font.size.xs};
3612
- line-height: ${font.lineHeight.xs};
3613
- max-width: 100%;
3614
- white-space: pre-wrap;
3615
- overflow-wrap: anywhere;
3616
- word-break: break-word;
3617
- }
3618
-
3619
- & pre {
3620
- margin: 0;
3621
- display: flex;
3622
- align-items: center;
3623
- }
3624
- `,
3625
- queryDetailsStatus: css`
3626
- border: 1px solid ${colors.darkGray[200]};
3627
- border-radius: ${tokens.border.radius.sm};
3628
- font-weight: ${font.weight.medium};
3629
- padding: ${tokens.size[1]} ${tokens.size[2.5]};
3630
- `,
3631
- actionsBody: css`
3632
- flex-wrap: wrap;
3633
- margin: ${tokens.size[2]} 0px ${tokens.size[2]} 0px;
3634
- display: flex;
3635
- gap: ${tokens.size[2]};
3636
- padding: 0px ${tokens.size[2]};
3637
- & > button {
3638
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3639
- font-size: ${font.size.xs};
3640
- padding: ${tokens.size[1]} ${tokens.size[2]};
3641
- display: flex;
3642
- border-radius: ${tokens.border.radius.sm};
3643
- background-color: ${t(colors.gray[100], colors.darkGray[600])};
3644
- border: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3645
- align-items: center;
3646
- gap: ${tokens.size[2]};
3647
- font-weight: ${font.weight.medium};
3648
- line-height: ${font.lineHeight.xs};
3649
- cursor: pointer;
3650
- &:focus-visible {
3651
- outline-offset: 2px;
3652
- border-radius: ${border.radius.xs};
3653
- outline: 2px solid ${colors.blue[800]};
3654
- }
3655
- &:hover {
3656
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3657
- }
3658
-
3659
- &:disabled {
3660
- opacity: 0.6;
3661
- cursor: not-allowed;
3662
- }
3663
-
3664
- & > span {
3665
- width: ${size[1.5]};
3666
- height: ${size[1.5]};
3667
- border-radius: ${tokens.border.radius.full};
3668
- }
3669
- }
3670
- `,
3671
- actionsSelect: css`
3672
- font-size: ${font.size.xs};
3673
- padding: ${tokens.size[0.5]} ${tokens.size[2]};
3674
- display: flex;
3675
- border-radius: ${tokens.border.radius.sm};
3676
- overflow: hidden;
3677
- background-color: ${t(colors.gray[100], colors.darkGray[600])};
3678
- border: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3679
- align-items: center;
3680
- gap: ${tokens.size[2]};
3681
- font-weight: ${font.weight.medium};
3682
- line-height: ${font.lineHeight.sm};
3683
- color: ${t(colors.red[500], colors.red[400])};
3684
- cursor: pointer;
3685
- position: relative;
3686
- &:hover {
3687
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3688
- }
3689
- & > span {
3690
- width: ${size[1.5]};
3691
- height: ${size[1.5]};
3692
- border-radius: ${tokens.border.radius.full};
3693
- }
3694
- &:focus-within {
3695
- outline-offset: 2px;
3696
- border-radius: ${border.radius.xs};
3697
- outline: 2px solid ${colors.blue[800]};
3698
- }
3699
- & select {
3700
- position: absolute;
3701
- top: 0;
3702
- left: 0;
3703
- width: 100%;
3704
- height: 100%;
3705
- appearance: none;
3706
- background-color: transparent;
3707
- border: none;
3708
- color: transparent;
3709
- outline: none;
3710
- }
3711
-
3712
- & svg path {
3713
- stroke: ${tokens.colors.red[400]};
3714
- }
3715
- & svg {
3716
- width: ${tokens.size[2]};
3717
- height: ${tokens.size[2]};
3718
- }
3719
- `,
3720
- settingsMenu: css`
3721
- display: flex;
3722
- & * {
3723
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3724
- }
3725
- flex-direction: column;
3726
- gap: ${size[0.5]};
3727
- border-radius: ${tokens.border.radius.sm};
3728
- border: 1px solid ${t(colors.gray[300], colors.gray[700])};
3729
- background-color: ${t(colors.gray[50], colors.darkGray[600])};
3730
- font-size: ${font.size.xs};
3731
- color: ${t(colors.gray[700], colors.gray[300])};
3732
- z-index: 99999;
3733
- min-width: 120px;
3734
- padding: ${size[0.5]};
3735
- `,
3736
- settingsSubTrigger: css`
3737
- display: flex;
3738
- align-items: center;
3739
- justify-content: space-between;
3740
- border-radius: ${tokens.border.radius.xs};
3741
- padding: ${tokens.size[1]} ${tokens.size[1]};
3742
- cursor: pointer;
3743
- background-color: transparent;
3744
- border: none;
3745
- color: ${t(colors.gray[700], colors.gray[300])};
3746
- & svg {
3747
- color: ${t(colors.gray[600], colors.gray[400])};
3748
- transform: rotate(-90deg);
3749
- width: ${tokens.size[2]};
3750
- height: ${tokens.size[2]};
3751
- }
3752
- &:hover {
3753
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3754
- }
3755
- &:focus-visible {
3756
- outline-offset: 2px;
3757
- outline: 2px solid ${colors.blue[800]};
3758
- }
3759
- &.data-disabled {
3760
- opacity: 0.6;
3761
- cursor: not-allowed;
3762
- }
3763
- `,
3764
- settingsMenuHeader: css`
3765
- padding: ${tokens.size[1]} ${tokens.size[1]};
3766
- font-weight: ${font.weight.medium};
3767
- border-bottom: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3768
- color: ${t(colors.gray[500], colors.gray[400])};
3769
- font-size: ${font.size['xs']};
3770
- `,
3771
- settingsSubButton: css`
3772
- display: flex;
3773
- align-items: center;
3774
- justify-content: space-between;
3775
- color: ${t(colors.gray[700], colors.gray[300])};
3776
- font-size: ${font.size['xs']};
3777
- border-radius: ${tokens.border.radius.xs};
3778
- padding: ${tokens.size[1]} ${tokens.size[1]};
3779
- cursor: pointer;
3780
- background-color: transparent;
3781
- border: none;
3782
- & svg {
3783
- color: ${t(colors.gray[600], colors.gray[400])};
3784
- }
3785
- &:hover {
3786
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3787
- }
3788
- &:focus-visible {
3789
- outline-offset: 2px;
3790
- outline: 2px solid ${colors.blue[800]};
3791
- }
3792
- &[data-checked] {
3793
- background-color: ${t(colors.purple[100], colors.purple[900])};
3794
- color: ${t(colors.purple[700], colors.purple[300])};
3795
- & svg {
3796
- color: ${t(colors.purple[700], colors.purple[300])};
3797
- }
3798
- &:hover {
3799
- background-color: ${t(colors.purple[100], colors.purple[900])};
3800
- }
3801
- }
3802
- `,
3803
- viewToggle: css`
3804
- border-radius: ${tokens.border.radius.sm};
3805
- background-color: ${t(colors.gray[200], colors.darkGray[600])};
3806
- border: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3807
- display: flex;
3808
- padding: 0;
3809
- font-size: ${font.size.xs};
3810
- color: ${t(colors.gray[700], colors.gray[300])};
3811
- overflow: hidden;
3812
-
3813
- &:has(:focus-visible) {
3814
- outline: 2px solid ${colors.blue[800]};
3815
- }
3816
-
3817
- & .tsqd-radio-toggle {
3818
- opacity: 0.5;
3819
- display: flex;
3820
- & label {
3821
- display: flex;
3822
- align-items: center;
3823
- cursor: pointer;
3824
- line-height: ${font.lineHeight.md};
3825
- }
3826
-
3827
- & label:hover {
3828
- background-color: ${t(colors.gray[100], colors.darkGray[500])};
3829
- }
3830
- }
3831
-
3832
- & > [data-checked] {
3833
- opacity: 1;
3834
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3835
- & label:hover {
3836
- background-color: ${t(colors.gray[100], colors.darkGray[400])};
3837
- }
3838
- }
3839
-
3840
- & .tsqd-radio-toggle:first-child {
3841
- & label {
3842
- padding: 0 ${tokens.size[1.5]} 0 ${tokens.size[2]};
3843
- }
3844
- border-right: 1px solid ${t(colors.gray[300], colors.darkGray[200])};
3845
- }
3846
-
3847
- & .tsqd-radio-toggle:nth-child(2) {
3848
- & label {
3849
- padding: 0 ${tokens.size[2]} 0 ${tokens.size[1.5]};
3850
- }
3851
- }
3852
- `,
3853
- devtoolsEditForm: css`
3854
- padding: ${size[2]};
3855
- & > [data-error='true'] {
3856
- outline: 2px solid ${t(colors.red[200], colors.red[800])};
3857
- outline-offset: 2px;
3858
- border-radius: ${border.radius.xs};
3859
- }
3860
- `,
3861
- devtoolsEditTextarea: css`
3862
- width: 100%;
3863
- max-height: 500px;
3864
- font-family: 'Fira Code', monospace;
3865
- font-size: ${font.size.xs};
3866
- border-radius: ${border.radius.sm};
3867
- field-sizing: content;
3868
- padding: ${size[2]};
3869
- background-color: ${t(colors.gray[100], colors.darkGray[800])};
3870
- color: ${t(colors.gray[900], colors.gray[100])};
3871
- border: 1px solid ${t(colors.gray[200], colors.gray[700])};
3872
- resize: none;
3873
- &:focus {
3874
- outline-offset: 2px;
3875
- border-radius: ${border.radius.xs};
3876
- outline: 2px solid ${t(colors.blue[200], colors.blue[800])};
3877
- }
3878
- `,
3879
- devtoolsEditFormActions: css`
3880
- display: flex;
3881
- justify-content: space-between;
3882
- gap: ${size[2]};
3883
- align-items: center;
3884
- padding-top: ${size[1]};
3885
- font-size: ${font.size.xs};
3886
- `,
3887
- devtoolsEditFormError: css`
3888
- color: ${t(colors.red[700], colors.red[500])};
3889
- `,
3890
- devtoolsEditFormActionContainer: css`
3891
- display: flex;
3892
- gap: ${size[2]};
3893
- `,
3894
- devtoolsEditFormAction: css`
3895
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
3896
- font-size: ${font.size.xs};
3897
- padding: ${size[1]} ${tokens.size[2]};
3898
- display: flex;
3899
- border-radius: ${border.radius.sm};
3900
- background-color: ${t(colors.gray[100], colors.darkGray[600])};
3901
- border: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
3902
- align-items: center;
3903
- gap: ${size[2]};
3904
- font-weight: ${font.weight.medium};
3905
- line-height: ${font.lineHeight.xs};
3906
- cursor: pointer;
3907
- &:focus-visible {
3908
- outline-offset: 2px;
3909
- border-radius: ${border.radius.xs};
3910
- outline: 2px solid ${colors.blue[800]};
3911
- }
3912
- &:hover {
3913
- background-color: ${t(colors.gray[200], colors.darkGray[500])};
3914
- }
3915
-
3916
- &:disabled {
3917
- opacity: 0.6;
3918
- cursor: not-allowed;
3919
- }
3920
- `,
3921
- }
3922
- }
3923
-
3924
- const lightStyles = (css: (typeof goober)['css']) => stylesFactory('light', css)
3925
- const darkStyles = (css: (typeof goober)['css']) => stylesFactory('dark', css)