@starasia/toggle 1.0.0 → 1.0.1
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.d.ts +2 -3
- package/dist/index.d.ts +2 -2
- package/dist/toggle.es.js +208 -192
- package/dist/toggle.umd.js +11 -9
- package/package.json +5 -1
package/dist/Toggle.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Toggle } from
|
|
2
|
-
export * from
|
|
1
|
+
export { Toggle } from "./Toggle";
|
|
2
|
+
export * from "./types";
|
package/dist/toggle.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Oe from "react";
|
|
2
|
+
var Q = { exports: {} }, I = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +9,25 @@ var H = { exports: {} }, W = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 };
|
|
23
27
|
}
|
|
24
|
-
return
|
|
28
|
+
return I.Fragment = E, I.jsx = D, I.jsxs = D, I;
|
|
25
29
|
}
|
|
26
|
-
var
|
|
30
|
+
var $ = {};
|
|
27
31
|
/**
|
|
28
32
|
* @license React
|
|
29
33
|
* react-jsx-runtime.development.js
|
|
@@ -33,27 +37,27 @@ var I = {};
|
|
|
33
37
|
* This source code is licensed under the MIT license found in the
|
|
34
38
|
* LICENSE file in the root directory of this source tree.
|
|
35
39
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var x =
|
|
40
|
-
function
|
|
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) {
|
|
41
45
|
if (e === null || typeof e != "object")
|
|
42
46
|
return null;
|
|
43
|
-
var r =
|
|
47
|
+
var r = ee && e[ee] || e[Ce];
|
|
44
48
|
return typeof r == "function" ? r : null;
|
|
45
49
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
50
|
+
var C = x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function c(e) {
|
|
48
52
|
{
|
|
49
53
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
50
54
|
t[n - 1] = arguments[n];
|
|
51
|
-
|
|
55
|
+
Pe("error", e, t);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
|
-
function
|
|
58
|
+
function Pe(e, r, t) {
|
|
55
59
|
{
|
|
56
|
-
var n =
|
|
60
|
+
var n = C.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
57
61
|
o !== "" && (r += "%s", t = t.concat([o]));
|
|
58
62
|
var s = t.map(function(i) {
|
|
59
63
|
return String(i);
|
|
@@ -61,29 +65,29 @@ function dr() {
|
|
|
61
65
|
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === b || e ===
|
|
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
|
|
68
72
|
// types supported by any Flight configuration anywhere since
|
|
69
73
|
// we don't know which Flight build this will end up being used
|
|
70
74
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
75
|
+
e.$$typeof === re || e.getModuleId !== void 0));
|
|
72
76
|
}
|
|
73
|
-
function
|
|
77
|
+
function Ye(e, r, t) {
|
|
74
78
|
var n = e.displayName;
|
|
75
79
|
if (n)
|
|
76
80
|
return n;
|
|
77
81
|
var o = r.displayName || r.name || "";
|
|
78
82
|
return o !== "" ? t + "(" + o + ")" : t;
|
|
79
83
|
}
|
|
80
|
-
function
|
|
84
|
+
function te(e) {
|
|
81
85
|
return e.displayName || "Context";
|
|
82
86
|
}
|
|
83
|
-
function
|
|
87
|
+
function m(e) {
|
|
84
88
|
if (e == null)
|
|
85
89
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
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")
|
|
87
91
|
return e.displayName || e.name || null;
|
|
88
92
|
if (typeof e == "string")
|
|
89
93
|
return e;
|
|
@@ -92,9 +96,9 @@ function dr() {
|
|
|
92
96
|
return "Fragment";
|
|
93
97
|
case E:
|
|
94
98
|
return "Portal";
|
|
95
|
-
case
|
|
99
|
+
case Y:
|
|
96
100
|
return "Profiler";
|
|
97
|
-
case
|
|
101
|
+
case R:
|
|
98
102
|
return "StrictMode";
|
|
99
103
|
case O:
|
|
100
104
|
return "Suspense";
|
|
@@ -103,21 +107,21 @@ function dr() {
|
|
|
103
107
|
}
|
|
104
108
|
if (typeof e == "object")
|
|
105
109
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
110
|
+
case _:
|
|
107
111
|
var r = e;
|
|
108
|
-
return
|
|
112
|
+
return te(r) + ".Consumer";
|
|
109
113
|
case D:
|
|
110
114
|
var t = e;
|
|
111
|
-
return
|
|
112
|
-
case
|
|
113
|
-
return
|
|
114
|
-
case
|
|
115
|
+
return te(t._context) + ".Provider";
|
|
116
|
+
case f:
|
|
117
|
+
return Ye(e, e.render, "ForwardRef");
|
|
118
|
+
case y:
|
|
115
119
|
var n = e.displayName || null;
|
|
116
|
-
return n !== null ? n :
|
|
120
|
+
return n !== null ? n : m(e.type) || "Memo";
|
|
117
121
|
case w: {
|
|
118
122
|
var o = e, s = o._payload, i = o._init;
|
|
119
123
|
try {
|
|
120
|
-
return
|
|
124
|
+
return m(i(s));
|
|
121
125
|
} catch {
|
|
122
126
|
return null;
|
|
123
127
|
}
|
|
@@ -125,18 +129,18 @@ function dr() {
|
|
|
125
129
|
}
|
|
126
130
|
return null;
|
|
127
131
|
}
|
|
128
|
-
var k = Object.assign, F = 0,
|
|
129
|
-
function
|
|
132
|
+
var k = Object.assign, F = 0, ne, ae, ie, oe, se, le, ue;
|
|
133
|
+
function ce() {
|
|
130
134
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
135
|
+
ce.__reactDisabledLog = !0;
|
|
136
|
+
function ze() {
|
|
133
137
|
{
|
|
134
138
|
if (F === 0) {
|
|
135
|
-
|
|
139
|
+
ne = console.log, ae = console.info, ie = console.warn, oe = console.error, se = console.group, le = console.groupCollapsed, ue = console.groupEnd;
|
|
136
140
|
var e = {
|
|
137
141
|
configurable: !0,
|
|
138
142
|
enumerable: !0,
|
|
139
|
-
value:
|
|
143
|
+
value: ce,
|
|
140
144
|
writable: !0
|
|
141
145
|
};
|
|
142
146
|
Object.defineProperties(console, {
|
|
@@ -152,7 +156,7 @@ function dr() {
|
|
|
152
156
|
F++;
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function Le() {
|
|
156
160
|
{
|
|
157
161
|
if (F--, F === 0) {
|
|
158
162
|
var e = {
|
|
@@ -162,64 +166,64 @@ function dr() {
|
|
|
162
166
|
};
|
|
163
167
|
Object.defineProperties(console, {
|
|
164
168
|
log: k({}, e, {
|
|
165
|
-
value:
|
|
169
|
+
value: ne
|
|
166
170
|
}),
|
|
167
171
|
info: k({}, e, {
|
|
168
|
-
value:
|
|
172
|
+
value: ae
|
|
169
173
|
}),
|
|
170
174
|
warn: k({}, e, {
|
|
171
|
-
value:
|
|
175
|
+
value: ie
|
|
172
176
|
}),
|
|
173
177
|
error: k({}, e, {
|
|
174
|
-
value:
|
|
178
|
+
value: oe
|
|
175
179
|
}),
|
|
176
180
|
group: k({}, e, {
|
|
177
|
-
value:
|
|
181
|
+
value: se
|
|
178
182
|
}),
|
|
179
183
|
groupCollapsed: k({}, e, {
|
|
180
|
-
value:
|
|
184
|
+
value: le
|
|
181
185
|
}),
|
|
182
186
|
groupEnd: k({}, e, {
|
|
183
|
-
value:
|
|
187
|
+
value: ue
|
|
184
188
|
})
|
|
185
189
|
});
|
|
186
190
|
}
|
|
187
|
-
F < 0 &&
|
|
191
|
+
F < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
192
|
}
|
|
189
193
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
194
|
+
var U = C.ReactCurrentDispatcher, B;
|
|
195
|
+
function L(e, r, t) {
|
|
192
196
|
{
|
|
193
|
-
if (
|
|
197
|
+
if (B === void 0)
|
|
194
198
|
try {
|
|
195
199
|
throw Error();
|
|
196
200
|
} catch (o) {
|
|
197
201
|
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
-
|
|
202
|
+
B = n && n[1] || "";
|
|
199
203
|
}
|
|
200
204
|
return `
|
|
201
|
-
` +
|
|
205
|
+
` + B + e;
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
|
-
var
|
|
208
|
+
var J = !1, N;
|
|
205
209
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
210
|
+
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
N = new Ne();
|
|
208
212
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
213
|
+
function fe(e, r) {
|
|
214
|
+
if (!e || J)
|
|
211
215
|
return "";
|
|
212
216
|
{
|
|
213
|
-
var t =
|
|
217
|
+
var t = N.get(e);
|
|
214
218
|
if (t !== void 0)
|
|
215
219
|
return t;
|
|
216
220
|
}
|
|
217
221
|
var n;
|
|
218
|
-
|
|
222
|
+
J = !0;
|
|
219
223
|
var o = Error.prepareStackTrace;
|
|
220
224
|
Error.prepareStackTrace = void 0;
|
|
221
225
|
var s;
|
|
222
|
-
s =
|
|
226
|
+
s = U.current, U.current = null, ze();
|
|
223
227
|
try {
|
|
224
228
|
if (r) {
|
|
225
229
|
var i = function() {
|
|
@@ -265,20 +269,20 @@ function dr() {
|
|
|
265
269
|
if (l--, u--, u < 0 || a[l] !== d[u]) {
|
|
266
270
|
var h = `
|
|
267
271
|
` + a[l].replace(" at new ", " at ");
|
|
268
|
-
return e.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
272
|
+
return e.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, h), h;
|
|
269
273
|
}
|
|
270
274
|
while (l >= 1 && u >= 0);
|
|
271
275
|
break;
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
278
|
} finally {
|
|
275
|
-
|
|
279
|
+
J = !1, U.current = s, Le(), Error.prepareStackTrace = o;
|
|
276
280
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" &&
|
|
281
|
+
var P = e ? e.displayName || e.name : "", T = P ? L(P) : "";
|
|
282
|
+
return typeof e == "function" && N.set(e, T), T;
|
|
279
283
|
}
|
|
280
284
|
function Ve(e, r, t) {
|
|
281
|
-
return
|
|
285
|
+
return fe(e, !1);
|
|
282
286
|
}
|
|
283
287
|
function Me(e) {
|
|
284
288
|
var r = e.prototype;
|
|
@@ -288,20 +292,20 @@ function dr() {
|
|
|
288
292
|
if (e == null)
|
|
289
293
|
return "";
|
|
290
294
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
295
|
+
return fe(e, Me(e));
|
|
292
296
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
297
|
+
return L(e);
|
|
294
298
|
switch (e) {
|
|
295
299
|
case O:
|
|
296
|
-
return
|
|
300
|
+
return L("Suspense");
|
|
297
301
|
case p:
|
|
298
|
-
return
|
|
302
|
+
return L("SuspenseList");
|
|
299
303
|
}
|
|
300
304
|
if (typeof e == "object")
|
|
301
305
|
switch (e.$$typeof) {
|
|
302
|
-
case
|
|
306
|
+
case f:
|
|
303
307
|
return Ve(e.render);
|
|
304
|
-
case
|
|
308
|
+
case y:
|
|
305
309
|
return V(e.type, r, t);
|
|
306
310
|
case w: {
|
|
307
311
|
var n = e, o = n._payload, s = n._init;
|
|
@@ -313,15 +317,15 @@ function dr() {
|
|
|
313
317
|
}
|
|
314
318
|
return "";
|
|
315
319
|
}
|
|
316
|
-
var A = Object.prototype.hasOwnProperty,
|
|
320
|
+
var A = Object.prototype.hasOwnProperty, de = {}, ge = C.ReactDebugCurrentFrame;
|
|
317
321
|
function M(e) {
|
|
318
322
|
if (e) {
|
|
319
323
|
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
320
|
-
|
|
324
|
+
ge.setExtraStackFrame(t);
|
|
321
325
|
} else
|
|
322
|
-
|
|
326
|
+
ge.setExtraStackFrame(null);
|
|
323
327
|
}
|
|
324
|
-
function
|
|
328
|
+
function Ue(e, r, t, n, o) {
|
|
325
329
|
{
|
|
326
330
|
var s = Function.call.bind(A);
|
|
327
331
|
for (var i in e)
|
|
@@ -336,41 +340,42 @@ function dr() {
|
|
|
336
340
|
} catch (l) {
|
|
337
341
|
a = l;
|
|
338
342
|
}
|
|
339
|
-
a && !(a instanceof Error) && (M(o),
|
|
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));
|
|
340
344
|
}
|
|
341
345
|
}
|
|
342
346
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
347
|
+
var Be = Array.isArray;
|
|
348
|
+
function q(e) {
|
|
349
|
+
return Be(e);
|
|
346
350
|
}
|
|
347
|
-
function
|
|
351
|
+
function Je(e) {
|
|
348
352
|
{
|
|
349
353
|
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
354
|
return t;
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
|
-
function
|
|
357
|
+
function qe(e) {
|
|
354
358
|
try {
|
|
355
|
-
return
|
|
359
|
+
return ve(e), !1;
|
|
356
360
|
} catch {
|
|
357
361
|
return !0;
|
|
358
362
|
}
|
|
359
363
|
}
|
|
360
|
-
function
|
|
364
|
+
function ve(e) {
|
|
361
365
|
return "" + e;
|
|
362
366
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
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);
|
|
366
370
|
}
|
|
367
|
-
var
|
|
371
|
+
var W = C.ReactCurrentOwner, Ke = {
|
|
368
372
|
key: !0,
|
|
369
373
|
ref: !0,
|
|
370
374
|
__self: !0,
|
|
371
375
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
|
|
376
|
+
}, he, be, K;
|
|
377
|
+
K = {};
|
|
378
|
+
function Ge(e) {
|
|
374
379
|
if (A.call(e, "ref")) {
|
|
375
380
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
381
|
if (r && r.isReactWarning)
|
|
@@ -378,7 +383,7 @@ function dr() {
|
|
|
378
383
|
}
|
|
379
384
|
return e.ref !== void 0;
|
|
380
385
|
}
|
|
381
|
-
function
|
|
386
|
+
function Xe(e) {
|
|
382
387
|
if (A.call(e, "key")) {
|
|
383
388
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
389
|
if (r && r.isReactWarning)
|
|
@@ -386,13 +391,16 @@ function dr() {
|
|
|
386
391
|
}
|
|
387
392
|
return e.key !== void 0;
|
|
388
393
|
}
|
|
389
|
-
function Xe(e, r) {
|
|
390
|
-
typeof e.ref == "string" && ve.current;
|
|
391
|
-
}
|
|
392
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) {
|
|
393
401
|
{
|
|
394
402
|
var t = function() {
|
|
395
|
-
|
|
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));
|
|
396
404
|
};
|
|
397
405
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
406
|
get: t,
|
|
@@ -400,10 +408,10 @@ function dr() {
|
|
|
400
408
|
});
|
|
401
409
|
}
|
|
402
410
|
}
|
|
403
|
-
function
|
|
411
|
+
function Qe(e, r) {
|
|
404
412
|
{
|
|
405
413
|
var t = function() {
|
|
406
|
-
|
|
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));
|
|
407
415
|
};
|
|
408
416
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
417
|
get: t,
|
|
@@ -411,7 +419,7 @@ function dr() {
|
|
|
411
419
|
});
|
|
412
420
|
}
|
|
413
421
|
}
|
|
414
|
-
var
|
|
422
|
+
var er = function(e, r, t, n, o, s, i) {
|
|
415
423
|
var a = {
|
|
416
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
425
|
$$typeof: v,
|
|
@@ -440,12 +448,12 @@ function dr() {
|
|
|
440
448
|
value: o
|
|
441
449
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
442
450
|
};
|
|
443
|
-
function
|
|
451
|
+
function rr(e, r, t, n, o) {
|
|
444
452
|
{
|
|
445
453
|
var s, i = {}, a = null, d = null;
|
|
446
|
-
t !== void 0 && (
|
|
454
|
+
t !== void 0 && (pe(t), a = "" + t), Xe(r) && (pe(r.key), a = "" + r.key), Ge(r) && (d = r.ref, He(r, o));
|
|
447
455
|
for (s in r)
|
|
448
|
-
A.call(r, s) && !
|
|
456
|
+
A.call(r, s) && !Ke.hasOwnProperty(s) && (i[s] = r[s]);
|
|
449
457
|
if (e && e.defaultProps) {
|
|
450
458
|
var l = e.defaultProps;
|
|
451
459
|
for (s in l)
|
|
@@ -453,28 +461,28 @@ function dr() {
|
|
|
453
461
|
}
|
|
454
462
|
if (a || d) {
|
|
455
463
|
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
-
a &&
|
|
464
|
+
a && Ze(i, u), d && Qe(i, u);
|
|
457
465
|
}
|
|
458
|
-
return
|
|
466
|
+
return er(e, a, d, o, n, W.current, i);
|
|
459
467
|
}
|
|
460
468
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
469
|
+
var G = C.ReactCurrentOwner, me = C.ReactDebugCurrentFrame;
|
|
470
|
+
function j(e) {
|
|
463
471
|
if (e) {
|
|
464
472
|
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
465
|
-
|
|
473
|
+
me.setExtraStackFrame(t);
|
|
466
474
|
} else
|
|
467
|
-
|
|
475
|
+
me.setExtraStackFrame(null);
|
|
468
476
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
477
|
+
var X;
|
|
478
|
+
X = !1;
|
|
479
|
+
function H(e) {
|
|
472
480
|
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
473
481
|
}
|
|
474
|
-
function
|
|
482
|
+
function ye() {
|
|
475
483
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
484
|
+
if (G.current) {
|
|
485
|
+
var e = m(G.current.type);
|
|
478
486
|
if (e)
|
|
479
487
|
return `
|
|
480
488
|
|
|
@@ -483,13 +491,21 @@ Check the render method of \`` + e + "`.";
|
|
|
483
491
|
return "";
|
|
484
492
|
}
|
|
485
493
|
}
|
|
486
|
-
function rr(e) {
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
var ye = {};
|
|
490
494
|
function tr(e) {
|
|
491
495
|
{
|
|
492
|
-
|
|
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();
|
|
493
509
|
if (!r) {
|
|
494
510
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
511
|
t && (r = `
|
|
@@ -499,39 +515,39 @@ Check the top-level render call using <` + t + ">.");
|
|
|
499
515
|
return r;
|
|
500
516
|
}
|
|
501
517
|
}
|
|
502
|
-
function
|
|
518
|
+
function Ee(e, r) {
|
|
503
519
|
{
|
|
504
520
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
521
|
return;
|
|
506
522
|
e._store.validated = !0;
|
|
507
|
-
var t =
|
|
508
|
-
if (
|
|
523
|
+
var t = nr(r);
|
|
524
|
+
if (xe[t])
|
|
509
525
|
return;
|
|
510
|
-
|
|
526
|
+
xe[t] = !0;
|
|
511
527
|
var n = "";
|
|
512
|
-
e && e._owner && e._owner !==
|
|
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);
|
|
513
529
|
}
|
|
514
530
|
}
|
|
515
|
-
function
|
|
531
|
+
function Re(e, r) {
|
|
516
532
|
{
|
|
517
533
|
if (typeof e != "object")
|
|
518
534
|
return;
|
|
519
|
-
if (
|
|
535
|
+
if (q(e))
|
|
520
536
|
for (var t = 0; t < e.length; t++) {
|
|
521
537
|
var n = e[t];
|
|
522
|
-
|
|
538
|
+
H(n) && Ee(n, r);
|
|
523
539
|
}
|
|
524
|
-
else if (
|
|
540
|
+
else if (H(e))
|
|
525
541
|
e._store && (e._store.validated = !0);
|
|
526
542
|
else if (e) {
|
|
527
|
-
var o =
|
|
543
|
+
var o = je(e);
|
|
528
544
|
if (typeof o == "function" && o !== e.entries)
|
|
529
545
|
for (var s = o.call(e), i; !(i = s.next()).done; )
|
|
530
|
-
|
|
546
|
+
H(i.value) && Ee(i.value, r);
|
|
531
547
|
}
|
|
532
548
|
}
|
|
533
549
|
}
|
|
534
|
-
function
|
|
550
|
+
function ar(e) {
|
|
535
551
|
{
|
|
536
552
|
var r = e.type;
|
|
537
553
|
if (r == null || typeof r == "string")
|
|
@@ -539,93 +555,93 @@ Check the top-level render call using <` + t + ">.");
|
|
|
539
555
|
var t;
|
|
540
556
|
if (typeof r == "function")
|
|
541
557
|
t = r.propTypes;
|
|
542
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
543
559
|
// Inner props are checked in the reconciler.
|
|
544
|
-
r.$$typeof ===
|
|
560
|
+
r.$$typeof === y))
|
|
545
561
|
t = r.propTypes;
|
|
546
562
|
else
|
|
547
563
|
return;
|
|
548
564
|
if (t) {
|
|
549
|
-
var n =
|
|
550
|
-
|
|
551
|
-
} else if (r.PropTypes !== void 0 && !
|
|
552
|
-
|
|
553
|
-
var o =
|
|
554
|
-
|
|
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");
|
|
555
571
|
}
|
|
556
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
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.");
|
|
557
573
|
}
|
|
558
574
|
}
|
|
559
|
-
function
|
|
575
|
+
function ir(e) {
|
|
560
576
|
{
|
|
561
577
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
562
578
|
var n = r[t];
|
|
563
579
|
if (n !== "children" && n !== "key") {
|
|
564
|
-
|
|
580
|
+
j(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), j(null);
|
|
565
581
|
break;
|
|
566
582
|
}
|
|
567
583
|
}
|
|
568
|
-
e.ref !== null && (
|
|
584
|
+
e.ref !== null && (j(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
569
585
|
}
|
|
570
586
|
}
|
|
571
587
|
var _e = {};
|
|
572
|
-
function
|
|
588
|
+
function we(e, r, t, n, o, s) {
|
|
573
589
|
{
|
|
574
|
-
var i =
|
|
590
|
+
var i = $e(e);
|
|
575
591
|
if (!i) {
|
|
576
592
|
var a = "";
|
|
577
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.");
|
|
578
|
-
var d =
|
|
579
|
-
d ? a += d : a +=
|
|
594
|
+
var d = tr(o);
|
|
595
|
+
d ? a += d : a += ye();
|
|
580
596
|
var l;
|
|
581
|
-
e === null ? l = "null" :
|
|
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);
|
|
582
598
|
}
|
|
583
|
-
var u =
|
|
599
|
+
var u = rr(e, r, t, o, s);
|
|
584
600
|
if (u == null)
|
|
585
601
|
return u;
|
|
586
602
|
if (i) {
|
|
587
603
|
var h = r.children;
|
|
588
604
|
if (h !== void 0)
|
|
589
605
|
if (n)
|
|
590
|
-
if (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
606
|
+
if (q(h)) {
|
|
607
|
+
for (var P = 0; P < h.length; P++)
|
|
608
|
+
Re(h[P], e);
|
|
593
609
|
Object.freeze && Object.freeze(h);
|
|
594
610
|
} else
|
|
595
|
-
|
|
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.");
|
|
596
612
|
else
|
|
597
|
-
|
|
613
|
+
Re(h, e);
|
|
598
614
|
}
|
|
599
615
|
if (A.call(r, "key")) {
|
|
600
|
-
var T =
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!_e[T +
|
|
604
|
-
var
|
|
605
|
-
|
|
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:
|
|
606
622
|
let props = %s;
|
|
607
623
|
<%s {...props} />
|
|
608
624
|
React keys must be passed directly to JSX without using spread:
|
|
609
625
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
626
|
+
<%s key={someKey} {...props} />`, Z, T, cr, T), _e[T + Z] = !0;
|
|
611
627
|
}
|
|
612
628
|
}
|
|
613
|
-
return e === b ?
|
|
629
|
+
return e === b ? ir(u) : ar(u), u;
|
|
614
630
|
}
|
|
615
631
|
}
|
|
616
|
-
function ir(e, r, t) {
|
|
617
|
-
return Re(e, r, t, !0);
|
|
618
|
-
}
|
|
619
632
|
function or(e, r, t) {
|
|
620
|
-
return
|
|
633
|
+
return we(e, r, t, !0);
|
|
634
|
+
}
|
|
635
|
+
function sr(e, r, t) {
|
|
636
|
+
return we(e, r, t, !1);
|
|
621
637
|
}
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
}()),
|
|
638
|
+
var lr = sr, ur = or;
|
|
639
|
+
$.Fragment = b, $.jsx = lr, $.jsxs = ur;
|
|
640
|
+
}()), $;
|
|
625
641
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var S =
|
|
628
|
-
const
|
|
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");
|
|
629
645
|
:root {
|
|
630
646
|
/* toogle root color */
|
|
631
647
|
--starasia-ui-background-toggle-checked: #1e88e5;
|
|
@@ -807,15 +823,15 @@ input:checked + .starasia-toggle-slider:before {
|
|
|
807
823
|
.starasia-toggle-slider.starasia-toggle-round:before {
|
|
808
824
|
border-radius: 50%;
|
|
809
825
|
}
|
|
810
|
-
`,
|
|
811
|
-
if (!document.getElementById(
|
|
826
|
+
`, Se = "starasia-toggle-styles", pr = (x) => {
|
|
827
|
+
if (!document.getElementById(Se)) {
|
|
812
828
|
const v = document.createElement("style");
|
|
813
|
-
v.id =
|
|
829
|
+
v.id = Se, v.textContent = x, document.head.appendChild(v);
|
|
814
830
|
}
|
|
815
831
|
};
|
|
816
|
-
vr
|
|
817
|
-
const
|
|
818
|
-
const { size: v = "md", label: E, description: b, ...
|
|
832
|
+
pr(vr);
|
|
833
|
+
const br = (x) => {
|
|
834
|
+
const { size: v = "md", label: E, description: b, ...R } = x;
|
|
819
835
|
return /* @__PURE__ */ S.jsxs(
|
|
820
836
|
"div",
|
|
821
837
|
{
|
|
@@ -826,7 +842,7 @@ const hr = (x) => {
|
|
|
826
842
|
{
|
|
827
843
|
className: `starasia-toggle-switch starasia-toggle-switch-${v}`,
|
|
828
844
|
children: [
|
|
829
|
-
/* @__PURE__ */ S.jsx("input", { type: "checkbox", ...
|
|
845
|
+
/* @__PURE__ */ S.jsx("input", { type: "checkbox", ...R }),
|
|
830
846
|
/* @__PURE__ */ S.jsx(
|
|
831
847
|
"span",
|
|
832
848
|
{
|
|
@@ -840,7 +856,7 @@ const hr = (x) => {
|
|
|
840
856
|
E ? /* @__PURE__ */ S.jsx(
|
|
841
857
|
"label",
|
|
842
858
|
{
|
|
843
|
-
htmlFor:
|
|
859
|
+
htmlFor: R.id,
|
|
844
860
|
style: {
|
|
845
861
|
display: "block"
|
|
846
862
|
},
|
|
@@ -854,5 +870,5 @@ const hr = (x) => {
|
|
|
854
870
|
);
|
|
855
871
|
};
|
|
856
872
|
export {
|
|
857
|
-
|
|
873
|
+
br as Toggle
|
|
858
874
|
};
|
package/dist/toggle.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(x,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(x=typeof globalThis<"u"?globalThis:x||self,j(x.Toggle={},x.React))})(this,function(x,j){"use strict";var
|
|
1
|
+
(function(x,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(x=typeof globalThis<"u"?globalThis:x||self,j(x.Toggle={},x.React))})(this,function(x,j){"use strict";var J={exports:{}},A={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
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
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
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
19
|
`),d=n.stack.split(`
|
|
20
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{
|
|
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
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
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
24
|
|
|
25
|
-
Check
|
|
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:
|
|
26
28
|
let props = %s;
|
|
27
29
|
<%s {...props} />
|
|
28
30
|
React keys must be passed directly to JSX without using spread:
|
|
29
31
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
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");
|
|
31
33
|
:root {
|
|
32
34
|
/* toogle root color */
|
|
33
35
|
--starasia-ui-background-toggle-checked: #1e88e5;
|
|
@@ -209,4 +211,4 @@ input:checked + .starasia-toggle-slider:before {
|
|
|
209
211
|
.starasia-toggle-slider.starasia-toggle-round:before {
|
|
210
212
|
border-radius: 50%;
|
|
211
213
|
}
|
|
212
|
-
`,
|
|
214
|
+
`,ae="starasia-toggle-styles";(R=>{if(!document.getElementById(ae)){const v=document.createElement("style");v.id=ae,v.textContent=R,document.head.appendChild(v)}})(De);const Fe=R=>{const{size:v="md",label:_,description:b,...w}=R;return E.jsxs("div",{className:`starasia-toggle-container starasia-toggle-container-${v}`,children:[E.jsxs("label",{className:`starasia-toggle-switch starasia-toggle-switch-${v}`,children:[E.jsx("input",{type:"checkbox",...w}),E.jsx("span",{className:`starasia-toggle-slider starasia-toggle-round starasia-toggle-${v}`})]}),_||b?E.jsxs("div",{children:[_?E.jsx("label",{htmlFor:w.id,style:{display:"block"},children:_}):null,b?E.jsx("p",{children:b}):null]}):null]})};x.Toggle=Fe,Object.defineProperty(x,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.1",
|
|
4
4
|
"description": "toggle component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/toggle.umd.js",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18.0.0"
|
|
24
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": ">=18.0.0 <20.0.0",
|
|
27
|
+
"react-dom": ">=18.0.0 <20.0.0"
|
|
28
|
+
},
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"@types/node": "^20.11.16",
|
|
27
31
|
"@vitejs/plugin-react": "^4.2.1",
|