@geomak/ui 1.1.0 → 1.3.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/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { colors_default } from './chunk-DNQSZOYD.js';
2
+ export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-DNQSZOYD.js';
1
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
4
  import React9, { createContext, useMemo, useState, useEffect, useContext, useRef, useCallback, useId } from 'react';
3
5
  import * as Dialog from '@radix-ui/react-dialog';
@@ -11,43 +13,6 @@ import * as Popover from '@radix-ui/react-popover';
11
13
  import * as SwitchPrimitive from '@radix-ui/react-switch';
12
14
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
13
15
 
14
- // src/utils/colors.ts
15
- var PALETTE = {
16
- "true-blue": "#0466C8",
17
- "usafa-blue": "#0353A4",
18
- "dark-cornflower-blue": "#023E7D",
19
- "oxford-blue-700": "#002855",
20
- "oxford-blue-800": "#001845",
21
- "oxford-blue-900": "#001233",
22
- independence: "#33415C",
23
- "black-coral": "#5C677D",
24
- "roman-silver": "#7D8597",
25
- manatee: "#979DAC",
26
- white: "#fff",
27
- ice: "#DBF1FD",
28
- "ice-dark": "#d0e3ed",
29
- "midnight-green-eagle-900": "#013E53",
30
- "midnight-green-eagle-700": "#125F6C",
31
- "midnight-green-eagle-500": "#125F6C",
32
- "rich-black-fogra": "#000202",
33
- "rich-black-fogra-opaque": "#0000005b",
34
- "prussian-blue": "#00273A",
35
- "indigo-dye": "#013C54",
36
- ming: "#0F6372",
37
- skobeloff: "#217479",
38
- "dark-cyan": "#2A8784",
39
- "celadon-green": "#297E74",
40
- turquise: "#2EB8B0",
41
- "oxford-blue-700-opaque": "rgba(0, 40, 85, .3)",
42
- disabled: "#dee2e6",
43
- error: "tomato",
44
- warning: "orange",
45
- success: "lightgreen",
46
- info: "lightblue",
47
- transparent: "rgba(255, 255, 255, .0)"
48
- };
49
- var COLORS = { PALETTE };
50
- var colors_default = COLORS;
51
16
  var Moon = ({ color = "gray" }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: color, viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: color, className: "w-8 h-8", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" }) });
52
17
  var Sun = ({ color = "yellow" }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: color, viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: color, className: "w-8 h-8", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" }) });
53
18
  var CheckCircle = ({ color = "#fff", size = 28 }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14 0.25C6.40625 0.25 0.25 6.40625 0.25 14C0.25 21.5937 6.40625 27.75 14 27.75C21.5937 27.75 27.75 21.5937 27.75 14C27.75 6.40625 21.5937 0.25 14 0.25ZM19.96 11.675C20.0697 11.5496 20.1533 11.4034 20.2057 11.2452C20.2582 11.087 20.2784 10.9199 20.2653 10.7537C20.2522 10.5876 20.206 10.4257 20.1295 10.2777C20.0529 10.1296 19.9475 9.99838 19.8194 9.89168C19.6914 9.78497 19.5433 9.70495 19.3839 9.65633C19.2244 9.6077 19.0569 9.59145 18.8911 9.60853C18.7253 9.62562 18.5646 9.67568 18.4184 9.75579C18.2723 9.8359 18.1436 9.94443 18.04 10.075L12.665 16.5237L9.88375 13.7412C9.648 13.5136 9.33224 13.3876 9.0045 13.3904C8.67675 13.3933 8.36324 13.5247 8.13148 13.7565C7.89972 13.9882 7.76825 14.3018 7.76541 14.6295C7.76256 14.9572 7.88855 15.273 8.11625 15.5087L11.8662 19.2587C11.9891 19.3815 12.1361 19.4773 12.298 19.5401C12.4599 19.6028 12.6331 19.6312 12.8066 19.6233C12.98 19.6154 13.15 19.5715 13.3055 19.4943C13.4611 19.4171 13.5988 19.3084 13.71 19.175L19.96 11.675Z", fill: color }) });
@@ -237,8 +202,45 @@ function IconButton({
237
202
  }
238
203
  );
239
204
  }
205
+ var VARIANT_CLASSES = {
206
+ primary: [
207
+ "bg-accent text-white",
208
+ "hover:bg-accent-hover",
209
+ "active:bg-accent",
210
+ "disabled:bg-roman-silver disabled:text-white/70 disabled:cursor-not-allowed",
211
+ "focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
212
+ ].join(" "),
213
+ secondary: [
214
+ "bg-transparent border border-accent text-accent",
215
+ "hover:bg-accent hover:text-white",
216
+ "active:bg-accent-hover active:text-white",
217
+ "disabled:border-roman-silver disabled:text-roman-silver disabled:cursor-not-allowed",
218
+ "focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
219
+ ].join(" "),
220
+ ghost: [
221
+ "bg-transparent text-foreground-secondary",
222
+ "hover:bg-ice dark:hover:bg-oxford-blue-700 hover:text-foreground",
223
+ "active:bg-ice-dark dark:active:bg-independence",
224
+ "disabled:text-roman-silver disabled:cursor-not-allowed",
225
+ "focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
226
+ ].join(" "),
227
+ danger: [
228
+ "bg-status-error text-white",
229
+ "hover:opacity-90",
230
+ "active:opacity-100",
231
+ "disabled:opacity-50 disabled:cursor-not-allowed",
232
+ "focus-visible:ring-2 focus-visible:ring-status-error focus-visible:ring-offset-2"
233
+ ].join(" ")
234
+ };
235
+ var SIZE_CLASSES = {
236
+ sm: "h-7 px-3 text-xs gap-1 rounded-md",
237
+ md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
238
+ lg: "h-11 px-5 text-sm gap-2 rounded-xl"
239
+ };
240
240
  function Button({
241
241
  content,
242
+ variant = "primary",
243
+ size = "md",
242
244
  buttonType = "button",
243
245
  loading,
244
246
  disabled,
@@ -252,26 +254,33 @@ function Button({
252
254
  onClick,
253
255
  disabled: disabled || loading,
254
256
  type: buttonType,
255
- className: "bg-usafa-blue w-60 h-9 outline-offset-2 mt-5 rounded-lg disabled:bg-roman-silver disabled:cursor-not-allowed transition-all duration-300 hover:bg-true-blue active:bg-usafa-blue flex justify-center gap-1 items-center text-white",
256
- style: style ?? {},
257
+ style,
258
+ className: [
259
+ // Base — layout, transitions, focus reset
260
+ "inline-flex items-center justify-center font-medium",
261
+ "outline-none transition-colors duration-150 select-none",
262
+ "whitespace-nowrap",
263
+ SIZE_CLASSES[size],
264
+ VARIANT_CLASSES[variant]
265
+ ].join(" "),
257
266
  children: [
258
267
  loading ? /* @__PURE__ */ jsx(
259
268
  "svg",
260
269
  {
261
- xmlns: "http://www.w3.org/2000/svg",
262
270
  viewBox: "0 0 24 24",
263
- fill: "#fff",
264
- className: "w-6 h-6 animate-spin",
271
+ fill: "currentColor",
272
+ className: "w-4 h-4 animate-spin flex-shrink-0",
273
+ "aria-hidden": "true",
265
274
  children: /* @__PURE__ */ jsx(
266
275
  "path",
267
276
  {
268
277
  fillRule: "evenodd",
269
- d: "M4.755 10.059a7.5 7.5 0 0112.548-3.364l1.903 1.903h-3.183a.75.75 0 100 1.5h4.992a.75.75 0 00.75-.75V4.356a.75.75 0 00-1.5 0v3.18l-1.9-1.9A9 9 0 003.306 9.67a.75.75 0 101.45.388zm15.408 3.352a.75.75 0 00-.919.53 7.5 7.5 0 01-12.548 3.364l-1.902-1.903h3.183a.75.75 0 000-1.5H2.984a.75.75 0 00-.75.75v4.992a.75.75 0 001.5 0v-3.18l1.9 1.9a9 9 0 0015.059-4.035.75.75 0 00-.53-.918z",
270
- clipRule: "evenodd"
278
+ clipRule: "evenodd",
279
+ d: "M4.755 10.059a7.5 7.5 0 0112.548-3.364l1.903 1.903h-3.183a.75.75 0 100 1.5h4.992a.75.75 0 00.75-.75V4.356a.75.75 0 00-1.5 0v3.18l-1.9-1.9A9 9 0 003.306 9.67a.75.75 0 101.45.388zm15.408 3.352a.75.75 0 00-.919.53 7.5 7.5 0 01-12.548 3.364l-1.902-1.903h3.183a.75.75 0 000-1.5H2.984a.75.75 0 00-.75.75v4.992a.75.75 0 001.5 0v-3.18l1.9 1.9a9 9 0 0015.059-4.035.75.75 0 00-.53-.918z"
271
280
  }
272
281
  )
273
282
  }
274
- ) : icon ? icon : null,
283
+ ) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", "aria-hidden": "true", children: icon }) : null,
275
284
  content
276
285
  ]
277
286
  }
@@ -694,15 +703,15 @@ var NotificationContext = createContext({
694
703
  open: () => void 0,
695
704
  close: () => void 0
696
705
  });
697
- var typeClass = {
698
- info: "bg-info",
699
- success: "bg-success",
700
- warning: "bg-warning",
701
- danger: "bg-error"
706
+ var TYPE_BG = {
707
+ info: "bg-status-info",
708
+ success: "bg-status-success",
709
+ warning: "bg-status-warning",
710
+ danger: "bg-status-error"
702
711
  };
703
712
  function TypeIcon({ type }) {
704
713
  if (type === "success") {
705
- return /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", children: /* @__PURE__ */ jsx(
714
+ return /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 28 28", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
706
715
  "path",
707
716
  {
708
717
  fillRule: "evenodd",
@@ -713,52 +722,94 @@ function TypeIcon({ type }) {
713
722
  ) });
714
723
  }
715
724
  if (type === "info") {
716
- return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-7 h-7", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 01.67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 11-.671-1.34l.041-.022zM12 9a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
725
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-5 h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 01.67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 11-.671-1.34l.041-.022zM12 9a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
717
726
  }
718
727
  if (type === "warning") {
719
- return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-7 h-7", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
728
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-5 h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
720
729
  }
721
- return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-7 h-7", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 01-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 01-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 01-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584zM12 18a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
730
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#fff", className: "w-5 h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 01-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 01-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 01-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584zM12 18a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }) });
731
+ }
732
+ function NotificationItem({
733
+ n,
734
+ onClose,
735
+ reduced
736
+ }) {
737
+ return /* @__PURE__ */ jsx(
738
+ motion.div,
739
+ {
740
+ layout: true,
741
+ initial: { opacity: 0, x: reduced ? 0 : 56, scale: reduced ? 0.97 : 1 },
742
+ animate: { opacity: 1, x: 0, scale: 1 },
743
+ exit: { opacity: 0, x: reduced ? 0 : 40, scale: reduced ? 0.97 : 1 },
744
+ transition: reduced ? { duration: 0 } : {
745
+ opacity: { duration: 0.15 },
746
+ x: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
747
+ layout: { duration: 0.2 }
748
+ },
749
+ children: /* @__PURE__ */ jsxs(
750
+ Toast.Root,
751
+ {
752
+ open: true,
753
+ duration: n.duration,
754
+ onOpenChange: (o) => {
755
+ if (!o) onClose(n.id);
756
+ },
757
+ className: [
758
+ "rounded-xl shadow-md p-3 w-[300px] text-white",
759
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-white/60",
760
+ TYPE_BG[n.type ?? "info"]
761
+ ].join(" "),
762
+ children: [
763
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
764
+ /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(TypeIcon, { type: n.type ?? "info" }) }),
765
+ /* @__PURE__ */ jsx(Toast.Title, { className: "font-semibold text-sm leading-snug flex-1", children: n.title }),
766
+ /* @__PURE__ */ jsx(Toast.Action, { asChild: true, altText: "Close", children: /* @__PURE__ */ jsx(
767
+ "button",
768
+ {
769
+ "aria-label": "Close notification",
770
+ onClick: () => onClose(n.id),
771
+ className: "flex-shrink-0 rounded-md p-1 hover:bg-white/20 transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-white/60",
772
+ children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
773
+ }
774
+ ) })
775
+ ] }),
776
+ n.description && /* @__PURE__ */ jsx(Toast.Description, { className: "mt-1.5 text-xs text-white/80 leading-relaxed pl-7", children: n.description })
777
+ ]
778
+ }
779
+ )
780
+ }
781
+ );
722
782
  }
