@geomak/ui 6.29.0 → 6.29.2

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.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkOAV4TA4B_cjs = require('./chunk-OAV4TA4B.cjs');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var React29 = require('react');
5
+ var React28 = require('react');
6
6
  var reactDom = require('react-dom');
7
7
  var AvatarPrimitive = require('@radix-ui/react-avatar');
8
8
  var DropdownMenu = require('@radix-ui/react-dropdown-menu');
@@ -40,7 +40,7 @@ function _interopNamespace(e) {
40
40
  return Object.freeze(n);
41
41
  }
42
42
 
43
- var React29__default = /*#__PURE__*/_interopDefault(React29);
43
+ var React28__default = /*#__PURE__*/_interopDefault(React28);
44
44
  var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
45
45
  var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
46
46
  var Dialog__namespace = /*#__PURE__*/_interopNamespace(Dialog);
@@ -216,8 +216,8 @@ Icon.Copy = Copy;
216
216
  Icon.CircleStack = CircleStack;
217
217
  var icons_default = Icon;
218
218
  function Portal({ children, target }) {
219
- const [resolved, setResolved] = React29.useState(null);
220
- React29.useEffect(() => {
219
+ const [resolved, setResolved] = React28.useState(null);
220
+ React28.useEffect(() => {
221
221
  if (target === null) {
222
222
  setResolved(null);
223
223
  return;
@@ -651,7 +651,7 @@ function IconButton({
651
651
  className = "",
652
652
  style
653
653
  }) {
654
- const colorScheme = React29.useMemo(() => {
654
+ const colorScheme = React28.useMemo(() => {
655
655
  if (type === "primary") {
656
656
  return "bg-accent text-accent-fg hover:bg-accent-hover";
657
657
  }
@@ -741,7 +741,7 @@ var SIZE_CLASSES = {
741
741
  md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
742
742
  lg: "h-11 px-5 text-sm gap-2 rounded-xl"
743
743
  };
744
- var Button = React29__default.default.forwardRef(function Button2({
744
+ var Button = React28__default.default.forwardRef(function Button2({
745
745
  content,
746
746
  variant = "primary",
747
747
  size = "md",
@@ -849,7 +849,7 @@ function MenuButton({
849
849
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
850
850
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
851
851
  ].join(" "),
852
- children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React29__default.default.Fragment, { children: [
852
+ children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
853
853
  item.separatorBefore && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Separator, { className: "my-1 h-px bg-border" }),
854
854
  /* @__PURE__ */ jsxRuntime.jsxs(
855
855
  DropdownMenu__namespace.Item,
@@ -1092,9 +1092,9 @@ function Tooltip({
1092
1092
  ] }) });
1093
1093
  }
1094
1094
  var TooltipProvider = TooltipPrimitive__namespace.Provider;
1095
- var TabsContext = React29.createContext(null);
1095
+ var TabsContext = React28.createContext(null);
1096
1096
  function useTabsContext() {
1097
- const ctx = React29.useContext(TabsContext);
1097
+ const ctx = React28.useContext(TabsContext);
1098
1098
  if (!ctx) throw new Error("Tabs.List / Tabs.Trigger / Tabs.Panel must be rendered inside <Tabs>.");
1099
1099
  return ctx;
1100
1100
  }
@@ -1116,26 +1116,26 @@ function Tabs({
1116
1116
  children
1117
1117
  }) {
1118
1118
  const isControlled = value !== void 0;
1119
- const [internal, setInternal] = React29.useState(defaultValue);
1119
+ const [internal, setInternal] = React28.useState(defaultValue);
1120
1120
  const current = isControlled ? value : internal;
1121
1121
  const reduced = !!framerMotion.useReducedMotion();
1122
- const indicatorId = React29.useId();
1123
- const select = React29.useCallback((next) => {
1122
+ const indicatorId = React28.useId();
1123
+ const select = React28.useCallback((next) => {
1124
1124
  if (!isControlled) setInternal(next);
1125
1125
  onValueChange?.(next);
1126
1126
  }, [isControlled, onValueChange]);
1127
- const registry = React29.useRef(/* @__PURE__ */ new Map());
1128
- const orderRef = React29.useRef(0);
1129
- const [, bump] = React29.useState(0);
1130
- const registerTab = React29.useCallback((val, meta) => {
1127
+ const registry = React28.useRef(/* @__PURE__ */ new Map());
1128
+ const orderRef = React28.useRef(0);
1129
+ const [, bump] = React28.useState(0);
1130
+ const registerTab = React28.useCallback((val, meta) => {
1131
1131
  const existing = registry.current.get(val);
1132
1132
  registry.current.set(val, { ...meta, order: existing?.order ?? orderRef.current++ });
1133
1133
  if (!existing) bump((v) => v + 1);
1134
1134
  }, []);
1135
- const unregisterTab = React29.useCallback((val) => {
1135
+ const unregisterTab = React28.useCallback((val) => {
1136
1136
  if (registry.current.delete(val)) bump((v) => v + 1);
1137
1137
  }, []);
1138
- const getTabs = React29.useCallback(() => [...registry.current.entries()].sort((a, b) => a[1].order - b[1].order).map(([val, m]) => ({ value: val, label: m.label, icon: m.icon, disabled: m.disabled })), []);
1138
+ const getTabs = React28.useCallback(() => [...registry.current.entries()].sort((a, b) => a[1].order - b[1].order).map(([val, m]) => ({ value: val, label: m.label, icon: m.icon, disabled: m.disabled })), []);
1139
1139
  return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { value: current, variant, size, orientation, indicatorId, reduced, select, registerTab, unregisterTab, getTabs }, children: /* @__PURE__ */ jsxRuntime.jsx(
1140
1140
  TabsPrimitive__namespace.Root,
1141
1141
  {
@@ -1155,10 +1155,10 @@ function Tabs({
1155
1155
  function TabsList({ children, "aria-label": ariaLabel, className = "" }) {
1156
1156
  const { variant, orientation, reduced, value } = useTabsContext();
1157
1157
  const horizontal = orientation === "horizontal";
1158
- const scrollRef = React29.useRef(null);
1159
- const [edges, setEdges] = React29.useState({ start: false, end: false });
1158
+ const scrollRef = React28.useRef(null);
1159
+ const [edges, setEdges] = React28.useState({ start: false, end: false });
1160
1160
  const scrollable = variant !== "segmented";
1161
- React29.useLayoutEffect(() => {
1161
+ React28.useLayoutEffect(() => {
1162
1162
  const el = scrollRef.current;
1163
1163
  if (!el || !scrollable) return;
1164
1164
  const update = () => {
@@ -1183,13 +1183,13 @@ function TabsList({ children, "aria-label": ariaLabel, className = "" }) {
1183
1183
  ro.disconnect();
1184
1184
  };
1185
1185
  }, [horizontal, scrollable, children]);
1186
- const nudge = React29.useCallback((dir) => {
1186
+ const nudge = React28.useCallback((dir) => {
1187
1187
  const el = scrollRef.current;
1188
1188
  if (!el) return;
1189
1189
  const amount = (horizontal ? el.clientWidth : el.clientHeight) * 0.7 * dir;
1190
1190
  el.scrollBy({ [horizontal ? "left" : "top"]: amount, behavior: reduced ? "auto" : "smooth" });
1191
1191
  }, [horizontal, reduced]);
1192
- React29.useLayoutEffect(() => {
1192
+ React28.useLayoutEffect(() => {
1193
1193
  const el = scrollRef.current;
1194
1194
  if (!el || !scrollable) return;
1195
1195
  const active = el.querySelector("[role=tab][data-state=active]");
@@ -1247,9 +1247,9 @@ function Chevron2({ side, orientation, onClick }) {
1247
1247
  function OverflowMenu() {
1248
1248
  const { getTabs, value, select, orientation } = useTabsContext();
1249
1249
  const horizontal = orientation === "horizontal";
1250
- const [open, setOpen] = React29.useState(false);
1251
- const wrapRef = React29.useRef(null);
1252
- const timer = React29.useRef(null);
1250
+ const [open, setOpen] = React28.useState(false);
1251
+ const wrapRef = React28.useRef(null);
1252
+ const timer = React28.useRef(null);
1253
1253
  const openNow = () => {
1254
1254
  if (timer.current) clearTimeout(timer.current);
1255
1255
  setOpen(true);
@@ -1257,7 +1257,7 @@ function OverflowMenu() {
1257
1257
  const closeSoon = () => {
1258
1258
  timer.current = setTimeout(() => setOpen(false), 160);
1259
1259
  };
1260
- React29.useLayoutEffect(() => {
1260
+ React28.useLayoutEffect(() => {
1261
1261
  if (!open) return;
1262
1262
  const onDoc = (e) => {
1263
1263
  if (wrapRef.current && !wrapRef.current.contains(e.target)) setOpen(false);
@@ -1338,7 +1338,7 @@ function TabsTrigger({ value, icon, badge, closeable, onClose, disabled, classNa
1338
1338
  const isActive = active === value;
1339
1339
  const horizontal = orientation === "horizontal";
1340
1340
  const sz = SIZE[size];
1341
- React29.useLayoutEffect(() => {
1341
+ React28.useLayoutEffect(() => {
1342
1342
  registerTab(value, { label: children, icon, disabled });
1343
1343
  return () => unregisterTab(value);
1344
1344
  }, [value, children, icon, disabled, registerTab, unregisterTab]);
@@ -1536,7 +1536,7 @@ function Tree({
1536
1536
  item.key
1537
1537
  )) });
1538
1538
  }
1539
- var AccordionCtx = React29.createContext({ variant: "separated" });
1539
+ var AccordionCtx = React28.createContext({ variant: "separated" });
1540
1540
  function Accordion2({
1541
1541
  children,
1542
1542
  type = "single",
@@ -1595,7 +1595,7 @@ var Chevron3 = /* @__PURE__ */ jsxRuntime.jsx(
1595
1595
  }
1596
1596
  );
1597
1597
  function AccordionItem({ value, title, icon, children, disabled, className = "" }) {
1598
- const { variant } = React29.useContext(AccordionCtx);
1598
+ const { variant } = React28.useContext(AccordionCtx);
1599
1599
  return /* @__PURE__ */ jsxRuntime.jsxs(
1600
1600
  AccordionPrimitive__namespace.Item,
1601
1601
  {
@@ -1654,7 +1654,7 @@ function Breadcrumbs({
1654
1654
  className = "",
1655
1655
  style
1656
1656
  }) {
1657
- const [expanded, setExpanded] = React29.useState(false);
1657
+ const [expanded, setExpanded] = React28.useState(false);
1658
1658
  const shouldCollapse = maxItems > 0 && items.length > maxItems && !expanded;
1659
1659
  const visible = [];
1660
1660
  if (shouldCollapse) {
@@ -1838,8 +1838,8 @@ function Stepper({
1838
1838
  className = ""
1839
1839
  }) {
1840
1840
  const reduced = framerMotion.useReducedMotion();
1841
- const [forcedVertical, setForcedVertical] = React29.useState(false);
1842
- React29.useEffect(() => {
1841
+ const [forcedVertical, setForcedVertical] = React28.useState(false);
1842
+ React28.useEffect(() => {
1843
1843
  if (!responsive || orientation === "vertical") return;
1844
1844
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
1845
1845
  const mq = window.matchMedia("(max-width: 767px)");
@@ -1948,7 +1948,7 @@ function Kbd({
1948
1948
  style
1949
1949
  }) {
1950
1950
  if (keys && keys.length > 0) {
1951
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxRuntime.jsxs(React29__default.default.Fragment, { children: [
1951
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
1952
1952
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
1953
1953
  /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
1954
1954
  ] }, `${k}-${i}`)) });
@@ -2039,13 +2039,13 @@ function FlatCarousel({
2039
2039
  className = "",
2040
2040
  style
2041
2041
  }) {
2042
- const scrollerRef = React29.useRef(null);
2043
- const slides = React29__default.default.Children.toArray(children);
2044
- const [active, setActive] = React29.useState(0);
2045
- const [atStart, setAtStart] = React29.useState(true);
2046
- const [atEnd, setAtEnd] = React29.useState(false);
2042
+ const scrollerRef = React28.useRef(null);
2043
+ const slides = React28__default.default.Children.toArray(children);
2044
+ const [active, setActive] = React28.useState(0);
2045
+ const [atStart, setAtStart] = React28.useState(true);
2046
+ const [atEnd, setAtEnd] = React28.useState(false);
2047
2047
  const width = typeof itemWidth === "number" ? `${itemWidth}px` : itemWidth;
2048
- const update = React29.useCallback(() => {
2048
+ const update = React28.useCallback(() => {
2049
2049
  const el = scrollerRef.current;
2050
2050
  if (!el) return;
2051
2051
  setAtStart(el.scrollLeft <= 1);
@@ -2054,7 +2054,7 @@ function FlatCarousel({
2054
2054
  const slideW = first ? first.getBoundingClientRect().width + gap : el.clientWidth;
2055
2055
  setActive(Math.round(el.scrollLeft / slideW));
2056
2056
  }, [gap]);
2057
- React29.useEffect(() => {
2057
+ React28.useEffect(() => {
2058
2058
  update();
2059
2059
  const el = scrollerRef.current;
2060
2060
  if (!el) return;
@@ -2095,9 +2095,9 @@ function RotatingCarousel({
2095
2095
  className = "",
2096
2096
  style
2097
2097
  }) {
2098
- const slides = React29__default.default.Children.toArray(children);
2098
+ const slides = React28__default.default.Children.toArray(children);
2099
2099
  const count = slides.length;
2100
- const [active, setActive] = React29.useState(0);
2100
+ const [active, setActive] = React28.useState(0);
2101
2101
  const reduced = framerMotion.useReducedMotion();
2102
2102
  const wrap = (n) => count > 0 ? (n % count + count) % count : 0;
2103
2103
  const idx = wrap(active);
@@ -2321,14 +2321,14 @@ function Chat({
2321
2321
  className = "",
2322
2322
  style
2323
2323
  }) {
2324
- const listRef = React29.useRef(null);
2325
- const atBottomRef = React29.useRef(true);
2326
- const [showJump, setShowJump] = React29.useState(false);
2327
- const [draft, setDraft] = React29.useState("");
2328
- const taRef = React29.useRef(null);
2324
+ const listRef = React28.useRef(null);
2325
+ const atBottomRef = React28.useRef(true);
2326
+ const [showJump, setShowJump] = React28.useState(false);
2327
+ const [draft, setDraft] = React28.useState("");
2328
+ const taRef = React28.useRef(null);
2329
2329
  const hasHeader = title != null || subtitle != null || avatar != null || headerActions != null;
2330
2330
  const isTyping = typingNames.length > 0;
2331
- const scrollToBottom = React29.useCallback((smooth = true) => {
2331
+ const scrollToBottom = React28.useCallback((smooth = true) => {
2332
2332
  const el = listRef.current;
2333
2333
  if (!el) return;
2334
2334
  if (typeof el.scrollTo === "function") el.scrollTo({ top: el.scrollHeight, behavior: smooth ? "smooth" : "auto" });
@@ -2341,13 +2341,13 @@ function Chat({
2341
2341
  atBottomRef.current = near;
2342
2342
  setShowJump(!near);
2343
2343
  };
2344
- React29.useEffect(() => {
2344
+ React28.useEffect(() => {
2345
2345
  if (atBottomRef.current) scrollToBottom(messages.length > 0);
2346
2346
  }, [messages.length, isTyping]);
2347
- React29.useEffect(() => {
2347
+ React28.useEffect(() => {
2348
2348
  scrollToBottom(false);
2349
2349
  }, [scrollToBottom]);
2350
- React29.useLayoutEffect(() => {
2350
+ React28.useLayoutEffect(() => {
2351
2351
  const ta = taRef.current;
2352
2352
  if (!ta) return;
2353
2353
  ta.style.height = "auto";
@@ -2541,7 +2541,7 @@ function FAB({
2541
2541
  className = "",
2542
2542
  style
2543
2543
  }) {
2544
- const [open, setOpen] = React29.useState(false);
2544
+ const [open, setOpen] = React28.useState(false);
2545
2545
  const reduced = framerMotion.useReducedMotion();
2546
2546
  const hasDial = !!actions && actions.length > 0;
2547
2547
  const bottom = position.startsWith("bottom");
@@ -2643,8 +2643,8 @@ function PopConfirm({
2643
2643
  onOpenChange,
2644
2644
  className = ""
2645
2645
  }) {
2646
- const [uncontrolledOpen, setUncontrolledOpen] = React29.useState(false);
2647
- const [loading, setLoading] = React29.useState(false);
2646
+ const [uncontrolledOpen, setUncontrolledOpen] = React28.useState(false);
2647
+ const [loading, setLoading] = React28.useState(false);
2648
2648
  const isOpen = open ?? uncontrolledOpen;
2649
2649
  const setOpen = (next) => {
2650
2650
  onOpenChange?.(next);
@@ -2731,16 +2731,16 @@ function LogoutTimer({
2731
2731
  logoutLabel = "Sign out now"
2732
2732
  }) {
2733
2733
  const reduced = framerMotion.useReducedMotion();
2734
- const [warning, setWarning] = React29.useState(false);
2735
- const [remaining, setRemaining] = React29.useState(countdown);
2736
- const idleTimer = React29.useRef(null);
2737
- const tick = React29.useRef(null);
2738
- const deadline = React29.useRef(0);
2739
- const warningRef = React29.useRef(false);
2740
- const lastReset = React29.useRef(0);
2741
- const cbs = React29.useRef({ onLogout, onContinue, onWarning });
2734
+ const [warning, setWarning] = React28.useState(false);
2735
+ const [remaining, setRemaining] = React28.useState(countdown);
2736
+ const idleTimer = React28.useRef(null);
2737
+ const tick = React28.useRef(null);
2738
+ const deadline = React28.useRef(0);
2739
+ const warningRef = React28.useRef(false);
2740
+ const lastReset = React28.useRef(0);
2741
+ const cbs = React28.useRef({ onLogout, onContinue, onWarning });
2742
2742
  cbs.current = { onLogout, onContinue, onWarning };
2743
- const clearTimers = React29.useCallback(() => {
2743
+ const clearTimers = React28.useCallback(() => {
2744
2744
  if (idleTimer.current) {
2745
2745
  clearTimeout(idleTimer.current);
2746
2746
  idleTimer.current = null;
@@ -2750,13 +2750,13 @@ function LogoutTimer({
2750
2750
  tick.current = null;
2751
2751
  }
2752
2752
  }, []);
2753
- const logout = React29.useCallback(() => {
2753
+ const logout = React28.useCallback(() => {
2754
2754
  clearTimers();
2755
2755
  warningRef.current = false;
2756
2756
  setWarning(false);
2757
2757
  cbs.current.onLogout();
2758
2758
  }, [clearTimers]);
2759
- const startIdle = React29.useCallback(() => {
2759
+ const startIdle = React28.useCallback(() => {
2760
2760
  if (idleTimer.current) clearTimeout(idleTimer.current);
2761
2761
  idleTimer.current = setTimeout(() => {
2762
2762
  warningRef.current = true;
@@ -2771,7 +2771,7 @@ function LogoutTimer({
2771
2771
  }, 250);
2772
2772
  }, timeout);
2773
2773
  }, [timeout, countdown, logout]);
2774
- const stay = React29.useCallback(() => {
2774
+ const stay = React28.useCallback(() => {
2775
2775
  if (tick.current) {
2776
2776
  clearInterval(tick.current);
2777
2777
  tick.current = null;
@@ -2781,7 +2781,7 @@ function LogoutTimer({
2781
2781
  cbs.current.onContinue?.();
2782
2782
  startIdle();
2783
2783
  }, [startIdle]);
2784
- React29.useEffect(() => {
2784
+ React28.useEffect(() => {
2785
2785
  if (!enabled) {
2786
2786
  clearTimers();
2787
2787
  warningRef.current = false;
@@ -2823,125 +2823,6 @@ function LogoutTimer({
2823
2823
  ] })
2824
2824
  ] }) });
2825
2825
  }
2826
- var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
2827
- var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
2828
- var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
2829
- var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
2830
- var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
2831
- function buildGrid(month, weekStartsOn) {
2832
- const first = new Date(month.getFullYear(), month.getMonth(), 1);
2833
- const offset = (first.getDay() - weekStartsOn + 7) % 7;
2834
- const start = new Date(first);
2835
- start.setDate(first.getDate() - offset);
2836
- return Array.from({ length: 42 }, (_, i) => {
2837
- const d = new Date(start);
2838
- d.setDate(start.getDate() + i);
2839
- return d;
2840
- });
2841
- }
2842
- var NavIcon = ({ dir }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: dir === "left" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7" }) });
2843
- function Calendar2({
2844
- value,
2845
- onChange,
2846
- month,
2847
- defaultMonth,
2848
- onMonthChange,
2849
- events,
2850
- min,
2851
- max,
2852
- weekStartsOn = 0,
2853
- className = "",
2854
- style
2855
- }) {
2856
- const today = React29.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
2857
- const [internalMonth, setInternalMonth] = React29.useState(() => month ?? defaultMonth ?? value ?? today);
2858
- const visible = month ?? internalMonth;
2859
- const setMonth = (next) => {
2860
- onMonthChange?.(next);
2861
- if (month === void 0) setInternalMonth(next);
2862
- };
2863
- const grid = React29.useMemo(() => buildGrid(visible, weekStartsOn), [visible, weekStartsOn]);
2864
- const weekdays = React29.useMemo(() => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]), [weekStartsOn]);
2865
- const eventsByDay = React29.useMemo(() => {
2866
- const map = /* @__PURE__ */ new Map();
2867
- for (const ev of events ?? []) {
2868
- const key = startOfDay(ev.date).toDateString();
2869
- const arr = map.get(key) ?? [];
2870
- arr.push(ev);
2871
- map.set(key, arr);
2872
- }
2873
- return map;
2874
- }, [events]);
2875
- const disabled = (d) => min && d < startOfDay(min) || max && d > startOfDay(max);
2876
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["inline-block rounded-lg border border-border bg-surface p-3 select-none", className].filter(Boolean).join(" "), style, children: [
2877
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between px-1", children: [
2878
- /* @__PURE__ */ jsxRuntime.jsx(
2879
- "button",
2880
- {
2881
- type: "button",
2882
- "aria-label": "Previous month",
2883
- onClick: () => setMonth(addMonths(visible, -1)),
2884
- className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
2885
- children: /* @__PURE__ */ jsxRuntime.jsx(NavIcon, { dir: "left" })
2886
- }
2887
- ),
2888
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-semibold text-foreground", "aria-live": "polite", children: [
2889
- MONTHS[visible.getMonth()],
2890
- " ",
2891
- visible.getFullYear()
2892
- ] }),
2893
- /* @__PURE__ */ jsxRuntime.jsx(
2894
- "button",
2895
- {
2896
- type: "button",
2897
- "aria-label": "Next month",
2898
- onClick: () => setMonth(addMonths(visible, 1)),
2899
- className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
2900
- children: /* @__PURE__ */ jsxRuntime.jsx(NavIcon, { dir: "right" })
2901
- }
2902
- )
2903
- ] }),
2904
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 mb-1", children: weekdays.map((w) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted py-1", children: w }, w)) }),
2905
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 gap-0.5", role: "grid", children: grid.map((d, i) => {
2906
- const inMonth = d.getMonth() === visible.getMonth();
2907
- const isSelected = value != null && sameDay(d, value);
2908
- const isToday2 = sameDay(d, today);
2909
- const isDisabled = disabled(d);
2910
- const dayEvents = eventsByDay.get(d.toDateString()) ?? [];
2911
- return /* @__PURE__ */ jsxRuntime.jsxs(
2912
- "button",
2913
- {
2914
- type: "button",
2915
- role: "gridcell",
2916
- "aria-selected": isSelected,
2917
- "aria-current": isToday2 ? "date" : void 0,
2918
- disabled: isDisabled,
2919
- onClick: () => onChange?.(startOfDay(d)),
2920
- className: [
2921
- "relative flex h-9 w-9 flex-col items-center justify-center rounded-md text-sm transition-colors",
2922
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
2923
- isSelected ? "bg-accent text-accent-fg font-semibold" : inMonth ? "text-foreground hover:bg-surface-raised" : "text-foreground-muted hover:bg-surface-raised",
2924
- isDisabled ? "opacity-40 cursor-not-allowed hover:bg-transparent" : "",
2925
- !isSelected && isToday2 ? "ring-1 ring-inset ring-accent/60" : ""
2926
- ].filter(Boolean).join(" "),
2927
- children: [
2928
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-none", children: d.getDate() }),
2929
- dayEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-1 flex gap-0.5", children: dayEvents.slice(0, 3).map((ev, j) => /* @__PURE__ */ jsxRuntime.jsx(
2930
- "span",
2931
- {
2932
- title: ev.label,
2933
- className: "h-1 w-1 rounded-full",
2934
- style: { backgroundColor: ev.color ?? (isSelected ? "var(--color-accent-fg)" : "var(--color-accent)") }
2935
- },
2936
- j
2937
- )) })
2938
- ]
2939
- },
2940
- i
2941
- );
2942
- }) })
2943
- ] });
2944
- }
2945
2826
  var SIZE5 = {
2946
2827
  sm: { h: "h-control-sm", text: "text-xs", pad: "px-2.5" },
2947
2828
  md: { h: "h-control-md", text: "text-sm", pad: "px-3.5" },
@@ -2965,11 +2846,11 @@ function SegmentedControl({
2965
2846
  "aria-label": ariaLabel
2966
2847
  }) {
2967
2848
  const sz = SIZE5[size];
2968
- const groupId = React29.useId();
2969
- const errorId = React29.useId();
2849
+ const groupId = React28.useId();
2850
+ const errorId = React28.useId();
2970
2851
  const hasError = errorMessage != null;
2971
2852
  const isControlled = value !== void 0;
2972
- const [internal, setInternal] = React29.useState(defaultValue);
2853
+ const [internal, setInternal] = React28.useState(defaultValue);
2973
2854
  const current = isControlled ? value : internal;
2974
2855
  const handle = (v) => {
2975
2856
  if (!v) return;
@@ -3040,7 +2921,7 @@ function SegmentedControl({
3040
2921
  }
3041
2922
 
3042
2923
  // src/components/core/scheduler.utils.ts
3043
- var MONTHS2 = [
2924
+ var MONTHS = [
3044
2925
  "January",
3045
2926
  "February",
3046
2927
  "March",
@@ -3054,23 +2935,23 @@ var MONTHS2 = [
3054
2935
  "November",
3055
2936
  "December"
3056
2937
  ];
3057
- var MONTHS_SHORT = MONTHS2.map((m) => m.slice(0, 3));
3058
- var WEEKDAYS2 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
2938
+ var MONTHS_SHORT = MONTHS.map((m) => m.slice(0, 3));
2939
+ var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
3059
2940
  var toDate2 = (d) => d instanceof Date ? d : new Date(d);
3060
- var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
2941
+ var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
3061
2942
  var addDays = (d, n) => {
3062
2943
  const x = new Date(d);
3063
2944
  x.setDate(x.getDate() + n);
3064
2945
  return x;
3065
2946
  };
3066
- var addMonths2 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
3067
- var sameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
3068
- var isToday = (d) => sameDay2(d, /* @__PURE__ */ new Date());
2947
+ var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
2948
+ var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
2949
+ var isToday = (d) => sameDay(d, /* @__PURE__ */ new Date());
3069
2950
  var isSameMonth = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
3070
2951
  var startOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
3071
2952
  var endOfMonth = (d) => new Date(d.getFullYear(), d.getMonth() + 1, 0);
3072
2953
  var startOfWeek = (d, weekStartsOn) => {
3073
- const x = startOfDay2(d);
2954
+ const x = startOfDay(d);
3074
2955
  const diff = (x.getDay() - weekStartsOn + 7) % 7;
3075
2956
  return addDays(x, -diff);
3076
2957
  };
@@ -3090,12 +2971,12 @@ var weekRange = (cursor, weekStartsOn) => {
3090
2971
  const from = startOfWeek(cursor, weekStartsOn);
3091
2972
  return { from, to: addDays(from, 6) };
3092
2973
  };
3093
- var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) => WEEKDAYS2[(i + weekStartsOn) % 7]);
3094
- var monthYearLabel = (d) => `${MONTHS2[d.getMonth()]} ${d.getFullYear()}`;
2974
+ var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]);
2975
+ var monthYearLabel = (d) => `${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
3095
2976
  var weekLabel = (cursor, weekStartsOn) => {
3096
2977
  const from = startOfWeek(cursor, weekStartsOn);
3097
2978
  const to = addDays(from, 6);
3098
- const m = (d) => MONTHS2[d.getMonth()].slice(0, 3);
2979
+ const m = (d) => MONTHS[d.getMonth()].slice(0, 3);
3099
2980
  if (from.getMonth() === to.getMonth()) {
3100
2981
  return `${m(from)} ${from.getDate()} \u2013 ${to.getDate()}, ${to.getFullYear()}`;
3101
2982
  }
@@ -3129,22 +3010,22 @@ function Scheduler({
3129
3010
  style
3130
3011
  }) {
3131
3012
  const reduced = framerMotion.useReducedMotion();
3132
- const [view, setView] = React29.useState(defaultView);
3133
- const [cursor, setCursor] = React29.useState(() => defaultDate ?? /* @__PURE__ */ new Date());
3134
- const [loaded, setLoaded] = React29.useState([]);
3135
- const [loading, setLoading] = React29.useState(false);
3136
- const [error, setError] = React29.useState(null);
3137
- const [reloadKey, setReloadKey] = React29.useState(0);
3138
- const [dir, setDir] = React29.useState(0);
3139
- const cbRef = React29.useRef({ loadEvents, onError });
3013
+ const [view, setView] = React28.useState(defaultView);
3014
+ const [cursor, setCursor] = React28.useState(() => defaultDate ?? /* @__PURE__ */ new Date());
3015
+ const [loaded, setLoaded] = React28.useState([]);
3016
+ const [loading, setLoading] = React28.useState(false);
3017
+ const [error, setError] = React28.useState(null);
3018
+ const [reloadKey, setReloadKey] = React28.useState(0);
3019
+ const [dir, setDir] = React28.useState(0);
3020
+ const cbRef = React28.useRef({ loadEvents, onError });
3140
3021
  cbRef.current = { loadEvents, onError };
3141
- const range = React29.useMemo(
3022
+ const range = React28.useMemo(
3142
3023
  () => view === "month" ? monthRange(cursor) : weekRange(cursor, weekStartsOn),
3143
3024
  [view, cursor, weekStartsOn]
3144
3025
  );
3145
3026
  const fromKey = range.from.getTime();
3146
3027
  const toKey = range.to.getTime();
3147
- React29.useEffect(() => {
3028
+ React28.useEffect(() => {
3148
3029
  const { loadEvents: loader, onError: onErr } = cbRef.current;
3149
3030
  if (!loader) return;
3150
3031
  let cancelled = false;
@@ -3164,16 +3045,16 @@ function Scheduler({
3164
3045
  cancelled = true;
3165
3046
  };
3166
3047
  }, [fromKey, toKey, view, reloadKey]);
3167
- const retry = React29.useCallback(() => setReloadKey((k) => k + 1), []);
3168
- const events = React29.useMemo(
3048
+ const retry = React28.useCallback(() => setReloadKey((k) => k + 1), []);
3049
+ const events = React28.useMemo(
3169
3050
  () => (controlledEvents ?? loaded).map(normalize),
3170
3051
  [controlledEvents, loaded]
3171
3052
  );
3172
- const go = React29.useCallback((delta) => {
3053
+ const go = React28.useCallback((delta) => {
3173
3054
  setDir(delta);
3174
- setCursor((c) => view === "month" ? addMonths2(c, delta) : addDays(c, delta * 7));
3055
+ setCursor((c) => view === "month" ? addMonths(c, delta) : addDays(c, delta * 7));
3175
3056
  }, [view]);
3176
- const goToday = React29.useCallback(() => {
3057
+ const goToday = React28.useCallback(() => {
3177
3058
  setDir(0);
3178
3059
  setCursor(/* @__PURE__ */ new Date());
3179
3060
  }, []);
@@ -3283,9 +3164,9 @@ function SchedulerError({ onRetry }) {
3283
3164
  ] });
3284
3165
  }
3285
3166
  function MonthYearPicker({ label, cursor, onPick }) {
3286
- const [open, setOpen] = React29.useState(false);
3287
- const [viewYear, setViewYear] = React29.useState(cursor.getFullYear());
3288
- React29.useEffect(() => {
3167
+ const [open, setOpen] = React28.useState(false);
3168
+ const [viewYear, setViewYear] = React28.useState(cursor.getFullYear());
3169
+ React28.useEffect(() => {
3289
3170
  if (open) setViewYear(cursor.getFullYear());
3290
3171
  }, [open, cursor]);
3291
3172
  return /* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { open, onOpenChange: setOpen, children: [
@@ -3348,13 +3229,13 @@ function MonthView({
3348
3229
  onSelectSlot,
3349
3230
  onSelectEvent
3350
3231
  }) {
3351
- const grid = React29.useMemo(() => buildMonthGrid(cursor, weekStartsOn), [cursor, weekStartsOn]);
3232
+ const grid = React28.useMemo(() => buildMonthGrid(cursor, weekStartsOn), [cursor, weekStartsOn]);
3352
3233
  const labels = weekdayLabels(weekStartsOn);
3353
3234
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col", children: [
3354
3235
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 border-b border-border", children: labels.map((l) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted", children: l }, l)) }),
3355
3236
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid flex-1 grid-cols-7 grid-rows-6", children: grid.map((day, i) => {
3356
3237
  const inMonth = isSameMonth(day, cursor);
3357
- const dayEvents = events.filter((e) => sameDay2(e.start, day));
3238
+ const dayEvents = events.filter((e) => sameDay(e.start, day));
3358
3239
  const today = isToday(day);
3359
3240
  return /* @__PURE__ */ jsxRuntime.jsxs(
3360
3241
  "button",
@@ -3422,11 +3303,11 @@ function WeekView({
3422
3303
  onSelectSlot,
3423
3304
  onSelectEvent
3424
3305
  }) {
3425
- const days = React29.useMemo(() => getWeekDays(cursor, weekStartsOn), [cursor, weekStartsOn]);
3426
- const labels = React29.useMemo(() => weekdayLabels(weekStartsOn), [weekStartsOn]);
3306
+ const days = React28.useMemo(() => getWeekDays(cursor, weekStartsOn), [cursor, weekStartsOn]);
3307
+ const labels = React28.useMemo(() => weekdayLabels(weekStartsOn), [weekStartsOn]);
3427
3308
  const dow = (d) => labels[(d.getDay() - weekStartsOn + 7) % 7];
3428
3309
  const [startHour, endHour] = dayHours;
3429
- const hours = React29.useMemo(
3310
+ const hours = React28.useMemo(
3430
3311
  () => Array.from({ length: endHour - startHour }, (_, i) => startHour + i),
3431
3312
  [startHour, endHour]
3432
3313
  );
@@ -3443,7 +3324,7 @@ function WeekView({
3443
3324
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid", style: { gridTemplateColumns: `3.5rem repeat(7, 1fr)`, height: gridHeight }, children: [
3444
3325
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-r border-border", children: hours.map((h, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-1 -translate-y-1/2 text-[10px] tabular-nums text-foreground-muted", style: { top: i * hourHeight }, children: i === 0 ? "" : hourLabel(h) }, h)) }),
3445
3326
  days.map((day) => {
3446
- const dayEvents = events.filter((e) => sameDay2(e.start, day) && !e.allDay);
3327
+ const dayEvents = events.filter((e) => sameDay(e.start, day) && !e.allDay);
3447
3328
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative border-r border-border last:border-r-0", children: [
3448
3329
  hours.map((h, i) => /* @__PURE__ */ jsxRuntime.jsx(
3449
3330
  "button",
@@ -3617,17 +3498,17 @@ function Cart({
3617
3498
  ] })
3618
3499
  ] });
3619
3500
  }
3620
- var CartContext = React29.createContext(null);
3501
+ var CartContext = React28.createContext(null);
3621
3502
  var clampQty = (qty, max) => {
3622
3503
  const lower = Math.max(1, Math.round(qty));
3623
3504
  return max != null ? Math.min(lower, max) : lower;
3624
3505
  };
3625
3506
  function CartProvider({ children, initialItems = [], onChange }) {
3626
- const [items, setItems] = React29.useState(initialItems);
3627
- React29.useEffect(() => {
3507
+ const [items, setItems] = React28.useState(initialItems);
3508
+ React28.useEffect(() => {
3628
3509
  onChange?.(items);
3629
3510
  }, [items]);
3630
- const addToCart = React29.useCallback((item, quantity) => {
3511
+ const addToCart = React28.useCallback((item, quantity) => {
3631
3512
  const addQty = quantity ?? item.quantity ?? 1;
3632
3513
  setItems((prev) => {
3633
3514
  const existing = prev.find((it) => it.id === item.id);
@@ -3640,29 +3521,29 @@ function CartProvider({ children, initialItems = [], onChange }) {
3640
3521
  return [...prev, { ...rest, quantity: clampQty(addQty, item.max) }];
3641
3522
  });
3642
3523
  }, []);
3643
- const removeFromCart = React29.useCallback((id) => {
3524
+ const removeFromCart = React28.useCallback((id) => {
3644
3525
  setItems((prev) => prev.filter((it) => it.id !== id));
3645
3526
  }, []);
3646
- const updateQuantity = React29.useCallback((id, quantity) => {
3527
+ const updateQuantity = React28.useCallback((id, quantity) => {
3647
3528
  setItems(
3648
3529
  (prev) => prev.map((it) => it.id === id ? { ...it, quantity: clampQty(quantity, it.max) } : it)
3649
3530
  );
3650
3531
  }, []);
3651
- const clearCart = React29.useCallback(() => setItems([]), []);
3652
- const isInCart = React29.useCallback((id) => items.some((it) => it.id === id), [items]);
3653
- const getItemCount = React29.useCallback(() => items.reduce((sum, it) => sum + it.quantity, 0), [items]);
3654
- const getCartTotal = React29.useCallback(
3532
+ const clearCart = React28.useCallback(() => setItems([]), []);
3533
+ const isInCart = React28.useCallback((id) => items.some((it) => it.id === id), [items]);
3534
+ const getItemCount = React28.useCallback(() => items.reduce((sum, it) => sum + it.quantity, 0), [items]);
3535
+ const getCartTotal = React28.useCallback(
3655
3536
  () => items.reduce((sum, it) => sum + it.price * it.quantity, 0),
3656
3537
  [items]
3657
3538
  );
3658
- const value = React29.useMemo(
3539
+ const value = React28.useMemo(
3659
3540
  () => ({ items, addToCart, removeFromCart, updateQuantity, clearCart, isInCart, getItemCount, getCartTotal }),
3660
3541
  [items, addToCart, removeFromCart, updateQuantity, clearCart, isInCart, getItemCount, getCartTotal]
3661
3542
  );
3662
3543
  return /* @__PURE__ */ jsxRuntime.jsx(CartContext.Provider, { value, children });
3663
3544
  }
3664
3545
  function useCart() {
3665
- const ctx = React29.useContext(CartContext);
3546
+ const ctx = React28.useContext(CartContext);
3666
3547
  if (!ctx) {
3667
3548
  throw new Error("useCart must be used within a <CartProvider>.");
3668
3549
  }
@@ -3996,11 +3877,11 @@ function buildBindings(store, name, kind, snap) {
3996
3877
 
3997
3878
  // src/form/useForm.ts
3998
3879
  function useForm(options = {}) {
3999
- const ref = React29.useRef(null);
3880
+ const ref = React28.useRef(null);
4000
3881
  if (ref.current === null) ref.current = new FormStore(options);
4001
3882
  const store = ref.current;
4002
- React29.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
4003
- const make = React29.useCallback(
3883
+ React28.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
3884
+ const make = React28.useCallback(
4004
3885
  (kind) => (name, rules) => {
4005
3886
  if (rules !== void 0) store.setRule(name, rules);
4006
3887
  return buildBindings(store, name, kind, store.getFieldSnapshot(name));
@@ -4029,9 +3910,9 @@ function useForm(options = {}) {
4029
3910
  fieldTarget: make("target")
4030
3911
  };
4031
3912
  }
4032
- var FormContext = React29.createContext(null);
3913
+ var FormContext = React28.createContext(null);
4033
3914
  function useFormStore() {
4034
- const store = React29.useContext(FormContext);
3915
+ const store = React28.useContext(FormContext);
4035
3916
  if (!store) {
4036
3917
  throw new Error("useFormStore must be used within a <Form>. Did you forget to wrap your fields?");
4037
3918
  }
@@ -4045,8 +3926,8 @@ function Form({
4045
3926
  children,
4046
3927
  ...rest
4047
3928
  }) {
4048
- const ref = React29.useRef(null);
4049
- const bypass = React29.useRef(false);
3929
+ const ref = React28.useRef(null);
3930
+ const bypass = React28.useRef(false);
4050
3931
  const handleSubmit = async (e) => {
4051
3932
  if (bypass.current) {
4052
3933
  bypass.current = false;
@@ -4098,12 +3979,12 @@ function useFormField(name, options = {}) {
4098
3979
  const store = useFormStore();
4099
3980
  const { kind = "value", rules } = options;
4100
3981
  if (rules !== void 0 && store.getRule(name) !== rules) store.setRule(name, rules);
4101
- React29.useEffect(() => {
3982
+ React28.useEffect(() => {
4102
3983
  return () => {
4103
3984
  if (rules !== void 0) store.removeRule(name);
4104
3985
  };
4105
3986
  }, [store, name]);
4106
- const snap = React29.useSyncExternalStore(
3987
+ const snap = React28.useSyncExternalStore(
4107
3988
  store.subscribe,
4108
3989
  () => store.getFieldSnapshot(name)
4109
3990
  );
@@ -4115,7 +3996,7 @@ function FormField({ name, kind, rules, children }) {
4115
3996
  }
4116
3997
  function useFieldArray(name) {
4117
3998
  const store = useFormStore();
4118
- React29.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
3999
+ React28.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
4119
4000
  const arr = store.getValue(name) ?? [];
4120
4001
  const keys = store.getKeys(name);
4121
4002
  return {
@@ -4148,7 +4029,7 @@ function TextInput({
4148
4029
  suffix,
4149
4030
  id
4150
4031
  }) {
4151
- const errorId = React29.useId();
4032
+ const errorId = React28.useId();
4152
4033
  const hasError = errorMessage != null;
4153
4034
  const hasAdornment = prefix != null || suffix != null;
4154
4035
  const inputId = htmlFor ?? id;
@@ -4309,7 +4190,7 @@ function CreditCardForm({
4309
4190
  className = "",
4310
4191
  style
4311
4192
  }) {
4312
- const initial = React29.useRef({
4193
+ const initial = React28.useRef({
4313
4194
  number: formatCardNumber(defaultValue?.number ?? ""),
4314
4195
  name: defaultValue?.name ?? "",
4315
4196
  expiry: formatExpiry(defaultValue?.expiry ?? ""),
@@ -4318,7 +4199,7 @@ function CreditCardForm({
4318
4199
  const form = useForm({ initialValues: initial });
4319
4200
  const numberStr = String(form.values.number ?? "");
4320
4201
  const brand = detectBrand(numberStr);
4321
- React29.useEffect(() => {
4202
+ React28.useEffect(() => {
4322
4203
  onChange?.(toCard(form.values));
4323
4204
  }, [form.values.number, form.values.name, form.values.expiry, form.values.cvv]);
4324
4205
  const numberBind = form.fieldNative("number", {
@@ -4441,7 +4322,7 @@ function Checkout({
4441
4322
  ] })
4442
4323
  ] });
4443
4324
  }
4444
- var NotificationContext = React29.createContext({
4325
+ var NotificationContext = React28.createContext({
4445
4326
  open: () => void 0,
4446
4327
  close: () => void 0
4447
4328
  });
@@ -4499,26 +4380,26 @@ function NotificationItem({
4499
4380
  onClose,
4500
4381
  reduced
4501
4382
  }) {
4502
- const [paused, setPaused] = React29.useState(false);
4383
+ const [paused, setPaused] = React28.useState(false);
4503
4384
  const duration = n.duration ?? 4e3;
4504
4385
  const isAutoDismissing = isFinite(duration) && duration > 0;
4505
4386
  const showProgress = !reduced && isAutoDismissing;
4506
- const timerRef = React29.useRef(null);
4507
- const startTimeRef = React29.useRef(0);
4508
- const remainingRef = React29.useRef(duration);
4509
- const clearTimer = React29.useCallback(() => {
4387
+ const timerRef = React28.useRef(null);
4388
+ const startTimeRef = React28.useRef(0);
4389
+ const remainingRef = React28.useRef(duration);
4390
+ const clearTimer = React28.useCallback(() => {
4510
4391
  if (timerRef.current !== null) {
4511
4392
  clearTimeout(timerRef.current);
4512
4393
  timerRef.current = null;
4513
4394
  }
4514
4395
  }, []);
4515
- const scheduleDismiss = React29.useCallback((ms) => {
4396
+ const scheduleDismiss = React28.useCallback((ms) => {
4516
4397
  clearTimer();
4517
4398
  if (!isAutoDismissing) return;
4518
4399
  startTimeRef.current = Date.now();
4519
4400
  timerRef.current = setTimeout(() => onClose(n.id), ms);
4520
4401
  }, [clearTimer, isAutoDismissing, n.id, onClose]);
4521
- React29.useEffect(() => {
4402
+ React28.useEffect(() => {
4522
4403
  if (paused || !isAutoDismissing) return;
4523
4404
  scheduleDismiss(remainingRef.current);
4524
4405
  return clearTimer;
@@ -4601,15 +4482,15 @@ function NotificationProvider({
4601
4482
  children,
4602
4483
  position = "top-right"
4603
4484
  }) {
4604
- const [notifications, setNotifications] = React29.useState([]);
4485
+ const [notifications, setNotifications] = React28.useState([]);
4605
4486
  const reduced = framerMotion.useReducedMotion();
4606
- const open = React29.useCallback((payload) => {
4487
+ const open = React28.useCallback((payload) => {
4607
4488
  setNotifications((prev) => [
4608
4489
  ...prev,
4609
4490
  { duration: 4e3, ...payload, id: Date.now() + Math.random() }
4610
4491
  ]);
4611
4492
  }, []);
4612
- const close = React29.useCallback((id) => {
4493
+ const close = React28.useCallback((id) => {
4613
4494
  setNotifications((prev) => prev.filter((n) => n.id !== id));
4614
4495
  }, []);
4615
4496
  return /* @__PURE__ */ jsxRuntime.jsxs(NotificationContext.Provider, { value: { open, close }, children: [
@@ -4638,7 +4519,7 @@ function NotificationProvider({
4638
4519
  ] });
4639
4520
  }
4640
4521
  function useNotification() {
4641
- const { open } = React29.useContext(NotificationContext);
4522
+ const { open } = React28.useContext(NotificationContext);
4642
4523
  return {
4643
4524
  info: (props) => open({ type: "info", ...props }),
4644
4525
  success: (props) => open({ type: "success", ...props }),
@@ -4755,10 +4636,10 @@ function FadingBase({
4755
4636
  isMounted = false,
4756
4637
  children
4757
4638
  }) {
4758
- const [shouldRender, setShouldRender] = React29.useState(isMounted);
4759
- const [visible, setVisible] = React29.useState(false);
4760
- const timerRef = React29.useRef(null);
4761
- React29.useEffect(() => {
4639
+ const [shouldRender, setShouldRender] = React28.useState(isMounted);
4640
+ const [visible, setVisible] = React28.useState(false);
4641
+ const timerRef = React28.useRef(null);
4642
+ React28.useEffect(() => {
4762
4643
  if (isMounted) {
4763
4644
  setShouldRender(true);
4764
4645
  const rafId = requestAnimationFrame(() => setVisible(true));
@@ -4856,8 +4737,8 @@ function ScalableContainer({
4856
4737
  togglePosition = "top-right",
4857
4738
  className = ""
4858
4739
  }) {
4859
- const containerRef = React29.useRef(null);
4860
- const [internalScaled, setInternalScaled] = React29.useState(false);
4740
+ const containerRef = React28.useRef(null);
4741
+ const [internalScaled, setInternalScaled] = React28.useState(false);
4861
4742
  const isScaled = expanded ?? internalScaled;
4862
4743
  const reduced = framerMotion.useReducedMotion();
4863
4744
  const onToggle = () => {
@@ -4995,17 +4876,17 @@ function CatalogGrid({ items, buttonText, onOpen, className = "" }) {
4995
4876
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex flex-wrap gap-2 ${className}`.trim(), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(GridCard, { item, buttonText, onOpen }, item.key)) });
4996
4877
  }
4997
4878
  function CatalogCarousel({ items, buttonText, onOpen, className = "" }) {
4998
- const [activeIndex, setActiveIndex] = React29.useState(0);
4999
- const [indexPool, setIndexPool] = React29.useState([]);
5000
- const cardRefs = React29.useRef([]);
5001
- const getIndexes = React29.useMemo(() => {
4879
+ const [activeIndex, setActiveIndex] = React28.useState(0);
4880
+ const [indexPool, setIndexPool] = React28.useState([]);
4881
+ const cardRefs = React28.useRef([]);
4882
+ const getIndexes = React28.useMemo(() => {
5002
4883
  let nextIndex = activeIndex + 1;
5003
4884
  let previousIndex = activeIndex - 1;
5004
4885
  if (activeIndex === 0) previousIndex = items.length - 1;
5005
4886
  if (activeIndex === items.length - 1) nextIndex = 0;
5006
4887
  return { previousIndex, nextIndex };
5007
4888
  }, [activeIndex, items.length]);
5008
- React29.useEffect(() => {
4889
+ React28.useEffect(() => {
5009
4890
  const { nextIndex, previousIndex } = getIndexes;
5010
4891
  let indexes = [previousIndex, activeIndex, nextIndex];
5011
4892
  if (activeIndex !== 0 && activeIndex !== items.length - 1) {
@@ -5178,8 +5059,8 @@ function writeDismissed(key) {
5178
5059
  }
5179
5060
  }
5180
5061
  function useTargetBbox(ref) {
5181
- const [bbox, setBbox] = React29.useState(null);
5182
- React29.useLayoutEffect(() => {
5062
+ const [bbox, setBbox] = React28.useState(null);
5063
+ React28.useLayoutEffect(() => {
5183
5064
  const el = ref?.current;
5184
5065
  if (!el) {
5185
5066
  setBbox(null);
@@ -5209,7 +5090,7 @@ function tooltipStyleFor(bbox, placement) {
5209
5090
  return { left: bbox.left + bbox.width / 2, top: bbox.top - TOOLTIP_GAP, transform: "translate(-50%, -100%)", width: TOOLTIP_WIDTH };
5210
5091
  }
5211
5092
  function useFocusTrap(containerRef, active) {
5212
- React29.useEffect(() => {
5093
+ React28.useEffect(() => {
5213
5094
  if (!active) return;
5214
5095
  const el = containerRef.current;
5215
5096
  if (!el) return;
@@ -5248,16 +5129,16 @@ function Wizard({
5248
5129
  onComplete,
5249
5130
  onSkip
5250
5131
  }) {
5251
- const tooltipRef = React29.useRef(null);
5252
- const tooltipTitleId = React29.useId();
5253
- const tooltipBodyId = React29.useId();
5132
+ const tooltipRef = React28.useRef(null);
5133
+ const tooltipTitleId = React28.useId();
5134
+ const tooltipBodyId = React28.useId();
5254
5135
  const reduced = framerMotion.useReducedMotion();
5255
- const [open, setOpen] = React29.useState(() => steps.length > 0 && !readDismissed(storageKey));
5256
- const [activeIndex, setActiveIndex] = React29.useState(0);
5136
+ const [open, setOpen] = React28.useState(() => steps.length > 0 && !readDismissed(storageKey));
5137
+ const [activeIndex, setActiveIndex] = React28.useState(0);
5257
5138
  const step = steps[activeIndex];
5258
5139
  const bbox = useTargetBbox(step?.stepRef);
5259
5140
  useFocusTrap(tooltipRef, open);
5260
- React29.useEffect(() => {
5141
+ React28.useEffect(() => {
5261
5142
  if (!open || !dismissible) return;
5262
5143
  const onKey = (e) => {
5263
5144
  if (e.key === "Escape") {
@@ -5268,12 +5149,12 @@ function Wizard({
5268
5149
  document.addEventListener("keydown", onKey);
5269
5150
  return () => document.removeEventListener("keydown", onKey);
5270
5151
  }, [open, dismissible]);
5271
- const handleSkip = React29.useCallback(() => {
5152
+ const handleSkip = React28.useCallback(() => {
5272
5153
  writeDismissed(storageKey);
5273
5154
  setOpen(false);
5274
5155
  onSkip?.();
5275
5156
  }, [storageKey, onSkip]);
5276
- const handleComplete = React29.useCallback(() => {
5157
+ const handleComplete = React28.useCallback(() => {
5277
5158
  writeDismissed(storageKey);
5278
5159
  setOpen(false);
5279
5160
  onComplete?.();
@@ -5416,7 +5297,7 @@ function Wizard({
5416
5297
  ] });
5417
5298
  }
5418
5299
  var SearchIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
5419
- var SearchInput = React29__default.default.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
5300
+ var SearchInput = React28__default.default.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
5420
5301
  return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsxs(
5421
5302
  "div",
5422
5303
  {
@@ -5600,7 +5481,7 @@ function TableBody({
5600
5481
  expandRow,
5601
5482
  getRowKey
5602
5483
  }) {
5603
- const [expanded, setExpanded] = React29.useState(() => /* @__PURE__ */ new Set());
5484
+ const [expanded, setExpanded] = React28.useState(() => /* @__PURE__ */ new Set());
5604
5485
  const reduced = framerMotion.useReducedMotion();
5605
5486
  const toggleRow = (rowKey) => {
5606
5487
  setExpanded((prev) => {
@@ -5615,7 +5496,7 @@ function TableBody({
5615
5496
  return /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((row, i) => {
5616
5497
  const rowKey = getRowKey(row, i);
5617
5498
  const isExpanded = expanded.has(rowKey);
5618
- return /* @__PURE__ */ jsxRuntime.jsxs(React29__default.default.Fragment, { children: [
5499
+ return /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
5619
5500
  /* @__PURE__ */ jsxRuntime.jsxs(
5620
5501
  "tr",
5621
5502
  {
@@ -5671,9 +5552,9 @@ function Pagination({
5671
5552
  const matchedOption = picker.find(
5672
5553
  (o) => o.label === options.perPage || o.value === options.perPage
5673
5554
  );
5674
- const [perPageKey, setPerPageKey] = React29.useState(() => matchedOption?.key ?? picker[0]?.key);
5555
+ const [perPageKey, setPerPageKey] = React28.useState(() => matchedOption?.key ?? picker[0]?.key);
5675
5556
  const displayPerPageKey = serverSide ? matchedOption?.key ?? perPageKey : perPageKey;
5676
- React29.useEffect(() => {
5557
+ React28.useEffect(() => {
5677
5558
  if (serverSide && options.perPage != null) {
5678
5559
  const next = picker.find((o) => o.label === options.perPage || o.value === options.perPage);
5679
5560
  if (next) setPerPageKey(next.key);
@@ -5681,9 +5562,10 @@ function Pagination({
5681
5562
  }, [serverSide, options.perPage, picker]);
5682
5563
  const currentOpt = picker.find((o) => o.key === displayPerPageKey);
5683
5564
  const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? options.perPage ?? "";
5684
- const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsxRuntime.jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: "w-7 !px-0 focus-visible:!ring-offset-0", "aria-label": title, title });
5685
- const chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
5686
- const doubleChevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
5565
+ const FOCUS = "focus-visible:!ring-0 focus-visible:!border-accent";
5566
+ const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsxRuntime.jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: `w-7 !px-0 ${FOCUS}`, "aria-label": title, title });
5567
+ const chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" }) });
5568
+ const doubleChevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l6 6-6 6M12 6l6 6-6 6" }) });
5687
5569
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
5688
5570
  options.withPicker && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
5689
5571
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
@@ -5693,7 +5575,7 @@ function Pagination({
5693
5575
  variant: "outline",
5694
5576
  size: "sm",
5695
5577
  side: "top",
5696
- className: "focus-visible:!ring-offset-0",
5578
+ className: FOCUS,
5697
5579
  label: String(currentPerPageLabel),
5698
5580
  items: picker.map((o) => ({
5699
5581
  key: o.key,
@@ -5709,7 +5591,7 @@ function Pagination({
5709
5591
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5710
5592
  navBtn(/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex rotate-180", children: doubleChevronRight }), activePage === 0, () => onPageChange(0), "First page"),
5711
5593
  navBtn(/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex rotate-180", children: chevronRight }), activePage === 0, () => activePage > 0 && onPageChange(activePage - 1), "Previous page"),
5712
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-2 text-sm tabular-nums text-foreground-secondary select-none", children: [
5594
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-2 text-xs tabular-nums text-foreground-secondary select-none", children: [
5713
5595
  activePage + 1,
5714
5596
  " ",
5715
5597
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-foreground-muted", children: [
@@ -5736,14 +5618,14 @@ function Table({
5736
5618
  className = "",
5737
5619
  style
5738
5620
  }) {
5739
- const searchRef = React29.useRef(null);
5740
- const [searchTerm, setSearchTerm] = React29.useState("");
5741
- const [perPage, setPerPage] = React29.useState(
5621
+ const searchRef = React28.useRef(null);
5622
+ const [searchTerm, setSearchTerm] = React28.useState("");
5623
+ const [perPage, setPerPage] = React28.useState(
5742
5624
  typeof pagination.perPage === "number" ? pagination.perPage : 15
5743
5625
  );
5744
- const [activePage, setActivePage] = React29.useState(0);
5626
+ const [activePage, setActivePage] = React28.useState(0);
5745
5627
  const isServerSide = !!(pagination.enabled && pagination.serverSide);
5746
- const filteredRows = React29.useMemo(() => {
5628
+ const filteredRows = React28.useMemo(() => {
5747
5629
  if (isServerSide || !searchTerm) return rows;
5748
5630
  const term = searchTerm.toLowerCase();
5749
5631
  return rows.filter(
@@ -5752,29 +5634,29 @@ function Table({
5752
5634
  )
5753
5635
  );
5754
5636
  }, [rows, searchTerm, isServerSide]);
5755
- const datasets = React29.useMemo(() => {
5637
+ const datasets = React28.useMemo(() => {
5756
5638
  if (isServerSide) return [rows];
5757
5639
  return createDatasets(filteredRows, pagination.enabled ? perPage : null);
5758
5640
  }, [filteredRows, perPage, pagination.enabled, isServerSide, rows]);
5759
- const MAX_PAGE = React29.useMemo(() => {
5641
+ const MAX_PAGE = React28.useMemo(() => {
5760
5642
  if (isServerSide && typeof pagination.maxPage === "number") return Math.max(0, pagination.maxPage);
5761
5643
  if (isServerSide && typeof pagination.totalCount === "number")
5762
5644
  return Math.max(0, Math.ceil(pagination.totalCount / perPage) - 1);
5763
5645
  return datasets.length ? datasets.length - 1 : 0;
5764
5646
  }, [isServerSide, pagination.maxPage, pagination.totalCount, perPage, datasets.length]);
5765
- const currentPageRows = React29.useMemo(() => {
5647
+ const currentPageRows = React28.useMemo(() => {
5766
5648
  if (isServerSide) return rows;
5767
5649
  return datasets[activePage] ?? [];
5768
5650
  }, [isServerSide, rows, datasets, activePage]);
5769
- React29.useEffect(() => {
5651
+ React28.useEffect(() => {
5770
5652
  if (pagination.enabled && !isServerSide && typeof pagination.perPage === "number") {
5771
5653
  setPerPage(pagination.perPage);
5772
5654
  }
5773
5655
  }, [pagination.enabled, pagination.perPage, isServerSide]);
5774
- React29.useEffect(() => {
5656
+ React28.useEffect(() => {
5775
5657
  if (isServerSide && typeof pagination.perPage === "number") setPerPage(pagination.perPage);
5776
5658
  }, [isServerSide, pagination.perPage]);
5777
- React29.useEffect(() => {
5659
+ React28.useEffect(() => {
5778
5660
  if (isServerSide && typeof pagination.page === "number" && pagination.page >= 1)
5779
5661
  setActivePage(pagination.page - 1);
5780
5662
  }, [isServerSide, pagination.page]);
@@ -5858,7 +5740,7 @@ function TableSkeletonBody({
5858
5740
  )) });
5859
5741
  }
5860
5742
  function ThemeSwitch({ checked, onChange, label = "Toggle dark mode", className = "" }) {
5861
- const id = React29.useId();
5743
+ const id = React28.useId();
5862
5744
  return /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: `flex items-center gap-2 cursor-pointer select-none ${className}`.trim(), children: /* @__PURE__ */ jsxRuntime.jsx(
5863
5745
  SwitchPrimitive__namespace.Root,
5864
5746
  {
@@ -6042,7 +5924,7 @@ function Sidebar({
6042
5924
  }
6043
5925
  ) });
6044
5926
  }
6045
- var MegaMenuContext = React29.createContext({ align: "start" });
5927
+ var MegaMenuContext = React28.createContext({ align: "start" });
6046
5928
  function MegaMenu({
6047
5929
  children,
6048
5930
  align = "start",
@@ -6073,7 +5955,7 @@ function MegaMenu({
6073
5955
  }
6074
5956
  var TOP_ITEM = "group/top inline-flex items-center gap-1.5 h-10 px-3 rounded-md text-sm font-medium select-none text-foreground-secondary hover:text-foreground hover:bg-surface-raised data-[state=open]:text-accent data-[active]:text-accent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent";
6075
5957
  function MegaMenuItem({ label, icon, href, children, className = "" }) {
6076
- const { align } = React29.useContext(MegaMenuContext);
5958
+ const { align } = React28.useContext(MegaMenuContext);
6077
5959
  const pos = align === "center" ? "left-1/2 -translate-x-1/2" : align === "end" ? "right-0" : "left-0";
6078
5960
  if (!children) {
6079
5961
  return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu__namespace.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu__namespace.Link, { href, className: [TOP_ITEM, className].filter(Boolean).join(" "), children: [
@@ -6158,8 +6040,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
6158
6040
  function MegaMenuFeatured({ children, className = "" }) {
6159
6041
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
6160
6042
  }
6161
- var elementsOfType = (children, type) => React29__default.default.Children.toArray(children).filter(
6162
- (c) => React29__default.default.isValidElement(c) && c.type === type
6043
+ var elementsOfType = (children, type) => React28__default.default.Children.toArray(children).filter(
6044
+ (c) => React28__default.default.isValidElement(c) && c.type === type
6163
6045
  );
6164
6046
  var MOBILE_CHEVRON = /* @__PURE__ */ jsxRuntime.jsx(
6165
6047
  "svg",
@@ -6196,9 +6078,9 @@ function MobileLinkRow({ link, onNavigate }) {
6196
6078
  );
6197
6079
  }
6198
6080
  function MobilePanel({ panel, onNavigate }) {
6199
- const nodes = React29__default.default.Children.toArray(panel.props.children);
6081
+ const nodes = React28__default.default.Children.toArray(panel.props.children);
6200
6082
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
6201
- if (!React29__default.default.isValidElement(node)) return null;
6083
+ if (!React28__default.default.isValidElement(node)) return null;
6202
6084
  const el = node;
6203
6085
  if (el.type === MegaMenuSection) {
6204
6086
  const { title, children } = el.props;
@@ -6217,8 +6099,8 @@ function MegaMenuMobile({
6217
6099
  children,
6218
6100
  label
6219
6101
  }) {
6220
- const [open, setOpen] = React29.useState(false);
6221
- const [expanded, setExpanded] = React29.useState(null);
6102
+ const [open, setOpen] = React28.useState(false);
6103
+ const [expanded, setExpanded] = React28.useState(null);
6222
6104
  const items = elementsOfType(children, MegaMenuItem);
6223
6105
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden w-full", children: [
6224
6106
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6291,17 +6173,17 @@ function AppShell({
6291
6173
  children,
6292
6174
  className = ""
6293
6175
  }) {
6294
- const [expanded, setExpanded] = React29.useState(sidebarDefaultExpanded);
6295
- const [isMobile, setIsMobile] = React29.useState(false);
6296
- const [mobileOpen, setMobileOpen] = React29.useState(false);
6297
- React29.useEffect(() => {
6176
+ const [expanded, setExpanded] = React28.useState(sidebarDefaultExpanded);
6177
+ const [isMobile, setIsMobile] = React28.useState(false);
6178
+ const [mobileOpen, setMobileOpen] = React28.useState(false);
6179
+ React28.useEffect(() => {
6298
6180
  const mq = window.matchMedia("(max-width: 767px)");
6299
6181
  const update = (e) => setIsMobile(e.matches);
6300
6182
  update(mq);
6301
6183
  mq.addEventListener("change", update);
6302
6184
  return () => mq.removeEventListener("change", update);
6303
6185
  }, []);
6304
- React29.useEffect(() => {
6186
+ React28.useEffect(() => {
6305
6187
  if (!isMobile) setMobileOpen(false);
6306
6188
  }, [isMobile]);
6307
6189
  const hasSidebar = sidebarSections.length > 0;
@@ -6428,7 +6310,7 @@ function SecureLayout({
6428
6310
  className = ""
6429
6311
  }) {
6430
6312
  const reduced = framerMotion.useReducedMotion();
6431
- const cbs = React29.useRef({ canAccess, onGranted, onDeny });
6313
+ const cbs = React28.useRef({ canAccess, onGranted, onDeny });
6432
6314
  cbs.current = { canAccess, onGranted, onDeny };
6433
6315
  const rolesKey = JSON.stringify(roles);
6434
6316
  const requiredRolesKey = JSON.stringify(requiredRoles);
@@ -6443,10 +6325,10 @@ function SecureLayout({
6443
6325
  if (requiredPermissions?.length && !has(permissions, requiredPermissions, requireAllPermissions)) return false;
6444
6326
  return true;
6445
6327
  };
6446
- const [state, setState] = React29.useState(
6328
+ const [state, setState] = React28.useState(
6447
6329
  () => !passesSync() ? "denied" : canAccess ? "checking" : "granted"
6448
6330
  );
6449
- React29.useEffect(() => {
6331
+ React28.useEffect(() => {
6450
6332
  let cancelled = false;
6451
6333
  const { canAccess: check, onGranted: granted, onDeny: deny } = cbs.current;
6452
6334
  const finish = (ok) => {
@@ -6607,10 +6489,10 @@ function ThemeProvider({
6607
6489
  className = "",
6608
6490
  style
6609
6491
  }) {
6610
- const id = React29__default.default.useId().replace(/:/g, "");
6492
+ const id = React28__default.default.useId().replace(/:/g, "");
6611
6493
  const scopeClass = `geo-th-${id}`;
6612
- const divRef = React29.useRef(null);
6613
- React29.useEffect(() => {
6494
+ const divRef = React28.useRef(null);
6495
+ React28.useEffect(() => {
6614
6496
  const el = divRef.current;
6615
6497
  if (!el) return;
6616
6498
  if (colorScheme === "auto") return;
@@ -6625,8 +6507,8 @@ function ThemeProvider({
6625
6507
  }
6626
6508
  el.classList.toggle("dark", colorScheme === "dark");
6627
6509
  }, [colorScheme]);
6628
- const lightVars = React29.useMemo(() => toCssVars(theme), [theme]);
6629
- const darkVarStr = React29.useMemo(() => {
6510
+ const lightVars = React28.useMemo(() => toCssVars(theme), [theme]);
6511
+ const darkVarStr = React28.useMemo(() => {
6630
6512
  if (!darkTheme) return "";
6631
6513
  const dvars = toCssVars(darkTheme);
6632
6514
  if (!Object.keys(dvars).length) return "";
@@ -6668,7 +6550,7 @@ function NumberInput({
6668
6550
  readOnly = false,
6669
6551
  precision
6670
6552
  }) {
6671
- const errorId = React29.useId();
6553
+ const errorId = React28.useId();
6672
6554
  const hasError = errorMessage != null;
6673
6555
  const inferredPrecision = precision ?? (Number.isInteger(step) ? 0 : String(step).split(".")[1]?.length ?? 0);
6674
6556
  const round = (n) => {
@@ -6799,8 +6681,8 @@ function Password({
6799
6681
  showIcon,
6800
6682
  hideIcon
6801
6683
  }) {
6802
- const [visible, setVisible] = React29.useState(false);
6803
- const errorId = React29.useId();
6684
+ const [visible, setVisible] = React28.useState(false);
6685
+ const errorId = React28.useId();
6804
6686
  const hasError = errorMessage != null;
6805
6687
  return /* @__PURE__ */ jsxRuntime.jsx(
6806
6688
  Field,
@@ -6873,7 +6755,7 @@ function Checkbox({
6873
6755
  }) {
6874
6756
  const isChecked = checked ?? value ?? false;
6875
6757
  const labelFirst = labelPosition === "left";
6876
- const errorId = React29.useId();
6758
+ const errorId = React28.useId();
6877
6759
  const hasError = errorMessage != null;
6878
6760
  const box = /* @__PURE__ */ jsxRuntime.jsx(
6879
6761
  CheckboxPrimitive__namespace.Root,
@@ -6981,8 +6863,8 @@ function RadioGroup({
6981
6863
  className,
6982
6864
  errorMessage
6983
6865
  }) {
6984
- const errorId = React29.useId();
6985
- const groupId = React29.useId();
6866
+ const errorId = React28.useId();
6867
+ const groupId = React28.useId();
6986
6868
  const hasError = errorMessage != null;
6987
6869
  const labelFirst = labelPosition === "left";
6988
6870
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -7082,11 +6964,11 @@ function Switch({
7082
6964
  disabled,
7083
6965
  errorMessage
7084
6966
  }) {
7085
- const id = React29.useId();
7086
- const errorId = React29.useId();
6967
+ const id = React28.useId();
6968
+ const errorId = React28.useId();
7087
6969
  const hasError = errorMessage != null;
7088
6970
  const isControlled = checked !== void 0;
7089
- const [internal, setInternal] = React29.useState(defaultChecked);
6971
+ const [internal, setInternal] = React28.useState(defaultChecked);
7090
6972
  const isOn = isControlled ? checked : internal;
7091
6973
  const handle = (c) => {
7092
6974
  if (!isControlled) setInternal(c);
@@ -7162,11 +7044,11 @@ function MultiTagRow({
7162
7044
  labelFor,
7163
7045
  onRemove
7164
7046
  }) {
7165
- const wrapRef = React29.useRef(null);
7166
- const measureRef = React29.useRef(null);
7167
- const [visibleCount, setVisibleCount] = React29.useState(values.length);
7047
+ const wrapRef = React28.useRef(null);
7048
+ const measureRef = React28.useRef(null);
7049
+ const [visibleCount, setVisibleCount] = React28.useState(values.length);
7168
7050
  const key = values.map(String).join("|");
7169
- React29.useLayoutEffect(() => {
7051
+ React28.useLayoutEffect(() => {
7170
7052
  const wrap = wrapRef.current;
7171
7053
  const measure = measureRef.current;
7172
7054
  if (!wrap || !measure) return;
@@ -7260,16 +7142,16 @@ function Dropdown({
7260
7142
  size = "md",
7261
7143
  className = ""
7262
7144
  }) {
7263
- const [open, setOpen] = React29.useState(false);
7264
- const [selectedItems, setSelectedItems] = React29.useState([]);
7265
- const [searchTerm, setSearchTerm] = React29.useState("");
7266
- const [innerItems, setInnerItems] = React29.useState([]);
7267
- const errorId = React29.useId();
7145
+ const [open, setOpen] = React28.useState(false);
7146
+ const [selectedItems, setSelectedItems] = React28.useState([]);
7147
+ const [searchTerm, setSearchTerm] = React28.useState("");
7148
+ const [innerItems, setInnerItems] = React28.useState([]);
7149
+ const errorId = React28.useId();
7268
7150
  const hasError = errorMessage != null;
7269
- React29.useEffect(() => {
7151
+ React28.useEffect(() => {
7270
7152
  setInnerItems(items);
7271
7153
  }, [items]);
7272
- React29.useEffect(() => {
7154
+ React28.useEffect(() => {
7273
7155
  if (isMultiselect && Array.isArray(value)) {
7274
7156
  setSelectedItems(value);
7275
7157
  }
@@ -7461,19 +7343,19 @@ function AutoComplete({
7461
7343
  required,
7462
7344
  htmlFor
7463
7345
  }) {
7464
- const errorId = React29.useId();
7346
+ const errorId = React28.useId();
7465
7347
  const hasError = errorMessage != null;
7466
- const [term, setTerm] = React29.useState("");
7467
- const [open, setOpen] = React29.useState(false);
7468
- const [asyncItems, setAsyncItems] = React29.useState([]);
7469
- const [loading, setLoading] = React29.useState(false);
7348
+ const [term, setTerm] = React28.useState("");
7349
+ const [open, setOpen] = React28.useState(false);
7350
+ const [asyncItems, setAsyncItems] = React28.useState([]);
7351
+ const [loading, setLoading] = React28.useState(false);
7470
7352
  const isAsync = typeof onSearch === "function";
7471
- const debounceRef = React29.useRef(null);
7472
- const requestIdRef = React29.useRef(0);
7353
+ const debounceRef = React28.useRef(null);
7354
+ const requestIdRef = React28.useRef(0);
7473
7355
  const staticFiltered = isAsync || !items ? [] : term.trim() ? items.filter(
7474
7356
  ({ key, label: label2 }) => label2.toLowerCase().includes(term.toLowerCase()) || key.toLowerCase().includes(term.toLowerCase())
7475
7357
  ) : [];
7476
- React29.useEffect(() => {
7358
+ React28.useEffect(() => {
7477
7359
  if (!isAsync) return;
7478
7360
  if (debounceRef.current) clearTimeout(debounceRef.current);
7479
7361
  if (!term.trim()) {
@@ -7629,15 +7511,15 @@ function TreeSelect({
7629
7511
  defaultExpandedKeys = [],
7630
7512
  size = "md"
7631
7513
  }) {
7632
- const errorId = React29.useId();
7514
+ const errorId = React28.useId();
7633
7515
  const hasError = errorMessage != null;
7634
- const [open, setOpen] = React29.useState(false);
7635
- const [expanded, setExpanded] = React29.useState(() => new Set(defaultExpandedKeys));
7636
- const [activeIndex, setActiveIndex] = React29.useState(0);
7637
- const listRef = React29.useRef(null);
7638
- const visible = React29.useMemo(() => flattenVisible(items, expanded), [items, expanded]);
7639
- const didSyncOnOpenRef = React29.useRef(false);
7640
- React29.useEffect(() => {
7516
+ const [open, setOpen] = React28.useState(false);
7517
+ const [expanded, setExpanded] = React28.useState(() => new Set(defaultExpandedKeys));
7518
+ const [activeIndex, setActiveIndex] = React28.useState(0);
7519
+ const listRef = React28.useRef(null);
7520
+ const visible = React28.useMemo(() => flattenVisible(items, expanded), [items, expanded]);
7521
+ const didSyncOnOpenRef = React28.useRef(false);
7522
+ React28.useEffect(() => {
7641
7523
  if (!open) {
7642
7524
  didSyncOnOpenRef.current = false;
7643
7525
  return;
@@ -7647,7 +7529,7 @@ function TreeSelect({
7647
7529
  setActiveIndex(selectedIdx >= 0 ? selectedIdx : 0);
7648
7530
  didSyncOnOpenRef.current = true;
7649
7531
  }, [open, value]);
7650
- const selectedNode = React29.useMemo(
7532
+ const selectedNode = React28.useMemo(
7651
7533
  () => value != null ? findNodeByKey(items, value) : null,
7652
7534
  [items, value]
7653
7535
  );
@@ -7878,11 +7760,11 @@ function FileInput({
7878
7760
  required,
7879
7761
  icon
7880
7762
  }) {
7881
- const inputRef = React29.useRef(null);
7882
- const errorId = React29.useId();
7883
- const [files, setFiles] = React29.useState([]);
7884
- const [dragging, setDragging] = React29.useState(false);
7885
- const [sizeError, setSizeError] = React29.useState(null);
7763
+ const inputRef = React28.useRef(null);
7764
+ const errorId = React28.useId();
7765
+ const [files, setFiles] = React28.useState([]);
7766
+ const [dragging, setDragging] = React28.useState(false);
7767
+ const [sizeError, setSizeError] = React28.useState(null);
7886
7768
  const effectiveError = errorMessage ?? sizeError ?? void 0;
7887
7769
  const openPicker = () => {
7888
7770
  if (!disabled) inputRef.current?.click();
@@ -8028,7 +7910,7 @@ function addDays2(d, n) {
8028
7910
  c.setDate(c.getDate() + n);
8029
7911
  return c;
8030
7912
  }
8031
- function addMonths3(d, n) {
7913
+ function addMonths2(d, n) {
8032
7914
  const c = new Date(d);
8033
7915
  c.setMonth(c.getMonth() + n);
8034
7916
  return c;
@@ -8039,7 +7921,7 @@ function defaultFormat3(d) {
8039
7921
  const day = d.getDate().toString().padStart(2, "0");
8040
7922
  return `${y}-${m}-${day}`;
8041
7923
  }
8042
- function buildGrid2(viewMonth, weekStartsOn) {
7924
+ function buildGrid(viewMonth, weekStartsOn) {
8043
7925
  const first = startOfMonth2(viewMonth);
8044
7926
  const startOffset = (first.getDay() - weekStartsOn + 7) % 7;
8045
7927
  const gridStart = addDays2(first, -startOffset);
@@ -8073,30 +7955,30 @@ function DatePicker({
8073
7955
  size = "md",
8074
7956
  className = ""
8075
7957
  }) {
8076
- const errorId = React29.useId();
7958
+ const errorId = React28.useId();
8077
7959
  const hasError = errorMessage != null;
8078
- const [open, setOpen] = React29.useState(false);
8079
- const [viewMonth, setViewMonth] = React29.useState(() => startOfMonth2(value ?? /* @__PURE__ */ new Date()));
8080
- const [focusDate, setFocusDate] = React29.useState(() => value ?? /* @__PURE__ */ new Date());
8081
- const [view, setView] = React29.useState("days");
8082
- const gridRef = React29.useRef(null);
8083
- React29.useEffect(() => {
7960
+ const [open, setOpen] = React28.useState(false);
7961
+ const [viewMonth, setViewMonth] = React28.useState(() => startOfMonth2(value ?? /* @__PURE__ */ new Date()));
7962
+ const [focusDate, setFocusDate] = React28.useState(() => value ?? /* @__PURE__ */ new Date());
7963
+ const [view, setView] = React28.useState("days");
7964
+ const gridRef = React28.useRef(null);
7965
+ React28.useEffect(() => {
8084
7966
  if (!open) return;
8085
7967
  const target = value ?? /* @__PURE__ */ new Date();
8086
7968
  setViewMonth(startOfMonth2(target));
8087
7969
  setFocusDate(target);
8088
7970
  setView("days");
8089
7971
  }, [open, value]);
8090
- React29.useEffect(() => {
7972
+ React28.useEffect(() => {
8091
7973
  if (!open) return;
8092
7974
  const cell = gridRef.current?.querySelector(`[data-day="${defaultFormat3(focusDate)}"]`);
8093
7975
  cell?.focus();
8094
7976
  }, [open, focusDate]);
8095
- const weekdays = React29.useMemo(() => {
7977
+ const weekdays = React28.useMemo(() => {
8096
7978
  const ordered = WEEKDAY_SHORT.slice(weekStartsOn).concat(WEEKDAY_SHORT.slice(0, weekStartsOn));
8097
7979
  return ordered;
8098
7980
  }, [weekStartsOn]);
8099
- const grid = React29.useMemo(() => buildGrid2(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
7981
+ const grid = React28.useMemo(() => buildGrid(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
8100
7982
  const isDisabled = (d) => {
8101
7983
  if (min && d < min) return true;
8102
7984
  if (max && d > max) return true;
@@ -8127,14 +8009,14 @@ function DatePicker({
8127
8009
  next(7);
8128
8010
  } else if (e.key === "PageUp") {
8129
8011
  e.preventDefault();
8130
- const nm = addMonths3(viewMonth, -1);
8012
+ const nm = addMonths2(viewMonth, -1);
8131
8013
  setViewMonth(nm);
8132
- setFocusDate((d) => addMonths3(d, -1));
8014
+ setFocusDate((d) => addMonths2(d, -1));
8133
8015
  } else if (e.key === "PageDown") {
8134
8016
  e.preventDefault();
8135
- const nm = addMonths3(viewMonth, 1);
8017
+ const nm = addMonths2(viewMonth, 1);
8136
8018
  setViewMonth(nm);
8137
- setFocusDate((d) => addMonths3(d, 1));
8019
+ setFocusDate((d) => addMonths2(d, 1));
8138
8020
  } else if (e.key === "Home") {
8139
8021
  e.preventDefault();
8140
8022
  const dow = (focusDate.getDay() - weekStartsOn + 7) % 7;
@@ -8199,7 +8081,7 @@ function DatePicker({
8199
8081
  {
8200
8082
  type: "button",
8201
8083
  onClick: () => {
8202
- if (view === "days") setViewMonth(addMonths3(viewMonth, -1));
8084
+ if (view === "days") setViewMonth(addMonths2(viewMonth, -1));
8203
8085
  else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
8204
8086
  else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
8205
8087
  },
@@ -8234,7 +8116,7 @@ function DatePicker({
8234
8116
  {
8235
8117
  type: "button",
8236
8118
  onClick: () => {
8237
- if (view === "days") setViewMonth(addMonths3(viewMonth, 1));
8119
+ if (view === "days") setViewMonth(addMonths2(viewMonth, 1));
8238
8120
  else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
8239
8121
  else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
8240
8122
  },
@@ -8386,10 +8268,10 @@ function TextArea({
8386
8268
  style,
8387
8269
  inputStyle
8388
8270
  }) {
8389
- const errorId = React29.useId();
8271
+ const errorId = React28.useId();
8390
8272
  const hasError = errorMessage != null;
8391
- const ref = React29.useRef(null);
8392
- React29.useLayoutEffect(() => {
8273
+ const ref = React28.useRef(null);
8274
+ React28.useLayoutEffect(() => {
8393
8275
  if (!autoGrow) return;
8394
8276
  const el = ref.current;
8395
8277
  if (!el) return;
@@ -8461,14 +8343,14 @@ function Slider({
8461
8343
  name,
8462
8344
  htmlFor
8463
8345
  }) {
8464
- const errorId = React29.useId();
8346
+ const errorId = React28.useId();
8465
8347
  const hasError = errorMessage != null;
8466
8348
  const isRange = Array.isArray(value ?? defaultValue);
8467
- const [internal, setInternal] = React29.useState(
8349
+ const [internal, setInternal] = React28.useState(
8468
8350
  () => toArray(value) ?? toArray(defaultValue) ?? [min]
8469
8351
  );
8470
8352
  const current = toArray(value) ?? internal;
8471
- const [dragging, setDragging] = React29.useState(false);
8353
+ const [dragging, setDragging] = React28.useState(false);
8472
8354
  const emit = (arr) => {
8473
8355
  setInternal(arr);
8474
8356
  const next = isRange ? [arr[0], arr[1]] : arr[0];
@@ -8563,11 +8445,11 @@ function TagsInput({
8563
8445
  validate,
8564
8446
  separators = ["Enter", ","]
8565
8447
  }) {
8566
- const errorId = React29.useId();
8567
- const inputRef = React29.useRef(null);
8568
- const [internal, setInternal] = React29.useState(defaultValue ?? []);
8569
- const [draft, setDraft] = React29.useState("");
8570
- const [localError, setLocalError] = React29.useState(null);
8448
+ const errorId = React28.useId();
8449
+ const inputRef = React28.useRef(null);
8450
+ const [internal, setInternal] = React28.useState(defaultValue ?? []);
8451
+ const [draft, setDraft] = React28.useState("");
8452
+ const [localError, setLocalError] = React28.useState(null);
8571
8453
  const tags = value ?? internal;
8572
8454
  const hasError = errorMessage != null || localError != null;
8573
8455
  const errorText = errorMessage ?? localError ?? void 0;
@@ -8698,9 +8580,9 @@ function OtpInput({
8698
8580
  className,
8699
8581
  groupAfter
8700
8582
  }) {
8701
- const errorId = React29.useId();
8583
+ const errorId = React28.useId();
8702
8584
  const hasError = errorMessage != null;
8703
- const refs = React29.useRef([]);
8585
+ const refs = React28.useRef([]);
8704
8586
  const chars = Array.from({ length }, (_, i) => value[i] ?? "");
8705
8587
  const pattern = mode === "numeric" ? /[0-9]/ : /[a-zA-Z0-9]/;
8706
8588
  const emit = (next) => {
@@ -8749,7 +8631,7 @@ function OtpInput({
8749
8631
  emit(valid.join(""));
8750
8632
  focusBox(valid.length);
8751
8633
  };
8752
- return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React29__default.default.Fragment, { children: [
8634
+ return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
8753
8635
  /* @__PURE__ */ jsxRuntime.jsx(
8754
8636
  "input",
8755
8637
  {
@@ -8807,9 +8689,9 @@ function Rating({
8807
8689
  className,
8808
8690
  required
8809
8691
  }) {
8810
- const errorId = React29.useId();
8811
- const [internal, setInternal] = React29.useState(defaultValue);
8812
- const [hover, setHover] = React29.useState(null);
8692
+ const errorId = React28.useId();
8693
+ const [internal, setInternal] = React28.useState(defaultValue);
8694
+ const [hover, setHover] = React28.useState(null);
8813
8695
  const current = value ?? internal;
8814
8696
  const display2 = hover ?? current;
8815
8697
  const interactive = !readOnly && !disabled;
@@ -8932,9 +8814,9 @@ function TimePicker({
8932
8814
  required,
8933
8815
  style
8934
8816
  }) {
8935
- const errorId = React29.useId();
8817
+ const errorId = React28.useId();
8936
8818
  const hasError = errorMessage != null;
8937
- const [open, setOpen] = React29.useState(false);
8819
+ const [open, setOpen] = React28.useState(false);
8938
8820
  const parsed = parse(value) ?? { h: 0, m: 0, s: 0 };
8939
8821
  const update = (next) => {
8940
8822
  const merged = { ...parsed, ...next };
@@ -9020,16 +8902,16 @@ function TimePicker({
9020
8902
  var MONTH_NAMES2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
9021
8903
  var WEEKDAY = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
9022
8904
  var startOfMonth3 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
9023
- var addMonths4 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
8905
+ var addMonths3 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
9024
8906
  var addDays3 = (d, n) => {
9025
8907
  const c = new Date(d);
9026
8908
  c.setDate(c.getDate() + n);
9027
8909
  return c;
9028
8910
  };
9029
8911
  var isSameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
9030
- var startOfDay3 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
8912
+ var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
9031
8913
  var defaultFmt = (d) => `${d.getFullYear()}-${`${d.getMonth() + 1}`.padStart(2, "0")}-${`${d.getDate()}`.padStart(2, "0")}`;
9032
- function buildGrid3(viewMonth, weekStartsOn) {
8914
+ function buildGrid2(viewMonth, weekStartsOn) {
9033
8915
  const first = startOfMonth3(viewMonth);
9034
8916
  const offset = (first.getDay() - weekStartsOn + 7) % 7;
9035
8917
  const gridStart = addDays3(first, -offset);
@@ -9058,23 +8940,23 @@ function DateRangePicker({
9058
8940
  required,
9059
8941
  style
9060
8942
  }) {
9061
- const errorId = React29.useId();
8943
+ const errorId = React28.useId();
9062
8944
  const hasError = errorMessage != null;
9063
- const [open, setOpen] = React29.useState(false);
9064
- const [leftMonth, setLeftMonth] = React29.useState(() => startOfMonth3(value.start ?? /* @__PURE__ */ new Date()));
9065
- const [pendingStart, setPendingStart] = React29.useState(null);
9066
- const [hoverDate, setHoverDate] = React29.useState(null);
9067
- const weekdays = React29.useMemo(
8945
+ const [open, setOpen] = React28.useState(false);
8946
+ const [leftMonth, setLeftMonth] = React28.useState(() => startOfMonth3(value.start ?? /* @__PURE__ */ new Date()));
8947
+ const [pendingStart, setPendingStart] = React28.useState(null);
8948
+ const [hoverDate, setHoverDate] = React28.useState(null);
8949
+ const weekdays = React28.useMemo(
9068
8950
  () => WEEKDAY.slice(weekStartsOn).concat(WEEKDAY.slice(0, weekStartsOn)),
9069
8951
  [weekStartsOn]
9070
8952
  );
9071
- const isDisabled = (d) => min && d < startOfDay3(min) || max && d > startOfDay3(max);
8953
+ const isDisabled = (d) => min && d < startOfDay2(min) || max && d > startOfDay2(max);
9072
8954
  const effective = pendingStart ? { start: pendingStart, end: hoverDate } : value;
9073
8955
  const inRange = (d) => {
9074
8956
  const { start, end } = effective;
9075
8957
  if (!start || !end) return false;
9076
8958
  const [a, b] = start <= end ? [start, end] : [end, start];
9077
- return d >= startOfDay3(a) && d <= startOfDay3(b);
8959
+ return d >= startOfDay2(a) && d <= startOfDay2(b);
9078
8960
  };
9079
8961
  const onDayClick = (d) => {
9080
8962
  if (isDisabled(d)) return;
@@ -9092,7 +8974,7 @@ function DateRangePicker({
9092
8974
  };
9093
8975
  const triggerText = value.start && value.end ? `${format(value.start)} \u2013 ${format(value.end)}` : value.start ? `${format(value.start)} \u2013 \u2026` : "";
9094
8976
  const renderMonth = (viewMonth) => {
9095
- const cells = buildGrid3(viewMonth, weekStartsOn);
8977
+ const cells = buildGrid2(viewMonth, weekStartsOn);
9096
8978
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9097
8979
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-semibold text-center mb-2 select-none", children: [
9098
8980
  MONTH_NAMES2[viewMonth.getMonth()],
@@ -9181,7 +9063,7 @@ function DateRangePicker({
9181
9063
  "button",
9182
9064
  {
9183
9065
  type: "button",
9184
- onClick: () => setLeftMonth(addMonths4(leftMonth, -1)),
9066
+ onClick: () => setLeftMonth(addMonths3(leftMonth, -1)),
9185
9067
  "aria-label": "Previous month",
9186
9068
  className: "absolute -top-1 left-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
9187
9069
  children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
@@ -9194,13 +9076,13 @@ function DateRangePicker({
9194
9076
  "button",
9195
9077
  {
9196
9078
  type: "button",
9197
- onClick: () => setLeftMonth(addMonths4(leftMonth, 1)),
9079
+ onClick: () => setLeftMonth(addMonths3(leftMonth, 1)),
9198
9080
  "aria-label": "Next month",
9199
9081
  className: "absolute -top-1 right-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
9200
9082
  children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
9201
9083
  }
9202
9084
  ),
9203
- renderMonth(addMonths4(leftMonth, 1))
9085
+ renderMonth(addMonths3(leftMonth, 1))
9204
9086
  ] })
9205
9087
  ] })
9206
9088
  ]
@@ -9240,10 +9122,10 @@ function ColorPicker({
9240
9122
  required,
9241
9123
  placeholder = "Pick a colour\u2026"
9242
9124
  }) {
9243
- const errorId = React29.useId();
9125
+ const errorId = React28.useId();
9244
9126
  const hasError = errorMessage != null;
9245
- const [open, setOpen] = React29.useState(false);
9246
- const [draft, setDraft] = React29.useState(value);
9127
+ const [open, setOpen] = React28.useState(false);
9128
+ const [draft, setDraft] = React28.useState(value);
9247
9129
  const valid = HEX_RE.test(value);
9248
9130
  const pick = (hex) => {
9249
9131
  onChange?.(hex);
@@ -9330,7 +9212,7 @@ function ColorPicker({
9330
9212
  }
9331
9213
  var CUSTOM_EVENT = "oxy-local-storage";
9332
9214
  function useLocalStorage(key, initialValue) {
9333
- const read = React29.useCallback(() => {
9215
+ const read = React28.useCallback(() => {
9334
9216
  if (typeof window === "undefined") return initialValue;
9335
9217
  try {
9336
9218
  const item = window.localStorage.getItem(key);
@@ -9339,8 +9221,8 @@ function useLocalStorage(key, initialValue) {
9339
9221
  return initialValue;
9340
9222
  }
9341
9223
  }, [key]);
9342
- const [stored, setStored] = React29.useState(read);
9343
- const setValue = React29.useCallback((value) => {
9224
+ const [stored, setStored] = React28.useState(read);
9225
+ const setValue = React28.useCallback((value) => {
9344
9226
  setStored((prev) => {
9345
9227
  const next = value instanceof Function ? value(prev) : value;
9346
9228
  try {
@@ -9353,7 +9235,7 @@ function useLocalStorage(key, initialValue) {
9353
9235
  return next;
9354
9236
  });
9355
9237
  }, [key]);
9356
- const remove = React29.useCallback(() => {
9238
+ const remove = React28.useCallback(() => {
9357
9239
  try {
9358
9240
  if (typeof window !== "undefined") {
9359
9241
  window.localStorage.removeItem(key);
@@ -9363,10 +9245,10 @@ function useLocalStorage(key, initialValue) {
9363
9245
  }
9364
9246
  setStored(initialValue);
9365
9247
  }, [key]);
9366
- React29.useEffect(() => {
9248
+ React28.useEffect(() => {
9367
9249
  setStored(read());
9368
9250
  }, [key, read]);
9369
- React29.useEffect(() => {
9251
+ React28.useEffect(() => {
9370
9252
  if (typeof window === "undefined") return;
9371
9253
  const onStorage = (e) => {
9372
9254
  if (e.key === null || e.key === key) setStored(read());
@@ -9385,8 +9267,8 @@ function useLocalStorage(key, initialValue) {
9385
9267
  }
9386
9268
  function useMediaQuery(query) {
9387
9269
  const get = () => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false;
9388
- const [matches, setMatches] = React29.useState(get);
9389
- React29.useEffect(() => {
9270
+ const [matches, setMatches] = React28.useState(get);
9271
+ React28.useEffect(() => {
9390
9272
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
9391
9273
  const mql = window.matchMedia(query);
9392
9274
  const onChange = () => setMatches(mql.matches);
@@ -9417,8 +9299,8 @@ function decodeSegment(seg) {
9417
9299
  }
9418
9300
  }
9419
9301
  function useJwt(token) {
9420
- const [, tick] = React29.useState(0);
9421
- const decoded = React29.useMemo(() => {
9302
+ const [, tick] = React28.useState(0);
9303
+ const decoded = React28.useMemo(() => {
9422
9304
  if (!token) return { payload: null, header: null, exp: null };
9423
9305
  const [h, p] = token.split(".");
9424
9306
  const header = decodeSegment(h);
@@ -9426,7 +9308,7 @@ function useJwt(token) {
9426
9308
  const exp = payload && typeof payload.exp === "number" ? payload.exp : null;
9427
9309
  return { payload, header, exp };
9428
9310
  }, [token]);
9429
- React29.useEffect(() => {
9311
+ React28.useEffect(() => {
9430
9312
  if (decoded.exp == null) return;
9431
9313
  const ms = decoded.exp * 1e3 - Date.now();
9432
9314
  if (ms <= 0) return;
@@ -9464,7 +9346,6 @@ exports.Box = Box;
9464
9346
  exports.Breadcrumbs = Breadcrumbs;
9465
9347
  exports.Button = Button_default;
9466
9348
  exports.CARD_BRANDS = CARD_BRANDS;
9467
- exports.Calendar = Calendar2;
9468
9349
  exports.Card = Card_default;
9469
9350
  exports.CardCarousel = CardCarousel;
9470
9351
  exports.Cart = Cart;