@luxfi/ui 7.4.9 → 7.4.11

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.
Files changed (82) hide show
  1. package/dist/accordion.cjs +107 -166
  2. package/dist/accordion.d.cts +18 -51
  3. package/dist/accordion.d.ts +18 -51
  4. package/dist/accordion.js +109 -166
  5. package/dist/chrome.cjs +193 -379
  6. package/dist/chrome.js +195 -379
  7. package/dist/collapsible.cjs +35 -26
  8. package/dist/collapsible.d.cts +2 -1
  9. package/dist/collapsible.d.ts +2 -1
  10. package/dist/collapsible.js +34 -24
  11. package/dist/dialog.d.cts +1 -1
  12. package/dist/dialog.d.ts +1 -1
  13. package/dist/drawer.cjs +92 -115
  14. package/dist/drawer.d.cts +43 -10
  15. package/dist/drawer.d.ts +43 -10
  16. package/dist/drawer.js +94 -115
  17. package/dist/field.cjs +60 -109
  18. package/dist/field.d.cts +0 -1
  19. package/dist/field.d.ts +0 -1
  20. package/dist/field.js +61 -109
  21. package/dist/heading.cjs +10 -17
  22. package/dist/heading.d.cts +0 -2
  23. package/dist/heading.d.ts +0 -2
  24. package/dist/heading.js +10 -17
  25. package/dist/icon-button.cjs +82 -82
  26. package/dist/icon-button.d.cts +16 -12
  27. package/dist/icon-button.d.ts +16 -12
  28. package/dist/icon-button.js +82 -82
  29. package/dist/index.cjs +1073 -1419
  30. package/dist/index.d.cts +1 -5
  31. package/dist/index.d.ts +1 -5
  32. package/dist/index.js +1075 -1414
  33. package/dist/input-group.cjs +11 -12
  34. package/dist/input-group.js +11 -12
  35. package/dist/input.cjs +27 -27
  36. package/dist/input.d.cts +21 -1
  37. package/dist/input.d.ts +21 -1
  38. package/dist/input.js +25 -28
  39. package/dist/menu.cjs +160 -271
  40. package/dist/menu.d.cts +41 -57
  41. package/dist/menu.d.ts +41 -57
  42. package/dist/menu.js +161 -251
  43. package/dist/next.cjs +6 -10
  44. package/dist/next.js +5 -9
  45. package/dist/popover.cjs +1 -1
  46. package/dist/popover.js +1 -1
  47. package/dist/select.cjs +40 -39
  48. package/dist/select.d.cts +35 -4
  49. package/dist/select.d.ts +35 -4
  50. package/dist/select.js +40 -38
  51. package/dist/separator.cjs +8 -33
  52. package/dist/separator.js +8 -33
  53. package/dist/tabs.cjs +108 -197
  54. package/dist/tabs.d.cts +16 -60
  55. package/dist/tabs.d.ts +16 -60
  56. package/dist/tabs.js +109 -196
  57. package/dist/textarea.cjs +56 -27
  58. package/dist/textarea.js +57 -28
  59. package/dist/toaster.cjs +97 -79
  60. package/dist/toaster.d.cts +7 -8
  61. package/dist/toaster.d.ts +7 -8
  62. package/dist/toaster.js +78 -80
  63. package/package.json +2 -16
  64. package/src/accordion.tsx +173 -227
  65. package/src/collapsible.tsx +55 -52
  66. package/src/drawer.tsx +123 -115
  67. package/src/engine.ts +0 -25
  68. package/src/field.tsx +68 -124
  69. package/src/heading.tsx +22 -26
  70. package/src/icon-button.tsx +134 -141
  71. package/src/ink.tsx +37 -0
  72. package/src/input-group.tsx +21 -12
  73. package/src/input.tsx +41 -32
  74. package/src/menu.tsx +224 -397
  75. package/src/next.ts +32 -1
  76. package/src/popover.tsx +1 -1
  77. package/src/select.tsx +80 -59
  78. package/src/separator.tsx +13 -34
  79. package/src/tabs.tsx +166 -296
  80. package/src/textarea.tsx +19 -29
  81. package/src/toaster.tsx +118 -86
  82. package/tokens.css +61 -0
package/dist/index.cjs CHANGED
@@ -3,23 +3,15 @@
3
3
 
4
4
  var gui = require('@hanzo/gui');
5
5
  var reactQuery = require('@tanstack/react-query');
6
- var React33 = require('react');
6
+ var React32 = require('react');
7
7
  var v5 = require('@hanzogui/config/v5');
8
8
  var v5Css = require('@hanzogui/config/v5-css');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
  var clsx = require('clsx');
11
11
  var tailwindMerge = require('tailwind-merge');
12
12
  var lucideReact = require('lucide-react');
13
- var RadixDialog = require('@radix-ui/react-dialog');
14
- var DropdownMenu = require('@radix-ui/react-dropdown-menu');
15
- var AccordionPrimitive = require('@radix-ui/react-accordion');
16
13
  var usehooks = require('@uidotdev/usehooks');
17
- var Collapsible = require('@radix-ui/react-collapsible');
18
- var LabelPrimitive = require('@radix-ui/react-label');
19
14
  var esToolkit = require('es-toolkit');
20
- var RadixSelect = require('@radix-ui/react-select');
21
- var RadixTabs = require('@radix-ui/react-tabs');
22
- var sonner = require('sonner');
23
15
 