723
783
  function NotificationProvider({ children }) {
724
784
  const [notifications, setNotifications] = useState([]);
785
+ const reduced = useReducedMotion();
725
786
  const open = (payload) => {
726
- setNotifications((prev) => [...prev, { duration: 4e3, ...payload, id: Date.now() + Math.random() }]);
787
+ setNotifications((prev) => [
788
+ ...prev,
789
+ { duration: 4e3, ...payload, id: Date.now() + Math.random() }
790
+ ]);
727
791
  };
728
792
  const close = (id) => {
729
793
  setNotifications((prev) => prev.filter((n) => n.id !== id));
730
794
  };
731
795
  return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: { open, close }, children: /* @__PURE__ */ jsxs(Toast.Provider, { swipeDirection: "right", children: [
732
796
  children,
733
- notifications.map((n) => /* @__PURE__ */ jsxs(
734
- Toast.Root,
797
+ /* @__PURE__ */ jsx(
798
+ Toast.Viewport,
735
799
  {
736
- open: true,
737
- duration: n.duration,
738
- onOpenChange: (o) => {
739
- if (!o) close(n.id);
740
- },
741
- className: `rounded-lg shadow-md p-2 w-[300px] text-white ${typeClass[n.type ?? "info"]} data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full`,
742
- children: [
743
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-white pb-1", children: [
744
- /* @__PURE__ */ jsx(TypeIcon, { type: n.type ?? "info" }),
745
- /* @__PURE__ */ jsx(Toast.Title, { className: "text-center font-bold text-lg flex-1", children: n.title }),
746
- /* @__PURE__ */ jsx(Toast.Action, { asChild: true, altText: "Close", children: /* @__PURE__ */ jsx(
747
- "button",
748
- {
749
- "aria-label": "Close notification",
750
- onClick: () => close(n.id),
751
- className: "cursor-pointer rounded p-0.5 hover:bg-white/20 transition-colors",
752
- children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
753
- }
754
- ) })
755
- ] }),
756
- n.description && /* @__PURE__ */ jsx(Toast.Description, { className: "text-center mt-1 text-sm", children: n.description })
757
- ]
758
- },
759
- n.id
760
- )),
761
- /* @__PURE__ */ jsx(Toast.Viewport, { className: "fixed top-[50px] right-0 flex flex-col gap-2 w-[350px] z-[500000] p-4 outline-none" })
800
+ asChild: true,
801
+ className: "fixed top-[56px] right-0 z-[500000] flex flex-col gap-2 w-[350px] p-4 outline-none",
802
+ children: /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: notifications.map((n) => /* @__PURE__ */ jsx(
803
+ NotificationItem,
804
+ {
805
+ n,
806
+ onClose: close,
807
+ reduced
808
+ },
809
+ n.id
810
+ )) }) })
811
+ }
812
+ )
762
813
  ] }) });
