@redocly/graphql-docs
Version:
Redocly GraphQL docs
20 lines (17 loc) • 929 B
JavaScript
import{jsx as t,jsxs as c}from"react/jsx-runtime";import{Link as m}from"react-router-dom";import{LinkIcon as r}from"@redocly/theme";import{useBaseUrlPath as h}from"../index.js";import{ROOT_PATH as d}from"../constants.js";import{styled as f}from"../../styled-components.js";function p(i){const a=h()||d,{to:o,id:e,className:n,children:s,"aria-label":l}=i;return t(m,{"aria-label":l||`link to ${o}`,id:e||"",className:n||"",to:o||a,children:s})}const x=f(p)`
position: absolute;
left: 0;
transform: translateX(-100%);
padding-right: var(--heading-anchor-offset-right);
z-index: 1;
${r} {
opacity: 0;
transition:
visibility 0.3s linear,
opacity 0.3s linear;
}
:hover ${r}, :focus ${r} {
visibility: visible;
opacity: 1;
}
`;function v(i){return c(x,{...i,children:[t(r,{size:"13px",color:"--heading-anchor-color"}),i.children]})}export{p as Link,v as ShareLink,x as StyledShareLink};