@worldresources/wri-design-systems 2.185.0 → 2.186.1

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
@@ -3684,10 +3684,10 @@ function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3684
3684
  background-image: url(${n});
3685
3685
  background-size: cover;
3686
3686
  background-position: center;
3687
- `)}),t.jsxs("div",{css:Ln,children:[t.jsxs("div",{className:"ds-base-map-title-container",children:[t.jsx("p",{className:"ds-base-map-title",children:e.label}),e.active?t.jsx(Gt,{label:"Active",variant:"warning",size:"small",icon:t.jsx(C,{})}):null]}),t.jsx("p",{className:"ds-base-map-caption",children:e.caption}),e.active&&e.children?t.jsx("div",{className:"ds-base-map-children",children:e.children}):null]})]},e.label);var n}))}):null]})]})})},exports.Breadcrumb=({links:r,separator:o,maxItems:i=99,linkRouter:a,size:s="default"})=>{const[l,c]=n.useState(r.length>i);n.useEffect((()=>{c(r.length>i)}),[r.length]);const d=a;return t.jsx(e.Breadcrumb.Root,{children:t.jsx(e.Breadcrumb.List,{gap:"small"===s?"6px":"10px",children:l?t.jsxs(t.Fragment,{children:[t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:t.jsxs(d,{to:r[0].link,href:r[0].link,children:[r[0].icon,r[0].label]})}),t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}),t.jsx("li",{className:"chakra-breadcrumb__item",children:t.jsx("button",{css:_h,type:"button",onClick:()=>c(!1),children:"..."})}),t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}),t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:t.jsxs("p",{"aria-current":"page","aria-label":r[r.length-1].label,children:[r[r.length-1].icon,r[r.length-1].label]})})]}):r.map(((i,a)=>i?.label?t.jsxs(n.Fragment,{children:[t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:a<r.length-1?t.jsxs(d,{to:i.link,href:i.link,children:[i.icon,i.label]}):t.jsxs("p",{"aria-current":"page","aria-label":i.label,children:[i.label&&i.icon?i.icon:"",i.label]})}),a<r.length-1?t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}):null]},i.label):null))})})},exports.Button=b,exports.Checkbox=Le,exports.CheckboxList=({label:o,caption:i,checkboxes:a,defaultValue:s,onCheckedChange:l,errorMessage:c,horizontal:d,required:u,hideCheckedCounter:p=!1,hideExpandToggle:h=!1})=>{const[f,x]=n.useState(s?{[s]:!0}:{}),[g,v]=n.useState(!0),m="string"!=typeof o,b=a.length>0&&a.every((e=>e.name&&f[e.name])),y=a.some((e=>e.name&&f[e.name]))&&!b,w=a.length,C=`${a.filter((e=>e?.name&&f[e.name])).length} / ${w}`,j=i?`${i}.`:"",k=u?"Required.":"Optional",S=c?`Error: ${c}.`:"",E=`${m?o.label:o}. ${j} ${k} ${S} `;return t.jsxs(e.Group,{css:ot,"aria-label":E,children:[c?t.jsx("div",{css:lt}):null,t.jsxs("div",{css:(R=!!c,r.css`
3688
- margin-left: ${R?"19px":"0px"};
3687
+ `)}),t.jsxs("div",{css:Ln,children:[t.jsxs("div",{className:"ds-base-map-title-container",children:[t.jsx("p",{className:"ds-base-map-title",children:e.label}),e.active?t.jsx(Gt,{label:"Active",variant:"warning",size:"small",icon:t.jsx(C,{})}):null]}),t.jsx("p",{className:"ds-base-map-caption",children:e.caption}),e.active&&e.children?t.jsx("div",{className:"ds-base-map-children",children:e.children}):null]})]},e.label);var n}))}):null]})]})})},exports.Breadcrumb=({links:r,separator:o,maxItems:i=99,linkRouter:a,size:s="default"})=>{const[l,c]=n.useState(r.length>i);n.useEffect((()=>{c(r.length>i)}),[r.length]);const d=a;return t.jsx(e.Breadcrumb.Root,{children:t.jsx(e.Breadcrumb.List,{gap:"small"===s?"6px":"10px",children:l?t.jsxs(t.Fragment,{children:[t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:t.jsxs(d,{to:r[0].link,href:r[0].link,children:[r[0].icon,r[0].label]})}),t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}),t.jsx("li",{className:"chakra-breadcrumb__item",children:t.jsx("button",{css:_h,type:"button",onClick:()=>c(!1),children:"..."})}),t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}),t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:t.jsxs("p",{"aria-current":"page","aria-label":r[r.length-1].label,children:[r[r.length-1].icon,r[r.length-1].label]})})]}):r.map(((i,a)=>i?.label?t.jsxs(n.Fragment,{children:[t.jsx(e.Breadcrumb.Item,{css:Mh(s),children:a<r.length-1?t.jsxs(d,{to:i.link,href:i.link,children:[i.icon,i.label]}):t.jsxs("p",{"aria-current":"page","aria-label":i.label,children:[i.label&&i.icon?i.icon:"",i.label]})}),a<r.length-1?t.jsx(e.Breadcrumb.Separator,{css:Ph(s),children:o||t.jsx($,{rotate:"270"})}):null]},i.label):null))})})},exports.Button=b,exports.Checkbox=Le,exports.CheckboxList=({label:o,caption:i,checkboxes:a,defaultValues:s,onCheckedChange:l,errorMessage:c,horizontal:d,required:u,hideCheckedCounter:p=!1,hideExpandToggle:h=!1})=>{const f=Array.isArray(s)?s:[],[x,g]=n.useState(f.reduce(((e,t)=>({...e,[t]:!0})),{})),[v,m]=n.useState(!0),b="string"!=typeof o,y=a.length>0&&a.every((e=>e.name&&x[e.name])),w=a.some((e=>e.name&&x[e.name]))&&!y,C=a.length,j=`${a.filter((e=>e?.name&&x[e.name])).length} / ${C}`,k=i?`${i}.`:"",S=u?"Required.":"Optional",E=c?`Error: ${c}.`:"",R=`${b?o.label:o}. ${k} ${S} ${E} `;return t.jsxs(e.Group,{css:ot,"aria-label":R,children:[c?t.jsx("div",{css:lt}):null,t.jsxs("div",{css:(L=!!c,r.css`
3688
+ margin-left: ${L?"19px":"0px"};
3689
3689
  width: 100%;
