A design system in a box.
hip-ui.tngl.io/docs/introduction
1import{i as e,t}from"./jsx-runtime-D-oznMWL.js";import{t as n}from"./react-DNjXG-IQ.js";import{a as r,n as i,o as a,r as o}from"./_virtual_content-FazmLmqR.js";import{t as s}from"./useLocation-ITrbnl1F.js";import{t as c}from"./icon-button-BFGSYviR.js";import{r as l}from"./typography-DYed328x.js";import{t as u}from"./copy-q8QAXVoJ.js";import{t as d}from"./flex-oubf-_sd.js";import{t as f}from"./main-C54yPR-t.js";import{t as p}from"./text-B77JGejP.js";var m=e(n(),1),h=t(),g=(0,h.jsx)(u,{}),_=({style:e,icon:t=g})=>{let n=s().pathname,[r,i]=(0,m.useState)(n);(0,m.useEffect)(()=>{async function e(){i(await(await fetch(`${globalThis.location.origin}${n}.md`)).text())}e()},[n]);let[a,o]=(0,m.useState)(`Copy for LLM`),[l,u]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=(0,m.useRef)(null);return(0,h.jsxs)(d,{align:`center`,justify:`center`,children:[(0,h.jsx)(c,{label:a,tooltipOpen:l,onTooltipOpenChange:e=>!f.current&&u(e),variant:`tertiary`,style:e,size:`sm`,onClick:()=>{p.current&&=(clearTimeout(p.current),null),f.current&&=(clearTimeout(f.current),null),navigator.clipboard.writeText(r),o(`Copied ✓`),u(!0),f.current=setTimeout(()=>{f.current=null,u(!1),p.current=setTimeout(()=>{o(`Copy for LLM`),p.current=null},200)},2e3)},children:t}),(0,h.jsx)(`a`,{href:`${n}.md`,target:`_blank`,rel:`noopener noreferrer`,className:`x10l6tqk x8knxv4 x3m8u43 x13vifvy`})]})};function v(){let{docPath:e}=f.useLoaderData(),{_splat:t}=f.useParams(),n=o.find(t=>e.match(RegExp(`${t._meta.path}$`)));if(!n)throw Error(`Doc not found: ${t??`unknown`}`);let s=i[e];if(!s)throw Error(`Content not found: ${e}`);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(d,{direction:`column`,gap:`7xl`,style:a.header,children:[(0,h.jsxs)(d,{align:`center`,gap:`xl`,children:[(0,h.jsx)(l,{style:a.grow,children:n.title}),(0,h.jsx)(_,{})]}),(0,h.jsx)(p,{size:`xl`,variant:`secondary`,children:n.description})]}),(0,h.jsx)(s,{components:r})]})}export{v as component};