@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.
Files changed (49) hide show
  1. package/dist/cjs/Explorer.cjs +152 -92
  2. package/dist/cjs/Explorer.cjs.map +1 -1
  3. package/dist/cjs/Explorer.d.cts +0 -7
  4. package/dist/cjs/devtools.cjs +924 -905
  5. package/dist/cjs/devtools.cjs.map +1 -1
  6. package/dist/cjs/logo.cjs +1012 -0
  7. package/dist/cjs/logo.cjs.map +1 -0
  8. package/dist/cjs/logo.d.cts +2 -0
  9. package/dist/cjs/tokens.cjs +302 -0
  10. package/dist/cjs/tokens.cjs.map +1 -0
  11. package/dist/cjs/tokens.d.cts +298 -0
  12. package/dist/cjs/utils.cjs +5 -33
  13. package/dist/cjs/utils.cjs.map +1 -1
  14. package/dist/cjs/utils.d.cts +2 -2
  15. package/dist/esm/Explorer.d.ts +0 -7
  16. package/dist/esm/Explorer.js +153 -93
  17. package/dist/esm/Explorer.js.map +1 -1
  18. package/dist/esm/devtools.js +924 -905
  19. package/dist/esm/devtools.js.map +1 -1
  20. package/dist/esm/logo.d.ts +2 -0
  21. package/dist/esm/logo.js +1012 -0
  22. package/dist/esm/logo.js.map +1 -0
  23. package/dist/esm/tokens.d.ts +298 -0
  24. package/dist/esm/tokens.js +302 -0
  25. package/dist/esm/tokens.js.map +1 -0
  26. package/dist/esm/utils.d.ts +2 -2
  27. package/dist/esm/utils.js +5 -33
  28. package/dist/esm/utils.js.map +1 -1
  29. package/package.json +5 -2
  30. package/src/Explorer.tsx +155 -93
  31. package/src/devtools.tsx +974 -860
  32. package/src/logo.tsx +817 -0
  33. package/src/tokens.ts +305 -0
  34. package/src/utils.ts +12 -11
  35. package/dist/cjs/styledComponents.cjs +0 -93
  36. package/dist/cjs/styledComponents.cjs.map +0 -1
  37. package/dist/cjs/styledComponents.d.cts +0 -7
  38. package/dist/cjs/theme.cjs +0 -28
  39. package/dist/cjs/theme.cjs.map +0 -1
  40. package/dist/cjs/useMediaQuery.cjs +0 -27
  41. package/dist/cjs/useMediaQuery.cjs.map +0 -1
  42. package/dist/esm/styledComponents.d.ts +0 -7
  43. package/dist/esm/styledComponents.js +0 -93
  44. package/dist/esm/styledComponents.js.map +0 -1
  45. package/dist/esm/theme.js +0 -28
  46. package/dist/esm/theme.js.map +0 -1
  47. package/dist/esm/useMediaQuery.js +0 -28
  48. package/dist/esm/useMediaQuery.js.map +0 -1
  49. package/src/styledComponents.ts +0 -106
@@ -5,55 +5,28 @@ const React = require("react");
5
5
  const reactRouter = require("@tanstack/react-router");
6
6
  const useLocalStorage = require("./useLocalStorage.cjs");
7
7
  const utils = require("./utils.cjs");
8
- const styledComponents = require("./styledComponents.cjs");
9
- const theme = require("./theme.cjs");
8
+ const goober = require("goober");
9
+ const clsx = require("clsx");
10
10
  const Explorer = require("./Explorer.cjs");
11
- const isServer = typeof window === "undefined";
11
+ const tokens = require("./tokens.cjs");
12
+ const logo = require("./logo.cjs");
12
13
  function Logo(props) {
13
- return /* @__PURE__ */ jsxRuntime.jsxs(
14
- "div",
15
- {
16
- ...props,
17
- style: {
18
- ...props.style ?? {},
19
- display: "flex",
20
- alignItems: "center",
21
- flexDirection: "column",
22
- fontSize: "0.8rem",
23
- fontWeight: "bolder",
24
- lineHeight: "1"
25
- },
26
- children: [
27
- /* @__PURE__ */ jsxRuntime.jsx(
28
- "div",
29
- {
30
- style: {
31
- letterSpacing: "-0.05rem"
32
- },
33
- children: "TANSTACK"
34
- }
35
- ),
36
- /* @__PURE__ */ jsxRuntime.jsx(
37
- "div",
38
- {
39
- style: {
40
- backgroundImage: "linear-gradient(to right, var(--tw-gradient-stops))",
41
- // @ts-ignore
42
- "--tw-gradient-from": "#84cc16",
43
- "--tw-gradient-stops": "var(--tw-gradient-from), var(--tw-gradient-to)",
44
- "--tw-gradient-to": "#10b981",
45
- WebkitBackgroundClip: "text",
46
- color: "transparent",
47
- letterSpacing: "0.1rem",
48
- marginRight: "-0.2rem"
49
- },
50
- children: "ROUTER"
51
- }
52
- )
53
- ]
54
- }
55
- );
14
+ const { className, ...rest } = props;
15
+ return /* @__PURE__ */ jsxRuntime.jsxs("button", { ...rest, className: clsx.clsx(getStyles().logo, className), children: [
16
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().tanstackLogo, children: "TANSTACK" }),
17
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().routerLogo, children: "React Router v1" })
18
+ ] });
56
19
  }
