analytica-frontend-lib 1.0.24 → 1.0.25

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 (85) hide show
  1. package/dist/{chunk-JNPCNN67.mjs → Alert/Alert.mjs} +1 -2
  2. package/dist/{chunk-GSEO6POW.mjs → Badge/Badge.mjs} +0 -1
  3. package/dist/{chunk-IB4IJ3GF.mjs → Button/Button.mjs} +0 -1
  4. package/dist/{chunk-LYOJCBOM.mjs → CheckBox/CheckBox.mjs} +2 -2
  5. package/dist/{chunk-KT6HNGRV.mjs → DropdownMenu/DropdownMenu.mjs} +3 -2
  6. package/dist/{chunk-RPYPJ5O5.mjs → IconButton/IconButton.mjs} +0 -1
  7. package/dist/{chunk-QOFMTSHE.mjs → IconRoundedButton/IconRoundedButton.mjs} +0 -1
  8. package/dist/{chunk-CETSS3RA.mjs → NavButton/NavButton.mjs} +0 -1
  9. package/dist/{chunk-SESX5OEP.mjs → SelectionButton/SelectionButton.mjs} +0 -1
  10. package/dist/{chunk-NWGRQN6R.mjs → Table/Table.mjs} +4 -5
  11. package/dist/{components/Text → Text}/Text.mjs +1 -1
  12. package/dist/{chunk-QODEDLAX.mjs → TextArea/TextArea.mjs} +2 -2
  13. package/dist/{components/Toast → Toast}/Toast.mjs +1 -1
  14. package/dist/{components/Toast → Toast}/utils/ToastStore.mjs +1 -1
  15. package/dist/{chunk-IH5TEC64.mjs → Toast/utils/Toaster.mjs} +3 -3
  16. package/dist/index.d.mts +154 -26
  17. package/dist/index.d.ts +154 -26
  18. package/dist/index.js +671 -16
  19. package/dist/index.mjs +676 -8
  20. package/package.json +1 -6
  21. package/dist/client-components.d.mts +0 -9
  22. package/dist/client-components.d.ts +0 -9
  23. package/dist/client-components.js +0 -755
  24. package/dist/client-components.mjs +0 -39
  25. package/dist/components/Alert/Alert.mjs +0 -7
  26. package/dist/components/Badge/Badge.mjs +0 -6
  27. package/dist/components/Button/Button.mjs +0 -6
  28. package/dist/components/CheckBox/CheckBox.mjs +0 -8
  29. package/dist/components/DropdownMenu/DropdownMenu.mjs +0 -17
  30. package/dist/components/IconButton/IconButton.mjs +0 -6
  31. package/dist/components/IconRoundedButton/IconRoundedButton.mjs +0 -6
  32. package/dist/components/NavButton/NavButton.mjs +0 -6
  33. package/dist/components/SelectionButton/SelectionButton.mjs +0 -6
  34. package/dist/components/Table/Table.mjs +0 -20
  35. package/dist/components/TextArea/TextArea.mjs +0 -8
  36. package/dist/components/Toast/utils/Toaster.mjs +0 -11
  37. package/dist/server-components.d.mts +0 -11
  38. package/dist/server-components.d.ts +0 -11
  39. package/dist/server-components.js +0 -629
  40. package/dist/server-components.mjs +0 -52
  41. /package/dist/{components/Alert → Alert}/Alert.d.mts +0 -0
  42. /package/dist/{components/Alert → Alert}/Alert.d.ts +0 -0
  43. /package/dist/{components/Alert → Alert}/Alert.js +0 -0
  44. /package/dist/{components/Badge → Badge}/Badge.d.mts +0 -0
  45. /package/dist/{components/Badge → Badge}/Badge.d.ts +0 -0
  46. /package/dist/{components/Badge → Badge}/Badge.js +0 -0
  47. /package/dist/{components/Button → Button}/Button.d.mts +0 -0
  48. /package/dist/{components/Button → Button}/Button.d.ts +0 -0
  49. /package/dist/{components/Button → Button}/Button.js +0 -0
  50. /package/dist/{components/CheckBox → CheckBox}/CheckBox.d.mts +0 -0
  51. /package/dist/{components/CheckBox → CheckBox}/CheckBox.d.ts +0 -0
  52. /package/dist/{components/CheckBox → CheckBox}/CheckBox.js +0 -0
  53. /package/dist/{components/DropdownMenu → DropdownMenu}/DropdownMenu.d.mts +0 -0
  54. /package/dist/{components/DropdownMenu → DropdownMenu}/DropdownMenu.d.ts +0 -0
  55. /package/dist/{components/DropdownMenu → DropdownMenu}/DropdownMenu.js +0 -0
  56. /package/dist/{components/IconButton → IconButton}/IconButton.d.mts +0 -0
  57. /package/dist/{components/IconButton → IconButton}/IconButton.d.ts +0 -0
  58. /package/dist/{components/IconButton → IconButton}/IconButton.js +0 -0
  59. /package/dist/{components/IconRoundedButton → IconRoundedButton}/IconRoundedButton.d.mts +0 -0
  60. /package/dist/{components/IconRoundedButton → IconRoundedButton}/IconRoundedButton.d.ts +0 -0
  61. /package/dist/{components/IconRoundedButton → IconRoundedButton}/IconRoundedButton.js +0 -0
  62. /package/dist/{components/NavButton → NavButton}/NavButton.d.mts +0 -0
  63. /package/dist/{components/NavButton → NavButton}/NavButton.d.ts +0 -0
  64. /package/dist/{components/NavButton → NavButton}/NavButton.js +0 -0
  65. /package/dist/{components/SelectionButton → SelectionButton}/SelectionButton.d.mts +0 -0
  66. /package/dist/{components/SelectionButton → SelectionButton}/SelectionButton.d.ts +0 -0
  67. /package/dist/{components/SelectionButton → SelectionButton}/SelectionButton.js +0 -0
  68. /package/dist/{components/Table → Table}/Table.d.mts +0 -0
  69. /package/dist/{components/Table → Table}/Table.d.ts +0 -0
  70. /package/dist/{components/Table → Table}/Table.js +0 -0
  71. /package/dist/{components/Text → Text}/Text.d.mts +0 -0
  72. /package/dist/{components/Text → Text}/Text.d.ts +0 -0
  73. /package/dist/{components/Text → Text}/Text.js +0 -0
  74. /package/dist/{components/TextArea → TextArea}/TextArea.d.mts +0 -0
  75. /package/dist/{components/TextArea → TextArea}/TextArea.d.ts +0 -0
  76. /package/dist/{components/TextArea → TextArea}/TextArea.js +0 -0
  77. /package/dist/{components/Toast → Toast}/Toast.d.mts +0 -0
  78. /package/dist/{components/Toast → Toast}/Toast.d.ts +0 -0
  79. /package/dist/{components/Toast → Toast}/Toast.js +0 -0
  80. /package/dist/{components/Toast → Toast}/utils/ToastStore.d.mts +0 -0
  81. /package/dist/{components/Toast → Toast}/utils/ToastStore.d.ts +0 -0
  82. /package/dist/{components/Toast → Toast}/utils/ToastStore.js +0 -0
  83. /package/dist/{components/Toast → Toast}/utils/Toaster.d.mts +0 -0
  84. /package/dist/{components/Toast → Toast}/utils/Toaster.d.ts +0 -0
  85. /package/dist/{components/Toast → Toast}/utils/Toaster.js +0 -0
