@tanstack/devtools 0.6.2 → 0.6.5

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 (37) hide show
  1. package/dist/esm/components/tabs.js +5 -2
  2. package/dist/esm/components/tabs.js.map +1 -1
  3. package/dist/esm/context/devtools-context.d.ts +2 -2
  4. package/dist/esm/context/devtools-context.js.map +1 -1
  5. package/dist/esm/context/devtools-store.d.ts +5 -0
  6. package/dist/esm/context/devtools-store.js +2 -1
  7. package/dist/esm/context/devtools-store.js.map +1 -1
  8. package/dist/esm/context/use-devtools-context.d.ts +5 -0
  9. package/dist/esm/context/use-devtools-context.js +10 -1
  10. package/dist/esm/context/use-devtools-context.js.map +1 -1
  11. package/dist/esm/devtools.js +38 -27
  12. package/dist/esm/devtools.js.map +1 -1
  13. package/dist/esm/styles/tokens.js +15 -7
  14. package/dist/esm/styles/tokens.js.map +1 -1
  15. package/dist/esm/styles/use-styles.d.ts +2 -3
  16. package/dist/esm/styles/use-styles.js +62 -59
  17. package/dist/esm/styles/use-styles.js.map +1 -1
  18. package/dist/esm/tabs/index.d.ts +3 -3
  19. package/dist/esm/tabs/index.js +5 -5
  20. package/dist/esm/tabs/index.js.map +1 -1
  21. package/dist/esm/tabs/plugins-tab.js +9 -8
  22. package/dist/esm/tabs/plugins-tab.js.map +1 -1
  23. package/dist/esm/tabs/seo-tab.js +23 -22
  24. package/dist/esm/tabs/seo-tab.js.map +1 -1
  25. package/dist/esm/tabs/settings-tab.js +52 -34
  26. package/dist/esm/tabs/settings-tab.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/components/tabs.tsx +4 -33
  29. package/src/context/devtools-context.tsx +10 -2
  30. package/src/context/devtools-store.ts +8 -0
  31. package/src/context/use-devtools-context.ts +10 -0
  32. package/src/devtools.tsx +30 -25
  33. package/src/styles/use-styles.ts +66 -59
  34. package/src/tabs/index.tsx +4 -64
  35. package/src/tabs/plugins-tab.tsx +7 -10
  36. package/src/tabs/seo-tab.tsx +2 -15
  37. package/src/tabs/settings-tab.tsx +20 -65
@@ -18,6 +18,16 @@ const useDevtoolsContext = () => {
18
18
  return context
19
19
  }
20
20
 
21
+ export function useTheme() {
22
+ const { settings, setSettings } = useDevtoolsSettings()
23
+ const theme = createMemo(() => settings().theme)
24
+ return {
25
+ theme,
26
+ setTheme: (theme: DevtoolsStore['settings']['theme']) =>
27
+ setSettings({ theme }),
28
+ }
29
+ }
30
+
21
31
  export const usePlugins = () => {
22
32
  const { store, setStore } = useDevtoolsContext()
23
33
  const { setForceExpand } = useDrawContext()
package/src/devtools.tsx CHANGED
@@ -1,10 +1,12 @@
1
1
  import { Show, createEffect, createSignal, onCleanup } from 'solid-js'
2
2
  import { createShortcut } from '@solid-primitives/keyboard'
3
3
  import { Portal } from 'solid-js/web'
4
+ import { ThemeContextProvider } from '@tanstack/devtools-ui'
4
5
  import {
5
6
  useDevtoolsSettings,
6
7
  useHeight,
7
8
  usePersistOpen,
9
+ useTheme,
8
10
  } from './context/use-devtools-context'
9
11
  import { useDisableTabbing } from './hooks/use-disable-tabbing'
10
12
  import { TANSTACK_DEVTOOLS } from './utils/storage'
@@ -172,7 +174,7 @@ export default function DevTools() {
172
174
  e.preventDefault()
173
175
  e.stopPropagation()
174
176
  fetch(
175
- `http://localhost:__TSD_PORT__/__tsd/open-source?source=${dataSource}`,
177
+ `__TSD_HOST__://localhost:__TSD_PORT__/__tsd/open-source?source=${encodeURIComponent(dataSource)}`,
176
178
  ).catch(() => {})
177
179
  }
178
180
  }
