@coinloger/dev-ui 0.0.3 → 0.0.5

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/dev-ui.js DELETED
@@ -1,1091 +0,0 @@
1
- import $, { createContext as Ie, useRef as Ae, useEffect as ne, useContext as ie, useState as Fe, forwardRef as L, useId as Rr } from "react";
2
- import { createPortal as _r } from "react-dom";
3
- var ae = { exports: {} }, Y = {};
4
- /**
5
- * @license React
6
- * react-jsx-runtime.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- var Pe;
14
- function wr() {
15
- if (Pe) return Y;
16
- Pe = 1;
17
- var t = $, a = Symbol.for("react.element"), s = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, l = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function f(v, p, j) {
19
- var g, y = {}, C = null, S = null;
20
- j !== void 0 && (C = "" + j), p.key !== void 0 && (C = "" + p.key), p.ref !== void 0 && (S = p.ref);
21
- for (g in p) o.call(p, g) && !c.hasOwnProperty(g) && (y[g] = p[g]);
22
- if (v && v.defaultProps) for (g in p = v.defaultProps, p) y[g] === void 0 && (y[g] = p[g]);
23
- return { $$typeof: a, type: v, key: C, ref: S, props: y, _owner: l.current };
24
- }
25
- return Y.Fragment = s, Y.jsx = f, Y.jsxs = f, Y;
26
- }
27
- var B = {};
28
- /**
29
- * @license React
30
- * react-jsx-runtime.development.js
31
- *
32
- * Copyright (c) Facebook, Inc. and its affiliates.
33
- *
34
- * This source code is licensed under the MIT license found in the
35
- * LICENSE file in the root directory of this source tree.
36
- */
37
- var $e;
38
- function Tr() {
39
- return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
40
- var t = $, a = Symbol.for("react.element"), s = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), v = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), O = Symbol.iterator, q = "@@iterator";
41
- function G(e) {
42
- if (e === null || typeof e != "object")
43
- return null;
44
- var r = O && e[O] || e[q];
45
- return typeof r == "function" ? r : null;
46
- }
47
- var _ = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function w(e) {
49
- {
50
- for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
51
- n[u - 1] = arguments[u];
52
- Be("error", e, n);
53
- }
54
- }
55
- function Be(e, r, n) {
56
- {
57
- var u = _.ReactDebugCurrentFrame, h = u.getStackAddendum();
58
- h !== "" && (r += "%s", n = n.concat([h]));
59
- var b = n.map(function(m) {
60
- return String(m);
61
- });
62
- b.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, b);
63
- }
64
- }
65
- var Ve = !1, Ue = !1, Je = !1, Ke = !1, qe = !1, se;
66
- se = Symbol.for("react.module.reference");
67
- function Ge(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === o || e === c || qe || e === l || e === j || e === g || Ke || e === S || Ve || Ue || Je || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === y || e.$$typeof === f || e.$$typeof === v || e.$$typeof === p || // This needs to include all possible module reference object
69
- // types supported by any Flight configuration anywhere since
70
- // we don't know which Flight build this will end up being used
71
- // with.
72
- e.$$typeof === se || e.getModuleId !== void 0));
73
- }
74
- function He(e, r, n) {
75
- var u = e.displayName;
76
- if (u)
77
- return u;
78
- var h = r.displayName || r.name || "";
79
- return h !== "" ? n + "(" + h + ")" : n;
80
- }
81
- function ue(e) {
82
- return e.displayName || "Context";
83
- }
84
- function P(e) {
85
- if (e == null)
86
- return null;
87
- if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
- return e.displayName || e.name || null;
89
- if (typeof e == "string")
90
- return e;
91
- switch (e) {
92
- case o:
93
- return "Fragment";
94
- case s:
95
- return "Portal";
96
- case c:
97
- return "Profiler";
98
- case l:
99
- return "StrictMode";
100
- case j:
101
- return "Suspense";
102
- case g:
103
- return "SuspenseList";
104
- }
105
- if (typeof e == "object")
106
- switch (e.$$typeof) {
107
- case v:
108
- var r = e;
109
- return ue(r) + ".Consumer";
110
- case f:
111
- var n = e;
112
- return ue(n._context) + ".Provider";
113
- case p:
114
- return He(e, e.render, "ForwardRef");
115
- case y:
116
- var u = e.displayName || null;
117
- return u !== null ? u : P(e.type) || "Memo";
118
- case C: {
119
- var h = e, b = h._payload, m = h._init;
120
- try {
121
- return P(m(b));
122
- } catch {
123
- return null;
124
- }
125
- }
126
- }
127
- return null;
128
- }
129
- var I = Object.assign, M = 0, le, ce, fe, de, ve, pe, me;
130
- function he() {
131
- }
132
- he.__reactDisabledLog = !0;
133
- function ze() {
134
- {
135
- if (M === 0) {
136
- le = console.log, ce = console.info, fe = console.warn, de = console.error, ve = console.group, pe = console.groupCollapsed, me = console.groupEnd;
137
- var e = {
138
- configurable: !0,
139
- enumerable: !0,
140
- value: he,
141
- writable: !0
142
- };
143
- Object.defineProperties(console, {
144
- info: e,
145
- log: e,
146
- warn: e,
147
- error: e,
148
- group: e,
149
- groupCollapsed: e,
150
- groupEnd: e
151
- });
152
- }
153
- M++;
154
- }
155
- }
156
- function Xe() {
157
- {
158
- if (M--, M === 0) {
159
- var e = {
160
- configurable: !0,
161
- enumerable: !0,
162
- writable: !0
163
- };
164
- Object.defineProperties(console, {
165
- log: I({}, e, {
166
- value: le
167
- }),
168
- info: I({}, e, {
169
- value: ce
170
- }),
171
- warn: I({}, e, {
172
- value: fe
173
- }),
174
- error: I({}, e, {
175
- value: de
176
- }),
177
- group: I({}, e, {
178
- value: ve
179
- }),
180
- groupCollapsed: I({}, e, {
181
- value: pe
182
- }),
183
- groupEnd: I({}, e, {
184
- value: me
185
- })
186
- });
187
- }
188
- M < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
- }
190
- }
191
- var H = _.ReactCurrentDispatcher, z;
192
- function V(e, r, n) {
193
- {
194
- if (z === void 0)
195
- try {
196
- throw Error();
197
- } catch (h) {
198
- var u = h.stack.trim().match(/\n( *(at )?)/);
199
- z = u && u[1] || "";
200
- }
201
- return `
202
- ` + z + e;
203
- }
204
- }
205
- var X = !1, U;
206
- {
207
- var Ze = typeof WeakMap == "function" ? WeakMap : Map;
208
- U = new Ze();
209
- }
210
- function be(e, r) {
211
- if (!e || X)
212
- return "";
213
- {
214
- var n = U.get(e);
215
- if (n !== void 0)
216
- return n;
217
- }
218
- var u;
219
- X = !0;
220
- var h = Error.prepareStackTrace;
221
- Error.prepareStackTrace = void 0;
222
- var b;
223
- b = H.current, H.current = null, ze();
224
- try {
225
- if (r) {
226
- var m = function() {
227
- throw Error();
228
- };
229
- if (Object.defineProperty(m.prototype, "props", {
230
- set: function() {
231
- throw Error();
232
- }
233
- }), typeof Reflect == "object" && Reflect.construct) {
234
- try {
235
- Reflect.construct(m, []);
236
- } catch (k) {
237
- u = k;
238
- }
239
- Reflect.construct(e, [], m);
240
- } else {
241
- try {
242
- m.call();
243
- } catch (k) {
244
- u = k;
245
- }
246
- e.call(m.prototype);
247
- }
248
- } else {
249
- try {
250
- throw Error();
251
- } catch (k) {
252
- u = k;
253
- }
254
- e();
255
- }
256
- } catch (k) {
257
- if (k && u && typeof k.stack == "string") {
258
- for (var d = k.stack.split(`
259
- `), T = u.stack.split(`
260
- `), E = d.length - 1, R = T.length - 1; E >= 1 && R >= 0 && d[E] !== T[R]; )
261
- R--;
262
- for (; E >= 1 && R >= 0; E--, R--)
263
- if (d[E] !== T[R]) {
264
- if (E !== 1 || R !== 1)
265
- do
266
- if (E--, R--, R < 0 || d[E] !== T[R]) {
267
- var N = `
268
- ` + d[E].replace(" at new ", " at ");
269
- return e.displayName && N.includes("<anonymous>") && (N = N.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, N), N;
270
- }
271
- while (E >= 1 && R >= 0);
272
- break;
273
- }
274
- }
275
- } finally {
276
- X = !1, H.current = b, Xe(), Error.prepareStackTrace = h;
277
- }
278
- var D = e ? e.displayName || e.name : "", A = D ? V(D) : "";
279
- return typeof e == "function" && U.set(e, A), A;
280
- }
281
- function Qe(e, r, n) {
282
- return be(e, !1);
283
- }
284
- function er(e) {
285
- var r = e.prototype;
286
- return !!(r && r.isReactComponent);
287
- }
288
- function J(e, r, n) {
289
- if (e == null)
290
- return "";
291
- if (typeof e == "function")
292
- return be(e, er(e));
293
- if (typeof e == "string")
294
- return V(e);
295
- switch (e) {
296
- case j:
297
- return V("Suspense");
298
- case g:
299
- return V("SuspenseList");
300
- }
301
- if (typeof e == "object")
302
- switch (e.$$typeof) {
303
- case p:
304
- return Qe(e.render);
305
- case y:
306
- return J(e.type, r, n);
307
- case C: {
308
- var u = e, h = u._payload, b = u._init;
309
- try {
310
- return J(b(h), r, n);
311
- } catch {
312
- }
313
- }
314
- }
315
- return "";
316
- }
317
- var W = Object.prototype.hasOwnProperty, xe = {}, ge = _.ReactDebugCurrentFrame;
318
- function K(e) {
319
- if (e) {
320
- var r = e._owner, n = J(e.type, e._source, r ? r.type : null);
321
- ge.setExtraStackFrame(n);
322
- } else
323
- ge.setExtraStackFrame(null);
324
- }
325
- function rr(e, r, n, u, h) {
326
- {
327
- var b = Function.call.bind(W);
328
- for (var m in e)
329
- if (b(e, m)) {
330
- var d = void 0;
331
- try {
332
- if (typeof e[m] != "function") {
333
- var T = Error((u || "React class") + ": " + n + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw T.name = "Invariant Violation", T;
335
- }
336
- d = e[m](r, m, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (E) {
338
- d = E;
339
- }
340
- d && !(d instanceof Error) && (K(h), w("%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).", u || "React class", n, m, typeof d), K(null)), d instanceof Error && !(d.message in xe) && (xe[d.message] = !0, K(h), w("Failed %s type: %s", n, d.message), K(null));
341
- }
342
- }
343
- }
344
- var tr = Array.isArray;
345
- function Z(e) {
346
- return tr(e);
347
- }
348
- function nr(e) {
349
- {
350
- var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
- return n;
352
- }
353
- }
354
- function ar(e) {
355
- try {
356
- return ye(e), !1;
357
- } catch {
358
- return !0;
359
- }
360
- }
361
- function ye(e) {
362
- return "" + e;
363
- }
364
- function je(e) {
365
- if (ar(e))
366
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nr(e)), ye(e);
367
- }
368
- var Ee = _.ReactCurrentOwner, ir = {
369
- key: !0,
370
- ref: !0,
371
- __self: !0,
372
- __source: !0
373
- }, Re, _e;
374
- function or(e) {
375
- if (W.call(e, "ref")) {
376
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
- if (r && r.isReactWarning)
378
- return !1;
379
- }
380
- return e.ref !== void 0;
381
- }
382
- function sr(e) {
383
- if (W.call(e, "key")) {
384
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
- if (r && r.isReactWarning)
386
- return !1;
387
- }
388
- return e.key !== void 0;
389
- }
390
- function ur(e, r) {
391
- typeof e.ref == "string" && Ee.current;
392
- }
393
- function lr(e, r) {
394
- {
395
- var n = function() {
396
- Re || (Re = !0, w("%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));
397
- };
398
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
399
- get: n,
400
- configurable: !0
401
- });
402
- }
403
- }
404
- function cr(e, r) {
405
- {
406
- var n = function() {
407
- _e || (_e = !0, w("%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));
408
- };
409
- n.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
- get: n,
411
- configurable: !0
412
- });
413
- }
414
- }
415
- var fr = function(e, r, n, u, h, b, m) {
416
- var d = {
417
- // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: a,
419
- // Built-in properties that belong on the element
420
- type: e,
421
- key: r,
422
- ref: n,
423
- props: m,
424
- // Record the component responsible for creating this element.
425
- _owner: b
426
- };
427
- return d._store = {}, Object.defineProperty(d._store, "validated", {
428
- configurable: !1,
429
- enumerable: !1,
430
- writable: !0,
431
- value: !1
432
- }), Object.defineProperty(d, "_self", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !1,
436
- value: u
437
- }), Object.defineProperty(d, "_source", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: h
442
- }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
443
- };
444
- function dr(e, r, n, u, h) {
445
- {
446
- var b, m = {}, d = null, T = null;
447
- n !== void 0 && (je(n), d = "" + n), sr(r) && (je(r.key), d = "" + r.key), or(r) && (T = r.ref, ur(r, h));
448
- for (b in r)
449
- W.call(r, b) && !ir.hasOwnProperty(b) && (m[b] = r[b]);
450
- if (e && e.defaultProps) {
451
- var E = e.defaultProps;
452
- for (b in E)
453
- m[b] === void 0 && (m[b] = E[b]);
454
- }
455
- if (d || T) {
456
- var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- d && lr(m, R), T && cr(m, R);
458
- }
459
- return fr(e, d, T, h, u, Ee.current, m);
460
- }
461
- }
462
- var Q = _.ReactCurrentOwner, we = _.ReactDebugCurrentFrame;
463
- function F(e) {
464
- if (e) {
465
- var r = e._owner, n = J(e.type, e._source, r ? r.type : null);
466
- we.setExtraStackFrame(n);
467
- } else
468
- we.setExtraStackFrame(null);
469
- }
470
- var ee;
471
- ee = !1;
472
- function re(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === a;
474
- }
475
- function Te() {
476
- {
477
- if (Q.current) {
478
- var e = P(Q.current.type);
479
- if (e)
480
- return `
481
-
482
- Check the render method of \`` + e + "`.";
483
- }
484
- return "";
485
- }
486
- }
487
- function vr(e) {
488
- return "";
489
- }
490
- var ke = {};
491
- function pr(e) {
492
- {
493
- var r = Te();
494
- if (!r) {
495
- var n = typeof e == "string" ? e : e.displayName || e.name;
496
- n && (r = `
497
-
498
- Check the top-level render call using <` + n + ">.");
499
- }
500
- return r;
501
- }
502
- }
503
- function Ce(e, r) {
504
- {
505
- if (!e._store || e._store.validated || e.key != null)
506
- return;
507
- e._store.validated = !0;
508
- var n = pr(r);
509
- if (ke[n])
510
- return;
511
- ke[n] = !0;
512
- var u = "";
513
- e && e._owner && e._owner !== Q.current && (u = " It was passed a child from " + P(e._owner.type) + "."), F(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, u), F(null);
514
- }
515
- }
516
- function Se(e, r) {
517
- {
518
- if (typeof e != "object")
519
- return;
520
- if (Z(e))
521
- for (var n = 0; n < e.length; n++) {
522
- var u = e[n];
523
- re(u) && Ce(u, r);
524
- }
525
- else if (re(e))
526
- e._store && (e._store.validated = !0);
527
- else if (e) {
528
- var h = G(e);
529
- if (typeof h == "function" && h !== e.entries)
530
- for (var b = h.call(e), m; !(m = b.next()).done; )
531
- re(m.value) && Ce(m.value, r);
532
- }
533
- }
534
- }
535
- function mr(e) {
536
- {
537
- var r = e.type;
538
- if (r == null || typeof r == "string")
539
- return;
540
- var n;
541
- if (typeof r == "function")
542
- n = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
544
- // Inner props are checked in the reconciler.
545
- r.$$typeof === y))
546
- n = r.propTypes;
547
- else
548
- return;
549
- if (n) {
550
- var u = P(r);
551
- rr(n, e.props, "prop", u, e);
552
- } else if (r.PropTypes !== void 0 && !ee) {
553
- ee = !0;
554
- var h = P(r);
555
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
556
- }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
- }
559
- }
560
- function hr(e) {
561
- {
562
- for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
563
- var u = r[n];
564
- if (u !== "children" && u !== "key") {
565
- F(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), F(null);
566
- break;
567
- }
568
- }
569
- e.ref !== null && (F(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
570
- }
571
- }
572
- var Ne = {};
573
- function Oe(e, r, n, u, h, b) {
574
- {
575
- var m = Ge(e);
576
- if (!m) {
577
- var d = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var T = vr();
580
- T ? d += T : d += Te();
581
- var E;
582
- e === null ? E = "null" : Z(e) ? E = "array" : e !== void 0 && e.$$typeof === a ? (E = "<" + (P(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, d);
583
- }
584
- var R = dr(e, r, n, h, b);
585
- if (R == null)
586
- return R;
587
- if (m) {
588
- var N = r.children;
589
- if (N !== void 0)
590
- if (u)
591
- if (Z(N)) {
592
- for (var D = 0; D < N.length; D++)
593
- Se(N[D], e);
594
- Object.freeze && Object.freeze(N);
595
- } else
596
- w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
- else
598
- Se(N, e);
599
- }
600
- if (W.call(r, "key")) {
601
- var A = P(e), k = Object.keys(r).filter(function(Er) {
602
- return Er !== "key";
603
- }), te = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Ne[A + te]) {
605
- var jr = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
606
- w(`A props object containing a "key" prop is being spread into JSX:
607
- let props = %s;
608
- <%s {...props} />
609
- React keys must be passed directly to JSX without using spread:
610
- let props = %s;
611
- <%s key={someKey} {...props} />`, te, A, jr, A), Ne[A + te] = !0;
612
- }
613
- }
614
- return e === o ? hr(R) : mr(R), R;
615
- }
616
- }
617
- function br(e, r, n) {
618
- return Oe(e, r, n, !0);
619
- }
620
- function xr(e, r, n) {
621
- return Oe(e, r, n, !1);
622
- }
623
- var gr = xr, yr = br;
624
- B.Fragment = o, B.jsx = gr, B.jsxs = yr;
625
- }()), B;
626
- }
627
- process.env.NODE_ENV === "production" ? ae.exports = wr() : ae.exports = Tr();
628
- var i = ae.exports;
629
- function De(t) {
630
- var a, s, o = "";
631
- if (typeof t == "string" || typeof t == "number") o += t;
632
- else if (typeof t == "object") if (Array.isArray(t)) {
633
- var l = t.length;
634
- for (a = 0; a < l; a++) t[a] && (s = De(t[a])) && (o && (o += " "), o += s);
635
- } else for (s in t) t[s] && (o && (o += " "), o += s);
636
- return o;
637
- }
638
- function x() {
639
- for (var t, a, s = 0, o = "", l = arguments.length; s < l; s++) (t = arguments[s]) && (a = De(t)) && (o && (o += " "), o += a);
640
- return o;
641
- }
642
- const kr = $.forwardRef(
643
- ({ className: t, variant: a = "primary", size: s = "md", ...o }, l) => {
644
- const c = x(
645
- "ui-btn",
646
- `ui-btn-${a}`,
647
- `ui-btn-${s}`,
648
- t
649
- );
650
- return /* @__PURE__ */ i.jsx("button", { ref: l, className: c, ...o });
651
- }
652
- );
653
- kr.displayName = "Button";
654
- const Cr = $.forwardRef(
655
- ({ className: t, label: a, error: s, helperText: o, fullWidth: l, size: c = "md", id: f, ...v }, p) => {
656
- const j = f || $.useId();
657
- return /* @__PURE__ */ i.jsxs("div", { className: x("ui-input-wrapper", l && "ui-input-wrapper-full"), children: [
658
- a && /* @__PURE__ */ i.jsx("label", { htmlFor: j, className: "ui-label", children: a }),
659
- /* @__PURE__ */ i.jsx(
660
- "input",
661
- {
662
- ref: p,
663
- id: j,
664
- className: x(
665
- "ui-input",
666
- `ui-input-${c}`,
667
- s && "ui-input-error",
668
- t
669
- ),
670
- ...v
671
- }
672
- ),
673
- o && /* @__PURE__ */ i.jsx("span", { className: x("ui-helper-text", s && "ui-helper-text-error"), children: o })
674
- ] });
675
- }
676
- );
677
- Cr.displayName = "Input";
678
- const Sr = $.forwardRef(
679
- ({ className: t, title: a, footer: s, children: o, ...l }, c) => /* @__PURE__ */ i.jsxs("div", { ref: c, className: x("ui-card", t), ...l, children: [
680
- a && /* @__PURE__ */ i.jsx("div", { className: "ui-card__header", children: a }),
681
- /* @__PURE__ */ i.jsx("div", { className: "ui-card__body", children: o }),
682
- s && /* @__PURE__ */ i.jsx("div", { className: "ui-card__footer", children: s })
683
- ] })
684
- );
685
- Sr.displayName = "Card";
686
- const Le = Ie(void 0), Nr = () => {
687
- const t = ie(Le);
688
- if (!t)
689
- throw new Error("Modal compound components must be used within a Modal");
690
- return t;
691
- }, Me = ({ children: t, className: a }) => {
692
- const { onClose: s } = Nr();
693
- return /* @__PURE__ */ i.jsxs("div", { className: x("ui-modal-header", a), children: [
694
- /* @__PURE__ */ i.jsx("h3", { className: "ui-modal-title", children: t }),
695
- /* @__PURE__ */ i.jsx(
696
- "button",
697
- {
698
- className: "ui-modal-close",
699
- onClick: s,
700
- "aria-label": "Close modal",
701
- children: /* @__PURE__ */ i.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
702
- /* @__PURE__ */ i.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
703
- /* @__PURE__ */ i.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
704
- ] })
705
- }
706
- )
707
- ] });
708
- }, We = ({ children: t, className: a }) => /* @__PURE__ */ i.jsx("div", { className: x("ui-modal-body", a), children: t }), Ye = ({ children: t, className: a }) => /* @__PURE__ */ i.jsx("div", { className: x("ui-modal-footer", a), children: t }), Or = ({
709
- isOpen: t,
710
- onClose: a,
711
- title: s,
712
- children: o,
713
- footer: l,
714
- size: c = "md",
715
- className: f,
716
- closeOnBackdropClick: v = !0
717
- }) => {
718
- const p = Ae(null), [j, g] = $.useState(t);
719
- ne(() => {
720
- t && g(!0);
721
- }, [t]);
722
- const y = () => {
723
- t || g(!1);
724
- };
725
- if (ne(() => {
726
- const S = (O) => {
727
- O.key === "Escape" && a();
728
- };
729
- return t && (document.addEventListener("keydown", S), document.body.style.overflow = "hidden"), () => {
730
- document.removeEventListener("keydown", S), document.body.style.overflow = "";
731
- };
732
- }, [t, a]), !j) return null;
733
- const C = (S) => {
734
- v && S.target === p.current && a();
735
- };
736
- return _r(
737
- /* @__PURE__ */ i.jsx(Le.Provider, { value: { onClose: a }, children: /* @__PURE__ */ i.jsx(
738
- "div",
739
- {
740
- className: x("ui-modal-overlay", !t && "ui-modal-closing"),
741
- ref: p,
742
- onClick: C,
743
- onAnimationEnd: y,
744
- children: /* @__PURE__ */ i.jsx(
745
- "div",
746
- {
747
- className: x(
748
- "ui-modal",
749
- `ui-modal-${c}`,
750
- !t && "ui-modal-closing",
751
- f
752
- ),
753
- role: "dialog",
754
- "aria-modal": "true",
755
- children: s ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
756
- /* @__PURE__ */ i.jsx(Me, { children: s }),
757
- /* @__PURE__ */ i.jsx(We, { children: o }),
758
- l && /* @__PURE__ */ i.jsx(Ye, { children: l })
759
- ] }) : o
760
- }
761
- )
762
- }
763
- ) }),
764
- document.body
765
- );
766
- }, Mr = Object.assign(Or, {
767
- Header: Me,
768
- Body: We,
769
- Footer: Ye
770
- }), Wr = ({
771
- options: t,
772
- value: a,
773
- onChange: s,
774
- placeholder: o = "Select an option",
775
- label: l,
776
- error: c,
777
- helperText: f,
778
- disabled: v,
779
- fullWidth: p,
780
- size: j = "md",
781
- className: g
782
- }) => {
783
- const [y, C] = Fe(!1), S = Ae(null), O = t.find((_) => _.value === a), q = () => {
784
- v || C(!y);
785
- }, G = (_) => {
786
- s && s(_), C(!1);
787
- };
788
- return ne(() => {
789
- const _ = (w) => {
790
- S.current && !S.current.contains(w.target) && C(!1);
791
- };
792
- return y && document.addEventListener("mousedown", _), () => {
793
- document.removeEventListener("mousedown", _);
794
- };
795
- }, [y]), /* @__PURE__ */ i.jsxs(
796
- "div",
797
- {
798
- className: x("ui-select-wrapper", p && "ui-w-full", g),
799
- ref: S,
800
- style: { width: p ? "100%" : "auto" },
801
- children: [
802
- l && /* @__PURE__ */ i.jsx("label", { className: "ui-label", style: { marginBottom: "0.375rem", display: "block" }, children: l }),
803
- /* @__PURE__ */ i.jsxs(
804
- "button",
805
- {
806
- type: "button",
807
- className: x(
808
- "ui-select-trigger",
809
- `ui-select-${j}`,
810
- c && "ui-select-error",
811
- v && "ui-select-disabled",
812
- y && "ui-select-open"
813
- ),
814
- onClick: q,
815
- disabled: v,
816
- "aria-haspopup": "listbox",
817
- "aria-expanded": y,
818
- children: [
819
- /* @__PURE__ */ i.jsx("span", { className: x(!O && "ui-select-placeholder"), children: O ? O.label : o }),
820
- /* @__PURE__ */ i.jsx(
821
- "svg",
822
- {
823
- className: "ui-select-icon",
824
- fill: "none",
825
- stroke: "currentColor",
826
- viewBox: "0 0 24 24",
827
- children: /* @__PURE__ */ i.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
828
- }
829
- )
830
- ]
831
- }
832
- ),
833
- y && /* @__PURE__ */ i.jsxs("ul", { className: "ui-select-menu", role: "listbox", children: [
834
- t.map((_) => /* @__PURE__ */ i.jsx(
835
- "li",
836
- {
837
- className: x(
838
- "ui-select-option",
839
- _.value === a && "ui-select-selected"
840
- ),
841
- onClick: () => G(_.value),
842
- role: "option",
843
- "aria-selected": _.value === a,
844
- children: _.label
845
- },
846
- _.value
847
- )),
848
- t.length === 0 && /* @__PURE__ */ i.jsx("li", { className: "ui-select-option", style: { color: "var(--ui-text-muted)", cursor: "default" }, children: "No options" })
849
- ] }),
850
- f && /* @__PURE__ */ i.jsx("span", { className: x("ui-helper-text", c && "ui-helper-text-error"), style: { marginTop: "0.375rem", display: "block" }, children: f })
851
- ]
852
- }
853
- );
854
- }, Yr = L(
855
- ({ className: t, label: a, error: s, disabled: o, size: l = "md", variant: c = "primary", ...f }, v) => /* @__PURE__ */ i.jsxs(
856
- "label",
857
- {
858
- className: x(
859
- "ui-checkbox-label",
860
- `ui-checkbox-${l}`,
861
- `ui-checkbox-${c}`,
862
- o && "ui-checkbox-disabled",
863
- t
864
- ),
865
- children: [
866
- /* @__PURE__ */ i.jsx(
867
- "input",
868
- {
869
- type: "checkbox",
870
- className: "ui-checkbox-input",
871
- disabled: o,
872
- ref: v,
873
- ...f
874
- }
875
- ),
876
- /* @__PURE__ */ i.jsx("span", { className: "ui-checkbox-custom", children: /* @__PURE__ */ i.jsx(
877
- "svg",
878
- {
879
- className: "ui-checkbox-icon",
880
- viewBox: "0 0 24 24",
881
- fill: "none",
882
- stroke: "currentColor",
883
- strokeLinecap: "round",
884
- strokeLinejoin: "round",
885
- children: /* @__PURE__ */ i.jsx("polyline", { points: "20 6 9 17 4 12" })
886
- }
887
- ) }),
888
- a && /* @__PURE__ */ i.jsx("span", { className: "ui-checkbox-text", children: a })
889
- ]
890
- }
891
- )
892
- ), Br = L(
893
- ({ className: t, label: a, error: s, disabled: o, size: l = "md", variant: c = "primary", ...f }, v) => /* @__PURE__ */ i.jsxs(
894
- "label",
895
- {
896
- className: x(
897
- "ui-radio-label",
898
- `ui-radio-${l}`,
899
- `ui-radio-${c}`,
900
- o && "ui-radio-disabled",
901
- t
902
- ),
903
- children: [
904
- /* @__PURE__ */ i.jsx(
905
- "input",
906
- {
907
- type: "radio",
908
- className: "ui-radio-input",
909
- disabled: o,
910
- ref: v,
911
- ...f
912
- }
913
- ),
914
- /* @__PURE__ */ i.jsx("span", { className: "ui-radio-custom", children: /* @__PURE__ */ i.jsx("span", { className: "ui-radio-dot" }) }),
915
- a && /* @__PURE__ */ i.jsx("span", { className: "ui-radio-text", children: a })
916
- ]
917
- }
918
- )
919
- ), Vr = L(
920
- ({ className: t, label: a, error: s, disabled: o, size: l = "md", variant: c = "primary", ...f }, v) => /* @__PURE__ */ i.jsxs(
921
- "label",
922
- {
923
- className: x(
924
- "ui-switch-label",
925
- `ui-switch-${l}`,
926
- `ui-switch-${c}`,
927
- o && "ui-switch-disabled",
928
- t
929
- ),
930
- children: [
931
- /* @__PURE__ */ i.jsx(
932
- "input",
933
- {
934
- type: "checkbox",
935
- className: "ui-switch-input",
936
- disabled: o,
937
- ref: v,
938
- role: "switch",
939
- ...f
940
- }
941
- ),
942
- /* @__PURE__ */ i.jsx("span", { className: "ui-switch-track", children: /* @__PURE__ */ i.jsx("span", { className: "ui-switch-thumb" }) }),
943
- a && /* @__PURE__ */ i.jsx("span", { className: "ui-switch-text", children: a })
944
- ]
945
- }
946
- )
947
- ), Ur = L(
948
- ({ className: t, children: a, variant: s = "primary", size: o = "md", shape: l = "rounded", ...c }, f) => /* @__PURE__ */ i.jsx(
949
- "span",
950
- {
951
- ref: f,
952
- className: x(
953
- "ui-badge",
954
- `ui-badge-${s}`,
955
- `ui-badge-${o}`,
956
- `ui-badge-${l}`,
957
- t
958
- ),
959
- ...c,
960
- children: a
961
- }
962
- )
963
- ), Jr = L(
964
- ({ className: t, children: a, level: s = 1, truncate: o, lines: l, style: c, ...f }, v) => {
965
- const p = `h${s}`, j = l ? { ...c, "--ui-line-clamp": l } : c;
966
- return /* @__PURE__ */ i.jsx(
967
- p,
968
- {
969
- ref: v,
970
- className: x(
971
- "ui-heading",
972
- `ui-heading-h${s}`,
973
- o && "ui-text-truncate",
974
- l && "ui-text-clamp",
975
- t
976
- ),
977
- style: j,
978
- ...f,
979
- children: a
980
- }
981
- );
982
- }
983
- ), Kr = L(
984
- ({ className: t, children: a, variant: s = "body", weight: o, muted: l, truncate: c, lines: f, as: v = "p", style: p, ...j }, g) => {
985
- const y = f ? { ...p, "--ui-line-clamp": f } : p;
986
- return /* @__PURE__ */ i.jsx(
987
- v,
988
- {
989
- ref: g,
990
- className: x(
991
- "ui-text",
992
- `ui-text-${s}`,
993
- o && `ui-text-weight-${o}`,
994
- l && "ui-text-muted",
995
- c && "ui-text-truncate",
996
- f && "ui-text-clamp",
997
- t
998
- ),
999
- style: y,
1000
- ...j,
1001
- children: a
1002
- }
1003
- );
1004
- }
1005
- ), oe = Ie(null), Pr = ({ defaultValue: t, value: a, onValueChange: s, children: o, className: l }) => {
1006
- const [c, f] = Fe(t || ""), v = a !== void 0, p = v ? a : c, j = Rr(), g = (y) => {
1007
- v || f(y), s == null || s(y);
1008
- };
1009
- return /* @__PURE__ */ i.jsx(oe.Provider, { value: { value: p, onChange: g, baseId: j }, children: /* @__PURE__ */ i.jsx("div", { className: x("ui-tabs", l), children: o }) });
1010
- }, $r = ({ className: t, children: a, variant: s = "line", ...o }) => /* @__PURE__ */ i.jsx(
1011
- "div",
1012
- {
1013
- role: "tablist",
1014
- className: x("ui-tabs-list", `ui-tabs-list-${s}`, t),
1015
- ...o,
1016
- children: a
1017
- }
1018
- ), Ir = ({ value: t, className: a, children: s, onClick: o, ...l }) => {
1019
- const c = ie(oe);
1020
- if (!c) throw new Error("TabsTrigger must be used within Tabs");
1021
- const f = c.value === t, v = `${c.baseId}-trigger-${t}`, p = `${c.baseId}-content-${t}`, j = (g) => {
1022
- c.onChange(t), o == null || o(g);
1023
- };
1024
- return /* @__PURE__ */ i.jsx(
1025
- "button",
1026
- {
1027
- type: "button",
1028
- role: "tab",
1029
- "aria-selected": f,
1030
- "aria-controls": p,
1031
- id: v,
1032
- tabIndex: f ? 0 : -1,
1033
- "data-state": f ? "active" : "inactive",
1034
- className: x("ui-tabs-trigger", a),
1035
- onClick: j,
1036
- ...l,
1037
- children: s
1038
- }
1039
- );
1040
- }, Ar = ({ value: t, className: a, children: s, ...o }) => {
1041
- const l = ie(oe);
1042
- if (!l) throw new Error("TabsContent must be used within Tabs");
1043
- const c = l.value === t, f = `${l.baseId}-trigger-${t}`, v = `${l.baseId}-content-${t}`;
1044
- return c ? /* @__PURE__ */ i.jsx(
1045
- "div",
1046
- {
1047
- role: "tabpanel",
1048
- id: v,
1049
- "aria-labelledby": f,
1050
- tabIndex: 0,
1051
- className: x("ui-tabs-content", a),
1052
- ...o,
1053
- children: s
1054
- }
1055
- ) : null;
1056
- }, qr = Object.assign(Pr, {
1057
- List: $r,
1058
- Trigger: Ir,
1059
- Content: Ar
1060
- }), Fr = $.forwardRef(
1061
- ({ className: t, bordered: a = !0, striped: s, hover: o, size: l = "md", children: c, ...f }, v) => {
1062
- const p = [
1063
- "ui-table",
1064
- a && "ui-table-bordered",
1065
- s && "ui-table-striped",
1066
- o && "ui-table-hover",
1067
- l === "sm" && "ui-table-sm",
1068
- t
1069
- ].filter(Boolean).join(" ");
1070
- return /* @__PURE__ */ i.jsx("div", { className: "ui-table-responsive", children: /* @__PURE__ */ i.jsx("table", { ref: v, className: p, ...f, children: c }) });
1071
- }
1072
- );
1073
- Fr.displayName = "Table";
1074
- export {
1075
- Ur as Badge,
1076
- kr as Button,
1077
- Sr as Card,
1078
- Yr as Checkbox,
1079
- Jr as Heading,
1080
- Cr as Input,
1081
- Mr as Modal,
1082
- We as ModalBody,
1083
- Ye as ModalFooter,
1084
- Me as ModalHeader,
1085
- Br as Radio,
1086
- Wr as Select,
1087
- Vr as Switch,
1088
- Fr as Table,
1089
- qr as Tabs,
1090
- Kr as Text
1091
- };