UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

93 lines (92 loc) 3.97 kB
"use client"; import { jsx as p, jsxs as F } from "react/jsx-runtime"; import { d as R } from "./index.CgTHIF3K.js"; import { c as k } from "./index.CEyLAtio.js"; import { D as W } from "./Button.Cf1CKq8N.js"; import { D as y } from "./Icon.NSsVrYeq.js"; import '../assets/Notification.BOuaA5GT.css';const L = "ds-notification_root_1jsx7_1", P = "ds-notification_root--success_1jsx7_26", V = "ds-notification_root--error_1jsx7_30", z = "ds-notification_root--warning_1jsx7_34", Y = "ds-notification_root--hide-icon_1jsx7_38", $ = "ds-notification_content_1jsx7_52", q = "ds-notification_content--hide-close-button_1jsx7_59", G = "ds-notification_content--hide-icon_1jsx7_62", J = "ds-notification_icon_1jsx7_66", K = "ds-notification_message_1jsx7_70", M = "ds-notification_custom-action-area_1jsx7_167", s = { root: L, rootSuccess: P, rootError: V, rootWarning: z, rootHideIcon: Y, content: $, contentHideCloseButton: q, contentHideIcon: G, icon: J, message: K, customActionArea: M }, no = ["success", "error", "warning", "info"], Q = { success: "circle-check-colored", error: "diamond-exclamationmark-colored", warning: "triangle-exclamationmark-colored", info: "circle-info-colored" }, U = { error: "alert", warning: "alert", info: "status", success: "status" }, eo = (v) => { const o = R.c(47); let i, r, a, c, n, l, N, h; o[0] !== v ? ({ children: i, variant: N, className: r, closeButtonProps: a, customActionArea: c, hideIcon: h, onClose: n, ...l } = v, o[0] = v, o[1] = i, o[2] = r, o[3] = a, o[4] = c, o[5] = n, o[6] = l, o[7] = N, o[8] = h) : (i = o[1], r = o[2], a = o[3], c = o[4], n = o[5], l = o[6], N = o[7], h = o[8]); const e = 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 H = A === void 0 ? "Close notification" : A, S = e === "success", O = e === "error", T = e === "warning", B = e === "info"; let g; o[14] !== r || o[15] !== t || o[16] !== S || o[17] !== O || o[18] !== T || o[19] !== B ? (g = k(s.root, r, { [s.rootSuccess]: S, [s.rootError]: O, [s.rootWarning]: T, [s.rootInfo]: B, [s.rootHideIcon]: t }), o[14] = r, o[15] = t, o[16] = S, o[17] = O, o[18] = T, o[19] = B, o[20] = g) : g = o[20]; const D = g, b = !n; let j; o[21] !== t || o[22] !== b ? (j = k(s.content, { [s.contentHideCloseButton]: b, [s.contentHideIcon]: t }), o[21] = t, o[22] = b, o[23] = j) : j = o[23]; const w = j, E = U[e]; let f; o[24] !== t || o[25] !== e ? (f = !t && /* @__PURE__ */ p(y, { name: Q[e], className: s.icon, "aria-hidden": "true" }), o[24] = t, o[25] = e, o[26] = f) : f = o[26]; let m; o[27] !== i ? (m = /* @__PURE__ */ p("div", { className: s.message, children: i }), o[27] = i, o[28] = m) : m = o[28]; let u; o[29] !== H || o[30] !== n || o[31] !== _ ? (u = n && /* @__PURE__ */ p(W, { ..._, hideLabel: !0, iconName: "cross", isFlush: !0, variant: "ghost", size: "small", onClick: n, type: "button", children: H }), o[29] = H, o[30] = n, o[31] = _, o[32] = u) : u = o[32]; let I; o[33] !== w || o[34] !== f || o[35] !== m || o[36] !== u ? (I = /* @__PURE__ */ F("div", { className: w, children: [ f, m, u ] }), o[33] = w, o[34] = f, o[35] = m, o[36] = u, o[37] = I) : I = o[37]; let x; o[38] !== c || o[39] !== t ? (x = c && /* @__PURE__ */ p("div", { className: k({ [s.customActionArea]: !t }), children: c }), o[38] = c, o[39] = t, o[40] = x) : x = o[40]; let C; return o[41] !== l || o[42] !== D || o[43] !== E || o[44] !== I || o[45] !== x ? (C = /* @__PURE__ */ F("div", { className: D, ...l, role: E, children: [ I, x ] }), o[41] = l, o[42] = D, o[43] = E, o[44] = I, o[45] = x, o[46] = C) : C = o[46], C; }; export { eo as D, no as N, Q as a };