package/dist/index.js CHANGED
@@ -23,19 +23,23 @@ __export(index_exports, {
23
23
  Alert: () => Alert,
24
24
  Badge: () => Badge,
25
25
  Button: () => Button,
26
+ CheckBox: () => CheckBox,
27
+ DropdownMenu: () => DropdownMenu,
28
+ DropdownMenuContent: () => MenuContent,
29
+ DropdownMenuItem: () => MenuItem,
30
+ DropdownMenuLabel: () => MenuLabel,
31
+ DropdownMenuSeparator: () => MenuSeparator,
32
+ DropdownMenuTrigger: () => DropdownMenuTrigger,
26
33
  IconButton: () => IconButton,
27
34
  IconRoundedButton: () => IconRoundedButton,
28
35
  NavButton: () => NavButton,
29
36
  SelectionButton: () => SelectionButton,
30
37
  Table: () => Table,
31
- TableBody: () => TableBody,
32
- TableCaption: () => TableCaption,
33
- TableCell: () => TableCell,
34
- TableFooter: () => TableFooter,
35
- TableHead: () => TableHead,
36
- TableHeader: () => TableHeader,
37
- TableRow: () => TableRow,
38
- Text: () => Text
38
+ Text: () => Text,
39
+ TextArea: () => TextArea,
40
+ Toast: () => Toast,
41
+ Toaster: () => Toaster,
42
+ useToastStore: () => useToastStore
39
43
  });
