UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

81 lines (80 loc) 3.75 kB
"use client"; import { jsx as a, jsxs as v } from "react/jsx-runtime"; import { c as l } from "./chunks/index.CEyLAtio.js"; import { forwardRef as w, useState as y, useEffect as L } from "react"; import { g as b } from "./chunks/helpers.BbWkXTr3.js"; import "./chunks/index.CgTHIF3K.js"; import './assets/logo._GqPgimo.css';const H = "ds-logo_anchor_m1yba_2", k = "ds-logo_anchor--main_m1yba_6", x = "ds-logo_anchor--reduced_m1yba_13", N = "ds-logo_anchor--dark_m1yba_51", R = "ds-logo_svg_m1yba_81", T = "ds-logo_svg-text_m1yba_87", I = "ds-logo_placeholder-reduced_m1yba_91", c = { anchor: H, anchorMain: k, anchorReduced: x, anchorDark: N, svg: R, svgText: T, placeholderReduced: I }, D = w(({ aria: u, className: d, logo: r = "main", href: s, target: g = "_self", theme: p = "light", ..._ }, f) => { const i = ({ className: S, logo: o }) => { const h = l(c.svg, !s && S), [m, n] = y(null); L(() => { let t = !0; return o !== "main" ? (async () => { try { let e; switch (o) { case "reduced-main": e = await import("./chunks/default-icon.D_-oBHyT.js"); break; case "reduced-connected": e = await import("./chunks/connected-icon.BEijTRDG.js"); break; case "reduced-mystihl": e = await import("./chunks/mystihl-icon.xHpCyYJf.js"); break; case "reduced-imow": e = await import("./chunks/imow-icon.CyH72ySI.js"); break; default: return; } t && n(() => e.default); } catch (e) { t && (n(null), console.error(b("DSLogo", e instanceof Error ? e.message : String(e)))); } })() : n(null), () => { t = !1; }; }, [o]); const M = { main: "STIHL", "reduced-main": "STIHL", "reduced-connected": "STIHL Connected", "reduced-imow": "STIHL iMOW", "reduced-mystihl": "MY STIHL" }; return o === "main" ? /* @__PURE__ */ v("svg", { xmlns: "http://www.w3.org/2000/svg", className: h, viewBox: "0 0 408 179", children: [ /* @__PURE__ */ a("title", { children: "STIHL" }), /* @__PURE__ */ a("path", { className: c.svgBackground, d: "M408 0H0v179h408V0Z" }), /* @__PURE__ */ a("path", { className: c.svgText, d: "M195.459 56.314h-61.656l-4.936 16.193h20.668l-15.304 50.179h20.106l15.293-50.18h20.893l4.936-16.192ZM62.286 66.62l-5.353 17.558c-2.384 7.814 1.957 13.531 9.637 13.531h25.065a1.626 1.626 0 0 1 1.288.7 1.638 1.638 0 0 1 .207 1.454l-1.349 4.42a3.37 3.37 0 0 1-2.8 2.154H49.624l-4.993 16.249h50.816c5.622 0 10.39-2.605 12.842-10.645l5.094-16.677c2.406-7.894-2.081-13.532-9.086-13.532H79.108c-1.394 0-1.945-1.015-1.563-2.255l1.35-4.42a3.385 3.385 0 0 1 1.185-1.872 3.368 3.368 0 0 1 2.087-.733h36.253l4.937-16.193H75.251c-6.87-.045-11.155 4.364-12.965 10.261ZM320.571 106.493l15.304-50.18h-20.218l-20.23 66.373h63.017l4.936-16.193h-42.809ZM282.653 56.314l-7.771 25.484H250.83l7.77-25.484h-19.319l-20.23 66.372h19.308l7.736-25.372h24.053l-7.725 25.372h19.836l20.23-66.372h-19.836ZM205.917 56.314l-20.229 66.372h20.218l20.23-66.372h-20.219Z" }) ] }) : m === null ? /* @__PURE__ */ a("div", { className: l(c.placeholderReduced) }) : /* @__PURE__ */ a(m, { className: h, title: M[o] }); }; return s ? /* @__PURE__ */ a("a", { className: l(c.anchor, { [c.anchorDark]: p === "dark", [c.anchorMain]: r === "main", [c.anchorReduced]: r !== "main" }, d), href: s, target: g, ...u, ..._, ref: f, children: /* @__PURE__ */ a(i, { logo: r }) }) : /* @__PURE__ */ a(i, { logo: r, className: d }); }); D.displayName = "DSLogo"; export { D as DSLogo };