@lanaco/lnc-react-ui
Version:
React component library
130 lines (128 loc) • 2.48 kB
JavaScript
import { jsx as e } from "react/jsx-runtime";
import { forwardRef as y } from "react";
import { s as T } from "./emotion-styled.browser.esm-DfbrHHed.js";
import { T as $ } from "./react-toastify.esm-CUXbGoqt.js";
import { c as t, b as v } from "./utils-BUdHa0nB.js";
import { useTheme as C } from "./ThemeProvider.js";
const O = T.div`
& .lnc-notification {
& > div {
background-color: ${(o) => t(
o.theme,
"Notification",
o.color,
"enabled",
"background",
"backgroundOpacity"
)};
box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1),
0px 4px 6px -2px rgba(0, 0, 0, 0.05);
border: ${(o) => `1px solid ${t(
o.theme,
"Notification",
"default",
"enabled",
"border"
)}`};
border-radius: ${(o) => v(o.theme, "regular")};
}
& .Toastify__close-button {
& svg {
fill: ${(o) => t(
o.theme,
"Notification",
"default",
"enabled",
"icon"
)};
}
}
& .Toastify__toast--success {
& svg {
fill: ${(o) => t(
o.theme,
"Notification",
"success",
"enabled",
"icon"
)};
}
}
& .Toastify__toast--information {
& svg {
fill: ${(o) => t(
o.theme,
"Notification",
"information",
"enabled",
"icon"
)};
}
}
& .Toastify__toast--danger {
& svg {
fill: ${(o) => t(
o.theme,
"Notification",
"warning",
"enabled",
"icon"
)};
}
}
& .Toastify__toast--error {
& svg {
fill: ${(o) => t(
o.theme,
"Notification",
"danger",
"enabled",
"icon"
)};
}
}
}
`, j = y((o, i) => {
const {
position: a = "top-right",
autoClose: s = 5e5,
hideProgressBar: n = !0,
newestOnTop: r = !0,
closeOnClick: l = !0,
rtl: c = !1,
pauseOnFocusLoss: f = !1,
draggable: d = !1,
pauseOnHover: m = !1,
closeButton: u = !0,
className: p = "",
style: g = {},
size: b = "small",
toastContainerProps: h,
...x
} = o, { theme: N } = C(), _ = {
theme: N,
className: "lnc-ui-notification " + p,
style: g,
size: b
};
return /* @__PURE__ */ e(O, { ref: i, ..._, ...x, children: /* @__PURE__ */ e(
$,
{
position: a,
autoClose: s,
hideProgressBar: n,
newestOnTop: r,
closeOnClick: l,
rtl: c,
pauseOnFocusLoss: f,
draggable: d,
pauseOnHover: m,
closeButton: u,
className: "lnc-notification",
...h
}
) });
});
export {
j as default
};