UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

92 lines (91 loc) 3.9 kB
"use client"; import { jsx as H, jsxs as F } from "react/jsx-runtime"; import { d as R } from "./index.D-sRdssb.js"; import { c as k } from "./index.DL9mof6u.js"; import { D as W } from "./Button.Cn5yg7dG.js"; import { D as j } from "./Icon.CDLyB7Pv.js"; import '../assets/Notification.CvohYEvT.css';const y = "ds-notification_root_trmu0_1", L = "ds-notification_root--success_trmu0_29", P = "ds-notification_root--error_trmu0_33", V = "ds-notification_root--warning_trmu0_37", z = "ds-notification_root--hide-icon_trmu0_41", Y = "ds-notification_content_trmu0_55", $ = "ds-notification_content--hide-close-button_trmu0_62", q = "ds-notification_content--hide-icon_trmu0_65", G = "ds-notification_icon_trmu0_69", J = "ds-notification_message_trmu0_73", K = "ds-notification_custom-action-area_trmu0_170", e = { root: y, rootSuccess: L, rootError: P, rootWarning: V, rootHideIcon: z, content: Y, contentHideCloseButton: $, contentHideIcon: q, icon: G, message: J, customActionArea: K }, et = ["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" }, nt = (S) => { const t = R.c(46); let i, r, a, s, n, l, h, A; t[0] !== S ? ({ children: i, variant: h, className: r, closeButtonProps: a, customActionArea: s, hideIcon: A, onClose: n, ...l } = S, t[0] = S, t[1] = i, t[2] = r, t[3] = a, t[4] = s, t[5] = n, t[6] = l, t[7] = h, t[8] = A) : (i = t[1], r = t[2], a = t[3], s = t[4], n = t[5], l = t[6], h = t[7], A = t[8]); const c = h === void 0 ? "info" : h, o = A === void 0 ? !1 : A; let d; t[9] !== a ? (d = a || {}, t[9] = a, t[10] = d) : d = t[10]; let m, g; t[11] !== d ? ({ label: g, ...m } = d, t[11] = d, t[12] = m, t[13] = g) : (m = t[12], g = t[13]); const O = g === void 0 ? "Close notification" : g, T = c === "success", x = c === "error", B = c === "warning"; let C; t[14] !== r || t[15] !== o || t[16] !== T || t[17] !== x || t[18] !== B ? (C = k(e.root, r, { [e.rootSuccess]: T, [e.rootError]: x, [e.rootWarning]: B, [e.rootHideIcon]: o }), t[14] = r, t[15] = o, t[16] = T, t[17] = x, t[18] = B, t[19] = C) : C = t[19]; const D = C, b = !n; let p; t[20] !== o || t[21] !== b ? (p = k(e.content, { [e.contentHideCloseButton]: b, [e.contentHideIcon]: o }), t[20] = o, t[21] = b, t[22] = p) : p = t[22]; const w = p, E = Q[c]; let u; t[23] !== o || t[24] !== c ? (u = !o && /* @__PURE__ */ H(j, { name: M[c], className: e.icon, "aria-hidden": "true" }), t[23] = o, t[24] = c, t[25] = u) : u = t[25]; let _; t[26] !== i ? (_ = /* @__PURE__ */ H("div", { className: e.message, children: i }), t[26] = i, t[27] = _) : _ = t[27]; let f; t[28] !== O || t[29] !== n || t[30] !== m ? (f = n && /* @__PURE__ */ H(W, { ...m, hideLabel: !0, iconName: "cross", isFlush: !0, variant: "ghost", size: "small", onClick: n, type: "button", children: O }), t[28] = O, t[29] = n, t[30] = m, t[31] = f) : f = t[31]; let I; t[32] !== w || t[33] !== u || t[34] !== _ || t[35] !== f ? (I = /* @__PURE__ */ F("div", { className: w, children: [ u, _, f ] }), t[32] = w, t[33] = u, t[34] = _, t[35] = f, t[36] = I) : I = t[36]; let N; t[37] !== s || t[38] !== o ? (N = s && /* @__PURE__ */ H("div", { className: k({ [e.customActionArea]: !o }), children: s }), t[37] = s, t[38] = o, t[39] = N) : N = t[39]; let v; return t[40] !== l || t[41] !== D || t[42] !== E || t[43] !== I || t[44] !== N ? (v = /* @__PURE__ */ F("div", { className: D, ...l, role: E, children: [ I, N ] }), t[40] = l, t[41] = D, t[42] = E, t[43] = I, t[44] = N, t[45] = v) : v = t[45], v; }; export { nt as D, et as N, M as a };