3690
- `),children:[t.jsx("div",{css:it,children:"string"==typeof o?t.jsxs(t.Fragment,{children:[u&&t.jsx("span",{id:"required-symbol","aria-label":"required",children:"*"}),o]}):t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[t.jsxs(Le,{checked:b,indeterminate:y,onCheckedChange:e=>(e=>{const t=a.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});x(t),l?.(t)})(!!e.checked),children:[o.label," ",!p&&t.jsx("span",{"aria-hidden":"true",css:dt,children:C})]}),!h&&t.jsxs("button",{type:"button",onClick:()=>v((e=>!e)),"aria-expanded":g,"aria-controls":"checkbox-list",css:ut,children:[g?"Hide":"Expand",t.jsx("span",{"aria-hidden":"true",children:g?t.jsx($,{style:{transform:"rotate(180deg)"}}):t.jsx($,{})})]})]})}),t.jsx("p",{css:at,"aria-label":i,children:i}),c?t.jsx("p",{css:ct,"aria-label":c,children:c}):null,t.jsx("div",{id:"checkbox-list",css:st(d,g),children:a.map((e=>t.jsx(Le,{ms:m&&!d?"6":"",css:{},checked:!!e?.name&&!!f[e.name],onCheckedChange:({checked:t})=>((e,t)=>{const n={...f};t&&(n[t]=e,x(n)),l&&l(n)})(t,e.name),...e},e.name)))})]})]});var R},exports.CheckboxOptionCard=({defaultValue:n,items:o,onValueChange:i})=>t.jsx(e.CheckboxGroup,{defaultValue:n,onValueChange:i,children:t.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:o.map((o=>{return t.jsxs(e.CheckboxCard.Root,{css:Oe,defaultChecked:-1!==n?.indexOf(o.value),disabled:o.disabled,value:o.value,children:[t.jsx(e.CheckboxCard.HiddenInput,{}),t.jsxs(e.CheckboxCard.Control,{css:Te,children:[t.jsxs(e.CheckboxCard.Content,{css:(a=o.variant,r.css`
3690
+ `),children:[t.jsx("div",{css:it,children:"string"==typeof o?t.jsxs(t.Fragment,{children:[u&&t.jsx("span",{id:"required-symbol","aria-label":"required",children:"*"}),o]}):t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[t.jsxs(Le,{checked:y,indeterminate:w,onCheckedChange:e=>(e=>{const t=a.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});g(t),l?.(t)})(!!e.checked),children:[o.label," ",!p&&t.jsx("span",{"aria-hidden":"true",css:dt,children:j})]}),!h&&t.jsxs("button",{type:"button",onClick:()=>m((e=>!e)),"aria-expanded":v,"aria-controls":"checkbox-list",css:ut,children:[v?"Hide":"Expand",t.jsx("span",{"aria-hidden":"true",children:v?t.jsx($,{style:{transform:"rotate(180deg)"}}):t.jsx($,{})})]})]})}),t.jsx("p",{css:at,"aria-label":i,children:i}),c?t.jsx("p",{css:ct,"aria-label":c,children:c}):null,t.jsx("div",{id:"checkbox-list",css:st(d,v),children:a.map((e=>t.jsx(Le,{ms:b&&!d?"6":"",css:{},checked:!!e?.name&&!!x[e.name],onCheckedChange:({checked:t})=>((e,t)=>{const n={...x};t&&(n[t]=e,g(n)),l&&l(n)})(t,e.name),...e},e.name)))})]})]});var L},exports.CheckboxOptionCard=({defaultValue:n,items:o,onValueChange:i})=>t.jsx(e.CheckboxGroup,{defaultValue:n,onValueChange:i,children:t.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:o.map((o=>{return t.jsxs(e.CheckboxCard.Root,{css:Oe,defaultChecked:-1!==n?.indexOf(o.value),disabled:o.disabled,value:o.value,children:[t.jsx(e.CheckboxCard.HiddenInput,{}),t.jsxs(e.CheckboxCard.Control,{css:Te,children:[t.jsxs(e.CheckboxCard.Content,{css:(a=o.variant,r.css`
3691
3691
  width: 100%;
