@tanstack/query-devtools 5.0.0-rc.9 → 5.0.0
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.
- package/build/Devtools/{5OOWR6BQ.jsx → 3BAJISSX.jsx} +604 -266
- package/build/Devtools/{CIR3WCBJ.js → 4TNE5QTO.js} +733 -428
- package/build/Devtools/{336SHOD5.jsx → OWSLDUSP.jsx} +604 -266
- package/build/Devtools/{XXDYGLB2.js → YSRICXZI.js} +733 -428
- package/build/dev.cjs +781 -464
- package/build/dev.js +42 -32
- package/build/dev.jsx +42 -32
- package/build/index.cjs +781 -464
- package/build/index.d.cts +1 -14
- package/build/index.d.ts +1 -14
- package/build/index.js +42 -32
- package/build/index.jsx +42 -32
- package/package.json +2 -2
- package/src/Context.ts +9 -0
- package/src/Devtools.tsx +422 -206
- package/src/Explorer.tsx +140 -61
- package/src/icons/index.tsx +118 -19
- package/src/index.tsx +41 -41
- package/src/utils.tsx +17 -0
package/src/Explorer.tsx
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
displayValue,
|
|
10
10
|
updateNestedDataByPath,
|
|
11
11
|
} from './utils'
|
|
12
|
-
import { CopiedCopier, Copier, ErrorCopier, List, Trash } from './icons'
|
|
13
|
-
import { useQueryDevtoolsContext } from './Context'
|
|
12
|
+
import { Check, CopiedCopier, Copier, ErrorCopier, List, Trash } from './icons'
|
|
13
|
+
import { useQueryDevtoolsContext, useTheme } from './Context'
|
|
14
14
|
import type { Query } from '@tanstack/query-core'
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -37,12 +37,15 @@ export function chunkArray<T extends { label: string; value: unknown }>(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const Expander = (props: { expanded: boolean }) => {
|
|
40
|
-
const
|
|
40
|
+
const theme = useTheme()
|
|
41
|
+
const styles = createMemo(() => {
|
|
42
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
43
|
+
})
|
|
41
44
|
|
|
42
45
|
return (
|
|
43
46
|
<span
|
|
44
47
|
class={cx(
|
|
45
|
-
styles.expander,
|
|
48
|
+
styles().expander,
|
|
46
49
|
css`
|
|
47
50
|
transform: rotate(${props.expanded ? 90 : 0}deg);
|
|
48
51
|
`,
|
|
@@ -74,12 +77,15 @@ const Expander = (props: { expanded: boolean }) => {
|
|
|
74
77
|
|
|
75
78
|
type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy'
|
|
76
79
|
const CopyButton = (props: { value: unknown }) => {
|
|
77
|
-
const
|
|
80
|
+
const theme = useTheme()
|
|
81
|
+
const styles = createMemo(() => {
|
|
82
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
83
|
+
})
|
|
78
84
|
const [copyState, setCopyState] = createSignal<CopyState>('NoCopy')
|
|
79
85
|
|
|
80
86
|
return (
|
|
81
87
|
<button
|
|
82
|
-
class={styles.actionButton}
|
|
88
|
+
class={styles().actionButton}
|
|
83
89
|
title="Copy object to clipboard"
|
|
84
90
|
aria-label={`${
|
|
85
91
|
copyState() === 'NoCopy'
|
|
@@ -115,7 +121,7 @@ const CopyButton = (props: { value: unknown }) => {
|
|
|
115
121
|
<Copier />
|
|
116
122
|
</Match>
|
|
117
123
|
<Match when={copyState() === 'SuccessCopy'}>
|
|
118
|
-
<CopiedCopier />
|
|
124
|
+
<CopiedCopier theme={theme()} />
|
|
119
125
|
</Match>
|
|
120
126
|
<Match when={copyState() === 'ErrorCopy'}>
|
|
121
127
|
<ErrorCopier />
|
|
@@ -129,12 +135,15 @@ const ClearArrayButton = (props: {
|
|
|
129
135
|
dataPath: Array<string>
|
|
130
136
|
activeQuery: Query
|
|
131
137
|
}) => {
|
|
132
|
-
const
|
|
138
|
+
const theme = useTheme()
|
|
139
|
+
const styles = createMemo(() => {
|
|
140
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
141
|
+
})
|
|
133
142
|
const queryClient = useQueryDevtoolsContext().client
|
|
134
143
|
|
|
135
144
|
return (
|
|
136
145
|
<button
|
|
137
|
-
class={styles.actionButton}
|
|
146
|
+
class={styles().actionButton}
|
|
138
147
|
title={'Remove all items'}
|
|
139
148
|
aria-label={'Remove all items'}
|
|
140
149
|
onClick={() => {
|
|
@@ -152,12 +161,15 @@ const DeleteItemButton = (props: {
|
|
|
152
161
|
dataPath: Array<string>
|
|
153
162
|
activeQuery: Query
|
|
154
163
|
}) => {
|
|
155
|
-
const
|
|
164
|
+
const theme = useTheme()
|
|
165
|
+
const styles = createMemo(() => {
|
|
166
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
167
|
+
})
|
|
156
168
|
const queryClient = useQueryDevtoolsContext().client
|
|
157
169
|
|
|
158
170
|
return (
|
|
159
171
|
<button
|
|
160
|
-
class={cx(styles.actionButton)}
|
|
172
|
+
class={cx(styles().actionButton)}
|
|
161
173
|
title={'Delete item'}
|
|
162
174
|
aria-label={'Delete item'}
|
|
163
175
|
onClick={() => {
|
|
@@ -171,6 +183,43 @@ const DeleteItemButton = (props: {
|
|
|
171
183
|
)
|
|
172
184
|
}
|
|
173
185
|
|
|
186
|
+
const ToggleValueButton = (props: {
|
|
187
|
+
dataPath: Array<string>
|
|
188
|
+
activeQuery: Query
|
|
189
|
+
value: boolean
|
|
190
|
+
}) => {
|
|
191
|
+
const theme = useTheme()
|
|
192
|
+
const styles = createMemo(() => {
|
|
193
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
194
|
+
})
|
|
195
|
+
const queryClient = useQueryDevtoolsContext().client
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<button
|
|
199
|
+
class={cx(
|
|
200
|
+
styles().actionButton,
|
|
201
|
+
css`
|
|
202
|
+
width: ${tokens.size[3.5]};
|
|
203
|
+
height: ${tokens.size[3.5]};
|
|
204
|
+
`,
|
|
205
|
+
)}
|
|
206
|
+
title={'Toggle value'}
|
|
207
|
+
aria-label={'Toggle value'}
|
|
208
|
+
onClick={() => {
|
|
209
|
+
const oldData = props.activeQuery.state.data
|
|
210
|
+
const newData = updateNestedDataByPath(
|
|
211
|
+
oldData,
|
|
212
|
+
props.dataPath,
|
|
213
|
+
!props.value,
|
|
214
|
+
)
|
|
215
|
+
queryClient.setQueryData(props.activeQuery.queryKey, newData)
|
|
216
|
+
}}
|
|
217
|
+
>
|
|
218
|
+
<Check theme={theme()} checked={props.value} />
|
|
219
|
+
</button>
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
|
|
174
223
|
type ExplorerProps = {
|
|
175
224
|
editable?: boolean
|
|
176
225
|
label: string
|
|
@@ -186,7 +235,10 @@ function isIterable(x: any): x is Iterable<unknown> {
|
|
|
186
235
|
}
|
|
187
236
|
|
|
188
237
|
export default function Explorer(props: ExplorerProps) {
|
|
189
|
-
const
|
|
238
|
+
const theme = useTheme()
|
|
239
|
+
const styles = createMemo(() => {
|
|
240
|
+
return theme() === 'dark' ? darkStyles : lightStyles
|
|
241
|
+
})
|
|
190
242
|
const queryClient = useQueryDevtoolsContext().client
|
|
191
243
|
|
|
192
244
|
const [expanded, setExpanded] = createSignal(
|
|
@@ -247,21 +299,21 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
247
299
|
const currentDataPath = props.dataPath ?? []
|
|
248
300
|
|
|
249
301
|
return (
|
|
250
|
-
<div class={styles.entry}>
|
|
302
|
+
<div class={styles().entry}>
|
|
251
303
|
<Show when={subEntryPages().length}>
|
|
252
|
-
<div class={styles.expanderButtonContainer}>
|
|
304
|
+
<div class={styles().expanderButtonContainer}>
|
|
253
305
|
<button
|
|
254
|
-
class={styles.expanderButton}
|
|
306
|
+
class={styles().expanderButton}
|
|
255
307
|
onClick={() => toggleExpanded()}
|
|
256
308
|
>
|
|
257
309
|
<Expander expanded={expanded()} /> <span>{props.label}</span>{' '}
|
|
258
|
-
<span class={styles.info}>
|
|
310
|
+
<span class={styles().info}>
|
|
259
311
|
{String(type()).toLowerCase() === 'iterable' ? '(Iterable) ' : ''}
|
|
260
312
|
{subEntries().length} {subEntries().length > 1 ? `items` : `item`}
|
|
261
313
|
</span>
|
|
262
314
|
</button>
|
|
263
315
|
<Show when={props.editable}>
|
|
264
|
-
<div class={styles.actions}>
|
|
316
|
+
<div class={styles().actions}>
|
|
265
317
|
<CopyButton value={props.value} />
|
|
266
318
|
|
|
267
319
|
<Show
|
|
@@ -286,7 +338,7 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
286
338
|
</div>
|
|
287
339
|
<Show when={expanded()}>
|
|
288
340
|
<Show when={subEntryPages().length === 1}>
|
|
289
|
-
<div class={styles.subEntry}>
|
|
341
|
+
<div class={styles().subEntry}>
|
|
290
342
|
<Key each={subEntries()} by={(item) => item.label}>
|
|
291
343
|
{(entry) => {
|
|
292
344
|
return (
|
|
@@ -309,11 +361,11 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
309
361
|
</div>
|
|
310
362
|
</Show>
|
|
311
363
|
<Show when={subEntryPages().length > 1}>
|
|
312
|
-
<div class={styles.subEntry}>
|
|
364
|
+
<div class={styles().subEntry}>
|
|
313
365
|
<Index each={subEntryPages()}>
|
|
314
366
|
{(entries, index) => (
|
|
315
367
|
<div>
|
|
316
|
-
<div class={styles.entry}>
|
|
368
|
+
<div class={styles().entry}>
|
|
317
369
|
<button
|
|
318
370
|
onClick={() =>
|
|
319
371
|
setExpandedPages((old) =>
|
|
@@ -322,14 +374,14 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
322
374
|
: [...old, index],
|
|
323
375
|
)
|
|
324
376
|
}
|
|
325
|
-
class={styles.expanderButton}
|
|
377
|
+
class={styles().expanderButton}
|
|
326
378
|
>
|
|
327
379
|
<Expander expanded={expandedPages().includes(index)} />{' '}
|
|
328
380
|
[{index * 100}...
|
|
329
381
|
{index * 100 + 100 - 1}]
|
|
330
382
|
</button>
|
|
331
383
|
<Show when={expandedPages().includes(index)}>
|
|
332
|
-
<div class={styles.subEntry}>
|
|
384
|
+
<div class={styles().subEntry}>
|
|
333
385
|
<Key each={entries()} by={(entry) => entry.label}>
|
|
334
386
|
{(entry) => (
|
|
335
387
|
<Explorer
|
|
@@ -353,36 +405,63 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
353
405
|
</Show>
|
|
354
406
|
</Show>
|
|
355
407
|
<Show when={subEntryPages().length === 0}>
|
|
356
|
-
<div class={styles.row}>
|
|
357
|
-
<span class={styles.label}>{props.label}:</span>
|
|
408
|
+
<div class={styles().row}>
|
|
409
|
+
<span class={styles().label}>{props.label}:</span>
|
|
358
410
|
<Show
|
|
359
411
|
when={
|
|
360
412
|
props.editable &&
|
|
361
413
|
props.activeQuery !== undefined &&
|
|
362
|
-
(type() === 'string' ||
|
|
414
|
+
(type() === 'string' ||
|
|
415
|
+
type() === 'number' ||
|
|
416
|
+
type() === 'boolean')
|
|
363
417
|
}
|
|
364
418
|
fallback={
|
|
365
|
-
<span class={styles.value}>{displayValue(props.value)}</span>
|
|
419
|
+
<span class={styles().value}>{displayValue(props.value)}</span>
|
|
366
420
|
}
|
|
367
421
|
>
|
|
368
|
-
<
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
422
|
+
<Show
|
|
423
|
+
when={
|
|
424
|
+
props.editable &&
|
|
425
|
+
props.activeQuery !== undefined &&
|
|
426
|
+
(type() === 'string' || type() === 'number')
|
|
427
|
+
}
|
|
428
|
+
>
|
|
429
|
+
<input
|
|
430
|
+
type={type() === 'number' ? 'number' : 'text'}
|
|
431
|
+
class={cx(styles().value, styles().editableInput)}
|
|
432
|
+
value={props.value as string | number}
|
|
433
|
+
onChange={(changeEvent) => {
|
|
434
|
+
const oldData = props.activeQuery!.state.data
|
|
435
|
+
|
|
436
|
+
const newData = updateNestedDataByPath(
|
|
437
|
+
oldData,
|
|
438
|
+
currentDataPath,
|
|
439
|
+
type() === 'number'
|
|
440
|
+
? changeEvent.target.valueAsNumber
|
|
441
|
+
: changeEvent.target.value,
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
queryClient.setQueryData(props.activeQuery!.queryKey, newData)
|
|
445
|
+
}}
|
|
446
|
+
/>
|
|
447
|
+
</Show>
|
|
448
|
+
|
|
449
|
+
<Show when={type() === 'boolean'}>
|
|
450
|
+
<span
|
|
451
|
+
class={cx(
|
|
452
|
+
styles().value,
|
|
453
|
+
styles().actions,
|
|
454
|
+
styles().editableInput,
|
|
455
|
+
)}
|
|
456
|
+
>
|
|
457
|
+
<ToggleValueButton
|
|
458
|
+
activeQuery={props.activeQuery!}
|
|
459
|
+
dataPath={currentDataPath}
|
|
460
|
+
value={props.value as boolean}
|
|
461
|
+
/>
|
|
462
|
+
{displayValue(props.value)}
|
|
463
|
+
</span>
|
|
464
|
+
</Show>
|
|
386
465
|
</Show>
|
|
387
466
|
|
|
388
467
|
<Show
|
|
@@ -403,9 +482,9 @@ export default function Explorer(props: ExplorerProps) {
|
|
|
403
482
|
)
|
|
404
483
|
}
|
|
405
484
|
|
|
406
|
-
const
|
|
485
|
+
const stylesFactory = (theme: 'light' | 'dark') => {
|
|
407
486
|
const { colors, font, size, border } = tokens
|
|
408
|
-
|
|
487
|
+
const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
|
|
409
488
|
return {
|
|
410
489
|
entry: css`
|
|
411
490
|
& * {
|
|
@@ -419,7 +498,7 @@ const getStyles = () => {
|
|
|
419
498
|
subEntry: css`
|
|
420
499
|
margin: 0 0 0 0.5em;
|
|
421
500
|
padding-left: 0.75em;
|
|
422
|
-
border-left: 2px solid ${colors.darkGray[400]};
|
|
501
|
+
border-left: 2px solid ${t(colors.gray[300], colors.darkGray[400])};
|
|
423
502
|
/* outline: 1px solid ${colors.teal[400]}; */
|
|
424
503
|
`,
|
|
425
504
|
expander: css`
|
|
@@ -468,21 +547,22 @@ const getStyles = () => {
|
|
|
468
547
|
}
|
|
469
548
|
`,
|
|
470
549
|
info: css`
|
|
471
|
-
color: ${colors.gray[500]};
|
|
550
|
+
color: ${t(colors.gray[500], colors.gray[500])};
|
|
472
551
|
font-size: ${font.size.xs};
|
|
473
552
|
margin-left: ${size[1]};
|
|
474
553
|
/* outline: 1px solid ${colors.yellow[400]}; */
|
|
475
554
|
`,
|
|
476
555
|
label: css`
|
|
477
|
-
color: ${colors.gray[300]};
|
|
556
|
+
color: ${t(colors.gray[700], colors.gray[300])};
|
|
478
557
|
`,
|
|
479
558
|
value: css`
|
|
480
|
-
color: ${colors.purple[400]};
|
|
559
|
+
color: ${t(colors.purple[600], colors.purple[400])};
|
|
481
560
|
flex-grow: 1;
|
|
482
561
|
`,
|
|
483
562
|
actions: css`
|
|
484
563
|
display: inline-flex;
|
|
485
564
|
gap: ${size[2]};
|
|
565
|
+
align-items: center;
|
|
486
566
|
`,
|
|
487
567
|
row: css`
|
|
488
568
|
display: inline-flex;
|
|
@@ -490,19 +570,22 @@ const getStyles = () => {
|
|
|
490
570
|
width: 100%;
|
|
491
571
|
margin-bottom: ${size[0.5]};
|
|
492
572
|
line-height: 1.125rem;
|
|
573
|
+
align-items: center;
|
|
493
574
|
`,
|
|
494
575
|
editableInput: css`
|
|
495
576
|
border: none;
|
|
496
|
-
padding:
|
|
577
|
+
padding: ${size[0.5]} ${size[1]} ${size[0.5]} ${size[1.5]};
|
|
497
578
|
flex-grow: 1;
|
|
498
|
-
|
|
579
|
+
border-radius: ${border.radius.xs};
|
|
580
|
+
background-color: ${t(colors.gray[200], colors.darkGray[500])};
|
|
499
581
|
|
|
500
582
|
&:hover {
|
|
501
|
-
background-color: ${colors.gray[
|
|
583
|
+
background-color: ${t(colors.gray[300], colors.darkGray[600])};
|
|
502
584
|
}
|
|
503
585
|
`,
|
|
504
586
|
actionButton: css`
|
|
505
587
|
background-color: transparent;
|
|
588
|
+
color: ${t(colors.gray[500], colors.gray[500])};
|
|
506
589
|
border: none;
|
|
507
590
|
display: inline-flex;
|
|
508
591
|
padding: 0px;
|
|
@@ -515,14 +598,7 @@ const getStyles = () => {
|
|
|
515
598
|
z-index: 1;
|
|
516
599
|
|
|
517
600
|
&:hover svg {
|
|
518
|
-
.
|
|
519
|
-
.list {
|
|
520
|
-
stroke: ${colors.gray[500]} !important;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
.list-item {
|
|
524
|
-
stroke: ${colors.gray[700]};
|
|
525
|
-
}
|
|
601
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
526
602
|
}
|
|
527
603
|
|
|
528
604
|
&:focus-visible {
|
|
@@ -533,3 +609,6 @@ const getStyles = () => {
|
|
|
533
609
|
`,
|
|
534
610
|
}
|
|
535
611
|
}
|
|
612
|
+
|
|
613
|
+
const lightStyles = stylesFactory('light')
|
|
614
|
+
const darkStyles = stylesFactory('dark')
|
package/src/icons/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Show } from 'solid-js'
|
|
2
2
|
|
|
3
3
|
export function Search() {
|
|
4
4
|
return (
|
|
@@ -11,7 +11,7 @@ export function Search() {
|
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
13
|
d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"
|
|
14
|
-
stroke="
|
|
14
|
+
stroke="currentColor"
|
|
15
15
|
stroke-width="1.66667"
|
|
16
16
|
stroke-linecap="round"
|
|
17
17
|
stroke-linejoin="round"
|
|
@@ -31,8 +31,8 @@ export function Trash() {
|
|
|
31
31
|
>
|
|
32
32
|
<path
|
|
33
33
|
d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"
|
|
34
|
-
stroke="
|
|
35
|
-
stroke-width="
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
stroke-width="2"
|
|
36
36
|
stroke-linecap="round"
|
|
37
37
|
stroke-linejoin="round"
|
|
38
38
|
/>
|
|
@@ -51,7 +51,7 @@ export function ChevronDown() {
|
|
|
51
51
|
>
|
|
52
52
|
<path
|
|
53
53
|
d="M1 1L5 5L9 1"
|
|
54
|
-
stroke="
|
|
54
|
+
stroke="currentColor"
|
|
55
55
|
stroke-width="1.66667"
|
|
56
56
|
stroke-linecap="round"
|
|
57
57
|
stroke-linejoin="round"
|
|
@@ -71,7 +71,7 @@ export function ArrowUp() {
|
|
|
71
71
|
>
|
|
72
72
|
<path
|
|
73
73
|
d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"
|
|
74
|
-
stroke="
|
|
74
|
+
stroke="currentColor"
|
|
75
75
|
stroke-width="1.66667"
|
|
76
76
|
stroke-linecap="round"
|
|
77
77
|
stroke-linejoin="round"
|
|
@@ -91,7 +91,7 @@ export function ArrowDown() {
|
|
|
91
91
|
>
|
|
92
92
|
<path
|
|
93
93
|
d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"
|
|
94
|
-
stroke="
|
|
94
|
+
stroke="currentColor"
|
|
95
95
|
stroke-width="1.66667"
|
|
96
96
|
stroke-linecap="round"
|
|
97
97
|
stroke-linejoin="round"
|
|
@@ -114,7 +114,7 @@ export function ArrowLeft() {
|
|
|
114
114
|
>
|
|
115
115
|
<path
|
|
116
116
|
d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"
|
|
117
|
-
stroke="
|
|
117
|
+
stroke="currentColor"
|
|
118
118
|
stroke-width="1.66667"
|
|
119
119
|
stroke-linecap="round"
|
|
120
120
|
stroke-linejoin="round"
|
|
@@ -137,7 +137,7 @@ export function ArrowRight() {
|
|
|
137
137
|
>
|
|
138
138
|
<path
|
|
139
139
|
d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"
|
|
140
|
-
stroke="
|
|
140
|
+
stroke="currentColor"
|
|
141
141
|
stroke-width="1.66667"
|
|
142
142
|
stroke-linecap="round"
|
|
143
143
|
stroke-linejoin="round"
|
|
@@ -146,11 +146,71 @@ export function ArrowRight() {
|
|
|
146
146
|
)
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
export function Sun() {
|
|
150
|
+
return (
|
|
151
|
+
<svg
|
|
152
|
+
viewBox="0 0 24 24"
|
|
153
|
+
height="12"
|
|
154
|
+
width="12"
|
|
155
|
+
fill="none"
|
|
156
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
157
|
+
>
|
|
158
|
+
<path
|
|
159
|
+
d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"
|
|
160
|
+
stroke="currentColor"
|
|
161
|
+
stroke-width="2"
|
|
162
|
+
stroke-linecap="round"
|
|
163
|
+
stroke-linejoin="round"
|
|
164
|
+
></path>
|
|
165
|
+
</svg>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function Moon() {
|
|
170
|
+
return (
|
|
171
|
+
<svg
|
|
172
|
+
viewBox="0 0 24 24"
|
|
173
|
+
height="12"
|
|
174
|
+
width="12"
|
|
175
|
+
fill="none"
|
|
176
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
177
|
+
>
|
|
178
|
+
<path
|
|
179
|
+
d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"
|
|
180
|
+
stroke="currentColor"
|
|
181
|
+
stroke-width="2"
|
|
182
|
+
stroke-linecap="round"
|
|
183
|
+
stroke-linejoin="round"
|
|
184
|
+
></path>
|
|
185
|
+
</svg>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function Monitor() {
|
|
190
|
+
return (
|
|
191
|
+
<svg
|
|
192
|
+
viewBox="0 0 24 24"
|
|
193
|
+
height="12"
|
|
194
|
+
width="12"
|
|
195
|
+
fill="none"
|
|
196
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
197
|
+
>
|
|
198
|
+
<path
|
|
199
|
+
d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"
|
|
200
|
+
stroke="currentColor"
|
|
201
|
+
stroke-width="2"
|
|
202
|
+
stroke-linecap="round"
|
|
203
|
+
stroke-linejoin="round"
|
|
204
|
+
></path>
|
|
205
|
+
</svg>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
|
|
149
209
|
export function Wifi() {
|
|
150
210
|
return (
|
|
151
211
|
<svg
|
|
152
|
-
stroke="
|
|
153
|
-
fill="
|
|
212
|
+
stroke="currentColor"
|
|
213
|
+
fill="currentColor"
|
|
154
214
|
stroke-width="0"
|
|
155
215
|
viewBox="0 0 24 24"
|
|
156
216
|
height="1em"
|
|
@@ -166,8 +226,6 @@ export function Wifi() {
|
|
|
166
226
|
export function Offline() {
|
|
167
227
|
return (
|
|
168
228
|
<svg
|
|
169
|
-
stroke={tokens.colors.yellow[500]}
|
|
170
|
-
fill={tokens.colors.yellow[500]}
|
|
171
229
|
stroke-width="0"
|
|
172
230
|
viewBox="0 0 24 24"
|
|
173
231
|
height="1em"
|
|
@@ -194,14 +252,14 @@ export function Settings() {
|
|
|
194
252
|
>
|
|
195
253
|
<path
|
|
196
254
|
d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"
|
|
197
|
-
stroke="
|
|
255
|
+
stroke="currentColor"
|
|
198
256
|
stroke-width="2"
|
|
199
257
|
stroke-linecap="round"
|
|
200
258
|
stroke-linejoin="round"
|
|
201
259
|
/>
|
|
202
260
|
<path
|
|
203
261
|
d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"
|
|
204
|
-
stroke="
|
|
262
|
+
stroke="currentColor"
|
|
205
263
|
stroke-width="2"
|
|
206
264
|
stroke-linecap="round"
|
|
207
265
|
stroke-linejoin="round"
|
|
@@ -225,13 +283,13 @@ export function Copier() {
|
|
|
225
283
|
stroke-width="2"
|
|
226
284
|
stroke-linecap="round"
|
|
227
285
|
stroke-linejoin="round"
|
|
228
|
-
stroke="
|
|
286
|
+
stroke="currentColor"
|
|
229
287
|
/>
|
|
230
288
|
</svg>
|
|
231
289
|
)
|
|
232
290
|
}
|
|
233
291
|
|
|
234
|
-
export function CopiedCopier() {
|
|
292
|
+
export function CopiedCopier(props: { theme: 'light' | 'dark' }) {
|
|
235
293
|
return (
|
|
236
294
|
<svg
|
|
237
295
|
width="24"
|
|
@@ -242,7 +300,7 @@ export function CopiedCopier() {
|
|
|
242
300
|
>
|
|
243
301
|
<path
|
|
244
302
|
d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"
|
|
245
|
-
stroke=
|
|
303
|
+
stroke={props.theme === 'dark' ? '#12B76A' : '#027A48'}
|
|
246
304
|
stroke-width="2"
|
|
247
305
|
stroke-linecap="round"
|
|
248
306
|
stroke-linejoin="round"
|
|
@@ -278,7 +336,7 @@ export function List() {
|
|
|
278
336
|
height="24"
|
|
279
337
|
viewBox="0 0 24 24"
|
|
280
338
|
fill="none"
|
|
281
|
-
stroke="
|
|
339
|
+
stroke="currentColor"
|
|
282
340
|
stroke-width="2"
|
|
283
341
|
xmlns="http://www.w3.org/2000/svg"
|
|
284
342
|
>
|
|
@@ -290,6 +348,47 @@ export function List() {
|
|
|
290
348
|
)
|
|
291
349
|
}
|
|
292
350
|
|
|
351
|
+
export function Check(props: { checked: boolean; theme: 'light' | 'dark' }) {
|
|
352
|
+
return (
|
|
353
|
+
<>
|
|
354
|
+
<Show when={props.checked}>
|
|
355
|
+
<svg
|
|
356
|
+
width="24"
|
|
357
|
+
height="24"
|
|
358
|
+
viewBox="0 0 24 24"
|
|
359
|
+
fill="none"
|
|
360
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
361
|
+
>
|
|
362
|
+
<path
|
|
363
|
+
d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"
|
|
364
|
+
stroke={props.theme === 'dark' ? '#9B8AFB' : '#6938EF'}
|
|
365
|
+
stroke-width="2"
|
|
366
|
+
stroke-linecap="round"
|
|
367
|
+
stroke-linejoin="round"
|
|
368
|
+
/>
|
|
369
|
+
</svg>
|
|
370
|
+
</Show>
|
|
371
|
+
<Show when={!props.checked}>
|
|
372
|
+
<svg
|
|
373
|
+
viewBox="0 0 24 24"
|
|
374
|
+
height="20"
|
|
375
|
+
width="20"
|
|
376
|
+
fill="none"
|
|
377
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
378
|
+
>
|
|
379
|
+
<path
|
|
380
|
+
d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"
|
|
381
|
+
stroke={props.theme === 'dark' ? '#9B8AFB' : '#6938EF'}
|
|
382
|
+
stroke-width="2"
|
|
383
|
+
stroke-linecap="round"
|
|
384
|
+
stroke-linejoin="round"
|
|
385
|
+
></path>
|
|
386
|
+
</svg>
|
|
387
|
+
</Show>
|
|
388
|
+
</>
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
|
|
293
392
|
export function TanstackLogo() {
|
|
294
393
|
return (
|
|
295
394
|
<svg version="1.0" viewBox="0 0 633 633">
|