@starasia/textarea 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 ADDED
@@ -0,0 +1,57 @@
1
+ # starasia textarea
2
+
3
+ starasia textarea is a strict and customizable textarea component for web development projects, designed for simplicity and adherence to strict design guidelines.
4
+
5
+ ## Screenshots
6
+
7
+ ![App Screenshot](https://github.com/primaramadhaniputra/image/blob/main/ITextarea.png)
8
+
9
+ ## Package instalation
10
+
11
+ Instal package using pnpm
12
+
13
+ ```bash
14
+ pnpm add @starasia/textarea
15
+ ```
16
+
17
+ Instal package using yarn
18
+
19
+ ```bash
20
+ yarn add @starasia/textarea
21
+ ```
22
+
23
+ Instal package using npm
24
+
25
+ ```bash
26
+ npm i @starasia/textarea
27
+ ```
28
+
29
+ ## Usage/Examples
30
+
31
+ ```javascript
32
+ import React from "react";
33
+ import {Textarea} from "@starasia/textarea";
34
+ import ReactDOM from "react-dom/client";
35
+
36
+ const App = () => (
37
+ <div style={{margin: "50px"}}>
38
+ <Textarea height={"128px"} />
39
+ </div>
40
+ );
41
+
42
+ ReactDOM.createRoot(document.getElementById("app")!).render(<App />);
43
+
44
+
45
+
46
+ ```
47
+
48
+ ## Props @starasia/textarea
49
+
50
+ #### Props that you can pass to <Textarea {...props} />
51
+
52
+ | Prop Name | Value | required |
53
+ | :-------- | :--------------------------------- | :------- | ----- |
54
+ | resize | "vertical" / "horizontal" / "both" | "none" | false |
55
+ | height | CSSProperties["height"] | "none" | false |
56
+ | width | CSSProperties["width"] | "none" | false |
57
+ | size | "xs" / "sm" / "md" / "lg" | "none" | false |
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { TextareaProps } from "./types";
3
+ export declare const Textarea: React.FC<TextareaProps>;
@@ -0,0 +1,2 @@
1
+ export { Textarea } from "./Textarea";
2
+ export * from "./types";
@@ -0,0 +1,833 @@
1
+ import Or from "react";
2
+ var Z = { exports: {} }, W = {};
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 wr;
13
+ function fe() {
14
+ if (wr)
15
+ return W;
16
+ wr = 1;
17
+ var E = Or, b = Symbol.for("react.element"), D = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, O = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function _(h, f, C) {
19
+ var p, y = {}, w = null, $ = null;
20
+ C !== void 0 && (w = "" + C), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && ($ = f.ref);
21
+ for (p in f)
22
+ m.call(f, p) && !R.hasOwnProperty(p) && (y[p] = f[p]);
23
+ if (h && h.defaultProps)
24
+ for (p in f = h.defaultProps, f)
25
+ y[p] === void 0 && (y[p] = f[p]);
26
+ return { $$typeof: b, type: h, key: w, ref: $, props: y, _owner: O.current };
27
+ }
28
+ return W.Fragment = D, W.jsx = _, W.jsxs = _, W;
29
+ }
30
+ var z = {};
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 Tr;
41
+ function de() {
42
+ return Tr || (Tr = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var E = Or, b = Symbol.for("react.element"), D = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), h = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), Q = Symbol.iterator, Cr = "@@iterator";
44
+ function Pr(r) {
45
+ if (r === null || typeof r != "object")
46
+ return null;
47
+ var e = Q && r[Q] || r[Cr];
48
+ return typeof e == "function" ? e : null;
49
+ }
50
+ var P = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function c(r) {
52
+ {
53
+ for (var e = arguments.length, a = new Array(e > 1 ? e - 1 : 0), t = 1; t < e; t++)
54
+ a[t - 1] = arguments[t];
55
+ jr("error", r, a);
56
+ }
57
+ }
58
+ function jr(r, e, a) {
59
+ {
60
+ var t = P.ReactDebugCurrentFrame, s = t.getStackAddendum();
61
+ s !== "" && (e += "%s", a = a.concat([s]));
62
+ var o = a.map(function(i) {
63
+ return String(i);
64
+ });
65
+ o.unshift("Warning: " + e), Function.prototype.apply.call(console[r], console, o);
66
+ }
67
+ }
68
+ var kr = !1, Dr = !1, Fr = !1, Ar = !1, Ir = !1, rr;
69
+ rr = Symbol.for("react.module.reference");
70
+ function Wr(r) {
71
+ return !!(typeof r == "string" || typeof r == "function" || r === m || r === R || Ir || r === O || r === C || r === p || Ar || r === $ || kr || Dr || Fr || typeof r == "object" && r !== null && (r.$$typeof === w || r.$$typeof === y || r.$$typeof === _ || r.$$typeof === h || r.$$typeof === f || // 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 === rr || r.getModuleId !== void 0));
76
+ }
77
+ function zr(r, e, a) {
78
+ var t = r.displayName;
79
+ if (t)
80
+ return t;
81
+ var s = e.displayName || e.name || "";
82
+ return s !== "" ? a + "(" + s + ")" : a;
83
+ }
84
+ function er(r) {
85
+ return r.displayName || "Context";
86
+ }
87
+ function x(r) {
88
+ if (r == null)
89
+ return null;
90
+ if (typeof r.tag == "number" && c("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 m:
96
+ return "Fragment";
97
+ case D:
98
+ return "Portal";
99
+ case R:
100
+ return "Profiler";
101
+ case O:
102
+ return "StrictMode";
103
+ case C:
104
+ return "Suspense";
105
+ case p:
106
+ return "SuspenseList";
107
+ }
108
+ if (typeof r == "object")
109
+ switch (r.$$typeof) {
110
+ case h:
111
+ var e = r;
112
+ return er(e) + ".Consumer";
113
+ case _:
114
+ var a = r;
115
+ return er(a._context) + ".Provider";
116
+ case f:
117
+ return zr(r, r.render, "ForwardRef");
118
+ case y:
119
+ var t = r.displayName || null;
120
+ return t !== null ? t : x(r.type) || "Memo";
121
+ case w: {
122
+ var s = r, o = s._payload, i = s._init;
123
+ try {
124
+ return x(i(o));
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ var T = Object.assign, F = 0, ar, tr, nr, ir, sr, or, ur;
133
+ function lr() {
134
+ }
135
+ lr.__reactDisabledLog = !0;
136
+ function $r() {
137
+ {
138
+ if (F === 0) {
139
+ ar = console.log, tr = console.info, nr = console.warn, ir = console.error, sr = console.group, or = console.groupCollapsed, ur = console.groupEnd;
140
+ var r = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ value: lr,
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
+ F++;
157
+ }
158
+ }
159
+ function Yr() {
160
+ {
161
+ if (F--, F === 0) {
162
+ var r = {
163
+ configurable: !0,
164
+ enumerable: !0,
165
+ writable: !0
166
+ };
167
+ Object.defineProperties(console, {
168
+ log: T({}, r, {
169
+ value: ar
170
+ }),
171
+ info: T({}, r, {
172
+ value: tr
173
+ }),
174
+ warn: T({}, r, {
175
+ value: nr
176
+ }),
177
+ error: T({}, r, {
178
+ value: ir
179
+ }),
180
+ group: T({}, r, {
181
+ value: sr
182
+ }),
183
+ groupCollapsed: T({}, r, {
184
+ value: or
185
+ }),
186
+ groupEnd: T({}, r, {
187
+ value: ur
188
+ })
189
+ });
190
+ }
191
+ F < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ }
193
+ }
194
+ var N = P.ReactCurrentDispatcher, U;
195
+ function Y(r, e, a) {
196
+ {
197
+ if (U === void 0)
198
+ try {
199
+ throw Error();
200
+ } catch (s) {
201
+ var t = s.stack.trim().match(/\n( *(at )?)/);
202
+ U = t && t[1] || "";
203
+ }
204
+ return `
205
+ ` + U + r;
206
+ }
207
+ }
208
+ var q = !1, L;
209
+ {
210
+ var Lr = typeof WeakMap == "function" ? WeakMap : Map;
211
+ L = new Lr();
212
+ }
213
+ function cr(r, e) {
214
+ if (!r || q)
215
+ return "";
216
+ {
217
+ var a = L.get(r);
218
+ if (a !== void 0)
219
+ return a;
220
+ }
221
+ var t;
222
+ q = !0;
223
+ var s = Error.prepareStackTrace;
224
+ Error.prepareStackTrace = void 0;
225
+ var o;
226
+ o = N.current, N.current = null, $r();
227
+ try {
228
+ if (e) {
229
+ var i = function() {
230
+ throw Error();
231
+ };
232
+ if (Object.defineProperty(i.prototype, "props", {
233
+ set: function() {
234
+ throw Error();
235
+ }
236
+ }), typeof Reflect == "object" && Reflect.construct) {
237
+ try {
238
+ Reflect.construct(i, []);
239
+ } catch (v) {
240
+ t = v;
241
+ }
242
+ Reflect.construct(r, [], i);
243
+ } else {
244
+ try {
245
+ i.call();
246
+ } catch (v) {
247
+ t = v;
248
+ }
249
+ r.call(i.prototype);
250
+ }
251
+ } else {
252
+ try {
253
+ throw Error();
254
+ } catch (v) {
255
+ t = v;
256
+ }
257
+ r();
258
+ }
259
+ } catch (v) {
260
+ if (v && t && typeof v.stack == "string") {
261
+ for (var n = v.stack.split(`
262
+ `), d = t.stack.split(`
263
+ `), u = n.length - 1, l = d.length - 1; u >= 1 && l >= 0 && n[u] !== d[l]; )
264
+ l--;
265
+ for (; u >= 1 && l >= 0; u--, l--)
266
+ if (n[u] !== d[l]) {
267
+ if (u !== 1 || l !== 1)
268
+ do
269
+ if (u--, l--, l < 0 || n[u] !== d[l]) {
270
+ var g = `
271
+ ` + n[u].replace(" at new ", " at ");
272
+ return r.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", r.displayName)), typeof r == "function" && L.set(r, g), g;
273
+ }
274
+ while (u >= 1 && l >= 0);
275
+ break;
276
+ }
277
+ }
278
+ } finally {
279
+ q = !1, N.current = o, Yr(), Error.prepareStackTrace = s;
280
+ }
281
+ var k = r ? r.displayName || r.name : "", S = k ? Y(k) : "";
282
+ return typeof r == "function" && L.set(r, S), S;
283
+ }
284
+ function Vr(r, e, a) {
285
+ return cr(r, !1);
286
+ }
287
+ function Mr(r) {
288
+ var e = r.prototype;
289
+ return !!(e && e.isReactComponent);
290
+ }
291
+ function V(r, e, a) {
292
+ if (r == null)
293
+ return "";
294
+ if (typeof r == "function")
295
+ return cr(r, Mr(r));
296
+ if (typeof r == "string")
297
+ return Y(r);
298
+ switch (r) {
299
+ case C:
300
+ return Y("Suspense");
301
+ case p:
302
+ return Y("SuspenseList");
303
+ }
304
+ if (typeof r == "object")
305
+ switch (r.$$typeof) {
306
+ case f:
307
+ return Vr(r.render);
308
+ case y:
309
+ return V(r.type, e, a);
310
+ case w: {
311
+ var t = r, s = t._payload, o = t._init;
312
+ try {
313
+ return V(o(s), e, a);
314
+ } catch {
315
+ }
316
+ }
317
+ }
318
+ return "";
319
+ }
320
+ var A = Object.prototype.hasOwnProperty, fr = {}, dr = P.ReactDebugCurrentFrame;
321
+ function M(r) {
322
+ if (r) {
323
+ var e = r._owner, a = V(r.type, r._source, e ? e.type : null);
324
+ dr.setExtraStackFrame(a);
325
+ } else
326
+ dr.setExtraStackFrame(null);
327
+ }
328
+ function Nr(r, e, a, t, s) {
329
+ {
330
+ var o = Function.call.bind(A);
331
+ for (var i in r)
332
+ if (o(r, i)) {
333
+ var n = void 0;
334
+ try {
335
+ if (typeof r[i] != "function") {
336
+ var d = Error((t || "React class") + ": " + a + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw d.name = "Invariant Violation", d;
338
+ }
339
+ n = r[i](e, i, t, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (u) {
341
+ n = u;
342
+ }
343
+ n && !(n instanceof Error) && (M(s), c("%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).", t || "React class", a, i, typeof n), M(null)), n instanceof Error && !(n.message in fr) && (fr[n.message] = !0, M(s), c("Failed %s type: %s", a, n.message), M(null));
344
+ }
345
+ }
346
+ }
347
+ var Ur = Array.isArray;
348
+ function B(r) {
349
+ return Ur(r);
350
+ }
351
+ function qr(r) {
352
+ {
353
+ var e = typeof Symbol == "function" && Symbol.toStringTag, a = e && r[Symbol.toStringTag] || r.constructor.name || "Object";
354
+ return a;
355
+ }
356
+ }
357
+ function Br(r) {
358
+ try {
359
+ return vr(r), !1;
360
+ } catch {
361
+ return !0;
362
+ }
363
+ }
364
+ function vr(r) {
365
+ return "" + r;
366
+ }
367
+ function pr(r) {
368
+ if (Br(r))
369
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qr(r)), vr(r);
370
+ }
371
+ var I = P.ReactCurrentOwner, Jr = {
372
+ key: !0,
373
+ ref: !0,
374
+ __self: !0,
375
+ __source: !0
376
+ }, gr, br, J;
377
+ J = {};
378
+ function Kr(r) {
379
+ if (A.call(r, "ref")) {
380
+ var e = Object.getOwnPropertyDescriptor(r, "ref").get;
381
+ if (e && e.isReactWarning)
382
+ return !1;
383
+ }
384
+ return r.ref !== void 0;
385
+ }
386
+ function Gr(r) {
387
+ if (A.call(r, "key")) {
388
+ var e = Object.getOwnPropertyDescriptor(r, "key").get;
389
+ if (e && e.isReactWarning)
390
+ return !1;
391
+ }
392
+ return r.key !== void 0;
393
+ }
394
+ function Xr(r, e) {
395
+ if (typeof r.ref == "string" && I.current && e && I.current.stateNode !== e) {
396
+ var a = x(I.current.type);
397
+ J[a] || (c('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', x(I.current.type), r.ref), J[a] = !0);
398
+ }
399
+ }
400
+ function Hr(r, e) {
401
+ {
402
+ var a = function() {
403
+ gr || (gr = !0, c("%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)", e));
404
+ };
405
+ a.isReactWarning = !0, Object.defineProperty(r, "key", {
406
+ get: a,
407
+ configurable: !0
408
+ });
409
+ }
410
+ }
411
+ function Zr(r, e) {
412
+ {
413
+ var a = function() {
414
+ br || (br = !0, c("%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)", e));
415
+ };
416
+ a.isReactWarning = !0, Object.defineProperty(r, "ref", {
417
+ get: a,
418
+ configurable: !0
419
+ });
420
+ }
421
+ }
422
+ var Qr = function(r, e, a, t, s, o, i) {
423
+ var n = {
424
+ // This tag allows us to uniquely identify this as a React Element
425
+ $$typeof: b,
426
+ // Built-in properties that belong on the element
427
+ type: r,
428
+ key: e,
429
+ ref: a,
430
+ props: i,
431
+ // Record the component responsible for creating this element.
432
+ _owner: o
433
+ };
434
+ return n._store = {}, Object.defineProperty(n._store, "validated", {
435
+ configurable: !1,
436
+ enumerable: !1,
437
+ writable: !0,
438
+ value: !1
439
+ }), Object.defineProperty(n, "_self", {
440
+ configurable: !1,
441
+ enumerable: !1,
442
+ writable: !1,
443
+ value: t
444
+ }), Object.defineProperty(n, "_source", {
445
+ configurable: !1,
446
+ enumerable: !1,
447
+ writable: !1,
448
+ value: s
449
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
450
+ };
451
+ function re(r, e, a, t, s) {
452
+ {
453
+ var o, i = {}, n = null, d = null;
454
+ a !== void 0 && (pr(a), n = "" + a), Gr(e) && (pr(e.key), n = "" + e.key), Kr(e) && (d = e.ref, Xr(e, s));
455
+ for (o in e)
456
+ A.call(e, o) && !Jr.hasOwnProperty(o) && (i[o] = e[o]);
457
+ if (r && r.defaultProps) {
458
+ var u = r.defaultProps;
459
+ for (o in u)
460
+ i[o] === void 0 && (i[o] = u[o]);
461
+ }
462
+ if (n || d) {
463
+ var l = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
464
+ n && Hr(i, l), d && Zr(i, l);
465
+ }
466
+ return Qr(r, n, d, s, t, I.current, i);
467
+ }
468
+ }
469
+ var K = P.ReactCurrentOwner, hr = P.ReactDebugCurrentFrame;
470
+ function j(r) {
471
+ if (r) {
472
+ var e = r._owner, a = V(r.type, r._source, e ? e.type : null);
473
+ hr.setExtraStackFrame(a);
474
+ } else
475
+ hr.setExtraStackFrame(null);
476
+ }
477
+ var G;
478
+ G = !1;
479
+ function X(r) {
480
+ return typeof r == "object" && r !== null && r.$$typeof === b;
481
+ }
482
+ function xr() {
483
+ {
484
+ if (K.current) {
485
+ var r = x(K.current.type);
486
+ if (r)
487
+ return `
488
+
489
+ Check the render method of \`` + r + "`.";
490
+ }
491
+ return "";
492
+ }
493
+ }
494
+ function ee(r) {
495
+ {
496
+ if (r !== void 0) {
497
+ var e = r.fileName.replace(/^.*[\\\/]/, ""), a = r.lineNumber;
498
+ return `
499
+
500
+ Check your code at ` + e + ":" + a + ".";
501
+ }
502
+ return "";
503
+ }
504
+ }
505
+ var yr = {};
506
+ function ae(r) {
507
+ {
508
+ var e = xr();
509
+ if (!e) {
510
+ var a = typeof r == "string" ? r : r.displayName || r.name;
511
+ a && (e = `
512
+
513
+ Check the top-level render call using <` + a + ">.");
514
+ }
515
+ return e;
516
+ }
517
+ }
518
+ function mr(r, e) {
519
+ {
520
+ if (!r._store || r._store.validated || r.key != null)
521
+ return;
522
+ r._store.validated = !0;
523
+ var a = ae(e);
524
+ if (yr[a])
525
+ return;
526
+ yr[a] = !0;
527
+ var t = "";
528
+ r && r._owner && r._owner !== K.current && (t = " It was passed a child from " + x(r._owner.type) + "."), j(r), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, t), j(null);
529
+ }
530
+ }
531
+ function Er(r, e) {
532
+ {
533
+ if (typeof r != "object")
534
+ return;
535
+ if (B(r))
536
+ for (var a = 0; a < r.length; a++) {
537
+ var t = r[a];
538
+ X(t) && mr(t, e);
539
+ }
540
+ else if (X(r))
541
+ r._store && (r._store.validated = !0);
542
+ else if (r) {
543
+ var s = Pr(r);
544
+ if (typeof s == "function" && s !== r.entries)
545
+ for (var o = s.call(r), i; !(i = o.next()).done; )
546
+ X(i.value) && mr(i.value, e);
547
+ }
548
+ }
549
+ }
550
+ function te(r) {
551
+ {
552
+ var e = r.type;
553
+ if (e == null || typeof e == "string")
554
+ return;
555
+ var a;
556
+ if (typeof e == "function")
557
+ a = e.propTypes;
558
+ else if (typeof e == "object" && (e.$$typeof === f || // Note: Memo only checks outer props here.
559
+ // Inner props are checked in the reconciler.
560
+ e.$$typeof === y))
561
+ a = e.propTypes;
562
+ else
563
+ return;
564
+ if (a) {
565
+ var t = x(e);
566
+ Nr(a, r.props, "prop", t, r);
567
+ } else if (e.PropTypes !== void 0 && !G) {
568
+ G = !0;
569
+ var s = x(e);
570
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
571
+ }
572
+ typeof e.getDefaultProps == "function" && !e.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
+ }
574
+ }
575
+ function ne(r) {
576
+ {
577
+ for (var e = Object.keys(r.props), a = 0; a < e.length; a++) {
578
+ var t = e[a];
579
+ if (t !== "children" && t !== "key") {
580
+ j(r), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", t), j(null);
581
+ break;
582
+ }
583
+ }
584
+ r.ref !== null && (j(r), c("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
585
+ }
586
+ }
587
+ var Rr = {};
588
+ function _r(r, e, a, t, s, o) {
589
+ {
590
+ var i = Wr(r);
591
+ if (!i) {
592
+ var n = "";
593
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (n += " 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 d = ee(s);
595
+ d ? n += d : n += xr();
596
+ var u;
597
+ r === null ? u = "null" : B(r) ? u = "array" : r !== void 0 && r.$$typeof === b ? (u = "<" + (x(r.type) || "Unknown") + " />", n = " Did you accidentally export a JSX literal instead of a component?") : u = typeof r, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, n);
598
+ }
599
+ var l = re(r, e, a, s, o);
600
+ if (l == null)
601
+ return l;
602
+ if (i) {
603
+ var g = e.children;
604
+ if (g !== void 0)
605
+ if (t)
606
+ if (B(g)) {
607
+ for (var k = 0; k < g.length; k++)
608
+ Er(g[k], r);
609
+ Object.freeze && Object.freeze(g);
610
+ } else
611
+ c("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
+ Er(g, r);
614
+ }
615
+ if (A.call(e, "key")) {
616
+ var S = x(r), v = Object.keys(e).filter(function(ce) {
617
+ return ce !== "key";
618
+ }), H = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
619
+ if (!Rr[S + H]) {
620
+ var le = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
621
+ c(`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} />`, H, S, le, S), Rr[S + H] = !0;
627
+ }
628
+ }
629
+ return r === m ? ne(l) : te(l), l;
630
+ }
631
+ }
632
+ function ie(r, e, a) {
633
+ return _r(r, e, a, !0);
634
+ }
635
+ function se(r, e, a) {
636
+ return _r(r, e, a, !1);
637
+ }
638
+ var oe = se, ue = ie;
639
+ z.Fragment = m, z.jsx = oe, z.jsxs = ue;
640
+ }()), z;
641
+ }
642
+ process.env.NODE_ENV === "production" ? Z.exports = fe() : Z.exports = de();
643
+ var ve = Z.exports;
644
+ const pe = `@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
+ font-family: "Poppins", serif;
650
+ box-sizing: border-box;
651
+ }
652
+
653
+ :root {
654
+ /* height */
655
+ --starasia-ui-h-6: 1.5rem; /* 24px */
656
+ --starasia-ui-h-8: 2rem; /* 32px */
657
+ --starasia-ui-h-10: 2.5rem; /* 40px */
658
+ --starasia-ui-h-12: 3rem; /* 48px */
659
+
660
+ /* color */
661
+ --starasia-ui-color-gray-200: #c9cecc;
662
+ --starasia-ui-color-gray-300: #d1d5db;
663
+ --starasia-ui-color-blue-800: #1e40af;
664
+
665
+ /* border radius */
666
+ --starasia-ui-radii-base: 0.25rem; /* 4px */
667
+
668
+ /* new root css */
669
+ /* spacing */
670
+ --starasia-ui-textarea-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
671
+ --starasia-ui-textarea-spacing-sm: var(--starasia-ui-spacing-sm, 8px);
672
+ --starasia-ui-textarea-spacing-md: var(--starasia-ui-spacing-md, 12px);
673
+
674
+ /* height */
675
+ --starasia-ui-textarea-height-xs: var(--starasia-ui-h-6, 24px);
676
+ --starasia-ui-textarea-height-sm: var(--starasia-ui-h-8, 32px);
677
+ --starasia-ui-textarea-height-md: var(--starasia-ui-h-10, 40px);
678
+ --starasia-ui-textarea-height-lg: var(--starasia-ui-h-12, 48px);
679
+
680
+ /* border width */
681
+ --starasia-ui-textarea-border-width: var(--starasia-ui-border, 1px);
682
+
683
+ /* color */
684
+ /* gray */
685
+ --starasia-ui-textarea-color-tertiary-gray: var(
686
+ --starasia-ui-color-gray-300,
687
+ #d1d5db
688
+ );
689
+
690
+ /* blue */
691
+ --starasia-ui-textarea-color-primary-blue: var(
692
+ --starasia-ui-color-blue-700,
693
+ #1d4ed8
694
+ );
695
+ --starasia-ui-textarea-color-tertiary-blue: var(
696
+ --starasia-ui-color-blue-300,
697
+ #93c5fd
698
+ );
699
+ --starasia-ui-textarea-color-quaternary-blue: var(
700
+ --starasia-ui-color-blue-100,
701
+ #dbeafe
702
+ );
703
+
704
+ /* border radius */
705
+ --starasia-ui-textarea-border-radius-base: var(--starasia-ui-radii-md, 8px);
706
+ --starasia-ui-textarea-border-radius-lg: var(--starasia-ui-radii-md, 8px);
707
+
708
+ --starasia-ui-textarea-placholder-color: var(
709
+ --starasia-ui-color-gray-200,
710
+ #c9cecc
711
+ );
712
+ --starasia-ui-textarea-placholder-fontWeight: var(
713
+ --starasia-ui-fontWeights-normal,
714
+ 300
715
+ );
716
+ }
717
+
718
+ .starasia-textarea {
719
+ padding: var(--starasia-ui-textarea-spacing-sm);
720
+ box-sizing: border-box;
721
+ /* background: transparent; */
722
+ background: white;
723
+ }
724
+ .starasia-textarea::placeholder {
725
+ color: var(--starasia-ui-textarea-placholder-color);
726
+ font-weight: var(--starasia-ui-textarea-placholder-fontWeight);
727
+ }
728
+ .starasia-textarea-resize-horizontal {
729
+ resize: horizontal;
730
+ }
731
+
732
+ .starasia-textarea-resize-vertical {
733
+ resize: vertical;
734
+ }
735
+
736
+ .starasia-textarea-resize-both {
737
+ resize: both;
738
+ }
739
+
740
+ .starasia-textarea-resize-none {
741
+ resize: none;
742
+ }
743
+
744
+ .starasia-textarea-xs {
745
+ height: var(--starasia-ui-textarea-height-xs);
746
+ padding-block: var(--starasia-ui-textarea-spacing-xs);
747
+ padding-inline: var(--starasia-ui-textarea-spacing-sm);
748
+ font-size: var(--starasia-ui-fontSizes-xs, 10px);
749
+ border: var(--starasia-ui-textarea-border-width) solid
750
+ var(--starasia-ui-textarea-color-tertiary-gray);
751
+ border-radius: var(--starasia-ui-textarea-border-radius-base);
752
+ }
753
+ .starasia-textarea-sm {
754
+ height: var(--starasia-ui-textarea-height-sm);
755
+ padding-block: var(--starasia-ui-textarea-spacing-xs);
756
+ padding-inline: var(--starasia-ui-textarea-spacing-sm);
757
+ font-size: var(--starasia-ui-fontSizes-sm, 12px);
758
+ border: var(--starasia-ui-textarea-border-width) solid
759
+ var(--starasia-ui-textarea-color-tertiary-gray);
760
+ border-radius: var(--starasia-ui-textarea-border-radius-base);
761
+ }
762
+ .starasia-textarea-md {
763
+ height: var(--starasia-ui-textarea-height-md);
764
+ padding-block: var(--starasia-ui-textarea-spacing-sm);
765
+ padding-inline: var(--starasia-ui-textarea-spacing-md);
766
+ font-size: var(--starasia-ui-fontSizes-md, 14px);
767
+ border: var(--starasia-ui-textarea-border-width) solid
768
+ rgba(120, 134, 127, 0.2);
769
+ border-radius: var(--starasia-ui-textarea-border-radius-lg);
770
+ }
771
+ .starasia-textarea-lg {
772
+ height: var(--starasia-ui-textarea-height-lg);
773
+ padding-block: var(--starasia-ui-textarea-spacing-md);
774
+ padding-inline: var(--starasia-ui-textarea-spacing-md);
775
+ font-size: var(var(--starasia-ui-fontSizes-lg, 16px));
776
+ border: var(--starasia-ui-textarea-border-width) solid
777
+ var(--starasia-ui-textarea-color-tertiary-gray);
778
+ border-radius: var(--starasia-ui-textarea-border-radius-lg);
779
+ }
780
+
781
+ .starasia-textarea:focus {
782
+ /* outline-color: var(--starasia-ui-textarea-color-primary-blue); */
783
+ outline: none;
784
+ border-color: var(--starasia-ui-textarea-color-primary-blue);
785
+ box-shadow: 0px 0px 0px 2px var(--starasia-ui-textarea-color-quaternary-blue);
786
+ }
787
+
788
+ .starasia-textarea:disabled {
789
+ border-color: rgba(120, 134, 127, 0.2);
790
+ background-color: rgba(120, 134, 127, 0.1);
791
+ /* background-color: var(--starasia-ui-textarea-color-tertiary-gray); */
792
+ /* border-color: var(--starasia-ui-textarea-color-tertiary-gray); */
793
+ cursor: not-allowed;
794
+ }
795
+
796
+ .starasia-textarea-warning {
797
+ border-color: #eab308 !important;
798
+ /* outline-color: #eab308 !important; */
799
+ }
800
+ .starasia-textarea-error {
801
+ border-color: #ef4444 !important;
802
+ /* outline-color: #eab308 !important; */
803
+ }
804
+ `, Sr = "starasia-textarea-styles", ge = (E) => {
805
+ if (!document.getElementById(Sr)) {
806
+ const b = document.createElement("style");
807
+ b.id = Sr, b.textContent = E, document.head.appendChild(b);
808
+ }
809
+ };
810
+ ge(pe);
811
+ const he = (E) => {
812
+ const {
813
+ height: b,
814
+ width: D = "fit-content",
815
+ resize: m,
816
+ size: O = "md",
817
+ status: R,
818
+ fullWidth: _,
819
+ ...h
820
+ } = E;
821
+ return /* @__PURE__ */ ve.jsx(
822
+ "textarea",
823
+ {
824
+ className: `starasia-textarea starasia-textarea-resize-${m} starasia-textarea-${O} starasia-textarea-${R}`,
825
+ ...h,
826
+ disabled: R === "disable" ? !0 : h.disabled,
827
+ style: { height: b, width: _ ? "100%" : D, ...h.style }
828
+ }
829
+ );
830
+ };
831
+ export {
832
+ he as Textarea
833
+ };
@@ -0,0 +1,192 @@
1
+ (function(E,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(E=typeof globalThis<"u"?globalThis:E||self,C(E.Textarea={},E.React))})(this,function(E,C){"use strict";var B={exports:{}},A={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var er;function Pr(){if(er)return A;er=1;var R=C,b=Symbol.for("react.element"),W=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,P=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function T(h,f,j){var p,y={},w=null,L=null;j!==void 0&&(w=""+j),f.key!==void 0&&(w=""+f.key),f.ref!==void 0&&(L=f.ref);for(p in f)m.call(f,p)&&!_.hasOwnProperty(p)&&(y[p]=f[p]);if(h&&h.defaultProps)for(p in f=h.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:b,type:h,key:w,ref:L,props:y,_owner:P.current}}return A.Fragment=W,A.jsx=T,A.jsxs=T,A}var I={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ar;function jr(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var R=C,b=Symbol.for("react.element"),W=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),nr=Symbol.iterator,Ar="@@iterator";function Ir(r){if(r===null||typeof r!="object")return null;var e=nr&&r[nr]||r[Ar];return typeof e=="function"?e:null}var k=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(r){{for(var e=arguments.length,a=new Array(e>1?e-1:0),t=1;t<e;t++)a[t-1]=arguments[t];Wr("error",r,a)}}function Wr(r,e,a){{var t=k.ReactDebugCurrentFrame,s=t.getStackAddendum();s!==""&&(e+="%s",a=a.concat([s]));var o=a.map(function(i){return String(i)});o.unshift("Warning: "+e),Function.prototype.apply.call(console[r],console,o)}}var zr=!1,$r=!1,Yr=!1,Lr=!1,Mr=!1,ir;ir=Symbol.for("react.module.reference");function Vr(r){return!!(typeof r=="string"||typeof r=="function"||r===m||r===_||Mr||r===P||r===j||r===p||Lr||r===L||zr||$r||Yr||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===y||r.$$typeof===T||r.$$typeof===h||r.$$typeof===f||r.$$typeof===ir||r.getModuleId!==void 0))}function Nr(r,e,a){var t=r.displayName;if(t)return t;var s=e.displayName||e.name||"";return s!==""?a+"("+s+")":a}function sr(r){return r.displayName||"Context"}function x(r){if(r==null)return null;if(typeof r.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case m:return"Fragment";case W:return"Portal";case _:return"Profiler";case P:return"StrictMode";case j:return"Suspense";case p:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case h:var e=r;return sr(e)+".Consumer";case T:var a=r;return sr(a._context)+".Provider";case f:return Nr(r,r.render,"ForwardRef");case y:var t=r.displayName||null;return t!==null?t:x(r.type)||"Memo";case w:{var s=r,o=s._payload,i=s._init;try{return x(i(o))}catch{return null}}}return null}var S=Object.assign,z=0,or,ur,lr,cr,fr,dr,vr;function pr(){}pr.__reactDisabledLog=!0;function Ur(){{if(z===0){or=console.log,ur=console.info,lr=console.warn,cr=console.error,fr=console.group,dr=console.groupCollapsed,vr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:pr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}z++}}function Br(){{if(z--,z===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},r,{value:or}),info:S({},r,{value:ur}),warn:S({},r,{value:lr}),error:S({},r,{value:cr}),group:S({},r,{value:fr}),groupCollapsed:S({},r,{value:dr}),groupEnd:S({},r,{value:vr})})}z<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,J;function M(r,e,a){{if(J===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);J=t&&t[1]||""}return`
18
+ `+J+r}}var K=!1,V;{var qr=typeof WeakMap=="function"?WeakMap:Map;V=new qr}function gr(r,e){if(!r||K)return"";{var a=V.get(r);if(a!==void 0)return a}var t;K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var o;o=q.current,q.current=null,Ur();try{if(e){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(v){t=v}Reflect.construct(r,[],i)}else{try{i.call()}catch(v){t=v}r.call(i.prototype)}}else{try{throw Error()}catch(v){t=v}r()}}catch(v){if(v&&t&&typeof v.stack=="string"){for(var n=v.stack.split(`
19
+ `),d=t.stack.split(`
20
+ `),u=n.length-1,l=d.length-1;u>=1&&l>=0&&n[u]!==d[l];)l--;for(;u>=1&&l>=0;u--,l--)if(n[u]!==d[l]){if(u!==1||l!==1)do if(u--,l--,l<0||n[u]!==d[l]){var g=`
21
+ `+n[u].replace(" at new "," at ");return r.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",r.displayName)),typeof r=="function"&&V.set(r,g),g}while(u>=1&&l>=0);break}}}finally{K=!1,q.current=o,Br(),Error.prepareStackTrace=s}var F=r?r.displayName||r.name:"",O=F?M(F):"";return typeof r=="function"&&V.set(r,O),O}function Jr(r,e,a){return gr(r,!1)}function Kr(r){var e=r.prototype;return!!(e&&e.isReactComponent)}function N(r,e,a){if(r==null)return"";if(typeof r=="function")return gr(r,Kr(r));if(typeof r=="string")return M(r);switch(r){case j:return M("Suspense");case p:return M("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case f:return Jr(r.render);case y:return N(r.type,e,a);case w:{var t=r,s=t._payload,o=t._init;try{return N(o(s),e,a)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,br={},hr=k.ReactDebugCurrentFrame;function U(r){if(r){var e=r._owner,a=N(r.type,r._source,e?e.type:null);hr.setExtraStackFrame(a)}else hr.setExtraStackFrame(null)}function Gr(r,e,a,t,s){{var o=Function.call.bind($);for(var i in r)if(o(r,i)){var n=void 0;try{if(typeof r[i]!="function"){var d=Error((t||"React class")+": "+a+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}n=r[i](e,i,t,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){n=u}n&&!(n instanceof Error)&&(U(s),c("%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).",t||"React class",a,i,typeof n),U(null)),n instanceof Error&&!(n.message in br)&&(br[n.message]=!0,U(s),c("Failed %s type: %s",a,n.message),U(null))}}}var Xr=Array.isArray;function G(r){return Xr(r)}function Hr(r){{var e=typeof Symbol=="function"&&Symbol.toStringTag,a=e&&r[Symbol.toStringTag]||r.constructor.name||"Object";return a}}function Zr(r){try{return xr(r),!1}catch{return!0}}function xr(r){return""+r}function yr(r){if(Zr(r))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Hr(r)),xr(r)}var Y=k.ReactCurrentOwner,Qr={key:!0,ref:!0,__self:!0,__source:!0},mr,Er,X;X={};function re(r){if($.call(r,"ref")){var e=Object.getOwnPropertyDescriptor(r,"ref").get;if(e&&e.isReactWarning)return!1}return r.ref!==void 0}function ee(r){if($.call(r,"key")){var e=Object.getOwnPropertyDescriptor(r,"key").get;if(e&&e.isReactWarning)return!1}return r.key!==void 0}function ae(r,e){if(typeof r.ref=="string"&&Y.current&&e&&Y.current.stateNode!==e){var a=x(Y.current.type);X[a]||(c('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',x(Y.current.type),r.ref),X[a]=!0)}}function te(r,e){{var a=function(){mr||(mr=!0,c("%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)",e))};a.isReactWarning=!0,Object.defineProperty(r,"key",{get:a,configurable:!0})}}function ne(r,e){{var a=function(){Er||(Er=!0,c("%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)",e))};a.isReactWarning=!0,Object.defineProperty(r,"ref",{get:a,configurable:!0})}}var ie=function(r,e,a,t,s,o,i){var n={$$typeof:b,type:r,key:e,ref:a,props:i,_owner:o};return n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(n,"_self",{configurable:!1,enumerable:!1,writable:!1,value:t}),Object.defineProperty(n,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n};function se(r,e,a,t,s){{var o,i={},n=null,d=null;a!==void 0&&(yr(a),n=""+a),ee(e)&&(yr(e.key),n=""+e.key),re(e)&&(d=e.ref,ae(e,s));for(o in e)$.call(e,o)&&!Qr.hasOwnProperty(o)&&(i[o]=e[o]);if(r&&r.defaultProps){var u=r.defaultProps;for(o in u)i[o]===void 0&&(i[o]=u[o])}if(n||d){var l=typeof r=="function"?r.displayName||r.name||"Unknown":r;n&&te(i,l),d&&ne(i,l)}return ie(r,n,d,s,t,Y.current,i)}}var H=k.ReactCurrentOwner,Rr=k.ReactDebugCurrentFrame;function D(r){if(r){var e=r._owner,a=N(r.type,r._source,e?e.type:null);Rr.setExtraStackFrame(a)}else Rr.setExtraStackFrame(null)}var Z;Z=!1;function Q(r){return typeof r=="object"&&r!==null&&r.$$typeof===b}function _r(){{if(H.current){var r=x(H.current.type);if(r)return`
22
+
23
+ Check the render method of \``+r+"`."}return""}}function oe(r){{if(r!==void 0){var e=r.fileName.replace(/^.*[\\\/]/,""),a=r.lineNumber;return`
24
+
25
+ Check your code at `+e+":"+a+"."}return""}}var Tr={};function ue(r){{var e=_r();if(!e){var a=typeof r=="string"?r:r.displayName||r.name;a&&(e=`
26
+
27
+ Check the top-level render call using <`+a+">.")}return e}}function wr(r,e){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var a=ue(e);if(Tr[a])return;Tr[a]=!0;var t="";r&&r._owner&&r._owner!==H.current&&(t=" It was passed a child from "+x(r._owner.type)+"."),D(r),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,t),D(null)}}function Sr(r,e){{if(typeof r!="object")return;if(G(r))for(var a=0;a<r.length;a++){var t=r[a];Q(t)&&wr(t,e)}else if(Q(r))r._store&&(r._store.validated=!0);else if(r){var s=Ir(r);if(typeof s=="function"&&s!==r.entries)for(var o=s.call(r),i;!(i=o.next()).done;)Q(i.value)&&wr(i.value,e)}}}function le(r){{var e=r.type;if(e==null||typeof e=="string")return;var a;if(typeof e=="function")a=e.propTypes;else if(typeof e=="object"&&(e.$$typeof===f||e.$$typeof===y))a=e.propTypes;else return;if(a){var t=x(e);Gr(a,r.props,"prop",t,r)}else if(e.PropTypes!==void 0&&!Z){Z=!0;var s=x(e);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof e.getDefaultProps=="function"&&!e.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ce(r){{for(var e=Object.keys(r.props),a=0;a<e.length;a++){var t=e[a];if(t!=="children"&&t!=="key"){D(r),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",t),D(null);break}}r.ref!==null&&(D(r),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Or={};function Cr(r,e,a,t,s,o){{var i=Vr(r);if(!i){var n="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=oe(s);d?n+=d:n+=_r();var u;r===null?u="null":G(r)?u="array":r!==void 0&&r.$$typeof===b?(u="<"+(x(r.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):u=typeof r,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,n)}var l=se(r,e,a,s,o);if(l==null)return l;if(i){var g=e.children;if(g!==void 0)if(t)if(G(g)){for(var F=0;F<g.length;F++)Sr(g[F],r);Object.freeze&&Object.freeze(g)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Sr(g,r)}if($.call(e,"key")){var O=x(r),v=Object.keys(e).filter(function(be){return be!=="key"}),rr=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!Or[O+rr]){var ge=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
28
+ let props = %s;
29
+ <%s {...props} />
30
+ React keys must be passed directly to JSX without using spread:
31
+ let props = %s;
32
+ <%s key={someKey} {...props} />`,rr,O,ge,O),Or[O+rr]=!0}}return r===m?ce(l):le(l),l}}function fe(r,e,a){return Cr(r,e,a,!0)}function de(r,e,a){return Cr(r,e,a,!1)}var ve=de,pe=fe;I.Fragment=m,I.jsx=ve,I.jsxs=pe}()),I}process.env.NODE_ENV==="production"?B.exports=Pr():B.exports=jr();var kr=B.exports;const Dr=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
33
+
34
+ * {
35
+ margin: 0;
36
+ padding: 0;
37
+ font-family: "Poppins", serif;
38
+ box-sizing: border-box;
39
+ }
40
+
41
+ :root {
42
+ /* height */
43
+ --starasia-ui-h-6: 1.5rem; /* 24px */
44
+ --starasia-ui-h-8: 2rem; /* 32px */
45
+ --starasia-ui-h-10: 2.5rem; /* 40px */
46
+ --starasia-ui-h-12: 3rem; /* 48px */
47
+
48
+ /* color */
49
+ --starasia-ui-color-gray-200: #c9cecc;
50
+ --starasia-ui-color-gray-300: #d1d5db;
51
+ --starasia-ui-color-blue-800: #1e40af;
52
+
53
+ /* border radius */
54
+ --starasia-ui-radii-base: 0.25rem; /* 4px */
55
+
56
+ /* new root css */
57
+ /* spacing */
58
+ --starasia-ui-textarea-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
59
+ --starasia-ui-textarea-spacing-sm: var(--starasia-ui-spacing-sm, 8px);
60
+ --starasia-ui-textarea-spacing-md: var(--starasia-ui-spacing-md, 12px);
61
+
62
+ /* height */
63
+ --starasia-ui-textarea-height-xs: var(--starasia-ui-h-6, 24px);
64
+ --starasia-ui-textarea-height-sm: var(--starasia-ui-h-8, 32px);
65
+ --starasia-ui-textarea-height-md: var(--starasia-ui-h-10, 40px);
66
+ --starasia-ui-textarea-height-lg: var(--starasia-ui-h-12, 48px);
67
+
68
+ /* border width */
69
+ --starasia-ui-textarea-border-width: var(--starasia-ui-border, 1px);
70
+
71
+ /* color */
72
+ /* gray */
73
+ --starasia-ui-textarea-color-tertiary-gray: var(
74
+ --starasia-ui-color-gray-300,
75
+ #d1d5db
76
+ );
77
+
78
+ /* blue */
79
+ --starasia-ui-textarea-color-primary-blue: var(
80
+ --starasia-ui-color-blue-700,
81
+ #1d4ed8
82
+ );
83
+ --starasia-ui-textarea-color-tertiary-blue: var(
84
+ --starasia-ui-color-blue-300,
85
+ #93c5fd
86
+ );
87
+ --starasia-ui-textarea-color-quaternary-blue: var(
88
+ --starasia-ui-color-blue-100,
89
+ #dbeafe
90
+ );
91
+
92
+ /* border radius */
93
+ --starasia-ui-textarea-border-radius-base: var(--starasia-ui-radii-md, 8px);
94
+ --starasia-ui-textarea-border-radius-lg: var(--starasia-ui-radii-md, 8px);
95
+
96
+ --starasia-ui-textarea-placholder-color: var(
97
+ --starasia-ui-color-gray-200,
98
+ #c9cecc
99
+ );
100
+ --starasia-ui-textarea-placholder-fontWeight: var(
101
+ --starasia-ui-fontWeights-normal,
102
+ 300
103
+ );
104
+ }
105
+
106
+ .starasia-textarea {
107
+ padding: var(--starasia-ui-textarea-spacing-sm);
108
+ box-sizing: border-box;
109
+ /* background: transparent; */
110
+ background: white;
111
+ }
112
+ .starasia-textarea::placeholder {
113
+ color: var(--starasia-ui-textarea-placholder-color);
114
+ font-weight: var(--starasia-ui-textarea-placholder-fontWeight);
115
+ }
116
+ .starasia-textarea-resize-horizontal {
117
+ resize: horizontal;
118
+ }
119
+
120
+ .starasia-textarea-resize-vertical {
121
+ resize: vertical;
122
+ }
123
+
124
+ .starasia-textarea-resize-both {
125
+ resize: both;
126
+ }
127
+
128
+ .starasia-textarea-resize-none {
129
+ resize: none;
130
+ }
131
+
132
+ .starasia-textarea-xs {
133
+ height: var(--starasia-ui-textarea-height-xs);
134
+ padding-block: var(--starasia-ui-textarea-spacing-xs);
135
+ padding-inline: var(--starasia-ui-textarea-spacing-sm);
136
+ font-size: var(--starasia-ui-fontSizes-xs, 10px);
137
+ border: var(--starasia-ui-textarea-border-width) solid
138
+ var(--starasia-ui-textarea-color-tertiary-gray);
139
+ border-radius: var(--starasia-ui-textarea-border-radius-base);
140
+ }
141
+ .starasia-textarea-sm {
142
+ height: var(--starasia-ui-textarea-height-sm);
143
+ padding-block: var(--starasia-ui-textarea-spacing-xs);
144
+ padding-inline: var(--starasia-ui-textarea-spacing-sm);
145
+ font-size: var(--starasia-ui-fontSizes-sm, 12px);
146
+ border: var(--starasia-ui-textarea-border-width) solid
147
+ var(--starasia-ui-textarea-color-tertiary-gray);
148
+ border-radius: var(--starasia-ui-textarea-border-radius-base);
149
+ }
150
+ .starasia-textarea-md {
151
+ height: var(--starasia-ui-textarea-height-md);
152
+ padding-block: var(--starasia-ui-textarea-spacing-sm);
153
+ padding-inline: var(--starasia-ui-textarea-spacing-md);
154
+ font-size: var(--starasia-ui-fontSizes-md, 14px);
155
+ border: var(--starasia-ui-textarea-border-width) solid
156
+ rgba(120, 134, 127, 0.2);
157
+ border-radius: var(--starasia-ui-textarea-border-radius-lg);
158
+ }
159
+ .starasia-textarea-lg {
160
+ height: var(--starasia-ui-textarea-height-lg);
161
+ padding-block: var(--starasia-ui-textarea-spacing-md);
162
+ padding-inline: var(--starasia-ui-textarea-spacing-md);
163
+ font-size: var(var(--starasia-ui-fontSizes-lg, 16px));
164
+ border: var(--starasia-ui-textarea-border-width) solid
165
+ var(--starasia-ui-textarea-color-tertiary-gray);
166
+ border-radius: var(--starasia-ui-textarea-border-radius-lg);
167
+ }
168
+
169
+ .starasia-textarea:focus {
170
+ /* outline-color: var(--starasia-ui-textarea-color-primary-blue); */
171
+ outline: none;
172
+ border-color: var(--starasia-ui-textarea-color-primary-blue);
173
+ box-shadow: 0px 0px 0px 2px var(--starasia-ui-textarea-color-quaternary-blue);
174
+ }
175
+
176
+ .starasia-textarea:disabled {
177
+ border-color: rgba(120, 134, 127, 0.2);
178
+ background-color: rgba(120, 134, 127, 0.1);
179
+ /* background-color: var(--starasia-ui-textarea-color-tertiary-gray); */
180
+ /* border-color: var(--starasia-ui-textarea-color-tertiary-gray); */
181
+ cursor: not-allowed;
182
+ }
183
+
184
+ .starasia-textarea-warning {
185
+ border-color: #eab308 !important;
186
+ /* outline-color: #eab308 !important; */
187
+ }
188
+ .starasia-textarea-error {
189
+ border-color: #ef4444 !important;
190
+ /* outline-color: #eab308 !important; */
191
+ }
192
+ `,tr="starasia-textarea-styles";(R=>{if(!document.getElementById(tr)){const b=document.createElement("style");b.id=tr,b.textContent=R,document.head.appendChild(b)}})(Dr);const Fr=R=>{const{height:b,width:W="fit-content",resize:m,size:P="md",status:_,fullWidth:T,...h}=R;return kr.jsx("textarea",{className:`starasia-textarea starasia-textarea-resize-${m} starasia-textarea-${P} starasia-textarea-${_}`,...h,disabled:_==="disable"?!0:h.disabled,style:{height:b,width:T?"100%":W,...h.style}})};E.Textarea=Fr,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from "react";
2
+ export interface TextareaProps extends React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
3
+ resize?: "vertical" | "horizontal" | "both" | "none";
4
+ height?: CSSProperties["height"];
5
+ width?: CSSProperties["width"];
6
+ size?: "xs" | "sm" | "md" | "lg";
7
+ status?: "error" | "warning" | "disable" | "default";
8
+ fullWidth?: boolean;
9
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@starasia/textarea",
3
+ "version": "1.0.0",
4
+ "description": "textarea component for starasia UI",
5
+ "author": "Prawito Hudoro",
6
+ "main": "dist/textarea.umd.js",
7
+ "module": "dist/textarea.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist/*.js",
11
+ "dist/*.d.ts",
12
+ "dist/*.map",
13
+ "dist/*.css"
14
+ ],
15
+ "scripts": {
16
+ "dev": "vite --config vite.config.ts --port 3000",
17
+ "build": "vite build --config vite.config.ts"
18
+ },
19
+ "keywords": [],
20
+ "license": "ISC",
21
+ "type": "module",
22
+ "engines": {
23
+ "node": ">=18.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^20.11.16",
27
+ "@vitejs/plugin-react": "^4.2.1",
28
+ "tsconfig-paths": "^4.2.0",
29
+ "typescript": "^5.3.3",
30
+ "vite": "^5.0.12",
31
+ "vite-plugin-dts": "^3.7.2",
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0",
34
+ "@types/react": "^18.2.55",
35
+ "@types/react-dom": "^18.2.19"
36
+ }
37
+ }