Skip to content

Commit 08263f7

Browse files
committed
chore: unify types
1 parent 8355776 commit 08263f7

File tree

9 files changed

+20
-18
lines changed

9 files changed

+20
-18
lines changed

examples/solid/devtools-ui/src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { createEffect, createSignal } from 'solid-js'
22
import { render } from 'solid-js/web'
3-
43
import { JsonTree, ThemeContextProvider } from '@tanstack/devtools-ui'
54

5+
import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
6+
67
import './index.css'
78

89
const JsonTreeDate = {
@@ -20,7 +21,7 @@ const JsonTreePath = {
2021
const darkThemeMq = window.matchMedia('(prefers-color-scheme: dark)')
2122

2223
function App() {
23-
const [theme, setTheme] = createSignal<'light' | 'dark'>(
24+
const [theme, setTheme] = createSignal<TanStackDevtoolsTheme>(
2425
darkThemeMq.matches ? 'dark' : 'light',
2526
)
2627

packages/devtools-a11y/src/core/styles/styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as goober from 'goober'
22
import { useTheme } from '@tanstack/devtools-ui'
33
import { createMemo } from 'solid-js'
44

5+
import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
56
import type { RuleCategory, SeverityThreshold } from '../types/types'
67

78
const SEVERITY_COLORS: Record<SeverityThreshold, string> = {
@@ -49,7 +50,7 @@ const css = goober.css
4950
const FONT_SCALE = 1.1
5051
const fontPx = (size: number) => `calc(${size}px * ${FONT_SCALE})`
5152

52-
function createA11yPanelStyles(theme: 'light' | 'dark') {
53+
function createA11yPanelStyles(theme: TanStackDevtoolsTheme) {
5354
const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
5455

5556
const bg = t('#f9fafb;', '#191c24')

packages/devtools-ui/src/components/icons.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// import { Show, createUniqueId } from 'solid-js'
22

3+
import type { TanStackDevtoolsTheme } from './theme'
4+
35
/* export function Search() {
46
return (
57
<svg
@@ -39,7 +41,7 @@ export function Trash() {
3941
</svg>
4042
)
4143
} */
42-
/*
44+
/*
4345
export function ChevronDown() {
4446
return (
4547
<svg
@@ -466,7 +468,7 @@ export function Link() {
466468
</svg>
467469
)
468470
}
469-
/*
471+
/*
470472
471473
export function Pencil() {
472474
return (
@@ -696,7 +698,7 @@ export function PiP() {
696698
)
697699
}
698700

699-
export function CopiedCopier(props: { theme: 'light' | 'dark' }) {
701+
export function CopiedCopier(props: { theme: TanStackDevtoolsTheme }) {
700702
return (
701703
<svg
702704
width="24"
@@ -735,7 +737,7 @@ export function ErrorCopier() {
735737
</svg>
736738
)
737739
}
738-
/*
740+
/*
739741
export function List() {
740742
return (
741743
<svg
@@ -755,7 +757,7 @@ export function List() {
755757
)
756758
}
757759
758-
export function Check(props: { checked: boolean; theme: 'light' | 'dark' }) {
760+
export function Check(props: { checked: boolean; theme: TanStackDevtoolsTheme }) {
759761
return (
760762
<>
761763
<Show when={props.checked}>
@@ -884,7 +886,7 @@ export function PauseCircle() {
884886
</svg>
885887
)
886888
} */
887-
/*
889+
/*
888890
export function TanstackLogo() {
889891
const id = createUniqueId()
890892
return (

packages/devtools-utils/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272
"engines": {
7373
"node": ">=18"
7474
},
75-
"dependencies": {
76-
"@tanstack/devtools-ui": "workspace:^"
77-
},
7875
"devDependencies": {
7976
"@tanstack/devtools": "workspace:^",
8077
"tsup": "^8.5.0",

packages/devtools/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export type {
66
TanStackDevtoolsPluginProps,
77
TanStackDevtoolsConfig,
88
} from './context/devtools-context'
9+
export type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'

packages/preact-devtools/src/devtools.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import type {
77
TanStackDevtoolsConfig,
88
TanStackDevtoolsPlugin,
99
TanStackDevtoolsPluginProps,
10+
TanStackDevtoolsTheme,
1011
} from '@tanstack/devtools'
1112

1213
type PluginRender =
1314
| JSX.Element
1415
| ((el: HTMLElement, props: TanStackDevtoolsPluginProps) => JSX.Element)
1516

1617
type TriggerProps = {
17-
theme: 'dark' | 'light'
18+
theme: TanStackDevtoolsTheme
1819
}
1920

2021
type TriggerRender =

packages/react-devtools/src/devtools.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import type {
77
TanStackDevtoolsConfig,
88
TanStackDevtoolsPlugin,
99
TanStackDevtoolsPluginProps,
10+
TanStackDevtoolsTheme,
1011
} from '@tanstack/devtools'
1112

1213
type PluginRender =
1314
| JSX.Element
1415
| ((el: HTMLElement, props: TanStackDevtoolsPluginProps) => JSX.Element)
1516

1617
type TriggerProps = {
17-
theme: 'dark' | 'light'
18+
theme: TanStackDevtoolsTheme
1819
}
1920

2021
type TriggerRender =

packages/solid-devtools/src/core.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
TanStackDevtoolsConfig,
1414
TanStackDevtoolsPlugin,
1515
TanStackDevtoolsPluginProps,
16+
TanStackDevtoolsTheme,
1617
} from '@tanstack/devtools'
1718

1819
type SolidPluginRender =
@@ -76,7 +77,7 @@ export type TanStackDevtoolsSolidPlugin = Omit<
7677
name: string | SolidPluginRender
7778
}
7879
interface TriggerProps {
79-
theme: 'light' | 'dark'
80+
theme: TanStackDevtoolsTheme
8081
}
8182
export interface TanStackDevtoolsInit {
8283
/**

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)