@worldresources/wri-design-systems 2.133.1 → 2.133.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 CHANGED
@@ -2968,7 +2968,7 @@
2968
2968
  padding: 0px;
2969
2969
  padding-top: 8px;
2970
2970
  color: ${i?p("neutral",500):"inherit"};
2971
- `),children:o.children}):null]},`${o.label}-${o.value}`);var i,l}))})}),exports.CloseButton=J,exports.Footer=({children:e,label:r="©️World Resources Institute",fixed:n,filled:o,maxWidth:i})=>{const l=(new Date).getFullYear();return t.jsx("footer",{css:To(n,o),children:t.jsxs("div",{css:Eo(i),children:[t.jsx("div",{children:t.jsx(I,{height:"32px",width:"91px"})}),t.jsx("div",{css:_o,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Po,children:[r," ",l]})})]})})},exports.IconButton=K,exports.IconMarker=sr,exports.IconMarkers=cr,exports.InlineMessage=({label:e,caption:r,variant:n,size:o="large",icon:i=t.jsx(j,{height:"16px",width:"16px"}),onActionClick:l,actionLabel:a,isButtonRight:s})=>{let c=Mi;return"info-grey"===n?c=Ri:"success"===n?c=Vi:"warning"===n?c=Ii:"error"===n&&(c=Di),t.jsxs("div",{css:[$i(o,s),c],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:ki,children:[i,t.jsx("p",{css:Si(o),children:e})]}),t.jsx("p",{css:Li(o),children:r})]}),a?t.jsx(b,{label:a,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:l}):null]})},exports.InputWithUnits=({label:r,caption:n,errorMessage:i,units:l,unitsPosition:a="end",defaultUnit:s="",defaultValue:c="",onChange:d,required:p,disabled:u})=>{const[x,h]=o.useState(c),[g,f]=o.useState(s?[s]:[l[0].value]),b=(e,t)=>{d&&d("end"===a?""+(t?`${x} ${e}`:`${e} ${g}`):""+(t?`${e} ${x}`:`${g} ${e}`))};return t.jsxs("div",{css:Je,children:[i?t.jsx("div",{css:tt}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:Qe(u),"aria-label":r,children:[p?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:et(u),"aria-label":n,children:n}),i?t.jsx("p",{css:rt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:nt(!!i,a),attached:!0,children:["start"===a?t.jsx(Pt,{placeholder:"",value:g,items:l,disabled:u,onChange:e=>{f(e),b(e?.[0],!0)}}):null,t.jsx(dt,{type:"number",value:x,disabled:u,onChange:e=>{h(e.target.value),b(e.target.value)}}),"end"===a?t.jsx(Pt,{placeholder:"",value:g,items:l,disabled:u,onChange:e=>{f(e),b(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Kr,exports.LayerGroup=({label:r,caption:n,value:i,layerItems:l,onChangeForRadioVariant:a})=>{const[s,c]=o.useState({}),[d]=o.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(l));o.useEffect((()=>{let e={...s};l.forEach((t=>{t.isDefaultSelected&&(e={...e,["radio"===t.variant?r:t.name]:t.isDefaultSelected})})),c(e)}),[]);const p=(e,t,r,n)=>{const o={...s,[e]:t};c(o),r&&r(e,t,n)},u=Object.values(s).filter((e=>!0===e)).length;return t.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[t.jsxs(e.Accordion.ItemTrigger,{padding:"16px",alignItems:"flex-start",children:[t.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[t.jsxs("span",{css:pr,children:[r,t.jsx(Tt,{label:`${u} Active`,size:"small",variant:u>0?"success":"info-grey"})]}),t.jsx("div",{css:ur,children:n})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(y,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(Ee,{name:r,defaultValue:d,customGap:"0px",onChange:(e,t)=>p(e,!!t,a,t),children:l.map((e=>t.jsx(Cr,{...e,onChange:(t,r)=>p(t,r,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:r,defaultValue:n,...o})=>t.jsx("div",{css:dr,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:r})}),exports.LayerItem=Cr,exports.LayerParameters=({label:r,children:n,openedByDefault:i})=>t.jsx("div",{children:t.jsx(e.Accordion.Root,{defaultValue:i?[r]:[],multiple:!0,children:t.jsxs(e.Accordion.Item,{css:mr,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:vr,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:wr,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(y,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:jr,children:o.Children.map(n,(e=>t.jsx("div",{className:"layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:r,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:l,children:a,onInfoClick:s,onOpacityChanged:c})=>t.jsxs("div",{css:yr,children:[t.jsxs("div",{css:$r,children:[t.jsx(K,{icon:t.jsx(L,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx(K,{icon:t.jsx(y,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(K,{icon:t.jsx(y,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:kr,children:[t.jsxs("div",{children:[t.jsx("h3",{css:Sr,children:e}),t.jsx("p",{css:Lr,children:r})]}),t.jsx(b,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx($,{}),onClick:l})]}),a,t.jsxs("div",{css:Mr,children:[t.jsx(b,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(j,{}),onClick:s}),t.jsx(Tr,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.MapControl=ne,exports.MapControls=oe,exports.Menu=ue,exports.Modal=({title:r,content:n,size:o="medium",draggable:i,blocking:l,open:a,onClose:s,showCancelButton:c,cancelLabel:d="Cancel",showActionButton:p,actionLabel:u,onActionClick:x})=>a?t.jsx(e.Dialog.Root,{open:a,onOpenChange:s,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!i&&!l,preventScroll:!i&&!l,closeOnEscape:!l,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[i?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(po,{disabled:!i,children:t.jsx(e.Dialog.Positioner,{children:t.jsxs(e.Dialog.Content,{css:uo(o),children:[t.jsxs(e.Dialog.Header,{css:xo,children:[t.jsx(e.Dialog.Title,{css:ho,children:r}),l?null:t.jsx(e.Dialog.CloseTrigger,{css:go,asChild:!0,children:t.jsx(J,{})})]}),t.jsx(e.Dialog.Body,{css:fo,children:n}),c||p?t.jsxs(e.Dialog.Footer,{children:[c?t.jsx(e.Dialog.ActionTrigger,{asChild:!0,children:t.jsx(b,{label:d,variant:"secondary"})}):null,p?t.jsx(b,{label:u,onClick:x}):null]}):null]})})})]})}):null,exports.MultiActionButton=({variant:r="primary",size:n="default",mainActionLabel:i,mainActionOnClick:l=()=>{},otherActions:a=[],...s})=>{const[c,d]=o.useState(!1);return t.jsxs(e.Group,{attached:!0,"aria-disabled":s.disabled,children:[t.jsx(b,{css:{},label:i,variant:r,size:n,onClick:l,...s}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:he(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(b,{variant:r,size:n,leftIcon:t.jsx(y,{rotate:c?"180":"0",color:p("accessible","text-on-primary-mids")||p("primary",900)}),disabled:s.disabled})}),t.jsx(fe,{children:a.map((({label:r,value:o,onClick:i})=>t.jsx(e.Menu.Item,{css:ge(n),onClick:i,value:o,children:r},o)))})]})]})},exports.Navbar=({logo:e,linkRouter:n,pathname:i,navigationSection:l,utilitySection:a,actionsSection:s,maxWidth:c,fixed:d,onNavbarHeightChange:u})=>{const x=o.useRef(null),h=o.useRef(null),g=o.useRef(null),[f,C]=o.useState(!1),[m,v]=o.useState(-1),[w,j]=o.useState(window?.innerWidth<=oi),[y,k]=o.useState(!1),S=n,L=o.useCallback((()=>{if(h.current&&x.current&&g.current){const e=x.current.getBoundingClientRect(),t=h.current.getBoundingClientRect(),r=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=oi||window.innerWidth<=m?(u?.(96),C(!0)):window.innerWidth>oi&&window.innerWidth<=1440?e.right>=t.left?(u?.(96),C(!0),v(window.innerWidth)):window.innerWidth>m&&(u?.(48),C(!1),v(-1)):(u?.(48),C(!1),v(-1)),f&&(window.innerWidth<=oi||r.right>=t.left?(j(!0),u?.(48)):(j(!1),u?.(96)))}}),[m,f]);return o.useEffect((()=>(L(),window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)})),[L]),t.jsxs("nav",{css:Bo(f&&!w,d),children:[t.jsxs("div",{css:zo(f&&!w,c),children:[t.jsxs("div",{css:(M=f&&!w,r.css`
2971
+ `),children:o.children}):null]},`${o.label}-${o.value}`);var i,l}))})}),exports.CloseButton=J,exports.Footer=({children:e,label:r="©️World Resources Institute",fixed:n,filled:o,maxWidth:i})=>{const l=(new Date).getFullYear();return t.jsx("footer",{css:To(n,o),children:t.jsxs("div",{css:Eo(i),children:[t.jsx("div",{children:t.jsx(I,{height:"32px",width:"91px"})}),t.jsx("div",{css:_o,children:e}),t.jsx("div",{children:t.jsxs("p",{css:Po,children:[r," ",l]})})]})})},exports.IconButton=K,exports.IconMarker=sr,exports.IconMarkers=cr,exports.InlineMessage=({label:e,caption:r,variant:n,size:o="large",icon:i=t.jsx(j,{height:"16px",width:"16px"}),onActionClick:l,actionLabel:a,isButtonRight:s})=>{let c=Mi;return"info-grey"===n?c=Ri:"success"===n?c=Vi:"warning"===n?c=Ii:"error"===n&&(c=Di),t.jsxs("div",{css:[$i(o,s),c],"aria-roledescription":"Note",children:[t.jsxs("div",{children:[t.jsxs("div",{css:ki,children:[i,t.jsx("p",{css:Si(o),children:e})]}),t.jsx("p",{css:Li(o),children:r})]}),a?t.jsx(b,{label:a,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:l}):null]})},exports.InputWithUnits=({label:r,caption:n,errorMessage:i,units:l,unitsPosition:a="end",defaultUnit:s="",defaultValue:c="",onChange:d,required:p,disabled:u})=>{const[x,h]=o.useState(c),[g,f]=o.useState(s?[s]:[l[0].value]),b=(e,t)=>{d&&d("end"===a?""+(t?`${x} ${e}`:`${e} ${g}`):""+(t?`${e} ${x}`:`${g} ${e}`))};return t.jsxs("div",{css:Je,children:[i?t.jsx("div",{css:tt}):null,t.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[t.jsxs("p",{css:Qe(u),"aria-label":r,children:[p?t.jsx("span",{children:"*"}):null,r]}),t.jsx("p",{css:et(u),"aria-label":n,children:n}),i?t.jsx("p",{css:rt,"aria-label":i,children:i}):null,t.jsxs(e.Group,{css:nt(!!i,a),attached:!0,children:["start"===a?t.jsx(Pt,{placeholder:"",value:g,items:l,disabled:u,onChange:e=>{f(e),b(e?.[0],!0)}}):null,t.jsx(dt,{type:"number",value:x,disabled:u,onChange:e=>{h(e.target.value),b(e.target.value)}}),"end"===a?t.jsx(Pt,{placeholder:"",value:g,items:l,disabled:u,onChange:e=>{f(e),b(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Kr,exports.LayerGroup=({label:r,caption:n,value:i,layerItems:l,onChangeForRadioVariant:a})=>{const[s,c]=o.useState({}),[d]=o.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(l));o.useEffect((()=>{let e={...s};l.forEach((t=>{t.isDefaultSelected&&(e={...e,["radio"===t.variant?r:t.name]:t.isDefaultSelected})})),c(e)}),[]);const p=(e,t,r,n)=>{const o={...s,[e]:t};c(o),r&&r(e,t,n)},u=Object.values(s).filter((e=>!0===e)).length;return t.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[t.jsxs(e.Accordion.ItemTrigger,{padding:"16px",alignItems:"flex-start",children:[t.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[t.jsxs("span",{css:pr,children:[r,t.jsx(Tt,{label:`${u} Active`,size:"small",variant:u>0?"success":"info-grey"})]}),t.jsx("div",{css:ur,children:n})]}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(y,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:t.jsx(Ee,{name:r,defaultValue:d,customGap:"0px",onChange:(e,t)=>p(e,!!t,a,t),children:l.map((e=>t.jsx(Cr,{...e,onChange:(t,r)=>p(t,r,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:r,defaultValue:n,...o})=>t.jsx("div",{css:dr,style:{width:"100%"},children:t.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:r})}),exports.LayerItem=Cr,exports.LayerParameters=({label:r,children:n,openedByDefault:i})=>t.jsx("div",{children:t.jsx(e.Accordion.Root,{defaultValue:i?[r]:[],multiple:!0,children:t.jsxs(e.Accordion.Item,{css:mr,value:r,children:[t.jsxs(e.Accordion.ItemTrigger,{css:vr,children:[t.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:t.jsx("p",{css:wr,children:r})}),t.jsx(e.Accordion.ItemIndicator,{display:"flex",children:t.jsx(y,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),t.jsx(e.Accordion.ItemContent,{css:jr,children:o.Children.map(n,(e=>t.jsx("div",{className:"layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:r,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:l,children:a,onInfoClick:s,onOpacityChanged:c})=>t.jsxs("div",{css:yr,children:[t.jsxs("div",{css:$r,children:[t.jsx(K,{icon:t.jsx(L,{}),"aria-label":"Drag and drop","aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx(K,{icon:t.jsx(y,{rotate:"180"}),"aria-label":"Up",onClick:o}),t.jsx(K,{icon:t.jsx(y,{}),"aria-label":"Down",onClick:i})]})]}),t.jsxs("div",{style:{width:"100%"},children:[t.jsxs("div",{css:kr,children:[t.jsxs("div",{children:[t.jsx("h3",{css:Sr,children:e}),t.jsx("p",{css:Lr,children:r})]}),t.jsx(b,{label:"Remove",size:"small",variant:"secondary",rightIcon:t.jsx($,{}),onClick:l})]}),a,t.jsxs("div",{css:Mr,children:[t.jsx(b,{label:"About data",size:"small",variant:"secondary",leftIcon:t.jsx(j,{}),onClick:s}),t.jsx(Tr,{defaultValue:80,onOpacityChanged:c})]})]})]}),exports.MapControl=ne,exports.MapControls=oe,exports.Menu=ue,exports.Modal=({title:r,content:n,size:o="medium",draggable:i,blocking:l,open:a,onClose:s,showCancelButton:c,cancelLabel:d="Cancel",showActionButton:p,actionLabel:u,onActionClick:x})=>a?t.jsx(e.Dialog.Root,{open:a,onOpenChange:s,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!i&&!l,preventScroll:!i&&!l,closeOnEscape:!l,defaultOpen:!0,children:t.jsxs(e.Portal,{children:[i?null:t.jsx(e.Dialog.Backdrop,{}),t.jsx(po,{disabled:!i,children:t.jsx(e.Dialog.Positioner,{children:t.jsxs(e.Dialog.Content,{css:uo(o),children:[t.jsxs(e.Dialog.Header,{css:xo,children:[t.jsx(e.Dialog.Title,{css:ho,children:r}),l?null:t.jsx(e.Dialog.CloseTrigger,{css:go,asChild:!0,children:t.jsx(J,{})})]}),t.jsx(e.Dialog.Body,{css:fo,children:n}),c||p?t.jsxs(e.Dialog.Footer,{children:[c?t.jsx(e.Dialog.ActionTrigger,{asChild:!0,children:t.jsx(b,{label:d,variant:"secondary"})}):null,p?t.jsx(b,{label:u,onClick:x}):null]}):null]})})})]})}):null,exports.MultiActionButton=({variant:r="primary",size:n="default",mainActionLabel:i,mainActionOnClick:l=()=>{},otherActions:a=[],...s})=>{const[c,d]=o.useState(!1);return t.jsxs(e.Group,{attached:!0,"aria-disabled":s.disabled,children:[t.jsx(b,{css:{},label:i,variant:r,size:n,onClick:l,...s}),t.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>d(e),positioning:{placement:"bottom-end"},children:[t.jsx(e.Menu.Trigger,{css:he(r),"data-group-item":!0,"data-last":!0,asChild:!0,children:t.jsx(b,{variant:r,size:n,leftIcon:t.jsx(y,{rotate:c?"180":"0",color:p("accessible","text-on-primary-mids")||p("primary",900)}),disabled:s.disabled})}),t.jsx(fe,{children:a.map((({label:r,value:o,onClick:i})=>t.jsx(e.Menu.Item,{css:ge(n),onClick:i,value:o,children:r},o)))})]})]})},exports.Navbar=({logo:e,linkRouter:n,pathname:i,navigationSection:l,utilitySection:a,actionsSection:s,maxWidth:c,fixed:d,onNavbarHeightChange:u})=>{const x=o.useRef(null),h=o.useRef(null),g=o.useRef(null),[f,C]=o.useState(!1),[m,v]=o.useState(-1),[w,j]=o.useState("undefined"!=typeof window&&window?.innerWidth<=oi),[y,k]=o.useState(!1),S=n,L=o.useCallback((()=>{if(h.current&&x.current&&g.current){const e=x.current.getBoundingClientRect(),t=h.current.getBoundingClientRect(),r=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=oi||window.innerWidth<=m?(u?.(96),C(!0)):window.innerWidth>oi&&window.innerWidth<=1440?e.right>=t.left?(u?.(96),C(!0),v(window.innerWidth)):window.innerWidth>m&&(u?.(48),C(!1),v(-1)):(u?.(48),C(!1),v(-1)),f&&(window.innerWidth<=oi||r.right>=t.left?(j(!0),u?.(48)):(j(!1),u?.(96)))}}),[m,f]);return o.useEffect((()=>(L(),window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)})),[L]),t.jsxs("nav",{css:Bo(f&&!w,d),children:[t.jsxs("div",{css:zo(f&&!w,c),children:[t.jsxs("div",{css:(M=f&&!w,r.css`
2972
2972
  display: flex;
