UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

56 lines (55 loc) 2.41 kB
"use client"; import { jsx as H, jsxs as x } from "react/jsx-runtime"; import { d as D } from "./chunks/index.CgTHIF3K.js"; import { c as N } from "./chunks/index.CEyLAtio.js"; import { D as j } from "./chunks/Button.B7xF1E19.js"; import './assets/banner.D9EiZqqR.css';const k = "ds-banner_root_19afy_1", P = "ds-banner_root--secondary_19afy_14", z = "ds-banner_root--highlight_19afy_18", E = "ds-banner_root--hide-close-button_19afy_22", L = "ds-banner_content_19afy_28", $ = "ds-banner_close-button_19afy_40", d = { root: k, rootSecondary: P, rootHighlight: z, rootHideCloseButton: E, content: L, closeButton: $ }, G = (y) => { const t = D.c(30); let e, s, n, o, l, f; t[0] !== y ? ({ className: s, closeButtonProps: n, children: e, variant: f, onClose: o, ...l } = y, t[0] = y, t[1] = e, t[2] = s, t[3] = n, t[4] = o, t[5] = l, t[6] = f) : (e = t[1], s = t[2], n = t[3], o = t[4], l = t[5], f = t[6]); const h = f === void 0 ? "default" : f; let r; t[7] !== n ? (r = n || {}, t[7] = n, t[8] = r) : r = t[8]; let a, _; t[9] !== r ? ({ label: _, ...a } = r, t[9] = r, t[10] = a, t[11] = _) : (a = t[10], _ = t[11]); const g = _ === void 0 ? "Close banner" : _, B = h === "secondary", p = h === "highlight", C = !o; let m; t[12] !== s || t[13] !== B || t[14] !== p || t[15] !== C ? (m = N(d.root, s, { [d.rootSecondary]: B, [d.rootHighlight]: p, [d.rootHideCloseButton]: C }), t[12] = s, t[13] = B, t[14] = p, t[15] = C, t[16] = m) : m = t[16]; const v = m; let u; t[17] === Symbol.for("react.memo_cache_sentinel") ? (u = N(d.content), t[17] = u) : u = t[17]; const S = u; let c; t[18] !== e ? (c = /* @__PURE__ */ H("div", { className: S, children: e }), t[18] = e, t[19] = c) : c = t[19]; let i; t[20] !== g || t[21] !== o || t[22] !== a || t[23] !== h ? (i = o && /* @__PURE__ */ H(j, { ...a, hideLabel: !0, iconName: "cross", variant: "ghost", className: d.closeButton, size: "small", onClick: o, type: "button", theme: h === "default" ? "dark" : "light", children: g }), t[20] = g, t[21] = o, t[22] = a, t[23] = h, t[24] = i) : i = t[24]; let b; return t[25] !== l || t[26] !== v || t[27] !== i || t[28] !== c ? (b = /* @__PURE__ */ x("div", { className: v, ...l, children: [ c, i ] }), t[25] = l, t[26] = v, t[27] = i, t[28] = c, t[29] = b) : b = t[29], b; }; export { G as DSBanner };