@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
92 lines (91 loc) • 3.9 kB
JavaScript
"use client";
import { jsx as v, jsxs as k } from "react/jsx-runtime";
import { d as F } from "./index.cKLI89Eg.js";
import { c as E } from "./index.DQOqod3i.js";
import { D as R } from "./Button.CCol--xy.js";
import { D as W } from "./Icon.DYtaQgbw.js";
import '../assets/Notification.2B81JHOp.css';const j = "ds-notification_root_1y4y5_1", L = "ds-notification_root--success_1y4y5_29", P = "ds-notification_root--error_1y4y5_33", V = "ds-notification_root--warning_1y4y5_37", z = "ds-notification_root--hide-icon_1y4y5_41", Y = "ds-notification_content_1y4y5_55", $ = "ds-notification_content--hide-close-button_1y4y5_62", q = "ds-notification_content--hide-icon_1y4y5_65", G = "ds-notification_icon_1y4y5_69", J = "ds-notification_message_1y4y5_73", K = "ds-notification_custom-action-area_1y4y5_188", e = {
root: j,
rootSuccess: L,
rootError: P,
rootWarning: V,
rootHideIcon: z,
content: Y,
contentHideCloseButton: $,
contentHideIcon: q,
icon: G,
message: J,
customActionArea: K
}, eo = ["success", "error", "warning", "info"], M = {
success: "circle-check-colored",
error: "diamond-exclamationmark-colored",
warning: "triangle-exclamationmark-colored",
info: "circle-info-colored"
}, Q = {
error: "alert",
warning: "alert",
info: "status",
success: "status"
}, no = (H) => {
const o = F.c(46);
let i, r, a, s, n, l, N, h;
o[0] !== H ? ({
children: i,
variant: N,
className: r,
closeButtonProps: a,
customActionArea: s,
hideIcon: h,
onClose: n,
...l
} = H, o[0] = H, o[1] = i, o[2] = r, o[3] = a, o[4] = s, o[5] = n, o[6] = l, o[7] = N, o[8] = h) : (i = o[1], r = o[2], a = o[3], s = o[4], n = o[5], l = o[6], N = o[7], h = o[8]);
const c = N === void 0 ? "info" : N, t = h === void 0 ? !1 : h;
let d;
o[9] !== a ? (d = a || {}, o[9] = a, o[10] = d) : d = o[10];
let _, A;
o[11] !== d ? ({
label: A,
..._
} = d, o[11] = d, o[12] = _, o[13] = A) : (_ = o[12], A = o[13]);
const S = A === void 0 ? "Close notification" : A, O = c === "success", T = c === "error", x = c === "warning";
let g;
o[14] !== r || o[15] !== t || o[16] !== O || o[17] !== T || o[18] !== x ? (g = E(e.root, r, {
[e.rootSuccess]: O,
[e.rootError]: T,
[e.rootWarning]: x,
[e.rootHideIcon]: t
}), o[14] = r, o[15] = t, o[16] = O, o[17] = T, o[18] = x, o[19] = g) : g = o[19];
const B = g, D = !n;
let C;
o[20] !== t || o[21] !== D ? (C = E(e.content, {
[e.contentHideCloseButton]: D,
[e.contentHideIcon]: t
}), o[20] = t, o[21] = D, o[22] = C) : C = o[22];
const b = C, w = Q[c];
let f;
o[23] !== t || o[24] !== c ? (f = !t && /* @__PURE__ */ v(W, { name: M[c], className: e.icon, "aria-hidden": "true" }), o[23] = t, o[24] = c, o[25] = f) : f = o[25];
let m;
o[26] !== i ? (m = /* @__PURE__ */ v("div", { className: e.message, children: i }), o[26] = i, o[27] = m) : m = o[27];
let u;
o[28] !== S || o[29] !== n || o[30] !== _ ? (u = n && /* @__PURE__ */ v(R, { ..._, hideLabel: !0, iconName: "cross", isFlush: !0, variant: "ghost", size: "small", onClick: n, type: "button", children: S }), o[28] = S, o[29] = n, o[30] = _, o[31] = u) : u = o[31];
let y;
o[32] !== b || o[33] !== f || o[34] !== m || o[35] !== u ? (y = /* @__PURE__ */ k("div", { className: b, children: [
f,
m,
u
] }), o[32] = b, o[33] = f, o[34] = m, o[35] = u, o[36] = y) : y = o[36];
let I;
o[37] !== s || o[38] !== t ? (I = s && /* @__PURE__ */ v("div", { className: E({
[e.customActionArea]: !t
}), children: s }), o[37] = s, o[38] = t, o[39] = I) : I = o[39];
let p;
return o[40] !== l || o[41] !== B || o[42] !== w || o[43] !== y || o[44] !== I ? (p = /* @__PURE__ */ k("div", { className: B, ...l, role: w, children: [
y,
I
] }), o[40] = l, o[41] = B, o[42] = w, o[43] = y, o[44] = I, o[45] = p) : p = o[45], p;
};
export {
no as D,
M as N,
eo as a
};