20
+ const DevtoolsOnCloseContext = React.createContext(void 0);
21
+ const useDevtoolsOnClose = () => {
22
+ const context = React.useContext(DevtoolsOnCloseContext);
23
+ if (!context) {
24
+ throw new Error(
25
+ "useDevtoolsOnClose must be used within a TanStackRouterDevtools component"
26
+ );
27
+ }
28
+ return context;
29
+ };
57
30
  function TanStackRouterDevtools({
58
31
  initialIsOpen,
59
32
  panelProps = {},
@@ -63,7 +36,7 @@ function TanStackRouterDevtools({
63
36
  containerElement: Container = "footer",
64
37
  router
65
38
  }) {
66
- const rootRef = React.useRef(null);
39
+ const [rootEl, setRootEl] = React.useState(null);
67
40
  const panelRef = React.useRef(null);
68
41
  const [isOpen, setIsOpen] = useLocalStorage(
69
42
  "tanstackRouterDevtoolsOpen",
@@ -102,56 +75,41 @@ function TanStackRouterDevtools({
102
75
  document.addEventListener("mousemove", run);
103
76
  document.addEventListener("mouseup", unsub);
104
77
  };
78
+ const isButtonClosed = isOpen ?? false;
105
79
  React.useEffect(() => {
106
80
  setIsResolvedOpen(isOpen ?? false);
107
81
  }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
108
82
  React.useEffect(() => {
109
- const ref = panelRef.current;
110
- if (ref) {
111
- const handlePanelTransitionStart = () => {
112
- if (ref && isResolvedOpen) {
113
- ref.style.visibility = "visible";
114
- }
115
- };
116
- const handlePanelTransitionEnd = () => {
117
- if (ref && !isResolvedOpen) {
118
- ref.style.visibility = "hidden";
119
- }
120
- };
121
- ref.addEventListener("transitionstart", handlePanelTransitionStart);
122
- ref.addEventListener("transitionend", handlePanelTransitionEnd);
123
- return () => {
124
- ref.removeEventListener("transitionstart", handlePanelTransitionStart);
125
- ref.removeEventListener("transitionend", handlePanelTransitionEnd);
126
- };
127
- }
128
- return;
129
- }, [isResolvedOpen]);
130
- React[isServer ? "useEffect" : "useLayoutEffect"](() => {
131
- var _a, _b;
83
+ var _a;
132
84
  if (isResolvedOpen) {
133
- const previousValue = (_b = (_a = rootRef.current) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.style.paddingBottom;
85
+ const previousValue = (_a = rootEl == null ? void 0 : rootEl.parentElement) == null ? void 0 : _a.style.paddingBottom;
134
86
  const run = () => {
135
- var _a2, _b2;
87
+ var _a2;
136
88
  const containerHeight = (_a2 = panelRef.current) == null ? void 0 : _a2.getBoundingClientRect().height;
137
- if ((_b2 = rootRef.current) == null ? void 0 : _b2.parentElement) {
138
- rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
89
+ if (rootEl == null ? void 0 : rootEl.parentElement) {
90
+ rootEl.parentElement.style.paddingBottom = `${containerHeight}px`;
139
91
  }
140
92
  };
141
93
  run();
142
94
  if (typeof window !== "undefined") {
143
95
  window.addEventListener("resize", run);
144
96
  return () => {
145
- var _a2;
146
97
  window.removeEventListener("resize", run);
147
- if (((_a2 = rootRef.current) == null ? void 0 : _a2.parentElement) && typeof previousValue === "string") {
148
- rootRef.current.parentElement.style.paddingBottom = previousValue;
98
+ if ((rootEl == null ? void 0 : rootEl.parentElement) && typeof previousValue === "string") {
99
+ rootEl.parentElement.style.paddingBottom = previousValue;
149
100
  }
150
101
  };
151
102
  }
152
103
  }
153
104
  return;
154
105
  }, [isResolvedOpen]);
106
+ React.useEffect(() => {
107
+ if (rootEl) {
108
+ const el = rootEl;
109
+ const fontSize = getComputedStyle(el).fontSize;
110
+ el.style.setProperty("--tsrd-font-size", fontSize);
111
+ }
112
+ }, [rootEl]);
155
113
  const { style: panelStyle = {}, ...otherPanelProps } = panelProps;
156
114
  const {
157
115
  style: closeButtonStyle = {},
@@ -165,78 +123,42 @@ function TanStackRouterDevtools({
165
123
  } = toggleButtonProps;
166
124
  if (!isMounted())
167
125
  return null;
168
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref: rootRef, className: "TanStackRouterDevtools", children: [
169
- /* @__PURE__ */ jsxRuntime.jsxs(theme.ThemeProvider, { theme: theme.defaultTheme, children: [
170
- /* @__PURE__ */ jsxRuntime.jsx(
171
- TanStackRouterDevtoolsPanel,
172
- {
173
- ref: panelRef,
174
- ...otherPanelProps,
175
- router,
176
- style: {
177
- direction: "ltr",
178
- position: "fixed",
179
- bottom: "0",
180
- right: "0",
181
- zIndex: 99999,
182
- width: "100%",
183
- height: devtoolsHeight ?? 500,
184
- maxHeight: "90%",
185
- boxShadow: "0 0 20px rgba(0,0,0,.3)",
186
- borderTop: `1px solid ${theme.defaultTheme.gray}`,
187
- transformOrigin: "top",
188
- // visibility will be toggled after transitions, but set initial state here
189
- visibility: isOpen ? "visible" : "hidden",
190
- ...panelStyle,
191
- ...isResizing ? {
192
- transition: `none`
193
- } : { transition: `all .2s ease` },
194
- ...isResolvedOpen ? {
195
- opacity: 1,
196
- pointerEvents: "all",
197
- transform: `translateY(0) scale(1)`
198
- } : {
199
- opacity: 0,
200
- pointerEvents: "none",
201
- transform: `translateY(15px) scale(1.02)`
202
- }
203
- },
204
- isOpen: isResolvedOpen,
205
- setIsOpen,
206
- handleDragStart: (e) => handleDragStart(panelRef.current, e)
207
- }
208
- ),
209
- isResolvedOpen ? /* @__PURE__ */ jsxRuntime.jsx(
210
- styledComponents.Button,
211
- {
212
- type: "button",
213
- "aria-label": "Close TanStack Router Devtools",
214
- ...otherCloseButtonProps,
215
- onClick: (e) => {
216
- setIsOpen(false);
217
- onCloseClick && onCloseClick(e);
218
- },
219
- style: {
220
- position: "fixed",
221
- zIndex: 99999,
222
- margin: ".5em",
223
- bottom: 0,
224
- ...position === "top-right" ? {
225
- right: "0"
226
- } : position === "top-left" ? {
227
- left: "0"
228
- } : position === "bottom-right" ? {
229
- right: "0"
230
- } : {
231
- left: "0"
126
+ const resolvedHeight = devtoolsHeight ?? 500;
127
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref: setRootEl, className: "TanStackRouterDevtools", children: [
128
+ /* @__PURE__ */ jsxRuntime.jsx(
129
+ DevtoolsOnCloseContext.Provider,
130
+ {
131
+ value: {
132
+ onCloseClick: onCloseClick ?? (() => {
133
+ })
134
+ },
135
+ children: /* @__PURE__ */ jsxRuntime.jsx(
136
+ TanStackRouterDevtoolsPanel,
137
+ {
138
+ ref: panelRef,
139
+ ...otherPanelProps,
140
+ router,
141
+ className: clsx.clsx(
142
+ getStyles().devtoolsPanelContainer,
143
+ getStyles().devtoolsPanelContainerVisibility(!!isOpen),
144
+ getStyles().devtoolsPanelContainerResizing(isResizing),
145
+ getStyles().devtoolsPanelContainerAnimation(
146
+ isResolvedOpen,
147
+ resolvedHeight + 16
148
+ )
149
+ ),
150
+ style: {
151
+ height: resolvedHeight,
152
+ ...panelStyle
232
153
  },
233
- ...closeButtonStyle
234
- },
235
- children: "Close"
236
- }
237
- ) : null
238
- ] }),
239
- !isResolvedOpen ? /* @__PURE__ */ jsxRuntime.jsx(
154
+ isOpen: isResolvedOpen,
155
+ setIsOpen,
156
+ handleDragStart: (e) => handleDragStart(panelRef.current, e)
157
+ }
158
+ )
159
+ }
160
+ ),
161
+ /* @__PURE__ */ jsxRuntime.jsxs(
240
162
  "button",
241
163
  {
242
164
  type: "button",
@@ -246,36 +168,21 @@ function TanStackRouterDevtools({
246
168
  setIsOpen(true);
247
169
  onToggleClick && onToggleClick(e);
248
170
  },
249
- style: {
250
- appearance: "none",
251
- background: "none",
252
- border: 0,
253
- padding: 0,
254
- position: "fixed",
255
- zIndex: 99999,
256
- display: "inline-flex",
257
- fontSize: "1.5em",
258
- margin: ".5em",
259
- cursor: "pointer",
260
- width: "fit-content",
261
- ...position === "top-right" ? {
262
- top: "0",
263
- right: "0"
264
- } : position === "top-left" ? {
265
- top: "0",
266
- left: "0"
267
- } : position === "bottom-right" ? {
268
- bottom: "0",
269
- right: "0"
270
- } : {
271
- bottom: "0",
272
- left: "0"
273
- },
274
- ...toggleButtonStyle
275
- },
276
- children: /* @__PURE__ */ jsxRuntime.jsx(Logo, { "aria-hidden": true })
171
+ className: clsx.clsx(
172
+ getStyles().mainCloseBtn,
173
+ getStyles().mainCloseBtnPosition(position),
174
+ getStyles().mainCloseBtnAnimation(!isButtonClosed)
175
+ ),
176
+ children: [
177
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().mainCloseBtnIconContainer, children: [
178
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().mainCloseBtnIconOuter, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) }),
179
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().mainCloseBtnIconInner, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) })
180
+ ] }),
181
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().mainCloseBtnDivider, children: "-" }),
182
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().routerLogoCloseButton, children: "React Router" })
183
+ ]
277
184
  }
278
- ) : null
185
+ )
279
186
  ] });
280
187
  }
281
188
  function RouteComp({
@@ -288,6 +195,23 @@ function RouteComp({
288
195
  const routerState = reactRouter.useRouterState();
289
196
  const matches = routerState.status === "pending" ? routerState.pendingMatches ?? [] : routerState.matches;
290
197
  const match = routerState.matches.find((d) => d.routeId === route.id);
198
+ const param = React.useMemo(() => {
199
+ try {
200
+ if (match == null ? void 0 : match.params) {
201
+ const p = match.params;
202
+ const r = route.path || reactRouter.trimPath(route.id);
203
+ if (r.startsWith("$")) {
204
+ const trimmed = r.slice(1);
205
+ if (p[trimmed]) {
206
+ return `(${p[trimmed]})`;
207
+ }
208
+ }
209
+ }
210
+ return "";
211
+ } catch (error) {
212
+ return "";
213
+ }
214
+ }, [match, route]);
291
215
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
292
216
  /* @__PURE__ */ jsxRuntime.jsxs(
293
217
  "div",
@@ -299,90 +223,42 @@ function RouteComp({
299
223
  setActiveId(activeId === route.id ? "" : route.id);
300
224
  }
301
225
  },
302
- style: {
303
- display: "flex",
304
- borderBottom: `solid 1px ${theme.defaultTheme.grayAlt}`,
305
- cursor: match ? "pointer" : "default",
306
- alignItems: "center",
307
- background: route.id === activeId ? "rgba(255,255,255,.1)" : void 0,
308
- padding: ".25rem .5rem",
309
- gap: ".5rem"
310
- },
226
+ className: clsx.clsx(
227
+ getStyles().routesRowContainer(route.id === activeId, !!match)
228
+ ),
311
229
  children: [
312
- isRoot ? null : /* @__PURE__ */ jsxRuntime.jsx(
230
+ /* @__PURE__ */ jsxRuntime.jsx(
313
231
  "div",
314
232
  {
315
- style: {
316
- flex: "0 0 auto",
317
- width: ".7rem",
318
- height: ".7rem",
319
- alignItems: "center",
320
- justifyContent: "center",
321
- fontWeight: "bold",
322
- borderRadius: "100%",
323
- transition: "all .2s ease-out",
324
- background: utils.getRouteStatusColor(matches, route, theme.defaultTheme),
325
- opacity: match ? 1 : 0.3
326
- }
233
+ className: clsx.clsx(
234
+ getStyles().matchIndicator(utils.getRouteStatusColor(matches, route))
235
+ )
327
236
  }
328
237
  ),
329
- /* @__PURE__ */ jsxRuntime.jsxs(
330
- "div",
331
- {
332
- style: {
333
- flex: "1 0 auto",
334
- display: "flex",
335
- justifyContent: "space-between",
336
- alignItems: "center",
337
- padding: isRoot ? "0 .25rem" : 0,
338
- opacity: match ? 1 : 0.7,
339
- fontSize: "0.7rem"
340
- },
341
- children: [
342
- /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.Code, { children: [
343
- route.path || reactRouter.trimPath(route.id),
344
- " "
345
- ] }),
346
- /* @__PURE__ */ jsxRuntime.jsxs(
347
- "div",
348
- {
349
- style: {
350
- display: "flex",
351
- alignItems: "center",
352
- gap: ".5rem"
353
- },
354
- children: [
355
- match ? /* @__PURE__ */ jsxRuntime.jsx(styledComponents.Code, { style: { opacity: 0.3 }, children: match.id }) : null,
356
- /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match })
357
- ]
358
- }
359
- )
360
- ]
361
- }
362
- )
238
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(getStyles().routesRow(!!match)), children: [
239
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
240
+ /* @__PURE__ */ jsxRuntime.jsxs("code", { className: getStyles().code, children: [
241
+ isRoot ? "__root__" : route.path || reactRouter.trimPath(route.id),
242
+ " "
243
+ ] }),
244
+ /* @__PURE__ */ jsxRuntime.jsx("code", { className: getStyles().routeParamInfo, children: param })
245
+ ] }),
246
+ /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match })
247
+ ] })
363
248
  ]
