@worldresources/wri-design-systems 2.177.1 → 2.178.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
@@ -2813,7 +2813,7 @@ function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2813
2813
  gap: 20px;
2814
2814
  padding-left: 16px;
2815
2815
  border-left: 1px solid ${h("neutral",e?700:300)};
2816
- `,nf=e=>r.css`
2816
+ `,nf=(e="light")=>r.css`
2817
2817
  background-color: none;
2818
2818
  border: none;
2819
2819
  cursor: pointer;
@@ -2971,7 +2971,7 @@ function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2971
2971
  button {
2972
2972
  width: calc(48% - 24px);
2973
2973
  }
2974
- `,ff=({theme:e="light",navigationSection:r,utilitySection:o,actionsSection:i,linkRouter:a,isOpen:s,setIsOpen:l,pathname:c})=>{const[u,d]=n.useState(void 0),[p,h]=n.useState(-1),f=n.useRef(null),x=n.useRef([]),g=a;return t.jsxs(t.Fragment,{children:[t.jsx("div",{css:rf(s),children:s&&t.jsxs("div",{css:of,children:[t.jsxs("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[o?t.jsx("div",{css:af(e),children:o?.map((e=>t.jsx("div",{className:"ds-utility-item",children:e})))}):null,r?t.jsx("div",{css:sf,children:r.map(((e,n)=>e.link?t.jsx(g,{to:e.link,href:e.link,onClick:()=>{d(void 0),h(-1),l(!1)},css:cf(c===e.link),children:e.label},e.label):t.jsxs("button",{css:uf,type:"button",ref:e=>x.current[n]=e,onClick:()=>{e.items&&(d(e),h(n),setTimeout((()=>{f.current?.focus()}),100))},children:[e.label,e.items?t.jsx($,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),i?t.jsx("div",{css:hf,children:i.map((e=>t.jsx(b,{...e,onClick:t=>{e?.onClick?.(t),d(void 0),h(-1),l(!1)}},e.ariaLabel)))}):null]})}),t.jsx("div",{css:df(!!u?.items),children:u?.items?t.jsxs(t.Fragment,{children:[t.jsxs("div",{css:pf,children:[t.jsxs("button",{type:"button",onClick:()=>{d(void 0),h(-1),x.current[p]?.focus()},"aria-label":"Go back",css:nf,ref:f,children:[t.jsx($,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),u?.label]}),t.jsxs("button",{type:"button",onClick:()=>{d(void 0),h(-1),l(!1)},"aria-label":"Close menu",css:nf,children:["Close",t.jsx(E,{height:"16px",width:"16px"})]})]}),t.jsx("div",{css:lf,children:u?.items?.map((e=>t.jsx(g,{to:e.link,href:e.link,css:cf(),onClick:()=>{d(void 0),h(-1),l(!1)},children:e.label},e.label)))})]}):null})]})},xf=1023,gf=r.css`
2974
+ `,ff=({theme:e="light",navigationSection:r,utilitySection:o,actionsSection:i,linkRouter:a,isOpen:s,setIsOpen:l,pathname:c})=>{const[u,d]=n.useState(void 0),[p,h]=n.useState(-1),f=n.useRef(null),x=n.useRef([]),g=a;return t.jsxs(t.Fragment,{children:[t.jsx("div",{css:rf(s),children:s&&t.jsxs("div",{css:of,children:[t.jsxs("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[o?t.jsx("div",{css:af(e),children:o?.map((e=>t.jsx("div",{className:"ds-utility-item",children:e})))}):null,r?t.jsx("div",{css:sf,children:r.map(((e,n)=>e.link?t.jsx(g,{to:e.link,href:e.link,onClick:()=>{d(void 0),h(-1),l(!1)},css:cf(c===e.link),children:e.label},e.label):t.jsxs("button",{css:uf,type:"button",ref:e=>x.current[n]=e,onClick:()=>{e.items&&(d(e),h(n),setTimeout((()=>{f.current?.focus()}),100))},children:[e.label,e.items?t.jsx($,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),i?t.jsx("div",{css:hf,children:i.map((e=>t.jsx(b,{...e,onClick:t=>{e?.onClick?.(t),d(void 0),h(-1),l(!1)}},e.ariaLabel)))}):null]})}),t.jsx("div",{css:df(!!u?.items),children:u?.items?t.jsxs(t.Fragment,{children:[t.jsxs("div",{css:pf,children:[t.jsxs("button",{type:"button",onClick:()=>{d(void 0),h(-1),x.current[p]?.focus()},"aria-label":"Go back",css:nf(e),ref:f,children:[t.jsx($,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),u?.label]}),t.jsxs("button",{type:"button",onClick:()=>{d(void 0),h(-1),l(!1)},"aria-label":"Close menu",css:nf(e),children:["Close",t.jsx(E,{height:"16px",width:"16px"})]})]}),t.jsx("div",{css:lf,children:u?.items?.map((e=>t.jsx(g,{to:e.link,href:e.link,css:cf(),onClick:()=>{d(void 0),h(-1),l(!1)},children:e.label},e.label)))})]}):null})]})},xf=1023,gf=r.css`
2975
2975
  width: 64px;
