@alexandregme/zljs 3.22.0 → 3.23.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/CHANGELOG.md +48 -1
- package/README.md +49 -8
- package/dist/{chunk-GQX4SRDD.js → chunk-BWPXWRLC.js} +393 -223
- package/dist/{chunk-VW4GICIJ.js → chunk-US6IUIXD.js} +2 -2
- package/dist/index.d.ts +83 -11
- package/dist/index.js +39 -29
- package/dist/next/index.js +4 -2
- package/dist/rhf/index.js +1 -1
- package/dist/styles/colors.css +58 -29
- package/dist/styles/scrollbar.css +12 -3
- package/dist/styles/theme.css +17 -0
- package/dist/styles.css +1 -0
- package/package.json +1 -1
|
@@ -81,7 +81,7 @@ var button = tv2({
|
|
|
81
81
|
variants: {
|
|
82
82
|
variant: {
|
|
83
83
|
default: "px-4 py-2 text-sm gap-2 rounded-md",
|
|
84
|
-
icon: "p-1 bg-transparent text-
|
|
84
|
+
icon: "p-1 bg-transparent text-zl-muted hover:text-zl-text-soft hover:bg-zl-surface-muted rounded-md",
|
|
85
85
|
// The invisible ::after grows the touch target to 44px without changing the layout.
|
|
86
86
|
link: "relative text-xs hover:underline rounded-sm after:absolute after:top-1/2 after:left-1/2 after:h-11 after:w-full after:min-w-11 after:-translate-x-1/2 after:-translate-y-1/2"
|
|
87
87
|
},
|
|
@@ -92,7 +92,7 @@ var button = tv2({
|
|
|
92
92
|
warning: "bg-zl-warning-bg hover:bg-zl-warning-hover text-zl-warning-on focus-visible:outline-zl-warning",
|
|
93
93
|
info: "bg-zl-info-bg hover:bg-zl-info-hover text-zl-info-on focus-visible:outline-zl-info",
|
|
94
94
|
muted: "bg-zl-muted-bg hover:bg-zl-muted-hover text-zl-muted-on focus-visible:outline-zl-muted",
|
|
95
|
-
ghost: "bg-transparent text-current hover:text-current hover:bg-neutral-500/20",
|
|
95
|
+
ghost: "bg-transparent text-current hover:text-current hover:bg-neutral-500/20 aria-pressed:bg-neutral-500/30",
|
|
96
96
|
none: ""
|
|
97
97
|
},
|
|
98
98
|
size: {
|
|
@@ -108,7 +108,7 @@ var button = tv2({
|
|
|
108
108
|
{
|
|
109
109
|
variant: "default",
|
|
110
110
|
color: "none",
|
|
111
|
-
class: "bg-
|
|
111
|
+
class: "bg-zl-surface-muted text-zl-text hover:bg-zl-surface-hover"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
variant: "default",
|
|
@@ -163,7 +163,7 @@ var button = tv2({
|
|
|
163
163
|
{
|
|
164
164
|
variant: "link",
|
|
165
165
|
color: "none",
|
|
166
|
-
class: "text-
|
|
166
|
+
class: "text-zl-text-soft hover:text-zl-text"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
variant: "link",
|
|
@@ -191,6 +191,7 @@ var Button = ({
|
|
|
191
191
|
disabled = false,
|
|
192
192
|
"aria-label": ariaLabel,
|
|
193
193
|
"aria-expanded": ariaExpanded,
|
|
194
|
+
"aria-pressed": ariaPressed,
|
|
194
195
|
onClick
|
|
195
196
|
}) => {
|
|
196
197
|
const isIconOnly = icon2 && !children;
|
|
@@ -219,6 +220,7 @@ var Button = ({
|
|
|
219
220
|
onClick,
|
|
220
221
|
"aria-label": ariaLabel,
|
|
221
222
|
"aria-expanded": ariaExpanded,
|
|
223
|
+
"aria-pressed": ariaPressed,
|
|
222
224
|
className: button({
|
|
223
225
|
variant,
|
|
224
226
|
color: variant === "icon" && color !== "ghost" ? "none" : color,
|
|
@@ -266,7 +268,7 @@ var overlay = tv4({
|
|
|
266
268
|
base: "fixed inset-0 z-50 bg-black/50"
|
|
267
269
|
});
|
|
268
270
|
var content = tv4({
|
|
269
|
-
base: "fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg shadow-lg p-6 w-full focus:outline-none max-h-[90vh] overflow-y-auto",
|
|
271
|
+
base: "fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg shadow-lg p-6 text-zl-text w-full focus:outline-none max-h-[90vh] overflow-y-auto",
|
|
270
272
|
variants: {
|
|
271
273
|
size: {
|
|
272
274
|
xs: "max-w-xs",
|
|
@@ -278,13 +280,13 @@ var content = tv4({
|
|
|
278
280
|
},
|
|
279
281
|
// An opaque tint: a translucent one, as Card has, would show the dark overlay behind the modal.
|
|
280
282
|
color: {
|
|
281
|
-
primary: "bg-[color-mix(in_srgb,var(--color-zl-primary)_15%,
|
|
282
|
-
success: "bg-[color-mix(in_srgb,var(--color-zl-success)_15%,
|
|
283
|
-
danger: "bg-[color-mix(in_srgb,var(--color-zl-danger)_15%,
|
|
284
|
-
warning: "bg-[color-mix(in_srgb,var(--color-zl-warning)_15%,
|
|
285
|
-
info: "bg-[color-mix(in_srgb,var(--color-zl-info)_15%,
|
|
286
|
-
muted: "bg-[color-mix(in_srgb,var(--color-zl-muted)_15%,
|
|
287
|
-
none: "bg-
|
|
283
|
+
primary: "bg-[color-mix(in_srgb,var(--color-zl-primary)_15%,var(--color-zl-surface))]",
|
|
284
|
+
success: "bg-[color-mix(in_srgb,var(--color-zl-success)_15%,var(--color-zl-surface))]",
|
|
285
|
+
danger: "bg-[color-mix(in_srgb,var(--color-zl-danger)_15%,var(--color-zl-surface))]",
|
|
286
|
+
warning: "bg-[color-mix(in_srgb,var(--color-zl-warning)_15%,var(--color-zl-surface))]",
|
|
287
|
+
info: "bg-[color-mix(in_srgb,var(--color-zl-info)_15%,var(--color-zl-surface))]",
|
|
288
|
+
muted: "bg-[color-mix(in_srgb,var(--color-zl-muted)_15%,var(--color-zl-surface))]",
|
|
289
|
+
none: "bg-zl-surface"
|
|
288
290
|
}
|
|
289
291
|
},
|
|
290
292
|
defaultVariants: {
|
|
@@ -306,7 +308,7 @@ var title = tv4({
|
|
|
306
308
|
warning: "text-zl-warning-strong",
|
|
307
309
|
info: "text-zl-info-strong",
|
|
308
310
|
muted: "text-zl-muted-strong",
|
|
309
|
-
none: "text-
|
|
311
|
+
none: "text-zl-text"
|
|
310
312
|
}
|
|
311
313
|
},
|
|
312
314
|
defaultVariants: {
|
|
@@ -314,7 +316,7 @@ var title = tv4({
|
|
|
314
316
|
}
|
|
315
317
|
});
|
|
316
318
|
var description = tv4({
|
|
317
|
-
base: "text-sm text-
|
|
319
|
+
base: "text-sm text-zl-text-soft mt-2"
|
|
318
320
|
});
|
|
319
321
|
var body = tv4({
|
|
320
322
|
base: "mt-4"
|
|
@@ -387,6 +389,207 @@ var Heading = ({ children, level = 1, color }) => {
|
|
|
387
389
|
return /* @__PURE__ */ jsx5(Tag, { className: heading({ level, color }), children });
|
|
388
390
|
};
|
|
389
391
|
|
|
392
|
+
// features/app/hooks/use-install-app/use-install-app.ts
|
|
393
|
+
import { useEffect, useState, useSyncExternalStore } from "react";
|
|
394
|
+
|
|
395
|
+
// features/app/hooks/use-install-app/use-install-app.const.ts
|
|
396
|
+
var INSTALL_APP_IOS_USER_AGENT = /iPhone|iPad|iPod/i;
|
|
397
|
+
var INSTALLED_APP_QUERY = "(display-mode: standalone)";
|
|
398
|
+
|
|
399
|
+
// features/app/hooks/use-install-app/use-install-app.ts
|
|
400
|
+
var subscribeToNothing = () => () => {
|
|
401
|
+
};
|
|
402
|
+
var needsInstructions = () => INSTALL_APP_IOS_USER_AGENT.test(navigator.userAgent) && !window.matchMedia(INSTALLED_APP_QUERY).matches;
|
|
403
|
+
var notOnServer = () => false;
|
|
404
|
+
var useInstallApp = () => {
|
|
405
|
+
const [promptEvent, setPromptEvent] = useState(
|
|
406
|
+
null
|
|
407
|
+
);
|
|
408
|
+
const instructions = useSyncExternalStore(
|
|
409
|
+
subscribeToNothing,
|
|
410
|
+
needsInstructions,
|
|
411
|
+
notOnServer
|
|
412
|
+
);
|
|
413
|
+
useEffect(() => {
|
|
414
|
+
const keep = (event) => {
|
|
415
|
+
event.preventDefault();
|
|
416
|
+
setPromptEvent(event);
|
|
417
|
+
};
|
|
418
|
+
const forget = () => {
|
|
419
|
+
setPromptEvent(null);
|
|
420
|
+
};
|
|
421
|
+
window.addEventListener("beforeinstallprompt", keep);
|
|
422
|
+
window.addEventListener("appinstalled", forget);
|
|
423
|
+
return () => {
|
|
424
|
+
window.removeEventListener("beforeinstallprompt", keep);
|
|
425
|
+
window.removeEventListener("appinstalled", forget);
|
|
426
|
+
};
|
|
427
|
+
}, []);
|
|
428
|
+
const prompt = () => {
|
|
429
|
+
if (!promptEvent) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
void promptEvent.prompt();
|
|
433
|
+
setPromptEvent(null);
|
|
434
|
+
};
|
|
435
|
+
if (promptEvent) {
|
|
436
|
+
return { way: "prompt", prompt };
|
|
437
|
+
}
|
|
438
|
+
return { way: instructions ? "instructions" : null, prompt };
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// features/app/hooks/use-is-desktop/use-is-desktop.ts
|
|
442
|
+
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
443
|
+
|
|
444
|
+
// features/app/hooks/use-is-desktop/use-is-desktop.const.ts
|
|
445
|
+
var DESKTOP_QUERY = "(min-width: 768px)";
|
|
446
|
+
|
|
447
|
+
// features/app/hooks/use-is-desktop/use-is-desktop.ts
|
|
448
|
+
var subscribe = (onChange) => {
|
|
449
|
+
const media = window.matchMedia(DESKTOP_QUERY);
|
|
450
|
+
media.addEventListener("change", onChange);
|
|
451
|
+
return () => {
|
|
452
|
+
media.removeEventListener("change", onChange);
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
var isDesktop = () => window.matchMedia(DESKTOP_QUERY).matches;
|
|
456
|
+
var unknown = () => null;
|
|
457
|
+
var useIsDesktop = () => useSyncExternalStore2(subscribe, isDesktop, unknown);
|
|
458
|
+
|
|
459
|
+
// features/app/hooks/use-theme/use-theme.ts
|
|
460
|
+
import { useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
461
|
+
|
|
462
|
+
// features/app/hooks/use-theme/use-theme.const.ts
|
|
463
|
+
var themes = ["system", "light", "dark"];
|
|
464
|
+
var THEME_STORAGE_KEY = "zljs-theme";
|
|
465
|
+
var THEME_STYLE_ID = "zljs-theme";
|
|
466
|
+
var THEME_RULES = {
|
|
467
|
+
light: ":root:root{color-scheme:light;--lightningcss-light:initial;--lightningcss-dark: }",
|
|
468
|
+
dark: ":root:root{color-scheme:dark;--lightningcss-light: ;--lightningcss-dark:initial}"
|
|
469
|
+
};
|
|
470
|
+
var themeScript = `(function(){try{var r=${JSON.stringify(THEME_RULES)},t=localStorage.getItem("${THEME_STORAGE_KEY}");if(t==="light"||t==="dark"){var s=document.createElement("style");s.id="${THEME_STYLE_ID}";s.textContent=r[t];document.head.appendChild(s)}}catch(e){}})()`;
|
|
471
|
+
|
|
472
|
+
// features/app/hooks/use-theme/use-theme.ts
|
|
473
|
+
var SYSTEM = "system";
|
|
474
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
475
|
+
var isTheme = (value) => themes.includes(value);
|
|
476
|
+
var readTheme = () => {
|
|
477
|
+
try {
|
|
478
|
+
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
479
|
+
return isTheme(stored) ? stored : SYSTEM;
|
|
480
|
+
} catch {
|
|
481
|
+
return SYSTEM;
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
var storeTheme = (theme) => {
|
|
485
|
+
try {
|
|
486
|
+
if (theme === SYSTEM) {
|
|
487
|
+
localStorage.removeItem(THEME_STORAGE_KEY);
|
|
488
|
+
} else {
|
|
489
|
+
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
490
|
+
}
|
|
491
|
+
} catch {
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
var applyTheme = (theme) => {
|
|
495
|
+
const existing = document.getElementById(THEME_STYLE_ID);
|
|
496
|
+
const style = existing ?? document.createElement("style");
|
|
497
|
+
style.id = THEME_STYLE_ID;
|
|
498
|
+
style.textContent = theme === SYSTEM ? "" : THEME_RULES[theme];
|
|
499
|
+
if (!existing) {
|
|
500
|
+
document.head.append(style);
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
var setTheme = (theme) => {
|
|
504
|
+
storeTheme(theme);
|
|
505
|
+
applyTheme(theme);
|
|
506
|
+
listeners.forEach((listener) => listener());
|
|
507
|
+
};
|
|
508
|
+
var subscribe2 = (onChange) => {
|
|
509
|
+
const followOtherTab = (event) => {
|
|
510
|
+
if (event.key === THEME_STORAGE_KEY || event.key === null) {
|
|
511
|
+
applyTheme(readTheme());
|
|
512
|
+
onChange();
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
applyTheme(readTheme());
|
|
516
|
+
listeners.add(onChange);
|
|
517
|
+
window.addEventListener("storage", followOtherTab);
|
|
518
|
+
return () => {
|
|
519
|
+
listeners.delete(onChange);
|
|
520
|
+
window.removeEventListener("storage", followOtherTab);
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
var unknown2 = () => SYSTEM;
|
|
524
|
+
var useTheme = () => {
|
|
525
|
+
const theme = useSyncExternalStore3(subscribe2, readTheme, unknown2);
|
|
526
|
+
return { theme, setTheme };
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// features/app/components/theme-toggle/theme-toggle.const.ts
|
|
530
|
+
var themeToggleIcons = {
|
|
531
|
+
system: "Monitor",
|
|
532
|
+
light: "Sun",
|
|
533
|
+
dark: "Moon"
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
// features/app/components/theme-toggle/theme-toggle.styles.ts
|
|
537
|
+
import { tv as tv6 } from "tailwind-variants";
|
|
538
|
+
var themeToggle = tv6({
|
|
539
|
+
// The three share the width of the line, each as tall as a row of a menu.
|
|
540
|
+
base: "flex gap-1 [&>button]:h-10 [&>button]:flex-1"
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// features/app/components/theme-toggle/theme-toggle.tsx
|
|
544
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
545
|
+
var ThemeToggle = ({
|
|
546
|
+
label,
|
|
547
|
+
iconOnly = false,
|
|
548
|
+
size = "md",
|
|
549
|
+
systemLabel = "System",
|
|
550
|
+
lightLabel = "Light",
|
|
551
|
+
darkLabel = "Dark"
|
|
552
|
+
}) => {
|
|
553
|
+
const { theme, setTheme: setTheme2 } = useTheme();
|
|
554
|
+
const labels = {
|
|
555
|
+
system: systemLabel,
|
|
556
|
+
light: lightLabel,
|
|
557
|
+
dark: darkLabel
|
|
558
|
+
};
|
|
559
|
+
const next = () => {
|
|
560
|
+
setTheme2(themes[(themes.indexOf(theme) + 1) % themes.length]);
|
|
561
|
+
};
|
|
562
|
+
if (iconOnly) {
|
|
563
|
+
return /* @__PURE__ */ jsx6(
|
|
564
|
+
Button,
|
|
565
|
+
{
|
|
566
|
+
color: "ghost",
|
|
567
|
+
size,
|
|
568
|
+
icon: themeToggleIcons[theme],
|
|
569
|
+
"aria-label": `${label}: ${labels[theme]}`,
|
|
570
|
+
onClick: next
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
return /* @__PURE__ */ jsx6("div", { role: "group", "aria-label": label, className: themeToggle(), children: themes.map((option) => {
|
|
575
|
+
const select = () => {
|
|
576
|
+
setTheme2(option);
|
|
577
|
+
};
|
|
578
|
+
return /* @__PURE__ */ jsx6(
|
|
579
|
+
Button,
|
|
580
|
+
{
|
|
581
|
+
color: "ghost",
|
|
582
|
+
size,
|
|
583
|
+
icon: themeToggleIcons[option],
|
|
584
|
+
"aria-label": labels[option],
|
|
585
|
+
"aria-pressed": theme === option,
|
|
586
|
+
onClick: select
|
|
587
|
+
},
|
|
588
|
+
option
|
|
589
|
+
);
|
|
590
|
+
}) });
|
|
591
|
+
};
|
|
592
|
+
|
|
390
593
|
// features/toaster/state/toast.store.ts
|
|
391
594
|
import { create } from "zustand";
|
|
392
595
|
import { devtools } from "zustand/middleware";
|
|
@@ -430,7 +633,7 @@ var useToastStore = create()(
|
|
|
430
633
|
var SHARE_APP_CANCELLED = "AbortError";
|
|
431
634
|
|
|
432
635
|
// features/app/components/share-app-button/share-app-button.tsx
|
|
433
|
-
import { jsx as
|
|
636
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
434
637
|
var ShareAppButton = ({
|
|
435
638
|
label,
|
|
436
639
|
iconOnly = false,
|
|
@@ -469,7 +672,7 @@ var ShareAppButton = ({
|
|
|
469
672
|
const share = () => {
|
|
470
673
|
void shareOrCopy();
|
|
471
674
|
};
|
|
472
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx7(
|
|
473
676
|
Button,
|
|
474
677
|
{
|
|
475
678
|
color: "ghost",
|
|
@@ -540,7 +743,7 @@ var useAppStore = create2()(
|
|
|
540
743
|
);
|
|
541
744
|
|
|
542
745
|
// features/app/components/connected-modal/connected-modal.tsx
|
|
543
|
-
import { jsx as
|
|
746
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
544
747
|
var ConnectedModal = ({
|
|
545
748
|
modalId,
|
|
546
749
|
title: title2,
|
|
@@ -554,7 +757,7 @@ var ConnectedModal = ({
|
|
|
554
757
|
const close = () => {
|
|
555
758
|
closeModal(modalId);
|
|
556
759
|
};
|
|
557
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ jsx8(
|
|
558
761
|
Modal,
|
|
559
762
|
{
|
|
560
763
|
open,
|
|
@@ -632,15 +835,15 @@ var useAuth = () => {
|
|
|
632
835
|
var SIGN_OUT_MODAL_ID = "zljs-sign-out";
|
|
633
836
|
|
|
634
837
|
// features/auth/components/sign-out/sign-out-modal.styles.ts
|
|
635
|
-
import { tv as
|
|
636
|
-
var signOutModal =
|
|
838
|
+
import { tv as tv7 } from "tailwind-variants";
|
|
839
|
+
var signOutModal = tv7({
|
|
637
840
|
slots: {
|
|
638
841
|
actions: "flex justify-end gap-2"
|
|
639
842
|
}
|
|
640
843
|
});
|
|
641
844
|
|
|
642
845
|
// features/auth/components/sign-out/sign-out-modal.tsx
|
|
643
|
-
import { jsx as
|
|
846
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
644
847
|
var SignOutModal = ({
|
|
645
848
|
title: title2 = "Sign out?",
|
|
646
849
|
confirmLabel = "Sign out",
|
|
@@ -668,7 +871,7 @@ var SignOutModal = ({
|
|
|
668
871
|
closeModal(SIGN_OUT_MODAL_ID);
|
|
669
872
|
signOutOfApp().catch(showError);
|
|
670
873
|
};
|
|
671
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ jsx9(
|
|
672
875
|
ConnectedModal,
|
|
673
876
|
{
|
|
674
877
|
modalId: SIGN_OUT_MODAL_ID,
|
|
@@ -676,15 +879,15 @@ var SignOutModal = ({
|
|
|
676
879
|
size: "xs",
|
|
677
880
|
color: "danger",
|
|
678
881
|
children: /* @__PURE__ */ jsxs3("div", { className: actions2(), children: [
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ jsx9(Button, { color: "ghost", onClick: stay, children: cancelLabel }),
|
|
883
|
+
/* @__PURE__ */ jsx9(Button, { color: "danger", onClick: leave, children: confirmLabel })
|
|
681
884
|
] })
|
|
682
885
|
}
|
|
683
886
|
);
|
|
684
887
|
};
|
|
685
888
|
|
|
686
889
|
// features/auth/components/sign-out/sign-out-button.tsx
|
|
687
|
-
import { Fragment as Fragment3, jsx as
|
|
890
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
688
891
|
var SignOutButton = ({
|
|
689
892
|
label = "Sign out",
|
|
690
893
|
size = "md",
|
|
@@ -699,7 +902,7 @@ var SignOutButton = ({
|
|
|
699
902
|
openModal(SIGN_OUT_MODAL_ID);
|
|
700
903
|
};
|
|
701
904
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
702
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx10(
|
|
703
906
|
Button,
|
|
704
907
|
{
|
|
705
908
|
color: "ghost",
|
|
@@ -709,7 +912,7 @@ var SignOutButton = ({
|
|
|
709
912
|
onClick: ask
|
|
710
913
|
}
|
|
711
914
|
),
|
|
712
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx10(
|
|
713
916
|
SignOutModal,
|
|
714
917
|
{
|
|
715
918
|
title: confirmTitle,
|
|
@@ -726,8 +929,8 @@ var SignOutButton = ({
|
|
|
726
929
|
import NextLink from "next/link.js";
|
|
727
930
|
|
|
728
931
|
// core/next/link/link.styles.ts
|
|
729
|
-
import { tv as
|
|
730
|
-
var link =
|
|
932
|
+
import { tv as tv8 } from "tailwind-variants";
|
|
933
|
+
var link = tv8({
|
|
731
934
|
// outline-current draws the focus in the text color.
|
|
732
935
|
base: "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current",
|
|
733
936
|
variants: {
|
|
@@ -763,7 +966,7 @@ var link = tv7({
|
|
|
763
966
|
});
|
|
764
967
|
|
|
765
968
|
// core/next/link/link.tsx
|
|
766
|
-
import { jsx as
|
|
969
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
767
970
|
var Link = ({
|
|
768
971
|
children,
|
|
769
972
|
href,
|
|
@@ -774,7 +977,7 @@ var Link = ({
|
|
|
774
977
|
"aria-label": ariaLabel,
|
|
775
978
|
onClick
|
|
776
979
|
}) => {
|
|
777
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ jsx11(
|
|
778
981
|
NextLink,
|
|
779
982
|
{
|
|
780
983
|
href,
|
|
@@ -789,12 +992,15 @@ var Link = ({
|
|
|
789
992
|
};
|
|
790
993
|
|
|
791
994
|
// core/sidebar/sidebar.tsx
|
|
792
|
-
import { useState } from "react";
|
|
995
|
+
import { useState as useState2 } from "react";
|
|
793
996
|
|
|
794
997
|
// core/sidebar/sidebar.styles.ts
|
|
795
|
-
import { tv as
|
|
796
|
-
var sidebar =
|
|
797
|
-
|
|
998
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
999
|
+
var sidebar = tv9({
|
|
1000
|
+
// A surface beside the page, with a line between the two: white in the light
|
|
1001
|
+
// theme and dark in the dark one. The line is an inset shadow, which takes no
|
|
1002
|
+
// width: a border would move what is centered in the collapsed sidebar.
|
|
1003
|
+
base: "h-dvh shadow-[inset_-1px_0_0_var(--color-zl-border)] bg-zl-surface text-zl-text-soft flex flex-col overflow-hidden transition-[width] duration-200 divide-y divide-zl-border",
|
|
798
1004
|
variants: {
|
|
799
1005
|
collapsed: {
|
|
800
1006
|
true: "w-14",
|
|
@@ -802,19 +1008,19 @@ var sidebar = tv8({
|
|
|
802
1008
|
}
|
|
803
1009
|
}
|
|
804
1010
|
});
|
|
805
|
-
var nav =
|
|
806
|
-
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-
|
|
1011
|
+
var nav = tv9({
|
|
1012
|
+
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-zl-border"
|
|
807
1013
|
});
|
|
808
|
-
var header2 =
|
|
1014
|
+
var header2 = tv9({
|
|
809
1015
|
base: "shrink-0 p-2"
|
|
810
1016
|
});
|
|
811
|
-
var section =
|
|
1017
|
+
var section = tv9({
|
|
812
1018
|
base: "grid gap-1 p-2"
|
|
813
1019
|
});
|
|
814
|
-
var actions =
|
|
815
|
-
base: "shrink-0 grid p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
1020
|
+
var actions = tv9({
|
|
1021
|
+
base: "shrink-0 grid gap-1 p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
816
1022
|
});
|
|
817
|
-
var footer =
|
|
1023
|
+
var footer = tv9({
|
|
818
1024
|
base: "shrink-0 h-16 p-3 flex items-center gap-3",
|
|
819
1025
|
variants: {
|
|
820
1026
|
collapsed: {
|
|
@@ -822,18 +1028,18 @@ var footer = tv8({
|
|
|
822
1028
|
}
|
|
823
1029
|
}
|
|
824
1030
|
});
|
|
825
|
-
var avatar =
|
|
826
|
-
base: "shrink-0 size-8 rounded-full bg-
|
|
1031
|
+
var avatar = tv9({
|
|
1032
|
+
base: "shrink-0 size-8 rounded-full bg-zl-surface-hover text-zl-text text-xs font-medium flex items-center justify-center"
|
|
827
1033
|
});
|
|
828
|
-
var userInfo =
|
|
829
|
-
base: "flex flex-col min-w-0 text-
|
|
1034
|
+
var userInfo = tv9({
|
|
1035
|
+
base: "flex flex-col min-w-0 text-zl-text [&>*]:truncate [&>*:last-child]:text-xs [&>*:last-child]:text-zl-muted"
|
|
830
1036
|
});
|
|
831
|
-
var toggleButton =
|
|
1037
|
+
var toggleButton = tv9({
|
|
832
1038
|
base: "shrink-0 h-14 grid p-2 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
833
1039
|
});
|
|
834
1040
|
|
|
835
1041
|
// core/sidebar/sidebar.tsx
|
|
836
|
-
import { Fragment as Fragment4, jsx as
|
|
1042
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
837
1043
|
var getInitials = (name) => {
|
|
838
1044
|
const parts = name.trim().split(/\s+/);
|
|
839
1045
|
if (parts.length >= 2) {
|
|
@@ -851,11 +1057,12 @@ var Sidebar = ({
|
|
|
851
1057
|
homeHref = "/",
|
|
852
1058
|
homeLabel,
|
|
853
1059
|
navLabel = "Main navigation",
|
|
1060
|
+
theme = {},
|
|
854
1061
|
share = {},
|
|
855
1062
|
logout = {},
|
|
856
1063
|
onLogout
|
|
857
1064
|
}) => {
|
|
858
|
-
const [collapsed, setCollapsed] =
|
|
1065
|
+
const [collapsed, setCollapsed] = useState2(defaultCollapsed);
|
|
859
1066
|
const initials = getInitials(user.name);
|
|
860
1067
|
const toggleLabel = collapsed ? expandLabel : collapseLabel;
|
|
861
1068
|
const toggleIcon = collapsed ? "ChevronRight" : "ChevronLeft";
|
|
@@ -863,7 +1070,7 @@ var Sidebar = ({
|
|
|
863
1070
|
setCollapsed(!collapsed);
|
|
864
1071
|
};
|
|
865
1072
|
return /* @__PURE__ */ jsxs5("aside", { className: sidebar({ collapsed }), children: [
|
|
866
|
-
homeHref && /* @__PURE__ */
|
|
1073
|
+
homeHref && /* @__PURE__ */ jsx12("div", { className: header2(), children: /* @__PURE__ */ jsxs5(
|
|
867
1074
|
Link,
|
|
868
1075
|
{
|
|
869
1076
|
href: homeHref,
|
|
@@ -872,12 +1079,12 @@ var Sidebar = ({
|
|
|
872
1079
|
active: homeHref === activeHref,
|
|
873
1080
|
"aria-label": homeLabel || "Home",
|
|
874
1081
|
children: [
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
homeLabel && !collapsed && /* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ jsx12(Icon, { name: "Home" }),
|
|
1083
|
+
homeLabel && !collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: homeLabel })
|
|
877
1084
|
]
|
|
878
1085
|
}
|
|
879
1086
|
) }),
|
|
880
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ jsx12("nav", { "aria-label": navLabel, className: nav(), children: sections.map((sectionData, i) => /* @__PURE__ */ jsx12("div", { className: section(), children: sectionData.items.map((sidebarItem) => /* @__PURE__ */ jsxs5(
|
|
881
1088
|
Link,
|
|
882
1089
|
{
|
|
883
1090
|
href: sidebarItem.href,
|
|
@@ -886,32 +1093,44 @@ var Sidebar = ({
|
|
|
886
1093
|
active: sidebarItem.href === activeHref,
|
|
887
1094
|
"aria-label": sidebarItem.label,
|
|
888
1095
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
!collapsed && /* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx12(Icon, { name: sidebarItem.icon }),
|
|
1097
|
+
!collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: sidebarItem.label })
|
|
891
1098
|
]
|
|
892
1099
|
},
|
|
893
1100
|
sidebarItem.href
|
|
894
1101
|
)) }, i)) }),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1102
|
+
/* @__PURE__ */ jsxs5("div", { className: actions(), children: [
|
|
1103
|
+
/* @__PURE__ */ jsx12(
|
|
1104
|
+
ThemeToggle,
|
|
1105
|
+
{
|
|
1106
|
+
label: theme.label ?? "Theme",
|
|
1107
|
+
iconOnly: collapsed,
|
|
1108
|
+
systemLabel: theme.systemLabel,
|
|
1109
|
+
lightLabel: theme.lightLabel,
|
|
1110
|
+
darkLabel: theme.darkLabel
|
|
1111
|
+
}
|
|
1112
|
+
),
|
|
1113
|
+
/* @__PURE__ */ jsx12(
|
|
1114
|
+
ShareAppButton,
|
|
1115
|
+
{
|
|
1116
|
+
label: share.label ?? "Share app",
|
|
1117
|
+
iconOnly: collapsed,
|
|
1118
|
+
title: share.title,
|
|
1119
|
+
text: share.text,
|
|
1120
|
+
copiedMessage: share.copiedMessage,
|
|
1121
|
+
errorMessage: share.errorMessage
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1124
|
+
] }),
|
|
906
1125
|
/* @__PURE__ */ jsxs5("div", { className: footer({ collapsed }), children: [
|
|
907
1126
|
!collapsed && /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
908
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ jsx12("div", { "aria-hidden": "true", className: avatar(), children: initials }),
|
|
909
1128
|
/* @__PURE__ */ jsxs5("div", { className: userInfo(), children: [
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.name }),
|
|
1130
|
+
/* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.email })
|
|
912
1131
|
] })
|
|
913
1132
|
] }),
|
|
914
|
-
/* @__PURE__ */
|
|
1133
|
+
/* @__PURE__ */ jsx12(
|
|
915
1134
|
SignOutButton,
|
|
916
1135
|
{
|
|
917
1136
|
label: logout.label,
|
|
@@ -923,7 +1142,7 @@ var Sidebar = ({
|
|
|
923
1142
|
}
|
|
924
1143
|
)
|
|
925
1144
|
] }),
|
|
926
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsx12("div", { className: toggleButton(), children: /* @__PURE__ */ jsx12(
|
|
927
1146
|
Button,
|
|
928
1147
|
{
|
|
929
1148
|
color: "ghost",
|
|
@@ -940,7 +1159,7 @@ var Sidebar = ({
|
|
|
940
1159
|
var INSTALL_APP_MODAL_ID = "zljs-install-app";
|
|
941
1160
|
|
|
942
1161
|
// features/app/components/install-app-button/install-app-button.tsx
|
|
943
|
-
import { Fragment as Fragment5, jsx as
|
|
1162
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
944
1163
|
var InstallAppButton = ({
|
|
945
1164
|
way,
|
|
946
1165
|
label,
|
|
@@ -959,7 +1178,7 @@ var InstallAppButton = ({
|
|
|
959
1178
|
}
|
|
960
1179
|
};
|
|
961
1180
|
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
962
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ jsx13(
|
|
963
1182
|
Button,
|
|
964
1183
|
{
|
|
965
1184
|
color: "ghost",
|
|
@@ -970,7 +1189,7 @@ var InstallAppButton = ({
|
|
|
970
1189
|
children: !iconOnly && label
|
|
971
1190
|
}
|
|
972
1191
|
),
|
|
973
|
-
way === "instructions" && /* @__PURE__ */
|
|
1192
|
+
way === "instructions" && /* @__PURE__ */ jsx13(
|
|
974
1193
|
ConnectedModal,
|
|
975
1194
|
{
|
|
976
1195
|
modalId: INSTALL_APP_MODAL_ID,
|
|
@@ -982,83 +1201,16 @@ var InstallAppButton = ({
|
|
|
982
1201
|
] });
|
|
983
1202
|
};
|
|
984
1203
|
|
|
985
|
-
// features/app/hooks/use-install-app/use-install-app.ts
|
|
986
|
-
import { useEffect, useState as useState2, useSyncExternalStore } from "react";
|
|
987
|
-
|
|
988
|
-
// features/app/hooks/use-install-app/use-install-app.const.ts
|
|
989
|
-
var INSTALL_APP_IOS_USER_AGENT = /iPhone|iPad|iPod/i;
|
|
990
|
-
var INSTALLED_APP_QUERY = "(display-mode: standalone)";
|
|
991
|
-
|
|
992
|
-
// features/app/hooks/use-install-app/use-install-app.ts
|
|
993
|
-
var subscribeToNothing = () => () => {
|
|
994
|
-
};
|
|
995
|
-
var needsInstructions = () => INSTALL_APP_IOS_USER_AGENT.test(navigator.userAgent) && !window.matchMedia(INSTALLED_APP_QUERY).matches;
|
|
996
|
-
var notOnServer = () => false;
|
|
997
|
-
var useInstallApp = () => {
|
|
998
|
-
const [promptEvent, setPromptEvent] = useState2(
|
|
999
|
-
null
|
|
1000
|
-
);
|
|
1001
|
-
const instructions = useSyncExternalStore(
|
|
1002
|
-
subscribeToNothing,
|
|
1003
|
-
needsInstructions,
|
|
1004
|
-
notOnServer
|
|
1005
|
-
);
|
|
1006
|
-
useEffect(() => {
|
|
1007
|
-
const keep = (event) => {
|
|
1008
|
-
event.preventDefault();
|
|
1009
|
-
setPromptEvent(event);
|
|
1010
|
-
};
|
|
1011
|
-
const forget = () => {
|
|
1012
|
-
setPromptEvent(null);
|
|
1013
|
-
};
|
|
1014
|
-
window.addEventListener("beforeinstallprompt", keep);
|
|
1015
|
-
window.addEventListener("appinstalled", forget);
|
|
1016
|
-
return () => {
|
|
1017
|
-
window.removeEventListener("beforeinstallprompt", keep);
|
|
1018
|
-
window.removeEventListener("appinstalled", forget);
|
|
1019
|
-
};
|
|
1020
|
-
}, []);
|
|
1021
|
-
const prompt = () => {
|
|
1022
|
-
if (!promptEvent) {
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
void promptEvent.prompt();
|
|
1026
|
-
setPromptEvent(null);
|
|
1027
|
-
};
|
|
1028
|
-
if (promptEvent) {
|
|
1029
|
-
return { way: "prompt", prompt };
|
|
1030
|
-
}
|
|
1031
|
-
return { way: instructions ? "instructions" : null, prompt };
|
|
1032
|
-
};
|
|
1033
|
-
|
|
1034
|
-
// features/app/hooks/use-is-desktop/use-is-desktop.ts
|
|
1035
|
-
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
1036
|
-
|
|
1037
|
-
// features/app/hooks/use-is-desktop/use-is-desktop.const.ts
|
|
1038
|
-
var DESKTOP_QUERY = "(min-width: 768px)";
|
|
1039
|
-
|
|
1040
|
-
// features/app/hooks/use-is-desktop/use-is-desktop.ts
|
|
1041
|
-
var subscribe = (onChange) => {
|
|
1042
|
-
const media = window.matchMedia(DESKTOP_QUERY);
|
|
1043
|
-
media.addEventListener("change", onChange);
|
|
1044
|
-
return () => {
|
|
1045
|
-
media.removeEventListener("change", onChange);
|
|
1046
|
-
};
|
|
1047
|
-
};
|
|
1048
|
-
var isDesktop = () => window.matchMedia(DESKTOP_QUERY).matches;
|
|
1049
|
-
var unknown = () => null;
|
|
1050
|
-
var useIsDesktop = () => useSyncExternalStore2(subscribe, isDesktop, unknown);
|
|
1051
|
-
|
|
1052
1204
|
// core/top-nav/top-nav.tsx
|
|
1053
1205
|
import { useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
1054
1206
|
|
|
1055
1207
|
// core/top-nav/top-nav.styles.ts
|
|
1056
|
-
import { tv as
|
|
1057
|
-
var topNav =
|
|
1208
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
1209
|
+
var topNav = tv10({
|
|
1058
1210
|
slots: {
|
|
1059
1211
|
// The panels hang from it, so it is their anchor. The safe area keeps the
|
|
1060
1212
|
// bar under the notch of a phone.
|
|
1061
|
-
base: "relative shrink-0 bg-
|
|
1213
|
+
base: "relative shrink-0 border-b border-zl-border bg-zl-surface pt-[env(safe-area-inset-top)] text-zl-text-soft",
|
|
1062
1214
|
bar: "flex h-14 items-center gap-1 px-2",
|
|
1063
1215
|
// As wide as the menu button it stands in for, so the home link stays in
|
|
1064
1216
|
// the middle of the bar.
|
|
@@ -1068,20 +1220,20 @@ var topNav = tv9({
|
|
|
1068
1220
|
// Over the page, under the bar, as wide as the screen. It scrolls when the
|
|
1069
1221
|
// links don't fit in what is left of the screen. `z-40` puts it over what
|
|
1070
1222
|
// the page layers on itself (a filter over a map), and under a modal.
|
|
1071
|
-
menu: "absolute inset-x-0 top-full z-40 max-h-[calc(100dvh-3.5rem)] divide-y divide-
|
|
1223
|
+
menu: "absolute inset-x-0 top-full z-40 max-h-[calc(100dvh-3.5rem)] divide-y divide-zl-border overflow-y-auto border-t border-zl-border bg-zl-surface shadow-lg",
|
|
1072
1224
|
section: "grid gap-1 p-2",
|
|
1073
1225
|
// Two rows: what the user can do with the app, then who is logged in.
|
|
1074
|
-
account: "absolute inset-x-0 top-full z-40 divide-y divide-
|
|
1226
|
+
account: "absolute inset-x-0 top-full z-40 divide-y divide-zl-border border-t border-zl-border bg-zl-surface shadow-lg",
|
|
1075
1227
|
// One action per line, each as tall and as far from the edge as a link of the menu.
|
|
1076
1228
|
actions: "grid gap-1 p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3",
|
|
1077
1229
|
profile: "flex items-center gap-3 p-3",
|
|
1078
1230
|
// Text takes no className, so the cut of a long name or email is set from here.
|
|
1079
|
-
user: "flex min-w-0 flex-1 flex-col text-
|
|
1231
|
+
user: "flex min-w-0 flex-1 flex-col text-zl-text [&>*]:truncate"
|
|
1080
1232
|
}
|
|
1081
1233
|
});
|
|
1082
1234
|
|
|
1083
1235
|
// core/top-nav/top-nav.tsx
|
|
1084
|
-
import { jsx as
|
|
1236
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1085
1237
|
var TopNav = ({
|
|
1086
1238
|
sections,
|
|
1087
1239
|
user,
|
|
@@ -1091,6 +1243,7 @@ var TopNav = ({
|
|
|
1091
1243
|
navLabel = "Main navigation",
|
|
1092
1244
|
menuLabel = "Menu",
|
|
1093
1245
|
accountLabel = "Account",
|
|
1246
|
+
theme = {},
|
|
1094
1247
|
share = {},
|
|
1095
1248
|
install = {},
|
|
1096
1249
|
logout = {},
|
|
@@ -1134,7 +1287,7 @@ var TopNav = ({
|
|
|
1134
1287
|
};
|
|
1135
1288
|
return /* @__PURE__ */ jsxs7("header", { className: styles.base(), onPointerDown: markPressInside, children: [
|
|
1136
1289
|
/* @__PURE__ */ jsxs7("div", { className: styles.bar(), children: [
|
|
1137
|
-
hasLinks ? /* @__PURE__ */
|
|
1290
|
+
hasLinks ? /* @__PURE__ */ jsx14(
|
|
1138
1291
|
Button,
|
|
1139
1292
|
{
|
|
1140
1293
|
color: "ghost",
|
|
@@ -1144,8 +1297,8 @@ var TopNav = ({
|
|
|
1144
1297
|
"aria-expanded": menuOpen,
|
|
1145
1298
|
onClick: toggleMenu
|
|
1146
1299
|
}
|
|
1147
|
-
) : /* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1300
|
+
) : /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", className: styles.spacer() }),
|
|
1301
|
+
/* @__PURE__ */ jsx14("div", { className: styles.home(), children: homeHref && /* @__PURE__ */ jsxs7(
|
|
1149
1302
|
Link,
|
|
1150
1303
|
{
|
|
1151
1304
|
href: homeHref,
|
|
@@ -1155,12 +1308,12 @@ var TopNav = ({
|
|
|
1155
1308
|
"aria-label": homeLabel || "Home",
|
|
1156
1309
|
onClick: close,
|
|
1157
1310
|
children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
homeLabel && /* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ jsx14(Icon, { name: "Home" }),
|
|
1312
|
+
homeLabel && /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: homeLabel })
|
|
1160
1313
|
]
|
|
1161
1314
|
}
|
|
1162
1315
|
) }),
|
|
1163
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsx14(
|
|
1164
1317
|
Button,
|
|
1165
1318
|
{
|
|
1166
1319
|
color: "ghost",
|
|
@@ -1174,7 +1327,17 @@ var TopNav = ({
|
|
|
1174
1327
|
] }),
|
|
1175
1328
|
accountOpen && /* @__PURE__ */ jsxs7("div", { className: styles.account(), children: [
|
|
1176
1329
|
/* @__PURE__ */ jsxs7("div", { className: styles.actions(), children: [
|
|
1177
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ jsx14(
|
|
1331
|
+
ThemeToggle,
|
|
1332
|
+
{
|
|
1333
|
+
size: "lg",
|
|
1334
|
+
label: theme.label ?? "Theme",
|
|
1335
|
+
systemLabel: theme.systemLabel,
|
|
1336
|
+
lightLabel: theme.lightLabel,
|
|
1337
|
+
darkLabel: theme.darkLabel
|
|
1338
|
+
}
|
|
1339
|
+
),
|
|
1340
|
+
/* @__PURE__ */ jsx14(
|
|
1178
1341
|
ShareAppButton,
|
|
1179
1342
|
{
|
|
1180
1343
|
label: share.label ?? "Share app",
|
|
@@ -1184,7 +1347,7 @@ var TopNav = ({
|
|
|
1184
1347
|
errorMessage: share.errorMessage
|
|
1185
1348
|
}
|
|
1186
1349
|
),
|
|
1187
|
-
installApp.way && /* @__PURE__ */
|
|
1350
|
+
installApp.way && /* @__PURE__ */ jsx14(
|
|
1188
1351
|
InstallAppButton,
|
|
1189
1352
|
{
|
|
1190
1353
|
way: installApp.way,
|
|
@@ -1197,10 +1360,10 @@ var TopNav = ({
|
|
|
1197
1360
|
] }),
|
|
1198
1361
|
/* @__PURE__ */ jsxs7("div", { className: styles.profile(), children: [
|
|
1199
1362
|
/* @__PURE__ */ jsxs7("div", { className: styles.user(), children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.name }),
|
|
1364
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.email })
|
|
1202
1365
|
] }),
|
|
1203
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ jsx14(
|
|
1204
1367
|
SignOutButton,
|
|
1205
1368
|
{
|
|
1206
1369
|
size: "lg",
|
|
@@ -1214,7 +1377,7 @@ var TopNav = ({
|
|
|
1214
1377
|
)
|
|
1215
1378
|
] })
|
|
1216
1379
|
] }),
|
|
1217
|
-
menuOpen && /* @__PURE__ */
|
|
1380
|
+
menuOpen && /* @__PURE__ */ jsx14("nav", { "aria-label": navLabel, className: styles.menu(), children: sections.map((section2, i) => /* @__PURE__ */ jsx14("div", { className: styles.section(), children: section2.items.map((item) => /* @__PURE__ */ jsxs7(
|
|
1218
1381
|
Link,
|
|
1219
1382
|
{
|
|
1220
1383
|
href: item.href,
|
|
@@ -1224,8 +1387,8 @@ var TopNav = ({
|
|
|
1224
1387
|
"aria-label": item.label,
|
|
1225
1388
|
onClick: close,
|
|
1226
1389
|
children: [
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ jsx14(Icon, { name: item.icon }),
|
|
1391
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: item.label })
|
|
1229
1392
|
]
|
|
1230
1393
|
},
|
|
1231
1394
|
item.href
|
|
@@ -1244,9 +1407,9 @@ var toasterCopyLabel = "Copy";
|
|
|
1244
1407
|
var toasterCopiedLabel = "Copied";
|
|
1245
1408
|
|
|
1246
1409
|
// features/toaster/components/toaster/toaster.styles.ts
|
|
1247
|
-
import { tv as
|
|
1410
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
1248
1411
|
var focusOutline = "focus-visible:outline-2! focus-visible:outline-offset-2! focus-visible:outline-current!";
|
|
1249
|
-
var toaster =
|
|
1412
|
+
var toaster = tv11({
|
|
1250
1413
|
slots: {
|
|
1251
1414
|
toast: focusOutline,
|
|
1252
1415
|
closeButton: focusOutline,
|
|
@@ -1256,21 +1419,21 @@ var toaster = tv10({
|
|
|
1256
1419
|
});
|
|
1257
1420
|
var toasterColors = {
|
|
1258
1421
|
"--success-text": "var(--color-zl-success-strong)",
|
|
1259
|
-
"--success-bg": "color-mix(in oklab, var(--color-zl-success) 15%,
|
|
1260
|
-
"--success-border": "color-mix(in oklab, var(--color-zl-success) 30%,
|
|
1422
|
+
"--success-bg": "color-mix(in oklab, var(--color-zl-success) 15%, var(--color-zl-surface))",
|
|
1423
|
+
"--success-border": "color-mix(in oklab, var(--color-zl-success) 30%, var(--color-zl-surface))",
|
|
1261
1424
|
"--info-text": "var(--color-zl-info-strong)",
|
|
1262
|
-
"--info-bg": "color-mix(in oklab, var(--color-zl-info) 15%,
|
|
1263
|
-
"--info-border": "color-mix(in oklab, var(--color-zl-info) 30%,
|
|
1425
|
+
"--info-bg": "color-mix(in oklab, var(--color-zl-info) 15%, var(--color-zl-surface))",
|
|
1426
|
+
"--info-border": "color-mix(in oklab, var(--color-zl-info) 30%, var(--color-zl-surface))",
|
|
1264
1427
|
"--warning-text": "var(--color-zl-warning-strong)",
|
|
1265
|
-
"--warning-bg": "color-mix(in oklab, var(--color-zl-warning) 15%,
|
|
1266
|
-
"--warning-border": "color-mix(in oklab, var(--color-zl-warning) 30%,
|
|
1428
|
+
"--warning-bg": "color-mix(in oklab, var(--color-zl-warning) 15%, var(--color-zl-surface))",
|
|
1429
|
+
"--warning-border": "color-mix(in oklab, var(--color-zl-warning) 30%, var(--color-zl-surface))",
|
|
1267
1430
|
"--error-text": "var(--color-zl-danger-strong)",
|
|
1268
|
-
"--error-bg": "color-mix(in oklab, var(--color-zl-danger) 15%,
|
|
1269
|
-
"--error-border": "color-mix(in oklab, var(--color-zl-danger) 30%,
|
|
1431
|
+
"--error-bg": "color-mix(in oklab, var(--color-zl-danger) 15%, var(--color-zl-surface))",
|
|
1432
|
+
"--error-border": "color-mix(in oklab, var(--color-zl-danger) 30%, var(--color-zl-surface))"
|
|
1270
1433
|
};
|
|
1271
1434
|
|
|
1272
1435
|
// features/toaster/components/toaster/toaster-copy-button.tsx
|
|
1273
|
-
import { jsx as
|
|
1436
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1274
1437
|
var ToasterCopyButton = ({ text: text2 }) => {
|
|
1275
1438
|
const [copied, setCopied] = useState4(false);
|
|
1276
1439
|
const { copyButton } = toaster();
|
|
@@ -1279,7 +1442,7 @@ var ToasterCopyButton = ({ text: text2 }) => {
|
|
|
1279
1442
|
// Without permission the browser refuses, and the button stays on Copy.
|
|
1280
1443
|
() => void 0
|
|
1281
1444
|
);
|
|
1282
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ jsx15("span", { className: copyButton(), children: /* @__PURE__ */ jsx15(
|
|
1283
1446
|
Button,
|
|
1284
1447
|
{
|
|
1285
1448
|
color: "ghost",
|
|
@@ -1292,13 +1455,13 @@ var ToasterCopyButton = ({ text: text2 }) => {
|
|
|
1292
1455
|
};
|
|
1293
1456
|
|
|
1294
1457
|
// features/toaster/components/toaster/toast.tsx
|
|
1295
|
-
import { jsx as
|
|
1458
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1296
1459
|
var copyText = (message, description2) => typeof description2 === "string" ? `${message}
|
|
1297
1460
|
${description2}` : message;
|
|
1298
1461
|
var withCopy = (show) => (message, data) => show(
|
|
1299
1462
|
message,
|
|
1300
1463
|
typeof message === "string" ? {
|
|
1301
|
-
action: /* @__PURE__ */
|
|
1464
|
+
action: /* @__PURE__ */ jsx16(ToasterCopyButton, { text: copyText(message, data?.description) }),
|
|
1302
1465
|
...data
|
|
1303
1466
|
} : data
|
|
1304
1467
|
);
|
|
@@ -1314,7 +1477,7 @@ var toast = Object.assign(
|
|
|
1314
1477
|
// features/toaster/components/toaster/toaster.tsx
|
|
1315
1478
|
import { useEffect as useEffect3 } from "react";
|
|
1316
1479
|
import { Toaster as SonnerToaster } from "sonner";
|
|
1317
|
-
import { jsx as
|
|
1480
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1318
1481
|
var Toaster = () => {
|
|
1319
1482
|
const toasts = useToastStore((s) => s.toasts);
|
|
1320
1483
|
const removeToast = useToastStore((s) => s.removeToast);
|
|
@@ -1325,7 +1488,7 @@ var Toaster = () => {
|
|
|
1325
1488
|
removeToast(t.id);
|
|
1326
1489
|
});
|
|
1327
1490
|
}, [toasts, removeToast]);
|
|
1328
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsx17(
|
|
1329
1492
|
SonnerToaster,
|
|
1330
1493
|
{
|
|
1331
1494
|
position: "bottom-right",
|
|
@@ -1350,44 +1513,44 @@ var spinnerIcons = {
|
|
|
1350
1513
|
};
|
|
1351
1514
|
|
|
1352
1515
|
// core/spinner/spinner.styles.ts
|
|
1353
|
-
import { tv as
|
|
1354
|
-
var spinner =
|
|
1516
|
+
import { tv as tv12 } from "tailwind-variants";
|
|
1517
|
+
var spinner = tv12({
|
|
1355
1518
|
base: "inline-flex animate-spin"
|
|
1356
1519
|
});
|
|
1357
1520
|
|
|
1358
1521
|
// core/spinner/spinner.tsx
|
|
1359
|
-
import { jsx as
|
|
1522
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1360
1523
|
var Spinner = ({
|
|
1361
1524
|
variant = "circle",
|
|
1362
1525
|
size = "md",
|
|
1363
1526
|
label = "Loading"
|
|
1364
|
-
}) => /* @__PURE__ */
|
|
1527
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1365
1528
|
"span",
|
|
1366
1529
|
{
|
|
1367
1530
|
"data-testid": "spinner",
|
|
1368
1531
|
role: "status",
|
|
1369
1532
|
"aria-label": label,
|
|
1370
1533
|
className: spinner(),
|
|
1371
|
-
children: /* @__PURE__ */
|
|
1534
|
+
children: /* @__PURE__ */ jsx18(Icon, { name: spinnerIcons[variant], size })
|
|
1372
1535
|
}
|
|
1373
1536
|
);
|
|
1374
1537
|
|
|
1375
1538
|
// features/app/components/loader/loader.styles.ts
|
|
1376
|
-
import { tv as
|
|
1377
|
-
var loader =
|
|
1539
|
+
import { tv as tv13 } from "tailwind-variants";
|
|
1540
|
+
var loader = tv13({
|
|
1378
1541
|
base: "flex fixed inset-0 justify-center items-center bg-black/20 text-zl-primary z-60"
|
|
1379
1542
|
});
|
|
1380
1543
|
|
|
1381
1544
|
// features/app/components/loader/loader.tsx
|
|
1382
|
-
import { jsx as
|
|
1545
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1383
1546
|
var Loader = ({ label = "Loading" }) => {
|
|
1384
1547
|
const fetching = useAppStore((s) => s.fetching);
|
|
1385
1548
|
if (!fetching) return null;
|
|
1386
|
-
return /* @__PURE__ */
|
|
1549
|
+
return /* @__PURE__ */ jsx19("div", { className: loader(), children: /* @__PURE__ */ jsx19(Spinner, { size: "lg", label }) });
|
|
1387
1550
|
};
|
|
1388
1551
|
|
|
1389
1552
|
// features/app/components/navigation/navigation.tsx
|
|
1390
|
-
import { jsx as
|
|
1553
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1391
1554
|
var Navigation = ({
|
|
1392
1555
|
mode = "auto",
|
|
1393
1556
|
sections,
|
|
@@ -1401,6 +1564,7 @@ var Navigation = ({
|
|
|
1401
1564
|
navLabel,
|
|
1402
1565
|
menuLabel,
|
|
1403
1566
|
accountLabel,
|
|
1567
|
+
theme,
|
|
1404
1568
|
share,
|
|
1405
1569
|
install,
|
|
1406
1570
|
logout,
|
|
@@ -1412,7 +1576,7 @@ var Navigation = ({
|
|
|
1412
1576
|
return null;
|
|
1413
1577
|
}
|
|
1414
1578
|
if (desktop) {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsx20(
|
|
1416
1580
|
Sidebar,
|
|
1417
1581
|
{
|
|
1418
1582
|
sections,
|
|
@@ -1424,13 +1588,14 @@ var Navigation = ({
|
|
|
1424
1588
|
homeHref,
|
|
1425
1589
|
homeLabel,
|
|
1426
1590
|
navLabel,
|
|
1591
|
+
theme,
|
|
1427
1592
|
share,
|
|
1428
1593
|
logout,
|
|
1429
1594
|
onLogout
|
|
1430
1595
|
}
|
|
1431
1596
|
);
|
|
1432
1597
|
}
|
|
1433
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ jsx20(
|
|
1434
1599
|
TopNav,
|
|
1435
1600
|
{
|
|
1436
1601
|
sections,
|
|
@@ -1441,6 +1606,7 @@ var Navigation = ({
|
|
|
1441
1606
|
navLabel,
|
|
1442
1607
|
menuLabel,
|
|
1443
1608
|
accountLabel,
|
|
1609
|
+
theme,
|
|
1444
1610
|
share,
|
|
1445
1611
|
install,
|
|
1446
1612
|
logout,
|
|
@@ -1483,7 +1649,7 @@ var createReduxStore = ({
|
|
|
1483
1649
|
};
|
|
1484
1650
|
|
|
1485
1651
|
// core/state/redux/redux-provider/redux-provider.tsx
|
|
1486
|
-
import { jsx as
|
|
1652
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1487
1653
|
var ReduxProvider = ({
|
|
1488
1654
|
children,
|
|
1489
1655
|
reducers = {},
|
|
@@ -1499,7 +1665,7 @@ var ReduxProvider = ({
|
|
|
1499
1665
|
coreReducers
|
|
1500
1666
|
})
|
|
1501
1667
|
);
|
|
1502
|
-
return /* @__PURE__ */
|
|
1668
|
+
return /* @__PURE__ */ jsx21(Provider, { store, children });
|
|
1503
1669
|
};
|
|
1504
1670
|
|
|
1505
1671
|
// core/state/zustand/router/router.utils.ts
|
|
@@ -1560,11 +1726,11 @@ var usePageStore = create5()(
|
|
|
1560
1726
|
);
|
|
1561
1727
|
|
|
1562
1728
|
// core/card/card.styles.ts
|
|
1563
|
-
import { tv as
|
|
1564
|
-
var card =
|
|
1729
|
+
import { tv as tv14 } from "tailwind-variants";
|
|
1730
|
+
var card = tv14({
|
|
1565
1731
|
slots: {
|
|
1566
1732
|
// A soft, wide shadow in the color of the card. shadow-sm only spreads 1 to
|
|
1567
|
-
// 3px and reads as part of the border on a
|
|
1733
|
+
// 3px and reads as part of the border on a light page.
|
|
1568
1734
|
base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
|
|
1569
1735
|
header: "flex flex-col gap-1"
|
|
1570
1736
|
},
|
|
@@ -1582,7 +1748,7 @@ var card = tv13({
|
|
|
1582
1748
|
},
|
|
1583
1749
|
info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
|
|
1584
1750
|
muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
|
|
1585
|
-
none: { base: "border-
|
|
1751
|
+
none: { base: "border-zl-border bg-zl-surface shadow-black/12" }
|
|
1586
1752
|
}
|
|
1587
1753
|
},
|
|
1588
1754
|
defaultVariants: {
|
|
@@ -1591,7 +1757,7 @@ var card = tv13({
|
|
|
1591
1757
|
});
|
|
1592
1758
|
|
|
1593
1759
|
// core/card/card.tsx
|
|
1594
|
-
import { jsx as
|
|
1760
|
+
import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1595
1761
|
var Card = ({
|
|
1596
1762
|
children,
|
|
1597
1763
|
title: title2,
|
|
@@ -1603,23 +1769,23 @@ var Card = ({
|
|
|
1603
1769
|
const messageColor = color === "none" ? "muted" : "none";
|
|
1604
1770
|
return /* @__PURE__ */ jsxs8("div", { "data-testid": "card", className: base(), children: [
|
|
1605
1771
|
(title2 || message) && /* @__PURE__ */ jsxs8("div", { className: header3(), children: [
|
|
1606
|
-
title2 && /* @__PURE__ */
|
|
1607
|
-
message && /* @__PURE__ */
|
|
1772
|
+
title2 && /* @__PURE__ */ jsx22(Heading, { level: titleLevel, children: title2 }),
|
|
1773
|
+
message && /* @__PURE__ */ jsx22(Text, { color: messageColor, children: message })
|
|
1608
1774
|
] }),
|
|
1609
1775
|
children
|
|
1610
1776
|
] });
|
|
1611
1777
|
};
|
|
1612
1778
|
|
|
1613
1779
|
// features/auth/components/access-pending/access-pending.styles.ts
|
|
1614
|
-
import { tv as
|
|
1615
|
-
var accessPending =
|
|
1780
|
+
import { tv as tv15 } from "tailwind-variants";
|
|
1781
|
+
var accessPending = tv15({
|
|
1616
1782
|
slots: {
|
|
1617
1783
|
account: "flex items-center justify-between gap-3"
|
|
1618
1784
|
}
|
|
1619
1785
|
});
|
|
1620
1786
|
|
|
1621
1787
|
// features/auth/components/access-pending/access-pending.tsx
|
|
1622
|
-
import { jsx as
|
|
1788
|
+
import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1623
1789
|
var AccessPending = ({
|
|
1624
1790
|
title: title2 = "Waiting for approval",
|
|
1625
1791
|
message = "Your access to this app has not been approved yet.",
|
|
@@ -1634,9 +1800,9 @@ var AccessPending = ({
|
|
|
1634
1800
|
if (!user) {
|
|
1635
1801
|
return null;
|
|
1636
1802
|
}
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ jsx23(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsxs9("div", { className: account(), children: [
|
|
1804
|
+
/* @__PURE__ */ jsx23(Text, { variant: "caption", color: "muted", children: user.email }),
|
|
1805
|
+
/* @__PURE__ */ jsx23(
|
|
1640
1806
|
SignOutButton,
|
|
1641
1807
|
{
|
|
1642
1808
|
label: signOutLabel,
|
|
@@ -1651,7 +1817,7 @@ var AccessPending = ({
|
|
|
1651
1817
|
|
|
1652
1818
|
// features/auth/components/auth-provider/auth-provider.tsx
|
|
1653
1819
|
import { useEffect as useEffect4 } from "react";
|
|
1654
|
-
import { Fragment as Fragment6, jsx as
|
|
1820
|
+
import { Fragment as Fragment6, jsx as jsx24 } from "react/jsx-runtime";
|
|
1655
1821
|
var AuthProvider = ({
|
|
1656
1822
|
adapter,
|
|
1657
1823
|
appId,
|
|
@@ -1668,7 +1834,7 @@ var AuthProvider = ({
|
|
|
1668
1834
|
reset();
|
|
1669
1835
|
};
|
|
1670
1836
|
}, [adapter, appId, configure, setSession, reset]);
|
|
1671
|
-
return /* @__PURE__ */
|
|
1837
|
+
return /* @__PURE__ */ jsx24(Fragment6, { children });
|
|
1672
1838
|
};
|
|
1673
1839
|
|
|
1674
1840
|
// features/auth/components/login/login.const.ts
|
|
@@ -1682,15 +1848,15 @@ var loginVendors = {
|
|
|
1682
1848
|
};
|
|
1683
1849
|
|
|
1684
1850
|
// features/auth/components/login/login.styles.ts
|
|
1685
|
-
import { tv as
|
|
1686
|
-
var login =
|
|
1851
|
+
import { tv as tv16 } from "tailwind-variants";
|
|
1852
|
+
var login = tv16({
|
|
1687
1853
|
slots: {
|
|
1688
1854
|
options: "flex flex-col gap-3"
|
|
1689
1855
|
}
|
|
1690
1856
|
});
|
|
1691
1857
|
|
|
1692
1858
|
// features/auth/components/login/login.tsx
|
|
1693
|
-
import { jsx as
|
|
1859
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1694
1860
|
var LoginProviderButton = ({
|
|
1695
1861
|
id,
|
|
1696
1862
|
label,
|
|
@@ -1699,7 +1865,7 @@ var LoginProviderButton = ({
|
|
|
1699
1865
|
const signIn = () => {
|
|
1700
1866
|
onSignIn(id);
|
|
1701
1867
|
};
|
|
1702
|
-
return /* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ jsx25(Button, { size: "lg", fullWidth: true, onClick: signIn, children: label });
|
|
1703
1869
|
};
|
|
1704
1870
|
var Login = ({
|
|
1705
1871
|
vendor,
|
|
@@ -1717,9 +1883,9 @@ var Login = ({
|
|
|
1717
1883
|
useToastStore.getState().error(errorMessage);
|
|
1718
1884
|
});
|
|
1719
1885
|
};
|
|
1720
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ jsx25(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsx25("div", { className: options(), children: providers.map((provider) => {
|
|
1721
1887
|
const id = String(provider);
|
|
1722
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsx25(
|
|
1723
1889
|
LoginProviderButton,
|
|
1724
1890
|
{
|
|
1725
1891
|
id,
|
|
@@ -1732,7 +1898,7 @@ var Login = ({
|
|
|
1732
1898
|
};
|
|
1733
1899
|
|
|
1734
1900
|
// features/auth/components/authorized/authorized.tsx
|
|
1735
|
-
import { Fragment as Fragment7, jsx as
|
|
1901
|
+
import { Fragment as Fragment7, jsx as jsx26 } from "react/jsx-runtime";
|
|
1736
1902
|
var Authorized = ({
|
|
1737
1903
|
children,
|
|
1738
1904
|
roles,
|
|
@@ -1741,18 +1907,18 @@ var Authorized = ({
|
|
|
1741
1907
|
}) => {
|
|
1742
1908
|
const { status, user, role } = useAuth();
|
|
1743
1909
|
if (status === "loading") return null;
|
|
1744
|
-
if (!user) return /* @__PURE__ */
|
|
1910
|
+
if (!user) return /* @__PURE__ */ jsx26(Login, { ...login2 });
|
|
1745
1911
|
const hasRole = !roles || role !== null && roles.includes(role);
|
|
1746
|
-
if (!user.hasAccess || !hasRole) return /* @__PURE__ */
|
|
1747
|
-
return /* @__PURE__ */
|
|
1912
|
+
if (!user.hasAccess || !hasRole) return /* @__PURE__ */ jsx26(AccessPending, { ...accessPending2 });
|
|
1913
|
+
return /* @__PURE__ */ jsx26(Fragment7, { children });
|
|
1748
1914
|
};
|
|
1749
1915
|
|
|
1750
1916
|
// features/providers/components/zustand-providers/zustand-providers.tsx
|
|
1751
|
-
import { Fragment as Fragment8, jsx as
|
|
1917
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1752
1918
|
var ZustandProviders = ({ children, auth }) => /* @__PURE__ */ jsxs10(Fragment8, { children: [
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
auth ? /* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsx27(Loader, {}),
|
|
1920
|
+
/* @__PURE__ */ jsx27(Toaster, {}),
|
|
1921
|
+
auth ? /* @__PURE__ */ jsx27(AuthProvider, { adapter: auth.adapter, appId: auth.appId, children }) : children
|
|
1756
1922
|
] });
|
|
1757
1923
|
|
|
1758
1924
|
export {
|
|
@@ -1761,6 +1927,12 @@ export {
|
|
|
1761
1927
|
Text,
|
|
1762
1928
|
Modal,
|
|
1763
1929
|
Heading,
|
|
1930
|
+
useInstallApp,
|
|
1931
|
+
useIsDesktop,
|
|
1932
|
+
themeScript,
|
|
1933
|
+
setTheme,
|
|
1934
|
+
useTheme,
|
|
1935
|
+
ThemeToggle,
|
|
1764
1936
|
useToastStore,
|
|
1765
1937
|
ShareAppButton,
|
|
1766
1938
|
appInitialState,
|
|
@@ -1772,8 +1944,6 @@ export {
|
|
|
1772
1944
|
Link,
|
|
1773
1945
|
Sidebar,
|
|
1774
1946
|
InstallAppButton,
|
|
1775
|
-
useInstallApp,
|
|
1776
|
-
useIsDesktop,
|
|
1777
1947
|
TopNav,
|
|
1778
1948
|
toast,
|
|
1779
1949
|
Toaster,
|