364
249
  }
365
250
  ),
366
- ((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx(
367
- "div",
251
+ ((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().nestedRouteRow(!!isRoot), children: [...route.children].sort((a, b) => {
252
+ return a.rank - b.rank;
253
+ }).map((r) => /* @__PURE__ */ jsxRuntime.jsx(
254
+ RouteComp,
368
255
  {
369
- style: {
370
- marginLeft: isRoot ? 0 : "1rem",
371
- borderLeft: isRoot ? "" : `solid 1px ${theme.defaultTheme.grayAlt}`
372
- },
373
- children: [...route.children].sort((a, b) => {
374
- return a.rank - b.rank;
375
- }).map((r) => /* @__PURE__ */ jsxRuntime.jsx(
376
- RouteComp,
377
- {
378
- route: r,
379
- activeId,
380
- setActiveId
381
- },
382
- r.id
383
- ))
384
- }
385
- ) : null
256
+ route: r,
257
+ activeId,
258
+ setActiveId
259
+ },
260
+ r.id
261
+ )) }) : null
386
262
  ] });
387
263
  }
388
264
  const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevtoolsPanel2(props, ref) {
@@ -394,6 +270,8 @@ const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevt
394
270
  router: userRouter,
395
271
  ...panelProps
396
272
  } = props;
273
+ const { onCloseClick } = useDevtoolsOnClose();
274
+ const { className, ...otherPanelProps } = panelProps;
397
275
  const contextRouter = reactRouter.useRouter({ warn: false });
398
276
  const router = userRouter ?? contextRouter;