2976
2976
  height: 100%;
2977
2977
  z-index: 100;
@@ -3721,4 +3721,4 @@ function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3721
3721
  border: 1px solid ${h("neutral",300)};
3722
3722
  border-radius: 4px;
3723
3723
  ${a?`background: ${a};`:""}
3724
- `)}):t.jsx("div",{css:Ri,children:e?.map(((e,r)=>t.jsx("div",{"data-test":`${e}-${n?.[r]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${n?.[r]}`)))}),t.jsx("div",{css:Li,children:n?.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Oi,children:e})},e)))}),o&&o.length?t.jsx("div",{css:Li,children:o.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Ti,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:r,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),k=n.useRef(null),$=`search-results-${n.useId()}`,S=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>S(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&k.current&&!k.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const E=x.length?t.jsx(se,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,R="none"!==c&&!!x.length&&y.length>0&&v;return t.jsxs("div",{ref:k,style:{position:"relative",width:"100%"},children:[t.jsx(e.InputGroup,{startElement:t.jsx(ne,{fill:o?h("neutral",500):h("primary",700),style:{marginTop:"-12px"}}),endElement:E,children:t.jsx(kt,{autoComplete:"off",placeholder:r||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},value:x,label:"",style:{paddingLeft:"40px"},type:"search","aria-label":r||"Search filter","aria-expanded":R,"aria-controls":$,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];S(e.id||e.label)}"Escape"===e.key&&b()}}})}),(R||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:S}),(R||l&&!!x.length)&&t.jsx(e.Portal,{container:k,children:t.jsxs(e.Box,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&t.jsx(e.Box,{padding:"1rem",children:t.jsx(e.Spinner,{})}),"text"===c&&!l&&t.jsx(Of,{highlightedIndex:C,items:y,query:x,onSelect:S}),"list"===c&&!l&&t.jsx(qi,{items:y,highlightedIndex:C})]})})]})},exports.Select=Yt,exports.Sheet=({header:e,content:r,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=Mh(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||Mh(g,b)!==b.length-1);return t.jsx(Oh,{ref:f,css:Ph(!!e,h),className:d,open:i,onDismiss:a,header:t.jsxs("div",{children:[t.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Th,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:t.jsx("div",{})}),t.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?r:null})},exports.SimpleMapPin=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="simple-pin"})=>o.jsx(Tn,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.Slider=tt,exports.SliderInput=({label:e,caption:r,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return t.jsxs("div",{children:[t.jsxs("p",{css:pn(o),"aria-label":e,children:[a?t.jsx("span",{children:"*"}):null,e]}),r?t.jsx("p",{css:hn(o),"aria-label":r,children:r}):null,t.jsxs("div",{css:fn,children:[i.step&&i.marks?t.jsx(Yt,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):t.jsx(kt,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),t.jsx(tt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?t.jsx(kt,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:n})=>t.jsxs("div",{css:ex,children:[e.map(((e,r)=>t.jsxs("div",{css:tx,children:[t.jsx("button",{css:nx(n>=r+1,n<r+1),type:"button",onClick:e.onClick,"aria-current":n===r+1,"aria-disabled":n<r+1,disabled:n<r+1,"aria-label":`Current Step ${r}${e.label?` ${e.label}`:""}`,"data-active":n>=r+1,children:n>r+1?t.jsx(C,{height:"16px",width:"16px"}):r+1}),e.label?t.jsx("p",{css:rx(n===r+1),children:e.label}):null]},`${e.label}-${r}`))),t.jsx("div",{css:ox,children:t.jsx("div",{css:ix})})]}),exports.Switch=rt,exports.TabBar=({variant:r="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(Ef(i,o)||0);return t.jsx("div",{css:wf(r),children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(Ef(i,t=e)),void(a&&a(t));var t},activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>t.jsxs(n.Fragment,{children:["view"===r&&1===i&&"left"===Rf(l)?t.jsx("div",{css:kf}):null,t.jsx(e.Tabs.Trigger,{css:[Cf,"view"===r&&$f,"panel"===r&&jf,"transparent"===r&&Sf],"aria-label":o["aria-label"]||o.label,...o,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[o.icon,o.label]})},o.label),"view"===r&&1===i&&"right"===Rf(l)?t.jsx("div",{css:kf}):null]},o.label)))})})})},exports.Table=({columns:r,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},S=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},E=u?.length===o?.length,R=u&&u.length>0&&!E;return t.jsxs("div",{children:[t.jsxs(e.Table.Root,{css:Ki(d),striped:a,stickyHeader:s,interactive:!0,children:[t.jsx(e.Table.Header,{css:Ji(d),children:t.jsxs(e.Table.Row,{children:[c?t.jsx(e.Table.ColumnHeader,{children:t.jsx(Le,{name:"header-checkbox",checked:E,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,r.map((n=>t.jsx(e.Table.ColumnHeader,{role:n.sortable?"columnheader":void 0,"aria-sort":n.sortable&&"asc"===m.order?"ascending":n.sortable&&"desc"===m.order?"descending":void 0,children:t.jsxs("div",{css:Qi,children:[n.label,n.sortable?t.jsxs("div",{css:ea,children:[t.jsx(ae,{css:ta(m.key===n.key&&"asc"===m.order),icon:t.jsx($,{style:{transform:"rotate(180deg)"}}),onClick:()=>S(n.key,"asc"),"aria-label":"Ascending"}),t.jsx(ae,{css:ta(m.key===n.key&&"desc"===m.order),icon:t.jsx($,{}),onClick:()=>S(n.key,"desc"),"aria-label":"Descending"})]}):null]})},n.key)))]})}),t.jsx(e.Table.Body,{css:oa,children:o.map((e=>t.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?t.jsx("div",{css:ia,children:t.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,t.jsxs("div",{css:na,children:[t.jsx("div",{children:j?t.jsx(Ii,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?t.jsx("div",{css:ra,children:t.jsx(Yi,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=sa,exports.TableRow=aa,exports.Tag=Gt,exports.TextInput=kt,exports.Textarea=({label:r,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{css:xn(c),children:[S?t.jsx("div",{css:gn}):null,t.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[r?t.jsxs(e.Field.Label,{css:vn(c,l),"aria-label":r,children:[t.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),r,s?"":t.jsx("span",{children:" (Optional)"})]}):null,o?t.jsx(e.Field.HelperText,{id:j,css:mn(c,l),children:o}):null,a?t.jsx(e.Field.ErrorText,{id:k,css:yn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,t.jsx(e.Textarea,{placeholder:i,disabled:l,css:wn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?t.jsxs(e.Field.ErrorText,{id:k,css:yn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?t.jsxs(e.Field.ErrorText,{id:k,css:yn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:t.jsx(e.Field.HelperText,{id:$,css:bn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(px).map((n=>t.jsx(e.Portal,{children:t.jsx(e.Toaster,{toaster:px[n],insetInline:{mdDown:"4"},children:r=>t.jsxs(e.Toast.Root,{css:ax,width:{md:"sm"},children:[t.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===r.type?r.meta?.icon?r.meta.icon:t.jsx(k,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===r.type?t.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===r.type?r.meta?.icon?r.meta.icon:t.jsx(P,{color:"var(--chakra-colors-success-500)"}):null,"warning"===r.type?r.meta?.icon?r.meta.icon:t.jsx(M,{color:"var(--chakra-colors-warning-500)"}):null,"error"===r.type?r.meta?.icon?r.meta.icon:t.jsx(_,{color:"var(--chakra-colors-error-500)"}):null,t.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[t.jsx(e.Toast.Title,{css:sx,"aria-label":`${r.title}`,children:r.title}),r.description?t.jsx(e.Toast.Title,{css:lx,"aria-label":`${r.description}`,children:r.description}):null]})]}),r.action||r.meta?.closable?t.jsxs(e.Stack,{flexDirection:"row",children:[r.action?t.jsx(b,{css:cx,label:r.action.label,size:"small",variant:"info"===r.type?"primary":"secondary",onClick:()=>{r?.action?.onClick&&r.action.onClick(),px[n].dismiss()}}):null,r.meta?.closable?t.jsx(b,{css:ux,label:r.meta.closableLabel,"aria-label":r.meta?.closableLabel||"Dismiss",leftIcon:t.jsx(E,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>px[n].dismiss()}):null]}):null]})})},n))),exports.Toolbar=fe,exports.Tooltip=pe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{px[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
3724
+ `)}):t.jsx("div",{css:Ri,children:e?.map(((e,r)=>t.jsx("div",{"data-test":`${e}-${n?.[r]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${n?.[r]}`)))}),t.jsx("div",{css:Li,children:n?.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Oi,children:e})},e)))}),o&&o.length?t.jsx("div",{css:Li,children:o.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Ti,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:r,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),[k,$]=n.useState(!1),S=n.useRef(null),E=`search-results-${n.useId()}`,R=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>R(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&S.current&&!S.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const L=x.length?t.jsx(se,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,O="none"!==c&&!!x.length&&y.length>0&&v;let T=h("neutral",500);return o?T=h("neutral",500):k&&(T=h("primary",700)),t.jsxs("div",{ref:S,style:{position:"relative",width:"100%"},children:[t.jsx(e.InputGroup,{startElement:t.jsx(ne,{fill:T,style:{marginTop:"-12px"}}),endElement:L,children:t.jsx(kt,{autoComplete:"off",placeholder:r||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},onFocus:()=>$(!0),onBlur:()=>$(!1),value:x,label:"",style:{paddingLeft:"40px",borderColor:h("neutral",500)},type:"search","aria-label":r||"Search filter","aria-expanded":O,"aria-controls":E,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,onKeyDown:e=>{if(O){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];R(e.id||e.label)}"Escape"===e.key&&b()}}})}),(O||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:R}),(O||l&&!!x.length)&&t.jsx(e.Portal,{container:S,children:t.jsxs(e.Box,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&t.jsx(e.Box,{padding:"1rem",children:t.jsx(e.Spinner,{})}),"text"===c&&!l&&t.jsx(Of,{highlightedIndex:C,items:y,query:x,onSelect:R}),"list"===c&&!l&&t.jsx(qi,{items:y,highlightedIndex:C})]})})]})},exports.Select=Yt,exports.Sheet=({header:e,content:r,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=Mh(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||Mh(g,b)!==b.length-1);return t.jsx(Oh,{ref:f,css:Ph(!!e,h),className:d,open:i,onDismiss:a,header:t.jsxs("div",{children:[t.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Th,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:t.jsx("div",{})}),t.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?r:null})},exports.SimpleMapPin=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="simple-pin"})=>o.jsx(Tn,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.Slider=tt,exports.SliderInput=({label:e,caption:r,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return t.jsxs("div",{children:[t.jsxs("p",{css:pn(o),"aria-label":e,children:[a?t.jsx("span",{children:"*"}):null,e]}),r?t.jsx("p",{css:hn(o),"aria-label":r,children:r}):null,t.jsxs("div",{css:fn,children:[i.step&&i.marks?t.jsx(Yt,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):t.jsx(kt,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),t.jsx(tt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?t.jsx(kt,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:n})=>t.jsxs("div",{css:ex,children:[e.map(((e,r)=>t.jsxs("div",{css:tx,children:[t.jsx("button",{css:nx(n>=r+1,n<r+1),type:"button",onClick:e.onClick,"aria-current":n===r+1,"aria-disabled":n<r+1,disabled:n<r+1,"aria-label":`Current Step ${r}${e.label?` ${e.label}`:""}`,"data-active":n>=r+1,children:n>r+1?t.jsx(C,{height:"16px",width:"16px"}):r+1}),e.label?t.jsx("p",{css:rx(n===r+1),children:e.label}):null]},`${e.label}-${r}`))),t.jsx("div",{css:ox,children:t.jsx("div",{css:ix})})]}),exports.Switch=rt,exports.TabBar=({variant:r="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(Ef(i,o)||0);return t.jsx("div",{css:wf(r),children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(Ef(i,t=e)),void(a&&a(t));var t},activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>t.jsxs(n.Fragment,{children:["view"===r&&1===i&&"left"===Rf(l)?t.jsx("div",{css:kf}):null,t.jsx(e.Tabs.Trigger,{css:[Cf,"view"===r&&$f,"panel"===r&&jf,"transparent"===r&&Sf],"aria-label":o["aria-label"]||o.label,...o,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[o.icon,o.label]})},o.label),"view"===r&&1===i&&"right"===Rf(l)?t.jsx("div",{css:kf}):null]},o.label)))})})})},exports.Table=({columns:r,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},S=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},E=u?.length===o?.length,R=u&&u.length>0&&!E;return t.jsxs("div",{children:[t.jsxs(e.Table.Root,{css:Ki(d),striped:a,stickyHeader:s,interactive:!0,children:[t.jsx(e.Table.Header,{css:Ji(d),children:t.jsxs(e.Table.Row,{children:[c?t.jsx(e.Table.ColumnHeader,{children:t.jsx(Le,{name:"header-checkbox",checked:E,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,r.map((n=>t.jsx(e.Table.ColumnHeader,{role:n.sortable?"columnheader":void 0,"aria-sort":n.sortable&&"asc"===m.order?"ascending":n.sortable&&"desc"===m.order?"descending":void 0,children:t.jsxs("div",{css:Qi,children:[n.label,n.sortable?t.jsxs("div",{css:ea,children:[t.jsx(ae,{css:ta(m.key===n.key&&"asc"===m.order),icon:t.jsx($,{style:{transform:"rotate(180deg)"}}),onClick:()=>S(n.key,"asc"),"aria-label":"Ascending"}),t.jsx(ae,{css:ta(m.key===n.key&&"desc"===m.order),icon:t.jsx($,{}),onClick:()=>S(n.key,"desc"),"aria-label":"Descending"})]}):null]})},n.key)))]})}),t.jsx(e.Table.Body,{css:oa,children:o.map((e=>t.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?t.jsx("div",{css:ia,children:t.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,t.jsxs("div",{css:na,children:[t.jsx("div",{children:j?t.jsx(Ii,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?t.jsx("div",{css:ra,children:t.jsx(Yi,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=sa,exports.TableRow=aa,exports.Tag=Gt,exports.TextInput=kt,exports.Textarea=({label:r,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{css:xn(c),children:[S?t.jsx("div",{css:gn}):null,t.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[r?t.jsxs(e.Field.Label,{css:vn(c,l),"aria-label":r,children:[t.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),r,s?"":t.jsx("span",{children:" (Optional)"})]}):null,o?t.jsx(e.Field.HelperText,{id:j,css:mn(c,l),children:o}):null,a?t.jsx(e.Field.ErrorText,{id:k,css:yn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,t.jsx(e.Textarea,{placeholder:i,disabled:l,css:wn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?t.jsxs(e.Field.ErrorText,{id:k,css:yn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?t.jsxs(e.Field.ErrorText,{id:k,css:yn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:t.jsx(e.Field.HelperText,{id:$,css:bn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(px).map((n=>t.jsx(e.Portal,{children:t.jsx(e.Toaster,{toaster:px[n],insetInline:{mdDown:"4"},children:r=>t.jsxs(e.Toast.Root,{css:ax,width:{md:"sm"},children:[t.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===r.type?r.meta?.icon?r.meta.icon:t.jsx(k,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===r.type?t.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===r.type?r.meta?.icon?r.meta.icon:t.jsx(P,{color:"var(--chakra-colors-success-500)"}):null,"warning"===r.type?r.meta?.icon?r.meta.icon:t.jsx(M,{color:"var(--chakra-colors-warning-500)"}):null,"error"===r.type?r.meta?.icon?r.meta.icon:t.jsx(_,{color:"var(--chakra-colors-error-500)"}):null,t.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[t.jsx(e.Toast.Title,{css:sx,"aria-label":`${r.title}`,children:r.title}),r.description?t.jsx(e.Toast.Title,{css:lx,"aria-label":`${r.description}`,children:r.description}):null]})]}),r.action||r.meta?.closable?t.jsxs(e.Stack,{flexDirection:"row",children:[r.action?t.jsx(b,{css:cx,label:r.action.label,size:"small",variant:"info"===r.type?"primary":"secondary",onClick:()=>{r?.action?.onClick&&r.action.onClick(),px[n].dismiss()}}):null,r.meta?.closable?t.jsx(b,{css:ux,label:r.meta.closableLabel,"aria-label":r.meta?.closableLabel||"Dismiss",leftIcon:t.jsx(E,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>px[n].dismiss()}):null]}):null]})})},n))),exports.Toolbar=fe,exports.Tooltip=pe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{px[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
package/dist/index.esm.js CHANGED
@@ -2870,7 +2870,7 @@ function Mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2870
2870
  gap: 20px;
2871
2871
  padding-left: 16px;
2872
2872
  border-left: 1px solid ${we("neutral",e?700:300)};
2873
- `,zg=e=>de`
2873
+ `,zg=(e="light")=>de`
2874
2874
  background-color: none;
2875
2875
  border: none;
2876
2876
  cursor: pointer;
@@ -3028,7 +3028,7 @@ function Mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3028
3028
  button {
3029
3029
  width: calc(48% - 24px);
3030
3030
  }
3031
- `,Kg=({theme:e="light",navigationSection:t,utilitySection:n,actionsSection:r,linkRouter:o,isOpen:i,setIsOpen:a,pathname:l})=>{const[s,c]=J(void 0),[d,u]=J(-1),p=Q(null),h=Q([]),f=o;return q(U,{children:[G("div",{css:Hg(i),children:i&&q("div",{css:Bg,children:[q("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[n?G("div",{css:Fg(e),children:n?.map((e=>G("div",{className:"ds-utility-item",children:e})))}):null,t?G("div",{css:Zg,children:t.map(((e,t)=>e.link?G(f,{to:e.link,href:e.link,onClick:()=>{c(void 0),u(-1),a(!1)},css:qg(l===e.link),children:e.label},e.label):q("button",{css:Gg,type:"button",ref:e=>h.current[t]=e,onClick:()=>{e.items&&(c(e),u(t),setTimeout((()=>{p.current?.focus()}),100))},children:[e.label,e.items?G(Me,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),r?G("div",{css:Yg,children:r.map((e=>G(Le,{...e,onClick:t=>{e?.onClick?.(t),c(void 0),u(-1),a(!1)}},e.ariaLabel)))}):null]})}),G("div",{css:Ug(!!s?.items),children:s?.items?q(U,{children:[q("div",{css:Xg,children:[q("button",{type:"button",onClick:()=>{c(void 0),u(-1),h.current[d]?.focus()},"aria-label":"Go back",css:zg,ref:p,children:[G(Me,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),s?.label]}),q("button",{type:"button",onClick:()=>{c(void 0),u(-1),a(!1)},"aria-label":"Close menu",css:zg,children:["Close",G(Ne,{height:"16px",width:"16px"})]})]}),G("div",{css:Wg,children:s?.items?.map((e=>G(f,{to:e.link,href:e.link,css:qg(),onClick:()=>{c(void 0),u(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},Jg=1023,Qg=({variant:e="default",theme:t="light",logo:n,linkRouter:r,pathname:o,navigationSection:i,utilitySection:a,actionsSection:l,maxWidth:s,fixed:c,onNavbarHeightChange:d,backgroundColor:u})=>{const p=Q(null),h=Q(null),f=Q(null),[g,v]=J(!1),[m,x]=J(-1),[b,y]=J("undefined"!=typeof window&&window?.innerWidth<=Jg),[w,C]=J(!1),$=r,k=ie((()=>{if(h.current&&p.current&&f.current){const e=p.current.getBoundingClientRect(),t=h.current.getBoundingClientRect(),n=f.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=Jg||window.innerWidth<=m?(d?.(96),v(!0)):window.innerWidth>Jg&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),v(!0),x(window.innerWidth)):window.innerWidth>m&&(d?.(48),v(!1),x(-1)):(d?.(48),v(!1),x(-1)),g&&(window.innerWidth<=Jg||n.right>=t.left?(y(!0),d?.(48)):(y(!1),d?.(96)))}}),[m,g]);ee((()=>(k(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)})),[k]);const S="condensed"===e;return q("nav",{css:Tg(g&&!b,c,u,t,S),children:[q("div",{css:_g(g&&!b,s,S),children:[q("div",{css:Mg(g&&!b||"dark"===t,S),ref:p,children:[n?G("div",{ref:f,css:Dg,children:n}):null,G("div",{css:Ng(g),children:i?.map((e=>e.link?G($,{to:e.link,href:e.link,css:Vg(o===e.link,t),children:e.label},e.label):G(Pt,{theme:t,label:e.label,items:e.items||[]},e.label)))})]}),G("div",{css:jg(S),ref:h,children:b?q("button",{type:"button",onClick:()=>C(!w),"aria-label":"Open menu",css:zg(t),children:[w?"Close":"Menu",G(w?Ne:at,{height:"16px",width:"16px"})]}):q(U,{children:[G("div",{css:jg(S),children:a?.map(((e,t)=>G("div",{css:Ig(g),children:e},t)))}),l?.length?G("div",{css:Ag(g),children:l.map((e=>G(Le,{...e},e.ariaLabel)))}):null]})})]}),g&&!b?G("div",{css:Pg(t,S),children:i?.map((e=>e.link?G($,{to:e.link,href:e.link,css:Vg(o===e.link,t),children:e.label},e.label):G(Pt,{theme:t,label:e.label,items:e.items||[]},e.label)))}):null,b?G(Kg,{theme:t,navigationSection:i,utilitySection:a,actionsSection:l,linkRouter:r,isOpen:w,setIsOpen:C,pathname:o}):null]})},ev=de`
3031
+ `,Kg=({theme:e="light",navigationSection:t,utilitySection:n,actionsSection:r,linkRouter:o,isOpen:i,setIsOpen:a,pathname:l})=>{const[s,c]=J(void 0),[d,u]=J(-1),p=Q(null),h=Q([]),f=o;return q(U,{children:[G("div",{css:Hg(i),children:i&&q("div",{css:Bg,children:[q("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[n?G("div",{css:Fg(e),children:n?.map((e=>G("div",{className:"ds-utility-item",children:e})))}):null,t?G("div",{css:Zg,children:t.map(((e,t)=>e.link?G(f,{to:e.link,href:e.link,onClick:()=>{c(void 0),u(-1),a(!1)},css:qg(l===e.link),children:e.label},e.label):q("button",{css:Gg,type:"button",ref:e=>h.current[t]=e,onClick:()=>{e.items&&(c(e),u(t),setTimeout((()=>{p.current?.focus()}),100))},children:[e.label,e.items?G(Me,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),r?G("div",{css:Yg,children:r.map((e=>G(Le,{...e,onClick:t=>{e?.onClick?.(t),c(void 0),u(-1),a(!1)}},e.ariaLabel)))}):null]})}),G("div",{css:Ug(!!s?.items),children:s?.items?q(U,{children:[q("div",{css:Xg,children:[q("button",{type:"button",onClick:()=>{c(void 0),u(-1),h.current[d]?.focus()},"aria-label":"Go back",css:zg(e),ref:p,children:[G(Me,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),s?.label]}),q("button",{type:"button",onClick:()=>{c(void 0),u(-1),a(!1)},"aria-label":"Close menu",css:zg(e),children:["Close",G(Ne,{height:"16px",width:"16px"})]})]}),G("div",{css:Wg,children:s?.items?.map((e=>G(f,{to:e.link,href:e.link,css:qg(),onClick:()=>{c(void 0),u(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},Jg=1023,Qg=({variant:e="default",theme:t="light",logo:n,linkRouter:r,pathname:o,navigationSection:i,utilitySection:a,actionsSection:l,maxWidth:s,fixed:c,onNavbarHeightChange:d,backgroundColor:u})=>{const p=Q(null),h=Q(null),f=Q(null),[g,v]=J(!1),[m,x]=J(-1),[b,y]=J("undefined"!=typeof window&&window?.innerWidth<=Jg),[w,C]=J(!1),$=r,k=ie((()=>{if(h.current&&p.current&&f.current){const e=p.current.getBoundingClientRect(),t=h.current.getBoundingClientRect(),n=f.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=Jg||window.innerWidth<=m?(d?.(96),v(!0)):window.innerWidth>Jg&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),v(!0),x(window.innerWidth)):window.innerWidth>m&&(d?.(48),v(!1),x(-1)):(d?.(48),v(!1),x(-1)),g&&(window.innerWidth<=Jg||n.right>=t.left?(y(!0),d?.(48)):(y(!1),d?.(96)))}}),[m,g]);ee((()=>(k(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)})),[k]);const S="condensed"===e;return q("nav",{css:Tg(g&&!b,c,u,t,S),children:[q("div",{css:_g(g&&!b,s,S),children:[q("div",{css:Mg(g&&!b||"dark"===t,S),ref:p,children:[n?G("div",{ref:f,css:Dg,children:n}):null,G("div",{css:Ng(g),children:i?.map((e=>e.link?G($,{to:e.link,href:e.link,css:Vg(o===e.link,t),children:e.label},e.label):G(Pt,{theme:t,label:e.label,items:e.items||[]},e.label)))})]}),G("div",{css:jg(S),ref:h,children:b?q("button",{type:"button",onClick:()=>C(!w),"aria-label":"Open menu",css:zg(t),children:[w?"Close":"Menu",G(w?Ne:at,{height:"16px",width:"16px"})]}):q(U,{children:[G("div",{css:jg(S),children:a?.map(((e,t)=>G("div",{css:Ig(g),children:e},t)))}),l?.length?G("div",{css:Ag(g),children:l.map((e=>G(Le,{...e},e.ariaLabel)))}):null]})})]}),g&&!b?G("div",{css:Pg(t,S),children:i?.map((e=>e.link?G($,{to:e.link,href:e.link,css:Vg(o===e.link,t),children:e.label},e.label):G(Pt,{theme:t,label:e.label,items:e.items||[]},e.label)))}):null,b?G(Kg,{theme:t,navigationSection:i,utilitySection:a,actionsSection:l,linkRouter:r,isOpen:w,setIsOpen:C,pathname:o}):null]})},ev=de`
3032
3032
  width: 64px;
3033
3033
  height: 100%;
3034
3034
  z-index: 100;
@@ -3417,7 +3417,7 @@ function Mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3417
3417
  }
3418
3418
  }
3419
3419
  }
3420
- `,pv=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),hv=e=>1===e?"none":2===e?"left":"right",fv=({variant:e="panel",defaultValue:t,tabs:n,onTabClick:o,activationMode:i="manual"})=>{const[a,l]=J(pv(n,t)||0);return G("div",{css:av(e),children:G(N.Root,{width:"full",defaultValue:t||n?.[0]?.value,onValueChange:({value:e})=>{return l(pv(n,t=e)),void(o&&o(t));var t},activationMode:i,children:G(N.List,{alignItems:"center",border:"none",children:n.map(((t,n)=>q(ce,{children:["view"===e&&1===n&&"left"===hv(a)?G("div",{css:cv}):null,G(N.Trigger,{css:[lv,"view"===e&&dv,"panel"===e&&sv,"transparent"===e&&uv],"aria-label":t["aria-label"]||t.label,...t,children:q(r,{display:"flex",alignItems:"center",gap:"5px",children:[t.icon,t.label]})},t.label),"view"===e&&1===n&&"right"===hv(a)?G("div",{css:cv}):null]},t.label)))})})})},gv=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),r=e.split(n);return ue(he,{children:r.map((e=>n.test(e)?ue("strong",{children:e},e):ue("span",{children:e},e)))})},vv=({items:e,query:t,onSelect:n,highlightedIndex:o})=>{const i=Q(null);return ee((()=>{if(!i.current)return;const e=i.current.children[o];e&&e.scrollIntoView({block:"nearest"})}),[o]),ue(r,{padding:"8px",children:e.map(((e,a)=>ue(r,{ref:i,padding:"6px 8px",borderRadius:"md",cursor:"pointer",bg:a===o?"gray.100":void 0,_hover:{background:"gray.50"},onClick:()=>n(e.id||e.label),children:ue(gv,{text:e.label,query:t})},e.id)))})},mv=({placeholder:e,disabled:t,size:n="default",options:i=[],resultsMaxHeight:a="200px",isLoading:s=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:p,renderResults:h})=>{const[f,g]=J(""),{open:v,onOpen:m,onClose:x}=A(),[b,y]=J(i),[w,C]=J(-1),$=Q(null),k=`search-results-${te()}`,S=e=>{const t=i.find((t=>t.id===e||t.label===e));t&&(d?.(t),g(""),x())};ee((()=>{if(u?.(f),!f)return void y(i);const e=i.filter((e=>e.id?.toLowerCase().includes(f.toLowerCase())||e.label.toLowerCase().includes(f.toLowerCase())||e.caption?.toLowerCase().includes(f.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>S(e.id||e.label)})));y(e),m()}),[f]),ee((()=>{function e(e){v&&$.current&&!$.current.contains(e.target)&&x()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const E=f.length?G(gt,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,L="none"!==c&&!!f.length&&b.length>0&&v;return q("div",{ref:$,style:{position:"relative",width:"100%"},children:[G(z,{startElement:G(dt,{fill:t?we("neutral",500):we("primary",700),style:{marginTop:"-12px"}}),endElement:E,children:G(In,{autoComplete:"off",placeholder:e||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},value:f,label:"",style:{paddingLeft:"40px"},type:"search","aria-label":e||"Search filter","aria-expanded":L,"aria-controls":k,role:"combobox","aria-autocomplete":"list",disabled:t,size:n,onKeyDown:e=>{if(L){if("ArrowDown"===e.key&&(e.preventDefault(),C((e=>Math.min(e+1,b.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),C((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),w>=0)){const e=b[w];S(e.id||e.label)}"Escape"===e.key&&x()}}})}),(L||s&&!!f.length)&&"custom"===c&&h&&!s&&h({items:b,highlightedIndex:w,query:f,onSelect:S}),(L||s&&!!f.length)&&G(l,{container:$,children:q(r,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:a,children:[s&&G(r,{padding:"1rem",children:G(o,{})}),"text"===c&&!s&&G(vv,{highlightedIndex:w,items:b,query:f,onSelect:S}),"list"===c&&!s&&G(bl,{items:b,highlightedIndex:w})]})})]})},xv={small:"16px",medium:"24px",large:"40px",default:"16px"};function bv(e,t,n,r){const o=function(e,t){return"string"==typeof t&&""!==t.trim()?t:e&&xv[e]?xv[e]:xv.default}(e,t),i=n?we("neutral",200):we("primary",300),a=r??i,l=r&&n?"opacity: 0.7;":"",s=we("neutral",n?400:800);return de`
3420
+ `,pv=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),hv=e=>1===e?"none":2===e?"left":"right",fv=({variant:e="panel",defaultValue:t,tabs:n,onTabClick:o,activationMode:i="manual"})=>{const[a,l]=J(pv(n,t)||0);return G("div",{css:av(e),children:G(N.Root,{width:"full",defaultValue:t||n?.[0]?.value,onValueChange:({value:e})=>{return l(pv(n,t=e)),void(o&&o(t));var t},activationMode:i,children:G(N.List,{alignItems:"center",border:"none",children:n.map(((t,n)=>q(ce,{children:["view"===e&&1===n&&"left"===hv(a)?G("div",{css:cv}):null,G(N.Trigger,{css:[lv,"view"===e&&dv,"panel"===e&&sv,"transparent"===e&&uv],"aria-label":t["aria-label"]||t.label,...t,children:q(r,{display:"flex",alignItems:"center",gap:"5px",children:[t.icon,t.label]})},t.label),"view"===e&&1===n&&"right"===hv(a)?G("div",{css:cv}):null]},t.label)))})})})},gv=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),r=e.split(n);return ue(he,{children:r.map((e=>n.test(e)?ue("strong",{children:e},e):ue("span",{children:e},e)))})},vv=({items:e,query:t,onSelect:n,highlightedIndex:o})=>{const i=Q(null);return ee((()=>{if(!i.current)return;const e=i.current.children[o];e&&e.scrollIntoView({block:"nearest"})}),[o]),ue(r,{padding:"8px",children:e.map(((e,a)=>ue(r,{ref:i,padding:"6px 8px",borderRadius:"md",cursor:"pointer",bg:a===o?"gray.100":void 0,_hover:{background:"gray.50"},onClick:()=>n(e.id||e.label),children:ue(gv,{text:e.label,query:t})},e.id)))})},mv=({placeholder:e,disabled:t,size:n="default",options:i=[],resultsMaxHeight:a="200px",isLoading:s=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:p,renderResults:h})=>{const[f,g]=J(""),{open:v,onOpen:m,onClose:x}=A(),[b,y]=J(i),[w,C]=J(-1),[$,k]=J(!1),S=Q(null),E=`search-results-${te()}`,L=e=>{const t=i.find((t=>t.id===e||t.label===e));t&&(d?.(t),g(""),x())};ee((()=>{if(u?.(f),!f)return void y(i);const e=i.filter((e=>e.id?.toLowerCase().includes(f.toLowerCase())||e.label.toLowerCase().includes(f.toLowerCase())||e.caption?.toLowerCase().includes(f.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>L(e.id||e.label)})));y(e),m()}),[f]),ee((()=>{function e(e){v&&S.current&&!S.current.contains(e.target)&&x()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const O=f.length?G(gt,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,R="none"!==c&&!!f.length&&b.length>0&&v;let T=we("neutral",500);return t?T=we("neutral",500):$&&(T=we("primary",700)),q("div",{ref:S,style:{position:"relative",width:"100%"},children:[G(z,{startElement:G(dt,{fill:T,style:{marginTop:"-12px"}}),endElement:O,children:G(In,{autoComplete:"off",placeholder:e||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},onFocus:()=>k(!0),onBlur:()=>k(!1),value:f,label:"",style:{paddingLeft:"40px",borderColor:we("neutral",500)},type:"search","aria-label":e||"Search filter","aria-expanded":R,"aria-controls":E,role:"combobox","aria-autocomplete":"list",disabled:t,size:n,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),C((e=>Math.min(e+1,b.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),C((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),w>=0)){const e=b[w];L(e.id||e.label)}"Escape"===e.key&&x()}}})}),(R||s&&!!f.length)&&"custom"===c&&h&&!s&&h({items:b,highlightedIndex:w,query:f,onSelect:L}),(R||s&&!!f.length)&&G(l,{container:S,children:q(r,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:a,children:[s&&G(r,{padding:"1rem",children:G(o,{})}),"text"===c&&!s&&G(vv,{highlightedIndex:w,items:b,query:f,onSelect:L}),"list"===c&&!s&&G(bl,{items:b,highlightedIndex:w})]})})]})},xv={small:"16px",medium:"24px",large:"40px",default:"16px"};function bv(e,t,n,r){const o=function(e,t){return"string"==typeof t&&""!==t.trim()?t:e&&xv[e]?xv[e]:xv.default}(e,t),i=n?we("neutral",200):we("primary",300),a=r??i,l=r&&n?"opacity: 0.7;":"",s=we("neutral",n?400:800);return de`
3421
3421
  height: ${o};
3422
3422
  width: ${o};
3423
3423
  border-radius: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldresources/wri-design-systems",
3
- "version": "2.177.1",
3
+ "version": "2.178.0",
4
4
  "description": "WRI UI Library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",