UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

36 lines (35 loc) 1.81 kB
"use client"; import { jsx as u } from "react/jsx-runtime"; import { d as g } from "./chunks/index.CgTHIF3K.js"; import { c as w } from "./chunks/index.CEyLAtio.js"; import { g as S } from "./chunks/helpers.BbWkXTr3.js"; import { forwardRef as T } from "react"; import { D as _ } from "./chunks/LinkButton.59oNDwPU.js"; import './assets/skiptocontent.CTSDC_kG.css';const v = "ds-skip-to-content_root_uqkjt_1", C = "ds-skip-to-content_root--dark_uqkjt_8", D = { root: v, rootDark: C }, E = T((m, d) => { const t = g.c(16); let o, e, s, r, n; t[0] !== m ? ({ children: s, className: o, targetElementId: r, theme: n, ...e } = m, t[0] = m, t[1] = o, t[2] = e, t[3] = s, t[4] = r, t[5] = n) : (o = t[1], e = t[2], s = t[3], r = t[4], n = t[5]); const h = s === void 0 ? "Skip to main content" : s, a = r === void 0 ? "main" : r, i = n === void 0 ? "light" : n; a.startsWith("#") && console.warn(S("DSSkipToContent", 'The targetElementId should not start with a "#" character. Please provide the id of the element you want to skip to.')), (a.startsWith("http") || a.startsWith(".")) && console.warn(S("DSSkipToContent", 'The targetElementId should not start with "http" or ".". Please provide the id of the element you want to skip to.')); const p = i === "dark"; let l; t[6] !== o || t[7] !== p ? (l = w(D.root, o, { [D.rootDark]: p }), t[6] = o, t[7] = p, t[8] = l) : l = t[8]; const k = l, f = `#${a}`; let c; return t[9] !== h || t[10] !== d || t[11] !== e || t[12] !== k || t[13] !== f || t[14] !== i ? (c = /* @__PURE__ */ u(_, { ...e, className: k, href: f, theme: i, ref: d, children: h }), t[9] = h, t[10] = d, t[11] = e, t[12] = k, t[13] = f, t[14] = i, t[15] = c) : c = t[15], c; }); E.displayName = "DSSkipToContent"; export { E as DSSkipToContent };