@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
75 lines (74 loc) • 3.91 kB
JavaScript
"use client";
import { jsxs as y, jsx as v } from "react/jsx-runtime";
import { d as L } from "./index.cKLI89Eg.js";
import { c as S } from "./index.DQOqod3i.js";
import { D as w } from "./Icon.DYtaQgbw.js";
import { g as D } from "./helpers.CexwVao7.js";
import '../assets/Flag.qP1xbolI.css';const O = "ds-flag_root_1r5js_1", P = "ds-flag_root--color-status-info_1r5js_27", R = "ds-flag_root--color-status-warning_1r5js_30", b = "ds-flag_root--color-status-negative_1r5js_33", N = "ds-flag_root--color-status-positive_1r5js_36", A = "ds-flag_root--color-promo-highlight_1r5js_39", G = "ds-flag_root--color-promo-neutral_1r5js_42", E = "ds-flag_root--color-grey-light_1r5js_46", F = "ds-flag_root--color-yellow-light_1r5js_49", x = "ds-flag_root--color-red-light_1r5js_52", $ = "ds-flag_root--color-green-light_1r5js_55", T = "ds-flag_root--color-orange-base_1r5js_58", p = {
root: O,
"root--color-status-info": "ds-flag_root--color-status-info_1r5js_27",
rootColorStatusInfo: P,
"root--color-status-warning": "ds-flag_root--color-status-warning_1r5js_30",
rootColorStatusWarning: R,
"root--color-status-negative": "ds-flag_root--color-status-negative_1r5js_33",
rootColorStatusNegative: b,
"root--color-status-positive": "ds-flag_root--color-status-positive_1r5js_36",
rootColorStatusPositive: N,
"root--color-promo-highlight": "ds-flag_root--color-promo-highlight_1r5js_39",
rootColorPromoHighlight: A,
"root--color-promo-neutral": "ds-flag_root--color-promo-neutral_1r5js_42",
rootColorPromoNeutral: G,
"root--color-grey-light": "ds-flag_root--color-grey-light_1r5js_46",
rootColorGreyLight: E,
"root--color-yellow-light": "ds-flag_root--color-yellow-light_1r5js_49",
rootColorYellowLight: F,
"root--color-red-light": "ds-flag_root--color-red-light_1r5js_52",
rootColorRedLight: x,
"root--color-green-light": "ds-flag_root--color-green-light_1r5js_55",
rootColorGreenLight: $,
"root--color-orange-base": "ds-flag_root--color-orange-base_1r5js_58",
rootColorOrangeBase: T
}, Y = ["status-info", "status-warning", "status-negative", "status-positive", "promo-highlight", "promo-neutral"], U = ["grey-light", "yellow-light", "red-light", "green-light", "orange-base"], j = {
"grey-light": "status-info",
"yellow-light": "status-warning",
"red-light": "status-negative",
"green-light": "status-positive",
"orange-base": "promo-highlight"
}, B = ["promo-neutral"], q = (d) => {
const o = L.c(24);
let l, e, r, s, a, n;
o[0] !== d ? ({
children: l,
className: e,
color: n,
iconName: r,
iconSource: s,
...a
} = d, o[0] = d, o[1] = l, o[2] = e, o[3] = r, o[4] = s, o[5] = a, o[6] = n) : (l = o[1], e = o[2], r = o[3], s = o[4], a = o[5], n = o[6]);
const t = n === void 0 ? "status-info" : n;
typeof t == "string" && t in j && console.warn(D("DSFlag", `The color "${t}" is deprecated and will be removed in the next stable release. Please use "${j[t]}" instead.`));
const i = typeof t == "string" && p[`root--color-${t}`];
let c;
o[7] !== t || o[8] !== i ? (c = i ? {} : {
backgroundColor: t
}, o[7] = t, o[8] = i, o[9] = c) : c = o[9];
const f = c, u = p[`root--color-${t}`];
let _;
o[10] !== e || o[11] !== i || o[12] !== u ? (_ = S(p.root, e, {
[u]: i
}), o[10] = e, o[11] = i, o[12] = u, o[13] = _) : _ = o[13];
const C = _, m = B.includes(t) ? "dark" : "light";
let g;
o[14] !== r || o[15] !== s || o[16] !== m ? (g = (r || s) && /* @__PURE__ */ v(w, { name: r, theme: m, source: s, "aria-hidden": "true" }), o[14] = r, o[15] = s, o[16] = m, o[17] = g) : g = o[17];
let h;
return o[18] !== l || o[19] !== f || o[20] !== a || o[21] !== C || o[22] !== g ? (h = /* @__PURE__ */ y("span", { className: C, style: f, ...a, children: [
g,
l
] }), o[18] = l, o[19] = f, o[20] = a, o[21] = C, o[22] = g, o[23] = h) : h = o[23], h;
};
export {
U as D,
Y as F,
j as a,
q as b
};