399
277
  const routerState = reactRouter.useRouterState({
@@ -425,670 +303,282 @@ const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevt
425
303
  ...router,
426
304
  state: router.state
427
305
  };
428
- return /* @__PURE__ */ jsxRuntime.jsx(theme.ThemeProvider, { theme: theme.defaultTheme, children: /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.Panel, { ref, className: "TanStackRouterDevtoolsPanel", ...panelProps, children: [
429
- /* @__PURE__ */ jsxRuntime.jsx(
430
- "style",
431
- {
432
- dangerouslySetInnerHTML: {
433
- __html: `
434
-
435
- .TanStackRouterDevtoolsPanel * {
436
- scrollbar-color: ${theme.defaultTheme.backgroundAlt} ${theme.defaultTheme.gray};
437
- }
438
-
439
- .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
440
- width: 1em;
441
- height: 1em;
442
- }
443
-
444
- .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
445
- background: ${theme.defaultTheme.backgroundAlt};
446
- }
447
-
448
- .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
449
- background: ${theme.defaultTheme.gray};
450
- border-radius: .5em;
451
- border: 3px solid ${theme.defaultTheme.backgroundAlt};
452
- }
453
-
454
- .TanStackRouterDevtoolsPanel table {
455
- width: 100%;
456
- }
457
-
458
- .TanStackRouterDevtoolsPanel table tr {
459
- border-bottom: 2px dotted rgba(255, 255, 255, .2);
460
- }
461
-
462
- .TanStackRouterDevtoolsPanel table tr:last-child {
463
- border-bottom: none
464
- }
465
-
466
- .TanStackRouterDevtoolsPanel table td {
467
- padding: .25rem .5rem;
468
- border-right: 2px dotted rgba(255, 255, 255, .05);
469
- }
470
-
471
- .TanStackRouterDevtoolsPanel table td:last-child {
472
- border-right: none
473
- }
474
-
475
- `
476
- }
477
- }
478
- ),
479
- handleDragStart ? /* @__PURE__ */ jsxRuntime.jsx(
480
- "div",
481
- {
482
- style: {
483
- position: "absolute",
484
- left: 0,
485
- top: 0,
486
- width: "100%",
487
- height: "4px",
488
- marginBottom: "-4px",
489
- cursor: "row-resize",
490
- zIndex: 1e5
491
- },
492
- onMouseDown: handleDragStart
493
- }
494
- ) : null,
495
- /* @__PURE__ */ jsxRuntime.jsxs(
496
- "div",
497
- {
498
- style: {
499
- flex: "1 1 500px",
500
- minHeight: "40%",
501
- maxHeight: "100%",
502
- overflow: "auto",
503
- borderRight: `1px solid ${theme.defaultTheme.grayAlt}`,
504
- display: "flex",
505
- flexDirection: "column"
506
- },
507
- children: [
508
- /* @__PURE__ */ jsxRuntime.jsxs(
509
- "div",
510
- {
511
- style: {
512
- display: "flex",
513
- justifyContent: "start",
514
- gap: "1rem",
515
- padding: "1rem",
516
- alignItems: "center",
517
- background: theme.defaultTheme.backgroundAlt
518
- },
519
- children: [
520
- /* @__PURE__ */ jsxRuntime.jsx(Logo, { "aria-hidden": true }),
521
- /* @__PURE__ */ jsxRuntime.jsx(
522
- "div",
306
+ return /* @__PURE__ */ jsxRuntime.jsxs(
307
+ "div",
308
+ {
309
+ ref,
310
+ className: clsx.clsx(
311
+ getStyles().devtoolsPanel,
312
+ "TanStackRouterDevtoolsPanel",
313
+ className
314
+ ),
315
+ ...otherPanelProps,
316
+ children: [
317
+ handleDragStart ? /* @__PURE__ */ jsxRuntime.jsx(
318
+ "div",
319
+ {
320
+ className: getStyles().dragHandle,
321
+ onMouseDown: handleDragStart
322
+ }
323
+ ) : null,
324
+ /* @__PURE__ */ jsxRuntime.jsx(
325
+ "button",
326
+ {
327
+ className: getStyles().panelCloseBtn,
328
+ onClick: (e) => {
329
+ setIsOpen(false);
330
+ onCloseClick(e);
331
+ },
332
+ children: /* @__PURE__ */ jsxRuntime.jsx(
333
+ "svg",
334
+ {
335
+ xmlns: "http://www.w3.org/2000/svg",
336
+ width: "10",
337
+ height: "6",
338
+ fill: "none",
339
+ viewBox: "0 0 10 6",
340
+ className: getStyles().panelCloseBtnIcon,
341
+ children: /* @__PURE__ */ jsxRuntime.jsx(
342
+ "path",
523
343
  {
524
- style: {
525
- fontSize: "clamp(.8rem, 2vw, 1.3rem)",
526
- fontWeight: "bold"
527
- },
528
- children: /* @__PURE__ */ jsxRuntime.jsx(
529
- "span",
530
- {
531
- style: {
532
- fontWeight: 100
533
- },
534
- children: "Devtools"
535
- }
536
- )
344
+ stroke: "currentColor",
345
+ strokeLinecap: "round",
346
+ strokeLinejoin: "round",
347
+ strokeWidth: "1.667",
348
+ d: "M1 1l4 4 4-4"
537
349
  }
538
350
  )
539
- ]
540
- }
541
- ),
542
- /* @__PURE__ */ jsxRuntime.jsx(
543
- "div",
351
+ }
352
+ )
353
+ }
354
+ ),
355
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().firstContainer, children: [
356
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().row, children: /* @__PURE__ */ jsxRuntime.jsx(
357
+ Logo,
544
358
  {
545
- style: {
546
- overflowY: "auto",
547
- flex: "1"
548
- },
549
- children: /* @__PURE__ */ jsxRuntime.jsx(
550
- "div",
551
- {
552
- style: {
553
- padding: ".5em"
554
- },
555
- children: /* @__PURE__ */ jsxRuntime.jsx(
556
- Explorer.default,
557
- {
558
- label: "Router",
559
- value: Object.fromEntries(
560
- utils.multiSortBy(
561
- Object.keys(explorerState),
562
- [
563
- "state",
564
- "routesById",
565
- "routesByPath",
566
- "flatRoutes",
567
- "options"
568
- ].map((d) => (dd) => dd !== d)
569
- ).map((key) => [key, explorerState[key]]).filter(
570
- (d) => typeof d[1] !== "function" && ![
571
- "__store",
572
- "basepath",
573
- "injectedHtml",
574
- "subscribers",
575
- "latestLoadPromise",
576
- "navigateTimeout",
577
- "resetNextScroll",
578
- "tempLocationKey",
579
- "latestLocation",
580
- "routeTree",
581
- "history"
582
- ].includes(d[0])
583
- )
584
- ),
585
- defaultExpanded: {
586
- state: {},
587
- context: {},
588
- options: {}
589
- },
590
- filterSubEntries: (subEntries) => {
591
- return subEntries.filter((d) => typeof d.value !== "function");
592
- }
593
- }
594
- )
595
- }
596
- )
359
+ "aria-hidden": true,
360
+ onClick: (e) => {
361
+ setIsOpen(false);
362
+ onCloseClick(e);
363
+ }
597
364
  }
598
- )
599
- ]
600
- }
601
- ),
602
- /* @__PURE__ */ jsxRuntime.jsxs(
603
- "div",
604
- {
605
- style: {
606
- flex: "1 1 500px",
607
- minHeight: "40%",
608
- maxHeight: "100%",
609
- overflow: "auto",
610
- borderRight: `1px solid ${theme.defaultTheme.grayAlt}`,
611
- display: "flex",
612
- flexDirection: "column"
613
- },
614
- children: [
615
- /* @__PURE__ */ jsxRuntime.jsxs(
616
- "div",
365
+ ) }),
366
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().routerExplorerContainer, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().routerExplorer, children: /* @__PURE__ */ jsxRuntime.jsx(
367
+ Explorer.default,
617
368
  {
618
- style: {
619
- flex: "1 1 auto",
620
- overflowY: "auto"
369
+ label: "Router",
370
+ value: Object.fromEntries(
371
+ utils.multiSortBy(
372
+ Object.keys(explorerState),
373
+ [
374
+ "state",
375
+ "routesById",
376
+ "routesByPath",
377
+ "flatRoutes",
378
+ "options"
379
+ ].map((d) => (dd) => dd !== d)
380
+ ).map((key) => [key, explorerState[key]]).filter(
381
+ (d) => typeof d[1] !== "function" && ![
382
+ "__store",
383
+ "basepath",
384
+ "injectedHtml",
385
+ "subscribers",
386
+ "latestLoadPromise",
387
+ "navigateTimeout",
388
+ "resetNextScroll",
389
+ "tempLocationKey",
390
+ "latestLocation",
391
+ "routeTree",
392
+ "history"
393
+ ].includes(d[0])
394
+ )
395
+ ),
396
+ defaultExpanded: {
397
+ state: {},
398
+ context: {},
399
+ options: {}
621
400
  },
622
- children: [
623
- /* @__PURE__ */ jsxRuntime.jsxs(
624
- "div",
625
- {
626
- style: {
627
- padding: ".5em",
628
- background: theme.defaultTheme.backgroundAlt,
629
- position: "sticky",
630
- top: 0,
631
- zIndex: 1,
632
- display: "flex",
633
- alignItems: "center",
634
- gap: ".5rem",
635
- fontWeight: "bold"
636
- },
637
- children: [
638
- "Pathname",
639
- " ",
640
- routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx(
641
- "div",
642
- {
643
- style: {
644
- padding: ".1rem .5rem",
645
- background: theme.defaultTheme.warning,
646
- color: "black",
647
- borderRadius: ".5rem"
648
- },
649
- children: "Masked"
650
- }
651
- ) : null
652
- ]
653
- }
654
- ),
655
- /* @__PURE__ */ jsxRuntime.jsxs(
656
- "div",
657
- {
658
- style: {
659
- padding: ".5rem",
660
- display: "flex",
661
- gap: ".5rem",
662
- alignItems: "center"
663
- },
664
- children: [
665
- /* @__PURE__ */ jsxRuntime.jsx(
666
- "code",
667
- {
668
- style: {
669
- opacity: 0.6
670
- },
671
- children: routerState.location.pathname
672
- }
673
- ),
674
- routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx(
675
- "code",
676
- {
677
- style: {
678
- color: theme.defaultTheme.warning,
679
- fontWeight: "bold"
680
- },
681
- children: routerState.location.maskedLocation.pathname
682
- }
683
- ) : null
684
- ]
685
- }
686
- ),
687
- /* @__PURE__ */ jsxRuntime.jsxs(
688
- "div",
401
+ filterSubEntries: (subEntries) => {
402
+ return subEntries.filter((d) => typeof d.value !== "function");
403
+ }
404
+ }
405
+ ) }) })
406
+ ] }),
407
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().secondContainer, children: [
408
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().matchesContainer, children: [
409
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().detailsHeader, children: [
410
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Pathname" }),
411
+ routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().maskedBadgeContainer, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: getStyles().maskedBadge, children: "masked" }) }) : null
412
+ ] }),
413
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().detailsContent, children: [
414
+ /* @__PURE__ */ jsxRuntime.jsx("code", { children: routerState.location.pathname }),
415
+ routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: getStyles().maskedLocation, children: routerState.location.maskedLocation.pathname }) : null
416
+ ] }),
417
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().detailsHeader, children: [
418
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().routeMatchesToggle, children: [
419
+ /* @__PURE__ */ jsxRuntime.jsx(
420
+ "button",
689
421
  {
690
- style: {
691
- padding: ".5em",
692
- background: theme.defaultTheme.backgroundAlt,
693
- position: "sticky",
694
- top: 0,
695
- zIndex: 1,
696
- display: "flex",
697
- alignItems: "center",
698
- justifyContent: "space-between",
699
- gap: ".5rem",
700
- fontWeight: "bold"
422
+ type: "button",
423
+ onClick: () => {
424
+ setShowMatches(false);
701
425
  },
702
- children: [
703
- /* @__PURE__ */ jsxRuntime.jsxs(
704
- "div",
705
- {
706
- style: {
707
- display: "flex",
708
- alignItems: "center",
709
- gap: ".5rem"
710
- },
711
- children: [
712
- /* @__PURE__ */ jsxRuntime.jsx(
713
- "button",
714
- {
715
- type: "button",
716
- onClick: () => {
717
- setShowMatches(false);
718
- },
719
- disabled: !showMatches,
720
- style: {
721
- appearance: "none",
722
- opacity: showMatches ? 0.5 : 1,
723
- border: 0,
724
- background: "transparent",
725
- color: "inherit",
726
- cursor: "pointer"
727
- },
728
- children: "Routes"
729
- }
730
- ),
731
- "/",
732
- /* @__PURE__ */ jsxRuntime.jsx(
733
- "button",
734
- {
735
- type: "button",
736
- onClick: () => {
737
- setShowMatches(true);
738
- },
739
- disabled: showMatches,
740
- style: {
741
- appearance: "none",
742
- opacity: !showMatches ? 0.5 : 1,
743
- border: 0,
744
- background: "transparent",
745
- color: "inherit",
746
- cursor: "pointer"
747
- },
748
- children: "Matches"
749
- }
750
- )
751
- ]
752
- }
753
- ),
754
- /* @__PURE__ */ jsxRuntime.jsx(
755
- "div",
756
- {
757
- style: {
758
- opacity: 0.3,
759
- fontSize: "0.7rem",
760
- fontWeight: "normal"
761
- },
762
- children: "age / staleTime / gcTime"
763
- }
764
- )
765
- ]
426
+ disabled: !showMatches,
427
+ className: clsx.clsx(
428
+ getStyles().routeMatchesToggleBtn(!showMatches, true)
429
+ ),
430
+ children: "Routes"
766
431
  }
767
432
  ),
768
- !showMatches ? /* @__PURE__ */ jsxRuntime.jsx(
769
- RouteComp,
770
- {
771
- route: router.routeTree,
772
- isRoot: true,
773
- activeId,
774
- setActiveId
775
- }
776
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: (routerState.status === "pending" ? routerState.pendingMatches ?? [] : routerState.matches).map((match, i) => {
777
- return /* @__PURE__ */ jsxRuntime.jsxs(
778
- "div",
779
- {
780
- role: "button",
781
- "aria-label": `Open match details for ${match.id}`,
782
- onClick: () => setActiveId(activeId === match.id ? "" : match.id),
783
- style: {
784
- display: "flex",
785
- borderBottom: `solid 1px ${theme.defaultTheme.grayAlt}`,
786
- cursor: "pointer",
787
- alignItems: "center",
788
- background: match === activeMatch ? "rgba(255,255,255,.1)" : void 0
789
- },
790
- children: [
791
- /* @__PURE__ */ jsxRuntime.jsx(
792
- "div",
793
- {
794
- style: {
795
- flex: "0 0 auto",
796
- width: "1.3rem",
797
- height: "1.3rem",
798
- marginLeft: ".25rem",
799
- background: utils.getStatusColor(match, theme.defaultTheme),
800
- alignItems: "center",
801
- justifyContent: "center",
802
- fontWeight: "bold",
803
- borderRadius: ".25rem",
804
- transition: "all .2s ease-out"
805
- }
806
- }
807
- ),
808
- /* @__PURE__ */ jsxRuntime.jsx(
809
- styledComponents.Code,
810
- {
811
- style: {
812
- padding: ".5em",
813
- fontSize: "0.7rem"
814
- },
815
- children: `${match.id}`
816
- }
817
- ),
818
- /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match })
819
- ]
820
- },
821
- match.id || i
822
- );
823
- }) })
824
- ]
825
- }
826
- ),
827
- ((_a = routerState.cachedMatches) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsxs(
828
- "div",
829
- {
830
- style: {
831
- flex: "1 1 auto",
832
- overflowY: "auto",
833
- maxHeight: "50%"
834
- },
835
- children: [
836
- /* @__PURE__ */ jsxRuntime.jsxs(
837
- "div",
433
+ /* @__PURE__ */ jsxRuntime.jsx(
434
+ "button",
838
435
  {
839
- style: {
840
- padding: ".5em",
841
- background: theme.defaultTheme.backgroundAlt,
842
- position: "sticky",
843
- top: 0,
844
- zIndex: 1,
845
- display: "flex",
846
- alignItems: "center",
847
- justifyContent: "space-between",
848
- gap: ".5rem",
849
- fontWeight: "bold"
436
+ type: "button",
437
+ onClick: () => {
438
+ setShowMatches(true);
850
439
  },
851
- children: [
852
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Cached Matches" }),
853
- /* @__PURE__ */ jsxRuntime.jsx(
854
- "div",
855
- {
856
- style: {
857
- opacity: 0.3,
858
- fontSize: "0.7rem",
859
- fontWeight: "normal"
860
- },
861
- children: "age / staleTime / gcTime"
862
- }
863
- )
864
- ]
440
+ disabled: showMatches,
441
+ className: clsx.clsx(
442
+ getStyles().routeMatchesToggleBtn(!!showMatches, false)
443
+ ),
444
+ children: "Matches"
865
445
  }
866
- ),
867
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: routerState.cachedMatches.map((match) => {
868
- return /* @__PURE__ */ jsxRuntime.jsxs(
869
- "div",
870
- {
871
- role: "button",
872
- "aria-label": `Open match details for ${match.id}`,
873
- onClick: () => setActiveId(activeId === match.id ? "" : match.id),
874
- style: {
875
- display: "flex",
876
- borderBottom: `solid 1px ${theme.defaultTheme.grayAlt}`,
877
- cursor: "pointer",
878
- alignItems: "center",
879
- background: match === activeMatch ? "rgba(255,255,255,.1)" : void 0,
880
- fontSize: "0.7rem"
881
- },
882
- children: [
883
- /* @__PURE__ */ jsxRuntime.jsx(
884
- "div",
885
- {
886
- style: {
887
- flex: "0 0 auto",
888
- width: ".75rem",
889
- height: ".75rem",
890
- marginLeft: ".25rem",
891
- background: utils.getStatusColor(match, theme.defaultTheme),
892
- alignItems: "center",
893
- justifyContent: "center",
894
- fontWeight: "bold",
895
- borderRadius: "100%",
896
- transition: "all 1s ease-out"
897
- }
898
- }
899
- ),
900
- /* @__PURE__ */ jsxRuntime.jsx(
901
- styledComponents.Code,
902
- {
903
- style: {
904
- padding: ".5em"
905
- },
906
- children: `${match.id}`
907
- }
908
- ),
909
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match }) })
910
- ]
911
- },
912
- match.id
913
- );
914
- }) })
915
- ]
916
- }
917
- ) : null
918
- ]
919
- }
920
- ),
921
- activeMatch ? /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.ActivePanel, { children: [
922
- /* @__PURE__ */ jsxRuntime.jsx(
923
- "div",
924
- {
925
- style: {
926
- padding: ".5em",
927
- background: theme.defaultTheme.backgroundAlt,
928
- position: "sticky",
929
- top: 0,
930
- bottom: 0,
931
- zIndex: 1
932
- },
933
- children: "Match Details"
934
- }
935
- ),
936
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
937
- "table",
938
- {
939
- style: {
940
- fontSize: "0.8rem"
941
- },
942
- children: /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
943
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
944
- /* @__PURE__ */ jsxRuntime.jsx("td", { style: { opacity: ".5" }, children: "ID" }),
945
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
946
- styledComponents.Code,
446
+ )
447
+ ] }),
448
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeaderInfo, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "age / staleTime / gcTime" }) })
449
+ ] }),
450
+ !showMatches ? /* @__PURE__ */ jsxRuntime.jsx(
451
+ RouteComp,
452
+ {
453
+ route: router.routeTree,
454
+ isRoot: true,
455
+ activeId,
456
+ setActiveId
457
+ }
458
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: (routerState.status === "pending" ? routerState.pendingMatches ?? [] : routerState.matches).map((match, i) => {
459
+ return /* @__PURE__ */ jsxRuntime.jsxs(
460
+ "div",
947
461
  {
948
- style: {
949
- lineHeight: "1.8em"
950
- },
951
- children: JSON.stringify(activeMatch.id, null, 2)
952
- }
953
- ) })
462
+ role: "button",
463
+ "aria-label": `Open match details for ${match.id}`,
464
+ onClick: () => setActiveId(activeId === match.id ? "" : match.id),
465
+ className: clsx.clsx(getStyles().matchRow(match === activeMatch)),
466
+ children: [
467
+ /* @__PURE__ */ jsxRuntime.jsx(
468
+ "div",
469
+ {
470
+ className: clsx.clsx(
471
+ getStyles().matchIndicator(utils.getStatusColor(match))
472
+ )
473
+ }
474
+ ),
475
+ /* @__PURE__ */ jsxRuntime.jsx(
476
+ "code",
477
+ {
478
+ className: getStyles().matchID,
479
+ children: `${match.routeId === "__root__" ? "__root__" : match.pathname}`
480
+ }
481
+ ),
482
+ /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match })
483
+ ]
484
+ },
485
+ match.id || i
486
+ );
487
+ }) })
488
+ ] }),
489
+ ((_a = routerState.cachedMatches) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().cachedMatchesContainer, children: [
490
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().detailsHeader, children: [
491
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Cached Matches" }),
492
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeaderInfo, children: "age / staleTime / gcTime" })
954
493
  ] }),
