@starasia/toggle 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/toggle.es.js +22 -664
- package/dist/toggle.umd.js +2 -33
- package/package.json +6 -6
package/dist/toggle.es.js
CHANGED
|
@@ -1,647 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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 ke;
|
|
13
|
-
function dr() {
|
|
14
|
-
if (ke)
|
|
15
|
-
return I;
|
|
16
|
-
ke = 1;
|
|
17
|
-
var x = Oe, v = Symbol.for("react.element"), E = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, R = x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Y = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function D(_, f, O) {
|
|
19
|
-
var p, y = {}, w = null, z = null;
|
|
20
|
-
O !== void 0 && (w = "" + O), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (z = f.ref);
|
|
21
|
-
for (p in f)
|
|
22
|
-
b.call(f, p) && !Y.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: v, type: _, key: w, ref: z, props: y, _owner: R.current };
|
|
27
|
-
}
|
|
28
|
-
return I.Fragment = E, I.jsx = D, I.jsxs = D, I;
|
|
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 gr() {
|
|
42
|
-
return Te || (Te = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var x = Oe, v = Symbol.for("react.element"), E = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), Y = Symbol.for("react.profiler"), D = 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"), z = Symbol.for("react.offscreen"), ee = Symbol.iterator, Ce = "@@iterator";
|
|
44
|
-
function je(e) {
|
|
45
|
-
if (e === null || typeof e != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var r = ee && e[ee] || e[Ce];
|
|
48
|
-
return typeof r == "function" ? r : null;
|
|
49
|
-
}
|
|
50
|
-
var C = x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function c(e) {
|
|
52
|
-
{
|
|
53
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
|
-
t[n - 1] = arguments[n];
|
|
55
|
-
Pe("error", e, t);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function Pe(e, r, t) {
|
|
59
|
-
{
|
|
60
|
-
var n = C.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
61
|
-
o !== "" && (r += "%s", t = t.concat([o]));
|
|
62
|
-
var s = t.map(function(i) {
|
|
63
|
-
return String(i);
|
|
64
|
-
});
|
|
65
|
-
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var De = !1, Fe = !1, Ae = !1, We = !1, Ie = !1, re;
|
|
69
|
-
re = Symbol.for("react.module.reference");
|
|
70
|
-
function $e(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === b || e === Y || Ie || e === R || e === O || e === p || We || e === z || De || Fe || Ae || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === y || e.$$typeof === D || e.$$typeof === _ || 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, t) {
|
|
78
|
-
var n = e.displayName;
|
|
79
|
-
if (n)
|
|
80
|
-
return n;
|
|
81
|
-
var o = r.displayName || r.name || "";
|
|
82
|
-
return o !== "" ? t + "(" + o + ")" : t;
|
|
83
|
-
}
|
|
84
|
-
function te(e) {
|
|
85
|
-
return e.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function m(e) {
|
|
88
|
-
if (e == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof e.tag == "number" && c("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 b:
|
|
96
|
-
return "Fragment";
|
|
97
|
-
case E:
|
|
98
|
-
return "Portal";
|
|
99
|
-
case Y:
|
|
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 e == "object")
|
|
109
|
-
switch (e.$$typeof) {
|
|
110
|
-
case _:
|
|
111
|
-
var r = e;
|
|
112
|
-
return te(r) + ".Consumer";
|
|
113
|
-
case D:
|
|
114
|
-
var t = e;
|
|
115
|
-
return te(t._context) + ".Provider";
|
|
116
|
-
case f:
|
|
117
|
-
return Ye(e, e.render, "ForwardRef");
|
|
118
|
-
case y:
|
|
119
|
-
var n = e.displayName || null;
|
|
120
|
-
return n !== null ? n : m(e.type) || "Memo";
|
|
121
|
-
case w: {
|
|
122
|
-
var o = e, s = o._payload, i = o._init;
|
|
123
|
-
try {
|
|
124
|
-
return m(i(s));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var k = Object.assign, F = 0, ne, ae, ie, oe, se, le, ue;
|
|
133
|
-
function ce() {
|
|
134
|
-
}
|
|
135
|
-
ce.__reactDisabledLog = !0;
|
|
136
|
-
function ze() {
|
|
137
|
-
{
|
|
138
|
-
if (F === 0) {
|
|
139
|
-
ne = console.log, ae = console.info, ie = console.warn, oe = console.error, se = console.group, le = console.groupCollapsed, ue = console.groupEnd;
|
|
140
|
-
var e = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: ce,
|
|
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
|
-
F++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function Le() {
|
|
160
|
-
{
|
|
161
|
-
if (F--, F === 0) {
|
|
162
|
-
var e = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: k({}, e, {
|
|
169
|
-
value: ne
|
|
170
|
-
}),
|
|
171
|
-
info: k({}, e, {
|
|
172
|
-
value: ae
|
|
173
|
-
}),
|
|
174
|
-
warn: k({}, e, {
|
|
175
|
-
value: ie
|
|
176
|
-
}),
|
|
177
|
-
error: k({}, e, {
|
|
178
|
-
value: oe
|
|
179
|
-
}),
|
|
180
|
-
group: k({}, e, {
|
|
181
|
-
value: se
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: k({}, e, {
|
|
184
|
-
value: le
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: k({}, e, {
|
|
187
|
-
value: ue
|
|
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 L(e, r, t) {
|
|
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 + e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var J = !1, N;
|
|
209
|
-
{
|
|
210
|
-
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
N = new Ne();
|
|
212
|
-
}
|
|
213
|
-
function fe(e, r) {
|
|
214
|
-
if (!e || J)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var t = N.get(e);
|
|
218
|
-
if (t !== void 0)
|
|
219
|
-
return t;
|
|
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, ze();
|
|
227
|
-
try {
|
|
228
|
-
if (r) {
|
|
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 (g) {
|
|
240
|
-
n = g;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(e, [], i);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
i.call();
|
|
246
|
-
} catch (g) {
|
|
247
|
-
n = g;
|
|
248
|
-
}
|
|
249
|
-
e.call(i.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (g) {
|
|
255
|
-
n = g;
|
|
256
|
-
}
|
|
257
|
-
e();
|
|
258
|
-
}
|
|
259
|
-
} catch (g) {
|
|
260
|
-
if (g && n && typeof g.stack == "string") {
|
|
261
|
-
for (var a = g.stack.split(`
|
|
262
|
-
`), d = n.stack.split(`
|
|
263
|
-
`), l = a.length - 1, u = d.length - 1; l >= 1 && u >= 0 && a[l] !== d[u]; )
|
|
264
|
-
u--;
|
|
265
|
-
for (; l >= 1 && u >= 0; l--, u--)
|
|
266
|
-
if (a[l] !== d[u]) {
|
|
267
|
-
if (l !== 1 || u !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (l--, u--, u < 0 || a[l] !== d[u]) {
|
|
270
|
-
var h = `
|
|
271
|
-
` + a[l].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, h), h;
|
|
273
|
-
}
|
|
274
|
-
while (l >= 1 && u >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
J = !1, U.current = s, Le(), Error.prepareStackTrace = o;
|
|
280
|
-
}
|
|
281
|
-
var P = e ? e.displayName || e.name : "", T = P ? L(P) : "";
|
|
282
|
-
return typeof e == "function" && N.set(e, T), T;
|
|
283
|
-
}
|
|
284
|
-
function Ve(e, r, t) {
|
|
285
|
-
return fe(e, !1);
|
|
286
|
-
}
|
|
287
|
-
function Me(e) {
|
|
288
|
-
var r = e.prototype;
|
|
289
|
-
return !!(r && r.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function V(e, r, t) {
|
|
292
|
-
if (e == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof e == "function")
|
|
295
|
-
return fe(e, Me(e));
|
|
296
|
-
if (typeof e == "string")
|
|
297
|
-
return L(e);
|
|
298
|
-
switch (e) {
|
|
299
|
-
case O:
|
|
300
|
-
return L("Suspense");
|
|
301
|
-
case p:
|
|
302
|
-
return L("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof e == "object")
|
|
305
|
-
switch (e.$$typeof) {
|
|
306
|
-
case f:
|
|
307
|
-
return Ve(e.render);
|
|
308
|
-
case y:
|
|
309
|
-
return V(e.type, r, t);
|
|
310
|
-
case w: {
|
|
311
|
-
var n = e, o = n._payload, s = n._init;
|
|
312
|
-
try {
|
|
313
|
-
return V(s(o), r, t);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var A = Object.prototype.hasOwnProperty, de = {}, ge = C.ReactDebugCurrentFrame;
|
|
321
|
-
function M(e) {
|
|
322
|
-
if (e) {
|
|
323
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
324
|
-
ge.setExtraStackFrame(t);
|
|
325
|
-
} else
|
|
326
|
-
ge.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function Ue(e, r, t, n, o) {
|
|
329
|
-
{
|
|
330
|
-
var s = Function.call.bind(A);
|
|
331
|
-
for (var i in e)
|
|
332
|
-
if (s(e, i)) {
|
|
333
|
-
var a = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof e[i] != "function") {
|
|
336
|
-
var d = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw d.name = "Invariant Violation", d;
|
|
338
|
-
}
|
|
339
|
-
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (l) {
|
|
341
|
-
a = l;
|
|
342
|
-
}
|
|
343
|
-
a && !(a instanceof Error) && (M(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", t, i, typeof a), M(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, M(o), c("Failed %s type: %s", t, a.message), M(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, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
-
return t;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function qe(e) {
|
|
358
|
-
try {
|
|
359
|
-
return ve(e), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function ve(e) {
|
|
365
|
-
return "" + e;
|
|
366
|
-
}
|
|
367
|
-
function pe(e) {
|
|
368
|
-
if (qe(e))
|
|
369
|
-
return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), ve(e);
|
|
370
|
-
}
|
|
371
|
-
var W = C.ReactCurrentOwner, Ke = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, he, be, 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" && W.current && r && W.current.stateNode !== r) {
|
|
396
|
-
var t = m(W.current.type);
|
|
397
|
-
K[t] || (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', m(W.current.type), e.ref), K[t] = !0);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function Ze(e, r) {
|
|
401
|
-
{
|
|
402
|
-
var t = function() {
|
|
403
|
-
he || (he = !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)", r));
|
|
404
|
-
};
|
|
405
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
-
get: t,
|
|
407
|
-
configurable: !0
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function Qe(e, r) {
|
|
412
|
-
{
|
|
413
|
-
var t = function() {
|
|
414
|
-
be || (be = !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)", r));
|
|
415
|
-
};
|
|
416
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
-
get: t,
|
|
418
|
-
configurable: !0
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
var er = function(e, r, t, n, o, s, i) {
|
|
423
|
-
var a = {
|
|
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: t,
|
|
430
|
-
props: i,
|
|
431
|
-
// Record the component responsible for creating this element.
|
|
432
|
-
_owner: s
|
|
433
|
-
};
|
|
434
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
435
|
-
configurable: !1,
|
|
436
|
-
enumerable: !1,
|
|
437
|
-
writable: !0,
|
|
438
|
-
value: !1
|
|
439
|
-
}), Object.defineProperty(a, "_self", {
|
|
440
|
-
configurable: !1,
|
|
441
|
-
enumerable: !1,
|
|
442
|
-
writable: !1,
|
|
443
|
-
value: n
|
|
444
|
-
}), Object.defineProperty(a, "_source", {
|
|
445
|
-
configurable: !1,
|
|
446
|
-
enumerable: !1,
|
|
447
|
-
writable: !1,
|
|
448
|
-
value: o
|
|
449
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
450
|
-
};
|
|
451
|
-
function rr(e, r, t, n, o) {
|
|
452
|
-
{
|
|
453
|
-
var s, i = {}, a = null, d = null;
|
|
454
|
-
t !== void 0 && (pe(t), a = "" + t), Xe(r) && (pe(r.key), a = "" + r.key), Ge(r) && (d = r.ref, He(r, o));
|
|
455
|
-
for (s in r)
|
|
456
|
-
A.call(r, s) && !Ke.hasOwnProperty(s) && (i[s] = r[s]);
|
|
457
|
-
if (e && e.defaultProps) {
|
|
458
|
-
var l = e.defaultProps;
|
|
459
|
-
for (s in l)
|
|
460
|
-
i[s] === void 0 && (i[s] = l[s]);
|
|
461
|
-
}
|
|
462
|
-
if (a || d) {
|
|
463
|
-
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
a && Ze(i, u), d && Qe(i, u);
|
|
465
|
-
}
|
|
466
|
-
return er(e, a, d, o, n, W.current, i);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
var G = C.ReactCurrentOwner, me = C.ReactDebugCurrentFrame;
|
|
470
|
-
function j(e) {
|
|
471
|
-
if (e) {
|
|
472
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
473
|
-
me.setExtraStackFrame(t);
|
|
474
|
-
} else
|
|
475
|
-
me.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 ye() {
|
|
483
|
-
{
|
|
484
|
-
if (G.current) {
|
|
485
|
-
var e = m(G.current.type);
|
|
486
|
-
if (e)
|
|
487
|
-
return `
|
|
488
|
-
|
|
489
|
-
Check the render method of \`` + e + "`.";
|
|
490
|
-
}
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function tr(e) {
|
|
495
|
-
{
|
|
496
|
-
if (e !== void 0) {
|
|
497
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
498
|
-
return `
|
|
499
|
-
|
|
500
|
-
Check your code at ` + r + ":" + t + ".";
|
|
501
|
-
}
|
|
502
|
-
return "";
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
var xe = {};
|
|
506
|
-
function nr(e) {
|
|
507
|
-
{
|
|
508
|
-
var r = ye();
|
|
509
|
-
if (!r) {
|
|
510
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
-
t && (r = `
|
|
512
|
-
|
|
513
|
-
Check the top-level render call using <` + t + ">.");
|
|
514
|
-
}
|
|
515
|
-
return r;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
function Ee(e, r) {
|
|
519
|
-
{
|
|
520
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
521
|
-
return;
|
|
522
|
-
e._store.validated = !0;
|
|
523
|
-
var t = nr(r);
|
|
524
|
-
if (xe[t])
|
|
525
|
-
return;
|
|
526
|
-
xe[t] = !0;
|
|
527
|
-
var n = "";
|
|
528
|
-
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + m(e._owner.type) + "."), j(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), j(null);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function Re(e, r) {
|
|
532
|
-
{
|
|
533
|
-
if (typeof e != "object")
|
|
534
|
-
return;
|
|
535
|
-
if (q(e))
|
|
536
|
-
for (var t = 0; t < e.length; t++) {
|
|
537
|
-
var n = e[t];
|
|
538
|
-
H(n) && Ee(n, r);
|
|
539
|
-
}
|
|
540
|
-
else if (H(e))
|
|
541
|
-
e._store && (e._store.validated = !0);
|
|
542
|
-
else if (e) {
|
|
543
|
-
var o = je(e);
|
|
544
|
-
if (typeof o == "function" && o !== e.entries)
|
|
545
|
-
for (var s = o.call(e), i; !(i = s.next()).done; )
|
|
546
|
-
H(i.value) && Ee(i.value, r);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
function ar(e) {
|
|
551
|
-
{
|
|
552
|
-
var r = e.type;
|
|
553
|
-
if (r == null || typeof r == "string")
|
|
554
|
-
return;
|
|
555
|
-
var t;
|
|
556
|
-
if (typeof r == "function")
|
|
557
|
-
t = 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 === y))
|
|
561
|
-
t = r.propTypes;
|
|
562
|
-
else
|
|
563
|
-
return;
|
|
564
|
-
if (t) {
|
|
565
|
-
var n = m(r);
|
|
566
|
-
Ue(t, e.props, "prop", n, e);
|
|
567
|
-
} else if (r.PropTypes !== void 0 && !X) {
|
|
568
|
-
X = !0;
|
|
569
|
-
var o = m(r);
|
|
570
|
-
c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
571
|
-
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function ir(e) {
|
|
576
|
-
{
|
|
577
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
578
|
-
var n = r[t];
|
|
579
|
-
if (n !== "children" && n !== "key") {
|
|
580
|
-
j(e), c("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), c("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
var _e = {};
|
|
588
|
-
function we(e, r, t, n, o, s) {
|
|
589
|
-
{
|
|
590
|
-
var i = $e(e);
|
|
591
|
-
if (!i) {
|
|
592
|
-
var a = "";
|
|
593
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " 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 = tr(o);
|
|
595
|
-
d ? a += d : a += ye();
|
|
596
|
-
var l;
|
|
597
|
-
e === null ? l = "null" : q(e) ? l = "array" : e !== void 0 && e.$$typeof === v ? (l = "<" + (m(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
598
|
-
}
|
|
599
|
-
var u = rr(e, r, t, o, s);
|
|
600
|
-
if (u == null)
|
|
601
|
-
return u;
|
|
602
|
-
if (i) {
|
|
603
|
-
var h = r.children;
|
|
604
|
-
if (h !== void 0)
|
|
605
|
-
if (n)
|
|
606
|
-
if (q(h)) {
|
|
607
|
-
for (var P = 0; P < h.length; P++)
|
|
608
|
-
Re(h[P], e);
|
|
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
|
-
Re(h, e);
|
|
614
|
-
}
|
|
615
|
-
if (A.call(r, "key")) {
|
|
616
|
-
var T = m(e), g = Object.keys(r).filter(function(fr) {
|
|
617
|
-
return fr !== "key";
|
|
618
|
-
}), Z = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
-
if (!_e[T + Z]) {
|
|
620
|
-
var cr = g.length > 0 ? "{" + g.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, cr, T), _e[T + Z] = !0;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
return e === b ? ir(u) : ar(u), u;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function or(e, r, t) {
|
|
633
|
-
return we(e, r, t, !0);
|
|
634
|
-
}
|
|
635
|
-
function sr(e, r, t) {
|
|
636
|
-
return we(e, r, t, !1);
|
|
637
|
-
}
|
|
638
|
-
var lr = sr, ur = or;
|
|
639
|
-
$.Fragment = b, $.jsx = lr, $.jsxs = ur;
|
|
640
|
-
}()), $;
|
|
641
|
-
}
|
|
642
|
-
process.env.NODE_ENV === "production" ? Q.exports = dr() : Q.exports = gr();
|
|
643
|
-
var S = Q.exports;
|
|
644
|
-
const vr = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
1
|
+
import { jsxs as e, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
const g = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
3
|
:root {
|
|
646
4
|
/* toogle root color */
|
|
647
5
|
--starasia-ui-background-toggle-checked: #1e88e5;
|
|
@@ -823,52 +181,52 @@ input:checked + .starasia-toggle-slider:before {
|
|
|
823
181
|
.starasia-toggle-slider.starasia-toggle-round:before {
|
|
824
182
|
border-radius: 50%;
|
|
825
183
|
}
|
|
826
|
-
`,
|
|
827
|
-
if (!document.getElementById(
|
|
828
|
-
const
|
|
829
|
-
|
|
184
|
+
`, r = "starasia-toggle-styles", l = (t) => {
|
|
185
|
+
if (!document.getElementById(r)) {
|
|
186
|
+
const a = document.createElement("style");
|
|
187
|
+
a.id = r, a.textContent = t, document.head.appendChild(a);
|
|
830
188
|
}
|
|
831
189
|
};
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
const { size:
|
|
835
|
-
return /* @__PURE__ */
|
|
190
|
+
l(g);
|
|
191
|
+
const c = (t) => {
|
|
192
|
+
const { size: a = "md", label: s, description: i, ...o } = t;
|
|
193
|
+
return /* @__PURE__ */ e(
|
|
836
194
|
"div",
|
|
837
195
|
{
|
|
838
|
-
className: `starasia-toggle-container starasia-toggle-container-${
|
|
196
|
+
className: `starasia-toggle-container starasia-toggle-container-${a}`,
|
|
839
197
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ e(
|
|
841
199
|
"label",
|
|
842
200
|
{
|
|
843
|
-
className: `starasia-toggle-switch starasia-toggle-switch-${
|
|
201
|
+
className: `starasia-toggle-switch starasia-toggle-switch-${a}`,
|
|
844
202
|
children: [
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ n("input", { type: "checkbox", ...o }),
|
|
204
|
+
/* @__PURE__ */ n(
|
|
847
205
|
"span",
|
|
848
206
|
{
|
|
849
|
-
className: `starasia-toggle-slider starasia-toggle-round starasia-toggle-${
|
|
207
|
+
className: `starasia-toggle-slider starasia-toggle-round starasia-toggle-${a}`
|
|
850
208
|
}
|
|
851
209
|
)
|
|
852
210
|
]
|
|
853
211
|
}
|
|
854
212
|
),
|
|
855
|
-
|
|
856
|
-
|
|
213
|
+
s || i ? /* @__PURE__ */ e("div", { children: [
|
|
214
|
+
s ? /* @__PURE__ */ n(
|
|
857
215
|
"label",
|
|
858
216
|
{
|
|
859
|
-
htmlFor:
|
|
217
|
+
htmlFor: o.id,
|
|
860
218
|
style: {
|
|
861
219
|
display: "block"
|
|
862
220
|
},
|
|
863
|
-
children:
|
|
221
|
+
children: s
|
|
864
222
|
}
|
|
865
223
|
) : null,
|
|
866
|
-
|
|
224
|
+
i ? /* @__PURE__ */ n("p", { children: i }) : null
|
|
867
225
|
] }) : null
|
|
868
226
|
]
|
|
869
227
|
}
|
|
870
228
|
);
|
|
871
229
|
};
|
|
872
230
|
export {
|
|
873
|
-
|
|
231
|
+
c as Toggle
|
|
874
232
|
};
|
package/dist/toggle.umd.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
(function(
|
|
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 te;function Ce(){if(te)return A;te=1;var R=j,v=Symbol.for("react.element"),_=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,w=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,L={key:!0,ref:!0,__self:!0,__source:!0};function I(k,f,C){var p,y={},T=null,N=null;C!==void 0&&(T=""+C),f.key!==void 0&&(T=""+f.key),f.ref!==void 0&&(N=f.ref);for(p in f)b.call(f,p)&&!L.hasOwnProperty(p)&&(y[p]=f[p]);if(k&&k.defaultProps)for(p in f=k.defaultProps,f)y[p]===void 0&&(y[p]=f[p]);return{$$typeof:v,type:k,key:T,ref:N,props:y,_owner:w.current}}return A.Fragment=_,A.jsx=I,A.jsxs=I,A}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"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),k=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),ie=Symbol.iterator,Ae="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=ie&&e[ie]||e[Ae];return typeof r=="function"?r:null}var P=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ie("error",e,t)}}function Ie(e,r,t){{var n=P.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ye=!1,$e=!1,ze=!1,Le=!1,Ne=!1,oe;oe=Symbol.for("react.module.reference");function Me(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===L||Ne||e===w||e===C||e===p||Le||e===N||Ye||$e||ze||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===y||e.$$typeof===I||e.$$typeof===k||e.$$typeof===f||e.$$typeof===oe||e.getModuleId!==void 0))}function Ve(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function se(e){return e.displayName||"Context"}function m(e){if(e==null)return null;if(typeof e.tag=="number"&&c("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 b:return"Fragment";case _:return"Portal";case L:return"Profiler";case w:return"StrictMode";case C:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case k:var r=e;return se(r)+".Consumer";case I:var t=e;return se(t._context)+".Provider";case f:return Ve(e,e.render,"ForwardRef");case y:var n=e.displayName||null;return n!==null?n:m(e.type)||"Memo";case T:{var o=e,s=o._payload,i=o._init;try{return m(i(s))}catch{return null}}}return null}var S=Object.assign,Y=0,le,ue,ce,fe,de,ge,ve;function pe(){}pe.__reactDisabledLog=!0;function Ue(){{if(Y===0){le=console.log,ue=console.info,ce=console.warn,fe=console.error,de=console.group,ge=console.groupCollapsed,ve=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:S({},e,{value:le}),info:S({},e,{value:ue}),warn:S({},e,{value:ce}),error:S({},e,{value:fe}),group:S({},e,{value:de}),groupCollapsed:S({},e,{value:ge}),groupEnd:S({},e,{value:ve})})}Y<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=P.ReactCurrentDispatcher,q;function M(e,r,t){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
18
|
-
`+q+e}}var G=!1,V;{var Je=typeof WeakMap=="function"?WeakMap:Map;V=new Je}function he(e,r){if(!e||G)return"";{var t=V.get(e);if(t!==void 0)return t}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=K.current,K.current=null,Ue();try{if(r){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(g){n=g}Reflect.construct(e,[],i)}else{try{i.call()}catch(g){n=g}e.call(i.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
-
`),d=n.stack.split(`
|
|
20
|
-
`),l=a.length-1,u=d.length-1;l>=1&&u>=0&&a[l]!==d[u];)u--;for(;l>=1&&u>=0;l--,u--)if(a[l]!==d[u]){if(l!==1||u!==1)do if(l--,u--,u<0||a[l]!==d[u]){var h=`
|
|
21
|
-
`+a[l].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,h),h}while(l>=1&&u>=0);break}}}finally{G=!1,K.current=s,Be(),Error.prepareStackTrace=o}var F=e?e.displayName||e.name:"",O=F?M(F):"";return typeof e=="function"&&V.set(e,O),O}function Ke(e,r,t){return he(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,qe(e));if(typeof e=="string")return M(e);switch(e){case C:return M("Suspense");case p:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ke(e.render);case y:return U(e.type,r,t);case T:{var n=e,o=n._payload,s=n._init;try{return U(s(o),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,be={},me=P.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function Ge(e,r,t,n,o){{var s=Function.call.bind($);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a 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",t,i,typeof a),B(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,B(o),c("Failed %s type: %s",t,a.message),B(null))}}}var Xe=Array.isArray;function X(e){return Xe(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ze(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function xe(e){if(Ze(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),ye(e)}var z=P.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Ee,Re,H;H={};function er(e){if($.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($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&z.current&&r&&z.current.stateNode!==r){var t=m(z.current.type);H[t]||(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',m(z.current.type),e.ref),H[t]=!0)}}function nr(e,r){{var t=function(){Ee||(Ee=!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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ar(e,r){{var t=function(){Re||(Re=!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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ir=function(e,r,t,n,o,s,i){var a={$$typeof:v,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function or(e,r,t,n,o){{var s,i={},a=null,d=null;t!==void 0&&(xe(t),a=""+t),rr(r)&&(xe(r.key),a=""+r.key),er(r)&&(d=r.ref,tr(r,o));for(s in r)$.call(r,s)&&!Qe.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||d){var u=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&nr(i,u),d&&ar(i,u)}return ir(e,a,d,o,n,z.current,i)}}var Z=P.ReactCurrentOwner,_e=P.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function we(){{if(Z.current){var e=m(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(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var ke={};function lr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(ke[t])return;ke[t]=!0;var n="";e&&e._owner&&e._owner!==Z.current&&(n=" It was passed a child from "+m(e._owner.type)+"."),D(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Se(e,r){{if(typeof e!="object")return;if(X(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&Te(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var o=We(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)ee(i.value)&&Te(i.value,r)}}}function ur(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===y))t=r.propTypes;else return;if(t){var n=m(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var o=m(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),c("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),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Oe={};function je(e,r,t,n,o,s){{var i=Me(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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(o);d?a+=d:a+=we();var l;e===null?l="null":X(e)?l="array":e!==void 0&&e.$$typeof===v?(l="<"+(m(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var u=or(e,r,t,o,s);if(u==null)return u;if(i){var h=r.children;if(h!==void 0)if(n)if(X(h)){for(var F=0;F<h.length;F++)Se(h[F],e);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 Se(h,e)}if($.call(r,"key")){var O=m(e),g=Object.keys(r).filter(function(hr){return hr!=="key"}),re=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[O+re]){var pr=g.length>0?"{"+g.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} />`,re,O,pr,O),Oe[O+re]=!0}}return e===b?cr(u):ur(u),u}}function fr(e,r,t){return je(e,r,t,!0)}function dr(e,r,t){return je(e,r,t,!1)}var gr=dr,vr=fr;W.Fragment=b,W.jsx=gr,W.jsxs=vr}()),W}process.env.NODE_ENV==="production"?J.exports=Ce():J.exports=Pe();var E=J.exports;const De=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
1
|
+
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.Toggle={},n.jsxRuntime))})(this,function(n,a){"use strict";const g=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
33
2
|
:root {
|
|
34
3
|
/* toogle root color */
|
|
35
4
|
--starasia-ui-background-toggle-checked: #1e88e5;
|
|
@@ -211,4 +180,4 @@ input:checked + .starasia-toggle-slider:before {
|
|
|
211
180
|
.starasia-toggle-slider.starasia-toggle-round:before {
|
|
212
181
|
border-radius: 50%;
|
|
213
182
|
}
|
|
214
|
-
`,
|
|
183
|
+
`,o="starasia-toggle-styles";(s=>{if(!document.getElementById(o)){const t=document.createElement("style");t.id=o,t.textContent=s,document.head.appendChild(t)}})(g);const l=s=>{const{size:t="md",label:e,description:i,...r}=s;return a.jsxs("div",{className:`starasia-toggle-container starasia-toggle-container-${t}`,children:[a.jsxs("label",{className:`starasia-toggle-switch starasia-toggle-switch-${t}`,children:[a.jsx("input",{type:"checkbox",...r}),a.jsx("span",{className:`starasia-toggle-slider starasia-toggle-round starasia-toggle-${t}`})]}),e||i?a.jsxs("div",{children:[e?a.jsx("label",{htmlFor:r.id,style:{display:"block"},children:e}):null,i?a.jsx("p",{children:i}):null]}):null]})};n.Toggle=l,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/toggle",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "toggle component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/toggle.umd.js",
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"dist/*.map",
|
|
13
13
|
"dist/*.css"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "vite --config vite.config.ts --port 3000",
|
|
17
|
-
"build": "vite build --config vite.config.ts"
|
|
18
|
-
},
|
|
19
15
|
"keywords": [],
|
|
20
16
|
"license": "ISC",
|
|
21
17
|
"type": "module",
|
|
@@ -37,5 +33,9 @@
|
|
|
37
33
|
"react-dom": "^18.2.0",
|
|
38
34
|
"@types/react": "^18.2.55",
|
|
39
35
|
"@types/react-dom": "^18.2.19"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
39
|
+
"build": "vite build --config vite.config.ts"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|