@worldresources/wri-design-systems 2.160.0 → 2.161.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 +4 -2
- package/dist/index.esm.js +4 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2300,9 +2300,11 @@
|
|
|
2300
2300
|
border: 1px solid ${h("neutral",300)};
|
|
2301
2301
|
`,sa=r.css`
|
|
2302
2302
|
padding: 16px;
|
|
2303
|
-
|
|
2304
2303
|
cursor: pointer;
|
|
2305
2304
|
border-bottom: 1px solid ${h("neutral",300)};
|
|
2305
|
+
> div {
|
|
2306
|
+
overflow: visible;
|
|
2307
|
+
}
|
|
2306
2308
|
&:focus-visible {
|
|
2307
2309
|
outline-offset: -2px;
|
|
2308
2310
|
outline: 2px solid ${h("primary",700)};
|
|
@@ -3557,7 +3559,7 @@ function Yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3557
3559
|
padding: 6px;
|
|
3558
3560
|
`,tx=r.css`
|
|
3559
3561
|
padding: 6px;
|
|
3560
|
-
`,nx={pauseOnPageIdle:!0,offsets:"24px"},rx={"top-start":e.createToaster({placement:"top-start",...nx}),"top-end":e.createToaster({placement:"top-end",...nx}),"bottom-start":e.createToaster({placement:"bottom-start",...nx}),"bottom-end":e.createToaster({placement:"bottom-end",...nx})};exports.AnalysisWidget=({children:r,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l,showFooterOnCollapsed:c=!1})=>{const u="analysis-widget-item",[d,p]=n.useState(a),h=`analysis-widget-header-${u}`;return t.jsx(e.Box,{as:"section","aria-labelledby":h,css:aa,children:t.jsxs(e.Accordion.Root,{multiple:!0,value:s?void 0:[u],defaultValue:a?[u]:[],children:[t.jsxs(e.Accordion.Item,{css:la,value:u,children:[o&&t.jsx(e.Accordion.ItemTrigger,{id:h,role:"button","aria-expanded":d,tabIndex:0,css:sa,pointerEvents:s?"auto":"none",onClick:s?()=>{p(!d)}:void 0,children:t.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[o,l&&l.map((e=>t.jsx(b,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),s&&t.jsx(e.Accordion.ItemIndicator,{height:"16px",display:"flex",children:t.jsx($,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),t.jsxs("div",{className:d?"item-content-open":"item-content-closed","aria-hidden":!d,children:[r,!c&&i&&t.jsx(e.Box,{css:ca,children:i})]})]}),c&&i&&t.jsx(e.Box,{css:ca,children:i})]})})},exports.Avatar=Sf,exports.Badge=({hasNotification:e,notificationCount:r,label:o})=>{const[i,a]=n.useState(!1);n.useEffect((()=>{const e=()=>{window.innerWidth<1024?a(!0):a(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const s=(()=>{let e="";return r&&r>0&&(e=`${r>99?"99+":r}`),e})();let l="16px";return r&&r>99?l="28px":r&&r>9&&(l="22px"),i?t.jsxs("div",{css:Ef,role:"status","aria-live":"polite",children:[t.jsxs("div",{css:Rf(),children:[t.jsx(I,{color:"currentColor",height:"16px",width:"16px"}),!e||r||o?null:t.jsx("div",{css:Of,"aria-hidden":!0})]}),o?t.jsx("p",{children:o}):null,s.length>0?t.jsx("div",{css:Pf,children:t.jsx("p",{css:Mf,"aria-label":`${r} unread message`,children:s})}):null]}):t.jsxs("div",{css:Ef,role:"status","aria-live":"polite",children:[o?t.jsx("p",{children:o}):null,t.jsxs("div",{css:Rf(l),children:[s.length>0?t.jsx("div",{css:Lf,children:t.jsx("p",{css:Tf,"aria-label":`${r} unread message`,children:s})}):null,e&&!r?t.jsx("div",{css:Of,"aria-hidden":!0}):null,t.jsx(I,{color:"currentColor",height:"16px",width:"16px"})]})]})},exports.BaseMap=({title:e,caption:o,additionalSettings:i,options:a,onOptionSelected:s,maxHeight:l="400px",maxWidth:c="260px"})=>{const u=n.useRef(null),d=n.useRef(null);return n.useEffect((()=>{const e=u.current,t=d.current;if(!e||!t)return;const n=()=>{e.focus()};if("undefined"!=typeof IntersectionObserver){let e=!1;const r=new IntersectionObserver((([t])=>{t?.isIntersecting?(e||n(),e=!0):e=!1}),{threshold:.01});return r.observe(t),()=>r.disconnect()}const r=window.setTimeout(n,0);return()=>window.clearTimeout(r)}),[]),t.jsx("div",{ref:d,css:bn(l,c),children:t.jsxs("div",{className:"ds-base-map-scroll-content",children:[t.jsxs("div",{css:yn,children:[t.jsx("h2",{ref:u,className:"ds-base-map-header-title",tabIndex:-1,children:e}),t.jsx("p",{className:"ds-base-map-header-caption",children:o})]}),t.jsxs("div",{css:wn,children:[i?t.jsx("div",{css:Cn,children:i.map((e=>t.jsxs("div",{children:[t.jsx(Re,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?t.jsx("div",{css:jn,children:e.children}):null]},e.label)))}):null,a?t.jsx("div",{css:kn,children:a.map((e=>{return t.jsxs("div",{css:$n(e.active),role:"button",onClick:()=>s?.(e),tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||s?.(e)},children:[t.jsx("div",{css:(n=e.imageUrl,r.css`
|
|
3562
|
+
`,nx={pauseOnPageIdle:!0,offsets:"24px"},rx={"top-start":e.createToaster({placement:"top-start",...nx}),"top-end":e.createToaster({placement:"top-end",...nx}),"bottom-start":e.createToaster({placement:"bottom-start",...nx}),"bottom-end":e.createToaster({placement:"bottom-end",...nx})};exports.AnalysisWidget=({children:r,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l,showFooterOnCollapsed:c=!1})=>{const u="analysis-widget-item",[d,p]=n.useState(a),h=`analysis-widget-header-${u}`;return t.jsx(e.Box,{as:"section","aria-labelledby":h,css:aa,children:t.jsxs(e.Accordion.Root,{multiple:!0,value:s?void 0:[u],defaultValue:a?[u]:[],children:[t.jsxs(e.Accordion.Item,{css:la,value:u,children:[o&&t.jsx(e.Accordion.ItemTrigger,{id:h,role:"button","aria-expanded":d,tabIndex:0,css:sa,pointerEvents:s?"auto":"none",onClick:s?()=>{p(!d)}:void 0,children:t.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[o,l&&l.map((e=>t.jsx(b,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),s&&t.jsx(e.Accordion.ItemIndicator,{height:"16px",marginTop:"8px",display:"flex",children:t.jsx($,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),t.jsxs("div",{className:d?"item-content-open":"item-content-closed","aria-hidden":!d,children:[r,!c&&i&&t.jsx(e.Box,{css:ca,children:i})]})]}),c&&i&&t.jsx(e.Box,{css:ca,children:i})]})})},exports.Avatar=Sf,exports.Badge=({hasNotification:e,notificationCount:r,label:o})=>{const[i,a]=n.useState(!1);n.useEffect((()=>{const e=()=>{window.innerWidth<1024?a(!0):a(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const s=(()=>{let e="";return r&&r>0&&(e=`${r>99?"99+":r}`),e})();let l="16px";return r&&r>99?l="28px":r&&r>9&&(l="22px"),i?t.jsxs("div",{css:Ef,role:"status","aria-live":"polite",children:[t.jsxs("div",{css:Rf(),children:[t.jsx(I,{color:"currentColor",height:"16px",width:"16px"}),!e||r||o?null:t.jsx("div",{css:Of,"aria-hidden":!0})]}),o?t.jsx("p",{children:o}):null,s.length>0?t.jsx("div",{css:Pf,children:t.jsx("p",{css:Mf,"aria-label":`${r} unread message`,children:s})}):null]}):t.jsxs("div",{css:Ef,role:"status","aria-live":"polite",children:[o?t.jsx("p",{children:o}):null,t.jsxs("div",{css:Rf(l),children:[s.length>0?t.jsx("div",{css:Lf,children:t.jsx("p",{css:Tf,"aria-label":`${r} unread message`,children:s})}):null,e&&!r?t.jsx("div",{css:Of,"aria-hidden":!0}):null,t.jsx(I,{color:"currentColor",height:"16px",width:"16px"})]})]})},exports.BaseMap=({title:e,caption:o,additionalSettings:i,options:a,onOptionSelected:s,maxHeight:l="400px",maxWidth:c="260px"})=>{const u=n.useRef(null),d=n.useRef(null);return n.useEffect((()=>{const e=u.current,t=d.current;if(!e||!t)return;const n=()=>{e.focus()};if("undefined"!=typeof IntersectionObserver){let e=!1;const r=new IntersectionObserver((([t])=>{t?.isIntersecting?(e||n(),e=!0):e=!1}),{threshold:.01});return r.observe(t),()=>r.disconnect()}const r=window.setTimeout(n,0);return()=>window.clearTimeout(r)}),[]),t.jsx("div",{ref:d,css:bn(l,c),children:t.jsxs("div",{className:"ds-base-map-scroll-content",children:[t.jsxs("div",{css:yn,children:[t.jsx("h2",{ref:u,className:"ds-base-map-header-title",tabIndex:-1,children:e}),t.jsx("p",{className:"ds-base-map-header-caption",children:o})]}),t.jsxs("div",{css:wn,children:[i?t.jsx("div",{css:Cn,children:i.map((e=>t.jsxs("div",{children:[t.jsx(Re,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?t.jsx("div",{css:jn,children:e.children}):null]},e.label)))}):null,a?t.jsx("div",{css:kn,children:a.map((e=>{return t.jsxs("div",{css:$n(e.active),role:"button",onClick:()=>s?.(e),tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||s?.(e)},children:[t.jsx("div",{css:(n=e.imageUrl,r.css`
|
|
3561
3563
|
height: 32px;
|
|
3562
3564
|
width: 32px;
|
|
3563
3565
|
border: 1px solid ${h("neutral",300)};
|
package/dist/index.esm.js
CHANGED
|
@@ -2356,9 +2356,11 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2356
2356
|
border: 1px solid ${be("neutral",300)};
|
|
2357
2357
|
`,Vl=se`
|
|
2358
2358
|
padding: 16px;
|
|
2359
|
-
|
|
2360
2359
|
cursor: pointer;
|
|
2361
2360
|
border-bottom: 1px solid ${be("neutral",300)};
|
|
2361
|
+
> div {
|
|
2362
|
+
overflow: visible;
|
|
2363
|
+
}
|
|
2362
2364
|
&:focus-visible {
|
|
2363
2365
|
outline-offset: -2px;
|
|
2364
2366
|
outline: 2px solid ${be("primary",700)};
|
|
@@ -2395,7 +2397,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2395
2397
|
}
|
|
2396
2398
|
`,Il=se`
|
|
2397
2399
|
border-top: 1px solid ${be("neutral",300)};
|
|
2398
|
-
`,Al=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a,showFooterOnCollapsed:l=!1})=>{const s="analysis-widget-item",[c,d]=Y(i),u=`analysis-widget-header-${s}`;return W(r,{as:"section","aria-labelledby":u,css:Nl,children:Z(S.Root,{multiple:!0,value:o?void 0:[s],defaultValue:i?[s]:[],children:[Z(S.Item,{css:jl,value:s,children:[t&&W(S.ItemTrigger,{id:u,role:"button","aria-expanded":c,tabIndex:0,css:Vl,pointerEvents:o?"auto":"none",onClick:o?()=>{d(!c)}:void 0,children:Z(L,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,a&&a.map((e=>W(Se,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),o&&W(S.ItemIndicator,{height:"16px",display:"flex",children:W(Pe,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),Z("div",{className:c?"item-content-open":"item-content-closed","aria-hidden":!c,children:[e,!l&&n&&W(r,{css:Il,children:n})]})]}),l&&n&&W(r,{css:Il,children:n})]})})};function zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hl(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Bl,Fl={exports:{}},Zl={},Wl={exports:{}},ql={exports:{}},Gl={};var Ul,Xl,Yl,Kl,Jl,Ql,es,ts,ns,rs,is,os,as,ls={};
|
|
2400
|
+
`,Al=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a,showFooterOnCollapsed:l=!1})=>{const s="analysis-widget-item",[c,d]=Y(i),u=`analysis-widget-header-${s}`;return W(r,{as:"section","aria-labelledby":u,css:Nl,children:Z(S.Root,{multiple:!0,value:o?void 0:[s],defaultValue:i?[s]:[],children:[Z(S.Item,{css:jl,value:s,children:[t&&W(S.ItemTrigger,{id:u,role:"button","aria-expanded":c,tabIndex:0,css:Vl,pointerEvents:o?"auto":"none",onClick:o?()=>{d(!c)}:void 0,children:Z(L,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,a&&a.map((e=>W(Se,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),o&&W(S.ItemIndicator,{height:"16px",marginTop:"8px",display:"flex",children:W(Pe,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),Z("div",{className:c?"item-content-open":"item-content-closed","aria-hidden":!c,children:[e,!l&&n&&W(r,{css:Il,children:n})]})]}),l&&n&&W(r,{css:Il,children:n})]})})};function zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hl(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Bl,Fl={exports:{}},Zl={},Wl={exports:{}},ql={exports:{}},Gl={};var Ul,Xl,Yl,Kl,Jl,Ql,es,ts,ns,rs,is,os,as,ls={};
|
|
2399
2401
|
/** @license React v16.13.1
|
|
2400
2402
|
* react-is.development.js
|
|
2401
2403
|
*
|