@starasia/radio 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 radio
2
+
3
+ starasia radio is a strict and customizable radio 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/IRadio.png)
8
+
9
+ ## Package instalation
10
+
11
+ Instal package using pnpm
12
+
13
+ ```bash
14
+ pnpm add @starasia/radio
15
+ ```
16
+
17
+ Instal package using yarn
18
+
19
+ ```bash
20
+ yarn add @starasia/radio
21
+ ```
22
+
23
+ Instal package using npm
24
+
25
+ ```bash
26
+ npm i @starasia/radio
27
+ ```
28
+
29
+ ## Usage/Examples
30
+
31
+ ```javascript
32
+ import React from "react";
33
+ import {Radio} from "@starasia/radio";
34
+ import ReactDOM from "react-dom/client";
35
+
36
+ const App = () => (
37
+ <div>
38
+ <h1>Component test</h1>
39
+ <Radio label="hello " sizes="sm" />
40
+ <Radio label="Hay " sizes="sm" />
41
+ </div>
42
+ );
43
+
44
+ ReactDOM.createRoot(document.getElementById("app")!).render(<App />);
45
+
46
+
47
+
48
+ ```
49
+
50
+ ## Props @starasia/radio
51
+
52
+ #### Props that you can pass to <Radio {...props} />
53
+
54
+ | Prop Name | Value | required |
55
+ | :-------- | :----------------- | :------- |
56
+ | size | "sm" / "md" / "lg" | false |
57
+ | label | string | false |
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { RadioProps } from "./types";
3
+ export declare const Radio: React.FC<RadioProps>;
@@ -0,0 +1,2 @@
1
+ export { Radio } from "./Radio";
2
+ export * from "./types";
@@ -0,0 +1,828 @@
1
+ import Cr from "react";
2
+ var Q = { exports: {} }, I = {};
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 Tr;
13
+ function de() {
14
+ if (Tr)
15
+ return I;
16
+ Tr = 1;
17
+ var E = Cr, g = Symbol.for("react.element"), S = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, R = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, $ = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function j(_, f, O) {
19
+ var p, y = {}, w = null, Y = null;
20
+ O !== void 0 && (w = "" + O), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (Y = f.ref);
21
+ for (p in f)
22
+ m.call(f, p) && !$.hasOwnProperty(p) && (y[p] = f[p]);
23
+ if (_ && _.defaultProps)
24
+ for (p in f = _.defaultProps, f)
25
+ y[p] === void 0 && (y[p] = f[p]);
26
+ return { $$typeof: g, type: _, key: w, ref: Y, props: y, _owner: R.current };
27
+ }
28
+ return I.Fragment = S, I.jsx = j, I.jsxs = j, I;
29
+ }
30
+ var W = {};
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 Sr;
41
+ function ve() {
42
+ return Sr || (Sr = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var E = Cr, g = Symbol.for("react.element"), S = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), $ = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), _ = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), rr = Symbol.iterator, Pr = "@@iterator";
44
+ function kr(r) {
45
+ if (r === null || typeof r != "object")
46
+ return null;
47
+ var e = rr && r[rr] || r[Pr];
48
+ return typeof e == "function" ? e : null;
49
+ }
50
+ var C = 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), n = 1; n < e; n++)
54
+ a[n - 1] = arguments[n];
55
+ jr("error", r, a);
56
+ }
57
+ }
58
+ function jr(r, e, a) {
59
+ {
60
+ var n = C.ReactDebugCurrentFrame, o = n.getStackAddendum();
61
+ o !== "" && (e += "%s", a = a.concat([o]));
62
+ var s = a.map(function(i) {
63
+ return String(i);
64
+ });
65
+ s.unshift("Warning: " + e), Function.prototype.apply.call(console[r], console, s);
66
+ }
67
+ }
68
+ var Fr = !1, Dr = !1, Ar = !1, Ir = !1, Wr = !1, er;
69
+ er = Symbol.for("react.module.reference");
70
+ function $r(r) {
71
+ return !!(typeof r == "string" || typeof r == "function" || r === m || r === $ || Wr || r === R || r === O || r === p || Ir || r === Y || Fr || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === w || r.$$typeof === y || r.$$typeof === j || r.$$typeof === _ || 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 === er || r.getModuleId !== void 0));
76
+ }
77
+ function Yr(r, e, a) {
78
+ var n = r.displayName;
79
+ if (n)
80
+ return n;
81
+ var o = e.displayName || e.name || "";
82
+ return o !== "" ? a + "(" + o + ")" : a;
83
+ }
84
+ function ar(r) {
85
+ return r.displayName || "Context";
86
+ }
87
+ function b(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 S:
98
+ return "Portal";
99
+ case $:
100
+ return "Profiler";
101
+ case R:
102
+ return "StrictMode";
103
+ case O:
104
+ return "Suspense";
105
+ case p:
106
+ return "SuspenseList";
107
+ }
108
+ if (typeof r == "object")
109
+ switch (r.$$typeof) {
110
+ case _:
111
+ var e = r;
112
+ return ar(e) + ".Consumer";
113
+ case j:
114
+ var a = r;
115
+ return ar(a._context) + ".Provider";
116
+ case f:
117
+ return Yr(r, r.render, "ForwardRef");
118
+ case y:
119
+ var n = r.displayName || null;
120
+ return n !== null ? n : b(r.type) || "Memo";
121
+ case w: {
122
+ var o = r, s = o._payload, i = o._init;
123
+ try {
124
+ return b(i(s));
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ var x = Object.assign, F = 0, nr, tr, ir, or, sr, ur, lr;
133
+ function cr() {
134
+ }
135
+ cr.__reactDisabledLog = !0;
136
+ function zr() {
137
+ {
138
+ if (F === 0) {
139
+ nr = console.log, tr = console.info, ir = console.warn, or = console.error, sr = console.group, ur = console.groupCollapsed, lr = console.groupEnd;
140
+ var r = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ value: cr,
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 Lr() {
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: x({}, r, {
169
+ value: nr
170
+ }),
171
+ info: x({}, r, {
172
+ value: tr
173
+ }),
174
+ warn: x({}, r, {
175
+ value: ir
176
+ }),
177
+ error: x({}, r, {
178
+ value: or
179
+ }),
180
+ group: x({}, r, {
181
+ value: sr
182
+ }),
183
+ groupCollapsed: x({}, r, {
184
+ value: ur
185
+ }),
186
+ groupEnd: x({}, r, {
187
+ value: lr
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 U = C.ReactCurrentDispatcher, B;
195
+ function z(r, e, a) {
196
+ {
197
+ if (B === void 0)
198
+ try {
199
+ throw Error();
200
+ } catch (o) {
201
+ var n = o.stack.trim().match(/\n( *(at )?)/);
202
+ B = n && n[1] || "";
203
+ }
204
+ return `
205
+ ` + B + r;
206
+ }
207
+ }
208
+ var J = !1, L;
209
+ {
210
+ var Nr = typeof WeakMap == "function" ? WeakMap : Map;
211
+ L = new Nr();
212
+ }
213
+ function fr(r, e) {
214
+ if (!r || J)
215
+ return "";
216
+ {
217
+ var a = L.get(r);
218
+ if (a !== void 0)
219
+ return a;
220
+ }
221
+ var n;
222
+ J = !0;
223
+ var o = Error.prepareStackTrace;
224
+ Error.prepareStackTrace = void 0;
225
+ var s;
226
+ s = U.current, U.current = null, zr();
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
+ n = v;
241
+ }
242
+ Reflect.construct(r, [], i);
243
+ } else {
244
+ try {
245
+ i.call();
246
+ } catch (v) {
247
+ n = v;
248
+ }
249
+ r.call(i.prototype);
250
+ }
251
+ } else {
252
+ try {
253
+ throw Error();
254
+ } catch (v) {
255
+ n = v;
256
+ }
257
+ r();
258
+ }
259
+ } catch (v) {
260
+ if (v && n && typeof v.stack == "string") {
261
+ for (var t = v.stack.split(`
262
+ `), d = n.stack.split(`
263
+ `), u = t.length - 1, l = d.length - 1; u >= 1 && l >= 0 && t[u] !== d[l]; )
264
+ l--;
265
+ for (; u >= 1 && l >= 0; u--, l--)
266
+ if (t[u] !== d[l]) {
267
+ if (u !== 1 || l !== 1)
268
+ do
269
+ if (u--, l--, l < 0 || t[u] !== d[l]) {
270
+ var h = `
271
+ ` + t[u].replace(" at new ", " at ");
272
+ return r.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", r.displayName)), typeof r == "function" && L.set(r, h), h;
273
+ }
274
+ while (u >= 1 && l >= 0);
275
+ break;
276
+ }
277
+ }
278
+ } finally {
279
+ J = !1, U.current = s, Lr(), Error.prepareStackTrace = o;
280
+ }
281
+ var k = r ? r.displayName || r.name : "", T = k ? z(k) : "";
282
+ return typeof r == "function" && L.set(r, T), T;
283
+ }
284
+ function Vr(r, e, a) {
285
+ return fr(r, !1);
286
+ }
287
+ function Mr(r) {
288
+ var e = r.prototype;
289
+ return !!(e && e.isReactComponent);
290
+ }
291
+ function N(r, e, a) {
292
+ if (r == null)
293
+ return "";
294
+ if (typeof r == "function")
295
+ return fr(r, Mr(r));
296
+ if (typeof r == "string")
297
+ return z(r);
298
+ switch (r) {
299
+ case O:
300
+ return z("Suspense");
301
+ case p:
302
+ return z("SuspenseList");
303
+ }
304
+ if (typeof r == "object")
305
+ switch (r.$$typeof) {
306
+ case f:
307
+ return Vr(r.render);
308
+ case y:
309
+ return N(r.type, e, a);
310
+ case w: {
311
+ var n = r, o = n._payload, s = n._init;
312
+ try {
313
+ return N(s(o), e, a);
314
+ } catch {
315
+ }
316
+ }
317
+ }
318
+ return "";
319
+ }
320
+ var D = Object.prototype.hasOwnProperty, dr = {}, vr = C.ReactDebugCurrentFrame;
321
+ function V(r) {
322
+ if (r) {
323
+ var e = r._owner, a = N(r.type, r._source, e ? e.type : null);
324
+ vr.setExtraStackFrame(a);
325
+ } else
326
+ vr.setExtraStackFrame(null);
327
+ }
328
+ function Ur(r, e, a, n, o) {
329
+ {
330
+ var s = Function.call.bind(D);
331
+ for (var i in r)
332
+ if (s(r, i)) {
333
+ var t = void 0;
334
+ try {
335
+ if (typeof r[i] != "function") {
336
+ var d = Error((n || "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
+ t = r[i](e, i, n, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (u) {
341
+ t = u;
342
+ }
343
+ t && !(t instanceof Error) && (V(o), 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).", n || "React class", a, i, typeof t), V(null)), t instanceof Error && !(t.message in dr) && (dr[t.message] = !0, V(o), c("Failed %s type: %s", a, t.message), V(null));
344
+ }
345
+ }
346
+ }
347
+ var Br = Array.isArray;
348
+ function q(r) {
349
+ return Br(r);
350
+ }
351
+ function Jr(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 qr(r) {
358
+ try {
359
+ return pr(r), !1;
360
+ } catch {
361
+ return !0;
362
+ }
363
+ }
364
+ function pr(r) {
365
+ return "" + r;
366
+ }
367
+ function hr(r) {
368
+ if (qr(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.", Jr(r)), pr(r);
370
+ }
371
+ var A = C.ReactCurrentOwner, Kr = {
372
+ key: !0,
373
+ ref: !0,
374
+ __self: !0,
375
+ __source: !0
376
+ }, gr, mr, K;
377
+ K = {};
378
+ function Gr(r) {
379
+ if (D.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 Hr(r) {
387
+ if (D.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" && A.current && e && A.current.stateNode !== e) {
396
+ var a = b(A.current.type);
397
+ K[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', b(A.current.type), r.ref), K[a] = !0);
398
+ }
399
+ }
400
+ function Zr(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 Qr(r, e) {
412
+ {
413
+ var a = function() {
414
+ mr || (mr = !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 re = function(r, e, a, n, o, s, i) {
423
+ var t = {
424
+ // This tag allows us to uniquely identify this as a React Element
425
+ $$typeof: g,
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: s
433
+ };
434
+ return t._store = {}, Object.defineProperty(t._store, "validated", {
435
+ configurable: !1,
436
+ enumerable: !1,
437
+ writable: !0,
438
+ value: !1
439
+ }), Object.defineProperty(t, "_self", {
440
+ configurable: !1,
441
+ enumerable: !1,
442
+ writable: !1,
443
+ value: n
444
+ }), Object.defineProperty(t, "_source", {
445
+ configurable: !1,
446
+ enumerable: !1,
447
+ writable: !1,
448
+ value: o
449
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
450
+ };
451
+ function ee(r, e, a, n, o) {
452
+ {
453
+ var s, i = {}, t = null, d = null;
454
+ a !== void 0 && (hr(a), t = "" + a), Hr(e) && (hr(e.key), t = "" + e.key), Gr(e) && (d = e.ref, Xr(e, o));
455
+ for (s in e)
456
+ D.call(e, s) && !Kr.hasOwnProperty(s) && (i[s] = e[s]);
457
+ if (r && r.defaultProps) {
458
+ var u = r.defaultProps;
459
+ for (s in u)
460
+ i[s] === void 0 && (i[s] = u[s]);
461
+ }
462
+ if (t || d) {
463
+ var l = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
464
+ t && Zr(i, l), d && Qr(i, l);
465
+ }
466
+ return re(r, t, d, o, n, A.current, i);
467
+ }
468
+ }
469
+ var G = C.ReactCurrentOwner, br = C.ReactDebugCurrentFrame;
470
+ function P(r) {
471
+ if (r) {
472
+ var e = r._owner, a = N(r.type, r._source, e ? e.type : null);
473
+ br.setExtraStackFrame(a);
474
+ } else
475
+ br.setExtraStackFrame(null);
476
+ }
477
+ var H;
478
+ H = !1;
479
+ function X(r) {
480
+ return typeof r == "object" && r !== null && r.$$typeof === g;
481
+ }
482
+ function yr() {
483
+ {
484
+ if (G.current) {
485
+ var r = b(G.current.type);
486
+ if (r)
487
+ return `
488
+
489
+ Check the render method of \`` + r + "`.";
490
+ }
491
+ return "";
492
+ }
493
+ }
494
+ function ae(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 Er = {};
506
+ function ne(r) {
507
+ {
508
+ var e = yr();
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 Rr(r, e) {
519
+ {
520
+ if (!r._store || r._store.validated || r.key != null)
521
+ return;
522
+ r._store.validated = !0;
523
+ var a = ne(e);
524
+ if (Er[a])
525
+ return;
526
+ Er[a] = !0;
527
+ var n = "";
528
+ r && r._owner && r._owner !== G.current && (n = " It was passed a child from " + b(r._owner.type) + "."), P(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, n), P(null);
529
+ }
530
+ }
531
+ function _r(r, e) {
532
+ {
533
+ if (typeof r != "object")
534
+ return;
535
+ if (q(r))
536
+ for (var a = 0; a < r.length; a++) {
537
+ var n = r[a];
538
+ X(n) && Rr(n, e);
539
+ }
540
+ else if (X(r))
541
+ r._store && (r._store.validated = !0);
542
+ else if (r) {
543
+ var o = kr(r);
544
+ if (typeof o == "function" && o !== r.entries)
545
+ for (var s = o.call(r), i; !(i = s.next()).done; )
546
+ X(i.value) && Rr(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 n = b(e);
566
+ Ur(a, r.props, "prop", n, r);
567
+ } else if (e.PropTypes !== void 0 && !H) {
568
+ H = !0;
569
+ var o = b(e);
570
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "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 ie(r) {
576
+ {
577
+ for (var e = Object.keys(r.props), a = 0; a < e.length; a++) {
578
+ var n = e[a];
579
+ if (n !== "children" && n !== "key") {
580
+ P(r), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), P(null);
581
+ break;
582
+ }
583
+ }
584
+ r.ref !== null && (P(r), c("Invalid attribute `ref` supplied to `React.Fragment`."), P(null));
585
+ }
586
+ }
587
+ var wr = {};
588
+ function xr(r, e, a, n, o, s) {
589
+ {
590
+ var i = $r(r);
591
+ if (!i) {
592
+ var t = "";
593
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (t += " 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 = ae(o);
595
+ d ? t += d : t += yr();
596
+ var u;
597
+ r === null ? u = "null" : q(r) ? u = "array" : r !== void 0 && r.$$typeof === g ? (u = "<" + (b(r.type) || "Unknown") + " />", t = " 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, t);
598
+ }
599
+ var l = ee(r, e, a, o, s);
600
+ if (l == null)
601
+ return l;
602
+ if (i) {
603
+ var h = e.children;
604
+ if (h !== void 0)
605
+ if (n)
606
+ if (q(h)) {
607
+ for (var k = 0; k < h.length; k++)
608
+ _r(h[k], r);
609
+ Object.freeze && Object.freeze(h);
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
+ _r(h, r);
614
+ }
615
+ if (D.call(e, "key")) {
616
+ var T = b(r), v = Object.keys(e).filter(function(fe) {
617
+ return fe !== "key";
618
+ }), Z = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
619
+ if (!wr[T + Z]) {
620
+ var ce = 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} />`, Z, T, ce, T), wr[T + Z] = !0;
627
+ }
628
+ }
629
+ return r === m ? ie(l) : te(l), l;
630
+ }
631
+ }
632
+ function oe(r, e, a) {
633
+ return xr(r, e, a, !0);
634
+ }
635
+ function se(r, e, a) {
636
+ return xr(r, e, a, !1);
637
+ }
638
+ var ue = se, le = oe;
639
+ W.Fragment = m, W.jsx = ue, W.jsxs = le;
640
+ }()), W;
641
+ }
642
+ process.env.NODE_ENV === "production" ? Q.exports = de() : Q.exports = ve();
643
+ var M = Q.exports;
644
+ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
645
+
646
+ :root {
647
+ /* font weight */
648
+ --starasia-ui-radio-font-weight-normal: var(
649
+ --starasia-ui-fontWeights-normal,
650
+ 300
651
+ );
652
+ --starasia-ui-radio-font-weight-medium: var(
653
+ --starasia-ui-fontWeights-medium,
654
+ 400
655
+ );
656
+
657
+ /* width */
658
+ --starasia-ui-radio-width-sm: 14px;
659
+ --starasia-ui-radio-width-md: var(--starasia-ui-w-4, 16px);
660
+ --starasia-ui-radio-width-lg: 18px;
661
+
662
+ /* height */
663
+ --starasia-ui-radio-height-sm: 14px;
664
+ --starasia-ui-radio-height-md: var(--starasia-ui-h-4, 16px);
665
+ --starasia-ui-radio-height-lg: 18px;
666
+
667
+ /* font size */
668
+ --starasia-ui-radio-font-size-sm: var(--starasia-ui-fontSizes-sm, 12px);
669
+ --starasia-ui-radio-font-size-md: var(--starasia-ui-fontSizes-md, 14px);
670
+ --starasia-ui-radio-font-size-lg: var(--starasia-ui-fontSizes-lg, 16px);
671
+
672
+ /* color */
673
+ --starasia-ui-radio-color-primary-blue: var(
674
+ --starasia-ui-brand-primary-default,
675
+ #1976d2
676
+ );
677
+ }
678
+
679
+ * {
680
+ font-family: "Poppins", serif;
681
+ margin: 0;
682
+ padding: 0;
683
+ }
684
+
685
+ .starasia-radio-container {
686
+ width: max-content;
687
+ display: flex;
688
+ & label {
689
+ font-weight: var(--starasia-ui-radio-font-weight-medium);
690
+ }
691
+ & span {
692
+ font-weight: var(--starasia-ui-radio-font-weight-normal);
693
+ }
694
+ }
695
+
696
+ .starasia-radio-container:has(.starasia-radio-input-sm) {
697
+ gap: 12px;
698
+ font-size: var(--starasia-ui-radio-font-size-sm);
699
+ }
700
+ .starasia-radio-container:has(.starasia-radio-input-md) {
701
+ gap: 12px;
702
+ font-size: var(--starasia-ui-radio-font-size-md);
703
+ }
704
+ .starasia-radio-container:has(.starasia-radio-input-lg) {
705
+ gap: 16px;
706
+ font-size: var(--starasia-ui-radio-font-size-lg);
707
+ }
708
+
709
+ input.starasia-radio-input[type="radio"] {
710
+ appearance: none;
711
+ border: 1px solid black;
712
+ border-radius: 50%;
713
+ outline: none;
714
+ background-color: transparent;
715
+ cursor: pointer;
716
+ position: relative;
717
+ &:checked {
718
+ border-color: var(--starasia-ui-radio-color-primary-blue);
719
+ }
720
+
721
+ &::after {
722
+ display: block;
723
+ position: absolute;
724
+ content: "";
725
+ width: 0px;
726
+ height: 0px;
727
+ top: 50%;
728
+ left: 50%;
729
+ transform: translate(-50%, -50%);
730
+ border-radius: 50%;
731
+ transition: 0.3s;
732
+ background-color: var(--starasia-ui-radio-color-primary-blue);
733
+ }
734
+
735
+ &:disabled {
736
+ border-color: #aeb6b2;
737
+ cursor: not-allowed;
738
+ }
739
+
740
+ &:checked:disabled {
741
+ border-color: #aeb6b2;
742
+ cursor: not-allowed;
743
+ }
744
+
745
+ &:checked:disabled::after {
746
+ background-color: #aeb6b2;
747
+ }
748
+
749
+ &:hover:not(:disabled) {
750
+ box-shadow: 0px 0px 0px 4px rgba(201, 206, 204, 0.2);
751
+ }
752
+ }
753
+
754
+ input.starasia-radio-input-sm[type="radio"] {
755
+ width: var(--starasia-ui-radio-width-sm);
756
+ height: var(--starasia-ui-radio-height-sm);
757
+
758
+ &:checked::after {
759
+ width: calc(var(--starasia-ui-radio-width-sm) - 5px);
760
+ height: calc(var(--starasia-ui-radio-height-sm) - 5px);
761
+ }
762
+ }
763
+
764
+ input.starasia-radio-input-md[type="radio"] {
765
+ width: var(--starasia-ui-radio-width-md);
766
+ height: var(--starasia-ui-radio-height-md);
767
+
768
+ &:checked::after {
769
+ width: calc(var(--starasia-ui-radio-width-md) - 6px);
770
+ height: calc(var(--starasia-ui-radio-height-md) - 6px);
771
+ }
772
+ }
773
+
774
+ input.starasia-radio-input-lg[type="radio"] {
775
+ width: var(--starasia-ui-radio-width-lg);
776
+ height: var(--starasia-ui-radio-height-lg);
777
+
778
+ &:checked::after {
779
+ width: calc(var(--starasia-ui-radio-width-lg) - 7px);
780
+ height: calc(var(--starasia-ui-radio-height-lg) - 7px);
781
+ }
782
+ }
783
+ `, Or = "starasia-radio-styles", he = (E) => {
784
+ if (!document.getElementById(Or)) {
785
+ const g = document.createElement("style");
786
+ g.id = Or, g.textContent = E, document.head.appendChild(g);
787
+ }
788
+ };
789
+ he(pe);
790
+ const me = (E) => {
791
+ const { size: g = "md", label: S, description: m, ...R } = E;
792
+ return /* @__PURE__ */ M.jsxs(
793
+ "div",
794
+ {
795
+ className: "starasia-radio-container",
796
+ style: {
797
+ alignItems: m ? "start" : "center"
798
+ },
799
+ children: [
800
+ /* @__PURE__ */ M.jsx(
801
+ "input",
802
+ {
803
+ type: "radio",
804
+ className: `starasia-radio-input starasia-radio-input-${g}`,
805
+ ...R
806
+ }
807
+ ),
808
+ S || m ? /* @__PURE__ */ M.jsxs("label", { htmlFor: R.id, style: { lineHeight: 1.07 }, children: [
809
+ S,
810
+ m ? /* @__PURE__ */ M.jsx(
811
+ "span",
812
+ {
813
+ style: {
814
+ display: "block",
815
+ color: "#78867F",
816
+ lineHeight: "initial"
817
+ },
818
+ children: m
819
+ }
820
+ ) : null
821
+ ] }) : null
822
+ ]
823
+ }
824
+ );
825
+ };
826
+ export {
827
+ me as Radio
828
+ };
@@ -0,0 +1,171 @@
1
+ (function(E,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],O):(E=typeof globalThis<"u"?globalThis:E||self,O(E.Radio={},E.React))})(this,function(E,O){"use strict";var J={exports:{}},D={};/**
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 ar;function jr(){if(ar)return D;ar=1;var R=O,g=Symbol.for("react.element"),C=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,_=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,L={key:!0,ref:!0,__self:!0,__source:!0};function I(w,f,P){var p,y={},x=null,M=null;P!==void 0&&(x=""+P),f.key!==void 0&&(x=""+f.key),f.ref!==void 0&&(M=f.ref);for(p in f)m.call(f,p)&&!L.hasOwnProperty(p)&&(y[p]=f[p]);if(w&&w.defaultProps)for(p in f=w.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:g,type:w,key:x,ref:M,props:y,_owner:_.current}}return D.Fragment=C,D.jsx=I,D.jsxs=I,D}var A={};/**
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 nr;function kr(){return nr||(nr=1,process.env.NODE_ENV!=="production"&&function(){var R=O,g=Symbol.for("react.element"),C=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),ir=Symbol.iterator,Ar="@@iterator";function Ir(r){if(r===null||typeof r!="object")return null;var e=ir&&r[ir]||r[Ar];return typeof e=="function"?e:null}var j=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),n=1;n<e;n++)a[n-1]=arguments[n];Wr("error",r,a)}}function Wr(r,e,a){{var n=j.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(e+="%s",a=a.concat([o]));var s=a.map(function(i){return String(i)});s.unshift("Warning: "+e),Function.prototype.apply.call(console[r],console,s)}}var Yr=!1,$r=!1,zr=!1,Lr=!1,Mr=!1,or;or=Symbol.for("react.module.reference");function Nr(r){return!!(typeof r=="string"||typeof r=="function"||r===m||r===L||Mr||r===_||r===P||r===p||Lr||r===M||Yr||$r||zr||typeof r=="object"&&r!==null&&(r.$$typeof===x||r.$$typeof===y||r.$$typeof===I||r.$$typeof===w||r.$$typeof===f||r.$$typeof===or||r.getModuleId!==void 0))}function Vr(r,e,a){var n=r.displayName;if(n)return n;var o=e.displayName||e.name||"";return o!==""?a+"("+o+")":a}function sr(r){return r.displayName||"Context"}function b(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 C:return"Portal";case L:return"Profiler";case _:return"StrictMode";case P:return"Suspense";case p:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case w:var e=r;return sr(e)+".Consumer";case I:var a=r;return sr(a._context)+".Provider";case f:return Vr(r,r.render,"ForwardRef");case y:var n=r.displayName||null;return n!==null?n:b(r.type)||"Memo";case x:{var o=r,s=o._payload,i=o._init;try{return b(i(s))}catch{return null}}}return null}var T=Object.assign,W=0,ur,lr,cr,fr,dr,vr,pr;function hr(){}hr.__reactDisabledLog=!0;function Ur(){{if(W===0){ur=console.log,lr=console.info,cr=console.warn,fr=console.error,dr=console.group,vr=console.groupCollapsed,pr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:hr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}W++}}function Br(){{if(W--,W===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},r,{value:ur}),info:T({},r,{value:lr}),warn:T({},r,{value:cr}),error:T({},r,{value:fr}),group:T({},r,{value:dr}),groupCollapsed:T({},r,{value:vr}),groupEnd:T({},r,{value:pr})})}W<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=j.ReactCurrentDispatcher,q;function N(r,e,a){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
18
+ `+q+r}}var G=!1,V;{var Jr=typeof WeakMap=="function"?WeakMap:Map;V=new Jr}function gr(r,e){if(!r||G)return"";{var a=V.get(r);if(a!==void 0)return a}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=K.current,K.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){n=v}Reflect.construct(r,[],i)}else{try{i.call()}catch(v){n=v}r.call(i.prototype)}}else{try{throw Error()}catch(v){n=v}r()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var t=v.stack.split(`
19
+ `),d=n.stack.split(`
20
+ `),u=t.length-1,l=d.length-1;u>=1&&l>=0&&t[u]!==d[l];)l--;for(;u>=1&&l>=0;u--,l--)if(t[u]!==d[l]){if(u!==1||l!==1)do if(u--,l--,l<0||t[u]!==d[l]){var h=`
21
+ `+t[u].replace(" at new "," at ");return r.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",r.displayName)),typeof r=="function"&&V.set(r,h),h}while(u>=1&&l>=0);break}}}finally{G=!1,K.current=s,Br(),Error.prepareStackTrace=o}var F=r?r.displayName||r.name:"",S=F?N(F):"";return typeof r=="function"&&V.set(r,S),S}function Kr(r,e,a){return gr(r,!1)}function qr(r){var e=r.prototype;return!!(e&&e.isReactComponent)}function U(r,e,a){if(r==null)return"";if(typeof r=="function")return gr(r,qr(r));if(typeof r=="string")return N(r);switch(r){case P:return N("Suspense");case p:return N("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case f:return Kr(r.render);case y:return U(r.type,e,a);case x:{var n=r,o=n._payload,s=n._init;try{return U(s(o),e,a)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,mr={},br=j.ReactDebugCurrentFrame;function B(r){if(r){var e=r._owner,a=U(r.type,r._source,e?e.type:null);br.setExtraStackFrame(a)}else br.setExtraStackFrame(null)}function Gr(r,e,a,n,o){{var s=Function.call.bind(Y);for(var i in r)if(s(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var d=Error((n||"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}t=r[i](e,i,n,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){t=u}t&&!(t instanceof Error)&&(B(o),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).",n||"React class",a,i,typeof t),B(null)),t instanceof Error&&!(t.message in mr)&&(mr[t.message]=!0,B(o),c("Failed %s type: %s",a,t.message),B(null))}}}var Hr=Array.isArray;function H(r){return Hr(r)}function Xr(r){{var e=typeof Symbol=="function"&&Symbol.toStringTag,a=e&&r[Symbol.toStringTag]||r.constructor.name||"Object";return a}}function Zr(r){try{return yr(r),!1}catch{return!0}}function yr(r){return""+r}function Er(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.",Xr(r)),yr(r)}var $=j.ReactCurrentOwner,Qr={key:!0,ref:!0,__self:!0,__source:!0},Rr,_r,X;X={};function re(r){if(Y.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(Y.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"&&$.current&&e&&$.current.stateNode!==e){var a=b($.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',b($.current.type),r.ref),X[a]=!0)}}function ne(r,e){{var a=function(){Rr||(Rr=!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 te(r,e){{var a=function(){_r||(_r=!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,n,o,s,i){var t={$$typeof:g,type:r,key:e,ref:a,props:i,_owner:s};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function oe(r,e,a,n,o){{var s,i={},t=null,d=null;a!==void 0&&(Er(a),t=""+a),ee(e)&&(Er(e.key),t=""+e.key),re(e)&&(d=e.ref,ae(e,o));for(s in e)Y.call(e,s)&&!Qr.hasOwnProperty(s)&&(i[s]=e[s]);if(r&&r.defaultProps){var u=r.defaultProps;for(s in u)i[s]===void 0&&(i[s]=u[s])}if(t||d){var l=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&ne(i,l),d&&te(i,l)}return ie(r,t,d,o,n,$.current,i)}}var Z=j.ReactCurrentOwner,wr=j.ReactDebugCurrentFrame;function k(r){if(r){var e=r._owner,a=U(r.type,r._source,e?e.type:null);wr.setExtraStackFrame(a)}else wr.setExtraStackFrame(null)}var Q;Q=!1;function rr(r){return typeof r=="object"&&r!==null&&r.$$typeof===g}function xr(){{if(Z.current){var r=b(Z.current.type);if(r)return`
22
+
23
+ Check the render method of \``+r+"`."}return""}}function se(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=xr();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 Sr(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 n="";r&&r._owner&&r._owner!==Z.current&&(n=" It was passed a child from "+b(r._owner.type)+"."),k(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,n),k(null)}}function Or(r,e){{if(typeof r!="object")return;if(H(r))for(var a=0;a<r.length;a++){var n=r[a];rr(n)&&Sr(n,e)}else if(rr(r))r._store&&(r._store.validated=!0);else if(r){var o=Ir(r);if(typeof o=="function"&&o!==r.entries)for(var s=o.call(r),i;!(i=s.next()).done;)rr(i.value)&&Sr(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 n=b(e);Gr(a,r.props,"prop",n,r)}else if(e.PropTypes!==void 0&&!Q){Q=!0;var o=b(e);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"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 n=e[a];if(n!=="children"&&n!=="key"){k(r),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),k(null);break}}r.ref!==null&&(k(r),c("Invalid attribute `ref` supplied to `React.Fragment`."),k(null))}}var Cr={};function Pr(r,e,a,n,o,s){{var i=Nr(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" 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=se(o);d?t+=d:t+=xr();var u;r===null?u="null":H(r)?u="array":r!==void 0&&r.$$typeof===g?(u="<"+(b(r.type)||"Unknown")+" />",t=" 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,t)}var l=oe(r,e,a,o,s);if(l==null)return l;if(i){var h=e.children;if(h!==void 0)if(n)if(H(h)){for(var F=0;F<h.length;F++)Or(h[F],r);Object.freeze&&Object.freeze(h)}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 Or(h,r)}if(Y.call(e,"key")){var S=b(r),v=Object.keys(e).filter(function(ge){return ge!=="key"}),er=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!Cr[S+er]){var he=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} />`,er,S,he,S),Cr[S+er]=!0}}return r===m?ce(l):le(l),l}}function fe(r,e,a){return Pr(r,e,a,!0)}function de(r,e,a){return Pr(r,e,a,!1)}var ve=de,pe=fe;A.Fragment=m,A.jsx=ve,A.jsxs=pe}()),A}process.env.NODE_ENV==="production"?J.exports=jr():J.exports=kr();var z=J.exports;const Fr=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
33
+
34
+ :root {
35
+ /* font weight */
36
+ --starasia-ui-radio-font-weight-normal: var(
37
+ --starasia-ui-fontWeights-normal,
38
+ 300
39
+ );
40
+ --starasia-ui-radio-font-weight-medium: var(
41
+ --starasia-ui-fontWeights-medium,
42
+ 400
43
+ );
44
+
45
+ /* width */
46
+ --starasia-ui-radio-width-sm: 14px;
47
+ --starasia-ui-radio-width-md: var(--starasia-ui-w-4, 16px);
48
+ --starasia-ui-radio-width-lg: 18px;
49
+
50
+ /* height */
51
+ --starasia-ui-radio-height-sm: 14px;
52
+ --starasia-ui-radio-height-md: var(--starasia-ui-h-4, 16px);
53
+ --starasia-ui-radio-height-lg: 18px;
54
+
55
+ /* font size */
56
+ --starasia-ui-radio-font-size-sm: var(--starasia-ui-fontSizes-sm, 12px);
57
+ --starasia-ui-radio-font-size-md: var(--starasia-ui-fontSizes-md, 14px);
58
+ --starasia-ui-radio-font-size-lg: var(--starasia-ui-fontSizes-lg, 16px);
59
+
60
+ /* color */
61
+ --starasia-ui-radio-color-primary-blue: var(
62
+ --starasia-ui-brand-primary-default,
63
+ #1976d2
64
+ );
65
+ }
66
+
67
+ * {
68
+ font-family: "Poppins", serif;
69
+ margin: 0;
70
+ padding: 0;
71
+ }
72
+
73
+ .starasia-radio-container {
74
+ width: max-content;
75
+ display: flex;
76
+ & label {
77
+ font-weight: var(--starasia-ui-radio-font-weight-medium);
78
+ }
79
+ & span {
80
+ font-weight: var(--starasia-ui-radio-font-weight-normal);
81
+ }
82
+ }
83
+
84
+ .starasia-radio-container:has(.starasia-radio-input-sm) {
85
+ gap: 12px;
86
+ font-size: var(--starasia-ui-radio-font-size-sm);
87
+ }
88
+ .starasia-radio-container:has(.starasia-radio-input-md) {
89
+ gap: 12px;
90
+ font-size: var(--starasia-ui-radio-font-size-md);
91
+ }
92
+ .starasia-radio-container:has(.starasia-radio-input-lg) {
93
+ gap: 16px;
94
+ font-size: var(--starasia-ui-radio-font-size-lg);
95
+ }
96
+
97
+ input.starasia-radio-input[type="radio"] {
98
+ appearance: none;
99
+ border: 1px solid black;
100
+ border-radius: 50%;
101
+ outline: none;
102
+ background-color: transparent;
103
+ cursor: pointer;
104
+ position: relative;
105
+ &:checked {
106
+ border-color: var(--starasia-ui-radio-color-primary-blue);
107
+ }
108
+
109
+ &::after {
110
+ display: block;
111
+ position: absolute;
112
+ content: "";
113
+ width: 0px;
114
+ height: 0px;
115
+ top: 50%;
116
+ left: 50%;
117
+ transform: translate(-50%, -50%);
118
+ border-radius: 50%;
119
+ transition: 0.3s;
120
+ background-color: var(--starasia-ui-radio-color-primary-blue);
121
+ }
122
+
123
+ &:disabled {
124
+ border-color: #aeb6b2;
125
+ cursor: not-allowed;
126
+ }
127
+
128
+ &:checked:disabled {
129
+ border-color: #aeb6b2;
130
+ cursor: not-allowed;
131
+ }
132
+
133
+ &:checked:disabled::after {
134
+ background-color: #aeb6b2;
135
+ }
136
+
137
+ &:hover:not(:disabled) {
138
+ box-shadow: 0px 0px 0px 4px rgba(201, 206, 204, 0.2);
139
+ }
140
+ }
141
+
142
+ input.starasia-radio-input-sm[type="radio"] {
143
+ width: var(--starasia-ui-radio-width-sm);
144
+ height: var(--starasia-ui-radio-height-sm);
145
+
146
+ &:checked::after {
147
+ width: calc(var(--starasia-ui-radio-width-sm) - 5px);
148
+ height: calc(var(--starasia-ui-radio-height-sm) - 5px);
149
+ }
150
+ }
151
+
152
+ input.starasia-radio-input-md[type="radio"] {
153
+ width: var(--starasia-ui-radio-width-md);
154
+ height: var(--starasia-ui-radio-height-md);
155
+
156
+ &:checked::after {
157
+ width: calc(var(--starasia-ui-radio-width-md) - 6px);
158
+ height: calc(var(--starasia-ui-radio-height-md) - 6px);
159
+ }
160
+ }
161
+
162
+ input.starasia-radio-input-lg[type="radio"] {
163
+ width: var(--starasia-ui-radio-width-lg);
164
+ height: var(--starasia-ui-radio-height-lg);
165
+
166
+ &:checked::after {
167
+ width: calc(var(--starasia-ui-radio-width-lg) - 7px);
168
+ height: calc(var(--starasia-ui-radio-height-lg) - 7px);
169
+ }
170
+ }
171
+ `,tr="starasia-radio-styles";(R=>{if(!document.getElementById(tr)){const g=document.createElement("style");g.id=tr,g.textContent=R,document.head.appendChild(g)}})(Fr);const Dr=R=>{const{size:g="md",label:C,description:m,..._}=R;return z.jsxs("div",{className:"starasia-radio-container",style:{alignItems:m?"start":"center"},children:[z.jsx("input",{type:"radio",className:`starasia-radio-input starasia-radio-input-${g}`,..._}),C||m?z.jsxs("label",{htmlFor:_.id,style:{lineHeight:1.07},children:[C,m?z.jsx("span",{style:{display:"block",color:"#78867F",lineHeight:"initial"},children:m}):null]}):null]})};E.Radio=Dr,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,5 @@
1
+ export interface RadioProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "size"> {
2
+ size?: "sm" | "md" | "lg";
3
+ label?: string;
4
+ description?: string;
5
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@starasia/radio",
3
+ "version": "1.0.0",
4
+ "description": "radio component for starasia UI",
5
+ "author": "Prawito Hudoro",
6
+ "main": "dist/radio.umd.js",
7
+ "module": "dist/radio.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
+ }