Skip to content

Commit 8355776

Browse files
committed
chore: export type
1 parent 00179c0 commit 8355776

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { createContext, createEffect, createSignal, useContext } from 'solid-js'
22
import type { Accessor, JSX } from 'solid-js'
33

4-
export type ThemeType = 'light' | 'dark'
4+
export type TanStackDevtoolsTheme = 'light' | 'dark'
55

66
type ThemeContextValue = {
7-
theme: Accessor<ThemeType>
8-
setTheme: (theme: ThemeType) => void
7+
theme: Accessor<TanStackDevtoolsTheme>
8+
setTheme: (theme: TanStackDevtoolsTheme) => void
99
}
1010
const ThemeContext = createContext<ThemeContextValue | undefined>(undefined)
1111

1212
export const ThemeContextProvider = (props: {
1313
children: JSX.Element
14-
theme: ThemeType
14+
theme: TanStackDevtoolsTheme
1515
}) => {
16-
const [theme, setTheme] = createSignal<ThemeType>(props.theme)
16+
const [theme, setTheme] = createSignal<TanStackDevtoolsTheme>(props.theme)
1717
createEffect(() => {
1818
setTheme(props.theme)
1919
})

packages/devtools-ui/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export {
1414
} from './components/section'
1515
export { Header, HeaderLogo } from './components/header'
1616
export { useTheme, ThemeContextProvider } from './components/theme'
17-
export type { ThemeType } from './components/theme'
17+
export type { TanStackDevtoolsTheme } from './components/theme'
1818
export {
1919
CheckCircleIcon,
2020
ChevronDownIcon,

packages/devtools-ui/src/styles/use-styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import * as goober from 'goober'
22
import { createEffect, createSignal } from 'solid-js'
33
import { useTheme } from '../components/theme'
44
import { tokens } from './tokens'
5+
6+
import type { TanStackDevtoolsTheme } from '../components/theme'
57
import type { ButtonVariant } from '../components/button'
6-
import type { ThemeType } from '../components/theme'
78

89
const buttonVariantColors: Record<
910
ButtonVariant,
@@ -118,7 +119,7 @@ const buttonVariantColors: Record<
118119
},
119120
}
120121
export const css = goober.css
121-
const stylesFactory = (theme: ThemeType = 'dark') => {
122+
const stylesFactory = (theme: TanStackDevtoolsTheme) => {
122123
const { colors, font, size, border } = tokens
123124
const { fontFamily } = font
124125

packages/devtools/src/context/devtools-context.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import {
1111
import { initialState } from './devtools-store'
1212
import type { DevtoolsStore } from './devtools-store'
1313
import type { JSX, Setter } from 'solid-js'
14+
import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
1415

1516
export interface TanStackDevtoolsPluginProps {
16-
theme: DevtoolsStore['settings']['theme']
17+
theme: TanStackDevtoolsTheme
1718
devtoolsOpen: boolean
1819
}
1920
export interface TanStackDevtoolsPlugin {

packages/devtools/src/context/devtools-store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { TabName } from '../tabs'
22
import type { TanStackDevtoolsPlugin } from './devtools-context'
3+
import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
34

45
type ModifierKey = 'Alt' | 'Control' | 'Meta' | 'Shift' | 'CtrlOrMeta'
56
type KeyboardKey = ModifierKey | (string & {})
@@ -21,7 +22,7 @@ type TriggerPosition =
2122
| 'middle-right'
2223

2324
type TriggerProps = {
24-
theme: 'light' | 'dark'
25+
theme: TanStackDevtoolsTheme
2526
}
2627

2728
export type DevtoolsStore = {
@@ -71,7 +72,7 @@ export type DevtoolsStore = {
7172
* The theme of the dev tools
7273
* @default "dark"
7374
*/
74-
theme: 'light' | 'dark'
75+
theme: TanStackDevtoolsTheme
7576

7677
/**
7778
* Whether the trigger should be completely hidden or not (you can still open with the hotkey)

pnpm-lock.yaml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)