@worldresources/wri-design-systems 2.187.0 → 2.187.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3700,7 +3700,7 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3700
3700
  padding: 0px;
3701
3701
  padding-top: 8px;
3702
3702
  color: ${i?h("neutral",500):"inherit"};
3703
- `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=ce,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(_n,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.DesignSystemLocaleProvider=({labels:e,children:n})=>t.jsx(f.Provider,{value:{labels:e},children:n}),exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:da,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:pa,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:a})=>{const s=(new Date).getFullYear();return r.jsx("footer",{css:Vh(n,o),children:r.jsxs("div",{css:Ah(i),children:[r.jsxs("div",{css:Hh,children:[r.jsx(N,{height:"32px",width:"91px"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:zh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Bh,children:[t," ",s]})})]})})},exports.IconButton=le,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(S,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:u})=>{let d=Yf;return"info-grey"===n?d=Kf:"success"===n?d=Jf:"warning"===n?d=Qf:"error"===n&&(d=ex),r.jsxs("div",{css:[qf(o,l),d],"aria-roledescription":"Note",children:[r.jsxs("div",{children:[r.jsxs("div",{css:Wf,children:[i,r.jsx("p",{css:Gf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Uf(o,!!i),children:t}):t?r.jsx("div",{css:Xf(o,!!i),children:t}):null]}),s?r.jsx(w,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:u}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:u,required:d,disabled:p})=>{const[h,f]=n.useState(c),[x,g]=n.useState(l?[l]:[a[0].value]),v=(e,t)=>{u&&u("end"===s?""+(t?`${h} ${e}`:`${e} ${x}`):""+(t?`${e} ${h}`:`${x} ${e}`))};return r.jsxs("div",{css:xt,children:[i?r.jsx("div",{css:mt}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:gt(p),"aria-label":t,children:[d?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:vt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:bt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:yt(!!i,s),attached:!0,children:["start"===s?r.jsx(Qt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Et,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?r.jsx(Qt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ai,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s})=>{const[l,c]=n.useState({}),[u]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...l};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),c(e)}),[]);const d=(e,t,n,r)=>{const o={...l,[e]:t};c(o),n&&n(e,t,r)},p=Object.values(l).filter((e=>!0===e)).length,h=`${t}, ${p} Active layers on the map${o?`, ${o}`:""}`;return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Jo,alignItems:"flex-start","aria-label":h,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:Qo,children:[t,r.jsx(Yt,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),r.jsx("div",{css:ei,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Ue,{name:t,value:u,customGap:"0px",onChange:(e,t)=>d(e,!!t,s,t),children:a.map((e=>r.jsx(ai,{...e,onChange:(t,n)=>d(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:Ko,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=ai,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:si,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:li,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:ci,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:ui,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c})=>r.jsxs("div",{css:di,children:[r.jsxs("div",{css:pi,children:[r.jsx(le,{icon:r.jsx(P,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(le,{icon:r.jsx(E,{rotate:"180"}),"aria-label":"Up",onClick:o}),r.jsx(le,{icon:r.jsx(E,{}),"aria-label":"Down",onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:hi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:fi,children:e}),r.jsx("p",{css:xi,children:t})]}),r.jsx(w,{label:"Remove",size:"small",variant:"secondary",rightIcon:r.jsx(L,{}),onClick:a})]}),s,r.jsxs("div",{css:gi,children:[r.jsx(w,{label:"About data",size:"small",variant:"secondary",leftIcon:r.jsx(S,{}),onClick:l}),r.jsx(wi,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=Ui,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d})=>{const p=[{icon:t.jsx(A,{}),label:"Zoom in",ariaLabel:"zoom in",onClick:e},{icon:t.jsx(z,{}),label:"Zoom out",ariaLabel:"zoom out",onClick:n,gap:!0},{icon:t.jsx(B,{}),label:"Expand",ariaLabel:"expand",onClick:r,gap:!0},{icon:t.jsx(H,{}),label:"Share",ariaLabel:"share",onClick:o,gap:!0},{icon:t.jsx(F,{}),label:"Print",ariaLabel:"print",onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:"Settings",ariaLabel:"settings",onClick:a,gap:!0},{icon:t.jsx(q,{}),label:"Help",ariaLabel:"question",onClick:s}];return t.jsx(ge,{items:p,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d||"Map controls toolbar"})},exports.MapMarker=_n,exports.MapMarkers=Dn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:u=30,closeOnEscape:d=!0,closeOnOutsideClick:p=!1})=>{const h=n.useRef(null),{refs:f,floatingStyles:x,context:g,middlewareData:v,placement:m}=Ho({open:e,onOpenChange:t,placement:c,whileElementsMounted:co,middleware:[Co(u),(b={fallbackAxisSideDirection:"start"},{...ho(b),options:[b,y]}),jo({padding:8}),ko({element:h})]});var b,y;n.useEffect((()=>{o?.current&&f.setReference(o.current)}),[o,f]);const w=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=No(),v=Hr("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=zo(f),{escapeKey:C,outsidePress:j}=zo(x),k=l.useRef(!1),$=Hr((e=>{var t;if(!n||!a||!s||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=g?Ar(g.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=Hr((e=>{var t;const n=()=>{var t;$(e),null==(t=Ir(e))||t.removeEventListener("keydown",n)};null==(t=Ir(e))||t.addEventListener("keydown",n)})),E=Hr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===u&&a)return;if(n)return;if("function"==typeof m&&!m(e))return;const s=Ir(e),l="[data-floating-ui-inert]",c=Vr(o.floating).querySelectorAll(l);let d=Bn(s)?s:null;for(;d&&!nr(d);){const e=ir(d);if(nr(e)||!Bn(e))break;d=e}if(c.length&&Bn(s)&&!s.matches("html,body")&&!Dr(s,o.floating)&&Array.from(c).every((e=>!Dr(d,e))))return;if(Hn(s)&&O){const t=nr(s),n=rr(s),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),a=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=i&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),d=a&&e.offsetY>s.clientHeight;if(u||d)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=g&&Ar(g.nodesRef.current,p).some((t=>{var n;return Nr(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Nr(e,o.floating)||Nr(e,o.domReference)||h)return;const f=g?Ar(g.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),R=Hr((e=>{var t;const n=()=>{var t;E(e),null==(t=Ir(e))||t.removeEventListener(u,n)};null==(t=Ir(e))||t.addEventListener(u,n)}));l.useEffect((()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function c(){e=window.setTimeout((()=>{k.current=!1}),er()?5:0)}const d=Vr(o.floating);s&&(d.addEventListener("keydown",C?S:$,C),d.addEventListener("compositionstart",l),d.addEventListener("compositionend",c)),m&&d.addEventListener(u,j?R:E,j);let p=[];return h&&(Bn(o.domReference)&&(p=sr(o.domReference)),Bn(o.floating)&&(p=p.concat(sr(o.floating))),!Bn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(sr(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(d.removeEventListener("keydown",C?S:$,C),d.removeEventListener("compositionstart",l),d.removeEventListener("compositionend",c)),m&&d.removeEventListener(u,j?R:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,m,u,n,r,h,a,y,w,$,C,S,E,j,R]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,m,u]);const L=l.useMemo((()=>({onKeyDown:$,...d&&{[Vo[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,p]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Ao[u]]:()=>{i.current.insideReactTree=!0}})),[$,u,i]);return l.useMemo((()=>a?{reference:L,floating:O}:{}),[a,L,O])}(g,{escapeKey:d,outsidePress:p}),C=qo(g,{role:"dialog"}),{getFloatingProps:j}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>Fo(t,e,"reference")),t),i=l.useCallback((t=>Fo(t,e,"floating")),n),a=l.useCallback((t=>Fo(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([w,C]),{x:k,y:$}=v.arrow??{x:null,y:null},S={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];if(!e)return null;let E=u-1,R=4;return"left"!==S&&"right"!==S||(E=4,R=u-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Wo,children:[r.jsxs("div",{css:Go,children:[i,r.jsx(ce,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),r.jsx("div",{css:Uo,children:a}),s?r.jsx("div",{css:Xo,children:s}):null,r.jsx("div",{ref:h,css:Yo(E,R,k,$,S,u)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=ke,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,u]=n.useState((()=>Gh(o,t)));return r.jsx("div",{css:Fh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Gh(o,e);u(t),i&&i(e)})(e),activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:s,"aria-label":u,"aria-describedby":d,disabled:p,...h}=t,f=`${t.value}-str-status`,x=[`tab ${n+1} of ${l}`,c===n?"selected":"not selected"];p&&x.push("disabled");const g=[d,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Zh,"aria-label":u||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[r.jsxs("div",{css:qh,children:[i,s?r.jsx("div",{css:Wh,className:"ds-badge-count",children:s}):null]}),a?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:f,children:x.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:a="medium",width:s,height:l,maxHeight:c,draggable:u,blocking:d,open:p,onClose:h})=>{const f=n.useRef(null);return p?r.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!u&&!d,preventScroll:!u&&!d,closeOnEscape:!d,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[u?null:r.jsx(e.Dialog.Backdrop,{}),r.jsx(ps,{disabled:!u,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:hs(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:fs,children:[t,d?null:r.jsx(e.Dialog.CloseTrigger,{css:xs,asChild:!0,children:r.jsx(ce,{})})]}),r.jsx(e.Dialog.Body,{css:gs,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"12px",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[u,d]=n.useState(!1),p=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:Re,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[r.jsx(w,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Se(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(w,{variant:t,size:o,leftIcon:r.jsx(E,{rotate:u?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Le,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Ee(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:u,fixed:d,onNavbarHeightChange:p,backgroundColor:h})=>{const f=n.useRef(null),x=n.useRef(null),g=n.useRef(null),[v,m]=n.useState(!1),[b,y]=n.useState(-1),[C,j]=n.useState("undefined"!=typeof window&&window?.innerWidth<=vf),[k,$]=n.useState(!1),S=i,E=n.useCallback((()=>{if(x.current&&f.current&&g.current){const e=f.current.getBoundingClientRect(),t=x.current.getBoundingClientRect(),n=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=vf||window.innerWidth<=b?(p?.(96),m(!0)):window.innerWidth>vf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),m(!0),y(window.innerWidth)):window.innerWidth>b&&(p?.(48),m(!1),y(-1)):(p?.(48),m(!1),y(-1)),v&&(window.innerWidth<=vf||n.right>=t.left?(j(!0),p?.(48)):(j(!1),p?.(96)))}}),[b,v]);n.useEffect((()=>(E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)})),[E]);const R="condensed"===e;return r.jsxs("nav",{css:Uh(v&&!C,d,h,t,R),children:[r.jsxs("div",{css:Yh(v&&!C,u,R),children:[r.jsxs("div",{css:Kh(v&&!C||"dark"===t,R),ref:f,children:[o?r.jsx("div",{ref:g,css:Jh,children:o}):null,r.jsx("div",{css:Qh(v),children:s?.map((e=>e.link?r.jsx(S,{to:e.link,href:e.link,css:ef(a===e.link,t),children:e.label},e.label):r.jsx(ke,{theme:t,label:e.label,items:e.items||[]},e.label)))})]}),r.jsx("div",{css:tf(R),ref:x,children:C?r.jsxs("button",{type:"button",onClick:()=>$(!k),"aria-label":"Open menu",css:of(t),children:[k?"Close":"Menu",k?r.jsx(L,{height:"16px",width:"16px"}):r.jsx(ee,{height:"16px",width:"16px"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:tf(R),children:l?.map(((e,t)=>r.jsx("div",{css:nf(v),children:e},t)))}),c?.length?r.jsx("div",{css:rf(v),children:c.map((e=>r.jsx(w,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?r.jsx("div",{css:Xh(t,R),children:s?.map((e=>e.link?r.jsx(S,{to:e.link,href:e.link,css:ef(a===e.link,t),children:e.label},e.label):r.jsx(ke,{theme:t,label:e.label,items:e.items||[]},e.label)))}):null,C?r.jsx(gf,{theme:t,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:k,setIsOpen:$,pathname:a}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s})=>{const[l,c]=n.useState(!1),[u,d]=n.useState(o||t?.[0]?.value),p=e=>{d(e),i&&i(e)},[f]=e.useMediaQuery(["(max-width: 768px)"]);return f?r.jsxs(e.Tabs.Root,{defaultValue:u,onValueChange:({value:e})=>p(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"8px",gap:"8px"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":h("primary",500),flexShrink:0,padding:"10px 16px",color:h("neutral",600),"&[data-selected]":{color:h("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:a},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[r.jsxs("div",{css:mf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{p(e)},role:"tablist",children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:bf,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:yf,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{c(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:wf,children:[r.jsx("div",{css:yf,children:l?r.jsx(j,{}):r.jsx(C,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:l?"Show":"Hide"}),r.jsx("p",{children:"Sidebar"})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!l,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Cf,role:"tabpanel","aria-labelledby":u,children:a})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:i})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:i,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:n.map((t=>{return r.jsxs(e.RadioCard.Item,{css:Ve,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:Ae,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3703
+ `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=ce,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(_n,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.DesignSystemLocaleProvider=({labels:e,children:n})=>t.jsx(f.Provider,{value:{labels:e},children:n}),exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:da,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:pa,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:a})=>{const s=(new Date).getFullYear();return r.jsx("footer",{css:Vh(n,o),children:r.jsxs("div",{css:Ah(i),children:[r.jsxs("div",{css:Hh,children:[r.jsx(N,{height:"32px",width:"91px"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:zh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Bh,children:[t," ",s]})})]})})},exports.IconButton=le,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(S,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:u})=>{let d=Yf;return"info-grey"===n?d=Kf:"success"===n?d=Jf:"warning"===n?d=Qf:"error"===n&&(d=ex),r.jsxs("div",{css:[qf(o,l),d],"aria-roledescription":"Note",children:[r.jsxs("div",{children:[r.jsxs("div",{css:Wf,children:[i,r.jsx("p",{css:Gf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Uf(o,!!i),children:t}):t?r.jsx("div",{css:Xf(o,!!i),children:t}):null]}),s?r.jsx(w,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:u}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:u,required:d,disabled:p})=>{const[h,f]=n.useState(c),[x,g]=n.useState(l?[l]:[a[0].value]),v=(e,t)=>{u&&u("end"===s?""+(t?`${h} ${e}`:`${e} ${x}`):""+(t?`${e} ${h}`:`${x} ${e}`))};return r.jsxs("div",{css:xt,children:[i?r.jsx("div",{css:mt}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:gt(p),"aria-label":t,children:[d?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:vt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:bt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:yt(!!i,s),attached:!0,children:["start"===s?r.jsx(Qt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Et,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?r.jsx(Qt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ai,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s})=>{const[l,c]=n.useState({}),[u]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...l};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),c(e)}),[]);const d=(e,t,n,r)=>{const o={...l,[e]:t};c(o),n&&n(e,t,r)},p=Object.values(l).filter((e=>!0===e)).length,h=`${t}, ${p} Active layers on the map${o?`, ${o}`:""}`;return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Jo,alignItems:"flex-start","aria-label":h,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:Qo,children:[t,r.jsx(Yt,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),r.jsx("div",{css:ei,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Ue,{name:t,value:u,customGap:"0px",onChange:(e,t)=>d(e,!!t,s,t),children:a.map((e=>r.jsx(ai,{...e,onChange:(t,n)=>d(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:Ko,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=ai,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:si,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:li,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:ci,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(E,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:ui,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c})=>r.jsxs("div",{css:di,children:[r.jsxs("div",{css:pi,children:[r.jsx(le,{icon:r.jsx(P,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(le,{icon:r.jsx(E,{rotate:"180"}),"aria-label":"Up",onClick:o}),r.jsx(le,{icon:r.jsx(E,{}),"aria-label":"Down",onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:hi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:fi,children:e}),r.jsx("p",{css:xi,children:t})]}),r.jsx(w,{label:"Remove",size:"small",variant:"secondary",rightIcon:r.jsx(L,{}),onClick:a})]}),s,r.jsxs("div",{css:gi,children:[r.jsx(w,{label:"About data",size:"small",variant:"secondary",leftIcon:r.jsx(S,{}),onClick:l}),r.jsx(wi,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=Ui,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d})=>{const p=[{icon:t.jsx(A,{}),label:"Zoom in",ariaLabel:"zoom in",onClick:e},{icon:t.jsx(z,{}),label:"Zoom out",ariaLabel:"zoom out",onClick:n,gap:!0},{icon:t.jsx(B,{}),label:"Expand",ariaLabel:"expand",onClick:r,gap:!0},{icon:t.jsx(H,{}),label:"Share",ariaLabel:"share",onClick:o,gap:!0},{icon:t.jsx(F,{}),label:"Print",ariaLabel:"print",onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:"Settings",ariaLabel:"settings",onClick:a,gap:!0},{icon:t.jsx(q,{}),label:"Help",ariaLabel:"question",onClick:s}];return t.jsx(ge,{items:p,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d||"Map controls toolbar"})},exports.MapMarker=_n,exports.MapMarkers=Dn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:u=30,closeOnEscape:d=!0,closeOnOutsideClick:p=!1})=>{const h=n.useRef(null),{refs:f,floatingStyles:x,context:g,middlewareData:v,placement:m}=Ho({open:e,onOpenChange:t,placement:c,whileElementsMounted:co,middleware:[Co(u),(b={fallbackAxisSideDirection:"start"},{...ho(b),options:[b,y]}),jo({padding:8}),ko({element:h})]});var b,y;n.useEffect((()=>{o?.current&&f.setReference(o.current)}),[o,f]);const w=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=No(),v=Hr("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=zo(f),{escapeKey:C,outsidePress:j}=zo(x),k=l.useRef(!1),$=Hr((e=>{var t;if(!n||!a||!s||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=g?Ar(g.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=Hr((e=>{var t;const n=()=>{var t;$(e),null==(t=Ir(e))||t.removeEventListener("keydown",n)};null==(t=Ir(e))||t.addEventListener("keydown",n)})),E=Hr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===u&&a)return;if(n)return;if("function"==typeof m&&!m(e))return;const s=Ir(e),l="[data-floating-ui-inert]",c=Vr(o.floating).querySelectorAll(l);let d=Bn(s)?s:null;for(;d&&!nr(d);){const e=ir(d);if(nr(e)||!Bn(e))break;d=e}if(c.length&&Bn(s)&&!s.matches("html,body")&&!Dr(s,o.floating)&&Array.from(c).every((e=>!Dr(d,e))))return;if(Hn(s)&&O){const t=nr(s),n=rr(s),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),a=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=i&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),d=a&&e.offsetY>s.clientHeight;if(u||d)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=g&&Ar(g.nodesRef.current,p).some((t=>{var n;return Nr(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Nr(e,o.floating)||Nr(e,o.domReference)||h)return;const f=g?Ar(g.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),R=Hr((e=>{var t;const n=()=>{var t;E(e),null==(t=Ir(e))||t.removeEventListener(u,n)};null==(t=Ir(e))||t.addEventListener(u,n)}));l.useEffect((()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function c(){e=window.setTimeout((()=>{k.current=!1}),er()?5:0)}const d=Vr(o.floating);s&&(d.addEventListener("keydown",C?S:$,C),d.addEventListener("compositionstart",l),d.addEventListener("compositionend",c)),m&&d.addEventListener(u,j?R:E,j);let p=[];return h&&(Bn(o.domReference)&&(p=sr(o.domReference)),Bn(o.floating)&&(p=p.concat(sr(o.floating))),!Bn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(sr(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(d.removeEventListener("keydown",C?S:$,C),d.removeEventListener("compositionstart",l),d.removeEventListener("compositionend",c)),m&&d.removeEventListener(u,j?R:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,m,u,n,r,h,a,y,w,$,C,S,E,j,R]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,m,u]);const L=l.useMemo((()=>({onKeyDown:$,...d&&{[Vo[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,p]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Ao[u]]:()=>{i.current.insideReactTree=!0}})),[$,u,i]);return l.useMemo((()=>a?{reference:L,floating:O}:{}),[a,L,O])}(g,{escapeKey:d,outsidePress:p}),C=qo(g,{role:"dialog"}),{getFloatingProps:j}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>Fo(t,e,"reference")),t),i=l.useCallback((t=>Fo(t,e,"floating")),n),a=l.useCallback((t=>Fo(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([w,C]),{x:k,y:$}=v.arrow??{x:null,y:null},S={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];if(!e)return null;let E=u-1,R=4;return"left"!==S&&"right"!==S||(E=4,R=u-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Wo,children:[r.jsxs("div",{css:Go,children:[i,r.jsx(ce,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),r.jsx("div",{css:Uo,children:a}),s?r.jsx("div",{css:Xo,children:s}):null,r.jsx("div",{ref:h,css:Yo(E,R,k,$,S,u)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=ke,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,u]=n.useState((()=>Gh(o,t)));return r.jsx("div",{css:Fh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Gh(o,e);u(t),i&&i(e)})(e),activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:s,"aria-label":u,"aria-describedby":d,disabled:p,...h}=t,f=`${t.value}-str-status`,x=[`tab ${n+1} of ${l}`,c===n?"selected":"not selected"];p&&x.push("disabled");const g=[d,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Zh,"aria-label":u||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[r.jsxs("div",{css:qh,children:[i,s?r.jsx("div",{css:Wh,className:"ds-badge-count",children:s}):null]}),a?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:f,children:x.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:a="medium",width:s,height:l,maxHeight:c,draggable:u,blocking:d,open:p,onClose:h})=>{const f=n.useRef(null);return p?r.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!u&&!d,preventScroll:!u&&!d,closeOnEscape:!d,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[u?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(ps,{disabled:!u,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:hs(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:fs,children:[t,d?null:r.jsx(e.Dialog.CloseTrigger,{css:xs,asChild:!0,children:r.jsx(ce,{})})]}),r.jsx(e.Dialog.Body,{css:gs,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"12px",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[u,d]=n.useState(!1),p=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:Re,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[r.jsx(w,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Se(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(w,{variant:t,size:o,leftIcon:r.jsx(E,{rotate:u?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Le,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Ee(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:u,fixed:d,onNavbarHeightChange:p,backgroundColor:h})=>{const f=n.useRef(null),x=n.useRef(null),g=n.useRef(null),[v,m]=n.useState(!1),[b,y]=n.useState(-1),[C,j]=n.useState("undefined"!=typeof window&&window?.innerWidth<=vf),[k,$]=n.useState(!1),S=i,E=n.useCallback((()=>{if(x.current&&f.current&&g.current){const e=f.current.getBoundingClientRect(),t=x.current.getBoundingClientRect(),n=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=vf||window.innerWidth<=b?(p?.(96),m(!0)):window.innerWidth>vf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),m(!0),y(window.innerWidth)):window.innerWidth>b&&(p?.(48),m(!1),y(-1)):(p?.(48),m(!1),y(-1)),v&&(window.innerWidth<=vf||n.right>=t.left?(j(!0),p?.(48)):(j(!1),p?.(96)))}}),[b,v]);n.useEffect((()=>(E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)})),[E]);const R="condensed"===e;return r.jsxs("nav",{css:Uh(v&&!C,d,h,t,R),children:[r.jsxs("div",{css:Yh(v&&!C,u,R),children:[r.jsxs("div",{css:Kh(v&&!C||"dark"===t,R),ref:f,children:[o?r.jsx("div",{ref:g,css:Jh,children:o}):null,r.jsx("div",{css:Qh(v),children:s?.map((e=>e.link?r.jsx(S,{to:e.link,href:e.link,css:ef(a===e.link,t),children:e.label},e.label):r.jsx(ke,{theme:t,label:e.label,items:e.items||[]},e.label)))})]}),r.jsx("div",{css:tf(R),ref:x,children:C?r.jsxs("button",{type:"button",onClick:()=>$(!k),"aria-label":"Open menu",css:of(t),children:[k?"Close":"Menu",k?r.jsx(L,{height:"16px",width:"16px"}):r.jsx(ee,{height:"16px",width:"16px"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:tf(R),children:l?.map(((e,t)=>r.jsx("div",{css:nf(v),children:e},t)))}),c?.length?r.jsx("div",{css:rf(v),children:c.map((e=>r.jsx(w,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?r.jsx("div",{css:Xh(t,R),children:s?.map((e=>e.link?r.jsx(S,{to:e.link,href:e.link,css:ef(a===e.link,t),children:e.label},e.label):r.jsx(ke,{theme:t,label:e.label,items:e.items||[]},e.label)))}):null,C?r.jsx(gf,{theme:t,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:k,setIsOpen:$,pathname:a}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s})=>{const[l,c]=n.useState(!1),[u,d]=n.useState(o||t?.[0]?.value),p=e=>{d(e),i&&i(e)},[f]=e.useMediaQuery(["(max-width: 768px)"]);return f?r.jsxs(e.Tabs.Root,{defaultValue:u,onValueChange:({value:e})=>p(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"8px",gap:"8px"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":h("primary",500),flexShrink:0,padding:"10px 16px",color:h("neutral",600),"&[data-selected]":{color:h("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:a},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[r.jsxs("div",{css:mf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{p(e)},role:"tablist",children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:bf,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:yf,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{c(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:wf,children:[r.jsx("div",{css:yf,children:l?r.jsx(j,{}):r.jsx(C,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:l?"Show":"Hide"}),r.jsx("p",{children:"Sidebar"})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!l,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Cf,role:"tabpanel","aria-labelledby":u,children:a})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:i})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:i,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:n.map((t=>{return r.jsxs(e.RadioCard.Item,{css:Ve,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:Ae,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3704
3704
  width: 100%;
3705
3705
  display: flex;
3706
3706
  flex-direction: ${"centered"===i?"column":"row"};
package/dist/index.esm.js CHANGED
@@ -2451,7 +2451,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2451
2451
  top: 10px;
2452
2452
  `,Ys=ge`
2453
2453
  padding: 12px;
2454
- `,Ks=({header:e,content:t,footer:n,size:r="medium",width:o,height:i,maxHeight:a,draggable:s,blocking:c,open:d,onClose:u})=>{const p=te(null);return d?he(M.Root,{open:d,onOpenChange:u,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!s&&!c,preventScroll:!s&&!c,closeOnEscape:!c,defaultOpen:!0,children:pe(l,{children:[s?null:he(M.Backdrop,{}),he(Ws,{disabled:!s,nodeRef:p,children:he(M.Positioner,{ref:p,children:pe(M.Content,{css:Gs(r,o,i,a),children:[pe(M.Header,{css:Xs,children:[e,c?null:he(M.CloseTrigger,{css:Us,asChild:!0,children:he(yt,{})})]}),he(M.Body,{css:Ys,children:t}),n?he(M.Footer,{padding:"12px",children:n}):null]})})})]})}):null},Js=e=>ge`
2454
+ `,Ks=({header:e,content:t,footer:n,size:r="medium",width:o,height:i,maxHeight:a,draggable:s,blocking:c,open:d,onClose:u})=>{const p=te(null);return d?he(M.Root,{open:d,onOpenChange:u,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!s&&!c,preventScroll:!s&&!c,closeOnEscape:!c,defaultOpen:!0,children:pe(l,{children:[s?null:he(M.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),he(Ws,{disabled:!s,nodeRef:p,children:he(M.Positioner,{ref:p,children:pe(M.Content,{css:Gs(r,o,i,a),children:[pe(M.Header,{css:Xs,children:[e,c?null:he(M.CloseTrigger,{css:Us,asChild:!0,children:he(yt,{})})]}),he(M.Body,{css:Ys,children:t}),n?he(M.Footer,{padding:"12px",children:n}):null]})})})]})}):null},Js=e=>ge`
2455
2455
  height: 100%;
2456
2456
  width: ${e||"320px"};
2457
2457
  background-color: ${$e("neutral",100)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldresources/wri-design-systems",
3
- "version": "2.187.0",
3
+ "version": "2.187.1",
4
4
  "description": "WRI UI Library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",