@cgi-learning-hub/ui
Version:
@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features
63 lines (62 loc) • 1.77 kB
JavaScript
import { H } from "./generateUtilityClasses-B_xKAflz.js";
function E(c, m) {
const N = c.charCodeAt(2);
return c[0] === "o" && c[1] === "n" && N >= 65 && N <= 90 && typeof m == "function";
}
function j(c, m) {
if (!c)
return m;
function N(h, i) {
const s = {};
return Object.keys(i).forEach((A) => {
E(A, i[A]) && typeof h[A] == "function" && (s[A] = (...n) => {
h[A](...n), i[A](...n);
});
}), s;
}
if (typeof c == "function" || typeof m == "function")
return (h) => {
const i = typeof m == "function" ? m(h) : m, s = typeof c == "function" ? c({
...h,
...i
}) : c, A = H(h == null ? void 0 : h.className, i == null ? void 0 : i.className, s == null ? void 0 : s.className), n = N(s, i);
return {
...i,
...s,
...n,
...!!A && {
className: A
},
...(i == null ? void 0 : i.style) && (s == null ? void 0 : s.style) && {
style: {
...i.style,
...s.style
}
},
...(i == null ? void 0 : i.sx) && (s == null ? void 0 : s.sx) && {
sx: [...Array.isArray(i.sx) ? i.sx : [i.sx], ...Array.isArray(s.sx) ? s.sx : [s.sx]]
}
};
};
const y = m, f = N(c, y), C = H(y == null ? void 0 : y.className, c == null ? void 0 : c.className);
return {
...m,
...c,
...f,
...!!C && {
className: C
},
...(y == null ? void 0 : y.style) && (c == null ? void 0 : c.style) && {
style: {
...y.style,
...c.style
}
},
...(y == null ? void 0 : y.sx) && (c == null ? void 0 : c.sx) && {
sx: [...Array.isArray(y.sx) ? y.sx : [y.sx], ...Array.isArray(c.sx) ? c.sx : [c.sx]]
}
};
}
export {
j as m
};