analytica-frontend-lib 1.0.44 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ __export(src_exports, {
39
39
  MenuItem: () => MenuItem,
40
40
  MenuLabel: () => MenuLabel,
41
41
  MenuSeparator: () => MenuSeparator,
42
+ Modal: () => Modal_default,
42
43
  NavButton: () => NavButton_default,
43
44
  ProfileMenuFooter: () => ProfileMenuFooter,
44
45
  ProfileMenuHeader: () => ProfileMenuHeader,
@@ -2159,7 +2160,7 @@ var getDayStyles = (day, variant, showActivities) => {
2159
2160
  dayStyle = "bg-primary-800";
2160
2161
  textStyle = "text-white";
2161
2162
  } else if (day.isToday) {
2162
- textStyle = "text-[#1c61b2]";
2163
+ textStyle = "text-primary-800";
2163
2164
  } else if (variant === "navigation" && showActivities && day.activities?.length) {
2164
2165
  const primaryActivity = day.activities[0];
2165
2166
  if (primaryActivity.status === "near-deadline") {
@@ -2395,7 +2396,7 @@ var Calendar = ({
2395
2396
  );
2396
2397
  let spanClass = "";
2397
2398
  if (day.isSelected && day.isToday) {
2398
- spanClass = "h-6 w-6 rounded-full bg-[#1c61b2] text-text";
2399
+ spanClass = "h-6 w-6 rounded-full bg-primary-800 text-text";
2399
2400
  } else if (day.isSelected) {
2400
2401
  spanClass = "h-6 w-6 rounded-full bg-primary-950 text-text";
2401
2402
  }
@@ -2407,12 +2408,12 @@ var Calendar = ({
2407
2408
  "button",
2408
2409
  {
2409
2410
  className: `
2410
- w-9 h-9
2411
- flex items-center justify-center
2412
- text-md font-normal
2413
- cursor-pointer
2411
+ w-9 h-9
2412
+ flex items-center justify-center
2413
+ text-md font-normal
2414
+ cursor-pointer
2414
2415
  rounded-full
2415
- ${dayStyle}
2416
+ ${dayStyle}
2416
2417
  ${textStyle}
2417
2418
  `,
2418
2419
  onClick: () => handleDateSelect(day),
@@ -2561,13 +2562,13 @@ var Calendar = ({
2561
2562
  "button",
2562
2563
  {
2563
2564
  className: `
2564
- w-10 h-10
2565
- flex items-center justify-center
2566
- text-xl font-normal
2567
- cursor-pointer
2565
+ w-10 h-10
2566
+ flex items-center justify-center
2567
+ text-xl font-normal
2568
+ cursor-pointer
2568
2569
  rounded-full
2569
2570
  focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1
2570
- ${dayStyle}
2571
+ ${dayStyle}
2571
2572
  ${textStyle}
2572
2573
  `,
2573
2574
  onClick: () => handleDateSelect(day),
@@ -2585,11 +2586,107 @@ var Calendar = ({
2585
2586
  };
2586
2587
  var Calendar_default = Calendar;
2587
2588
 
2588
- // src/components/DropdownMenu/DropdownMenu.tsx
2589
- var import_phosphor_react7 = require("phosphor-react");
2589
+ // src/components/Modal/Modal.tsx
2590
2590
  var import_react10 = require("react");
2591
- var import_zustand2 = require("zustand");
2591
+ var import_phosphor_react7 = require("phosphor-react");
2592
2592
  var import_jsx_runtime21 = require("react/jsx-runtime");
2593
+ var SIZE_CLASSES9 = {
2594
+ xs: "max-w-[360px]",
2595
+ sm: "max-w-[420px]",
2596
+ md: "max-w-[510px]",
2597
+ lg: "max-w-[640px]",
2598
+ xl: "max-w-[970px]"
2599
+ };
2600
+ var Modal = ({
2601
+ isOpen,
2602
+ onClose,
2603
+ title,
2604
+ children,
2605
+ size = "md",
2606
+ className = "",
2607
+ closeOnBackdropClick = true,
2608
+ closeOnEscape = true,
2609
+ footer,
2610
+ hideCloseButton = false
2611
+ }) => {
2612
+ (0, import_react10.useEffect)(() => {
2613
+ if (!isOpen || !closeOnEscape) return;
2614
+ const handleEscape = (event) => {
2615
+ if (event.key === "Escape") {
2616
+ onClose();
2617
+ }
2618
+ };
2619
+ document.addEventListener("keydown", handleEscape);
2620
+ return () => document.removeEventListener("keydown", handleEscape);
2621
+ }, [isOpen, closeOnEscape, onClose]);
2622
+ (0, import_react10.useEffect)(() => {
2623
+ const originalOverflow = document.body.style.overflow;
2624
+ if (isOpen) {
2625
+ document.body.style.overflow = "hidden";
2626
+ } else {
2627
+ document.body.style.overflow = originalOverflow;
2628
+ }
2629
+ return () => {
2630
+ document.body.style.overflow = originalOverflow;
2631
+ };
2632
+ }, [isOpen]);
2633
+ const handleBackdropClick = (event) => {
2634
+ if (closeOnBackdropClick && event.target === event.currentTarget) {
2635
+ onClose();
2636
+ }
2637
+ };
2638
+ const handleBackdropKeyDown = (event) => {
2639
+ if (closeOnBackdropClick && (event.key === "Enter" || event.key === " ")) {
2640
+ onClose();
2641
+ }
2642
+ };
2643
+ if (!isOpen) return null;
2644
+ const sizeClasses = SIZE_CLASSES9[size];
2645
+ const baseClasses = "bg-background rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
2646
+ const modalClasses = `${baseClasses} ${sizeClasses} ${className}`;
2647
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2648
+ "div",
2649
+ {
2650
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs",
2651
+ onClick: handleBackdropClick,
2652
+ onKeyDown: handleBackdropKeyDown,
2653
+ role: "none",
2654
+ "aria-hidden": "true",
2655
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2656
+ "div",
2657
+ {
2658
+ className: modalClasses,
2659
+ role: "dialog",
2660
+ "aria-modal": "true",
2661
+ "aria-labelledby": "modal-title",
2662
+ children: [
2663
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
2664
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { id: "modal-title", className: "text-lg font-semibold text-text-950", children: title }),
2665
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2666
+ "button",
2667
+ {
2668
+ onClick: onClose,
2669
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2670
+ "aria-label": "Fechar modal",
2671
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react7.X, { size: 18 })
2672
+ }
2673
+ )
2674
+ ] }),
2675
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "px-6 pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2676
+ footer && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2677
+ ]
2678
+ }
2679
+ )
2680
+ }
2681
+ );
2682
+ };
2683
+ var Modal_default = Modal;
2684
+
2685
+ // src/components/DropdownMenu/DropdownMenu.tsx
2686
+ var import_phosphor_react8 = require("phosphor-react");
2687
+ var import_react11 = require("react");
2688
+ var import_zustand2 = require("zustand");
2689
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2593
2690
  function createDropdownStore() {
2594
2691
  return (0, import_zustand2.create)((set) => ({
2595
2692
  open: false,
@@ -2605,8 +2702,8 @@ var useDropdownStore = (externalStore) => {
2605
2702
  return externalStore;
2606
2703
  };
2607
2704
  var injectStore = (children, store) => {
2608
- return import_react10.Children.map(children, (child) => {
2609
- if ((0, import_react10.isValidElement)(child)) {
2705
+ return import_react11.Children.map(children, (child) => {
2706
+ if ((0, import_react11.isValidElement)(child)) {
2610
2707
  const typedChild = child;
2611
2708
  const newProps = {
2612
2709
  store
@@ -2614,23 +2711,24 @@ var injectStore = (children, store) => {
2614
2711
  if (typedChild.props.children) {
2615
2712
  newProps.children = injectStore(typedChild.props.children, store);
2616
2713
  }
2617
- return (0, import_react10.cloneElement)(typedChild, newProps);
2714
+ return (0, import_react11.cloneElement)(typedChild, newProps);
2618
2715
  }
2619
2716
  return child;
2620
2717
  });
2621
2718
  };
2622
- var DropdownMenu = ({ children, open, onOpenChange }) => {
2623
- const storeRef = (0, import_react10.useRef)(null);
2719
+ var DropdownMenu = ({
2720
+ children,
2721
+ open: propOpen,
2722
+ onOpenChange
2723
+ }) => {
2724
+ const storeRef = (0, import_react11.useRef)(null);
2624
2725
  storeRef.current ??= createDropdownStore();
2625
2726
  const store = storeRef.current;
2626
- const isControlled = open !== void 0;
2627
- const uncontrolledOpen = (0, import_zustand2.useStore)(store, (s) => s.open);
2628
- const currentOpen = isControlled ? open : uncontrolledOpen;
2727
+ const { open, setOpen: storeSetOpen } = (0, import_zustand2.useStore)(store, (s) => s);
2629
2728
  const setOpen = (newOpen) => {
2630
- onOpenChange?.(newOpen);
2631
- if (!isControlled) store.setState({ open: newOpen });
2729
+ storeSetOpen(newOpen);
2632
2730
  };
2633
- const menuRef = (0, import_react10.useRef)(null);
2731
+ const menuRef = (0, import_react11.useRef)(null);
2634
2732
  const handleArrowDownOrArrowUp = (event) => {
2635
2733
  const menuContent = menuRef.current?.querySelector('[role="menu"]');
2636
2734
  if (menuContent) {
@@ -2664,9 +2762,8 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
2664
2762
  setOpen(false);
2665
2763
  }
2666
2764
  };
2667
- (0, import_react10.useEffect)(() => {
2668
- onOpenChange?.(currentOpen);
2669
- if (currentOpen) {
2765
+ (0, import_react11.useEffect)(() => {
2766
+ if (open) {
2670
2767
  document.addEventListener("mousedown", handleClickOutside);
2671
2768
  document.addEventListener("keydown", handleDownkey);
2672
2769
  }
@@ -2674,13 +2771,17 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
2674
2771
  document.removeEventListener("mousedown", handleClickOutside);
2675
2772
  document.removeEventListener("keydown", handleDownkey);
2676
2773
  };
2677
- }, [currentOpen]);
2678
- (0, import_react10.useEffect)(() => {
2679
- if (isControlled) {
2680
- store.setState({ open });
2774
+ }, [open]);
2775
+ (0, import_react11.useEffect)(() => {
2776
+ setOpen(open);
2777
+ onOpenChange?.(open);
2778
+ }, [open, onOpenChange]);
2779
+ (0, import_react11.useEffect)(() => {
2780
+ if (propOpen) {
2781
+ setOpen(propOpen);
2681
2782
  }
2682
- }, []);
2683
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
2783
+ }, [propOpen]);
2784
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
2684
2785
  };
2685
2786
  var DropdownMenuTrigger = ({
2686
2787
  className,
@@ -2692,7 +2793,7 @@ var DropdownMenuTrigger = ({
2692
2793
  const store = useDropdownStore(externalStore);
2693
2794
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
2694
2795
  const toggleOpen = () => store.setState({ open: !open });
2695
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2796
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2696
2797
  Button_default,
2697
2798
  {
2698
2799
  variant: "outline",
@@ -2728,8 +2829,8 @@ var MENUCONTENT_VARIANT_CLASSES = {
2728
2829
  menu: "p-1",
2729
2830
  profile: "p-6"
2730
2831
  };
2731
- var MenuLabel = (0, import_react10.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
2732
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2832
+ var MenuLabel = (0, import_react11.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
2833
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2733
2834
  "div",
2734
2835
  {
2735
2836
  ref,
@@ -2739,7 +2840,7 @@ var MenuLabel = (0, import_react10.forwardRef)(({ className, inset, store: _stor
2739
2840
  );
2740
2841
  });
2741
2842
  MenuLabel.displayName = "MenuLabel";
2742
- var MenuContent = (0, import_react10.forwardRef)(
2843
+ var MenuContent = (0, import_react11.forwardRef)(
2743
2844
  ({
2744
2845
  className,
2745
2846
  align = "start",
@@ -2752,8 +2853,8 @@ var MenuContent = (0, import_react10.forwardRef)(
2752
2853
  }, ref) => {
2753
2854
  const store = useDropdownStore(externalStore);
2754
2855
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
2755
- const [isVisible, setIsVisible] = (0, import_react10.useState)(open);
2756
- (0, import_react10.useEffect)(() => {
2856
+ const [isVisible, setIsVisible] = (0, import_react11.useState)(open);
2857
+ (0, import_react11.useEffect)(() => {
2757
2858
  if (open) {
2758
2859
  setIsVisible(true);
2759
2860
  } else {
@@ -2768,7 +2869,7 @@ var MenuContent = (0, import_react10.forwardRef)(
2768
2869
  return `absolute ${vertical} ${horizontal}`;
2769
2870
  };
2770
2871
  const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
2771
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2872
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2772
2873
  "div",
2773
2874
  {
2774
2875
  ref,
@@ -2793,7 +2894,7 @@ var MenuContent = (0, import_react10.forwardRef)(
2793
2894
  }
2794
2895
  );
2795
2896
  MenuContent.displayName = "MenuContent";
2796
- var DropdownMenuItem = (0, import_react10.forwardRef)(
2897
+ var DropdownMenuItem = (0, import_react11.forwardRef)(
2797
2898
  ({
2798
2899
  className,
2799
2900
  size = "small",
@@ -2827,7 +2928,7 @@ var DropdownMenuItem = (0, import_react10.forwardRef)(
2827
2928
  const getVariantProps = () => {
2828
2929
  return variant === "profile" ? { "data-variant": "profile" } : {};
2829
2930
  };
2830
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2931
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2831
2932
  "div",
2832
2933
  {
2833
2934
  ref,
@@ -2849,7 +2950,7 @@ var DropdownMenuItem = (0, import_react10.forwardRef)(
2849
2950
  ...props,
2850
2951
  children: [
2851
2952
  iconLeft,
2852
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w-full text-md", children }),
2953
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "w-full text-md", children }),
2853
2954
  iconRight
2854
2955
  ]
2855
2956
  }
@@ -2857,7 +2958,7 @@ var DropdownMenuItem = (0, import_react10.forwardRef)(
2857
2958
  }
2858
2959
  );
2859
2960
  DropdownMenuItem.displayName = "DropdownMenuItem";
2860
- var DropdownMenuSeparator = (0, import_react10.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2961
+ var DropdownMenuSeparator = (0, import_react11.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2861
2962
  "div",
2862
2963
  {
2863
2964
  ref,
@@ -2866,11 +2967,11 @@ var DropdownMenuSeparator = (0, import_react10.forwardRef)(({ className, store:
2866
2967
  }
2867
2968
  ));
2868
2969
  DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
2869
- var ProfileMenuTrigger = (0, import_react10.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
2970
+ var ProfileMenuTrigger = (0, import_react11.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
2870
2971
  const store = useDropdownStore(externalStore);
2871
2972
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
2872
2973
  const toggleOpen = () => store.setState({ open: !open });
2873
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2974
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2874
2975
  "button",
2875
2976
  {
2876
2977
  ref,
@@ -2882,13 +2983,13 @@ var ProfileMenuTrigger = (0, import_react10.forwardRef)(({ className, onClick, s
2882
2983
  },
2883
2984
  "aria-expanded": open,
2884
2985
  ...props,
2885
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react7.User, { className: "text-background-950", size: 18 }) })
2986
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react8.User, { className: "text-background-950", size: 18 }) })
2886
2987
  }
2887
2988
  );
2888
2989
  });
2889
2990
  ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
2890
- var ProfileMenuHeader = (0, import_react10.forwardRef)(({ className, name, email, store: _store, ...props }, ref) => {
2891
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2991
+ var ProfileMenuHeader = (0, import_react11.forwardRef)(({ className, name, email, store: _store, ...props }, ref) => {
2992
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2892
2993
  "div",
2893
2994
  {
2894
2995
  ref,
@@ -2899,18 +3000,18 @@ var ProfileMenuHeader = (0, import_react10.forwardRef)(({ className, name, email
2899
3000
  `,
2900
3001
  ...props,
2901
3002
  children: [
2902
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react7.User, { size: 34, className: "text-background-950" }) }),
2903
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col ", children: [
2904
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xl font-bold text-text-950", children: name }),
2905
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-md text-text-600", children: email })
3003
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react8.User, { size: 34, className: "text-background-950" }) }),
3004
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col ", children: [
3005
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xl font-bold text-text-950", children: name }),
3006
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-md text-text-600", children: email })
2906
3007
  ] })
2907
3008
  ]
2908
3009
  }
2909
3010
  );
2910
3011
  });
2911
3012
  ProfileMenuHeader.displayName = "ProfileMenuHeader";
2912
- var ProfileMenuSection = (0, import_react10.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
2913
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3013
+ var ProfileMenuSection = (0, import_react11.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
3014
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2914
3015
  "div",
2915
3016
  {
2916
3017
  ref,
@@ -2933,7 +3034,7 @@ var ProfileMenuFooter = ({
2933
3034
  }) => {
2934
3035
  const store = useDropdownStore(externalStore);
2935
3036
  const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
2936
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3037
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2937
3038
  Button_default,
2938
3039
  {
2939
3040
  variant: "outline",
@@ -2945,8 +3046,8 @@ var ProfileMenuFooter = ({
2945
3046
  },
2946
3047
  ...props,
2947
3048
  children: [
2948
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react7.SignOut, {}) }),
2949
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Sair" })
3049
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react8.SignOut, {}) }),
3050
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Sair" })
2950
3051
  ]
2951
3052
  }
2952
3053
  );
@@ -2956,15 +3057,15 @@ var DropdownMenu_default = DropdownMenu;
2956
3057
 
2957
3058
  // src/components/Select/Select.tsx
2958
3059
  var import_zustand3 = require("zustand");
2959
- var import_react11 = require("react");
2960
- var import_phosphor_react8 = require("phosphor-react");
2961
- var import_jsx_runtime22 = require("react/jsx-runtime");
3060
+ var import_react12 = require("react");
3061
+ var import_phosphor_react9 = require("phosphor-react");
3062
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2962
3063
  var VARIANT_CLASSES4 = {
2963
3064
  outlined: "border-2 rounded-sm focus:border-primary-950",
2964
3065
  underlined: "border-b-2 focus:border-primary-950",
2965
3066
  rounded: "border-2 rounded-4xl focus:border-primary-950"
2966
3067
  };
2967
- var SIZE_CLASSES9 = {
3068
+ var SIZE_CLASSES10 = {
2968
3069
  small: "text-sm",
2969
3070
  medium: "text-md",
2970
3071
  large: "text-lg"
@@ -3002,13 +3103,13 @@ function getLabelAsNode(children) {
3002
3103
  if (typeof children === "string" || typeof children === "number") {
3003
3104
  return children;
3004
3105
  }
3005
- const flattened = import_react11.Children.toArray(children);
3106
+ const flattened = import_react12.Children.toArray(children);
3006
3107
  if (flattened.length === 1) return flattened[0];
3007
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children: flattened });
3108
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: flattened });
3008
3109
  }
3009
3110
  var injectStore2 = (children, store) => {
3010
- return import_react11.Children.map(children, (child) => {
3011
- if ((0, import_react11.isValidElement)(child)) {
3111
+ return import_react12.Children.map(children, (child) => {
3112
+ if ((0, import_react12.isValidElement)(child)) {
3012
3113
  const typedChild = child;
3013
3114
  const newProps = {
3014
3115
  store
@@ -3016,7 +3117,7 @@ var injectStore2 = (children, store) => {
3016
3117
  if (typedChild.props.children) {
3017
3118
  newProps.children = injectStore2(typedChild.props.children, store);
3018
3119
  }
3019
- return (0, import_react11.cloneElement)(typedChild, newProps);
3120
+ return (0, import_react12.cloneElement)(typedChild, newProps);
3020
3121
  }
3021
3122
  return child;
3022
3123
  });
@@ -3028,21 +3129,19 @@ var Select = ({
3028
3129
  onValueChange,
3029
3130
  size = "small"
3030
3131
  }) => {
3031
- const storeRef = (0, import_react11.useRef)(null);
3132
+ const storeRef = (0, import_react12.useRef)(null);
3032
3133
  storeRef.current ??= createSelectStore();
3033
3134
  const store = storeRef.current;
3034
- const selectRef = (0, import_react11.useRef)(null);
3135
+ const selectRef = (0, import_react12.useRef)(null);
3035
3136
  const { open, setOpen, setValue, value, selectedLabel } = (0, import_zustand3.useStore)(
3036
3137
  store,
3037
3138
  (s) => s
3038
3139
  );
3039
- const isControlled = propValue !== void 0;
3040
- const currentValue = isControlled ? propValue : value;
3041
3140
  const findLabelForValue = (children2, targetValue) => {
3042
3141
  let found = null;
3043
3142
  const search = (nodes) => {
3044
- import_react11.Children.forEach(nodes, (child) => {
3045
- if (!(0, import_react11.isValidElement)(child)) return;
3143
+ import_react12.Children.forEach(nodes, (child) => {
3144
+ if (!(0, import_react12.isValidElement)(child)) return;
3046
3145
  const typedChild = child;
3047
3146
  if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
3048
3147
  if (typeof typedChild.props.children === "string")
@@ -3055,14 +3154,13 @@ var Select = ({
3055
3154
  search(children2);
3056
3155
  return found;
3057
3156
  };
3058
- (0, import_react11.useEffect)(() => {
3157
+ (0, import_react12.useEffect)(() => {
3059
3158
  if (!selectedLabel && defaultValue) {
3060
3159
  const label = findLabelForValue(children, defaultValue);
3061
3160
  if (label) store.setState({ selectedLabel: label });
3062
3161
  }
3063
3162
  }, [children, defaultValue, selectedLabel]);
3064
- (0, import_react11.useEffect)(() => {
3065
- setValue(currentValue);
3163
+ (0, import_react12.useEffect)(() => {
3066
3164
  const handleClickOutside = (event) => {
3067
3165
  if (selectRef.current && !selectRef.current.contains(event.target)) {
3068
3166
  setOpen(false);
@@ -3097,13 +3195,19 @@ var Select = ({
3097
3195
  document.removeEventListener("keydown", handleArrowKeys);
3098
3196
  };
3099
3197
  }, [open]);
3100
- (0, import_react11.useEffect)(() => {
3101
- if (onValueChange) {
3102
- onValueChange(value);
3198
+ (0, import_react12.useEffect)(() => {
3199
+ setValue(value);
3200
+ onValueChange?.(value);
3201
+ }, [value, onValueChange]);
3202
+ (0, import_react12.useEffect)(() => {
3203
+ if (propValue) {
3204
+ setValue(propValue);
3205
+ const label = findLabelForValue(children, propValue);
3206
+ if (label) store.setState({ selectedLabel: label });
3103
3207
  }
3104
- }, [value]);
3105
- const sizeClasses = SIZE_CLASSES9[size];
3106
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
3208
+ }, [propValue]);
3209
+ const sizeClasses = SIZE_CLASSES10[size];
3210
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
3107
3211
  };
3108
3212
  var SelectValue = ({
3109
3213
  placeholder,
@@ -3112,9 +3216,9 @@ var SelectValue = ({
3112
3216
  const store = useSelectStore(externalStore);
3113
3217
  const selectedLabel = (0, import_zustand3.useStore)(store, (s) => s.selectedLabel);
3114
3218
  const value = (0, import_zustand3.useStore)(store, (s) => s.value);
3115
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
3219
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
3116
3220
  };
3117
- var SelectTrigger = (0, import_react11.forwardRef)(
3221
+ var SelectTrigger = (0, import_react12.forwardRef)(
3118
3222
  ({
3119
3223
  className,
3120
3224
  invalid = false,
@@ -3127,7 +3231,7 @@ var SelectTrigger = (0, import_react11.forwardRef)(
3127
3231
  const open = (0, import_zustand3.useStore)(store, (s) => s.open);
3128
3232
  const toggleOpen = () => store.setState({ open: !open });
3129
3233
  const variantClasses = VARIANT_CLASSES4[variant];
3130
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3234
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3131
3235
  "button",
3132
3236
  {
3133
3237
  ref,
@@ -3146,8 +3250,8 @@ var SelectTrigger = (0, import_react11.forwardRef)(
3146
3250
  ...props,
3147
3251
  children: [
3148
3252
  props.children,
3149
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3150
- import_phosphor_react8.CaretDown,
3253
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3254
+ import_phosphor_react9.CaretDown,
3151
3255
  {
3152
3256
  className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
3153
3257
  }
@@ -3158,7 +3262,7 @@ var SelectTrigger = (0, import_react11.forwardRef)(
3158
3262
  }
3159
3263
  );
3160
3264
  SelectTrigger.displayName = "SelectTrigger";
3161
- var SelectContent = (0, import_react11.forwardRef)(
3265
+ var SelectContent = (0, import_react12.forwardRef)(
3162
3266
  ({
3163
3267
  children,
3164
3268
  className,
@@ -3171,7 +3275,7 @@ var SelectContent = (0, import_react11.forwardRef)(
3171
3275
  const open = (0, import_zustand3.useStore)(store, (s) => s.open);
3172
3276
  if (!open) return null;
3173
3277
  const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
3174
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3278
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3175
3279
  "div",
3176
3280
  {
3177
3281
  role: "menu",
@@ -3184,7 +3288,7 @@ var SelectContent = (0, import_react11.forwardRef)(
3184
3288
  }
3185
3289
  );
3186
3290
  SelectContent.displayName = "SelectContent";
3187
- var SelectItem = (0, import_react11.forwardRef)(
3291
+ var SelectItem = (0, import_react12.forwardRef)(
3188
3292
  ({
3189
3293
  className,
3190
3294
  children,
@@ -3194,8 +3298,12 @@ var SelectItem = (0, import_react11.forwardRef)(
3194
3298
  ...props
3195
3299
  }, ref) => {
3196
3300
  const store = useSelectStore(externalStore);
3197
- const selectedValue = (0, import_zustand3.useStore)(store, (s) => s.value);
3198
- const { setValue, setSelectedLabel, setOpen } = store.getState();
3301
+ const {
3302
+ value: selectedValue,
3303
+ setValue,
3304
+ setOpen,
3305
+ setSelectedLabel
3306
+ } = (0, import_zustand3.useStore)(store, (s) => s);
3199
3307
  const handleClick = (e) => {
3200
3308
  const labelNode = getLabelAsNode(children);
3201
3309
  if (!disabled) {
@@ -3205,7 +3313,7 @@ var SelectItem = (0, import_react11.forwardRef)(
3205
3313
  }
3206
3314
  props.onClick?.(e);
3207
3315
  };
3208
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3316
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3209
3317
  "div",
3210
3318
  {
3211
3319
  role: "menuitem",
@@ -3225,7 +3333,7 @@ var SelectItem = (0, import_react11.forwardRef)(
3225
3333
  tabIndex: disabled ? -1 : 0,
3226
3334
  ...props,
3227
3335
  children: [
3228
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react8.Check, { className: "" }) }),
3336
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react9.Check, { className: "" }) }),
3229
3337
  children
3230
3338
  ]
3231
3339
  }
@@ -3237,9 +3345,9 @@ var Select_default = Select;
3237
3345
 
3238
3346
  // src/components/Menu/Menu.tsx
3239
3347
  var import_zustand4 = require("zustand");
3240
- var import_react12 = require("react");
3241
- var import_phosphor_react9 = require("phosphor-react");
3242
- var import_jsx_runtime23 = require("react/jsx-runtime");
3348
+ var import_react13 = require("react");
3349
+ var import_phosphor_react10 = require("phosphor-react");
3350
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3243
3351
  var createMenuStore = () => (0, import_zustand4.create)((set) => ({
3244
3352
  value: "",
3245
3353
  setValue: (value) => set({ value })
@@ -3253,7 +3361,7 @@ var VARIANT_CLASSES5 = {
3253
3361
  menu2: "overflow-x-auto scroll-smooth",
3254
3362
  breadcrumb: ""
3255
3363
  };
3256
- var Menu = (0, import_react12.forwardRef)(
3364
+ var Menu = (0, import_react13.forwardRef)(
3257
3365
  ({
3258
3366
  className,
3259
3367
  children,
@@ -3263,19 +3371,19 @@ var Menu = (0, import_react12.forwardRef)(
3263
3371
  onValueChange,
3264
3372
  ...props
3265
3373
  }, ref) => {
3266
- const storeRef = (0, import_react12.useRef)(null);
3374
+ const storeRef = (0, import_react13.useRef)(null);
3267
3375
  storeRef.current ??= createMenuStore();
3268
3376
  const store = storeRef.current;
3269
3377
  const { setValue, value } = (0, import_zustand4.useStore)(store, (s) => s);
3270
- (0, import_react12.useEffect)(() => {
3378
+ (0, import_react13.useEffect)(() => {
3271
3379
  setValue(propValue ?? defaultValue);
3272
3380
  }, [defaultValue, propValue, setValue]);
3273
- (0, import_react12.useEffect)(() => {
3381
+ (0, import_react13.useEffect)(() => {
3274
3382
  onValueChange?.(value);
3275
3383
  }, [value, onValueChange]);
3276
3384
  const baseClasses = "w-full flex flex-row items-center gap-2 py-2 px-6";
3277
3385
  const variantClasses = VARIANT_CLASSES5[variant];
3278
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3386
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3279
3387
  "ul",
3280
3388
  {
3281
3389
  ref,
@@ -3292,7 +3400,7 @@ var Menu = (0, import_react12.forwardRef)(
3292
3400
  }
3293
3401
  );
3294
3402
  Menu.displayName = "Menu";
3295
- var MenuItem = (0, import_react12.forwardRef)(
3403
+ var MenuItem = (0, import_react13.forwardRef)(
3296
3404
  ({
3297
3405
  className,
3298
3406
  children,
@@ -3320,7 +3428,7 @@ var MenuItem = (0, import_react12.forwardRef)(
3320
3428
  ...props
3321
3429
  };
3322
3430
  const variants = {
3323
- menu: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3431
+ menu: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3324
3432
  "li",
3325
3433
  {
3326
3434
  "data-variant": "menu",
@@ -3335,7 +3443,7 @@ var MenuItem = (0, import_react12.forwardRef)(
3335
3443
  children
3336
3444
  }
3337
3445
  ),
3338
- menu2: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3446
+ menu2: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3339
3447
  "li",
3340
3448
  {
3341
3449
  "data-variant": "menu2",
@@ -3347,7 +3455,7 @@ var MenuItem = (0, import_react12.forwardRef)(
3347
3455
  children
3348
3456
  }
3349
3457
  ),
3350
- breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3458
+ breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3351
3459
  "li",
3352
3460
  {
3353
3461
  "data-variant": "breadcrumb",
@@ -3358,7 +3466,7 @@ var MenuItem = (0, import_react12.forwardRef)(
3358
3466
  ${className ?? ""}
3359
3467
  `,
3360
3468
  ...commonProps,
3361
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3469
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3362
3470
  "span",
3363
3471
  {
3364
3472
  className: `
@@ -3375,24 +3483,24 @@ var MenuItem = (0, import_react12.forwardRef)(
3375
3483
  }
3376
3484
  );
3377
3485
  MenuItem.displayName = "MenuItem";
3378
- var MenuSeparator = (0, import_react12.forwardRef)(
3379
- ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3486
+ var MenuSeparator = (0, import_react13.forwardRef)(
3487
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3380
3488
  "li",
3381
3489
  {
3382
3490
  ref,
3383
3491
  "aria-hidden": "true",
3384
3492
  className: `[&>svg]:w-4 [&>svg]:h-4 text-text-600 ${className ?? ""}`,
3385
3493
  ...props,
3386
- children: children ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react9.CaretRight, {})
3494
+ children: children ?? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react10.CaretRight, {})
3387
3495
  }
3388
3496
  )
3389
3497
  );
3390
3498
  MenuSeparator.displayName = "MenuSeparator";
3391
- var injectStore3 = (children, store) => import_react12.Children.map(children, (child) => {
3392
- if (!(0, import_react12.isValidElement)(child)) return child;
3499
+ var injectStore3 = (children, store) => import_react13.Children.map(children, (child) => {
3500
+ if (!(0, import_react13.isValidElement)(child)) return child;
3393
3501
  const typedChild = child;
3394
3502
  const shouldInject = typedChild.type === MenuItem;
3395
- return (0, import_react12.cloneElement)(typedChild, {
3503
+ return (0, import_react13.cloneElement)(typedChild, {
3396
3504
  ...shouldInject ? { store } : {},
3397
3505
  ...typedChild.props.children ? { children: injectStore3(typedChild.props.children, store) } : {}
3398
3506
  });
@@ -3419,6 +3527,7 @@ var Menu_default = Menu;
3419
3527
  MenuItem,
3420
3528
  MenuLabel,
3421
3529
  MenuSeparator,
3530
+ Modal,
3422
3531
  NavButton,
3423
3532
  ProfileMenuFooter,
3424
3533
  ProfileMenuHeader,