@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
82 lines (81 loc) • 3.66 kB
JavaScript
"use client";
import { jsxs as $, jsx as y } from "react/jsx-runtime";
import { d as F } from "./chunks/index.D-sRdssb.js";
import { c as G } from "./chunks/index.DL9mof6u.js";
import { D as J } from "./chunks/Icon.CDLyB7Pv.js";
import "./chunks/LinkButton.C6F-yuLL.js";
import { Tooltip as R } from "./tooltip.Cj3AvYgB.js";
import { forwardRef as K } from "react";
import './assets/link.CeJUHbdf.css';const M = "ds-link_root_13q40_1", Q = "ds-link_root--highlight_13q40_68", U = "ds-link_root--neutral-dark_13q40_82", V = "ds-link_root--highlight-dark_13q40_131", W = "ds-link_root--active_13q40_180", X = "ds-link_root--icon-left_13q40_187", r = {
root: M,
rootHighlight: Q,
rootNeutralDark: U,
rootHighlightDark: V,
rootActive: W,
rootIconLeft: X
}, Y = K((P, j) => {
const t = F.c(53);
let s, n, a, c, h, o, e, i, d, f, m, D, N, q, H, l;
t[0] !== P ? ({
children: a,
aria: n,
active: s,
className: c,
download: h,
href: o,
iconName: e,
iconPosition: D,
iconSource: i,
referrerPolicy: d,
rel: f,
target: N,
theme: q,
tooltip: l,
variant: H,
...m
} = P, t[0] = P, t[1] = s, t[2] = n, t[3] = a, t[4] = c, t[5] = h, t[6] = o, t[7] = e, t[8] = i, t[9] = d, t[10] = f, t[11] = m, t[12] = D, t[13] = N, t[14] = q, t[15] = H, t[16] = l) : (s = t[1], n = t[2], a = t[3], c = t[4], h = t[5], o = t[6], e = t[7], i = t[8], d = t[9], f = t[10], m = t[11], D = t[12], N = t[13], q = t[14], H = t[15], l = t[16]);
const B = D === void 0 ? "left" : D, w = N === void 0 ? "_self" : N, L = q === void 0 ? "light" : q, C = H === void 0 ? "neutral" : H, E = C === "highlight", T = L === "dark" && C === "neutral", b = L === "dark" && C === "highlight", z = B === "left";
let x;
t[17] !== s || t[18] !== c || t[19] !== E || t[20] !== T || t[21] !== b || t[22] !== z ? (x = G(r.root, c, {
[r.rootHighlight]: E,
[r.rootNeutralDark]: T,
[r.rootHighlightDark]: b,
[r.rootActive]: s,
[r.rootIconLeft]: z
}), t[17] = s, t[18] = c, t[19] = E, t[20] = T, t[21] = b, t[22] = z, t[23] = x) : x = t[23];
const O = x, g = o === void 0 ? "span" : "a";
let k;
t[24] !== g || t[25] !== h || t[26] !== o || t[27] !== d || t[28] !== f || t[29] !== w ? (k = g === "a" && {
href: o,
target: w,
rel: f,
referrerPolicy: d,
download: h
}, t[24] = g, t[25] = h, t[26] = o, t[27] = d, t[28] = f, t[29] = w, t[30] = k) : k = t[30];
let _;
t[31] !== a ? (_ = /* @__PURE__ */ y("span", { className: r.label, children: a }), t[31] = a, t[32] = _) : _ = t[32];
let p;
t[33] !== e || t[34] !== i || t[35] !== L ? (p = (e || i) && /* @__PURE__ */ y(J, { name: e, theme: L, source: i, size: "medium", "aria-hidden": "true" }), t[33] = e, t[34] = i, t[35] = L, t[36] = p) : p = t[36];
let A;
t[37] !== g || t[38] !== n || t[39] !== j || t[40] !== m || t[41] !== O || t[42] !== k || t[43] !== _ || t[44] !== p ? (A = /* @__PURE__ */ $(g, { className: O, ...k, ...n, ...m, ref: j, children: [
_,
p
] }), t[37] = g, t[38] = n, t[39] = j, t[40] = m, t[41] = O, t[42] = k, t[43] = _, t[44] = p, t[45] = A) : A = t[45];
const I = A;
if (l) {
let u;
t[46] !== I ? (u = /* @__PURE__ */ y(R.Anchor, { children: I }), t[46] = I, t[47] = u) : u = t[47];
let v;
t[48] !== l ? (v = /* @__PURE__ */ y(R.Content, { children: l }), t[48] = l, t[49] = v) : v = t[49];
let S;
return t[50] !== u || t[51] !== v ? (S = /* @__PURE__ */ $(R, { placement: "top", tooltipOffset: 6, children: [
u,
v
] }), t[50] = u, t[51] = v, t[52] = S) : S = t[52], S;
}
return I;
});
Y.displayName = "DSLink";
export {
Y as DSLink
};