@starasia/badges 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/badges.es.js +58 -58
- package/dist/badges.umd.js +24 -24
- package/package.json +5 -1
package/dist/badges.es.js
CHANGED
|
@@ -13,13 +13,13 @@ var Tr;
|
|
|
13
13
|
function fe() {
|
|
14
14
|
if (Tr) return I;
|
|
15
15
|
Tr = 1;
|
|
16
|
-
var v = U,
|
|
16
|
+
var v = U, g = Symbol.for("react.element"), R = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, p = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function x(S, c, P) {
|
|
18
18
|
var h, E = {}, T = null, Y = null;
|
|
19
19
|
P !== void 0 && (T = "" + P), c.key !== void 0 && (T = "" + c.key), c.ref !== void 0 && (Y = c.ref);
|
|
20
20
|
for (h in c) y.call(c, h) && !C.hasOwnProperty(h) && (E[h] = c[h]);
|
|
21
21
|
if (S && S.defaultProps) for (h in c = S.defaultProps, c) E[h] === void 0 && (E[h] = c[h]);
|
|
22
|
-
return { $$typeof:
|
|
22
|
+
return { $$typeof: g, type: S, key: T, ref: Y, props: E, _owner: p.current };
|
|
23
23
|
}
|
|
24
24
|
return I.Fragment = R, I.jsx = x, I.jsxs = x, I;
|
|
25
25
|
}
|
|
@@ -33,10 +33,10 @@ var $ = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
36
|
+
var Or;
|
|
37
37
|
function de() {
|
|
38
|
-
return
|
|
39
|
-
var v = U,
|
|
38
|
+
return Or || (Or = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var v = U, g = Symbol.for("react.element"), R = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), S = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), Q = Symbol.iterator, Cr = "@@iterator";
|
|
40
40
|
function Pr(r) {
|
|
41
41
|
if (r === null || typeof r != "object")
|
|
42
42
|
return null;
|
|
@@ -64,7 +64,7 @@ function de() {
|
|
|
64
64
|
var kr = !1, Dr = !1, Ar = !1, Fr = !1, Ir = !1, rr;
|
|
65
65
|
rr = Symbol.for("react.module.reference");
|
|
66
66
|
function $r(r) {
|
|
67
|
-
return !!(typeof r == "string" || typeof r == "function" || r === y || r === C || Ir || r ===
|
|
67
|
+
return !!(typeof r == "string" || typeof r == "function" || r === y || r === C || Ir || r === p || r === P || r === h || Fr || r === Y || kr || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === T || r.$$typeof === E || r.$$typeof === x || r.$$typeof === S || r.$$typeof === c || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
@@ -94,7 +94,7 @@ function de() {
|
|
|
94
94
|
return "Portal";
|
|
95
95
|
case C:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case p:
|
|
98
98
|
return "StrictMode";
|
|
99
99
|
case P:
|
|
100
100
|
return "Suspense";
|
|
@@ -125,7 +125,7 @@ function de() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
128
|
+
var O = Object.assign, A = 0, ar, nr, tr, ir, sr, or, ur;
|
|
129
129
|
function lr() {
|
|
130
130
|
}
|
|
131
131
|
lr.__reactDisabledLog = !0;
|
|
@@ -161,25 +161,25 @@ function de() {
|
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
164
|
+
log: O({}, r, {
|
|
165
165
|
value: ar
|
|
166
166
|
}),
|
|
167
|
-
info:
|
|
167
|
+
info: O({}, r, {
|
|
168
168
|
value: nr
|
|
169
169
|
}),
|
|
170
|
-
warn:
|
|
170
|
+
warn: O({}, r, {
|
|
171
171
|
value: tr
|
|
172
172
|
}),
|
|
173
|
-
error:
|
|
173
|
+
error: O({}, r, {
|
|
174
174
|
value: ir
|
|
175
175
|
}),
|
|
176
|
-
group:
|
|
176
|
+
group: O({}, r, {
|
|
177
177
|
value: sr
|
|
178
178
|
}),
|
|
179
|
-
groupCollapsed:
|
|
179
|
+
groupCollapsed: O({}, r, {
|
|
180
180
|
value: or
|
|
181
181
|
}),
|
|
182
|
-
groupEnd:
|
|
182
|
+
groupEnd: O({}, r, {
|
|
183
183
|
value: ur
|
|
184
184
|
})
|
|
185
185
|
});
|
|
@@ -274,8 +274,8 @@ function de() {
|
|
|
274
274
|
} finally {
|
|
275
275
|
J = !1, B.current = o, Lr(), Error.prepareStackTrace = s;
|
|
276
276
|
}
|
|
277
|
-
var D = r ? r.displayName || r.name : "",
|
|
278
|
-
return typeof r == "function" && L.set(r,
|
|
277
|
+
var D = r ? r.displayName || r.name : "", w = D ? W(D) : "";
|
|
278
|
+
return typeof r == "function" && L.set(r, w), w;
|
|
279
279
|
}
|
|
280
280
|
function Mr(r, e, a) {
|
|
281
281
|
return cr(r, !1);
|
|
@@ -360,11 +360,11 @@ function de() {
|
|
|
360
360
|
function vr(r) {
|
|
361
361
|
return "" + r;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function gr(r) {
|
|
364
364
|
if (Jr(r))
|
|
365
365
|
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", zr(r)), vr(r);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var pr = j.ReactCurrentOwner, qr = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
@@ -387,7 +387,7 @@ function de() {
|
|
|
387
387
|
return r.key !== void 0;
|
|
388
388
|
}
|
|
389
389
|
function Xr(r, e) {
|
|
390
|
-
typeof r.ref == "string" &&
|
|
390
|
+
typeof r.ref == "string" && pr.current;
|
|
391
391
|
}
|
|
392
392
|
function Hr(r, e) {
|
|
393
393
|
{
|
|
@@ -414,7 +414,7 @@ function de() {
|
|
|
414
414
|
var Qr = function(r, e, a, n, s, o, i) {
|
|
415
415
|
var t = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: g,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: r,
|
|
420
420
|
key: e,
|
|
@@ -443,7 +443,7 @@ function de() {
|
|
|
443
443
|
function re(r, e, a, n, s) {
|
|
444
444
|
{
|
|
445
445
|
var o, i = {}, t = null, d = null;
|
|
446
|
-
a !== void 0 && (
|
|
446
|
+
a !== void 0 && (gr(a), t = "" + a), Kr(e) && (gr(e.key), t = "" + e.key), Gr(e) && (d = e.ref, Xr(e, s));
|
|
447
447
|
for (o in e)
|
|
448
448
|
F.call(e, o) && !qr.hasOwnProperty(o) && (i[o] = e[o]);
|
|
449
449
|
if (r && r.defaultProps) {
|
|
@@ -455,7 +455,7 @@ function de() {
|
|
|
455
455
|
var l = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
456
456
|
t && Hr(i, l), d && Zr(i, l);
|
|
457
457
|
}
|
|
458
|
-
return Qr(r, t, d, s, n,
|
|
458
|
+
return Qr(r, t, d, s, n, pr.current, i);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
var G = j.ReactCurrentOwner, mr = j.ReactDebugCurrentFrame;
|
|
@@ -469,7 +469,7 @@ function de() {
|
|
|
469
469
|
var K;
|
|
470
470
|
K = !1;
|
|
471
471
|
function X(r) {
|
|
472
|
-
return typeof r == "object" && r !== null && r.$$typeof ===
|
|
472
|
+
return typeof r == "object" && r !== null && r.$$typeof === g;
|
|
473
473
|
}
|
|
474
474
|
function yr() {
|
|
475
475
|
{
|
|
@@ -578,7 +578,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
578
578
|
var d = ee();
|
|
579
579
|
d ? t += d : t += yr();
|
|
580
580
|
var u;
|
|
581
|
-
r === null ? u = "null" : q(r) ? u = "array" : r !== void 0 && r.$$typeof ===
|
|
581
|
+
r === null ? u = "null" : q(r) ? u = "array" : r !== void 0 && r.$$typeof === g ? (u = "<" + (_(r.type) || "Unknown") + " />", t = " Did you accidentally export a JSX literal instead of a component?") : u = typeof r, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, t);
|
|
582
582
|
}
|
|
583
583
|
var l = re(r, e, a, s, o);
|
|
584
584
|
if (l == null)
|
|
@@ -597,17 +597,17 @@ Check the top-level render call using <` + a + ">.");
|
|
|
597
597
|
Rr(m, r);
|
|
598
598
|
}
|
|
599
599
|
if (F.call(e, "key")) {
|
|
600
|
-
var
|
|
600
|
+
var w = _(r), b = Object.keys(e).filter(function(ce) {
|
|
601
601
|
return ce !== "key";
|
|
602
602
|
}), H = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
-
if (!xr[
|
|
603
|
+
if (!xr[w + H]) {
|
|
604
604
|
var le = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
605
605
|
f(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`, H,
|
|
610
|
+
<%s key={someKey} {...props} />`, H, w, le, w), xr[w + H] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
return r === y ? te(l) : ne(l), l;
|
|
@@ -625,7 +625,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
625
625
|
}
|
|
626
626
|
process.env.NODE_ENV === "production" ? Z.exports = fe() : Z.exports = de();
|
|
627
627
|
var ve = Z.exports;
|
|
628
|
-
const
|
|
628
|
+
const ge = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
|
|
629
629
|
|
|
630
630
|
.starasia-badges {
|
|
631
631
|
display: flex;
|
|
@@ -645,7 +645,7 @@ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@4
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
.starasia-badges-xs.starasia-badges-rounded {
|
|
648
|
-
border-radius: var(--starasia-ui-radii-
|
|
648
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
.starasia-badges-sm {
|
|
@@ -655,7 +655,7 @@ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@4
|
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
.starasia-badges-sm.starasia-badges-rounded {
|
|
658
|
-
border-radius: var(--starasia-ui-radii-
|
|
658
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
.starasia-badges-md {
|
|
@@ -665,7 +665,7 @@ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@4
|
|
|
665
665
|
}
|
|
666
666
|
|
|
667
667
|
.starasia-badges-md.starasia-badges-rounded {
|
|
668
|
-
border-radius: var(--starasia-ui-radii-
|
|
668
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
669
669
|
}
|
|
670
670
|
|
|
671
671
|
.starasia-badges-lg {
|
|
@@ -694,43 +694,43 @@ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@4
|
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
.starasia-badges-success {
|
|
697
|
-
border-color: var(--starasia-ui-color-green-50, #
|
|
698
|
-
background: var(--starasia-ui-color-green-50, #
|
|
699
|
-
color: var(--starasia-ui-color-green-700, #
|
|
697
|
+
border-color: var(--starasia-ui-color-green-50, #dcf6ea);
|
|
698
|
+
background: var(--starasia-ui-color-green-50, #dcf6ea);
|
|
699
|
+
color: var(--starasia-ui-color-green-700, #208958);
|
|
700
700
|
}
|
|
701
701
|
|
|
702
702
|
.starasia-badges-success.starasia-badges-border {
|
|
703
|
-
border-color: var(--starasia-ui-color-green-700, #
|
|
703
|
+
border-color: var(--starasia-ui-color-green-700, #208958);
|
|
704
704
|
}
|
|
705
705
|
|
|
706
706
|
.starasia-badges-danger {
|
|
707
|
-
border-color: var(--starasia-ui-color-red-50, #
|
|
708
|
-
background: var(--starasia-ui-color-red-50, #
|
|
709
|
-
color: var(--starasia-ui-color-red-700, #
|
|
707
|
+
border-color: var(--starasia-ui-color-red-50, #fff0f3);
|
|
708
|
+
background: var(--starasia-ui-color-red-50, #fff0f3);
|
|
709
|
+
color: var(--starasia-ui-color-red-700, #a4133c);
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
.starasia-badges-danger.starasia-badges-border {
|
|
713
|
-
border-color: var(--starasia-ui-color-red-700, #
|
|
713
|
+
border-color: var(--starasia-ui-color-red-700, #a4133c);
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
.starasia-badges-warning {
|
|
717
|
-
border-color: var(--starasia-ui-color-
|
|
718
|
-
background: var(--starasia-ui-color-
|
|
719
|
-
color: var(--starasia-ui-color-
|
|
717
|
+
border-color: var(--starasia-ui-color-orange-50, #faf6e0);
|
|
718
|
+
background: var(--starasia-ui-color-orange-50, #faf6e0);
|
|
719
|
+
color: var(--starasia-ui-color-orange-700, #986800);
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
.starasia-badges-warning.starasia-badges-border {
|
|
723
|
-
border-color: var(--starasia-ui-color-
|
|
723
|
+
border-color: var(--starasia-ui-color-orange-700, #986800);
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
.starasia-badges-dark {
|
|
727
727
|
border-color: var(--starasia-ui-color-gray-100, #eff3f8);
|
|
728
728
|
background: var(--starasia-ui-color-gray-100, #eff3f8);
|
|
729
|
-
color: var(--starasia-ui-color-gray-700, #
|
|
729
|
+
color: var(--starasia-ui-color-gray-700, #48504c);
|
|
730
730
|
}
|
|
731
731
|
|
|
732
732
|
.starasia-badges-dark.starasia-badges-border {
|
|
733
|
-
border-color: var(--starasia-ui-color-gray-700, #
|
|
733
|
+
border-color: var(--starasia-ui-color-gray-700, #48504c);
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
.starasia-badges-neutral {
|
|
@@ -742,13 +742,13 @@ const pe = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@4
|
|
|
742
742
|
.starasia-badges-neutral.starasia-badges-border {
|
|
743
743
|
border-color: var(--starasia-ui-color-purple-500, #7e39c5);
|
|
744
744
|
}
|
|
745
|
-
`,
|
|
746
|
-
if (!document.getElementById(
|
|
747
|
-
const
|
|
748
|
-
|
|
745
|
+
`, wr = "starasia-badges-styles", pe = (v) => {
|
|
746
|
+
if (!document.getElementById(wr)) {
|
|
747
|
+
const g = document.createElement("style");
|
|
748
|
+
g.id = wr, g.textContent = v, document.head.appendChild(g);
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
|
-
ge
|
|
751
|
+
pe(ge);
|
|
752
752
|
const N = {
|
|
753
753
|
xs: 14,
|
|
754
754
|
sm: 16,
|
|
@@ -756,13 +756,13 @@ const N = {
|
|
|
756
756
|
lg: 18
|
|
757
757
|
}, me = ({
|
|
758
758
|
size: v = "md",
|
|
759
|
-
variant:
|
|
759
|
+
variant: g = "info",
|
|
760
760
|
text: R,
|
|
761
761
|
LeftIcon: y,
|
|
762
|
-
RightIcon:
|
|
762
|
+
RightIcon: p,
|
|
763
763
|
border: C,
|
|
764
764
|
corners: x = "rounded"
|
|
765
|
-
}) => /* @__PURE__ */ ve.jsxs("div", { className: be(v,
|
|
765
|
+
}) => /* @__PURE__ */ ve.jsxs("div", { className: be(v, g, C, x), children: [
|
|
766
766
|
y ? U.cloneElement(y, {
|
|
767
767
|
width: N[v],
|
|
768
768
|
height: N[v],
|
|
@@ -771,16 +771,16 @@ const N = {
|
|
|
771
771
|
}
|
|
772
772
|
}) : null,
|
|
773
773
|
R,
|
|
774
|
-
|
|
774
|
+
p ? U.cloneElement(p, {
|
|
775
775
|
width: N[v],
|
|
776
776
|
height: N[v],
|
|
777
777
|
style: {
|
|
778
778
|
color: "inherit"
|
|
779
779
|
}
|
|
780
780
|
}) : null
|
|
781
|
-
] }), be = (v,
|
|
782
|
-
let
|
|
783
|
-
return v &&
|
|
781
|
+
] }), be = (v, g, R, y) => {
|
|
782
|
+
let p = ["starasia-badges"];
|
|
783
|
+
return v && p.push(`starasia-badges-${v}`), g && p.push(`starasia-badges-${g}`), R && p.push("starasia-badges-border"), y === "rounded" ? p.push("starasia-badges-rounded") : p.push("starasia-badges-circular"), p.join(" ");
|
|
784
784
|
};
|
|
785
785
|
export {
|
|
786
786
|
me as Badges
|
package/dist/badges.umd.js
CHANGED
|
@@ -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 rr;function Cr(){if(rr)return I;rr=1;var v=R,p=Symbol.for("react.element"),S=Symbol.for("react.fragment"),
|
|
9
|
+
*/var rr;function Cr(){if(rr)return I;rr=1;var v=R,p=Symbol.for("react.element"),S=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,g=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j={key:!0,ref:!0,__self:!0,__source:!0};function T(O,c,k){var h,E={},w=null,V=null;k!==void 0&&(w=""+k),c.key!==void 0&&(w=""+c.key),c.ref!==void 0&&(V=c.ref);for(h in c)y.call(c,h)&&!j.hasOwnProperty(h)&&(E[h]=c[h]);if(O&&O.defaultProps)for(h in c=O.defaultProps,c)E[h]===void 0&&(E[h]=c[h]);return{$$typeof:p,type:O,key:w,ref:V,props:E,_owner:g.current}}return I.Fragment=S,I.jsx=T,I.jsxs=T,I}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,20 @@
|
|
|
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 er;function jr(){return er||(er=1,process.env.NODE_ENV!=="production"&&function(){var v=R,p=Symbol.for("react.element"),S=Symbol.for("react.portal"),
|
|
17
|
+
*/var er;function jr(){return er||(er=1,process.env.NODE_ENV!=="production"&&function(){var v=R,p=Symbol.for("react.element"),S=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),O=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),nr=Symbol.iterator,Ir="@@iterator";function Yr(r){if(r===null||typeof r!="object")return null;var e=nr&&r[nr]||r[Ir];return typeof e=="function"?e:null}var D=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(r){{for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];Wr("error",r,a)}}function Wr(r,e,a){{var n=D.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(e+="%s",a=a.concat([s]));var o=a.map(function(i){return String(i)});o.unshift("Warning: "+e),Function.prototype.apply.call(console[r],console,o)}}var $r=!1,Lr=!1,Vr=!1,Mr=!1,Nr=!1,tr;tr=Symbol.for("react.module.reference");function Ur(r){return!!(typeof r=="string"||typeof r=="function"||r===y||r===j||Nr||r===g||r===k||r===h||Mr||r===V||$r||Lr||Vr||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===E||r.$$typeof===T||r.$$typeof===O||r.$$typeof===c||r.$$typeof===tr||r.getModuleId!==void 0))}function Br(r,e,a){var n=r.displayName;if(n)return n;var s=e.displayName||e.name||"";return s!==""?a+"("+s+")":a}function ir(r){return r.displayName||"Context"}function _(r){if(r==null)return null;if(typeof r.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case y:return"Fragment";case S:return"Portal";case j:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case h:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case O:var e=r;return ir(e)+".Consumer";case T:var a=r;return ir(a._context)+".Provider";case c:return Br(r,r.render,"ForwardRef");case E:var n=r.displayName||null;return n!==null?n:_(r.type)||"Memo";case w:{var s=r,o=s._payload,i=s._init;try{return _(i(o))}catch{return null}}}return null}var P=Object.assign,W=0,sr,or,ur,lr,cr,fr,dr;function vr(){}vr.__reactDisabledLog=!0;function zr(){{if(W===0){sr=console.log,or=console.info,ur=console.warn,lr=console.error,cr=console.group,fr=console.groupCollapsed,dr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:vr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}W++}}function Jr(){{if(W--,W===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},r,{value:sr}),info:P({},r,{value:or}),warn:P({},r,{value:ur}),error:P({},r,{value:lr}),group:P({},r,{value:cr}),groupCollapsed:P({},r,{value:fr}),groupEnd:P({},r,{value:dr})})}W<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=D.ReactCurrentDispatcher,G;function M(r,e,a){{if(G===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);G=n&&n[1]||""}return`
|
|
18
18
|
`+G+r}}var K=!1,N;{var Gr=typeof WeakMap=="function"?WeakMap:Map;N=new Gr}function pr(r,e){if(!r||K)return"";{var a=N.get(r);if(a!==void 0)return a}var n;K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var o;o=J.current,J.current=null,zr();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(b){n=b}Reflect.construct(r,[],i)}else{try{i.call()}catch(b){n=b}r.call(i.prototype)}}else{try{throw Error()}catch(b){n=b}r()}}catch(b){if(b&&n&&typeof b.stack=="string"){for(var t=b.stack.split(`
|
|
19
19
|
`),d=n.stack.split(`
|
|
20
|
-
`),u=t.length-1,l=d.length-1;u>=1&&l>=0&&t[u]!==d[l];)l--;for(;u>=1&&l>=0;u--,l--)if(t[u]!==d[l]){if(u!==1||l!==1)do if(u--,l--,l<0||t[u]!==d[l]){var
|
|
21
|
-
`+t[u].replace(" at new "," at ");return r.displayName&&
|
|
20
|
+
`),u=t.length-1,l=d.length-1;u>=1&&l>=0&&t[u]!==d[l];)l--;for(;u>=1&&l>=0;u--,l--)if(t[u]!==d[l]){if(u!==1||l!==1)do if(u--,l--,l<0||t[u]!==d[l]){var m=`
|
|
21
|
+
`+t[u].replace(" at new "," at ");return r.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",r.displayName)),typeof r=="function"&&N.set(r,m),m}while(u>=1&&l>=0);break}}}finally{K=!1,J.current=o,Jr(),Error.prepareStackTrace=s}var F=r?r.displayName||r.name:"",C=F?M(F):"";return typeof r=="function"&&N.set(r,C),C}function Kr(r,e,a){return pr(r,!1)}function qr(r){var e=r.prototype;return!!(e&&e.isReactComponent)}function U(r,e,a){if(r==null)return"";if(typeof r=="function")return pr(r,qr(r));if(typeof r=="string")return M(r);switch(r){case k:return M("Suspense");case h:return M("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case c:return Kr(r.render);case E:return U(r.type,e,a);case w:{var n=r,s=n._payload,o=n._init;try{return U(o(s),e,a)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,gr={},br=D.ReactDebugCurrentFrame;function B(r){if(r){var e=r._owner,a=U(r.type,r._source,e?e.type:null);br.setExtraStackFrame(a)}else br.setExtraStackFrame(null)}function Xr(r,e,a,n,s){{var o=Function.call.bind($);for(var i in r)if(o(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var d=Error((n||"React class")+": "+a+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}t=r[i](e,i,n,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){t=u}t&&!(t instanceof Error)&&(B(s),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",a,i,typeof t),B(null)),t instanceof Error&&!(t.message in gr)&&(gr[t.message]=!0,B(s),f("Failed %s type: %s",a,t.message),B(null))}}}var Hr=Array.isArray;function q(r){return Hr(r)}function Zr(r){{var e=typeof Symbol=="function"&&Symbol.toStringTag,a=e&&r[Symbol.toStringTag]||r.constructor.name||"Object";return a}}function Qr(r){try{return hr(r),!1}catch{return!0}}function hr(r){return""+r}function mr(r){if(Qr(r))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Zr(r)),hr(r)}var yr=D.ReactCurrentOwner,re={key:!0,ref:!0,__self:!0,__source:!0},Er,Rr;function ee(r){if($.call(r,"ref")){var e=Object.getOwnPropertyDescriptor(r,"ref").get;if(e&&e.isReactWarning)return!1}return r.ref!==void 0}function ae(r){if($.call(r,"key")){var e=Object.getOwnPropertyDescriptor(r,"key").get;if(e&&e.isReactWarning)return!1}return r.key!==void 0}function ne(r,e){typeof r.ref=="string"&&yr.current}function te(r,e){{var a=function(){Er||(Er=!0,f("%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))};a.isReactWarning=!0,Object.defineProperty(r,"key",{get:a,configurable:!0})}}function ie(r,e){{var a=function(){Rr||(Rr=!0,f("%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))};a.isReactWarning=!0,Object.defineProperty(r,"ref",{get:a,configurable:!0})}}var se=function(r,e,a,n,s,o,i){var t={$$typeof:p,type:r,key:e,ref:a,props:i,_owner:o};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function oe(r,e,a,n,s){{var o,i={},t=null,d=null;a!==void 0&&(mr(a),t=""+a),ae(e)&&(mr(e.key),t=""+e.key),ee(e)&&(d=e.ref,ne(e,s));for(o in e)$.call(e,o)&&!re.hasOwnProperty(o)&&(i[o]=e[o]);if(r&&r.defaultProps){var u=r.defaultProps;for(o in u)i[o]===void 0&&(i[o]=u[o])}if(t||d){var l=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&te(i,l),d&&ie(i,l)}return se(r,t,d,s,n,yr.current,i)}}var X=D.ReactCurrentOwner,_r=D.ReactDebugCurrentFrame;function A(r){if(r){var e=r._owner,a=U(r.type,r._source,e?e.type:null);_r.setExtraStackFrame(a)}else _r.setExtraStackFrame(null)}var H;H=!1;function Z(r){return typeof r=="object"&&r!==null&&r.$$typeof===p}function xr(){{if(X.current){var r=_(X.current.type);if(r)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+r+"`."}return""}}function ue(r){return""}var Sr={};function le(r){{var e=xr();if(!e){var a=typeof r=="string"?r:r.displayName||r.name;a&&(e=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+a+">.")}return e}}function Tr(r,e){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var a=le(e);if(Sr[a])return;Sr[a]=!0;var n="";r&&r._owner&&r._owner!==X.current&&(n=" It was passed a child from "+_(r._owner.type)+"."),A(r),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,n),A(null)}}function
|
|
25
|
+
Check the top-level render call using <`+a+">.")}return e}}function Tr(r,e){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var a=le(e);if(Sr[a])return;Sr[a]=!0;var n="";r&&r._owner&&r._owner!==X.current&&(n=" It was passed a child from "+_(r._owner.type)+"."),A(r),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,n),A(null)}}function Or(r,e){{if(typeof r!="object")return;if(q(r))for(var a=0;a<r.length;a++){var n=r[a];Z(n)&&Tr(n,e)}else if(Z(r))r._store&&(r._store.validated=!0);else if(r){var s=Yr(r);if(typeof s=="function"&&s!==r.entries)for(var o=s.call(r),i;!(i=o.next()).done;)Z(i.value)&&Tr(i.value,e)}}}function ce(r){{var e=r.type;if(e==null||typeof e=="string")return;var a;if(typeof e=="function")a=e.propTypes;else if(typeof e=="object"&&(e.$$typeof===c||e.$$typeof===E))a=e.propTypes;else return;if(a){var n=_(e);Xr(a,r.props,"prop",n,r)}else if(e.PropTypes!==void 0&&!H){H=!0;var s=_(e);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof e.getDefaultProps=="function"&&!e.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fe(r){{for(var e=Object.keys(r.props),a=0;a<e.length;a++){var n=e[a];if(n!=="children"&&n!=="key"){A(r),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}r.ref!==null&&(A(r),f("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var wr={};function Pr(r,e,a,n,s,o){{var i=Ur(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=ue();d?t+=d:t+=xr();var u;r===null?u="null":q(r)?u="array":r!==void 0&&r.$$typeof===p?(u="<"+(_(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):u=typeof r,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,t)}var l=oe(r,e,a,s,o);if(l==null)return l;if(i){var m=e.children;if(m!==void 0)if(n)if(q(m)){for(var F=0;F<m.length;F++)Or(m[F],r);Object.freeze&&Object.freeze(m)}else f("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 Or(m,r)}if($.call(e,"key")){var C=_(r),b=Object.keys(e).filter(function(he){return he!=="key"}),Q=b.length>0?"{key: someKey, "+b.join(": ..., ")+": ...}":"{key: someKey}";if(!wr[C+Q]){var be=b.length>0?"{"+b.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Q,C,be,C),
|
|
30
|
+
<%s key={someKey} {...props} />`,Q,C,be,C),wr[C+Q]=!0}}return r===y?fe(l):ce(l),l}}function de(r,e,a){return Pr(r,e,a,!0)}function ve(r,e,a){return Pr(r,e,a,!1)}var pe=ve,ge=de;Y.Fragment=y,Y.jsx=pe,Y.jsxs=ge}()),Y}process.env.NODE_ENV==="production"?z.exports=Cr():z.exports=jr();var kr=z.exports;const Dr=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
|
|
31
31
|
|
|
32
32
|
.starasia-badges {
|
|
33
33
|
display: flex;
|
|
@@ -47,7 +47,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.starasia-badges-xs.starasia-badges-rounded {
|
|
50
|
-
border-radius: var(--starasia-ui-radii-
|
|
50
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.starasia-badges-sm {
|
|
@@ -57,7 +57,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.starasia-badges-sm.starasia-badges-rounded {
|
|
60
|
-
border-radius: var(--starasia-ui-radii-
|
|
60
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.starasia-badges-md {
|
|
@@ -67,7 +67,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.starasia-badges-md.starasia-badges-rounded {
|
|
70
|
-
border-radius: var(--starasia-ui-radii-
|
|
70
|
+
border-radius: var(--starasia-ui-radii-xs, 4px);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.starasia-badges-lg {
|
|
@@ -96,43 +96,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.starasia-badges-success {
|
|
99
|
-
border-color: var(--starasia-ui-color-green-50, #
|
|
100
|
-
background: var(--starasia-ui-color-green-50, #
|
|
101
|
-
color: var(--starasia-ui-color-green-700, #
|
|
99
|
+
border-color: var(--starasia-ui-color-green-50, #dcf6ea);
|
|
100
|
+
background: var(--starasia-ui-color-green-50, #dcf6ea);
|
|
101
|
+
color: var(--starasia-ui-color-green-700, #208958);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.starasia-badges-success.starasia-badges-border {
|
|
105
|
-
border-color: var(--starasia-ui-color-green-700, #
|
|
105
|
+
border-color: var(--starasia-ui-color-green-700, #208958);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.starasia-badges-danger {
|
|
109
|
-
border-color: var(--starasia-ui-color-red-50, #
|
|
110
|
-
background: var(--starasia-ui-color-red-50, #
|
|
111
|
-
color: var(--starasia-ui-color-red-700, #
|
|
109
|
+
border-color: var(--starasia-ui-color-red-50, #fff0f3);
|
|
110
|
+
background: var(--starasia-ui-color-red-50, #fff0f3);
|
|
111
|
+
color: var(--starasia-ui-color-red-700, #a4133c);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.starasia-badges-danger.starasia-badges-border {
|
|
115
|
-
border-color: var(--starasia-ui-color-red-700, #
|
|
115
|
+
border-color: var(--starasia-ui-color-red-700, #a4133c);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.starasia-badges-warning {
|
|
119
|
-
border-color: var(--starasia-ui-color-
|
|
120
|
-
background: var(--starasia-ui-color-
|
|
121
|
-
color: var(--starasia-ui-color-
|
|
119
|
+
border-color: var(--starasia-ui-color-orange-50, #faf6e0);
|
|
120
|
+
background: var(--starasia-ui-color-orange-50, #faf6e0);
|
|
121
|
+
color: var(--starasia-ui-color-orange-700, #986800);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.starasia-badges-warning.starasia-badges-border {
|
|
125
|
-
border-color: var(--starasia-ui-color-
|
|
125
|
+
border-color: var(--starasia-ui-color-orange-700, #986800);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.starasia-badges-dark {
|
|
129
129
|
border-color: var(--starasia-ui-color-gray-100, #eff3f8);
|
|
130
130
|
background: var(--starasia-ui-color-gray-100, #eff3f8);
|
|
131
|
-
color: var(--starasia-ui-color-gray-700, #
|
|
131
|
+
color: var(--starasia-ui-color-gray-700, #48504c);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
.starasia-badges-dark.starasia-badges-border {
|
|
135
|
-
border-color: var(--starasia-ui-color-gray-700, #
|
|
135
|
+
border-color: var(--starasia-ui-color-gray-700, #48504c);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.starasia-badges-neutral {
|
|
@@ -144,4 +144,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
144
144
|
.starasia-badges-neutral.starasia-badges-border {
|
|
145
145
|
border-color: var(--starasia-ui-color-purple-500, #7e39c5);
|
|
146
146
|
}
|
|
147
|
-
`,ar="starasia-badges-styles";(v=>{if(!document.getElementById(ar)){const p=document.createElement("style");p.id=ar,p.textContent=v,document.head.appendChild(p)}})(Dr);const L={xs:14,sm:16,md:18,lg:18},Ar=({size:v="md",variant:p="info",text:S,LeftIcon:
|
|
147
|
+
`,ar="starasia-badges-styles";(v=>{if(!document.getElementById(ar)){const p=document.createElement("style");p.id=ar,p.textContent=v,document.head.appendChild(p)}})(Dr);const L={xs:14,sm:16,md:18,lg:18},Ar=({size:v="md",variant:p="info",text:S,LeftIcon:y,RightIcon:g,border:j,corners:T="rounded"})=>kr.jsxs("div",{className:Fr(v,p,j,T),children:[y?R.cloneElement(y,{width:L[v],height:L[v],style:{color:"inherit"}}):null,S,g?R.cloneElement(g,{width:L[v],height:L[v],style:{color:"inherit"}}):null]}),Fr=(v,p,S,y)=>{let g=["starasia-badges"];return v&&g.push(`starasia-badges-${v}`),p&&g.push(`starasia-badges-${p}`),S&&g.push("starasia-badges-border"),y==="rounded"?g.push("starasia-badges-rounded"):g.push("starasia-badges-circular"),g.join(" ")};x.Badges=Ar,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/badges",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Badges component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/badges.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.13",
|
|
27
31
|
"@vitejs/plugin-react": "^4.2.1",
|