File tree Expand file tree Collapse file tree 9 files changed +20
-18
lines changed
examples/solid/devtools-ui/src
devtools-a11y/src/core/styles
devtools-ui/src/components Expand file tree Collapse file tree 9 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 11import { createEffect , createSignal } from 'solid-js'
22import { render } from 'solid-js/web'
3-
43import { JsonTree , ThemeContextProvider } from '@tanstack/devtools-ui'
54
5+ import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
6+
67import './index.css'
78
89const JsonTreeDate = {
@@ -20,7 +21,7 @@ const JsonTreePath = {
2021const darkThemeMq = window . matchMedia ( '(prefers-color-scheme: dark)' )
2122
2223function App ( ) {
23- const [ theme , setTheme ] = createSignal < 'light' | 'dark' > (
24+ const [ theme , setTheme ] = createSignal < TanStackDevtoolsTheme > (
2425 darkThemeMq . matches ? 'dark' : 'light' ,
2526 )
2627
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as goober from 'goober'
22import { useTheme } from '@tanstack/devtools-ui'
33import { createMemo } from 'solid-js'
44
5+ import type { TanStackDevtoolsTheme } from '@tanstack/devtools-ui'
56import type { RuleCategory , SeverityThreshold } from '../types/types'
67
78const SEVERITY_COLORS : Record < SeverityThreshold , string > = {
@@ -49,7 +50,7 @@ const css = goober.css
4950const FONT_SCALE = 1.1
5051const 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' )
Original file line number Diff line number Diff line change 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+ /*
4345export function ChevronDown() {
4446 return (
4547 <svg
@@ -466,7 +468,7 @@ export function Link() {
466468 </ svg >
467469 )
468470}
469- /*
471+ /*
470472
471473export 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+ /*
739741export 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+ /*
888890export function TanstackLogo() {
889891 const id = createUniqueId()
890892 return (
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ import type {
77 TanStackDevtoolsConfig ,
88 TanStackDevtoolsPlugin ,
99 TanStackDevtoolsPluginProps ,
10+ TanStackDevtoolsTheme ,
1011} from '@tanstack/devtools'
1112
1213type PluginRender =
1314 | JSX . Element
1415 | ( ( el : HTMLElement , props : TanStackDevtoolsPluginProps ) => JSX . Element )
1516
1617type TriggerProps = {
17- theme : 'dark' | 'light'
18+ theme : TanStackDevtoolsTheme
1819}
1920
2021type TriggerRender =
Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ import type {
77 TanStackDevtoolsConfig ,
88 TanStackDevtoolsPlugin ,
99 TanStackDevtoolsPluginProps ,
10+ TanStackDevtoolsTheme ,
1011} from '@tanstack/devtools'
1112
1213type PluginRender =
1314 | JSX . Element
1415 | ( ( el : HTMLElement , props : TanStackDevtoolsPluginProps ) => JSX . Element )
1516
1617type TriggerProps = {
17- theme : 'dark' | 'light'
18+ theme : TanStackDevtoolsTheme
1819}
1920
2021type TriggerRender =
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import type {
1313 TanStackDevtoolsConfig ,
1414 TanStackDevtoolsPlugin ,
1515 TanStackDevtoolsPluginProps ,
16+ TanStackDevtoolsTheme ,
1617} from '@tanstack/devtools'
1718
1819type SolidPluginRender =
@@ -76,7 +77,7 @@ export type TanStackDevtoolsSolidPlugin = Omit<
7677 name : string | SolidPluginRender
7778}
7879interface TriggerProps {
79- theme : 'light' | 'dark'
80+ theme : TanStackDevtoolsTheme
8081}
8182export interface TanStackDevtoolsInit {
8283 /**
You can’t perform that action at this time.
0 commit comments