@undp/design-system-react
Version:
React based design system for UNDP
2 lines • 3.22 kB
JavaScript
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./utils-Dd9-5CFr.cjs"),n=require("./createLucideIcon-FKMTNncQ.cjs"),r=require("./x-bed1YSbv.cjs");let i=require("react");i=e.r(i,1);let a=require("react/jsx-runtime");var o=n.t(`menu`,[[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 18h16`,key:`19g7jn`}],[`path`,{d:`M4 6h16`,key:`1o0s65`}]]);function s({className:e,children:n,...r}){return(0,a.jsx)(`header`,{...r,className:t.t(`relative top-0 left-0 z-10 box-border flex h-18.75 w-full max-w-full items-center justify-between gap-4 bg-surface-2xs px-6 py-0 shadow-header md:h-header`,e),children:n})}function c({className:e,siteName:n,siteSubName:r,hyperlink:i,logoLocale:o,...s}){return(0,a.jsx)(`div`,{...s,className:t.t(`flex items-center`,e),children:(0,a.jsxs)(`a`,{href:i||`./`,style:{textDecoration:`none`},className:`logo-sub-head flex items-center gap-6`,children:[(0,a.jsx)(`img`,{src:`https://cdn.jsdelivr.net/npm/@undp/design-system-assets/images/${o===`es`||o===`fr`?`pnud`:`undp`}-logo-blue.svg`,alt:`UNDP Logo`,className:`z-100 h-20.5 w-10 md:h-30.5 md:w-15`}),(0,a.jsxs)(`div`,{children:[r?(0,a.jsx)(`div`,{className:`mx-0 mt-0 mb-[4.8px] inline-block border-b border-b-primary-gray-500 pb-px font-semibold text-primary-gray-600 text-xs uppercase leading-base no-underline`,children:r}):null,(0,a.jsx)(`div`,{className:`m-0 p-0 font-semibold text-base text-content-primary leading-base no-underline lg:text-xl`,children:n})]})]})})}function l({className:e,children:n,...s}){let[c,l]=i.default.useState(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{...s,className:t.t(`hidden grow justify-between gap-8 text-sm uppercase md:flex`,e),children:n}),(0,a.jsxs)(`div`,{...s,className:t.t(`flex grow justify-end gap-8 md:hidden`,e),children:[(0,a.jsx)(`button`,{type:`button`,onClick:()=>{l(!c)},children:c?(0,a.jsx)(r.t,{className:`h-6 w-6 stroke-secondary`}):(0,a.jsx)(o,{className:`h-6 w-6 stroke-secondary`})}),c?(0,a.jsx)(`div`,{onClick:e=>{e.target.closest(`a`)&&l(!1)},onKeyDown:()=>{},className:`absolute top-full left-0 m-0 box-border h-[calc(100vh-75px)] w-full overflow-y-auto bg-surface/80 p-[5.625rem_1.5rem_3.75rem] backdrop-blur-frosted`,children:n}):null]})]})}function u({className:e,children:n,align:r=`center`,...i}){return(0,a.jsx)(`div`,{...i,className:t.t(`grid grow items-center gap-4 font-medium text-content-primary tracking-[0.42px] md:flex md:gap-8 [&>a:hover]:text-secondary [&>a]:font-bold [&>a]:text-base [&>a]:text-content-primary [&>a]:uppercase [&>a]:no-underline md:[&>a]:font-medium md:[&>a]:text-sm`,r===`end`?`md:justify-end`:`md:justify-center`,e),children:n})}function d({className:e,children:n,...r}){return(0,a.jsx)(`div`,{...r,className:t.t(`mt-6 flex items-center gap-8 md:mt-0 md:justify-center`,e),children:n})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
//# sourceMappingURL=header-BWD1jAkz.cjs.map