@@ -182,31 +184,34 @@ export default function DevTools() {
182
184
  window.removeEventListener('click', openSourceHandler)
183
185
  })
184
186
  })
187
+ const { theme } = useTheme()
185
188
 
186
189
  return (
187
- <Portal mount={(pip().pipWindow ?? window).document.body}>
188
- <div ref={setRootEl} data-testid={TANSTACK_DEVTOOLS}>
189
- <Show
190
- when={
191
- pip().pipWindow !== null
192
- ? true
193
- : settings().requireUrlFlag
194
- ? window.location.search.includes(settings().urlFlag)
195
- : true
196
- }
197
- >
198
- <Trigger isOpen={isOpen} setIsOpen={toggleOpen} />
199
- <MainPanel isResizing={isResizing} isOpen={isOpen}>
200
- <ContentPanel
201
- ref={(ref) => (panelRef = ref)}
202
- handleDragStart={(e) => handleDragStart(panelRef, e)}
203
- >
204
- <Tabs toggleOpen={toggleOpen} />
205
- <TabContent />
206
- </ContentPanel>
207
- </MainPanel>
208
- </Show>
209
- </div>
210
- </Portal>
190
+ <ThemeContextProvider theme={theme()}>
191
+ <Portal mount={(pip().pipWindow ?? window).document.body}>
192
+ <div ref={setRootEl} data-testid={TANSTACK_DEVTOOLS}>
193
+ <Show
194
+ when={
195
+ pip().pipWindow !== null
196
+ ? true
197
+ : settings().requireUrlFlag
198
+ ? window.location.search.includes(settings().urlFlag)
199
+ : true
200
+ }
201
+ >
202
+ <Trigger isOpen={isOpen} setIsOpen={toggleOpen} />
203
+ <MainPanel isResizing={isResizing} isOpen={isOpen}>
204
+ <ContentPanel
205
+ ref={(ref) => (panelRef = ref)}
206
+ handleDragStart={(e) => handleDragStart(panelRef, e)}
207
+ >
208
+ <Tabs toggleOpen={toggleOpen} />
209
+ <TabContent />
210
+ </ContentPanel>
211
+ </MainPanel>
212
+ </Show>
213
+ </div>
214
+ </Portal>
215
+ </ThemeContextProvider>
211
216
  )
212
217
  }
@@ -1,24 +1,27 @@
1
1
  import * as goober from 'goober'
2
- import { createSignal } from 'solid-js'
2
+ import { createEffect, createSignal } from 'solid-js'
3
+ import { useTheme } from '../context/use-devtools-context'
3
4
  import { tokens } from './tokens'
4
5
  import type { TanStackDevtoolsConfig } from '../context/devtools-context'
5
6
  import type { Accessor } from 'solid-js'
7
+ import type { DevtoolsStore } from '../context/devtools-store'
6
8
 
7
9
  const mSecondsToCssSeconds = (mSeconds: number) =>
8
10
  `${(mSeconds / 1000).toFixed(2)}s`
9
11
 
