UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

82 lines (81 loc) 3.65 kB
"use client"; import { jsxs as B, jsx as P } from "react/jsx-runtime"; import { d as G } from "./chunks/index.cKLI89Eg.js"; import { c as J } from "./chunks/index.DQOqod3i.js"; import { D as K } from "./chunks/Icon.DYtaQgbw.js"; import "./chunks/LinkButton.BxG7fx1O.js"; import { Tooltip as $ } from "./tooltip.BFQG-7VR.js"; import { forwardRef as M } from "react"; import './assets/link.EZrauC8s.css';const Q = "ds-link_root_o35du_1", U = "ds-link_root--highlight_o35du_68", V = "ds-link_root--neutral-dark_o35du_82", W = "ds-link_root--highlight-dark_o35du_131", X = "ds-link_root--active_o35du_180", Y = "ds-link_root--icon-left_o35du_187", r = { root: Q, rootHighlight: U, rootNeutralDark: V, rootHighlightDark: W, rootActive: X, rootIconLeft: Y }, Z = M((T, j) => { const t = G.c(53); let s, n, a, c, h, o, e, i, d, f, m, D, N, H, L, l; t[0] !== T ? ({ 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: H, tooltip: l, variant: L, ...m } = T, t[0] = T, 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] = H, t[15] = L, 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], H = t[14], L = t[15], l = t[16]); const F = D === void 0 ? "left" : D, w = N === void 0 ? "_self" : N, x = H === void 0 ? "light" : H, C = L === void 0 ? "neutral" : L, q = x === "dark", E = C === "highlight", b = q && C === "neutral", z = q && C === "highlight", O = F === "left"; let A; t[17] !== s || t[18] !== c || t[19] !== E || t[20] !== b || t[21] !== z || t[22] !== O ? (A = J(r.root, c, { [r.rootHighlight]: E, [r.rootNeutralDark]: b, [r.rootHighlightDark]: z, [r.rootActive]: s, [r.rootIconLeft]: O }), t[17] = s, t[18] = c, t[19] = E, t[20] = b, t[21] = z, t[22] = O, t[23] = A) : A = t[23]; const R = A, 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 u; t[31] !== a ? (u = /* @__PURE__ */ P("span", { className: r.label, children: a }), t[31] = a, t[32] = u) : u = t[32]; let _; t[33] !== e || t[34] !== i || t[35] !== x ? (_ = (e || i) && /* @__PURE__ */ P(K, { name: e, theme: x, source: i, size: "medium", "aria-hidden": "true" }), t[33] = e, t[34] = i, t[35] = x, t[36] = _) : _ = t[36]; let I; t[37] !== g || t[38] !== n || t[39] !== j || t[40] !== m || t[41] !== R || t[42] !== k || t[43] !== u || t[44] !== _ ? (I = /* @__PURE__ */ B(g, { className: R, ...k, ...n, ...m, ref: j, children: [ u, _ ] }), t[37] = g, t[38] = n, t[39] = j, t[40] = m, t[41] = R, t[42] = k, t[43] = u, t[44] = _, t[45] = I) : I = t[45]; const S = I; if (l) { let p; t[46] !== S ? (p = /* @__PURE__ */ P($.Anchor, { children: S }), t[46] = S, t[47] = p) : p = t[47]; let v; t[48] !== l ? (v = /* @__PURE__ */ P($.Content, { children: l }), t[48] = l, t[49] = v) : v = t[49]; let y; return t[50] !== p || t[51] !== v ? (y = /* @__PURE__ */ B($, { placement: "top", tooltipOffset: 6, children: [ p, v ] }), t[50] = p, t[51] = v, t[52] = y) : y = t[52], y; } return S; }); Z.displayName = "DSLink"; export { Z as DSLink };