@starasia/input 1.0.4 → 2.0.1
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/README.md +272 -81
- package/dist/functions.d.ts +13 -3
- package/dist/input.es.js +826 -466
- package/dist/input.umd.js +475 -264
- package/dist/types.d.ts +22 -8
- package/package.json +2 -2
package/dist/input.umd.js
CHANGED
|
@@ -1,334 +1,545 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
3
|
-
* {
|
|
4
|
-
margin: 0;
|
|
5
|
-
padding: 0;
|
|
6
|
-
}
|
|
1
|
+
(function(h,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(h=typeof globalThis<"u"?globalThis:h||self,n(h.Input={},h.jsxRuntime,h.React))})(this,function(h,n,o){"use strict";const pn=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
7
2
|
|
|
8
3
|
:root {
|
|
9
|
-
/*
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
|
|
24
|
-
--
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
--
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
61
|
-
--starasia-ui-input-color-quinary-red: var(
|
|
62
|
-
--starasia-ui-color-red-50,
|
|
63
|
-
rgba(255, 240, 243, 1)
|
|
64
|
-
);
|
|
65
|
-
/* orange */
|
|
66
|
-
--starasia-ui-input-color-primary-orange: var(
|
|
67
|
-
--starasia-ui-color-orange-700,
|
|
68
|
-
rgba(152, 104, 0, 1)
|
|
69
|
-
);
|
|
70
|
-
--starasia-ui-input-color-secondary-orange: var(
|
|
71
|
-
--starasia-ui-color-orange-500,
|
|
72
|
-
rgba(210, 160, 58, 1)
|
|
73
|
-
);
|
|
74
|
-
--starasia-ui-input-color-tertiary-orange: var(
|
|
75
|
-
--starasia-ui-color-orange-300,
|
|
76
|
-
rgba(255, 203, 105, 1)
|
|
77
|
-
);
|
|
78
|
-
--starasia-ui-input-color-quaternary-orange: var(
|
|
79
|
-
--starasia-ui-color-orange-100,
|
|
80
|
-
rgba(255, 245, 193, 1)
|
|
81
|
-
);
|
|
82
|
-
--starasia-ui-input-color-quinary-orange: var(
|
|
83
|
-
--starasia-ui-color-orange-50,
|
|
84
|
-
rgba(250, 246, 224, 1)
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
/* text color */
|
|
88
|
-
--starasia-ui-text-default: var(--starasia-ui-color-gray-900);
|
|
89
|
-
--starasia-ui-color-text: var(--starasia-ui-text-default);
|
|
90
|
-
|
|
91
|
-
/* border width */
|
|
92
|
-
--starasia-ui-input-border-width: var(--starasia-ui-border, 1px);
|
|
93
|
-
|
|
94
|
-
/* border color */
|
|
95
|
-
--starasia-ui-color-border: rgba(120, 134, 127, 0.2);
|
|
96
|
-
|
|
97
|
-
/* disabled */
|
|
98
|
-
--starasia-ui-input-color-disabled-bg: rgba(242, 243, 242, 1);
|
|
99
|
-
--starasia-ui-input-color-disabled-text: rgba(147, 158, 153, 1);
|
|
100
|
-
--starasia-ui-input-color-addons-bg: rgba(120, 134, 127, 0.1);
|
|
101
|
-
--starasia-ui-input-color-addons-bg-disabled: rgba(120, 134, 127, 0.3);
|
|
102
|
-
|
|
103
|
-
/* white */
|
|
104
|
-
--starasia-ui-input-color-white: var(--starasia-ui-color-gray-50, rgba(255, 254, 255, 1));
|
|
4
|
+
/* Figma design tokens */
|
|
5
|
+
--sa-input-text-primary: #292a2e;
|
|
6
|
+
--sa-input-text-subtle: #505258;
|
|
7
|
+
--sa-input-text-subtlest: #6b6e76;
|
|
8
|
+
--sa-input-text-error: #a4133c;
|
|
9
|
+
--sa-input-text-disable: rgba(24, 26, 25, 0.56);
|
|
10
|
+
|
|
11
|
+
--sa-input-icon-subtle: #505258;
|
|
12
|
+
--sa-input-icon-subtlest: #6b6e76;
|
|
13
|
+
--sa-input-icon-success: #208958;
|
|
14
|
+
--sa-input-icon-disable: rgba(24, 26, 25, 0.56);
|
|
15
|
+
|
|
16
|
+
--sa-input-border-subtle: rgba(11, 18, 14, 0.14);
|
|
17
|
+
--sa-input-border-brand: #1976d2;
|
|
18
|
+
--sa-input-border-brand-subtle: #90caf9;
|
|
19
|
+
--sa-input-border-danger: #c9184a;
|
|
20
|
+
--sa-input-border-danger-subtle: #ffb3c1;
|
|
21
|
+
--sa-input-border-success: #28ac6e;
|
|
22
|
+
--sa-input-border-disabled: rgba(24, 26, 25, 0.56);
|
|
23
|
+
|
|
24
|
+
--sa-input-bg-neutral: #f0f1f2;
|
|
25
|
+
--sa-input-bg-error-subtlest: #fff0f3;
|
|
26
|
+
--sa-input-bg-success-subtlest: #ecfff6;
|
|
27
|
+
--sa-input-accent-subtle: #f0f1f2;
|
|
28
|
+
|
|
29
|
+
--sa-input-text-placeholder: rgb(201, 206, 204);
|
|
30
|
+
|
|
31
|
+
--sa-input-radius: 6px;
|
|
32
|
+
--sa-input-padding-x: 12px;
|
|
33
|
+
--sa-input-padding-y: 8px;
|
|
34
|
+
--sa-input-gap: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ROOT */
|
|
38
|
+
.sa-tf {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: stretch;
|
|
43
|
+
gap: 8px;
|
|
44
|
+
font-family: "Poppins", sans-serif;
|
|
45
|
+
width: max-content;
|
|
46
|
+
}
|
|
47
|
+
.sa-tf *,
|
|
48
|
+
.sa-tf *::before,
|
|
49
|
+
.sa-tf *::after {
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
}
|
|
52
|
+
.sa-tf-fullwidth {
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
105
55
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
56
|
+
/* outside-left layout */
|
|
57
|
+
.sa-tf-label-outside-left {
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: flex-start;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
}
|
|
62
|
+
.sa-tf-label-outside-left > .sa-tf-label-col {
|
|
63
|
+
width: 40%;
|
|
64
|
+
min-width: 120px;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
padding-top: 9.5px;
|
|
69
|
+
}
|
|
70
|
+
.sa-tf-label-outside-left > .sa-tf-input-col {
|
|
71
|
+
flex: 1 1 0;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
}
|
|
111
77
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
78
|
+
/* LABEL ROW */
|
|
79
|
+
.sa-tf-label {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 4px;
|
|
83
|
+
width: 100%;
|
|
84
|
+
color: var(--sa-input-text-primary);
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
line-height: normal;
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
.sa-tf-size-sm .sa-tf-label,
|
|
91
|
+
.sa-tf-size-sm .sa-tf-label-inside-text {
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
}
|
|
94
|
+
.sa-tf-required {
|
|
95
|
+
color: var(--sa-input-text-error);
|
|
96
|
+
font-weight: 500;
|
|
97
|
+
}
|
|
98
|
+
.sa-tf-optional {
|
|
99
|
+
background: var(--sa-input-accent-subtle);
|
|
100
|
+
border: 1px solid var(--sa-input-border-subtle);
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
padding: 0 8px;
|
|
103
|
+
font-size: 10px;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
line-height: 18px;
|
|
106
|
+
color: var(--sa-input-text-primary);
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
116
110
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
/* DESCRIPTIONS */
|
|
112
|
+
.sa-tf-desc-top,
|
|
113
|
+
.sa-tf-helper,
|
|
114
|
+
.sa-tf-error {
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
line-height: 18px;
|
|
117
|
+
margin: 0;
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
}
|
|
120
|
+
.sa-tf-desc-top,
|
|
121
|
+
.sa-tf-helper {
|
|
122
|
+
color: var(--sa-input-text-subtlest);
|
|
123
|
+
}
|
|
124
|
+
.sa-tf-error {
|
|
125
|
+
color: var(--sa-input-text-error);
|
|
126
|
+
}
|
|
127
|
+
.sa-tf-size-sm .sa-tf-desc-top,
|
|
128
|
+
.sa-tf-size-sm .sa-tf-helper,
|
|
129
|
+
.sa-tf-size-sm .sa-tf-error {
|
|
130
|
+
font-size: 10px;
|
|
131
|
+
line-height: 15px;
|
|
121
132
|
}
|
|
122
133
|
|
|
123
|
-
|
|
124
|
-
|
|
134
|
+
/* INPUT BOX */
|
|
135
|
+
.sa-tf-box {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: stretch;
|
|
138
|
+
gap: var(--sa-input-gap);
|
|
139
|
+
border-radius: var(--sa-input-radius);
|
|
140
|
+
position: relative;
|
|
141
|
+
width: 100%;
|
|
142
|
+
background: transparent;
|
|
143
|
+
border: 0.8px solid var(--sa-input-border-subtle);
|
|
125
144
|
overflow: hidden;
|
|
145
|
+
transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
|
|
146
|
+
}
|
|
147
|
+
.sa-tf-box-content {
|
|
126
148
|
display: flex;
|
|
127
149
|
align-items: center;
|
|
128
|
-
|
|
150
|
+
gap: var(--sa-input-gap);
|
|
151
|
+
flex: 1 1 0;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
padding: var(--sa-input-padding-y) var(--sa-input-padding-x);
|
|
129
154
|
}
|
|
130
155
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
/* sizes */
|
|
157
|
+
.sa-tf-size-sm .sa-tf-box {
|
|
158
|
+
min-height: 32px;
|
|
134
159
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.starasia-input-container-icon-left {
|
|
138
|
-
background-color: var(--starasia-ui-input-color-disabled-bg);
|
|
160
|
+
.sa-tf-size-md .sa-tf-box {
|
|
161
|
+
min-height: 40px;
|
|
139
162
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
.starasia-input-container-icon-right {
|
|
143
|
-
background-color: var(--starasia-ui-input-color-disabled-bg);
|
|
163
|
+
.sa-tf-size-lg .sa-tf-box {
|
|
164
|
+
min-height: 48px;
|
|
144
165
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
/* border-color: var(--starasia-ui-input-color-tertiary-gray); */
|
|
148
|
-
/* background-color: var(--starasia-ui-input-color-tertiary-gray); */
|
|
149
|
-
border-color: var(--starasia-ui-color-border);
|
|
150
|
-
background-color: var(--starasia-ui-input-color-disabled-bg);
|
|
166
|
+
.sa-tf-size-xl .sa-tf-box {
|
|
167
|
+
min-height: 56px;
|
|
151
168
|
}
|
|
152
169
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
/* variants */
|
|
171
|
+
.sa-tf-variant-outline .sa-tf-box {
|
|
172
|
+
background: transparent;
|
|
173
|
+
border: 0.8px solid var(--sa-input-border-subtle);
|
|
157
174
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
border
|
|
175
|
+
.sa-tf-variant-standard .sa-tf-box {
|
|
176
|
+
background: var(--sa-input-bg-neutral);
|
|
177
|
+
border: 0.8px solid transparent;
|
|
161
178
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
border
|
|
165
|
-
|
|
179
|
+
.sa-tf-variant-flushed .sa-tf-box {
|
|
180
|
+
background: transparent;
|
|
181
|
+
border: 0;
|
|
182
|
+
border-bottom: 0.8px solid var(--sa-input-border-subtle);
|
|
183
|
+
border-radius: 0;
|
|
166
184
|
}
|
|
167
185
|
|
|
168
|
-
|
|
169
|
-
|
|
186
|
+
/* state: focused */
|
|
187
|
+
.sa-tf-focused.sa-tf-status-default .sa-tf-box,
|
|
188
|
+
.sa-tf-variant-outline.sa-tf-focused.sa-tf-status-default .sa-tf-box {
|
|
189
|
+
border-color: var(--sa-input-border-brand);
|
|
190
|
+
border-width: 1.2px;
|
|
170
191
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
border-
|
|
192
|
+
.sa-tf-variant-flushed.sa-tf-focused.sa-tf-status-default .sa-tf-box {
|
|
193
|
+
border-bottom-color: var(--sa-input-border-brand);
|
|
194
|
+
border-bottom-width: 1.2px;
|
|
174
195
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
border-
|
|
178
|
-
background-color: var(--starasia-ui-input-color-quinary-orange);
|
|
196
|
+
.sa-tf-variant-standard.sa-tf-focused.sa-tf-status-default .sa-tf-box {
|
|
197
|
+
border-color: var(--sa-input-border-brand);
|
|
198
|
+
border-width: 1.2px;
|
|
179
199
|
}
|
|
180
200
|
|
|
181
|
-
|
|
182
|
-
|
|
201
|
+
/* inside-label focused: outer ring */
|
|
202
|
+
.sa-tf-label-inside.sa-tf-focused.sa-tf-status-default .sa-tf-box {
|
|
203
|
+
box-shadow: 0 0 0 1.2px var(--sa-input-border-brand-subtle);
|
|
183
204
|
}
|
|
184
205
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
border-width:
|
|
189
|
-
border-style: solid;
|
|
206
|
+
/* state: error */
|
|
207
|
+
.sa-tf-status-error .sa-tf-box {
|
|
208
|
+
border-color: var(--sa-input-border-danger);
|
|
209
|
+
border-width: 1.2px;
|
|
190
210
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
border-
|
|
194
|
-
border-style: solid;
|
|
195
|
-
border-color: var(--starasia-ui-input-color-quinary-gray);
|
|
196
|
-
background-color: var(--starasia-ui-input-color-quinary-gray);
|
|
211
|
+
.sa-tf-variant-flushed.sa-tf-status-error .sa-tf-box {
|
|
212
|
+
border: 0;
|
|
213
|
+
border-bottom: 1.2px solid var(--sa-input-border-danger);
|
|
197
214
|
}
|
|
198
215
|
|
|
199
|
-
|
|
200
|
-
|
|
216
|
+
/* Flushed must never render a box-shadow ring — only the bottom border. */
|
|
217
|
+
.sa-tf-variant-flushed .sa-tf-box {
|
|
218
|
+
box-shadow: none !important;
|
|
201
219
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
border-bottom: var(--starasia-ui-input-border-width) solid
|
|
205
|
-
var(--starasia-ui-input-color-tertiary-gray);
|
|
206
|
-
border-bottom-left-radius: 0 !important;
|
|
207
|
-
border-bottom-right-radius: 0 !important;
|
|
220
|
+
.sa-tf-variant-standard.sa-tf-status-error .sa-tf-box {
|
|
221
|
+
background: var(--sa-input-bg-error-subtlest);
|
|
208
222
|
}
|
|
209
|
-
|
|
210
|
-
.
|
|
211
|
-
height: var(--starasia-ui-input-height-sm);
|
|
212
|
-
border-radius: var(--starasia-ui-input-border-radius-sm);
|
|
213
|
-
font-size: var(--starasia-ui-fontSizes-sm, 12px);
|
|
214
|
-
/* padding-inline: var(--starasia-ui-input-spacing-sm); */
|
|
223
|
+
.sa-tf-status-error.sa-tf-focused .sa-tf-box {
|
|
224
|
+
box-shadow: 0 0 0 1.2px var(--sa-input-border-danger-subtle);
|
|
215
225
|
}
|
|
216
226
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
border-
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
/* state: success */
|
|
228
|
+
.sa-tf-status-success .sa-tf-box {
|
|
229
|
+
border-color: var(--sa-input-border-success);
|
|
230
|
+
border-width: 1.2px;
|
|
231
|
+
}
|
|
232
|
+
.sa-tf-variant-flushed.sa-tf-status-success .sa-tf-box {
|
|
233
|
+
border: 0;
|
|
234
|
+
border-bottom: 1.2px solid var(--sa-input-border-success);
|
|
235
|
+
}
|
|
236
|
+
.sa-tf-variant-standard.sa-tf-status-success .sa-tf-box {
|
|
237
|
+
background: var(--sa-input-bg-success-subtlest);
|
|
222
238
|
}
|
|
223
239
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
240
|
+
/* state: disable */
|
|
241
|
+
.sa-tf-status-disable .sa-tf-box,
|
|
242
|
+
.sa-tf-disabled .sa-tf-box {
|
|
243
|
+
border-color: var(--sa-input-border-disabled);
|
|
244
|
+
cursor: not-allowed;
|
|
245
|
+
}
|
|
246
|
+
.sa-tf-variant-standard.sa-tf-status-disable .sa-tf-box,
|
|
247
|
+
.sa-tf-variant-standard.sa-tf-disabled .sa-tf-box {
|
|
248
|
+
background: var(--sa-input-bg-neutral);
|
|
249
|
+
border-color: transparent;
|
|
250
|
+
}
|
|
251
|
+
.sa-tf-status-disable .sa-tf-input,
|
|
252
|
+
.sa-tf-disabled .sa-tf-input {
|
|
253
|
+
color: var(--sa-input-text-disable);
|
|
254
|
+
cursor: not-allowed;
|
|
255
|
+
}
|
|
256
|
+
.sa-tf-status-disable .sa-tf-placeholder,
|
|
257
|
+
.sa-tf-disabled .sa-tf-placeholder {
|
|
258
|
+
color: var(--sa-input-text-disable);
|
|
229
259
|
}
|
|
230
260
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
261
|
+
/* Icons inside box */
|
|
262
|
+
.sa-tf-icon {
|
|
263
|
+
display: inline-flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
color: var(--sa-input-icon-subtle);
|
|
268
|
+
}
|
|
269
|
+
.sa-tf-icon-clickable {
|
|
270
|
+
cursor: pointer;
|
|
271
|
+
}
|
|
272
|
+
.sa-tf-status-disable .sa-tf-icon,
|
|
273
|
+
.sa-tf-disabled .sa-tf-icon {
|
|
274
|
+
color: var(--sa-input-icon-disable);
|
|
275
|
+
}
|
|
276
|
+
.sa-tf-status-success .sa-tf-success-mark {
|
|
277
|
+
color: var(--sa-input-icon-success);
|
|
236
278
|
}
|
|
237
279
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
280
|
+
/* Clear (×) button — slot is always reserved to keep input width stable */
|
|
281
|
+
.sa-tf-clear {
|
|
282
|
+
appearance: none;
|
|
283
|
+
border: 0;
|
|
284
|
+
background: transparent;
|
|
285
|
+
padding: 0;
|
|
286
|
+
margin: 0;
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
color: var(--sa-input-icon-subtlest);
|
|
289
|
+
border-radius: 50%;
|
|
290
|
+
opacity: 1;
|
|
291
|
+
transition: opacity 120ms ease, color 120ms ease, transform 80ms ease;
|
|
292
|
+
}
|
|
293
|
+
.sa-tf-clear:hover {
|
|
294
|
+
color: var(--sa-input-icon-subtle);
|
|
295
|
+
}
|
|
296
|
+
.sa-tf-clear:active {
|
|
297
|
+
transform: scale(0.92);
|
|
298
|
+
}
|
|
299
|
+
.sa-tf-clear:focus-visible {
|
|
300
|
+
outline: 2px solid var(--sa-input-border-brand-subtle);
|
|
301
|
+
outline-offset: 2px;
|
|
302
|
+
}
|
|
303
|
+
.sa-tf-clear-hidden {
|
|
304
|
+
opacity: 0;
|
|
246
305
|
pointer-events: none;
|
|
306
|
+
cursor: default;
|
|
247
307
|
}
|
|
248
308
|
|
|
249
|
-
|
|
250
|
-
|
|
309
|
+
/* Addons (left/right blocks) */
|
|
310
|
+
.sa-tf-addon {
|
|
311
|
+
display: flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
padding: 0 12px;
|
|
315
|
+
background: var(--sa-input-bg-neutral);
|
|
316
|
+
color: var(--sa-input-text-subtle);
|
|
317
|
+
font-size: 14px;
|
|
318
|
+
line-height: 21px;
|
|
319
|
+
flex-shrink: 0;
|
|
320
|
+
align-self: stretch;
|
|
251
321
|
}
|
|
252
|
-
|
|
253
|
-
.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
322
|
+
.sa-tf-addon-left {
|
|
323
|
+
border-right: 0.8px solid var(--sa-input-border-subtle);
|
|
324
|
+
}
|
|
325
|
+
.sa-tf-addon-right {
|
|
326
|
+
border-left: 0.8px solid var(--sa-input-border-subtle);
|
|
327
|
+
}
|
|
328
|
+
.sa-tf-size-sm .sa-tf-addon {
|
|
329
|
+
font-size: 12px;
|
|
330
|
+
line-height: 18px;
|
|
257
331
|
}
|
|
258
332
|
|
|
259
|
-
|
|
333
|
+
/* Input field + placeholder */
|
|
334
|
+
.sa-tf-field-wrap {
|
|
335
|
+
display: flex;
|
|
336
|
+
align-items: center;
|
|
337
|
+
flex: 1 1 0;
|
|
338
|
+
min-width: 0;
|
|
339
|
+
position: relative;
|
|
340
|
+
}
|
|
341
|
+
.sa-tf-input {
|
|
260
342
|
width: 100%;
|
|
261
|
-
|
|
262
|
-
height: 100%;
|
|
263
|
-
border: none;
|
|
343
|
+
border: 0;
|
|
264
344
|
outline: none;
|
|
265
|
-
font-family: "Poppins", serif;
|
|
266
|
-
font-size: inherit;
|
|
267
|
-
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
268
345
|
background: transparent;
|
|
269
|
-
|
|
270
|
-
|
|
346
|
+
padding: 0;
|
|
347
|
+
margin: 0;
|
|
348
|
+
font-family: inherit;
|
|
349
|
+
font-size: 14px;
|
|
350
|
+
font-weight: 400;
|
|
351
|
+
line-height: 21px;
|
|
352
|
+
color: var(--sa-input-text-primary);
|
|
353
|
+
}
|
|
354
|
+
.sa-tf-size-sm .sa-tf-input {
|
|
355
|
+
font-size: 12px;
|
|
356
|
+
line-height: 18px;
|
|
357
|
+
}
|
|
358
|
+
.sa-tf-input::placeholder {
|
|
359
|
+
color: var(--sa-input-text-placeholder);
|
|
360
|
+
font-weight: 300;
|
|
361
|
+
opacity: 1;
|
|
362
|
+
}
|
|
363
|
+
.sa-tf-variant-standard .sa-tf-input::placeholder,
|
|
364
|
+
.sa-tf-variant-standard .sa-tf-placeholder {
|
|
365
|
+
color: var(--sa-input-text-placeholder);
|
|
366
|
+
}
|
|
367
|
+
.sa-tf-input:disabled {
|
|
368
|
+
color: var(--sa-input-text-disable);
|
|
369
|
+
cursor: not-allowed;
|
|
370
|
+
-webkit-text-fill-color: var(--sa-input-text-disable);
|
|
271
371
|
}
|
|
272
372
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
/* just icon */
|
|
277
|
-
|
|
278
|
-
/* INPUT ICON */
|
|
279
|
-
.starasia-input-container-icon-left {
|
|
373
|
+
.sa-tf-placeholder {
|
|
374
|
+
position: absolute;
|
|
375
|
+
inset: 0;
|
|
280
376
|
display: flex;
|
|
281
|
-
height: 100%;
|
|
282
377
|
align-items: center;
|
|
283
|
-
|
|
284
|
-
|
|
378
|
+
pointer-events: none;
|
|
379
|
+
color: var(--sa-input-text-placeholder);
|
|
380
|
+
font-size: 14px;
|
|
381
|
+
font-weight: 300;
|
|
382
|
+
line-height: 21px;
|
|
383
|
+
margin: 0;
|
|
384
|
+
white-space: nowrap;
|
|
385
|
+
overflow: hidden;
|
|
386
|
+
text-overflow: ellipsis;
|
|
387
|
+
}
|
|
388
|
+
.sa-tf-size-sm .sa-tf-placeholder {
|
|
389
|
+
font-size: 12px;
|
|
390
|
+
line-height: 18px;
|
|
391
|
+
}
|
|
392
|
+
.sa-tf-placeholder-highlight {
|
|
393
|
+
color: var(--sa-input-text-primary);
|
|
394
|
+
font-weight: 500;
|
|
285
395
|
}
|
|
286
396
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
397
|
+
/* ─────────────────────────────────────────────────────────────────
|
|
398
|
+
Inside-label (floating) layout & animation
|
|
399
|
+
─────────────────────────────────────────────────────────────────
|
|
400
|
+
Both rows always render so the transition is smooth — visibility
|
|
401
|
+
is controlled with max-height + opacity, not conditional render.
|
|
402
|
+
*/
|
|
403
|
+
.sa-tf-label-inside .sa-tf-box {
|
|
290
404
|
align-items: center;
|
|
291
|
-
|
|
292
|
-
|
|
405
|
+
cursor: text;
|
|
406
|
+
}
|
|
407
|
+
.sa-tf-label-inside.sa-tf-disabled .sa-tf-box,
|
|
408
|
+
.sa-tf-label-inside.sa-tf-status-disable .sa-tf-box {
|
|
409
|
+
cursor: not-allowed;
|
|
410
|
+
}
|
|
411
|
+
/* Box-content stays as a flex row so icons share container padding. */
|
|
412
|
+
.sa-tf-label-inside .sa-tf-box-content {
|
|
413
|
+
flex-direction: row;
|
|
414
|
+
align-items: center;
|
|
415
|
+
gap: var(--sa-input-gap);
|
|
293
416
|
}
|
|
294
417
|
|
|
295
|
-
/*
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
418
|
+
/* The label + input rows live inside this column. Stack handles the
|
|
419
|
+
floating animation; icons (siblings) translate to align with the
|
|
420
|
+
input row when floating. */
|
|
421
|
+
.sa-tf-label-inside .sa-tf-inside-stack {
|
|
299
422
|
display: flex;
|
|
300
|
-
|
|
301
|
-
|
|
423
|
+
flex-direction: column;
|
|
424
|
+
flex: 1 1 0;
|
|
425
|
+
min-width: 0;
|
|
426
|
+
gap: 0;
|
|
302
427
|
justify-content: center;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
428
|
+
transition: gap 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
429
|
+
}
|
|
430
|
+
.sa-tf-label-inside.sa-tf-floating .sa-tf-inside-stack {
|
|
431
|
+
gap: 4px;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* Icons & success-mark: align with active row.
|
|
435
|
+
Resting → vertical-center of label.
|
|
436
|
+
Floating → translated down so they sit next to the input text. */
|
|
437
|
+
.sa-tf-label-inside .sa-tf-box-content > .sa-tf-icon {
|
|
438
|
+
align-self: center;
|
|
439
|
+
transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
440
|
+
transform: translateY(0);
|
|
441
|
+
}
|
|
442
|
+
.sa-tf-label-inside.sa-tf-floating .sa-tf-box-content > .sa-tf-icon {
|
|
443
|
+
transform: translateY(11px);
|
|
444
|
+
}
|
|
445
|
+
.sa-tf-label-inside.sa-tf-size-sm.sa-tf-floating .sa-tf-box-content > .sa-tf-icon {
|
|
446
|
+
transform: translateY(9px);
|
|
447
|
+
}
|
|
448
|
+
.sa-tf-label-inside.sa-tf-size-lg.sa-tf-floating .sa-tf-box-content > .sa-tf-icon {
|
|
449
|
+
transform: translateY(12px);
|
|
450
|
+
}
|
|
451
|
+
.sa-tf-label-inside.sa-tf-size-xl.sa-tf-floating .sa-tf-box-content > .sa-tf-icon {
|
|
452
|
+
transform: translateY(13px);
|
|
306
453
|
}
|
|
307
454
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
height: 100%;
|
|
455
|
+
/* Label row — animates font-size when floating */
|
|
456
|
+
.sa-tf-label-inside .sa-tf-inside-label-row {
|
|
311
457
|
display: flex;
|
|
312
|
-
padding-inline: var(--starasia-ui-input-spacing-ms);
|
|
313
458
|
align-items: center;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
459
|
+
gap: 4px;
|
|
460
|
+
width: 100%;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
color: var(--sa-input-text-primary);
|
|
464
|
+
line-height: 21px;
|
|
465
|
+
transition: font-size 180ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
466
|
+
line-height 180ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
467
|
+
color 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
468
|
+
pointer-events: none;
|
|
318
469
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
470
|
+
.sa-tf-label-inside .sa-tf-inside-label-row label {
|
|
471
|
+
pointer-events: auto;
|
|
472
|
+
}
|
|
473
|
+
.sa-tf-label-inside.sa-tf-size-sm .sa-tf-inside-label-row {
|
|
474
|
+
font-size: 12px;
|
|
475
|
+
line-height: 18px;
|
|
476
|
+
}
|
|
477
|
+
.sa-tf-label-inside.sa-tf-floating .sa-tf-inside-label-row {
|
|
478
|
+
font-size: 12px;
|
|
479
|
+
line-height: 18px;
|
|
480
|
+
color: var(--sa-input-text-subtle);
|
|
481
|
+
}
|
|
482
|
+
.sa-tf-label-inside.sa-tf-size-sm.sa-tf-floating .sa-tf-inside-label-row {
|
|
483
|
+
font-size: 10px;
|
|
484
|
+
line-height: 15px;
|
|
485
|
+
}
|
|
486
|
+
.sa-tf-label-inside.sa-tf-focused.sa-tf-status-default .sa-tf-inside-label-row {
|
|
487
|
+
color: var(--sa-input-border-brand);
|
|
488
|
+
}
|
|
489
|
+
.sa-tf-label-inside.sa-tf-status-error .sa-tf-inside-label-row {
|
|
490
|
+
color: var(--sa-input-text-error);
|
|
491
|
+
}
|
|
492
|
+
.sa-tf-label-inside.sa-tf-no-label .sa-tf-inside-label-row {
|
|
493
|
+
display: none;
|
|
323
494
|
}
|
|
324
495
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
496
|
+
/* Input row — collapsed when not floating */
|
|
497
|
+
.sa-tf-label-inside .sa-tf-inside-row {
|
|
498
|
+
display: flex;
|
|
499
|
+
align-items: center;
|
|
500
|
+
gap: var(--sa-input-gap);
|
|
501
|
+
width: 100%;
|
|
502
|
+
max-height: 0;
|
|
503
|
+
opacity: 0;
|
|
504
|
+
overflow: hidden;
|
|
505
|
+
transform-origin: top left;
|
|
506
|
+
transform: translateY(-4px);
|
|
507
|
+
transition: max-height 180ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
508
|
+
opacity 140ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
509
|
+
transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
510
|
+
}
|
|
511
|
+
.sa-tf-label-inside.sa-tf-floating .sa-tf-inside-row,
|
|
512
|
+
.sa-tf-label-inside.sa-tf-no-label .sa-tf-inside-row {
|
|
513
|
+
max-height: 28px;
|
|
514
|
+
opacity: 1;
|
|
515
|
+
transform: translateY(0);
|
|
516
|
+
}
|
|
517
|
+
.sa-tf-label-inside.sa-tf-size-sm.sa-tf-floating .sa-tf-inside-row,
|
|
518
|
+
.sa-tf-label-inside.sa-tf-size-sm.sa-tf-no-label .sa-tf-inside-row {
|
|
519
|
+
max-height: 22px;
|
|
520
|
+
}
|
|
521
|
+
.sa-tf-label-inside.sa-tf-size-lg.sa-tf-floating .sa-tf-inside-row,
|
|
522
|
+
.sa-tf-label-inside.sa-tf-size-xl.sa-tf-floating .sa-tf-inside-row,
|
|
523
|
+
.sa-tf-label-inside.sa-tf-size-lg.sa-tf-no-label .sa-tf-inside-row,
|
|
524
|
+
.sa-tf-label-inside.sa-tf-size-xl.sa-tf-no-label .sa-tf-inside-row {
|
|
525
|
+
max-height: 32px;
|
|
328
526
|
}
|
|
329
527
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
528
|
+
/* Box height grows smoothly when floating */
|
|
529
|
+
.sa-tf-label-inside .sa-tf-box {
|
|
530
|
+
transition: border-color 120ms ease, box-shadow 120ms ease,
|
|
531
|
+
background-color 120ms ease, min-height 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
532
|
+
}
|
|
533
|
+
.sa-tf-label-inside.sa-tf-floating.sa-tf-size-sm .sa-tf-box {
|
|
534
|
+
min-height: 56px;
|
|
535
|
+
}
|
|
536
|
+
.sa-tf-label-inside.sa-tf-floating.sa-tf-size-md .sa-tf-box {
|
|
537
|
+
min-height: 64px;
|
|
538
|
+
}
|
|
539
|
+
.sa-tf-label-inside.sa-tf-floating.sa-tf-size-lg .sa-tf-box {
|
|
540
|
+
min-height: 72px;
|
|
541
|
+
}
|
|
542
|
+
.sa-tf-label-inside.sa-tf-floating.sa-tf-size-xl .sa-tf-box {
|
|
543
|
+
min-height: 80px;
|
|
333
544
|
}
|
|
334
|
-
`,
|
|
545
|
+
`,y=t=>t==="lg"||t==="xl"?18:16,j={default:"#505258",error:"#a4133c",success:"#208958",disable:"rgba(24, 26, 25, 0.56)"},J=(t,a)=>a?j.disable:j[t]??j.default;function bn(t){return Number(t.replace(/\./g,""))}function O(t){let a=t.replace(/[^\d]/g,"");return a=a.replace(/^0+(?=\d)/,""),a.replace(/\B(?=(\d{3})+(?!\d))/g,".")}function hn(t,a){if(a<=0)return 0;let r=0;for(let l=0;l<t.length;l++)if(/\d/.test(t[l])&&(r+=1,r===a))return l+1;return t.length}const gn=o.forwardRef(({options:t,value:a,setValue:r,isComponentVisible:l,onOptionChange:d},f)=>{const[m,V]=o.useState([]),c=o.useRef(null),u=()=>{if(f!=null&&f.current&&c.current){const g=window.innerHeight,p=f==null?void 0:f.current.getBoundingClientRect(),v=c.current.getBoundingClientRect(),z=p.bottom+v.height;c.current.style.left=`${p.left}px`,c.current.style.width=`${p.width}px`,z>=g-10?c.current.style.top=`${p.top-v.height-5}px`:c.current.style.top=`${p.top+p.height}px`}};return o.useEffect(()=>(window.addEventListener("scroll",u),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u)}),[f,c]),o.useEffect(()=>{u()},[l]),o.useEffect(()=>{V((t==null?void 0:t.filter(g=>g.toLowerCase().startsWith(a.toLowerCase())))||[])},[a,t]),n.jsx("div",{ref:c,style:{position:"fixed",padding:"8px",boxSizing:"border-box",boxShadow:"0px 8px 12px 0px rgba(0, 0, 0, 0.08)",borderRadius:"8px",background:"white",overflow:"auto",zIndex:5e4},children:m==null?void 0:m.map(g=>xn(g,a,r,d))})}),xn=(t,a,r,l)=>{const d=t.toLowerCase().indexOf(a.toLowerCase());return n.jsxs("p",{style:{fontFamily:"Poppins",color:"#c9cecc",fontWeight:500,padding:"8px 14px",cursor:"pointer"},onClick:()=>{r(t),l&&l(t)},children:[t.slice(0,d),n.jsx("span",{style:{color:"#374151"},children:t.slice(d,d+a.length)}),t.slice(d+a.length)]})};function mn(t){const[a,r]=o.useState(t),l=o.useRef(null),d=f=>{l.current&&!l.current.contains(f.target)&&r(!1)};return o.useEffect(()=>(document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}),[]),{ref:l,isComponentVisible:a,setIsComponentVisible:r}}const Q="starasia-input-styles";(t=>{if(!(typeof document>"u")&&!document.getElementById(Q)){const a=document.createElement("style");a.id=Q,a.textContent=t,document.head.appendChild(a)}})(pn);const vn=t=>n.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[n.jsx("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1.2"}),n.jsx("path",{d:"M5.2 8.2l1.8 1.8 3.8-4.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),wn=t=>n.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[n.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"currentColor",opacity:"0.2"}),n.jsx("path",{d:"M5.5 5.5l5 5M10.5 5.5l-5 5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}),Z=o.forwardRef((t,a)=>{const{size:r="md",variant:l="outline",status:d="default",label:f,labelPosition:m="outside-top",required:V,optional:c,description:u,helperText:g,errorText:p,leftIcon:v,rightIcon:z,leftAddons:S,rightAddons:L,onClickLeftIcon:R,onClickRightIcon:nn,fullWidth:zn=!1,highlightPlaceholder:$,currency:B,options:E,onOptionChange:Y,clearable:kn=!0,onClear:M,...s}=t,P=s.value!==void 0,[W,k]=o.useState(()=>{const e=s.value!==void 0?String(s.value??""):String(s.defaultValue??"");return B?O(e):e}),[tn,en]=o.useState(!1),[Cn,sn]=o.useState(""),C=o.useRef(null),N=o.useRef(null);o.useImperativeHandle(a,()=>N.current);const an=o.useRef(s.id??`sa-input-${Math.random().toString(36).slice(2,9)}`),{isComponentVisible:rn,ref:q,setIsComponentVisible:Nn}=mn(!1);o.useLayoutEffect(()=>{if(!P)return;const e=s.value===void 0||s.value===null?"":String(s.value),i=B?O(e):e;k(b=>b===i?b:i)},[s.value,B,P]),o.useLayoutEffect(()=>{if(C.current===null)return;const e=N.current,i=C.current;if(C.current=null,!!e)try{e.setSelectionRange(i,i)}catch{}},[W]);const I=W,D=I!==""&&I!==void 0,w=d==="disable"||s.disabled,A=w?"disable":d,H=m==="inside",In=H&&(D||tn),K=["sa-tf",`sa-tf-variant-${l}`,`sa-tf-size-${r}`,`sa-tf-status-${A}`,`sa-tf-label-${m}`,tn?"sa-tf-focused":"",w?"sa-tf-disabled":"",In?"sa-tf-floating":"",f?"":"sa-tf-no-label",zn?"sa-tf-fullwidth":""].filter(Boolean).join(" "),Sn=()=>{var e;return(e=N.current)==null?void 0:e.focus()},Ln=e=>{var cn,un;if(!B){const T=e.target.selectionStart;T!==null&&(C.current=T),k(e.target.value),(cn=s.onChange)==null||cn.call(s,e);return}const i=e.target.value;let b=i,x=e.target.selectionStart??i.length;if(Cn==="Backspace"){const T=W.replace(/\D/g,""),Tn=i.replace(/\D/g,"");T.length===Tn.length&&x>0&&(b=i.slice(0,x-1)+i.slice(x),x-=1)}const G=O(b),Dn=b.slice(0,x).replace(/\D/g,"").length,Fn=hn(G,Dn);C.current=Fn,k(G),(un=s.onChange)==null||un.call(s,{...e,target:{...e.target,value:String(bn(G)),name:e.target.name}}),sn("")},_=e=>f?n.jsxs("div",{className:e,children:[n.jsx("label",{htmlFor:an.current,style:{cursor:w?"not-allowed":"pointer"},children:f}),c?n.jsx("span",{className:"sa-tf-optional",children:"Optional"}):null,V?n.jsx("span",{className:"sa-tf-required","aria-hidden":"true",children:"*"}):null]}):null,U=n.jsxs(n.Fragment,{children:[g?n.jsx("p",{className:"sa-tf-helper",children:g}):null,p&&d==="error"?n.jsx("p",{className:"sa-tf-error",children:p}):null]}),F=(e,i)=>n.jsx("span",{className:`sa-tf-icon${i?" sa-tf-icon-clickable":""}`,onClick:i,children:o.cloneElement(e,{width:y(r),height:y(r),color:J(A,w),style:{color:J(A,w)}})}),on=d==="success"?n.jsx("span",{className:"sa-tf-icon sa-tf-success-mark","aria-hidden":"true",children:n.jsx(vn,{width:y(r),height:y(r)})}):null,Bn=e=>{var b;e.stopPropagation(),P||k("");const i={target:{value:"",name:s.name},currentTarget:{value:"",name:s.name}};(b=s.onChange)==null||b.call(s,i),M==null||M(),C.current=0,requestAnimationFrame(()=>{var x;return(x=N.current)==null?void 0:x.focus()})},ln=kn&&!w?n.jsx("button",{type:"button",className:`sa-tf-icon sa-tf-clear${D?"":" sa-tf-clear-hidden"}`,"aria-label":"Clear input","aria-hidden":!D,tabIndex:-1,onClick:Bn,onMouseDown:e=>e.preventDefault(),children:n.jsx(wn,{width:y(r),height:y(r)})}):null,En=!D&&!!s.placeholder&&!!$,dn=n.jsxs("div",{className:"sa-tf-field-wrap",children:[n.jsx("input",{...s,id:an.current,ref:N,className:"sa-tf-input",disabled:w,placeholder:$?"":s.placeholder,value:I,onFocus:e=>{var i;en(!0),Nn(!0),(i=s.onFocus)==null||i.call(s,e)},onBlur:e=>{var i;en(!1),(i=s.onBlur)==null||i.call(s,e)},onKeyDown:e=>{var i;e.key==="Backspace"&&sn(e.key),(i=s.onKeyDown)==null||i.call(s,e)},onChange:Ln}),En?yn(s.placeholder,$):null]}),fn=I&&rn&&(E!=null&&E.length)?n.jsx(gn,{options:E,value:I,setValue:k,ref:q,isComponentVisible:rn,onOptionChange:e=>{Y==null||Y(e),k(e)}}):null,X=H?n.jsxs("div",{className:"sa-tf-box",ref:q,onClick:Sn,children:[S?n.jsx("div",{className:"sa-tf-addon sa-tf-addon-left",children:S}):null,n.jsxs("div",{className:"sa-tf-box-content",children:[v?F(v,R):null,n.jsxs("div",{className:"sa-tf-inside-stack",children:[_("sa-tf-inside-label-row"),n.jsx("div",{className:"sa-tf-inside-row",children:dn})]}),ln,on,z?F(z,nn):null]}),L?n.jsx("div",{className:"sa-tf-addon sa-tf-addon-right",children:L}):null,fn]}):n.jsxs("div",{className:"sa-tf-box",ref:q,children:[S?n.jsx("div",{className:"sa-tf-addon sa-tf-addon-left",children:S}):null,n.jsxs("div",{className:"sa-tf-box-content",children:[v?F(v,R):null,dn,ln,on,z?F(z,nn):null]}),L?n.jsx("div",{className:"sa-tf-addon sa-tf-addon-right",children:L}):null,fn]});return m==="outside-left"?n.jsxs("div",{className:K,children:[n.jsxs("div",{className:"sa-tf-label-col",children:[_("sa-tf-label"),u?n.jsx("p",{className:"sa-tf-desc-top",children:u}):null]}),n.jsxs("div",{className:"sa-tf-input-col",children:[X,U]})]}):H?n.jsxs("div",{className:K,children:[X,U]}):n.jsxs("div",{className:K,children:[_("sa-tf-label"),u?n.jsx("p",{className:"sa-tf-desc-top",children:u}):null,X,U]})}),yn=(t,a)=>{if(!t)return null;if(!a)return n.jsx("p",{className:"sa-tf-placeholder",children:t});const r=t.toLowerCase().indexOf(a.toLowerCase());return r===-1?n.jsx("p",{className:"sa-tf-placeholder",children:t}):n.jsxs("p",{className:"sa-tf-placeholder",children:[t.slice(0,r),n.jsx("span",{className:"sa-tf-placeholder-highlight",children:t.slice(r,r+a.length)}),t.slice(r+a.length)]})};Z.displayName="Input",h.Input=Z,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|