@worldresources/wri-design-systems 2.183.1 → 2.184.2
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 +4 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.esm.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3493,13 +3493,13 @@ function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3493
3493
|
line-height: ${"small"===e?"20px":"28px"};
|
|
3494
3494
|
font-weight: 400;
|
|
3495
3495
|
text-align: left;
|
|
3496
|
-
`,qf=e=>r.css`
|
|
3496
|
+
`,qf=(e,t)=>r.css`
|
|
3497
3497
|
max-width: 720px;
|
|
3498
3498
|
color: ${h("neutral",700)};
|
|
3499
3499
|
font-size: ${"small"===e?"12px":"16px"};
|
|
3500
3500
|
line-height: ${"small"===e?"16px":"24px"};
|
|
3501
3501
|
font-weight: 400;
|
|
3502
|
-
margin-left: 24px;
|
|
3502
|
+
margin-left: ${t?"24px":"0"};
|
|
3503
3503
|
text-align: left;
|
|
3504
3504
|
`,Wf=r.css`
|
|
3505
3505
|
background-color: ${h("neutral",100)};
|
|
@@ -3692,7 +3692,7 @@ function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3692
3692
|
padding: 0px;
|
|
3693
3693
|
padding-top: 8px;
|
|
3694
3694
|
color: ${i?h("neutral",500):"inherit"};
|
|
3695
|
-
`),children:o.children}):null]},`${o.label}-${o.value}`);var i,a}))})}),exports.CloseButton=se,exports.ClusterPoint=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="cluster"})=>o.jsx(Tn,{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:la,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:ca,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($,{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,additionalLogos:a})=>{const s=(new Date).getFullYear();return t.jsx("footer",{css:Dh(r,o),children:t.jsxs("div",{css:Ih(i),children:[t.jsxs("div",{css:Ah,children:[t.jsx(D,{height:"32px",width:"91px"}),a&&a.map(((e,n)=>t.jsx("div",{children:e},n)))]}),t.jsx("div",{css:Nh,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Vh,children:[n," ",s]})})]})})},exports.IconButton=ae,exports.InlineMessage=({label:e,caption:n,variant:r,size:o="large",icon:i=t.jsx(k,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l})=>{let c=Wf;return"info-grey"===r?c=Gf:"success"===r?c=Uf:"warning"===r?c=Xf:"error"===r&&(c=Yf),t.jsxs("div",{css:[Hf(o,l),c],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:Ff,children:[i,t.jsx("p",{css:Zf(o),children:e})]}),t.jsx("p",{css:qf(o),children:n})]}),s?t.jsx(b,{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: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 t.jsxs("div",{css:pt,children:[i?t.jsx("div",{css:xt}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:ht(p),"aria-label":r,children:[u?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:ft(p),"aria-label":o,children:o}),i?t.jsx("p",{css:gt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:vt(!!i,s),attached:!0,children:["start"===s?t.jsx(Yt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,t.jsx(kt,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?t.jsx(Yt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ii,exports.LayerGroup=({label:r,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s})=>{const[l,c]=n.useState({}),[d]=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 u=(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:Xo,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:Yo,children:[r,t.jsx(Gt,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),t.jsx("div",{css:Ko,children:o})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx($,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(We,{name:r,value:d,customGap:"0px",onChange:(e,t)=>u(e,!!t,s,t),children:a.map((e=>t.jsx(ri,{...e,onChange:(t,n)=>u(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:n,defaultValue:r,...o})=>t.jsx("div",{css:Uo,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:r,multiple:!0,...o,children:n})}),exports.LayerItem=ri,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:oi,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:ii,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:ai,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx($,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:si,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:li,children:[t.jsxs("div",{css:ci,children:[t.jsx(ae,{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(ae,{icon:t.jsx($,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(ae,{icon:t.jsx($,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:di,children:[t.jsxs("div",{children:[t.jsx("h3",{css:ui,children:e}),t.jsx("p",{css:pi,children:n})]}),t.jsx(b,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx(E,{}),onClick:a})]}),s,t.jsxs("div",{css:hi,children:[t.jsx(b,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(k,{}),onClick:l}),t.jsx(mi,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=qi,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u})=>{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:d,ariaLabel:u||"Map controls toolbar"})},exports.MapMarker=Tn,exports.MapMarkers=Mn,exports.MapPopUp=({open:e,onOpenChange:r,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1})=>{const h=n.useRef(null),{refs:f,floatingStyles:x,context:g,middlewareData:v,placement:m}=Ao({open:e,onOpenChange:r,placement:c,whileElementsMounted:ao,middleware:[bo(d),(b={fallbackAxisSideDirection:"start"},{...co(b),options:[b,y]}),yo({padding:8}),wo({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:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=_o(),v=Ar("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=No(f),{escapeKey:C,outsidePress:j}=No(x),k=l.useRef(!1),$=Ar((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?Ir(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=Ar((e=>{var t;const n=()=>{var t;$(e),null==(t=Pr(e))||t.removeEventListener("keydown",n)};null==(t=Pr(e))||t.addEventListener("keydown",n)})),E=Ar((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof m&&!m(e))return;const s=Pr(e),l="[data-floating-ui-inert]",c=Dr(o.floating).querySelectorAll(l);let u=Vn(s)?s:null;for(;u&&!Qn(u);){const e=nr(u);if(Qn(e)||!Vn(e))break;u=e}if(c.length&&Vn(s)&&!s.matches("html,body")&&!Mr(s,o.floating)&&Array.from(c).every((e=>!Mr(u,e))))return;if(An(s)&&O){const t=Qn(s),n=er(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&&Ir(g.nodesRef.current,p).some((t=>{var n;return _r(e,null==(n=t.context)?void 0:n.elements.floating)}));if(_r(e,o.floating)||_r(e,o.domReference)||h)return;const f=g?Ir(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=Ar((e=>{var t;const n=()=>{var t;E(e),null==(t=Pr(e))||t.removeEventListener(d,n)};null==(t=Pr(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}),Kn()?5:0)}const u=Dr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),m&&u.addEventListener(d,j?R:E,j);let p=[];return h&&(Vn(o.domReference)&&(p=or(o.domReference)),Vn(o.floating)&&(p=p.concat(or(o.floating))),!Vn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(or(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)),m&&u.removeEventListener(d,j?R:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,m,d,n,r,h,a,y,w,$,C,S,E,j,R]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,m,d]);const L=l.useMemo((()=>({onKeyDown:$,...u&&{[Do[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Io[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:L,floating:O}:{}),[a,L,O])}(g,{escapeKey:u,outsidePress:p}),C=Ho(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=>zo(t,e,"reference")),t),i=l.useCallback((t=>zo(t,e,"floating")),n),a=l.useCallback((t=>zo(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=d-1,R=4;return"left"!==S&&"right"!==S||(E=4,R=d-1),t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Fo,children:[t.jsxs("div",{css:Zo,children:[i,t.jsx(se,{onClick:()=>r(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),t.jsx("div",{css:qo,children:a}),s?t.jsx("div",{css:Wo,children:s}):null,t.jsx("div",{ref:h,css:Go(E,R,k,$,S,d)})]}),t.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&r(!1)})]})},exports.Menu=Ce,exports.MobileTabBar=({defaultValue:r,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Zh(o,r)));return t.jsx("div",{css:zh,children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:r||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Zh(o,e);d(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":d,"aria-describedby":u,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=[u,f].filter(Boolean).join(" ")||void 0;return t.jsxs(e.Tabs.Trigger,{css:Bh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[t.jsxs("div",{css:Hh,children:[i,s?t.jsx("div",{css:Fh,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:r,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?t.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[d?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(cs,{disabled:!d,nodeRef:f,children:t.jsx(e.Dialog.Positioner,{ref:f,children:t.jsxs(e.Dialog.Content,{css:ds(a,s,l,c),children:[t.jsxs(e.Dialog.Header,{css:us,children:[r,u?null:t.jsx(e.Dialog.CloseTrigger,{css:ps,asChild:!0,children:t.jsx(se,{})})]}),t.jsx(e.Dialog.Body,{css:hs,children:o}),i?t.jsx(e.Dialog.Footer,{padding:"12px",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:r="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 t.jsxs(e.Group,{css:Se,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[t.jsx(b,{css:{},label:i,variant:r,size:o,onClick:a,disabled:l,...c}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:ke(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(b,{variant:r,size:o,leftIcon:t.jsx($,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),t.jsx(Ee,{children:s.map((({label:n,value:r,onClick:i})=>t.jsx(e.Menu.Item,{css:$e(o),onClick:i,value:r,children:n},r)))})]})]})},exports.Navbar=({variant:e="default",theme:r="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h})=>{const f=n.useRef(null),x=n.useRef(null),g=n.useRef(null),[v,m]=n.useState(!1),[y,w]=n.useState(-1),[C,j]=n.useState("undefined"!=typeof window&&window?.innerWidth<=ff),[k,$]=n.useState(!1),S=i,R=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<=ff||window.innerWidth<=y?(p?.(96),m(!0)):window.innerWidth>ff&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),m(!0),w(window.innerWidth)):window.innerWidth>y&&(p?.(48),m(!1),w(-1)):(p?.(48),m(!1),w(-1)),v&&(window.innerWidth<=ff||n.right>=t.left?(j(!0),p?.(48)):(j(!1),p?.(96)))}}),[y,v]);n.useEffect((()=>(R(),window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)})),[R]);const L="condensed"===e;return t.jsxs("nav",{css:qh(v&&!C,u,h,r,L),children:[t.jsxs("div",{css:Gh(v&&!C,d,L),children:[t.jsxs("div",{css:Uh(v&&!C||"dark"===r,L),ref:f,children:[o?t.jsx("div",{ref:g,css:Xh,children:o}):null,t.jsx("div",{css:Yh(v),children:s?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:Kh(a===e.link,r),children:e.label},e.label):t.jsx(Ce,{theme:r,label:e.label,items:e.items||[]},e.label)))})]}),t.jsx("div",{css:Jh(L),ref:x,children:C?t.jsxs("button",{type:"button",onClick:()=>$(!k),"aria-label":"Open menu",css:tf(r),children:[k?"Close":"Menu",k?t.jsx(E,{height:"16px",width:"16px"}):t.jsx(J,{height:"16px",width:"16px"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{css:Jh(L),children:l?.map(((e,n)=>t.jsx("div",{css:Qh(v),children:e},n)))}),c?.length?t.jsx("div",{css:ef(v),children:c.map((e=>t.jsx(b,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?t.jsx("div",{css:Wh(r,L),children:s?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:Kh(a===e.link,r),children:e.label},e.label):t.jsx(Ce,{theme:r,label:e.label,items:e.items||[]},e.label)))}):null,C?t.jsx(hf,{theme:r,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:k,setIsOpen:$,pathname:a}):null]})},exports.NavigationRail=({tabs:r=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s})=>{const[l,c]=n.useState(!1),[d,u]=n.useState(o||r?.[0]?.value),p=e=>{u(e),i&&i(e)},[f]=e.useMediaQuery(["(max-width: 768px)"]);return f?t.jsxs(e.Tabs.Root,{defaultValue:d,onValueChange:({value:e})=>p(e),children:[t.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"8px",gap:"8px"},children:r.map((n=>t.jsx(e.Tabs.Trigger,{value:n.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:n.label},n.value)))}),r.map((n=>t.jsx(e.Tabs.Content,{value:n.value,children:a},n.value)))]}):t.jsxs("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[t.jsxs("div",{css:xf,children:[t.jsx(e.Tabs.Root,{defaultValue:o||r?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{p(e)},role:"tablist",children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:r.map((n=>t.jsx(e.Tabs.Trigger,{css:gf,"aria-label":n["aria-label"]||n.label,...n,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"ds-tab-label",children:[n.icon?t.jsx("div",{css:vf,children:n.icon}):null,t.jsx("p",{children:n.label})]})},n.label)))})}),a?t.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{c(e),s&&s(!e)},children:t.jsxs(e.Collapsible.Trigger,{css:mf,children:[t.jsx("div",{css:vf,children:l?t.jsx(w,{}):t.jsx(y,{})}),t.jsxs("div",{className:"ds-tab-label",children:[t.jsx("p",{children:l?"Show":"Hide"}),t.jsx("p",{children:"Sidebar"})]})]})}):null]}),a?t.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!l,children:t.jsx(e.Collapsible.Content,{height:"100%",children:t.jsx("div",{css:bf,role:"tabpanel","aria-labelledby":d,children:a})})}):null]})},exports.OptionCard=({defaultValue:n,items:o,onValueChange:i})=>t.jsx(e.RadioCard.Root,{defaultValue:n,onValueChange:i,children:t.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:o.map((n=>{return t.jsxs(e.RadioCard.Item,{css:Ie,value:n.value,disabled:n.disabled,children:[t.jsx(e.RadioCard.ItemHiddenInput,{}),t.jsxs(e.RadioCard.ItemControl,{css:Ne,children:[t.jsxs("div",{css:(i=n.variant,r.css`
|
|
3695
|
+
`),children:o.children}):null]},`${o.label}-${o.value}`);var i,a}))})}),exports.CloseButton=se,exports.ClusterPoint=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="cluster"})=>o.jsx(Tn,{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:la,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:ca,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($,{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,additionalLogos:a})=>{const s=(new Date).getFullYear();return t.jsx("footer",{css:Dh(r,o),children:t.jsxs("div",{css:Ih(i),children:[t.jsxs("div",{css:Ah,children:[t.jsx(D,{height:"32px",width:"91px"}),a&&a.map(((e,n)=>t.jsx("div",{children:e},n)))]}),t.jsx("div",{css:Nh,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Vh,children:[n," ",s]})})]})})},exports.IconButton=ae,exports.InlineMessage=({label:e,caption:n,variant:r,size:o="large",icon:i=t.jsx(k,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:d})=>{let u=Wf;return"info-grey"===r?u=Gf:"success"===r?u=Uf:"warning"===r?u=Xf:"error"===r&&(u=Yf),t.jsxs("div",{css:[Hf(o,l),u],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:Ff,children:[i,t.jsx("p",{css:Zf(o),children:e})]}),n&&t.jsx("p",{css:qf(o,!!i),children:n})]}),s?t.jsx(b,{label:s,variant:"info-white"===r||"info-grey"===r?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:d}):null]})},exports.InputWithUnits=({label:r,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 t.jsxs("div",{css:pt,children:[i?t.jsx("div",{css:xt}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:ht(p),"aria-label":r,children:[u?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:ft(p),"aria-label":o,children:o}),i?t.jsx("p",{css:gt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:vt(!!i,s),attached:!0,children:["start"===s?t.jsx(Yt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null,t.jsx(kt,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===s?t.jsx(Yt,{placeholder:"",value:x,items:a,disabled:p,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Ii,exports.LayerGroup=({label:r,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s})=>{const[l,c]=n.useState({}),[d]=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 u=(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:Xo,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:Yo,children:[r,t.jsx(Gt,{label:`${p} Active`,size:"small",variant:p>0?"success":"info-grey"})]}),t.jsx("div",{css:Ko,children:o})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx($,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(We,{name:r,value:d,customGap:"0px",onChange:(e,t)=>u(e,!!t,s,t),children:a.map((e=>t.jsx(ri,{...e,onChange:(t,n)=>u(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:n,defaultValue:r,...o})=>t.jsx("div",{css:Uo,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:r,multiple:!0,...o,children:n})}),exports.LayerItem=ri,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:oi,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:ii,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:ai,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx($,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:si,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:li,children:[t.jsxs("div",{css:ci,children:[t.jsx(ae,{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(ae,{icon:t.jsx($,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(ae,{icon:t.jsx($,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:di,children:[t.jsxs("div",{children:[t.jsx("h3",{css:ui,children:e}),t.jsx("p",{css:pi,children:n})]}),t.jsx(b,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx(E,{}),onClick:a})]}),s,t.jsxs("div",{css:hi,children:[t.jsx(b,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(k,{}),onClick:l}),t.jsx(mi,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.List=qi,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u})=>{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:d,ariaLabel:u||"Map controls toolbar"})},exports.MapMarker=Tn,exports.MapMarkers=Mn,exports.MapPopUp=({open:e,onOpenChange:r,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1})=>{const h=n.useRef(null),{refs:f,floatingStyles:x,context:g,middlewareData:v,placement:m}=Ao({open:e,onOpenChange:r,placement:c,whileElementsMounted:ao,middleware:[bo(d),(b={fallbackAxisSideDirection:"start"},{...co(b),options:[b,y]}),yo({padding:8}),wo({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:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:x}=t,g=_o(),v=Ar("function"==typeof c?c:()=>!1),m="function"==typeof c?v:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=No(f),{escapeKey:C,outsidePress:j}=No(x),k=l.useRef(!1),$=Ar((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?Ir(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=Ar((e=>{var t;const n=()=>{var t;$(e),null==(t=Pr(e))||t.removeEventListener("keydown",n)};null==(t=Pr(e))||t.addEventListener("keydown",n)})),E=Ar((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof m&&!m(e))return;const s=Pr(e),l="[data-floating-ui-inert]",c=Dr(o.floating).querySelectorAll(l);let u=Vn(s)?s:null;for(;u&&!Qn(u);){const e=nr(u);if(Qn(e)||!Vn(e))break;u=e}if(c.length&&Vn(s)&&!s.matches("html,body")&&!Mr(s,o.floating)&&Array.from(c).every((e=>!Mr(u,e))))return;if(An(s)&&O){const t=Qn(s),n=er(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&&Ir(g.nodesRef.current,p).some((t=>{var n;return _r(e,null==(n=t.context)?void 0:n.elements.floating)}));if(_r(e,o.floating)||_r(e,o.domReference)||h)return;const f=g?Ir(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=Ar((e=>{var t;const n=()=>{var t;E(e),null==(t=Pr(e))||t.removeEventListener(d,n)};null==(t=Pr(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}),Kn()?5:0)}const u=Dr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),m&&u.addEventListener(d,j?R:E,j);let p=[];return h&&(Vn(o.domReference)&&(p=or(o.domReference)),Vn(o.floating)&&(p=p.concat(or(o.floating))),!Vn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(or(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)),m&&u.removeEventListener(d,j?R:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,m,d,n,r,h,a,y,w,$,C,S,E,j,R]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,m,d]);const L=l.useMemo((()=>({onKeyDown:$,...u&&{[Do[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Io[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:L,floating:O}:{}),[a,L,O])}(g,{escapeKey:u,outsidePress:p}),C=Ho(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=>zo(t,e,"reference")),t),i=l.useCallback((t=>zo(t,e,"floating")),n),a=l.useCallback((t=>zo(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=d-1,R=4;return"left"!==S&&"right"!==S||(E=4,R=d-1),t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:f.setFloating,style:x,"aria-modal":!0,...j(),css:Fo,children:[t.jsxs("div",{css:Zo,children:[i,t.jsx(se,{onClick:()=>r(!1),className:"ds-map-pop-up-close-button","aria-label":"Close"})]}),t.jsx("div",{css:qo,children:a}),s?t.jsx("div",{css:Wo,children:s}):null,t.jsx("div",{ref:h,css:Go(E,R,k,$,S,d)})]}),t.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&r(!1)})]})},exports.Menu=Ce,exports.MobileTabBar=({defaultValue:r,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Zh(o,r)));return t.jsx("div",{css:zh,children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:r||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Zh(o,e);d(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":d,"aria-describedby":u,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=[u,f].filter(Boolean).join(" ")||void 0;return t.jsxs(e.Tabs.Trigger,{css:Bh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":g,disabled:p,...h,children:[t.jsxs("div",{css:Hh,children:[i,s?t.jsx("div",{css:Fh,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:r,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?t.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[d?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(cs,{disabled:!d,nodeRef:f,children:t.jsx(e.Dialog.Positioner,{ref:f,children:t.jsxs(e.Dialog.Content,{css:ds(a,s,l,c),children:[t.jsxs(e.Dialog.Header,{css:us,children:[r,u?null:t.jsx(e.Dialog.CloseTrigger,{css:ps,asChild:!0,children:t.jsx(se,{})})]}),t.jsx(e.Dialog.Body,{css:hs,children:o}),i?t.jsx(e.Dialog.Footer,{padding:"12px",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:r="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 t.jsxs(e.Group,{css:Se,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[t.jsx(b,{css:{},label:i,variant:r,size:o,onClick:a,disabled:l,...c}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:ke(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(b,{variant:r,size:o,leftIcon:t.jsx($,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),t.jsx(Ee,{children:s.map((({label:n,value:r,onClick:i})=>t.jsx(e.Menu.Item,{css:$e(o),onClick:i,value:r,children:n},r)))})]})]})},exports.Navbar=({variant:e="default",theme:r="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h})=>{const f=n.useRef(null),x=n.useRef(null),g=n.useRef(null),[v,m]=n.useState(!1),[y,w]=n.useState(-1),[C,j]=n.useState("undefined"!=typeof window&&window?.innerWidth<=ff),[k,$]=n.useState(!1),S=i,R=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<=ff||window.innerWidth<=y?(p?.(96),m(!0)):window.innerWidth>ff&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),m(!0),w(window.innerWidth)):window.innerWidth>y&&(p?.(48),m(!1),w(-1)):(p?.(48),m(!1),w(-1)),v&&(window.innerWidth<=ff||n.right>=t.left?(j(!0),p?.(48)):(j(!1),p?.(96)))}}),[y,v]);n.useEffect((()=>(R(),window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)})),[R]);const L="condensed"===e;return t.jsxs("nav",{css:qh(v&&!C,u,h,r,L),children:[t.jsxs("div",{css:Gh(v&&!C,d,L),children:[t.jsxs("div",{css:Uh(v&&!C||"dark"===r,L),ref:f,children:[o?t.jsx("div",{ref:g,css:Xh,children:o}):null,t.jsx("div",{css:Yh(v),children:s?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:Kh(a===e.link,r),children:e.label},e.label):t.jsx(Ce,{theme:r,label:e.label,items:e.items||[]},e.label)))})]}),t.jsx("div",{css:Jh(L),ref:x,children:C?t.jsxs("button",{type:"button",onClick:()=>$(!k),"aria-label":"Open menu",css:tf(r),children:[k?"Close":"Menu",k?t.jsx(E,{height:"16px",width:"16px"}):t.jsx(J,{height:"16px",width:"16px"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{css:Jh(L),children:l?.map(((e,n)=>t.jsx("div",{css:Qh(v),children:e},n)))}),c?.length?t.jsx("div",{css:ef(v),children:c.map((e=>t.jsx(b,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?t.jsx("div",{css:Wh(r,L),children:s?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:Kh(a===e.link,r),children:e.label},e.label):t.jsx(Ce,{theme:r,label:e.label,items:e.items||[]},e.label)))}):null,C?t.jsx(hf,{theme:r,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:k,setIsOpen:$,pathname:a}):null]})},exports.NavigationRail=({tabs:r=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s})=>{const[l,c]=n.useState(!1),[d,u]=n.useState(o||r?.[0]?.value),p=e=>{u(e),i&&i(e)},[f]=e.useMediaQuery(["(max-width: 768px)"]);return f?t.jsxs(e.Tabs.Root,{defaultValue:d,onValueChange:({value:e})=>p(e),children:[t.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"8px",gap:"8px"},children:r.map((n=>t.jsx(e.Tabs.Trigger,{value:n.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:n.label},n.value)))}),r.map((n=>t.jsx(e.Tabs.Content,{value:n.value,children:a},n.value)))]}):t.jsxs("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[t.jsxs("div",{css:xf,children:[t.jsx(e.Tabs.Root,{defaultValue:o||r?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{p(e)},role:"tablist",children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:r.map((n=>t.jsx(e.Tabs.Trigger,{css:gf,"aria-label":n["aria-label"]||n.label,...n,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"ds-tab-label",children:[n.icon?t.jsx("div",{css:vf,children:n.icon}):null,t.jsx("p",{children:n.label})]})},n.label)))})}),a?t.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{c(e),s&&s(!e)},children:t.jsxs(e.Collapsible.Trigger,{css:mf,children:[t.jsx("div",{css:vf,children:l?t.jsx(w,{}):t.jsx(y,{})}),t.jsxs("div",{className:"ds-tab-label",children:[t.jsx("p",{children:l?"Show":"Hide"}),t.jsx("p",{children:"Sidebar"})]})]})}):null]}),a?t.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!l,children:t.jsx(e.Collapsible.Content,{height:"100%",children:t.jsx("div",{css:bf,role:"tabpanel","aria-labelledby":d,children:a})})}):null]})},exports.OptionCard=({defaultValue:n,items:o,onValueChange:i})=>t.jsx(e.RadioCard.Root,{defaultValue:n,onValueChange:i,children:t.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:o.map((n=>{return t.jsxs(e.RadioCard.Item,{css:Ie,value:n.value,disabled:n.disabled,children:[t.jsx(e.RadioCard.ItemHiddenInput,{}),t.jsxs(e.RadioCard.ItemControl,{css:Ne,children:[t.jsxs("div",{css:(i=n.variant,r.css`
|
|
3696
3696
|
width: 100%;
|
|
3697
3697
|
display: flex;
|
|
3698
3698
|
flex-direction: ${"centered"===i?"column":"row"};
|
|
@@ -3705,7 +3705,7 @@ function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3705
3705
|
padding: 0px;
|
|
3706
3706
|
padding-top: 8px;
|
|
3707
3707
|
color: ${o?h("neutral",500):"inherit"};
|
|
3708
|
-
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,i}))})}),exports.Pagination=Yi,exports.Panel=({header:e,content:r,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return t.jsxs("div",{css:[fs(a),"fixed"===i?xs:gs],children:[e?t.jsx("div",{css:vs,ref:u,children:e}):null,t.jsx("div",{css:ms(s,c),children:r}),o?t.jsx("div",{css:bs,ref:p,children:o}):null]})},exports.Password=({label:e,caption:o,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c})=>{const[d,u]=n.useState(!1),[p,f]=n.useState(""),[x,g]=n.useState({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return t.jsxs("div",{css:Kt,children:[t.jsxs("p",{css:Jt,"aria-label":e,children:[i?t.jsx("span",{children:"*"}):null,e]}),t.jsx("p",{css:Qt,"aria-label":o,children:o}),t.jsxs("div",{css:en,children:[t.jsx(kt,{type:d?"text":"password",value:p,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...x};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=l&&n>=4&&(t.strength="Strong"),e.length>=l+2&&n>=5&&(t.strength="Very Strong"),f(e),g(t),s&&s(t)})(e.target.value)}),t.jsx(b,{label:d?"Hide":"Show",variant:"secondary",leftIcon:d?t.jsx(O,{}):t.jsx(L,{}),"aria-label":d?"Hide password":"Show password",onClick:()=>u(!d),type:"button"})]}),p&&!c?t.jsxs("div",{id:"password-guidelines",css:tn,"aria-live":"polite",children:[t.jsxs("p",{css:(v=x.strength,r.css`
|
|
3708
|
+
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,i}))})}),exports.Pagination=Yi,exports.Panel=({header:e,content:r,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return t.jsxs("div",{css:[fs(a),"fixed"===i?xs:gs],children:[e?t.jsx("div",{css:vs,ref:u,children:e}):null,t.jsx("div",{css:ms(s,c),children:r}),o?t.jsx("div",{css:bs,ref:p,children:o}):null]})},exports.Password=({label:e,caption:o,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c})=>{const[d,u]=n.useState(!1),[p,f]=n.useState(""),[x,g]=n.useState({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return t.jsxs("div",{css:Kt,children:[t.jsxs("p",{css:Jt,"aria-label":e,children:[i?t.jsx("span",{children:"*"}):null,e]}),t.jsx("p",{css:Qt,"aria-label":o,children:o}),t.jsxs("div",{css:en,children:[t.jsx(kt,{type:d?"text":"password",value:p,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...x};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=l&&n>=4&&(t.strength="Strong"),e.length>=l+2&&n>=5&&(t.strength="Very Strong"),f(e),g(t),s&&s({...t,password:e})})(e.target.value)}),t.jsx(b,{label:d?"Hide":"Show",variant:"secondary",leftIcon:d?t.jsx(O,{}):t.jsx(L,{}),"aria-label":d?"Hide password":"Show password",onClick:()=>u(!d),type:"button"})]}),p&&!c?t.jsxs("div",{id:"password-guidelines",css:tn,"aria-live":"polite",children:[t.jsxs("p",{css:(v=x.strength,r.css`
|
|
3709
3709
|
font-size: 16px;
|
|
3710
3710
|
line-height: 24px;
|
|
3711
3711
|
font-weight: 400;
|
package/dist/index.d.ts
CHANGED
|
@@ -282,13 +282,14 @@ type PasswordProps = {
|
|
|
282
282
|
label: string;
|
|
283
283
|
caption?: string;
|
|
284
284
|
required?: boolean;
|
|
285
|
-
onChange?: ({ strength, length, uppercase, lowercase, numbers, specialCharacters, }: {
|
|
285
|
+
onChange?: ({ strength, length, uppercase, lowercase, numbers, specialCharacters, password, }: {
|
|
286
286
|
strength: string;
|
|
287
287
|
length: boolean;
|
|
288
288
|
uppercase: boolean;
|
|
289
289
|
lowercase: boolean;
|
|
290
290
|
numbers: boolean;
|
|
291
291
|
specialCharacters: boolean;
|
|
292
|
+
password: string;
|
|
292
293
|
}) => void;
|
|
293
294
|
disabledRules?: {
|
|
294
295
|
uppercase?: boolean;
|
|
@@ -883,9 +884,11 @@ type InlineMessageProps = {
|
|
|
883
884
|
onActionClick?: VoidFunction;
|
|
884
885
|
actionLabel?: string;
|
|
885
886
|
isButtonRight?: boolean;
|
|
887
|
+
buttonLeftIcon?: React.ReactNode;
|
|
888
|
+
buttonRightIcon?: React.ReactNode;
|
|
886
889
|
};
|
|
887
890
|
|
|
888
|
-
declare const InlineMessage: ({ label, caption, variant, size, icon, onActionClick, actionLabel, isButtonRight, }: InlineMessageProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
891
|
+
declare const InlineMessage: ({ label, caption, variant, size, icon, onActionClick, actionLabel, isButtonRight, buttonLeftIcon, buttonRightIcon, }: InlineMessageProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
889
892
|
|
|
890
893
|
type ProgressBarProps = {
|
|
891
894
|
progress: number;
|
package/dist/index.esm.js
CHANGED
|
@@ -1511,7 +1511,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
|
|
|
1511
1511
|
justify-content: center;
|
|
1512
1512
|
align-items: center;
|
|
1513
1513
|
}
|
|
1514
|
-
`,br=({label:e,caption:t,required:n,disabledRules:r,onChange:o,minLength:i=8,hideValidations:a})=>{const[l,s]=J(!1),[c,d]=J(""),[u,p]=J({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return q("div",{css:pr,children:[q("p",{css:hr,"aria-label":e,children:[n?G("span",{children:"*"}):null,e]}),G("p",{css:fr,"aria-label":t,children:t}),q("div",{css:gr,children:[G(jn,{type:l?"text":"password",value:c,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...u};let n=0,r=!1;t.length=e.length>=i,n+=e.length>=i?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=i&&n>=4&&(t.strength="Strong"),e.length>=i+2&&n>=5&&(t.strength="Very Strong"),d(e),p(t),o&&o(t)})(e.target.value)}),G(Le,{label:l?"Hide":"Show",variant:"secondary",leftIcon:G(l?je:Ie,{}),"aria-label":l?"Hide password":"Show password",onClick:()=>s(!l),type:"button"})]}),c&&!a?q("div",{id:"password-guidelines",css:vr,"aria-live":"polite",children:[q("p",{css:(h=u.strength,de`
|
|
1514
|
+
`,br=({label:e,caption:t,required:n,disabledRules:r,onChange:o,minLength:i=8,hideValidations:a})=>{const[l,s]=J(!1),[c,d]=J(""),[u,p]=J({strength:"Very weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1});return q("div",{css:pr,children:[q("p",{css:hr,"aria-label":e,children:[n?G("span",{children:"*"}):null,e]}),G("p",{css:fr,"aria-label":t,children:t}),q("div",{css:gr,children:[G(jn,{type:l?"text":"password",value:c,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...u};let n=0,r=!1;t.length=e.length>=i,n+=e.length>=i?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="Very Weak",e.length>=4&&n>=2&&(t.strength="Weak"),e.length>=6&&n>=3&&(t.strength="Medium"),e.length>=i&&n>=4&&(t.strength="Strong"),e.length>=i+2&&n>=5&&(t.strength="Very Strong"),d(e),p(t),o&&o({...t,password:e})})(e.target.value)}),G(Le,{label:l?"Hide":"Show",variant:"secondary",leftIcon:G(l?je:Ie,{}),"aria-label":l?"Hide password":"Show password",onClick:()=>s(!l),type:"button"})]}),c&&!a?q("div",{id:"password-guidelines",css:vr,"aria-live":"polite",children:[q("p",{css:(h=u.strength,de`
|
|
1515
1515
|
font-size: 16px;
|
|
1516
1516
|
line-height: 24px;
|
|
1517
1517
|
font-weight: 400;
|
|
@@ -3550,13 +3550,13 @@ function _h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3550
3550
|
line-height: ${"small"===e?"20px":"28px"};
|
|
3551
3551
|
font-weight: 400;
|
|
3552
3552
|
text-align: left;
|
|
3553
|
-
`,Mv=e=>de`
|
|
3553
|
+
`,Mv=(e,t)=>de`
|
|
3554
3554
|
max-width: 720px;
|
|
3555
3555
|
color: ${we("neutral",700)};
|
|
3556
3556
|
font-size: ${"small"===e?"12px":"16px"};
|
|
3557
3557
|
line-height: ${"small"===e?"16px":"24px"};
|
|
3558
3558
|
font-weight: 400;
|
|
3559
|
-
margin-left: 24px;
|
|
3559
|
+
margin-left: ${t?"24px":"0"};
|
|
3560
3560
|
text-align: left;
|
|
3561
3561
|
`,Dv=de`
|
|
3562
3562
|
background-color: ${we("neutral",100)};
|
|
@@ -3590,7 +3590,7 @@ function _h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3590
3590
|
p {
|
|
3591
3591
|
color: ${we("error",900)};
|
|
3592
3592
|
}
|
|
3593
|
-
`,Av=({label:e,caption:t,variant:n,size:r="large",icon:o=G(Pe,{height:"16px",width:"16px"}),onActionClick:i,actionLabel:a,isButtonRight:l})=>{let
|
|
3593
|
+
`,Av=({label:e,caption:t,variant:n,size:r="large",icon:o=G(Pe,{height:"16px",width:"16px"}),onActionClick:i,actionLabel:a,isButtonRight:l,buttonLeftIcon:s,buttonRightIcon:c})=>{let d=Dv;return"info-grey"===n?d=Nv:"success"===n?d=Vv:"warning"===n?d=Iv:"error"===n&&(d=jv),q("div",{css:[Tv(r,l),d],"aria-roledescription":"Note",children:[q("div",{children:[q("div",{css:_v,children:[o,G("p",{css:Pv(r),children:e})]}),t&&G("p",{css:Mv(r,!!o),children:t})]}),a?G(Le,{label:a,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===r?"default":"small",onClick:i,leftIcon:s,rightIcon:c}):null]})},zv=de`
|
|
3594
3594
|
height: 8px;
|
|
3595
3595
|
width: 100%;
|
|
3596
3596
|
background-color: ${we("neutral",300)};
|