@alexandregme/zljs 3.21.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.
@@ -10,7 +10,8 @@ import {
10
10
  SiInstagram,
11
11
  SiShopify,
12
12
  SiGithub,
13
- SiVercel
13
+ SiVercel,
14
+ SiSupabase
14
15
  } from "react-icons/si";
15
16
  var iconBrands = {
16
17
  SiWhatsapp,
@@ -18,7 +19,8 @@ var iconBrands = {
18
19
  SiInstagram,
19
20
  SiShopify,
20
21
  SiGithub,
21
- SiVercel
22
+ SiVercel,
23
+ SiSupabase
22
24
  };
23
25
  var iconSizes = {
24
26
  sm: 12,
@@ -79,7 +81,7 @@ var button = tv2({
79
81
  variants: {
80
82
  variant: {
81
83
  default: "px-4 py-2 text-sm gap-2 rounded-md",
82
- icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md",
84
+ icon: "p-1 bg-transparent text-zl-muted hover:text-zl-text-soft hover:bg-zl-surface-muted rounded-md",
83
85
  // The invisible ::after grows the touch target to 44px without changing the layout.
84
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"
85
87
  },
@@ -90,7 +92,7 @@ var button = tv2({
90
92
  warning: "bg-zl-warning-bg hover:bg-zl-warning-hover text-zl-warning-on focus-visible:outline-zl-warning",
91
93
  info: "bg-zl-info-bg hover:bg-zl-info-hover text-zl-info-on focus-visible:outline-zl-info",
92
94
  muted: "bg-zl-muted-bg hover:bg-zl-muted-hover text-zl-muted-on focus-visible:outline-zl-muted",
93
- 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",
94
96
  none: ""
95
97
  },
96
98
  size: {
@@ -106,7 +108,7 @@ var button = tv2({
106
108
  {
107
109
  variant: "default",
108
110
  color: "none",
109
- class: "bg-gray-100 text-gray-900 hover:bg-gray-200"
111
+ class: "bg-zl-surface-muted text-zl-text hover:bg-zl-surface-hover"
110
112
  },
111
113
  {
112
114
  variant: "default",
@@ -161,7 +163,7 @@ var button = tv2({
161
163
  {
162
164
  variant: "link",
163
165
  color: "none",
164
- class: "text-slate-600 hover:text-slate-800"
166
+ class: "text-zl-text-soft hover:text-zl-text"
165
167
  },
166
168
  {
167
169
  variant: "link",
@@ -189,6 +191,7 @@ var Button = ({
189
191
  disabled = false,
190
192
  "aria-label": ariaLabel,
191
193
  "aria-expanded": ariaExpanded,
194
+ "aria-pressed": ariaPressed,
192
195
  onClick
193
196
  }) => {
194
197
  const isIconOnly = icon2 && !children;
@@ -217,6 +220,7 @@ var Button = ({
217
220
  onClick,
218
221
  "aria-label": ariaLabel,
219
222
  "aria-expanded": ariaExpanded,
223
+ "aria-pressed": ariaPressed,
220
224
  className: button({
221
225
  variant,
222
226
  color: variant === "icon" && color !== "ghost" ? "none" : color,
@@ -264,7 +268,7 @@ var overlay = tv4({
264
268
  base: "fixed inset-0 z-50 bg-black/50"
265
269
  });
266
270
  var content = tv4({
267
- 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",
268
272
  variants: {
269
273
  size: {
270
274
  xs: "max-w-xs",
@@ -276,13 +280,13 @@ var content = tv4({
276
280
  },
277
281
  // An opaque tint: a translucent one, as Card has, would show the dark overlay behind the modal.
278
282
  color: {
279
- primary: "bg-[color-mix(in_srgb,var(--color-zl-primary)_15%,white)]",
280
- success: "bg-[color-mix(in_srgb,var(--color-zl-success)_15%,white)]",
281
- danger: "bg-[color-mix(in_srgb,var(--color-zl-danger)_15%,white)]",
282
- warning: "bg-[color-mix(in_srgb,var(--color-zl-warning)_15%,white)]",
283
- info: "bg-[color-mix(in_srgb,var(--color-zl-info)_15%,white)]",
284
- muted: "bg-[color-mix(in_srgb,var(--color-zl-muted)_15%,white)]",
285
- none: "bg-white"
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"
286
290
  }
287
291
  },
288
292
  defaultVariants: {
@@ -304,7 +308,7 @@ var title = tv4({
304
308
  warning: "text-zl-warning-strong",
305
309
  info: "text-zl-info-strong",
306
310
  muted: "text-zl-muted-strong",
307
- none: "text-gray-900"
311
+ none: "text-zl-text"
308
312
  }
309
313
  },
310
314
  defaultVariants: {
@@ -312,7 +316,7 @@ var title = tv4({
312
316
  }
313
317
  });
314
318
  var description = tv4({
315
- base: "text-sm text-gray-600 mt-2"
319
+ base: "text-sm text-zl-text-soft mt-2"
316
320
  });
317
321
  var body = tv4({
318
322
  base: "mt-4"
@@ -385,6 +389,203 @@ var Heading = ({ children, level = 1, color }) => {
385
389
  return /* @__PURE__ */ jsx5(Tag, { className: heading({ level, color }), children });
386
390
  };
387
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
+
388
589
  // features/toaster/state/toast.store.ts
389
590
  import { create } from "zustand";
390
591
  import { devtools } from "zustand/middleware";
@@ -428,7 +629,7 @@ var useToastStore = create()(
428
629
  var SHARE_APP_CANCELLED = "AbortError";
429
630
 
430
631
  // features/app/components/share-app-button/share-app-button.tsx
431
- import { jsx as jsx6 } from "react/jsx-runtime";
632
+ import { jsx as jsx7 } from "react/jsx-runtime";
432
633
  var ShareAppButton = ({
433
634
  label,
434
635
  iconOnly = false,
@@ -467,7 +668,7 @@ var ShareAppButton = ({
467
668
  const share = () => {
468
669
  void shareOrCopy();
469
670
  };
470
- return /* @__PURE__ */ jsx6(
671
+ return /* @__PURE__ */ jsx7(
471
672
  Button,
472
673
  {
473
674
  color: "ghost",
@@ -538,7 +739,7 @@ var useAppStore = create2()(
538
739
  );
539
740
 
540
741
  // features/app/components/connected-modal/connected-modal.tsx
541
- import { jsx as jsx7 } from "react/jsx-runtime";
742
+ import { jsx as jsx8 } from "react/jsx-runtime";
542
743
  var ConnectedModal = ({
543
744
  modalId,
544
745
  title: title2,
@@ -552,7 +753,7 @@ var ConnectedModal = ({
552
753
  const close = () => {
553
754
  closeModal(modalId);
554
755
  };
555
- return /* @__PURE__ */ jsx7(
756
+ return /* @__PURE__ */ jsx8(
556
757
  Modal,
557
758
  {
558
759
  open,
@@ -630,15 +831,15 @@ var useAuth = () => {
630
831
  var SIGN_OUT_MODAL_ID = "zljs-sign-out";
631
832
 
632
833
  // features/auth/components/sign-out/sign-out-modal.styles.ts
633
- import { tv as tv6 } from "tailwind-variants";
634
- var signOutModal = tv6({
834
+ import { tv as tv7 } from "tailwind-variants";
835
+ var signOutModal = tv7({
635
836
  slots: {
636
837
  actions: "flex justify-end gap-2"
637
838
  }
638
839
  });
639
840
 
640
841
  // features/auth/components/sign-out/sign-out-modal.tsx
641
- import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
842
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
642
843
  var SignOutModal = ({
643
844
  title: title2 = "Sign out?",
644
845
  confirmLabel = "Sign out",
@@ -666,7 +867,7 @@ var SignOutModal = ({
666
867
  closeModal(SIGN_OUT_MODAL_ID);
667
868
  signOutOfApp().catch(showError);
668
869
  };
669
- return /* @__PURE__ */ jsx8(
870
+ return /* @__PURE__ */ jsx9(
670
871
  ConnectedModal,
671
872
  {
672
873
  modalId: SIGN_OUT_MODAL_ID,
@@ -674,15 +875,15 @@ var SignOutModal = ({
674
875
  size: "xs",
675
876
  color: "danger",
676
877
  children: /* @__PURE__ */ jsxs3("div", { className: actions2(), children: [
677
- /* @__PURE__ */ jsx8(Button, { color: "ghost", onClick: stay, children: cancelLabel }),
678
- /* @__PURE__ */ jsx8(Button, { color: "danger", onClick: leave, children: confirmLabel })
878
+ /* @__PURE__ */ jsx9(Button, { color: "ghost", onClick: stay, children: cancelLabel }),
879
+ /* @__PURE__ */ jsx9(Button, { color: "danger", onClick: leave, children: confirmLabel })
679
880
  ] })
680
881
  }
681
882
  );
682
883
  };
683
884
 
684
885
  // features/auth/components/sign-out/sign-out-button.tsx
685
- import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
886
+ import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
686
887
  var SignOutButton = ({
687
888
  label = "Sign out",
688
889
  size = "md",
@@ -697,7 +898,7 @@ var SignOutButton = ({
697
898
  openModal(SIGN_OUT_MODAL_ID);
698
899
  };
699
900
  return /* @__PURE__ */ jsxs4(Fragment3, { children: [
700
- /* @__PURE__ */ jsx9(
901
+ /* @__PURE__ */ jsx10(
701
902
  Button,
702
903
  {
703
904
  color: "ghost",
@@ -707,7 +908,7 @@ var SignOutButton = ({
707
908
  onClick: ask
708
909
  }
709
910
  ),
710
- /* @__PURE__ */ jsx9(
911
+ /* @__PURE__ */ jsx10(
711
912
  SignOutModal,
712
913
  {
713
914
  title: confirmTitle,
@@ -724,8 +925,8 @@ var SignOutButton = ({
724
925
  import NextLink from "next/link.js";
725
926
 
726
927
  // core/next/link/link.styles.ts
727
- import { tv as tv7 } from "tailwind-variants";
728
- var link = tv7({
928
+ import { tv as tv8 } from "tailwind-variants";
929
+ var link = tv8({
729
930
  // outline-current draws the focus in the text color.
730
931
  base: "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current",
731
932
  variants: {
@@ -761,7 +962,7 @@ var link = tv7({
761
962
  });
762
963
 
763
964
  // core/next/link/link.tsx
764
- import { jsx as jsx10 } from "react/jsx-runtime";
965
+ import { jsx as jsx11 } from "react/jsx-runtime";
765
966
  var Link = ({
766
967
  children,
767
968
  href,
@@ -772,7 +973,7 @@ var Link = ({
772
973
  "aria-label": ariaLabel,
773
974
  onClick
774
975
  }) => {
775
- return /* @__PURE__ */ jsx10(
976
+ return /* @__PURE__ */ jsx11(
776
977
  NextLink,
777
978
  {
778
979
  href,
@@ -787,12 +988,15 @@ var Link = ({
787
988
  };
788
989
 
789
990
  // core/sidebar/sidebar.tsx
790
- import { useState } from "react";
991
+ import { useState as useState2 } from "react";
791
992
 
792
993
  // core/sidebar/sidebar.styles.ts
793
- import { tv as tv8 } from "tailwind-variants";
794
- var sidebar = tv8({
795
- base: "h-dvh bg-neutral-800 text-neutral-300 flex flex-col overflow-hidden transition-[width] duration-200 divide-y divide-neutral-600/50",
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",
796
1000
  variants: {
797
1001
  collapsed: {
798
1002
  true: "w-14",
@@ -800,19 +1004,19 @@ var sidebar = tv8({
800
1004
  }
801
1005
  }
802
1006
  });
803
- var nav = tv8({
804
- base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-neutral-600/50"
1007
+ var nav = tv9({
1008
+ base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-zl-border"
805
1009
  });
806
- var header2 = tv8({
1010
+ var header2 = tv9({
807
1011
  base: "shrink-0 p-2"
808
1012
  });
809
- var section = tv8({
1013
+ var section = tv9({
810
1014
  base: "grid gap-1 p-2"
811
1015
  });
812
- var actions = tv8({
813
- 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"
814
1018
  });
815
- var footer = tv8({
1019
+ var footer = tv9({
816
1020
  base: "shrink-0 h-16 p-3 flex items-center gap-3",
817
1021
  variants: {
818
1022
  collapsed: {
@@ -820,18 +1024,18 @@ var footer = tv8({
820
1024
  }
821
1025
  }
822
1026
  });
823
- var avatar = tv8({
824
- base: "shrink-0 size-8 rounded-full bg-neutral-600 text-white text-xs font-medium flex items-center justify-center"
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"
825
1029
  });
826
- var userInfo = tv8({
827
- base: "flex flex-col min-w-0 text-white [&>*]:truncate [&>*:last-child]:text-xs [&>*:last-child]:text-neutral-400"
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"
828
1032
  });
829
- var toggleButton = tv8({
1033
+ var toggleButton = tv9({
830
1034
  base: "shrink-0 h-14 grid p-2 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
831
1035
  });
832
1036
 
833
1037
  // core/sidebar/sidebar.tsx
834
- import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1038
+ import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
835
1039
  var getInitials = (name) => {
836
1040
  const parts = name.trim().split(/\s+/);
837
1041
  if (parts.length >= 2) {
@@ -849,11 +1053,12 @@ var Sidebar = ({
849
1053
  homeHref = "/",
850
1054
  homeLabel,
851
1055
  navLabel = "Main navigation",
1056
+ theme = {},
852
1057
  share = {},
853
1058
  logout = {},
854
1059
  onLogout
855
1060
  }) => {
856
- const [collapsed, setCollapsed] = useState(defaultCollapsed);
1061
+ const [collapsed, setCollapsed] = useState2(defaultCollapsed);
857
1062
  const initials = getInitials(user.name);
858
1063
  const toggleLabel = collapsed ? expandLabel : collapseLabel;
859
1064
  const toggleIcon = collapsed ? "ChevronRight" : "ChevronLeft";
@@ -861,7 +1066,7 @@ var Sidebar = ({
861
1066
  setCollapsed(!collapsed);
862
1067
  };
863
1068
  return /* @__PURE__ */ jsxs5("aside", { className: sidebar({ collapsed }), children: [
864
- homeHref && /* @__PURE__ */ jsx11("div", { className: header2(), children: /* @__PURE__ */ jsxs5(
1069
+ homeHref && /* @__PURE__ */ jsx12("div", { className: header2(), children: /* @__PURE__ */ jsxs5(
865
1070
  Link,
866
1071
  {
867
1072
  href: homeHref,
@@ -870,12 +1075,12 @@ var Sidebar = ({
870
1075
  active: homeHref === activeHref,
871
1076
  "aria-label": homeLabel || "Home",
872
1077
  children: [
873
- /* @__PURE__ */ jsx11(Icon, { name: "Home" }),
874
- homeLabel && !collapsed && /* @__PURE__ */ jsx11(Text, { as: "span", variant: "caption", children: homeLabel })
1078
+ /* @__PURE__ */ jsx12(Icon, { name: "Home" }),
1079
+ homeLabel && !collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: homeLabel })
875
1080
  ]
876
1081
  }
877
1082
  ) }),
878
- /* @__PURE__ */ jsx11("nav", { "aria-label": navLabel, className: nav(), children: sections.map((sectionData, i) => /* @__PURE__ */ jsx11("div", { className: section(), children: sectionData.items.map((sidebarItem) => /* @__PURE__ */ jsxs5(
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(
879
1084
  Link,
880
1085
  {
881
1086
  href: sidebarItem.href,
@@ -884,32 +1089,44 @@ var Sidebar = ({
884
1089
  active: sidebarItem.href === activeHref,
885
1090
  "aria-label": sidebarItem.label,
886
1091
  children: [
887
- /* @__PURE__ */ jsx11(Icon, { name: sidebarItem.icon }),
888
- !collapsed && /* @__PURE__ */ jsx11(Text, { as: "span", variant: "caption", children: sidebarItem.label })
1092
+ /* @__PURE__ */ jsx12(Icon, { name: sidebarItem.icon }),
1093
+ !collapsed && /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: sidebarItem.label })
889
1094
  ]
890
1095
  },
891
1096
  sidebarItem.href
892
1097
  )) }, i)) }),
893
- /* @__PURE__ */ jsx11("div", { className: actions(), children: /* @__PURE__ */ jsx11(
894
- ShareAppButton,
895
- {
896
- label: share.label ?? "Share app",
897
- iconOnly: collapsed,
898
- title: share.title,
899
- text: share.text,
900
- copiedMessage: share.copiedMessage,
901
- errorMessage: share.errorMessage
902
- }
903
- ) }),
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
+ ] }),
904
1121
  /* @__PURE__ */ jsxs5("div", { className: footer({ collapsed }), children: [
905
1122
  !collapsed && /* @__PURE__ */ jsxs5(Fragment4, { children: [
906
- /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", className: avatar(), children: initials }),
1123
+ /* @__PURE__ */ jsx12("div", { "aria-hidden": "true", className: avatar(), children: initials }),
907
1124
  /* @__PURE__ */ jsxs5("div", { className: userInfo(), children: [
908
- /* @__PURE__ */ jsx11(Text, { as: "span", variant: "caption", children: user.name }),
909
- /* @__PURE__ */ jsx11(Text, { as: "span", variant: "caption", children: user.email })
1125
+ /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.name }),
1126
+ /* @__PURE__ */ jsx12(Text, { as: "span", variant: "caption", children: user.email })
910
1127
  ] })
911
1128
  ] }),
912
- /* @__PURE__ */ jsx11(
1129
+ /* @__PURE__ */ jsx12(
913
1130
  SignOutButton,
914
1131
  {
915
1132
  label: logout.label,
@@ -921,7 +1138,7 @@ var Sidebar = ({
921
1138
  }
922
1139
  )
923
1140
  ] }),
924
- /* @__PURE__ */ jsx11("div", { className: toggleButton(), children: /* @__PURE__ */ jsx11(
1141
+ /* @__PURE__ */ jsx12("div", { className: toggleButton(), children: /* @__PURE__ */ jsx12(
925
1142
  Button,
926
1143
  {
927
1144
  color: "ghost",
@@ -938,7 +1155,7 @@ var Sidebar = ({
938
1155
  var INSTALL_APP_MODAL_ID = "zljs-install-app";
939
1156
 
940
1157
  // features/app/components/install-app-button/install-app-button.tsx
941
- import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1158
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
942
1159
  var InstallAppButton = ({
943
1160
  way,
944
1161
  label,
@@ -957,7 +1174,7 @@ var InstallAppButton = ({
957
1174
  }
958
1175
  };
959
1176
  return /* @__PURE__ */ jsxs6(Fragment5, { children: [
960
- /* @__PURE__ */ jsx12(
1177
+ /* @__PURE__ */ jsx13(
961
1178
  Button,
962
1179
  {
963
1180
  color: "ghost",
@@ -968,7 +1185,7 @@ var InstallAppButton = ({
968
1185
  children: !iconOnly && label
969
1186
  }
970
1187
  ),
971
- way === "instructions" && /* @__PURE__ */ jsx12(
1188
+ way === "instructions" && /* @__PURE__ */ jsx13(
972
1189
  ConnectedModal,
973
1190
  {
974
1191
  modalId: INSTALL_APP_MODAL_ID,
@@ -980,83 +1197,16 @@ var InstallAppButton = ({
980
1197
  ] });
981
1198
  };
982
1199
 
983
- // features/app/hooks/use-install-app/use-install-app.ts
984
- import { useEffect, useState as useState2, useSyncExternalStore } from "react";
985
-
986
- // features/app/hooks/use-install-app/use-install-app.const.ts
987
- var INSTALL_APP_IOS_USER_AGENT = /iPhone|iPad|iPod/i;
988
- var INSTALLED_APP_QUERY = "(display-mode: standalone)";
989
-
990
- // features/app/hooks/use-install-app/use-install-app.ts
991
- var subscribeToNothing = () => () => {
992
- };
993
- var needsInstructions = () => INSTALL_APP_IOS_USER_AGENT.test(navigator.userAgent) && !window.matchMedia(INSTALLED_APP_QUERY).matches;
994
- var notOnServer = () => false;
995
- var useInstallApp = () => {
996
- const [promptEvent, setPromptEvent] = useState2(
997
- null
998
- );
999
- const instructions = useSyncExternalStore(
1000
- subscribeToNothing,
1001
- needsInstructions,
1002
- notOnServer
1003
- );
1004
- useEffect(() => {
1005
- const keep = (event) => {
1006
- event.preventDefault();
1007
- setPromptEvent(event);
1008
- };
1009
- const forget = () => {
1010
- setPromptEvent(null);
1011
- };
1012
- window.addEventListener("beforeinstallprompt", keep);
1013
- window.addEventListener("appinstalled", forget);
1014
- return () => {
1015
- window.removeEventListener("beforeinstallprompt", keep);
1016
- window.removeEventListener("appinstalled", forget);
1017
- };
1018
- }, []);
1019
- const prompt = () => {
1020
- if (!promptEvent) {
1021
- return;
1022
- }
1023
- void promptEvent.prompt();
1024
- setPromptEvent(null);
1025
- };
1026
- if (promptEvent) {
1027
- return { way: "prompt", prompt };
1028
- }
1029
- return { way: instructions ? "instructions" : null, prompt };
1030
- };
1031
-
1032
- // features/app/hooks/use-is-desktop/use-is-desktop.ts
1033
- import { useSyncExternalStore as useSyncExternalStore2 } from "react";
1034
-
1035
- // features/app/hooks/use-is-desktop/use-is-desktop.const.ts
1036
- var DESKTOP_QUERY = "(min-width: 768px)";
1037
-
1038
- // features/app/hooks/use-is-desktop/use-is-desktop.ts
1039
- var subscribe = (onChange) => {
1040
- const media = window.matchMedia(DESKTOP_QUERY);
1041
- media.addEventListener("change", onChange);
1042
- return () => {
1043
- media.removeEventListener("change", onChange);
1044
- };
1045
- };
1046
- var isDesktop = () => window.matchMedia(DESKTOP_QUERY).matches;
1047
- var unknown = () => null;
1048
- var useIsDesktop = () => useSyncExternalStore2(subscribe, isDesktop, unknown);
1049
-
1050
1200
  // core/top-nav/top-nav.tsx
1051
1201
  import { useEffect as useEffect2, useRef, useState as useState3 } from "react";
1052
1202
 
1053
1203
  // core/top-nav/top-nav.styles.ts
1054
- import { tv as tv9 } from "tailwind-variants";
1055
- var topNav = tv9({
1204
+ import { tv as tv10 } from "tailwind-variants";
1205
+ var topNav = tv10({
1056
1206
  slots: {
1057
1207
  // The panels hang from it, so it is their anchor. The safe area keeps the
1058
1208
  // bar under the notch of a phone.
1059
- base: "relative shrink-0 bg-neutral-800 pt-[env(safe-area-inset-top)] text-neutral-300",
1209
+ base: "relative shrink-0 border-b border-zl-border bg-zl-surface pt-[env(safe-area-inset-top)] text-zl-text-soft",
1060
1210
  bar: "flex h-14 items-center gap-1 px-2",
1061
1211
  // As wide as the menu button it stands in for, so the home link stays in
1062
1212
  // the middle of the bar.
@@ -1066,20 +1216,20 @@ var topNav = tv9({
1066
1216
  // Over the page, under the bar, as wide as the screen. It scrolls when the
1067
1217
  // links don't fit in what is left of the screen. `z-40` puts it over what
1068
1218
  // the page layers on itself (a filter over a map), and under a modal.
1069
- menu: "absolute inset-x-0 top-full z-40 max-h-[calc(100dvh-3.5rem)] divide-y divide-neutral-600/50 overflow-y-auto border-t border-neutral-600/50 bg-neutral-800 shadow-lg",
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",
1070
1220
  section: "grid gap-1 p-2",
1071
1221
  // Two rows: what the user can do with the app, then who is logged in.
1072
- account: "absolute inset-x-0 top-full z-40 divide-y divide-neutral-600/50 border-t border-neutral-600/50 bg-neutral-800 shadow-lg",
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",
1073
1223
  // One action per line, each as tall and as far from the edge as a link of the menu.
1074
1224
  actions: "grid gap-1 p-2 [&>button]:h-10 [&>button]:justify-start [&>button]:px-3",
1075
1225
  profile: "flex items-center gap-3 p-3",
1076
1226
  // Text takes no className, so the cut of a long name or email is set from here.
1077
- user: "flex min-w-0 flex-1 flex-col text-white [&>*]:truncate"
1227
+ user: "flex min-w-0 flex-1 flex-col text-zl-text [&>*]:truncate"
1078
1228
  }
1079
1229
  });
1080
1230
 
1081
1231
  // core/top-nav/top-nav.tsx
1082
- import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1232
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1083
1233
  var TopNav = ({
1084
1234
  sections,
1085
1235
  user,
@@ -1089,6 +1239,7 @@ var TopNav = ({
1089
1239
  navLabel = "Main navigation",
1090
1240
  menuLabel = "Menu",
1091
1241
  accountLabel = "Account",
1242
+ theme = {},
1092
1243
  share = {},
1093
1244
  install = {},
1094
1245
  logout = {},
@@ -1132,7 +1283,7 @@ var TopNav = ({
1132
1283
  };
1133
1284
  return /* @__PURE__ */ jsxs7("header", { className: styles.base(), onPointerDown: markPressInside, children: [
1134
1285
  /* @__PURE__ */ jsxs7("div", { className: styles.bar(), children: [
1135
- hasLinks ? /* @__PURE__ */ jsx13(
1286
+ hasLinks ? /* @__PURE__ */ jsx14(
1136
1287
  Button,
1137
1288
  {
1138
1289
  color: "ghost",
@@ -1142,8 +1293,8 @@ var TopNav = ({
1142
1293
  "aria-expanded": menuOpen,
1143
1294
  onClick: toggleMenu
1144
1295
  }
1145
- ) : /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: styles.spacer() }),
1146
- /* @__PURE__ */ jsx13("div", { className: styles.home(), children: homeHref && /* @__PURE__ */ jsxs7(
1296
+ ) : /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", className: styles.spacer() }),
1297
+ /* @__PURE__ */ jsx14("div", { className: styles.home(), children: homeHref && /* @__PURE__ */ jsxs7(
1147
1298
  Link,
1148
1299
  {
1149
1300
  href: homeHref,
@@ -1153,12 +1304,12 @@ var TopNav = ({
1153
1304
  "aria-label": homeLabel || "Home",
1154
1305
  onClick: close,
1155
1306
  children: [
1156
- /* @__PURE__ */ jsx13(Icon, { name: "Home" }),
1157
- homeLabel && /* @__PURE__ */ jsx13(Text, { as: "span", variant: "caption", children: homeLabel })
1307
+ /* @__PURE__ */ jsx14(Icon, { name: "Home" }),
1308
+ homeLabel && /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: homeLabel })
1158
1309
  ]
1159
1310
  }
1160
1311
  ) }),
1161
- /* @__PURE__ */ jsx13(
1312
+ /* @__PURE__ */ jsx14(
1162
1313
  Button,
1163
1314
  {
1164
1315
  color: "ghost",
@@ -1172,7 +1323,17 @@ var TopNav = ({
1172
1323
  ] }),
1173
1324
  accountOpen && /* @__PURE__ */ jsxs7("div", { className: styles.account(), children: [
1174
1325
  /* @__PURE__ */ jsxs7("div", { className: styles.actions(), children: [
1175
- /* @__PURE__ */ jsx13(
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(
1176
1337
  ShareAppButton,
1177
1338
  {
1178
1339
  label: share.label ?? "Share app",
@@ -1182,7 +1343,7 @@ var TopNav = ({
1182
1343
  errorMessage: share.errorMessage
1183
1344
  }
1184
1345
  ),
1185
- installApp.way && /* @__PURE__ */ jsx13(
1346
+ installApp.way && /* @__PURE__ */ jsx14(
1186
1347
  InstallAppButton,
1187
1348
  {
1188
1349
  way: installApp.way,
@@ -1195,10 +1356,10 @@ var TopNav = ({
1195
1356
  ] }),
1196
1357
  /* @__PURE__ */ jsxs7("div", { className: styles.profile(), children: [
1197
1358
  /* @__PURE__ */ jsxs7("div", { className: styles.user(), children: [
1198
- /* @__PURE__ */ jsx13(Text, { as: "span", variant: "caption", children: user.name }),
1199
- /* @__PURE__ */ jsx13(Text, { as: "span", variant: "caption", children: user.email })
1359
+ /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.name }),
1360
+ /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: user.email })
1200
1361
  ] }),
1201
- /* @__PURE__ */ jsx13(
1362
+ /* @__PURE__ */ jsx14(
1202
1363
  SignOutButton,
1203
1364
  {
1204
1365
  size: "lg",
@@ -1212,7 +1373,7 @@ var TopNav = ({
1212
1373
  )
1213
1374
  ] })
1214
1375
  ] }),
1215
- menuOpen && /* @__PURE__ */ jsx13("nav", { "aria-label": navLabel, className: styles.menu(), children: sections.map((section2, i) => /* @__PURE__ */ jsx13("div", { className: styles.section(), children: section2.items.map((item) => /* @__PURE__ */ jsxs7(
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(
1216
1377
  Link,
1217
1378
  {
1218
1379
  href: item.href,
@@ -1222,8 +1383,8 @@ var TopNav = ({
1222
1383
  "aria-label": item.label,
1223
1384
  onClick: close,
1224
1385
  children: [
1225
- /* @__PURE__ */ jsx13(Icon, { name: item.icon }),
1226
- /* @__PURE__ */ jsx13(Text, { as: "span", variant: "caption", children: item.label })
1386
+ /* @__PURE__ */ jsx14(Icon, { name: item.icon }),
1387
+ /* @__PURE__ */ jsx14(Text, { as: "span", variant: "caption", children: item.label })
1227
1388
  ]
1228
1389
  },
1229
1390
  item.href
@@ -1242,9 +1403,9 @@ var toasterCopyLabel = "Copy";
1242
1403
  var toasterCopiedLabel = "Copied";
1243
1404
 
1244
1405
  // features/toaster/components/toaster/toaster.styles.ts
1245
- import { tv as tv10 } from "tailwind-variants";
1406
+ import { tv as tv11 } from "tailwind-variants";
1246
1407
  var focusOutline = "focus-visible:outline-2! focus-visible:outline-offset-2! focus-visible:outline-current!";
1247
- var toaster = tv10({
1408
+ var toaster = tv11({
1248
1409
  slots: {
1249
1410
  toast: focusOutline,
1250
1411
  closeButton: focusOutline,
@@ -1254,21 +1415,21 @@ var toaster = tv10({
1254
1415
  });
1255
1416
  var toasterColors = {
1256
1417
  "--success-text": "var(--color-zl-success-strong)",
1257
- "--success-bg": "color-mix(in oklab, var(--color-zl-success) 15%, white)",
1258
- "--success-border": "color-mix(in oklab, var(--color-zl-success) 30%, white)",
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))",
1259
1420
  "--info-text": "var(--color-zl-info-strong)",
1260
- "--info-bg": "color-mix(in oklab, var(--color-zl-info) 15%, white)",
1261
- "--info-border": "color-mix(in oklab, var(--color-zl-info) 30%, white)",
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))",
1262
1423
  "--warning-text": "var(--color-zl-warning-strong)",
1263
- "--warning-bg": "color-mix(in oklab, var(--color-zl-warning) 15%, white)",
1264
- "--warning-border": "color-mix(in oklab, var(--color-zl-warning) 30%, white)",
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))",
1265
1426
  "--error-text": "var(--color-zl-danger-strong)",
1266
- "--error-bg": "color-mix(in oklab, var(--color-zl-danger) 15%, white)",
1267
- "--error-border": "color-mix(in oklab, var(--color-zl-danger) 30%, white)"
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))"
1268
1429
  };
1269
1430
 
1270
1431
  // features/toaster/components/toaster/toaster-copy-button.tsx
1271
- import { jsx as jsx14 } from "react/jsx-runtime";
1432
+ import { jsx as jsx15 } from "react/jsx-runtime";
1272
1433
  var ToasterCopyButton = ({ text: text2 }) => {
1273
1434
  const [copied, setCopied] = useState4(false);
1274
1435
  const { copyButton } = toaster();
@@ -1277,7 +1438,7 @@ var ToasterCopyButton = ({ text: text2 }) => {
1277
1438
  // Without permission the browser refuses, and the button stays on Copy.
1278
1439
  () => void 0
1279
1440
  );
1280
- return /* @__PURE__ */ jsx14("span", { className: copyButton(), children: /* @__PURE__ */ jsx14(
1441
+ return /* @__PURE__ */ jsx15("span", { className: copyButton(), children: /* @__PURE__ */ jsx15(
1281
1442
  Button,
1282
1443
  {
1283
1444
  color: "ghost",
@@ -1290,13 +1451,13 @@ var ToasterCopyButton = ({ text: text2 }) => {
1290
1451
  };
1291
1452
 
1292
1453
  // features/toaster/components/toaster/toast.tsx
1293
- import { jsx as jsx15 } from "react/jsx-runtime";
1454
+ import { jsx as jsx16 } from "react/jsx-runtime";
1294
1455
  var copyText = (message, description2) => typeof description2 === "string" ? `${message}
1295
1456
  ${description2}` : message;
1296
1457
  var withCopy = (show) => (message, data) => show(
1297
1458
  message,
1298
1459
  typeof message === "string" ? {
1299
- action: /* @__PURE__ */ jsx15(ToasterCopyButton, { text: copyText(message, data?.description) }),
1460
+ action: /* @__PURE__ */ jsx16(ToasterCopyButton, { text: copyText(message, data?.description) }),
1300
1461
  ...data
1301
1462
  } : data
1302
1463
  );
@@ -1312,7 +1473,7 @@ var toast = Object.assign(
1312
1473
  // features/toaster/components/toaster/toaster.tsx
1313
1474
  import { useEffect as useEffect3 } from "react";
1314
1475
  import { Toaster as SonnerToaster } from "sonner";
1315
- import { jsx as jsx16 } from "react/jsx-runtime";
1476
+ import { jsx as jsx17 } from "react/jsx-runtime";
1316
1477
  var Toaster = () => {
1317
1478
  const toasts = useToastStore((s) => s.toasts);
1318
1479
  const removeToast = useToastStore((s) => s.removeToast);
@@ -1323,7 +1484,7 @@ var Toaster = () => {
1323
1484
  removeToast(t.id);
1324
1485
  });
1325
1486
  }, [toasts, removeToast]);
1326
- return /* @__PURE__ */ jsx16(
1487
+ return /* @__PURE__ */ jsx17(
1327
1488
  SonnerToaster,
1328
1489
  {
1329
1490
  position: "bottom-right",
@@ -1348,44 +1509,44 @@ var spinnerIcons = {
1348
1509
  };
1349
1510
 
1350
1511
  // core/spinner/spinner.styles.ts
1351
- import { tv as tv11 } from "tailwind-variants";
1352
- var spinner = tv11({
1512
+ import { tv as tv12 } from "tailwind-variants";
1513
+ var spinner = tv12({
1353
1514
  base: "inline-flex animate-spin"
1354
1515
  });
1355
1516
 
1356
1517
  // core/spinner/spinner.tsx
1357
- import { jsx as jsx17 } from "react/jsx-runtime";
1518
+ import { jsx as jsx18 } from "react/jsx-runtime";
1358
1519
  var Spinner = ({
1359
1520
  variant = "circle",
1360
1521
  size = "md",
1361
1522
  label = "Loading"
1362
- }) => /* @__PURE__ */ jsx17(
1523
+ }) => /* @__PURE__ */ jsx18(
1363
1524
  "span",
1364
1525
  {
1365
1526
  "data-testid": "spinner",
1366
1527
  role: "status",
1367
1528
  "aria-label": label,
1368
1529
  className: spinner(),
1369
- children: /* @__PURE__ */ jsx17(Icon, { name: spinnerIcons[variant], size })
1530
+ children: /* @__PURE__ */ jsx18(Icon, { name: spinnerIcons[variant], size })
1370
1531
  }
1371
1532
  );
1372
1533
 
1373
1534
  // features/app/components/loader/loader.styles.ts
1374
- import { tv as tv12 } from "tailwind-variants";
1375
- var loader = tv12({
1535
+ import { tv as tv13 } from "tailwind-variants";
1536
+ var loader = tv13({
1376
1537
  base: "flex fixed inset-0 justify-center items-center bg-black/20 text-zl-primary z-60"
1377
1538
  });
1378
1539
 
1379
1540
  // features/app/components/loader/loader.tsx
1380
- import { jsx as jsx18 } from "react/jsx-runtime";
1541
+ import { jsx as jsx19 } from "react/jsx-runtime";
1381
1542
  var Loader = ({ label = "Loading" }) => {
1382
1543
  const fetching = useAppStore((s) => s.fetching);
1383
1544
  if (!fetching) return null;
1384
- return /* @__PURE__ */ jsx18("div", { className: loader(), children: /* @__PURE__ */ jsx18(Spinner, { size: "lg", label }) });
1545
+ return /* @__PURE__ */ jsx19("div", { className: loader(), children: /* @__PURE__ */ jsx19(Spinner, { size: "lg", label }) });
1385
1546
  };
1386
1547
 
1387
1548
  // features/app/components/navigation/navigation.tsx
1388
- import { jsx as jsx19 } from "react/jsx-runtime";
1549
+ import { jsx as jsx20 } from "react/jsx-runtime";
1389
1550
  var Navigation = ({
1390
1551
  mode = "auto",
1391
1552
  sections,
@@ -1399,6 +1560,7 @@ var Navigation = ({
1399
1560
  navLabel,
1400
1561
  menuLabel,
1401
1562
  accountLabel,
1563
+ theme,
1402
1564
  share,
1403
1565
  install,
1404
1566
  logout,
@@ -1410,7 +1572,7 @@ var Navigation = ({
1410
1572
  return null;
1411
1573
  }
1412
1574
  if (desktop) {
1413
- return /* @__PURE__ */ jsx19(
1575
+ return /* @__PURE__ */ jsx20(
1414
1576
  Sidebar,
1415
1577
  {
1416
1578
  sections,
@@ -1422,13 +1584,14 @@ var Navigation = ({
1422
1584
  homeHref,
1423
1585
  homeLabel,
1424
1586
  navLabel,
1587
+ theme,
1425
1588
  share,
1426
1589
  logout,
1427
1590
  onLogout
1428
1591
  }
1429
1592
  );
1430
1593
  }
1431
- return /* @__PURE__ */ jsx19(
1594
+ return /* @__PURE__ */ jsx20(
1432
1595
  TopNav,
1433
1596
  {
1434
1597
  sections,
@@ -1439,6 +1602,7 @@ var Navigation = ({
1439
1602
  navLabel,
1440
1603
  menuLabel,
1441
1604
  accountLabel,
1605
+ theme,
1442
1606
  share,
1443
1607
  install,
1444
1608
  logout,
@@ -1481,7 +1645,7 @@ var createReduxStore = ({
1481
1645
  };
1482
1646
 
1483
1647
  // core/state/redux/redux-provider/redux-provider.tsx
1484
- import { jsx as jsx20 } from "react/jsx-runtime";
1648
+ import { jsx as jsx21 } from "react/jsx-runtime";
1485
1649
  var ReduxProvider = ({
1486
1650
  children,
1487
1651
  reducers = {},
@@ -1497,7 +1661,7 @@ var ReduxProvider = ({
1497
1661
  coreReducers
1498
1662
  })
1499
1663
  );
1500
- return /* @__PURE__ */ jsx20(Provider, { store, children });
1664
+ return /* @__PURE__ */ jsx21(Provider, { store, children });
1501
1665
  };
1502
1666
 
1503
1667
  // core/state/zustand/router/router.utils.ts
@@ -1558,11 +1722,11 @@ var usePageStore = create5()(
1558
1722
  );
1559
1723
 
1560
1724
  // core/card/card.styles.ts
1561
- import { tv as tv13 } from "tailwind-variants";
1562
- var card = tv13({
1725
+ import { tv as tv14 } from "tailwind-variants";
1726
+ var card = tv14({
1563
1727
  slots: {
1564
1728
  // A soft, wide shadow in the color of the card. shadow-sm only spreads 1 to
1565
- // 3px and reads as part of the border on a white page.
1729
+ // 3px and reads as part of the border on a light page.
1566
1730
  base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
1567
1731
  header: "flex flex-col gap-1"
1568
1732
  },
@@ -1580,7 +1744,7 @@ var card = tv13({
1580
1744
  },
1581
1745
  info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
1582
1746
  muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
1583
- none: { base: "border-gray-200 bg-white shadow-black/12" }
1747
+ none: { base: "border-zl-border bg-zl-surface shadow-black/12" }
1584
1748
  }
1585
1749
  },
1586
1750
  defaultVariants: {
@@ -1589,7 +1753,7 @@ var card = tv13({
1589
1753
  });
1590
1754
 
1591
1755
  // core/card/card.tsx
1592
- import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
1756
+ import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
1593
1757
  var Card = ({
1594
1758
  children,
1595
1759
  title: title2,
@@ -1601,23 +1765,23 @@ var Card = ({
1601
1765
  const messageColor = color === "none" ? "muted" : "none";
1602
1766
  return /* @__PURE__ */ jsxs8("div", { "data-testid": "card", className: base(), children: [
1603
1767
  (title2 || message) && /* @__PURE__ */ jsxs8("div", { className: header3(), children: [
1604
- title2 && /* @__PURE__ */ jsx21(Heading, { level: titleLevel, children: title2 }),
1605
- message && /* @__PURE__ */ jsx21(Text, { color: messageColor, children: message })
1768
+ title2 && /* @__PURE__ */ jsx22(Heading, { level: titleLevel, children: title2 }),
1769
+ message && /* @__PURE__ */ jsx22(Text, { color: messageColor, children: message })
1606
1770
  ] }),
1607
1771
  children
1608
1772
  ] });
1609
1773
  };
1610
1774
 
1611
1775
  // features/auth/components/access-pending/access-pending.styles.ts
1612
- import { tv as tv14 } from "tailwind-variants";
1613
- var accessPending = tv14({
1776
+ import { tv as tv15 } from "tailwind-variants";
1777
+ var accessPending = tv15({
1614
1778
  slots: {
1615
1779
  account: "flex items-center justify-between gap-3"
1616
1780
  }
1617
1781
  });
1618
1782
 
1619
1783
  // features/auth/components/access-pending/access-pending.tsx
1620
- import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
1784
+ import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
1621
1785
  var AccessPending = ({
1622
1786
  title: title2 = "Waiting for approval",
1623
1787
  message = "Your access to this app has not been approved yet.",
@@ -1632,9 +1796,9 @@ var AccessPending = ({
1632
1796
  if (!user) {
1633
1797
  return null;
1634
1798
  }
1635
- return /* @__PURE__ */ jsx22(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsxs9("div", { className: account(), children: [
1636
- /* @__PURE__ */ jsx22(Text, { variant: "caption", color: "muted", children: user.email }),
1637
- /* @__PURE__ */ jsx22(
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(
1638
1802
  SignOutButton,
1639
1803
  {
1640
1804
  label: signOutLabel,
@@ -1649,7 +1813,7 @@ var AccessPending = ({
1649
1813
 
1650
1814
  // features/auth/components/auth-provider/auth-provider.tsx
1651
1815
  import { useEffect as useEffect4 } from "react";
1652
- import { Fragment as Fragment6, jsx as jsx23 } from "react/jsx-runtime";
1816
+ import { Fragment as Fragment6, jsx as jsx24 } from "react/jsx-runtime";
1653
1817
  var AuthProvider = ({
1654
1818
  adapter,
1655
1819
  appId,
@@ -1666,7 +1830,7 @@ var AuthProvider = ({
1666
1830
  reset();
1667
1831
  };
1668
1832
  }, [adapter, appId, configure, setSession, reset]);
1669
- return /* @__PURE__ */ jsx23(Fragment6, { children });
1833
+ return /* @__PURE__ */ jsx24(Fragment6, { children });
1670
1834
  };
1671
1835
 
1672
1836
  // features/auth/components/login/login.const.ts
@@ -1680,15 +1844,15 @@ var loginVendors = {
1680
1844
  };
1681
1845
 
1682
1846
  // features/auth/components/login/login.styles.ts
1683
- import { tv as tv15 } from "tailwind-variants";
1684
- var login = tv15({
1847
+ import { tv as tv16 } from "tailwind-variants";
1848
+ var login = tv16({
1685
1849
  slots: {
1686
1850
  options: "flex flex-col gap-3"
1687
1851
  }
1688
1852
  });
1689
1853
 
1690
1854
  // features/auth/components/login/login.tsx
1691
- import { jsx as jsx24 } from "react/jsx-runtime";
1855
+ import { jsx as jsx25 } from "react/jsx-runtime";
1692
1856
  var LoginProviderButton = ({
1693
1857
  id,
1694
1858
  label,
@@ -1697,7 +1861,7 @@ var LoginProviderButton = ({
1697
1861
  const signIn = () => {
1698
1862
  onSignIn(id);
1699
1863
  };
1700
- return /* @__PURE__ */ jsx24(Button, { size: "lg", fullWidth: true, onClick: signIn, children: label });
1864
+ return /* @__PURE__ */ jsx25(Button, { size: "lg", fullWidth: true, onClick: signIn, children: label });
1701
1865
  };
1702
1866
  var Login = ({
1703
1867
  vendor,
@@ -1715,9 +1879,9 @@ var Login = ({
1715
1879
  useToastStore.getState().error(errorMessage);
1716
1880
  });
1717
1881
  };
1718
- return /* @__PURE__ */ jsx24(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsx24("div", { className: options(), children: providers.map((provider) => {
1882
+ return /* @__PURE__ */ jsx25(Card, { title: title2, titleLevel: 1, message, children: /* @__PURE__ */ jsx25("div", { className: options(), children: providers.map((provider) => {
1719
1883
  const id = String(provider);
1720
- return /* @__PURE__ */ jsx24(
1884
+ return /* @__PURE__ */ jsx25(
1721
1885
  LoginProviderButton,
1722
1886
  {
1723
1887
  id,
@@ -1730,7 +1894,7 @@ var Login = ({
1730
1894
  };
1731
1895
 
1732
1896
  // features/auth/components/authorized/authorized.tsx
1733
- import { Fragment as Fragment7, jsx as jsx25 } from "react/jsx-runtime";
1897
+ import { Fragment as Fragment7, jsx as jsx26 } from "react/jsx-runtime";
1734
1898
  var Authorized = ({
1735
1899
  children,
1736
1900
  roles,
@@ -1739,18 +1903,18 @@ var Authorized = ({
1739
1903
  }) => {
1740
1904
  const { status, user, role } = useAuth();
1741
1905
  if (status === "loading") return null;
1742
- if (!user) return /* @__PURE__ */ jsx25(Login, { ...login2 });
1906
+ if (!user) return /* @__PURE__ */ jsx26(Login, { ...login2 });
1743
1907
  const hasRole = !roles || role !== null && roles.includes(role);
1744
- if (!user.hasAccess || !hasRole) return /* @__PURE__ */ jsx25(AccessPending, { ...accessPending2 });
1745
- return /* @__PURE__ */ jsx25(Fragment7, { children });
1908
+ if (!user.hasAccess || !hasRole) return /* @__PURE__ */ jsx26(AccessPending, { ...accessPending2 });
1909
+ return /* @__PURE__ */ jsx26(Fragment7, { children });
1746
1910
  };
1747
1911
 
1748
1912
  // features/providers/components/zustand-providers/zustand-providers.tsx
1749
- import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs10 } from "react/jsx-runtime";
1913
+ import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
1750
1914
  var ZustandProviders = ({ children, auth }) => /* @__PURE__ */ jsxs10(Fragment8, { children: [
1751
- /* @__PURE__ */ jsx26(Loader, {}),
1752
- /* @__PURE__ */ jsx26(Toaster, {}),
1753
- auth ? /* @__PURE__ */ jsx26(AuthProvider, { adapter: auth.adapter, appId: auth.appId, children }) : children
1915
+ /* @__PURE__ */ jsx27(Loader, {}),
1916
+ /* @__PURE__ */ jsx27(Toaster, {}),
1917
+ auth ? /* @__PURE__ */ jsx27(AuthProvider, { adapter: auth.adapter, appId: auth.appId, children }) : children
1754
1918
  ] });
1755
1919
 
1756
1920
  export {
@@ -1759,6 +1923,12 @@ export {
1759
1923
  Text,
1760
1924
  Modal,
1761
1925
  Heading,
1926
+ useInstallApp,
1927
+ useIsDesktop,
1928
+ themeScript,
1929
+ setTheme,
1930
+ useTheme,
1931
+ ThemeToggle,
1762
1932
  useToastStore,
1763
1933
  ShareAppButton,
1764
1934
  appInitialState,
@@ -1770,8 +1940,6 @@ export {
1770
1940
  Link,
1771
1941
  Sidebar,
1772
1942
  InstallAppButton,
1773
- useInstallApp,
1774
- useIsDesktop,
1775
1943
  TopNav,
1776
1944
  toast,
1777
1945
  Toaster,