40
44
  module.exports = __toCommonJS(index_exports);
41
45
 
@@ -608,22 +612,673 @@ var TableCaption = (0, import_react4.forwardRef)(({ className, ...props }, ref)
608
612
  }
609
613
  ));
610
614
  TableCaption.displayName = "TableCaption";
615
+
616
+ // src/components/CheckBox/CheckBox.tsx
617
+ var import_react5 = require("react");
618
+ var import_phosphor_react3 = require("phosphor-react");
619
+ var import_jsx_runtime10 = require("react/jsx-runtime");
620
+ var SIZE_CLASSES3 = {
621
+ small: {
622
+ checkbox: "w-4 h-4",
623
+ // 16px x 16px
624
+ textSize: "sm",
625
+ spacing: "gap-1.5",
626
+ // 6px
627
+ borderWidth: "border-2",
628
+ iconSize: 14,
629
+ // pixels for Phosphor icons
630
+ labelHeight: "h-[21px]"
631
+ },
632
+ medium: {
633
+ checkbox: "w-5 h-5",
634
+ // 20px x 20px
635
+ textSize: "md",
636
+ spacing: "gap-2",
637
+ // 8px
638
+ borderWidth: "border-2",
639
+ iconSize: 16,
640
+ // pixels for Phosphor icons
641
+ labelHeight: "h-6"
642
+ },
643
+ large: {
644
+ checkbox: "w-6 h-6",
645
+ // 24px x 24px
646
+ textSize: "lg",
647
+ spacing: "gap-2",
648
+ // 8px
649
+ borderWidth: "border-[3px]",
650
+ // 3px border
651
+ iconSize: 20,
652
+ // pixels for Phosphor icons
653
+ labelHeight: "h-[27px]"
654
+ }
655
+ };
656
+ var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
657
+ var STATE_CLASSES = {
658
+ default: {
659
+ unchecked: "border-border-400 bg-background hover:border-border-500",
660
+ checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
661
+ },
662
+ hovered: {
663
+ unchecked: "border-border-500 bg-background",
664
+ checked: "border-primary-800 bg-primary-800 text-text"
665
+ },
666
+ focused: {
667
+ unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
668
+ checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
669
+ },
670
+ invalid: {
671
+ unchecked: "border-error-700 bg-background hover:border-error-600",
672
+ checked: "border-error-700 bg-primary-950 text-text"
673
+ },
674
+ disabled: {
675
+ unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
676
+ checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
677
+ }
678
+ };
679
+ var CheckBox = (0, import_react5.forwardRef)(
680
+ ({
681
+ label,
682
+ size = "medium",
683
+ state = "default",
684
+ indeterminate = false,
685
+ errorMessage,
686
+ helperText,
687
+ className = "",
688
+ labelClassName = "",
689
+ checked: checkedProp,
690
+ disabled,
691
+ id,
692
+ onChange,
693
+ ...props
694
+ }, ref) => {
695
+ const generatedId = (0, import_react5.useId)();
696
+ const inputId = id ?? `checkbox-${generatedId}`;
697
+ const [internalChecked, setInternalChecked] = (0, import_react5.useState)(false);
698
+ const isControlled = checkedProp !== void 0;
699
+ const checked = isControlled ? checkedProp : internalChecked;
700
+ const handleChange = (event) => {
701
+ if (!isControlled) {
702
+ setInternalChecked(event.target.checked);
703
+ }
704
+ onChange?.(event);
705
+ };
706
+ const currentState = disabled ? "disabled" : state;
707
+ const sizeClasses = SIZE_CLASSES3[size];
708
+ const checkVariant = checked || indeterminate ? "checked" : "unchecked";
709
+ const stylingClasses = STATE_CLASSES[currentState][checkVariant];
710
+ const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
711
+ const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
712
+ const renderIcon = () => {
713
+ if (indeterminate) {
714
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
715
+ import_phosphor_react3.Minus,
716
+ {
717
+ size: sizeClasses.iconSize,
718
+ weight: "bold",
719
+ color: "currentColor"
720
+ }
721
+ );
722
+ }
723
+ if (checked) {
724
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
725
+ import_phosphor_react3.Check,
726
+ {
727
+ size: sizeClasses.iconSize,
728
+ weight: "bold",
729
+ color: "currentColor"
730
+ }
731
+ );
732
+ }
733
+ return null;
734
+ };
735
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
736
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
737
+ "div",
738
+ {
739
+ className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
740
+ children: [
741
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
742
+ "input",
743
+ {
744
+ ref,
745
+ type: "checkbox",
746
+ id: inputId,
747
+ checked,
748
+ disabled,
749
+ onChange: handleChange,
750
+ className: "sr-only",
751
+ ...props
752
+ }
753
+ ),
754
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
755
+ label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
756
+ "div",
757
+ {
758
+ className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
759
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
760
+ Text,
761
+ {
762
+ as: "label",
763
+ htmlFor: inputId,
764
+ size: sizeClasses.textSize,
765
+ weight: "normal",
766
+ className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
767
+ children: label
768
+ }
769
+ )
770
+ }
771
+ )
772
+ ]
773
+ }
774
+ ),
775
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
776
+ Text,
777
+ {
778
+ size: "sm",
779
+ weight: "normal",
780
+ className: "mt-1.5",
781
+ color: "text-error-600",
782
+ children: errorMessage
783
+ }
784
+ ),
785
+ helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
786
+ Text,
787
+ {
788
+ size: "sm",
789
+ weight: "normal",
790
+ className: "mt-1.5",
791
+ color: "text-text-500",
792
+ children: helperText
793
+ }
794
+ )
795
+ ] });
796
+ }
797
+ );
798
+ CheckBox.displayName = "CheckBox";
799
+
800
+ // src/components/TextArea/TextArea.tsx
801
+ var import_react6 = require("react");
802
+ var import_jsx_runtime11 = require("react/jsx-runtime");
803
+ var SIZE_CLASSES4 = {
804
+ small: {
805
+ container: "w-72",
806
+ // 288px width
807
+ textarea: "h-24 text-sm",
808
+ // 96px height, 14px font
809
+ textSize: "sm"
810
+ },
811
+ medium: {
812
+ container: "w-72",
813
+ // 288px width
814
+ textarea: "h-24 text-base",
815
+ // 96px height, 16px font
816
+ textSize: "md"
817
+ },
818
+ large: {
819
+ container: "w-72",
820
+ // 288px width
821
+ textarea: "h-24 text-lg",
822
+ // 96px height, 18px font
823
+ textSize: "lg"
824
+ },
825
+ extraLarge: {
826
+ container: "w-72",
827
+ // 288px width
828
+ textarea: "h-24 text-xl",
829
+ // 96px height, 20px font
830
+ textSize: "xl"
831
+ }
832
+ };
833
+ var BASE_TEXTAREA_CLASSES = "w-full box-border p-3 bg-background border border-solid rounded-[4px] resize-none focus:outline-none font-roboto font-normal leading-[150%] placeholder:text-text-600 transition-all duration-200";
834
+ var STATE_CLASSES2 = {
835
+ default: {
836
+ base: "border-border-300 bg-background text-text-600",
837
+ hover: "hover:border-border-400",
838
+ focus: "focus:border-border-500"
839
+ },
840
+ hovered: {
841
+ base: "border-border-400 bg-background text-text-600",
842
+ hover: "",
843
+ focus: "focus:border-border-500"
844
+ },
845
+ focused: {
846
+ base: "border-2 border-primary-950 bg-background text-text-900",
847
+ hover: "",
848
+ focus: ""
849
+ },
850
+ invalid: {
851
+ base: "border-2 border-red-700 bg-white text-gray-800",
852
+ hover: "hover:border-red-700",
853
+ focus: "focus:border-red-700"
854
+ },
855
+ disabled: {
856
+ base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
857
+ hover: "",
858
+ focus: ""
859
+ }
860
+ };
861
+ var TextArea = (0, import_react6.forwardRef)(
862
+ ({
863
+ label,
864
+ size = "medium",
865
+ state = "default",
866
+ errorMessage,
867
+ helperMessage,
868
+ className = "",
869
+ labelClassName = "",
870
+ disabled,
871
+ id,
872
+ onChange,
873
+ placeholder,
874
+ ...props
875
+ }, ref) => {
876
+ const generatedId = (0, import_react6.useId)();
877
+ const inputId = id ?? `textarea-${generatedId}`;
878
+ const [isFocused, setIsFocused] = (0, import_react6.useState)(false);
879
+ const handleChange = (event) => {
880
+ onChange?.(event);
881
+ };
882
+ const handleFocus = (event) => {
883
+ setIsFocused(true);
884
+ props.onFocus?.(event);
885
+ };
886
+ const handleBlur = (event) => {
887
+ setIsFocused(false);
888
+ props.onBlur?.(event);
889
+ };
890
+ let currentState = disabled ? "disabled" : state;
891
+ if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
892
+ currentState = "focused";
893
+ }
894
+ const sizeClasses = SIZE_CLASSES4[size];
895
+ const stateClasses = STATE_CLASSES2[currentState];
896
+ const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
897
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
898
+ label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
899
+ Text,
900
+ {
901
+ as: "label",
902
+ htmlFor: inputId,
903
+ size: sizeClasses.textSize,
904
+ weight: "medium",
905
+ color: "text-text-950",
906
+ className: `mb-1.5 ${labelClassName}`,
907
+ children: label
908
+ }
909
+ ),
910
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
911
+ "textarea",
912
+ {
913
+ ref,
914
+ id: inputId,
915
+ disabled,
916
+ onChange: handleChange,
917
+ onFocus: handleFocus,
918
+ onBlur: handleBlur,
919
+ className: textareaClasses,
920
+ placeholder,
921
+ ...props
922
+ }
923
+ ),
924
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
925
+ helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
926
+ ] });
927
+ }
928
+ );
929
+ TextArea.displayName = "TextArea";
930
+
931
+ // src/components/DropdownMenu/DropdownMenu.tsx
932
+ var import_react7 = require("react");
933
+ var import_jsx_runtime12 = require("react/jsx-runtime");
934
+ var DropdownMenuContext = (0, import_react7.createContext)(
935
+ void 0
936
+ );
937
+ var DropdownMenu = ({ children, open, onOpenChange }) => {
938
+ const [internalOpen, setInternalOpen] = (0, import_react7.useState)(false);
939
+ const isControlled = open !== void 0;
940
+ const currentOpen = isControlled ? open : internalOpen;
941
+ const setOpen = (0, import_react7.useCallback)(
942
+ (newOpen) => {
943
+ if (onOpenChange) onOpenChange(newOpen);
944
+ if (!isControlled) setInternalOpen(newOpen);
945
+ },
946
+ [isControlled, onOpenChange]
947
+ );
948
+ const menuRef = (0, import_react7.useRef)(null);
949
+ const handleArrowDownOrArrowUp = (event) => {
950
+ const menuContent = menuRef.current?.querySelector('[role="menu"]');
951
+ if (menuContent) {
952
+ event.preventDefault();
953
+ const items = Array.from(
954
+ menuContent.querySelectorAll(
955
+ '[role="menuitem"]:not([aria-disabled="true"])'
956
+ )
957
+ ).filter((el) => el instanceof HTMLElement);
958
+ if (items.length === 0) return;
959
+ const focusedItem = document.activeElement;
960
+ const currentIndex = items.findIndex((item) => item === focusedItem);
961
+ let nextIndex;
962
+ if (event.key === "ArrowDown") {
963
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
964
+ } else {
965
+ nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
966
+ }
967
+ items[nextIndex]?.focus();
968
+ }
969
+ };
970
+ const handleDownkey = (event) => {
971
+ if (event.key === "Escape") {
972
+ setOpen(false);
973
+ } else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
974
+ handleArrowDownOrArrowUp(event);
975
+ }
976
+ };
977
+ const handleClickOutside = (event) => {
978
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
979
+ setOpen(false);
980
+ }
981
+ };
982
+ (0, import_react7.useEffect)(() => {
983
+ if (currentOpen) {
984
+ document.addEventListener("mousedown", handleClickOutside);
985
+ document.addEventListener("keydown", handleDownkey);
986
+ }
987
+ return () => {
988
+ document.removeEventListener("mousedown", handleClickOutside);
989
+ document.removeEventListener("keydown", handleDownkey);
990
+ };
991
+ }, [currentOpen]);
992
+ const value = (0, import_react7.useMemo)(
993
+ () => ({ open: currentOpen, setOpen }),
994
+ [currentOpen, setOpen]
995
+ );
996
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "relative", ref: menuRef, children }) });
997
+ };
998
+ var DropdownMenuTrigger = (0, import_react7.forwardRef)(({ className, children, onClick, ...props }, ref) => {
999
+ const context = (0, import_react7.useContext)(DropdownMenuContext);
1000
+ if (!context)
1001
+ throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
1002
+ const { open, setOpen } = context;
1003
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1004
+ "button",
1005
+ {
1006
+ ref,
1007
+ className: `border border-border-200 cursor-pointer bg-background-muted hover:bg-background-200 transition-colors px-4 py-2 rounded-sm ${className}`,
1008
+ onClick: (e) => {
1009
+ e.stopPropagation();
1010
+ setOpen(!open);
1011
+ if (onClick) onClick(e);
1012
+ },
1013
+ "aria-expanded": open,
1014
+ ...props,
1015
+ children
1016
+ }
1017
+ );
1018
+ });
1019
+ DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
1020
+ var ITEM_SIZE_CLASSES = {
1021
+ small: "text-sm",
1022
+ medium: "text-md"
1023
+ };
1024
+ var SIDE_CLASSES = {
1025
+ top: "bottom-full",
1026
+ right: "top-full",
1027
+ bottom: "top-full",
1028
+ left: "top-full"
1029
+ };
1030
+ var ALIGN_CLASSES = {
1031
+ start: "left-0",
1032
+ center: "left-1/2 -translate-x-1/2",
1033
+ end: "right-0"
1034
+ };
1035
+ var MenuLabel = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1036
+ "fieldset",
1037
+ {
1038
+ ref,
1039
+ role: "group",
1040
+ className: `text-sm w-full ${inset ? "pl-8" : ""} ${className ?? ""}`,
1041
+ ...props
1042
+ }
1043
+ ));
1044
+ MenuLabel.displayName = "MenuLabel";
1045
+ var MenuContent = (0, import_react7.forwardRef)(
1046
+ ({
1047
+ className,
1048
+ align = "start",
1049
+ side = "bottom",
1050
+ sideOffset = 4,
1051
+ children,
1052
+ ...props
1053
+ }, ref) => {
1054
+ const { open } = (0, import_react7.useContext)(DropdownMenuContext);
1055
+ const [isVisible, setIsVisible] = (0, import_react7.useState)(open);
1056
+ (0, import_react7.useEffect)(() => {
1057
+ if (open) {
1058
+ setIsVisible(true);
1059
+ } else {
1060
+ const timer = setTimeout(() => setIsVisible(false), 200);
1061
+ return () => clearTimeout(timer);
1062
+ }
1063
+ }, [open]);
1064
+ if (!isVisible) return null;
1065
+ const getPositionClasses = () => {
1066
+ const vertical = SIDE_CLASSES[side];
1067
+ const horizontal = ALIGN_CLASSES[align];
1068
+ return `absolute ${vertical} ${horizontal}`;
1069
+ };
1070
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1071
+ "div",
1072
+ {
1073
+ ref,
1074
+ role: "menu",
1075
+ className: `
1076
+ bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100
1077
+ ${open ? "animate-in fade-in-0 zoom-in-95" : "animate-out fade-out-0 zoom-out-95"}
1078
+ ${getPositionClasses()}
1079
+ ${className}
1080
+ `,
1081
+ style: {
1082
+ marginTop: side === "bottom" ? sideOffset : void 0,
1083
+ marginBottom: side === "top" ? sideOffset : void 0,
1084
+ marginLeft: side === "right" ? sideOffset : void 0,
1085
+ marginRight: side === "left" ? sideOffset : void 0
1086
+ },
1087
+ ...props,
1088
+ children
1089
+ }
1090
+ );
1091
+ }
1092
+ );
1093
+ MenuContent.displayName = "MenuContent";
1094
+ var MenuItem = (0, import_react7.forwardRef)(
1095
+ ({
1096
+ className,
1097
+ inset,
1098
+ size = "small",
1099
+ children,
1100
+ iconRight,
1101
+ iconLeft,
1102
+ disabled = false,
1103
+ onClick,
1104
+ ...props
1105
+ }, ref) => {
1106
+ const sizeClasses = ITEM_SIZE_CLASSES[size];
1107
+ const handleClick = (e) => {
1108
+ if (disabled) {
1109
+ e.preventDefault();
1110
+ e.stopPropagation();
1111
+ return;
1112
+ }
1113
+ onClick?.(e);
1114
+ };
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1116
+ "div",
1117
+ {
1118
+ ref,
1119
+ role: "menuitem",
1120
+ "aria-disabled": disabled,
1121
+ className: `
1122
+ focus-visible:bg-background-50
1123
+ relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
1124
+ ${inset && "pl-8"}
1125
+ ${sizeClasses}
1126
+ ${className}
1127
+ ${disabled ? "cursor-not-allowed text-text-400" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
1128
+ `,
1129
+ onClick: handleClick,
1130
+ onKeyDown: (e) => {
1131
+ if (e.key === "Enter" || e.key === " ") handleClick(e);
1132
+ },
1133
+ tabIndex: disabled ? -1 : 0,
1134
+ ...props,
1135
+ children: [
1136
+ iconLeft,
1137
+ children,
1138
+ iconRight
1139
+ ]
1140
+ }
1141
+ );
1142
+ }
1143
+ );
1144
+ MenuItem.displayName = "MenuItem";
1145
+ var MenuSeparator = (0, import_react7.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1146
+ "div",
1147
+ {
1148
+ ref,
1149
+ className: `my-1 h-px bg-border-200 ${className}`,
1150
+ ...props
1151
+ }
1152
+ ));
1153
+ MenuSeparator.displayName = "MenuSeparator";
1154
+
1155
+ // src/components/Toast/Toast.tsx
1156
+ var import_phosphor_react4 = require("phosphor-react");
1157
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1158
+ var VARIANT_ACTION_CLASSES4 = {
1159
+ solid: {
1160
+ warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
1161
+ success: "bg-success text-success-800 border-none focus-visible:outline-none",
1162
+ info: "bg-info text-info-800 border-none focus-visible:outline-none"
1163
+ },
1164
+ outlined: {
1165
+ warning: "bg-warning text-warning-800 border border-warning-200 focus-visible:outline-none",
1166
+ success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
1167
+ info: "bg-info text-info-800 border border-info-200 focus-visible:outline-none"
1168
+ }
1169
+ };
1170
+ var iconMap = {
1171
+ success: import_phosphor_react4.CheckCircle,
1172
+ info: import_phosphor_react4.Info,
1173
+ warning: import_phosphor_react4.WarningCircle
1174
+ };
1175
+ var Toast = ({
1176
+ variant = "outlined",
1177
+ action = "success",
1178
+ className = "",
1179
+ onClose,
1180
+ title,
1181
+ description,
1182
+ position = "default",
1183
+ ...props
1184
+ }) => {
1185
+ const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
1186
+ const positionClasses = {
1187
+ "top-left": "fixed top-4 left-4",
1188
+ "top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
1189
+ "top-right": "fixed top-4 right-4",
1190
+ "bottom-left": "fixed bottom-4 left-4",
1191
+ "bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
1192
+ "bottom-right": "fixed bottom-4 right-4",
1193
+ default: ""
1194
+ };
1195
+ const IconAction = iconMap[action] || iconMap["success"];
1196
+ const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
1197
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1198
+ "div",
1199
+ {
1200
+ role: "alert",
1201
+ "aria-live": "assertive",
1202
+ "aria-atomic": "true",
1203
+ className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
1204
+ ...props,
1205
+ children: [
1206
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-row items-start gap-3", children: [
1207
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconAction, {}) }),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
1209
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "font-semibold text-md", children: title }),
1210
+ description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-md text-text-900", children: description })
1211
+ ] })
1212
+ ] }),
1213
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1214
+ "button",
1215
+ {
1216
+ onClick: onClose,
1217
+ "aria-label": "Dismiss notification",
1218
+ className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
1219
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react4.X, {})
1220
+ }
1221
+ )
1222
+ ]
1223
+ }
1224
+ );
1225
+ };
1226
+
1227
+ // src/components/Toast/utils/ToastStore.ts
1228
+ var import_zustand = require("zustand");
1229
+ var useToastStore = (0, import_zustand.create)((set) => ({
1230
+ toasts: [],
1231
+ addToast: (toast) => {
1232
+ const id = crypto.randomUUID();
1233
+ set((state) => ({
1234
+ toasts: [...state.toasts, { id, ...toast }]
1235
+ }));
1236
+ },
1237
+ removeToast: (id) => {
1238
+ set((state) => ({
1239
+ toasts: state.toasts.filter((t) => t.id !== id)
1240
+ }));
1241
+ }
1242
+ }));
1243
+
1244
+ // src/components/Toast/utils/Toaster.tsx
1245
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1246
+ var Toaster = () => {
1247
+ const toasts = useToastStore((state) => state.toasts);
1248
+ const removeToast = useToastStore((state) => state.removeToast);
1249
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1250
+ Toast,
1251
+ {
1252
+ title: toast.title,
1253
+ description: toast.description,
1254
+ variant: toast.variant,
1255
+ action: toast.action,
1256
+ position: toast.position,
1257
+ onClose: () => removeToast(toast.id)
1258
+ },
1259
+ toast.id
1260
+ )) });
1261
+ };
611
1262
  // Annotate the CommonJS export names for ESM import in node:
612
1263
  0 && (module.exports = {
613
1264
  Alert,
614
1265
  Badge,
615
1266
  Button,
1267
+ CheckBox,
1268
+ DropdownMenu,
1269
+ DropdownMenuContent,
1270
+ DropdownMenuItem,
1271
+ DropdownMenuLabel,
1272
+ DropdownMenuSeparator,
1273
+ DropdownMenuTrigger,
616
1274
  IconButton,
617
1275
  IconRoundedButton,
618
1276
  NavButton,
619
1277
  SelectionButton,
620
1278
  Table,
621
- TableBody,
622
- TableCaption,
623
- TableCell,
624
- TableFooter,
625
- TableHead,
626
- TableHeader,
627
- TableRow,
628
- Text
1279
+ Text,
1280
+ TextArea,
1281
+ Toast,
1282
+ Toaster,
1283
+ useToastStore
629
1284
  });