sprint-asia-custom-component 0.1.180 → 0.1.181

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
@@ -29226,7 +29226,7 @@
29226
29226
  max: maximum !== null && maximum !== undefined && type === "number" ? maximum : undefined,
29227
29227
  type: type === "password" ? showPassword ? "text" : "password" : "text" // number tetap text
29228
29228
  ,
29229
- className: `py-2.5 px-3 w-full font-normal text-sm text-black rounded-md border
29229
+ className: `py-2.5 w-full font-normal text-sm text-black rounded-md border
29230
29230
  ${!value && mode === "default" && "bg-neutral20 border-neutral50 focus:outline-2 outline-primary500"}
29231
29231
  ${value && mode === "default" && "bg-neutral20 border-black focus:outline-2 outline-primary500"}
29232
29232
  ${isFocused && mode === "default" && "bg-neutral20 border-primary500"}
@@ -29237,6 +29237,10 @@
29237
29237
  ${leftIcon && leftAdornment ? "pl-16" : "pl-3"}
29238
29238
  ${rightIcon || rightAdornment ? "pr-8" : "pr-3"}
29239
29239
  ${rightIcon && rightAdornment ? "pr-16" : "pr-3"}`,
29240
+ style: {
29241
+ paddingLeft: leftAdornment || leftIcon ? "2rem" : "0.75rem",
29242
+ paddingRight: rightAdornment || rightIcon ? "2rem" : "0.75rem"
29243
+ },
29240
29244
  placeholder: placeholder,
29241
29245
  disabled: mode === "disable",
29242
29246
  value: displayValue,
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.180",
4
+ "version": "0.1.181",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -53,8 +53,7 @@ const TextInput = ({
53
53
  onChangeInput(e);
54
54
  };
55
55
 
56
- const displayValue =
57
- type === "number" ? (value ? formatNumber(value) : "") : value;
56
+ const displayValue = type === "number" ? (value ? formatNumber(value) : "") : value;
58
57
 
59
58
  return (
60
59
  <div className={`w-full ${className}`}>
@@ -62,9 +61,7 @@ const TextInput = ({
62
61
  {title && (
63
62
  <div className="flex">
64
63
  <p className="text-sm font-normal text-black mb-1">{title}</p>
65
- {isRequired && (
66
- <p className="text-sm font-normal text-danger500 ml-1">*</p>
67
- )}
64
+ {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
68
65
  </div>
69
66
  )}
70
67
  {rightComponent}
@@ -86,41 +83,24 @@ const TextInput = ({
86
83
  </section>
87
84
 
88
85
  <input
89
- min={
90
- minimum !== null && minimum !== undefined && type === "number"
91
- ? minimum
92
- : undefined
93
- }
94
- max={
95
- maximum !== null && maximum !== undefined && type === "number"
96
- ? maximum
97
- : undefined
98
- }
99
- type={
100
- type === "password" ? (showPassword ? "text" : "password") : "text"
101
- } // number tetap text
102
- className={`py-2.5 px-3 w-full font-normal text-sm text-black rounded-md border
103
- ${
104
- !value &&
105
- mode === "default" &&
106
- "bg-neutral20 border-neutral50 focus:outline-2 outline-primary500"
107
- }
108
- ${
109
- value &&
110
- mode === "default" &&
111
- "bg-neutral20 border-black focus:outline-2 outline-primary500"
112
- }
86
+ min={minimum !== null && minimum !== undefined && type === "number" ? minimum : undefined}
87
+ max={maximum !== null && maximum !== undefined && type === "number" ? maximum : undefined}
88
+ type={type === "password" ? (showPassword ? "text" : "password") : "text"} // number tetap text
89
+ className={`py-2.5 w-full font-normal text-sm text-black rounded-md border
90
+ ${!value && mode === "default" && "bg-neutral20 border-neutral50 focus:outline-2 outline-primary500"}
91
+ ${value && mode === "default" && "bg-neutral20 border-black focus:outline-2 outline-primary500"}
113
92
  ${isFocused && mode === "default" && "bg-neutral20 border-primary500"}
114
93
  ${mode === "disable" && "bg-neutral30 border-neutral50"}
115
94
  ${mode === "white" && "bg-white border-neutral50"}
116
- ${
117
- mode === "danger" &&
118
- "bg-danger50 border-danger500 focus:outline-2 outline-danger500"
119
- }
95
+ ${mode === "danger" && "bg-danger50 border-danger500 focus:outline-2 outline-danger500"}
120
96
  ${leftIcon || leftAdornment ? "pl-8" : "pl-3"}
121
97
  ${leftIcon && leftAdornment ? "pl-16" : "pl-3"}
122
98
  ${rightIcon || rightAdornment ? "pr-8" : "pr-3"}
123
99
  ${rightIcon && rightAdornment ? "pr-16" : "pr-3"}`}
100
+ style={{
101
+ paddingLeft: leftAdornment || leftIcon ? "2rem" : "0.75rem",
102
+ paddingRight: rightAdornment || rightIcon ? "2rem" : "0.75rem",
103
+ }}
124
104
  placeholder={placeholder}
125
105
  disabled={mode === "disable"}
126
106
  value={displayValue}
@@ -135,19 +115,9 @@ const TextInput = ({
135
115
  onClick={handleTogglePasswordVisibility}
136
116
  >
137
117
  {showPassword ? (
138
- <PiEye
139
- size={16}
140
- className={`text-black ${
141
- mode === "danger" && "text-danger500"
142
- }`}
143
- />
118
+ <PiEye size={16} className={`text-black ${mode === "danger" && "text-danger500"}`} />
144
119
  ) : (
145
- <PiEyeClosedLight
146
- size={16}
147
- className={`text-black ${
148
- mode === "danger" && "text-danger500"
149
- }`}
150
- />
120
+ <PiEyeClosedLight size={16} className={`text-black ${mode === "danger" && "text-danger500"}`} />
151
121
  )}
152
122
  </span>
153
123
  )}
@@ -185,4 +155,4 @@ const TextInput = ({
185
155
  );
186
156
  };
187
157
 
188
- export default TextInput;
158
+ export default TextInput;