@starasia/tabs 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/tabs.es.js +87 -728
- package/dist/tabs.umd.js +2 -33
- package/package.json +6 -6
package/dist/tabs.es.js
CHANGED
|
@@ -1,647 +1,6 @@
|
|
|
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 jr;
|
|
13
|
-
function ya() {
|
|
14
|
-
if (jr)
|
|
15
|
-
return B;
|
|
16
|
-
jr = 1;
|
|
17
|
-
var g = Dr, c = Symbol.for("react.element"), t = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, T = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function y(x, f, R) {
|
|
19
|
-
var b, _ = {}, w = null, k = null;
|
|
20
|
-
R !== void 0 && (w = "" + R), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (k = f.ref);
|
|
21
|
-
for (b in f)
|
|
22
|
-
u.call(f, b) && !h.hasOwnProperty(b) && (_[b] = f[b]);
|
|
23
|
-
if (x && x.defaultProps)
|
|
24
|
-
for (b in f = x.defaultProps, f)
|
|
25
|
-
_[b] === void 0 && (_[b] = f[b]);
|
|
26
|
-
return { $$typeof: c, type: x, key: w, ref: k, props: _, _owner: T.current };
|
|
27
|
-
}
|
|
28
|
-
return B.Fragment = t, B.jsx = y, B.jsxs = y, B;
|
|
29
|
-
}
|
|
30
|
-
var z = {};
|
|
31
|
-
/**
|
|
32
|
-
* @license React
|
|
33
|
-
* react-jsx-runtime.development.js
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var kr;
|
|
41
|
-
function ma() {
|
|
42
|
-
return kr || (kr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var g = Dr, c = Symbol.for("react.element"), t = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), x = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), N = Symbol.iterator, Fr = "@@iterator";
|
|
44
|
-
function $r(r) {
|
|
45
|
-
if (r === null || typeof r != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var a = N && r[N] || r[Fr];
|
|
48
|
-
return typeof a == "function" ? a : null;
|
|
49
|
-
}
|
|
50
|
-
var A = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function p(r) {
|
|
52
|
-
{
|
|
53
|
-
for (var a = arguments.length, e = new Array(a > 1 ? a - 1 : 0), n = 1; n < a; n++)
|
|
54
|
-
e[n - 1] = arguments[n];
|
|
55
|
-
Ir("error", r, e);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function Ir(r, a, e) {
|
|
59
|
-
{
|
|
60
|
-
var n = A.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
61
|
-
o !== "" && (a += "%s", e = e.concat([o]));
|
|
62
|
-
var l = e.map(function(s) {
|
|
63
|
-
return String(s);
|
|
64
|
-
});
|
|
65
|
-
l.unshift("Warning: " + a), Function.prototype.apply.call(console[r], console, l);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var Wr = !1, Br = !1, zr = !1, Yr = !1, Lr = !1, sr;
|
|
69
|
-
sr = Symbol.for("react.module.reference");
|
|
70
|
-
function Nr(r) {
|
|
71
|
-
return !!(typeof r == "string" || typeof r == "function" || r === u || r === h || Lr || r === T || r === R || r === b || Yr || r === k || Wr || Br || zr || typeof r == "object" && r !== null && (r.$$typeof === w || r.$$typeof === _ || r.$$typeof === y || r.$$typeof === x || r.$$typeof === f || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
r.$$typeof === sr || r.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function Vr(r, a, e) {
|
|
78
|
-
var n = r.displayName;
|
|
79
|
-
if (n)
|
|
80
|
-
return n;
|
|
81
|
-
var o = a.displayName || a.name || "";
|
|
82
|
-
return o !== "" ? e + "(" + o + ")" : e;
|
|
83
|
-
}
|
|
84
|
-
function or(r) {
|
|
85
|
-
return r.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function S(r) {
|
|
88
|
-
if (r == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof r.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
91
|
-
return r.displayName || r.name || null;
|
|
92
|
-
if (typeof r == "string")
|
|
93
|
-
return r;
|
|
94
|
-
switch (r) {
|
|
95
|
-
case u:
|
|
96
|
-
return "Fragment";
|
|
97
|
-
case t:
|
|
98
|
-
return "Portal";
|
|
99
|
-
case h:
|
|
100
|
-
return "Profiler";
|
|
101
|
-
case T:
|
|
102
|
-
return "StrictMode";
|
|
103
|
-
case R:
|
|
104
|
-
return "Suspense";
|
|
105
|
-
case b:
|
|
106
|
-
return "SuspenseList";
|
|
107
|
-
}
|
|
108
|
-
if (typeof r == "object")
|
|
109
|
-
switch (r.$$typeof) {
|
|
110
|
-
case x:
|
|
111
|
-
var a = r;
|
|
112
|
-
return or(a) + ".Consumer";
|
|
113
|
-
case y:
|
|
114
|
-
var e = r;
|
|
115
|
-
return or(e._context) + ".Provider";
|
|
116
|
-
case f:
|
|
117
|
-
return Vr(r, r.render, "ForwardRef");
|
|
118
|
-
case _:
|
|
119
|
-
var n = r.displayName || null;
|
|
120
|
-
return n !== null ? n : S(r.type) || "Memo";
|
|
121
|
-
case w: {
|
|
122
|
-
var o = r, l = o._payload, s = o._init;
|
|
123
|
-
try {
|
|
124
|
-
return S(s(l));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var P = Object.assign, $ = 0, ur, lr, cr, fr, dr, vr, br;
|
|
133
|
-
function pr() {
|
|
134
|
-
}
|
|
135
|
-
pr.__reactDisabledLog = !0;
|
|
136
|
-
function Mr() {
|
|
137
|
-
{
|
|
138
|
-
if ($ === 0) {
|
|
139
|
-
ur = console.log, lr = console.info, cr = console.warn, fr = console.error, dr = console.group, vr = console.groupCollapsed, br = console.groupEnd;
|
|
140
|
-
var r = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: pr,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: r,
|
|
148
|
-
log: r,
|
|
149
|
-
warn: r,
|
|
150
|
-
error: r,
|
|
151
|
-
group: r,
|
|
152
|
-
groupCollapsed: r,
|
|
153
|
-
groupEnd: r
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
$++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function Ur() {
|
|
160
|
-
{
|
|
161
|
-
if ($--, $ === 0) {
|
|
162
|
-
var r = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: P({}, r, {
|
|
169
|
-
value: ur
|
|
170
|
-
}),
|
|
171
|
-
info: P({}, r, {
|
|
172
|
-
value: lr
|
|
173
|
-
}),
|
|
174
|
-
warn: P({}, r, {
|
|
175
|
-
value: cr
|
|
176
|
-
}),
|
|
177
|
-
error: P({}, r, {
|
|
178
|
-
value: fr
|
|
179
|
-
}),
|
|
180
|
-
group: P({}, r, {
|
|
181
|
-
value: dr
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: P({}, r, {
|
|
184
|
-
value: vr
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: P({}, r, {
|
|
187
|
-
value: br
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
$ < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var K = A.ReactCurrentDispatcher, G;
|
|
195
|
-
function V(r, a, e) {
|
|
196
|
-
{
|
|
197
|
-
if (G === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (o) {
|
|
201
|
-
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
G = n && n[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + G + r;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var X = !1, M;
|
|
209
|
-
{
|
|
210
|
-
var Jr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
M = new Jr();
|
|
212
|
-
}
|
|
213
|
-
function gr(r, a) {
|
|
214
|
-
if (!r || X)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var e = M.get(r);
|
|
218
|
-
if (e !== void 0)
|
|
219
|
-
return e;
|
|
220
|
-
}
|
|
221
|
-
var n;
|
|
222
|
-
X = !0;
|
|
223
|
-
var o = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var l;
|
|
226
|
-
l = K.current, K.current = null, Mr();
|
|
227
|
-
try {
|
|
228
|
-
if (a) {
|
|
229
|
-
var s = function() {
|
|
230
|
-
throw Error();
|
|
231
|
-
};
|
|
232
|
-
if (Object.defineProperty(s.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(s, []);
|
|
239
|
-
} catch (E) {
|
|
240
|
-
n = E;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(r, [], s);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
s.call();
|
|
246
|
-
} catch (E) {
|
|
247
|
-
n = E;
|
|
248
|
-
}
|
|
249
|
-
r.call(s.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (E) {
|
|
255
|
-
n = E;
|
|
256
|
-
}
|
|
257
|
-
r();
|
|
258
|
-
}
|
|
259
|
-
} catch (E) {
|
|
260
|
-
if (E && n && typeof E.stack == "string") {
|
|
261
|
-
for (var i = E.stack.split(`
|
|
262
|
-
`), m = n.stack.split(`
|
|
263
|
-
`), d = i.length - 1, v = m.length - 1; d >= 1 && v >= 0 && i[d] !== m[v]; )
|
|
264
|
-
v--;
|
|
265
|
-
for (; d >= 1 && v >= 0; d--, v--)
|
|
266
|
-
if (i[d] !== m[v]) {
|
|
267
|
-
if (d !== 1 || v !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (d--, v--, v < 0 || i[d] !== m[v]) {
|
|
270
|
-
var C = `
|
|
271
|
-
` + i[d].replace(" at new ", " at ");
|
|
272
|
-
return r.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", r.displayName)), typeof r == "function" && M.set(r, C), C;
|
|
273
|
-
}
|
|
274
|
-
while (d >= 1 && v >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
X = !1, K.current = l, Ur(), Error.prepareStackTrace = o;
|
|
280
|
-
}
|
|
281
|
-
var F = r ? r.displayName || r.name : "", O = F ? V(F) : "";
|
|
282
|
-
return typeof r == "function" && M.set(r, O), O;
|
|
283
|
-
}
|
|
284
|
-
function qr(r, a, e) {
|
|
285
|
-
return gr(r, !1);
|
|
286
|
-
}
|
|
287
|
-
function Kr(r) {
|
|
288
|
-
var a = r.prototype;
|
|
289
|
-
return !!(a && a.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function U(r, a, e) {
|
|
292
|
-
if (r == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof r == "function")
|
|
295
|
-
return gr(r, Kr(r));
|
|
296
|
-
if (typeof r == "string")
|
|
297
|
-
return V(r);
|
|
298
|
-
switch (r) {
|
|
299
|
-
case R:
|
|
300
|
-
return V("Suspense");
|
|
301
|
-
case b:
|
|
302
|
-
return V("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof r == "object")
|
|
305
|
-
switch (r.$$typeof) {
|
|
306
|
-
case f:
|
|
307
|
-
return qr(r.render);
|
|
308
|
-
case _:
|
|
309
|
-
return U(r.type, a, e);
|
|
310
|
-
case w: {
|
|
311
|
-
var n = r, o = n._payload, l = n._init;
|
|
312
|
-
try {
|
|
313
|
-
return U(l(o), a, e);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var I = Object.prototype.hasOwnProperty, hr = {}, yr = A.ReactDebugCurrentFrame;
|
|
321
|
-
function J(r) {
|
|
322
|
-
if (r) {
|
|
323
|
-
var a = r._owner, e = U(r.type, r._source, a ? a.type : null);
|
|
324
|
-
yr.setExtraStackFrame(e);
|
|
325
|
-
} else
|
|
326
|
-
yr.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function Gr(r, a, e, n, o) {
|
|
329
|
-
{
|
|
330
|
-
var l = Function.call.bind(I);
|
|
331
|
-
for (var s in r)
|
|
332
|
-
if (l(r, s)) {
|
|
333
|
-
var i = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof r[s] != "function") {
|
|
336
|
-
var m = Error((n || "React class") + ": " + e + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw m.name = "Invariant Violation", m;
|
|
338
|
-
}
|
|
339
|
-
i = r[s](a, s, n, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (d) {
|
|
341
|
-
i = d;
|
|
342
|
-
}
|
|
343
|
-
i && !(i instanceof Error) && (J(o), p("%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", e, s, typeof i), J(null)), i instanceof Error && !(i.message in hr) && (hr[i.message] = !0, J(o), p("Failed %s type: %s", e, i.message), J(null));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
var Xr = Array.isArray;
|
|
348
|
-
function H(r) {
|
|
349
|
-
return Xr(r);
|
|
350
|
-
}
|
|
351
|
-
function Hr(r) {
|
|
352
|
-
{
|
|
353
|
-
var a = typeof Symbol == "function" && Symbol.toStringTag, e = a && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
354
|
-
return e;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function Zr(r) {
|
|
358
|
-
try {
|
|
359
|
-
return mr(r), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function mr(r) {
|
|
365
|
-
return "" + r;
|
|
366
|
-
}
|
|
367
|
-
function Er(r) {
|
|
368
|
-
if (Zr(r))
|
|
369
|
-
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Hr(r)), mr(r);
|
|
370
|
-
}
|
|
371
|
-
var W = A.ReactCurrentOwner, Qr = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, Rr, _r, Z;
|
|
377
|
-
Z = {};
|
|
378
|
-
function ra(r) {
|
|
379
|
-
if (I.call(r, "ref")) {
|
|
380
|
-
var a = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
381
|
-
if (a && a.isReactWarning)
|
|
382
|
-
return !1;
|
|
383
|
-
}
|
|
384
|
-
return r.ref !== void 0;
|
|
385
|
-
}
|
|
386
|
-
function aa(r) {
|
|
387
|
-
if (I.call(r, "key")) {
|
|
388
|
-
var a = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
389
|
-
if (a && a.isReactWarning)
|
|
390
|
-
return !1;
|
|
391
|
-
}
|
|
392
|
-
return r.key !== void 0;
|
|
393
|
-
}
|
|
394
|
-
function ea(r, a) {
|
|
395
|
-
if (typeof r.ref == "string" && W.current && a && W.current.stateNode !== a) {
|
|
396
|
-
var e = S(W.current.type);
|
|
397
|
-
Z[e] || (p('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', S(W.current.type), r.ref), Z[e] = !0);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function ta(r, a) {
|
|
401
|
-
{
|
|
402
|
-
var e = function() {
|
|
403
|
-
Rr || (Rr = !0, p("%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)", a));
|
|
404
|
-
};
|
|
405
|
-
e.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
406
|
-
get: e,
|
|
407
|
-
configurable: !0
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function na(r, a) {
|
|
412
|
-
{
|
|
413
|
-
var e = function() {
|
|
414
|
-
_r || (_r = !0, p("%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)", a));
|
|
415
|
-
};
|
|
416
|
-
e.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
417
|
-
get: e,
|
|
418
|
-
configurable: !0
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
var ia = function(r, a, e, n, o, l, s) {
|
|
423
|
-
var i = {
|
|
424
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
-
$$typeof: c,
|
|
426
|
-
// Built-in properties that belong on the element
|
|
427
|
-
type: r,
|
|
428
|
-
key: a,
|
|
429
|
-
ref: e,
|
|
430
|
-
props: s,
|
|
431
|
-
// Record the component responsible for creating this element.
|
|
432
|
-
_owner: l
|
|
433
|
-
};
|
|
434
|
-
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
435
|
-
configurable: !1,
|
|
436
|
-
enumerable: !1,
|
|
437
|
-
writable: !0,
|
|
438
|
-
value: !1
|
|
439
|
-
}), Object.defineProperty(i, "_self", {
|
|
440
|
-
configurable: !1,
|
|
441
|
-
enumerable: !1,
|
|
442
|
-
writable: !1,
|
|
443
|
-
value: n
|
|
444
|
-
}), Object.defineProperty(i, "_source", {
|
|
445
|
-
configurable: !1,
|
|
446
|
-
enumerable: !1,
|
|
447
|
-
writable: !1,
|
|
448
|
-
value: o
|
|
449
|
-
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
450
|
-
};
|
|
451
|
-
function sa(r, a, e, n, o) {
|
|
452
|
-
{
|
|
453
|
-
var l, s = {}, i = null, m = null;
|
|
454
|
-
e !== void 0 && (Er(e), i = "" + e), aa(a) && (Er(a.key), i = "" + a.key), ra(a) && (m = a.ref, ea(a, o));
|
|
455
|
-
for (l in a)
|
|
456
|
-
I.call(a, l) && !Qr.hasOwnProperty(l) && (s[l] = a[l]);
|
|
457
|
-
if (r && r.defaultProps) {
|
|
458
|
-
var d = r.defaultProps;
|
|
459
|
-
for (l in d)
|
|
460
|
-
s[l] === void 0 && (s[l] = d[l]);
|
|
461
|
-
}
|
|
462
|
-
if (i || m) {
|
|
463
|
-
var v = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
464
|
-
i && ta(s, v), m && na(s, v);
|
|
465
|
-
}
|
|
466
|
-
return ia(r, i, m, o, n, W.current, s);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
var Q = A.ReactCurrentOwner, Tr = A.ReactDebugCurrentFrame;
|
|
470
|
-
function D(r) {
|
|
471
|
-
if (r) {
|
|
472
|
-
var a = r._owner, e = U(r.type, r._source, a ? a.type : null);
|
|
473
|
-
Tr.setExtraStackFrame(e);
|
|
474
|
-
} else
|
|
475
|
-
Tr.setExtraStackFrame(null);
|
|
476
|
-
}
|
|
477
|
-
var rr;
|
|
478
|
-
rr = !1;
|
|
479
|
-
function ar(r) {
|
|
480
|
-
return typeof r == "object" && r !== null && r.$$typeof === c;
|
|
481
|
-
}
|
|
482
|
-
function xr() {
|
|
483
|
-
{
|
|
484
|
-
if (Q.current) {
|
|
485
|
-
var r = S(Q.current.type);
|
|
486
|
-
if (r)
|
|
487
|
-
return `
|
|
488
|
-
|
|
489
|
-
Check the render method of \`` + r + "`.";
|
|
490
|
-
}
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function oa(r) {
|
|
495
|
-
{
|
|
496
|
-
if (r !== void 0) {
|
|
497
|
-
var a = r.fileName.replace(/^.*[\\\/]/, ""), e = r.lineNumber;
|
|
498
|
-
return `
|
|
499
|
-
|
|
500
|
-
Check your code at ` + a + ":" + e + ".";
|
|
501
|
-
}
|
|
502
|
-
return "";
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
var Cr = {};
|
|
506
|
-
function ua(r) {
|
|
507
|
-
{
|
|
508
|
-
var a = xr();
|
|
509
|
-
if (!a) {
|
|
510
|
-
var e = typeof r == "string" ? r : r.displayName || r.name;
|
|
511
|
-
e && (a = `
|
|
512
|
-
|
|
513
|
-
Check the top-level render call using <` + e + ">.");
|
|
514
|
-
}
|
|
515
|
-
return a;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
function Sr(r, a) {
|
|
519
|
-
{
|
|
520
|
-
if (!r._store || r._store.validated || r.key != null)
|
|
521
|
-
return;
|
|
522
|
-
r._store.validated = !0;
|
|
523
|
-
var e = ua(a);
|
|
524
|
-
if (Cr[e])
|
|
525
|
-
return;
|
|
526
|
-
Cr[e] = !0;
|
|
527
|
-
var n = "";
|
|
528
|
-
r && r._owner && r._owner !== Q.current && (n = " It was passed a child from " + S(r._owner.type) + "."), D(r), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', e, n), D(null);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function wr(r, a) {
|
|
532
|
-
{
|
|
533
|
-
if (typeof r != "object")
|
|
534
|
-
return;
|
|
535
|
-
if (H(r))
|
|
536
|
-
for (var e = 0; e < r.length; e++) {
|
|
537
|
-
var n = r[e];
|
|
538
|
-
ar(n) && Sr(n, a);
|
|
539
|
-
}
|
|
540
|
-
else if (ar(r))
|
|
541
|
-
r._store && (r._store.validated = !0);
|
|
542
|
-
else if (r) {
|
|
543
|
-
var o = $r(r);
|
|
544
|
-
if (typeof o == "function" && o !== r.entries)
|
|
545
|
-
for (var l = o.call(r), s; !(s = l.next()).done; )
|
|
546
|
-
ar(s.value) && Sr(s.value, a);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
function la(r) {
|
|
551
|
-
{
|
|
552
|
-
var a = r.type;
|
|
553
|
-
if (a == null || typeof a == "string")
|
|
554
|
-
return;
|
|
555
|
-
var e;
|
|
556
|
-
if (typeof a == "function")
|
|
557
|
-
e = a.propTypes;
|
|
558
|
-
else if (typeof a == "object" && (a.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
|
-
// Inner props are checked in the reconciler.
|
|
560
|
-
a.$$typeof === _))
|
|
561
|
-
e = a.propTypes;
|
|
562
|
-
else
|
|
563
|
-
return;
|
|
564
|
-
if (e) {
|
|
565
|
-
var n = S(a);
|
|
566
|
-
Gr(e, r.props, "prop", n, r);
|
|
567
|
-
} else if (a.PropTypes !== void 0 && !rr) {
|
|
568
|
-
rr = !0;
|
|
569
|
-
var o = S(a);
|
|
570
|
-
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
571
|
-
}
|
|
572
|
-
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function ca(r) {
|
|
576
|
-
{
|
|
577
|
-
for (var a = Object.keys(r.props), e = 0; e < a.length; e++) {
|
|
578
|
-
var n = a[e];
|
|
579
|
-
if (n !== "children" && n !== "key") {
|
|
580
|
-
D(r), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
581
|
-
break;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
r.ref !== null && (D(r), p("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
var Pr = {};
|
|
588
|
-
function Or(r, a, e, n, o, l) {
|
|
589
|
-
{
|
|
590
|
-
var s = Nr(r);
|
|
591
|
-
if (!s) {
|
|
592
|
-
var i = "";
|
|
593
|
-
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (i += " 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 m = oa(o);
|
|
595
|
-
m ? i += m : i += xr();
|
|
596
|
-
var d;
|
|
597
|
-
r === null ? d = "null" : H(r) ? d = "array" : r !== void 0 && r.$$typeof === c ? (d = "<" + (S(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : d = typeof r, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, i);
|
|
598
|
-
}
|
|
599
|
-
var v = sa(r, a, e, o, l);
|
|
600
|
-
if (v == null)
|
|
601
|
-
return v;
|
|
602
|
-
if (s) {
|
|
603
|
-
var C = a.children;
|
|
604
|
-
if (C !== void 0)
|
|
605
|
-
if (n)
|
|
606
|
-
if (H(C)) {
|
|
607
|
-
for (var F = 0; F < C.length; F++)
|
|
608
|
-
wr(C[F], r);
|
|
609
|
-
Object.freeze && Object.freeze(C);
|
|
610
|
-
} else
|
|
611
|
-
p("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
|
-
wr(C, r);
|
|
614
|
-
}
|
|
615
|
-
if (I.call(a, "key")) {
|
|
616
|
-
var O = S(r), E = Object.keys(a).filter(function(ga) {
|
|
617
|
-
return ga !== "key";
|
|
618
|
-
}), er = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
-
if (!Pr[O + er]) {
|
|
620
|
-
var pa = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
-
p(`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} />`, er, O, pa, O), Pr[O + er] = !0;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
return r === u ? ca(v) : la(v), v;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function fa(r, a, e) {
|
|
633
|
-
return Or(r, a, e, !0);
|
|
634
|
-
}
|
|
635
|
-
function da(r, a, e) {
|
|
636
|
-
return Or(r, a, e, !1);
|
|
637
|
-
}
|
|
638
|
-
var va = da, ba = fa;
|
|
639
|
-
z.Fragment = u, z.jsx = va, z.jsxs = ba;
|
|
640
|
-
}()), z;
|
|
641
|
-
}
|
|
642
|
-
process.env.NODE_ENV === "production" ? tr.exports = ya() : tr.exports = ma();
|
|
643
|
-
var j = tr.exports;
|
|
644
|
-
const Ea = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
1
|
+
import { jsx as l, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as B, useState as u, useEffect as c, useContext as f, useRef as m } from "react";
|
|
3
|
+
const T = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
4
|
|
|
646
5
|
:root {
|
|
647
6
|
/* border width */
|
|
@@ -809,126 +168,126 @@ const Ea = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
809
168
|
height: 42px;
|
|
810
169
|
font-size: var(--starasia-ui-tabs-font-size-lg);
|
|
811
170
|
}
|
|
812
|
-
`,
|
|
813
|
-
if (!document.getElementById(
|
|
814
|
-
const
|
|
815
|
-
|
|
171
|
+
`, h = "starasia-tab-styles", k = (n) => {
|
|
172
|
+
if (!document.getElementById(h)) {
|
|
173
|
+
const s = document.createElement("style");
|
|
174
|
+
s.id = h, s.textContent = n, document.head.appendChild(s);
|
|
816
175
|
}
|
|
817
176
|
};
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
children:
|
|
821
|
-
activeTab:
|
|
822
|
-
size:
|
|
823
|
-
variant:
|
|
824
|
-
...
|
|
177
|
+
k(T);
|
|
178
|
+
const v = B(null), S = ({
|
|
179
|
+
children: n,
|
|
180
|
+
activeTab: s,
|
|
181
|
+
size: a = "md",
|
|
182
|
+
variant: t = "underline",
|
|
183
|
+
...e
|
|
825
184
|
}) => {
|
|
826
|
-
const [
|
|
185
|
+
const [i, r] = u(0), [d, b] = u(
|
|
827
186
|
null
|
|
828
|
-
), [
|
|
829
|
-
|
|
187
|
+
), [o, p] = u([]), [g, y] = u([]), x = (z) => {
|
|
188
|
+
b(z);
|
|
830
189
|
};
|
|
831
|
-
return
|
|
832
|
-
|
|
833
|
-
}, [
|
|
834
|
-
|
|
835
|
-
}, [
|
|
836
|
-
|
|
190
|
+
return c(() => {
|
|
191
|
+
b(o[s || 0]);
|
|
192
|
+
}, [o, s]), c(() => {
|
|
193
|
+
r(s || 0);
|
|
194
|
+
}, [s]), /* @__PURE__ */ l(
|
|
195
|
+
v.Provider,
|
|
837
196
|
{
|
|
838
197
|
value: {
|
|
839
|
-
activeContext:
|
|
840
|
-
handleSetActiveContext:
|
|
841
|
-
tabsButton:
|
|
842
|
-
setTabsButton:
|
|
843
|
-
activeTabButton:
|
|
844
|
-
setActiveTabButton:
|
|
845
|
-
panels:
|
|
846
|
-
setPanels:
|
|
847
|
-
size:
|
|
848
|
-
variant:
|
|
198
|
+
activeContext: d,
|
|
199
|
+
handleSetActiveContext: x,
|
|
200
|
+
tabsButton: o,
|
|
201
|
+
setTabsButton: p,
|
|
202
|
+
activeTabButton: i,
|
|
203
|
+
setActiveTabButton: r,
|
|
204
|
+
panels: g,
|
|
205
|
+
setPanels: y,
|
|
206
|
+
size: a,
|
|
207
|
+
variant: t
|
|
849
208
|
},
|
|
850
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ l("div", { ...e, children: n })
|
|
851
210
|
}
|
|
852
211
|
);
|
|
853
|
-
},
|
|
854
|
-
var
|
|
855
|
-
const
|
|
856
|
-
let
|
|
857
|
-
return
|
|
858
|
-
var
|
|
859
|
-
if (
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
}, [
|
|
212
|
+
}, $ = ({ children: n, ...s }) => {
|
|
213
|
+
var d;
|
|
214
|
+
const a = f(v), t = m(null), [e, i] = u(0);
|
|
215
|
+
let r = ((d = a == null ? void 0 : a.activeContext) == null ? void 0 : d.getBoundingClientRect().width) || 0;
|
|
216
|
+
return c(() => {
|
|
217
|
+
var b, o;
|
|
218
|
+
if (t.current) {
|
|
219
|
+
const p = ((b = a == null ? void 0 : a.activeContext) == null ? void 0 : b.getBoundingClientRect().left) || 0, g = ((o = t == null ? void 0 : t.current) == null ? void 0 : o.getBoundingClientRect().left) || 0;
|
|
220
|
+
i(p - g);
|
|
221
|
+
}
|
|
222
|
+
}, [t, a == null ? void 0 : a.activeContext]), /* @__PURE__ */ C(
|
|
864
223
|
"div",
|
|
865
224
|
{
|
|
866
|
-
className: `starasia-tabs-tablist starasia-tabs-tablist-${
|
|
867
|
-
...
|
|
868
|
-
ref:
|
|
225
|
+
className: `starasia-tabs-tablist starasia-tabs-tablist-${a == null ? void 0 : a.variant}`,
|
|
226
|
+
...s,
|
|
227
|
+
ref: t,
|
|
869
228
|
children: [
|
|
870
|
-
|
|
871
|
-
/* @__PURE__ */
|
|
229
|
+
n,
|
|
230
|
+
/* @__PURE__ */ l(
|
|
872
231
|
"div",
|
|
873
232
|
{
|
|
874
|
-
className: `starasia-tabs-tablist-line-move starasia-tabs-tablist-line-move-${
|
|
875
|
-
style: { width: `${
|
|
233
|
+
className: `starasia-tabs-tablist-line-move starasia-tabs-tablist-line-move-${a == null ? void 0 : a.variant}`,
|
|
234
|
+
style: { width: `${r}px`, left: `${e}px` }
|
|
876
235
|
}
|
|
877
236
|
)
|
|
878
237
|
]
|
|
879
238
|
}
|
|
880
239
|
);
|
|
881
|
-
},
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
...
|
|
886
|
-
|
|
240
|
+
}, A = ({ children: n, ...s }) => {
|
|
241
|
+
const a = f(v), t = m(null);
|
|
242
|
+
c(() => {
|
|
243
|
+
t.current && (a == null || a.setTabsButton((i) => [
|
|
244
|
+
...i,
|
|
245
|
+
t.current
|
|
887
246
|
]));
|
|
888
|
-
}, [
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
for (let
|
|
892
|
-
|
|
247
|
+
}, [t]);
|
|
248
|
+
const e = (i) => {
|
|
249
|
+
if (a == null || a.handleSetActiveContext(i.currentTarget), a != null && a.tabsButton)
|
|
250
|
+
for (let r = 0; r < a.tabsButton.length; r++)
|
|
251
|
+
a.tabsButton[r] === i.currentTarget && a.setActiveTabButton(r);
|
|
893
252
|
};
|
|
894
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ l(
|
|
895
254
|
"button",
|
|
896
255
|
{
|
|
897
|
-
className: `starasia-tabs-tab starasia-tabs-tab-${
|
|
898
|
-
onClick: (
|
|
899
|
-
|
|
256
|
+
className: `starasia-tabs-tab starasia-tabs-tab-${a == null ? void 0 : a.size} starasia-tabs-tab-${a == null ? void 0 : a.variant} ${(a == null ? void 0 : a.tabsButton[a.activeTabButton]) === t.current ? `starasia-tabs-tab-${a == null ? void 0 : a.variant}-active` : ""}`,
|
|
257
|
+
onClick: (i) => {
|
|
258
|
+
e(i), s.onClick && s.onClick();
|
|
900
259
|
},
|
|
901
|
-
ref:
|
|
260
|
+
ref: t,
|
|
902
261
|
style: {
|
|
903
|
-
fontWeight: (
|
|
904
|
-
...
|
|
262
|
+
fontWeight: (a == null ? void 0 : a.tabsButton[a.activeTabButton]) === t.current ? "var(--starasia-ui-fontWeights-medium, 400)" : "var(--starasia-ui-fontWeights-normal, 300)",
|
|
263
|
+
...s.style
|
|
905
264
|
},
|
|
906
|
-
children:
|
|
265
|
+
children: n
|
|
907
266
|
}
|
|
908
267
|
);
|
|
909
|
-
},
|
|
910
|
-
const
|
|
911
|
-
return
|
|
912
|
-
|
|
913
|
-
...
|
|
914
|
-
|
|
268
|
+
}, R = ({ children: n, ...s }) => /* @__PURE__ */ l("div", { ...s, children: n }), E = ({ children: n, ...s }) => {
|
|
269
|
+
const a = f(v), t = m(null);
|
|
270
|
+
return c(() => {
|
|
271
|
+
t.current && (a == null || a.setPanels((e) => [
|
|
272
|
+
...e,
|
|
273
|
+
t.current
|
|
915
274
|
]));
|
|
916
|
-
}, [
|
|
275
|
+
}, [t]), /* @__PURE__ */ l(
|
|
917
276
|
"div",
|
|
918
277
|
{
|
|
919
|
-
ref:
|
|
278
|
+
ref: t,
|
|
920
279
|
style: {
|
|
921
|
-
display: (
|
|
922
|
-
...
|
|
280
|
+
display: (a == null ? void 0 : a.panels[a.activeTabButton]) === t.current ? "block" : "none",
|
|
281
|
+
...s.style
|
|
923
282
|
},
|
|
924
|
-
children: (
|
|
283
|
+
children: (a == null ? void 0 : a.panels[a.activeTabButton]) === t.current ? n : null
|
|
925
284
|
}
|
|
926
285
|
);
|
|
927
286
|
};
|
|
928
287
|
export {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
288
|
+
A as Tab,
|
|
289
|
+
E as TabPanel,
|
|
290
|
+
R as TabPanels,
|
|
291
|
+
S as Tabs,
|
|
292
|
+
$ as TabsLists
|
|
934
293
|
};
|
package/dist/tabs.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 na;function ka(){if(na)return B;na=1;var h=f,c=Symbol.for("react.element"),t=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,C=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function m(x,d,_){var p,T={},O=null,D=null;_!==void 0&&(O=""+_),d.key!==void 0&&(O=""+d.key),d.ref!==void 0&&(D=d.ref);for(p in d)u.call(d,p)&&!y.hasOwnProperty(p)&&(T[p]=d[p]);if(x&&x.defaultProps)for(p in d=x.defaultProps,d)T[p]===void 0&&(T[p]=d[p]);return{$$typeof:c,type:x,key:O,ref:D,props:T,_owner:C.current}}return B.Fragment=t,B.jsx=m,B.jsxs=m,B}var z={};/**
|
|
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 sa;function Aa(){return sa||(sa=1,process.env.NODE_ENV!=="production"&&function(){var h=f,c=Symbol.for("react.element"),t=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),x=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),V=Symbol.iterator,Ya="@@iterator";function La(a){if(a===null||typeof a!="object")return null;var e=V&&a[V]||a[Ya];return typeof e=="function"?e:null}var F=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(a){{for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];Na("error",a,r)}}function Na(a,e,r){{var n=F.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(e+="%s",r=r.concat([o]));var l=r.map(function(i){return String(i)});l.unshift("Warning: "+e),Function.prototype.apply.call(console[a],console,l)}}var Ma=!1,Va=!1,Ua=!1,Ja=!1,Ka=!1,oa;oa=Symbol.for("react.module.reference");function Ga(a){return!!(typeof a=="string"||typeof a=="function"||a===u||a===y||Ka||a===C||a===_||a===p||Ja||a===D||Ma||Va||Ua||typeof a=="object"&&a!==null&&(a.$$typeof===O||a.$$typeof===T||a.$$typeof===m||a.$$typeof===x||a.$$typeof===d||a.$$typeof===oa||a.getModuleId!==void 0))}function Xa(a,e,r){var n=a.displayName;if(n)return n;var o=e.displayName||e.name||"";return o!==""?r+"("+o+")":r}function ua(a){return a.displayName||"Context"}function w(a){if(a==null)return null;if(typeof a.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case u:return"Fragment";case t:return"Portal";case y:return"Profiler";case C:return"StrictMode";case _:return"Suspense";case p:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case x:var e=a;return ua(e)+".Consumer";case m:var r=a;return ua(r._context)+".Provider";case d:return Xa(a,a.render,"ForwardRef");case T:var n=a.displayName||null;return n!==null?n:w(a.type)||"Memo";case O:{var o=a,l=o._payload,i=o._init;try{return w(i(l))}catch{return null}}}return null}var k=Object.assign,Y=0,la,ca,fa,da,va,ba,pa;function ga(){}ga.__reactDisabledLog=!0;function Ha(){{if(Y===0){la=console.log,ca=console.info,fa=console.warn,da=console.error,va=console.group,ba=console.groupCollapsed,pa=console.groupEnd;var a={configurable:!0,enumerable:!0,value:ga,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}Y++}}function Za(){{if(Y--,Y===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},a,{value:la}),info:k({},a,{value:ca}),warn:k({},a,{value:fa}),error:k({},a,{value:da}),group:k({},a,{value:va}),groupCollapsed:k({},a,{value:ba}),groupEnd:k({},a,{value:pa})})}Y<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=F.ReactCurrentDispatcher,Z;function U(a,e,r){{if(Z===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
|
|
18
|
-
`+Z+a}}var Q=!1,J;{var Qa=typeof WeakMap=="function"?WeakMap:Map;J=new Qa}function ha(a,e){if(!a||Q)return"";{var r=J.get(a);if(r!==void 0)return r}var n;Q=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=H.current,H.current=null,Ha();try{if(e){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(R){n=R}Reflect.construct(a,[],i)}else{try{i.call()}catch(R){n=R}a.call(i.prototype)}}else{try{throw Error()}catch(R){n=R}a()}}catch(R){if(R&&n&&typeof R.stack=="string"){for(var s=R.stack.split(`
|
|
19
|
-
`),E=n.stack.split(`
|
|
20
|
-
`),v=s.length-1,b=E.length-1;v>=1&&b>=0&&s[v]!==E[b];)b--;for(;v>=1&&b>=0;v--,b--)if(s[v]!==E[b]){if(v!==1||b!==1)do if(v--,b--,b<0||s[v]!==E[b]){var S=`
|
|
21
|
-
`+s[v].replace(" at new "," at ");return a.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",a.displayName)),typeof a=="function"&&J.set(a,S),S}while(v>=1&&b>=0);break}}}finally{Q=!1,H.current=l,Za(),Error.prepareStackTrace=o}var W=a?a.displayName||a.name:"",A=W?U(W):"";return typeof a=="function"&&J.set(a,A),A}function $a(a,e,r){return ha(a,!1)}function qa(a){var e=a.prototype;return!!(e&&e.isReactComponent)}function K(a,e,r){if(a==null)return"";if(typeof a=="function")return ha(a,qa(a));if(typeof a=="string")return U(a);switch(a){case _:return U("Suspense");case p:return U("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case d:return $a(a.render);case T:return K(a.type,e,r);case O:{var n=a,o=n._payload,l=n._init;try{return K(l(o),e,r)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,ya={},ma=F.ReactDebugCurrentFrame;function G(a){if(a){var e=a._owner,r=K(a.type,a._source,e?e.type:null);ma.setExtraStackFrame(r)}else ma.setExtraStackFrame(null)}function ae(a,e,r,n,o){{var l=Function.call.bind(L);for(var i in a)if(l(a,i)){var s=void 0;try{if(typeof a[i]!="function"){var E=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}s=a[i](e,i,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){s=v}s&&!(s instanceof Error)&&(G(o),g("%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",r,i,typeof s),G(null)),s instanceof Error&&!(s.message in ya)&&(ya[s.message]=!0,G(o),g("Failed %s type: %s",r,s.message),G(null))}}}var ee=Array.isArray;function $(a){return ee(a)}function re(a){{var e=typeof Symbol=="function"&&Symbol.toStringTag,r=e&&a[Symbol.toStringTag]||a.constructor.name||"Object";return r}}function te(a){try{return Ea(a),!1}catch{return!0}}function Ea(a){return""+a}function Ra(a){if(te(a))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",re(a)),Ea(a)}var N=F.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0},_a,Ta,q;q={};function se(a){if(L.call(a,"ref")){var e=Object.getOwnPropertyDescriptor(a,"ref").get;if(e&&e.isReactWarning)return!1}return a.ref!==void 0}function ie(a){if(L.call(a,"key")){var e=Object.getOwnPropertyDescriptor(a,"key").get;if(e&&e.isReactWarning)return!1}return a.key!==void 0}function oe(a,e){if(typeof a.ref=="string"&&N.current&&e&&N.current.stateNode!==e){var r=w(N.current.type);q[r]||(g('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',w(N.current.type),a.ref),q[r]=!0)}}function ue(a,e){{var r=function(){_a||(_a=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(a,"key",{get:r,configurable:!0})}}function le(a,e){{var r=function(){Ta||(Ta=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};r.isReactWarning=!0,Object.defineProperty(a,"ref",{get:r,configurable:!0})}}var ce=function(a,e,r,n,o,l,i){var s={$$typeof:c,type:a,key:e,ref:r,props:i,_owner:l};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function fe(a,e,r,n,o){{var l,i={},s=null,E=null;r!==void 0&&(Ra(r),s=""+r),ie(e)&&(Ra(e.key),s=""+e.key),se(e)&&(E=e.ref,oe(e,o));for(l in e)L.call(e,l)&&!ne.hasOwnProperty(l)&&(i[l]=e[l]);if(a&&a.defaultProps){var v=a.defaultProps;for(l in v)i[l]===void 0&&(i[l]=v[l])}if(s||E){var b=typeof a=="function"?a.displayName||a.name||"Unknown":a;s&&ue(i,b),E&&le(i,b)}return ce(a,s,E,o,n,N.current,i)}}var aa=F.ReactCurrentOwner,Ca=F.ReactDebugCurrentFrame;function I(a){if(a){var e=a._owner,r=K(a.type,a._source,e?e.type:null);Ca.setExtraStackFrame(r)}else Ca.setExtraStackFrame(null)}var ea;ea=!1;function ra(a){return typeof a=="object"&&a!==null&&a.$$typeof===c}function xa(){{if(aa.current){var a=w(aa.current.type);if(a)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+a+"`."}return""}}function de(a){{if(a!==void 0){var e=a.fileName.replace(/^.*[\\\/]/,""),r=a.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+e+":"+r+"."}return""}}var Sa={};function ve(a){{var e=xa();if(!e){var r=typeof a=="string"?a:a.displayName||a.name;r&&(e=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+r+">.")}return e}}function Pa(a,e){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var r=ve(e);if(Sa[r])return;Sa[r]=!0;var n="";a&&a._owner&&a._owner!==aa.current&&(n=" It was passed a child from "+w(a._owner.type)+"."),I(a),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),I(null)}}function wa(a,e){{if(typeof a!="object")return;if($(a))for(var r=0;r<a.length;r++){var n=a[r];ra(n)&&Pa(n,e)}else if(ra(a))a._store&&(a._store.validated=!0);else if(a){var o=La(a);if(typeof o=="function"&&o!==a.entries)for(var l=o.call(a),i;!(i=l.next()).done;)ra(i.value)&&Pa(i.value,e)}}}function be(a){{var e=a.type;if(e==null||typeof e=="string")return;var r;if(typeof e=="function")r=e.propTypes;else if(typeof e=="object"&&(e.$$typeof===d||e.$$typeof===T))r=e.propTypes;else return;if(r){var n=w(e);ae(r,a.props,"prop",n,a)}else if(e.PropTypes!==void 0&&!ea){ea=!0;var o=w(e);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof e.getDefaultProps=="function"&&!e.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pe(a){{for(var e=Object.keys(a.props),r=0;r<e.length;r++){var n=e[r];if(n!=="children"&&n!=="key"){I(a),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}a.ref!==null&&(I(a),g("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var Oa={};function ja(a,e,r,n,o,l){{var i=Ga(a);if(!i){var s="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(s+=" 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 E=de(o);E?s+=E:s+=xa();var v;a===null?v="null":$(a)?v="array":a!==void 0&&a.$$typeof===c?(v="<"+(w(a.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):v=typeof a,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,s)}var b=fe(a,e,r,o,l);if(b==null)return b;if(i){var S=e.children;if(S!==void 0)if(n)if($(S)){for(var W=0;W<S.length;W++)wa(S[W],a);Object.freeze&&Object.freeze(S)}else g("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 wa(S,a)}if(L.call(e,"key")){var A=w(a),R=Object.keys(e).filter(function(Re){return Re!=="key"}),ta=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!Oa[A+ta]){var Ee=R.length>0?"{"+R.join(": ..., ")+": ...}":"{}";g(`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} />`,ta,A,Ee,A),Oa[A+ta]=!0}}return a===u?pe(b):be(b),b}}function ge(a,e,r){return ja(a,e,r,!0)}function he(a,e,r){return ja(a,e,r,!1)}var ye=he,me=ge;z.Fragment=u,z.jsx=ye,z.jsxs=me}()),z}process.env.NODE_ENV==="production"?X.exports=ka():X.exports=Aa();var j=X.exports;const Da=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
1
|
+
(function(i,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.Tabs={},i.jsxRuntime,i.React))})(this,function(i,r,n){"use strict";const h=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
33
2
|
|
|
34
3
|
:root {
|
|
35
4
|
/* border width */
|
|
@@ -197,4 +166,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
197
166
|
height: 42px;
|
|
198
167
|
font-size: var(--starasia-ui-tabs-font-size-lg);
|
|
199
168
|
}
|
|
200
|
-
`,
|
|
169
|
+
`,g="starasia-tab-styles";(e=>{if(!document.getElementById(g)){const t=document.createElement("style");t.id=g,t.textContent=e,document.head.appendChild(t)}})(h);const d=n.createContext(null),m=({children:e,activeTab:t,size:a="md",variant:s="underline",...b})=>{const[o,l]=n.useState(0),[v,c]=n.useState(null),[u,f]=n.useState([]),[p,C]=n.useState([]),B=S=>{c(S)};return n.useEffect(()=>{c(u[t||0])},[u,t]),n.useEffect(()=>{l(t||0)},[t]),r.jsx(d.Provider,{value:{activeContext:v,handleSetActiveContext:B,tabsButton:u,setTabsButton:f,activeTabButton:o,setActiveTabButton:l,panels:p,setPanels:C,size:a,variant:s},children:r.jsx("div",{...b,children:e})})},y=({children:e,...t})=>{var v;const a=n.useContext(d),s=n.useRef(null),[b,o]=n.useState(0);let l=((v=a==null?void 0:a.activeContext)==null?void 0:v.getBoundingClientRect().width)||0;return n.useEffect(()=>{var c,u;if(s.current){const f=((c=a==null?void 0:a.activeContext)==null?void 0:c.getBoundingClientRect().left)||0,p=((u=s==null?void 0:s.current)==null?void 0:u.getBoundingClientRect().left)||0;o(f-p)}},[s,a==null?void 0:a.activeContext]),r.jsxs("div",{className:`starasia-tabs-tablist starasia-tabs-tablist-${a==null?void 0:a.variant}`,...t,ref:s,children:[e,r.jsx("div",{className:`starasia-tabs-tablist-line-move starasia-tabs-tablist-line-move-${a==null?void 0:a.variant}`,style:{width:`${l}px`,left:`${b}px`}})]})},x=({children:e,...t})=>{const a=n.useContext(d),s=n.useRef(null);n.useEffect(()=>{s.current&&(a==null||a.setTabsButton(o=>[...o,s.current]))},[s]);const b=o=>{if(a==null||a.handleSetActiveContext(o.currentTarget),a!=null&&a.tabsButton)for(let l=0;l<a.tabsButton.length;l++)a.tabsButton[l]===o.currentTarget&&a.setActiveTabButton(l)};return r.jsx("button",{className:`starasia-tabs-tab starasia-tabs-tab-${a==null?void 0:a.size} starasia-tabs-tab-${a==null?void 0:a.variant} ${(a==null?void 0:a.tabsButton[a.activeTabButton])===s.current?`starasia-tabs-tab-${a==null?void 0:a.variant}-active`:""}`,onClick:o=>{b(o),t.onClick&&t.onClick()},ref:s,style:{fontWeight:(a==null?void 0:a.tabsButton[a.activeTabButton])===s.current?"var(--starasia-ui-fontWeights-medium, 400)":"var(--starasia-ui-fontWeights-normal, 300)",...t.style},children:e})},T=({children:e,...t})=>r.jsx("div",{...t,children:e}),z=({children:e,...t})=>{const a=n.useContext(d),s=n.useRef(null);return n.useEffect(()=>{s.current&&(a==null||a.setPanels(b=>[...b,s.current]))},[s]),r.jsx("div",{ref:s,style:{display:(a==null?void 0:a.panels[a.activeTabButton])===s.current?"block":"none",...t.style},children:(a==null?void 0:a.panels[a.activeTabButton])===s.current?e:null})};i.Tab=x,i.TabPanel=z,i.TabPanels=T,i.Tabs=m,i.TabsLists=y,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/tabs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Tabs component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/tabs.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",
|
|
@@ -40,5 +36,9 @@
|
|
|
40
36
|
},
|
|
41
37
|
"publishConfig": {
|
|
42
38
|
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
42
|
+
"build": "vite build --config vite.config.ts"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|