10
- const stylesFactory = () => {
11
- const { colors, font, size, alpha, border } = tokens
12
+ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
13
+ const { colors, font, size, border } = tokens
12
14
  const { fontFamily, size: fontSize } = font
13
15
  const css = goober.css
16
+ const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
14
17
 
15
18
  return {
16
19
  seoTabContainer: css`
17
20
  padding: 0;
18
21
  margin: 0 auto;
19
- background: ${colors.darkGray[700]};
22
+ background: ${t(colors.white, colors.darkGray[700])};
20
23
  border-radius: 12px;
21
- box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
24
+ box-shadow: 0 2px 16px ${t('rgba(0, 0, 0, 0.04)', 'rgba(0, 0, 0, 0.08)')};
22
25
  overflow-y: auto;
23
26
  height: 100%;
24
27
  display: flex;
@@ -30,16 +33,16 @@ const stylesFactory = () => {
30
33
  seoTabTitle: css`
31
34
  font-size: 1.25rem;
32
35
  font-weight: 600;
33
- color: ${colors.purple[400]};
36
+ color: ${t(colors.purple[500], colors.purple[400])};
34
37
  margin: 0;
35
38
  padding: 1rem 1.5rem 0.5rem 1.5rem;
36
39
  text-align: left;
37
- border-bottom: 1px solid ${colors.gray[700]};
40
+ border-bottom: 1px solid ${t(colors.gray[300], colors.gray[700])};
38
41
  `,
39
42
  seoTabSection: css`
40
43
  padding: 1.5rem;
41
- background: ${colors.darkGray[800]};
42
- border: 1px solid ${colors.gray[700]};
44
+ background: ${t(colors.gray[100], colors.gray[800])};
45
+ border: 1px solid ${t(colors.gray[300], colors.gray[700])};
43
46
  display: flex;
44
47
  flex-direction: column;
45
48
  gap: 0.5rem;
@@ -58,12 +61,12 @@ const stylesFactory = () => {
58
61
  padding-bottom: 0.5rem;
59
62
  `,
60
63
  seoPreviewCard: css`
61
- border: 1px solid ${colors.gray[700]};
64
+ border: 1px solid ${t(colors.gray[300], colors.gray[700])};
62
65
  border-radius: 8px;
63
66
  padding: 12px 10px;
64
- background: ${colors.darkGray[900]};
67
+ background: ${t(colors.white, colors.darkGray[900])};
65
68
  margin-bottom: 0;
66
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
69
+ box-shadow: 0 1px 4px ${t('rgba(0,0,0,0.02)', 'rgba(0,0,0,0.04)')};
67
70
  display: flex;
68
71
  flex-direction: column;
69
72
  align-items: flex-start;
@@ -76,28 +79,28 @@ const stylesFactory = () => {
76
79
  font-size: 1rem;
77
80
  font-weight: 500;
78
81
  margin-bottom: 6px;
79
- color: ${colors.purple[400]};
82
+ color: ${t(colors.purple[500], colors.purple[400])};
80
83
  `,
81
84
  seoPreviewImage: css`
82
85
  max-width: 100%;
83
86
  border-radius: 6px;
84
87
  margin-bottom: 6px;
85
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
88
+ box-shadow: 0 1px 2px ${t('rgba(0,0,0,0.03)', 'rgba(0,0,0,0.06)')};
86
89
  height: 160px;
87
90
  `,
88
91
  seoPreviewTitle: css`
89
92
  font-size: 1rem;
90
93
  font-weight: 600;
91
94
  margin-bottom: 2px;
92
- color: ${colors.gray[100]};
95
+ color: ${t(colors.gray[900], colors.gray[100])};
93
96
  `,
94
97
  seoPreviewDesc: css`
95
- color: ${colors.gray[300]};
98
+ color: ${t(colors.gray[700], colors.gray[300])};
96
99
  margin-bottom: 2px;
97
100
  font-size: 0.95rem;
98
101
  `,
99
102
  seoPreviewUrl: css`
100
- color: ${colors.gray[500]};
103
+ color: ${t(colors.gray[500], colors.gray[500])};
101
104
  font-size: 0.9rem;
102
105
  margin-bottom: 2px;
103
106
  word-break: break-all;
@@ -105,7 +108,7 @@ const stylesFactory = () => {
105
108
  seoMissingTagsSection: css`
106
109
  margin-top: 4px;
107
110
  font-size: 0.95rem;
108
- color: ${colors.red[400]};
111
+ color: ${t(colors.red[400], colors.red[400])};
109
112
  `,
110
113
  seoMissingTagsList: css`
111
114
  margin: 4px 0 0 0;
@@ -117,15 +120,15 @@ const stylesFactory = () => {
117
120
  max-width: 240px;
118
121
  `,
119
122
  seoMissingTag: css`
120
- background: ${colors.red[500]}22;
121
- color: ${colors.red[500]};
123
+ background: ${t(colors.red[100], colors.red[500] + '22')};
124
+ color: ${t(colors.red[700], colors.red[500])};
122
125
  border-radius: 4px;
123
126
  padding: 1px 6px;
124
127
  font-size: 0.9rem;
125
128
  font-weight: 500;
126
129
  `,
127
130
  seoAllTagsFound: css`
128
- color: ${colors.green[500]};
131
+ color: ${t(colors.green[700], colors.green[500])};
129
132
  font-weight: 500;
130
133
  margin-left: 6px;
131
134
  font-size: 0.95rem;
@@ -143,7 +146,7 @@ const stylesFactory = () => {
143
146
  z-index: 99999;
144
147
  width: 100%;
145
148
  ${isDetached ? '' : 'max-height: 90%;'}
146
- border-top: 1px solid ${colors.gray[700]};
149
+ border-top: 1px solid ${t(colors.gray[300], colors.gray[700])};
147
150
  transform-origin: top;
148
151
  `,
149
152
  devtoolsPanelContainerVisibility: (isOpen: boolean) => {
@@ -179,8 +182,8 @@ const stylesFactory = () => {
179
182
  display: flex;
180
183
  font-size: ${fontSize.sm};
181
184
  font-family: ${fontFamily.sans};
182
- background-color: ${colors.darkGray[700]};
183
- color: ${colors.gray[300]};
185
+ background-color: ${t(colors.white, colors.darkGray[700])};
186
+ color: ${t(colors.gray[900], colors.gray[300])};
184
187
  width: w-screen;
185
188
  flex-direction: row;
186
189
  overflow-x: hidden;
@@ -197,7 +200,7 @@ const stylesFactory = () => {
197
200
  user-select: none;
198
201
  z-index: 100000;
199
202
  &:hover {
200
- background-color: ${colors.purple[400]}${alpha[90]};
203
+ background-color: ${t(colors.purple[700], colors.purple[400])};
201
204
  }
202
205
  `,
203
206
 
@@ -228,7 +231,7 @@ const stylesFactory = () => {
228
231
  &:focus-visible {
229
232
  outline-offset: 2px;
230
233
  border-radius: ${border.radius.full};
231
- outline: 2px solid ${colors.blue[800]};
234
+ outline: 2px solid ${t(colors.blue[700], colors.blue[800])};
232
235
  }
233
236
  `,
234
237
  mainCloseBtnPosition: (position: TanStackDevtoolsConfig['position']) => {
@@ -280,9 +283,9 @@ const stylesFactory = () => {
280
283
  align-items: center;
281
284
  justify-content: flex-start;
282
285
  height: 100%;
283
- background-color: ${colors.darkGray[800]};
284
- border-right: 1px solid ${colors.gray[700]};
285
- box-shadow: 0 1px 0 ${colors.gray[700]};
286
+ background-color: ${t(colors.gray[100], colors.darkGray[800])};
287
+ border-right: 1px solid ${t(colors.gray[300], colors.gray[700])};
288
+ box-shadow: 0 1px 0 ${t(colors.gray[200], colors.gray[700])};
286
289
  position: relative;
287
290
  width: ${size[10]};
288
291
  `,
@@ -296,39 +299,38 @@ const stylesFactory = () => {
296
299
  cursor: pointer;
297
300
  font-size: ${fontSize.sm};
298
301
  font-family: ${fontFamily.sans};
299
- color: ${colors.gray[300]};
302
+ color: ${t(colors.gray[700], colors.gray[300])};
300
303
  background-color: transparent;
301
304
  border: none;
302
305
  transition: all 0.2s ease-in-out;
303
306
  border-left: 2px solid transparent;
304
307
  &:hover:not(.close):not(.active):not(.detach) {
305
- background-color: ${colors.gray[700]};
306
- color: ${colors.gray[100]};
307
- border-left: 2px solid ${colors.purple[500]};
308
+ background-color: ${t(colors.gray[200], colors.gray[700])};
309
+ color: ${t(colors.gray[900], colors.gray[100])};
310
+ border-left: 2px solid ${t(colors.purple[700], colors.purple[500])};
308
311
  }
309
312
  &.active {
310
- background-color: ${colors.purple[500]};
311
- color: ${colors.gray[100]};
312
- border-left: 2px solid ${colors.purple[500]};
313
+ background-color: ${t(colors.purple[200], colors.purple[500])};
314
+ color: ${t(colors.gray[900], colors.gray[100])};
315
+ border-left: 2px solid ${t(colors.purple[700], colors.purple[500])};
313
316
  }
314
317
  &.detach {
315
318
  &:hover {
316
- background-color: ${colors.gray[700]};
319
+ background-color: ${t(colors.gray[200], colors.gray[700])};
317
320
  }
318
321
  &:hover {
319
- color: ${colors.green[500]};
322
+ color: ${t(colors.green[700], colors.green[500])};
320
323
  }
321
324
  }
322
325
  &.close {
323
326
  margin-top: auto;
324
327
  &:hover {
325
- background-color: ${colors.gray[700]};
328
+ background-color: ${t(colors.gray[200], colors.gray[700])};
326
329
  }
327
330
  &:hover {
328
- color: ${colors.red[500]};
331
+ color: ${t(colors.red[700], colors.red[500])};
329
332
  }
330
333
  }
331
-
332
334
  &.disabled {
333
335
  cursor: not-allowed;
334
336
  opacity: 0.2;
@@ -352,15 +354,18 @@ const stylesFactory = () => {
352
354
  overflow: hidden;
353
355
  `,
354
356
 
355
- pluginsTabDraw: css`
356
- width: 0px;
357
+ pluginsTabDraw: (isExpanded: boolean) => css`
358
+ width: ${isExpanded ? size[48] : 0};
357
359
  height: 100%;
358
- background-color: ${colors.darkGray[800]};
360
+ background-color: ${t(colors.white, colors.darkGray[800])};
359
361
  box-shadow: 0 1px 0 ${colors.gray[700]};
362
+ ${isExpanded
363
+ ? `border-right: 1px solid ${t(colors.gray[300], colors.gray[700])};`
364
+ : ''}
360
365
  `,
361
366
  pluginsTabDrawExpanded: css`
362
367
  width: ${size[48]};
363
- border-right: 1px solid ${colors.gray[700]};
368
+ border-right: 1px solid ${t(colors.gray[300], colors.gray[700])};
364
369
  `,
365
370
  pluginsTabDrawTransition: (mSeconds: number) => {
366
371
  return css`
@@ -368,14 +373,12 @@ const stylesFactory = () => {
368
373
  `
369
374
  },
370
375
 
371
- pluginsTabSidebar: css`
376
+ pluginsTabSidebar: (isExpanded: boolean) => css`
372
377
  width: ${size[48]};
373
378
  overflow-y: auto;
374
- transform: translateX(-100%);
375
- `,
376
- pluginsTabSidebarExpanded: css`
377
- transform: translateX(0);
379
+ transform: ${isExpanded ? 'translateX(0)' : 'translateX(-100%)'};
378
380
  `,
381
+
379
382
  pluginsTabSidebarTransition: (mSeconds: number) => {
380
383
  return css`
381
384
  transition: transform ${mSecondsToCssSeconds(mSeconds)} ease;
@@ -385,19 +388,19 @@ const stylesFactory = () => {
385
388
  pluginName: css`
386
389
  font-size: ${fontSize.xs};
387
390
  font-family: ${fontFamily.sans};
388
- color: ${colors.gray[300]};
391
+ color: ${t(colors.gray[700], colors.gray[300])};
389
392
  padding: ${size[2]};
390
393
  cursor: pointer;
391
394
  text-align: center;
392
395
  transition: all 0.2s ease-in-out;
393
396
  &:hover {
394
- background-color: ${colors.gray[700]};
395
- color: ${colors.gray[100]};
397
+ background-color: ${t(colors.gray[200], colors.gray[700])};
398
+ color: ${t(colors.gray[900], colors.gray[100])};
396
399
  padding: ${size[2]};
397
400
  }
398
401
  &.active {
399
- background-color: ${colors.purple[500]};
400
- color: ${colors.gray[100]};
402
+ background-color: ${t(colors.purple[200], colors.purple[500])};
403
+ color: ${t(colors.gray[900], colors.gray[100])};
401
404
  }
402
405
  `,
403
406
  pluginsTabContent: css`
@@ -414,8 +417,8 @@ const stylesFactory = () => {
414
417
  conditionalSetting: css`
415
418
  margin-left: 1.5rem;
416
419
  padding-left: 1rem;
417
- border-left: 2px solid ${colors.purple[400]};
418
- background-color: ${colors.darkGray[800]};
420
+ border-left: 2px solid ${t(colors.purple[600], colors.purple[400])};
421
+ background-color: ${t(colors.gray[100], colors.darkGray[800])};
419
422
  padding: 1rem;
420
423
  border-radius: 0.5rem;
421
424
  margin-top: 0.5rem;
@@ -437,6 +440,10 @@ const stylesFactory = () => {
437
440
  }
438
441
 
439
442
  export function useStyles() {
440
- const [_styles] = createSignal(stylesFactory())
441
- return _styles
443
+ const { theme } = useTheme()
444
+ const [styles, setStyles] = createSignal(stylesFactory(theme()))
445
+ createEffect(() => {
446
+ setStyles(stylesFactory(theme()))
447
+ })
448
+ return styles
442
449
  }
@@ -1,3 +1,4 @@
1
+ import { Cogs, List, PageSearch } from '@tanstack/devtools-ui/icons'
1
2
  import { SettingsTab } from './settings-tab'
2
3
  import { PluginsTab } from './plugins-tab'
3
4
  import { SeoTab } from './seo-tab'
@@ -7,80 +8,19 @@ export const tabs = [
7
8
  name: 'Plugins',
8
9
  id: 'plugins',
9
10
  component: () => <PluginsTab />,
10
- icon: (
11
- <svg
12
- xmlns="http://www.w3.org/2000/svg"
13
- width="24"
14
- height="24"
15
- viewBox="0 0 24 24"
16
- fill="none"
17
- stroke="currentColor"
18
- stroke-width="2"
19
- stroke-linecap="round"
20
- stroke-linejoin="round"
21
- >
22
- <path d="M8 6h10" />
23
- <path d="M6 12h9" />
24
- <path d="M11 18h7" />
25
- </svg>
26
- ),
11
+ icon: () => <List />,
27
12
  },
28
13
  {
29
14
  name: 'SEO',
30
15
  id: 'seo',
31
16
  component: () => <SeoTab />,
32
- icon: (
33
- <svg
34
- xmlns="http://www.w3.org/2000/svg"
35
- width="24"
36
- height="24"
37
- viewBox="0 0 24 24"
38
- fill="none"
39
- stroke="currentColor"
40
- stroke-width="2"
41
- stroke-linecap="round"
42
- stroke-linejoin="round"
43
- class="lucide lucide-file-search2-icon lucide-file-search-2"
44
- >
45
- <path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" />
46
- <path d="M14 2v4a2 2 0 0 0 2 2h4" />
47
- <circle cx="11.5" cy="14.5" r="2.5" />
48
- <path d="M13.3 16.3 15 18" />
49
- </svg>
50
- ),
17
+ icon: () => <PageSearch />,
51
18
  },
52
19
  {
53
20
  name: 'Settings',
54
21
  id: 'settings',
55
22
  component: () => <SettingsTab />,
56
- icon: (
57
- <svg
58
- xmlns="http://www.w3.org/2000/svg"
59
- width="24"
60
- height="24"
61
- viewBox="0 0 24 24"
62
- fill="none"
63
- stroke="currentColor"
64
- stroke-width="2"
65
- stroke-linecap="round"
66
- stroke-linejoin="round"
67
- >
68
- <path d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z" />
69
- <path d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" />
70
- <path d="M12 2v2" />
71
- <path d="M12 22v-2" />
72
- <path d="m17 20.66-1-1.73" />
73
- <path d="M11 10.27 7 3.34" />
74
- <path d="m20.66 17-1.73-1" />
75
- <path d="m3.34 7 1.73 1" />
76
- <path d="M14 12h8" />
77
- <path d="M2 12h2" />
78
- <path d="m20.66 7-1.73 1" />
79
- <path d="m3.34 17 1.73-1" />
80
- <path d="m17 3.34-1 1.73" />
81
- <path d="m11 13.73-4 6.93" />
82
- </svg>
83
- ),
23
+ icon: () => <Cogs />,
84
24
  },
85
25
  ] as const
86
26
 
@@ -1,7 +1,7 @@
1
1
  import { For, createEffect } from 'solid-js'
2
2
  import clsx from 'clsx'
3
3
  import { useDrawContext } from '../context/draw-context'
4
- import { usePlugins } from '../context/use-devtools-context'
4
+ import { usePlugins, useTheme } from '../context/use-devtools-context'
5
5
  import { useStyles } from '../styles/use-styles'
6
6
  import { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from '../constants'
7
7
 
@@ -10,23 +10,23 @@ export const PluginsTab = () => {
10
10
  const { expanded, hoverUtils, animationMs } = useDrawContext()
11
11
  let activePluginRef: HTMLDivElement | undefined
12
12
 
13
+ const { theme } = useTheme()
13
14
  createEffect(() => {
14
15
  const currentActivePlugin = plugins()?.find(
15
16
  (plugin) => plugin.id === activePlugin(),
16
17
  )
17
18
  if (activePluginRef && currentActivePlugin) {
18
- currentActivePlugin.render(activePluginRef)
19
+ currentActivePlugin.render(activePluginRef, theme())
19
20
  }
20
21
  })
21
22
  const styles = useStyles()
22
-
23
23
  return (
24
24
  <div class={styles().pluginsTabPanel}>
25
25
  <div
26
26
  class={clsx(
27
- styles().pluginsTabDraw,
27
+ styles().pluginsTabDraw(expanded()),
28
28
  {
29
- [styles().pluginsTabDrawExpanded]: expanded(),
29
+ [styles().pluginsTabDraw(expanded())]: expanded(),
30
30
  },
31
31
  styles().pluginsTabDrawTransition(animationMs),
32
32
  )}
@@ -39,10 +39,7 @@ export const PluginsTab = () => {
39
39
  >
40
40
  <div
41
41
  class={clsx(
42
- styles().pluginsTabSidebar,
43
- {
44
- [styles().pluginsTabSidebarExpanded]: expanded(),
45
- },
42
+ styles().pluginsTabSidebar(expanded()),
46
43
  styles().pluginsTabSidebarTransition(animationMs),
47
44
  )}
48
45
  >
@@ -53,7 +50,7 @@ export const PluginsTab = () => {
53
50
  if (pluginHeading) {
54
51
  typeof plugin.name === 'string'
55
52
  ? (pluginHeading.textContent = plugin.name)
56
- : plugin.name(pluginHeading)
53
+ : plugin.name(pluginHeading, theme())
57
54
  }
58
55
  })
59
56
  return (
@@ -6,6 +6,7 @@ import {
6
6
  SectionIcon,
7
7
  SectionTitle,
8
8
  } from '@tanstack/devtools-ui'
9
+ import { SocialBubble } from '@tanstack/devtools-ui/icons'
9
10
  import { useStyles } from '../styles/use-styles'
10
11
  import { useHeadChanges } from '../hooks/use-head-changes'
11
12
 
@@ -185,21 +186,7 @@ export const SeoTab = () => {
185
186
  <Section>
186
187
  <SectionTitle>
187
188
  <SectionIcon>
188
- <svg
189
- xmlns="http://www.w3.org/2000/svg"
190
- width="20"
191
- height="20"
192
- viewBox="0 0 24 24"
193
- fill="none"
194
- stroke="currentColor"
195
- stroke-width="2"
196
- stroke-linecap="round"
197
- stroke-linejoin="round"
198
- >
199
- <path d="m10 9-3 3 3 3" />
200
- <path d="m14 15 3-3-3-3" />
201
- <path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" />
202
- </svg>
189
+ <SocialBubble />
203
190
  </SectionIcon>
204
191
  Social previews
205
192
  </SectionTitle>