3692
3692
  display: flex;
3693
3693
  flex-direction: ${"centered"===a?"column":"row"};
package/dist/index.d.ts CHANGED
@@ -247,7 +247,7 @@ type CheckboxListProps = {
247
247
  label: CheckboxListLabel;
248
248
  caption?: string;
249
249
  checkboxes: CheckboxProps[];
250
- defaultValue?: string;
250
+ defaultValues?: string[];
251
251
  onCheckedChange?: (checkedValues: {
252
252
  [name: string]: boolean;
253
253
  }) => void;
@@ -258,7 +258,7 @@ type CheckboxListProps = {
258
258
  hideExpandToggle?: boolean;
259
259
  };
260
260
 
261
- declare const CheckboxList: ({ label, caption, checkboxes, defaultValue, onCheckedChange, errorMessage, horizontal, required, hideCheckedCounter, hideExpandToggle, }: CheckboxListProps) => _emotion_react_jsx_runtime.JSX.Element;
261
+ declare const CheckboxList: ({ label, caption, checkboxes, defaultValues, onCheckedChange, errorMessage, horizontal, required, hideCheckedCounter, hideExpandToggle, }: CheckboxListProps) => _emotion_react_jsx_runtime.JSX.Element;
262
262
 
263
263
  type InputWithUnitsProps = {
264
264
  label: string;
package/dist/index.esm.js CHANGED
@@ -1052,10 +1052,10 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1052
1052
  > span {
1053
1053
  margin-left: 6px;
1054
1054
  }
1055
- `,Sn=({label:e,caption:t,checkboxes:n,defaultValue:r,onCheckedChange:o,errorMessage:i,horizontal:a,required:l,hideCheckedCounter:c=!1,hideExpandToggle:d=!1})=>{const[u,p]=J(r?{[r]:!0}:{}),[h,f]=J(!0),g="string"!=typeof e,v=n.length>0&&n.every((e=>e.name&&u[e.name])),m=n.some((e=>e.name&&u[e.name]))&&!v,x=n.length,b=`${n.filter((e=>e?.name&&u[e.name])).length} / ${x}`,y=t?`${t}.`:"",w=l?"Required.":"Optional",C=i?`Error: ${i}.`:"",$=`${g?e.label:e}. ${y} ${w} ${C} `;return q(s,{css:mn,"aria-label":$,children:[i?G("div",{css:wn}):null,q("div",{css:(k=!!i,de`
1056
- margin-left: ${k?"19px":"0px"};
1055
+ `,Sn=({label:e,caption:t,checkboxes:n,defaultValues:r,onCheckedChange:o,errorMessage:i,horizontal:a,required:l,hideCheckedCounter:c=!1,hideExpandToggle:d=!1})=>{const u=Array.isArray(r)?r:[],[p,h]=J(u.reduce(((e,t)=>({...e,[t]:!0})),{})),[f,g]=J(!0),v="string"!=typeof e,m=n.length>0&&n.every((e=>e.name&&p[e.name])),x=n.some((e=>e.name&&p[e.name]))&&!m,b=n.length,y=`${n.filter((e=>e?.name&&p[e.name])).length} / ${b}`,w=t?`${t}.`:"",C=l?"Required.":"Optional",$=i?`Error: ${i}.`:"",k=`${v?e.label:e}. ${w} ${C} ${$} `;return q(s,{css:mn,"aria-label":k,children:[i?G("div",{css:wn}):null,q("div",{css:(S=!!i,de`
1056
+ margin-left: ${S?"19px":"0px"};
1057
1057
  width: 100%;
1058
- `),children:[G("div",{css:xn,children:"string"==typeof e?q(U,{children:[l&&G("span",{id:"required-symbol","aria-label":"required",children:"*"}),e]}):q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[q(At,{checked:v,indeterminate:m,onCheckedChange:e=>(e=>{const t=n.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});p(t),o?.(t)})(!!e.checked),children:[e.label," ",!c&&G("span",{"aria-hidden":"true",css:$n,children:b})]}),!d&&q("button",{type:"button",onClick:()=>f((e=>!e)),"aria-expanded":h,"aria-controls":"checkbox-list",css:kn,children:[h?"Hide":"Expand",G("span",{"aria-hidden":"true",children:G(Me,h?{style:{transform:"rotate(180deg)"}}:{})})]})]})}),G("p",{css:bn,"aria-label":t,children:t}),i?G("p",{css:Cn,"aria-label":i,children:i}):null,G("div",{id:"checkbox-list",css:yn(a,h),children:n.map((e=>G(At,{ms:g&&!a?"6":"",css:{},checked:!!e?.name&&!!u[e.name],onCheckedChange:({checked:t})=>((e,t)=>{const n={...u};t&&(n[t]=e,p(n)),o&&o(n)})(t,e.name),...e},e.name)))})]})]});var k},En=de`
1058
+ `),children:[G("div",{css:xn,children:"string"==typeof e?q(U,{children:[l&&G("span",{id:"required-symbol","aria-label":"required",children:"*"}),e]}):q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[q(At,{checked:m,indeterminate:x,onCheckedChange:e=>(e=>{const t=n.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});h(t),o?.(t)})(!!e.checked),children:[e.label," ",!c&&G("span",{"aria-hidden":"true",css:$n,children:y})]}),!d&&q("button",{type:"button",onClick:()=>g((e=>!e)),"aria-expanded":f,"aria-controls":"checkbox-list",css:kn,children:[f?"Hide":"Expand",G("span",{"aria-hidden":"true",children:G(Me,f?{style:{transform:"rotate(180deg)"}}:{})})]})]})}),G("p",{css:bn,"aria-label":t,children:t}),i?G("p",{css:Cn,"aria-label":i,children:i}):null,G("div",{id:"checkbox-list",css:yn(a,f),children:n.map((e=>G(At,{ms:v&&!a?"6":"",css:{},checked:!!e?.name&&!!p[e.name],onCheckedChange:({checked:t})=>((e,t)=>{const n={...p};t&&(n[t]=e,h(n)),o&&o(n)})(t,e.name),...e},e.name)))})]})]});var S},En=de`
1059
1059
  width: 100%;
1060
1060
  max-width: 370px;
1061
1061
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldresources/wri-design-systems",
3
- "version": "2.185.0",
3
+ "version": "2.186.1",
4
4
  "description": "WRI UI Library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",