763
814
  }
764
815
  function useNotification() {
@@ -1735,29 +1786,77 @@ function Table({
1735
1786
  /* @__PURE__ */ jsx("div", { children: footer })
1736
1787
  ] });
1737
1788
  }
1738
- function Switch({ checked, onChange }) {
1789
+ function ThemeSwitch({ checked, onChange, label = "Toggle dark mode" }) {
1739
1790
  const id = useId();
1740
- return /* @__PURE__ */ jsx("div", { className: "relative bottom-5", children: /* @__PURE__ */ jsx("label", { htmlFor: id, className: "flex items-center cursor-pointer mr-12 select-none", children: /* @__PURE__ */ jsx(
1791
+ return /* @__PURE__ */ jsx("label", { htmlFor: id, className: "flex items-center gap-2 cursor-pointer select-none", children: /* @__PURE__ */ jsx(
1741
1792
  SwitchPrimitive.Root,
1742
1793
  {
1743
1794
  id,
1744
1795
  checked,
1745
1796
  onCheckedChange: (c) => onChange({ target: { checked: c } }),
1746
- className: "relative inline-flex h-6 w-14 items-center rounded-full bg-prussian-blue dark:bg-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-usafa-blue",
1797
+ "aria-label": label,
1798
+ className: [
1799
+ "relative inline-flex h-6 w-11 items-center rounded-full",
1800
+ "transition-colors duration-200",
1801
+ "bg-foreground-secondary data-[state=checked]:bg-accent",
1802
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2"
1803
+ ].join(" "),
1747
1804
  children: /* @__PURE__ */ jsx(
1748
1805
  SwitchPrimitive.Thumb,
1749
1806
  {
1750
- className: "pointer-events-none inline-flex h-8 w-8 rounded-full shadow transition-transform duration-200 data-[state=checked]:translate-x-[22px] data-[state=unchecked]:translate-x-[-4px]",
1751
- children: /* @__PURE__ */ jsx(
1752
- "div",
1753
- {
1754
- className: `rounded-full w-8 h-8 ${checked ? "bg-success" : "bg-error"} transition-colors duration-200`
1755
- }
1807
+ className: [
1808
+ "pointer-events-none block h-5 w-5 rounded-full shadow-sm",
1809
+ "transition-transform duration-200",
1810
+ "data-[state=checked]:translate-x-[22px]",
1811
+ "data-[state=unchecked]:translate-x-[2px]",
1812
+ // Moon icon (dark mode indicator) when checked, sun when unchecked
1813
+ checked ? "bg-oxford-blue-900" : "bg-white"
1814
+ ].join(" "),
1815
+ children: checked ? (
1816
+ // Moon
1817
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "currentColor", className: "w-3 h-3 m-1 text-manatee", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) })
1818
+ ) : (
1819
+ // Sun
1820
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "currentColor", className: "w-3 h-3 m-1 text-usafa-blue", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707z" }) })
1756
1821
  )
1757
1822
  }
1758
1823
  )
1759
1824
  }
1760
- ) }) });
1825
+ ) });
1826
+ }
1827
+ function TopBar({
1828
+ brand,
1829
+ center,
1830
+ actions,
1831
+ height = 56,
1832
+ className = ""
1833
+ }) {
1834
+ return /* @__PURE__ */ jsxs(
1835
+ "header",
1836
+ {
1837
+ className: [
1838
+ "sticky top-0 z-[100]",
1839
+ "flex items-center justify-between gap-4",
1840
+ "border-b border-border bg-surface",
1841
+ "px-4 md:px-6",
1842
+ className
1843
+ ].join(" "),
1844
+ style: {
1845
+ height,
1846
+ // Expose as CSS var so consumers can write:
1847
+ // padding-top: calc(var(--topbar-height) + 1rem)
1848
+ ["--topbar-height"]: `${height}px`
1849
+ },
1850
+ children: [
1851
+ brand !== void 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: brand }) : (
1852
+ // Reserve leading space even when brand is null so center stays centred
1853
+ /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "flex-shrink-0 w-0" })
1854
+ ),
1855
+ center !== void 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center min-w-0", children: center }),
1856
+ actions !== void 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: actions })
1857
+ ]
1858
+ }
1859
+ );
1761
1860
  }
1762
1861
  function TextInput({
1763
1862
  value,
@@ -2034,7 +2133,7 @@ function Checkbox({
2034
2133
  /* @__PURE__ */ jsx("div", { className: "text-error text-center", children: errorMessage })
2035
2134
  ] });
2036
2135
  }
2037
- function Switch2({
2136
+ function Switch({
2038
2137
  checked = false,
2039
2138
  onChange,
2040
2139
  checkedIcon,
@@ -2634,6 +2733,6 @@ Temporal.DatePicker = DatePickerBase;
2634
2733
  Temporal.TemporalPicker = TemporalPickerBase;
2635
2734
  var DatePicker_default = Temporal;
2636
2735
 
2637
- export { AutoComplete, Button, colors_default as COLORS, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput, Switch2 as Switch, Table, Tabs, DatePicker_default as Temporal, TextInput, Switch as ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, Tree, TreeSelect, Wizard, useNotification };
2736
+ export { AutoComplete, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput, Switch, Table, Tabs, DatePicker_default as Temporal, TextInput, ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Wizard, useNotification };
2638
2737
  //# sourceMappingURL=index.js.map
2639
2738
  //# sourceMappingURL=index.js.map