@starasia/input 1.0.0 → 1.0.2

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/input.es.js CHANGED
@@ -1,647 +1,6 @@
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");
1
+ import { jsx as c, jsxs as N } from "react/jsx-runtime";
2
+ import B, { forwardRef as W, useState as w, useRef as A, useEffect as x } from "react";
3
+ const G = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
645
4
 
646
5
  * {
647
6
  margin: 0;
@@ -660,86 +19,86 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
660
19
  /* blue */
661
20
  --starasia-ui-input-color-primary-blue: var(
662
21
  --starasia-ui-color-blue-700,
663
- #1d4ed8
22
+ #1976d2
664
23
  );
665
24
  --starasia-ui-input-color-secondary-blue: var(
666
25
  --starasia-ui-color-blue-500,
667
- #3b82f6
26
+ #2196f3
668
27
  );
669
28
  --starasia-ui-input-color-tertiary-blue: var(
670
29
  --starasia-ui-color-blue-300,
671
- #93c5fd
30
+ #64b5f6
672
31
  );
673
32
  --starasia-ui-input-color-quaternary-blue: var(
674
33
  --starasia-ui-color-blue-100,
675
- #dbeafe
34
+ #bbdefb
676
35
  );
677
36
  --starasia-ui-input-color-quinary-blue: var(
678
37
  --starasia-ui-color-blue-50,
679
- #eff6ff
38
+ #e3f2fd
680
39
  );
681
40
  /* gray */
682
41
  --starasia-ui-input-color-primary-gray: var(
683
42
  --starasia-ui-color-gray-700,
684
- #374151
43
+ #48504c
685
44
  );
686
45
  --starasia-ui-input-color-secondary-gray: var(
687
46
  --starasia-ui-color-gray-500,
688
- #6b7280
47
+ #78867f
689
48
  );
690
49
  --starasia-ui-input-color-tertiary-gray: var(
691
50
  --starasia-ui-color-gray-300,
692
- #d1d5db
51
+ #aeb6b2
693
52
  );
694
53
  --starasia-ui-input-color-quaternary-gray: var(
695
54
  --starasia-ui-color-gray-100,
696
- #f3f4f6
55
+ #eff3f8
697
56
  );
698
57
  --starasia-ui-input-color-quinary-gray: var(
699
58
  --starasia-ui-color-gray-50,
700
- #f9fafb
59
+ #fffeff
701
60
  );
702
61
  /* red */
703
62
  --starasia-ui-input-color-primary-red: var(
704
63
  --starasia-ui-color-red-700,
705
- #b91c1c
64
+ #a4133c
706
65
  );
707
66
  --starasia-ui-input-color-secondary-red: var(
708
67
  --starasia-ui-color-red-500,
709
- #ef4444
68
+ #ff4d6d
710
69
  );
711
70
  --starasia-ui-input-color-tertiary-red: var(
712
71
  --starasia-ui-color-red-300,
713
- #fca5a5
72
+ #ff8fa3
714
73
  );
715
74
  --starasia-ui-input-color-quaternary-red: var(
716
75
  --starasia-ui-color-red-100,
717
- #fee2e2
76
+ #ffccd5
718
77
  );
719
78
  --starasia-ui-input-color-quinary-red: var(
720
79
  --starasia-ui-color-red-50,
721
- #fef2f2
80
+ #fff0f3
722
81
  );
723
- /* yellow */
724
- --starasia-ui-input-color-primary-yellow: var(
725
- --starasia-ui-color-yellow-700,
726
- #a16207
82
+ /* orange */
83
+ --starasia-ui-input-color-primary-orange: var(
84
+ --starasia-ui-color-orange-700,
85
+ #986800
727
86
  );
728
- --starasia-ui-input-color-secondary-yellow: var(
729
- --starasia-ui-color-yellow-500,
730
- #eab308
87
+ --starasia-ui-input-color-secondary-orange: var(
88
+ --starasia-ui-color-orange-500,
89
+ #d2a03a
731
90
  );
732
- --starasia-ui-input-color-tertiary-yellow: var(
733
- --starasia-ui-color-yellow-300,
734
- #fde047
91
+ --starasia-ui-input-color-tertiary-orange: var(
92
+ --starasia-ui-color-orange-300,
93
+ #ffcb69
735
94
  );
736
- --starasia-ui-input-color-quaternary-yellow: var(
737
- --starasia-ui-color-yellow-100,
738
- #fef9c3
95
+ --starasia-ui-input-color-quaternary-orange: var(
96
+ --starasia-ui-color-orange-100,
97
+ #fff5c1
739
98
  );
740
- --starasia-ui-input-color-quinary-yellow: var(
741
- --starasia-ui-color-yellow-50,
742
- #fefce8
99
+ --starasia-ui-input-color-quinary-orange: var(
100
+ --starasia-ui-color-orange-50,
101
+ #faf6e0
743
102
  );
744
103
 
745
104
  /* text color */
@@ -819,16 +178,16 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
819
178
  }
820
179
 
821
180
  .starasia-input-outline.starasia-input-container-warning {
822
- border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
181
+ border-color: var(--starasia-ui-input-color-secondary-orange) !important;
823
182
  }
824
183
 
825
184
  .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);
185
+ border-color: var(--starasia-ui-input-color-secondary-orange) !important;
186
+ background-color: var(--starasia-ui-input-color-quinary-orange);
828
187
  }
829
188
 
830
189
  .starasia-input-flushed.starasia-input-container-warning {
831
- border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
190
+ border-color: var(--starasia-ui-input-color-secondary-orange) !important;
832
191
  }
833
192
 
834
193
  .starasia-input-outline {
@@ -980,35 +339,35 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
980
339
  color: var(--starasia-ui-input-placeholder-color);
981
340
  font-weight: var(--starasia-ui-fontWeights-normal, 300);
982
341
  }
983
- `, Yr = (t) => {
984
- if (t === "sm")
342
+ `, P = (a) => {
343
+ if (a === "sm")
985
344
  return 16;
986
- if (t === "md")
345
+ if (a === "md")
987
346
  return 16;
988
- if (t === "lg")
347
+ if (a === "lg")
989
348
  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`;
349
+ }, T = (a) => a === "default" ? "#939E99" : a === "error" ? "#EF4444" : a === "warning" ? "#EAB308" : "#939E99", j = (a) => a === "default" ? "#939E99" : a === "error" ? "#EF4444" : a === "warning" ? "#EAB308" : "#939E99", J = W(
350
+ ({ options: a, value: n, setValue: s, isComponentVisible: o, onOptionChange: e }, i) => {
351
+ const [k, V] = w([]), u = A(null), g = () => {
352
+ if (i != null && i.current && u.current) {
353
+ const h = window.innerHeight, f = i == null ? void 0 : i.current.getBoundingClientRect(), C = u.current.getBoundingClientRect(), m = f.bottom + C.height;
354
+ u.current.style.left = `${f.left}px`, u.current.style.width = `${f.width}px`, m >= h - 10 ? u.current.style.top = `${f.top - C.height - 5}px` : u.current.style.top = `${f.top + f.height}px`;
996
355
  }
997
356
  };
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())
357
+ return x(() => (window.addEventListener("scroll", g), window.addEventListener("resize", g), () => {
358
+ window.removeEventListener("scroll", g), window.removeEventListener("resize", g);
359
+ }), [i, u]), x(() => {
360
+ g();
361
+ }, [o]), x(() => {
362
+ V(
363
+ (a == null ? void 0 : a.filter(
364
+ (h) => h.toLowerCase().startsWith(n.toLowerCase())
1006
365
  )) || []
1007
366
  );
1008
- }, [u, t]), /* @__PURE__ */ S.jsx(
367
+ }, [n, a]), /* @__PURE__ */ c(
1009
368
  "div",
1010
369
  {
1011
- ref: l,
370
+ ref: u,
1012
371
  style: {
1013
372
  position: "fixed",
1014
373
  padding: "8px",
@@ -1019,15 +378,15 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
1019
378
  overflow: "auto",
1020
379
  zIndex: 5e4
1021
380
  },
1022
- children: A == null ? void 0 : A.map(
1023
- (p) => Cn(p, u, b, x)
381
+ children: k == null ? void 0 : k.map(
382
+ (h) => M(h, n, s, e)
1024
383
  )
1025
384
  }
1026
385
  );
1027
386
  }
1028
- ), Cn = (t, u, b, w) => {
1029
- const x = t.toLowerCase().indexOf(u.toLowerCase());
1030
- return /* @__PURE__ */ S.jsxs(
387
+ ), M = (a, n, s, o) => {
388
+ const e = a.toLowerCase().indexOf(n.toLowerCase());
389
+ return /* @__PURE__ */ N(
1031
390
  "p",
1032
391
  {
1033
392
  style: {
@@ -1038,177 +397,177 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
1038
397
  cursor: "pointer"
1039
398
  },
1040
399
  onClick: () => {
1041
- b(t), w && w(t);
400
+ s(a), o && o(a);
1042
401
  },
1043
402
  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)
403
+ a.slice(0, e),
404
+ /* @__PURE__ */ c("span", { style: { color: "#374151" }, children: a.slice(e, e + n.length) }),
405
+ a.slice(e + n.length)
1047
406
  ]
1048
407
  }
1049
408
  );
1050
409
  };
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);
410
+ function Q(a) {
411
+ const [n, s] = w(a), o = A(null), e = (i) => {
412
+ o.current && !o.current.contains(i.target) && s(!1);
1054
413
  };
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);
414
+ return x(() => (document.addEventListener("click", e, !0), () => {
415
+ document.removeEventListener("click", e, !0);
416
+ }), []), { ref: o, isComponentVisible: n, setIsComponentVisible: s };
417
+ }
418
+ const D = "starasia-input-styles", X = (a) => {
419
+ if (!document.getElementById(D)) {
420
+ const n = document.createElement("style");
421
+ n.id = D, n.textContent = a, document.head.appendChild(n);
1063
422
  }
1064
423
  };
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) => {
424
+ X(G);
425
+ function Z(a) {
426
+ return Number(a.replace(/\./g, ""));
427
+ }
428
+ const z = (a) => {
429
+ let n = a.replace(/[^\d]/g, "");
430
+ return n = n.replace(/^0+(?=\d)/, ""), n.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
431
+ }, ra = W(
432
+ (a, n) => {
1074
433
  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;
434
+ leftIcon: s,
435
+ rightIcon: o,
436
+ size: e = "md",
437
+ status: i = "default",
438
+ inputUse: k = "icon",
439
+ variant: V = "outline",
440
+ leftAddons: u,
441
+ rightAddons: g,
442
+ onClickLeftIcon: h,
443
+ onClickRightIcon: f,
444
+ highlightPlaceholder: C,
445
+ currency: m,
446
+ fullWidth: O = !1,
447
+ options: E,
448
+ onOptionChange: K,
449
+ ...r
450
+ } = a;
1092
451
  {
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);
452
+ const [F, L] = w(!0), [b, S] = w(""), [H, R] = w(""), {
453
+ isComponentVisible: q,
454
+ ref: $,
455
+ setIsComponentVisible: U
456
+ } = Q(!1), Y = () => {
457
+ U((t) => !t);
1099
458
  };
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(
459
+ return x(() => {
460
+ typeof r.value == "string" && r.value.length || r.defaultValue || typeof r.value == "number" ? L(!1) : L(!0);
461
+ }, [r.value, r.defaultValue]), x(() => {
462
+ S(m ? z(String(r.value)) : r.value || "");
463
+ }, [r]), /* @__PURE__ */ N(
1105
464
  "div",
1106
465
  {
1107
- className: `starasia-input-container starasia-input-${I} starasia-input-container-${f} ${x} `,
466
+ className: `starasia-input-container starasia-input-${V} starasia-input-container-${i} ${e} `,
1108
467
  style: {
1109
- width: X ? "auto" : "max-content",
468
+ width: O ? "auto" : "max-content",
1110
469
  position: "relative"
1111
470
  },
1112
- ref: B,
1113
- onClick: ur,
471
+ ref: $,
472
+ onClick: Y,
1114
473
  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,
474
+ u ? /* @__PURE__ */ c("div", { className: "starasia-input-container-addons-left", children: u }) : null,
475
+ s ? /* @__PURE__ */ c("div", { className: "starasia-input-container-icon-left", children: B.cloneElement(s, {
476
+ width: P(e),
477
+ color: T(r.disabled ? "disable" : i),
478
+ onClick: h,
1120
479
  style: {
1121
- color: `${qr(
1122
- c.disabled ? "disable" : f
480
+ color: `${T(
481
+ r.disabled ? "disable" : i
1123
482
  )}`
1124
483
  }
1125
484
  }) }) : null,
1126
- /* @__PURE__ */ S.jsxs("div", { className: "starasia-input-preview-container", children: [
1127
- /* @__PURE__ */ S.jsx(
485
+ /* @__PURE__ */ N("div", { className: "starasia-input-preview-container", children: [
486
+ /* @__PURE__ */ c(
1128
487
  "input",
1129
488
  {
1130
489
  className: "starasia-input",
1131
- ...c,
490
+ ...r,
1132
491
  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
492
+ disabled: i === "disable" ? !0 : r.disabled,
493
+ ref: n,
494
+ onChange: (t) => {
495
+ let d = m ? z(t.target.value) : t.target.value;
496
+ const l = t.target.selectionStart;
497
+ if (m)
498
+ if (H === "Backspace")
499
+ if (typeof l == "number" && b[l] === ".") {
500
+ let v = d.slice(0, l - 1), y = d.slice(
501
+ l,
502
+ d.length
1144
503
  );
1145
- v = yr(j + L);
1146
- const O = F.length - 1, $ = v.length - 1;
504
+ d = z(v + y);
505
+ const p = b.length - 1, I = d.length - 1;
1147
506
  setTimeout(
1148
- () => y.target.setSelectionRange(
1149
- m - (O - $) < 0 ? 0 : m - (O - $),
1150
- m - (O - $) < 0 ? 0 : m - (O - $)
507
+ () => t.target.setSelectionRange(
508
+ l - (p - I) < 0 ? 0 : l - (p - I),
509
+ l - (p - I) < 0 ? 0 : l - (p - I)
1151
510
  ),
1152
511
  0
1153
512
  );
1154
513
  } else {
1155
- const j = F.length - 1, L = v.length - 1;
1156
- let O = m + 1 - (j - L);
514
+ const v = b.length - 1, y = d.length - 1;
515
+ let p = l + 1 - (v - y);
1157
516
  setTimeout(
1158
- () => y.target.setSelectionRange(
1159
- O < 0 ? 0 : O,
1160
- O < 0 ? 0 : O
517
+ () => t.target.setSelectionRange(
518
+ p < 0 ? 0 : p,
519
+ p < 0 ? 0 : p
1161
520
  ),
1162
521
  0
1163
522
  );
1164
523
  }
1165
524
  else {
1166
- const j = F.length - 1, L = v.length - 1;
525
+ const v = b.length - 1, y = d.length - 1;
1167
526
  setTimeout(
1168
- () => y.target.setSelectionRange(
1169
- m + (L - j) - 1,
1170
- m + (L - j) - 1
527
+ () => t.target.setSelectionRange(
528
+ l + (y - v) - 1,
529
+ l + (y - v) - 1
1171
530
  ),
1172
531
  0
1173
532
  );
1174
533
  }
1175
- Y(v), y.target.value ? W(!1) : W(!0), c.onChange && c.onChange({
1176
- ...y,
534
+ S(d), t.target.value ? L(!1) : L(!0), r.onChange && r.onChange({
535
+ ...t,
1177
536
  target: {
1178
- ...y.target,
1179
- value: D ? String(Tn(v)) : v,
1180
- name: y.target.name
537
+ ...t.target,
538
+ value: m ? String(Z(d)) : d,
539
+ name: t.target.name
1181
540
  }
1182
- }), Z("");
541
+ }), R("");
1183
542
  },
1184
- value: F,
1185
- onKeyDown: (y) => {
1186
- y.key === "Backspace" && Z(y.key), c.onKeyDown && c.onKeyDown(y);
543
+ value: b,
544
+ onKeyDown: (t) => {
545
+ t.key === "Backspace" && R(t.key), r.onKeyDown && r.onKeyDown(t);
1187
546
  }
1188
547
  }
1189
548
  ),
1190
- R ? jn(c.placeholder, T) : null
549
+ F ? _(r.placeholder, C) : null
1191
550
  ] }),
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,
551
+ o ? /* @__PURE__ */ c("div", { className: "starasia-input-container-icon-right", children: B.cloneElement(o, {
552
+ width: P(e),
553
+ color: j(r.disabled ? "disable" : i),
554
+ onClick: f,
1196
555
  style: {
1197
- color: `${zr(
1198
- c.disabled ? "disable" : f
556
+ color: `${j(
557
+ r.disabled ? "disable" : i
1199
558
  )}`
1200
559
  }
1201
560
  }) }) : 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,
561
+ g ? /* @__PURE__ */ c("div", { className: "starasia-input-container-addons-right", children: g }) : null,
562
+ b && q && (E != null && E.length) ? /* @__PURE__ */ c(
563
+ J,
1205
564
  {
1206
- options: N,
1207
- value: F,
1208
- setValue: Y,
1209
- ref: B,
1210
- isComponentVisible: Q,
1211
- onOptionChange: ir
565
+ options: E,
566
+ value: b,
567
+ setValue: S,
568
+ ref: $,
569
+ isComponentVisible: q,
570
+ onOptionChange: K
1212
571
  }
1213
572
  ) : null
1214
573
  ]
@@ -1216,16 +575,16 @@ const yr = (t) => {
1216
575
  );
1217
576
  }
1218
577
  }
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)
578
+ ), _ = (a, n) => {
579
+ if (!a || !n)
580
+ return /* @__PURE__ */ c("p", { className: "starasia-input-placeholder", children: a || "" });
581
+ const s = a.toLowerCase().indexOf(n.toLowerCase());
582
+ return s === -1 ? /* @__PURE__ */ c("p", { className: "starasia-input-placeholder", children: a }) : /* @__PURE__ */ N("p", { className: "starasia-input-placeholder", children: [
583
+ a.slice(0, s),
584
+ /* @__PURE__ */ c("span", { className: "starasia-input-placeholder-highlighted", children: a.slice(s, s + n.length) }),
585
+ a.slice(s + n.length)
1227
586
  ] });
1228
587
  };
1229
588
  export {
1230
- Pn as Input
589
+ ra as Input
1231
590
  };