@refinn/core-ui 0.1.9 → 0.1.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.
package/dist/index.js CHANGED
@@ -715,163 +715,22 @@ var Button = forwardRef7(
715
715
  );
716
716
  Button.displayName = "Button";
717
717
 
718
- // src/components/BottomSheet/BottomSheet.tsx
719
- import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef8 } from "react";
720
- import { createPortal } from "react-dom";
721
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
722
- var BottomSheet = forwardRef8(
723
- (_a, ref) => {
724
- var _b = _a, {
725
- isForceOpen = false,
726
- setIsForceOpen,
727
- isClosedAble = true,
728
- children,
729
- startModalBtn,
730
- stopModalBtn,
731
- afterStopBtn,
732
- size = "md",
733
- modalTitle = "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D",
734
- modalDesc = "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
735
- className = ""
736
- } = _b, rest = __objRest(_b, [
737
- "isForceOpen",
738
- "setIsForceOpen",
739
- "isClosedAble",
740
- "children",
741
- "startModalBtn",
742
- "stopModalBtn",
743
- "afterStopBtn",
744
- "size",
745
- "modalTitle",
746
- "modalDesc",
747
- "className"
748
- ]);
749
- const [isOpen, setIsOpen] = useState2(false);
750
- const [shouldRender, setShouldRender] = useState2(false);
751
- const [animate, setAnimate] = useState2(false);
752
- useEffect(() => {
753
- if (isOpen) {
754
- setShouldRender(true);
755
- setTimeout(() => setAnimate(true), 10);
756
- } else {
757
- setAnimate(false);
758
- const timer = setTimeout(() => setShouldRender(false), 300);
759
- return () => clearTimeout(timer);
760
- }
761
- }, [isOpen]);
762
- useEffect(() => {
763
- if (isForceOpen) {
764
- setIsOpen(true);
765
- } else {
766
- setIsOpen(false);
767
- }
768
- }, [isForceOpen]);
769
- const handleStartClick = useCallback2(
770
- (e) => {
771
- var _a2, _b2;
772
- (_b2 = startModalBtn == null ? void 0 : (_a2 = startModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
773
- setIsForceOpen == null ? void 0 : setIsForceOpen(true);
774
- setIsOpen(true);
775
- },
776
- [startModalBtn]
777
- );
778
- const handleStopClick = useCallback2(
779
- (e) => {
780
- var _a2, _b2;
781
- (_b2 = stopModalBtn == null ? void 0 : (_a2 = stopModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
782
- setIsForceOpen == null ? void 0 : setIsForceOpen(false);
783
- setIsOpen(false);
784
- },
785
- [stopModalBtn]
786
- );
787
- const handleCloseClick = () => {
788
- setIsForceOpen == null ? void 0 : setIsForceOpen(false);
789
- setIsOpen(false);
790
- };
791
- return /* @__PURE__ */ jsxs8("span", { ref, style: { display: "contents" }, children: [
792
- startModalBtn && React.cloneElement(startModalBtn, {
793
- onClick: handleStartClick
794
- }),
795
- shouldRender && createPortal(
796
- /* @__PURE__ */ jsxs8(
797
- "div",
798
- {
799
- className: `fixed inset-0 z-15000 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
800
- "aria-modal": "true",
801
- role: "dialog",
802
- children: [
803
- /* @__PURE__ */ jsx8(
804
- "div",
805
- {
806
- className: "absolute inset-0 bg-black/40",
807
- onClick: () => isClosedAble ? handleCloseClick() : null,
808
- "aria-label": "Close modal"
809
- }
810
- ),
811
- /* @__PURE__ */ jsxs8(
812
- "div",
813
- {
814
- className: `flex flex-col z-10 w-full rounded-t-xl bg-white pt-8 pb-16 px-16 shadow-lg transform transition-all duration-300
815
- ${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
816
- ${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
817
- children: [
818
- /* @__PURE__ */ jsxs8("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
819
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-col px-8 max-w-225", children: [
820
- /* @__PURE__ */ jsx8("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
821
- /* @__PURE__ */ jsx8("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
822
- ] }),
823
- /* @__PURE__ */ jsx8(
824
- "i",
825
- {
826
- className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
827
- onClick: () => handleCloseClick()
828
- }
829
- ),
830
- /* @__PURE__ */ jsx8(
831
- "div",
832
- {
833
- className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
834
- onClick: () => handleCloseClick(),
835
- children: "x"
836
- }
837
- )
838
- ] }),
839
- /* @__PURE__ */ jsxs8("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
840
- children,
841
- stopModalBtn && React.cloneElement(stopModalBtn, {
842
- onClick: handleStopClick
843
- }),
844
- afterStopBtn && afterStopBtn
845
- ] })
846
- ]
847
- }
848
- )
849
- ]
850
- }
851
- ),
852
- document.body
853
- )
854
- ] });
855
- }
856
- );
857
- BottomSheet.displayName = "BottomSheet";
858
-
859
718
  // src/components/Checkbox/Checkbox.tsx
860
719
  import {
861
- forwardRef as forwardRef9,
720
+ forwardRef as forwardRef8,
862
721
  useId as useId2,
863
- useState as useState3
722
+ useState as useState2
864
723
  } from "react";
