@worldresources/wri-design-systems 2.148.5 → 2.148.7

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
@@ -1904,6 +1904,13 @@
1904
1904
  height: 10px;
1905
1905
  width: 10px;
1906
1906
  }
1907
+
1908
+ &:focus-visible {
1909
+ outline-color: ${p("primary",700)};
1910
+ box-shadow:
1911
+ 0 0 0 2px ${p("neutral",100)},
1912
+ rgba(0, 0, 0, 0.05) 0px 2px 2px 4px;
1913
+ }
1907
1914
  `,Jo=r.css`
1908
1915
  font-size: 12px;
1909
1916
  font-weight: 700;
@@ -2649,7 +2656,7 @@ function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2649
2656
  display: flex;
2650
2657
  justify-content: center;
2651
2658
  align-items: center;
2652
- `,Ph=(e,t)=>e.findIndex((e=>e.value===t)),Mh=(e,t)=>r.css`
2659
+ `,Ph=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),Mh=(e,t)=>r.css`
2653
2660
  height: ${e?"96px":"48px"};
2654
2661
  width: 100%;
2655
2662
  background-color: ${p("neutral",100)};
@@ -3224,7 +3231,7 @@ function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3224
3231
  opacity: 1;
3225
3232
  }
3226
3233
  }
3227
- `,pf=(e,t)=>e.findIndex((e=>e.value===t)),hf=e=>1===e?"none":2===e?"left":"right",ff=r.css`
3234
+ `,pf=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),hf=e=>1===e?"none":2===e?"left":"right",ff=r.css`
3228
3235
  height: 28px;
3229
3236
  width: 28px;
3230
3237
  border-radius: 50%;
@@ -3548,7 +3555,7 @@ function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3548
3555
  padding: 0px;
3549
3556
  padding-top: 8px;
3550
3557
  color: ${i?p("neutral",500):"inherit"};
