@rws-aoa/react-library
Version:
RWS AOA Design System
41 lines (40 loc) • 1.84 kB
JavaScript
import { jsx as h } from "react/jsx-runtime";
import { c as U } from "../../../chunks/compiler-runtime.hDcrsMwn.js";
import { CircularProgress as k } from "@mui/material";
import { l as B } from "../../../chunks/lodash.CA_K01A9.js";
import { AoaButton as C } from "../../atoms/button/Button.js";
function P(b) {
const e = U.c(30);
let l, o, i, s, t, r, a, n, m, d;
e[0] !== b ? ({
isUploading: t,
isDisabled: i,
children: l,
sx: m,
isNeverDisabled: s,
type: d,
files: o,
setIsUploading: n,
onClick: r,
...a
} = b, e[0] = b, e[1] = l, e[2] = o, e[3] = i, e[4] = s, e[5] = t, e[6] = r, e[7] = a, e[8] = n, e[9] = m, e[10] = d) : (l = e[1], o = e[2], i = e[3], s = e[4], t = e[5], r = e[6], a = e[7], n = e[8], m = e[9], d = e[10]);
let p;
e[11] !== o || e[12] !== i || e[13] !== s || e[14] !== t ? (p = s ? !1 : !!i || t || Object.keys(o ?? []).length < 1, e[11] = o, e[12] = i, e[13] = s, e[14] = t, e[15] = p) : p = e[15];
let g;
e[16] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ h(k, { "aria-label": "Uploading...", size: 20 }), e[16] = g) : g = e[16];
let c;
e[17] !== r || e[18] !== n ? (c = (y) => {
n(!0), r?.(y);
}, e[17] = r, e[18] = n, e[19] = c) : c = e[19];
let f;
e[20] !== m ? (f = B.merge({
marginRight: 0
}, m), e[20] = m, e[21] = f) : f = e[21];
const x = d ?? "primary";
let u;
return e[22] !== l || e[23] !== t || e[24] !== a || e[25] !== p || e[26] !== c || e[27] !== f || e[28] !== x ? (u = /* @__PURE__ */ h(C, { ...a, disabled: p, loading: t, loadingIndicator: g, loadingPosition: "start", onClick: c, sx: f, type: x, children: l }), e[22] = l, e[23] = t, e[24] = a, e[25] = p, e[26] = c, e[27] = f, e[28] = x, e[29] = u) : u = e[29], u;
}
export {
P as AoaUploadButton
};
//# sourceMappingURL=UploadButton.js.map