955
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
956
- /* @__PURE__ */ jsxRuntime.jsx("td", { style: { opacity: ".5" }, children: "Status" }),
957
- /* @__PURE__ */ jsxRuntime.jsxs("td", { children: [
958
- ((_b = routerState.pendingMatches) == null ? void 0 : _b.find(
959
- (d) => d.id === activeMatch.id
960
- )) ? "Pending" : ((_c = routerState.matches) == null ? void 0 : _c.find(
961
- (d) => d.id === activeMatch.id
962
- )) ? "Active" : "Cached",
963
- " ",
964
- "- ",
965
- activeMatch.status
966
- ] })
494
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: routerState.cachedMatches.map((match) => {
495
+ return /* @__PURE__ */ jsxRuntime.jsxs(
496
+ "div",
497
+ {
498
+ role: "button",
499
+ "aria-label": `Open match details for ${match.id}`,
500
+ onClick: () => setActiveId(activeId === match.id ? "" : match.id),
501
+ className: clsx.clsx(getStyles().matchRow(match === activeMatch)),
502
+ children: [
503
+ /* @__PURE__ */ jsxRuntime.jsx(
504
+ "div",
505
+ {
506
+ className: clsx.clsx(
507
+ getStyles().matchIndicator(utils.getStatusColor(match))
508
+ )
509
+ }
510
+ ),
511
+ /* @__PURE__ */ jsxRuntime.jsx("code", { className: getStyles().matchID, children: `${match.id}` }),
512
+ /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match })
513
+ ]
514
+ },
515
+ match.id
516
+ );
517
+ }) })
518
+ ] }) : null
519
+ ] }),
520
+ activeMatch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().thirdContainer, children: [
521
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeader, children: "Match Details" }),
522
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().matchDetails, children: [
523
+ /* @__PURE__ */ jsxRuntime.jsx(
524
+ "div",
525
+ {
526
+ className: getStyles().matchStatus(
527
+ activeMatch.status,
528
+ activeMatch.isFetching
529
+ ),
530
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: activeMatch.status === "success" && activeMatch.isFetching ? "fetching" : activeMatch.status })
531
+ }
532
+ ),
533
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
534
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "ID:" }),
535
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().matchDetailsInfo, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: activeMatch.id }) })
967
536
  ] }),
