UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

93 lines (92 loc) 5.1 kB
"use client"; import { jsxs as lt, jsx as Z } from "react/jsx-runtime"; import { d as st } from "./chunks/index.CgTHIF3K.js"; import { c as tt } from "./chunks/index.CEyLAtio.js"; import { u as Y } from "./chunks/useBreakpoint.CMOR9ZOB.js"; import { forwardRef as nt } from "react"; import { D as rt } from "./chunks/Icon.CAXZUNWo.js"; import './assets/linkbutton.DuHHqo7Z.css';const et = "ds-link-button_root_3a4lw_1", it = "ds-link-button_root--highlight_3a4lw_75", at = "ds-link-button_root--dark-highlight_3a4lw_75", ct = "ds-link-button_root--filled_3a4lw_151", dt = "ds-link-button_root--outline_3a4lw_179", ht = "ds-link-button_root--ghost_3a4lw_206", ut = "ds-link-button_root--ghost-flush_3a4lw_231", _t = "ds-link-button_root--small_3a4lw_237", kt = "ds-link-button_root--dark-filled_3a4lw_317", mt = "ds-link-button_root--dark-outline_3a4lw_374", gt = "ds-link-button_root--dark-ghost_3a4lw_430", ft = "ds-link-button_root--dark-ghost-flush_3a4lw_484", bt = "ds-link-button_root--icon-left_3a4lw_559", Dt = "ds-link-button_root--icon-only_3a4lw_562", wt = "ds-link-button_root--icon-only-small_3a4lw_571", Ft = "ds-link-button_label--hidden_3a4lw_582", o = { root: et, rootHighlight: it, rootDarkHighlight: at, rootFilled: ct, rootOutline: dt, rootGhost: ht, rootGhostFlush: ut, rootSmall: _t, rootDarkFilled: kt, rootDarkOutline: mt, rootDarkGhost: gt, rootDarkGhostFlush: ft, rootIconLeft: bt, rootIconOnly: Dt, rootIconOnlySmall: wt, labelHidden: Ft }, pt = nt((H, L) => { const t = st.c(59); let i, a, c, d, n, r, e, h, u, _, b, D, w, F, p, G, O; t[0] !== H ? ({ children: a, aria: i, className: c, download: d, hideLabel: b, href: n, iconName: r, iconPosition: D, iconSource: e, isFlush: w, referrerPolicy: h, rel: u, size: F, target: p, theme: G, variant: O, ..._ } = H, t[0] = H, t[1] = i, t[2] = a, t[3] = c, t[4] = d, t[5] = n, t[6] = r, t[7] = e, t[8] = h, t[9] = u, t[10] = _, t[11] = b, t[12] = D, t[13] = w, t[14] = F, t[15] = p, t[16] = G, t[17] = O) : (i = t[1], a = t[2], c = t[3], d = t[4], n = t[5], r = t[6], e = t[7], h = t[8], u = t[9], _ = t[10], b = t[11], D = t[12], w = t[13], F = t[14], p = t[15], G = t[16], O = t[17]); const N = b === void 0 ? !1 : b, ot = D === void 0 ? "left" : D, y = w === void 0 ? !1 : w, x = F === void 0 ? "medium" : F, B = p === void 0 ? "_self" : p, s = G === void 0 ? "light" : G, l = O === void 0 ? "filled" : O, P = l === "filled", j = l === "highlight", z = l === "outline", C = l === "ghost" && y !== !0, T = l === "ghost" && y === !0, E = s === "dark" && l === "filled", R = s === "dark" && l === "highlight", V = s === "dark" && l === "outline", $ = s === "dark" && l === "ghost" && y !== !0, q = s === "dark" && l === "ghost" && y === !0, A = x === "small", J = ot === "left", K = Y(N) && x === "medium", M = Y(N) && x === "small"; let v; t[18] !== c || t[19] !== z || t[20] !== C || t[21] !== T || t[22] !== E || t[23] !== R || t[24] !== V || t[25] !== $ || t[26] !== q || t[27] !== A || t[28] !== J || t[29] !== K || t[30] !== M || t[31] !== P || t[32] !== j ? (v = tt(o.root, c, { [o.rootFilled]: P, [o.rootHighlight]: j, [o.rootOutline]: z, [o.rootGhost]: C, [o.rootGhostFlush]: T, [o.rootDarkFilled]: E, [o.rootDarkHighlight]: R, [o.rootDarkOutline]: V, [o.rootDarkGhost]: $, [o.rootDarkGhostFlush]: q, [o.rootSmall]: A, [o.rootIconLeft]: J, [o.rootIconOnly]: K, [o.rootIconOnlySmall]: M }), t[18] = c, t[19] = z, t[20] = C, t[21] = T, t[22] = E, t[23] = R, t[24] = V, t[25] = $, t[26] = q, t[27] = A, t[28] = J, t[29] = K, t[30] = M, t[31] = P, t[32] = j, t[33] = v) : v = t[33]; const Q = v, U = Y(N); let I; t[34] !== U ? (I = tt({ [o.labelHidden]: U }), t[34] = U, t[35] = I) : I = t[35]; const W = I, X = s === "light" && l === "filled" || s === "dark" && l === "outline" || s === "dark" && l === "ghost" ? "dark" : "light", k = n === void 0 ? "span" : "a"; let m; t[36] !== k || t[37] !== d || t[38] !== n || t[39] !== h || t[40] !== u || t[41] !== B ? (m = k === "a" && { href: n, target: B, rel: u, referrerPolicy: h, download: d }, t[36] = k, t[37] = d, t[38] = n, t[39] = h, t[40] = u, t[41] = B, t[42] = m) : m = t[42]; let g; t[43] !== a || t[44] !== W ? (g = /* @__PURE__ */ Z("span", { className: W, children: a }), t[43] = a, t[44] = W, t[45] = g) : g = t[45]; let f; t[46] !== r || t[47] !== e || t[48] !== X ? (f = (r || e) && /* @__PURE__ */ Z(rt, { name: r, theme: X, source: e, "aria-hidden": "true" }), t[46] = r, t[47] = e, t[48] = X, t[49] = f) : f = t[49]; let S; return t[50] !== k || t[51] !== i || t[52] !== L || t[53] !== _ || t[54] !== Q || t[55] !== m || t[56] !== g || t[57] !== f ? (S = /* @__PURE__ */ lt(k, { className: Q, ...m, ...i, ..._, ref: L, children: [ g, f ] }), t[50] = k, t[51] = i, t[52] = L, t[53] = _, t[54] = Q, t[55] = m, t[56] = g, t[57] = f, t[58] = S) : S = t[58], S; }); pt.displayName = "DSLinkButton"; export { pt as DSLinkButton };