@rws-aoa/react-library
Version:
RWS AOA Design System
51 lines (50 loc) • 2.56 kB
JavaScript
import { jsx as h } from "react/jsx-runtime";
import { c as y } from "../../../chunks/compiler-runtime.CrLvXwKf.js";
import { IconButton as g } from "@mui/material";
import { l as k } from "../../../chunks/lodash.DPVO3Hgf.js";
import { AoaTooltip as B } from "../tooltip/Tooltip.js";
function I(v) {
const e = y.c(33);
let l, o, r, t, a, i, d, s, n, c, p, b;
if (e[0] !== v) {
const {
ref: C,
...R
} = v;
o = R, l = g, r = o.label, a = o["data-qa"], i = !0, d = !0, s = !0, n = o.disabled, c = o.onClick, p = C, b = "button", t = k.merge({
color: "var(--color-primary)",
border: "1px solid var(--color-primary)",
borderRadius: 0,
":hover, :active, :focus": {
color: "var(--color-primary-hover)",
borderColor: "var(--color-primary-hover)"
},
":disabled": {
backgroundColor: "transparent",
borderColor: "var(--color-text-disabled)",
color: "var(--color-text-disabled)"
},
":focus": {
outline: "2px dashed var(--color-text)",
outlineOffset: 3,
boxShadow: "none"
},
...o.inline && {
border: "none",
padding: 0
}
}, o.sx), e[0] = v, e[1] = l, e[2] = o, e[3] = r, e[4] = t, e[5] = a, e[6] = i, e[7] = d, e[8] = s, e[9] = n, e[10] = c, e[11] = p, e[12] = b;
} else
l = e[1], o = e[2], r = e[3], t = e[4], a = e[5], i = e[6], d = e[7], s = e[8], n = e[9], c = e[10], p = e[11], b = e[12];
let m;
e[13] !== l || e[14] !== o.icon || e[15] !== r || e[16] !== t || e[17] !== a || e[18] !== i || e[19] !== d || e[20] !== s || e[21] !== n || e[22] !== c || e[23] !== p || e[24] !== b ? (m = /* @__PURE__ */ h(l, { "aria-label": r, "data-qa": a, disableFocusRipple: i, disableRipple: d, disableTouchRipple: s, disabled: n, onClick: c, ref: p, role: b, sx: t, children: o.icon }), e[13] = l, e[14] = o.icon, e[15] = r, e[16] = t, e[17] = a, e[18] = i, e[19] = d, e[20] = s, e[21] = n, e[22] = c, e[23] = p, e[24] = b, e[25] = m) : m = e[25];
const f = m;
let u;
e[26] !== f || e[27] !== o.disabled || e[28] !== o.label ? (u = o.disabled ? /* @__PURE__ */ h("span", { "aria-label": o.label, "data-testid": "disabled-span-wrapper", role: "tooltip", children: f }) : f, e[26] = f, e[27] = o.disabled, e[28] = o.label, e[29] = u) : u = e[29];
let x;
return e[30] !== o.label || e[31] !== u ? (x = /* @__PURE__ */ h(B, { title: o.label, children: u }), e[30] = o.label, e[31] = u, e[32] = x) : x = e[32], x;
}
export {
I as AoaIconButton
};
//# sourceMappingURL=IconButton.js.map