968
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
969
- /* @__PURE__ */ jsxRuntime.jsx("td", { style: { opacity: ".5" }, children: "Last Updated" }),
970
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: activeMatch.updatedAt ? new Date(
537
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
538
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "State:" }),
539
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().matchDetailsInfo, children: ((_b = routerState.pendingMatches) == null ? void 0 : _b.find(
540
+ (d) => d.id === activeMatch.id
541
+ )) ? "Pending" : ((_c = routerState.matches) == null ? void 0 : _c.find((d) => d.id === activeMatch.id)) ? "Active" : "Cached" })
542
+ ] }),
543
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
544
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Last Updated:" }),
545
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().matchDetailsInfo, children: activeMatch.updatedAt ? new Date(
971
546
  activeMatch.updatedAt
972
547
  ).toLocaleTimeString() : "N/A" })
973
548
  ] })
974
- ] })
975
- }
976
- ) }),
977
- activeMatch.loaderData ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
978
- /* @__PURE__ */ jsxRuntime.jsx(
979
- "div",
980
- {
981
- style: {
982
- background: theme.defaultTheme.backgroundAlt,
983
- padding: ".5em",
984
- position: "sticky",
985
- top: 0,
986
- bottom: 0,
987
- zIndex: 1
988
- },
989
- children: "Loader Data"
990
- }
991
- ),
992
- /* @__PURE__ */ jsxRuntime.jsx(
993
- "div",
994
- {
995
- style: {
996
- padding: ".5em"
997
- },
998
- children: /* @__PURE__ */ jsxRuntime.jsx(
549
+ ] }) }),
550
+ activeMatch.loaderData ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
551
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeader, children: "Loader Data" }),
552
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
999
553
  Explorer.default,
1000
554
  {
1001
555
  label: "loaderData",
1002
556
  value: activeMatch.loaderData,
1003
557
  defaultExpanded: {}
1004
558
  }
1005
- )
1006
- }
1007
- )
1008
- ] }) : null,
1009
- /* @__PURE__ */ jsxRuntime.jsx(
1010
- "div",
1011
- {
1012
- style: {
1013
- background: theme.defaultTheme.backgroundAlt,
1014
- padding: ".5em",
1015
- position: "sticky",
1016
- top: 0,
1017
- bottom: 0,
1018
- zIndex: 1
1019
- },
1020
- children: "Explorer"
1021
- }
1022
- ),
1023
- /* @__PURE__ */ jsxRuntime.jsx(
1024
- "div",
1025
- {
1026
- style: {
1027
- padding: ".5em"
1028
- },
1029
- children: /* @__PURE__ */ jsxRuntime.jsx(
559
+ ) })
560
+ ] }) : null,
561
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeader, children: "Explorer" }),
562
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(Explorer.default, { label: "Match", value: activeMatch, defaultExpanded: {} }) })
563
+ ] }) : null,
564
+ hasSearch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: getStyles().fourthContainer, children: [
565
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsHeader, children: "Search Params" }),
566
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
1030
567
  Explorer.default,
1031
568
  {
1032
- label: "Match",
1033
- value: activeMatch,
1034
- defaultExpanded: {}
1035
- }
1036
- )
1037
- }
1038
- )
1039
- ] }) : null,
1040
- hasSearch ? /* @__PURE__ */ jsxRuntime.jsxs(
1041
- "div",
1042
- {
1043
- style: {
1044
- flex: "1 1 500px",
1045
- minHeight: "40%",
1046
- maxHeight: "100%",
1047
- overflow: "auto",
1048
- borderRight: `1px solid ${theme.defaultTheme.grayAlt}`,
1049
- display: "flex",
1050
- flexDirection: "column"
1051
- },
1052
- children: [
1053
- /* @__PURE__ */ jsxRuntime.jsx(
1054
- "div",
1055
- {
1056
- style: {
1057
- padding: ".5em",
1058
- background: theme.defaultTheme.backgroundAlt,
1059
- position: "sticky",
1060
- top: 0,
1061
- bottom: 0,
1062
- zIndex: 1,
1063
- fontWeight: "bold"
1064
- },
1065
- children: "Search Params"
1066
- }
1067
- ),
1068
- /* @__PURE__ */ jsxRuntime.jsx(
1069
- "div",
1070
- {
1071
- style: {
1072
- padding: ".5em"
1073
- },
1074
- children: /* @__PURE__ */ jsxRuntime.jsx(
1075
- Explorer.default,
1076
- {
1077
- value: routerState.location.search || {},
1078
- defaultExpanded: Object.keys(
1079
- routerState.location.search || {}
1080
- ).reduce((obj, next) => {
1081
- obj[next] = {};
1082
- return obj;
1083
- }, {})
1084
- }
1085
- )
569
+ value: routerState.location.search || {},
570
+ defaultExpanded: Object.keys(
571
+ routerState.location.search || {}
572
+ ).reduce((obj, next) => {
573
+ obj[next] = {};
574
+ return obj;
575
+ }, {})
1086
576
  }
1087
- )
1088
- ]
1089
- }
1090
- ) : null
1091
- ] }) });
577
+ ) })
578
+ ] }) : null
579
+ ]
580
+ }
581
+ );
1092
582
  });
1093
583
  function AgeTicker({ match }) {
1094
584
  const router = reactRouter.useRouter();
@@ -1114,24 +604,13 @@ function AgeTicker({ match }) {
1114
604
  const age = Date.now() - (match == null ? void 0 : match.updatedAt);
1115
605
  const staleTime = route.options.staleTime ?? router.options.defaultStaleTime ?? 0;
1116
606
  const gcTime = route.options.gcTime ?? router.options.defaultGcTime ?? 30 * 60 * 1e3;
1117
- return /* @__PURE__ */ jsxRuntime.jsxs(
1118
- "div",
1119
- {
1120
- style: {
1121
- display: "inline-flex",
1122
- alignItems: "center",
1123
- gap: ".25rem",
1124
- color: age > staleTime ? theme.defaultTheme.warning : void 0
1125
- },
1126
- children: [
1127
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: {}, children: formatTime(age) }),
1128
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
1129
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(staleTime) }),
1130
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
1131
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(gcTime) })
1132
- ]
1133
- }
1134
- );
607
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(getStyles().ageTicker(age > staleTime)), children: [
608
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(age) }),
609
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
610
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(staleTime) }),
611
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
612
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(gcTime) })
613
+ ] });
1135
614
  }
1136
615
  function formatTime(ms) {
1137
616
  const units = ["s", "min", "h", "d"];
@@ -1149,6 +628,546 @@ function formatTime(ms) {
1149
628
  });
1150
629
  return formatter.format(values[chosenUnitIndex]) + units[chosenUnitIndex];
1151
630
  }
