@alexandregme/zljs 3.22.0 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -1
- package/README.md +49 -8
- package/dist/{chunk-GQX4SRDD.js → chunk-NHCD5NHZ.js} +389 -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,203 @@ 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 themeScript = `(function(){try{var t=localStorage.getItem("${THEME_STORAGE_KEY}");if(t==="light"||t==="dark"){var s=document.createElement("style");s.id="${THEME_STYLE_ID}";s.textContent=":root:root{color-scheme:"+t+"}";document.head.appendChild(s)}}catch(e){}})()`;
|
|
467
|
+
|
|
468
|
+
// features/app/hooks/use-theme/use-theme.ts
|
|
469
|
+
var SYSTEM = "system";
|
|
470
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
471
|
+
var isTheme = (value) => themes.includes(value);
|
|
472
|
+
var readTheme = () => {
|
|
473
|
+
try {
|
|
474
|
+
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
475
|
+
return isTheme(stored) ? stored : SYSTEM;
|
|
476
|
+
} catch {
|
|
477
|
+
return SYSTEM;
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
var storeTheme = (theme) => {
|
|
481
|
+
try {
|
|
482
|
+
if (theme === SYSTEM) {
|
|
483
|
+
localStorage.removeItem(THEME_STORAGE_KEY);
|
|
484
|
+
} else {
|
|
485
|
+
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
486
|
+
}
|
|
487
|
+
} catch {
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
var applyTheme = (theme) => {
|
|
491
|
+
const existing = document.getElementById(THEME_STYLE_ID);
|
|
492
|
+
const style = existing ?? document.createElement("style");
|
|
493
|
+
style.id = THEME_STYLE_ID;
|
|
494
|
+
style.textContent = theme === SYSTEM ? "" : `:root:root{color-scheme:${theme}}`;
|
|
495
|
+
if (!existing) {
|
|
496
|
+
document.head.append(style);
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
var setTheme = (theme) => {
|
|
500
|
+
storeTheme(theme);
|
|
501
|
+
applyTheme(theme);
|
|
502
|
+
listeners.forEach((listener) => listener());
|
|
503
|
+
};
|
|
504
|
+
var subscribe2 = (onChange) => {
|
|
505
|
+
const followOtherTab = (event) => {
|
|
506
|
+
if (event.key === THEME_STORAGE_KEY || event.key === null) {
|
|
507
|
+
applyTheme(readTheme());
|
|
508
|
+
onChange();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
applyTheme(readTheme());
|
|
512
|
+
listeners.add(onChange);
|
|
513
|
+
window.addEventListener("storage", followOtherTab);
|
|
514
|
+
return () => {
|
|
515
|
+
listeners.delete(onChange);
|
|
516
|
+
window.removeEventListener("storage", followOtherTab);
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
var unknown2 = () => SYSTEM;
|
|
520
|
+
var useTheme = () => {
|
|
521
|
+
const theme = useSyncExternalStore3(subscribe2, readTheme, unknown2);
|
|
522
|
+
return { theme, setTheme };
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// features/app/components/theme-toggle/theme-toggle.const.ts
|
|
526
|
+
var themeToggleIcons = {
|
|
527
|
+
system: "Monitor",
|
|
528
|
+
light: "Sun",
|
|
529
|
+
dark: "Moon"
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// features/app/components/theme-toggle/theme-toggle.styles.ts
|
|
533
|
+
import { tv as tv6 } from "tailwind-variants";
|
|
534
|
+
var themeToggle = tv6({
|
|
535
|
+
// The three share the width of the line, each as tall as a row of a menu.
|
|
536
|
+
base: "flex gap-1 [&>button]:h-10 [&>button]:flex-1"
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
// features/app/components/theme-toggle/theme-toggle.tsx
|
|
540
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
541
|
+
var ThemeToggle = ({
|
|
542
|
+
label,
|
|
543
|
+
iconOnly = false,
|
|
544
|
+
size = "md",
|
|
545
|
+
systemLabel = "System",
|
|
546
|
+
lightLabel = "Light",
|
|
547
|
+
darkLabel = "Dark"
|
|
548
|
+
}) => {
|
|
549
|
+
const { theme, setTheme: setTheme2 } = useTheme();
|
|
550
|
+
const labels = {
|
|
551
|
+
system: systemLabel,
|
|
552
|
+
light: lightLabel,
|
|
553
|
+
dark: darkLabel
|
|
554
|
+
};
|
|
555
|
+
const next = () => {
|
|
556
|
+
setTheme2(themes[(themes.indexOf(theme) + 1) % themes.length]);
|
|
557
|
+
};
|
|
558
|
+
if (iconOnly) {
|
|
559
|
+
return /* @__PURE__ */ jsx6(
|
|
560
|
+
Button,
|
|
561
|
+
{
|
|
562
|
+
color: "ghost",
|
|
563
|
+
size,
|
|
564
|
+
icon: themeToggleIcons[theme],
|
|
565
|
+
"aria-label": `${label}: ${labels[theme]}`,
|
|
566
|
+
onClick: next
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
return /* @__PURE__ */ jsx6("div", { role: "group", "aria-label": label, className: themeToggle(), children: themes.map((option) => {
|
|
571
|
+
const select = () => {
|
|
572
|
+
setTheme2(option);
|
|
573
|
+
};
|
|
574
|
+
return /* @__PURE__ */ jsx6(
|
|
575
|
+
Button,
|
|
576
|
+
{
|
|
577
|
+
color: "ghost",
|
|
578
|
+
size,
|
|
579
|
+
icon: themeToggleIcons[option],
|
|
580
|
+
"aria-label": labels[option],
|
|
581
|
+
"aria-pressed": theme === option,
|
|
582
|
+
onClick: select
|
|
583
|
+
},
|
|
584
|
+
option
|
|
585
|
+
);
|
|
586
|
+
}) });
|
|
587
|
+
};
|
|
588
|
+
|
|
390
589
|
// features/toaster/state/toast.store.ts
|
|
391
590
|
import { create } from "zustand";
|
|
392
591
|
import { devtools } from "zustand/middleware";
|
|
@@ -430,7 +629,7 @@ var useToastStore = create()(
|
|
|
430
629
|
var SHARE_APP_CANCELLED = "AbortError";
|
|
431
630
|
|
|
432
631
|
// features/app/components/share-app-button/share-app-button.tsx
|
|
433
|
-
import { jsx as
|
|
632
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
434
633
|
var ShareAppButton = ({
|
|
435
634
|
label,
|
|
436
635
|
iconOnly = false,
|
|
@@ -469,7 +668,7 @@ var ShareAppButton = ({
|
|
|
469
668
|
const share = () => {
|
|
470
669
|
void shareOrCopy();
|
|
471
670
|
};
|
|
472
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ jsx7(
|
|
473
672
|
Button,
|
|
474
673
|
{
|
|
475
674
|
color: "ghost",
|
|
@@ -540,7 +739,7 @@ var useAppStore = create2()(
|
|
|
540
739
|
);
|
|
541
740
|
|
|
542
741
|
// features/app/components/connected-modal/connected-modal.tsx
|
|
543
|
-
import { jsx as
|
|
742
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
544
743
|
var ConnectedModal = ({
|
|
545
744
|
modalId,
|
|
546
745
|
title: title2,
|
|
@@ -554,7 +753,7 @@ var ConnectedModal = ({
|
|
|
554
753
|
const close = () => {
|
|
555
754
|
closeModal(modalId);
|
|
556
755
|
};
|
|
557
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ jsx8(
|
|
558
757
|
Modal,
|
|
559
758
|
{
|
|
560
759
|
open,
|
|
@@ -632,15 +831,15 @@ var useAuth = () => {
|
|
|
632
831
|
var SIGN_OUT_MODAL_ID = "zljs-sign-out";
|
|
633
832
|
|
|
634
833
|
// features/auth/components/sign-out/sign-out-modal.styles.ts
|
|
635
|
-
import { tv as
|
|
636
|
-
var signOutModal =
|
|
834
|
+
import { tv as tv7 } from "tailwind-variants";
|
|
835
|
+
var signOutModal = tv7({
|
|
637
836
|
slots: {
|
|
638
837
|
actions: "flex justify-end gap-2"
|
|
639
838
|
}
|
|
640
839
|
});
|
|
641
840
|
|
|
642
841
|
// features/auth/components/sign-out/sign-out-modal.tsx
|
|
643
|
-
import { jsx as
|
|
842
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
644
843
|
var SignOutModal = ({
|
|
645
844
|
title: title2 = "Sign out?",
|
|
646
845
|
confirmLabel = "Sign out",
|
|
@@ -668,7 +867,7 @@ var SignOutModal = ({
|
|
|
668
867
|
closeModal(SIGN_OUT_MODAL_ID);
|
|
669
868
|
signOutOfApp().catch(showError);
|
|
670
869
|
};
|
|
671
|
-
return /* @__PURE__ */
|
|
870
|
+
return /* @__PURE__ */ jsx9(
|
|
672
871
|
ConnectedModal,
|
|
673
872
|
{
|
|
674
873
|
modalId: SIGN_OUT_MODAL_ID,
|
|
@@ -676,15 +875,15 @@ var SignOutModal = ({
|
|
|
676
875
|
size: "xs",
|
|
677
876
|
color: "danger",
|
|
678
877
|
children: /* @__PURE__ */ jsxs3("div", { className: actions2(), children: [
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ jsx9(Button, { color: "ghost", onClick: stay, children: cancelLabel }),
|
|
879
|
+
/* @__PURE__ */ jsx9(Button, { color: "danger", onClick: leave, children: confirmLabel })
|
|
681
880
|
] })
|
|
682
881
|
}
|
|
683
882
|
);
|
|
684
883
|
};
|
|
685
884
|
|
|
686
885
|
// features/auth/components/sign-out/sign-out-button.tsx
|
|
687
|
-
import { Fragment as Fragment3, jsx as
|
|
886
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
688
887
|
var SignOutButton = ({
|
|
689
888
|
label = "Sign out",
|
|
690
889
|
size = "md",
|
|
@@ -699,7 +898,7 @@ var SignOutButton = ({
|
|
|
699
898
|
openModal(SIGN_OUT_MODAL_ID);
|
|
700
899
|
};
|
|
701
900
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
702
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ jsx10(
|
|
703
902
|
Button,
|
|
704
903
|
{
|
|
705
904
|
color: "ghost",
|
|
@@ -709,7 +908,7 @@ var SignOutButton = ({
|
|
|
709
908
|
onClick: ask
|
|
710
909
|
}
|
|
711
910
|
),
|
|
712
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ jsx10(
|
|
713
912
|
SignOutModal,
|
|
714
913
|
{
|
|
715
914
|
title: confirmTitle,
|
|
@@ -726,8 +925,8 @@ var SignOutButton = ({
|
|
|
726
925
|
import NextLink from "next/link.js";
|
|
727
926
|
|
|
728
927
|
// core/next/link/link.styles.ts
|
|
729
|
-
import { tv as
|
|
730
|
-
var link =
|
|
928
|
+
import { tv as tv8 } from "tailwind-variants";
|
|
929
|
+
var link = tv8({
|
|
731
930
|
// outline-current draws the focus in the text color.
|
|
732
931
|
base: "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current",
|
|
733
932
|
variants: {
|
|
@@ -763,7 +962,7 @@ var link = tv7({
|
|
|
763
962
|
});
|
|
764
963
|
|
|
765
964
|
// core/next/link/link.tsx
|
|
766
|
-
import { jsx as
|
|
965
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
767
966
|
var Link = ({
|
|
768
967
|
children,
|
|
769
968
|
href,
|
|
@@ -774,7 +973,7 @@ var Link = ({
|
|
|
774
973
|
"aria-label": ariaLabel,
|
|
775
974
|
onClick
|
|
776
975
|
}) => {
|
|
777
|
-
return /* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ jsx11(
|
|
778
977
|
NextLink,
|
|
779
978
|
{
|
|
780
979
|
href,
|
|
@@ -789,12 +988,15 @@ var Link = ({
|
|
|
789
988
|
};
|
|
790
989
|
|
|
791
990
|
// core/sidebar/sidebar.tsx
|
|
792
|
-
import { useState } from "react";
|
|
991
|
+
import { useState as useState2 } from "react";
|
|
793
992
|
|
|
794
993
|
// core/sidebar/sidebar.styles.ts
|
|
795
|
-
import { tv as
|
|
796
|
-
var sidebar =
|
|
797
|
-
|
|
994
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
995
|
+
var sidebar = tv9({
|
|
996
|
+
// A surface beside the page, with a line between the two: white in the light
|
|
997
|
+
// theme and dark in the dark one. The line is an inset shadow, which takes no
|
|
998
|
+
// width: a border would move what is centered in the collapsed sidebar.
|
|
999
|
+
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
1000
|
variants: {
|
|
799
1001
|
collapsed: {
|
|
800
1002
|
true: "w-14",
|
|
@@ -802,19 +1004,19 @@ var sidebar = tv8({
|
|
|
802
1004
|
}
|
|
803
1005
|
}
|
|
804
1006
|
});
|
|
805
|
-
var nav =
|
|
806
|
-
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-
|
|
1007
|
+
var nav = tv9({
|
|
1008
|
+
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-zl-border"
|
|
807
1009
|
});
|
|
808
|
-
var header2 =
|
|
1010
|
+
var header2 = tv9({
|
|
809
1011
|
base: "shrink-0 p-2"
|
|
810
1012
|
});
|
|
811
|
-
var section =
|
|
1013
|
+
var section = tv9({
|
|
812
1014
|
base: "grid gap-1 p-2"
|
|
813
1015
|
});
|
|
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"
|
|
1016
|
+
var actions = tv9({
|
|
1017
|
+
base: "shrink-0 grid gap-1 p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
816
1018
|
});
|
|
817
|
-
var footer =
|
|
1019
|
+
var footer = tv9({
|
|
818
1020
|
base: "shrink-0 h-16 p-3 flex items-center gap-3",
|
|
819
1021
|
variants: {
|
|
820
1022
|
collapsed: {
|
|
@@ -822,18 +1024,18 @@ var footer = tv8({
|
|
|
822
1024
|
}
|
|
823
1025
|
}
|
|
824
1026
|
});
|
|
825
|
-
var avatar =
|
|
826
|
-
base: "shrink-0 size-8 rounded-full bg-
|
|
1027
|
+
var avatar = tv9({
|
|
1028
|
+
base: "shrink-0 size-8 rounded-full bg-zl-surface-hover text-zl-text text-xs font-medium flex items-center justify-center"
|
|
827
1029
|
});
|
|
828
|
-
var userInfo =
|
|
829
|
-
base: "flex flex-col min-w-0 text-
|
|
1030
|
+
var userInfo = tv9({
|
|
1031
|
+
base: "flex flex-col min-w-0 text-zl-text [&>*]:truncate [&>*:last-child]:text-xs [&>*:last-child]:text-zl-muted"
|
|
830
1032
|
});
|
|
831
|
-
var toggleButton =
|
|
1033
|
+
var toggleButton = tv9({
|
|
832
1034
|
base: "shrink-0 h-14 grid p-2 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
833
1035
|
});
|
|
834
1036
|
|
|
835
1037
|
// core/sidebar/sidebar.tsx
|
|
836
|
-
import { Fragment as Fragment4, jsx as
|
|
1038
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
837
1039
|
var getInitials = (name) => {
|
|
838
1040
|
const parts = name.trim().split(/\s+/);
|
|
839
1041
|
if (parts.length >= 2) {
|
|
@@ -851,11 +1053,12 @@ var Sidebar = ({
|
|
|
851
1053
|
homeHref = "/",
|
|
852
1054
|
homeLabel,
|
|
853
1055
|
navLabel = "Main navigation",
|
|
1056
|
+
theme = {},
|
|
854
1057
|
share = {},
|
|
855
1058
|
logout = {},
|
|
856
1059
|
onLogout
|
|
857
1060
|
}) => {
|
|
858
|
-
const [collapsed, setCollapsed] =
|
|
1061
|
+
const [collapsed, setCollapsed] = useState2(defaultCollapsed);
|
|
859
1062
|
const initials = getInitials(user.name);
|
|
860
1063
|
const toggleLabel = collapsed ? expandLabel : collapseLabel;
|
|
861
1064
|
const toggleIcon = collapsed ? "ChevronRight" : "ChevronLeft";
|
|
@@ -863,7 +1066,7 @@ var Sidebar = ({
|
|
|
863
1066
|
setCollapsed(!collapsed);
|
|
864
1067
|
};
|
|
865
1068
|
return /* @__PURE__ */ jsxs5("aside", { className: sidebar({ collapsed }), children: [
|
|
866
|
-
homeHref && /* @__PURE__ */
|
|
1069
|
+
homeHref && /* @__PURE__ */ jsx12("div", { className: header2(), children: /* @__PURE__ */ jsxs5(
|
|
867
1070
|
Link,
|
|
868
1071
|
{
|
|
869
1072
|
href: homeHref,
|
|
@@ -872,12 +1075,12 @@ var Sidebar = ({
|
|
|
872
1075
|
active: homeHref === activeHref,
|
|
873
1076
|
"aria-label": homeLabel || "Home",
|
|
874
1077
|
children: [
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
homeLabel && !collapsed && /* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ jsx12(Icon, { name: "Home" }),
|
|
1079
|
+
homeLabel && !collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: homeLabel })
|
|
877
1080
|
]
|
|
878
1081
|
}
|
|
879
1082
|
) }),
|
|
880
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__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
1084
|
Link,
|
|
882
1085
|
{
|
|
883
1086
|
href: sidebarItem.href,
|
|
@@ -886,32 +1089,44 @@ var Sidebar = ({
|
|
|
886
1089
|
active: sidebarItem.href === activeHref,
|
|
887
1090
|
"aria-label": sidebarItem.label,
|
|
888
1091
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
!collapsed && /* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsx12(Icon, { name: sidebarItem.icon }),
|
|
1093
|
+
!collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: sidebarItem.label })
|
|
891
1094
|
]
|
|
892
1095
|
},
|
|
893
1096
|
sidebarItem.href
|
|
894
1097
|
)) }, i)) }),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1098
|
+
/* @__PURE__ */ jsxs5("div", { className: actions(), children: [
|
|
1099
|
+
/* @__PURE__ */ jsx12(
|
|
1100
|
+
ThemeToggle,
|
|
1101
|
+
{
|
|
1102
|
+
label: theme.label ?? "Theme",
|
|
1103
|
+
iconOnly: collapsed,
|
|
1104
|
+
systemLabel: theme.systemLabel,
|
|
1105
|
+
lightLabel: theme.lightLabel,
|
|
1106
|
+
darkLabel: theme.darkLabel
|
|
1107
|
+
}
|
|
1108
|
+
),
|
|
1109
|
+
/* @__PURE__ */ jsx12(
|
|
1110
|
+
ShareAppButton,
|
|
1111
|
+
{
|
|
1112
|
+
label: share.label ?? "Share app",
|
|
1113
|
+
iconOnly: collapsed,
|
|
1114
|
+
title: share.title,
|
|
1115
|
+
text: share.text,
|
|
1116
|
+
copiedMessage: share.copiedMessage,
|
|
1117
|
+
errorMessage: share.errorMessage
|
|
1118
|
+
}
|
|
1119
|
+
)
|
|
1120
|
+
] }),
|
|
906
1121
|
/* @__PURE__ */ jsxs5("div", { className: footer({ collapsed }), children: [
|
|
907
1122
|
!collapsed && /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
908
|
-
/* @__PURE__ */
|
|
1123
|
+
/* @__PURE__ */ jsx12("div", { "aria-hidden": "true", className: avatar(), children: initials }),
|
|
909
1124
|
/* @__PURE__ */ jsxs5("div", { className: userInfo(), children: [
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.name }),
|
|
1126
|
+
/* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.email })
|
|
912
1127
|
] })
|
|
913
1128
|
] }),
|
|
914
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ jsx12(
|
|
915
1130
|
SignOutButton,
|
|
916
1131
|
{
|
|
917
1132
|
label: logout.label,
|
|
@@ -923,7 +1138,7 @@ var Sidebar = ({
|
|
|
923
1138
|
}
|
|
924
1139
|
)
|
|
925
1140
|
] }),
|
|
926
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsx12("div", { className: toggleButton(), children: /* @__PURE__ */ jsx12(
|
|
927
1142
|
Button,
|
|
928
1143
|
{
|
|
929
1144
|
color: "ghost",
|
|
@@ -940,7 +1155,7 @@ var Sidebar = ({
|
|
|
940
1155
|
var INSTALL_APP_MODAL_ID = "zljs-install-app";
|
|
941
1156
|
|
|
942
1157
|
// features/app/components/install-app-button/install-app-button.tsx
|
|
943
|
-
import { Fragment as Fragment5, jsx as
|
|
1158
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
944
1159
|
var InstallAppButton = ({
|
|
945
1160
|
way,
|
|
946
1161
|
label,
|
|
@@ -959,7 +1174,7 @@ var InstallAppButton = ({
|
|
|
959
1174
|
}
|
|
960
1175
|
};
|
|
961
1176
|
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
962
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ jsx13(
|
|
963
1178
|
Button,
|
|
964
1179
|
{
|
|
965
1180
|
color: "ghost",
|
|
@@ -970,7 +1185,7 @@ var InstallAppButton = ({
|
|
|
970
1185
|
children: !iconOnly && label
|
|
971
1186
|
}
|
|
972
1187
|
),
|
|
973
|
-
way === "instructions" && /* @__PURE__ */
|
|
1188
|
+
way === "instructions" && /* @__PURE__ */ jsx13(
|
|
974
1189
|
ConnectedModal,
|
|
975
1190
|
{
|
|
976
1191
|
modalId: INSTALL_APP_MODAL_ID,
|
|
@@ -982,83 +1197,16 @@ var InstallAppButton = ({
|
|
|
982
1197
|
] });
|
|
983
1198
|
};
|
|
984
1199
|
|
|
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
1200
|
// core/top-nav/top-nav.tsx
|
|
1053
1201
|
import { useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
1054
1202
|
|
|
1055
1203
|
// core/top-nav/top-nav.styles.ts
|
|
1056
|
-
import { tv as
|
|
1057
|
-
var topNav =
|
|
1204
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
1205
|
+
var topNav = tv10({
|
|
1058
1206
|
slots: {
|
|
1059
1207
|
// The panels hang from it, so it is their anchor. The safe area keeps the
|
|
1060
1208
|
// bar under the notch of a phone.
|
|
1061
|
-
base: "relative shrink-0 bg-
|
|
1209
|
+
base: "relative shrink-0 border-b border-zl-border bg-zl-surface pt-[env(safe-area-inset-top)] text-zl-text-soft",
|
|
1062
1210
|
bar: "flex h-14 items-center gap-1 px-2",
|
|
1063
1211
|
// As wide as the menu button it stands in for, so the home link stays in
|
|
1064
1212
|
// the middle of the bar.
|
|
@@ -1068,20 +1216,20 @@ var topNav = tv9({
|
|
|
1068
1216
|
// Over the page, under the bar, as wide as the screen. It scrolls when the
|
|
1069
1217
|
// links don't fit in what is left of the screen. `z-40` puts it over what
|
|
1070
1218
|
// 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-
|
|
1219
|
+
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
1220
|
section: "grid gap-1 p-2",
|
|
1073
1221
|
// 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-
|
|
1222
|
+
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
1223
|
// One action per line, each as tall and as far from the edge as a link of the menu.
|
|
1076
1224
|
actions: "grid gap-1 p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3",
|
|
1077
1225
|
profile: "flex items-center gap-3 p-3",
|
|
1078
1226
|
// 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-
|
|
1227
|
+
user: "flex min-w-0 flex-1 flex-col text-zl-text [&>*]:truncate"
|
|
1080
1228
|
}
|
|
1081
1229
|
});
|
|
1082
1230
|
|
|
1083
1231
|
// core/top-nav/top-nav.tsx
|
|
1084
|
-
import { jsx as
|
|
1232
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1085
1233
|
var TopNav = ({
|
|
1086
1234
|
sections,
|
|
1087
1235
|
user,
|
|
@@ -1091,6 +1239,7 @@ var TopNav = ({
|
|
|
1091
1239
|
navLabel = "Main navigation",
|
|
1092
1240
|
menuLabel = "Menu",
|
|
1093
1241
|
accountLabel = "Account",
|
|
1242
|
+
theme = {},
|
|
1094
1243
|
share = {},
|
|
1095
1244
|
install = {},
|
|
1096
1245
|
logout = {},
|
|
@@ -1134,7 +1283,7 @@ var TopNav = ({
|
|
|
1134
1283
|
};
|
|
1135
1284
|
return /* @__PURE__ */ jsxs7("header", { className: styles.base(), onPointerDown: markPressInside, children: [
|
|
1136
1285
|
/* @__PURE__ */ jsxs7("div", { className: styles.bar(), children: [
|
|
1137
|
-
hasLinks ? /* @__PURE__ */
|
|
1286
|
+
hasLinks ? /* @__PURE__ */ jsx14(
|
|
1138
1287
|
Button,
|
|
1139
1288
|
{
|
|
1140
1289
|
color: "ghost",
|
|
@@ -1144,8 +1293,8 @@ var TopNav = ({
|
|
|
1144
1293
|
"aria-expanded": menuOpen,
|
|
1145
1294
|
onClick: toggleMenu
|
|
1146
1295
|
}
|
|
1147
|
-
) : /* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1296
|
+
) : /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", className: styles.spacer() }),
|
|
1297
|
+
/* @__PURE__ */ jsx14("div", { className: styles.home(), children: homeHref && /* @__PURE__ */ jsxs7(
|
|
1149
1298
|
Link,
|
|
1150
1299
|
{
|
|
1151
1300
|
href: homeHref,
|
|
@@ -1155,12 +1304,12 @@ var TopNav = ({
|
|
|
1155
1304
|
"aria-label": homeLabel || "Home",
|
|
1156
1305
|
onClick: close,
|
|
1157
1306
|
children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
homeLabel && /* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ jsx14(Icon, { name: "Home" }),
|
|
1308
|
+
homeLabel && /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: homeLabel })
|
|
1160
1309
|
]
|
|
1161
1310
|
}
|
|
1162
1311
|
) }),
|
|
1163
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ jsx14(
|
|
1164
1313
|
Button,
|
|
1165
1314
|
{
|
|
1166
1315
|
color: "ghost",
|
|
@@ -1174,7 +1323,17 @@ var TopNav = ({
|
|
|
1174
1323
|
] }),
|
|
1175
1324
|
accountOpen && /* @__PURE__ */ jsxs7("div", { className: styles.account(), children: [
|
|
1176
1325
|
/* @__PURE__ */ jsxs7("div", { className: styles.actions(), children: [
|
|
1177
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx14(
|
|
1327
|
+
ThemeToggle,
|
|
1328
|
+
{
|
|
1329
|
+
size: "lg",
|
|
1330
|
+
label: theme.label ?? "Theme",
|
|
1331
|
+
systemLabel: theme.systemLabel,
|
|
1332
|
+
lightLabel: theme.lightLabel,
|
|
1333
|
+
darkLabel: theme.darkLabel
|
|
1334
|
+
}
|
|
1335
|
+
),
|
|
1336
|
+
/* @__PURE__ */ jsx14(
|
|
1178
1337
|
ShareAppButton,
|
|
1179
1338
|
{
|
|
1180
1339
|
label: share.label ?? "Share app",
|
|
@@ -1184,7 +1343,7 @@ var TopNav = ({
|
|
|
1184
1343
|
errorMessage: share.errorMessage
|
|
1185
1344
|
}
|
|
1186
1345
|
),
|
|
1187
|
-
installApp.way && /* @__PURE__ */
|
|
1346
|
+
installApp.way && /* @__PURE__ */ jsx14(
|
|
1188
1347
|
InstallAppButton,
|
|
1189
1348
|
{
|
|
1190
1349
|
way: installApp.way,
|
|
@@ -1197,10 +1356,10 @@ var TopNav = ({
|
|
|
1197
1356
|
] }),
|
|
1198
1357
|
/* @__PURE__ */ jsxs7("div", { className: styles.profile(), children: [
|
|
1199
1358
|
/* @__PURE__ */ jsxs7("div", { className: styles.user(), children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.name }),
|
|
1360
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.email })
|
|
1202
1361
|
] }),
|
|
1203
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsx14(
|
|
1204
1363
|
SignOutButton,
|
|
1205
1364
|
{
|
|
1206
1365
|
size: "lg",
|
|
@@ -1214,7 +1373,7 @@ var TopNav = ({
|
|
|
1214
1373
|
)
|
|
1215
1374
|
] })
|
|
1216
1375
|
] }),
|
|
1217
|
-
menuOpen && /* @__PURE__ */
|
|
1376
|
+
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
1377
|
Link,
|
|
1219
1378
|
{
|
|
1220
1379
|
href: item.href,
|
|
@@ -1224,8 +1383,8 @@ var TopNav = ({
|
|
|
1224
1383
|
"aria-label": item.label,
|
|
1225
1384
|
onClick: close,
|
|
1226
1385
|
children: [
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ jsx14(Icon, { name: item.icon }),
|
|
1387
|
+
/* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: item.label })
|
|
1229
1388
|
]
|
|
1230
1389
|
},
|
|
1231
1390
|
item.href
|
|
@@ -1244,9 +1403,9 @@ var toasterCopyLabel = "Copy";
|
|
|
1244
1403
|
var toasterCopiedLabel = "Copied";
|
|
1245
1404
|
|
|
1246
1405
|
// features/toaster/components/toaster/toaster.styles.ts
|
|
1247
|
-
import { tv as
|
|
1406
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
1248
1407
|
var focusOutline = "focus-visible:outline-2! focus-visible:outline-offset-2! focus-visible:outline-current!";
|
|
1249
|
-
var toaster =
|
|
1408
|
+
var toaster = tv11({
|
|
1250
1409
|
slots: {
|
|
1251
1410
|
toast: focusOutline,
|
|
1252
1411
|
closeButton: focusOutline,
|
|
@@ -1256,21 +1415,21 @@ var toaster = tv10({
|
|
|
1256
1415
|
});
|
|
1257
1416
|
var toasterColors = {
|
|
1258
1417
|
"--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%,
|
|
1418
|
+
"--success-bg": "color-mix(in oklab, var(--color-zl-success) 15%, var(--color-zl-surface))",
|
|
1419
|
+
"--success-border": "color-mix(in oklab, var(--color-zl-success) 30%, var(--color-zl-surface))",
|
|
1261
1420
|
"--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%,
|
|
1421
|
+
"--info-bg": "color-mix(in oklab, var(--color-zl-info) 15%, var(--color-zl-surface))",
|
|
1422
|
+
"--info-border": "color-mix(in oklab, var(--color-zl-info) 30%, var(--color-zl-surface))",
|
|
1264
1423
|
"--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%,
|
|
1424
|
+
"--warning-bg": "color-mix(in oklab, var(--color-zl-warning) 15%, var(--color-zl-surface))",
|
|
1425
|
+
"--warning-border": "color-mix(in oklab, var(--color-zl-warning) 30%, var(--color-zl-surface))",
|
|
1267
1426
|
"--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%,
|
|
1427
|
+
"--error-bg": "color-mix(in oklab, var(--color-zl-danger) 15%, var(--color-zl-surface))",
|
|
1428
|
+
"--error-border": "color-mix(in oklab, var(--color-zl-danger) 30%, var(--color-zl-surface))"
|
|
1270
1429
|
};
|
|
1271
1430
|
|
|
1272
1431
|
// features/toaster/components/toaster/toaster-copy-button.tsx
|
|
1273
|
-
import { jsx as
|
|
1432
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1274
1433
|
var ToasterCopyButton = ({ text: text2 }) => {
|
|
1275
1434
|
const [copied, setCopied] = useState4(false);
|
|
1276
1435
|
const { copyButton } = toaster();
|
|
@@ -1279,7 +1438,7 @@ var ToasterCopyButton = ({ text: text2 }) => {
|
|
|
1279
1438
|
// Without permission the browser refuses, and the button stays on Copy.
|
|
1280
1439
|
() => void 0
|
|
1281
1440
|
);
|
|
1282
|
-
return /* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ jsx15("span", { className: copyButton(), children: /* @__PURE__ */ jsx15(
|
|
1283
1442
|
Button,
|
|
1284
1443
|
{
|
|
1285
1444
|
color: "ghost",
|
|
@@ -1292,13 +1451,13 @@ var ToasterCopyButton = ({ text: text2 }) => {
|
|
|
1292
1451
|
};
|
|
1293
1452
|
|
|
1294
1453
|
// features/toaster/components/toaster/toast.tsx
|
|
1295
|
-
import { jsx as
|
|
1454
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1296
1455
|
var copyText = (message, description2) => typeof description2 === "string" ? `${message}
|
|
1297
1456
|
${description2}` : message;
|
|
1298
1457
|
var withCopy = (show) => (message, data) => show(
|
|
1299
1458
|
message,
|
|
1300
1459
|
typeof message === "string" ? {
|
|
1301
|
-
action: /* @__PURE__ */
|
|
1460
|
+
action: /* @__PURE__ */ jsx16(ToasterCopyButton, { text: copyText(message, data?.description) }),
|
|
1302
1461
|
...data
|
|
1303
1462
|
} : data
|
|
1304
1463
|
);
|
|
@@ -1314,7 +1473,7 @@ var toast = Object.assign(
|
|
|
1314
1473
|
// features/toaster/components/toaster/toaster.tsx
|
|
1315
1474
|
import { useEffect as useEffect3 } from "react";
|
|
1316
1475
|
import { Toaster as SonnerToaster } from "sonner";
|
|
1317
|
-
import { jsx as
|
|
1476
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1318
1477
|
var Toaster = () => {
|
|
1319
1478
|
const toasts = useToastStore((s) => s.toasts);
|
|
1320
1479
|
const removeToast = useToastStore((s) => s.removeToast);
|
|
@@ -1325,7 +1484,7 @@ var Toaster = () => {
|
|
|
1325
1484
|
removeToast(t.id);
|
|
1326
1485
|
});
|
|
1327
1486
|
}, [toasts, removeToast]);
|
|
1328
|
-
return /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ jsx17(
|
|
1329
1488
|
SonnerToaster,
|
|
1330
1489
|
{
|
|
1331
1490
|
position: "bottom-right",
|
|
@@ -1350,44 +1509,44 @@ var spinnerIcons = {
|
|
|
1350
1509
|
};
|
|
1351
1510
|
|
|
1352
1511
|
// core/spinner/spinner.styles.ts
|
|
1353
|
-
import { tv as
|
|
1354
|
-
var spinner =
|
|
1512
|
+
import { tv as tv12 } from "tailwind-variants";
|
|
1513
|
+
var spinner = tv12({
|
|
1355
1514
|
base: "inline-flex animate-spin"
|
|
1356
1515
|
});
|
|
1357
1516
|
|
|
1358
1517
|
// core/spinner/spinner.tsx
|
|
1359
|
-
import { jsx as
|
|
1518
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1360
1519
|
var Spinner = ({
|
|
1361
1520
|
variant = "circle",
|
|
1362
1521
|
size = "md",
|
|
1363
1522
|
label = "Loading"
|
|
1364
|
-
}) => /* @__PURE__ */
|
|
1523
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1365
1524
|
"span",
|
|
1366
1525
|
{
|
|
1367
1526
|
"data-testid": "spinner",
|
|
1368
1527
|
role: "status",
|
|
1369
1528
|
"aria-label": label,
|
|
1370
1529
|
className: spinner(),
|
|
1371
|
-
children: /* @__PURE__ */
|
|
1530
|
+
children: /* @__PURE__ */ jsx18(Icon, { name: spinnerIcons[variant], size })
|
|
1372
1531
|
}
|
|
1373
1532
|
);
|
|
1374
1533
|
|
|
1375
1534
|
// features/app/components/loader/loader.styles.ts
|
|
1376
|
-
import { tv as
|
|
1377
|
-
var loader =
|
|
1535
|
+
import { tv as tv13 } from "tailwind-variants";
|
|
1536
|
+
var loader = tv13({
|
|
1378
1537
|
base: "flex fixed inset-0 justify-center items-center bg-black/20 text-zl-primary z-60"
|
|
1379
1538
|
});
|
|
1380
1539
|
|
|
1381
1540
|
// features/app/components/loader/loader.tsx
|
|
1382
|
-
import { jsx as
|
|
1541
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1383
1542
|
var Loader = ({ label = "Loading" }) => {
|
|
1384
1543
|
const fetching = useAppStore((s) => s.fetching);
|
|
1385
1544
|
if (!fetching) return null;
|
|
1386
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx19("div", { className: loader(), children: /* @__PURE__ */ jsx19(Spinner, { size: "lg", label }) });
|
|
1387
1546
|
};
|
|
1388
1547
|
|
|
1389
1548
|
// features/app/components/navigation/navigation.tsx
|
|
1390
|
-
import { jsx as
|
|
1549
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1391
1550
|
var Navigation = ({
|
|
1392
1551
|
mode = "auto",
|
|
1393
1552
|
sections,
|
|
@@ -1401,6 +1560,7 @@ var Navigation = ({
|
|
|
1401
1560
|
navLabel,
|
|
1402
1561
|
menuLabel,
|
|
1403
1562
|
accountLabel,
|
|
1563
|
+
theme,
|
|
1404
1564
|
share,
|
|
1405
1565
|
install,
|
|
1406
1566
|
logout,
|
|
@@ -1412,7 +1572,7 @@ var Navigation = ({
|
|
|
1412
1572
|
return null;
|
|
1413
1573
|
}
|
|
1414
1574
|
if (desktop) {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ jsx20(
|
|
1416
1576
|
Sidebar,
|
|
1417
1577
|
{
|
|
1418
1578
|
sections,
|
|
@@ -1424,13 +1584,14 @@ var Navigation = ({
|
|
|
1424
1584
|
homeHref,
|
|
1425
1585
|
homeLabel,
|
|
1426
1586
|
navLabel,
|
|
1587
|
+
theme,
|
|
1427
1588
|
share,
|
|
1428
1589
|
logout,
|
|
1429
1590
|
onLogout
|
|
1430
1591
|
}
|
|
1431
1592
|
);
|
|
1432
1593
|
}
|
|
1433
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx20(
|
|
1434
1595
|
TopNav,
|
|
1435
1596
|
{
|
|
1436
1597
|
sections,
|
|
@@ -1441,6 +1602,7 @@ var Navigation = ({
|
|
|
1441
1602
|
navLabel,
|
|
1442
1603
|
menuLabel,
|
|
1443
1604
|
accountLabel,
|
|
1605
|
+
theme,
|
|
1444
1606
|
share,
|
|
1445
1607
|
install,
|
|
1446
1608
|
logout,
|
|
@@ -1483,7 +1645,7 @@ var createReduxStore = ({
|
|
|
1483
1645
|
};
|
|
1484
1646
|
|
|
1485
1647
|
// core/state/redux/redux-provider/redux-provider.tsx
|
|
1486
|
-
import { jsx as
|
|
1648
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1487
1649
|
var ReduxProvider = ({
|
|
1488
1650
|
children,
|
|
1489
1651
|
reducers = {},
|
|
@@ -1499,7 +1661,7 @@ var ReduxProvider = ({
|
|
|
1499
1661
|
coreReducers
|
|
1500
1662
|
})
|
|
1501
1663
|
);
|
|
1502
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsx21(Provider, { store, children });
|
|
1503
1665
|
};
|
|
1504
1666
|
|
|
1505
1667
|
// core/state/zustand/router/router.utils.ts
|
|
@@ -1560,11 +1722,11 @@ var usePageStore = create5()(
|
|
|
1560
1722
|
);
|
|
1561
1723
|
|
|
1562
1724
|
// core/card/card.styles.ts
|
|
1563
|
-
import { tv as
|
|
1564
|
-
var card =
|
|
1725
|
+
import { tv as tv14 } from "tailwind-variants";
|
|
1726
|
+
var card = tv14({
|
|
1565
1727
|
slots: {
|
|
1566
1728
|
// 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
|
|
1729
|
+
// 3px and reads as part of the border on a light page.
|
|
1568
1730
|
base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
|
|
1569
1731
|
header: "flex flex-col gap-1"
|
|
1570
1732
|
},
|
|
@@ -1582,7 +1744,7 @@ var card = tv13({
|
|
|
1582
1744
|
},
|
|
1583
1745
|
info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
|
|
1584
1746
|
muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
|
|
1585
|
-
none: { base: "border-
|
|
1747
|
+
none: { base: "border-zl-border bg-zl-surface shadow-black/12" }
|
|
1586
1748
|
}
|
|
1587
1749
|
},
|
|
1588
1750
|
defaultVariants: {
|
|
@@ -1591,7 +1753,7 @@ var card = tv13({
|
|
|
1591
1753
|
});
|
|
1592
1754
|
|
|
1593
1755
|
// core/card/card.tsx
|
|
1594
|
-
import { jsx as
|
|
1756
|
+
import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1595
1757
|
var Card = ({
|
|
1596
1758
|
children,
|
|
1597
1759
|
title: title2,
|
|
@@ -1603,23 +1765,23 @@ var Card = ({
|
|
|
1603
1765
|
const messageColor = color === "none" ? "muted" : "none";
|
|
1604
1766
|
return /* @__PURE__ */ jsxs8("div", { "data-testid": "card", className: base(), children: [
|
|
1605
1767
|
(title2 || message) && /* @__PURE__ */ jsxs8("div", { className: header3(), children: [
|
|
1606
|
-
title2 && /* @__PURE__ */
|
|
1607
|
-
message && /* @__PURE__ */
|
|
1768
|
+
title2 && /* @__PURE__ */ jsx22(Heading, { level: titleLevel, children: title2 }),
|
|
1769
|
+
message && /* @__PURE__ */ jsx22(Text, { color: messageColor, children: message })
|
|
1608
1770
|
] }),
|
|
1609
1771
|
children
|
|
1610
1772
|
] });
|
|
1611
1773
|
};
|
|
1612
1774
|
|
|
1613
1775
|
// features/auth/components/access-pending/access-pending.styles.ts
|
|
1614
|
-
import { tv as
|
|
1615
|
-
var accessPending =
|
|
1776
|
+
import { tv as tv15 } from "tailwind-variants";
|
|
1777
|
+
var accessPending = tv15({
|
|
1616
1778
|
slots: {
|
|
1617
1779
|
account: "flex items-center justify-between gap-3"
|
|
1618
1780
|
}
|
|
1619
1781
|
});
|
|
1620
1782
|
|
|
1621
1783
|
// features/auth/components/access-pending/access-pending.tsx
|
|
1622
|
-
import { jsx as
|
|
1784
|
+
import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1623
1785
|
var AccessPending = ({
|
|
1624
1786
|
title: title2 = "Waiting for approval",
|
|
1625
1787
|
message = "Your access to this app has not been approved yet.",
|
|
@@ -1634,9 +1796,9 @@ var AccessPending = ({
|
|
|
1634
1796
|
if (!user) {
|
|
1635
1797
|
return null;
|
|
1636
1798
|
}
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ jsx23(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsxs9("div", { className: account(), children: [
|
|
1800
|
+
/* @__PURE__ */ jsx23(Text, { variant: "caption", color: "muted", children: user.email }),
|
|
1801
|
+
/* @__PURE__ */ jsx23(
|
|
1640
1802
|
SignOutButton,
|
|
1641
1803
|
{
|
|
1642
1804
|
label: signOutLabel,
|
|
@@ -1651,7 +1813,7 @@ var AccessPending = ({
|
|
|
1651
1813
|
|
|
1652
1814
|
// features/auth/components/auth-provider/auth-provider.tsx
|
|
1653
1815
|
import { useEffect as useEffect4 } from "react";
|
|
1654
|
-
import { Fragment as Fragment6, jsx as
|
|
1816
|
+
import { Fragment as Fragment6, jsx as jsx24 } from "react/jsx-runtime";
|
|
1655
1817
|
var AuthProvider = ({
|
|
1656
1818
|
adapter,
|
|
1657
1819
|
appId,
|
|
@@ -1668,7 +1830,7 @@ var AuthProvider = ({
|
|
|
1668
1830
|
reset();
|
|
1669
1831
|
};
|
|
1670
1832
|
}, [adapter, appId, configure, setSession, reset]);
|
|
1671
|
-
return /* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ jsx24(Fragment6, { children });
|
|
1672
1834
|
};
|
|
1673
1835
|
|
|
1674
1836
|
// features/auth/components/login/login.const.ts
|
|
@@ -1682,15 +1844,15 @@ var loginVendors = {
|
|
|
1682
1844
|
};
|
|
1683
1845
|
|
|
1684
1846
|
// features/auth/components/login/login.styles.ts
|
|
1685
|
-
import { tv as
|
|
1686
|
-
var login =
|
|
1847
|
+
import { tv as tv16 } from "tailwind-variants";
|
|
1848
|
+
var login = tv16({
|
|
1687
1849
|
slots: {
|
|
1688
1850
|
options: "flex flex-col gap-3"
|
|
1689
1851
|
}
|
|
1690
1852
|
});
|
|
1691
1853
|
|
|
1692
1854
|
// features/auth/components/login/login.tsx
|
|
1693
|
-
import { jsx as
|
|
1855
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1694
1856
|
var LoginProviderButton = ({
|
|
1695
1857
|
id,
|
|
1696
1858
|
label,
|
|
@@ -1699,7 +1861,7 @@ var LoginProviderButton = ({
|
|
|
1699
1861
|
const signIn = () => {
|
|
1700
1862
|
onSignIn(id);
|
|
1701
1863
|
};
|
|
1702
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ jsx25(Button, { size: "lg", fullWidth: true, onClick: signIn, children: label });
|
|
1703
1865
|
};
|
|
1704
1866
|
var Login = ({
|
|
1705
1867
|
vendor,
|
|
@@ -1717,9 +1879,9 @@ var Login = ({
|
|
|
1717
1879
|
useToastStore.getState().error(errorMessage);
|
|
1718
1880
|
});
|
|
1719
1881
|
};
|
|
1720
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ jsx25(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsx25("div", { className: options(), children: providers.map((provider) => {
|
|
1721
1883
|
const id = String(provider);
|
|
1722
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ jsx25(
|
|
1723
1885
|
LoginProviderButton,
|
|
1724
1886
|
{
|
|
1725
1887
|
id,
|
|
@@ -1732,7 +1894,7 @@ var Login = ({
|
|
|
1732
1894
|
};
|
|
1733
1895
|
|
|
1734
1896
|
// features/auth/components/authorized/authorized.tsx
|
|
1735
|
-
import { Fragment as Fragment7, jsx as
|
|
1897
|
+
import { Fragment as Fragment7, jsx as jsx26 } from "react/jsx-runtime";
|
|
1736
1898
|
var Authorized = ({
|
|
1737
1899
|
children,
|
|
1738
1900
|
roles,
|
|
@@ -1741,18 +1903,18 @@ var Authorized = ({
|
|
|
1741
1903
|
}) => {
|
|
1742
1904
|
const { status, user, role } = useAuth();
|
|
1743
1905
|
if (status === "loading") return null;
|
|
1744
|
-
if (!user) return /* @__PURE__ */
|
|
1906
|
+
if (!user) return /* @__PURE__ */ jsx26(Login, { ...login2 });
|
|
1745
1907
|
const hasRole = !roles || role !== null && roles.includes(role);
|
|
1746
|
-
if (!user.hasAccess || !hasRole) return /* @__PURE__ */
|
|
1747
|
-
return /* @__PURE__ */
|
|
1908
|
+
if (!user.hasAccess || !hasRole) return /* @__PURE__ */ jsx26(AccessPending, { ...accessPending2 });
|
|
1909
|
+
return /* @__PURE__ */ jsx26(Fragment7, { children });
|
|
1748
1910
|
};
|
|
1749
1911
|
|
|
1750
1912
|
// features/providers/components/zustand-providers/zustand-providers.tsx
|
|
1751
|
-
import { Fragment as Fragment8, jsx as
|
|
1913
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1752
1914
|
var ZustandProviders = ({ children, auth }) => /* @__PURE__ */ jsxs10(Fragment8, { children: [
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
auth ? /* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ jsx27(Loader, {}),
|
|
1916
|
+
/* @__PURE__ */ jsx27(Toaster, {}),
|
|
1917
|
+
auth ? /* @__PURE__ */ jsx27(AuthProvider, { adapter: auth.adapter, appId: auth.appId, children }) : children
|
|
1756
1918
|
] });
|
|
1757
1919
|
|
|
1758
1920
|
export {
|
|
@@ -1761,6 +1923,12 @@ export {
|
|
|
1761
1923
|
Text,
|
|
1762
1924
|
Modal,
|
|
1763
1925
|
Heading,
|
|
1926
|
+
useInstallApp,
|
|
1927
|
+
useIsDesktop,
|
|
1928
|
+
themeScript,
|
|
1929
|
+
setTheme,
|
|
1930
|
+
useTheme,
|
|
1931
|
+
ThemeToggle,
|
|
1764
1932
|
useToastStore,
|
|
1765
1933
|
ShareAppButton,
|
|
1766
1934
|
appInitialState,
|
|
@@ -1772,8 +1940,6 @@ export {
|
|
|
1772
1940
|
Link,
|
|
1773
1941
|
Sidebar,
|
|
1774
1942
|
InstallAppButton,
|
|
1775
|
-
useInstallApp,
|
|
1776
|
-
useIsDesktop,
|
|
1777
1943
|
TopNav,
|
|
1778
1944
|
toast,
|
|
1779
1945
|
Toaster,
|