@starasia/checkbox 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 +55 -0
- package/dist/Checkbox.d.ts +3 -0
- package/dist/checkbox.es.js +867 -0
- package/dist/checkbox.umd.js +205 -0
- package/dist/index.d.ts +2 -0
- package/dist/types.d.ts +7 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# starasia checkbox
|
|
2
|
+
|
|
3
|
+
starasia checkbox is a strict and customizable checkbox component for web development projects, designed for simplicity and adherence to strict design guidelines.
|
|
4
|
+
|
|
5
|
+
## Screenshots
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Package instalation
|
|
10
|
+
|
|
11
|
+
Instal package using pnpm
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @starasia/checkbox
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Instal package using yarn
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn add @starasia/checkbox
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Instal package using npm
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm i @starasia/checkbox
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage/Examples (you can combine using icon package starasia)
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import React from "react";
|
|
33
|
+
import {Checkbox} from "@starasia/checkbox";
|
|
34
|
+
import ReactDOM from "react-dom/client";
|
|
35
|
+
|
|
36
|
+
const App = () => (
|
|
37
|
+
<div>
|
|
38
|
+
<h1>Component test</h1>
|
|
39
|
+
<Checkbox label="starasia Checkbox" />
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
ReactDOM.createRoot(document.getElementById("app")!).render(<App />);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Props @starasia/checkbox
|
|
49
|
+
|
|
50
|
+
#### Props that you can pass to <Checkbox {...props} />
|
|
51
|
+
|
|
52
|
+
| Prop Name | Value | required |
|
|
53
|
+
| :-------- | :----------------- | :------- |
|
|
54
|
+
| sizes | "sm" / "md" / "lg" | false |
|
|
55
|
+
| label | string | false |
|
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
import Ce from "react";
|
|
2
|
+
var Q = { 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 we;
|
|
13
|
+
function dr() {
|
|
14
|
+
if (we)
|
|
15
|
+
return W;
|
|
16
|
+
we = 1;
|
|
17
|
+
var E = Ce, v = Symbol.for("react.element"), R = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, _ = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function w(y, f, O) {
|
|
19
|
+
var b, k = {}, T = null, L = null;
|
|
20
|
+
O !== void 0 && (T = "" + O), f.key !== void 0 && (T = "" + f.key), f.ref !== void 0 && (L = f.ref);
|
|
21
|
+
for (b in f)
|
|
22
|
+
g.call(f, b) && !m.hasOwnProperty(b) && (k[b] = f[b]);
|
|
23
|
+
if (y && y.defaultProps)
|
|
24
|
+
for (b in f = y.defaultProps, f)
|
|
25
|
+
k[b] === void 0 && (k[b] = f[b]);
|
|
26
|
+
return { $$typeof: v, type: y, key: T, ref: L, props: k, _owner: _.current };
|
|
27
|
+
}
|
|
28
|
+
return W.Fragment = R, W.jsx = w, W.jsxs = w, W;
|
|
29
|
+
}
|
|
30
|
+
var $ = {};
|
|
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 Te;
|
|
41
|
+
function hr() {
|
|
42
|
+
return Te || (Te = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var E = Ce, v = Symbol.for("react.element"), R = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), ee = Symbol.iterator, Oe = "@@iterator";
|
|
44
|
+
function Pe(e) {
|
|
45
|
+
if (e === null || typeof e != "object")
|
|
46
|
+
return null;
|
|
47
|
+
var r = ee && e[ee] || e[Oe];
|
|
48
|
+
return typeof r == "function" ? r : null;
|
|
49
|
+
}
|
|
50
|
+
var P = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function l(e) {
|
|
52
|
+
{
|
|
53
|
+
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
|
+
a[n - 1] = arguments[n];
|
|
55
|
+
je("error", e, a);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function je(e, r, a) {
|
|
59
|
+
{
|
|
60
|
+
var n = P.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
61
|
+
i !== "" && (r += "%s", a = a.concat([i]));
|
|
62
|
+
var s = a.map(function(o) {
|
|
63
|
+
return String(o);
|
|
64
|
+
});
|
|
65
|
+
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var Fe = !1, De = !1, Ae = !1, Ie = !1, We = !1, re;
|
|
69
|
+
re = Symbol.for("react.module.reference");
|
|
70
|
+
function $e(e) {
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === g || e === m || We || e === _ || e === O || e === b || Ie || e === L || Fe || De || Ae || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === k || e.$$typeof === w || e.$$typeof === y || e.$$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
|
+
e.$$typeof === re || e.getModuleId !== void 0));
|
|
76
|
+
}
|
|
77
|
+
function Ye(e, r, a) {
|
|
78
|
+
var n = e.displayName;
|
|
79
|
+
if (n)
|
|
80
|
+
return n;
|
|
81
|
+
var i = r.displayName || r.name || "";
|
|
82
|
+
return i !== "" ? a + "(" + i + ")" : a;
|
|
83
|
+
}
|
|
84
|
+
function ae(e) {
|
|
85
|
+
return e.displayName || "Context";
|
|
86
|
+
}
|
|
87
|
+
function x(e) {
|
|
88
|
+
if (e == null)
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof e.tag == "number" && l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
+
return e.displayName || e.name || null;
|
|
92
|
+
if (typeof e == "string")
|
|
93
|
+
return e;
|
|
94
|
+
switch (e) {
|
|
95
|
+
case g:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case R:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case m:
|
|
100
|
+
return "Profiler";
|
|
101
|
+
case _:
|
|
102
|
+
return "StrictMode";
|
|
103
|
+
case O:
|
|
104
|
+
return "Suspense";
|
|
105
|
+
case b:
|
|
106
|
+
return "SuspenseList";
|
|
107
|
+
}
|
|
108
|
+
if (typeof e == "object")
|
|
109
|
+
switch (e.$$typeof) {
|
|
110
|
+
case y:
|
|
111
|
+
var r = e;
|
|
112
|
+
return ae(r) + ".Consumer";
|
|
113
|
+
case w:
|
|
114
|
+
var a = e;
|
|
115
|
+
return ae(a._context) + ".Provider";
|
|
116
|
+
case f:
|
|
117
|
+
return Ye(e, e.render, "ForwardRef");
|
|
118
|
+
case k:
|
|
119
|
+
var n = e.displayName || null;
|
|
120
|
+
return n !== null ? n : x(e.type) || "Memo";
|
|
121
|
+
case T: {
|
|
122
|
+
var i = e, s = i._payload, o = i._init;
|
|
123
|
+
try {
|
|
124
|
+
return x(o(s));
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var S = Object.assign, D = 0, ne, te, oe, ie, se, ce, ue;
|
|
133
|
+
function le() {
|
|
134
|
+
}
|
|
135
|
+
le.__reactDisabledLog = !0;
|
|
136
|
+
function Le() {
|
|
137
|
+
{
|
|
138
|
+
if (D === 0) {
|
|
139
|
+
ne = console.log, te = console.info, oe = console.warn, ie = console.error, se = console.group, ce = console.groupCollapsed, ue = console.groupEnd;
|
|
140
|
+
var e = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
value: le,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
info: e,
|
|
148
|
+
log: e,
|
|
149
|
+
warn: e,
|
|
150
|
+
error: e,
|
|
151
|
+
group: e,
|
|
152
|
+
groupCollapsed: e,
|
|
153
|
+
groupEnd: e
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
D++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Ne() {
|
|
160
|
+
{
|
|
161
|
+
if (D--, D === 0) {
|
|
162
|
+
var e = {
|
|
163
|
+
configurable: !0,
|
|
164
|
+
enumerable: !0,
|
|
165
|
+
writable: !0
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperties(console, {
|
|
168
|
+
log: S({}, e, {
|
|
169
|
+
value: ne
|
|
170
|
+
}),
|
|
171
|
+
info: S({}, e, {
|
|
172
|
+
value: te
|
|
173
|
+
}),
|
|
174
|
+
warn: S({}, e, {
|
|
175
|
+
value: oe
|
|
176
|
+
}),
|
|
177
|
+
error: S({}, e, {
|
|
178
|
+
value: ie
|
|
179
|
+
}),
|
|
180
|
+
group: S({}, e, {
|
|
181
|
+
value: se
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: S({}, e, {
|
|
184
|
+
value: ce
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: S({}, e, {
|
|
187
|
+
value: ue
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
D < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var z = P.ReactCurrentDispatcher, B;
|
|
195
|
+
function N(e, r, a) {
|
|
196
|
+
{
|
|
197
|
+
if (B === void 0)
|
|
198
|
+
try {
|
|
199
|
+
throw Error();
|
|
200
|
+
} catch (i) {
|
|
201
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
B = n && n[1] || "";
|
|
203
|
+
}
|
|
204
|
+
return `
|
|
205
|
+
` + B + e;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var J = !1, V;
|
|
209
|
+
{
|
|
210
|
+
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
V = new Ve();
|
|
212
|
+
}
|
|
213
|
+
function fe(e, r) {
|
|
214
|
+
if (!e || J)
|
|
215
|
+
return "";
|
|
216
|
+
{
|
|
217
|
+
var a = V.get(e);
|
|
218
|
+
if (a !== void 0)
|
|
219
|
+
return a;
|
|
220
|
+
}
|
|
221
|
+
var n;
|
|
222
|
+
J = !0;
|
|
223
|
+
var i = Error.prepareStackTrace;
|
|
224
|
+
Error.prepareStackTrace = void 0;
|
|
225
|
+
var s;
|
|
226
|
+
s = z.current, z.current = null, Le();
|
|
227
|
+
try {
|
|
228
|
+
if (r) {
|
|
229
|
+
var o = function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
};
|
|
232
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
233
|
+
set: function() {
|
|
234
|
+
throw Error();
|
|
235
|
+
}
|
|
236
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
+
try {
|
|
238
|
+
Reflect.construct(o, []);
|
|
239
|
+
} catch (h) {
|
|
240
|
+
n = h;
|
|
241
|
+
}
|
|
242
|
+
Reflect.construct(e, [], o);
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
o.call();
|
|
246
|
+
} catch (h) {
|
|
247
|
+
n = h;
|
|
248
|
+
}
|
|
249
|
+
e.call(o.prototype);
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
try {
|
|
253
|
+
throw Error();
|
|
254
|
+
} catch (h) {
|
|
255
|
+
n = h;
|
|
256
|
+
}
|
|
257
|
+
e();
|
|
258
|
+
}
|
|
259
|
+
} catch (h) {
|
|
260
|
+
if (h && n && typeof h.stack == "string") {
|
|
261
|
+
for (var t = h.stack.split(`
|
|
262
|
+
`), d = n.stack.split(`
|
|
263
|
+
`), c = t.length - 1, u = d.length - 1; c >= 1 && u >= 0 && t[c] !== d[u]; )
|
|
264
|
+
u--;
|
|
265
|
+
for (; c >= 1 && u >= 0; c--, u--)
|
|
266
|
+
if (t[c] !== d[u]) {
|
|
267
|
+
if (c !== 1 || u !== 1)
|
|
268
|
+
do
|
|
269
|
+
if (c--, u--, u < 0 || t[c] !== d[u]) {
|
|
270
|
+
var p = `
|
|
271
|
+
` + t[c].replace(" at new ", " at ");
|
|
272
|
+
return e.displayName && p.includes("<anonymous>") && (p = p.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, p), p;
|
|
273
|
+
}
|
|
274
|
+
while (c >= 1 && u >= 0);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
J = !1, z.current = s, Ne(), Error.prepareStackTrace = i;
|
|
280
|
+
}
|
|
281
|
+
var F = e ? e.displayName || e.name : "", C = F ? N(F) : "";
|
|
282
|
+
return typeof e == "function" && V.set(e, C), C;
|
|
283
|
+
}
|
|
284
|
+
function Me(e, r, a) {
|
|
285
|
+
return fe(e, !1);
|
|
286
|
+
}
|
|
287
|
+
function Ue(e) {
|
|
288
|
+
var r = e.prototype;
|
|
289
|
+
return !!(r && r.isReactComponent);
|
|
290
|
+
}
|
|
291
|
+
function M(e, r, a) {
|
|
292
|
+
if (e == null)
|
|
293
|
+
return "";
|
|
294
|
+
if (typeof e == "function")
|
|
295
|
+
return fe(e, Ue(e));
|
|
296
|
+
if (typeof e == "string")
|
|
297
|
+
return N(e);
|
|
298
|
+
switch (e) {
|
|
299
|
+
case O:
|
|
300
|
+
return N("Suspense");
|
|
301
|
+
case b:
|
|
302
|
+
return N("SuspenseList");
|
|
303
|
+
}
|
|
304
|
+
if (typeof e == "object")
|
|
305
|
+
switch (e.$$typeof) {
|
|
306
|
+
case f:
|
|
307
|
+
return Me(e.render);
|
|
308
|
+
case k:
|
|
309
|
+
return M(e.type, r, a);
|
|
310
|
+
case T: {
|
|
311
|
+
var n = e, i = n._payload, s = n._init;
|
|
312
|
+
try {
|
|
313
|
+
return M(s(i), r, a);
|
|
314
|
+
} catch {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
var A = Object.prototype.hasOwnProperty, de = {}, he = P.ReactDebugCurrentFrame;
|
|
321
|
+
function U(e) {
|
|
322
|
+
if (e) {
|
|
323
|
+
var r = e._owner, a = M(e.type, e._source, r ? r.type : null);
|
|
324
|
+
he.setExtraStackFrame(a);
|
|
325
|
+
} else
|
|
326
|
+
he.setExtraStackFrame(null);
|
|
327
|
+
}
|
|
328
|
+
function ze(e, r, a, n, i) {
|
|
329
|
+
{
|
|
330
|
+
var s = Function.call.bind(A);
|
|
331
|
+
for (var o in e)
|
|
332
|
+
if (s(e, o)) {
|
|
333
|
+
var t = void 0;
|
|
334
|
+
try {
|
|
335
|
+
if (typeof e[o] != "function") {
|
|
336
|
+
var d = Error((n || "React class") + ": " + a + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
+
throw d.name = "Invariant Violation", d;
|
|
338
|
+
}
|
|
339
|
+
t = e[o](r, o, n, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (c) {
|
|
341
|
+
t = c;
|
|
342
|
+
}
|
|
343
|
+
t && !(t instanceof Error) && (U(i), l("%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, o, typeof t), U(null)), t instanceof Error && !(t.message in de) && (de[t.message] = !0, U(i), l("Failed %s type: %s", a, t.message), U(null));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var Be = Array.isArray;
|
|
348
|
+
function q(e) {
|
|
349
|
+
return Be(e);
|
|
350
|
+
}
|
|
351
|
+
function Je(e) {
|
|
352
|
+
{
|
|
353
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, a = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
+
return a;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function qe(e) {
|
|
358
|
+
try {
|
|
359
|
+
return be(e), !1;
|
|
360
|
+
} catch {
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function be(e) {
|
|
365
|
+
return "" + e;
|
|
366
|
+
}
|
|
367
|
+
function pe(e) {
|
|
368
|
+
if (qe(e))
|
|
369
|
+
return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), be(e);
|
|
370
|
+
}
|
|
371
|
+
var I = P.ReactCurrentOwner, Ke = {
|
|
372
|
+
key: !0,
|
|
373
|
+
ref: !0,
|
|
374
|
+
__self: !0,
|
|
375
|
+
__source: !0
|
|
376
|
+
}, ve, xe, K;
|
|
377
|
+
K = {};
|
|
378
|
+
function Ge(e) {
|
|
379
|
+
if (A.call(e, "ref")) {
|
|
380
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
|
+
if (r && r.isReactWarning)
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
return e.ref !== void 0;
|
|
385
|
+
}
|
|
386
|
+
function Xe(e) {
|
|
387
|
+
if (A.call(e, "key")) {
|
|
388
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
|
+
if (r && r.isReactWarning)
|
|
390
|
+
return !1;
|
|
391
|
+
}
|
|
392
|
+
return e.key !== void 0;
|
|
393
|
+
}
|
|
394
|
+
function He(e, r) {
|
|
395
|
+
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
|
396
|
+
var a = x(I.current.type);
|
|
397
|
+
K[a] || (l('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), e.ref), K[a] = !0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function Ze(e, r) {
|
|
401
|
+
{
|
|
402
|
+
var a = function() {
|
|
403
|
+
ve || (ve = !0, l("%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)", r));
|
|
404
|
+
};
|
|
405
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
+
get: a,
|
|
407
|
+
configurable: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function Qe(e, r) {
|
|
412
|
+
{
|
|
413
|
+
var a = function() {
|
|
414
|
+
xe || (xe = !0, l("%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)", r));
|
|
415
|
+
};
|
|
416
|
+
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
+
get: a,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var er = function(e, r, a, n, i, s, o) {
|
|
423
|
+
var t = {
|
|
424
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
+
$$typeof: v,
|
|
426
|
+
// Built-in properties that belong on the element
|
|
427
|
+
type: e,
|
|
428
|
+
key: r,
|
|
429
|
+
ref: a,
|
|
430
|
+
props: o,
|
|
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: i
|
|
449
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
450
|
+
};
|
|
451
|
+
function rr(e, r, a, n, i) {
|
|
452
|
+
{
|
|
453
|
+
var s, o = {}, t = null, d = null;
|
|
454
|
+
a !== void 0 && (pe(a), t = "" + a), Xe(r) && (pe(r.key), t = "" + r.key), Ge(r) && (d = r.ref, He(r, i));
|
|
455
|
+
for (s in r)
|
|
456
|
+
A.call(r, s) && !Ke.hasOwnProperty(s) && (o[s] = r[s]);
|
|
457
|
+
if (e && e.defaultProps) {
|
|
458
|
+
var c = e.defaultProps;
|
|
459
|
+
for (s in c)
|
|
460
|
+
o[s] === void 0 && (o[s] = c[s]);
|
|
461
|
+
}
|
|
462
|
+
if (t || d) {
|
|
463
|
+
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
+
t && Ze(o, u), d && Qe(o, u);
|
|
465
|
+
}
|
|
466
|
+
return er(e, t, d, i, n, I.current, o);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
var G = P.ReactCurrentOwner, ge = P.ReactDebugCurrentFrame;
|
|
470
|
+
function j(e) {
|
|
471
|
+
if (e) {
|
|
472
|
+
var r = e._owner, a = M(e.type, e._source, r ? r.type : null);
|
|
473
|
+
ge.setExtraStackFrame(a);
|
|
474
|
+
} else
|
|
475
|
+
ge.setExtraStackFrame(null);
|
|
476
|
+
}
|
|
477
|
+
var X;
|
|
478
|
+
X = !1;
|
|
479
|
+
function H(e) {
|
|
480
|
+
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
481
|
+
}
|
|
482
|
+
function me() {
|
|
483
|
+
{
|
|
484
|
+
if (G.current) {
|
|
485
|
+
var e = x(G.current.type);
|
|
486
|
+
if (e)
|
|
487
|
+
return `
|
|
488
|
+
|
|
489
|
+
Check the render method of \`` + e + "`.";
|
|
490
|
+
}
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function ar(e) {
|
|
495
|
+
{
|
|
496
|
+
if (e !== void 0) {
|
|
497
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), a = e.lineNumber;
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check your code at ` + r + ":" + a + ".";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
var ye = {};
|
|
506
|
+
function nr(e) {
|
|
507
|
+
{
|
|
508
|
+
var r = me();
|
|
509
|
+
if (!r) {
|
|
510
|
+
var a = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
+
a && (r = `
|
|
512
|
+
|
|
513
|
+
Check the top-level render call using <` + a + ">.");
|
|
514
|
+
}
|
|
515
|
+
return r;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function ke(e, r) {
|
|
519
|
+
{
|
|
520
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
521
|
+
return;
|
|
522
|
+
e._store.validated = !0;
|
|
523
|
+
var a = nr(r);
|
|
524
|
+
if (ye[a])
|
|
525
|
+
return;
|
|
526
|
+
ye[a] = !0;
|
|
527
|
+
var n = "";
|
|
528
|
+
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + x(e._owner.type) + "."), j(e), l('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), j(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function Ee(e, r) {
|
|
532
|
+
{
|
|
533
|
+
if (typeof e != "object")
|
|
534
|
+
return;
|
|
535
|
+
if (q(e))
|
|
536
|
+
for (var a = 0; a < e.length; a++) {
|
|
537
|
+
var n = e[a];
|
|
538
|
+
H(n) && ke(n, r);
|
|
539
|
+
}
|
|
540
|
+
else if (H(e))
|
|
541
|
+
e._store && (e._store.validated = !0);
|
|
542
|
+
else if (e) {
|
|
543
|
+
var i = Pe(e);
|
|
544
|
+
if (typeof i == "function" && i !== e.entries)
|
|
545
|
+
for (var s = i.call(e), o; !(o = s.next()).done; )
|
|
546
|
+
H(o.value) && ke(o.value, r);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function tr(e) {
|
|
551
|
+
{
|
|
552
|
+
var r = e.type;
|
|
553
|
+
if (r == null || typeof r == "string")
|
|
554
|
+
return;
|
|
555
|
+
var a;
|
|
556
|
+
if (typeof r == "function")
|
|
557
|
+
a = r.propTypes;
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
|
+
// Inner props are checked in the reconciler.
|
|
560
|
+
r.$$typeof === k))
|
|
561
|
+
a = r.propTypes;
|
|
562
|
+
else
|
|
563
|
+
return;
|
|
564
|
+
if (a) {
|
|
565
|
+
var n = x(r);
|
|
566
|
+
ze(a, e.props, "prop", n, e);
|
|
567
|
+
} else if (r.PropTypes !== void 0 && !X) {
|
|
568
|
+
X = !0;
|
|
569
|
+
var i = x(r);
|
|
570
|
+
l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
571
|
+
}
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function or(e) {
|
|
576
|
+
{
|
|
577
|
+
for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
|
|
578
|
+
var n = r[a];
|
|
579
|
+
if (n !== "children" && n !== "key") {
|
|
580
|
+
j(e), l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), j(null);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
e.ref !== null && (j(e), l("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
var Re = {};
|
|
588
|
+
function _e(e, r, a, n, i, s) {
|
|
589
|
+
{
|
|
590
|
+
var o = $e(e);
|
|
591
|
+
if (!o) {
|
|
592
|
+
var t = "";
|
|
593
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).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 = ar(i);
|
|
595
|
+
d ? t += d : t += me();
|
|
596
|
+
var c;
|
|
597
|
+
e === null ? c = "null" : q(e) ? c = "array" : e !== void 0 && e.$$typeof === v ? (c = "<" + (x(e.type) || "Unknown") + " />", t = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, t);
|
|
598
|
+
}
|
|
599
|
+
var u = rr(e, r, a, i, s);
|
|
600
|
+
if (u == null)
|
|
601
|
+
return u;
|
|
602
|
+
if (o) {
|
|
603
|
+
var p = r.children;
|
|
604
|
+
if (p !== void 0)
|
|
605
|
+
if (n)
|
|
606
|
+
if (q(p)) {
|
|
607
|
+
for (var F = 0; F < p.length; F++)
|
|
608
|
+
Ee(p[F], e);
|
|
609
|
+
Object.freeze && Object.freeze(p);
|
|
610
|
+
} else
|
|
611
|
+
l("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
|
+
Ee(p, e);
|
|
614
|
+
}
|
|
615
|
+
if (A.call(r, "key")) {
|
|
616
|
+
var C = x(e), h = Object.keys(r).filter(function(fr) {
|
|
617
|
+
return fr !== "key";
|
|
618
|
+
}), Z = h.length > 0 ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!Re[C + Z]) {
|
|
620
|
+
var lr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
+
l(`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, C, lr, C), Re[C + Z] = !0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return e === g ? or(u) : tr(u), u;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function ir(e, r, a) {
|
|
633
|
+
return _e(e, r, a, !0);
|
|
634
|
+
}
|
|
635
|
+
function sr(e, r, a) {
|
|
636
|
+
return _e(e, r, a, !1);
|
|
637
|
+
}
|
|
638
|
+
var cr = sr, ur = ir;
|
|
639
|
+
$.Fragment = g, $.jsx = cr, $.jsxs = ur;
|
|
640
|
+
}()), $;
|
|
641
|
+
}
|
|
642
|
+
process.env.NODE_ENV === "production" ? Q.exports = dr() : Q.exports = hr();
|
|
643
|
+
var Y = Q.exports;
|
|
644
|
+
const br = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
|
+
|
|
646
|
+
:root {
|
|
647
|
+
/* color */
|
|
648
|
+
--starasia-ui-checkbox-color-primary-black: var(
|
|
649
|
+
--starasia-ui-color-gray-700,
|
|
650
|
+
#374151
|
|
651
|
+
);
|
|
652
|
+
--starasia-ui-checkbox-color-secondary-black: var(
|
|
653
|
+
--starasia-ui-color-gray-50,
|
|
654
|
+
#f9fafb
|
|
655
|
+
);
|
|
656
|
+
--starasia-ui-checkbox-color-primary-blue: var(
|
|
657
|
+
--starasia-ui-brand-primary-default,
|
|
658
|
+
#1976d2
|
|
659
|
+
);
|
|
660
|
+
|
|
661
|
+
/* border radius */
|
|
662
|
+
--starasia-ui-checkbox-border-radius: var(--starasia-ui-radii-sm, 2px);
|
|
663
|
+
|
|
664
|
+
/* height */
|
|
665
|
+
--starasia-ui-checkbox-height-sm: 14px;
|
|
666
|
+
--starasia-ui-checkbox-height-md: 16px;
|
|
667
|
+
--starasia-ui-checkbox-height-lg: 18px;
|
|
668
|
+
|
|
669
|
+
/* width */
|
|
670
|
+
--starasia-ui-checkbox-width-sm: 14px;
|
|
671
|
+
--starasia-ui-checkbox-width-md: 16px;
|
|
672
|
+
--starasia-ui-checkbox-width-lg: 18px;
|
|
673
|
+
|
|
674
|
+
/* box shadow */
|
|
675
|
+
---starasia-ui-checkbox-box-shadow: var(
|
|
676
|
+
var(--starasia-ui-shadow-md),
|
|
677
|
+
0 4px 6px -1px rgb(0 0 0 / 0.1),
|
|
678
|
+
0 2px 4px -2px rgb(0 0 0 / 0.1)
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
* {
|
|
683
|
+
font-family: "Poppins", serif;
|
|
684
|
+
margin: 0;
|
|
685
|
+
padding: 0;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.starasia-checkbox-container {
|
|
689
|
+
display: flex;
|
|
690
|
+
width: max-content;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.starasia-checkbox-container.sm {
|
|
694
|
+
font-size: var(--starasia-ui-fontSizes-sm, 12px);
|
|
695
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
696
|
+
gap: 12px;
|
|
697
|
+
}
|
|
698
|
+
.starasia-checkbox-container.md {
|
|
699
|
+
font-size: var(--starasia-ui-fontSizes-md, 14px);
|
|
700
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
701
|
+
gap: 12px;
|
|
702
|
+
}
|
|
703
|
+
.starasia-checkbox-container.lg {
|
|
704
|
+
font-size: var(--starasia-ui-fontSizes-lg, 16px);
|
|
705
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
706
|
+
gap: 16px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.starasia-checkbox-description {
|
|
710
|
+
font-weight: var(--starasia-ui-fontWeights-normal, 300);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.starasia-checkbox[type="checkbox"] {
|
|
714
|
+
-webkit-appearance: none;
|
|
715
|
+
appearance: none;
|
|
716
|
+
background-color: transparent;
|
|
717
|
+
/* font: inherit; */
|
|
718
|
+
/* color: currentColor; */
|
|
719
|
+
/* border: var(--starasia-ui-border, 1px) solid
|
|
720
|
+
var(--starasia-ui-checkbox-color-primary-black);
|
|
721
|
+
border-radius: var(--starasia-ui-checkbox-border-radius); */
|
|
722
|
+
display: grid;
|
|
723
|
+
place-content: center;
|
|
724
|
+
position: initial !important;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.starasia-checkbox[type="checkbox"].sm {
|
|
728
|
+
width: var(--starasia-ui-checkbox-width-sm);
|
|
729
|
+
height: var(--starasia-ui-checkbox-height-sm);
|
|
730
|
+
border-radius: 2px;
|
|
731
|
+
border: 1px solid #181a19;
|
|
732
|
+
}
|
|
733
|
+
.starasia-checkbox[type="checkbox"].md {
|
|
734
|
+
width: var(--starasia-ui-checkbox-width-md);
|
|
735
|
+
height: var(--starasia-ui-checkbox-height-md);
|
|
736
|
+
border-radius: 3px;
|
|
737
|
+
border: 1px solid #181a19;
|
|
738
|
+
}
|
|
739
|
+
.starasia-checkbox[type="checkbox"].lg {
|
|
740
|
+
width: var(--starasia-ui-checkbox-width-lg);
|
|
741
|
+
height: var(--starasia-ui-checkbox-height-lg);
|
|
742
|
+
border-radius: 3px;
|
|
743
|
+
border: 1px solid #181a19;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.starasia-checkbox[type="checkbox"]:checked {
|
|
747
|
+
background-color: var(--starasia-ui-checkbox-color-primary-blue);
|
|
748
|
+
border-color: var(--starasia-ui-checkbox-color-primary-blue);
|
|
749
|
+
}
|
|
750
|
+
.starasia-checkbox[type="checkbox"] {
|
|
751
|
+
border-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
752
|
+
cursor: pointer;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.starasia-checkbox[type="checkbox"].sm::before {
|
|
756
|
+
width: 8px;
|
|
757
|
+
height: 8px;
|
|
758
|
+
/* width: calc(var(--starasia-ui-checkbox-width-sm) / 2); */
|
|
759
|
+
/* height: calc(var(--starasia-ui-checkbox-height-sm) / 2); */
|
|
760
|
+
}
|
|
761
|
+
.starasia-checkbox[type="checkbox"].md::before {
|
|
762
|
+
width: 8px;
|
|
763
|
+
height: 8px;
|
|
764
|
+
/* width: calc(var(--starasia-ui-checkbox-width-md) / 2); */
|
|
765
|
+
/* height: calc(var(--starasia-ui-checkbox-height-md) / 2); */
|
|
766
|
+
}
|
|
767
|
+
.starasia-checkbox[type="checkbox"].lg::before {
|
|
768
|
+
width: 10px;
|
|
769
|
+
height: 10px;
|
|
770
|
+
/* width: calc(var(--starasia-ui-checkbox-width-lg) / 1.5); */
|
|
771
|
+
/* height: calc(var(--starasia-ui-checkbox-height-lg) / 2); */
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.starasia-checkbox[type="checkbox"]::before {
|
|
775
|
+
content: "";
|
|
776
|
+
transform: scale(0);
|
|
777
|
+
transition: 120ms transform ease-in-out;
|
|
778
|
+
background-color: var(--starasia-ui-checkbox-color-secondary-black);
|
|
779
|
+
}
|
|
780
|
+
.starasia-checkbox[type="checkbox"].starasia-checkbox-select::before {
|
|
781
|
+
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
|
|
782
|
+
transform-origin: bottom left;
|
|
783
|
+
}
|
|
784
|
+
.starasia-checkbox[type="checkbox"].starasia-checkbox-indeterminate::before {
|
|
785
|
+
clip-path: polygon(0% 40%, 100% 40%, 100% 60%, 0% 60%);
|
|
786
|
+
transform-origin: left left;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.starasia-checkbox[type="checkbox"]:checked::before {
|
|
790
|
+
transform: scale(1);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.starasia-checkbox[type="checkbox"]:hover:not(:disabled) {
|
|
794
|
+
/* border-color: var(--starasia-ui-checkbox-color-primary-blue); */
|
|
795
|
+
box-shadow: 0px 0px 1px 5px rgba(201, 206, 204, 0.2);
|
|
796
|
+
}
|
|
797
|
+
.starasia-checkbox[type="checkbox"]:checked:hover:not(:disabled) {
|
|
798
|
+
/* border-color: var(--starasia-ui-checkbox-color-primary-blue); */
|
|
799
|
+
box-shadow: 0px 0px 1px 5px rgba(25, 118, 210, 0.1);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.starasia-checkbox[type="checkbox"]:disabled {
|
|
803
|
+
--form-control-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
804
|
+
color: var(--starasia-ui-checkbox-color-primary-black);
|
|
805
|
+
border-color: #aeb6b2;
|
|
806
|
+
cursor: not-allowed;
|
|
807
|
+
box-shadow: none;
|
|
808
|
+
}
|
|
809
|
+
.starasia-checkbox[type="checkbox"]:checked:disabled {
|
|
810
|
+
--form-control-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
811
|
+
color: var(--starasia-ui-checkbox-color-primary-black);
|
|
812
|
+
border-color: #aeb6b2;
|
|
813
|
+
cursor: not-allowed;
|
|
814
|
+
box-shadow: none;
|
|
815
|
+
background-color: #aeb6b2;
|
|
816
|
+
}
|
|
817
|
+
`, Se = "starasia-checkbox-styles", pr = (E) => {
|
|
818
|
+
if (!document.getElementById(Se)) {
|
|
819
|
+
const v = document.createElement("style");
|
|
820
|
+
v.id = Se, v.textContent = E, document.head.appendChild(v);
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
pr(br);
|
|
824
|
+
const xr = (E) => {
|
|
825
|
+
const {
|
|
826
|
+
color: v = "blue",
|
|
827
|
+
label: R,
|
|
828
|
+
sizes: g = "md",
|
|
829
|
+
id: _,
|
|
830
|
+
description: m,
|
|
831
|
+
variant: w = "select",
|
|
832
|
+
...y
|
|
833
|
+
} = E;
|
|
834
|
+
return /* @__PURE__ */ Y.jsxs(
|
|
835
|
+
"label",
|
|
836
|
+
{
|
|
837
|
+
htmlFor: _,
|
|
838
|
+
className: `starasia-checkbox-container ${g}`,
|
|
839
|
+
style: { alignItems: m ? "start" : "center" },
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ Y.jsx(
|
|
842
|
+
"input",
|
|
843
|
+
{
|
|
844
|
+
id: _,
|
|
845
|
+
type: "checkbox",
|
|
846
|
+
className: `starasia-checkbox ${g} starasia-checkbox-${w}`,
|
|
847
|
+
...y
|
|
848
|
+
}
|
|
849
|
+
),
|
|
850
|
+
R || m ? /* @__PURE__ */ Y.jsxs("div", { children: [
|
|
851
|
+
R ? /* @__PURE__ */ Y.jsx("p", { style: { lineHeight: 1.07 }, children: R }) : null,
|
|
852
|
+
m ? /* @__PURE__ */ Y.jsx(
|
|
853
|
+
"p",
|
|
854
|
+
{
|
|
855
|
+
className: "starasia-checkbox-description",
|
|
856
|
+
style: { color: "#78867F" },
|
|
857
|
+
children: m
|
|
858
|
+
}
|
|
859
|
+
) : null
|
|
860
|
+
] }) : null
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
);
|
|
864
|
+
};
|
|
865
|
+
export {
|
|
866
|
+
xr as Checkbox
|
|
867
|
+
};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
(function(E,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(E=typeof globalThis<"u"?globalThis:E||self,j(E.Checkbox={},E.React))})(this,function(E,j){"use strict";var J={exports:{}},I={};/**
|
|
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 ae;function je(){if(ae)return I;ae=1;var R=j,v=Symbol.for("react.element"),_=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,w=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function T(y,f,P){var b,k={},S=null,M=null;P!==void 0&&(S=""+P),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(M=f.ref);for(b in f)g.call(f,b)&&!m.hasOwnProperty(b)&&(k[b]=f[b]);if(y&&y.defaultProps)for(b in f=y.defaultProps,f)k[b]===void 0&&(k[b]=f[b]);return{$$typeof:v,type:y,key:S,ref:M,props:k,_owner:w.current}}return I.Fragment=_,I.jsx=T,I.jsxs=T,I}var W={};/**
|
|
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 ne;function Pe(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var R=j,v=Symbol.for("react.element"),_=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),oe=Symbol.iterator,Ae="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=oe&&e[oe]||e[Ae];return typeof r=="function"?r:null}var F=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function l(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];We("error",e,a)}}function We(e,r,a){{var n=F.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",a=a.concat([i]));var s=a.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var $e=!1,Ye=!1,Le=!1,Ne=!1,Me=!1,ie;ie=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===m||Me||e===w||e===P||e===b||Ne||e===M||$e||Ye||Le||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===k||e.$$typeof===T||e.$$typeof===y||e.$$typeof===f||e.$$typeof===ie||e.getModuleId!==void 0))}function Ue(e,r,a){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?a+"("+i+")":a}function se(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case _:return"Portal";case m:return"Profiler";case w:return"StrictMode";case P:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return se(r)+".Consumer";case T:var a=e;return se(a._context)+".Provider";case f:return Ue(e,e.render,"ForwardRef");case k:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case S:{var i=e,s=i._payload,o=i._init;try{return x(o(s))}catch{return null}}}return null}var C=Object.assign,Y=0,ce,ue,le,fe,de,he,be;function pe(){}pe.__reactDisabledLog=!0;function ze(){{if(Y===0){ce=console.log,ue=console.info,le=console.warn,fe=console.error,de=console.group,he=console.groupCollapsed,be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Be(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:ce}),info:C({},e,{value:ue}),warn:C({},e,{value:le}),error:C({},e,{value:fe}),group:C({},e,{value:de}),groupCollapsed:C({},e,{value:he}),groupEnd:C({},e,{value:be})})}Y<0&&l("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=F.ReactCurrentDispatcher,q;function V(e,r,a){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
18
|
+
`+q+e}}var G=!1,U;{var Je=typeof WeakMap=="function"?WeakMap:Map;U=new Je}function ve(e,r){if(!e||G)return"";{var a=U.get(e);if(a!==void 0)return a}var n;G=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=K.current,K.current=null,ze();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(h){n=h}Reflect.construct(e,[],o)}else{try{o.call()}catch(h){n=h}e.call(o.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var t=h.stack.split(`
|
|
19
|
+
`),d=n.stack.split(`
|
|
20
|
+
`),c=t.length-1,u=d.length-1;c>=1&&u>=0&&t[c]!==d[u];)u--;for(;c>=1&&u>=0;c--,u--)if(t[c]!==d[u]){if(c!==1||u!==1)do if(c--,u--,u<0||t[c]!==d[u]){var p=`
|
|
21
|
+
`+t[c].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,p),p}while(c>=1&&u>=0);break}}}finally{G=!1,K.current=s,Be(),Error.prepareStackTrace=i}var A=e?e.displayName||e.name:"",O=A?V(A):"";return typeof e=="function"&&U.set(e,O),O}function Ke(e,r,a){return ve(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function z(e,r,a){if(e==null)return"";if(typeof e=="function")return ve(e,qe(e));if(typeof e=="string")return V(e);switch(e){case P:return V("Suspense");case b:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ke(e.render);case k:return z(e.type,r,a);case S:{var n=e,i=n._payload,s=n._init;try{return z(s(i),r,a)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,xe={},ge=F.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,a=z(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(a)}else ge.setExtraStackFrame(null)}function Ge(e,r,a,n,i){{var s=Function.call.bind(L);for(var o in e)if(s(e,o)){var t=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+a+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}t=e[o](r,o,n,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(B(i),l("%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,o,typeof t),B(null)),t instanceof Error&&!(t.message in xe)&&(xe[t.message]=!0,B(i),l("Failed %s type: %s",a,t.message),B(null))}}}var Xe=Array.isArray;function X(e){return Xe(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Ze(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ye(e){if(Ze(e))return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),me(e)}var N=F.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},ke,Ee,H;H={};function er(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ar(e,r){if(typeof e.ref=="string"&&N.current&&r&&N.current.stateNode!==r){var a=x(N.current.type);H[a]||(l('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(N.current.type),e.ref),H[a]=!0)}}function nr(e,r){{var a=function(){ke||(ke=!0,l("%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)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function tr(e,r){{var a=function(){Ee||(Ee=!0,l("%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)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var or=function(e,r,a,n,i,s,o){var t={$$typeof:v,type:e,key:r,ref:a,props:o,_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:i}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function ir(e,r,a,n,i){{var s,o={},t=null,d=null;a!==void 0&&(ye(a),t=""+a),rr(r)&&(ye(r.key),t=""+r.key),er(r)&&(d=r.ref,ar(r,i));for(s in r)L.call(r,s)&&!Qe.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)o[s]===void 0&&(o[s]=c[s])}if(t||d){var u=typeof e=="function"?e.displayName||e.name||"Unknown":e;t&&nr(o,u),d&&tr(o,u)}return or(e,t,d,i,n,N.current,o)}}var Z=F.ReactCurrentOwner,Re=F.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,a=z(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(a)}else Re.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function _e(){{if(Z.current){var e=x(Z.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+a+"."}return""}}var we={};function cr(e){{var r=_e();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+a+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=cr(r);if(we[a])return;we[a]=!0;var n="";e&&e._owner&&e._owner!==Z.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),D(e),l('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),D(null)}}function Se(e,r){{if(typeof e!="object")return;if(X(e))for(var a=0;a<e.length;a++){var n=e[a];ee(n)&&Te(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var i=Ie(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)ee(o.value)&&Te(o.value,r)}}}function ur(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===k))a=r.propTypes;else return;if(a){var n=x(r);Ge(a,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var i=x(r);l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var n=r[a];if(n!=="children"&&n!=="key"){D(e),l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),l("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Ce={};function Oe(e,r,a,n,i,s){{var o=Ve(e);if(!o){var t="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).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=sr(i);d?t+=d:t+=_e();var c;e===null?c="null":X(e)?c="array":e!==void 0&&e.$$typeof===v?(c="<"+(x(e.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,t)}var u=ir(e,r,a,i,s);if(u==null)return u;if(o){var p=r.children;if(p!==void 0)if(n)if(X(p)){for(var A=0;A<p.length;A++)Se(p[A],e);Object.freeze&&Object.freeze(p)}else l("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 Se(p,e)}if(L.call(r,"key")){var O=x(e),h=Object.keys(r).filter(function(vr){return vr!=="key"}),re=h.length>0?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}";if(!Ce[O+re]){var pr=h.length>0?"{"+h.join(": ..., ")+": ...}":"{}";l(`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} />`,re,O,pr,O),Ce[O+re]=!0}}return e===g?lr(u):ur(u),u}}function fr(e,r,a){return Oe(e,r,a,!0)}function dr(e,r,a){return Oe(e,r,a,!1)}var hr=dr,br=fr;W.Fragment=g,W.jsx=hr,W.jsxs=br}()),W}process.env.NODE_ENV==="production"?J.exports=je():J.exports=Pe();var $=J.exports;const Fe=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
33
|
+
|
|
34
|
+
:root {
|
|
35
|
+
/* color */
|
|
36
|
+
--starasia-ui-checkbox-color-primary-black: var(
|
|
37
|
+
--starasia-ui-color-gray-700,
|
|
38
|
+
#374151
|
|
39
|
+
);
|
|
40
|
+
--starasia-ui-checkbox-color-secondary-black: var(
|
|
41
|
+
--starasia-ui-color-gray-50,
|
|
42
|
+
#f9fafb
|
|
43
|
+
);
|
|
44
|
+
--starasia-ui-checkbox-color-primary-blue: var(
|
|
45
|
+
--starasia-ui-brand-primary-default,
|
|
46
|
+
#1976d2
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
/* border radius */
|
|
50
|
+
--starasia-ui-checkbox-border-radius: var(--starasia-ui-radii-sm, 2px);
|
|
51
|
+
|
|
52
|
+
/* height */
|
|
53
|
+
--starasia-ui-checkbox-height-sm: 14px;
|
|
54
|
+
--starasia-ui-checkbox-height-md: 16px;
|
|
55
|
+
--starasia-ui-checkbox-height-lg: 18px;
|
|
56
|
+
|
|
57
|
+
/* width */
|
|
58
|
+
--starasia-ui-checkbox-width-sm: 14px;
|
|
59
|
+
--starasia-ui-checkbox-width-md: 16px;
|
|
60
|
+
--starasia-ui-checkbox-width-lg: 18px;
|
|
61
|
+
|
|
62
|
+
/* box shadow */
|
|
63
|
+
---starasia-ui-checkbox-box-shadow: var(
|
|
64
|
+
var(--starasia-ui-shadow-md),
|
|
65
|
+
0 4px 6px -1px rgb(0 0 0 / 0.1),
|
|
66
|
+
0 2px 4px -2px rgb(0 0 0 / 0.1)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
* {
|
|
71
|
+
font-family: "Poppins", serif;
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.starasia-checkbox-container {
|
|
77
|
+
display: flex;
|
|
78
|
+
width: max-content;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.starasia-checkbox-container.sm {
|
|
82
|
+
font-size: var(--starasia-ui-fontSizes-sm, 12px);
|
|
83
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
84
|
+
gap: 12px;
|
|
85
|
+
}
|
|
86
|
+
.starasia-checkbox-container.md {
|
|
87
|
+
font-size: var(--starasia-ui-fontSizes-md, 14px);
|
|
88
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
89
|
+
gap: 12px;
|
|
90
|
+
}
|
|
91
|
+
.starasia-checkbox-container.lg {
|
|
92
|
+
font-size: var(--starasia-ui-fontSizes-lg, 16px);
|
|
93
|
+
font-weight: var(--starasia-ui-fontWeights-medium, 400);
|
|
94
|
+
gap: 16px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.starasia-checkbox-description {
|
|
98
|
+
font-weight: var(--starasia-ui-fontWeights-normal, 300);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.starasia-checkbox[type="checkbox"] {
|
|
102
|
+
-webkit-appearance: none;
|
|
103
|
+
appearance: none;
|
|
104
|
+
background-color: transparent;
|
|
105
|
+
/* font: inherit; */
|
|
106
|
+
/* color: currentColor; */
|
|
107
|
+
/* border: var(--starasia-ui-border, 1px) solid
|
|
108
|
+
var(--starasia-ui-checkbox-color-primary-black);
|
|
109
|
+
border-radius: var(--starasia-ui-checkbox-border-radius); */
|
|
110
|
+
display: grid;
|
|
111
|
+
place-content: center;
|
|
112
|
+
position: initial !important;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.starasia-checkbox[type="checkbox"].sm {
|
|
116
|
+
width: var(--starasia-ui-checkbox-width-sm);
|
|
117
|
+
height: var(--starasia-ui-checkbox-height-sm);
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
border: 1px solid #181a19;
|
|
120
|
+
}
|
|
121
|
+
.starasia-checkbox[type="checkbox"].md {
|
|
122
|
+
width: var(--starasia-ui-checkbox-width-md);
|
|
123
|
+
height: var(--starasia-ui-checkbox-height-md);
|
|
124
|
+
border-radius: 3px;
|
|
125
|
+
border: 1px solid #181a19;
|
|
126
|
+
}
|
|
127
|
+
.starasia-checkbox[type="checkbox"].lg {
|
|
128
|
+
width: var(--starasia-ui-checkbox-width-lg);
|
|
129
|
+
height: var(--starasia-ui-checkbox-height-lg);
|
|
130
|
+
border-radius: 3px;
|
|
131
|
+
border: 1px solid #181a19;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.starasia-checkbox[type="checkbox"]:checked {
|
|
135
|
+
background-color: var(--starasia-ui-checkbox-color-primary-blue);
|
|
136
|
+
border-color: var(--starasia-ui-checkbox-color-primary-blue);
|
|
137
|
+
}
|
|
138
|
+
.starasia-checkbox[type="checkbox"] {
|
|
139
|
+
border-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.starasia-checkbox[type="checkbox"].sm::before {
|
|
144
|
+
width: 8px;
|
|
145
|
+
height: 8px;
|
|
146
|
+
/* width: calc(var(--starasia-ui-checkbox-width-sm) / 2); */
|
|
147
|
+
/* height: calc(var(--starasia-ui-checkbox-height-sm) / 2); */
|
|
148
|
+
}
|
|
149
|
+
.starasia-checkbox[type="checkbox"].md::before {
|
|
150
|
+
width: 8px;
|
|
151
|
+
height: 8px;
|
|
152
|
+
/* width: calc(var(--starasia-ui-checkbox-width-md) / 2); */
|
|
153
|
+
/* height: calc(var(--starasia-ui-checkbox-height-md) / 2); */
|
|
154
|
+
}
|
|
155
|
+
.starasia-checkbox[type="checkbox"].lg::before {
|
|
156
|
+
width: 10px;
|
|
157
|
+
height: 10px;
|
|
158
|
+
/* width: calc(var(--starasia-ui-checkbox-width-lg) / 1.5); */
|
|
159
|
+
/* height: calc(var(--starasia-ui-checkbox-height-lg) / 2); */
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.starasia-checkbox[type="checkbox"]::before {
|
|
163
|
+
content: "";
|
|
164
|
+
transform: scale(0);
|
|
165
|
+
transition: 120ms transform ease-in-out;
|
|
166
|
+
background-color: var(--starasia-ui-checkbox-color-secondary-black);
|
|
167
|
+
}
|
|
168
|
+
.starasia-checkbox[type="checkbox"].starasia-checkbox-select::before {
|
|
169
|
+
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
|
|
170
|
+
transform-origin: bottom left;
|
|
171
|
+
}
|
|
172
|
+
.starasia-checkbox[type="checkbox"].starasia-checkbox-indeterminate::before {
|
|
173
|
+
clip-path: polygon(0% 40%, 100% 40%, 100% 60%, 0% 60%);
|
|
174
|
+
transform-origin: left left;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.starasia-checkbox[type="checkbox"]:checked::before {
|
|
178
|
+
transform: scale(1);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.starasia-checkbox[type="checkbox"]:hover:not(:disabled) {
|
|
182
|
+
/* border-color: var(--starasia-ui-checkbox-color-primary-blue); */
|
|
183
|
+
box-shadow: 0px 0px 1px 5px rgba(201, 206, 204, 0.2);
|
|
184
|
+
}
|
|
185
|
+
.starasia-checkbox[type="checkbox"]:checked:hover:not(:disabled) {
|
|
186
|
+
/* border-color: var(--starasia-ui-checkbox-color-primary-blue); */
|
|
187
|
+
box-shadow: 0px 0px 1px 5px rgba(25, 118, 210, 0.1);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.starasia-checkbox[type="checkbox"]:disabled {
|
|
191
|
+
--form-control-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
192
|
+
color: var(--starasia-ui-checkbox-color-primary-black);
|
|
193
|
+
border-color: #aeb6b2;
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
box-shadow: none;
|
|
196
|
+
}
|
|
197
|
+
.starasia-checkbox[type="checkbox"]:checked:disabled {
|
|
198
|
+
--form-control-color: var(--starasia-ui-checkbox-color-primary-black);
|
|
199
|
+
color: var(--starasia-ui-checkbox-color-primary-black);
|
|
200
|
+
border-color: #aeb6b2;
|
|
201
|
+
cursor: not-allowed;
|
|
202
|
+
box-shadow: none;
|
|
203
|
+
background-color: #aeb6b2;
|
|
204
|
+
}
|
|
205
|
+
`,te="starasia-checkbox-styles";(R=>{if(!document.getElementById(te)){const v=document.createElement("style");v.id=te,v.textContent=R,document.head.appendChild(v)}})(Fe);const De=R=>{const{color:v="blue",label:_,sizes:g="md",id:w,description:m,variant:T="select",...y}=R;return $.jsxs("label",{htmlFor:w,className:`starasia-checkbox-container ${g}`,style:{alignItems:m?"start":"center"},children:[$.jsx("input",{id:w,type:"checkbox",className:`starasia-checkbox ${g} starasia-checkbox-${T}`,...y}),_||m?$.jsxs("div",{children:[_?$.jsx("p",{style:{lineHeight:1.07},children:_}):null,m?$.jsx("p",{className:"starasia-checkbox-description",style:{color:"#78867F"},children:m}):null]}):null]})};E.Checkbox=De,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.d.ts
ADDED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface CheckboxProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
3
|
+
sizes?: "sm" | "md" | "lg";
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string | ReactNode;
|
|
6
|
+
variant?: "select" | "indeterminate";
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@starasia/checkbox",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "checkbox component for starasia UI",
|
|
5
|
+
"author": "Prawito Hudoro",
|
|
6
|
+
"main": "dist/checkbox.umd.js",
|
|
7
|
+
"module": "dist/checkbox.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
|
+
}
|