@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
45 lines (44 loc) • 1.61 kB
JavaScript
"use client";
import { jsxs as v, jsx as y } from "react/jsx-runtime";
import { d as g } from "./chunks/index.CgTHIF3K.js";
import { c as F } from "./chunks/index.CEyLAtio.js";
import { useState as S, useEffect as b } from "react";
import { D as h } from "./chunks/Icon.CAXZUNWo.js";
import './assets/systemfeedback.BX2zCzSL.css';const D = "ds-system-feedback_root_mgtv6_1", I = {
root: D
}, N = {
valid: "circle-check-colored",
invalid: "diamond-exclamationmark-colored",
warning: "triangle-exclamationmark-colored"
}, C = (f) => {
const e = g.c(22);
let o, r, t, l, s;
e[0] !== f ? ({
id: r,
message: t,
type: s,
className: o,
...l
} = f, e[0] = f, e[1] = o, e[2] = r, e[3] = t, e[4] = l, e[5] = s) : (o = e[1], r = e[2], t = e[3], l = e[4], s = e[5]);
const [a, x] = S(!0);
let c;
e[6] !== o ? (c = F(I.root, o), e[6] = o, e[7] = c) : c = e[7];
const p = c;
let n;
e[8] !== a ? (n = () => {
a && x(!1);
}, e[8] = a, e[9] = n) : n = e[9];
let m;
e[10] !== t || e[11] !== s ? (m = [t, s], e[10] = t, e[11] = s, e[12] = m) : m = e[12], b(n, m);
const k = a ? "alert" : void 0, u = N[s];
let i;
e[13] !== u ? (i = /* @__PURE__ */ y(h, { name: u, "aria-hidden": "true" }), e[13] = u, e[14] = i) : i = e[14];
let d;
return e[15] !== r || e[16] !== t || e[17] !== l || e[18] !== p || e[19] !== k || e[20] !== i ? (d = /* @__PURE__ */ v("div", { id: r, className: p, ...l, role: k, children: [
i,
t
] }), e[15] = r, e[16] = t, e[17] = l, e[18] = p, e[19] = k, e[20] = i, e[21] = d) : d = e[21], d;
};
export {
C as DSSystemFeedback
};