asma-ui-core 3.108.0 → 3.108.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveSx as u } from "../../../helpers/sx.js";
|
|
2
|
-
import
|
|
2
|
+
import x from "clsx";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as b, jsxs as I } from "react/jsx-runtime";
|
|
5
5
|
var v = {
|
|
6
6
|
primary: {
|
|
7
7
|
backgroundColor: "var(--colors-badge-background)",
|
|
@@ -36,46 +36,42 @@ var v = {
|
|
|
36
36
|
"top-left": "top-0 left-0 -translate-x-1/2 -translate-y-1/2 origin-[0%_0%]",
|
|
37
37
|
"bottom-right": "bottom-0 right-0 translate-x-1/2 translate-y-1/2 origin-[100%_100%]",
|
|
38
38
|
"bottom-left": "bottom-0 left-0 -translate-x-1/2 translate-y-1/2 origin-[0%_100%]"
|
|
39
|
-
}, g = "& .MuiBadge-badge",
|
|
40
|
-
const j = typeof o == "number" ? o : void 0, f = a && typeof a == "object" && !Array.isArray(a) ? a : {}, A = u(f[g]), O = u(Object.fromEntries(Object.entries(f).filter(([z]) => z !== g))), r = h === "dot", l = r &&
|
|
41
|
-
borderColor: r ? "var(--colors-badge-border-dot)" : "var(--colors-badge-border-count)",
|
|
42
|
-
borderStyle: "solid",
|
|
43
|
-
borderWidth: r ? "var(--border-badge-dot)" : "var(--border-badge-count)"
|
|
44
|
-
} : {}, R = t && !s && e ? {
|
|
39
|
+
}, g = "& .MuiBadge-badge", Q = ({ color: n = "primary", dataTest: y, size: i = "medium", badgeContent: o, max: T, showZero: Z, variant: h = "standard", purpose: w = "notification", statusMessage: _, invisible: S, anchorOrigin: c, children: d, className: p, sx: a, overlap: G, classes: H, slots: M, slotProps: m, component: X, tabIndex: Y, "aria-label": e, ...k }) => {
|
|
40
|
+
const j = typeof o == "number" ? o : void 0, f = a && typeof a == "object" && !Array.isArray(a) ? a : {}, A = u(f[g]), O = u(Object.fromEntries(Object.entries(f).filter(([z]) => z !== g))), r = h === "dot", l = r && w !== "notification", t = d === void 0, s = !!S || !r && (o === 0 || o === void 0 || o === null), D = r ? null : typeof o == "number" && o > 99 ? "99+" : o, N = typeof o == "number" && o > 0 && o < 10, R = c?.vertical ?? "top", B = c?.horizontal ?? "right", C = n === "primary" && !l ? { boxShadow: r ? "inset 0 0 0 var(--border-badge-dot) var(--colors-badge-border-dot)" : "inset 0 0 0 var(--border-badge-count) var(--colors-badge-border-count)" } : {}, E = t && !s && e ? {
|
|
45
41
|
role: "img",
|
|
46
42
|
"aria-label": e
|
|
47
43
|
} : {}, $ = !t && e ? { "aria-label": e } : {};
|
|
48
44
|
return /* @__PURE__ */ I("span", {
|
|
49
|
-
className: t ?
|
|
45
|
+
className: t ? x("inline-flex shrink-0 align-middle", p) : "relative inline-flex shrink-0 align-middle",
|
|
50
46
|
"data-testid": y,
|
|
51
47
|
style: O,
|
|
52
48
|
...$,
|
|
53
|
-
...
|
|
49
|
+
...E,
|
|
54
50
|
...k,
|
|
55
51
|
children: [
|
|
56
52
|
d,
|
|
57
|
-
!s && /* @__PURE__ */
|
|
53
|
+
!s && /* @__PURE__ */ b("span", {
|
|
58
54
|
"aria-hidden": "true",
|
|
59
|
-
className:
|
|
55
|
+
className: x("box-border flex items-center justify-center whitespace-nowrap font-roboto font-semibold", !t && "absolute z-[1]", !t && L[`${R}-${B}`], l ? "h-[8px] w-[8px] min-w-[8px] rounded-full p-0" : r ? "h-[12px] w-[12px] min-w-[12px] rounded-full p-0" : i === "small" ? "h-[16px] w-max min-w-[16px] rounded-[20px] px-[4px] text-[0.75rem]" : "h-[20px] min-w-[20px] rounded-[20px] px-[6px] text-sm leading-5", !r && i === "medium" && N && "w-[20px]", !t && p, m?.badge?.className),
|
|
60
56
|
style: {
|
|
61
|
-
...v[
|
|
57
|
+
...v[n] ?? v.default,
|
|
62
58
|
...l ? { backgroundColor: "var(--colors-gama-500)" } : {},
|
|
63
|
-
...
|
|
59
|
+
...C,
|
|
64
60
|
...A,
|
|
65
61
|
...m?.badge?.style
|
|
66
62
|
},
|
|
67
|
-
children:
|
|
63
|
+
children: D
|
|
68
64
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ b("span", {
|
|
70
66
|
"aria-atomic": "true",
|
|
71
67
|
"aria-live": "polite",
|
|
72
68
|
className: "sr-only",
|
|
73
69
|
role: "status",
|
|
74
|
-
children: s || j === void 0 ? "" :
|
|
70
|
+
children: s || j === void 0 ? "" : _ ?? ""
|
|
75
71
|
})
|
|
76
72
|
]
|
|
77
73
|
});
|
|
78
74
|
};
|
|
79
75
|
export {
|
|
80
|
-
|
|
76
|
+
Q as StyledBadge
|
|
81
77
|
};
|