sprint-asia-custom-component 0.1.91 → 0.1.93

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
@@ -28891,7 +28891,7 @@
28891
28891
  as: "div",
28892
28892
  className: "relative z-10",
28893
28893
  initialFocus: cancelButtonRef,
28894
- onClose: () => props.onClose,
28894
+ onClose: () => props.onClose(),
28895
28895
  static: true
28896
28896
  }, /*#__PURE__*/React__default["default"].createElement(qe.Child, {
28897
28897
  as: React.Fragment,
@@ -48562,6 +48562,95 @@
48562
48562
  })))))));
48563
48563
  };
48564
48564
 
48565
+ const TextArea = ({
48566
+ title = "",
48567
+ leftIcon = null,
48568
+ rightIcon = null,
48569
+ placeholder = "",
48570
+ footer = null,
48571
+ type = "text",
48572
+ mode = "default",
48573
+ isRequired = true,
48574
+ value,
48575
+ onChangeInput,
48576
+ className = ""
48577
+ }) => {
48578
+ const [isFocused, setIsFocused] = React.useState(false);
48579
+ const [showPassword, setShowPassword] = React.useState(false);
48580
+ const handleFocus = () => {
48581
+ setIsFocused(true);
48582
+ };
48583
+ const handleBlur = () => {
48584
+ setIsFocused(false);
48585
+ };
48586
+ const handleTogglePasswordVisibility = () => {
48587
+ setShowPassword(!showPassword);
48588
+ };
48589
+ return /*#__PURE__*/React__default["default"].createElement("div", {
48590
+ className: `w-full ${className}`
48591
+ }, title && /*#__PURE__*/React__default["default"].createElement("div", {
48592
+ className: "flex"
48593
+ }, /*#__PURE__*/React__default["default"].createElement("p", {
48594
+ className: "text-sm font-normal text-black mb-1"
48595
+ }, title), isRequired && /*#__PURE__*/React__default["default"].createElement("p", {
48596
+ className: "text-sm font-normal text-danger500 ml-1"
48597
+ }, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
48598
+ className: "relative rounded-md"
48599
+ }, leftIcon && /*#__PURE__*/React__default["default"].createElement("span", {
48600
+ className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none"
48601
+ }, /*#__PURE__*/React__default["default"].createElement(PiInfo, {
48602
+ size: 16,
48603
+ className: `
48604
+ ${mode === "primary" && "text-black"}
48605
+ ${mode === "disable" && "text-neutral50"}
48606
+ ${mode === "danger" && "text-danger500"}
48607
+ `
48608
+ })), /*#__PURE__*/React__default["default"].createElement("textarea", {
48609
+ type: type === "password" ? showPassword ? "text" : "password" : type,
48610
+ className: `py-2.5 px-4 w-full font-normal text-sm text-neutral300 rounded-md border
48611
+ ${!value && mode === "default" && "bg-neutral20 border-neutral50 focus:outline-2 outline-primary500"}
48612
+ ${value && mode === "default" && "bg-neutral20 border-black focus:outline-2 outline-primary500"}
48613
+ ${isFocused && mode === "default" && "bg-neutral20 border-primary500"}
48614
+ ${mode === "disable" && "bg-neutral30 border-neutral50"}
48615
+ ${mode === "danger" && "bg-danger50 border-danger500 focus:outline-2 outline-danger500"}
48616
+ ${leftIcon ? "pl-10" : "pl-3"}
48617
+ ${rightIcon ? "pr-10" : "pr-3"}`,
48618
+ placeholder: placeholder,
48619
+ disabled: mode === "disable",
48620
+ value: value,
48621
+ onChange: onChangeInput,
48622
+ onFocus: handleFocus,
48623
+ onBlur: handleBlur
48624
+ }), type === "password" && /*#__PURE__*/React__default["default"].createElement("span", {
48625
+ className: "absolute inset-y-0 right-0 pr-4 flex items-center cursor-pointer",
48626
+ onClick: handleTogglePasswordVisibility
48627
+ }, showPassword ? /*#__PURE__*/React__default["default"].createElement(PiEye, {
48628
+ size: 16,
48629
+ className: `text-black ${mode === "danger" && "text-danger500"}`
48630
+ }) : /*#__PURE__*/React__default["default"].createElement(PiEyeClosedLight, {
48631
+ size: 16,
48632
+ className: `text-black ${mode === "danger" && "text-danger500"}`
48633
+ })), rightIcon && /*#__PURE__*/React__default["default"].createElement("span", {
48634
+ className: "absolute inset-y-0 right-0 pr-4 flex items-center pointer-events-none"
48635
+ }, /*#__PURE__*/React__default["default"].createElement(PiInfo, {
48636
+ size: 16,
48637
+ className: `
48638
+ ${mode === "primary" && "text-black"}
48639
+ ${mode === "disable" && "text-neutral50"}
48640
+ ${mode === "danger" && "text-danger500"}
48641
+ `
48642
+ }))), footer && /*#__PURE__*/React__default["default"].createElement("div", null, mode === "danger" ? /*#__PURE__*/React__default["default"].createElement("div", {
48643
+ className: "flex"
48644
+ }, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(PiInfo, {
48645
+ size: 16,
48646
+ className: "text-danger500"
48647
+ })), /*#__PURE__*/React__default["default"].createElement("p", {
48648
+ className: "text-danger500 text-xs ml-1"
48649
+ }, footer)) : /*#__PURE__*/React__default["default"].createElement("p", {
48650
+ className: "text-black text-xs"
48651
+ }, footer)));
48652
+ };
48653
+
48565
48654
  exports.Alert = Alert;
48566
48655
  exports.BillerList = BillerList;
48567
48656
  exports.BillerProductList = BillerProductList;
@@ -48617,6 +48706,7 @@
48617
48706
  exports.Stepper = Stepper;
48618
48707
  exports.Switch = Switch;
48619
48708
  exports.TabBar = TabBar;
48709
+ exports.TextArea = TextArea;
48620
48710
  exports.TextEditor = TextEditor;
48621
48711
  exports.TextInput = TextInput;
48622
48712
  exports.VerticalStepBar = VerticalStepBar;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.91",
4
+ "version": "0.1.93",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -17,7 +17,7 @@ const ModalResult = (props) => {
17
17
  as="div"
18
18
  className="relative z-10"
19
19
  initialFocus={cancelButtonRef}
20
- onClose={() => props.onClose}
20
+ onClose={() => props.onClose()}
21
21
  static={true}
22
22
  >
23
23
  <Transition.Child
package/src/index.js CHANGED
@@ -88,6 +88,7 @@ import Footer from "./components/footer";
88
88
  import Header from "./components/header";
89
89
  import TextEditor from "./components/texteditor";
90
90
  import CustomPhone from "./components/customphone";
91
+ import TextArea from "./components/textarea";
91
92
 
92
93
  export {
93
94
  Header,
@@ -147,5 +148,6 @@ export {
147
148
  ModalDeposit,
148
149
  DescriptionFile,
149
150
  TextEditor,
150
- CustomPhone
151
+ CustomPhone,
152
+ TextArea
151
153
  };