sprint-asia-custom-component 0.1.160 → 0.1.161

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
@@ -29144,6 +29144,7 @@
29144
29144
 
29145
29145
  const TextInput = ({
29146
29146
  title = "",
29147
+ rightComponent = null,
29147
29148
  leftIcon = null,
29148
29149
  rightIcon = null,
29149
29150
  placeholder = "",
@@ -29172,13 +29173,15 @@
29172
29173
  };
29173
29174
  return /*#__PURE__*/React__default["default"].createElement("div", {
29174
29175
  className: `w-full ${className}`
29176
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
29177
+ className: "flex justify-between w-full items-center"
29175
29178
  }, title && /*#__PURE__*/React__default["default"].createElement("div", {
29176
29179
  className: "flex"
29177
29180
  }, /*#__PURE__*/React__default["default"].createElement("p", {
29178
29181
  className: "text-sm font-normal text-black mb-1"
29179
29182
  }, title), isRequired && /*#__PURE__*/React__default["default"].createElement("p", {
29180
29183
  className: "text-sm font-normal text-danger500 ml-1"
29181
- }, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
29184
+ }, "*")), rightComponent && /*#__PURE__*/React__default["default"].createElement("div", null, rightComponent)), /*#__PURE__*/React__default["default"].createElement("div", {
29182
29185
  className: "relative rounded-md"
29183
29186
  }, /*#__PURE__*/React__default["default"].createElement("section", {
29184
29187
  className: "absolute inset-y-0 left-0 pl-2 flex items-center justify-center gap-2"
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.160",
4
+ "version": "0.1.161",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -3,6 +3,7 @@ import { PiEyeClosedLight, PiEye, PiInfo } from "react-icons/pi";
3
3
 
4
4
  const TextInput = ({
5
5
  title = "",
6
+ rightComponent = null,
6
7
  leftIcon = null,
7
8
  rightIcon = null,
8
9
  placeholder = "",
@@ -16,7 +17,7 @@ const TextInput = ({
16
17
  rightAdornment,
17
18
  leftAdornment,
18
19
  minimum,
19
- maximum
20
+ maximum,
20
21
  }) => {
21
22
  const [isFocused, setIsFocused] = useState(false);
22
23
  const [showPassword, setShowPassword] = useState(false);
@@ -35,12 +36,17 @@ const TextInput = ({
35
36
 
36
37
  return (
37
38
  <div className={`w-full ${className}`}>
38
- {title && (
39
- <div className="flex">
40
- <p className="text-sm font-normal text-black mb-1">{title}</p>
41
- {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
42
- </div>
43
- )}
39
+ <div className="flex justify-between w-full items-center">
40
+ {title && (
41
+ <div className="flex">
42
+ <p className="text-sm font-normal text-black mb-1">{title}</p>
43
+ {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
44
+ </div>
45
+ )}
46
+ {
47
+ rightComponent && <div>{rightComponent}</div>
48
+ }
49
+ </div>
44
50
 
45
51
  <div className="relative rounded-md">
46
52
  <section className="absolute inset-y-0 left-0 pl-2 flex items-center justify-center gap-2">
@@ -1598,6 +1598,8 @@ const Templates = () => {
1598
1598
 
1599
1599
  <div className="m-9"></div>
1600
1600
  <p className="text-black font-bold text-2xl text-center py-2">Text Input</p>
1601
+ <TextInput title="Default Input" placeholder="Type something..." value={inputValue} onChange={setInputValue} rightComponent={<div className="flex items-center mb-2"><Switch /><p className="ml-2">Auto</p></div>}/>
1602
+
1601
1603
  <TextInput title="Default Input" placeholder="Type something..." value={inputValue} onChange={setInputValue} />
1602
1604
 
1603
1605
  <TextInput