631
+ const stylesFactory = () => {
632
+ const { colors, font, size, alpha, shadow, border } = tokens.tokens;
633
+ const { fontFamily, lineHeight, size: fontSize } = font;
634
+ return {
635
+ devtoolsPanelContainer: goober.css`
636
+ direction: ltr;
637
+ position: fixed;
638
+ bottom: 0;
639
+ right: 0;
640
+ z-index: 99999;
641
+ width: 100%;
642
+ max-height: 90%;
643
+ border-top: 1px solid ${colors.gray[700]};
644
+ transform-origin: top;
645
+ `,
646
+ devtoolsPanelContainerVisibility: (isOpen) => {
647
+ return goober.css`
648
+ visibility: ${isOpen ? "visible" : "hidden"};
649
+ `;
650
+ },
651
+ devtoolsPanelContainerResizing: (isResizing) => {
652
+ if (isResizing) {
653
+ return goober.css`
654
+ transition: none;
655
+ `;
656
+ }
657
+ return goober.css`
658
+ transition: all 0.4s ease;
659
+ `;
660
+ },
661
+ devtoolsPanelContainerAnimation: (isOpen, height) => {
662
+ if (isOpen) {
663
+ return goober.css`
664
+ pointer-events: auto;
665
+ transform: translateY(0);
666
+ `;
667
+ }
668
+ return goober.css`
669
+ pointer-events: none;
670
+ transform: translateY(${height}px);
671
+ `;
672
+ },
673
+ logo: goober.css`
674
+ cursor: pointer;
675
+ display: flex;
676
+ flex-direction: column;
677
+ background-color: transparent;
678
+ border: none;
679
+ font-family: ${fontFamily.sans};
680
+ gap: ${tokens.tokens.size[0.5]};
681
+ padding: 0px;
682
+ &:hover {
683
+ opacity: 0.7;
684
+ }
685
+ &:focus-visible {
686
+ outline-offset: 4px;
687
+ border-radius: ${border.radius.xs};
688
+ outline: 2px solid ${colors.blue[800]};
689
+ }
690
+ `,
691
+ tanstackLogo: goober.css`
692
+ font-size: ${font.size.md};
693
+ font-weight: ${font.weight.bold};
694
+ line-height: ${font.lineHeight.xs};
695
+ white-space: nowrap;
696
+ color: ${colors.gray[300]};
697
+ `,
698
+ routerLogo: goober.css`
699
+ font-weight: ${font.weight.semibold};
700
+ font-size: ${font.size.xs};
701
+ background: linear-gradient(to right, #84cc16, #10b981);
702
+ background-clip: text;
703
+ -webkit-background-clip: text;
704
+ line-height: 1;
705
+ -webkit-text-fill-color: transparent;
706
+ white-space: nowrap;
707
+ `,
708
+ devtoolsPanel: goober.css`
709
+ display: flex;
710
+ font-size: ${fontSize.sm};
711
+ font-family: ${fontFamily.sans};
712
+ background-color: ${colors.darkGray[700]};
713
+ color: ${colors.gray[300]};
714
+
715
+ @media (max-width: 700px) {
716
+ flex-direction: column;
717
+ }
718
+ @media (max-width: 600px) {
719
+ font-size: ${fontSize.xs};
720
+ }
721
+ `,
722
+ dragHandle: goober.css`
723
+ position: absolute;
724
+ left: 0;
725
+ top: 0;
726
+ width: 100%;
727
+ height: 4px;
728
+ cursor: row-resize;
729
+ z-index: 100000;
730
+ &:hover {
731
+ background-color: ${colors.purple[400]}${alpha[90]};
732
+ }
733
+ `,
734
+ firstContainer: goober.css`
735
+ flex: 1 1 500px;
736
+ min-height: 40%;
737
+ max-height: 100%;
738
+ overflow: auto;
739
+ border-right: 1px solid ${colors.gray[700]};
740
+ display: flex;
741
+ flex-direction: column;
742
+ `,
743
+ routerExplorerContainer: goober.css`
744
+ overflow-y: auto;
745
+ flex: 1;
746
+ `,
747
+ routerExplorer: goober.css`
748
+ padding: ${tokens.tokens.size[2]};
749
+ `,
750
+ row: goober.css`
751
+ display: flex;
752
+ align-items: center;
753
+ padding: ${tokens.tokens.size[2]} ${tokens.tokens.size[2.5]};
754
+ gap: ${tokens.tokens.size[2.5]};
755
+ border-bottom: ${colors.darkGray[500]} 1px solid;
756
+ align-items: center;
757
+ `,
758
+ detailsHeader: goober.css`
759
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
760
+ position: sticky;
761
+ top: 0;
762
+ z-index: 2;
763
+ background-color: ${colors.darkGray[600]};
764
+ padding: 0px ${tokens.tokens.size[2]};
765
+ font-weight: ${font.weight.medium};
766
+ font-size: ${font.size.xs};
767
+ min-height: ${tokens.tokens.size[8]};
768
+ line-height: ${font.lineHeight.xs};
769
+ text-align: left;
770
+ display: flex;
771
+ align-items: center;
772
+ `,
773
+ maskedBadge: goober.css`
774
+ background: ${colors.yellow[900]}${alpha[70]};
775
+ color: ${colors.yellow[300]};
776
+ display: inline-block;
777
+ padding: ${tokens.tokens.size[0]} ${tokens.tokens.size[2.5]};
778
+ border-radius: ${border.radius.full};
779
+ font-size: ${font.size.xs};
780
+ font-weight: ${font.weight.normal};
781
+ border: 1px solid ${colors.yellow[300]};
782
+ `,
783
+ maskedLocation: goober.css`
784
+ color: ${colors.yellow[300]};
785
+ `,
786
+ detailsContent: goober.css`
787
+ padding: ${tokens.tokens.size[1.5]} ${tokens.tokens.size[2]};
788
+ display: flex;
789
+ align-items: center;
790
+ font-size: ${font.size.xs};
791
+ `,
792
+ routeMatchesToggle: goober.css`
793
+ display: flex;
794
+ align-items: center;
795
+ border: 1px solid ${colors.gray[500]};
796
+ border-radius: ${border.radius.sm};
797
+ overflow: hidden;
798
+ `,
799
+ routeMatchesToggleBtn: (active, showBorder) => {
800
+ const base = goober.css`
801
+ appearance: none;
802
+ border: none;
803
+ font-size: 12px;
804
+ padding: 4px 8px;
805
+ background: transparent;
806
+ cursor: pointer;
807
+ font-family: ${fontFamily.sans};
808
+ font-weight: ${font.weight.medium};
809
+ `;
810
+ const classes = [base];
811
+ if (active) {
812
+ const activeStyles = goober.css`
813
+ background: ${colors.darkGray[400]};
814
+ color: ${colors.gray[300]};
815
+ `;
816
+ classes.push(activeStyles);
817
+ } else {
818
+ const inactiveStyles = goober.css`
819
+ color: ${colors.gray[500]};
820
+ background: ${colors.darkGray[800]}${alpha[20]};
821
+ `;
822
+ classes.push(inactiveStyles);
823
+ }
824
+ if (showBorder) {
825
+ const border2 = goober.css`
826
+ border-right: 1px solid ${tokens.tokens.colors.gray[500]};
827
+ `;
828
+ classes.push(border2);
829
+ }
830
+ return classes;
831
+ },
832
+ detailsHeaderInfo: goober.css`
833
+ flex: 1;
834
+ justify-content: flex-end;
835
+ display: flex;
836
+ align-items: center;
837
+ font-weight: ${font.weight.normal};
838
+ color: ${colors.gray[400]};
839
+ `,
840
+ matchRow: (active) => {
841
+ const base = goober.css`
842
+ display: flex;
843
+ border-bottom: 1px solid ${colors.darkGray[400]};
844
+ cursor: pointer;
845
+ align-items: center;
846
+ padding: ${size[1]} ${size[2]};
847
+ gap: ${size[2]};
848
+ font-size: ${fontSize.xs};
849
+ color: ${colors.gray[300]};
850
+ `;
851
+ const classes = [base];
852
+ if (active) {
853
+ const activeStyles = goober.css`
854
+ background: ${colors.darkGray[500]};
855
+ `;
856
+ classes.push(activeStyles);
857
+ }
858
+ return classes;
859
+ },
860
+ matchIndicator: (color) => {
861
+ const base = goober.css`
862
+ flex: 0 0 auto;
863
+ width: ${size[3]};
864
+ height: ${size[3]};
865
+ background: ${colors[color][900]};
866
+ border: 1px solid ${colors[color][500]};
867
+ border-radius: ${border.radius.full};
868
+ transition: all 0.25s ease-out;
869
+ box-sizing: border-box;
870
+ `;
871
+ const classes = [base];
872
+ if (color === "gray") {
873
+ const grayStyles = goober.css`
874
+ background: ${colors.gray[700]};
875
+ border-color: ${colors.gray[400]};
876
+ `;
877
+ classes.push(grayStyles);
878
+ }
879
+ return classes;
880
+ },
881
+ matchID: goober.css`
882
+ flex: 1;
883
+ line-height: ${lineHeight["xs"]};
884
+ `,
885
+ ageTicker: (showWarning) => {
886
+ const base = goober.css`
887
+ display: flex;
888
+ gap: ${size[1]};
889
+ font-size: ${fontSize.xs};
890
+ color: ${colors.gray[400]};
891
+ font-variant-numeric: tabular-nums;
892
+ line-height: ${lineHeight["xs"]};
893
+ `;
894
+ const classes = [base];
895
+ if (showWarning) {
896
+ const warningStyles = goober.css`
897
+ color: ${colors.yellow[400]};
898
+ `;
899
+ classes.push(warningStyles);
900
+ }
901
+ return classes;
902
+ },
903
+ secondContainer: goober.css`
904
+ flex: 1 1 500px;
905
+ min-height: 40%;
906
+ max-height: 100%;
907
+ overflow: auto;
908
+ border-right: 1px solid ${colors.gray[700]};
909
+ display: flex;
910
+ flex-direction: column;
911
+ `,
912
+ thirdContainer: goober.css`
913
+ flex: 1 1 500px;
914
+ overflow: auto;
915
+ display: flex;
916
+ flex-direction: column;
917
+ height: 100%;
918
+ border-right: 1px solid ${colors.gray[700]};
919
+
920
+ @media (max-width: 700px) {
921
+ border-top: 2px solid ${colors.gray[700]};
922
+ }
923
+ `,
924
+ fourthContainer: goober.css`
925
+ flex: 1 1 500px;
926
+ min-height: 40%;
927
+ max-height: 100%;
928
+ overflow: auto;
929
+ display: flex;
930
+ flex-direction: column;
931
+ `,
932
+ routesRowContainer: (active, isMatch) => {
933
+ const base = goober.css`
934
+ display: flex;
935
+ border-bottom: 1px solid ${colors.darkGray[400]};
936
+ align-items: center;
937
+ padding: ${size[1]} ${size[2]};
938
+ gap: ${size[2]};
939
+ font-size: ${fontSize.xs};
940
+ color: ${colors.gray[300]};
941
+ cursor: ${isMatch ? "pointer" : "default"};
942
+ line-height: ${lineHeight["xs"]};
943
+ `;
944
+ const classes = [base];
945
+ if (active) {
946
+ const activeStyles = goober.css`
947
+ background: ${colors.darkGray[500]};
948
+ `;
949
+ classes.push(activeStyles);
950
+ }
951
+ return classes;
952
+ },
953
+ routesRow: (isMatch) => {
954
+ const base = goober.css`
955
+ flex: 1 0 auto;
956
+ display: flex;
957
+ justify-content: space-between;
958
+ align-items: center;
959
+ font-size: ${fontSize.xs};
960
+ line-height: ${lineHeight["xs"]};
961
+ `;
962
+ const classes = [base];
963
+ if (!isMatch) {
964
+ const matchStyles = goober.css`
965
+ color: ${colors.gray[400]};
966
+ `;
967
+ classes.push(matchStyles);
968
+ }
969
+ return classes;
970
+ },
971
+ routeParamInfo: goober.css`
972
+ color: ${colors.gray[400]};
973
+ font-size: ${fontSize.xs};
974
+ line-height: ${lineHeight["xs"]};
975
+ `,
976
+ nestedRouteRow: (isRoot) => {
977
+ const base = goober.css`
978
+ margin-left: ${isRoot ? 0 : size[3.5]};
979
+ border-left: ${isRoot ? "" : `solid 1px ${colors.gray[700]}`};
980
+ `;
981
+ return base;
982
+ },
983
+ code: goober.css`
984
+ font-size: ${fontSize.xs};
985
+ line-height: ${lineHeight["xs"]};
986
+ `,
987
+ matchesContainer: goober.css`
988
+ flex: 1 1 auto;
989
+ overflow-y: auto;
990
+ `,
991
+ cachedMatchesContainer: goober.css`
992
+ flex: 1 1 auto;
993
+ overflow-y: auto;
994
+ max-height: 50%;
995
+ `,
996
+ maskedBadgeContainer: goober.css`
997
+ flex: 1;
998
+ justify-content: flex-end;
999
+ display: flex;
1000
+ `,
1001
+ matchDetails: goober.css`
1002
+ display: flex;
1003
+ flex-direction: column;
1004
+ padding: ${tokens.tokens.size[2]};
1005
+ font-size: ${tokens.tokens.font.size.xs};
1006
+ color: ${tokens.tokens.colors.gray[300]};
1007
+ line-height: ${tokens.tokens.font.lineHeight.sm};
1008
+ `,
1009
+ matchStatus: (status, isFetching) => {
1010
+ const colorMap = {
1011
+ pending: "yellow",
1012
+ success: "green",
1013
+ error: "red"
1014
+ };
1015
+ const color = isFetching && status === "success" ? "blue" : colorMap[status];
1016
+ return goober.css`
1017
+ display: flex;
1018
+ justify-content: center;
1019
+ align-items: center;
1020
+ height: 40px;
1021
+ border-radius: ${tokens.tokens.border.radius.sm};
1022
+ font-weight: ${tokens.tokens.font.weight.normal};
1023
+ background-color: ${tokens.tokens.colors[color][900]}${tokens.tokens.alpha[90]};
1024
+ color: ${tokens.tokens.colors[color][300]};
1025
+ border: 1px solid ${tokens.tokens.colors[color][600]};
1026
+ margin-bottom: ${tokens.tokens.size[2]};
1027
+ transition: all 0.25s ease-out;
1028
+ `;
1029
+ },
1030
+ matchDetailsInfo: goober.css`
1031
+ display: flex;
1032
+ justify-content: flex-end;
1033
+ flex: 1;
1034
+ `,
1035
+ matchDetailsInfoLabel: goober.css`
1036
+ display: flex;
1037
+ `,
1038
+ mainCloseBtn: goober.css`
1039
+ background: ${colors.darkGray[700]};
1040
+ padding: ${size[1]} ${size[2]} ${size[1]} ${size[1.5]};
1041
+ border-radius: ${border.radius.md};
1042
+ position: fixed;
1043
+ z-index: 99999;
1044
+ display: inline-flex;
1045
+ width: fit-content;
1046
+ cursor: pointer;
1047
+ appearance: none;
1048
+ border: 0;
1049
+ gap: 8px;
1050
+ align-items: center;
1051
+ border: 1px solid ${colors.gray[500]};
1052
+ font-size: ${font.size.xs};
1053
+ cursor: pointer;
1054
+ transition: all 0.25s ease-out;
1055
+
1056
+ &:hover {
1057
+ background: ${colors.darkGray[500]};
1058
+ }
1059
+ `,
1060
+ mainCloseBtnPosition: (position) => {
1061
+ const base = goober.css`
1062
+ ${position === "top-left" ? `top: ${size[2]}; left: ${size[2]};` : ""}
1063
+ ${position === "top-right" ? `top: ${size[2]}; right: ${size[2]};` : ""}
1064
+ ${position === "bottom-left" ? `bottom: ${size[2]}; left: ${size[2]};` : ""}
1065
+ ${position === "bottom-right" ? `bottom: ${size[2]}; right: ${size[2]};` : ""}
1066
+ `;
1067
+ return base;
1068
+ },
1069
+ mainCloseBtnAnimation: (isOpen) => {
1070
+ if (isOpen) {
1071
+ return goober.css`
1072
+ opacity: 1;
1073
+ pointer-events: auto;
1074
+ visibility: visible;
1075
+ `;
1076
+ }
1077
+ return goober.css`
1078
+ opacity: 0;
1079
+ pointer-events: none;
1080
+ visibility: hidden;
1081
+ `;
1082
+ },
1083
+ routerLogoCloseButton: goober.css`
1084
+ font-weight: ${font.weight.semibold};
1085
+ font-size: ${font.size.xs};
1086
+ background: linear-gradient(to right, #98f30c, #00f4a3);
1087
+ background-clip: text;
1088
+ -webkit-background-clip: text;
1089
+ line-height: 1;
1090
+ -webkit-text-fill-color: transparent;
1091
+ white-space: nowrap;
1092
+ `,
1093
+ mainCloseBtnDivider: goober.css`
1094
+ width: 1px;
1095
+ background: ${tokens.tokens.colors.gray[600]};
1096
+ height: 100%;
1097
+ border-radius: 999999px;
1098
+ color: transparent;
1099
+ `,
1100
+ mainCloseBtnIconContainer: goober.css`
1101
+ position: relative;
1102
+ width: ${size[5]};
1103
+ height: ${size[5]};
1104
+ background: pink;
1105
+ border-radius: 999999px;
1106
+ overflow: hidden;
1107
+ `,
1108
+ mainCloseBtnIconOuter: goober.css`
1109
+ width: ${size[5]};
1110
+ height: ${size[5]};
1111
+ position: absolute;
1112
+ top: 50%;
1113
+ left: 50%;
1114
+ transform: translate(-50%, -50%);
1115
+ filter: blur(3px) saturate(1.8) contrast(2);
1116
+ `,
1117
+ mainCloseBtnIconInner: goober.css`
1118
+ width: ${size[4]};
1119
+ height: ${size[4]};
1120
+ position: absolute;
1121
+ top: 50%;
1122
+ left: 50%;
1123
+ transform: translate(-50%, -50%);
1124
+ `,
1125
+ panelCloseBtn: goober.css`
1126
+ position: absolute;
1127
+ cursor: pointer;
1128
+ z-index: 100001;
1129
+ display: flex;
1130
+ align-items: center;
1131
+ justify-content: center;
1132
+ outline: none;
1133
+ background-color: ${colors.darkGray[700]};
1134
+ &:hover {
1135
+ background-color: ${colors.darkGray[500]};
1136
+ }
1137
+
1138
+ top: 0;
1139
+ right: ${size[2]};
1140
+ transform: translate(0, -100%);
1141
+ border-right: ${colors.darkGray[300]} 1px solid;
1142
+ border-left: ${colors.darkGray[300]} 1px solid;
1143
+ border-top: ${colors.darkGray[300]} 1px solid;
1144
+ border-bottom: none;
1145
+ border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
1146
+ padding: ${size[1]} ${size[1.5]} ${size[0.5]} ${size[1.5]};
1147
+
1148
+ &::after {
1149
+ content: ' ';
1150
+ position: absolute;
1151
+ top: 100%;
1152
+ left: -${size[2.5]};
1153
+ height: ${size[1.5]};
1154
+ width: calc(100% + ${size[5]});
1155
+ }
1156
+ `,
1157
+ panelCloseBtnIcon: goober.css`
1158
+ color: ${colors.gray[400]};
1159
+ width: ${size[2]};
1160
+ height: ${size[2]};
1161
+ `
1162
+ };
1163
+ };
1164
+ let _styles = null;
1165
+ function getStyles() {
1166
+ if (_styles)
1167
+ return _styles;
1168
+ _styles = stylesFactory();
1169
+ return _styles;
1170
+ }
1152
1171
  exports.TanStackRouterDevtools = TanStackRouterDevtools;
1153
1172
  exports.TanStackRouterDevtoolsPanel = TanStackRouterDevtoolsPanel;
1154
1173
  //# sourceMappingURL=devtools.cjs.map