3551
- `),children:o.children}):null]},`${o.label}-${o.value}`);var i,a}))})}),exports.CloseButton=re,exports.ClusterPoint=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="cluster"})=>o.jsx(jn,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.ExtendableCard=({children:n,header:r,footer:o})=>t.jsx(e.Box,{css:Ki,children:t.jsx(e.Accordion.Root,{multiple:!0,children:t.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[t.jsxs(e.Accordion.ItemTrigger,{css:Ji,alignItems:"center",children:[t.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:r}),t.jsx(e.Accordion.ItemIndicator,{children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsxs(e.Accordion.ItemContent,{children:[n,o]})]})})}),exports.Footer=({children:e,label:n="© World Resources Institute",fixed:r,filled:o,maxWidth:i})=>{const a=(new Date).getFullYear();return t.jsx("footer",{css:kh(r,o),children:t.jsxs("div",{css:$h(i),children:[t.jsx("div",{children:t.jsx(D,{height:"32px",width:"91px"})}),t.jsx("div",{css:Sh,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Eh,children:[n," ",a]})})]})})},exports.IconButton=ne,exports.IconMarker=jn,exports.IconMarkers=kn,exports.InlineMessage=({label:e,caption:n,variant:r,size:o="large",icon:i=t.jsx(j,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l})=>{let c=Of;return"info-grey"===r?c=Lf:"success"===r?c=Tf:"warning"===r?c=Pf:"error"===r&&(c=Mf),t.jsxs("div",{css:[$f(o,l),c],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:Sf,children:[i,t.jsx("p",{css:Ef(o),children:e})]}),t.jsx("p",{css:Rf(o),children:n})]}),s?t.jsx(m,{label:s,variant:"info-white"===r||"info-grey"===r?"primary":"secondary",size:"large"===o?"default":"small",onClick:a}):null]})},exports.InputWithUnits=({label:r,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 t.jsxs("div",{css:ot,children:[i?t.jsx("div",{css:st}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:it(p),"aria-label":r,children:[d?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:at(p),"aria-label":o,children:o}),i?t.jsx("p",{css:lt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:ct(!!i,s),attached:!0,children:["start"===s?t.jsx(Ht,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,t.jsx(gt,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?t.jsx(Ht,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ri,exports.LayerGroup=({label:r,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((t=>{t.isDefaultSelected&&(e={...e,["radio"===t.variant?r:t.name]:t.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=`${r}, ${p} Active layers on the map${o?`, ${o}`:""}`;return t.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[t.jsxs(e.Accordion.ItemTrigger,{css:Bo,alignItems:"flex-start","aria-label":h,children:[t.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[t.jsxs("span",{css:Ho,children:[r,t.jsx(At,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),t.jsx("div",{css:Fo,children:o})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(ze,{name:r,defaultValue:u,customGap:"0px",onChange:(e,t)=>d(e,!!t,s,t),children:a.map((e=>t.jsx(Xo,{...e,onChange:(t,n)=>d(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:n,defaultValue:r,...o})=>t.jsx("div",{css:zo,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:r,multiple:!0,...o,children:n})}),exports.LayerItem=Xo,exports.LayerParameters=({label:r,children:o,openedByDefault:i})=>t.jsx("div",{children:t.jsx(e.Accordion.Root,{defaultValue:i?[r]:[],multiple:!0,children:t.jsxs(e.Accordion.Item,{css:Yo,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:Ko,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:Jo,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:Qo,children:n.Children.map(o,(e=>t.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:n,onDrag:r,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c})=>t.jsxs("div",{css:ei,children:[t.jsxs("div",{css:ti,children:[t.jsx(ne,{icon:t.jsx(T,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:r,style:{display:"none",marginBottom:"12px"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx(ne,{icon:t.jsx(k,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(ne,{icon:t.jsx(k,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:ni,children:[t.jsxs("div",{children:[t.jsx("h3",{css:ri,children:e}),t.jsx("p",{css:oi,children:n})]}),t.jsx(m,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx(E,{}),onClick:a})]}),s,t.jsxs("div",{css:ii,children:[t.jsx(m,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(j,{}),onClick:l}),t.jsx(ui,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=({items:n,noBorder:r})=>t.jsx(e.Box,{css:Oi(r),children:n.map((e=>t.jsx(Ii,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick},e.id??e.label)))}),exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d})=>{const p=[{icon:o.jsx(N,{}),label:"Zoom in",ariaLabel:"zoom in",onClick:e},{icon:o.jsx(V,{}),label:"Zoom out",ariaLabel:"zoom out",onClick:t,gap:!0},{icon:o.jsx(A,{}),label:"Expand",ariaLabel:"expand",onClick:n,gap:!0},{icon:o.jsx(z,{}),label:"Share",ariaLabel:"share",onClick:r,gap:!0},{icon:o.jsx(B,{}),label:"Print",ariaLabel:"print",onClick:i,gap:!0},{icon:o.jsx(H,{}),label:"Settings",ariaLabel:"settings",onClick:a,gap:!0},{icon:o.jsx(F,{}),label:"Help",ariaLabel:"question",onClick:s}];return o.jsx(fe,{items:p,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d||"Map controls toolbar"})},exports.MapPopUp=({open:e,onOpenChange:r,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}=To({open:e,onOpenChange:r,placement:c,whileElementsMounted:Jr,middleware:[uo(u),(b={fallbackAxisSideDirection:"start"},{...to(b),options:[b,y]}),po({padding:8}),ho({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=So(),v=Tr("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=Oo(f),{escapeKey:C,outsidePress:j}=Oo(x),k=l.useRef(!1),$=Tr((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?Rr(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=Tr((e=>{var t;const n=()=>{var t;$(e),null==(t=$r(e))||t.removeEventListener("keydown",n)};null==(t=$r(e))||t.addEventListener("keydown",n)})),E=Tr((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=$r(e),l="[data-floating-ui-inert]",c=Er(o.floating).querySelectorAll(l);let d=Ln(s)?s:null;for(;d&&!Wn(d);){const e=Un(d);if(Wn(e)||!Ln(e))break;d=e}if(c.length&&Ln(s)&&!s.matches("html,body")&&!kr(s,o.floating)&&Array.from(c).every((e=>!kr(d,e))))return;if(Tn(s)&&L){const t=Wn(s),n=qn(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&&Rr(g.nodesRef.current,p).some((t=>{var n;return Sr(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Sr(e,o.floating)||Sr(e,o.domReference)||h)return;const f=g?Rr(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=Tr((e=>{var t;const n=()=>{var t;E(e),null==(t=$r(e))||t.removeEventListener(u,n)};null==(t=$r(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}),Fn()?5:0)}const d=Er(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&&(Ln(o.domReference)&&(p=Yn(o.domReference)),Ln(o.floating)&&(p=p.concat(Yn(o.floating))),!Ln(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Yn(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 O=l.useMemo((()=>({onKeyDown:$,...d&&{[Eo[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,p]),L=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Ro[u]]:()=>{i.current.insideReactTree=!0}})),[$,u,i]);return l.useMemo((()=>a?{reference:O,floating:L}:{}),[a,O,L])}(g,{escapeKey:d,outsidePress:p}),C=_o(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=>Po(t,e,"reference")),t),i=l.useCallback((t=>Po(t,e,"floating")),n),a=l.useCallback((t=>Po(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),t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Do,children:[t.jsxs("div",{css:Io,children:[i,t.jsx(re,{onClick:()=>r(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),t.jsx("div",{css:No,children:a}),s?t.jsx("div",{css:Vo,children:s}):null,t.jsx("div",{ref:h,css:Ao(E,R,k,$,S,u)})]}),t.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&r(!1)})]})},exports.Menu=de,exports.MobileTabBar=({defaultValue:r,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const[l,c]=n.useState(Ph(o,r)||0);return t.jsx("div",{css:Rh,children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:r||o?.[0]?.value,onValueChange:({value:e})=>{return c(Ph(o,t=e)),void(i&&i(t));var t},activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map((n=>{const{label:r,icon:o,bagdeCount:i,"aria-label":s,...l}=n;return t.jsxs(e.Tabs.Trigger,{css:Oh,"aria-label":s||r,...l,children:[t.jsxs("div",{css:Lh,children:[o,i?t.jsx("div",{css:Th,className:"ds-badge-count",children:i}):null]}),a?null:t.jsx("p",{children:r})]},r)}))})})})},exports.Modal=({header:n,content:r,footer:o,size:i="medium",draggable:a,blocking:s,open:l,onClose:c})=>l?t.jsx(e.Dialog.Root,{open:l,onOpenChange:c,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!a&&!s,preventScroll:!a&&!s,closeOnEscape:!s,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[a?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(es,{disabled:!a,children:t.jsx(e.Dialog.Positioner,{children:t.jsxs(e.Dialog.Content,{css:ts(i),children:[t.jsxs(e.Dialog.Header,{css:ns,children:[n,s?null:t.jsx(e.Dialog.CloseTrigger,{css:rs,asChild:!0,children:t.jsx(re,{})})]}),t.jsx(e.Dialog.Body,{css:os,children:r}),o?t.jsx(e.Dialog.Footer,{padding:"12px",children:o}):null]})})})]})}):null,exports.MultiActionButton=({variant:r="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[u,d]=n.useState(!1),h=l?`${i} action button with menu, disabled`:void 0;return t.jsxs(e.Group,{css:me,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":h,role:"group",children:[t.jsx(m,{css:{},label:i,variant:r,size:o,onClick:a,disabled:l,...c}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:ge(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(m,{variant:r,size:o,leftIcon:t.jsx(k,{rotate:u?"180":"0",color:p("accessible","text-on-primary-mids")||p("primary",900)}),disabled:l})}),t.jsx(be,{children:s.map((({label:n,value:r,onClick:i})=>t.jsx(e.Menu.Item,{css:ve(o),onClick:i,value:r,children:n},r)))})]})]})},exports.Navbar=({logo:e,linkRouter:o,pathname:i,navigationSection:a,utilitySection:s,actionsSection:l,maxWidth:c,fixed:u,onNavbarHeightChange:d})=>{const h=n.useRef(null),f=n.useRef(null),x=n.useRef(null),[g,v]=n.useState(!1),[b,y]=n.useState(-1),[w,C]=n.useState("undefined"!=typeof window&&window?.innerWidth<=ef),[j,k]=n.useState(!1),$=o,S=n.useCallback((()=>{if(f.current&&h.current&&x.current){const e=h.current.getBoundingClientRect(),t=f.current.getBoundingClientRect(),n=x.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=ef||window.innerWidth<=b?(d?.(96),v(!0)):window.innerWidth>ef&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),v(!0),y(window.innerWidth)):window.innerWidth>b&&(d?.(48),v(!1),y(-1)):(d?.(48),v(!1),y(-1)),g&&(window.innerWidth<=ef||n.right>=t.left?(C(!0),d?.(48)):(C(!1),d?.(96)))}}),[b,g]);return n.useEffect((()=>(S(),window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)})),[S]),t.jsxs("nav",{css:Mh(g&&!w,u),children:[t.jsxs("div",{css:Dh(g&&!w,c),children:[t.jsxs("div",{css:(R=g&&!w,r.css`
3558
+ `),children:o.children}):null]},`${o.label}-${o.value}`);var i,a}))})}),exports.CloseButton=re,exports.ClusterPoint=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="cluster"})=>o.jsx(jn,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.ExtendableCard=({children:n,header:r,footer:o})=>t.jsx(e.Box,{css:Ki,children:t.jsx(e.Accordion.Root,{multiple:!0,children:t.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[t.jsxs(e.Accordion.ItemTrigger,{css:Ji,alignItems:"center",children:[t.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:r}),t.jsx(e.Accordion.ItemIndicator,{children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsxs(e.Accordion.ItemContent,{children:[n,o]})]})})}),exports.Footer=({children:e,label:n="© World Resources Institute",fixed:r,filled:o,maxWidth:i})=>{const a=(new Date).getFullYear();return t.jsx("footer",{css:kh(r,o),children:t.jsxs("div",{css:$h(i),children:[t.jsx("div",{children:t.jsx(D,{height:"32px",width:"91px"})}),t.jsx("div",{css:Sh,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Eh,children:[n," ",a]})})]})})},exports.IconButton=ne,exports.IconMarker=jn,exports.IconMarkers=kn,exports.InlineMessage=({label:e,caption:n,variant:r,size:o="large",icon:i=t.jsx(j,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l})=>{let c=Of;return"info-grey"===r?c=Lf:"success"===r?c=Tf:"warning"===r?c=Pf:"error"===r&&(c=Mf),t.jsxs("div",{css:[$f(o,l),c],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:Sf,children:[i,t.jsx("p",{css:Ef(o),children:e})]}),t.jsx("p",{css:Rf(o),children:n})]}),s?t.jsx(m,{label:s,variant:"info-white"===r||"info-grey"===r?"primary":"secondary",size:"large"===o?"default":"small",onClick:a}):null]})},exports.InputWithUnits=({label:r,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 t.jsxs("div",{css:ot,children:[i?t.jsx("div",{css:st}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:it(p),"aria-label":r,children:[d?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:at(p),"aria-label":o,children:o}),i?t.jsx("p",{css:lt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:ct(!!i,s),attached:!0,children:["start"===s?t.jsx(Ht,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,t.jsx(gt,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?t.jsx(Ht,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ri,exports.LayerGroup=({label:r,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((t=>{t.isDefaultSelected&&(e={...e,["radio"===t.variant?r:t.name]:t.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=`${r}, ${p} Active layers on the map${o?`, ${o}`:""}`;return t.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[t.jsxs(e.Accordion.ItemTrigger,{css:Bo,alignItems:"flex-start","aria-label":h,children:[t.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[t.jsxs("span",{css:Ho,children:[r,t.jsx(At,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),t.jsx("div",{css:Fo,children:o})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(ze,{name:r,defaultValue:u,customGap:"0px",onChange:(e,t)=>d(e,!!t,s,t),children:a.map((e=>t.jsx(Xo,{...e,onChange:(t,n)=>d(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:n,defaultValue:r,...o})=>t.jsx("div",{css:zo,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:r,multiple:!0,...o,children:n})}),exports.LayerItem=Xo,exports.LayerParameters=({label:r,children:o,openedByDefault:i})=>t.jsx("div",{children:t.jsx(e.Accordion.Root,{defaultValue:i?[r]:[],multiple:!0,children:t.jsxs(e.Accordion.Item,{css:Yo,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:Ko,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:Jo,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(k,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:Qo,children:n.Children.map(o,(e=>t.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:n,onDrag:r,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c})=>t.jsxs("div",{css:ei,children:[t.jsxs("div",{css:ti,children:[t.jsx(ne,{icon:t.jsx(T,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:r,style:{display:"none",marginBottom:"12px"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx(ne,{icon:t.jsx(k,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(ne,{icon:t.jsx(k,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:ni,children:[t.jsxs("div",{children:[t.jsx("h3",{css:ri,children:e}),t.jsx("p",{css:oi,children:n})]}),t.jsx(m,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx(E,{}),onClick:a})]}),s,t.jsxs("div",{css:ii,children:[t.jsx(m,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(j,{}),onClick:l}),t.jsx(ui,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=({items:n,noBorder:r})=>t.jsx(e.Box,{css:Oi(r),children:n.map((e=>t.jsx(Ii,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick},e.id??e.label)))}),exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d})=>{const p=[{icon:o.jsx(N,{}),label:"Zoom in",ariaLabel:"zoom in",onClick:e},{icon:o.jsx(V,{}),label:"Zoom out",ariaLabel:"zoom out",onClick:t,gap:!0},{icon:o.jsx(A,{}),label:"Expand",ariaLabel:"expand",onClick:n,gap:!0},{icon:o.jsx(z,{}),label:"Share",ariaLabel:"share",onClick:r,gap:!0},{icon:o.jsx(B,{}),label:"Print",ariaLabel:"print",onClick:i,gap:!0},{icon:o.jsx(H,{}),label:"Settings",ariaLabel:"settings",onClick:a,gap:!0},{icon:o.jsx(F,{}),label:"Help",ariaLabel:"question",onClick:s}];return o.jsx(fe,{items:p,vertical:l,expanded:c,showExpandedToggle:u,ariaLabel:d||"Map controls toolbar"})},exports.MapPopUp=({open:e,onOpenChange:r,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}=To({open:e,onOpenChange:r,placement:c,whileElementsMounted:Jr,middleware:[uo(u),(b={fallbackAxisSideDirection:"start"},{...to(b),options:[b,y]}),po({padding:8}),ho({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=So(),v=Tr("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=Oo(f),{escapeKey:C,outsidePress:j}=Oo(x),k=l.useRef(!1),$=Tr((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?Rr(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=Tr((e=>{var t;const n=()=>{var t;$(e),null==(t=$r(e))||t.removeEventListener("keydown",n)};null==(t=$r(e))||t.addEventListener("keydown",n)})),E=Tr((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=$r(e),l="[data-floating-ui-inert]",c=Er(o.floating).querySelectorAll(l);let d=Ln(s)?s:null;for(;d&&!Wn(d);){const e=Un(d);if(Wn(e)||!Ln(e))break;d=e}if(c.length&&Ln(s)&&!s.matches("html,body")&&!kr(s,o.floating)&&Array.from(c).every((e=>!kr(d,e))))return;if(Tn(s)&&L){const t=Wn(s),n=qn(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&&Rr(g.nodesRef.current,p).some((t=>{var n;return Sr(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Sr(e,o.floating)||Sr(e,o.domReference)||h)return;const f=g?Rr(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=Tr((e=>{var t;const n=()=>{var t;E(e),null==(t=$r(e))||t.removeEventListener(u,n)};null==(t=$r(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}),Fn()?5:0)}const d=Er(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&&(Ln(o.domReference)&&(p=Yn(o.domReference)),Ln(o.floating)&&(p=p.concat(Yn(o.floating))),!Ln(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Yn(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 O=l.useMemo((()=>({onKeyDown:$,...d&&{[Eo[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,p]),L=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Ro[u]]:()=>{i.current.insideReactTree=!0}})),[$,u,i]);return l.useMemo((()=>a?{reference:O,floating:L}:{}),[a,O,L])}(g,{escapeKey:d,outsidePress:p}),C=_o(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=>Po(t,e,"reference")),t),i=l.useCallback((t=>Po(t,e,"floating")),n),a=l.useCallback((t=>Po(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),t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Do,children:[t.jsxs("div",{css:Io,children:[i,t.jsx(re,{onClick:()=>r(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),t.jsx("div",{css:No,children:a}),s?t.jsx("div",{css:Vo,children:s}):null,t.jsx("div",{ref:h,css:Ao(E,R,k,$,S,u)})]}),t.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&r(!1)})]})},exports.Menu=de,exports.MobileTabBar=({defaultValue:r,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,u]=n.useState((()=>Ph(o,r)));return t.jsx("div",{css:Rh,children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:r||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Ph(o,e);u(t),i&&i(e)})(e),activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((n,r)=>{const{label:o,icon:i,bagdeCount:s,"aria-label":u,"aria-describedby":d,disabled:p,...h}=n,f=`${n.value}-str-status`,x=[`tab ${r+1} of ${l}`,c===r?"selected":"not selected"];p&&x.push("disabled");const g=[d,f].filter(Boolean).join(" ")||void 0;return t.jsxs(e.Tabs.Trigger,{css:Oh,"aria-label":u||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[t.jsxs("div",{css:Lh,children:[i,s?t.jsx("div",{css:Th,className:"ds-badge-count",children:s}):null]}),a?null:t.jsx("p",{children:o}),t.jsx(e.VisuallyHidden,{id:f,children:x.join(", ")})]},n.value)}))})})})},exports.Modal=({header:n,content:r,footer:o,size:i="medium",draggable:a,blocking:s,open:l,onClose:c})=>l?t.jsx(e.Dialog.Root,{open:l,onOpenChange:c,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!a&&!s,preventScroll:!a&&!s,closeOnEscape:!s,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[a?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(es,{disabled:!a,children:t.jsx(e.Dialog.Positioner,{children:t.jsxs(e.Dialog.Content,{css:ts(i),children:[t.jsxs(e.Dialog.Header,{css:ns,children:[n,s?null:t.jsx(e.Dialog.CloseTrigger,{css:rs,asChild:!0,children:t.jsx(re,{})})]}),t.jsx(e.Dialog.Body,{css:os,children:r}),o?t.jsx(e.Dialog.Footer,{padding:"12px",children:o}):null]})})})]})}):null,exports.MultiActionButton=({variant:r="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[u,d]=n.useState(!1),h=l?`${i} action button with menu, disabled`:void 0;return t.jsxs(e.Group,{css:me,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":h,role:"group",children:[t.jsx(m,{css:{},label:i,variant:r,size:o,onClick:a,disabled:l,...c}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:ge(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(m,{variant:r,size:o,leftIcon:t.jsx(k,{rotate:u?"180":"0",color:p("accessible","text-on-primary-mids")||p("primary",900)}),disabled:l})}),t.jsx(be,{children:s.map((({label:n,value:r,onClick:i})=>t.jsx(e.Menu.Item,{css:ve(o),onClick:i,value:r,children:n},r)))})]})]})},exports.Navbar=({logo:e,linkRouter:o,pathname:i,navigationSection:a,utilitySection:s,actionsSection:l,maxWidth:c,fixed:u,onNavbarHeightChange:d})=>{const h=n.useRef(null),f=n.useRef(null),x=n.useRef(null),[g,v]=n.useState(!1),[b,y]=n.useState(-1),[w,C]=n.useState("undefined"!=typeof window&&window?.innerWidth<=ef),[j,k]=n.useState(!1),$=o,S=n.useCallback((()=>{if(f.current&&h.current&&x.current){const e=h.current.getBoundingClientRect(),t=f.current.getBoundingClientRect(),n=x.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=ef||window.innerWidth<=b?(d?.(96),v(!0)):window.innerWidth>ef&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),v(!0),y(window.innerWidth)):window.innerWidth>b&&(d?.(48),v(!1),y(-1)):(d?.(48),v(!1),y(-1)),g&&(window.innerWidth<=ef||n.right>=t.left?(C(!0),d?.(48)):(C(!1),d?.(96)))}}),[b,g]);return n.useEffect((()=>(S(),window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)})),[S]),t.jsxs("nav",{css:Mh(g&&!w,u),children:[t.jsxs("div",{css:Dh(g&&!w,c),children:[t.jsxs("div",{css:(R=g&&!w,r.css`
3552
3559
  display: flex;
3553
3560
  align-items: center;
3554
3561
  justify-content: flex-start;