UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

77 lines (76 loc) 3.35 kB
"use client"; import { jsx as C, jsxs as y } from "react/jsx-runtime"; import { d as E } from "./index.CgTHIF3K.js"; import { c as j } from "./index.CEyLAtio.js"; import { forwardRef as L } from "react"; import { D as M } from "./Button.Cf1CKq8N.js"; import { D as O } from "./Icon.NSsVrYeq.js"; import '../assets/Toast.CJ1zhDIT.css';const P = "ds-toast_root_gamkt_5", z = "ds-toast_root--closing_gamkt_19", A = "ds-toast_root--success_gamkt_54", R = "ds-toast_root--info_gamkt_58", $ = "ds-toast_root--warning_gamkt_62", q = "ds-toast_content_gamkt_67", F = "ds-toast_content--hide-icon_gamkt_74", G = "ds-toast_icon_gamkt_78", J = "ds-toast_message_gamkt_82", s = { root: P, rootClosing: z, rootSuccess: A, rootInfo: R, rootWarning: $, content: q, contentHideIcon: F, icon: G, message: J }, K = { success: "circle-check-colored", warning: "triangle-exclamationmark-colored", info: "circle-info-colored" }, Q = L((D, x) => { const t = E.c(44); let e, n, o, a, c, l, i, k, h; t[0] !== D ? ({ message: o, className: e, closeButtonProps: n, hideIcon: k, variant: h, onClick: a, onMouseEnter: c, onMouseLeave: l, ...i } = D, t[0] = D, t[1] = e, t[2] = n, t[3] = o, t[4] = a, t[5] = c, t[6] = l, t[7] = i, t[8] = k, t[9] = h) : (e = t[1], n = t[2], o = t[3], a = t[4], c = t[5], l = t[6], i = t[7], k = t[8], h = t[9]); const r = k === void 0 ? !1 : k, m = h === void 0 ? "info" : h; let d; t[10] !== n ? (d = n || {}, t[10] = n, t[11] = d) : d = t[11]; let _, v; t[12] !== d ? ({ label: v, ..._ } = d, t[12] = d, t[13] = _, t[14] = v) : (_ = t[13], v = t[14]); const b = v === void 0 ? "Close toast" : v, w = m === "success", T = m === "warning", B = m === "info"; let I; t[15] !== e || t[16] !== w || t[17] !== T || t[18] !== B ? (I = j(s.root, e, { [s.rootSuccess]: w, [s.rootWarning]: T, [s.rootInfo]: B }), t[15] = e, t[16] = w, t[17] = T, t[18] = B, t[19] = I) : I = t[19]; const H = I; let N; t[20] !== r ? (N = j(s.content, { [s.contentHideIcon]: r }), t[20] = r, t[21] = N) : N = t[21]; const W = N; let f; t[22] !== r || t[23] !== m ? (f = !r && /* @__PURE__ */ C(O, { name: K[m], className: s.icon, "aria-hidden": "true" }), t[22] = r, t[23] = m, t[24] = f) : f = t[24]; let g; t[25] !== o ? (g = /* @__PURE__ */ C("div", { className: s.message, children: o }), t[25] = o, t[26] = g) : g = t[26]; let u; t[27] !== b || t[28] !== a || t[29] !== _ ? (u = /* @__PURE__ */ C(M, { ..._, hideLabel: !0, iconName: "cross", size: "small", variant: "ghost", onClick: a, children: b }), t[27] = b, t[28] = a, t[29] = _, t[30] = u) : u = t[30]; let p; t[31] !== W || t[32] !== f || t[33] !== g || t[34] !== u ? (p = /* @__PURE__ */ y("div", { className: W, children: [ f, g, u ] }), t[31] = W, t[32] = f, t[33] = g, t[34] = u, t[35] = p) : p = t[35]; let S; return t[36] !== o || t[37] !== c || t[38] !== l || t[39] !== x || t[40] !== i || t[41] !== H || t[42] !== p ? (S = /* @__PURE__ */ C("aside", { className: H, ref: x, popover: "manual", "data-ds-toast": !0, onMouseEnter: c, onMouseLeave: l, "aria-label": o, ...i, children: p }), t[36] = o, t[37] = c, t[38] = l, t[39] = x, t[40] = i, t[41] = H, t[42] = p, t[43] = S) : S = t[43], S; }); Q.displayName = "DSToast"; export { Q as D, s };