2973
2973
  align-items: center;
2974
2974
  justify-content: flex-start;
package/dist/index.esm.js CHANGED
@@ -2468,7 +2468,7 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
2468
2468
  button {
2469
2469
  width: calc(48% - 24px);
2470
2470
  }
2471
- `,fl=({navigationSection:e,utilitySection:t,actionsSection:r,linkRouter:n,isOpen:o,setIsOpen:i,pathname:l})=>{const[a,s]=Y(void 0),[c,d]=Y(-1),p=q(null),u=q([]),h=n;return P(O,{children:[T("div",{css:ll(o),children:o&&P("div",{css:al,children:[P("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[t?T("div",{css:sl,children:t?.map((e=>T("div",{className:"utility-item",children:e})))}):null,e?T("div",{css:cl,children:e.map(((e,t)=>e.link?T(h,{to:e.link,href:e.link,onClick:()=>{s(void 0),d(-1),i(!1)},css:pl(l===e.link),children:e.label},e.label):P("button",{css:ul,type:"button",ref:e=>u.current[t]=e,onClick:()=>{e.items&&(s(e),d(t),setTimeout((()=>{p.current?.focus()}),100))},children:[e.label,e.items?T(ge,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),r?T("div",{css:gl,children:r.map((e=>T(ce,{label:e.label,onClick:()=>{e?.onClick?.(),s(void 0),d(-1),i(!1)}},e.label)))}):null]})}),T("div",{css:hl(!!a?.items),children:a?.items?P(O,{children:[P("div",{css:xl,children:[P("button",{type:"button",onClick:()=>{s(void 0),d(-1),u.current[c]?.focus()},"aria-label":"Go back",css:il,ref:p,children:[T(ge,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),a?.label]}),P("button",{type:"button",onClick:()=>{s(void 0),d(-1),i(!1)},"aria-label":"Close menu",css:il,children:["Close",T(fe,{height:"16px",width:"16px"})]})]}),T("div",{css:dl,children:a?.items?.map((e=>T(h,{to:e.link,href:e.link,css:pl(),onClick:()=>{s(void 0),d(-1),i(!1)},children:e.label},e.label)))})]}):null})]})},bl=1023,Cl=({logo:e,linkRouter:t,pathname:r,navigationSection:n,utilitySection:o,actionsSection:i,maxWidth:l,fixed:a,onNavbarHeightChange:s})=>{const c=q(null),d=q(null),p=q(null),[u,h]=Y(!1),[x,g]=Y(-1),[f,b]=Y(window?.innerWidth<=bl),[C,m]=Y(!1),v=t,w=J((()=>{if(d.current&&c.current&&p.current){const e=c.current.getBoundingClientRect(),t=d.current.getBoundingClientRect(),r=p.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=bl||window.innerWidth<=x?(s?.(96),h(!0)):window.innerWidth>bl&&window.innerWidth<=1440?e.right>=t.left?(s?.(96),h(!0),g(window.innerWidth)):window.innerWidth>x&&(s?.(48),h(!1),g(-1)):(s?.(48),h(!1),g(-1)),u&&(window.innerWidth<=bl||r.right>=t.left?(b(!0),s?.(48)):(b(!1),s?.(96)))}}),[x,u]);return X((()=>(w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)})),[w]),P("nav",{css:Gi(u&&!f,a),children:[P("div",{css:Ji(u&&!f,l),children:[P("div",{css:(y=u&&!f,B`
2471
+ `,fl=({navigationSection:e,utilitySection:t,actionsSection:r,linkRouter:n,isOpen:o,setIsOpen:i,pathname:l})=>{const[a,s]=Y(void 0),[c,d]=Y(-1),p=q(null),u=q([]),h=n;return P(O,{children:[T("div",{css:ll(o),children:o&&P("div",{css:al,children:[P("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[t?T("div",{css:sl,children:t?.map((e=>T("div",{className:"utility-item",children:e})))}):null,e?T("div",{css:cl,children:e.map(((e,t)=>e.link?T(h,{to:e.link,href:e.link,onClick:()=>{s(void 0),d(-1),i(!1)},css:pl(l===e.link),children:e.label},e.label):P("button",{css:ul,type:"button",ref:e=>u.current[t]=e,onClick:()=>{e.items&&(s(e),d(t),setTimeout((()=>{p.current?.focus()}),100))},children:[e.label,e.items?T(ge,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),r?T("div",{css:gl,children:r.map((e=>T(ce,{label:e.label,onClick:()=>{e?.onClick?.(),s(void 0),d(-1),i(!1)}},e.label)))}):null]})}),T("div",{css:hl(!!a?.items),children:a?.items?P(O,{children:[P("div",{css:xl,children:[P("button",{type:"button",onClick:()=>{s(void 0),d(-1),u.current[c]?.focus()},"aria-label":"Go back",css:il,ref:p,children:[T(ge,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),a?.label]}),P("button",{type:"button",onClick:()=>{s(void 0),d(-1),i(!1)},"aria-label":"Close menu",css:il,children:["Close",T(fe,{height:"16px",width:"16px"})]})]}),T("div",{css:dl,children:a?.items?.map((e=>T(h,{to:e.link,href:e.link,css:pl(),onClick:()=>{s(void 0),d(-1),i(!1)},children:e.label},e.label)))})]}):null})]})},bl=1023,Cl=({logo:e,linkRouter:t,pathname:r,navigationSection:n,utilitySection:o,actionsSection:i,maxWidth:l,fixed:a,onNavbarHeightChange:s})=>{const c=q(null),d=q(null),p=q(null),[u,h]=Y(!1),[x,g]=Y(-1),[f,b]=Y("undefined"!=typeof window&&window?.innerWidth<=bl),[C,m]=Y(!1),v=t,w=J((()=>{if(d.current&&c.current&&p.current){const e=c.current.getBoundingClientRect(),t=d.current.getBoundingClientRect(),r=p.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=bl||window.innerWidth<=x?(s?.(96),h(!0)):window.innerWidth>bl&&window.innerWidth<=1440?e.right>=t.left?(s?.(96),h(!0),g(window.innerWidth)):window.innerWidth>x&&(s?.(48),h(!1),g(-1)):(s?.(48),h(!1),g(-1)),u&&(window.innerWidth<=bl||r.right>=t.left?(b(!0),s?.(48)):(b(!1),s?.(96)))}}),[x,u]);return X((()=>(w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)})),[w]),P("nav",{css:Gi(u&&!f,a),children:[P("div",{css:Ji(u&&!f,l),children:[P("div",{css:(y=u&&!f,B`
2472
2472
  display: flex;
2473
2473
  align-items: center;
2474
2474
  justify-content: flex-start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldresources/wri-design-systems",
3
- "version": "2.133.1",
3
+ "version": "2.133.2",
4
4
  "description": "WRI UI Library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",