865
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
724
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
866
725
  function CheckIcon({ className }) {
867
- return /* @__PURE__ */ jsx9(
726
+ return /* @__PURE__ */ jsx8(
868
727
  "svg",
869
728
  {
870
729
  className,
871
730
  viewBox: "0 0 16 16",
872
731
  fill: "none",
873
732
  "aria-hidden": "true",
874
- children: /* @__PURE__ */ jsx9(
733
+ children: /* @__PURE__ */ jsx8(
875
734
  "path",
876
735
  {
877
736
  d: "M13.333 4.667 6 12l-3.333-3.333",
@@ -885,14 +744,14 @@ function CheckIcon({ className }) {
885
744
  );
886
745
  }
887
746
  function IndeterminateIcon({ className }) {
888
- return /* @__PURE__ */ jsx9(
747
+ return /* @__PURE__ */ jsx8(
889
748
  "svg",
890
749
  {
891
750
  className,
892
751
  viewBox: "0 0 16 16",
893
752
  fill: "none",
894
753
  "aria-hidden": "true",
895
- children: /* @__PURE__ */ jsx9(
754
+ children: /* @__PURE__ */ jsx8(
896
755
  "path",
897
756
  {
898
757
  d: "M3.333 8h9.334",
@@ -904,7 +763,7 @@ function IndeterminateIcon({ className }) {
904
763
  }
905
764
  );
906
765
  }
907
- var Checkbox = forwardRef9(
766
+ var Checkbox = forwardRef8(
908
767
  (_a, ref) => {
909
768
  var _b = _a, {
910
769
  label,
@@ -929,15 +788,15 @@ var Checkbox = forwardRef9(
929
788
  ]);
930
789
  const reactId = useId2();
931
790
  const inputId = id != null ? id : reactId;
932
- const [isChecked, setIsChecked] = useState3(defaultChecked != null ? defaultChecked : false);
933
- return /* @__PURE__ */ jsxs9(
791
+ const [isChecked, setIsChecked] = useState2(defaultChecked != null ? defaultChecked : false);
792
+ return /* @__PURE__ */ jsxs8(
934
793
  "label",
935
794
  {
936
795
  htmlFor: inputId,
937
796
  className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
938
797
  children: [
939
- /* @__PURE__ */ jsxs9("div", { className: "relative mr-16", children: [
940
- /* @__PURE__ */ jsx9(
798
+ /* @__PURE__ */ jsxs8("div", { className: "relative mr-16", children: [
799
+ /* @__PURE__ */ jsx8(
941
800
  "input",
942
801
  __spreadValues({
943
802
  ref,
@@ -954,16 +813,16 @@ var Checkbox = forwardRef9(
954
813
  className: "sr-only"
955
814
  }, rest)
956
815
  ),
957
- /* @__PURE__ */ jsx9(
816
+ /* @__PURE__ */ jsx8(
958
817
  "div",
959
818
  {
960
819
  className: `box m-6 flex h-20 w-20 rounded-md items-center justify-center border ${contrast ? isChecked || indeterminate ? "border-white bg-white" : "border-white" : isChecked || indeterminate ? "bg-static-icon-brand border-static-icon-brand" : "border-static-icon-primary"}`,
961
- children: isChecked ? /* @__PURE__ */ jsx9(
820
+ children: isChecked ? /* @__PURE__ */ jsx8(
962
821
  CheckIcon,
963
822
  {
964
823
  className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
965
824
  }
966
- ) : indeterminate ? /* @__PURE__ */ jsx9(
825
+ ) : indeterminate ? /* @__PURE__ */ jsx8(
967
826
  IndeterminateIcon,
968
827
  {
969
828
  className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
@@ -972,15 +831,15 @@ var Checkbox = forwardRef9(
972
831
  }
973
832
  )
974
833
  ] }),
975
- (label || description) && /* @__PURE__ */ jsxs9("span", { className: "flex flex-col", children: [
976
- label && /* @__PURE__ */ jsx9(
834
+ (label || description) && /* @__PURE__ */ jsxs8("span", { className: "flex flex-col", children: [
835
+ label && /* @__PURE__ */ jsx8(
977
836
  "span",
978
837
  {
979
838
  className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
980
839
  children: label
981
840
  }
982
841
  ),
983
- description && /* @__PURE__ */ jsx9(
842
+ description && /* @__PURE__ */ jsx8(
984
843
  "span",
985
844
  {
986
845
  className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
@@ -997,9 +856,9 @@ Checkbox.displayName = "Checkbox";
997
856
 
998
857
  // src/components/Chip/Chip.tsx
999
858
  import {
1000
- forwardRef as forwardRef10
859
+ forwardRef as forwardRef9
1001
860
  } from "react";
1002
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
861
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1003
862
  var sizeClasses4 = {
1004
863
  sm: "h-32 text-label-medium px-12 py-6",
1005
864
  md: "h-40 text-label-large px-16 py-10",
@@ -1018,7 +877,7 @@ var isDarkClasses = {
1018
877
  true: "!bg-chip-background-black-active !text-chip-text-inverse",
1019
878
  false: "!bg-chip-background-active !text-chip-text-inverse"
1020
879
  };
1021
- var Chip = forwardRef10(
880
+ var Chip = forwardRef9(
1022
881
  (_a, ref) => {
1023
882
  var _b = _a, {
1024
883
  size = "md",
@@ -1054,14 +913,14 @@ var Chip = forwardRef10(
1054
913
  className,
1055
914
  isSelected ? darkClass : ""
1056
915
  ].filter(Boolean).join(" ");
1057
- return /* @__PURE__ */ jsxs10(
916
+ return /* @__PURE__ */ jsxs9(
1058
917
  "div",
1059
918
  __spreadProps(__spreadValues({
1060
919
  ref,
1061
920
  className: containerClasses
1062
921
  }, rest), {
1063
922
  children: [
1064
- icon ? icon : src && /* @__PURE__ */ jsx10("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
923
+ icon ? icon : src && /* @__PURE__ */ jsx9("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
1065
924
  label
1066
925
  ]
1067
926
  })
@@ -1071,143 +930,459 @@ var Chip = forwardRef10(
1071
930
  Chip.displayName = "Chip";
1072
931
 
1073
932
  // src/components/Dialog/Dialog.tsx
1074
- import React2, {
933
+ import {
934
+ forwardRef as forwardRef11,
935
+ useEffect,
936
+ useState as useState4
937
+ } from "react";
938
+ import { createPortal } from "react-dom";
939
+
940
+ // src/components/IconButton/IconButton.tsx
941
+ import { forwardRef as forwardRef10 } from "react";
942
+ import { jsx as jsx10 } from "react/jsx-runtime";
943
+ var sizeClasses5 = {
944
+ xs: "h-24 w-24",
945
+ s: "h-32 w-32",
946
+ m: "h-40 w-40",
947
+ l: "h-48 w-48"
948
+ };
949
+ var iconSizeClasses2 = {
950
+ xs: "h-16 w-16",
951
+ s: "h-20 w-20",
952
+ m: "h-20 w-20",
953
+ l: "h-24 w-24"
954
+ };
955
+ var IconButton = forwardRef10(
956
+ (_a, ref) => {
957
+ var _b = _a, { icon, size = "s", danger = false, disabled = false, className = "" } = _b, rest = __objRest(_b, ["icon", "size", "danger", "disabled", "className"]);
958
+ const classes = [
959
+ "inline-flex shrink-0 items-center justify-center rounded-full transition-colors",
960
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-icon-button-border-focus",
961
+ sizeClasses5[size],
962
+ disabled ? "cursor-not-allowed text-icon-button-icon-disabled" : danger ? "cursor-pointer text-icon-button-icon-danger hover:bg-icon-button-background-hover active:bg-icon-button-background-active" : "cursor-pointer text-icon-button-icon-primary hover:bg-icon-button-background-hover active:bg-icon-button-background-active",
963
+ className
964
+ ].filter(Boolean).join(" ");
965
+ return /* @__PURE__ */ jsx10("button", __spreadProps(__spreadValues({ ref, type: "button", disabled, className: classes }, rest), { children: /* @__PURE__ */ jsx10("span", { className: `shrink-0 flex items-center justify-center ${iconSizeClasses2[size]}`, children: icon }) }));
966
+ }
967
+ );
968
+ IconButton.displayName = "IconButton";
969
+
970
+ // src/components/Dialog/Dialog.tsx
971
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
972
+ function CloseIcon2({ className }) {
973
+ return /* @__PURE__ */ jsx11("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
974
+ }
975
+ function WarningIcon2({ className }) {
976
+ return /* @__PURE__ */ jsx11("svg", { className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z" }) });
977
+ }
978
+ function useMountTransition(open, duration = 300) {
979
+ const [mounted, setMounted] = useState4(open);
980
+ const [animate, setAnimate] = useState4(open);
981
+ useEffect(() => {
982
+ if (open) {
983
+ setMounted(true);
984
+ let raf2 = 0;
985
+ const raf1 = requestAnimationFrame(() => {
986
+ raf2 = requestAnimationFrame(() => setAnimate(true));
987
+ });
988
+ return () => {
989
+ cancelAnimationFrame(raf1);
990
+ cancelAnimationFrame(raf2);
991
+ };
992
+ }
993
+ setAnimate(false);
994
+ const timer = setTimeout(() => setMounted(false), duration);
995
+ return () => clearTimeout(timer);
996
+ }, [open, duration]);
997
+ return { mounted, animate };
998
+ }
999
+ function DialogAction({
1000
+ action,
1001
+ variant,
1002
+ orderClass
1003
+ }) {
1004
+ if (!action) return null;
1005
+ const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
1006
+ return /* @__PURE__ */ jsx11(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
1007
+ }
1008
+ var Dialog = forwardRef11(
1009
+ (_a, ref) => {
1010
+ var _b = _a, {
1011
+ open,
1012
+ onOpenChange,
1013
+ display = "centered",
1014
+ artwork,
1015
+ title,
1016
+ subtitle,
1017
+ warning = false,
1018
+ closable = true,
1019
+ backdrop = true,
1020
+ children,
1021
+ dismiss,
1022
+ secondary,
1023
+ confirm,
1024
+ className = ""
1025
+ } = _b, rest = __objRest(_b, [
1026
+ "open",
1027
+ "onOpenChange",
1028
+ "display",
1029
+ "artwork",
1030
+ "title",
1031
+ "subtitle",
1032
+ "warning",
1033
+ "closable",
1034
+ "backdrop",
1035
+ "children",
1036
+ "dismiss",
1037
+ "secondary",
1038
+ "confirm",
1039
+ "className"
1040
+ ]);
1041
+ const { mounted, animate } = useMountTransition(open);
1042
+ useEffect(() => {
1043
+ if (!open || !closable) return;
1044
+ const handleKeyDown = (e) => {
1045
+ if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
1046
+ };
1047
+ document.addEventListener("keydown", handleKeyDown);
1048
+ return () => document.removeEventListener("keydown", handleKeyDown);
1049
+ }, [open, closable, onOpenChange]);
1050
+ if (!mounted) return null;
1051
+ const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
1052
+ const handleBackdropMouseDown = (e) => {
1053
+ if (closable && e.target === e.currentTarget) handleClose();
1054
+ };
1055
+ const showHeader = Boolean(title || subtitle || warning || closable);
1056
+ const footerCount = [dismiss, secondary, confirm].filter(Boolean).length;
1057
+ const showFooter = footerCount > 0;
1058
+ const splitDismissLeft = footerCount === 3;
1059
+ const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
1060
+ const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
1061
+ return createPortal(
1062
+ /* @__PURE__ */ jsx11(
1063
+ "div",
1064
+ {
1065
+ className: [
1066
+ "fixed inset-0 z-15000 flex flex-col",
1067
+ backdrop ? "bg-dialog-background-backdrop" : "",
1068
+ "transition-opacity duration-300",
1069
+ animate ? "opacity-100" : "opacity-0",
1070
+ display === "slide-up" ? "items-center justify-end" : "",
1071
+ display === "full" ? "items-start justify-end" : "",
1072
+ display === "centered" ? "items-center justify-center px-24" : "",
1073
+ "lg:items-center lg:justify-center lg:px-0"
1074
+ ].filter(Boolean).join(" "),
1075
+ role: "presentation",
1076
+ onMouseDown: handleBackdropMouseDown,
1077
+ children: /* @__PURE__ */ jsxs10(
1078
+ "div",
1079
+ __spreadProps(__spreadValues({
1080
+ ref,
1081
+ role: "dialog",
1082
+ "aria-modal": "true",
1083
+ className: [
1084
+ "relative flex w-full flex-col overflow-hidden bg-dialog-background-primary",
1085
+ display === "centered" ? "rounded-12" : "rounded-t-12",
1086
+ "max-h-[85vh]",
1087
+ display === "full" ? "max-w-479 flex-1" : "max-w-479",
1088
+ "lg:min-w-0 lg:w-480 lg:max-w-480 lg:flex-none lg:rounded-16 lg:max-h-[85vh]",
1089
+ "transition-all duration-300",
1090
+ mobileTransition,
1091
+ desktopTransition,
1092
+ className
1093
+ ].filter(Boolean).join(" "),
1094
+ onMouseDown: (e) => e.stopPropagation()
1095
+ }, rest), {
1096
+ children: [
1097
+ artwork ? /* @__PURE__ */ jsxs10("div", { className: "relative shrink-0 bg-background-tertiary", children: [
1098
+ closable && /* @__PURE__ */ jsx11("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ jsx11(
1099
+ IconButton,
1100
+ {
1101
+ icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-24 w-24" }),
1102
+ size: "m",
1103
+ "aria-label": "\u0E1B\u0E34\u0E14",
1104
+ onClick: handleClose,
1105
+ className: "bg-icon-button-background-dark-transparent-enabled hover:bg-icon-button-background-dark-transparent-hover active:bg-icon-button-background-dark-transparent-active text-icon-button-icon-inverse!"
1106
+ }
1107
+ ) }),
1108
+ artwork
1109
+ ] }) : null,
1110
+ showHeader && /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 items-center gap-8 bg-dialog-background-primary px-16 pb-12 pt-16 lg:px-24 lg:pb-12 lg:pt-20", children: [
1111
+ /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
1112
+ warning && /* @__PURE__ */ jsx11("span", { className: "flex shrink-0 items-center pt-2", children: /* @__PURE__ */ jsx11(WarningIcon2, { className: "h-20 w-20 text-dialog-icon-warning lg:h-24 lg:w-24" }) }),
1113
+ /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
1114
+ title && /* @__PURE__ */ jsx11("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
1115
+ subtitle && !artwork && /* @__PURE__ */ jsx11("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
1116
+ ] })
1117
+ ] }),
1118
+ closable && !artwork && /* @__PURE__ */ jsxs10(Fragment2, { children: [
1119
+ /* @__PURE__ */ jsx11(
1120
+ IconButton,
1121
+ {
1122
+ icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-20 w-20" }),
1123
+ size: "s",
1124
+ "aria-label": "\u0E1B\u0E34\u0E14",
1125
+ onClick: handleClose,
1126
+ className: "bg-icon-button-background-enabled lg:hidden!"
1127
+ }
1128
+ ),
1129
+ /* @__PURE__ */ jsx11(
1130
+ IconButton,
1131
+ {
1132
+ icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-24 w-24" }),
1133
+ size: "m",
1134
+ "aria-label": "\u0E1B\u0E34\u0E14",
1135
+ onClick: handleClose,
1136
+ className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
1137
+ }
1138
+ )
1139
+ ] })
1140
+ ] }),
1141
+ /* @__PURE__ */ jsx11("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary px-16 py-12 text-body-small text-dialog-text-primary lg:px-24 lg:text-body-regular", children }),
1142
+ showFooter && /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 flex-col gap-8 bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end lg:px-24 lg:pb-24", children: [
1143
+ /* @__PURE__ */ jsx11(
1144
+ DialogAction,
1145
+ {
1146
+ action: dismiss,
1147
+ variant: "tertiary",
1148
+ orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
1149
+ }
1150
+ ),
1151
+ /* @__PURE__ */ jsx11(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
1152
+ /* @__PURE__ */ jsx11(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
1153
+ ] })
1154
+ ]
1155
+ })
1156
+ )
1157
+ }
1158
+ ),
1159
+ document.body
1160
+ );
1161
+ }
1162
+ );
1163
+ Dialog.displayName = "Dialog";
1164
+
1165
+ // src/components/Drawer/Drawer.tsx
1166
+ import {
1167
+ forwardRef as forwardRef12,
1075
1168
  useEffect as useEffect2,
1076
- useState as useState5,
1077
- useCallback as useCallback3,
1078
- forwardRef as forwardRef11
1169
+ useState as useState5
1079
1170
  } from "react";
1080
1171
  import { createPortal as createPortal2 } from "react-dom";
1081
- import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1082
- var Dialog = forwardRef11(
1083
- ({
1084
- isForceOpen = false,
1085
- setIsForceOpen,
1086
- isClosedAble = true,
1087
- isCloseIcon = true,
1088
- children,
1089
- startModalBtn,
1090
- stopModalBtn,
1091
- afterStopBtn,
1092
- p = "20",
1093
- maxW = "md"
1094
- }, ref) => {
1095
- const [isOpen, setIsOpen] = useState5(false);
1096
- const [isRender, setIsRender] = useState5(false);
1097
- const [animate, setAnimate] = useState5(false);
1098
- useEffect2(() => {
1099
- if (isOpen) {
1100
- setIsRender(true);
1101
- setTimeout(() => setAnimate(true), 10);
1102
- } else {
1103
- setAnimate(false);
1104
- const timer = setTimeout(() => setIsRender(false), 300);
1105
- return () => clearTimeout(timer);
1106
- }
1107
- }, [isOpen]);
1172
+ import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1173
+ function CloseIcon3({ className }) {
1174
+ return /* @__PURE__ */ jsx12("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1175
+ }
1176
+ function useMountTransition2(open, duration = 300) {
1177
+ const [mounted, setMounted] = useState5(open);
1178
+ const [animate, setAnimate] = useState5(open);
1179
+ useEffect2(() => {
1180
+ if (open) {
1181
+ setMounted(true);
1182
+ let raf2 = 0;
1183
+ const raf1 = requestAnimationFrame(() => {
1184
+ raf2 = requestAnimationFrame(() => setAnimate(true));
1185
+ });
1186
+ return () => {
1187
+ cancelAnimationFrame(raf1);
1188
+ cancelAnimationFrame(raf2);
1189
+ };
1190
+ }
1191
+ setAnimate(false);
1192
+ const timer = setTimeout(() => setMounted(false), duration);
1193
+ return () => clearTimeout(timer);
1194
+ }, [open, duration]);
1195
+ return { mounted, animate };
1196
+ }
1197
+ function DrawerAction({
1198
+ action,
1199
+ variant,
1200
+ orderClass
1201
+ }) {
1202
+ if (!action) return null;
1203
+ const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
1204
+ return /* @__PURE__ */ jsx12(
1205
+ Button,
1206
+ __spreadProps(__spreadValues({
1207
+ variant,
1208
+ size: "lg",
1209
+ className: `w-full lg:w-auto ${orderClass} ${className}`
1210
+ }, rest), {
1211
+ children: label
1212
+ })
1213
+ );
1214
+ }
1215
+ var Drawer = forwardRef12(
1216
+ (_a, ref) => {
1217
+ var _b = _a, {
1218
+ open,
1219
+ onOpenChange,
1220
+ title,
1221
+ subtitle,
1222
+ closable = true,
1223
+ backdrop = true,
1224
+ fullScreen = false,
1225
+ header,
1226
+ background = "primary",
1227
+ children,
1228
+ dismiss,
1229
+ secondary,
1230
+ confirm,
1231
+ className = ""
1232
+ } = _b, rest = __objRest(_b, [
1233
+ "open",
1234
+ "onOpenChange",
1235
+ "title",
1236
+ "subtitle",
1237
+ "closable",
1238
+ "backdrop",
1239
+ "fullScreen",
1240
+ "header",
1241
+ "background",
1242
+ "children",
1243
+ "dismiss",
1244
+ "secondary",
1245
+ "confirm",
1246
+ "className"
1247
+ ]);
1248
+ const { mounted, animate } = useMountTransition2(open);
1108
1249
  useEffect2(() => {
1109
- if (isForceOpen) {
1110
- setIsOpen(true);
1111
- } else {
1112
- setIsOpen(false);
1113
- }
1114
- }, [isForceOpen]);
1115
- const handleStartClick = useCallback3(
1116
- (e) => {
1117
- var _a, _b;
1118
- (_b = startModalBtn == null ? void 0 : (_a = startModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
1119
- setIsForceOpen == null ? void 0 : setIsForceOpen(true);
1120
- setIsOpen(true);
1121
- },
1122
- [startModalBtn]
1123
- );
1124
- const handleStopClick = useCallback3(
1125
- (e) => {
1126
- var _a, _b;
1127
- (_b = stopModalBtn == null ? void 0 : (_a = stopModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
1128
- setIsForceOpen == null ? void 0 : setIsForceOpen(false);
1129
- setIsOpen(false);
1130
- },
1131
- [stopModalBtn]
1132
- );
1133
- const handleCloseClick = () => {
1134
- setIsForceOpen == null ? void 0 : setIsForceOpen(false);
1135
- setIsOpen(false);
1250
+ if (!open || !closable) return;
1251
+ const handleKeyDown = (e) => {
1252
+ if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
1253
+ };
1254
+ document.addEventListener("keydown", handleKeyDown);
1255
+ return () => document.removeEventListener("keydown", handleKeyDown);
1256
+ }, [open, closable, onOpenChange]);
1257
+ if (!mounted) return null;
1258
+ const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
1259
+ const handleBackdropMouseDown = (e) => {
1260
+ if (closable && e.target === e.currentTarget) handleClose();
1136
1261
  };
1137
- return /* @__PURE__ */ jsxs11("span", { ref, style: { display: "contents" }, children: [
1138
- startModalBtn && React2.cloneElement(startModalBtn, {
1139
- onClick: handleStartClick
1140
- }),
1141
- isRender && createPortal2(
1142
- /* @__PURE__ */ jsxs11(
1143
- "div",
1144
- {
1145
- className: `fixed inset-0 z-15000 flex items-center justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
1146
- "aria-modal": "true",
1147
- role: "dialog",
1148
- children: [
1149
- /* @__PURE__ */ jsx11(
1150
- "div",
1151
- {
1152
- className: "absolute inset-0 bg-black/40",
1153
- onClick: () => isClosedAble ? handleCloseClick() : null,
1154
- "aria-label": "Close modal"
1155
- }
1156
- ),
1157
- /* @__PURE__ */ jsxs11(
1158
- "div",
1159
- {
1160
- className: `relative z-10 w-[calc(100%-40px)] max-w-${maxW} rounded-xl bg-white p-${p || "20"} shadow-lg transform transition-all duration-300 ${animate ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
1161
- children: [
1162
- isCloseIcon && /* @__PURE__ */ jsx11(
1163
- "svg",
1164
- {
1165
- xmlns: "http://www.w3.org/2000/svg",
1166
- width: "20",
1167
- height: "20",
1168
- viewBox: "0 0 20 20",
1169
- fill: "none",
1170
- className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-16 cursor-pointer",
1171
- onMouseDown: (e) => {
1172
- e.preventDefault();
1173
- handleCloseClick();
1174
- },
1175
- children: /* @__PURE__ */ jsx11(
1176
- "path",
1262
+ const showHeader = header != null ? header : Boolean(title || subtitle || closable);
1263
+ const showFooter = Boolean(dismiss || secondary || confirm);
1264
+ const allActions = Boolean(dismiss && secondary && confirm);
1265
+ return createPortal2(
1266
+ /* @__PURE__ */ jsx12(
1267
+ "div",
1268
+ {
1269
+ className: [
1270
+ "fixed inset-0 z-15000 flex flex-col items-end justify-center",
1271
+ backdrop ? "bg-dialog-background-backdrop" : "",
1272
+ "transition-opacity duration-300",
1273
+ animate ? "opacity-100" : "opacity-0"
1274
+ ].filter(Boolean).join(" "),
1275
+ role: "presentation",
1276
+ onMouseDown: handleBackdropMouseDown,
1277
+ children: /* @__PURE__ */ jsxs11(
1278
+ "div",
1279
+ __spreadProps(__spreadValues({
1280
+ ref,
1281
+ role: "dialog",
1282
+ "aria-modal": "true",
1283
+ className: [
1284
+ "relative flex h-full w-full flex-col overflow-hidden bg-dialog-background-primary",
1285
+ "transition-transform duration-300",
1286
+ animate ? "translate-y-0" : "translate-y-full",
1287
+ fullScreen ? "" : [
1288
+ "lg:translate-y-0",
1289
+ animate ? "lg:translate-x-0" : "lg:translate-x-full"
1290
+ ].join(" "),
1291
+ fullScreen ? "lg:w-full" : "lg:w-480 lg:min-w-480 lg:max-w-640",
1292
+ className
1293
+ ].filter(Boolean).join(" "),
1294
+ onMouseDown: (e) => e.stopPropagation()
1295
+ }, rest), {
1296
+ children: [
1297
+ showHeader && /* @__PURE__ */ jsxs11(
1298
+ "div",
1299
+ {
1300
+ className: [
1301
+ "flex shrink-0 items-center gap-8 border-b border-border-subtle bg-dialog-background-primary px-16 pb-12 pt-16",
1302
+ fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-16 lg:pt-20"
1303
+ ].join(" "),
1304
+ children: [
1305
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
1306
+ title && /* @__PURE__ */ jsx12("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
1307
+ subtitle && /* @__PURE__ */ jsx12("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
1308
+ ] }),
1309
+ closable && /* @__PURE__ */ jsxs11(Fragment3, { children: [
1310
+ /* @__PURE__ */ jsx12(
1311
+ IconButton,
1177
1312
  {
1178
- d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
1179
- fill: "#111827"
1313
+ icon: /* @__PURE__ */ jsx12(CloseIcon3, { className: "h-20 w-20" }),
1314
+ size: "s",
1315
+ "aria-label": "\u0E1B\u0E34\u0E14",
1316
+ onClick: handleClose,
1317
+ className: "bg-icon-button-background-enabled lg:hidden!"
1318
+ }
1319
+ ),
1320
+ /* @__PURE__ */ jsx12(
1321
+ IconButton,
1322
+ {
1323
+ icon: /* @__PURE__ */ jsx12(CloseIcon3, { className: "h-24 w-24" }),
1324
+ size: fullScreen ? "l" : "m",
1325
+ "aria-label": "\u0E1B\u0E34\u0E14",
1326
+ onClick: handleClose,
1327
+ className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
1180
1328
  }
1181
1329
  )
1182
- }
1183
- ),
1184
- children,
1185
- stopModalBtn && React2.cloneElement(stopModalBtn, {
1186
- onClick: handleStopClick
1187
- }),
1188
- afterStopBtn && afterStopBtn
1189
- ]
1190
- }
1191
- )
1192
- ]
1193
- }
1194
- ),
1195
- document.body
1196
- )
1197
- ] });
1330
+ ] })
1331
+ ]
1332
+ }
1333
+ ),
1334
+ /* @__PURE__ */ jsx12(
1335
+ "div",
1336
+ {
1337
+ className: [
1338
+ "flex-1 overflow-y-auto p-16 text-body-regular text-dialog-text-primary",
1339
+ background === "secondary" ? "bg-drawer-background-secondary" : "bg-dialog-background-primary",
1340
+ fullScreen ? "lg:px-112 lg:py-24" : "lg:p-24"
1341
+ ].join(" "),
1342
+ children
1343
+ }
1344
+ ),
1345
+ showFooter && /* @__PURE__ */ jsx12(
1346
+ "div",
1347
+ {
1348
+ className: [
1349
+ "flex shrink-0 flex-col gap-8 border-t border-border-subtle bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end",
1350
+ fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-24 lg:pt-16"
1351
+ ].join(" "),
1352
+ children: allActions ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
1353
+ /* @__PURE__ */ jsx12(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
1354
+ /* @__PURE__ */ jsxs11("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
1355
+ /* @__PURE__ */ jsx12(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
1356
+ /* @__PURE__ */ jsx12(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
1357
+ ] })
1358
+ ] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
1359
+ /* @__PURE__ */ jsx12(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
1360
+ /* @__PURE__ */ jsx12(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
1361
+ /* @__PURE__ */ jsx12(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
1362
+ ] })
1363
+ }
1364
+ )
1365
+ ]
1366
+ })
1367
+ )
1368
+ }
1369
+ ),
1370
+ document.body
1371
+ );
1198
1372
  }
1199
1373
  );
1200
- Dialog.displayName = "Dialog";
1374
+ Drawer.displayName = "Drawer";
1201
1375
 
1202
1376
  // src/components/Dropdown/Dropdown.tsx
1203
1377
  import {
1204
- useState as useState6,
1205
- useRef,
1206
1378
  useEffect as useEffect3,
1207
- forwardRef as forwardRef12
1379
+ useId as useId3,
1380
+ useRef,
1381
+ useState as useState6,
1382
+ forwardRef as forwardRef13
1208
1383
  } from "react";
1209
- import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1210
- var IconDanger = () => /* @__PURE__ */ jsx12(
1384
+ import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1385
+ var IconDanger = () => /* @__PURE__ */ jsx13(
1211
1386
  "svg",
1212
1387
  {
1213
1388
  xmlns: "http://www.w3.org/2000/svg",
@@ -1215,7 +1390,7 @@ var IconDanger = () => /* @__PURE__ */ jsx12(
1215
1390
  height: "20",
1216
1391
  viewBox: "0 0 20 20",
1217
1392
  fill: "none",
1218
- children: /* @__PURE__ */ jsx12(
1393
+ children: /* @__PURE__ */ jsx13(
1219
1394
  "path",
1220
1395
  {
1221
1396
  d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
@@ -1225,7 +1400,7 @@ var IconDanger = () => /* @__PURE__ */ jsx12(
1225
1400
  }
1226
1401
  );
1227
1402
  function IconCheck({ className }) {
1228
- return /* @__PURE__ */ jsx12(
1403
+ return /* @__PURE__ */ jsx13(
1229
1404
  "svg",
1230
1405
  {
1231
1406
  xmlns: "http://www.w3.org/2000/svg",
@@ -1234,7 +1409,7 @@ function IconCheck({ className }) {
1234
1409
  viewBox: "0 0 20 20",
1235
1410
  fill: "none",
1236
1411
  className,
1237
- children: /* @__PURE__ */ jsx12(
1412
+ children: /* @__PURE__ */ jsx13(
1238
1413
  "path",
1239
1414
  {
1240
1415
  d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
@@ -1245,7 +1420,7 @@ function IconCheck({ className }) {
1245
1420
  );
1246
1421
  }
1247
1422
  function ChevronDown({ className }) {
1248
- return /* @__PURE__ */ jsx12(
1423
+ return /* @__PURE__ */ jsx13(
1249
1424
  "svg",
1250
1425
  {
1251
1426
  xmlns: "http://www.w3.org/2000/svg",
@@ -1254,7 +1429,7 @@ function ChevronDown({ className }) {
1254
1429
  viewBox: "0 0 20 20",
1255
1430
  fill: "none",
1256
1431
  className,
1257
- children: /* @__PURE__ */ jsx12(
1432
+ children: /* @__PURE__ */ jsx13(
1258
1433
  "path",
1259
1434
  {
1260
1435
  d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
@@ -1264,16 +1439,17 @@ function ChevronDown({ className }) {
1264
1439
  }
1265
1440
  );
1266
1441
  }
1267
- var Dropdown = forwardRef12(
1442
+ var Dropdown = forwardRef13(
1268
1443
  (_a, ref) => {
1269
1444
  var _b = _a, {
1270
1445
  size = "md",
1446
+ variant = "default",
1271
1447
  error,
1272
1448
  label,
1273
1449
  placeholder,
1274
- isDisabled = false,
1275
- isSearchable = false,
1276
- isTextCenter = false,
1450
+ helperText,
1451
+ disabled = false,
1452
+ textCenter = false,
1277
1453
  value,
1278
1454
  setValue,
1279
1455
  dropDownItems = [
@@ -1286,168 +1462,248 @@ var Dropdown = forwardRef12(
1286
1462
  className = ""
1287
1463
  } = _b, rest = __objRest(_b, [
1288
1464
  "size",
1465
+ "variant",
1289
1466
  "error",
1290
1467
  "label",
1291
1468
  "placeholder",
1292
- "isDisabled",
1293
- "isSearchable",
1294
- "isTextCenter",
1469
+ "helperText",
1470
+ "disabled",
1471
+ "textCenter",
1295
1472
  "value",
1296
1473
  "setValue",
1297
1474
  "dropDownItems",
1298
1475
  "className"
1299
1476
  ]);
1477
+ const isCombobox = variant === "combobox";
1478
+ const iconButtonSize = size === "lg" ? "m" : "s";
1300
1479
  const [isOpen, setIsOpen] = useState6(false);
1301
- const [search, setSearch] = useState6("");
1480
+ const [isFocused, setIsFocused] = useState6(false);
1481
+ const [query, setQuery] = useState6(value.label || "");
1482
+ const [filterText, setFilterText] = useState6("");
1302
1483
  const dropdownRef = useRef(null);
1303
- const filteredItems = dropDownItems.filter(
1304
- (item) => item.label.toLowerCase().includes(search.toLowerCase())
1305
- );
1484
+ const inputRef = useRef(null);
1485
+ const listboxId = useId3();
1486
+ const [prevLabel, setPrevLabel] = useState6(value.label);
1487
+ if (value.label !== prevLabel) {
1488
+ setPrevLabel(value.label);
1489
+ setQuery(value.label || "");
1490
+ }
1491
+ const filteredItems = isCombobox ? dropDownItems.filter(
1492
+ (item) => item.label.toLowerCase().includes(filterText.toLowerCase())
1493
+ ) : dropDownItems;
1306
1494
  useEffect3(() => {
1307
1495
  function handleClickOutside(event) {
1308
1496
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
1309
1497
  setIsOpen(false);
1498
+ if (isCombobox) setQuery(value.label || "");
1310
1499
  }
1311
1500
  }
1312
1501
  document.addEventListener("mousedown", handleClickOutside);
1313
1502
  return () => {
1314
1503
  document.removeEventListener("mousedown", handleClickOutside);
1315
1504
  };
1316
- }, []);
1317
- return /* @__PURE__ */ jsxs12("div", { className: "w-full", children: [
1318
- label ? /* @__PURE__ */ jsx12(
1505
+ }, [isCombobox, value.label]);
1506
+ const triggerClassName = `w-full rounded-6 text-body-small px-16 inline-flex gap-8 items-center border
1507
+ ${size === "lg" ? "h-48 py-16" : "h-40 py-12"}
1508
+ ${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
1509
+ ${disabled ? "pointer-events-none bg-dropdown-background-disabled border-dropdown-border-disabled" : error ? "bg-dropdown-background-enabled border-dropdown-border-danger ring-1 ring-inset ring-dropdown-border-danger" : isOpen ? "bg-dropdown-background-enabled border-dropdown-border-active ring-1 ring-inset ring-dropdown-border-active" : isFocused ? "bg-dropdown-background-enabled border-dropdown-border-focus ring-1 ring-inset ring-dropdown-border-focus" : "bg-dropdown-background-enabled border-dropdown-border-enabled hover:border-dropdown-border-hover"}
1510
+ ${className}`;
1511
+ return /* @__PURE__ */ jsxs12("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
1512
+ label ? /* @__PURE__ */ jsx13(
1319
1513
  "p",
1320
1514
  {
1321
- className: `text-label-medium text-left items-left font-medium mb-4 ${isDisabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
1515
+ className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
1322
1516
  children: label
1323
1517
  }
1324
- ) : /* @__PURE__ */ jsx12(Fragment2, {}),
1518
+ ) : /* @__PURE__ */ jsx13(Fragment4, {}),
1325
1519
  /* @__PURE__ */ jsxs12("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
1326
- /* @__PURE__ */ jsxs12(
1520
+ isCombobox ? /* @__PURE__ */ jsxs12(
1327
1521
  "div",
1328
1522
  __spreadProps(__spreadValues({
1329
1523
  ref
1330
1524
  }, rest), {
1331
- onClick: () => !isDisabled && setIsOpen(!isOpen),
1332
- className: `w-full rounded-md text-body-small px-16 text-center inline-flex gap-8 items-center border **:focus:outline-none focus:border-2 focus:px-15 focus:py-9
1333
- ${size === "lg" ? "py-12" : "py-8"}
1334
- ${isDisabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer"}
1335
- ${isDisabled ? "pointer-events-none bg-dropdown-background-disabled border-dropdown-border-disabled" : error ? "border-red-600 bg-dropdown-background-enabled focus:border-red-600" : value ? "text-dropdown-text-primary bg-dropdown-background-enabled border-dropdown-border-enabled focus:border-dropdown-border-active " : "text-dropdown-text-secondary bg-dropdown-background-enabled border-dropdown-border-enabled focus:border-dropdown-border-active "}
1336
- ${className}`,
1525
+ onClick: () => {
1526
+ var _a2;
1527
+ return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
1528
+ },
1529
+ className: triggerClassName,
1337
1530
  children: [
1338
- /* @__PURE__ */ jsx12(
1339
- "p",
1531
+ /* @__PURE__ */ jsx13(
1532
+ "input",
1340
1533
  {
1341
- className: `grow truncate ${isTextCenter ? "text-center" : "text-start"}`,
1342
- children: value.label || placeholder
1534
+ ref: inputRef,
1535
+ type: "text",
1536
+ role: "combobox",
1537
+ "aria-autocomplete": "list",
1538
+ "aria-haspopup": "listbox",
1539
+ "aria-expanded": isOpen,
1540
+ "aria-controls": listboxId,
1541
+ disabled,
1542
+ placeholder,
1543
+ value: query,
1544
+ onChange: (e) => {
1545
+ setQuery(e.target.value);
1546
+ setFilterText(e.target.value);
1547
+ setIsOpen(true);
1548
+ },
1549
+ onFocus: () => {
1550
+ setIsFocused(true);
1551
+ setIsOpen(true);
1552
+ setFilterText("");
1553
+ },
1554
+ onBlur: () => setIsFocused(false),
1555
+ onKeyDown: (e) => {
1556
+ if (!disabled && e.key === "Escape") {
1557
+ setIsOpen(false);
1558
+ setQuery(value.label || "");
1559
+ }
1560
+ },
1561
+ className: `grow w-full min-w-0 bg-transparent focus:outline-none ${disabled ? "text-dropdown-text-disabled cursor-not-allowed" : "text-dropdown-text-primary cursor-text"}`
1343
1562
  }
1344
1563
  ),
1345
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-8", children: [
1346
- isDisabled ? /* @__PURE__ */ jsx12(Fragment2, {}) : error ? /* @__PURE__ */ jsx12(IconDanger, {}) : /* @__PURE__ */ jsx12(Fragment2, {}),
1347
- /* @__PURE__ */ jsx12(
1348
- ChevronDown,
1564
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-4", children: [
1565
+ disabled ? /* @__PURE__ */ jsx13(Fragment4, {}) : error ? /* @__PURE__ */ jsx13(IconDanger, {}) : /* @__PURE__ */ jsx13(Fragment4, {}),
1566
+ /* @__PURE__ */ jsx13(
1567
+ IconButton,
1349
1568
  {
1350
- className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
1569
+ size: iconButtonSize,
1570
+ disabled,
1571
+ tabIndex: -1,
1572
+ "aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
1573
+ icon: /* @__PURE__ */ jsx13(
1574
+ ChevronDown,
1575
+ {
1576
+ className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
1577
+ }
1578
+ ),
1579
+ onMouseDown: (e) => e.preventDefault(),
1580
+ onClick: (e) => {
1581
+ var _a2;
1582
+ e.stopPropagation();
1583
+ if (disabled) return;
1584
+ if (isOpen) {
1585
+ setIsOpen(false);
1586
+ setQuery(value.label || "");
1587
+ } else {
1588
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1589
+ }
1590
+ }
1351
1591
  }
1352
1592
  )
1353
1593
  ] })
1354
1594
  ]
1355
1595
  })
1356
- ),
1357
- /* @__PURE__ */ jsxs12(
1596
+ ) : /* @__PURE__ */ jsxs12(
1358
1597
  "div",
1359
- {
1360
- id: "dropdownSearch",
1361
- className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-8 absolute z-10000 bg-white-100 rounded-lg shadow-base w-9/10 min-w-fit flex-col`,
1598
+ __spreadProps(__spreadValues({
1599
+ ref
1600
+ }, rest), {
1601
+ tabIndex: disabled ? -1 : 0,
1602
+ role: "button",
1603
+ "aria-haspopup": "listbox",
1604
+ "aria-expanded": isOpen,
1605
+ onClick: () => !disabled && setIsOpen(!isOpen),
1606
+ onFocus: (e) => {
1607
+ var _a2;
1608
+ setIsFocused(true);
1609
+ (_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
1610
+ },
1611
+ onBlur: (e) => {
1612
+ var _a2;
1613
+ setIsFocused(false);
1614
+ (_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
1615
+ },
1616
+ onKeyDown: (e) => {
1617
+ var _a2;
1618
+ if (disabled) return;
1619
+ if (e.key === "Enter" || e.key === " ") {
1620
+ e.preventDefault();
1621
+ setIsOpen((prev) => !prev);
1622
+ } else if (e.key === "Escape") {
1623
+ setIsOpen(false);
1624
+ }
1625
+ (_a2 = rest.onKeyDown) == null ? void 0 : _a2.call(rest, e);
1626
+ },
1627
+ className: `focus:outline-none ${triggerClassName}`,
1362
1628
  children: [
1363
- isSearchable ? /* @__PURE__ */ jsxs12("div", { className: "p-3", children: [
1364
- /* @__PURE__ */ jsx12("label", { htmlFor: "input-group-search", className: "sr-only", children: "Search" }),
1365
- /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
1366
- /* @__PURE__ */ jsx12("div", { className: "absolute inset-y-0 rtl:inset-r-0 inset-s-0 flex items-center ps-12 pointer-events-none", children: /* @__PURE__ */ jsxs12(
1367
- "svg",
1368
- {
1369
- xmlns: "http://www.w3.org/2000/svg",
1370
- width: "20",
1371
- height: "20",
1372
- viewBox: "0 0 20 20",
1373
- fill: "none",
1374
- children: [
1375
- /* @__PURE__ */ jsx12(
1376
- "mask",
1377
- {
1378
- id: "mask0_3218_5077",
1379
- style: { maskType: "alpha" },
1380
- maskUnits: "userSpaceOnUse",
1381
- x: "0",
1382
- y: "0",
1383
- width: "20",
1384
- height: "20",
1385
- children: /* @__PURE__ */ jsx12("rect", { width: "20", height: "20", fill: "#D9D9D9" })
1386
- }
1387
- ),
1388
- /* @__PURE__ */ jsx12("g", { mask: "url(#mask0_3218_5077)", children: /* @__PURE__ */ jsx12(
1389
- "path",
1390
- {
1391
- d: "M15.8894 16.6476L10.9263 11.6842C10.5096 12.0005 10.0527 12.2454 9.55563 12.419C9.05855 12.5926 8.54556 12.6794 8.01667 12.6794C6.7182 12.6794 5.61354 12.2241 4.70271 11.3134C3.79202 10.4026 3.33667 9.29811 3.33667 8.00005C3.33667 6.702 3.79202 5.59755 4.70271 4.68672C5.61354 3.77603 6.71799 3.32068 8.01604 3.32068C9.3141 3.32068 10.4185 3.77603 11.3294 4.68672C12.2401 5.59755 12.6954 6.70221 12.6954 8.00068C12.6954 8.54554 12.606 9.06651 12.4271 9.56359C12.2481 10.0608 12.0058 10.5097 11.7002 10.9103L16.6633 15.8734L15.8894 16.6476ZM8.01604 11.5963C9.02035 11.5963 9.87077 11.248 10.5673 10.5513C11.264 9.85478 11.6123 9.00436 11.6123 8.00005C11.6123 6.99575 11.264 6.14533 10.5673 5.4488C9.87077 4.75214 9.02035 4.4038 8.01604 4.4038C7.01174 4.4038 6.16132 4.75214 5.46479 5.4488C4.76813 6.14533 4.41979 6.99575 4.41979 8.00005C4.41979 9.00436 4.76813 9.85478 5.46479 10.5513C6.16132 11.248 7.01174 11.5963 8.01604 11.5963Z",
1392
- fill: "#111827"
1393
- }
1394
- ) })
1395
- ]
1396
- }
1397
- ) }),
1398
- /* @__PURE__ */ jsx12(
1399
- "input",
1400
- {
1401
- type: "text",
1402
- className: "block w-full p-8 ps-40 text-body-small text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-bubblegum focus:border-bubblegum",
1403
- placeholder: "Search...",
1404
- value: search,
1405
- onChange: (e) => setSearch(e.target.value)
1406
- }
1407
- )
1408
- ] })
1409
- ] }) : /* @__PURE__ */ jsx12(Fragment2, {}),
1410
- /* @__PURE__ */ jsx12(
1411
- "ul",
1629
+ /* @__PURE__ */ jsx13(
1630
+ "p",
1412
1631
  {
1413
- className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
1414
- "aria-labelledby": "dropdownSearchButton",
1415
- children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsxs12(
1416
- "div",
1417
- {
1418
- onClick: () => {
1419
- setValue(item);
1420
- setSearch("");
1421
- setIsOpen(false);
1422
- },
1423
- className: "relative text-gray-900 py-12 px-16 rounded-sm text-label-medium hover:bg-gray-100 flex items-center justify-between gap-12",
1424
- children: [
1425
- /* @__PURE__ */ jsx12("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
1426
- value.value === item.value && /* @__PURE__ */ jsx12(IconCheck, { className: "h-20 w-20" })
1427
- ]
1428
- }
1429
- ) }, idx)) : /* @__PURE__ */ jsx12("li", { className: "px-8 py-8 text-label-medium text-gray-900", children: "No results found" })
1632
+ className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
1633
+ children: value.label || placeholder
1430
1634
  }
1431
- )
1635
+ ),
1636
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-4", children: [
1637
+ disabled ? /* @__PURE__ */ jsx13(Fragment4, {}) : error ? /* @__PURE__ */ jsx13(IconDanger, {}) : /* @__PURE__ */ jsx13(Fragment4, {}),
1638
+ /* @__PURE__ */ jsx13(
1639
+ IconButton,
1640
+ {
1641
+ size: iconButtonSize,
1642
+ disabled,
1643
+ tabIndex: -1,
1644
+ "aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
1645
+ icon: /* @__PURE__ */ jsx13(
1646
+ ChevronDown,
1647
+ {
1648
+ className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
1649
+ }
1650
+ ),
1651
+ onMouseDown: (e) => e.preventDefault(),
1652
+ onClick: (e) => {
1653
+ e.stopPropagation();
1654
+ if (!disabled) setIsOpen((prev) => !prev);
1655
+ }
1656
+ }
1657
+ )
1658
+ ] })
1432
1659
  ]
1660
+ })
1661
+ ),
1662
+ /* @__PURE__ */ jsx13(
1663
+ "div",
1664
+ {
1665
+ className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-0 absolute z-10000 bg-dropdown-background-enabled rounded-6 shadow-base w-full flex-col pt-4 overflow-hidden`,
1666
+ children: /* @__PURE__ */ jsx13(
1667
+ "ul",
1668
+ {
1669
+ id: isCombobox ? listboxId : void 0,
1670
+ role: isCombobox ? "listbox" : void 0,
1671
+ className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
1672
+ children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12(
1673
+ "div",
1674
+ {
1675
+ onClick: () => {
1676
+ setValue(item);
1677
+ if (isCombobox) setQuery(item.label);
1678
+ setIsOpen(false);
1679
+ },
1680
+ className: "relative h-48 py-8 px-16 border-t border-gray-50 text-label-medium hover:bg-dropdown-background-hover active:bg-dropdown-background-active flex items-center justify-between gap-12",
1681
+ children: [
1682
+ /* @__PURE__ */ jsx13("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
1683
+ value.value === item.value && /* @__PURE__ */ jsx13(IconCheck, { className: "h-20 w-20" })
1684
+ ]
1685
+ }
1686
+ ) }, idx)) : /* @__PURE__ */ jsx13("li", { className: "px-16 py-8 text-label-medium text-dropdown-text-secondary", children: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23" })
1687
+ }
1688
+ )
1433
1689
  }
1434
1690
  )
1435
1691
  ] }),
1436
- error ? /* @__PURE__ */ jsx12(
1692
+ error ? /* @__PURE__ */ jsx13("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx13(
1437
1693
  "p",
1438
1694
  {
1439
- className: `text-caption-caption text-left items-left text-dropdown-text-danger mt-4 ${isDisabled ? "hidden" : ""}`,
1440
- children: error
1695
+ className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
1696
+ children: helperText
1441
1697
  }
1442
- ) : /* @__PURE__ */ jsx12(Fragment2, {})
1698
+ ) : /* @__PURE__ */ jsx13(Fragment4, {})
1443
1699
  ] });
1444
1700
  }
1445
1701
  );
1446
1702
  Dropdown.displayName = "Dropdown";
1447
1703
 
1448
1704
  // src/components/FinancialLogo/FinancialLogo.tsx
1449
- import { forwardRef as forwardRef13 } from "react";
1450
- import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1705
+ import { forwardRef as forwardRef14 } from "react";
1706
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1451
1707
  var inlineClasses2 = {
1452
1708
  info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
1453
1709
  success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
@@ -1477,34 +1733,34 @@ var inlineIconClasses2 = {
1477
1733
  common: "text-alert-inline-common-icon"
1478
1734
  };
1479
1735
  function InfoIcon2({ className }) {
1480
- return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6h.01M9 10h1v4h1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1736
+ return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6h.01M9 10h1v4h1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1481
1737
  }
1482
1738
  function SuccessIcon2({ className }) {
1483
1739
  return /* @__PURE__ */ jsxs13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
1484
- /* @__PURE__ */ jsx13("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
1485
- /* @__PURE__ */ jsx13("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1740
+ /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
1741
+ /* @__PURE__ */ jsx14("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1486
1742
  ] });
1487
1743
  }
1488
- function WarningIcon2({ className }) {
1489
- return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M8.57 3.22 1.53 15.5a1.67 1.67 0 0 0 1.43 2.5h14.08a1.67 1.67 0 0 0 1.43-2.5L11.43 3.22a1.67 1.67 0 0 0-2.86 0ZM10 7.5v3.33M10 14.17h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1744
+ function WarningIcon3({ className }) {
1745
+ return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M8.57 3.22 1.53 15.5a1.67 1.67 0 0 0 1.43 2.5h14.08a1.67 1.67 0 0 0 1.43-2.5L11.43 3.22a1.67 1.67 0 0 0-2.86 0ZM10 7.5v3.33M10 14.17h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1490
1746
  }
1491
1747
  function DangerIcon2({ className }) {
1492
- return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12.5 7.5l-5 5M7.5 7.5l5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1748
+ return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12.5 7.5l-5 5M7.5 7.5l5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1493
1749
  }
1494
1750
  function CommonIcon({ className }) {
1495
- return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6v4M10 14h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1751
+ return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6v4M10 14h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1496
1752
  }
1497
- function CloseIcon2({ className }) {
1498
- return /* @__PURE__ */ jsx13("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1753
+ function CloseIcon4({ className }) {
1754
+ return /* @__PURE__ */ jsx14("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1499
1755
  }
1500
1756
  var defaultIcons2 = {
1501
1757
  info: InfoIcon2,
1502
1758
  success: SuccessIcon2,
1503
- warning: WarningIcon2,
1759
+ warning: WarningIcon3,
1504
1760
  danger: DangerIcon2,
1505
1761
  common: CommonIcon
1506
1762
  };
1507
- var FinancialLogo = forwardRef13(
1763
+ var FinancialLogo = forwardRef14(
1508
1764
  (_a, ref) => {
1509
1765
  var _b = _a, {
1510
1766
  variant = "info",
@@ -1541,21 +1797,21 @@ var FinancialLogo = forwardRef13(
1541
1797
  className
1542
1798
  ].filter(Boolean).join(" ");
1543
1799
  return /* @__PURE__ */ jsxs13("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
1544
- /* @__PURE__ */ jsx13("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx13(DefaultIcon, { className: "h-20 w-20" }) }),
1800
+ /* @__PURE__ */ jsx14("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx14(DefaultIcon, { className: "h-20 w-20" }) }),
1545
1801
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
1546
- title && /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium leading-20", children: title }),
1547
- description && /* @__PURE__ */ jsx13("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
1802
+ title && /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium leading-20", children: title }),
1803
+ description && /* @__PURE__ */ jsx14("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
1548
1804
  children
1549
1805
  ] }),
1550
- action && /* @__PURE__ */ jsx13("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
1551
- onClose && /* @__PURE__ */ jsx13(
1806
+ action && /* @__PURE__ */ jsx14("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
1807
+ onClose && /* @__PURE__ */ jsx14(
1552
1808
  "button",
1553
1809
  {
1554
1810
  type: "button",
1555
1811
  onClick: onClose,
1556
1812
  className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
1557
1813
  "aria-label": "Close",
1558
- children: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-16 w-16" })
1814
+ children: /* @__PURE__ */ jsx14(CloseIcon4, { className: "h-16 w-16" })
1559
1815
  }
1560
1816
  )
1561
1817
  ] }));
@@ -1564,9 +1820,9 @@ var FinancialLogo = forwardRef13(
1564
1820
  FinancialLogo.displayName = "FinancialLogo";
1565
1821
 
1566
1822
  // src/components/Icon/Icon.tsx
1567
- import { forwardRef as forwardRef14 } from "react";
1568
- import { jsx as jsx14 } from "react/jsx-runtime";
1569
- var Icon = forwardRef14(
1823
+ import { forwardRef as forwardRef15 } from "react";
1824
+ import { jsx as jsx15 } from "react/jsx-runtime";
1825
+ var Icon = forwardRef15(
1570
1826
  (_a, ref) => {
1571
1827
  var _b = _a, {
1572
1828
  name,
@@ -1594,7 +1850,7 @@ var Icon = forwardRef14(
1594
1850
  "material-symbols-outlined select-none shrink-0 inline-block leading-none",
1595
1851
  className
1596
1852
  ].filter(Boolean).join(" ");
1597
- return /* @__PURE__ */ jsx14(
1853
+ return /* @__PURE__ */ jsx15(
1598
1854
  "span",
1599
1855
  __spreadProps(__spreadValues({
1600
1856
  ref,
@@ -1617,8 +1873,8 @@ var Icon = forwardRef14(
1617
1873
  Icon.displayName = "Icon";
1618
1874
 
1619
1875
  // src/components/Link/Link.tsx
1620
- import { forwardRef as forwardRef15 } from "react";
1621
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1876
+ import { forwardRef as forwardRef16 } from "react";
1877
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1622
1878
  var linkStyleClasses = {
1623
1879
  brand: "font-sans text-link-text-enabled",
1624
1880
  white: "font-sans text-link-text-enabled-inverse",
@@ -1641,11 +1897,11 @@ var iconVariantClasses = {
1641
1897
  };
1642
1898
  function SuccessIcon3({ className }) {
1643
1899
  return /* @__PURE__ */ jsxs14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
1644
- /* @__PURE__ */ jsx15("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
1645
- /* @__PURE__ */ jsx15("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1900
+ /* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
1901
+ /* @__PURE__ */ jsx16("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1646
1902
  ] });
1647
1903
  }
1648
- var Link = forwardRef15(
1904
+ var Link = forwardRef16(
1649
1905
  (_a, ref) => {
1650
1906
  var _b = _a, {
1651
1907
  variant = "sm",
@@ -1677,8 +1933,8 @@ var Link = forwardRef15(
1677
1933
  className
1678
1934
  ].filter(Boolean).join(" ");
1679
1935
  return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
1680
- /* @__PURE__ */ jsx15("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
1681
- icon && !isInline ? /* @__PURE__ */ jsx15(SuccessIcon3, { className: iconClass }) : null
1936
+ /* @__PURE__ */ jsx16("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
1937
+ icon && !isInline ? /* @__PURE__ */ jsx16(SuccessIcon3, { className: iconClass }) : null
1682
1938
  ] }));
1683
1939
  }
1684
1940
  );
@@ -1686,11 +1942,11 @@ Link.displayName = "Link";
1686
1942
 
1687
1943
  // src/components/Radio/Radio.tsx
1688
1944
  import {
1689
- forwardRef as forwardRef16,
1690
- useId as useId3
1945
+ forwardRef as forwardRef17,
1946
+ useId as useId4
1691
1947
  } from "react";
1692
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1693
- var Radio = forwardRef16(
1948
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
1949
+ var Radio = forwardRef17(
1694
1950
  (_a, ref) => {
1695
1951
  var _b = _a, {
1696
1952
  size = "sm",
@@ -1715,9 +1971,9 @@ var Radio = forwardRef16(
1715
1971
  "id",
1716
1972
  "name"
1717
1973
  ]);
1718
- const reactId = useId3();
1974
+ const reactId = useId4();
1719
1975
  const inputId = id != null ? id : reactId;
1720
- return /* @__PURE__ */ jsx16(
1976
+ return /* @__PURE__ */ jsx17(
1721
1977
  "div",
1722
1978
  {
1723
1979
  className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
@@ -1728,7 +1984,7 @@ var Radio = forwardRef16(
1728
1984
  className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
1729
1985
  children: [
1730
1986
  /* @__PURE__ */ jsxs15("div", { children: [
1731
- /* @__PURE__ */ jsx16(
1987
+ /* @__PURE__ */ jsx17(
1732
1988
  "input",
1733
1989
  __spreadValues({
1734
1990
  ref,
@@ -1741,14 +1997,14 @@ var Radio = forwardRef16(
1741
1997
  name
1742
1998
  }, rest)
1743
1999
  ),
1744
- /* @__PURE__ */ jsx16(
2000
+ /* @__PURE__ */ jsx17(
1745
2001
  "div",
1746
2002
  {
1747
2003
  className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
1748
2004
  ${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
1749
2005
  ${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
1750
2006
  `,
1751
- children: /* @__PURE__ */ jsx16(
2007
+ children: /* @__PURE__ */ jsx17(
1752
2008
  "span",
1753
2009
  {
1754
2010
  className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
@@ -1764,7 +2020,7 @@ var Radio = forwardRef16(
1764
2020
  {
1765
2021
  className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
1766
2022
  children: [
1767
- /* @__PURE__ */ jsx16(
2023
+ /* @__PURE__ */ jsx17(
1768
2024
  "p",
1769
2025
  {
1770
2026
  className: `
@@ -1774,7 +2030,7 @@ var Radio = forwardRef16(
1774
2030
  children: label
1775
2031
  }
1776
2032
  ),
1777
- /* @__PURE__ */ jsx16(
2033
+ /* @__PURE__ */ jsx17(
1778
2034
  "p",
1779
2035
  {
1780
2036
  className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
@@ -1795,19 +2051,19 @@ Radio.displayName = "Radio";
1795
2051
 
1796
2052
  // src/components/SegmentControl/SegmentControl.tsx
1797
2053
  import {
1798
- forwardRef as forwardRef17
2054
+ forwardRef as forwardRef18
1799
2055
  } from "react";
1800
- import { jsx as jsx17 } from "react/jsx-runtime";
1801
- var SegmentControl = forwardRef17(
2056
+ import { jsx as jsx18 } from "react/jsx-runtime";
2057
+ var SegmentControl = forwardRef18(
1802
2058
  (_a, ref) => {
1803
2059
  var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
1804
- return /* @__PURE__ */ jsx17(
2060
+ return /* @__PURE__ */ jsx18(
1805
2061
  "div",
1806
2062
  __spreadProps(__spreadValues({
1807
2063
  ref,
1808
2064
  className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
1809
2065
  }, rest), {
1810
- children: items.map((item) => /* @__PURE__ */ jsx17(
2066
+ children: items.map((item) => /* @__PURE__ */ jsx18(
1811
2067
  "div",
1812
2068
  {
1813
2069
  onClick: () => setSelected == null ? void 0 : setSelected(item.value),
@@ -1825,12 +2081,12 @@ SegmentControl.displayName = "SegmentControl";
1825
2081
 
1826
2082
  // src/components/Slider/Slider.tsx
1827
2083
  import {
1828
- forwardRef as forwardRef18,
1829
- useCallback as useCallback4,
1830
- useId as useId4,
2084
+ forwardRef as forwardRef19,
2085
+ useCallback as useCallback2,
2086
+ useId as useId5,
1831
2087
  useState as useState8
1832
2088
  } from "react";
1833
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2089
+ import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
1834
2090
  var sizeConfig = {
1835
2091
  small: {
1836
2092
  trackH: "h-4",
@@ -1871,7 +2127,7 @@ function ChevronGlyphs({ size, color }) {
1871
2127
  xmlns: "http://www.w3.org/2000/svg",
1872
2128
  "aria-hidden": "true",
1873
2129
  children: [
1874
- /* @__PURE__ */ jsx18(
2130
+ /* @__PURE__ */ jsx19(
1875
2131
  "path",
1876
2132
  {
1877
2133
  d: "M4.75 3.25L2.25 6L4.75 8.75",
@@ -1881,7 +2137,7 @@ function ChevronGlyphs({ size, color }) {
1881
2137
  strokeLinejoin: "round"
1882
2138
  }
1883
2139
  ),
1884
- /* @__PURE__ */ jsx18(
2140
+ /* @__PURE__ */ jsx19(
1885
2141
  "path",
1886
2142
  {
1887
2143
  d: "M7.25 3.25L9.75 6L7.25 8.75",
@@ -1895,7 +2151,7 @@ function ChevronGlyphs({ size, color }) {
1895
2151
  }
1896
2152
  );
1897
2153
  }
1898
- var Slider = forwardRef18(
2154
+ var Slider = forwardRef19(
1899
2155
  (_a, ref) => {
1900
2156
  var _b = _a, {
1901
2157
  size = "medium",
@@ -1930,7 +2186,7 @@ var Slider = forwardRef18(
1930
2186
  "onChange",
1931
2187
  "aria-label"
1932
2188
  ]);
1933
- const reactId = useId4();
2189
+ const reactId = useId5();
1934
2190
  const inputId = id != null ? id : reactId;
1935
2191
  const sz = sizeConfig[size];
1936
2192
  const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
@@ -1938,7 +2194,7 @@ var Slider = forwardRef18(
1938
2194
  const isControlled = controlledValue !== void 0;
1939
2195
  const [internalValue, setInternalValue] = useState8(defaultValue != null ? defaultValue : min);
1940
2196
  const currentValue = isControlled ? controlledValue : internalValue;
1941
- const handleChange = useCallback4(
2197
+ const handleChange = useCallback2(
1942
2198
  (e) => {
1943
2199
  const val = Number(e.target.value);
1944
2200
  if (!isControlled) {
@@ -1964,7 +2220,7 @@ var Slider = forwardRef18(
1964
2220
  className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
1965
2221
  children: [
1966
2222
  (label || showValue && !disabled) && /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
1967
- label && /* @__PURE__ */ jsx18(
2223
+ label && /* @__PURE__ */ jsx19(
1968
2224
  "label",
1969
2225
  {
1970
2226
  htmlFor: inputId,
@@ -1977,7 +2233,7 @@ var Slider = forwardRef18(
1977
2233
  children: label
1978
2234
  }
1979
2235
  ),
1980
- showValue && /* @__PURE__ */ jsx18(
2236
+ showValue && /* @__PURE__ */ jsx19(
1981
2237
  "span",
1982
2238
  {
1983
2239
  className: [sz.description, "tabular-nums", labelColor].join(" "),
@@ -1994,7 +2250,7 @@ var Slider = forwardRef18(
1994
2250
  disabled ? "cursor-not-allowed" : "cursor-pointer"
1995
2251
  ].join(" "),
1996
2252
  children: [
1997
- /* @__PURE__ */ jsx18(
2253
+ /* @__PURE__ */ jsx19(
1998
2254
  "div",
1999
2255
  {
2000
2256
  className: [
@@ -2004,14 +2260,14 @@ var Slider = forwardRef18(
2004
2260
  ].join(" ")
2005
2261
  }
2006
2262
  ),
2007
- /* @__PURE__ */ jsx18(
2263
+ /* @__PURE__ */ jsx19(
2008
2264
  "div",
2009
2265
  {
2010
2266
  className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
2011
2267
  style: { width: `calc(${percent}% + ${fillOffset}px)` }
2012
2268
  }
2013
2269
  ),
2014
- /* @__PURE__ */ jsx18(
2270
+ /* @__PURE__ */ jsx19(
2015
2271
  "input",
2016
2272
  __spreadValues({
2017
2273
  ref,
@@ -2032,7 +2288,7 @@ var Slider = forwardRef18(
2032
2288
  ].join(" ")
2033
2289
  }, rest)
2034
2290
  ),
2035
- /* @__PURE__ */ jsx18(
2291
+ /* @__PURE__ */ jsx19(
2036
2292
  "div",
2037
2293
  {
2038
2294
  className: [
@@ -2045,13 +2301,13 @@ var Slider = forwardRef18(
2045
2301
  !disabled && "peer-hover:shadow-medium"
2046
2302
  ].filter(Boolean).join(" "),
2047
2303
  style: { left: `calc(${percent}% - ${thumbOffset}px)` },
2048
- children: /* @__PURE__ */ jsx18(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
2304
+ children: /* @__PURE__ */ jsx19(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
2049
2305
  }
2050
2306
  )
2051
2307
  ]
2052
2308
  }
2053
2309
  ),
2054
- description && /* @__PURE__ */ jsx18(
2310
+ description && /* @__PURE__ */ jsx19(
2055
2311
  "span",
2056
2312
  {
2057
2313
  id: ariaDescriptionId,
@@ -2067,9 +2323,9 @@ var Slider = forwardRef18(
2067
2323
  Slider.displayName = "Slider";
2068
2324
 
2069
2325
  // src/components/Tab/Tab.tsx
2070
- import { forwardRef as forwardRef19 } from "react";
2071
- import { jsx as jsx19 } from "react/jsx-runtime";
2072
- var Tab = forwardRef19(
2326
+ import { forwardRef as forwardRef20 } from "react";
2327
+ import { jsx as jsx20 } from "react/jsx-runtime";
2328
+ var Tab = forwardRef20(
2073
2329
  (_a, ref) => {
2074
2330
  var _b = _a, {
2075
2331
  size = "md",
@@ -2088,7 +2344,7 @@ var Tab = forwardRef19(
2088
2344
  "setSelected",
2089
2345
  "className"
2090
2346
  ]);
2091
- return /* @__PURE__ */ jsx19(
2347
+ return /* @__PURE__ */ jsx20(
2092
2348
  "div",
2093
2349
  __spreadProps(__spreadValues({
2094
2350
  ref,
@@ -2108,140 +2364,180 @@ Tab.displayName = "Tab";
2108
2364
  // src/components/TextArea/TextArea.tsx
2109
2365
  import {
2110
2366
  useState as useState9,
2111
- forwardRef as forwardRef20
2367
+ forwardRef as forwardRef21
2112
2368
  } from "react";
2113
- import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
2114
- var TextArea = forwardRef20(
2369
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2370
+ var TextArea = forwardRef21(
2115
2371
  (_a, ref) => {
2116
2372
  var _b = _a, {
2117
- maxText = 500,
2118
- height = 100,
2119
2373
  error,
2120
2374
  label,
2121
2375
  placeholder,
2122
- description,
2123
- icon,
2124
- isDisabled = false,
2125
- isLoading = false,
2126
- isVertify = false,
2127
- isClearable = true,
2128
- disabled,
2376
+ helperText,
2377
+ optional = false,
2378
+ success = false,
2379
+ pending = false,
2380
+ clearable = true,
2381
+ disabled = false,
2382
+ showCounter = true,
2383
+ maxLength = 500,
2384
+ height = 100,
2129
2385
  value,
2130
- onChange
2386
+ onChange,
2387
+ onFocus,
2388
+ onBlur,
2389
+ className
2131
2390
  } = _b, props = __objRest(_b, [
2132
- "maxText",
2133
- "height",
2134
2391
  "error",
2135
2392
  "label",
2136
2393
  "placeholder",
2137
- "description",
2138
- "icon",
2139
- "isDisabled",
2140
- "isLoading",
2141
- "isVertify",
2142
- "isClearable",
2394
+ "helperText",
2395
+ "optional",
2396
+ "success",
2397
+ "pending",
2398
+ "clearable",
2143
2399
  "disabled",
2400
+ "showCounter",
2401
+ "maxLength",
2402
+ "height",
2144
2403
  "value",
2145
- "onChange"
2404
+ "onChange",
2405
+ "onFocus",
2406
+ "onBlur",
2407
+ "className"
2146
2408
  ]);
2409
+ var _a2;
2147
2410
  const [isFocused, setIsFocused] = useState9(false);
2148
- return /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-col gap-4", children: [
2149
- /* @__PURE__ */ jsxs17("div", { className: "w-full flex justify-between items-center ", children: [
2150
- label ? /* @__PURE__ */ jsx20(
2411
+ const isActive = isFocused && !!value;
2412
+ return /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
2413
+ label || showCounter ? /* @__PURE__ */ jsxs17("div", { className: "w-full flex justify-between items-center gap-8", children: [
2414
+ label ? /* @__PURE__ */ jsxs17(
2151
2415
  "p",
2152
2416
  {
2153
- className: `text-label-medium text-left items-left ${isDisabled || disabled ? "text-gray-400" : "text-gray-900"}`,
2154
- children: label
2417
+ className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
2418
+ children: [
2419
+ label,
2420
+ optional && /* @__PURE__ */ jsx21("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
2421
+ ]
2155
2422
  }
2156
- ) : /* @__PURE__ */ jsx20(Fragment3, {}),
2157
- maxText ? /* @__PURE__ */ jsxs17("p", { className: "text-gray-400 text-caption-caption", children: [
2158
- " ",
2159
- (value == null ? void 0 : value.length) || 0,
2160
- " / ",
2161
- maxText
2162
- ] }) : /* @__PURE__ */ jsx20(Fragment3, {})
2163
- ] }),
2164
- /* @__PURE__ */ jsxs17("div", { className: "relative w-full", children: [
2165
- /* @__PURE__ */ jsx20(
2166
- "textarea",
2167
- __spreadValues({
2168
- ref,
2169
- name: "text-input",
2170
- placeholder,
2171
- disabled: isDisabled || disabled || isLoading,
2172
- onFocus: () => setIsFocused(true),
2173
- onBlur: () => setIsFocused(false),
2174
- value,
2175
- onChange,
2176
- className: `w-full min-h-${height} focus:min-h-${height - 2} pt-12 pb-8 pr-44 pl-16 focus:pt-11 focus:pb-7 focus:pr-43 focus:pl-15 border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
2177
- }, props)
2178
- ),
2179
- isLoading ? /* @__PURE__ */ jsx20(
2180
- Loading,
2423
+ ) : /* @__PURE__ */ jsx21("span", {}),
2424
+ showCounter && /* @__PURE__ */ jsxs17(
2425
+ "p",
2181
2426
  {
2182
- size: "sm",
2183
- className: `absolute right-12 top-12`
2427
+ className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
2428
+ children: [
2429
+ (_a2 = value == null ? void 0 : value.length) != null ? _a2 : 0,
2430
+ "/",
2431
+ maxLength
2432
+ ]
2184
2433
  }
2185
- ) : isClearable && isFocused && value ? /* @__PURE__ */ jsx20(
2186
- "svg",
2187
- {
2188
- xmlns: "http://www.w3.org/2000/svg",
2189
- width: "20",
2190
- height: "20",
2191
- viewBox: "0 0 20 20",
2192
- fill: "none",
2193
- className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
2194
- onMouseDown: (e) => {
2195
- e.preventDefault();
2196
- onChange == null ? void 0 : onChange({ target: { value: "" } });
2197
- },
2198
- children: /* @__PURE__ */ jsx20(
2199
- "path",
2434
+ )
2435
+ ] }) : /* @__PURE__ */ jsx21(Fragment5, {}),
2436
+ /* @__PURE__ */ jsxs17(
2437
+ "div",
2438
+ {
2439
+ className: `relative w-full rounded-6 border ${disabled ? "bg-text-area-background-disabled border-text-area-border-disabled" : error ? `bg-text-area-background-enabled border-text-area-border-danger ${isFocused ? "ring-1 ring-inset ring-text-area-border-danger" : ""}` : isActive ? "bg-text-area-background-enabled border-text-area-border-active ring-1 ring-inset ring-text-area-border-active" : isFocused ? "bg-text-area-background-enabled border-text-area-border-focus ring-1 ring-inset ring-text-area-border-focus" : "bg-text-area-background-enabled border-text-area-border-enabled hover:border-text-area-border-hover"} ${className != null ? className : ""}`,
2440
+ children: [
2441
+ /* @__PURE__ */ jsx21(
2442
+ "textarea",
2443
+ __spreadValues({
2444
+ ref,
2445
+ placeholder,
2446
+ disabled: disabled || pending,
2447
+ maxLength,
2448
+ style: { height },
2449
+ onFocus: (e) => {
2450
+ setIsFocused(true);
2451
+ onFocus == null ? void 0 : onFocus(e);
2452
+ },
2453
+ onBlur: (e) => {
2454
+ setIsFocused(false);
2455
+ onBlur == null ? void 0 : onBlur(e);
2456
+ },
2457
+ value,
2458
+ onChange,
2459
+ className: `block w-full min-w-0 pt-12 pb-8 pl-16 pr-48 text-body-small bg-transparent focus:outline-none placeholder:text-text-area-text-tertiary ${disabled ? "resize-none text-text-area-text-disabled" : "resize-y text-text-area-text-primary"}`
2460
+ }, props)
2461
+ ),
2462
+ pending ? /* @__PURE__ */ jsx21(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx21(
2463
+ IconButton,
2200
2464
  {
2201
- d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
2202
- fill: "#111827"
2465
+ size: "s",
2466
+ "aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
2467
+ className: "absolute right-6 top-6",
2468
+ icon: /* @__PURE__ */ jsx21(
2469
+ "svg",
2470
+ {
2471
+ xmlns: "http://www.w3.org/2000/svg",
2472
+ width: "20",
2473
+ height: "20",
2474
+ viewBox: "0 0 20 20",
2475
+ fill: "none",
2476
+ children: /* @__PURE__ */ jsx21(
2477
+ "path",
2478
+ {
2479
+ d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
2480
+ fill: "currentColor"
2481
+ }
2482
+ )
2483
+ }
2484
+ ),
2485
+ onMouseDown: (e) => {
2486
+ e.preventDefault();
2487
+ },
2488
+ onClick: () => {
2489
+ onChange == null ? void 0 : onChange({
2490
+ target: { value: "" }
2491
+ });
2492
+ }
2203
2493
  }
2204
- )
2205
- }
2206
- ) : isVertify ? /* @__PURE__ */ jsx20(
2207
- "svg",
2208
- {
2209
- xmlns: "http://www.w3.org/2000/svg",
2210
- width: "20",
2211
- height: "20",
2212
- viewBox: "0 0 20 20",
2213
- fill: "none",
2214
- className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
2215
- children: /* @__PURE__ */ jsx20(
2216
- "path",
2494
+ ) : success ? /* @__PURE__ */ jsx21(
2495
+ "svg",
2217
2496
  {
2218
- fillRule: "evenodd",
2219
- clipRule: "evenodd",
2220
- d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
2221
- fill: "#16A34A"
2497
+ xmlns: "http://www.w3.org/2000/svg",
2498
+ width: "20",
2499
+ height: "20",
2500
+ viewBox: "0 0 20 20",
2501
+ fill: "none",
2502
+ className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
2503
+ children: /* @__PURE__ */ jsx21(
2504
+ "path",
2505
+ {
2506
+ fillRule: "evenodd",
2507
+ clipRule: "evenodd",
2508
+ d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
2509
+ fill: "currentColor"
2510
+ }
2511
+ )
2222
2512
  }
2223
- )
2224
- }
2225
- ) : error ? /* @__PURE__ */ jsx20(
2226
- "svg",
2227
- {
2228
- xmlns: "http://www.w3.org/2000/svg",
2229
- width: "20",
2230
- height: "20",
2231
- viewBox: "0 0 20 20",
2232
- fill: "none",
2233
- className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
2234
- children: /* @__PURE__ */ jsx20(
2235
- "path",
2513
+ ) : error ? /* @__PURE__ */ jsx21(
2514
+ "svg",
2236
2515
  {
2237
- d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
2238
- fill: "#EF4444"
2516
+ xmlns: "http://www.w3.org/2000/svg",
2517
+ width: "20",
2518
+ height: "20",
2519
+ viewBox: "0 0 20 20",
2520
+ fill: "none",
2521
+ className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
2522
+ children: /* @__PURE__ */ jsx21(
2523
+ "path",
2524
+ {
2525
+ d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
2526
+ fill: "currentColor"
2527
+ }
2528
+ )
2239
2529
  }
2240
- )
2241
- }
2242
- ) : /* @__PURE__ */ jsx20(Fragment3, {})
2243
- ] }),
2244
- error ? /* @__PURE__ */ jsx20("p", { className: "text-caption-caption text-left items-left text-red-600", children: error }) : description ? /* @__PURE__ */ jsx20("p", { className: "text-caption-caption text-left items-left text-gray-600", children: description }) : /* @__PURE__ */ jsx20(Fragment3, {})
2530
+ ) : /* @__PURE__ */ jsx21(Fragment5, {})
2531
+ ]
2532
+ }
2533
+ ),
2534
+ error ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx21(
2535
+ "p",
2536
+ {
2537
+ className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
2538
+ children: helperText
2539
+ }
2540
+ ) : /* @__PURE__ */ jsx21(Fragment5, {})
2245
2541
  ] });
2246
2542
  }
2247
2543
  );
@@ -2250,164 +2546,223 @@ TextArea.displayName = "TextArea";
2250
2546
  // src/components/TextField/TextField.tsx
2251
2547
  import {
2252
2548
  useState as useState10,
2253
- forwardRef as forwardRef21
2549
+ useRef as useRef2,
2550
+ useImperativeHandle,
2551
+ forwardRef as forwardRef22
2254
2552
  } from "react";
2255
- import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
2256
- var TextField = forwardRef21(
2553
+ import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
2554
+ var TextField = forwardRef22(
2257
2555
  (_a, ref) => {
2258
2556
  var _b = _a, {
2259
- inputSize,
2557
+ size = "md",
2260
2558
  error,
2261
2559
  label,
2262
2560
  placeholder,
2263
- description,
2264
- icon,
2265
- isDisabled = false,
2266
- isLoading = false,
2267
- isVertify = false,
2268
- isUnrequired = false,
2269
- isClearable = true,
2270
- disabled,
2561
+ helperText,
2562
+ prefix,
2563
+ suffix,
2564
+ optional = false,
2565
+ success = false,
2566
+ pending = false,
2567
+ clearable = true,
2568
+ disabled = false,
2271
2569
  type,
2272
2570
  value,
2273
- onChange
2571
+ onChange,
2572
+ onFocus,
2573
+ onBlur,
2574
+ className
2274
2575
  } = _b, props = __objRest(_b, [
2275
- "inputSize",
2576
+ "size",
2276
2577
  "error",
2277
2578
  "label",
2278
2579
  "placeholder",
2279
- "description",
2280
- "icon",
2281
- "isDisabled",
2282
- "isLoading",
2283
- "isVertify",
2284
- "isUnrequired",
2285
- "isClearable",
2580
+ "helperText",
2581
+ "prefix",
2582
+ "suffix",
2583
+ "optional",
2584
+ "success",
2585
+ "pending",
2586
+ "clearable",
2286
2587
  "disabled",
2287
2588
  "type",
2288
2589
  "value",
2289
- "onChange"
2590
+ "onChange",
2591
+ "onFocus",
2592
+ "onBlur",
2593
+ "className"
2290
2594
  ]);
2291
2595
  const [isFocused, setIsFocused] = useState10(false);
2292
- return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4", children: [
2596
+ const isActive = isFocused && !!value;
2597
+ const iconButtonSize = size === "lg" ? "m" : "s";
2598
+ const inputRef = useRef2(null);
2599
+ useImperativeHandle(ref, () => inputRef.current);
2600
+ return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
2293
2601
  label ? /* @__PURE__ */ jsxs18(
2294
2602
  "p",
2295
2603
  {
2296
- className: `text-label-medium text-left items-left ${isDisabled || disabled ? "text-gray-400" : "text-gray-900"}`,
2604
+ className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
2297
2605
  children: [
2298
2606
  label,
2299
- " ",
2300
- isUnrequired && /* @__PURE__ */ jsx21("span", { className: "text-gray-400", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
2607
+ optional && /* @__PURE__ */ jsx22("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
2301
2608
  ]
2302
2609
  }
2303
- ) : /* @__PURE__ */ jsx21(Fragment4, {}),
2304
- /* @__PURE__ */ jsxs18("div", { className: "relative w-full", children: [
2305
- icon && icon,
2306
- /* @__PURE__ */ jsx21(
2307
- "input",
2308
- __spreadValues({
2309
- ref,
2310
- type: type || "text",
2311
- placeholder,
2312
- disabled: isDisabled || disabled || isLoading,
2313
- onFocus: () => setIsFocused(true),
2314
- onBlur: () => setIsFocused(false),
2315
- value,
2316
- onChange,
2317
- className: `w-full ${icon ? "pl-40 focus:pl-39" : "pl-16 focus:pl-15"} pr-16 focus:pr-15 ${inputSize === "md" ? "py-8 focus:py-7" : "py-12 focus:py-11"} border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
2318
- }, props)
2319
- ),
2320
- isLoading ? /* @__PURE__ */ jsx21(
2321
- Loading,
2322
- {
2323
- size: "sm",
2324
- className: `absolute right-16 top-1/2 -translate-y-1/2`
2325
- }
2326
- ) : isClearable && isFocused && value ? /* @__PURE__ */ jsx21(
2327
- "svg",
2328
- {
2329
- xmlns: "http://www.w3.org/2000/svg",
2330
- width: "20",
2331
- height: "20",
2332
- viewBox: "0 0 20 20",
2333
- fill: "none",
2334
- className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
2335
- onMouseDown: (e) => {
2610
+ ) : /* @__PURE__ */ jsx22(Fragment6, {}),
2611
+ /* @__PURE__ */ jsxs18(
2612
+ "div",
2613
+ {
2614
+ className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
2615
+ onMouseDown: (e) => {
2616
+ var _a2;
2617
+ if (e.target !== inputRef.current && !disabled) {
2336
2618
  e.preventDefault();
2337
- onChange == null ? void 0 : onChange({ target: { value: "" } });
2338
- },
2339
- children: /* @__PURE__ */ jsx21(
2340
- "path",
2619
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2620
+ }
2621
+ },
2622
+ children: [
2623
+ prefix && /* @__PURE__ */ jsx22(
2624
+ "span",
2341
2625
  {
2342
- d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
2343
- fill: "#111827"
2626
+ className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
2627
+ children: prefix
2344
2628
  }
2345
- )
2346
- }
2347
- ) : isVertify ? /* @__PURE__ */ jsx21(
2348
- "svg",
2349
- {
2350
- xmlns: "http://www.w3.org/2000/svg",
2351
- width: "20",
2352
- height: "20",
2353
- viewBox: "0 0 20 20",
2354
- fill: "none",
2355
- className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
2356
- children: /* @__PURE__ */ jsx21(
2357
- "path",
2629
+ ),
2630
+ /* @__PURE__ */ jsx22(
2631
+ "input",
2632
+ __spreadValues({
2633
+ ref: inputRef,
2634
+ type: type || "text",
2635
+ placeholder,
2636
+ disabled: disabled || pending,
2637
+ onFocus: (e) => {
2638
+ setIsFocused(true);
2639
+ onFocus == null ? void 0 : onFocus(e);
2640
+ },
2641
+ onBlur: (e) => {
2642
+ setIsFocused(false);
2643
+ onBlur == null ? void 0 : onBlur(e);
2644
+ },
2645
+ value,
2646
+ onChange,
2647
+ className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
2648
+ }, props)
2649
+ ),
2650
+ suffix && /* @__PURE__ */ jsx22(
2651
+ "span",
2358
2652
  {
2359
- fillRule: "evenodd",
2360
- clipRule: "evenodd",
2361
- d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
2362
- fill: "#16A34A"
2653
+ className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
2654
+ children: suffix
2363
2655
  }
2364
- )
2365
- }
2366
- ) : error ? /* @__PURE__ */ jsx21(
2367
- "svg",
2368
- {
2369
- xmlns: "http://www.w3.org/2000/svg",
2370
- width: "20",
2371
- height: "20",
2372
- viewBox: "0 0 20 20",
2373
- fill: "none",
2374
- className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
2375
- children: /* @__PURE__ */ jsx21(
2376
- "path",
2656
+ ),
2657
+ (pending || clearable || success || error) && /* @__PURE__ */ jsx22(
2658
+ "span",
2377
2659
  {
2378
- d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
2379
- fill: "#EF4444"
2660
+ className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
2661
+ children: pending ? /* @__PURE__ */ jsx22(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx22(
2662
+ IconButton,
2663
+ {
2664
+ size: iconButtonSize,
2665
+ "aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
2666
+ icon: /* @__PURE__ */ jsx22(
2667
+ "svg",
2668
+ {
2669
+ xmlns: "http://www.w3.org/2000/svg",
2670
+ width: "20",
2671
+ height: "20",
2672
+ viewBox: "0 0 20 20",
2673
+ fill: "none",
2674
+ children: /* @__PURE__ */ jsx22(
2675
+ "path",
2676
+ {
2677
+ d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
2678
+ fill: "currentColor"
2679
+ }
2680
+ )
2681
+ }
2682
+ ),
2683
+ onMouseDown: (e) => {
2684
+ e.preventDefault();
2685
+ },
2686
+ onClick: () => {
2687
+ onChange == null ? void 0 : onChange({
2688
+ target: { value: "" }
2689
+ });
2690
+ }
2691
+ }
2692
+ ) : success ? /* @__PURE__ */ jsx22(
2693
+ "svg",
2694
+ {
2695
+ xmlns: "http://www.w3.org/2000/svg",
2696
+ width: "20",
2697
+ height: "20",
2698
+ viewBox: "0 0 20 20",
2699
+ fill: "none",
2700
+ className: "text-accent-success flex h-20 w-20 items-center justify-center",
2701
+ children: /* @__PURE__ */ jsx22(
2702
+ "path",
2703
+ {
2704
+ fillRule: "evenodd",
2705
+ clipRule: "evenodd",
2706
+ d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
2707
+ fill: "currentColor"
2708
+ }
2709
+ )
2710
+ }
2711
+ ) : error ? /* @__PURE__ */ jsx22(
2712
+ "svg",
2713
+ {
2714
+ xmlns: "http://www.w3.org/2000/svg",
2715
+ width: "20",
2716
+ height: "20",
2717
+ viewBox: "0 0 20 20",
2718
+ fill: "none",
2719
+ className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
2720
+ children: /* @__PURE__ */ jsx22(
2721
+ "path",
2722
+ {
2723
+ d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
2724
+ fill: "currentColor"
2725
+ }
2726
+ )
2727
+ }
2728
+ ) : null
2380
2729
  }
2381
2730
  )
2382
- }
2383
- ) : /* @__PURE__ */ jsx21(Fragment4, {})
2384
- ] }),
2385
- error ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-red-600", children: error }) : description ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-gray-600", children: description }) : /* @__PURE__ */ jsx21(Fragment4, {})
2731
+ ]
2732
+ }
2733
+ ),
2734
+ error ? /* @__PURE__ */ jsx22("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx22(
2735
+ "p",
2736
+ {
2737
+ className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
2738
+ children: helperText
2739
+ }
2740
+ ) : /* @__PURE__ */ jsx22(Fragment6, {})
2386
2741
  ] });
2387
2742
  }
2388
2743
  );
2389
2744
  TextField.displayName = "TextField";
2390
2745
 
2391
2746
  // src/components/Toast/Toast.tsx
2392
- import { forwardRef as forwardRef22 } from "react";
2393
- import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
2747
+ import { forwardRef as forwardRef23 } from "react";
2748
+ import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
2394
2749
  function CheckCircleIcon({ className }) {
2395
2750
  return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
2396
- /* @__PURE__ */ jsx22("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
2397
- /* @__PURE__ */ jsx22("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
2751
+ /* @__PURE__ */ jsx23("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
2752
+ /* @__PURE__ */ jsx23("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
2398
2753
  ] });
2399
2754
  }
2400
2755
  function ProgressIcon({ className }) {
2401
- return /* @__PURE__ */ jsx22(Loading, { size: "sm", className });
2756
+ return /* @__PURE__ */ jsx23(Loading, { size: "sm", className });
2402
2757
  }
2403
2758
  function ErrorIcon({ className }) {
2404
2759
  return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
2405
- /* @__PURE__ */ jsx22("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
2406
- /* @__PURE__ */ jsx22("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
2760
+ /* @__PURE__ */ jsx23("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
2761
+ /* @__PURE__ */ jsx23("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
2407
2762
  ] });
2408
2763
  }
2409
- function CloseIcon3({ className }) {
2410
- return /* @__PURE__ */ jsx22("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx22("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
2764
+ function CloseIcon5({ className }) {
2765
+ return /* @__PURE__ */ jsx23("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx23("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
2411
2766
  }
2412
2767
  var defaultIcons3 = {
2413
2768
  default: CheckCircleIcon,
@@ -2424,7 +2779,7 @@ var iconColorClasses = {
2424
2779
  progress: "text-toast-progress-icon",
2425
2780
  error: "text-toast-error-icon"
2426
2781
  };
2427
- var Toast = forwardRef22(
2782
+ var Toast = forwardRef23(
2428
2783
  (_a, ref) => {
2429
2784
  var _b = _a, {
2430
2785
  type = "default",
@@ -2453,9 +2808,9 @@ var Toast = forwardRef22(
2453
2808
  className
2454
2809
  ].filter(Boolean).join(" ");
2455
2810
  return /* @__PURE__ */ jsxs19("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
2456
- icon && /* @__PURE__ */ jsx22("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx22(DefaultIcon, { className: "h-20 w-20" }) }),
2457
- /* @__PURE__ */ jsx22("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
2458
- actionLabel && onAction && /* @__PURE__ */ jsx22(
2811
+ icon && /* @__PURE__ */ jsx23("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx23(DefaultIcon, { className: "h-20 w-20" }) }),
2812
+ /* @__PURE__ */ jsx23("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
2813
+ actionLabel && onAction && /* @__PURE__ */ jsx23(
2459
2814
  "button",
2460
2815
  {
2461
2816
  type: "button",
@@ -2464,14 +2819,14 @@ var Toast = forwardRef22(
2464
2819
  children: actionLabel
2465
2820
  }
2466
2821
  ),
2467
- onDismiss && /* @__PURE__ */ jsx22(
2822
+ onDismiss && /* @__PURE__ */ jsx23(
2468
2823
  "button",
2469
2824
  {
2470
2825
  type: "button",
2471
2826
  onClick: onDismiss,
2472
2827
  className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
2473
2828
  "aria-label": "Dismiss",
2474
- children: /* @__PURE__ */ jsx22(CloseIcon3, { className: "h-16 w-16" })
2829
+ children: /* @__PURE__ */ jsx23(CloseIcon5, { className: "h-16 w-16" })
2475
2830
  }
2476
2831
  )
2477
2832
  ] }));
@@ -2480,9 +2835,9 @@ var Toast = forwardRef22(
2480
2835
  Toast.displayName = "Toast";
2481
2836
 
2482
2837
  // src/components/ToggleSwitch/ToggleSwitch.tsx
2483
- import { forwardRef as forwardRef23 } from "react";
2484
- import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
2485
- var ToggleSwitch = forwardRef23(
2838
+ import { forwardRef as forwardRef24 } from "react";
2839
+ import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
2840
+ var ToggleSwitch = forwardRef24(
2486
2841
  (_a, ref) => {
2487
2842
  var _b = _a, {
2488
2843
  value,
@@ -2504,7 +2859,7 @@ var ToggleSwitch = forwardRef23(
2504
2859
  className: `inline-flex items-center ${className}`
2505
2860
  }, rest), {
2506
2861
  children: [
2507
- /* @__PURE__ */ jsx23(
2862
+ /* @__PURE__ */ jsx24(
2508
2863
  "input",
2509
2864
  {
2510
2865
  type: "checkbox",
@@ -2514,7 +2869,7 @@ var ToggleSwitch = forwardRef23(
2514
2869
  onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
2515
2870
  }
2516
2871
  ),
2517
- /* @__PURE__ */ jsx23(
2872
+ /* @__PURE__ */ jsx24(
2518
2873
  "div",
2519
2874
  {
2520
2875
  className: `${isDisabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer hover:bg-gray-300 hover:peer-checked:bg-green-700"} relative w-48 h-26 bg-gray-200 rounded-full peer-checked:after:translate-x-22 rtl:peer-checked:after:-translate-x-22 peer-checked:after:border-white after:content-[''] after:absolute after:top-4 after:left-4 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-18 after:w-18 after:transition-all peer-checked:bg-green-600 `
@@ -2530,12 +2885,12 @@ ToggleSwitch.displayName = "ToggleSwitch";
2530
2885
  // src/components/Tooltip/Tooltip.tsx
2531
2886
  import {
2532
2887
  useState as useState11,
2533
- useEffect as useEffect6,
2534
- useRef as useRef4,
2535
- forwardRef as forwardRef24
2888
+ useEffect as useEffect4,
2889
+ useRef as useRef3,
2890
+ forwardRef as forwardRef25
2536
2891
  } from "react";
2537
- import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
2538
- var Tooltip = forwardRef24(
2892
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
2893
+ var Tooltip = forwardRef25(
2539
2894
  (_a, ref) => {
2540
2895
  var _b = _a, {
2541
2896
  size = "md",
@@ -2552,10 +2907,10 @@ var Tooltip = forwardRef24(
2552
2907
  "position",
2553
2908
  "className"
2554
2909
  ]);
2555
- const wrapperRef = useRef4(null);
2910
+ const wrapperRef = useRef3(null);
2556
2911
  const [isVisible, setIsVisible] = useState11(false);
2557
2912
  const [isHovered, setIsHovered] = useState11(false);
2558
- useEffect6(() => {
2913
+ useEffect4(() => {
2559
2914
  const handleClickOutside = (event) => {
2560
2915
  if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
2561
2916
  setIsVisible(false);
@@ -2574,7 +2929,7 @@ var Tooltip = forwardRef24(
2574
2929
  ref
2575
2930
  }, rest), {
2576
2931
  children: [
2577
- /* @__PURE__ */ jsx24(
2932
+ /* @__PURE__ */ jsx25(
2578
2933
  "div",
2579
2934
  {
2580
2935
  ref: wrapperRef,
@@ -2596,20 +2951,20 @@ var Tooltip = forwardRef24(
2596
2951
  {
2597
2952
  className: `min-w-100 max-w-300 whitespace-nowrap rounded bg-gray-900 text-white ${size === "lg" ? "text-body-regular py-12 px-16" : size === "md" ? "text-body-small px-12 pt-10 pb-8" : "text-body-small px-8 pt-6 pb-4"} ${position === "right" && `absolute left-full top-1/2 z-20 ml-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "top" && `absolute bottom-full left-1/2 z-20 mb-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "left" && `absolute right-full top-1/2 z-20 mr-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "bottom" && `absolute left-1/2 top-full z-20 mt-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}`}`,
2598
2953
  children: [
2599
- /* @__PURE__ */ jsx24(
2954
+ /* @__PURE__ */ jsx25(
2600
2955
  "span",
2601
2956
  {
2602
2957
  className: ` ${position === "right" && `absolute -left-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "top" && `absolute -bottom-3 left-1/2 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black` || position === "left" && `absolute -right-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "bottom" && `absolute left-1/2 -top-3 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black`} `
2603
2958
  }
2604
2959
  ),
2605
- headText ? /* @__PURE__ */ jsx24(
2960
+ headText ? /* @__PURE__ */ jsx25(
2606
2961
  "p",
2607
2962
  {
2608
2963
  className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
2609
2964
  children: headText
2610
2965
  }
2611
- ) : /* @__PURE__ */ jsx24(Fragment5, {}),
2612
- text ? /* @__PURE__ */ jsx24("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx24(Fragment5, {})
2966
+ ) : /* @__PURE__ */ jsx25(Fragment7, {}),
2967
+ text ? /* @__PURE__ */ jsx25("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx25(Fragment7, {})
2613
2968
  ]
2614
2969
  }
2615
2970
  )
@@ -2624,15 +2979,16 @@ export {
2624
2979
  AlertBanner,
2625
2980
  Avatar,
2626
2981
  Badge,
2627
- BottomSheet,
2628
2982
  Branding,
2629
2983
  Button,
2630
2984
  Checkbox,
2631
2985
  Chip,
2632
2986
  Dialog,
2987
+ Drawer,
2633
2988
  Dropdown,
2634
2989
  FinancialLogo,
2635
2990
  Icon,
2991
+ IconButton,
2636
2992
  Link,
2637
2993
  Loading,
2638
2994
  Radio,