@worldresources/wri-design-systems 2.190.0 → 2.191.0

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
@@ -3731,7 +3731,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3731
3731
  padding: 0px;
3732
3732
  padding-top: 8px;
3733
3733
  color: ${i?h("neutral",500):"inherit"};
3734
- `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=de,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(f.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:xa,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:ga,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(L,{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:Hh(n,o),children:r.jsxs("div",{css:Fh(i),children:[r.jsxs("div",{css:Wh,children:[r.jsx(N,{height:"32px",width:"91px"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:qh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Zh,children:[t," ",s]})})]})})},exports.FormContainer=({label:e,error:t,children:n})=>r.jsxs("div",{css:Oe,children:[t?r.jsx("div",{css:Me}):null,r.jsxs("div",{children:[e?r.jsx("p",{css:Pe,children:e}):null,t?r.jsx("p",{css:_e,"aria-label":t,children:t}):null,n]})]}),exports.IconButton=ce,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(E,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:d,labels:u})=>{const p=w("InlineMessage",u);let h=ex;return"info-grey"===n?h=tx:"success"===n?h=nx:"warning"===n?h=rx:"error"===n&&(h=ox),r.jsxs("div",{css:[Xf(o,l),h],"aria-roledescription":p.roleDescription,children:[r.jsxs("div",{children:[r.jsxs("div",{css:Yf,children:[i,r.jsx("p",{css:Kf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Jf(o,!!i),children:t}):t?r.jsx("div",{css:Qf(o,!!i),children:t}):null]}),s?r.jsx(C,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:d}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:p})=>{const[h,f]=n.useState(c),[x,g]=n.useState(l?[l]:[a[0].value]),v=(e,t)=>{d&&d("end"===s?""+(t?`${h} ${e}`:`${e} ${x}`):""+(t?`${e} ${h}`:`${x} ${e}`))};return r.jsxs("div",{css:mt,children:[i?r.jsx("div",{css:Ct}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:yt(p),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:wt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:jt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:kt(!!i,s),attached:!0,children:["start"===s?r.jsx(rn,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Ot,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?r.jsx(rn,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Fi,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s,labels:l})=>{const c=w("LayerGroup",l),[d,u]=n.useState({}),[p]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...d};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const h=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,x=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:ni,alignItems:"flex-start","aria-label":x,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:ri,children:[t,r.jsx(en,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:oi,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Qe,{name:t,value:p,customGap:"0px",onChange:(e,t)=>h(e,!!t,s,t),children:a.map((e=>r.jsx(di,{...e,onChange:(t,n)=>h(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:ti,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=di,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:ui,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:pi,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:hi,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:fi,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,labels:d})=>{const u=w("LegendItem",d);return r.jsxs("div",{css:xi,children:[r.jsxs("div",{css:gi,children:[r.jsx(ce,{icon:r.jsx(_,{}),"aria-label":u.dragAndDropLabel,"aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(ce,{icon:r.jsx(L,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(ce,{icon:r.jsx(L,{}),"aria-label":u.downLabel,onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:vi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:bi,children:e}),r.jsx("p",{css:mi,children:t})]}),r.jsx(C,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(T,{}),onClick:a})]}),s,r.jsxs("div",{css:yi,children:[r.jsx(C,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(E,{}),onClick:l}),r.jsx($i,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ji,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:p})=>{const h=w("MapControlsToolbar",p),f=[{icon:t.jsx(z,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:t.jsx(B,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(H,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(F,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(q,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:a,gap:!0},{icon:t.jsx(W,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return t.jsx(ve,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||h.toolbarAriaLabel})},exports.MapMarker=Nn,exports.MapMarkers=Vn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1,labels:h})=>{const f=w("MapPopUp",h),x=n.useRef(null),{refs:g,floatingStyles:v,context:b,middlewareData:m,placement:y}=Wo({open:e,onOpenChange:t,placement:c,whileElementsMounted:fo,middleware:[So(d),(C={fallbackAxisSideDirection:"start"},{...vo(C),options:[C,j]}),Eo({padding:8}),Lo({element:x})]});var C,j;n.useEffect((()=>{o?.current&&g.setReference(o.current)}),[o,g]);const k=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:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=Bo(),v=Wr("function"==typeof c?c:()=>!1),b="function"==typeof c?v:c,m=l.useRef(!1),{escapeKey:y,outsidePress:w}=qo(f),{escapeKey:C,outsidePress:j}=qo(x),k=l.useRef(!1),$=Wr((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?Fr(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=Wr((e=>{var t;const n=()=>{var t;$(e),null==(t=zr(e))||t.removeEventListener("keydown",n)};null==(t=zr(e))||t.addEventListener("keydown",n)})),E=Wr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=m.current;if(m.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof b&&!b(e))return;const s=zr(e),l="[data-floating-ui-inert]",c=Hr(o.floating).querySelectorAll(l);let u=Zn(s)?s:null;for(;u&&!ar(u);){const e=cr(u);if(ar(e)||!Zn(e))break;u=e}if(c.length&&Zn(s)&&!s.matches("html,body")&&!Vr(s,o.floating)&&Array.from(c).every((e=>!Vr(u,e))))return;if(Wn(s)&&T){const t=ar(s),n=sr(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,d=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),u=a&&e.offsetY>s.clientHeight;if(d||u)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=g&&Fr(g.nodesRef.current,p).some((t=>{var n;return Br(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Br(e,o.floating)||Br(e,o.domReference)||h)return;const f=g?Fr(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")})),L=Wr((e=>{var t;const n=()=>{var t;E(e),null==(t=zr(e))||t.removeEventListener(d,n)};null==(t=zr(e))||t.addEventListener(d,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}),or()?5:0)}const u=Hr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),b&&u.addEventListener(d,j?L:E,j);let p=[];return h&&(Zn(o.domReference)&&(p=ur(o.domReference)),Zn(o.floating)&&(p=p.concat(ur(o.floating))),!Zn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ur(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),b&&u.removeEventListener(d,j?L:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,b,d,n,r,h,a,y,w,$,C,S,E,j,L]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,b,d]);const R=l.useMemo((()=>({onKeyDown:$,...u&&{[Ho[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),T=l.useMemo((()=>({onKeyDown:$,onMouseDown(){m.current=!0},onMouseUp(){m.current=!0},[Fo[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:R,floating:T}:{}),[a,R,T])}(b,{escapeKey:u,outsidePress:p}),$=Xo(b,{role:"dialog"}),{getFloatingProps:S}=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=>Go(t,e,"reference")),t),i=l.useCallback((t=>Go(t,e,"floating")),n),a=l.useCallback((t=>Go(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([k,$]),{x:E,y:L}=m.arrow??{x:null,y:null},R={top:"bottom",right:"left",bottom:"top",left:"right"}[y.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==R&&"right"!==R||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:g.setFloating,style:v,"aria-modal":!0,...S(),css:Yo,children:[r.jsxs("div",{css:Ko,children:[i,r.jsx(de,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Jo,children:a}),s?r.jsx("div",{css:Qo,children:s}):null,r.jsx("div",{ref:x,css:ei(T,O,E,L,R,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=$e,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Kh(o,t)));return r.jsx("div",{css:Gh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Kh(o,e);d(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":d,"aria-describedby":u,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=[u,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Uh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[r.jsxs("div",{css:Xh,children:[i,s?r.jsx("div",{css:Yh,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:d,blocking:u,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:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(gs,{disabled:!d,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:vs(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:bs,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:ms,asChild:!0,children:r.jsx(de,{})})]}),r.jsx(e.Dialog.Body,{css:ys,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[d,u]=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(C,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Ee(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(C,{variant:t,size:o,leftIcon:r.jsx(L,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Te,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Le(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:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h,labels:f})=>{const x=w("Navbar",f),g=n.useRef(null),v=n.useRef(null),b=n.useRef(null),[m,y]=n.useState(!1),[j,k]=n.useState(-1),[$,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=wf),[E,L]=n.useState(!1),R=i,O=n.useCallback((()=>{if(v.current&&g.current&&b.current){const e=g.current.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=b.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=wf||window.innerWidth<=j?(p?.(96),y(!0)):window.innerWidth>wf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),y(!0),k(window.innerWidth)):window.innerWidth>j&&(p?.(48),y(!1),k(-1)):(p?.(48),y(!1),k(-1)),m&&(window.innerWidth<=wf||n.right>=t.left?(S(!0),p?.(48)):(S(!1),p?.(96)))}}),[j,m]);n.useEffect((()=>(O(),window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)})),[O]);const P="condensed"===e;return r.jsxs("nav",{css:Jh(m&&!$,u,h,t,P),children:[r.jsxs("div",{css:ef(m&&!$,d,P),children:[r.jsxs("div",{css:tf(m&&!$||"dark"===t,P),ref:g,children:[o?r.jsx("div",{ref:b,css:nf,children:o}):null,r.jsx("div",{css:rf(m),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:of(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"14px":"16px",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:af(P),ref:v,children:$?r.jsxs("button",{type:"button",onClick:()=>L(!E),"aria-label":x.openMenuLabel,css:cf(t),children:[E?x.closeLabel:x.menuLabel,E?r.jsx(T,{height:P?"12px":"16px",width:P?"12px":"16px"}):r.jsx(te,{height:P?"12px":"16px",width:P?"12px":"16px"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:af(P),children:l?.map(((e,t)=>r.jsx("div",{css:sf(m),children:e},t)))}),c?.length?r.jsx("div",{css:lf(m),children:c.map((e=>r.jsx(C,{...e},e.ariaLabel)))}):null]})})]}),m&&!$?r.jsx("div",{css:Qh(t,P),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:of(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"14px":"16px",items:e.items||[]},e.label)))}):null,$?r.jsx(yf,{theme:t,variant:e,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:E,setIsOpen:L,pathname:a,resolvedLabels:x}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s,labels:l})=>{const c=w("NavigationRail",l),[d,u]=n.useState(!1),[p,f]=n.useState(o||t?.[0]?.value),x=e=>{f(e),i&&i(e)},[g]=e.useMediaQuery(["(max-width: 768px)"]);return g?r.jsxs(e.Tabs.Root,{defaultValue:p,onValueChange:({value:e})=>x(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:Cf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{x(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:jf,"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:kf,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:$f,children:[r.jsx("div",{css:kf,children:d?r.jsx(k,{}):r.jsx(j,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Sf,role:"tabpanel","aria-labelledby":p,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:Fe,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:qe,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3734
+ `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=de,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Combobox=({label:t,required:o,caption:i,errorMessage:a,size:s,disabled:l,placeholder:c,labels:d,noMarginBottom:u,initialItems:p=[],multiple:h=!1,showSelectedItems:f=!1})=>{const[x,g]=n.useState([]),v=w("TextInput",d),{contains:b}=e.useFilter({sensitivity:"base"}),{collection:m,filter:y}=e.useListCollection({initialItems:p,filter:b});return r.jsxs("div",{css:$t(s,u),className:"ds-text-input-container",children:[a?r.jsx("div",{css:St}):null,r.jsxs(e.Field.Root,{required:o,invalid:!!a,gap:"0",style:{marginLeft:a?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Et(s,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":v.requiredSymbolLabel}),t,o?"":r.jsx("span",{children:v.optionalSuffix})]}):null,i?r.jsx(e.Field.HelperText,{css:Lt(s,l),"aria-label":i,children:i}):null,a?r.jsx(e.Field.ErrorText,{css:Rt(s),"aria-label":a,children:a}):null,r.jsxs(e.Combobox.Root,{multiple:h,onValueChange:e=>{g(e.items.map((e=>({label:e.label,value:e.value}))))},value:x.map((e=>e.value)),collection:m,onInputValueChange:e=>y(e.inputValue),width:"320px",size:"small"===s?"sm":"md",children:[r.jsxs(e.Combobox.Control,{children:[r.jsx(e.Combobox.Input,{placeholder:c,css:Tt(s),disabled:l}),r.jsxs(e.Combobox.IndicatorGroup,{children:[r.jsx(e.Combobox.ClearTrigger,{}),r.jsx(e.Combobox.Trigger,{})]})]}),r.jsx(e.Portal,{children:r.jsx(e.Combobox.Positioner,{children:r.jsxs(e.Combobox.Content,{children:[r.jsx(e.Combobox.Empty,{children:"No items found"}),m.items.map((t=>r.jsxs(e.Combobox.Item,{item:t,children:[t.label,r.jsx(e.Combobox.ItemIndicator,{})]},t.value)))]})})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:f&&x.map((e=>r.jsx(en,{label:e.label,variant:"info-white",onClose:()=>g((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(f.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:xa,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:ga,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(L,{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:Hh(n,o),children:r.jsxs("div",{css:Fh(i),children:[r.jsxs("div",{css:Wh,children:[r.jsx(N,{height:"32px",width:"91px"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:qh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Zh,children:[t," ",s]})})]})})},exports.FormContainer=({label:e,error:t,children:n})=>r.jsxs("div",{css:Oe,children:[t?r.jsx("div",{css:Me}):null,r.jsxs("div",{children:[e?r.jsx("p",{css:Pe,children:e}):null,t?r.jsx("p",{css:_e,"aria-label":t,children:t}):null,n]})]}),exports.IconButton=ce,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(E,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:d,labels:u})=>{const p=w("InlineMessage",u);let h=ex;return"info-grey"===n?h=tx:"success"===n?h=nx:"warning"===n?h=rx:"error"===n&&(h=ox),r.jsxs("div",{css:[Xf(o,l),h],"aria-roledescription":p.roleDescription,children:[r.jsxs("div",{children:[r.jsxs("div",{css:Yf,children:[i,r.jsx("p",{css:Kf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Jf(o,!!i),children:t}):t?r.jsx("div",{css:Qf(o,!!i),children:t}):null]}),s?r.jsx(C,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:d}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:p})=>{const[h,f]=n.useState(c),[x,g]=n.useState(l?[l]:[a[0].value]),v=(e,t)=>{d&&d("end"===s?""+(t?`${h} ${e}`:`${e} ${x}`):""+(t?`${e} ${h}`:`${x} ${e}`))};return r.jsxs("div",{css:mt,children:[i?r.jsx("div",{css:Ct}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:yt(p),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:wt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:jt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:kt(!!i,s),attached:!0,children:["start"===s?r.jsx(rn,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Ot,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?r.jsx(rn,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Fi,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s,labels:l})=>{const c=w("LayerGroup",l),[d,u]=n.useState({}),[p]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...d};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const h=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,x=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:ni,alignItems:"flex-start","aria-label":x,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:ri,children:[t,r.jsx(en,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:oi,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Qe,{name:t,value:p,customGap:"0px",onChange:(e,t)=>h(e,!!t,s,t),children:a.map((e=>r.jsx(di,{...e,onChange:(t,n)=>h(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:ti,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=di,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:ui,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:pi,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:hi,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:fi,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,labels:d})=>{const u=w("LegendItem",d);return r.jsxs("div",{css:xi,children:[r.jsxs("div",{css:gi,children:[r.jsx(ce,{icon:r.jsx(_,{}),"aria-label":u.dragAndDropLabel,"aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(ce,{icon:r.jsx(L,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(ce,{icon:r.jsx(L,{}),"aria-label":u.downLabel,onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:vi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:bi,children:e}),r.jsx("p",{css:mi,children:t})]}),r.jsx(C,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(T,{}),onClick:a})]}),s,r.jsxs("div",{css:yi,children:[r.jsx(C,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(E,{}),onClick:l}),r.jsx($i,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ji,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:p})=>{const h=w("MapControlsToolbar",p),f=[{icon:t.jsx(z,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:t.jsx(B,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(H,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(F,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(q,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:a,gap:!0},{icon:t.jsx(W,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return t.jsx(ve,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||h.toolbarAriaLabel})},exports.MapMarker=Nn,exports.MapMarkers=Vn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1,labels:h})=>{const f=w("MapPopUp",h),x=n.useRef(null),{refs:g,floatingStyles:v,context:b,middlewareData:m,placement:y}=Wo({open:e,onOpenChange:t,placement:c,whileElementsMounted:fo,middleware:[So(d),(C={fallbackAxisSideDirection:"start"},{...vo(C),options:[C,j]}),Eo({padding:8}),Lo({element:x})]});var C,j;n.useEffect((()=>{o?.current&&g.setReference(o.current)}),[o,g]);const k=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:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=Bo(),v=Wr("function"==typeof c?c:()=>!1),b="function"==typeof c?v:c,m=l.useRef(!1),{escapeKey:y,outsidePress:w}=qo(f),{escapeKey:C,outsidePress:j}=qo(x),k=l.useRef(!1),$=Wr((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?Fr(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=Wr((e=>{var t;const n=()=>{var t;$(e),null==(t=zr(e))||t.removeEventListener("keydown",n)};null==(t=zr(e))||t.addEventListener("keydown",n)})),E=Wr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=m.current;if(m.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof b&&!b(e))return;const s=zr(e),l="[data-floating-ui-inert]",c=Hr(o.floating).querySelectorAll(l);let u=Zn(s)?s:null;for(;u&&!ar(u);){const e=cr(u);if(ar(e)||!Zn(e))break;u=e}if(c.length&&Zn(s)&&!s.matches("html,body")&&!Vr(s,o.floating)&&Array.from(c).every((e=>!Vr(u,e))))return;if(Wn(s)&&T){const t=ar(s),n=sr(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,d=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),u=a&&e.offsetY>s.clientHeight;if(d||u)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=g&&Fr(g.nodesRef.current,p).some((t=>{var n;return Br(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Br(e,o.floating)||Br(e,o.domReference)||h)return;const f=g?Fr(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")})),L=Wr((e=>{var t;const n=()=>{var t;E(e),null==(t=zr(e))||t.removeEventListener(d,n)};null==(t=zr(e))||t.addEventListener(d,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}),or()?5:0)}const u=Hr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),b&&u.addEventListener(d,j?L:E,j);let p=[];return h&&(Zn(o.domReference)&&(p=ur(o.domReference)),Zn(o.floating)&&(p=p.concat(ur(o.floating))),!Zn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ur(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),b&&u.removeEventListener(d,j?L:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,b,d,n,r,h,a,y,w,$,C,S,E,j,L]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,b,d]);const R=l.useMemo((()=>({onKeyDown:$,...u&&{[Ho[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),T=l.useMemo((()=>({onKeyDown:$,onMouseDown(){m.current=!0},onMouseUp(){m.current=!0},[Fo[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:R,floating:T}:{}),[a,R,T])}(b,{escapeKey:u,outsidePress:p}),$=Xo(b,{role:"dialog"}),{getFloatingProps:S}=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=>Go(t,e,"reference")),t),i=l.useCallback((t=>Go(t,e,"floating")),n),a=l.useCallback((t=>Go(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([k,$]),{x:E,y:L}=m.arrow??{x:null,y:null},R={top:"bottom",right:"left",bottom:"top",left:"right"}[y.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==R&&"right"!==R||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:g.setFloating,style:v,"aria-modal":!0,...S(),css:Yo,children:[r.jsxs("div",{css:Ko,children:[i,r.jsx(de,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Jo,children:a}),s?r.jsx("div",{css:Qo,children:s}):null,r.jsx("div",{ref:x,css:ei(T,O,E,L,R,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=$e,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Kh(o,t)));return r.jsx("div",{css:Gh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Kh(o,e);d(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":d,"aria-describedby":u,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=[u,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Uh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[r.jsxs("div",{css:Xh,children:[i,s?r.jsx("div",{css:Yh,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:d,blocking:u,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:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(gs,{disabled:!d,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:vs(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:bs,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:ms,asChild:!0,children:r.jsx(de,{})})]}),r.jsx(e.Dialog.Body,{css:ys,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[d,u]=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(C,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Ee(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(C,{variant:t,size:o,leftIcon:r.jsx(L,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Te,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Le(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:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h,labels:f})=>{const x=w("Navbar",f),g=n.useRef(null),v=n.useRef(null),b=n.useRef(null),[m,y]=n.useState(!1),[j,k]=n.useState(-1),[$,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=wf),[E,L]=n.useState(!1),R=i,O=n.useCallback((()=>{if(v.current&&g.current&&b.current){const e=g.current.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=b.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=wf||window.innerWidth<=j?(p?.(96),y(!0)):window.innerWidth>wf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),y(!0),k(window.innerWidth)):window.innerWidth>j&&(p?.(48),y(!1),k(-1)):(p?.(48),y(!1),k(-1)),m&&(window.innerWidth<=wf||n.right>=t.left?(S(!0),p?.(48)):(S(!1),p?.(96)))}}),[j,m]);n.useEffect((()=>(O(),window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)})),[O]);const P="condensed"===e;return r.jsxs("nav",{css:Jh(m&&!$,u,h,t,P),children:[r.jsxs("div",{css:ef(m&&!$,d,P),children:[r.jsxs("div",{css:tf(m&&!$||"dark"===t,P),ref:g,children:[o?r.jsx("div",{ref:b,css:nf,children:o}):null,r.jsx("div",{css:rf(m),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:of(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"14px":"16px",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:af(P),ref:v,children:$?r.jsxs("button",{type:"button",onClick:()=>L(!E),"aria-label":x.openMenuLabel,css:cf(t),children:[E?x.closeLabel:x.menuLabel,E?r.jsx(T,{height:P?"12px":"16px",width:P?"12px":"16px"}):r.jsx(te,{height:P?"12px":"16px",width:P?"12px":"16px"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:af(P),children:l?.map(((e,t)=>r.jsx("div",{css:sf(m),children:e},t)))}),c?.length?r.jsx("div",{css:lf(m),children:c.map((e=>r.jsx(C,{...e},e.ariaLabel)))}):null]})})]}),m&&!$?r.jsx("div",{css:Qh(t,P),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:of(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"14px":"16px",items:e.items||[]},e.label)))}):null,$?r.jsx(yf,{theme:t,variant:e,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:E,setIsOpen:L,pathname:a,resolvedLabels:x}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s,labels:l})=>{const c=w("NavigationRail",l),[d,u]=n.useState(!1),[p,f]=n.useState(o||t?.[0]?.value),x=e=>{f(e),i&&i(e)},[g]=e.useMediaQuery(["(max-width: 768px)"]);return g?r.jsxs(e.Tabs.Root,{defaultValue:p,onValueChange:({value:e})=>x(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:Cf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{x(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:jf,"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:kf,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:$f,children:[r.jsx("div",{css:kf,children:d?r.jsx(k,{}):r.jsx(j,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Sf,role:"tabpanel","aria-labelledby":p,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:Fe,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:qe,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3735
3735
  width: 100%;
3736
3736
  display: flex;
3737
3737
  flex-direction: ${"centered"===i?"column":"row"};
package/dist/index.d.ts CHANGED
@@ -909,6 +909,26 @@ type TextInputProps = Omit<InputProps, 'size' | 'variant' | 'colorPalette' | 'de
909
909
 
910
910
  declare const TextInput: ({ label, caption, placeholder, errorMessage, required, disabled, size, noMarginBottom, defaultValue, onChange, labels, ...rest }: TextInputProps) => _emotion_react_jsx_runtime.JSX.Element;
911
911
 
912
+ type ComboboxProps = {
913
+ initialItems?: {
914
+ label: string;
915
+ value: string;
916
+ }[];
917
+ label?: string;
918
+ required?: boolean;
919
+ caption?: string;
920
+ errorMessage?: string;
921
+ size?: 'small' | 'default';
922
+ disabled?: boolean;
923
+ placeholder?: string;
924
+ labels?: Partial<TextInputLabels>;
925
+ noMarginBottom?: boolean;
926
+ multiple?: boolean;
927
+ showSelectedItems?: boolean;
928
+ };
929
+
930
+ declare const Combobox: ({ label, required, caption, errorMessage, size, disabled, placeholder, labels, noMarginBottom, initialItems, multiple, showSelectedItems, }: ComboboxProps) => _emotion_react_jsx_runtime.JSX.Element;
931
+
912
932
  type TagProps = Omit<Tag$1.RootProps, 'size' | 'variant' | 'colorPalette' | 'children'> & {
913
933
  label: string;
914
934
  variant: 'info-white' | 'info-grey' | 'success' | 'warning' | 'error';
@@ -1468,4 +1488,4 @@ declare const Toast: React__default.FC<ToastComponentProps>;
1468
1488
 
1469
1489
  declare const showToast: (props: ToastProps) => void;
1470
1490
 
1471
- export { AlertBanner, AnalysisWidget, type AnalysisWidgetLabels, Avatar, Badge, BaseMap, type BaseMapLabels, Breadcrumb, Button, type ButtonLabels, Checkbox, CheckboxList, type CheckboxListLabels, CheckboxOptionCard, CloseButton, type CloseButtonLabels, ClusterPoint, type DesignSystemLabels, DesignSystemLocaleProvider, type DesignSystemLocaleProviderProps, ExtendableCard, Footer, FormContainer, IconButton, InlineMessage, type InlineMessageLabels, InputWithUnits, ItemCount, type ItemCountLabels, LayerGroup, LayerGroupContainer, type LayerGroupLabels, LayerItem, LayerParameters, LegendItem, type LegendItemLabels, List, MapControlsToolbar, type MapControlsToolbarLabels, MapMarker, MapMarkers, MapPopUp, type MapPopUpLabels, Menu, MobileTabBar, Modal, MultiActionButton, Navbar, type NavbarLabels, NavigationRail, type NavigationRailLabels, type OpacityControlLabels, OptionCard, Pagination, type PaginationLabels, Panel, Password, type PasswordLabels, ProgressBar, QualitativeAttribute, type QualitativeAttributeLabels, Radio, RadioGroup, RadioList, type RadioListLabels, SSOButtons, ScaleBar, Search, type SearchLabels, Select, type SelectLabels, Sheet, SimpleMapPin, Slider, SliderInput, StepProgressIndicator, type StepProgressIndicatorLabels, Switch, TabBar, Table, TableCell, type TableLabels, TableRow, Tag, TextInput, type TextInputLabels, Textarea, type TextareaLabels, Toast, type ToastLabels, Toolbar, type ToolbarLabels, Tooltip, designSystemStyles, designSystemStylesForTailwind, getThemedColor, showToast };
1491
+ export { AlertBanner, AnalysisWidget, type AnalysisWidgetLabels, Avatar, Badge, BaseMap, type BaseMapLabels, Breadcrumb, Button, type ButtonLabels, Checkbox, CheckboxList, type CheckboxListLabels, CheckboxOptionCard, CloseButton, type CloseButtonLabels, ClusterPoint, Combobox, type DesignSystemLabels, DesignSystemLocaleProvider, type DesignSystemLocaleProviderProps, ExtendableCard, Footer, FormContainer, IconButton, InlineMessage, type InlineMessageLabels, InputWithUnits, ItemCount, type ItemCountLabels, LayerGroup, LayerGroupContainer, type LayerGroupLabels, LayerItem, LayerParameters, LegendItem, type LegendItemLabels, List, MapControlsToolbar, type MapControlsToolbarLabels, MapMarker, MapMarkers, MapPopUp, type MapPopUpLabels, Menu, MobileTabBar, Modal, MultiActionButton, Navbar, type NavbarLabels, NavigationRail, type NavigationRailLabels, type OpacityControlLabels, OptionCard, Pagination, type PaginationLabels, Panel, Password, type PasswordLabels, ProgressBar, QualitativeAttribute, type QualitativeAttributeLabels, Radio, RadioGroup, RadioList, type RadioListLabels, SSOButtons, ScaleBar, Search, type SearchLabels, Select, type SelectLabels, Sheet, SimpleMapPin, Slider, SliderInput, StepProgressIndicator, type StepProgressIndicatorLabels, Switch, TabBar, Table, TableCell, type TableLabels, TableRow, Tag, TextInput, type TextInputLabels, Textarea, type TextareaLabels, Toast, type ToastLabels, Toolbar, type ToolbarLabels, Tooltip, designSystemStyles, designSystemStylesForTailwind, getThemedColor, showToast };