@starasia/input 1.0.0
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 +103 -0
- package/dist/Input.d.ts +3 -0
- package/dist/Suggestion.d.ts +10 -0
- package/dist/functions.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/input.es.js +1231 -0
- package/dist/input.umd.js +371 -0
- package/dist/types.d.ts +20 -0
- package/dist/useComponentVisible.d.ts +5 -0
- package/package.json +37 -0
package/dist/input.es.js
ADDED
|
@@ -0,0 +1,1231 @@
|
|
|
1
|
+
import tr, { forwardRef as Br, useState as H, useRef as Mr, useEffect as U } from "react";
|
|
2
|
+
var mr = { exports: {} }, J = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Nr;
|
|
13
|
+
function xn() {
|
|
14
|
+
if (Nr)
|
|
15
|
+
return J;
|
|
16
|
+
Nr = 1;
|
|
17
|
+
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.fragment"), w = Object.prototype.hasOwnProperty, x = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function A(I, l, _) {
|
|
19
|
+
var p, E = {}, T = null, D = null;
|
|
20
|
+
_ !== void 0 && (T = "" + _), l.key !== void 0 && (T = "" + l.key), l.ref !== void 0 && (D = l.ref);
|
|
21
|
+
for (p in l)
|
|
22
|
+
w.call(l, p) && !f.hasOwnProperty(p) && (E[p] = l[p]);
|
|
23
|
+
if (I && I.defaultProps)
|
|
24
|
+
for (p in l = I.defaultProps, l)
|
|
25
|
+
E[p] === void 0 && (E[p] = l[p]);
|
|
26
|
+
return { $$typeof: u, type: I, key: T, ref: D, props: E, _owner: x.current };
|
|
27
|
+
}
|
|
28
|
+
return J.Fragment = b, J.jsx = A, J.jsxs = A, J;
|
|
29
|
+
}
|
|
30
|
+
var G = {};
|
|
31
|
+
/**
|
|
32
|
+
* @license React
|
|
33
|
+
* react-jsx-runtime.development.js
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
var Wr;
|
|
41
|
+
function En() {
|
|
42
|
+
return Wr || (Wr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), I = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), X = Symbol.iterator, N = "@@iterator";
|
|
44
|
+
function ir(r) {
|
|
45
|
+
if (r === null || typeof r != "object")
|
|
46
|
+
return null;
|
|
47
|
+
var n = X && r[X] || r[N];
|
|
48
|
+
return typeof n == "function" ? n : null;
|
|
49
|
+
}
|
|
50
|
+
var c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function R(r) {
|
|
52
|
+
{
|
|
53
|
+
for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), e = 1; e < n; e++)
|
|
54
|
+
a[e - 1] = arguments[e];
|
|
55
|
+
W("error", r, a);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function W(r, n, a) {
|
|
59
|
+
{
|
|
60
|
+
var e = c.ReactDebugCurrentFrame, s = e.getStackAddendum();
|
|
61
|
+
s !== "" && (n += "%s", a = a.concat([s]));
|
|
62
|
+
var d = a.map(function(o) {
|
|
63
|
+
return String(o);
|
|
64
|
+
});
|
|
65
|
+
d.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, d);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var F = !1, Y = !1, or = !1, Z = !1, Q = !1, B;
|
|
69
|
+
B = Symbol.for("react.module.reference");
|
|
70
|
+
function sr(r) {
|
|
71
|
+
return !!(typeof r == "string" || typeof r == "function" || r === w || r === f || Q || r === x || r === _ || r === p || Z || r === D || F || Y || or || typeof r == "object" && r !== null && (r.$$typeof === T || r.$$typeof === E || r.$$typeof === A || r.$$typeof === I || r.$$typeof === l || // This needs to include all possible module reference object
|
|
72
|
+
// types supported by any Flight configuration anywhere since
|
|
73
|
+
// we don't know which Flight build this will end up being used
|
|
74
|
+
// with.
|
|
75
|
+
r.$$typeof === B || r.getModuleId !== void 0));
|
|
76
|
+
}
|
|
77
|
+
function ur(r, n, a) {
|
|
78
|
+
var e = r.displayName;
|
|
79
|
+
if (e)
|
|
80
|
+
return e;
|
|
81
|
+
var s = n.displayName || n.name || "";
|
|
82
|
+
return s !== "" ? a + "(" + s + ")" : a;
|
|
83
|
+
}
|
|
84
|
+
function y(r) {
|
|
85
|
+
return r.displayName || "Context";
|
|
86
|
+
}
|
|
87
|
+
function v(r) {
|
|
88
|
+
if (r == null)
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof r.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
91
|
+
return r.displayName || r.name || null;
|
|
92
|
+
if (typeof r == "string")
|
|
93
|
+
return r;
|
|
94
|
+
switch (r) {
|
|
95
|
+
case w:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case b:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case f:
|
|
100
|
+
return "Profiler";
|
|
101
|
+
case x:
|
|
102
|
+
return "StrictMode";
|
|
103
|
+
case _:
|
|
104
|
+
return "Suspense";
|
|
105
|
+
case p:
|
|
106
|
+
return "SuspenseList";
|
|
107
|
+
}
|
|
108
|
+
if (typeof r == "object")
|
|
109
|
+
switch (r.$$typeof) {
|
|
110
|
+
case I:
|
|
111
|
+
var n = r;
|
|
112
|
+
return y(n) + ".Consumer";
|
|
113
|
+
case A:
|
|
114
|
+
var a = r;
|
|
115
|
+
return y(a._context) + ".Provider";
|
|
116
|
+
case l:
|
|
117
|
+
return ur(r, r.render, "ForwardRef");
|
|
118
|
+
case E:
|
|
119
|
+
var e = r.displayName || null;
|
|
120
|
+
return e !== null ? e : v(r.type) || "Memo";
|
|
121
|
+
case T: {
|
|
122
|
+
var s = r, d = s._payload, o = s._init;
|
|
123
|
+
try {
|
|
124
|
+
return v(o(d));
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var m = Object.assign, j = 0, L, O, $, wr, xr, Er, Rr;
|
|
133
|
+
function _r() {
|
|
134
|
+
}
|
|
135
|
+
_r.__reactDisabledLog = !0;
|
|
136
|
+
function Kr() {
|
|
137
|
+
{
|
|
138
|
+
if (j === 0) {
|
|
139
|
+
L = console.log, O = console.info, $ = console.warn, wr = console.error, xr = console.group, Er = console.groupCollapsed, Rr = console.groupEnd;
|
|
140
|
+
var r = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
value: _r,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
info: r,
|
|
148
|
+
log: r,
|
|
149
|
+
warn: r,
|
|
150
|
+
error: r,
|
|
151
|
+
group: r,
|
|
152
|
+
groupCollapsed: r,
|
|
153
|
+
groupEnd: r
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
j++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Jr() {
|
|
160
|
+
{
|
|
161
|
+
if (j--, j === 0) {
|
|
162
|
+
var r = {
|
|
163
|
+
configurable: !0,
|
|
164
|
+
enumerable: !0,
|
|
165
|
+
writable: !0
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperties(console, {
|
|
168
|
+
log: m({}, r, {
|
|
169
|
+
value: L
|
|
170
|
+
}),
|
|
171
|
+
info: m({}, r, {
|
|
172
|
+
value: O
|
|
173
|
+
}),
|
|
174
|
+
warn: m({}, r, {
|
|
175
|
+
value: $
|
|
176
|
+
}),
|
|
177
|
+
error: m({}, r, {
|
|
178
|
+
value: wr
|
|
179
|
+
}),
|
|
180
|
+
group: m({}, r, {
|
|
181
|
+
value: xr
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: m({}, r, {
|
|
184
|
+
value: Er
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: m({}, r, {
|
|
187
|
+
value: Rr
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
j < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var lr = c.ReactCurrentDispatcher, cr;
|
|
195
|
+
function rr(r, n, a) {
|
|
196
|
+
{
|
|
197
|
+
if (cr === void 0)
|
|
198
|
+
try {
|
|
199
|
+
throw Error();
|
|
200
|
+
} catch (s) {
|
|
201
|
+
var e = s.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
cr = e && e[1] || "";
|
|
203
|
+
}
|
|
204
|
+
return `
|
|
205
|
+
` + cr + r;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var dr = !1, nr;
|
|
209
|
+
{
|
|
210
|
+
var Gr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
nr = new Gr();
|
|
212
|
+
}
|
|
213
|
+
function Cr(r, n) {
|
|
214
|
+
if (!r || dr)
|
|
215
|
+
return "";
|
|
216
|
+
{
|
|
217
|
+
var a = nr.get(r);
|
|
218
|
+
if (a !== void 0)
|
|
219
|
+
return a;
|
|
220
|
+
}
|
|
221
|
+
var e;
|
|
222
|
+
dr = !0;
|
|
223
|
+
var s = Error.prepareStackTrace;
|
|
224
|
+
Error.prepareStackTrace = void 0;
|
|
225
|
+
var d;
|
|
226
|
+
d = lr.current, lr.current = null, Kr();
|
|
227
|
+
try {
|
|
228
|
+
if (n) {
|
|
229
|
+
var o = function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
};
|
|
232
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
233
|
+
set: function() {
|
|
234
|
+
throw Error();
|
|
235
|
+
}
|
|
236
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
+
try {
|
|
238
|
+
Reflect.construct(o, []);
|
|
239
|
+
} catch (k) {
|
|
240
|
+
e = k;
|
|
241
|
+
}
|
|
242
|
+
Reflect.construct(r, [], o);
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
o.call();
|
|
246
|
+
} catch (k) {
|
|
247
|
+
e = k;
|
|
248
|
+
}
|
|
249
|
+
r.call(o.prototype);
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
try {
|
|
253
|
+
throw Error();
|
|
254
|
+
} catch (k) {
|
|
255
|
+
e = k;
|
|
256
|
+
}
|
|
257
|
+
r();
|
|
258
|
+
}
|
|
259
|
+
} catch (k) {
|
|
260
|
+
if (k && e && typeof k.stack == "string") {
|
|
261
|
+
for (var i = k.stack.split(`
|
|
262
|
+
`), C = e.stack.split(`
|
|
263
|
+
`), g = i.length - 1, h = C.length - 1; g >= 1 && h >= 0 && i[g] !== C[h]; )
|
|
264
|
+
h--;
|
|
265
|
+
for (; g >= 1 && h >= 0; g--, h--)
|
|
266
|
+
if (i[g] !== C[h]) {
|
|
267
|
+
if (g !== 1 || h !== 1)
|
|
268
|
+
do
|
|
269
|
+
if (g--, h--, h < 0 || i[g] !== C[h]) {
|
|
270
|
+
var P = `
|
|
271
|
+
` + i[g].replace(" at new ", " at ");
|
|
272
|
+
return r.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", r.displayName)), typeof r == "function" && nr.set(r, P), P;
|
|
273
|
+
}
|
|
274
|
+
while (g >= 1 && h >= 0);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
dr = !1, lr.current = d, Jr(), Error.prepareStackTrace = s;
|
|
280
|
+
}
|
|
281
|
+
var z = r ? r.displayName || r.name : "", V = z ? rr(z) : "";
|
|
282
|
+
return typeof r == "function" && nr.set(r, V), V;
|
|
283
|
+
}
|
|
284
|
+
function Hr(r, n, a) {
|
|
285
|
+
return Cr(r, !1);
|
|
286
|
+
}
|
|
287
|
+
function Xr(r) {
|
|
288
|
+
var n = r.prototype;
|
|
289
|
+
return !!(n && n.isReactComponent);
|
|
290
|
+
}
|
|
291
|
+
function ar(r, n, a) {
|
|
292
|
+
if (r == null)
|
|
293
|
+
return "";
|
|
294
|
+
if (typeof r == "function")
|
|
295
|
+
return Cr(r, Xr(r));
|
|
296
|
+
if (typeof r == "string")
|
|
297
|
+
return rr(r);
|
|
298
|
+
switch (r) {
|
|
299
|
+
case _:
|
|
300
|
+
return rr("Suspense");
|
|
301
|
+
case p:
|
|
302
|
+
return rr("SuspenseList");
|
|
303
|
+
}
|
|
304
|
+
if (typeof r == "object")
|
|
305
|
+
switch (r.$$typeof) {
|
|
306
|
+
case l:
|
|
307
|
+
return Hr(r.render);
|
|
308
|
+
case E:
|
|
309
|
+
return ar(r.type, n, a);
|
|
310
|
+
case T: {
|
|
311
|
+
var e = r, s = e._payload, d = e._init;
|
|
312
|
+
try {
|
|
313
|
+
return ar(d(s), n, a);
|
|
314
|
+
} catch {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
var M = Object.prototype.hasOwnProperty, Sr = {}, kr = c.ReactDebugCurrentFrame;
|
|
321
|
+
function er(r) {
|
|
322
|
+
if (r) {
|
|
323
|
+
var n = r._owner, a = ar(r.type, r._source, n ? n.type : null);
|
|
324
|
+
kr.setExtraStackFrame(a);
|
|
325
|
+
} else
|
|
326
|
+
kr.setExtraStackFrame(null);
|
|
327
|
+
}
|
|
328
|
+
function Zr(r, n, a, e, s) {
|
|
329
|
+
{
|
|
330
|
+
var d = Function.call.bind(M);
|
|
331
|
+
for (var o in r)
|
|
332
|
+
if (d(r, o)) {
|
|
333
|
+
var i = void 0;
|
|
334
|
+
try {
|
|
335
|
+
if (typeof r[o] != "function") {
|
|
336
|
+
var C = Error((e || "React class") + ": " + a + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
+
throw C.name = "Invariant Violation", C;
|
|
338
|
+
}
|
|
339
|
+
i = r[o](n, o, e, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (g) {
|
|
341
|
+
i = g;
|
|
342
|
+
}
|
|
343
|
+
i && !(i instanceof Error) && (er(s), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", e || "React class", a, o, typeof i), er(null)), i instanceof Error && !(i.message in Sr) && (Sr[i.message] = !0, er(s), R("Failed %s type: %s", a, i.message), er(null));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var Qr = Array.isArray;
|
|
348
|
+
function fr(r) {
|
|
349
|
+
return Qr(r);
|
|
350
|
+
}
|
|
351
|
+
function rn(r) {
|
|
352
|
+
{
|
|
353
|
+
var n = typeof Symbol == "function" && Symbol.toStringTag, a = n && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
354
|
+
return a;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function nn(r) {
|
|
358
|
+
try {
|
|
359
|
+
return Tr(r), !1;
|
|
360
|
+
} catch {
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function Tr(r) {
|
|
365
|
+
return "" + r;
|
|
366
|
+
}
|
|
367
|
+
function jr(r) {
|
|
368
|
+
if (nn(r))
|
|
369
|
+
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rn(r)), Tr(r);
|
|
370
|
+
}
|
|
371
|
+
var K = c.ReactCurrentOwner, an = {
|
|
372
|
+
key: !0,
|
|
373
|
+
ref: !0,
|
|
374
|
+
__self: !0,
|
|
375
|
+
__source: !0
|
|
376
|
+
}, Or, Pr, pr;
|
|
377
|
+
pr = {};
|
|
378
|
+
function en(r) {
|
|
379
|
+
if (M.call(r, "ref")) {
|
|
380
|
+
var n = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
381
|
+
if (n && n.isReactWarning)
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
return r.ref !== void 0;
|
|
385
|
+
}
|
|
386
|
+
function tn(r) {
|
|
387
|
+
if (M.call(r, "key")) {
|
|
388
|
+
var n = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
389
|
+
if (n && n.isReactWarning)
|
|
390
|
+
return !1;
|
|
391
|
+
}
|
|
392
|
+
return r.key !== void 0;
|
|
393
|
+
}
|
|
394
|
+
function on(r, n) {
|
|
395
|
+
if (typeof r.ref == "string" && K.current && n && K.current.stateNode !== n) {
|
|
396
|
+
var a = v(K.current.type);
|
|
397
|
+
pr[a] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', v(K.current.type), r.ref), pr[a] = !0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function sn(r, n) {
|
|
401
|
+
{
|
|
402
|
+
var a = function() {
|
|
403
|
+
Or || (Or = !0, R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
404
|
+
};
|
|
405
|
+
a.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
406
|
+
get: a,
|
|
407
|
+
configurable: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function un(r, n) {
|
|
412
|
+
{
|
|
413
|
+
var a = function() {
|
|
414
|
+
Pr || (Pr = !0, R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
415
|
+
};
|
|
416
|
+
a.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
417
|
+
get: a,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var ln = function(r, n, a, e, s, d, o) {
|
|
423
|
+
var i = {
|
|
424
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
+
$$typeof: u,
|
|
426
|
+
// Built-in properties that belong on the element
|
|
427
|
+
type: r,
|
|
428
|
+
key: n,
|
|
429
|
+
ref: a,
|
|
430
|
+
props: o,
|
|
431
|
+
// Record the component responsible for creating this element.
|
|
432
|
+
_owner: d
|
|
433
|
+
};
|
|
434
|
+
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
435
|
+
configurable: !1,
|
|
436
|
+
enumerable: !1,
|
|
437
|
+
writable: !0,
|
|
438
|
+
value: !1
|
|
439
|
+
}), Object.defineProperty(i, "_self", {
|
|
440
|
+
configurable: !1,
|
|
441
|
+
enumerable: !1,
|
|
442
|
+
writable: !1,
|
|
443
|
+
value: e
|
|
444
|
+
}), Object.defineProperty(i, "_source", {
|
|
445
|
+
configurable: !1,
|
|
446
|
+
enumerable: !1,
|
|
447
|
+
writable: !1,
|
|
448
|
+
value: s
|
|
449
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
450
|
+
};
|
|
451
|
+
function cn(r, n, a, e, s) {
|
|
452
|
+
{
|
|
453
|
+
var d, o = {}, i = null, C = null;
|
|
454
|
+
a !== void 0 && (jr(a), i = "" + a), tn(n) && (jr(n.key), i = "" + n.key), en(n) && (C = n.ref, on(n, s));
|
|
455
|
+
for (d in n)
|
|
456
|
+
M.call(n, d) && !an.hasOwnProperty(d) && (o[d] = n[d]);
|
|
457
|
+
if (r && r.defaultProps) {
|
|
458
|
+
var g = r.defaultProps;
|
|
459
|
+
for (d in g)
|
|
460
|
+
o[d] === void 0 && (o[d] = g[d]);
|
|
461
|
+
}
|
|
462
|
+
if (i || C) {
|
|
463
|
+
var h = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
464
|
+
i && sn(o, h), C && un(o, h);
|
|
465
|
+
}
|
|
466
|
+
return ln(r, i, C, s, e, K.current, o);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
var vr = c.ReactCurrentOwner, Ir = c.ReactDebugCurrentFrame;
|
|
470
|
+
function q(r) {
|
|
471
|
+
if (r) {
|
|
472
|
+
var n = r._owner, a = ar(r.type, r._source, n ? n.type : null);
|
|
473
|
+
Ir.setExtraStackFrame(a);
|
|
474
|
+
} else
|
|
475
|
+
Ir.setExtraStackFrame(null);
|
|
476
|
+
}
|
|
477
|
+
var gr;
|
|
478
|
+
gr = !1;
|
|
479
|
+
function hr(r) {
|
|
480
|
+
return typeof r == "object" && r !== null && r.$$typeof === u;
|
|
481
|
+
}
|
|
482
|
+
function Dr() {
|
|
483
|
+
{
|
|
484
|
+
if (vr.current) {
|
|
485
|
+
var r = v(vr.current.type);
|
|
486
|
+
if (r)
|
|
487
|
+
return `
|
|
488
|
+
|
|
489
|
+
Check the render method of \`` + r + "`.";
|
|
490
|
+
}
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function dn(r) {
|
|
495
|
+
{
|
|
496
|
+
if (r !== void 0) {
|
|
497
|
+
var n = r.fileName.replace(/^.*[\\\/]/, ""), a = r.lineNumber;
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check your code at ` + n + ":" + a + ".";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
var Ar = {};
|
|
506
|
+
function fn(r) {
|
|
507
|
+
{
|
|
508
|
+
var n = Dr();
|
|
509
|
+
if (!n) {
|
|
510
|
+
var a = typeof r == "string" ? r : r.displayName || r.name;
|
|
511
|
+
a && (n = `
|
|
512
|
+
|
|
513
|
+
Check the top-level render call using <` + a + ">.");
|
|
514
|
+
}
|
|
515
|
+
return n;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function Fr(r, n) {
|
|
519
|
+
{
|
|
520
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
521
|
+
return;
|
|
522
|
+
r._store.validated = !0;
|
|
523
|
+
var a = fn(n);
|
|
524
|
+
if (Ar[a])
|
|
525
|
+
return;
|
|
526
|
+
Ar[a] = !0;
|
|
527
|
+
var e = "";
|
|
528
|
+
r && r._owner && r._owner !== vr.current && (e = " It was passed a child from " + v(r._owner.type) + "."), q(r), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, e), q(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function Lr(r, n) {
|
|
532
|
+
{
|
|
533
|
+
if (typeof r != "object")
|
|
534
|
+
return;
|
|
535
|
+
if (fr(r))
|
|
536
|
+
for (var a = 0; a < r.length; a++) {
|
|
537
|
+
var e = r[a];
|
|
538
|
+
hr(e) && Fr(e, n);
|
|
539
|
+
}
|
|
540
|
+
else if (hr(r))
|
|
541
|
+
r._store && (r._store.validated = !0);
|
|
542
|
+
else if (r) {
|
|
543
|
+
var s = ir(r);
|
|
544
|
+
if (typeof s == "function" && s !== r.entries)
|
|
545
|
+
for (var d = s.call(r), o; !(o = d.next()).done; )
|
|
546
|
+
hr(o.value) && Fr(o.value, n);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function pn(r) {
|
|
551
|
+
{
|
|
552
|
+
var n = r.type;
|
|
553
|
+
if (n == null || typeof n == "string")
|
|
554
|
+
return;
|
|
555
|
+
var a;
|
|
556
|
+
if (typeof n == "function")
|
|
557
|
+
a = n.propTypes;
|
|
558
|
+
else if (typeof n == "object" && (n.$$typeof === l || // Note: Memo only checks outer props here.
|
|
559
|
+
// Inner props are checked in the reconciler.
|
|
560
|
+
n.$$typeof === E))
|
|
561
|
+
a = n.propTypes;
|
|
562
|
+
else
|
|
563
|
+
return;
|
|
564
|
+
if (a) {
|
|
565
|
+
var e = v(n);
|
|
566
|
+
Zr(a, r.props, "prop", e, r);
|
|
567
|
+
} else if (n.PropTypes !== void 0 && !gr) {
|
|
568
|
+
gr = !0;
|
|
569
|
+
var s = v(n);
|
|
570
|
+
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
571
|
+
}
|
|
572
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function vn(r) {
|
|
576
|
+
{
|
|
577
|
+
for (var n = Object.keys(r.props), a = 0; a < n.length; a++) {
|
|
578
|
+
var e = n[a];
|
|
579
|
+
if (e !== "children" && e !== "key") {
|
|
580
|
+
q(r), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", e), q(null);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
r.ref !== null && (q(r), R("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
var $r = {};
|
|
588
|
+
function Vr(r, n, a, e, s, d) {
|
|
589
|
+
{
|
|
590
|
+
var o = sr(r);
|
|
591
|
+
if (!o) {
|
|
592
|
+
var i = "";
|
|
593
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
+
var C = dn(s);
|
|
595
|
+
C ? i += C : i += Dr();
|
|
596
|
+
var g;
|
|
597
|
+
r === null ? g = "null" : fr(r) ? g = "array" : r !== void 0 && r.$$typeof === u ? (g = "<" + (v(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : g = typeof r, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, i);
|
|
598
|
+
}
|
|
599
|
+
var h = cn(r, n, a, s, d);
|
|
600
|
+
if (h == null)
|
|
601
|
+
return h;
|
|
602
|
+
if (o) {
|
|
603
|
+
var P = n.children;
|
|
604
|
+
if (P !== void 0)
|
|
605
|
+
if (e)
|
|
606
|
+
if (fr(P)) {
|
|
607
|
+
for (var z = 0; z < P.length; z++)
|
|
608
|
+
Lr(P[z], r);
|
|
609
|
+
Object.freeze && Object.freeze(P);
|
|
610
|
+
} else
|
|
611
|
+
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
|
+
else
|
|
613
|
+
Lr(P, r);
|
|
614
|
+
}
|
|
615
|
+
if (M.call(n, "key")) {
|
|
616
|
+
var V = v(r), k = Object.keys(n).filter(function(wn) {
|
|
617
|
+
return wn !== "key";
|
|
618
|
+
}), br = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!$r[V + br]) {
|
|
620
|
+
var mn = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
+
R(`A props object containing a "key" prop is being spread into JSX:
|
|
622
|
+
let props = %s;
|
|
623
|
+
<%s {...props} />
|
|
624
|
+
React keys must be passed directly to JSX without using spread:
|
|
625
|
+
let props = %s;
|
|
626
|
+
<%s key={someKey} {...props} />`, br, V, mn, V), $r[V + br] = !0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return r === w ? vn(h) : pn(h), h;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function gn(r, n, a) {
|
|
633
|
+
return Vr(r, n, a, !0);
|
|
634
|
+
}
|
|
635
|
+
function hn(r, n, a) {
|
|
636
|
+
return Vr(r, n, a, !1);
|
|
637
|
+
}
|
|
638
|
+
var bn = hn, yn = gn;
|
|
639
|
+
G.Fragment = w, G.jsx = bn, G.jsxs = yn;
|
|
640
|
+
}()), G;
|
|
641
|
+
}
|
|
642
|
+
process.env.NODE_ENV === "production" ? mr.exports = xn() : mr.exports = En();
|
|
643
|
+
var S = mr.exports;
|
|
644
|
+
const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
|
+
|
|
646
|
+
* {
|
|
647
|
+
margin: 0;
|
|
648
|
+
padding: 0;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
:root {
|
|
652
|
+
/* spacing */
|
|
653
|
+
--starasia-ui-input-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
|
|
654
|
+
--starasia-ui-input-spacing-sm: var(--starasia-ui-spacing-sm, 8px);
|
|
655
|
+
--starasia-ui-input-spacing-ms: var(--starasia-ui-spacing-12, 12px);
|
|
656
|
+
--starasia-ui-input-spacing-md: var(--starasia-ui-spacing-lg, 16px);
|
|
657
|
+
--starasia-ui-input-spacing-lg: var(--starasia-ui-spacing-xl, 24px);
|
|
658
|
+
|
|
659
|
+
/* color */
|
|
660
|
+
/* blue */
|
|
661
|
+
--starasia-ui-input-color-primary-blue: var(
|
|
662
|
+
--starasia-ui-color-blue-700,
|
|
663
|
+
#1d4ed8
|
|
664
|
+
);
|
|
665
|
+
--starasia-ui-input-color-secondary-blue: var(
|
|
666
|
+
--starasia-ui-color-blue-500,
|
|
667
|
+
#3b82f6
|
|
668
|
+
);
|
|
669
|
+
--starasia-ui-input-color-tertiary-blue: var(
|
|
670
|
+
--starasia-ui-color-blue-300,
|
|
671
|
+
#93c5fd
|
|
672
|
+
);
|
|
673
|
+
--starasia-ui-input-color-quaternary-blue: var(
|
|
674
|
+
--starasia-ui-color-blue-100,
|
|
675
|
+
#dbeafe
|
|
676
|
+
);
|
|
677
|
+
--starasia-ui-input-color-quinary-blue: var(
|
|
678
|
+
--starasia-ui-color-blue-50,
|
|
679
|
+
#eff6ff
|
|
680
|
+
);
|
|
681
|
+
/* gray */
|
|
682
|
+
--starasia-ui-input-color-primary-gray: var(
|
|
683
|
+
--starasia-ui-color-gray-700,
|
|
684
|
+
#374151
|
|
685
|
+
);
|
|
686
|
+
--starasia-ui-input-color-secondary-gray: var(
|
|
687
|
+
--starasia-ui-color-gray-500,
|
|
688
|
+
#6b7280
|
|
689
|
+
);
|
|
690
|
+
--starasia-ui-input-color-tertiary-gray: var(
|
|
691
|
+
--starasia-ui-color-gray-300,
|
|
692
|
+
#d1d5db
|
|
693
|
+
);
|
|
694
|
+
--starasia-ui-input-color-quaternary-gray: var(
|
|
695
|
+
--starasia-ui-color-gray-100,
|
|
696
|
+
#f3f4f6
|
|
697
|
+
);
|
|
698
|
+
--starasia-ui-input-color-quinary-gray: var(
|
|
699
|
+
--starasia-ui-color-gray-50,
|
|
700
|
+
#f9fafb
|
|
701
|
+
);
|
|
702
|
+
/* red */
|
|
703
|
+
--starasia-ui-input-color-primary-red: var(
|
|
704
|
+
--starasia-ui-color-red-700,
|
|
705
|
+
#b91c1c
|
|
706
|
+
);
|
|
707
|
+
--starasia-ui-input-color-secondary-red: var(
|
|
708
|
+
--starasia-ui-color-red-500,
|
|
709
|
+
#ef4444
|
|
710
|
+
);
|
|
711
|
+
--starasia-ui-input-color-tertiary-red: var(
|
|
712
|
+
--starasia-ui-color-red-300,
|
|
713
|
+
#fca5a5
|
|
714
|
+
);
|
|
715
|
+
--starasia-ui-input-color-quaternary-red: var(
|
|
716
|
+
--starasia-ui-color-red-100,
|
|
717
|
+
#fee2e2
|
|
718
|
+
);
|
|
719
|
+
--starasia-ui-input-color-quinary-red: var(
|
|
720
|
+
--starasia-ui-color-red-50,
|
|
721
|
+
#fef2f2
|
|
722
|
+
);
|
|
723
|
+
/* yellow */
|
|
724
|
+
--starasia-ui-input-color-primary-yellow: var(
|
|
725
|
+
--starasia-ui-color-yellow-700,
|
|
726
|
+
#a16207
|
|
727
|
+
);
|
|
728
|
+
--starasia-ui-input-color-secondary-yellow: var(
|
|
729
|
+
--starasia-ui-color-yellow-500,
|
|
730
|
+
#eab308
|
|
731
|
+
);
|
|
732
|
+
--starasia-ui-input-color-tertiary-yellow: var(
|
|
733
|
+
--starasia-ui-color-yellow-300,
|
|
734
|
+
#fde047
|
|
735
|
+
);
|
|
736
|
+
--starasia-ui-input-color-quaternary-yellow: var(
|
|
737
|
+
--starasia-ui-color-yellow-100,
|
|
738
|
+
#fef9c3
|
|
739
|
+
);
|
|
740
|
+
--starasia-ui-input-color-quinary-yellow: var(
|
|
741
|
+
--starasia-ui-color-yellow-50,
|
|
742
|
+
#fefce8
|
|
743
|
+
);
|
|
744
|
+
|
|
745
|
+
/* text color */
|
|
746
|
+
--starasia-ui-text-default: var(--starasia-ui-color-gray-900);
|
|
747
|
+
--starasia-ui-color-text: var(--starasia-ui-text-default);
|
|
748
|
+
|
|
749
|
+
/* border width */
|
|
750
|
+
--starasia-ui-input-border-width: var(--starasia-ui-border, 1px);
|
|
751
|
+
|
|
752
|
+
/* border color */
|
|
753
|
+
--starasia-ui-color-border: rgba(120, 134, 127, 0.2);
|
|
754
|
+
|
|
755
|
+
/* height */
|
|
756
|
+
--starasia-ui-input-height-sm: var(--starasia-ui-h-8, 32px);
|
|
757
|
+
/* --starasia-ui-input-height-md: var(--starasia-ui-h-10, 40px); */
|
|
758
|
+
--starasia-ui-input-height-md: 38px;
|
|
759
|
+
--starasia-ui-input-height-lg: var(--starasia-ui-h-12, 48px);
|
|
760
|
+
|
|
761
|
+
/* border radius */
|
|
762
|
+
--starasia-ui-input-border-radius-sm: var(--starasia-ui-radii-md, 8px);
|
|
763
|
+
--starasia-ui-input-border-radius-md: var(--starasia-ui-radii-md, 8px);
|
|
764
|
+
--starasia-ui-input-border-radius-lg: var(--starasia-ui-radii-lg, 12px);
|
|
765
|
+
|
|
766
|
+
--starasia-ui-input-placeholder-color: var(
|
|
767
|
+
--starasia-ui-color-gray-200,
|
|
768
|
+
#c9cecc
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.starasia-input-container {
|
|
773
|
+
box-sizing: border-box;
|
|
774
|
+
overflow: hidden;
|
|
775
|
+
display: flex;
|
|
776
|
+
align-items: center;
|
|
777
|
+
/* gap: var(--starasia-ui-input-spacing-sm); */
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.starasia-input-container:has(input:focus) {
|
|
781
|
+
border-color: var(--starasia-ui-input-color-primary-blue);
|
|
782
|
+
box-shadow: 0px 0px 0px 2px var(--starasia-ui-input-color-quaternary-blue);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.starasia-input-container:has(input:disabled)
|
|
786
|
+
.starasia-input-container-icon-left {
|
|
787
|
+
background-color: #f2f3f2;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.starasia-input-container:has(input:disabled)
|
|
791
|
+
.starasia-input-container-icon-right {
|
|
792
|
+
background-color: #f2f3f2;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.starasia-input-container:has(input:disabled) {
|
|
796
|
+
/* border-color: var(--starasia-ui-input-color-tertiary-gray); */
|
|
797
|
+
/* background-color: var(--starasia-ui-input-color-tertiary-gray); */
|
|
798
|
+
border-color: rgba(120, 134, 127, 0.2);
|
|
799
|
+
background-color: #f2f3f2;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.starasia-input-container:has(input:disabled) input {
|
|
803
|
+
color: #939e99 !important;
|
|
804
|
+
border-color: rgba(120, 134, 127, 0.2);
|
|
805
|
+
background-color: #f2f3f2;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.starasia-input-outline.starasia-input-container-error {
|
|
809
|
+
border-color: var(--starasia-ui-input-color-secondary-red) !important;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.starasia-input-filled.starasia-input-container-error {
|
|
813
|
+
border-color: var(--starasia-ui-input-color-secondary-red) !important;
|
|
814
|
+
background-color: var(--starasia-ui-input-color-quinary-red);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
.starasia-input-flushed.starasia-input-container-error {
|
|
818
|
+
border-color: var(--starasia-ui-input-color-secondary-red) !important;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.starasia-input-outline.starasia-input-container-warning {
|
|
822
|
+
border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.starasia-input-filled.starasia-input-container-warning {
|
|
826
|
+
border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
|
|
827
|
+
background-color: var(--starasia-ui-input-color-quinary-yellow);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.starasia-input-flushed.starasia-input-container-warning {
|
|
831
|
+
border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.starasia-input-outline {
|
|
835
|
+
border-color: var(--starasia-ui-color-border);
|
|
836
|
+
background-color: transparent;
|
|
837
|
+
border-width: var(--starasia-ui-input-border-width);
|
|
838
|
+
border-style: solid;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.starasia-input-filled {
|
|
842
|
+
border-width: var(--starasia-ui-input-border-width);
|
|
843
|
+
border-style: solid;
|
|
844
|
+
border-color: var(--starasia-ui-input-color-quinary-gray);
|
|
845
|
+
background-color: var(--starasia-ui-input-color-quinary-gray);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
.starasia-input-flushed.starasia-input-container:has(input:focus) {
|
|
849
|
+
box-shadow: none;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
.starasia-input-flushed {
|
|
853
|
+
border-bottom: var(--starasia-ui-input-border-width) solid
|
|
854
|
+
var(--starasia-ui-input-color-tertiary-gray);
|
|
855
|
+
border-bottom-left-radius: 0 !important;
|
|
856
|
+
border-bottom-right-radius: 0 !important;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.starasia-input-container.sm {
|
|
860
|
+
height: var(--starasia-ui-input-height-sm);
|
|
861
|
+
border-radius: var(--starasia-ui-input-border-radius-sm);
|
|
862
|
+
font-size: var(--starasia-ui-fontSizes-sm, 12px);
|
|
863
|
+
/* padding-inline: var(--starasia-ui-input-spacing-sm); */
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.starasia-input-container.md {
|
|
867
|
+
height: var(--starasia-ui-input-height-md);
|
|
868
|
+
border-radius: var(--starasia-ui-input-border-radius-md);
|
|
869
|
+
font-size: var(--starasia-ui-fontSizes-md, 14px);
|
|
870
|
+
/* padding-inline: var(--starasia-ui-input-spacing-ms); */
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.starasia-input-container.lg {
|
|
874
|
+
height: var(--starasia-ui-input-height-lg);
|
|
875
|
+
border-radius: var(--starasia-ui-input-border-radius-lg);
|
|
876
|
+
font-size: var(--starasia-ui-fontSizes-lg, 16px);
|
|
877
|
+
/* padding-inline: var(--starasia-ui-input-spacing-ms); */
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.starasia-input-preview-container {
|
|
881
|
+
width: 100%;
|
|
882
|
+
position: relative;
|
|
883
|
+
z-index: 1;
|
|
884
|
+
height: 100%;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.starasia-input-placeholder {
|
|
888
|
+
position: absolute;
|
|
889
|
+
top: 50%;
|
|
890
|
+
left: 8px;
|
|
891
|
+
transform: translateY(-50%);
|
|
892
|
+
font-family: "Poppins", serif;
|
|
893
|
+
color: var(--starasia-ui-input-placeholder-color);
|
|
894
|
+
font-weight: var(--starasia-ui-fontWeights-normal, 300);
|
|
895
|
+
pointer-events: none;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.starasia-input-placeholder-highlighted {
|
|
899
|
+
color: var(--starasia-ui-input-color-primary-gray);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.starasia-input-preview-container
|
|
903
|
+
.starasia-input:focus
|
|
904
|
+
+ .starasia-input-placeholder {
|
|
905
|
+
display: none;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.starasia-input {
|
|
909
|
+
width: 100%;
|
|
910
|
+
box-sizing: border-box;
|
|
911
|
+
height: 100%;
|
|
912
|
+
border: none;
|
|
913
|
+
outline: none;
|
|
914
|
+
font-family: "Poppins", serif;
|
|
915
|
+
font-size: inherit;
|
|
916
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
917
|
+
background: transparent;
|
|
918
|
+
color: var(--starasia-ui-color-text);
|
|
919
|
+
padding-inline: var(--starasia-ui-input-spacing-sm) !important;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/* .starasia-input-container:not(:has(.starasia-input-container-icon-left)) .starasia-input {
|
|
923
|
+
padding-inline: 12px !important;
|
|
924
|
+
} */
|
|
925
|
+
/* just icon */
|
|
926
|
+
|
|
927
|
+
/* INPUT ICON */
|
|
928
|
+
.starasia-input-container-icon-left {
|
|
929
|
+
display: flex;
|
|
930
|
+
height: 100%;
|
|
931
|
+
align-items: center;
|
|
932
|
+
padding-left: 12px;
|
|
933
|
+
background: transparent;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.starasia-input-container-icon-right {
|
|
937
|
+
display: flex;
|
|
938
|
+
height: 100%;
|
|
939
|
+
align-items: center;
|
|
940
|
+
padding-right: 12px;
|
|
941
|
+
background: transparent;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/* INPUT ADDONS */
|
|
945
|
+
.starasia-input-container-addons-left {
|
|
946
|
+
background-color: rgba(120, 134, 127, 0.1);
|
|
947
|
+
height: 100%;
|
|
948
|
+
display: flex;
|
|
949
|
+
padding-inline: var(--starasia-ui-input-spacing-ms);
|
|
950
|
+
align-items: center;
|
|
951
|
+
justify-content: center;
|
|
952
|
+
font-family: "Poppins", serif;
|
|
953
|
+
color: var(--starasia-ui-input-color-secondary-gray);
|
|
954
|
+
border-right: 1px solid var(--starasia-ui-color-border);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.starasia-input-container-addons-right {
|
|
958
|
+
background-color: rgba(120, 134, 127, 0.1);
|
|
959
|
+
height: 100%;
|
|
960
|
+
display: flex;
|
|
961
|
+
padding-inline: var(--starasia-ui-input-spacing-ms);
|
|
962
|
+
align-items: center;
|
|
963
|
+
justify-content: center;
|
|
964
|
+
font-family: "Poppins", serif;
|
|
965
|
+
color: var(--starasia-ui-input-color-secondary-gray);
|
|
966
|
+
border-left: 1px solid var(--starasia-ui-color-border);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.starasia-input-container:has(input:disabled)
|
|
970
|
+
.starasia-input-container-addons-right {
|
|
971
|
+
background-color: rgba(120, 134, 127, 0.3) !important;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.starasia-input-container:has(input:disabled)
|
|
975
|
+
.starasia-input-container-addons-left {
|
|
976
|
+
background-color: rgba(120, 134, 127, 0.3) !important;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
.starasia-input::placeholder {
|
|
980
|
+
color: var(--starasia-ui-input-placeholder-color);
|
|
981
|
+
font-weight: var(--starasia-ui-fontWeights-normal, 300);
|
|
982
|
+
}
|
|
983
|
+
`, Yr = (t) => {
|
|
984
|
+
if (t === "sm")
|
|
985
|
+
return 16;
|
|
986
|
+
if (t === "md")
|
|
987
|
+
return 16;
|
|
988
|
+
if (t === "lg")
|
|
989
|
+
return 20;
|
|
990
|
+
}, qr = (t) => t === "default" ? "#939E99" : t === "error" ? "#EF4444" : t === "warning" ? "#EAB308" : "#939E99", zr = (t) => t === "default" ? "#939E99" : t === "error" ? "#EF4444" : t === "warning" ? "#EAB308" : "#939E99", _n = Br(
|
|
991
|
+
({ options: t, value: u, setValue: b, isComponentVisible: w, onOptionChange: x }, f) => {
|
|
992
|
+
const [A, I] = H([]), l = Mr(null), _ = () => {
|
|
993
|
+
if (f != null && f.current && l.current) {
|
|
994
|
+
const p = window.innerHeight, E = f == null ? void 0 : f.current.getBoundingClientRect(), T = l.current.getBoundingClientRect(), D = E.bottom + T.height;
|
|
995
|
+
l.current.style.left = `${E.left}px`, l.current.style.width = `${E.width}px`, D >= p - 10 ? l.current.style.top = `${E.top - T.height - 5}px` : l.current.style.top = `${E.top + E.height}px`;
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
return U(() => (window.addEventListener("scroll", _), window.addEventListener("resize", _), () => {
|
|
999
|
+
window.removeEventListener("scroll", _), window.removeEventListener("resize", _);
|
|
1000
|
+
}), [f, l]), U(() => {
|
|
1001
|
+
_();
|
|
1002
|
+
}, [w]), U(() => {
|
|
1003
|
+
I(
|
|
1004
|
+
(t == null ? void 0 : t.filter(
|
|
1005
|
+
(p) => p.toLowerCase().startsWith(u.toLowerCase())
|
|
1006
|
+
)) || []
|
|
1007
|
+
);
|
|
1008
|
+
}, [u, t]), /* @__PURE__ */ S.jsx(
|
|
1009
|
+
"div",
|
|
1010
|
+
{
|
|
1011
|
+
ref: l,
|
|
1012
|
+
style: {
|
|
1013
|
+
position: "fixed",
|
|
1014
|
+
padding: "8px",
|
|
1015
|
+
boxSizing: "border-box",
|
|
1016
|
+
boxShadow: "0px 8px 12px 0px rgba(0, 0, 0, 0.08)",
|
|
1017
|
+
borderRadius: "8px",
|
|
1018
|
+
background: "white",
|
|
1019
|
+
overflow: "auto",
|
|
1020
|
+
zIndex: 5e4
|
|
1021
|
+
},
|
|
1022
|
+
children: A == null ? void 0 : A.map(
|
|
1023
|
+
(p) => Cn(p, u, b, x)
|
|
1024
|
+
)
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
}
|
|
1028
|
+
), Cn = (t, u, b, w) => {
|
|
1029
|
+
const x = t.toLowerCase().indexOf(u.toLowerCase());
|
|
1030
|
+
return /* @__PURE__ */ S.jsxs(
|
|
1031
|
+
"p",
|
|
1032
|
+
{
|
|
1033
|
+
style: {
|
|
1034
|
+
fontFamily: "Poppins",
|
|
1035
|
+
color: "#c9cecc",
|
|
1036
|
+
fontWeight: 500,
|
|
1037
|
+
padding: "8px 14px",
|
|
1038
|
+
cursor: "pointer"
|
|
1039
|
+
},
|
|
1040
|
+
onClick: () => {
|
|
1041
|
+
b(t), w && w(t);
|
|
1042
|
+
},
|
|
1043
|
+
children: [
|
|
1044
|
+
t.slice(0, x),
|
|
1045
|
+
/* @__PURE__ */ S.jsx("span", { style: { color: "#374151" }, children: t.slice(x, x + u.length) }),
|
|
1046
|
+
t.slice(x + u.length)
|
|
1047
|
+
]
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
};
|
|
1051
|
+
function Sn(t) {
|
|
1052
|
+
const [u, b] = H(t), w = Mr(null), x = (f) => {
|
|
1053
|
+
w.current && !w.current.contains(f.target) && b(!1);
|
|
1054
|
+
};
|
|
1055
|
+
return U(() => (document.addEventListener("click", x, !0), () => {
|
|
1056
|
+
document.removeEventListener("click", x, !0);
|
|
1057
|
+
}), []), { ref: w, isComponentVisible: u, setIsComponentVisible: b };
|
|
1058
|
+
}
|
|
1059
|
+
const Ur = "starasia-input-styles", kn = (t) => {
|
|
1060
|
+
if (!document.getElementById(Ur)) {
|
|
1061
|
+
const u = document.createElement("style");
|
|
1062
|
+
u.id = Ur, u.textContent = t, document.head.appendChild(u);
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
kn(Rn);
|
|
1066
|
+
function Tn(t) {
|
|
1067
|
+
return Number(t.replace(/\./g, ""));
|
|
1068
|
+
}
|
|
1069
|
+
const yr = (t) => {
|
|
1070
|
+
let u = t.replace(/[^\d]/g, "");
|
|
1071
|
+
return u = u.replace(/^0+(?=\d)/, ""), u.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
1072
|
+
}, Pn = Br(
|
|
1073
|
+
(t, u) => {
|
|
1074
|
+
const {
|
|
1075
|
+
leftIcon: b,
|
|
1076
|
+
rightIcon: w,
|
|
1077
|
+
size: x = "md",
|
|
1078
|
+
status: f = "default",
|
|
1079
|
+
inputUse: A = "icon",
|
|
1080
|
+
variant: I = "outline",
|
|
1081
|
+
leftAddons: l,
|
|
1082
|
+
rightAddons: _,
|
|
1083
|
+
onClickLeftIcon: p,
|
|
1084
|
+
onClickRightIcon: E,
|
|
1085
|
+
highlightPlaceholder: T,
|
|
1086
|
+
currency: D,
|
|
1087
|
+
fullWidth: X = !1,
|
|
1088
|
+
options: N,
|
|
1089
|
+
onOptionChange: ir,
|
|
1090
|
+
...c
|
|
1091
|
+
} = t;
|
|
1092
|
+
{
|
|
1093
|
+
const [R, W] = H(!0), [F, Y] = H(""), [or, Z] = H(""), {
|
|
1094
|
+
isComponentVisible: Q,
|
|
1095
|
+
ref: B,
|
|
1096
|
+
setIsComponentVisible: sr
|
|
1097
|
+
} = Sn(!1), ur = () => {
|
|
1098
|
+
sr((y) => !y);
|
|
1099
|
+
};
|
|
1100
|
+
return U(() => {
|
|
1101
|
+
typeof c.value == "string" && c.value.length || c.defaultValue || typeof c.value == "number" ? W(!1) : W(!0);
|
|
1102
|
+
}, [c.value, c.defaultValue]), U(() => {
|
|
1103
|
+
Y(D ? yr(String(c.value)) : c.value || "");
|
|
1104
|
+
}, [c]), /* @__PURE__ */ S.jsxs(
|
|
1105
|
+
"div",
|
|
1106
|
+
{
|
|
1107
|
+
className: `starasia-input-container starasia-input-${I} starasia-input-container-${f} ${x} `,
|
|
1108
|
+
style: {
|
|
1109
|
+
width: X ? "auto" : "max-content",
|
|
1110
|
+
position: "relative"
|
|
1111
|
+
},
|
|
1112
|
+
ref: B,
|
|
1113
|
+
onClick: ur,
|
|
1114
|
+
children: [
|
|
1115
|
+
l ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-addons-left", children: l }) : null,
|
|
1116
|
+
b ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-icon-left", children: tr.cloneElement(b, {
|
|
1117
|
+
width: Yr(x),
|
|
1118
|
+
color: qr(c.disabled ? "disable" : f),
|
|
1119
|
+
onClick: p,
|
|
1120
|
+
style: {
|
|
1121
|
+
color: `${qr(
|
|
1122
|
+
c.disabled ? "disable" : f
|
|
1123
|
+
)}`
|
|
1124
|
+
}
|
|
1125
|
+
}) }) : null,
|
|
1126
|
+
/* @__PURE__ */ S.jsxs("div", { className: "starasia-input-preview-container", children: [
|
|
1127
|
+
/* @__PURE__ */ S.jsx(
|
|
1128
|
+
"input",
|
|
1129
|
+
{
|
|
1130
|
+
className: "starasia-input",
|
|
1131
|
+
...c,
|
|
1132
|
+
placeholder: "",
|
|
1133
|
+
disabled: f === "disable" ? !0 : c.disabled,
|
|
1134
|
+
ref: u,
|
|
1135
|
+
onChange: (y) => {
|
|
1136
|
+
let v = D ? yr(y.target.value) : y.target.value;
|
|
1137
|
+
const m = y.target.selectionStart;
|
|
1138
|
+
if (D)
|
|
1139
|
+
if (or === "Backspace")
|
|
1140
|
+
if (typeof m == "number" && F[m] === ".") {
|
|
1141
|
+
let j = v.slice(0, m - 1), L = v.slice(
|
|
1142
|
+
m,
|
|
1143
|
+
v.length
|
|
1144
|
+
);
|
|
1145
|
+
v = yr(j + L);
|
|
1146
|
+
const O = F.length - 1, $ = v.length - 1;
|
|
1147
|
+
setTimeout(
|
|
1148
|
+
() => y.target.setSelectionRange(
|
|
1149
|
+
m - (O - $) < 0 ? 0 : m - (O - $),
|
|
1150
|
+
m - (O - $) < 0 ? 0 : m - (O - $)
|
|
1151
|
+
),
|
|
1152
|
+
0
|
|
1153
|
+
);
|
|
1154
|
+
} else {
|
|
1155
|
+
const j = F.length - 1, L = v.length - 1;
|
|
1156
|
+
let O = m + 1 - (j - L);
|
|
1157
|
+
setTimeout(
|
|
1158
|
+
() => y.target.setSelectionRange(
|
|
1159
|
+
O < 0 ? 0 : O,
|
|
1160
|
+
O < 0 ? 0 : O
|
|
1161
|
+
),
|
|
1162
|
+
0
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
else {
|
|
1166
|
+
const j = F.length - 1, L = v.length - 1;
|
|
1167
|
+
setTimeout(
|
|
1168
|
+
() => y.target.setSelectionRange(
|
|
1169
|
+
m + (L - j) - 1,
|
|
1170
|
+
m + (L - j) - 1
|
|
1171
|
+
),
|
|
1172
|
+
0
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
Y(v), y.target.value ? W(!1) : W(!0), c.onChange && c.onChange({
|
|
1176
|
+
...y,
|
|
1177
|
+
target: {
|
|
1178
|
+
...y.target,
|
|
1179
|
+
value: D ? String(Tn(v)) : v,
|
|
1180
|
+
name: y.target.name
|
|
1181
|
+
}
|
|
1182
|
+
}), Z("");
|
|
1183
|
+
},
|
|
1184
|
+
value: F,
|
|
1185
|
+
onKeyDown: (y) => {
|
|
1186
|
+
y.key === "Backspace" && Z(y.key), c.onKeyDown && c.onKeyDown(y);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
),
|
|
1190
|
+
R ? jn(c.placeholder, T) : null
|
|
1191
|
+
] }),
|
|
1192
|
+
w ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-icon-right", children: tr.cloneElement(w, {
|
|
1193
|
+
width: Yr(x),
|
|
1194
|
+
color: zr(c.disabled ? "disable" : f),
|
|
1195
|
+
onClick: E,
|
|
1196
|
+
style: {
|
|
1197
|
+
color: `${zr(
|
|
1198
|
+
c.disabled ? "disable" : f
|
|
1199
|
+
)}`
|
|
1200
|
+
}
|
|
1201
|
+
}) }) : null,
|
|
1202
|
+
_ ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-addons-right", children: _ }) : null,
|
|
1203
|
+
F && Q && (N != null && N.length) ? /* @__PURE__ */ S.jsx(
|
|
1204
|
+
_n,
|
|
1205
|
+
{
|
|
1206
|
+
options: N,
|
|
1207
|
+
value: F,
|
|
1208
|
+
setValue: Y,
|
|
1209
|
+
ref: B,
|
|
1210
|
+
isComponentVisible: Q,
|
|
1211
|
+
onOptionChange: ir
|
|
1212
|
+
}
|
|
1213
|
+
) : null
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
), jn = (t, u) => {
|
|
1220
|
+
if (!t || !u)
|
|
1221
|
+
return /* @__PURE__ */ S.jsx("p", { className: "starasia-input-placeholder", children: t || "" });
|
|
1222
|
+
const b = t.toLowerCase().indexOf(u.toLowerCase());
|
|
1223
|
+
return b === -1 ? /* @__PURE__ */ S.jsx("p", { className: "starasia-input-placeholder", children: t }) : /* @__PURE__ */ S.jsxs("p", { className: "starasia-input-placeholder", children: [
|
|
1224
|
+
t.slice(0, b),
|
|
1225
|
+
/* @__PURE__ */ S.jsx("span", { className: "starasia-input-placeholder-highlighted", children: t.slice(b, b + u.length) }),
|
|
1226
|
+
t.slice(b + u.length)
|
|
1227
|
+
] });
|
|
1228
|
+
};
|
|
1229
|
+
export {
|
|
1230
|
+
Pn as Input
|
|
1231
|
+
};
|