@tanstack/router-devtools 1.16.6 → 1.17.1
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/dist/cjs/Explorer.cjs +152 -92
- package/dist/cjs/Explorer.cjs.map +1 -1
- package/dist/cjs/Explorer.d.cts +0 -7
- package/dist/cjs/devtools.cjs +924 -905
- package/dist/cjs/devtools.cjs.map +1 -1
- package/dist/cjs/logo.cjs +1012 -0
- package/dist/cjs/logo.cjs.map +1 -0
- package/dist/cjs/logo.d.cts +2 -0
- package/dist/cjs/tokens.cjs +302 -0
- package/dist/cjs/tokens.cjs.map +1 -0
- package/dist/cjs/tokens.d.cts +298 -0
- package/dist/cjs/utils.cjs +5 -33
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/cjs/utils.d.cts +2 -2
- package/dist/esm/Explorer.d.ts +0 -7
- package/dist/esm/Explorer.js +153 -93
- package/dist/esm/Explorer.js.map +1 -1
- package/dist/esm/devtools.js +924 -905
- package/dist/esm/devtools.js.map +1 -1
- package/dist/esm/logo.d.ts +2 -0
- package/dist/esm/logo.js +1012 -0
- package/dist/esm/logo.js.map +1 -0
- package/dist/esm/tokens.d.ts +298 -0
- package/dist/esm/tokens.js +302 -0
- package/dist/esm/tokens.js.map +1 -0
- package/dist/esm/utils.d.ts +2 -2
- package/dist/esm/utils.js +5 -33
- package/dist/esm/utils.js.map +1 -1
- package/package.json +5 -2
- package/src/Explorer.tsx +155 -93
- package/src/devtools.tsx +974 -860
- package/src/logo.tsx +817 -0
- package/src/tokens.ts +305 -0
- package/src/utils.ts +12 -11
- package/dist/cjs/styledComponents.cjs +0 -93
- package/dist/cjs/styledComponents.cjs.map +0 -1
- package/dist/cjs/styledComponents.d.cts +0 -7
- package/dist/cjs/theme.cjs +0 -28
- package/dist/cjs/theme.cjs.map +0 -1
- package/dist/cjs/useMediaQuery.cjs +0 -27
- package/dist/cjs/useMediaQuery.cjs.map +0 -1
- package/dist/esm/styledComponents.d.ts +0 -7
- package/dist/esm/styledComponents.js +0 -93
- package/dist/esm/styledComponents.js.map +0 -1
- package/dist/esm/theme.js +0 -28
- package/dist/esm/theme.js.map +0 -1
- package/dist/esm/useMediaQuery.js +0 -28
- package/dist/esm/useMediaQuery.js.map +0 -1
- package/src/styledComponents.ts +0 -106
package/src/tokens.ts
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
export const tokens = {
|
|
2
|
+
colors: {
|
|
3
|
+
inherit: 'inherit',
|
|
4
|
+
current: 'currentColor',
|
|
5
|
+
transparent: 'transparent',
|
|
6
|
+
black: '#000000',
|
|
7
|
+
white: '#ffffff',
|
|
8
|
+
neutral: {
|
|
9
|
+
50: '#f9fafb',
|
|
10
|
+
100: '#f2f4f7',
|
|
11
|
+
200: '#eaecf0',
|
|
12
|
+
300: '#d0d5dd',
|
|
13
|
+
400: '#98a2b3',
|
|
14
|
+
500: '#667085',
|
|
15
|
+
600: '#475467',
|
|
16
|
+
700: '#344054',
|
|
17
|
+
800: '#1d2939',
|
|
18
|
+
900: '#101828',
|
|
19
|
+
},
|
|
20
|
+
darkGray: {
|
|
21
|
+
50: '#525c7a',
|
|
22
|
+
100: '#49536e',
|
|
23
|
+
200: '#414962',
|
|
24
|
+
300: '#394056',
|
|
25
|
+
400: '#313749',
|
|
26
|
+
500: '#292e3d',
|
|
27
|
+
600: '#212530',
|
|
28
|
+
700: '#191c24',
|
|
29
|
+
800: '#111318',
|
|
30
|
+
900: '#0b0d10',
|
|
31
|
+
},
|
|
32
|
+
gray: {
|
|
33
|
+
50: '#f9fafb',
|
|
34
|
+
100: '#f2f4f7',
|
|
35
|
+
200: '#eaecf0',
|
|
36
|
+
300: '#d0d5dd',
|
|
37
|
+
400: '#98a2b3',
|
|
38
|
+
500: '#667085',
|
|
39
|
+
600: '#475467',
|
|
40
|
+
700: '#344054',
|
|
41
|
+
800: '#1d2939',
|
|
42
|
+
900: '#101828',
|
|
43
|
+
},
|
|
44
|
+
blue: {
|
|
45
|
+
25: '#F5FAFF',
|
|
46
|
+
50: '#EFF8FF',
|
|
47
|
+
100: '#D1E9FF',
|
|
48
|
+
200: '#B2DDFF',
|
|
49
|
+
300: '#84CAFF',
|
|
50
|
+
400: '#53B1FD',
|
|
51
|
+
500: '#2E90FA',
|
|
52
|
+
600: '#1570EF',
|
|
53
|
+
700: '#175CD3',
|
|
54
|
+
800: '#1849A9',
|
|
55
|
+
900: '#194185',
|
|
56
|
+
},
|
|
57
|
+
green: {
|
|
58
|
+
25: '#F6FEF9',
|
|
59
|
+
50: '#ECFDF3',
|
|
60
|
+
100: '#D1FADF',
|
|
61
|
+
200: '#A6F4C5',
|
|
62
|
+
300: '#6CE9A6',
|
|
63
|
+
400: '#32D583',
|
|
64
|
+
500: '#12B76A',
|
|
65
|
+
600: '#039855',
|
|
66
|
+
700: '#027A48',
|
|
67
|
+
800: '#05603A',
|
|
68
|
+
900: '#054F31',
|
|
69
|
+
},
|
|
70
|
+
red: {
|
|
71
|
+
50: '#fef2f2',
|
|
72
|
+
100: '#fee2e2',
|
|
73
|
+
200: '#fecaca',
|
|
74
|
+
300: '#fca5a5',
|
|
75
|
+
400: '#f87171',
|
|
76
|
+
500: '#ef4444',
|
|
77
|
+
600: '#dc2626',
|
|
78
|
+
700: '#b91c1c',
|
|
79
|
+
800: '#991b1b',
|
|
80
|
+
900: '#7f1d1d',
|
|
81
|
+
950: '#450a0a',
|
|
82
|
+
},
|
|
83
|
+
yellow: {
|
|
84
|
+
25: '#FFFCF5',
|
|
85
|
+
50: '#FFFAEB',
|
|
86
|
+
100: '#FEF0C7',
|
|
87
|
+
200: '#FEDF89',
|
|
88
|
+
300: '#FEC84B',
|
|
89
|
+
400: '#FDB022',
|
|
90
|
+
500: '#F79009',
|
|
91
|
+
600: '#DC6803',
|
|
92
|
+
700: '#B54708',
|
|
93
|
+
800: '#93370D',
|
|
94
|
+
900: '#7A2E0E',
|
|
95
|
+
},
|
|
96
|
+
purple: {
|
|
97
|
+
25: '#FAFAFF',
|
|
98
|
+
50: '#F4F3FF',
|
|
99
|
+
100: '#EBE9FE',
|
|
100
|
+
200: '#D9D6FE',
|
|
101
|
+
300: '#BDB4FE',
|
|
102
|
+
400: '#9B8AFB',
|
|
103
|
+
500: '#7A5AF8',
|
|
104
|
+
600: '#6938EF',
|
|
105
|
+
700: '#5925DC',
|
|
106
|
+
800: '#4A1FB8',
|
|
107
|
+
900: '#3E1C96',
|
|
108
|
+
},
|
|
109
|
+
teal: {
|
|
110
|
+
25: '#F6FEFC',
|
|
111
|
+
50: '#F0FDF9',
|
|
112
|
+
100: '#CCFBEF',
|
|
113
|
+
200: '#99F6E0',
|
|
114
|
+
300: '#5FE9D0',
|
|
115
|
+
400: '#2ED3B7',
|
|
116
|
+
500: '#15B79E',
|
|
117
|
+
600: '#0E9384',
|
|
118
|
+
700: '#107569',
|
|
119
|
+
800: '#125D56',
|
|
120
|
+
900: '#134E48',
|
|
121
|
+
},
|
|
122
|
+
pink: {
|
|
123
|
+
25: '#fdf2f8',
|
|
124
|
+
50: '#fce7f3',
|
|
125
|
+
100: '#fbcfe8',
|
|
126
|
+
200: '#f9a8d4',
|
|
127
|
+
300: '#f472b6',
|
|
128
|
+
400: '#ec4899',
|
|
129
|
+
500: '#db2777',
|
|
130
|
+
600: '#be185d',
|
|
131
|
+
700: '#9d174d',
|
|
132
|
+
800: '#831843',
|
|
133
|
+
900: '#500724',
|
|
134
|
+
},
|
|
135
|
+
cyan: {
|
|
136
|
+
25: '#ecfeff',
|
|
137
|
+
50: '#cffafe',
|
|
138
|
+
100: '#a5f3fc',
|
|
139
|
+
200: '#67e8f9',
|
|
140
|
+
300: '#22d3ee',
|
|
141
|
+
400: '#06b6d4',
|
|
142
|
+
500: '#0891b2',
|
|
143
|
+
600: '#0e7490',
|
|
144
|
+
700: '#155e75',
|
|
145
|
+
800: '#164e63',
|
|
146
|
+
900: '#083344',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
alpha: {
|
|
150
|
+
100: 'ff',
|
|
151
|
+
90: 'e5',
|
|
152
|
+
80: 'cc',
|
|
153
|
+
70: 'b3',
|
|
154
|
+
60: '99',
|
|
155
|
+
50: '80',
|
|
156
|
+
40: '66',
|
|
157
|
+
30: '4d',
|
|
158
|
+
20: '33',
|
|
159
|
+
10: '1a',
|
|
160
|
+
0: '00',
|
|
161
|
+
},
|
|
162
|
+
font: {
|
|
163
|
+
size: {
|
|
164
|
+
'2xs': 'calc(var(--tsrd-font-size) * 0.625)',
|
|
165
|
+
xs: 'calc(var(--tsrd-font-size) * 0.75)',
|
|
166
|
+
sm: 'calc(var(--tsrd-font-size) * 0.875)',
|
|
167
|
+
md: 'var(--tsrd-font-size)',
|
|
168
|
+
lg: 'calc(var(--tsrd-font-size) * 1.125)',
|
|
169
|
+
xl: 'calc(var(--tsrd-font-size) * 1.25)',
|
|
170
|
+
'2xl': 'calc(var(--tsrd-font-size) * 1.5)',
|
|
171
|
+
'3xl': 'calc(var(--tsrd-font-size) * 1.875)',
|
|
172
|
+
'4xl': 'calc(var(--tsrd-font-size) * 2.25)',
|
|
173
|
+
'5xl': 'calc(var(--tsrd-font-size) * 3)',
|
|
174
|
+
'6xl': 'calc(var(--tsrd-font-size) * 3.75)',
|
|
175
|
+
'7xl': 'calc(var(--tsrd-font-size) * 4.5)',
|
|
176
|
+
'8xl': 'calc(var(--tsrd-font-size) * 6)',
|
|
177
|
+
'9xl': 'calc(var(--tsrd-font-size) * 8)',
|
|
178
|
+
},
|
|
179
|
+
lineHeight: {
|
|
180
|
+
'3xs': 'calc(var(--tsrd-font-size) * 0.75)',
|
|
181
|
+
'2xs': 'calc(var(--tsrd-font-size) * 0.875)',
|
|
182
|
+
xs: 'calc(var(--tsrd-font-size) * 1)',
|
|
183
|
+
sm: 'calc(var(--tsrd-font-size) * 1.25)',
|
|
184
|
+
md: 'calc(var(--tsrd-font-size) * 1.5)',
|
|
185
|
+
lg: 'calc(var(--tsrd-font-size) * 1.75)',
|
|
186
|
+
xl: 'calc(var(--tsrd-font-size) * 2)',
|
|
187
|
+
'2xl': 'calc(var(--tsrd-font-size) * 2.25)',
|
|
188
|
+
'3xl': 'calc(var(--tsrd-font-size) * 2.5)',
|
|
189
|
+
'4xl': 'calc(var(--tsrd-font-size) * 2.75)',
|
|
190
|
+
'5xl': 'calc(var(--tsrd-font-size) * 3)',
|
|
191
|
+
'6xl': 'calc(var(--tsrd-font-size) * 3.25)',
|
|
192
|
+
'7xl': 'calc(var(--tsrd-font-size) * 3.5)',
|
|
193
|
+
'8xl': 'calc(var(--tsrd-font-size) * 3.75)',
|
|
194
|
+
'9xl': 'calc(var(--tsrd-font-size) * 4)',
|
|
195
|
+
},
|
|
196
|
+
weight: {
|
|
197
|
+
thin: '100',
|
|
198
|
+
extralight: '200',
|
|
199
|
+
light: '300',
|
|
200
|
+
normal: '400',
|
|
201
|
+
medium: '500',
|
|
202
|
+
semibold: '600',
|
|
203
|
+
bold: '700',
|
|
204
|
+
extrabold: '800',
|
|
205
|
+
black: '900',
|
|
206
|
+
},
|
|
207
|
+
fontFamily: {
|
|
208
|
+
sans: 'ui-sans-serif, Inter, system-ui, sans-serif, sans-serif',
|
|
209
|
+
mono: `ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace`,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
breakpoints: {
|
|
213
|
+
xs: '320px',
|
|
214
|
+
sm: '640px',
|
|
215
|
+
md: '768px',
|
|
216
|
+
lg: '1024px',
|
|
217
|
+
xl: '1280px',
|
|
218
|
+
'2xl': '1536px',
|
|
219
|
+
},
|
|
220
|
+
border: {
|
|
221
|
+
radius: {
|
|
222
|
+
none: '0px',
|
|
223
|
+
xs: 'calc(var(--tsrd-font-size) * 0.125)',
|
|
224
|
+
sm: 'calc(var(--tsrd-font-size) * 0.25)',
|
|
225
|
+
md: 'calc(var(--tsrd-font-size) * 0.375)',
|
|
226
|
+
lg: 'calc(var(--tsrd-font-size) * 0.5)',
|
|
227
|
+
xl: 'calc(var(--tsrd-font-size) * 0.75)',
|
|
228
|
+
'2xl': 'calc(var(--tsrd-font-size) * 1)',
|
|
229
|
+
'3xl': 'calc(var(--tsrd-font-size) * 1.5)',
|
|
230
|
+
full: '9999px',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
size: {
|
|
234
|
+
0: '0px',
|
|
235
|
+
0.25: 'calc(var(--tsrd-font-size) * 0.0625)',
|
|
236
|
+
0.5: 'calc(var(--tsrd-font-size) * 0.125)',
|
|
237
|
+
1: 'calc(var(--tsrd-font-size) * 0.25)',
|
|
238
|
+
1.5: 'calc(var(--tsrd-font-size) * 0.375)',
|
|
239
|
+
2: 'calc(var(--tsrd-font-size) * 0.5)',
|
|
240
|
+
2.5: 'calc(var(--tsrd-font-size) * 0.625)',
|
|
241
|
+
3: 'calc(var(--tsrd-font-size) * 0.75)',
|
|
242
|
+
3.5: 'calc(var(--tsrd-font-size) * 0.875)',
|
|
243
|
+
4: 'calc(var(--tsrd-font-size) * 1)',
|
|
244
|
+
4.5: 'calc(var(--tsrd-font-size) * 1.125)',
|
|
245
|
+
5: 'calc(var(--tsrd-font-size) * 1.25)',
|
|
246
|
+
5.5: 'calc(var(--tsrd-font-size) * 1.375)',
|
|
247
|
+
6: 'calc(var(--tsrd-font-size) * 1.5)',
|
|
248
|
+
6.5: 'calc(var(--tsrd-font-size) * 1.625)',
|
|
249
|
+
7: 'calc(var(--tsrd-font-size) * 1.75)',
|
|
250
|
+
8: 'calc(var(--tsrd-font-size) * 2)',
|
|
251
|
+
9: 'calc(var(--tsrd-font-size) * 2.25)',
|
|
252
|
+
10: 'calc(var(--tsrd-font-size) * 2.5)',
|
|
253
|
+
11: 'calc(var(--tsrd-font-size) * 2.75)',
|
|
254
|
+
12: 'calc(var(--tsrd-font-size) * 3)',
|
|
255
|
+
14: 'calc(var(--tsrd-font-size) * 3.5)',
|
|
256
|
+
16: 'calc(var(--tsrd-font-size) * 4)',
|
|
257
|
+
20: 'calc(var(--tsrd-font-size) * 5)',
|
|
258
|
+
24: 'calc(var(--tsrd-font-size) * 6)',
|
|
259
|
+
28: 'calc(var(--tsrd-font-size) * 7)',
|
|
260
|
+
32: 'calc(var(--tsrd-font-size) * 8)',
|
|
261
|
+
36: 'calc(var(--tsrd-font-size) * 9)',
|
|
262
|
+
40: 'calc(var(--tsrd-font-size) * 10)',
|
|
263
|
+
44: 'calc(var(--tsrd-font-size) * 11)',
|
|
264
|
+
48: 'calc(var(--tsrd-font-size) * 12)',
|
|
265
|
+
52: 'calc(var(--tsrd-font-size) * 13)',
|
|
266
|
+
56: 'calc(var(--tsrd-font-size) * 14)',
|
|
267
|
+
60: 'calc(var(--tsrd-font-size) * 15)',
|
|
268
|
+
64: 'calc(var(--tsrd-font-size) * 16)',
|
|
269
|
+
72: 'calc(var(--tsrd-font-size) * 18)',
|
|
270
|
+
80: 'calc(var(--tsrd-font-size) * 20)',
|
|
271
|
+
96: 'calc(var(--tsrd-font-size) * 24)',
|
|
272
|
+
},
|
|
273
|
+
shadow: {
|
|
274
|
+
xs: (_: string = 'rgb(0 0 0 / 0.1)') =>
|
|
275
|
+
`0 1px 2px 0 rgb(0 0 0 / 0.05)` as const,
|
|
276
|
+
sm: (color: string = 'rgb(0 0 0 / 0.1)') =>
|
|
277
|
+
`0 1px 3px 0 ${color}, 0 1px 2px -1px ${color}` as const,
|
|
278
|
+
md: (color: string = 'rgb(0 0 0 / 0.1)') =>
|
|
279
|
+
`0 4px 6px -1px ${color}, 0 2px 4px -2px ${color}` as const,
|
|
280
|
+
lg: (color: string = 'rgb(0 0 0 / 0.1)') =>
|
|
281
|
+
`0 10px 15px -3px ${color}, 0 4px 6px -4px ${color}` as const,
|
|
282
|
+
xl: (color: string = 'rgb(0 0 0 / 0.1)') =>
|
|
283
|
+
`0 20px 25px -5px ${color}, 0 8px 10px -6px ${color}` as const,
|
|
284
|
+
'2xl': (color: string = 'rgb(0 0 0 / 0.25)') =>
|
|
285
|
+
`0 25px 50px -12px ${color}` as const,
|
|
286
|
+
inner: (color: string = 'rgb(0 0 0 / 0.05)') =>
|
|
287
|
+
`inset 0 2px 4px 0 ${color}` as const,
|
|
288
|
+
none: () => `none` as const,
|
|
289
|
+
},
|
|
290
|
+
zIndices: {
|
|
291
|
+
hide: -1,
|
|
292
|
+
auto: 'auto',
|
|
293
|
+
base: 0,
|
|
294
|
+
docked: 10,
|
|
295
|
+
dropdown: 1000,
|
|
296
|
+
sticky: 1100,
|
|
297
|
+
banner: 1200,
|
|
298
|
+
overlay: 1300,
|
|
299
|
+
modal: 1400,
|
|
300
|
+
popover: 1500,
|
|
301
|
+
skipLink: 1600,
|
|
302
|
+
toast: 1700,
|
|
303
|
+
tooltip: 1800,
|
|
304
|
+
},
|
|
305
|
+
} as const
|
package/src/utils.ts
CHANGED
|
@@ -25,24 +25,25 @@ type StyledComponent<T> = T extends 'button'
|
|
|
25
25
|
? React.HTMLAttributes<HTMLElementTagNameMap[T]>
|
|
26
26
|
: never
|
|
27
27
|
|
|
28
|
-
export function getStatusColor(match: AnyRouteMatch
|
|
29
|
-
return match.status === '
|
|
30
|
-
?
|
|
31
|
-
: match.status === '
|
|
32
|
-
?
|
|
33
|
-
: match.status === '
|
|
34
|
-
?
|
|
35
|
-
:
|
|
28
|
+
export function getStatusColor(match: AnyRouteMatch) {
|
|
29
|
+
return match.status === 'success' && match.isFetching
|
|
30
|
+
? 'blue'
|
|
31
|
+
: match.status === 'pending'
|
|
32
|
+
? 'yellow'
|
|
33
|
+
: match.status === 'error'
|
|
34
|
+
? 'red'
|
|
35
|
+
: match.status === 'success'
|
|
36
|
+
? 'green'
|
|
37
|
+
: 'gray'
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export function getRouteStatusColor(
|
|
39
41
|
matches: AnyRouteMatch[],
|
|
40
42
|
route: AnyRoute | AnyRootRoute,
|
|
41
|
-
theme: Theme,
|
|
42
43
|
) {
|
|
43
44
|
const found = matches.find((d) => d.routeId === route.id)
|
|
44
|
-
if (!found) return
|
|
45
|
-
return getStatusColor(found
|
|
45
|
+
if (!found) return 'gray'
|
|
46
|
+
return getStatusColor(found)
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
type Styles =
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils = require("./utils.cjs");
|
|
4
|
-
const Panel = utils.styled(
|
|
5
|
-
"div",
|
|
6
|
-
(_props, theme) => ({
|
|
7
|
-
fontSize: "clamp(12px, 1.5vw, 14px)",
|
|
8
|
-
fontFamily: `sans-serif`,
|
|
9
|
-
display: "flex",
|
|
10
|
-
backgroundColor: theme.background,
|
|
11
|
-
color: theme.foreground
|
|
12
|
-
}),
|
|
13
|
-
{
|
|
14
|
-
"(max-width: 700px)": {
|
|
15
|
-
flexDirection: "column"
|
|
16
|
-
},
|
|
17
|
-
"(max-width: 600px)": {
|
|
18
|
-
fontSize: ".9em"
|
|
19
|
-
// flexDirection: 'column',
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
const ActivePanel = utils.styled(
|
|
24
|
-
"div",
|
|
25
|
-
() => ({
|
|
26
|
-
flex: "1 1 500px",
|
|
27
|
-
display: "flex",
|
|
28
|
-
flexDirection: "column",
|
|
29
|
-
overflow: "auto",
|
|
30
|
-
height: "100%"
|
|
31
|
-
}),
|
|
32
|
-
{
|
|
33
|
-
"(max-width: 700px)": (_props, theme) => ({
|
|
34
|
-
borderTop: `2px solid ${theme.gray}`
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
const Button = utils.styled("button", (props, theme) => ({
|
|
39
|
-
appearance: "none",
|
|
40
|
-
fontSize: ".9em",
|
|
41
|
-
fontWeight: "bold",
|
|
42
|
-
background: theme.gray,
|
|
43
|
-
border: "0",
|
|
44
|
-
borderRadius: ".3em",
|
|
45
|
-
color: "white",
|
|
46
|
-
padding: ".5em",
|
|
47
|
-
opacity: props.disabled ? ".5" : void 0,
|
|
48
|
-
cursor: "pointer"
|
|
49
|
-
}));
|
|
50
|
-
const Code = utils.styled("code", {
|
|
51
|
-
fontSize: ".9em"
|
|
52
|
-
});
|
|
53
|
-
utils.styled("input", (_props, theme) => ({
|
|
54
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
55
|
-
border: 0,
|
|
56
|
-
borderRadius: ".2em",
|
|
57
|
-
color: theme.inputTextColor,
|
|
58
|
-
fontSize: ".9em",
|
|
59
|
-
lineHeight: `1.3`,
|
|
60
|
-
padding: ".3em .4em"
|
|
61
|
-
}));
|
|
62
|
-
utils.styled(
|
|
63
|
-
"select",
|
|
64
|
-
(_props, theme) => ({
|
|
65
|
-
display: `inline-block`,
|
|
66
|
-
fontSize: `.9em`,
|
|
67
|
-
fontFamily: `sans-serif`,
|
|
68
|
-
fontWeight: "normal",
|
|
69
|
-
lineHeight: `1.3`,
|
|
70
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
71
|
-
height: "auto",
|
|
72
|
-
border: 0,
|
|
73
|
-
borderRadius: `.2em`,
|
|
74
|
-
appearance: `none`,
|
|
75
|
-
WebkitAppearance: "none",
|
|
76
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
77
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
78
|
-
backgroundRepeat: `no-repeat`,
|
|
79
|
-
backgroundPosition: `right .55em center`,
|
|
80
|
-
backgroundSize: `.65em auto, 100%`,
|
|
81
|
-
color: theme.inputTextColor
|
|
82
|
-
}),
|
|
83
|
-
{
|
|
84
|
-
"(max-width: 500px)": {
|
|
85
|
-
display: "none"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
exports.ActivePanel = ActivePanel;
|
|
90
|
-
exports.Button = Button;
|
|
91
|
-
exports.Code = Code;
|
|
92
|
-
exports.Panel = Panel;
|
|
93
|
-
//# sourceMappingURL=styledComponents.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.cjs","sources":["../../src/styledComponents.ts"],"sourcesContent":["import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nexport const ActivePanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\n// export const QueryKeys = styled('span', {\n// display: 'inline-block',\n// fontSize: '0.9em',\n// })\n\n// export const QueryKey = styled('span', {\n// display: 'inline-flex',\n// alignItems: 'center',\n// padding: '.2em .4em',\n// fontWeight: 'bold',\n// textShadow: '0 0 10px black',\n// borderRadius: '.2em',\n// })\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n})\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n"],"names":["styled"],"mappings":";;;AAEO,MAAM,QAAQA,MAAA;AAAA,EACnB;AAAA,EACA,CAAC,QAAQ,WAAW;AAAA,IAClB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,iBAAiB,MAAM;AAAA,IACvB,OAAO,MAAM;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,sBAAsB;AAAA,MACpB,eAAe;AAAA,IACjB;AAAA,IACA,sBAAsB;AAAA,MACpB,UAAU;AAAA;AAAA,IAEZ;AAAA,EACF;AACF;AAEO,MAAM,cAAcA,MAAA;AAAA,EACzB;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV;AAAA,IACE,sBAAsB,CAAC,QAAQ,WAAW;AAAA,MACxC,WAAW,aAAa,MAAM,IAAI;AAAA,IAAA;AAAA,EAEtC;AACF;AAEO,MAAM,SAASA,MAAAA,OAAO,UAAU,CAAC,OAAO,WAAW;AAAA,EACxD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY,MAAM;AAAA,EAClB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS,MAAM,WAAW,OAAO;AAAA,EACjC,QAAQ;AACV,EAAE;AAgBW,MAAA,OAAOA,aAAO,QAAQ;AAAA,EACjC,UAAU;AACZ,CAAC;AAEoBA,MAAAA,OAAO,SAAS,CAAC,QAAQ,WAAW;AAAA,EACvD,iBAAiB,MAAM;AAAA,EACvB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO,MAAM;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,SAAS;AACX,EAAE;AAEoBA,MAAA;AAAA,EACpB;AAAA,EACA,CAAC,QAAQ,WAAW;AAAA,IAClB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,iBAAiB,MAAM;AAAA,IACvB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,OAAO,MAAM;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,EACF;AACF;;;;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Panel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
-
export declare const ActivePanel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
export declare const Code: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
6
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
7
|
-
export declare const Select: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
package/dist/cjs/theme.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const defaultTheme = {
|
|
6
|
-
background: "#222222",
|
|
7
|
-
backgroundAlt: "#292929",
|
|
8
|
-
foreground: "white",
|
|
9
|
-
gray: "#444",
|
|
10
|
-
grayAlt: "#444",
|
|
11
|
-
inputBackgroundColor: "#fff",
|
|
12
|
-
inputTextColor: "#000",
|
|
13
|
-
success: "#80cb00",
|
|
14
|
-
danger: "#ff0085",
|
|
15
|
-
active: "#0099ff",
|
|
16
|
-
warning: "#ffb200"
|
|
17
|
-
};
|
|
18
|
-
const ThemeContext = React.createContext(defaultTheme);
|
|
19
|
-
function ThemeProvider({ theme, ...rest }) {
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: theme, ...rest });
|
|
21
|
-
}
|
|
22
|
-
function useTheme() {
|
|
23
|
-
return React.useContext(ThemeContext);
|
|
24
|
-
}
|
|
25
|
-
exports.ThemeProvider = ThemeProvider;
|
|
26
|
-
exports.defaultTheme = defaultTheme;
|
|
27
|
-
exports.useTheme = useTheme;
|
|
28
|
-
//# sourceMappingURL=theme.cjs.map
|
package/dist/cjs/theme.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.cjs","sources":["../../src/theme.tsx"],"sourcesContent":["import React from 'react'\n\nexport const defaultTheme = {\n background: '#222222',\n backgroundAlt: '#292929',\n foreground: 'white',\n gray: '#444',\n grayAlt: '#444',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#80cb00',\n danger: '#ff0085',\n active: '#0099ff',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n"],"names":[],"mappings":";;;;AAEO,MAAM,eAAe;AAAA,EAC1B,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAQA,MAAM,eAAe,MAAM,cAAc,YAAY;AAE9C,SAAS,cAAc,EAAE,OAAO,GAAG,QAAuB;AAC/D,wCAAQ,aAAa,UAAb,EAAsB,OAAO,OAAQ,GAAG,KAAM,CAAA;AACxD;AAEO,SAAS,WAAW;AAClB,SAAA,MAAM,WAAW,YAAY;AACtC;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const React = require("react");
|
|
3
|
-
function useMediaQuery(query) {
|
|
4
|
-
const [isMatch, setIsMatch] = React.useState(() => {
|
|
5
|
-
if (typeof window !== "undefined") {
|
|
6
|
-
return window.matchMedia && window.matchMedia(query).matches;
|
|
7
|
-
}
|
|
8
|
-
return;
|
|
9
|
-
});
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (typeof window !== "undefined") {
|
|
12
|
-
if (!window.matchMedia) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const matcher = window.matchMedia(query);
|
|
16
|
-
const onChange = ({ matches }) => setIsMatch(matches);
|
|
17
|
-
matcher.addListener(onChange);
|
|
18
|
-
return () => {
|
|
19
|
-
matcher.removeListener(onChange);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return;
|
|
23
|
-
}, [isMatch, query, setIsMatch]);
|
|
24
|
-
return isMatch;
|
|
25
|
-
}
|
|
26
|
-
module.exports = useMediaQuery;
|
|
27
|
-
//# sourceMappingURL=useMediaQuery.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.cjs","sources":["../../src/useMediaQuery.ts"],"sourcesContent":["import React from 'react'\n\nexport default function useMediaQuery(query: string): boolean | undefined {\n // Keep track of the preference in state, start with the current match\n const [isMatch, setIsMatch] = React.useState(() => {\n if (typeof window !== 'undefined') {\n return window.matchMedia && window.matchMedia(query).matches\n }\n return\n })\n\n // Watch for changes\n React.useEffect(() => {\n if (typeof window !== 'undefined') {\n if (!window.matchMedia) {\n return\n }\n\n // Create a matcher\n const matcher = window.matchMedia(query)\n\n // Create our handler\n const onChange = ({ matches }: { matches: boolean }) =>\n setIsMatch(matches)\n\n // Listen for changes\n matcher.addListener(onChange)\n\n return () => {\n // Stop listening for changes\n matcher.removeListener(onChange)\n }\n }\n\n return\n }, [isMatch, query, setIsMatch])\n\n return isMatch\n}\n"],"names":[],"mappings":";;AAEA,SAAwB,cAAc,OAAoC;AAExE,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,MAAM;AAC7C,QAAA,OAAO,WAAW,aAAa;AACjC,aAAO,OAAO,cAAc,OAAO,WAAW,KAAK,EAAE;AAAA,IACvD;AACA;AAAA,EAAA,CACD;AAGD,QAAM,UAAU,MAAM;AAChB,QAAA,OAAO,WAAW,aAAa;AAC7B,UAAA,CAAC,OAAO,YAAY;AACtB;AAAA,MACF;AAGM,YAAA,UAAU,OAAO,WAAW,KAAK;AAGvC,YAAM,WAAW,CAAC,EAAE,QAAQ,MAC1B,WAAW,OAAO;AAGpB,cAAQ,YAAY,QAAQ;AAE5B,aAAO,MAAM;AAEX,gBAAQ,eAAe,QAAQ;AAAA,MAAA;AAAA,IAEnC;AAEA;AAAA,EACC,GAAA,CAAC,SAAS,OAAO,UAAU,CAAC;AAExB,SAAA;AACT;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Panel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
-
export declare const ActivePanel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
export declare const Code: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
6
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
7
|
-
export declare const Select: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { styled } from "./utils.js";
|
|
2
|
-
const Panel = styled(
|
|
3
|
-
"div",
|
|
4
|
-
(_props, theme) => ({
|
|
5
|
-
fontSize: "clamp(12px, 1.5vw, 14px)",
|
|
6
|
-
fontFamily: `sans-serif`,
|
|
7
|
-
display: "flex",
|
|
8
|
-
backgroundColor: theme.background,
|
|
9
|
-
color: theme.foreground
|
|
10
|
-
}),
|
|
11
|
-
{
|
|
12
|
-
"(max-width: 700px)": {
|
|
13
|
-
flexDirection: "column"
|
|
14
|
-
},
|
|
15
|
-
"(max-width: 600px)": {
|
|
16
|
-
fontSize: ".9em"
|
|
17
|
-
// flexDirection: 'column',
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
const ActivePanel = styled(
|
|
22
|
-
"div",
|
|
23
|
-
() => ({
|
|
24
|
-
flex: "1 1 500px",
|
|
25
|
-
display: "flex",
|
|
26
|
-
flexDirection: "column",
|
|
27
|
-
overflow: "auto",
|
|
28
|
-
height: "100%"
|
|
29
|
-
}),
|
|
30
|
-
{
|
|
31
|
-
"(max-width: 700px)": (_props, theme) => ({
|
|
32
|
-
borderTop: `2px solid ${theme.gray}`
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
const Button = styled("button", (props, theme) => ({
|
|
37
|
-
appearance: "none",
|
|
38
|
-
fontSize: ".9em",
|
|
39
|
-
fontWeight: "bold",
|
|
40
|
-
background: theme.gray,
|
|
41
|
-
border: "0",
|
|
42
|
-
borderRadius: ".3em",
|
|
43
|
-
color: "white",
|
|
44
|
-
padding: ".5em",
|
|
45
|
-
opacity: props.disabled ? ".5" : void 0,
|
|
46
|
-
cursor: "pointer"
|
|
47
|
-
}));
|
|
48
|
-
const Code = styled("code", {
|
|
49
|
-
fontSize: ".9em"
|
|
50
|
-
});
|
|
51
|
-
styled("input", (_props, theme) => ({
|
|
52
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
53
|
-
border: 0,
|
|
54
|
-
borderRadius: ".2em",
|
|
55
|
-
color: theme.inputTextColor,
|
|
56
|
-
fontSize: ".9em",
|
|
57
|
-
lineHeight: `1.3`,
|
|
58
|
-
padding: ".3em .4em"
|
|
59
|
-
}));
|
|
60
|
-
styled(
|
|
61
|
-
"select",
|
|
62
|
-
(_props, theme) => ({
|
|
63
|
-
display: `inline-block`,
|
|
64
|
-
fontSize: `.9em`,
|
|
65
|
-
fontFamily: `sans-serif`,
|
|
66
|
-
fontWeight: "normal",
|
|
67
|
-
lineHeight: `1.3`,
|
|
68
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
69
|
-
height: "auto",
|
|
70
|
-
border: 0,
|
|
71
|
-
borderRadius: `.2em`,
|
|
72
|
-
appearance: `none`,
|
|
73
|
-
WebkitAppearance: "none",
|
|
74
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
75
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
76
|
-
backgroundRepeat: `no-repeat`,
|
|
77
|
-
backgroundPosition: `right .55em center`,
|
|
78
|
-
backgroundSize: `.65em auto, 100%`,
|
|
79
|
-
color: theme.inputTextColor
|
|
80
|
-
}),
|
|
81
|
-
{
|
|
82
|
-
"(max-width: 500px)": {
|
|
83
|
-
display: "none"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
export {
|
|
88
|
-
ActivePanel,
|
|
89
|
-
Button,
|
|
90
|
-
Code,
|
|
91
|
-
Panel
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=styledComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.js","sources":["../../src/styledComponents.ts"],"sourcesContent":["import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nexport const ActivePanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\n// export const QueryKeys = styled('span', {\n// display: 'inline-block',\n// fontSize: '0.9em',\n// })\n\n// export const QueryKey = styled('span', {\n// display: 'inline-flex',\n// alignItems: 'center',\n// padding: '.2em .4em',\n// fontWeight: 'bold',\n// textShadow: '0 0 10px black',\n// borderRadius: '.2em',\n// })\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n})\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n"],"names":[],"mappings":";AAEO,MAAM,QAAQ;AAAA,EACnB;AAAA,EACA,CAAC,QAAQ,WAAW;AAAA,IAClB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,iBAAiB,MAAM;AAAA,IACvB,OAAO,MAAM;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,sBAAsB;AAAA,MACpB,eAAe;AAAA,IACjB;AAAA,IACA,sBAAsB;AAAA,MACpB,UAAU;AAAA;AAAA,IAEZ;AAAA,EACF;AACF;AAEO,MAAM,cAAc;AAAA,EACzB;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV;AAAA,IACE,sBAAsB,CAAC,QAAQ,WAAW;AAAA,MACxC,WAAW,aAAa,MAAM,IAAI;AAAA,IAAA;AAAA,EAEtC;AACF;AAEO,MAAM,SAAS,OAAO,UAAU,CAAC,OAAO,WAAW;AAAA,EACxD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY,MAAM;AAAA,EAClB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS,MAAM,WAAW,OAAO;AAAA,EACjC,QAAQ;AACV,EAAE;AAgBW,MAAA,OAAO,OAAO,QAAQ;AAAA,EACjC,UAAU;AACZ,CAAC;AAEoB,OAAO,SAAS,CAAC,QAAQ,WAAW;AAAA,EACvD,iBAAiB,MAAM;AAAA,EACvB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO,MAAM;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,SAAS;AACX,EAAE;AAEoB;AAAA,EACpB;AAAA,EACA,CAAC,QAAQ,WAAW;AAAA,IAClB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,iBAAiB,MAAM;AAAA,IACvB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,OAAO,MAAM;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,EACF;AACF;"}
|
package/dist/esm/theme.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
const defaultTheme = {
|
|
4
|
-
background: "#222222",
|
|
5
|
-
backgroundAlt: "#292929",
|
|
6
|
-
foreground: "white",
|
|
7
|
-
gray: "#444",
|
|
8
|
-
grayAlt: "#444",
|
|
9
|
-
inputBackgroundColor: "#fff",
|
|
10
|
-
inputTextColor: "#000",
|
|
11
|
-
success: "#80cb00",
|
|
12
|
-
danger: "#ff0085",
|
|
13
|
-
active: "#0099ff",
|
|
14
|
-
warning: "#ffb200"
|
|
15
|
-
};
|
|
16
|
-
const ThemeContext = React__default.createContext(defaultTheme);
|
|
17
|
-
function ThemeProvider({ theme, ...rest }) {
|
|
18
|
-
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme, ...rest });
|
|
19
|
-
}
|
|
20
|
-
function useTheme() {
|
|
21
|
-
return React__default.useContext(ThemeContext);
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
ThemeProvider,
|
|
25
|
-
defaultTheme,
|
|
26
|
-
useTheme
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=theme.js.map
|
package/dist/esm/theme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sources":["../../src/theme.tsx"],"sourcesContent":["import React from 'react'\n\nexport const defaultTheme = {\n background: '#222222',\n backgroundAlt: '#292929',\n foreground: 'white',\n gray: '#444',\n grayAlt: '#444',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#80cb00',\n danger: '#ff0085',\n active: '#0099ff',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n"],"names":["React"],"mappings":";;AAEO,MAAM,eAAe;AAAA,EAC1B,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAQA,MAAM,eAAeA,eAAM,cAAc,YAAY;AAE9C,SAAS,cAAc,EAAE,OAAO,GAAG,QAAuB;AAC/D,6BAAQ,aAAa,UAAb,EAAsB,OAAO,OAAQ,GAAG,KAAM,CAAA;AACxD;AAEO,SAAS,WAAW;AAClB,SAAAA,eAAM,WAAW,YAAY;AACtC;"}
|