24
16
  function _interopNamespace(e) {
25
17
  if (e && e.__esModule) return e;
@@ -39,14 +31,7 @@ function _interopNamespace(e) {
39
31
  return Object.freeze(n);
40
32
  }
41
33
 
42
- var React33__namespace = /*#__PURE__*/_interopNamespace(React33);
43
- var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
44
- var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
45
- var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
46
- var Collapsible__namespace = /*#__PURE__*/_interopNamespace(Collapsible);
47
- var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
48
- var RadixSelect__namespace = /*#__PURE__*/_interopNamespace(RadixSelect);
49
- var RadixTabs__namespace = /*#__PURE__*/_interopNamespace(RadixTabs);
34
+ var React32__namespace = /*#__PURE__*/_interopNamespace(React32);
50
35
 
51
36
  // src/provider.tsx
52
37
 
@@ -227,7 +212,7 @@ var defaultQueryClient = new reactQuery.QueryClient({
227
212
  var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
228
213
  var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
229
214
  var useFontBodyReset = () => {
230
- React33__namespace.default.useInsertionEffect(() => {
215
+ React32__namespace.default.useInsertionEffect(() => {
231
216
  if (typeof document === "undefined") return;
232
217
  if (document.getElementById(FONT_BODY_RESET_ID)) return;
233
218
  const style = document.createElement("style");
@@ -236,16 +221,16 @@ var useFontBodyReset = () => {
236
221
  document.head.appendChild(style);
237
222
  }, []);
238
223
  };
239
- var WhiteLabelContext = React33__namespace.default.createContext(resolveWhiteLabel(""));
240
- var useWhiteLabel = () => React33__namespace.default.useContext(WhiteLabelContext);
224
+ var WhiteLabelContext = React32__namespace.default.createContext(resolveWhiteLabel(""));
225
+ var useWhiteLabel = () => React32__namespace.default.useContext(WhiteLabelContext);
241
226
  var useHostWhiteLabel = (host) => {
242
- const [resolvedHost, setResolvedHost] = React33__namespace.default.useState(host ?? "");
243
- React33__namespace.default.useEffect(() => {
227
+ const [resolvedHost, setResolvedHost] = React32__namespace.default.useState(host ?? "");
228
+ React32__namespace.default.useEffect(() => {
244
229
  if (host !== void 0) return;
245
230
  const browserHost = currentHost();
246
231
  if (browserHost) setResolvedHost(browserHost);
247
232
  }, [host]);
248
- return React33__namespace.default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
233
+ return React32__namespace.default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
249
234
  };
250
235
  var AppProvider = ({
251
236
  children,
@@ -264,8 +249,8 @@ function cn(...inputs) {
264
249
  var NARROW_PX = 640;
265
250
  var TOUCH_PX = 1024;
266
251
  function useBelow(px) {
267
- const [below, setBelow] = React33__namespace.useState(false);
268
- React33__namespace.useEffect(() => {
252
+ const [below, setBelow] = React32__namespace.useState(false);
253
+ React32__namespace.useEffect(() => {
269
254
  const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
270
255
  const apply = () => setBelow(mql.matches);
271
256
  apply();
@@ -403,23 +388,23 @@ function writeScope(host, kind, value) {
403
388
  } catch {
404
389
  }
405
390
  }
406
- var IdentityContext = React33__namespace.createContext(null);
391
+ var IdentityContext = React32__namespace.createContext(null);
407
392
  var IdentityProvider = ({
408
393
  children,
409
394
  auth = defaultAuth,
410
395
  loginPath = "/login"
411
396
  }) => {
412
397
  const whiteLabel = useWhiteLabel();
413
- const base = React33__namespace.useMemo(() => iamBase(whiteLabel), [whiteLabel]);
414
- const [status, setStatus] = React33__namespace.useState("loading");
415
- const [account, setAccount] = React33__namespace.useState(null);
416
- const [orgs, setOrgs] = React33__namespace.useState([]);
417
- const [projects, setProjects] = React33__namespace.useState([]);
418
- const [error, setError] = React33__namespace.useState(null);
419
- const [orgName, setOrgName] = React33__namespace.useState(null);
420
- const [projectName, setProjectName] = React33__namespace.useState(null);
421
- const [epoch, setEpoch] = React33__namespace.useState(0);
422
- React33__namespace.useEffect(() => {
398
+ const base = React32__namespace.useMemo(() => iamBase(whiteLabel), [whiteLabel]);
399
+ const [status, setStatus] = React32__namespace.useState("loading");
400
+ const [account, setAccount] = React32__namespace.useState(null);
401
+ const [orgs, setOrgs] = React32__namespace.useState([]);
402
+ const [projects, setProjects] = React32__namespace.useState([]);
403
+ const [error, setError] = React32__namespace.useState(null);
404
+ const [orgName, setOrgName] = React32__namespace.useState(null);
405
+ const [projectName, setProjectName] = React32__namespace.useState(null);
406
+ const [epoch, setEpoch] = React32__namespace.useState(0);
407
+ React32__namespace.useEffect(() => {
423
408
  const ac = new AbortController();
424
409
  let live = true;
425
410
  void (async () => {
@@ -467,12 +452,12 @@ var IdentityProvider = ({
467
452
  ac.abort();
468
453
  };
469
454
  }, [base, auth, epoch]);
470
- const org = React33__namespace.useMemo(() => {
455
+ const org = React32__namespace.useMemo(() => {
471
456
  if (orgs.length === 0) return null;
472
457
  const saved = orgName ?? readScope(whiteLabel.host, "org");
473
458
  return orgs.find((o) => o.name === saved) ?? orgs.find((o) => o.name === account?.owner) ?? orgs[0];
474
459
  }, [orgs, orgName, account, whiteLabel.host]);
475
- React33__namespace.useEffect(() => {
460
+ React32__namespace.useEffect(() => {
476
461
  if (!org) {
477
462
  setProjects([]);
478
463
  return;
@@ -490,12 +475,12 @@ var IdentityProvider = ({
490
475
  ac.abort();
491
476
  };
492
477
  }, [base, auth, org, epoch]);
493
- const project = React33__namespace.useMemo(() => {
478
+ const project = React32__namespace.useMemo(() => {
494
479
  if (projects.length === 0) return null;
495
480
  const saved = projectName ?? readScope(whiteLabel.host, "project");
496
481
  return projects.find((p) => p.name === saved) ?? projects.find((p) => p.isDefault) ?? projects[0];
497
482
  }, [projects, projectName, whiteLabel.host]);
498
- const value = React33__namespace.useMemo(() => ({
483
+ const value = React32__namespace.useMemo(() => ({
499
484
  status,
500
485
  account,
501
486
  orgs,
@@ -527,9 +512,9 @@ var IdentityProvider = ({
527
512
  return /* @__PURE__ */ jsxRuntime.jsx(IdentityContext.Provider, { value, children });
528
513
  };
529
514
  function useIdentity() {
530
- const ctx = React33__namespace.useContext(IdentityContext);
515
+ const ctx = React32__namespace.useContext(IdentityContext);
531
516
  const whiteLabel = useWhiteLabel();
532
- const fallback = React33__namespace.useMemo(() => ({
517
+ const fallback = React32__namespace.useMemo(() => ({
533
518
  status: "anonymous",
534
519
  account: null,
535
520
  orgs: [],
@@ -583,7 +568,7 @@ var CLOSE_BUTTON_CLASSES = [
583
568
  "hover:text-[var(--hover-color,currentColor)]",
584
569
  "disabled:opacity-40"
585
570
  ].join(" ");
586
- var CloseButton = React33__namespace.forwardRef(function CloseButton2(props, ref) {
571
+ var CloseButton = React32__namespace.forwardRef(function CloseButton2(props, ref) {
587
572
  const { variant: _variant, size: _size, className, children, ...rest } = props;
588
573
  return /* @__PURE__ */ jsxRuntime.jsx(
589
574
  CloseButtonFrame,
@@ -610,13 +595,22 @@ var CloseButton = React33__namespace.forwardRef(function CloseButton2(props, ref
610
595
  }
611
596
  );
612
597
  });
613
- var DrawerPlacementContext = React33__namespace.createContext("right");
614
- var DrawerSizeContext = React33__namespace.createContext("md");
615
- var DrawerStateContext = React33__namespace.createContext({
598
+ var ink = (children, Wrap = gui.Text, props = {}) => {
599
+ let hasText = false;
600
+ React32.Children.forEach(children, (child) => {
601
+ if (typeof child === "string" || typeof child === "number") hasText = true;
602
+ });
603
+ if (!hasText) return children;
604
+ return React32.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React32.createElement(Wrap, props, child) : child);
605
+ };
606
+ var DrawerPlacementContext = React32__namespace.createContext("right");
607
+ var DrawerSizeContext = React32__namespace.createContext("md");
608
+ var DrawerStateContext = React32__namespace.createContext({
616
609
  open: false,
617
610
  setOpen: () => {
618
611
  },
619
- modal: true
612
+ modal: true,
613
+ narrow: false
620
614
  });
621
615
  var DrawerRoot = (props) => {
622
616
  const {
@@ -628,63 +622,43 @@ var DrawerRoot = (props) => {
628
622
  modal = true,
629
623
  size = "md"
630
624
  } = props;
631
- const [uncontrolled, setUncontrolled] = React33__namespace.useState(defaultOpen ?? false);
625
+ const [uncontrolled, setUncontrolled] = React32__namespace.useState(defaultOpen ?? false);
632
626
  const isControlled = open !== void 0;
633
627
  const isOpen = isControlled ? open : uncontrolled;
634
- const setOpen = React33__namespace.useCallback((nextOpen) => {
628
+ const narrow = useIsNarrow();
629
+ const setOpen = React32__namespace.useCallback((nextOpen) => {
635
630
  if (!isControlled) setUncontrolled(nextOpen);
636
631
  onOpenChange?.({ open: nextOpen });
637
632
  }, [isControlled, onOpenChange]);
638
- const state = React33__namespace.useMemo(
639
- () => ({ open: isOpen, setOpen, modal }),
640
- [isOpen, setOpen, modal]
633
+ const state = React32__namespace.useMemo(
634
+ () => ({ open: isOpen, setOpen, modal, narrow }),
635
+ [isOpen, setOpen, modal, narrow]
641
636
  );
642
- return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxRuntime.jsx(
643
- RadixDialog__namespace.Root,
644
- {
645
- open: isOpen,
646
- onOpenChange: setOpen,
647
- modal,
648
- children
649
- }
650
- ) }) }) });
637
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: narrow ? children : /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog, { open: isOpen, onOpenChange: setOpen, modal, children }) }) }) });
651
638
  };
652
- var PLACEMENT_CLASSES = {
653
- right: [
654
- "inset-y-0 right-0",
655
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
656
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
657
- ].join(" "),
658
- left: [
659
- "inset-y-0 left-0",
660
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
661
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
662
- ].join(" "),
663
- top: [
664
- "inset-x-0 top-0",
665
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
666
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
667
- ].join(" "),
668
- bottom: [
669
- "inset-x-0 bottom-0",
670
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
671
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
672
- ].join(" ")
639
+ var ANCHOR = {
640
+ right: { top: 0, bottom: 0, right: 0, enterStyle: { x: 24, opacity: 0 }, exitStyle: { x: 24, opacity: 0 } },
641
+ left: { top: 0, bottom: 0, left: 0, enterStyle: { x: -24, opacity: 0 }, exitStyle: { x: -24, opacity: 0 } },
642
+ top: { left: 0, right: 0, top: 0, enterStyle: { y: -24, opacity: 0 }, exitStyle: { y: -24, opacity: 0 } },
643
+ bottom: { left: 0, right: 0, bottom: 0, enterStyle: { y: 24, opacity: 0 }, exitStyle: { y: 24, opacity: 0 } }
673
644
  };
674
- var SIZE_CLASSES = {
675
- right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
676
- left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
677
- top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
678
- bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
645
+ var ACROSS = {
646
+ xs: 240,
647
+ sm: 320,
648
+ md: 384,
649
+ lg: 480,
650
+ xl: 640,
651
+ full: "100%"
679
652
  };
680
- var DrawerContent = React33__namespace.forwardRef(
653
+ var extent = (placement, size) => placement === "left" || placement === "right" ? { width: ACROSS[size], maxWidth: "100%" } : { height: ACROSS[size], maxHeight: "100%" };
654
+ var SCRIM = "rgba(0,0,0,0.5)";
655
+ var DrawerContent = React32__namespace.forwardRef(
681
656
  function DrawerContent2(props, ref) {
682
- const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
683
- const placement = React33__namespace.useContext(DrawerPlacementContext);
684
- const size = React33__namespace.useContext(DrawerSizeContext);
685
- const { open, setOpen, modal } = React33__namespace.useContext(DrawerStateContext);
686
- const isNarrow = useIsNarrow();
687
- if (isNarrow) {
657
+ const { children, portalled = true, portalRef: _portalRef, offset: _offset, backdrop = true, ...rest } = props;
658
+ const placement = React32__namespace.useContext(DrawerPlacementContext);
659
+ const size = React32__namespace.useContext(DrawerSizeContext);
660
+ const { open, setOpen, modal, narrow } = React32__namespace.useContext(DrawerStateContext);
661
+ if (narrow) {
688
662
  return /* @__PURE__ */ jsxRuntime.jsxs(
689
663
  gui.Sheet,
690
664
  {
@@ -702,7 +676,7 @@ var DrawerContent = React33__namespace.forwardRef(
702
676
  transition: "lazy",
703
677
  enterStyle: { opacity: 0 },
704
678
  exitStyle: { opacity: 0 },
705
- className: "bg-black/50"
679
+ backgroundColor: SCRIM
706
680
  }
707
681
  ),
708
682
  /* @__PURE__ */ jsxRuntime.jsx(gui.Sheet.Handle, {}),
@@ -710,10 +684,11 @@ var DrawerContent = React33__namespace.forwardRef(
710
684
  gui.Sheet.Frame,
711
685
  {
712
686
  unstyled: true,
713
- className: cn(
714
- "flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
715
- className
716
- ),
687
+ flexDirection: "column",
688
+ borderTopLeftRadius: 16,
689
+ borderTopRightRadius: 16,
690
+ backgroundColor: "var(--color-drawer-bg)",
691
+ shadowColor: "var(--shadow-drawer)",
717
692
  ...rest,
718
693
  children
719
694
  }
@@ -724,324 +699,223 @@ var DrawerContent = React33__namespace.forwardRef(
724
699
  }
725
700
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
726
701
  backdrop && /* @__PURE__ */ jsxRuntime.jsx(
727
- RadixDialog__namespace.Overlay,
702
+ gui.Dialog.Overlay,
728
703
  {
729
- className: cn(
730
- "fixed inset-0 z-50 bg-black/50",
731
- "data-[state=open]:animate-in data-[state=open]:fade-in-0",
732
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
733
- )
734
- }
704
+ position: "fixed",
705
+ top: 0,
706
+ right: 0,
707
+ bottom: 0,
708
+ left: 0,
709
+ zIndex: 50,
710
+ backgroundColor: SCRIM,
711
+ transition: "lazy",
712
+ enterStyle: { opacity: 0 },
713
+ exitStyle: { opacity: 0 }
714
+ },
715
+ "overlay"
735
716
  ),
736
717
  /* @__PURE__ */ jsxRuntime.jsx(
737
- RadixDialog__namespace.Content,
718
+ gui.Dialog.Content,
738
719
  {
739
720
  ref,
740
- className: cn(
741
- "fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
742
- PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
743
- SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
744
- className
745
- ),
721
+ unstyled: true,
722
+ position: "fixed",
723
+ zIndex: 50,
724
+ flexDirection: "column",
725
+ backgroundColor: "var(--color-drawer-bg)",
726
+ transition: "medium",
727
+ ...ANCHOR[placement],
728
+ ...extent(placement, size),
746
729
  ...rest,
747
730
  children
748
- }
731
+ },
732
+ "content"
749
733
  )
750
734
  ] });
751
- if (portalled) {
752
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
753
- }
754
- return content;
735
+ return portalled ? /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Portal, { children: content }) : content;
755
736
  }
756
737
  );
757
- var DrawerCloseTrigger = React33__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
758
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
759
- CloseButton,
760
- {
761
- ref,
762
- className: cn("absolute top-7 right-5", props.className),
763
- ...props
764
- }
765
- ) });
738
+ var DrawerCloseTrigger = React32__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
739
+ return (
740
+ // Placement belongs to the surrounding box, not to the button: CloseButton
741
+ // is a fixed 20px control and has no opinion about where it sits.
742
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", top: 28, right: 20, zIndex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, ...props }) }) })
743
+ );
766
744
  });
767
- var DrawerTrigger = (props) => {
768
- const { asChild = true, ...rest } = props;
769
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
770
- };
771
- var DrawerHeader = React33__namespace.forwardRef(
772
- function DrawerHeader2({ className, ...props }, ref) {
773
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
774
- }
775
- );
776
- var DrawerBody = React33__namespace.forwardRef(
777
- function DrawerBody2({ className, ...props }, ref) {
778
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
779
- }
780
- );
781
- var DrawerFooter = React33__namespace.forwardRef(
782
- function DrawerFooter2({ className, ...props }, ref) {
783
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
784
- }
785
- );
786
- var DrawerTitle = RadixDialog__namespace.Title;
787
- var DrawerDescription = RadixDialog__namespace.Description;
788
- var DrawerActionTrigger = RadixDialog__namespace.Close;
789
- function parsePlacement(placement) {
790
- if (!placement) {
791
- return { side: "bottom", align: "start" };
792
- }
793
- const parts = placement.split("-");
794
- const side = parts[0] ?? "bottom";
795
- const alignPart = parts[1];
796
- let align = "center";
797
- if (alignPart === "start") {
798
- align = "start";
799
- } else if (alignPart === "end") {
800
- align = "end";
745
+ var DrawerTrigger = ({ asChild = true, children, ...rest }) => {
746
+ const { setOpen, narrow } = React32__namespace.useContext(DrawerStateContext);
747
+ if (narrow) {
748
+ return React32__namespace.isValidElement(children) ? React32__namespace.cloneElement(children, { onClick: () => setOpen(true) }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
801
749
  }
802
- return { side, align };
803
- }
804
- var PositioningContext = React33__namespace.createContext({
805
- side: "bottom",
806
- align: "start",
807
- sideOffset: 4,
808
- alignOffset: 0
809
- });
810
- var MenuRoot = (props) => {
811
- const {
812
- children,
750
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Trigger, { asChild, ...rest, children });
751
+ };
752
+ var DrawerHeader = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: 6, padding: 24, paddingBottom: 0, ...props, children: ink(children) });
753
+ var DrawerBody = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { flex: 1, overflow: "scroll", padding: 24, ...props, children: ink(children) });
754
+ var DrawerFooter = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", justifyContent: "flex-end", gap: 8, padding: 24, paddingTop: 0, ...props, children: ink(children) });
755
+ var DrawerTitle = gui.Dialog.Title;
756
+ var DrawerDescription = gui.Dialog.Description;
757
+ var DrawerActionTrigger = gui.Dialog.Close;
758
+ var ITEM_HOVER = "var(--color-popover-item-hover)";
759
+ var TEXT = "var(--color-text-primary)";
760
+ var ROW = {
761
+ position: "relative",
762
+ flexDirection: "row",
763
+ alignItems: "center",
764
+ cursor: "pointer",
765
+ userSelect: "none",
766
+ borderRadius: 6,
767
+ fontSize: 14,
768
+ backgroundColor: "transparent",
769
+ hoverStyle: { backgroundColor: ITEM_HOVER },
770
+ focusStyle: { backgroundColor: ITEM_HOVER }
771
+ };
772
+ var MenuRoot = ({
773
+ children,
774
+ open,
775
+ defaultOpen,
776
+ onOpenChange,
777
+ positioning,
778
+ modal = true
779
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
780
+ gui.Menu,
781
+ {
813
782
  open,
814
783
  defaultOpen,
815
- onOpenChange,
816
- positioning,
817
- modal = true,
818
- // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
819
- // mount/unmount automatically.
820
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
821
- lazyMount: _lazyMount,
822
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
823
- unmountOnExit: _unmountOnExit
824
- } = props;
825
- const mergedPositioning = {
826
- placement: "bottom-start",
827
- ...positioning,
828
- offset: {
829
- mainAxis: 4,
830
- ...positioning?.offset
831
- }
832
- };
833
- const { side, align } = parsePlacement(mergedPositioning.placement);
834
- const positioningValue = React33__namespace.useMemo(() => ({
835
- side,
836
- align,
837
- sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
838
- alignOffset: mergedPositioning.offset?.crossAxis ?? 0
839
- }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
840
- const handleOpenChange = React33__namespace.useCallback((isOpen) => {
841
- onOpenChange?.({ open: isOpen });
842
- }, [onOpenChange]);
843
- return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
844
- DropdownMenu__namespace.Root,
845
- {
846
- open,
847
- defaultOpen,
848
- onOpenChange: handleOpenChange,
849
- modal,
850
- children
851
- }
852
- ) });
853
- };
854
- var MenuTrigger = React33__namespace.forwardRef(function MenuTrigger2(props, ref) {
855
- const { asChild = false, ...rest } = props;
856
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
857
- });
858
- var MenuContent = React33__namespace.forwardRef(function MenuContent2(props, ref) {
859
- const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
860
- const positioning = React33__namespace.useContext(PositioningContext);
861
- const mergedStyle = {
862
- ...style,
863
- ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
864
- ...minW !== void 0 ? { minWidth: minW } : {}
865
- };
866
- const content = /* @__PURE__ */ jsxRuntime.jsx(
867
- DropdownMenu__namespace.Content,
868
- {
869
- ref,
870
- side: positioning.side,
871
- align: positioning.align,
872
- sideOffset: positioning.sideOffset,
873
- alignOffset: positioning.alignOffset,
874
- className: cn(
875
- "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
876
- "border border-[var(--color-popover-border,var(--color-border-divider))]",
877
- "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
878
- "shadow-[0_4px_12px_var(--color-popover-shadow)]",
879
- "outline-none",
880
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
881
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
882
- "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
883
- "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
884
- className
885
- ),
886
- style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
887
- ...rest
888
- }
889
- );
890
- if (!portalled) {
891
- return content;
784
+ onOpenChange: onOpenChange ? (isOpen) => onOpenChange({ open: isOpen }) : void 0,
785
+ modal,
786
+ placement: positioning?.placement ?? "bottom-start",
787
+ offset: positioning?.offset?.mainAxis ?? 4,
788
+ children
892
789
  }
893
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
894
- });
895
- var MenuItem = React33__namespace.forwardRef(function MenuItem2(props, ref) {
896
- const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
897
- return /* @__PURE__ */ jsxRuntime.jsx(
898
- DropdownMenu__namespace.Item,
790
+ );
791
+ var MenuTrigger = ({ asChild = false, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Trigger, { asChild, ...rest });
792
+ var MenuContent = ({
793
+ portalled = true,
794
+ minW,
795
+ children,
796
+ ...rest
797
+ }) => {
798
+ const content = /* @__PURE__ */ jsxRuntime.jsx(
799
+ gui.Menu.Content,
899
800
  {
900
- ref,
901
- asChild,
902
- disabled,
903
- onClick,
904
- className: cn(
905
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
906
- "outline-none transition-colors",
907
- "text-[var(--color-text-primary,inherit)]",
908
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
909
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
910
- className
911
- ),
801
+ unstyled: true,
802
+ zIndex: 50,
803
+ minWidth: minW ?? 128,
804
+ overflow: "hidden",
805
+ borderRadius: 8,
806
+ padding: 4,
807
+ borderWidth: 1,
808
+ borderColor: "var(--color-popover-border)",
809
+ backgroundColor: "var(--color-popover-bg)",
810
+ transition: "quick",
811
+ enterStyle: { opacity: 0, scale: 0.95 },
812
+ exitStyle: { opacity: 0, scale: 0.95 },
912
813
  ...rest,
913
814
  children
914
815
  }
915
816
  );
916
- });
917
- var MenuItemText = React33__namespace.forwardRef(function MenuItemText2(props, ref) {
918
- const { className, ...rest } = props;
919
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
920
- });
921
- React33__namespace.forwardRef(function MenuItemCommand2(props, ref) {
922
- const { className, ...rest } = props;
923
- return /* @__PURE__ */ jsxRuntime.jsx(
924
- "span",
925
- {
926
- ref,
927
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
928
- ...rest
929
- }
930
- );
931
- });
932
- var MenuSeparator = React33__namespace.forwardRef(function MenuSeparator2(props, ref) {
933
- const { className, ...rest } = props;
934
- return /* @__PURE__ */ jsxRuntime.jsx(
935
- DropdownMenu__namespace.Separator,
936
- {
937
- ref,
938
- className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
939
- ...rest
940
- }
941
- );
942
- });
943
- var MenuItemGroup = React33__namespace.forwardRef(function MenuItemGroup2(props, ref) {
944
- const { title, children, className, ...rest } = props;
945
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
946
- title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
947
- children
948
- ] });
949
- });
950
- var MenuArrow = React33__namespace.forwardRef(function MenuArrow2(props, ref) {
951
- const { className, ...rest } = props;
952
- return /* @__PURE__ */ jsxRuntime.jsx(
953
- DropdownMenu__namespace.Arrow,
954
- {
955
- ref,
956
- className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
957
- ...rest
958
- }
959
- );
960
- });
961
- var MenuCheckboxItem = React33__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
962
- const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
963
- return /* @__PURE__ */ jsxRuntime.jsxs(
964
- DropdownMenu__namespace.CheckboxItem,
817
+ return portalled ? /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Portal, { children: content }) : content;
818
+ };
819
+ var MenuItem = ({ children, value: _value, asChild, ...rest }) => (
820
+ // `asChild` means the caller brought its own element and owns the look. Its
821
+ // props are then forwarded to that element verbatim, so the skin must NOT be
822
+ // applied: `unstyled` and friends are not DOM attributes and React rejects
823
+ // them out loud ("Received `true` for a non-boolean attribute `unstyled`").
824
+ // Two shapes, said once, rather than one shape that is wrong in one of them.
825
+ asChild ? /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Item, { asChild: true, ...rest, children }) : /* @__PURE__ */ jsxRuntime.jsx(
826
+ gui.Menu.Item,
965
827
  {
966
- ref,
967
- checked,
968
- onCheckedChange,
969
- onClick,
970
- className: cn(
971
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
972
- "outline-none transition-colors",
973
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
974
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
975
- className
976
- ),
828
+ unstyled: true,
829
+ ...ROW,
830
+ gap: 8,
831
+ paddingHorizontal: 8,
832
+ paddingVertical: 6,
833
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
977
834
  ...rest,
978
- children: [
979
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
980
- children
981
- ]
982
- }
983
- );
984
- });
985
- var MenuRadioItemGroup = React33__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
986
- const { value, onValueChange, ...rest } = props;
987
- return /* @__PURE__ */ jsxRuntime.jsx(
988
- DropdownMenu__namespace.RadioGroup,
989
- {
990
- ref,
991
- value,
992
- onValueChange,
993
- ...rest
994
- }
995
- );
996
- });
997
- var MenuRadioItem = React33__namespace.forwardRef(function MenuRadioItem2(props, ref) {
998
- const { className, children, value, onClick, ...rest } = props;
999
- const { value: _v, ...radixRest } = rest;
1000
- return /* @__PURE__ */ jsxRuntime.jsxs(
1001
- DropdownMenu__namespace.RadioItem,
1002
- {
1003
- ref,
1004
- value,
1005
- onClick,
1006
- className: cn(
1007
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
1008
- "outline-none transition-colors",
1009
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
1010
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1011
- className
1012
- ),
1013
- children: [
1014
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
1015
- /* @__PURE__ */ jsxRuntime.jsx("span", { children })
1016
- ]
835
+ children: ink(children, void 0, { fontSize: 14, color: TEXT })
1017
836
  }
1018
- );
1019
- });
1020
- React33__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
1021
- const { asChild: _asChild, ...rest } = props;
1022
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
1023
- });
1024
- var MenuTriggerItem = React33__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
1025
- const { startIcon, children, className, ...rest } = props;
1026
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1027
- DropdownMenu__namespace.SubTrigger,
837
+ )
838
+ );
839
+ var MenuItemText = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: 14, color: TEXT, ...props });
840
+ var MenuSeparator = (props) => /* @__PURE__ */ jsxRuntime.jsx(
841
+ gui.Menu.Separator,
842
+ {
843
+ unstyled: true,
844
+ height: 1,
845
+ marginVertical: 4,
846
+ marginHorizontal: -4,
847
+ backgroundColor: "var(--color-border-divider)",
848
+ ...props
849
+ }
850
+ );
851
+ var MenuItemGroup = ({ title, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(gui.Menu.Group, { unstyled: true, ...rest, children: [
852
+ title && /* @__PURE__ */ jsxRuntime.jsx(
853
+ gui.Menu.Label,
1028
854
  {
1029
- ref,
1030
- className: cn(
1031
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
1032
- "outline-none transition-colors",
1033
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
1034
- className
1035
- ),
1036
- ...rest,
1037
- children: [
1038
- startIcon,
1039
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
1040
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
1041
- ]
855
+ unstyled: true,
856
+ paddingHorizontal: 8,
857
+ paddingVertical: 6,
858
+ fontSize: 12,
859
+ fontWeight: "600",
860
+ userSelect: "none",
861
+ opacity: 0.6,
862
+ color: TEXT,
863
+ children: title
1042
864
  }
1043
- ) });
1044
- });
865
+ ),
866
+ children
867
+ ] });
868
+ var MenuArrow = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Arrow, { backgroundColor: "var(--color-popover-bg)", ...props });
869
+ var Indicator = () => /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", left: 8, width: 14, height: 14, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 16 }) }) });
870
+ var MenuCheckboxItem = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(
871
+ gui.Menu.CheckboxItem,
872
+ {
873
+ unstyled: true,
874
+ ...ROW,
875
+ paddingLeft: 32,
876
+ paddingRight: 8,
877
+ paddingVertical: 6,
878
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
879
+ ...rest,
880
+ children: [
881
+ /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}),
882
+ ink(children, void 0, { fontSize: 14, color: TEXT })
883
+ ]
884
+ }
885
+ );
886
+ var MenuRadioItemGroup = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.RadioGroup, { ...props });
887
+ var MenuRadioItem = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(
888
+ gui.Menu.RadioItem,
889
+ {
890
+ unstyled: true,
891
+ ...ROW,
892
+ paddingLeft: 32,
893
+ paddingRight: 8,
894
+ paddingVertical: 6,
895
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
896
+ ...rest,
897
+ children: [
898
+ /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}),
899
+ ink(children, void 0, { fontSize: 14, color: TEXT })
900
+ ]
901
+ }
902
+ );
903
+ var MenuTriggerItem = ({ startIcon, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
904
+ gui.Menu.SubTrigger,
905
+ {
906
+ unstyled: true,
907
+ ...ROW,
908
+ gap: 8,
909
+ paddingHorizontal: 8,
910
+ paddingVertical: 6,
911
+ ...rest,
912
+ children: [
913
+ startIcon,
914
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flex: 1, children: ink(children, void 0, { fontSize: 14, color: TEXT }) }),
915
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 })
916
+ ]
917
+ }
918
+ ) });
1045
919
  function initials(label) {
1046
920
  return label.split(/[\s._-]+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2).toUpperCase();
1047
921
  }
@@ -1091,9 +965,9 @@ var Switcher = ({
1091
965
  align = "start",
1092
966
  testId
1093
967
  }) => {
1094
- const [open, setOpen] = React33__namespace.useState(false);
968
+ const [open, setOpen] = React32__namespace.useState(false);
1095
969
  const narrow = useIsNarrow();
1096
- const close = React33__namespace.useCallback(() => setOpen(false), []);
970
+ const close = React32__namespace.useCallback(() => setOpen(false), []);
1097
971
  const message = status === "loading" ? "Loading\u2026" : status === "error" ? error ?? "Could not reach IAM." : status === "anonymous" ? null : items.length === 0 ? empty : null;
1098
972
  const rows = status === "anonymous" && onSignIn ? [{ id: "sign-in", label: signInLabel, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: onSignIn }] : status === "ready" ? items : [];
1099
973
  const panel = (menu) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -1126,7 +1000,7 @@ var Switcher = ({
1126
1000
  );
1127
1001
  if (narrow) {
1128
1002
  return /* @__PURE__ */ jsxRuntime.jsxs(DrawerRoot, { open, onOpenChange: (d) => setOpen(d.open), placement: "bottom", size: "md", children: [
1129
- React33__namespace.cloneElement(trigger, { onClick: () => setOpen(true) }),
1003
+ React32__namespace.cloneElement(trigger, { onClick: () => setOpen(true) }),
1130
1004
  /* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { "data-testid": testId ? `${testId}-panel` : void 0, children: [
1131
1005
  /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: title }) }),
1132
1006
  /* @__PURE__ */ jsxRuntime.jsx(DrawerBody, { children: panel(false) })
@@ -1242,7 +1116,7 @@ var AppNav = ({
1242
1116
  }) => {
1243
1117
  const id = useIdentity();
1244
1118
  const narrow = useIsNarrow();
1245
- const [menu, setMenu] = React33__namespace.useState(false);
1119
+ const [menu, setMenu] = React32__namespace.useState(false);
1246
1120
  return /* @__PURE__ */ jsxRuntime.jsx(
1247
1121
  "header",
1248
1122
  {
@@ -1304,178 +1178,117 @@ var AppNav = ({
1304
1178
  }
1305
1179
  );
1306
1180
  };
1307
- var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1308
- var AccordionRoot = React33__namespace.forwardRef(
1309
- function AccordionRoot2(props, ref) {
1310
- const {
1311
- multiple: _multiple,
1312
- value,
1313
- defaultValue,
1314
- onValueChange,
1315
- variant,
1316
- size,
1317
- noAnimation: _noAnimation,
1318
- lazyMount: _lazyMount,
1319
- className,
1320
- children,
1321
- position: _position,
1322
- w: _w,
1323
- bgColor: _bgColor,
1324
- borderRadius: _borderRadius,
1325
- ...rest
1326
- } = props;
1327
- const handleValueChange = React33__namespace.useCallback(
1328
- (next) => {
1329
- onValueChange?.({ value: next });
1330
- },
1331
- [onValueChange]
1332
- );
1333
- return /* @__PURE__ */ jsxRuntime.jsx(
1334
- AccordionPrimitive__namespace.Root,
1335
- {
1336
- ref,
1337
- type: "multiple",
1338
- value,
1339
- defaultValue,
1340
- onValueChange: handleValueChange,
1341
- className: cn(
1342
- "w-full",
1343
- variant === "faq" && "accordion-faq",
1344
- size === "sm" && "accordion-sm",
1345
- className
1346
- ),
1347
- "data-variant": variant,
1348
- "data-size": size,
1349
- ...rest,
1350
- children
1351
- }
1352
- );
1181
+ var IndicatorIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1182
+ var BAR = "var(--color-text-primary)";
1183
+ var Indicator2 = ({ open, variant }) => variant === "faq" ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { width: 12, height: 12, flexShrink: 0, alignItems: "center", justifyContent: "center", position: "relative", children: [
1184
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", width: "100%", height: 2, borderRadius: 2, backgroundColor: BAR }),
1185
+ /* @__PURE__ */ jsxRuntime.jsx(
1186
+ gui.View,
1187
+ {
1188
+ position: "absolute",
1189
+ width: 2,
1190
+ height: "100%",
1191
+ borderRadius: 2,
1192
+ backgroundColor: BAR,
1193
+ rotate: open ? "90deg" : "0deg"
1194
+ }
1195
+ )
1196
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flexShrink: 0, alignItems: "center", rotate: open ? "270deg" : "180deg", children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon, {}) });
1197
+ var Variant = React32__namespace.createContext(void 0);
1198
+ var AccordionRoot = ({
1199
+ value,
1200
+ defaultValue,
1201
+ onValueChange,
1202
+ variant,
1203
+ size,
1204
+ children,
1205
+ ...rest
1206
+ }) => /* @__PURE__ */ jsxRuntime.jsx(Variant.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
1207
+ gui.Accordion,
1208
+ {
1209
+ unstyled: true,
1210
+ type: "multiple",
1211
+ width: "100%",
1212
+ value,
1213
+ defaultValue,
1214
+ onValueChange: onValueChange ? (next) => onValueChange({ value: next }) : void 0,
1215
+ "data-variant": variant,
1216
+ "data-size": size,
1217
+ ...rest,
1218
+ children
1353
1219
  }
1354
- );
1355
- var AccordionItem = React33__namespace.forwardRef(
1356
- function AccordionItem2(props, ref) {
1357
- const { className, as: _as, _first, _last, display: _display, ...rest } = props;
1358
- return /* @__PURE__ */ jsxRuntime.jsx(
1359
- AccordionPrimitive__namespace.Item,
1360
- {
1361
- ref,
1362
- className: cn(
1363
- "border-b border-[var(--color-border-divider)]",
1364
- className
1365
- ),
1366
- ...rest
1367
- }
1368
- );
1220
+ ) });
1221
+ var AccordionItem = (props) => /* @__PURE__ */ jsxRuntime.jsx(
1222
+ gui.Accordion.Item,
1223
+ {
1224
+ unstyled: true,
1225
+ borderBottomWidth: 1,
1226
+ borderColor: "var(--color-border-divider)",
1227
+ ...props
1369
1228
  }
1370
1229
  );
1371
- var AccordionItemTrigger = React33__namespace.forwardRef(function AccordionItemTrigger2(props, ref) {
1372
- const {
1373
- children,
1374
- indicatorPlacement: indicatorPlacementProp,
1375
- variant,
1376
- noIndicator,
1377
- className,
1378
- // Strip Chakra style props
1379
- px: _px,
1380
- py: _py,
1381
- _hover,
1382
- wordBreak: _wordBreak,
1383
- textAlign: _textAlign,
1384
- cursor: _cursor,
1385
- display: _display,
1386
- alignItems: _alignItems,
1387
- columnGap: _columnGap,
1388
- ...rest
1389
- } = props;
1390
- const indicatorPlacement = variant === "faq" ? "start" : indicatorPlacementProp ?? "end";
1391
- const indicator = variant === "faq" ? /* @__PURE__ */ jsxRuntime.jsx(
1392
- "span",
1393
- {
1394
- className: cn(
1395
- "relative inline-block h-3 w-3 shrink-0",
1396
- // horizontal bar (always visible)
1397
- "before:absolute before:left-0 before:top-1/2 before:block before:h-[2px] before:w-full before:-translate-y-1/2 before:rounded-[2px] before:bg-current",
1398
- // vertical bar (rotates to 0 when open)
1399
- "after:absolute after:left-1/2 after:top-0 after:block after:h-full after:w-[2px]",
1400
- "after:-translate-x-1/2 after:rounded-[2px] after:bg-current",
1401
- "after:transition-transform after:duration-200 after:ease-in-out",
1402
- // When parent trigger has data-state="open", rotate vertical bar
1403
- "group-data-[state=open]/trigger:after:rotate-90"
1404
- )
1405
- }
1406
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1407
- "span",
1408
- {
1409
- className: cn(
1410
- "inline-flex shrink-0 transition-transform duration-200",
1411
- "rotate-180",
1412
- "group-data-[state=open]/trigger:rotate-[270deg]"
1413
- ),
1414
- children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon, { className: "h-5 w-5" })
1415
- }
1416
- );
1417
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
1418
- AccordionPrimitive__namespace.Trigger,
1419
- {
1420
- ref,
1421
- className: cn(
1422
- "group/trigger flex w-full cursor-pointer items-center gap-2 py-3 text-left text-[var(--color-text-primary)]",
1423
- "hover:text-[var(--color-hover)]",
1424
- "focus-visible:outline-none",
1425
- className
1426
- ),
1427
- ...rest,
1428
- children: [
1429
- indicatorPlacement === "start" && !noIndicator && indicator,
1430
- children,
1431
- indicatorPlacement === "end" && !noIndicator && indicator
1432
- ]
1433
- }
1434
- ) }) });
1435
- });
1436
- var AccordionItemContent = React33__namespace.forwardRef(function AccordionItemContent2(props, ref) {
1437
- const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
1438
- return /* @__PURE__ */ jsxRuntime.jsx(
1439
- AccordionPrimitive__namespace.Content,
1230
+ var AccordionItemTrigger = ({
1231
+ children,
1232
+ indicatorPlacement: placementProp,
1233
+ variant: variantProp,
1234
+ noIndicator,
1235
+ headingLevel = 3,
1236
+ ...rest
1237
+ }) => {
1238
+ const variant = variantProp ?? React32__namespace.useContext(Variant);
1239
+ const placement = variant === "faq" ? "start" : placementProp ?? "end";
1240
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Accordion.Header, { unstyled: true, render: `h${headingLevel}`, "aria-level": headingLevel, display: "flex", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
1241
+ gui.Accordion.Trigger,
1440
1242
  {
1441
- ref,
1442
- className: cn(
1443
- "overflow-hidden text-[var(--color-text-primary)]",
1444
- "data-[state=open]:animate-accordion-down",
1445
- "data-[state=closed]:animate-accordion-up",
1446
- className
1447
- ),
1243
+ unstyled: true,
1244
+ type: "button",
1245
+ width: "100%",
1246
+ flexDirection: "row",
1247
+ alignItems: "center",
1248
+ gap: 8,
1249
+ paddingVertical: 12,
1250
+ paddingHorizontal: 0,
1251
+ borderWidth: 0,
1252
+ backgroundColor: "transparent",
1253
+ cursor: "pointer",
1254
+ className: "lux-accordion-trigger",
1448
1255
  ...rest,
1449
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-3", children })
1256
+ children: (({ open }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1257
+ placement === "start" && !noIndicator && /* @__PURE__ */ jsxRuntime.jsx(Indicator2, { open, variant }),
1258
+ ink(children, void 0, { color: "inherit", textAlign: "left" }),
1259
+ placement === "end" && !noIndicator && /* @__PURE__ */ jsxRuntime.jsx(Indicator2, { open, variant })
1260
+ ] }))
1450
1261
  }
1451
- );
1452
- });
1262
+ ) });
1263
+ };
1264
+ var AccordionItemContent = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
1265
+ gui.Accordion.Content,
1266
+ {
1267
+ unstyled: true,
1268
+ overflow: "hidden",
1269
+ paddingBottom: 12,
1270
+ backgroundColor: "transparent",
1271
+ ...rest,
1272
+ children: ink(children, void 0, { color: "var(--color-text-primary)" })
1273
+ }
1274
+ );
1453
1275
  function useAccordion(items) {
1454
- const [value, setValue] = React33__namespace.useState([]);
1455
- const onValueChange = React33__namespace.useCallback(({ value: value2 }) => {
1456
- setValue(value2);
1276
+ const [value, setValue] = React32__namespace.useState([]);
1277
+ const onValueChange = React32__namespace.useCallback(({ value: next }) => {
1278
+ setValue(next);
1457
1279
  }, []);
1458
- const scrollToItemFromUrl = React33__namespace.useCallback(() => {
1280
+ const scrollToItemFromUrl = React32__namespace.useCallback(() => {
1459
1281
  const hash = window.location.hash.replace("#", "");
1460
- if (!hash) {
1461
- return;
1462
- }
1282
+ if (!hash) return;
1463
1283
  const itemToScroll = items.find((item) => item.id === hash);
1464
- if (itemToScroll) {
1465
- const el = document.getElementById(itemToScroll.id);
1466
- if (el) {
1467
- el.scrollIntoView({ behavior: "smooth", block: "start" });
1468
- }
1469
- setValue([itemToScroll.id]);
1470
- }
1284
+ if (!itemToScroll) return;
1285
+ document.getElementById(itemToScroll.id)?.scrollIntoView({ behavior: "smooth", block: "start" });
1286
+ setValue([itemToScroll.id]);
1471
1287
  }, [items]);
1472
- return React33__namespace.useMemo(() => {
1473
- return {
1474
- value,
1475
- onValueChange,
1476
- scrollToItemFromUrl
1477
- };
1478
- }, [value, onValueChange, scrollToItemFromUrl]);
1288
+ return React32__namespace.useMemo(
1289
+ () => ({ value, onValueChange, scrollToItemFromUrl }),
1290
+ [value, onValueChange, scrollToItemFromUrl]
1291
+ );
1479
1292
  }
1480
1293
  var SHIM_PROPS = [
1481
1294
  "w",
@@ -1593,7 +1406,7 @@ function stripShims(props) {
1593
1406
  }
1594
1407
  var SKELETON_CLASSES = "lux-skeleton rounded-sm";
1595
1408
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
1596
- var Skeleton = React33__namespace.forwardRef(
1409
+ var Skeleton = React32__namespace.forwardRef(
1597
1410
  function Skeleton2(props, ref) {
1598
1411
  const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
1599
1412
  const shimStyle = shimToStyle(props);
@@ -1602,10 +1415,10 @@ var Skeleton = React33__namespace.forwardRef(
1602
1415
  const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
1603
1416
  const htmlRest = stripShims(allRest);
1604
1417
  if (!loading) {
1605
- if (asChild && React33__namespace.isValidElement(children)) return children;
1418
+ if (asChild && React32__namespace.isValidElement(children)) return children;
1606
1419
  return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
1607
1420
  }
1608
- if (asChild && React33__namespace.isValidElement(children)) {
1421
+ if (asChild && React32__namespace.isValidElement(children)) {
1609
1422
  return /* @__PURE__ */ jsxRuntime.jsx(
1610
1423
  Component,
1611
1424
  {
@@ -1631,7 +1444,7 @@ var Skeleton = React33__namespace.forwardRef(
1631
1444
  );
1632
1445
  }
1633
1446
  );
1634
- var SkeletonCircle = React33__namespace.forwardRef(
1447
+ var SkeletonCircle = React32__namespace.forwardRef(
1635
1448
  function SkeletonCircle2(props, ref) {
1636
1449
  const { size = 40, loading = true, className, ...rest } = props;
1637
1450
  const dimension = typeof size === "number" ? `${size}px` : size;
@@ -1647,7 +1460,7 @@ var SkeletonCircle = React33__namespace.forwardRef(
1647
1460
  );
1648
1461
  }
1649
1462
  );
1650
- var SkeletonText = React33__namespace.forwardRef(
1463
+ var SkeletonText = React32__namespace.forwardRef(
1651
1464
  function SkeletonText2(props, ref) {
1652
1465
  const { noOfLines = 3, loading = true, className, ...rest } = props;
1653
1466
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -1673,7 +1486,7 @@ var STATUS_CLASSES = {
1673
1486
  success: "bg-[var(--color-alert-bg-success)]",
1674
1487
  error: "bg-[var(--color-alert-bg-error)]"
1675
1488
  };
1676
- var SIZE_CLASSES2 = {
1489
+ var SIZE_CLASSES = {
1677
1490
  sm: "gap-2 px-2 py-2 text-xs",
1678
1491
  md: "gap-2 px-3 py-2 text-base"
1679
1492
  };
@@ -1681,7 +1494,7 @@ var INDICATOR_SIZE_CLASSES = {
1681
1494
  sm: "w-5 h-5 my-0",
1682
1495
  md: "w-5 h-5 my-[2px]"
1683
1496
  };
1684
- var Alert = React33__namespace.forwardRef(
1497
+ var Alert = React32__namespace.forwardRef(
1685
1498
  function Alert2(props, ref) {
1686
1499
  const {
1687
1500
  title,
@@ -1706,7 +1519,7 @@ var Alert = React33__namespace.forwardRef(
1706
1519
  if (_mb !== void 0) shimStyle.marginBottom = typeof _mb === "number" ? `${_mb * 4}px` : _mb;
1707
1520
  if (_mt !== void 0) shimStyle.marginTop = typeof _mt === "number" ? `${_mt * 4}px` : _mt;
1708
1521
  const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
1709
- const [isOpen, setIsOpen] = React33__namespace.useState(true);
1522
+ const [isOpen, setIsOpen] = React32__namespace.useState(true);
1710
1523
  const resolvedSize = size ?? "md";
1711
1524
  const defaultIcon = /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon2, { className: "w-5 h-5" });
1712
1525
  const iconElement = (() => {
@@ -1721,7 +1534,7 @@ var Alert = React33__namespace.forwardRef(
1721
1534
  INDICATOR_SIZE_CLASSES[resolvedSize]
1722
1535
  ), children: icon || defaultIcon });
1723
1536
  })();
1724
- const handleClose = React33__namespace.useCallback(() => {
1537
+ const handleClose = React32__namespace.useCallback(() => {
1725
1538
  setIsOpen(false);
1726
1539
  onClose?.();
1727
1540
  }, [onClose]);
@@ -1752,7 +1565,7 @@ var Alert = React33__namespace.forwardRef(
1752
1565
  "div",
1753
1566
  {
1754
1567
  ref,
1755
- className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES2[resolvedSize], className),
1568
+ className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className),
1756
1569
  style: alertStyle,
1757
1570
  ...alertRest,
1758
1571
  children: [
@@ -1782,7 +1595,7 @@ var Alert = React33__namespace.forwardRef(
1782
1595
  ) });
1783
1596
  }
1784
1597
  );
1785
- var SIZE_CLASSES3 = {
1598
+ var SIZE_CLASSES2 = {
1786
1599
  xs: "h-6 w-6 text-[10px]",
1787
1600
  sm: "h-8 w-8 text-xs",
1788
1601
  md: "h-10 w-10 text-sm",
@@ -1797,11 +1610,11 @@ var VARIANT_CLASSES = {
1797
1610
  };
1798
1611
  var DEFAULT_SIZE = "md";
1799
1612
  var DEFAULT_VARIANT = "subtle";
1800
- var AvatarGroupContext = React33__namespace.createContext({});
1613
+ var AvatarGroupContext = React32__namespace.createContext({});
1801
1614
  function useAvatarGroupContext() {
1802
- return React33__namespace.useContext(AvatarGroupContext);
1615
+ return React32__namespace.useContext(AvatarGroupContext);
1803
1616
  }
1804
- var Avatar = React33__namespace.forwardRef(
1617
+ var Avatar = React32__namespace.forwardRef(
1805
1618
  function Avatar2(props, ref) {
1806
1619
  const group = useAvatarGroupContext();
1807
1620
  const {
@@ -1828,7 +1641,7 @@ var Avatar = React33__namespace.forwardRef(
1828
1641
  unstyled: true,
1829
1642
  className: cn(
1830
1643
  "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
1831
- SIZE_CLASSES3[size],
1644
+ SIZE_CLASSES2[size],
1832
1645
  VARIANT_CLASSES[variant],
1833
1646
  !isBorderless && "ring-2 ring-white dark:ring-gray-900",
1834
1647
  className
@@ -1852,7 +1665,7 @@ var Avatar = React33__namespace.forwardRef(
1852
1665
  );
1853
1666
  }
1854
1667
  );
1855
- var AvatarFallback = React33__namespace.forwardRef(
1668
+ var AvatarFallback = React32__namespace.forwardRef(
1856
1669
  function AvatarFallback2(props, ref) {
1857
1670
  const { name, icon, children, className, ...rest } = props;
1858
1671
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1880,10 +1693,10 @@ function getInitials(name) {
1880
1693
  const lastName = names.length > 1 ? names[names.length - 1] : "";
1881
1694
  return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
1882
1695
  }
1883
- var AvatarGroup = React33__namespace.forwardRef(
1696
+ var AvatarGroup = React32__namespace.forwardRef(
1884
1697
  function AvatarGroup2(props, ref) {
1885
1698
  const { size, variant, borderless, className, ...rest } = props;
1886
- const contextValue = React33__namespace.useMemo(
1699
+ const contextValue = React32__namespace.useMemo(
1887
1700
  () => ({ size, variant, borderless }),
1888
1701
  [size, variant, borderless]
1889
1702
  );
@@ -1901,7 +1714,7 @@ function mapPlacement(p) {
1901
1714
  if (!p) return void 0;
1902
1715
  return p;
1903
1716
  }
1904
- var Tooltip = React33__namespace.forwardRef(
1717
+ var Tooltip = React32__namespace.forwardRef(
1905
1718
  function Tooltip2(props, ref) {
1906
1719
  const {
1907
1720
  showArrow: showArrowProp,
@@ -1920,28 +1733,28 @@ var Tooltip = React33__namespace.forwardRef(
1920
1733
  interactive,
1921
1734
  positioning
1922
1735
  } = props;
1923
- const [open, setOpen] = React33__namespace.useState(defaultOpen);
1924
- const timeoutRef = React33__namespace.useRef(null);
1736
+ const [open, setOpen] = React32__namespace.useState(defaultOpen);
1737
+ const timeoutRef = React32__namespace.useRef(null);
1925
1738
  const isMobile = useIsTouch();
1926
- const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
1739
+ const handleOpenChange = React32__namespace.useCallback((nextOpen) => {
1927
1740
  setOpen(nextOpen);
1928
1741
  onOpenChange?.({ open: nextOpen });
1929
1742
  }, [onOpenChange]);
1930
- const handleOpenChangeManual = React33__namespace.useCallback((nextOpen) => {
1743
+ const handleOpenChangeManual = React32__namespace.useCallback((nextOpen) => {
1931
1744
  timeoutRef.current && window.clearTimeout(timeoutRef.current);
1932
1745
  timeoutRef.current = window.setTimeout(() => {
1933
1746
  setOpen(nextOpen);
1934
1747
  onOpenChange?.({ open: nextOpen });
1935
1748
  }, nextOpen ? openDelay : closeDelay);
1936
1749
  }, [closeDelay, openDelay, onOpenChange]);
1937
- const handleClickAway = React33__namespace.useCallback(() => {
1750
+ const handleClickAway = React32__namespace.useCallback(() => {
1938
1751
  if (open) handleOpenChangeManual(false);
1939
1752
  }, [open, handleOpenChangeManual]);
1940
1753
  const triggerRef = usehooks.useClickAway(handleClickAway);
1941
- const handleTriggerClick = React33__namespace.useCallback(() => {
1754
+ const handleTriggerClick = React32__namespace.useCallback(() => {
1942
1755
  handleOpenChangeManual(!open);
1943
1756
  }, [handleOpenChangeManual, open]);
1944
- const handleContentClick = React33__namespace.useCallback((event) => {
1757
+ const handleContentClick = React32__namespace.useCallback((event) => {
1945
1758
  event.stopPropagation();
1946
1759
  if (interactive) {
1947
1760
  const closestLink = event.target?.closest("a");
@@ -1950,7 +1763,7 @@ var Tooltip = React33__namespace.forwardRef(
1950
1763
  }
1951
1764
  }
1952
1765
  }, [interactive, handleOpenChangeManual]);
1953
- React33__namespace.useEffect(() => {
1766
+ React32__namespace.useEffect(() => {
1954
1767
  return () => {
1955
1768
  if (timeoutRef.current) {
1956
1769
  clearTimeout(timeoutRef.current);
@@ -2022,7 +1835,7 @@ function TruncatedTextTooltip({ label, children }) {
2022
1835
  return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
2023
1836
  }
2024
1837
  var BASE_CLASSES = "inline-flex items-center rounded-sm gap-1 font-medium w-fit max-w-full whitespace-nowrap select-text";
2025
- var SIZE_CLASSES4 = {
1838
+ var SIZE_CLASSES3 = {
2026
1839
  sm: "text-xs p-1 h-[18px] min-h-[18px]",
2027
1840
  md: "text-sm px-1 py-0.5 min-h-6",
2028
1841
  lg: "text-sm px-2 py-1 min-h-7 font-semibold"
@@ -2052,7 +1865,7 @@ var COLOR_PALETTE_CLASSES = {
2052
1865
  bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
2053
1866
  };
2054
1867
  var S2 = 4;
2055
- var Badge = React33__namespace.default.forwardRef(
1868
+ var Badge = React32__namespace.default.forwardRef(
2056
1869
  function Badge2(props, ref) {
2057
1870
  const {
2058
1871
  loading,
@@ -2092,7 +1905,7 @@ var Badge = React33__namespace.default.forwardRef(
2092
1905
  ref,
2093
1906
  className: cn(
2094
1907
  BASE_CLASSES,
2095
- SIZE_CLASSES4[size],
1908
+ SIZE_CLASSES3[size],
2096
1909
  COLOR_PALETTE_CLASSES[colorPalette],
2097
1910
  className
2098
1911
  ),
@@ -2301,7 +2114,7 @@ function buildShimStyle(props) {
2301
2114
  if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
2302
2115
  return Object.keys(s).length > 0 ? s : void 0;
2303
2116
  }
2304
- var Button = React33__namespace.forwardRef(
2117
+ var Button = React32__namespace.forwardRef(
2305
2118
  function Button2(props, ref) {
2306
2119
  const {
2307
2120
  className,
@@ -2392,7 +2205,7 @@ var Button = React33__namespace.forwardRef(
2392
2205
  return button;
2393
2206
  }
2394
2207
  );
2395
- var SIZE_CLASSES5 = {
2208
+ var SIZE_CLASSES4 = {
2396
2209
  "2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
2397
2210
  xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
2398
2211
  sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
@@ -2401,9 +2214,9 @@ var SIZE_CLASSES5 = {
2401
2214
  function buttonVariants(opts) {
2402
2215
  const v = opts?.variant ?? "solid";
2403
2216
  const s = opts?.size ?? "md";
2404
- return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES5[s] ?? ""].filter(Boolean).join(" ");
2217
+ return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES4[s] ?? ""].filter(Boolean).join(" ");
2405
2218
  }
2406
- var ButtonGroup = React33__namespace.forwardRef(
2219
+ var ButtonGroup = React32__namespace.forwardRef(
2407
2220
  function ButtonGroup2(props, ref) {
2408
2221
  const { className, ...rest } = props;
2409
2222
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2417,7 +2230,7 @@ var ButtonGroup = React33__namespace.forwardRef(
2417
2230
  );
2418
2231
  }
2419
2232
  );
2420
- var ButtonGroupRadio = React33__namespace.forwardRef(
2233
+ var ButtonGroupRadio = React32__namespace.forwardRef(
2421
2234
  function ButtonGroupRadio2(props, ref) {
2422
2235
  const {
2423
2236
  children,
@@ -2429,24 +2242,24 @@ var ButtonGroupRadio = React33__namespace.forwardRef(
2429
2242
  className,
2430
2243
  ...rest
2431
2244
  } = props;
2432
- const firstChildValue = React33__namespace.useMemo(() => {
2245
+ const firstChildValue = React32__namespace.useMemo(() => {
2433
2246
  const firstChild = Array.isArray(children) ? children[0] : void 0;
2434
2247
  return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
2435
2248
  }, [children]);
2436
- const [value, setValue] = React33__namespace.useState(defaultValue ?? firstChildValue);
2437
- const handleItemClick = React33__namespace.useCallback((event) => {
2249
+ const [value, setValue] = React32__namespace.useState(defaultValue ?? firstChildValue);
2250
+ const handleItemClick = React32__namespace.useCallback((event) => {
2438
2251
  const v = event.currentTarget.value;
2439
2252
  setValue(v);
2440
2253
  onChange?.(v);
2441
2254
  }, [onChange]);
2442
- const clonedChildren = React33__namespace.Children.map(children, (child) => {
2443
- return React33__namespace.cloneElement(child, {
2255
+ const clonedChildren = React32__namespace.Children.map(children, (child) => {
2256
+ return React32__namespace.cloneElement(child, {
2444
2257
  onClick: handleItemClick,
2445
2258
  selected: value === child.props.value,
2446
2259
  variant
2447
2260
  });
2448
2261
  });
2449
- const childrenLength = React33__namespace.Children.count(children);
2262
+ const childrenLength = React32__namespace.Children.count(children);
2450
2263
  return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxRuntime.jsx(
2451
2264
  "div",
2452
2265
  {
@@ -2466,11 +2279,11 @@ var ButtonGroupRadio = React33__namespace.forwardRef(
2466
2279
  );
2467
2280
  var NOOP = () => {
2468
2281
  };
2469
- var CheckboxGroupContext = React33__namespace.createContext(null);
2282
+ var CheckboxGroupContext = React32__namespace.createContext(null);
2470
2283
  function useCheckboxGroupContext() {
2471
- return React33__namespace.useContext(CheckboxGroupContext);
2284
+ return React32__namespace.useContext(CheckboxGroupContext);
2472
2285
  }
2473
- var CheckboxGroupBase = React33__namespace.forwardRef(
2286
+ var CheckboxGroupBase = React32__namespace.forwardRef(
2474
2287
  function CheckboxGroup(props, ref) {
2475
2288
  const {
2476
2289
  children,
@@ -2482,10 +2295,10 @@ var CheckboxGroupBase = React33__namespace.forwardRef(
2482
2295
  className,
2483
2296
  ...rest
2484
2297
  } = props;
2485
- const [uncontrolledValue, setUncontrolledValue] = React33__namespace.useState(defaultValue ?? []);
2298
+ const [uncontrolledValue, setUncontrolledValue] = React32__namespace.useState(defaultValue ?? []);
2486
2299
  const isControlled = controlledValue !== void 0;
2487
2300
  const value = isControlled ? controlledValue : uncontrolledValue;
2488
- const toggle = React33__namespace.useCallback(
2301
+ const toggle = React32__namespace.useCallback(
2489
2302
  (itemValue) => {
2490
2303
  const next = value.includes(itemValue) ? value.filter((v) => v !== itemValue) : [...value, itemValue];
2491
2304
  if (!isControlled) {
@@ -2495,12 +2308,12 @@ var CheckboxGroupBase = React33__namespace.forwardRef(
2495
2308
  },
2496
2309
  [value, isControlled, onValueChange]
2497
2310
  );
2498
- React33__namespace.useEffect(() => {
2311
+ React32__namespace.useEffect(() => {
2499
2312
  if (isControlled) {
2500
2313
  setUncontrolledValue(controlledValue);
2501
2314
  }
2502
2315
  }, [isControlled, controlledValue]);
2503
- const ctx = React33__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
2316
+ const ctx = React32__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
2504
2317
  return /* @__PURE__ */ jsxRuntime.jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
2505
2318
  "div",
2506
2319
  {
@@ -2518,7 +2331,7 @@ var CheckboxGroupBase = React33__namespace.forwardRef(
2518
2331
  }
2519
2332
  );
2520
2333
  var CheckboxGroup2 = CheckboxGroupBase;
2521
- var SIZE_CLASSES6 = {
2334
+ var SIZE_CLASSES5 = {
2522
2335
  sm: {
2523
2336
  root: "gap-1.5",
2524
2337
  control: "h-3.5 w-3.5 rounded-sm",
@@ -2558,7 +2371,7 @@ var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
2558
2371
  children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
2559
2372
  }
2560
2373
  );
2561
- var CheckboxBase = React33__namespace.forwardRef(
2374
+ var CheckboxBase = React32__namespace.forwardRef(
2562
2375
  function Checkbox(props, ref) {
2563
2376
  const {
2564
2377
  icon,
@@ -2579,8 +2392,8 @@ var CheckboxBase = React33__namespace.forwardRef(
2579
2392
  ...rest
2580
2393
  } = props;
2581
2394
  const group = useCheckboxGroupContext();
2582
- const hiddenInputRef = React33__namespace.useRef(null);
2583
- const setHiddenInputRef = React33__namespace.useCallback(
2395
+ const hiddenInputRef = React32__namespace.useRef(null);
2396
+ const setHiddenInputRef = React32__namespace.useCallback(
2584
2397
  (node) => {
2585
2398
  hiddenInputRef.current = node;
2586
2399
  if (typeof ref === "function") {
@@ -2593,7 +2406,7 @@ var CheckboxBase = React33__namespace.forwardRef(
2593
2406
  );
2594
2407
  const isInGroup = group !== null && value !== void 0;
2595
2408
  const groupChecked = isInGroup ? group.value.includes(value) : void 0;
2596
- const [internalChecked, setInternalChecked] = React33__namespace.useState(
2409
+ const [internalChecked, setInternalChecked] = React32__namespace.useState(
2597
2410
  defaultChecked ?? false
2598
2411
  );
2599
2412
  const isControlled = checkedProp !== void 0 || isInGroup;
@@ -2605,7 +2418,7 @@ var CheckboxBase = React33__namespace.forwardRef(
2605
2418
  } else {
2606
2419
  checkedState = internalChecked;
2607
2420
  }
2608
- const handleCheckedChange = React33__namespace.useCallback(
2421
+ const handleCheckedChange = React32__namespace.useCallback(
2609
2422
  (nextChecked) => {
2610
2423
  if (readOnly) return;
2611
2424
  if (!isControlled) {
@@ -2628,7 +2441,7 @@ var CheckboxBase = React33__namespace.forwardRef(
2628
2441
  },
2629
2442
  [readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
2630
2443
  );
2631
- const sizeClasses2 = SIZE_CLASSES6[size];
2444
+ const sizeClasses2 = SIZE_CLASSES5[size];
2632
2445
  return /* @__PURE__ */ jsxRuntime.jsxs(
2633
2446
  "label",
2634
2447
  {
@@ -2770,7 +2583,7 @@ function resolveSpacing(v) {
2770
2583
  }
2771
2584
  return void 0;
2772
2585
  }
2773
- var Link = React33__namespace.default.forwardRef(
2586
+ var Link = React32__namespace.default.forwardRef(
2774
2587
  function Link2(props, ref) {
2775
2588
  const {
2776
2589
  external,
@@ -2859,7 +2672,7 @@ var Link = React33__namespace.default.forwardRef(
2859
2672
  ) });
2860
2673
  }
2861
2674
  );
2862
- var LinkBox = React33__namespace.default.forwardRef(
2675
+ var LinkBox = React32__namespace.default.forwardRef(
2863
2676
  function LinkBox2(props, ref) {
2864
2677
  const { className, ...rest } = props;
2865
2678
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2872,7 +2685,7 @@ var LinkBox = React33__namespace.default.forwardRef(
2872
2685
  );
2873
2686
  }
2874
2687
  );
2875
- var LinkOverlay = React33__namespace.default.forwardRef(
2688
+ var LinkOverlay = React32__namespace.default.forwardRef(
2876
2689
  function LinkOverlay2(props, ref) {
2877
2690
  const {
2878
2691
  children,
@@ -2953,8 +2766,8 @@ var LinkOverlay = React33__namespace.default.forwardRef(
2953
2766
  }
2954
2767
  );
2955
2768
  function useUpdateEffect(effect, deps) {
2956
- const isFirstMount = React33__namespace.default.useRef(true);
2957
- React33__namespace.default.useEffect(() => {
2769
+ const isFirstMount = React32__namespace.default.useRef(true);
2770
+ React32__namespace.default.useEffect(() => {
2958
2771
  if (isFirstMount.current) {
2959
2772
  isFirstMount.current = false;
2960
2773
  return;
@@ -2963,71 +2776,81 @@ function useUpdateEffect(effect, deps) {
2963
2776
  }, deps);
2964
2777
  }
2965
2778
  function scrollToElement(id) {
2966
- const el = document.getElementById(id);
2967
- if (el) {
2968
- el.scrollIntoView({ behavior: "smooth", block: "start" });
2969
- }
2779
+ document.getElementById(id)?.scrollIntoView({ behavior: "smooth", block: "start" });
2970
2780
  }
2971
2781
  var CUT_ID = "CollapsibleDetails";
2972
2782
  var CollapsibleDetails = (props) => {
2973
- const { children, id = CUT_ID, onClick, isExpanded: isExpandedProp = false, text: textProp, loading, noScroll, ...rest } = props;
2974
- const [isExpanded, setIsExpanded] = React33__namespace.default.useState(isExpandedProp);
2975
- const handleClick = React33__namespace.default.useCallback((event) => {
2783
+ const {
2784
+ children,
2785
+ id = CUT_ID,
2786
+ onClick,
2787
+ isExpanded: isExpandedProp = false,
2788
+ text: textProp,
2789
+ loading,
2790
+ noScroll,
2791
+ ...rest
2792
+ } = props;
2793
+ const [isExpanded, setIsExpanded] = React32__namespace.default.useState(isExpandedProp);
2794
+ const handleClick = React32__namespace.default.useCallback((event) => {
2976
2795
  setIsExpanded((flag) => !flag);
2977
- if (!noScroll) {
2978
- scrollToElement(id);
2979
- }
2796
+ if (!noScroll) scrollToElement(id);
2980
2797
  onClick?.(event);
2981
2798
  }, [id, noScroll, onClick]);
2982
2799
  useUpdateEffect(() => {
2983
2800
  setIsExpanded(isExpandedProp);
2984
- if (isExpandedProp && !noScroll) {
2985
- scrollToElement(id);
2986
- }
2801
+ if (isExpandedProp && !noScroll) scrollToElement(id);
2987
2802
  }, [isExpandedProp, id, noScroll]);
2988
2803
  const text = isExpanded ? textProp?.[1] ?? "Hide details" : textProp?.[0] ?? "View details";
2989
- return /* @__PURE__ */ jsxRuntime.jsxs(Collapsible__namespace.Root, { open: isExpanded, children: [
2990
- /* @__PURE__ */ jsxRuntime.jsx(Collapsible__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2804
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Collapsible, { open: isExpanded, onOpenChange: setIsExpanded, children: [
2805
+ /* @__PURE__ */ jsxRuntime.jsx(
2991
2806
  Link,
2992
2807
  {
2993
2808
  className: "text-sm underline decoration-dashed w-fit",
2809
+ "aria-expanded": isExpanded,
2994
2810
  onClick: handleClick,
2995
2811
  loading,
2996
2812
  ...rest,
2997
2813
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { id, children: text })
2998
2814
  }
2999
- ) }),
3000
- /* @__PURE__ */ jsxRuntime.jsx(Collapsible__namespace.Content, { children })
2815
+ ),
2816
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Collapsible.Content, { children })
3001
2817
  ] });
3002
2818
  };
2819
+ var CUT_LENGTH = 3;
3003
2820
  var CollapsibleList = (props) => {
3004
- const CUT_LENGTH = 3;
3005
- const { items, renderItem, triggerProps, cutLength = CUT_LENGTH, text: textProp, defaultExpanded = false, className, ...rest } = props;
3006
- const [isExpanded, setIsExpanded] = React33__namespace.default.useState(defaultExpanded);
3007
- React33__namespace.default.useEffect(() => {
2821
+ const {
2822
+ items,
2823
+ renderItem,
2824
+ triggerProps,
2825
+ cutLength = CUT_LENGTH,
2826
+ text: textProp,
2827
+ defaultExpanded = false,
2828
+ ...rest
2829
+ } = props;
2830
+ const [isExpanded, setIsExpanded] = React32__namespace.default.useState(defaultExpanded);
2831
+ React32__namespace.default.useEffect(() => {
3008
2832
  setIsExpanded(defaultExpanded);
3009
2833
  }, [defaultExpanded]);
3010
- const handleToggle = React33__namespace.default.useCallback(() => {
3011
- setIsExpanded((flag) => !flag);
3012
- }, []);
2834
+ const handleToggle = React32__namespace.default.useCallback(() => setIsExpanded((flag) => !flag), []);
3013
2835
  const text = isExpanded ? textProp?.[1] ?? "Hide" : textProp?.[0] ?? "Show all";
3014
- return /* @__PURE__ */ jsxRuntime.jsx(Collapsible__namespace.Root, { open: isExpanded, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col w-full", className), ...rest, children: [
2836
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { width: "100%", ...rest, children: [
3015
2837
  items.slice(0, isExpanded ? void 0 : cutLength).map(renderItem),
3016
- items.length > cutLength && /* @__PURE__ */ jsxRuntime.jsx(Collapsible__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2838
+ items.length > cutLength && /* @__PURE__ */ jsxRuntime.jsx(
3017
2839
  Link,
3018
2840
  {
3019
2841
  className: "text-sm underline decoration-dashed w-fit min-w-0",
2842
+ "aria-expanded": isExpanded,
3020
2843
  onClick: handleToggle,
3021
2844
  ...triggerProps,
3022
2845
  children: text
3023
2846
  }
3024
- ) })
3025
- ] }) });
2847
+ )
2848
+ ] });
3026
2849
  };
3027
- var ColorModeContext = React33__namespace.createContext(void 0);
2850
+ var ColorModeContext = React32__namespace.createContext(void 0);
3028
2851
  function ColorModeProvider(props) {
3029
2852
  const { children, defaultTheme = "light", value: controlledValue, onValueChange } = props;
3030
- const [internalMode, setInternalMode] = React33__namespace.useState(() => {
2853
+ const [internalMode, setInternalMode] = React32__namespace.useState(() => {
3031
2854
  if (controlledValue === "dark" || controlledValue === "light") {
3032
2855
  return controlledValue;
3033
2856
  }
@@ -3037,7 +2860,7 @@ function ColorModeProvider(props) {
3037
2860
  return defaultTheme === "dark" ? "dark" : "light";
3038
2861
  });
3039
2862
  const colorMode = controlledValue === "dark" || controlledValue === "light" ? controlledValue : internalMode;
3040
- const setColorMode = React33__namespace.useCallback((mode) => {
2863
+ const setColorMode = React32__namespace.useCallback((mode) => {
3041
2864
  const resolved = mode === "dark" ? "dark" : "light";
3042
2865
  setInternalMode(resolved);
3043
2866
  onValueChange?.(resolved);
@@ -3046,19 +2869,19 @@ function ColorModeProvider(props) {
3046
2869
  document.documentElement.classList.toggle("light", resolved === "light");
3047
2870
  }
3048
2871
  }, [onValueChange]);
3049
- const toggleColorMode = React33__namespace.useCallback(() => {
2872
+ const toggleColorMode = React32__namespace.useCallback(() => {
3050
2873
  setColorMode(colorMode === "dark" ? "light" : "dark");
3051
2874
  }, [colorMode, setColorMode]);
3052
- const ctx = React33__namespace.useMemo(
2875
+ const ctx = React32__namespace.useMemo(
3053
2876
  () => ({ colorMode, setColorMode, toggleColorMode }),
3054
2877
  [colorMode, setColorMode, toggleColorMode]
3055
2878
  );
3056
2879
  return /* @__PURE__ */ jsxRuntime.jsx(ColorModeContext.Provider, { value: ctx, children });
3057
2880
  }
3058
2881
  function useColorMode() {
3059
- const ctx = React33__namespace.useContext(ColorModeContext);
2882
+ const ctx = React32__namespace.useContext(ColorModeContext);
3060
2883
  if (!ctx) {
3061
- const [mode, setMode] = React33__namespace.useState(() => {
2884
+ const [mode, setMode] = React32__namespace.useState(() => {
3062
2885
  if (typeof document !== "undefined" && document.documentElement.classList.contains("dark")) {
3063
2886
  return "dark";
3064
2887
  }
@@ -3102,9 +2925,9 @@ function BackToButton({ onClick }) {
3102
2925
  }
3103
2926
  );
3104
2927
  }
3105
- var DialogSizeContext = React33__namespace.createContext({ size: "md" });
2928
+ var DialogSizeContext = React32__namespace.createContext({ size: "md" });
3106
2929
  function useDialogSizeContext() {
3107
- return React33__namespace.useContext(DialogSizeContext);
2930
+ return React32__namespace.useContext(DialogSizeContext);
3108
2931
  }
3109
2932
  var CONTENT_SIZE_MAP = {
3110
2933
  sm: "max-w-[400px]",
@@ -3136,13 +2959,13 @@ var DialogRoot = ({
3136
2959
  modal = true
3137
2960
  // motionPreset is intentionally unused -- kept for API compat
3138
2961
  }) => {
3139
- const handleOpenChange = React33__namespace.useCallback(
2962
+ const handleOpenChange = React32__namespace.useCallback(
3140
2963
  (nextOpen) => {
3141
2964
  onOpenChange?.({ open: nextOpen });
3142
2965
  },
3143
2966
  [onOpenChange]
3144
2967
  );
3145
- const ctx = React33__namespace.useMemo(() => ({ size }), [size]);
2968
+ const ctx = React32__namespace.useMemo(() => ({ size }), [size]);
3146
2969
  return /* @__PURE__ */ jsxRuntime.jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
3147
2970
  gui.Dialog,
3148
2971
  {
@@ -3154,7 +2977,7 @@ var DialogRoot = ({
3154
2977
  }
3155
2978
  ) });
3156
2979
  };
3157
- var DialogContent = React33__namespace.forwardRef(function DialogContent2(props, ref) {
2980
+ var DialogContent = React32__namespace.forwardRef(function DialogContent2(props, ref) {
3158
2981
  const {
3159
2982
  children,
3160
2983
  portalled: _portalled = true,
@@ -3211,11 +3034,11 @@ var DialogContent = React33__namespace.forwardRef(function DialogContent2(props,
3211
3034
  )
3212
3035
  ] });
3213
3036
  });
3214
- var DialogCloseTrigger = React33__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
3037
+ var DialogCloseTrigger = React32__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
3215
3038
  const { className, ...rest } = props;
3216
3039
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
3217
3040
  });
3218
- var DialogHeader = React33__namespace.forwardRef(function DialogHeader2(props, ref) {
3041
+ var DialogHeader = React32__namespace.forwardRef(function DialogHeader2(props, ref) {
3219
3042
  const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
3220
3043
  const startElement = startElementProp ?? (onBackToClick ? /* @__PURE__ */ jsxRuntime.jsx(BackToButton, { onClick: onBackToClick }) : void 0);
3221
3044
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3245,7 +3068,7 @@ var DialogHeader = React33__namespace.forwardRef(function DialogHeader2(props, r
3245
3068
  }
3246
3069
  );
3247
3070
  });
3248
- var DialogBody = React33__namespace.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
3071
+ var DialogBody = React32__namespace.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
3249
3072
  const bodyStyle = {
3250
3073
  ...styleProp,
3251
3074
  ...pt !== void 0 ? { paddingTop: typeof pt === "number" ? `${pt * 4}px` : pt } : {},
@@ -3262,7 +3085,7 @@ var DialogBody = React33__namespace.forwardRef(function DialogBody2({ className,
3262
3085
  }
3263
3086
  );
3264
3087
  });
3265
- var DialogFooter = React33__namespace.forwardRef(function DialogFooter2({ className, ...props }, ref) {
3088
+ var DialogFooter = React32__namespace.forwardRef(function DialogFooter2({ className, ...props }, ref) {
3266
3089
  return /* @__PURE__ */ jsxRuntime.jsx(
3267
3090
  "div",
3268
3091
  {
@@ -3282,7 +3105,7 @@ function upperFirst(str) {
3282
3105
  return str.charAt(0).toUpperCase() + str.slice(1);
3283
3106
  }
3284
3107
  var ICONS = {};
3285
- var EmptyState = React33__namespace.forwardRef(
3108
+ var EmptyState = React32__namespace.forwardRef(
3286
3109
  function EmptyState2(props, ref) {
3287
3110
  const { title, description, term, type = "query", icon, children, className, ...rest } = props;
3288
3111
  const titleContent = (() => {
@@ -3342,7 +3165,18 @@ function getComponentDisplayName(type) {
3342
3165
  if ("displayName" in type) return type.displayName;
3343
3166
  return void 0;
3344
3167
  }
3345
- var Field = React33__namespace.forwardRef(
3168
+ var ERROR = "var(--color-text-error)";
3169
+ var MUTED = "var(--color-text-secondary)";
3170
+ var Marks = ({ required, optionalText, errorText }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3171
+ required && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { color: ERROR, "aria-hidden": true, children: "*" }),
3172
+ !required && optionalText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, color: MUTED, children: optionalText }),
3173
+ errorText && /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 14, color: ERROR, children: [
3174
+ "-",
3175
+ space,
3176
+ errorText
3177
+ ] })
3178
+ ] });
3179
+ var Field = React32__namespace.forwardRef(
3346
3180
  function Field2(props, ref) {
3347
3181
  const {
3348
3182
  label,
@@ -3360,148 +3194,92 @@ var Field = React33__namespace.forwardRef(
3360
3194
  className,
3361
3195
  style
3362
3196
  } = props;
3197
+ const flags = {
3198
+ "data-disabled": disabled || void 0,
3199
+ "data-readonly": readOnly || void 0,
3200
+ "data-invalid": invalid || void 0
3201
+ };
3363
3202
  if (floating && label) {
3364
- const injectedProps2 = {
3365
- className: "peer",
3366
- placeholder: " ",
3367
- size,
3368
- floating,
3369
- disabled,
3370
- readOnly
3371
- };
3203
+ const injectedProps = { className: "lux-field-control", placeholder: " ", size, floating, disabled, readOnly };
3372
3204
  const labelElement = /* @__PURE__ */ jsxRuntime.jsxs(
3373
- LabelPrimitive__namespace.Root,
3205
+ gui.Label,
3374
3206
  {
3375
- className: cn(
3376
- "absolute left-3 top-1/2 -translate-y-1/2",
3377
- "text-[var(--color-input-placeholder,theme(colors.gray.400))]",
3378
- "pointer-events-none select-none",
3379
- "origin-top-left transition-all duration-150",
3380
- "peer-focus:top-1 peer-focus:translate-y-0 peer-focus:scale-75",
3381
- "peer-[:not(:placeholder-shown)]:top-1 peer-[:not(:placeholder-shown)]:translate-y-0 peer-[:not(:placeholder-shown)]:scale-75"
3382
- ),
3383
3207
  htmlFor: id,
3208
+ position: "absolute",
3209
+ left: 12,
3210
+ top: "50%",
3211
+ pointerEvents: "none",
3212
+ userSelect: "none",
3213
+ flexDirection: "row",
3214
+ gap: 4,
3215
+ color: "var(--color-input-placeholder)",
3216
+ className: "lux-field-float",
3384
3217
  children: [
3385
3218
  label,
3386
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-0.5 text-[var(--color-fg-error,theme(colors.red.500))]", "aria-hidden": "true", children: "*" }),
3387
- !required && optionalText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[var(--color-text-secondary,theme(colors.gray.400))] text-sm", children: optionalText }),
3388
- errorText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-0.5 text-[var(--color-fg-error,theme(colors.red.500))] text-sm", children: [
3389
- "-",
3390
- space,
3391
- errorText
3392
- ] })
3219
+ /* @__PURE__ */ jsxRuntime.jsx(Marks, { required, optionalText, errorText })
3393
3220
  ]
3394
3221
  }
3395
3222
  );
3396
- const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-xs text-[var(--color-text-secondary,theme(colors.gray.400))]", children: helperText }) : null;
3397
- const child2 = React33__namespace.Children.only(children);
3223
+ const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginTop: 6, fontSize: 12, color: MUTED, children: helperText }) : null;
3224
+ const child2 = React32__namespace.Children.only(children);
3398
3225
  const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
3399
3226
  if (isInputGroup) {
3400
- const inputElement2 = React33__namespace.cloneElement(
3401
- React33__namespace.Children.only(child2.props.children),
3402
- injectedProps2
3403
- );
3404
- const groupInputElement = React33__namespace.cloneElement(
3405
- child2,
3406
- {},
3407
- inputElement2,
3408
- labelElement
3227
+ const inputElement = React32__namespace.cloneElement(
3228
+ React32__namespace.Children.only(child2.props.children),
3229
+ injectedProps
3409
3230
  );
3410
- return /* @__PURE__ */ jsxRuntime.jsxs(
3411
- "div",
3412
- {
3413
- ref,
3414
- id,
3415
- className: cn("relative w-full", className),
3416
- style,
3417
- "data-disabled": disabled || void 0,
3418
- "data-readonly": readOnly || void 0,
3419
- "data-invalid": invalid || void 0,
3420
- children: [
3421
- groupInputElement,
3422
- helperTextElement
3423
- ]
3424
- }
3425
- );
3426
- }
3427
- const inputElement = React33__namespace.cloneElement(child2, injectedProps2);
3428
- return /* @__PURE__ */ jsxRuntime.jsxs(
3429
- "div",
3231
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { ref, id, position: "relative", width: "100%", className, style, ...flags, children: [
3232
+ React32__namespace.cloneElement(child2, {}, inputElement, labelElement),
3233
+ helperTextElement
3234
+ ] });
3235
+ }
3236
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { ref, id, position: "relative", width: "100%", className, style, ...flags, children: [
3237
+ React32__namespace.cloneElement(child2, injectedProps),
3238
+ labelElement,
3239
+ helperTextElement
3240
+ ] });
3241
+ }
3242
+ const child = React32__namespace.Children.only(children);
3243
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { ref, id, gap: 4, className, style, ...flags, children: [
3244
+ label && /* @__PURE__ */ jsxRuntime.jsxs(
3245
+ gui.Label,
3430
3246
  {
3431
- ref,
3432
- id,
3433
- className: cn("relative w-full", className),
3434
- style,
3435
- "data-disabled": disabled || void 0,
3436
- "data-readonly": readOnly || void 0,
3437
- "data-invalid": invalid || void 0,
3247
+ htmlFor: id,
3248
+ flexDirection: "row",
3249
+ gap: 4,
3250
+ fontSize: 14,
3251
+ fontWeight: "500",
3252
+ color: "var(--color-text-primary)",
3253
+ opacity: disabled ? 0.4 : 1,
3438
3254
  children: [
3439
- inputElement,
3440
- labelElement,
3441
- helperTextElement
3255
+ label,
3256
+ /* @__PURE__ */ jsxRuntime.jsx(Marks, { required, optionalText })
3442
3257
  ]
3443
3258
  }
3444
- );
3445
- }
3446
- const injectedProps = {
3447
- size
3448
- };
3449
- const child = React33__namespace.Children.only(children);
3450
- const clonedChild = React33__namespace.cloneElement(child, injectedProps);
3451
- return /* @__PURE__ */ jsxRuntime.jsxs(
3452
- "div",
3453
- {
3454
- ref,
3455
- id,
3456
- className: cn("flex flex-col gap-1", className),
3457
- style,
3458
- "data-disabled": disabled || void 0,
3459
- "data-readonly": readOnly || void 0,
3460
- "data-invalid": invalid || void 0,
3461
- children: [
3462
- label && /* @__PURE__ */ jsxRuntime.jsxs(
3463
- LabelPrimitive__namespace.Root,
3464
- {
3465
- className: cn(
3466
- "text-sm font-medium text-[var(--color-field-label,theme(colors.gray.700))]",
3467
- "dark:text-[var(--color-field-label,theme(colors.gray.300))]",
3468
- disabled && "opacity-40"
3469
- ),
3470
- htmlFor: id,
3471
- children: [
3472
- label,
3473
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-0.5 text-[var(--color-fg-error,theme(colors.red.500))]", "aria-hidden": "true", children: "*" }),
3474
- !required && optionalText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[var(--color-text-secondary,theme(colors.gray.400))] text-sm font-normal", children: optionalText })
3475
- ]
3476
- }
3477
- ),
3478
- clonedChild,
3479
- helperText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-[var(--color-text-secondary,theme(colors.gray.400))]", children: helperText }),
3480
- errorText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-[var(--color-fg-error,theme(colors.red.500))]", children: errorText })
3481
- ]
3482
- }
3483
- );
3259
+ ),
3260
+ React32__namespace.cloneElement(child, { size }),
3261
+ helperText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: MUTED, children: helperText }),
3262
+ errorText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: ERROR, children: errorText })
3263
+ ] });
3484
3264
  }
3485
3265
  );
3486
- var LEVEL_TAG = { "1": gui.H1, "2": gui.H2, "3": gui.H3 };
3487
- var LEVEL_CLASSES = {
3488
- "1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
3489
- "2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
3490
- "3": "text-[14px] leading-[20px] font-semibold lg:text-[18px] lg:leading-[24px] lg:font-medium"
3266
+ var TAG = { "1": gui.H1, "2": gui.H2, "3": gui.H3 };
3267
+ var RAMP = {
3268
+ "1": { fontSize: 18, lineHeight: 24, fontWeight: "500", $lg: { fontSize: 32, lineHeight: 40, letterSpacing: -0.5 } },
3269
+ "2": { fontSize: 16, lineHeight: 24, fontWeight: "500", $lg: { fontSize: 24, lineHeight: 32 } },
3270
+ "3": { fontSize: 14, lineHeight: 20, fontWeight: "600", $lg: { fontSize: 18, lineHeight: 24, fontWeight: "500" } }
3491
3271
  };
3492
- var BASE_CLASSES4 = "font-heading text-heading";
3493
- var Heading = React33__namespace.default.forwardRef(
3494
- function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
3495
- const Tag3 = level ? LEVEL_TAG[level] : gui.H2;
3496
- const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
3497
- const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
3272
+ var Heading = React32__namespace.default.forwardRef(
3273
+ function Heading2({ level, ...rest }, ref) {
3274
+ const Tag3 = level ? TAG[level] : gui.H2;
3498
3275
  return /* @__PURE__ */ jsxRuntime.jsx(
3499
3276
  Tag3,
3500
3277
  {
3501
3278
  ref,
3502
3279
  unstyled: true,
3503
- className: cn(BASE_CLASSES4, levelClasses, className),
3504
- style: mergedStyle,
3280
+ fontFamily: "$heading",
3281
+ color: "var(--color-heading)",
3282
+ ...level ? RAMP[level] : null,
3505
3283
  ...rest
3506
3284
  }
3507
3285
  );
@@ -3524,60 +3302,75 @@ var IconButtonFrame = gui.styled(gui.View, {
3524
3302
  size: {
3525
3303
  "2xs": { width: 20, height: 20, borderRadius: 4 },
3526
3304
  "2xs_alt": { width: 20, height: 20, borderRadius: 4 },
3527
- md: { width: 32, height: 32, borderRadius: "var(--radius-base, 8px)" }
3305
+ md: { width: 32, height: 32, borderRadius: 8 }
3528
3306
  },
3529
3307
  disabled: {
3530
- true: {
3531
- opacity: 0.4,
3532
- cursor: "not-allowed",
3533
- pointerEvents: "none"
3534
- }
3308
+ true: { opacity: 0.4, cursor: "not-allowed", pointerEvents: "none" }
3535
3309
  }
3536
3310
  }
3537
3311
  });
3538
- var VARIANT_CLASSES4 = {
3539
- plain: "bg-transparent text-inherit border-none hover:bg-transparent",
3540
- icon_secondary: [
3541
- "bg-transparent text-icon-secondary border-none",
3542
- "hover:text-hover",
3543
- "data-[selected]:bg-selected-control-bg data-[selected]:text-selected-control-text",
3544
- "data-[selected]:hover:text-hover",
3545
- "data-[expanded]:text-hover"
3546
- ].join(" "),
3547
- icon_background: [
3548
- "bg-[var(--color-button-icon-background-bg)] text-icon-secondary border-none",
3549
- "hover:text-hover",
3550
- "data-[selected]:bg-selected-control-bg data-[selected]:text-selected-control-text",
3551
- "data-[selected]:hover:text-hover",
3552
- "data-[expanded]:text-hover"
3553
- ].join(" "),
3554
- link: [
3555
- "bg-transparent text-link-primary border-none font-normal px-0 h-auto",
3556
- "hover:bg-transparent hover:text-link-primary-hover",
3557
- "disabled:text-text-secondary"
3558
- ].join(" "),
3559
- dropdown: [
3560
- "border-2 border-solid bg-transparent",
3561
- "text-[var(--color-button-dropdown-fg)] border-[var(--color-button-dropdown-border)]",
3562
- "hover:bg-transparent hover:text-hover hover:border-hover",
3563
- "data-[expanded]:bg-transparent data-[expanded]:text-hover data-[expanded]:border-hover",
3564
- "data-[selected]:bg-selected-control-bg data-[selected]:text-selected-control-text data-[selected]:border-transparent",
3565
- "data-[selected]:hover:text-hover"
3566
- ].join(" "),
3567
- pagination: [
3568
- "border-2 border-solid bg-transparent",
3569
- "text-[var(--color-button-pagination-fg)] border-[var(--color-button-pagination-border)]",
3570
- "hover:bg-transparent hover:text-hover hover:border-hover",
3571
- "data-[selected]:bg-selected-control-bg data-[selected]:text-selected-control-text data-[selected]:border-transparent"
3572
- ].join(" ")
3573
- };
3574
- var ICON_SIZE_CLASSES = {
3575
- "2xs": "[&_svg]:size-5",
3576
- "2xs_alt": "[&_svg]:size-3",
3577
- md: "[&_svg]:size-5"
3312
+ var HOVER = "var(--color-hover)";
3313
+ var SELECTED_BG = "var(--color-selected-control-bg)";
3314
+ var SELECTED_FG = "var(--color-selected-control-text)";
3315
+ var VARIANT = {
3316
+ plain: {
3317
+ rest: { backgroundColor: "transparent", hoverStyle: { backgroundColor: "transparent" } }
3318
+ },
3319
+ icon_secondary: {
3320
+ rest: {
3321
+ backgroundColor: "transparent",
3322
+ color: "var(--color-icon-secondary)",
3323
+ hoverStyle: { color: HOVER }
3324
+ },
3325
+ selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, hoverStyle: { color: HOVER } },
3326
+ expanded: { color: HOVER }
3327
+ },
3328
+ icon_background: {
3329
+ rest: {
3330
+ backgroundColor: "var(--color-button-icon-background-bg)",
3331
+ color: "var(--color-icon-secondary)",
3332
+ hoverStyle: { color: HOVER }
3333
+ },
3334
+ selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, hoverStyle: { color: HOVER } },
3335
+ expanded: { color: HOVER }
3336
+ },
3337
+ link: {
3338
+ rest: {
3339
+ backgroundColor: "transparent",
3340
+ color: "var(--color-link-primary)",
3341
+ fontWeight: "400",
3342
+ paddingHorizontal: 0,
3343
+ height: "auto",
3344
+ hoverStyle: { backgroundColor: "transparent", color: "var(--color-link-primary-hover)" },
3345
+ disabledStyle: { color: "var(--color-text-secondary)" }
3346
+ }
3347
+ },
3348
+ dropdown: {
3349
+ rest: {
3350
+ borderWidth: 2,
3351
+ borderStyle: "solid",
3352
+ backgroundColor: "transparent",
3353
+ color: "var(--color-button-dropdown-fg)",
3354
+ borderColor: "var(--color-button-dropdown-border)",
3355
+ hoverStyle: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
3356
+ },
3357
+ selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent", hoverStyle: { color: HOVER } },
3358
+ expanded: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
3359
+ },
3360
+ pagination: {
3361
+ rest: {
3362
+ borderWidth: 2,
3363
+ borderStyle: "solid",
3364
+ backgroundColor: "transparent",
3365
+ color: "var(--color-button-pagination-fg)",
3366
+ borderColor: "var(--color-button-pagination-border)",
3367
+ hoverStyle: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
3368
+ },
3369
+ selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent" }
3370
+ }
3578
3371
  };
3579
- var SP2 = 4;
3580
- var IconButton = React33__namespace.forwardRef(
3372
+ var ICON_SIZE = { "2xs": 20, "2xs_alt": 12, md: 20 };
3373
+ var IconButton = React32__namespace.forwardRef(
3581
3374
  function IconButton2(props, ref) {
3582
3375
  const {
3583
3376
  size,
@@ -3590,58 +3383,43 @@ var IconButton = React33__namespace.forwardRef(
3590
3383
  disabled,
3591
3384
  className,
3592
3385
  children,
3593
- as: _as,
3386
+ as: asProp,
3594
3387
  style: styleProp,
3595
- // Strip Chakra style props
3596
- boxSize: _boxSize,
3597
- color: _color,
3598
- px: _px,
3599
- borderRadius: _borderRadius,
3600
- ml: _ml,
3601
- mr: _mr,
3602
- _hover,
3603
- _expanded,
3604
3388
  ...rest
3605
3389
  } = props;
3606
- const shimStyle = { ...styleProp };
3607
- if (_boxSize !== void 0) {
3608
- const bs = typeof _boxSize === "number" ? `${_boxSize * SP2}px` : _boxSize;
3609
- shimStyle.width = bs;
3610
- shimStyle.height = bs;
3611
- }
3612
- if (_color) shimStyle.color = _color;
3613
- if (_px !== void 0) {
3614
- const v = typeof _px === "number" ? `${_px * SP2}px` : _px;
3615
- shimStyle.paddingLeft = v;
3616
- shimStyle.paddingRight = v;
3617
- }
3618
- if (_borderRadius) shimStyle.borderRadius = _borderRadius;
3619
- if (_ml !== void 0) shimStyle.marginLeft = typeof _ml === "number" ? `${_ml * SP2}px` : _ml;
3620
- if (_mr !== void 0) shimStyle.marginRight = typeof _mr === "number" ? `${_mr * SP2}px` : _mr;
3621
- const mergedStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
3622
- const variantClass = VARIANT_CLASSES4[variant] ?? VARIANT_CLASSES4.plain;
3623
- const iconSizeClass = size ? ICON_SIZE_CLASSES[size] ?? "" : "";
3624
- const combinedClassName = [variantClass, iconSizeClass, className].filter(Boolean).join(" ");
3390
+ const look = VARIANT[variant] ?? VARIANT.plain;
3391
+ const iconSize = size ? ICON_SIZE[size] : void 0;
3625
3392
  const button = /* @__PURE__ */ jsxRuntime.jsx(
3626
3393
  IconButtonFrame,
3627
3394
  {
3628
3395
  ref,
3629
3396
  size,
3630
3397
  disabled: !loadingSkeleton && (loading || disabled) || void 0,
3631
- render: _as ? React33__namespace.createElement(_as) : void 0,
3632
- className: combinedClassName,
3633
- style: mergedStyle,
3398
+ render: asProp ? React32__namespace.createElement(asProp) : void 0,
3399
+ className: ["lux-icon", className].filter(Boolean).join(" "),
3400
+ style: { ...styleProp, ...iconSize ? { "--icon-size": `${iconSize}px` } : null },
3401
+ ...look.rest,
3402
+ ...selected ? look.selected : null,
3403
+ ...expanded ? look.expanded : null,
3634
3404
  ...expanded ? { "data-expanded": true } : {},
3635
3405
  ...selected ? { "data-selected": true } : {},
3636
3406
  ...highlighted ? { "data-highlighted": true } : {},
3637
3407
  ...loadingSkeleton ? { "data-loading-skeleton": true } : {},
3638
3408
  ...rest,
3639
3409
  children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
3640
- "span",
3410
+ gui.View,
3641
3411
  {
3642
- className: "inline-block size-5 animate-spin rounded-full border-2 border-current border-b-transparent border-l-transparent",
3412
+ className: "lux-spin",
3413
+ render: /* @__PURE__ */ jsxRuntime.jsx("span", {}),
3643
3414
  role: "status",
3644
- "aria-label": "Loading"
3415
+ "aria-label": "Loading",
3416
+ width: 20,
3417
+ height: 20,
3418
+ borderRadius: 1e3,
3419
+ borderWidth: 2,
3420
+ borderColor: "currentColor",
3421
+ borderBottomColor: "transparent",
3422
+ borderLeftColor: "transparent"
3645
3423
  }
3646
3424
  ) : children
3647
3425
  }
@@ -3799,31 +3577,31 @@ function extractStyleProps(props) {
3799
3577
  }
3800
3578
  return { styleProps, rest };
3801
3579
  }
3802
- var Image = React33__namespace.default.forwardRef(
3580
+ var Image = React32__namespace.default.forwardRef(
3803
3581
  function Image2(props, ref) {
3804
3582
  const { fallback, src, onLoad, onError, skeletonWidth, skeletonHeight, alt, className, style: styleProp, ...allRest } = props;
3805
3583
  const { styleProps, rest: extraProps } = extractStyleProps(allRest);
3806
- const [loading, setLoading] = React33__namespace.default.useState(true);
3807
- const [error, setError] = React33__namespace.default.useState(false);
3808
- const handleLoadError = React33__namespace.default.useCallback((event) => {
3584
+ const [loading, setLoading] = React32__namespace.default.useState(true);
3585
+ const [error, setError] = React32__namespace.default.useState(false);
3586
+ const handleLoadError = React32__namespace.default.useCallback((event) => {
3809
3587
  setError(true);
3810
3588
  setLoading(false);
3811
3589
  onError?.(event);
3812
3590
  }, [onError]);
3813
- const handleLoadSuccess = React33__namespace.default.useCallback((event) => {
3591
+ const handleLoadSuccess = React32__namespace.default.useCallback((event) => {
3814
3592
  setLoading(false);
3815
3593
  onLoad?.(event);
3816
3594
  }, [onLoad]);
3817
3595
  const passthroughProps = allRest;
3818
3596
  if (!src && fallback) {
3819
- if (React33__namespace.default.isValidElement(fallback)) {
3820
- return React33__namespace.default.cloneElement(fallback, passthroughProps);
3597
+ if (React32__namespace.default.isValidElement(fallback)) {
3598
+ return React32__namespace.default.cloneElement(fallback, passthroughProps);
3821
3599
  }
3822
3600
  return fallback;
3823
3601
  }
3824
3602
  if (error) {
3825
- if (React33__namespace.default.isValidElement(fallback)) {
3826
- return React33__namespace.default.cloneElement(fallback, passthroughProps);
3603
+ if (React32__namespace.default.isValidElement(fallback)) {
3604
+ return React32__namespace.default.cloneElement(fallback, passthroughProps);
3827
3605
  }
3828
3606
  return fallback;
3829
3607
  }
@@ -3856,32 +3634,31 @@ var Image = React33__namespace.default.forwardRef(
3856
3634
  ] });
3857
3635
  }
3858
3636
  );
3859
- var INPUT_BASE = [
3860
- "w-full appearance-none outline-none transition-colors",
3861
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
3862
- "placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
3863
- "hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
3864
- "focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
3865
- "focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
3866
- "disabled:opacity-40 disabled:cursor-not-allowed",
3867
- "read-only:opacity-70",
3868
- "data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
3869
- ].join(" ");
3870
- var INPUT_SIZE_CLASSES = {
3871
- xs: "h-6 px-2 text-xs rounded",
3872
- sm: "h-8 px-3 text-sm rounded-md",
3873
- md: "h-10 px-4 text-base rounded-md",
3874
- lg: "h-12 px-4 text-lg rounded-lg",
3875
- "2xl": "h-14 px-4 text-xl rounded-lg"
3637
+ var SIZE = {
3638
+ xs: { height: 24, paddingHorizontal: 8, fontSize: 12, borderRadius: 4 },
3639
+ sm: { height: 32, paddingHorizontal: 12, fontSize: 14, borderRadius: 6 },
3640
+ md: { height: 40, paddingHorizontal: 16, fontSize: 16, borderRadius: 6 },
3641
+ lg: { height: 48, paddingHorizontal: 16, fontSize: 18, borderRadius: 8 },
3642
+ "2xl": { height: 56, paddingHorizontal: 16, fontSize: 20, borderRadius: 8 }
3876
3643
  };
3877
- var INPUT_VARIANT_CLASSES = {
3878
- outline: "border border-solid",
3879
- filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
3880
- unstyled: "border-0 bg-transparent p-0 h-auto"
3644
+ var VARIANT2 = {
3645
+ outline: { borderWidth: 1, borderStyle: "solid" },
3646
+ filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
3647
+ unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
3881
3648
  };
3882
- var Input = React33__namespace.default.forwardRef(
3649
+ var CONTROL = {
3650
+ width: "100%",
3651
+ outlineWidth: 0,
3652
+ backgroundColor: "var(--color-input-bg)",
3653
+ color: "var(--color-input-fg)",
3654
+ borderColor: "var(--color-input-border)",
3655
+ hoverStyle: { borderColor: "var(--color-input-border-hover)" },
3656
+ focusStyle: { borderColor: "var(--color-input-border-focus)" },
3657
+ disabledStyle: { opacity: 0.4, cursor: "not-allowed" }
3658
+ };
3659
+ var Input = React32__namespace.default.forwardRef(
3883
3660
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
3884
- const handleChange = React33__namespace.default.useCallback(
3661
+ const handleChange = React32__namespace.default.useCallback(
3885
3662
  (event) => {
3886
3663
  onChange?.(event);
3887
3664
  onChangeText?.(event.target.value);
@@ -3893,7 +3670,10 @@ var Input = React33__namespace.default.forwardRef(
3893
3670
  {
3894
3671
  ref,
3895
3672
  unstyled: true,
3896
- className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
3673
+ className: className ? `lux-control ${className}` : "lux-control",
3674
+ ...CONTROL,
3675
+ ...SIZE[size],
3676
+ ...VARIANT2[variant],
3897
3677
  ...rest,
3898
3678
  onChange: handleChange
3899
3679
  }
@@ -3901,12 +3681,8 @@ var Input = React33__namespace.default.forwardRef(
3901
3681
  }
3902
3682
  );
3903
3683
  Input.displayName = "Input";
3904
- function getComponentDisplayName2(type) {
3905
- if (typeof type === "string") return void 0;
3906
- if ("displayName" in type) return type.displayName;
3907
- return void 0;
3908
- }
3909
- var InputGroup = React33__namespace.forwardRef(
3684
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React32__namespace.useLayoutEffect : React32__namespace.useEffect;
3685
+ var InputGroup = React32__namespace.forwardRef(
3910
3686
  function InputGroup2(props, ref) {
3911
3687
  const {
3912
3688
  startElement,
@@ -3919,11 +3695,11 @@ var InputGroup = React33__namespace.forwardRef(
3919
3695
  className,
3920
3696
  ...rest
3921
3697
  } = props;
3922
- const startElementRef = React33__namespace.useRef(null);
3923
- const endElementRef = React33__namespace.useRef(null);
3924
- const groupRef = React33__namespace.useRef(null);
3925
- const [inlinePaddings, setInlinePaddings] = React33__namespace.useState();
3926
- const calculateInlinePaddings = React33__namespace.useCallback(() => {
3698
+ const startElementRef = React32__namespace.useRef(null);
3699
+ const endElementRef = React32__namespace.useRef(null);
3700
+ const groupRef = React32__namespace.useRef(null);
3701
+ const [inlinePaddings, setInlinePaddings] = React32__namespace.useState();
3702
+ const calculateInlinePaddings = React32__namespace.useCallback(() => {
3927
3703
  const startWidth = startElementRef.current?.getBoundingClientRect().width ?? 0;
3928
3704
  const endWidth = endElementRef.current?.getBoundingClientRect().width ?? 0;
3929
3705
  setInlinePaddings({
@@ -3931,12 +3707,12 @@ var InputGroup = React33__namespace.forwardRef(
3931
3707
  end: endWidth
3932
3708
  });
3933
3709
  }, []);
3934
- React33__namespace.useEffect(() => {
3710
+ React32__namespace.useEffect(() => {
3935
3711
  if (!groupRef.current) return;
3936
3712
  let timeoutId;
3937
3713
  const intersectionObserver = new IntersectionObserver(
3938
- (entries) => {
3939
- const entry = entries[0];
3714
+ (entries2) => {
3715
+ const entry = entries2[0];
3940
3716
  if (entry && entry.isIntersecting) {
3941
3717
  timeoutId = setTimeout(calculateInlinePaddings, 50);
3942
3718
  }
@@ -3951,7 +3727,7 @@ var InputGroup = React33__namespace.forwardRef(
3951
3727
  }
3952
3728
  };
3953
3729
  }, [calculateInlinePaddings]);
3954
- React33__namespace.useEffect(() => {
3730
+ useIsomorphicLayoutEffect(() => {
3955
3731
  calculateInlinePaddings();
3956
3732
  const resizeHandler = esToolkit.debounce(calculateInlinePaddings, 300);
3957
3733
  const resizeObserver = new ResizeObserver(resizeHandler);
@@ -3962,7 +3738,7 @@ var InputGroup = React33__namespace.forwardRef(
3962
3738
  resizeObserver.disconnect();
3963
3739
  };
3964
3740
  }, [calculateInlinePaddings]);
3965
- const combinedRef = React33__namespace.useCallback((node) => {
3741
+ const combinedRef = React32__namespace.useCallback((node) => {
3966
3742
  groupRef.current = node;
3967
3743
  if (typeof ref === "function") {
3968
3744
  ref(node);
@@ -3991,16 +3767,19 @@ var InputGroup = React33__namespace.forwardRef(
3991
3767
  children: startElement
3992
3768
  }
3993
3769
  ),
3994
- React33__namespace.Children.map(children, (child) => {
3995
- if (getComponentDisplayName2(child.type) !== "FieldInput") {
3770
+ React32__namespace.Children.map(children, (child) => {
3771
+ if (!React32__namespace.isValidElement(child)) {
3996
3772
  return child;
3997
3773
  }
3998
- return React33__namespace.cloneElement(child, {
3999
- ...startElement && { ps: startOffset ?? (inlinePaddings?.start ? `${inlinePaddings.start}px` : void 0) },
4000
- ...endElement && { pe: endOffset ?? (inlinePaddings?.end ? `${inlinePaddings.end}px` : void 0) },
4001
- // hide input value and placeholder for the first render
4002
- value: inlinePaddings ? child.props.value : void 0,
4003
- placeholder: inlinePaddings ? child.props.placeholder : void 0
3774
+ const start = startElement ? startOffset ?? inlinePaddings?.start : void 0;
3775
+ const end = endElement ? endOffset ?? inlinePaddings?.end : void 0;
3776
+ const px = (v) => typeof v === "number" ? `${v}px` : v;
3777
+ return React32__namespace.cloneElement(child, {
3778
+ style: {
3779
+ ...child.props.style,
3780
+ ...start !== void 0 && { paddingInlineStart: px(start) },
3781
+ ...end !== void 0 && { paddingInlineEnd: px(end) }
3782
+ }
4004
3783
  });
4005
3784
  }),
4006
3785
  endElement && /* @__PURE__ */ jsxRuntime.jsx(
@@ -4021,7 +3800,7 @@ var InputGroup = React33__namespace.forwardRef(
4021
3800
  }
4022
3801
  );
4023
3802
  InputGroup.displayName = "InputGroup";
4024
- var INPUT_BASE2 = [
3803
+ var INPUT_BASE = [
4025
3804
  "w-10 h-10",
4026
3805
  "text-center text-sm font-medium",
4027
3806
  "border-2 rounded-md",
@@ -4035,7 +3814,7 @@ var INPUT_BASE2 = [
4035
3814
  ].join(" ");
4036
3815
  var INPUT_FILLED = "border-[var(--color-input-border)]";
4037
3816
  var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
4038
- var PinInput = React33__namespace.forwardRef(
3817
+ var PinInput = React32__namespace.forwardRef(
4039
3818
  function PinInput2(props, ref) {
4040
3819
  const {
4041
3820
  count = 6,
@@ -4053,12 +3832,12 @@ var PinInput = React33__namespace.forwardRef(
4053
3832
  bgColor,
4054
3833
  className
4055
3834
  } = props;
4056
- const inputRefs = React33__namespace.useRef([]);
4057
- const values = React33__namespace.useMemo(
3835
+ const inputRefs = React32__namespace.useRef([]);
3836
+ const values = React32__namespace.useMemo(
4058
3837
  () => controlledValue ?? Array.from({ length: count }).fill(""),
4059
3838
  [controlledValue, count]
4060
3839
  );
4061
- const updateValue = React33__namespace.useCallback((index, char) => {
3840
+ const updateValue = React32__namespace.useCallback((index, char) => {
4062
3841
  const next = [...values];
4063
3842
  next[index] = char;
4064
3843
  onValueChange?.({ value: next });
@@ -4066,11 +3845,11 @@ var PinInput = React33__namespace.forwardRef(
4066
3845
  onValueComplete?.({ value: next });
4067
3846
  }
4068
3847
  }, [values, onValueChange, onValueComplete]);
4069
- const focusInput = React33__namespace.useCallback((index) => {
3848
+ const focusInput = React32__namespace.useCallback((index) => {
4070
3849
  const clamped = Math.max(0, Math.min(index, count - 1));
4071
3850
  inputRefs.current[clamped]?.focus();
4072
3851
  }, [count]);
4073
- const handleInput = React33__namespace.useCallback((index, e) => {
3852
+ const handleInput = React32__namespace.useCallback((index, e) => {
4074
3853
  const target = e.currentTarget;
4075
3854
  const char = target.value.slice(-1);
4076
3855
  updateValue(index, char);
@@ -4078,7 +3857,7 @@ var PinInput = React33__namespace.forwardRef(
4078
3857
  focusInput(index + 1);
4079
3858
  }
4080
3859
  }, [count, updateValue, focusInput]);
4081
- const handleKeyDown = React33__namespace.useCallback((index, e) => {
3860
+ const handleKeyDown = React32__namespace.useCallback((index, e) => {
4082
3861
  if (e.key === "Backspace") {
4083
3862
  if (values[index]) {
4084
3863
  updateValue(index, "");
@@ -4095,7 +3874,7 @@ var PinInput = React33__namespace.forwardRef(
4095
3874
  e.preventDefault();
4096
3875
  }
4097
3876
  }, [count, values, updateValue, focusInput]);
4098
- const handlePaste = React33__namespace.useCallback((e) => {
3877
+ const handlePaste = React32__namespace.useCallback((e) => {
4099
3878
  e.preventDefault();
4100
3879
  const pasted = e.clipboardData.getData("text/plain").trim();
4101
3880
  if (!pasted) {
@@ -4112,18 +3891,18 @@ var PinInput = React33__namespace.forwardRef(
4112
3891
  }
4113
3892
  focusInput(Math.min(chars.length, count - 1));
4114
3893
  }, [count, values, onValueChange, onValueComplete, focusInput]);
4115
- const handleFocus = React33__namespace.useCallback((e) => {
3894
+ const handleFocus = React32__namespace.useCallback((e) => {
4116
3895
  e.currentTarget.select();
4117
3896
  }, []);
4118
- const handleNoop = React33__namespace.useCallback(() => {
3897
+ const handleNoop = React32__namespace.useCallback(() => {
4119
3898
  }, []);
4120
- const setInputRef = React33__namespace.useCallback((index) => (el) => {
3899
+ const setInputRef = React32__namespace.useCallback((index) => (el) => {
4121
3900
  inputRefs.current[index] = el;
4122
3901
  }, []);
4123
- const onInputAtIndex = React33__namespace.useCallback((index) => (e) => {
3902
+ const onInputAtIndex = React32__namespace.useCallback((index) => (e) => {
4124
3903
  handleInput(index, e);
4125
3904
  }, [handleInput]);
4126
- const onKeyDownAtIndex = React33__namespace.useCallback((index) => (e) => {
3905
+ const onKeyDownAtIndex = React32__namespace.useCallback((index) => (e) => {
4127
3906
  handleKeyDown(index, e);
4128
3907
  }, [handleKeyDown]);
4129
3908
  const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
@@ -4152,7 +3931,7 @@ var PinInput = React33__namespace.forwardRef(
4152
3931
  "aria-invalid": invalid || void 0,
4153
3932
  value: values[index] || "",
4154
3933
  className: cn(
4155
- INPUT_BASE2,
3934
+ INPUT_BASE,
4156
3935
  values[index] && INPUT_FILLED,
4157
3936
  invalid && INPUT_INVALID,
4158
3937
  attached && index > 0 && "-ml-0.5"
@@ -4169,7 +3948,7 @@ var PinInput = React33__namespace.forwardRef(
4169
3948
  ] });
4170
3949
  }
4171
3950
  );
4172
- function parsePlacement2(placement) {
3951
+ function parsePlacement(placement) {
4173
3952
  if (!placement) {
4174
3953
  return { side: "bottom", align: "start" };
4175
3954
  }
@@ -4184,7 +3963,7 @@ function parsePlacement2(placement) {
4184
3963
  }
4185
3964
  return { side, align };
4186
3965
  }
4187
- var PositioningContext2 = React33__namespace.createContext({
3966
+ var PositioningContext = React32__namespace.createContext({
4188
3967
  side: "bottom",
4189
3968
  align: "start",
4190
3969
  sideOffset: 4,
@@ -4217,8 +3996,8 @@ var PopoverRoot = (props) => {
4217
3996
  ...positioning?.offset
4218
3997
  }
4219
3998
  };
4220
- const { side, align } = parsePlacement2(mergedPositioning.placement);
4221
- const positioningValue = React33__namespace.useMemo(() => ({
3999
+ const { side, align } = parsePlacement(mergedPositioning.placement);
4000
+ const positioningValue = React32__namespace.useMemo(() => ({
4222
4001
  side,
4223
4002
  align,
4224
4003
  sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
@@ -4235,12 +4014,12 @@ var PopoverRoot = (props) => {
4235
4014
  autoFocus,
4236
4015
  closeOnInteractOutside
4237
4016
  ]);
4238
- const handleOpenChange = React33__namespace.useCallback((isOpen) => {
4017
+ const handleOpenChange = React32__namespace.useCallback((isOpen) => {
4239
4018
  onOpenChange?.({ open: isOpen });
4240
4019
  }, [onOpenChange]);
4241
4020
  const placement = mergedPositioning.placement ?? "bottom-start";
4242
4021
  const offset = mergedPositioning.offset?.mainAxis ?? 4;
4243
- return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext2.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
4022
+ return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
4244
4023
  gui.Popover,
4245
4024
  {
4246
4025
  open,
@@ -4253,11 +4032,11 @@ var PopoverRoot = (props) => {
4253
4032
  }
4254
4033
  ) });
4255
4034
  };
4256
- var PopoverTrigger = React33__namespace.forwardRef(function PopoverTrigger2(props, ref) {
4035
+ var PopoverTrigger = React32__namespace.forwardRef(function PopoverTrigger2(props, ref) {
4257
4036
  const { asChild = true, ...rest } = props;
4258
4037
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
4259
4038
  });
4260
- var PopoverContent = React33__namespace.forwardRef(function PopoverContent2(props, ref) {
4039
+ var PopoverContent = React32__namespace.forwardRef(function PopoverContent2(props, ref) {
4261
4040
  const { portalled = true, portalRef: _portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
4262
4041
  const resolvedW = typeof w === "object" ? w.base ?? w.lg : w;
4263
4042
  const contentStyle = {
@@ -4275,7 +4054,7 @@ var PopoverContent = React33__namespace.forwardRef(function PopoverContent2(prop
4275
4054
  className: cn(
4276
4055
  "z-50 rounded-lg border border-[var(--color-popover-border,var(--color-border-divider))]",
4277
4056
  "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
4278
- "shadow-[var(--shadow-popover,var(--shadow-lg))]",
4057
+ "shadow-[var(--shadow-popover)]",
4279
4058
  "outline-none",
4280
4059
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
4281
4060
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
@@ -4288,7 +4067,7 @@ var PopoverContent = React33__namespace.forwardRef(function PopoverContent2(prop
4288
4067
  }
4289
4068
  );
4290
4069
  });
4291
- var PopoverArrow = React33__namespace.forwardRef(function PopoverArrow2(props, ref) {
4070
+ var PopoverArrow = React32__namespace.forwardRef(function PopoverArrow2(props, ref) {
4292
4071
  const { className, ...rest } = props;
4293
4072
  return /* @__PURE__ */ jsxRuntime.jsx(
4294
4073
  gui.Popover.Arrow,
@@ -4300,7 +4079,7 @@ var PopoverArrow = React33__namespace.forwardRef(function PopoverArrow2(props, r
4300
4079
  }
4301
4080
  );
4302
4081
  });
4303
- var PopoverCloseTrigger = React33__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
4082
+ var PopoverCloseTrigger = React32__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
4304
4083
  const { className, ...rest } = props;
4305
4084
  return /* @__PURE__ */ jsxRuntime.jsx(
4306
4085
  gui.Popover.Close,
@@ -4314,14 +4093,14 @@ var PopoverCloseTrigger = React33__namespace.forwardRef(function PopoverCloseTri
4314
4093
  }
4315
4094
  );
4316
4095
  });
4317
- var PopoverCloseTriggerWrapper = React33__namespace.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
4096
+ var PopoverCloseTriggerWrapper = React32__namespace.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
4318
4097
  const { disabled, children, ...rest } = props;
4319
4098
  if (disabled) {
4320
4099
  return children;
4321
4100
  }
4322
4101
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Close, { ref, ...rest, asChild: true, children });
4323
4102
  });
4324
- var PopoverBody = React33__namespace.forwardRef(function PopoverBody2(props, ref) {
4103
+ var PopoverBody = React32__namespace.forwardRef(function PopoverBody2(props, ref) {
4325
4104
  const {
4326
4105
  className,
4327
4106
  style: styleProp,
@@ -4359,7 +4138,7 @@ var PopoverBody = React33__namespace.forwardRef(function PopoverBody2(props, ref
4359
4138
  }
4360
4139
  );
4361
4140
  });
4362
- var PopoverHeader = React33__namespace.forwardRef(function PopoverHeader2(props, ref) {
4141
+ var PopoverHeader = React32__namespace.forwardRef(function PopoverHeader2(props, ref) {
4363
4142
  const { className, ...rest } = props;
4364
4143
  return /* @__PURE__ */ jsxRuntime.jsx(
4365
4144
  "div",
@@ -4370,7 +4149,7 @@ var PopoverHeader = React33__namespace.forwardRef(function PopoverHeader2(props,
4370
4149
  }
4371
4150
  );
4372
4151
  });
4373
- var PopoverFooter = React33__namespace.forwardRef(function PopoverFooter2(props, ref) {
4152
+ var PopoverFooter = React32__namespace.forwardRef(function PopoverFooter2(props, ref) {
4374
4153
  const { className, ...rest } = props;
4375
4154
  return /* @__PURE__ */ jsxRuntime.jsx(
4376
4155
  "div",
@@ -4381,7 +4160,7 @@ var PopoverFooter = React33__namespace.forwardRef(function PopoverFooter2(props,
4381
4160
  }
4382
4161
  );
4383
4162
  });
4384
- var PopoverTitle = React33__namespace.forwardRef(function PopoverTitle2(props, ref) {
4163
+ var PopoverTitle = React32__namespace.forwardRef(function PopoverTitle2(props, ref) {
4385
4164
  const { className, ...rest } = props;
4386
4165
  return /* @__PURE__ */ jsxRuntime.jsx(
4387
4166
  "h3",
@@ -4392,7 +4171,7 @@ var PopoverTitle = React33__namespace.forwardRef(function PopoverTitle2(props, r
4392
4171
  }
4393
4172
  );
4394
4173
  });
4395
- var PopoverDescription = React33__namespace.forwardRef(function PopoverDescription2(props, ref) {
4174
+ var PopoverDescription = React32__namespace.forwardRef(function PopoverDescription2(props, ref) {
4396
4175
  const { className, ...rest } = props;
4397
4176
  return /* @__PURE__ */ jsxRuntime.jsx(
4398
4177
  "p",
@@ -4403,7 +4182,7 @@ var PopoverDescription = React33__namespace.forwardRef(function PopoverDescripti
4403
4182
  }
4404
4183
  );
4405
4184
  });
4406
- var SIZE_CLASSES7 = {
4185
+ var SIZE_CLASSES6 = {
4407
4186
  sm: "h-1",
4408
4187
  md: "h-2",
4409
4188
  lg: "h-3",
@@ -4414,7 +4193,7 @@ function normalizeValue(value, min, max) {
4414
4193
  if (max <= min) return 0;
4415
4194
  return Math.round((value - min) / (max - min) * 100);
4416
4195
  }
4417
- var Progress = React33__namespace.forwardRef(
4196
+ var Progress = React32__namespace.forwardRef(
4418
4197
  function Progress2(props, ref) {
4419
4198
  const {
4420
4199
  value,
@@ -4462,7 +4241,7 @@ var Progress = React33__namespace.forwardRef(
4462
4241
  className: cn(
4463
4242
  "w-full overflow-hidden rounded-full",
4464
4243
  "bg-[var(--color-progress-track)]",
4465
- SIZE_CLASSES7[size],
4244
+ SIZE_CLASSES6[size],
4466
4245
  trackProps?.className
4467
4246
  ),
4468
4247
  style: trackStyle,
@@ -4493,12 +4272,12 @@ var SIZE_MAP = {
4493
4272
  lg: { size: 48, thickness: 7, textClass: "text-sm" },
4494
4273
  xl: { size: 64, thickness: 8, textClass: "text-sm" }
4495
4274
  };
4496
- var Ctx = React33__namespace.createContext({
4275
+ var Ctx = React32__namespace.createContext({
4497
4276
  value: 0,
4498
4277
  size: "md",
4499
4278
  colorPalette: "blue"
4500
4279
  });
4501
- var ProgressCircleRoot = React33__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
4280
+ var ProgressCircleRoot = React32__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
4502
4281
  const {
4503
4282
  value = 0,
4504
4283
  size = "md",
@@ -4507,7 +4286,7 @@ var ProgressCircleRoot = React33__namespace.forwardRef(function ProgressCircleRo
4507
4286
  children,
4508
4287
  ...rest
4509
4288
  } = props;
4510
- const ctx = React33__namespace.useMemo(
4289
+ const ctx = React32__namespace.useMemo(
4511
4290
  () => ({ value: value ?? null, size, colorPalette }),
4512
4291
  [value, size, colorPalette]
4513
4292
  );
@@ -4525,9 +4304,9 @@ var ProgressCircleRoot = React33__namespace.forwardRef(function ProgressCircleRo
4525
4304
  }
4526
4305
  ) });
4527
4306
  });
4528
- var ProgressCircleRing = React33__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
4307
+ var ProgressCircleRing = React32__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
4529
4308
  const { trackColor, cap, color, className, ...rest } = props;
4530
- const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
4309
+ const { value, size: sizeKey } = React32__namespace.useContext(Ctx);
4531
4310
  const { size, thickness } = SIZE_MAP[sizeKey];
4532
4311
  const radius = size / 2 - thickness / 2;
4533
4312
  const circumference = 2 * Math.PI * radius;
@@ -4582,9 +4361,9 @@ var ProgressCircleRing = React33__namespace.forwardRef(function ProgressCircleRi
4582
4361
  }
4583
4362
  );
4584
4363
  });
4585
- var ProgressCircleValueText = React33__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
4364
+ var ProgressCircleValueText = React32__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
4586
4365
  const { className, children, ...rest } = props;
4587
- const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
4366
+ const { value, size: sizeKey } = React32__namespace.useContext(Ctx);
4588
4367
  const { textClass } = SIZE_MAP[sizeKey];
4589
4368
  return /* @__PURE__ */ jsxRuntime.jsx(
4590
4369
  "div",
@@ -4602,7 +4381,7 @@ var ProgressCircleValueText = React33__namespace.forwardRef(function ProgressCir
4602
4381
  }
4603
4382
  );
4604
4383
  });
4605
- var SIZE_CLASSES8 = {
4384
+ var SIZE_CLASSES7 = {
4606
4385
  xs: {
4607
4386
  root: "gap-1.5",
4608
4387
  control: "h-3 w-3",
@@ -4628,9 +4407,9 @@ var SIZE_CLASSES8 = {
4628
4407
  label: "text-base"
4629
4408
  }
4630
4409
  };
4631
- var RadioSizeContext = React33__namespace.createContext("md");
4632
- var RadioGroupBase = React33__namespace.forwardRef(
4633
- function RadioGroup2(props, ref) {
4410
+ var RadioSizeContext = React32__namespace.createContext("md");
4411
+ var RadioGroupBase = React32__namespace.forwardRef(
4412
+ function RadioGroup(props, ref) {
4634
4413
  const {
4635
4414
  children,
4636
4415
  name,
@@ -4647,7 +4426,7 @@ var RadioGroupBase = React33__namespace.forwardRef(
4647
4426
  className,
4648
4427
  ...rest
4649
4428
  } = props;
4650
- const handleValueChange = React33__namespace.useCallback(
4429
+ const handleValueChange = React32__namespace.useCallback(
4651
4430
  (nextValue) => {
4652
4431
  if (readOnly) return;
4653
4432
  onValueChange?.({ value: nextValue });
@@ -4677,14 +4456,14 @@ var RadioGroupBase = React33__namespace.forwardRef(
4677
4456
  ) });
4678
4457
  }
4679
4458
  );
4680
- var RadioGroup3 = RadioGroupBase;
4459
+ var RadioGroup2 = RadioGroupBase;
4681
4460
  var NOOP2 = () => {
4682
4461
  };
4683
- var RadioBase = React33__namespace.forwardRef(
4462
+ var RadioBase = React32__namespace.forwardRef(
4684
4463
  function Radio(props, ref) {
4685
4464
  const { children, inputProps, rootRef, value, disabled, className, ...rest } = props;
4686
- const size = React33__namespace.useContext(RadioSizeContext);
4687
- const sizeClasses2 = SIZE_CLASSES8[size];
4465
+ const size = React32__namespace.useContext(RadioSizeContext);
4466
+ const sizeClasses2 = SIZE_CLASSES7[size];
4688
4467
  return /* @__PURE__ */ jsxRuntime.jsxs(
4689
4468
  "label",
4690
4469
  {
@@ -4747,23 +4526,23 @@ var RadioBase = React33__namespace.forwardRef(
4747
4526
  var Radio2 = RadioBase;
4748
4527
  var StarFilledIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
4749
4528
  var StarOutlineIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
4750
- var Rating = React33__namespace.forwardRef(
4529
+ var Rating = React32__namespace.forwardRef(
4751
4530
  function Rating2(props, ref) {
4752
4531
  const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
4753
- const [value, setValue] = React33__namespace.useState(defaultValue);
4754
- const [hoveredIndex, setHoveredIndex] = React33__namespace.useState(-1);
4532
+ const [value, setValue] = React32__namespace.useState(defaultValue);
4533
+ const [hoveredIndex, setHoveredIndex] = React32__namespace.useState(-1);
4755
4534
  const highlightedIndex = hoveredIndex >= 0 && !readOnly ? hoveredIndex + 1 : value;
4756
4535
  const label = Array.isArray(labelProp) ? labelProp[highlightedIndex - 1] : labelProp;
4757
- const handleClick = React33__namespace.useCallback((index) => () => {
4536
+ const handleClick = React32__namespace.useCallback((index) => () => {
4758
4537
  if (readOnly) return;
4759
4538
  setValue(index);
4760
4539
  onValueChange?.({ value: index });
4761
4540
  }, [readOnly, onValueChange]);
4762
- const handleMouseEnter = React33__namespace.useCallback((index) => () => {
4541
+ const handleMouseEnter = React32__namespace.useCallback((index) => () => {
4763
4542
  if (readOnly) return;
4764
4543
  setHoveredIndex(index);
4765
4544
  }, [readOnly]);
4766
- const handleMouseLeave = React33__namespace.useCallback(() => {
4545
+ const handleMouseLeave = React32__namespace.useCallback(() => {
4767
4546
  setHoveredIndex(-1);
4768
4547
  }, []);
4769
4548
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("inline-flex items-center gap-1", className), ...rest, children: [
@@ -4797,8 +4576,8 @@ function createListCollection(config2) {
4797
4576
  var ArrowIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
4798
4577
  var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.667 5L7.5 14.167 3.333 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
4799
4578
  function FilterInput({ placeholder, initialValue = "", onChange }) {
4800
- const [value, setValue] = React33__namespace.useState(initialValue);
4801
- const handleChange = React33__namespace.useCallback((e) => {
4579
+ const [value, setValue] = React32__namespace.useState(initialValue);
4580
+ const handleChange = React32__namespace.useCallback((e) => {
4802
4581
  setValue(e.target.value);
4803
4582
  onChange?.(e.target.value);
4804
4583
  }, [onChange]);
@@ -4817,15 +4596,15 @@ function FilterInput({ placeholder, initialValue = "", onChange }) {
4817
4596
  }
4818
4597
  );
4819
4598
  }
4820
- var SelectInternalContext = React33__namespace.createContext(null);
4599
+ var SelectInternalContext = React32__namespace.createContext(null);
4821
4600
  function useSelectInternalContext() {
4822
- const ctx = React33__namespace.useContext(SelectInternalContext);
4601
+ const ctx = React32__namespace.useContext(SelectInternalContext);
4823
4602
  if (!ctx) {
4824
4603
  throw new Error("Select compound components must be rendered inside <SelectRoot>");
4825
4604
  }
4826
4605
  return ctx;
4827
4606
  }
4828
- var SelectRoot = React33__namespace.forwardRef(
4607
+ var SelectRoot = React32__namespace.forwardRef(
4829
4608
  function SelectRoot2(props, ref) {
4830
4609
  const {
4831
4610
  children,
@@ -4856,21 +4635,21 @@ var SelectRoot = React33__namespace.forwardRef(
4856
4635
  hideFrom: _hideFrom
4857
4636
  } = props;
4858
4637
  const collection = collectionProp ?? createListCollection({ items: [] });
4859
- const [internalValue, setInternalValue] = React33__namespace.useState(defaultValueArr ?? []);
4638
+ const [internalValue, setInternalValue] = React32__namespace.useState(defaultValueArr ?? []);
4860
4639
  const currentValue = valueProp ?? internalValue;
4861
- const selectedItems = React33__namespace.useMemo(() => {
4640
+ const selectedItems = React32__namespace.useMemo(() => {
4862
4641
  return currentValue.map((v) => collection.items.find((item) => item.value === v)).filter(Boolean);
4863
4642
  }, [currentValue, collection.items]);
4864
- const [open, setOpen] = React33__namespace.useState(defaultOpen ?? false);
4643
+ const [open, setOpen] = React32__namespace.useState(defaultOpen ?? false);
4865
4644
  const isOpen = openProp ?? open;
4866
- const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
4645
+ const handleOpenChange = React32__namespace.useCallback((nextOpen) => {
4867
4646
  setOpen(nextOpen);
4868
4647
  onOpenChange?.(nextOpen);
4869
4648
  if (!nextOpen) {
4870
4649
  onInteractOutside?.();
4871
4650
  }
4872
4651
  }, [onOpenChange, onInteractOutside]);
4873
- const handleRadixValueChange = React33__namespace.useCallback((radixValue) => {
4652
+ const handleRadixValueChange = React32__namespace.useCallback((radixValue) => {
4874
4653
  const nextArr = [radixValue];
4875
4654
  if (!valueProp) {
4876
4655
  setInternalValue(nextArr);
@@ -4878,7 +4657,7 @@ var SelectRoot = React33__namespace.forwardRef(
4878
4657
  const items = collection.items.filter((item) => nextArr.includes(item.value));
4879
4658
  onValueChangeProp?.({ value: nextArr, items });
4880
4659
  }, [valueProp, collection.items, onValueChangeProp]);
4881
- const ctxValue = React33__namespace.useMemo(() => ({
4660
+ const ctxValue = React32__namespace.useMemo(() => ({
4882
4661
  value: currentValue,
4883
4662
  selectedItems,
4884
4663
  collection,
@@ -4898,7 +4677,7 @@ var SelectRoot = React33__namespace.forwardRef(
4898
4677
  if (typeof v === "string") return v;
4899
4678
  return v.base ?? v.lg ?? Object.values(v)[0];
4900
4679
  };
4901
- const inlineStyle = React33__namespace.useMemo(() => {
4680
+ const inlineStyle = React32__namespace.useMemo(() => {
4902
4681
  const s = { ...style };
4903
4682
  const rw = resolveVal(w);
4904
4683
  if (rw) s.width = rw;
@@ -4909,16 +4688,15 @@ var SelectRoot = React33__namespace.forwardRef(
4909
4688
  return s;
4910
4689
  }, [style, w, maxW, minW]);
4911
4690
  return /* @__PURE__ */ jsxRuntime.jsx(SelectInternalContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsx(
4912
- RadixSelect__namespace.Root,
4691
+ gui.Select,
4913
4692
  {
4914
4693
  value: currentValue[0] ?? "",
4915
4694
  defaultValue: defaultValueArr?.[0],
4916
4695
  onValueChange: handleRadixValueChange,
4917
4696
  open: isOpen,
4918
4697
  onOpenChange: handleOpenChange,
4919
- disabled: disabled || readOnly,
4698
+ disablePreventBodyScroll: true,
4920
4699
  name,
4921
- required,
4922
4700
  children: /* @__PURE__ */ jsxRuntime.jsx(
4923
4701
  "div",
4924
4702
  {
@@ -4936,17 +4714,18 @@ var SelectRoot = React33__namespace.forwardRef(
4936
4714
  ) });
4937
4715
  }
4938
4716
  );
4939
- var SelectControl = React33__namespace.forwardRef(
4717
+ var SelectControl = React32__namespace.forwardRef(
4940
4718
  function SelectControl2(props, ref) {
4941
4719
  const { children, noIndicator, triggerProps, loading, defaultValue } = props;
4942
4720
  const ctx = useSelectInternalContext();
4943
4721
  const isDefaultValue = Array.isArray(defaultValue) ? ctx.value.every((item) => defaultValue.includes(item)) : false;
4944
4722
  const { asChild, px: _px, className: triggerClassName, ...radixTriggerProps } = triggerProps ?? {};
4945
4723
  const trigger = /* @__PURE__ */ jsxRuntime.jsx(
4946
- RadixSelect__namespace.Trigger,
4724
+ gui.Select.Trigger,
4947
4725
  {
4948
4726
  ref,
4949
4727
  asChild,
4728
+ unstyled: true,
4950
4729
  className: cn(
4951
4730
  "group peer inline-flex items-center gap-2 cursor-pointer",
4952
4731
  "rounded-lg text-sm transition-colors outline-none",
@@ -4973,11 +4752,11 @@ var SelectControl = React33__namespace.forwardRef(
4973
4752
  return trigger;
4974
4753
  }
4975
4754
  );
4976
- var SelectClearTrigger = React33__namespace.forwardRef(
4755
+ var SelectClearTrigger = React32__namespace.forwardRef(
4977
4756
  function SelectClearTrigger2(props, ref) {
4978
4757
  const { className, ...rest } = props;
4979
4758
  const ctx = useSelectInternalContext();
4980
- const handleClick = React33__namespace.useCallback(() => {
4759
+ const handleClick = React32__namespace.useCallback(() => {
4981
4760
  ctx.onValueChange({ value: [], items: [] });
4982
4761
  }, [ctx]);
4983
4762
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4994,42 +4773,44 @@ var SelectClearTrigger = React33__namespace.forwardRef(
4994
4773
  );
4995
4774
  }
4996
4775
  );
4997
- var SelectContent = React33__namespace.forwardRef(
4998
- function SelectContent2(props, ref) {
4999
- const { portalled = true, portalRef, children, className, ...rest } = props;
5000
- const content = /* @__PURE__ */ jsxRuntime.jsx(
5001
- RadixSelect__namespace.Content,
5002
- {
5003
- ref,
5004
- position: "popper",
5005
- sideOffset: 4,
5006
- className: cn(
5007
- "z-50 min-w-[8rem] overflow-hidden rounded-lg",
5008
- "bg-[var(--color-popover-bg)] shadow-[var(--shadow-popover)]",
5009
- "border border-[var(--color-border-divider)]",
5010
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
5011
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
5012
- className
5013
- ),
5014
- ...rest,
5015
- children: /* @__PURE__ */ jsxRuntime.jsx(RadixSelect__namespace.Viewport, { className: "p-1", children })
5016
- }
4776
+ var SelectContent = React32__namespace.forwardRef(
4777
+ function SelectContent2(props, _ref) {
4778
+ const { portalled: _portalled, portalRef: _portalRef, children, className, ...rest } = props;
4779
+ let n = 0;
4780
+ const counter2 = () => n++;
4781
+ return (
4782
+ // Content is the focus scope — it takes no style props at all. The
4783
+ // Viewport is the box you can see, so the surface is declared there.
4784
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Content, { ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
4785
+ gui.Select.Viewport,
4786
+ {
4787
+ className: cn(
4788
+ "min-w-[8rem] overflow-hidden rounded-lg p-1",
4789
+ "bg-[var(--color-popover-bg)] shadow-[var(--shadow-popover)]",
4790
+ "border border-[var(--color-border-divider)]",
4791
+ className
4792
+ ),
4793
+ children: stampIndices(children, counter2)
4794
+ }
4795
+ ) })
5017
4796
  );
5018
- if (portalled) {
5019
- return /* @__PURE__ */ jsxRuntime.jsx(RadixSelect__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
5020
- }
5021
- return content;
5022
4797
  }
5023
4798
  );
5024
- var SelectItem = React33__namespace.forwardRef(
4799
+ var stampIndices = (children, next) => React32__namespace.Children.map(children, (child) => {
4800
+ if (!React32__namespace.isValidElement(child)) return child;
4801
+ if (child.type === SelectItem) return React32__namespace.cloneElement(child, { index: next() });
4802
+ const kids = child.props.children;
4803
+ return kids === void 0 ? child : React32__namespace.cloneElement(child, void 0, stampIndices(kids, next));
4804
+ });
4805
+ var SelectItem = React32__namespace.forwardRef(
5025
4806
  function SelectItem2(props, ref) {
5026
- const { item, children, className, ...rest } = props;
4807
+ const { item, children, className, index, ...rest } = props;
5027
4808
  return /* @__PURE__ */ jsxRuntime.jsxs(
5028
- RadixSelect__namespace.Item,
4809
+ gui.Select.Item,
5029
4810
  {
5030
4811
  ref,
4812
+ index: index ?? 0,
5031
4813
  value: item.value,
5032
- textValue: item.label,
5033
4814
  className: cn(
5034
4815
  "relative flex cursor-pointer select-none items-center gap-2",
5035
4816
  "rounded-md px-3 py-2 text-sm outline-none",
@@ -5042,14 +4823,14 @@ var SelectItem = React33__namespace.forwardRef(
5042
4823
  ...rest,
5043
4824
  children: [
5044
4825
  item.icon,
5045
- /* @__PURE__ */ jsxRuntime.jsx(RadixSelect__namespace.ItemText, { children }),
5046
- /* @__PURE__ */ jsxRuntime.jsx(RadixSelect__namespace.ItemIndicator, { className: "ml-auto shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "h-5 w-5" }) })
4826
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.ItemText, { children: children ?? item.label }),
4827
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.ItemIndicator, { className: "ml-auto shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "h-5 w-5" }) })
5047
4828
  ]
5048
4829
  }
5049
4830
  );
5050
4831
  }
5051
4832
  );
5052
- var SelectValueText = React33__namespace.forwardRef(
4833
+ var SelectValueText = React32__namespace.forwardRef(
5053
4834
  function SelectValueText2(props, ref) {
5054
4835
  const { children, size, required, invalid, errorText, mode, className, style, placeholder: placeholderProp, ...rest } = props;
5055
4836
  const ctx = useSelectInternalContext();
@@ -5094,7 +4875,7 @@ var SelectValueText = React33__namespace.forwardRef(
5094
4875
  return `${items.length} selected`;
5095
4876
  })();
5096
4877
  return /* @__PURE__ */ jsxRuntime.jsx(
5097
- RadixSelect__namespace.Value,
4878
+ gui.Select.Value,
5098
4879
  {
5099
4880
  ref,
5100
4881
  placeholder: placeholderText,
@@ -5105,18 +4886,18 @@ var SelectValueText = React33__namespace.forwardRef(
5105
4886
  );
5106
4887
  }
5107
4888
  );
5108
- var SelectItemGroup = React33__namespace.forwardRef(
4889
+ var SelectItemGroup = React32__namespace.forwardRef(
5109
4890
  function SelectItemGroup2(props, ref) {
5110
4891
  const { children, label, className, ...rest } = props;
5111
- return /* @__PURE__ */ jsxRuntime.jsxs(RadixSelect__namespace.Group, { ref, className: cn("py-1", className), ...rest, children: [
5112
- /* @__PURE__ */ jsxRuntime.jsx(RadixSelect__namespace.Label, { className: "px-3 py-1.5 text-xs font-medium text-[var(--color-text-secondary)]", children: label }),
4892
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Select.Group, { ref, className: cn("py-1", className), ...rest, children: [
4893
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Label, { className: "px-3 py-1.5 text-xs font-medium text-[var(--color-text-secondary)]", children: label }),
5113
4894
  children
5114
4895
  ] });
5115
4896
  }
5116
4897
  );
5117
- var SelectLabel = RadixSelect__namespace.Label;
5118
- var SelectItemText = RadixSelect__namespace.ItemText;
5119
- var Select = React33__namespace.forwardRef((props, ref) => {
4898
+ var SelectLabel = gui.Select.Label;
4899
+ var SelectItemText = gui.Select.ItemText;
4900
+ var Select = React32__namespace.forwardRef((props, ref) => {
5120
4901
  const { collection, placeholder, portalled = true, loading, errorText, contentProps, contentHeader, itemFilter, mode, ...rest } = props;
5121
4902
  return /* @__PURE__ */ jsxRuntime.jsxs(
5122
4903
  SelectRoot,
@@ -5138,7 +4919,7 @@ var Select = React33__namespace.forwardRef((props, ref) => {
5138
4919
  ) }),
5139
4920
  /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { portalled, ...contentProps, children: [
5140
4921
  contentHeader,
5141
- collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React33__namespace.Fragment, { children: [
4922
+ collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React32__namespace.Fragment, { children: [
5142
4923
  /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { item, children: item.renderLabel ? item.renderLabel("item") : item.label }),
5143
4924
  item.afterElement
5144
4925
  ] }, item.value))
@@ -5147,19 +4928,19 @@ var Select = React33__namespace.forwardRef((props, ref) => {
5147
4928
  }
5148
4929
  );
5149
4930
  });
5150
- var SelectAsync = React33__namespace.forwardRef((props, ref) => {
4931
+ var SelectAsync = React32__namespace.forwardRef((props, ref) => {
5151
4932
  const { placeholder, portalled = true, loading, loadOptions, extraControls, onValueChange, errorText, mode, contentHeader, ...rest } = props;
5152
- const [collection, setCollection] = React33__namespace.useState(createListCollection({ items: [] }));
5153
- const [inputValue, setInputValue] = React33__namespace.useState("");
5154
- const [value, setValue] = React33__namespace.useState([]);
4933
+ const [collection, setCollection] = React32__namespace.useState(createListCollection({ items: [] }));
4934
+ const [inputValue, setInputValue] = React32__namespace.useState("");
4935
+ const [value, setValue] = React32__namespace.useState([]);
5155
4936
  const debouncedInputValue = usehooks.useDebounce(inputValue, 300);
5156
- React33__namespace.useEffect(() => {
4937
+ React32__namespace.useEffect(() => {
5157
4938
  loadOptions(debouncedInputValue, value).then(setCollection);
5158
4939
  }, [debouncedInputValue, loadOptions, value]);
5159
- const handleFilterChange = React33__namespace.useCallback((val) => {
4940
+ const handleFilterChange = React32__namespace.useCallback((val) => {
5160
4941
  setInputValue(val);
5161
4942
  }, []);
5162
- const handleValueChange = React33__namespace.useCallback(({ value: v, items }) => {
4943
+ const handleValueChange = React32__namespace.useCallback(({ value: v, items }) => {
5163
4944
  setValue(v);
5164
4945
  onValueChange?.({ value: v, items });
5165
4946
  }, [onValueChange]);
@@ -5201,47 +4982,27 @@ var SelectAsync = React33__namespace.forwardRef((props, ref) => {
5201
4982
  }
5202
4983
  );
5203
4984
  });
5204
- var VARIANT_CLASSES5 = {
5205
- solid: "border-solid",
5206
- dashed: "border-dashed",
5207
- dotted: "border-dotted"
5208
- };
5209
- var HORIZONTAL_SIZE_CLASSES = {
5210
- xs: "border-t-[0.5px]",
5211
- sm: "border-t",
5212
- md: "border-t-2",
5213
- lg: "border-t-[3px]"
5214
- };
5215
- var VERTICAL_SIZE_CLASSES = {
5216
- xs: "border-l-[0.5px]",
5217
- sm: "border-l",
5218
- md: "border-l-2",
5219
- lg: "border-l-[3px]"
5220
- };
5221
- var Separator2 = React33__namespace.default.forwardRef(
5222
- function Separator3({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
5223
- const isVertical = orientation === "vertical";
4985
+ var WEIGHT = { xs: 0.5, sm: 1, md: 2, lg: 3 };
4986
+ var Separator = React32__namespace.default.forwardRef(
4987
+ function Separator2({ orientation = "horizontal", variant = "solid", size = "sm", ...rest }, ref) {
4988
+ const vertical = orientation === "vertical";
5224
4989
  return /* @__PURE__ */ jsxRuntime.jsx(
5225
4990
  gui.Separator,
5226
4991
  {
5227
4992
  ref,
5228
- vertical: isVertical,
4993
+ vertical,
5229
4994
  role: "separator",
5230
4995
  "aria-orientation": orientation,
5231
- className: cn(
5232
- "border-[var(--color-border-divider)]",
5233
- "border-0",
5234
- VARIANT_CLASSES5[variant],
5235
- isVertical ? VERTICAL_SIZE_CLASSES[size] : HORIZONTAL_SIZE_CLASSES[size],
5236
- isVertical ? "self-stretch h-auto w-0" : "w-full",
5237
- className
5238
- ),
4996
+ borderWidth: 0,
4997
+ borderStyle: variant,
4998
+ borderColor: "var(--color-border-divider)",
4999
+ ...vertical ? { borderLeftWidth: WEIGHT[size], alignSelf: "stretch", height: "auto", width: 0 } : { borderTopWidth: WEIGHT[size], width: "100%" },
5239
5000
  ...rest
5240
5001
  }
5241
5002
  );
5242
5003
  }
5243
5004
  );
5244
- var Slider = React33__namespace.forwardRef(
5005
+ var Slider = React32__namespace.forwardRef(
5245
5006
  function Slider2(props, ref) {
5246
5007
  const {
5247
5008
  marks: marksProp,
@@ -5265,12 +5026,12 @@ var Slider = React33__namespace.forwardRef(
5265
5026
  return mark;
5266
5027
  });
5267
5028
  const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
5268
- const latest = React33__namespace.useRef(value ?? defaultValue ?? []);
5269
- const handleValueChange = React33__namespace.useCallback((next) => {
5029
+ const latest = React32__namespace.useRef(value ?? defaultValue ?? []);
5030
+ const handleValueChange = React32__namespace.useCallback((next) => {
5270
5031
  latest.current = next;
5271
5032
  onValueChange?.(next);
5272
5033
  }, [onValueChange]);
5273
- const handleSlideEnd = React33__namespace.useCallback(() => {
5034
+ const handleSlideEnd = React32__namespace.useCallback(() => {
5274
5035
  onValueCommit?.(latest.current);
5275
5036
  }, [onValueCommit]);
5276
5037
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
@@ -5358,7 +5119,7 @@ function SliderMarks(props) {
5358
5119
  }
5359
5120
  var NOOP3 = () => {
5360
5121
  };
5361
- var SIZE_CLASSES9 = {
5122
+ var SIZE_CLASSES8 = {
5362
5123
  sm: {
5363
5124
  root: "h-4 w-7",
5364
5125
  thumb: "h-3 w-3",
@@ -5375,7 +5136,7 @@ var SIZE_CLASSES9 = {
5375
5136
  label: "text-base"
5376
5137
  }
5377
5138
  };
5378
- var SwitchBase = React33__namespace.forwardRef(
5139
+ var SwitchBase = React32__namespace.forwardRef(
5379
5140
  function Switch(props, ref) {
5380
5141
  const {
5381
5142
  inputProps,
@@ -5394,10 +5155,10 @@ var SwitchBase = React33__namespace.forwardRef(
5394
5155
  className,
5395
5156
  ...rest
5396
5157
  } = props;
5397
- const [internalChecked, setInternalChecked] = React33__namespace.useState(defaultChecked ?? false);
5158
+ const [internalChecked, setInternalChecked] = React32__namespace.useState(defaultChecked ?? false);
5398
5159
  const isControlled = checkedProp !== void 0;
5399
5160
  const checkedState = isControlled ? checkedProp : internalChecked;
5400
- const handleCheckedChange = React33__namespace.useCallback(
5161
+ const handleCheckedChange = React32__namespace.useCallback(
5401
5162
  (nextChecked) => {
5402
5163
  if (!isControlled) {
5403
5164
  setInternalChecked(nextChecked);
@@ -5406,7 +5167,7 @@ var SwitchBase = React33__namespace.forwardRef(
5406
5167
  },
5407
5168
  [isControlled, onCheckedChange]
5408
5169
  );
5409
- const sizeClasses2 = SIZE_CLASSES9[size];
5170
+ const sizeClasses2 = SIZE_CLASSES8[size];
5410
5171
  const isRtl = direction === "rtl";
5411
5172
  return /* @__PURE__ */ jsxRuntime.jsxs(
5412
5173
  "label",
@@ -5662,7 +5423,7 @@ function resolveResponsive(value) {
5662
5423
  }
5663
5424
  return void 0;
5664
5425
  }
5665
- var TableRoot = React33__namespace.forwardRef(
5426
+ var TableRoot = React32__namespace.forwardRef(
5666
5427
  function TableRoot2(props, ref) {
5667
5428
  const { className, style: styleProp, children, ...other } = props;
5668
5429
  const rawMinW = other.minWidth ?? other.minW;
@@ -5685,7 +5446,7 @@ var TableRoot = React33__namespace.forwardRef(
5685
5446
  );
5686
5447
  }
5687
5448
  );
5688
- var TableHeader = React33__namespace.forwardRef(
5449
+ var TableHeader = React32__namespace.forwardRef(
5689
5450
  function TableHeader2(props, ref) {
5690
5451
  const { className, style: styleProp, children, ...other } = props;
5691
5452
  const { style: extracted, rest } = extractStyles(other);
@@ -5702,7 +5463,7 @@ var TableHeader = React33__namespace.forwardRef(
5702
5463
  );
5703
5464
  }
5704
5465
  );
5705
- var TableBody = React33__namespace.forwardRef(
5466
+ var TableBody = React32__namespace.forwardRef(
5706
5467
  function TableBody2(props, ref) {
5707
5468
  const { className, style: styleProp, children, ...other } = props;
5708
5469
  const { style: extracted, rest } = extractStyles(other);
@@ -5719,7 +5480,7 @@ var TableBody = React33__namespace.forwardRef(
5719
5480
  );
5720
5481
  }
5721
5482
  );
5722
- var TableRow = React33__namespace.forwardRef(
5483
+ var TableRow = React32__namespace.forwardRef(
5723
5484
  function TableRow2(props, ref) {
5724
5485
  const { className, style: styleProp, children, ...other } = props;
5725
5486
  const { style: extracted, rest } = extractStyles(other);
@@ -5736,7 +5497,7 @@ var TableRow = React33__namespace.forwardRef(
5736
5497
  );
5737
5498
  }
5738
5499
  );
5739
- var TableCell = React33__namespace.forwardRef(
5500
+ var TableCell = React32__namespace.forwardRef(
5740
5501
  function TableCell2(props, ref) {
5741
5502
  const { isNumeric, className, style: styleProp, children, ...other } = props;
5742
5503
  const { style: extracted, rest } = extractStyles(other);
@@ -5757,7 +5518,7 @@ var TableCell = React33__namespace.forwardRef(
5757
5518
  );
5758
5519
  }
5759
5520
  );
5760
- var TableColumnHeader = React33__namespace.forwardRef(
5521
+ var TableColumnHeader = React32__namespace.forwardRef(
5761
5522
  function TableColumnHeader2(props, ref) {
5762
5523
  const { isNumeric, className, style: styleProp, children, ...other } = props;
5763
5524
  const { style: extracted, rest } = extractStyles(other);
@@ -5784,7 +5545,7 @@ var TableColumnHeader = React33__namespace.forwardRef(
5784
5545
  );
5785
5546
  var TableColumnHeaderSortable = (props) => {
5786
5547
  const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
5787
- const handleSortToggle = React33__namespace.useCallback(() => {
5548
+ const handleSortToggle = React32__namespace.useCallback(() => {
5788
5549
  onSortToggle(sortField);
5789
5550
  }, [onSortToggle, sortField]);
5790
5551
  const isActive = sortValue.includes(sortField);
@@ -5810,16 +5571,16 @@ var TableColumnHeaderSortable = (props) => {
5810
5571
  var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
5811
5572
  var TableHeaderSticky = (props) => {
5812
5573
  const { top, children, className, style: styleProp, ...rest } = props;
5813
- const ref = React33__namespace.useRef(null);
5814
- const [isStuck, setIsStuck] = React33__namespace.useState(false);
5815
- const handleScroll = React33__namespace.useCallback(() => {
5574
+ const ref = React32__namespace.useRef(null);
5575
+ const [isStuck, setIsStuck] = React32__namespace.useState(false);
5576
+ const handleScroll = React32__namespace.useCallback(() => {
5816
5577
  if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
5817
5578
  setIsStuck(true);
5818
5579
  } else {
5819
5580
  setIsStuck(false);
5820
5581
  }
5821
5582
  }, [top]);
5822
- React33__namespace.useEffect(() => {
5583
+ React32__namespace.useEffect(() => {
5823
5584
  const throttledHandleScroll = esToolkit.throttle(handleScroll, 300);
5824
5585
  window.addEventListener("scroll", throttledHandleScroll);
5825
5586
  return () => {
@@ -5841,7 +5602,7 @@ var TableHeaderSticky = (props) => {
5841
5602
  }
5842
5603
  );
5843
5604
  };
5844
- var TableCaption = React33__namespace.forwardRef(
5605
+ var TableCaption = React32__namespace.forwardRef(
5845
5606
  function TableCaption2(props, ref) {
5846
5607
  const { className, style: styleProp, children, ...other } = props;
5847
5608
  const { style: extracted, rest } = extractStyles(other);
@@ -5858,7 +5619,7 @@ var TableCaption = React33__namespace.forwardRef(
5858
5619
  );
5859
5620
  }
5860
5621
  );
5861
- var TableFooter = React33__namespace.forwardRef(
5622
+ var TableFooter = React32__namespace.forwardRef(
5862
5623
  function TableFooter2(props, ref) {
5863
5624
  const { className, style: styleProp, children, ...other } = props;
5864
5625
  const { style: extracted, rest } = extractStyles(other);
@@ -5875,7 +5636,7 @@ var TableFooter = React33__namespace.forwardRef(
5875
5636
  );
5876
5637
  }
5877
5638
  );
5878
- var TableScrollWrapper = React33__namespace.forwardRef(
5639
+ var TableScrollWrapper = React32__namespace.forwardRef(
5879
5640
  function TableScrollWrapper2(props, ref) {
5880
5641
  const { className, children, ...rest } = props;
5881
5642
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5889,206 +5650,115 @@ var TableScrollWrapper = React33__namespace.forwardRef(
5889
5650
  );
5890
5651
  }
5891
5652
  );
5892
- var ROOT_SIZE_CLASSES = {
5893
- sm: "[--tabs-height:2rem] [--tabs-content-padding:1.5rem]",
5894
- md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
5895
- free: ""
5896
- };
5897
- var TabsRoot = React33__namespace.forwardRef(
5898
- function TabsRoot2(props, ref) {
5899
- const {
5900
- variant = "solid",
5901
- size = "md",
5902
- fitted,
5903
- lazyMount: _lazyMount,
5904
- unmountOnExit: _unmountOnExit,
5905
- onValueChange,
5906
- className,
5907
- ...rest
5908
- } = props;
5909
- const handleValueChange = React33__namespace.useCallback(
5910
- (value) => {
5911
- if (!onValueChange) return;
5912
- onValueChange({ value });
5913
- },
5914
- [onValueChange]
5915
- );
5916
- return /* @__PURE__ */ jsxRuntime.jsx(
5917
- RadixTabs__namespace.Root,
5918
- {
5919
- ref,
5920
- "data-variant": variant,
5921
- "data-size": size,
5922
- "data-fitted": fitted ? "" : void 0,
5923
- className: cn(
5924
- "relative",
5925
- ROOT_SIZE_CLASSES[size],
5926
- className
5927
- ),
5928
- onValueChange: onValueChange ? handleValueChange : void 0,
5929
- ...rest
5930
- }
5931
- );
5932
- }
5933
- );
5934
- var TabsList = React33__namespace.forwardRef(
5935
- function TabsList2(props, ref) {
5936
- const {
5937
- className,
5938
- // Strip Chakra style props
5939
- flexWrap: _flexWrap,
5940
- alignItems: _alignItems,
5941
- whiteSpace: _whiteSpace,
5942
- bgColor: _bgColor,
5943
- marginBottom: _marginBottom,
5944
- mx: _mx,
5945
- px: _px,
5946
- w: _w,
5947
- overflowX: _overflowX,
5948
- overscrollBehaviorX: _overscrollBehaviorX,
5949
- css: _css,
5950
- position: _position,
5951
- boxShadow: _boxShadow,
5952
- top: _top,
5953
- zIndex: _zIndex,
5954
- style: styleProp,
5955
- asChild,
5956
- loop,
5957
- ...rest
5958
- } = props;
5959
- return /* @__PURE__ */ jsxRuntime.jsx(
5960
- RadixTabs__namespace.List,
5961
- {
5962
- ref,
5963
- asChild,
5964
- loop,
5965
- className: cn(
5966
- "inline-flex w-full relative isolate flex-row",
5967
- "min-h-[var(--tabs-height,2.5rem)]",
5968
- className
5969
- ),
5970
- style: styleProp,
5971
- ...rest
5972
- }
5973
- );
5974
- }
5975
- );
5976
- var TRIGGER_BASE = "outline-none min-w-[var(--tabs-height,2.5rem)] h-[var(--tabs-height,2.5rem)] flex items-center relative cursor-pointer gap-2 focus-visible:z-[1] focus-visible:outline-2 focus-visible:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-50";
5977
- var TRIGGER_SIZE_CLASSES = {
5978
- sm: "py-1 px-3 text-sm",
5979
- md: "py-2 px-4 text-base",
5980
- free: ""
5653
+ var Shape = React32__namespace.createContext({
5654
+ variant: "solid",
5655
+ size: "md",
5656
+ fitted: false
5657
+ });
5658
+ var SIZE2 = {
5659
+ sm: { height: 32, minWidth: 32, paddingVertical: 4, paddingHorizontal: 12, fontSize: 14 },
5660
+ md: { height: 40, minWidth: 40, paddingVertical: 8, paddingHorizontal: 16, fontSize: 16 },
5661
+ free: {}
5981
5662
  };
5982
- var TRIGGER_VARIANT_CLASSES = {
5983
- solid: "font-semibold gap-1 rounded-md bg-transparent text-tabs-solid-fg data-[state=active]:bg-selected-control-bg data-[state=active]:text-selected-control-text data-[state=active]:hover:text-selected-control-text hover:text-hover",
5984
- secondary: "font-medium bg-transparent text-tabs-secondary-fg border-2 border-solid border-tabs-secondary-border rounded-md data-[state=active]:bg-selected-control-bg data-[state=active]:text-selected-control-text data-[state=active]:border-transparent data-[state=active]:hover:border-transparent hover:text-hover hover:border-hover",
5985
- segmented: "bg-transparent text-text-primary border-2 border-solid border-selected-control-bg hover:text-hover data-[state=active]:text-selected-control-text data-[state=active]:bg-selected-control-bg data-[state=active]:border-selected-control-bg data-[state=active]:hover:text-selected-control-text",
5986
- unstyled: ""
5663
+ var SELECTED_BG2 = "var(--color-selected-control-bg)";
5664
+ var SELECTED_FG2 = "var(--color-selected-control-text)";
5665
+ var VARIANT3 = {
5666
+ solid: {
5667
+ rest: {
5668
+ fontWeight: "600",
5669
+ borderRadius: 6,
5670
+ color: "var(--color-tabs-solid-fg)",
5671
+ hoverStyle: { color: "var(--color-hover)" }
5672
+ },
5673
+ active: { backgroundColor: SELECTED_BG2, color: SELECTED_FG2 }
5674
+ },
5675
+ secondary: {
5676
+ rest: {
5677
+ fontWeight: "500",
5678
+ borderRadius: 6,
5679
+ borderWidth: 2,
5680
+ borderColor: "var(--color-tabs-secondary-border)",
5681
+ color: "var(--color-tabs-secondary-fg)",
5682
+ hoverStyle: { color: "var(--color-hover)", borderColor: "var(--color-hover)" }
5683
+ },
5684
+ active: { backgroundColor: SELECTED_BG2, color: SELECTED_FG2, borderColor: "transparent" }
5685
+ },
5686
+ segmented: {
5687
+ rest: {
5688
+ borderWidth: 2,
5689
+ borderColor: SELECTED_BG2,
5690
+ color: "var(--color-text-primary)",
5691
+ hoverStyle: { color: "var(--color-hover)" }
5692
+ },
5693
+ active: { backgroundColor: SELECTED_BG2, borderColor: SELECTED_BG2, color: SELECTED_FG2 }
5694
+ },
5695
+ unstyled: { rest: {}, active: {} }
5987
5696
  };
5988
- var TabsTrigger = React33__namespace.forwardRef(
5989
- function TabsTrigger2(props, ref) {
5990
- const {
5991
- className,
5992
- // Strip Chakra style props
5993
- scrollSnapAlign: _scrollSnapAlign,
5994
- flexShrink: _flexShrink,
5995
- bgColor: _bgColor,
5996
- w: _w,
5997
- py: _py,
5998
- borderRadius: _borderRadius,
5999
- fontWeight: _fontWeight,
6000
- color: _color,
6001
- _hover,
6002
- position: _position,
6003
- top: _top,
6004
- left: _left,
6005
- visibility: _visibility,
5697
+ var LIST_HEIGHT = { sm: 32, md: 40, free: void 0 };
5698
+ var TabsRoot = ({
5699
+ variant = "solid",
5700
+ size = "md",
5701
+ fitted = false,
5702
+ onValueChange,
5703
+ ...rest
5704
+ }) => {
5705
+ const shape = React32__namespace.useMemo(() => ({ variant, size, fitted }), [variant, size, fitted]);
5706
+ return /* @__PURE__ */ jsxRuntime.jsx(Shape.Provider, { value: shape, children: /* @__PURE__ */ jsxRuntime.jsx(
5707
+ gui.Tabs,
5708
+ {
5709
+ unstyled: true,
5710
+ position: "relative",
5711
+ orientation: "horizontal",
5712
+ onValueChange: onValueChange ? (value) => onValueChange({ value }) : void 0,
6006
5713
  ...rest
6007
- } = props;
6008
- const internalRef = React33__namespace.useRef(null);
6009
- const mergedRef = useMergedRef(ref, internalRef);
6010
- const { variant, size, fitted } = useTabsContext(internalRef);
6011
- return /* @__PURE__ */ jsxRuntime.jsx(
6012
- RadixTabs__namespace.Trigger,
6013
- {
6014
- ref: mergedRef,
6015
- className: cn(
6016
- "group",
6017
- TRIGGER_BASE,
6018
- TRIGGER_SIZE_CLASSES[size],
6019
- TRIGGER_VARIANT_CLASSES[variant],
6020
- fitted && "flex-1 text-center justify-center",
6021
- className
6022
- ),
6023
- ...rest
6024
- }
6025
- );
6026
- }
6027
- );
6028
- var TabsContent = React33__namespace.forwardRef(
6029
- function TabsContent2(props, ref) {
6030
- const { className, padding: _padding, ...rest } = props;
6031
- return /* @__PURE__ */ jsxRuntime.jsx(
6032
- RadixTabs__namespace.Content,
6033
- {
6034
- ref,
6035
- className: cn(
6036
- "w-full pt-[var(--tabs-content-padding,1.5rem)]",
6037
- "focus-visible:outline-2 focus-visible:outline-offset-[-2px]",
6038
- className
6039
- ),
6040
- ...rest
6041
- }
6042
- );
6043
- }
6044
- );
6045
- var COUNTER_OVERLOAD = 50;
6046
- var TabsCounter = ({ count }) => {
6047
- if (count === void 0 || count === null) {
6048
- return null;
6049
- }
5714
+ }
5715
+ ) });
5716
+ };
5717
+ var TabsList = (props) => {
5718
+ const { size } = React32__namespace.useContext(Shape);
6050
5719
  return /* @__PURE__ */ jsxRuntime.jsx(
6051
- "span",
5720
+ gui.Tabs.List,
6052
5721
  {
6053
- className: cn(
6054
- "group-hover:text-inherit",
6055
- count > 0 ? "text-text-secondary" : "text-[rgba(16,17,18,0.24)] dark:text-[rgba(255,255,255,0.24)]"
6056
- ),
6057
- children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count
5722
+ unstyled: true,
5723
+ width: "100%",
5724
+ position: "relative",
5725
+ flexDirection: "row",
5726
+ backgroundColor: "transparent",
5727
+ minHeight: LIST_HEIGHT[size],
5728
+ ...props
6058
5729
  }
6059
5730
  );
6060
5731
  };
6061
- function useTabsContext(triggerRef) {
6062
- const [ctx, setCtx] = React33__namespace.useState({ variant: "solid", size: "md", fitted: false });
6063
- React33__namespace.useEffect(() => {
6064
- const el = triggerRef.current;
6065
- if (!el) return;
6066
- const root = el.closest("[data-variant]");
6067
- if (!root) return;
6068
- setCtx({
6069
- variant: root.getAttribute("data-variant") ?? "solid",
6070
- size: root.getAttribute("data-size") ?? "md",
6071
- fitted: root.hasAttribute("data-fitted")
6072
- });
6073
- }, [triggerRef]);
6074
- return ctx;
6075
- }
6076
- function useMergedRef(...refs) {
6077
- return React33__namespace.useCallback(
6078
- (instance) => {
6079
- for (const ref of refs) {
6080
- if (!ref) continue;
6081
- if (typeof ref === "function") {
6082
- ref(instance);
6083
- } else {
6084
- ref.current = instance;
6085
- }
6086
- }
6087
- },
6088
- // eslint-disable-next-line react-hooks/exhaustive-deps
6089
- refs
5732
+ var TabsTrigger = ({ children, ...props }) => {
5733
+ const { variant, size, fitted } = React32__namespace.useContext(Shape);
5734
+ const { rest, active } = VARIANT3[variant];
5735
+ const selected = gui.useTabsContext().value === props.value;
5736
+ return /* @__PURE__ */ jsxRuntime.jsx(
5737
+ gui.Tabs.Tab,
5738
+ {
5739
+ unstyled: true,
5740
+ flexDirection: "row",
5741
+ alignItems: "center",
5742
+ justifyContent: "center",
5743
+ position: "relative",
5744
+ cursor: "pointer",
5745
+ gap: 8,
5746
+ borderWidth: 0,
5747
+ ...SIZE2[size],
5748
+ ...rest,
5749
+ ...selected ? active : null,
5750
+ ...fitted ? { flex: 1 } : null,
5751
+ ...props,
5752
+ children: ink(children, void 0, { fontSize: "inherit", color: "inherit", fontWeight: "inherit" })
5753
+ }
6090
5754
  );
6091
- }
5755
+ };
5756
+ var TabsContent = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Tabs.Content, { unstyled: true, width: "100%", paddingTop: 24, backgroundColor: "transparent", ...props, children: ink(children) });
5757
+ var COUNTER_OVERLOAD = 50;
5758
+ var TabsCounter = ({ count }) => {
5759
+ if (count === void 0 || count === null) return null;
5760
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { color: count > 0 ? "var(--color-text-secondary)" : "var(--color-text-disabled)", children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count });
5761
+ };
6092
5762
  var nbsp = String.fromCharCode(160);
6093
5763
  function TruncatedTextTooltip2({ label, children }) {
6094
5764
  return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
@@ -6112,7 +5782,7 @@ var TAG_SELECTED_CLASSES = [
6112
5782
  "hover:opacity-76"
6113
5783
  ].join(" ");
6114
5784
  var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
6115
- var Tag = React33__namespace.forwardRef(
5785
+ var Tag = React32__namespace.forwardRef(
6116
5786
  function Tag2(props, ref) {
6117
5787
  const {
6118
5788
  variant,
@@ -6176,32 +5846,16 @@ var Tag = React33__namespace.forwardRef(
6176
5846
  ) });
6177
5847
  }
6178
5848
  );
6179
- var TEXTAREA_BASE = [
6180
- "w-full appearance-none outline-none transition-colors resize-y",
6181
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
6182
- "placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
6183
- "hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
6184
- "focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
6185
- "focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
6186
- "disabled:opacity-40 disabled:cursor-not-allowed",
6187
- "read-only:opacity-70",
6188
- "data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
6189
- ].join(" ");
6190
- var TEXTAREA_SIZE_CLASSES = {
6191
- xs: "px-2 py-1 text-xs rounded",
6192
- sm: "px-3 py-2 text-sm rounded-md",
6193
- md: "px-4 py-2 text-base rounded-md",
6194
- lg: "px-4 py-3 text-lg rounded-lg",
6195
- "2xl": "px-4 py-3 text-xl rounded-lg"
6196
- };
6197
- var TEXTAREA_VARIANT_CLASSES = {
6198
- outline: "border border-solid",
6199
- filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
6200
- unstyled: "border-0 bg-transparent p-0"
5849
+ var SIZE3 = {
5850
+ xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: 12, borderRadius: 4 },
5851
+ sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: 14, borderRadius: 6 },
5852
+ md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: 16, borderRadius: 6 },
5853
+ lg: { paddingHorizontal: 16, paddingVertical: 12, fontSize: 18, borderRadius: 8 },
5854
+ "2xl": { paddingHorizontal: 16, paddingVertical: 12, fontSize: 20, borderRadius: 8 }
6201
5855
  };
6202
- var Textarea = React33__namespace.default.forwardRef(
5856
+ var Textarea = React32__namespace.default.forwardRef(
6203
5857
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
6204
- const handleChange = React33__namespace.default.useCallback(
5858
+ const handleChange = React32__namespace.default.useCallback(
6205
5859
  (event) => {
6206
5860
  onChange?.(event);
6207
5861
  onChangeText?.(event.target.value);
@@ -6213,7 +5867,10 @@ var Textarea = React33__namespace.default.forwardRef(
6213
5867
  {
6214
5868
  ref,
6215
5869
  unstyled: true,
6216
- className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
5870
+ className: className ? `lux-control ${className}` : "lux-control",
5871
+ ...CONTROL,
5872
+ ...SIZE3[size],
5873
+ ...VARIANT2[variant],
6217
5874
  ...rest,
6218
5875
  onChange: handleChange
6219
5876
  }
@@ -6223,93 +5880,90 @@ var Textarea = React33__namespace.default.forwardRef(
6223
5880
  Textarea.displayName = "Textarea";
6224
5881
  var SECOND = 1e3;
6225
5882
  var DURATION = 10 * SECOND;
6226
- function mapOptions(opts) {
6227
- const external = {
6228
- id: opts.id,
6229
- description: opts.description,
6230
- duration: opts.duration
5883
+ var entries = [];
5884
+ var listeners = /* @__PURE__ */ new Set();
5885
+ var counter = 0;
5886
+ var emit = () => listeners.forEach((l) => l());
5887
+ var subscribe = (l) => {
5888
+ listeners.add(l);
5889
+ return () => {
5890
+ listeners.delete(l);
6231
5891
  };
6232
- if (opts.action) {
6233
- external.action = {
6234
- label: opts.action.label,
6235
- onClick: opts.action.onClick
6236
- };
6237
- }
6238
- if (opts.onStatusChange) {
6239
- const cb = opts.onStatusChange;
6240
- external.onDismiss = () => cb({ status: "unmounted" });
6241
- external.onAutoClose = () => cb({ status: "unmounted" });
6242
- }
6243
- return external;
6244
- }
6245
- function create(opts) {
6246
- const external = mapOptions(opts);
6247
- const title = opts.title ?? "";
6248
- switch (opts.type) {
6249
- case "success":
6250
- return sonner.toast.success(title, external);
6251
- case "error":
6252
- return sonner.toast.error(title, external);
6253
- case "warning":
6254
- return sonner.toast.warning(title, external);
6255
- case "loading":
6256
- return sonner.toast.loading(title, external);
6257
- case "info":
6258
- default:
6259
- return sonner.toast.info(title, external);
6260
- }
6261
- }
6262
- function update(id, opts) {
6263
- const title = opts.title ?? "";
6264
- const external = mapOptions({ ...opts, id });
6265
- switch (opts.type) {
6266
- case "success":
6267
- sonner.toast.success(title, external);
6268
- break;
6269
- case "error":
6270
- sonner.toast.error(title, external);
6271
- break;
6272
- case "warning":
6273
- sonner.toast.warning(title, external);
6274
- break;
6275
- case "loading":
6276
- sonner.toast.loading(title, external);
6277
- break;
6278
- case "info":
6279
- default:
6280
- sonner.toast.info(title, external);
6281
- break;
6282
- }
6283
- }
5892
+ };
5893
+ var snapshot = () => entries;
5894
+ var remove = (id) => {
5895
+ const found = entries.find((e) => e.id === id);
5896
+ entries = entries.filter((e) => e.id !== id);
5897
+ emit();
5898
+ found?.onStatusChange?.({ status: "unmounted" });
5899
+ };
5900
+ var create = (opts) => {
5901
+ const id = opts.id ?? `toast-${++counter}`;
5902
+ const entry = { ...opts, id };
5903
+ entries = [...entries.filter((e) => e.id !== id), entry];
5904
+ emit();
5905
+ return id;
5906
+ };
5907
+ var update = (id, opts) => {
5908
+ entries = entries.map((e) => e.id === id ? { ...e, ...opts, id } : e);
5909
+ emit();
5910
+ };
6284
5911
  var toaster = {
6285
5912
  create,
6286
5913
  success: (opts) => create({ ...opts, type: "success" }),
6287
5914
  error: (opts) => create({ ...opts, type: "error" }),
6288
5915
  loading: (opts) => create({ ...opts, type: "loading" }),
6289
5916
  update,
6290
- remove: (id) => sonner.toast.dismiss(id)
5917
+ remove
6291
5918
  };
6292
- var Toaster = () => {
6293
- return /* @__PURE__ */ jsxRuntime.jsx(
6294
- sonner.Toaster,
6295
- {
6296
- position: "top-right",
6297
- richColors: true,
6298
- closeButton: true,
6299
- duration: DURATION,
6300
- offset: { top: 12, right: 12, bottom: 12, left: 12 },
6301
- mobileOffset: { top: 16, right: 16, bottom: 16, left: 16 },
6302
- toastOptions: {
6303
- className: "font-sans",
6304
- style: {
6305
- fontFamily: 'var(--font-sans, "Geist", sans-serif)',
6306
- color: "var(--color-text-primary)",
6307
- backgroundColor: "var(--color-bg-primary)",
6308
- borderColor: "var(--color-border-divider)"
5919
+ var EDGE = {
5920
+ success: "var(--color-status-good)",
5921
+ error: "var(--color-status-bad)",
5922
+ warning: "var(--color-status-warn)",
5923
+ loading: "var(--color-border-divider)",
5924
+ info: "var(--color-border-divider)"
5925
+ };
5926
+ var One = ({ entry }) => /* @__PURE__ */ jsxRuntime.jsxs(
5927
+ gui.Toast,
5928
+ {
5929
+ duration: entry.duration ?? DURATION,
5930
+ onOpenChange: (open) => {
5931
+ if (!open) remove(entry.id);
5932
+ },
5933
+ unstyled: true,
5934
+ flexDirection: "column",
5935
+ gap: 4,
5936
+ padding: 12,
5937
+ borderRadius: 8,
5938
+ borderWidth: 1,
5939
+ borderColor: EDGE[entry.type ?? "info"],
5940
+ backgroundColor: "var(--color-popover-bg)",
5941
+ transition: "quick",
5942
+ enterStyle: { opacity: 0, y: -8 },
5943
+ exitStyle: { opacity: 0, y: -8 },
5944
+ children: [
5945
+ entry.title ? /* @__PURE__ */ jsxRuntime.jsx(gui.Toast.Title, { unstyled: true, fontSize: 14, fontWeight: "600", color: "var(--color-text-primary)", children: entry.title }) : null,
5946
+ entry.description ? /* @__PURE__ */ jsxRuntime.jsx(gui.Toast.Description, { unstyled: true, fontSize: 13, color: "var(--color-text-secondary)", children: entry.description }) : null,
5947
+ entry.action ? /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Toast.Action, { altText: entry.action.label, onPress: entry.action.onClick, children: /* @__PURE__ */ jsxRuntime.jsx(
5948
+ gui.Text,
5949
+ {
5950
+ cursor: "pointer",
5951
+ fontSize: 13,
5952
+ fontWeight: "500",
5953
+ color: "var(--color-link-primary)",
5954
+ children: entry.action.label
6309
5955
  }
6310
- }
6311
- }
6312
- );
5956
+ ) }) }) : null
5957
+ ]
5958
+ },
5959
+ entry.id
5960
+ );
5961
+ var Toaster = () => {
5962
+ const list = React32__namespace.useSyncExternalStore(subscribe, snapshot, snapshot);
5963
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.ToastProvider, { children: [
5964
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { children: list.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(One, { entry }, entry.id)) }),
5965
+ /* @__PURE__ */ jsxRuntime.jsx(gui.ToastViewport, { position: "absolute", top: 12, right: 12 })
5966
+ ] });
6313
5967
  };
6314
5968
  function fmt(n, decimals = 2) {
6315
5969
  if (n === void 0 || n === null) return "-";
@@ -6344,7 +5998,7 @@ function QuoteCell({ value, highlight, align = "right", onClick, className }) {
6344
5998
  }
6345
5999
  var CALL_HEADERS = ["Bid", "Ask", "Last", "Vol", "OI", "IV", "Delta"];
6346
6000
  var PUT_HEADERS = ["Delta", "IV", "OI", "Vol", "Last", "Ask", "Bid"];
6347
- var OptionChain = React33__namespace.forwardRef(
6001
+ var OptionChain = React32__namespace.forwardRef(
6348
6002
  function OptionChain2(props, ref) {
6349
6003
  const {
6350
6004
  symbol: _symbol,
@@ -6355,7 +6009,7 @@ var OptionChain = React33__namespace.forwardRef(
6355
6009
  className,
6356
6010
  ...rest
6357
6011
  } = props;
6358
- const handleClick = React33__namespace.useCallback(
6012
+ const handleClick = React32__namespace.useCallback(
6359
6013
  (quote, type, strike) => {
6360
6014
  if (!quote || !onSelectContract) return;
6361
6015
  onSelectContract({
@@ -6535,7 +6189,7 @@ function GreekItem({ def, value, compact }) {
6535
6189
  }
6536
6190
  );
6537
6191
  }
6538
- var GreeksDisplay = React33__namespace.forwardRef(
6192
+ var GreeksDisplay = React32__namespace.forwardRef(
6539
6193
  function GreeksDisplay2(props, ref) {
6540
6194
  const {
6541
6195
  delta,
@@ -6767,7 +6421,7 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
6767
6421
  )
6768
6422
  ] });
6769
6423
  }
6770
- var StrategyBuilder = React33__namespace.forwardRef(
6424
+ var StrategyBuilder = React32__namespace.forwardRef(
6771
6425
  function StrategyBuilder2(props, ref) {
6772
6426
  const {
6773
6427
  underlying,
@@ -6779,12 +6433,12 @@ var StrategyBuilder = React33__namespace.forwardRef(
6779
6433
  ...rest
6780
6434
  } = props;
6781
6435
  const defaultExp = expirations[0] ?? "";
6782
- const [strategyType, setStrategyType] = React33__namespace.useState("bull_call_spread");
6783
- const [legs, setLegs] = React33__namespace.useState(() => {
6436
+ const [strategyType, setStrategyType] = React32__namespace.useState("bull_call_spread");
6437
+ const [legs, setLegs] = React32__namespace.useState(() => {
6784
6438
  const preset = STRATEGY_PRESETS.find((p) => p.value === "bull_call_spread");
6785
6439
  return preset ? preset.buildLegs(strikes, spotPrice, defaultExp) : [];
6786
6440
  });
6787
- const handleStrategyChange = React33__namespace.useCallback(
6441
+ const handleStrategyChange = React32__namespace.useCallback(
6788
6442
  (e) => {
6789
6443
  const type = e.target.value;
6790
6444
  setStrategyType(type);
@@ -6795,7 +6449,7 @@ var StrategyBuilder = React33__namespace.forwardRef(
6795
6449
  },
6796
6450
  [strikes, spotPrice, defaultExp]
6797
6451
  );
6798
- const handleLegChange = React33__namespace.useCallback(
6452
+ const handleLegChange = React32__namespace.useCallback(
6799
6453
  (index, leg) => {
6800
6454
  setLegs((prev) => {
6801
6455
  const next = [...prev];
@@ -6805,13 +6459,13 @@ var StrategyBuilder = React33__namespace.forwardRef(
6805
6459
  },
6806
6460
  []
6807
6461
  );
6808
- const handleLegRemove = React33__namespace.useCallback(
6462
+ const handleLegRemove = React32__namespace.useCallback(
6809
6463
  (index) => {
6810
6464
  setLegs((prev) => prev.filter((_, i) => i !== index));
6811
6465
  },
6812
6466
  []
6813
6467
  );
6814
- const handleAddLeg = React33__namespace.useCallback(() => {
6468
+ const handleAddLeg = React32__namespace.useCallback(() => {
6815
6469
  if (legs.length >= 4) return;
6816
6470
  const atm = findATM(strikes, spotPrice);
6817
6471
  setLegs((prev) => [
@@ -6819,14 +6473,14 @@ var StrategyBuilder = React33__namespace.forwardRef(
6819
6473
  { action: "buy", type: "call", strike: atm, expiration: defaultExp, quantity: 1 }
6820
6474
  ]);
6821
6475
  }, [legs.length, strikes, spotPrice, defaultExp]);
6822
- const netPremium = React33__namespace.useMemo(() => {
6476
+ const netPremium = React32__namespace.useMemo(() => {
6823
6477
  return legs.reduce((sum, leg) => {
6824
6478
  if (leg.premium === void 0) return sum;
6825
6479
  const sign = leg.action === "buy" ? -1 : 1;
6826
6480
  return sum + sign * leg.premium * leg.quantity;
6827
6481
  }, 0);
6828
6482
  }, [legs]);
6829
- const handleSubmit = React33__namespace.useCallback(() => {
6483
+ const handleSubmit = React32__namespace.useCallback(() => {
6830
6484
  if (!onSubmit || legs.length === 0) return;
6831
6485
  onSubmit({
6832
6486
  type: strategyType,
@@ -6949,7 +6603,7 @@ function buildPath(points, vb, width, height) {
6949
6603
  var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
6950
6604
  var BREAKEVEN_COLOR = "var(--chart-1)";
6951
6605
  var BREAKEVEN_RING = "var(--background)";
6952
- var PnlDiagram = React33__namespace.forwardRef(
6606
+ var PnlDiagram = React32__namespace.forwardRef(
6953
6607
  function PnlDiagram2(props, ref) {
6954
6608
  const {
6955
6609
  legs,
@@ -6958,14 +6612,14 @@ var PnlDiagram = React33__namespace.forwardRef(
6958
6612
  className,
6959
6613
  ...rest
6960
6614
  } = props;
6961
- const containerRef = React33__namespace.useRef(null);
6962
- const [hoverX, setHoverX] = React33__namespace.useState(null);
6963
- const [dims, setDims] = React33__namespace.useState({ width: 600, height: 240 });
6964
- React33__namespace.useEffect(() => {
6615
+ const containerRef = React32__namespace.useRef(null);
6616
+ const [hoverX, setHoverX] = React32__namespace.useState(null);
6617
+ const [dims, setDims] = React32__namespace.useState({ width: 600, height: 240 });
6618
+ React32__namespace.useEffect(() => {
6965
6619
  const el = containerRef.current;
6966
6620
  if (!el) return;
6967
- const observer = new ResizeObserver((entries) => {
6968
- const entry = entries[0];
6621
+ const observer = new ResizeObserver((entries2) => {
6622
+ const entry = entries2[0];
6969
6623
  if (entry) {
6970
6624
  setDims({
6971
6625
  width: Math.max(entry.contentRect.width, 200),
@@ -6984,7 +6638,7 @@ var PnlDiagram = React33__namespace.forwardRef(
6984
6638
  const xMax = maxStrike + range * 0.3;
6985
6639
  const SAMPLES = 200;
6986
6640
  const step = (xMax - xMin) / SAMPLES;
6987
- const combinedPoints = React33__namespace.useMemo(() => {
6641
+ const combinedPoints = React32__namespace.useMemo(() => {
6988
6642
  const pts = [];
6989
6643
  for (let i = 0; i <= SAMPLES; i++) {
6990
6644
  const price = xMin + i * step;
@@ -6992,7 +6646,7 @@ var PnlDiagram = React33__namespace.forwardRef(
6992
6646
  }
6993
6647
  return pts;
6994
6648
  }, [legs, multiplier, xMin, step]);
6995
- const legPointSets = React33__namespace.useMemo(() => {
6649
+ const legPointSets = React32__namespace.useMemo(() => {
6996
6650
  return legs.map((leg) => {
6997
6651
  const pts = [];
6998
6652
  for (let i = 0; i <= SAMPLES; i++) {
@@ -7013,7 +6667,7 @@ var PnlDiagram = React33__namespace.forwardRef(
7013
6667
  const chartH = height - PADDING.top - PADDING.bottom;
7014
6668
  const scaleX = (x) => PADDING.left + (x - vb.xMin) / (vb.xMax - vb.xMin) * chartW;
7015
6669
  const scaleY = (y) => PADDING.top + chartH - (y - vb.yMin) / (vb.yMax - vb.yMin) * chartH;
7016
- const breakevens = React33__namespace.useMemo(() => {
6670
+ const breakevens = React32__namespace.useMemo(() => {
7017
6671
  const pts = [];
7018
6672
  for (let i = 1; i < combinedPoints.length; i++) {
7019
6673
  const prev = combinedPoints[i - 1];
@@ -7030,7 +6684,7 @@ var PnlDiagram = React33__namespace.forwardRef(
7030
6684
  const maxGainPoint = combinedPoints.find((p) => p.y === maxGain);
7031
6685
  const maxLossPoint = combinedPoints.find((p) => p.y === maxLoss);
7032
6686
  const zeroY = scaleY(0);
7033
- const handleMouseMove = React33__namespace.useCallback(
6687
+ const handleMouseMove = React32__namespace.useCallback(
7034
6688
  (e) => {
7035
6689
  const rect = e.currentTarget.getBoundingClientRect();
7036
6690
  const mouseX = e.clientX - rect.left;
@@ -7043,7 +6697,7 @@ var PnlDiagram = React33__namespace.forwardRef(
7043
6697
  },
7044
6698
  [vb.xMin, vb.xMax, chartW]
7045
6699
  );
7046
- const handleMouseLeave = React33__namespace.useCallback(() => setHoverX(null), []);
6700
+ const handleMouseLeave = React32__namespace.useCallback(() => setHoverX(null), []);
7047
6701
  const hoverPnl = hoverX !== null ? calcTotalPnl(legs, hoverX, multiplier) : null;
7048
6702
  buildPath(
7049
6703
  combinedPoints.map((p) => ({ x: scaleX(p.x), y: scaleY(p.y) })).map((p) => ({ x: p.x - PADDING.left, y: p.y - PADDING.top })),
@@ -7347,7 +7001,7 @@ function formatDate(date) {
7347
7001
  const d = new Date(date);
7348
7002
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
7349
7003
  }
7350
- var OptionPositionCard = React33__namespace.forwardRef(
7004
+ var OptionPositionCard = React32__namespace.forwardRef(
7351
7005
  function OptionPositionCard2(props, ref) {
7352
7006
  const {
7353
7007
  position,
@@ -7511,7 +7165,7 @@ function ExpirationPill({ exp, isSelected, onClick }) {
7511
7165
  }
7512
7166
  );
7513
7167
  }
7514
- var ExpirationSelector = React33__namespace.forwardRef(
7168
+ var ExpirationSelector = React32__namespace.forwardRef(
7515
7169
  function ExpirationSelector2(props, ref) {
7516
7170
  const {
7517
7171
  expirations,
@@ -7521,8 +7175,8 @@ var ExpirationSelector = React33__namespace.forwardRef(
7521
7175
  className,
7522
7176
  ...rest
7523
7177
  } = props;
7524
- const scrollRef = React33__namespace.useRef(null);
7525
- React33__namespace.useEffect(() => {
7178
+ const scrollRef = React32__namespace.useRef(null);
7179
+ React32__namespace.useEffect(() => {
7526
7180
  const container = scrollRef.current;
7527
7181
  if (!container) return;
7528
7182
  const selectedEl = container.querySelector('[data-selected="true"]');
@@ -7941,7 +7595,7 @@ exports.ProgressCircleRoot = ProgressCircleRoot;
7941
7595
  exports.ProgressCircleValueText = ProgressCircleValueText;
7942
7596
  exports.ProjectSwitcher = ProjectSwitcher;
7943
7597
  exports.Radio = Radio2;
7944
- exports.RadioGroup = RadioGroup3;
7598
+ exports.RadioGroup = RadioGroup2;
7945
7599
  exports.Rating = Rating;
7946
7600
  exports.Select = Select;
7947
7601
  exports.SelectAsync = SelectAsync;
@@ -7954,7 +7608,7 @@ exports.SelectItemText = SelectItemText;
7954
7608
  exports.SelectLabel = SelectLabel;
7955
7609
  exports.SelectRoot = SelectRoot;
7956
7610
  exports.SelectValueText = SelectValueText;
7957
- exports.Separator = Separator2;
7611
+ exports.Separator = Separator;
7958
7612
  exports.SettingsMenu = SettingsMenu;
7959
7613
  exports.Skeleton = Skeleton;
7960
7614
  exports.SkeletonCircle = SkeletonCircle;