@worldresources/wri-design-systems 2.145.1 → 2.146.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/README.md +1 -1
- package/dist/index.cjs.js +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +2 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ border: 1px solid ${getThemedColor('neutral', 400)};
|
|
|
167
167
|
- [Button](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/Button)
|
|
168
168
|
- [Close Button](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/CloseButton)
|
|
169
169
|
- [Icon Button](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/IconButton)
|
|
170
|
-
- [
|
|
170
|
+
- [Toolbar](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/Toolbar)
|
|
171
171
|
- [Menu](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/Menu)
|
|
172
172
|
- [Multi Action Button](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/MultiActionButton)
|
|
173
173
|
- [Tooltip](https://github.com/wri/wri-design-systems/tree/main/src/components/Forms/Actions/Tooltip)
|
package/dist/index.cjs.js
CHANGED
|
@@ -2161,7 +2161,7 @@
|
|
|
2161
2161
|
&:disabled {
|
|
2162
2162
|
background-color: ${p("neutral",200)};
|
|
2163
2163
|
}
|
|
2164
|
-
`,Ii=({id:n,label:r,caption:o,icon:i,value:a,variant:s="data",onItemClick:l,isExpanded:c=!1,ariaLabel:u,disabled:d=!1})=>{const p="navigation"===s&&!!l,h=p?e.chakra.button:e.chakra.div,f=u||("data"===s&&a?`${r}, ${a}`:r);return t.jsxs(h,{id:n,css:"data"===s?Mi:Di,onClick:p?l:void 0,tabIndex:p?0:void 0,onKeyDown:e=>{p&&("Enter"!==e.key&&" "!==e.key||l?.())},role:p?"button":void 0,"aria-expanded":p?c:void 0,"aria-label":f,disabled:d,children:[t.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",children:[i
|
|
2164
|
+
`,Ii=({id:n,label:r,caption:o,icon:i,value:a,variant:s="data",onItemClick:l,isExpanded:c=!1,ariaLabel:u,disabled:d=!1})=>{const p="navigation"===s&&!!l,h=p?e.chakra.button:e.chakra.div,f=u||("data"===s&&a?`${r}, ${a}`:r);return t.jsxs(h,{id:n,css:"data"===s?Mi:Di,onClick:p?l:void 0,tabIndex:p?0:void 0,onKeyDown:e=>{p&&("Enter"!==e.key&&" "!==e.key||l?.())},role:p?"button":void 0,"aria-expanded":p?c:void 0,"aria-label":f,disabled:d,children:[t.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",children:[i,t.jsxs(e.Box,{flex:"1",minWidth:0,children:[t.jsx(e.Text,{fontWeight:"navigation"===s?"700":"400",css:Li(d),children:r}),o&&t.jsx(e.Text,{css:Ti,children:o})]})]}),"data"===s&&a&&t.jsx(e.Text,{css:Pi,children:a}),"navigation"===s&&t.jsx(e.Icon,{as:$,boxSize:4,"aria-hidden":"true",css:_i(d)})]})},Ni=r.css`
|
|
2165
2165
|
svg {
|
|
2166
2166
|
path {
|
|
2167
2167
|
fill: ${p("primary",500)};
|
|
@@ -2261,7 +2261,6 @@
|
|
|
2261
2261
|
}
|
|
2262
2262
|
`,Qi=r.css`
|
|
2263
2263
|
border: 1px solid ${p("neutral",300)};
|
|
2264
|
-
border-radius: 8px;
|
|
2265
2264
|
`,ea=r.css`
|
|
2266
2265
|
padding: 16px;
|
|
2267
2266
|
cursor: pointer;
|
|
@@ -3451,7 +3450,7 @@ function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3451
3450
|
padding: 6px;
|
|
3452
3451
|
`,Hf=r.css`
|
|
3453
3452
|
padding: 6px;
|
|
3454
|
-
`,Ff={pauseOnPageIdle:!0,offsets:"24px"},Zf={"top-start":e.createToaster({placement:"top-start",...Ff}),"top-end":e.createToaster({placement:"top-end",...Ff}),"bottom-start":e.createToaster({placement:"bottom-start",...Ff}),"bottom-end":e.createToaster({placement:"bottom-end",...Ff})};exports.AnalysisWidget=({children:r,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l})=>{const c="analysis-widget-item",[u,d]=n.useState(a),p=`analysis-widget-header-${c}`;return t.jsx(e.Box,{as:"section","aria-labelledby":p,css:Qi,children:t.jsx(e.Accordion.Root,{multiple:!0,value:s?void 0:[c],defaultValue:a?[c]:[],children:t.jsxs(e.Accordion.Item,{css:ta,value:c,children:[t.jsx(e.Accordion.ItemTrigger,{id:p,role:"button","aria-expanded":u,tabIndex:0,css:ea,pointerEvents:s?"auto":"none",onClick:s?()=>{d(!u)}:void 0,children:t.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",children:[o,l&&l.map((e=>t.jsx(At,{variant:"info-grey",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},icon:e?.icon},e.label))),s&&t.jsx(e.Accordion.ItemIndicator,{height:"16px",display:"flex",children:t.jsx(k,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),t.jsxs("div",{className:u?"item-content-open":"item-content-closed","aria-hidden":!u,children:[r,i&&t.jsx(e.Box,{css:na,children:i})]})]})})})},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:ff,role:"status","aria-live":"polite",children:[t.jsxs("div",{css:xf(),children:[t.jsx(I,{color:"currentColor",height:"16px",width:"16px"}),!e||r||o?null:t.jsx("div",{css:gf,"aria-hidden":!0})]}),o?t.jsx("p",{children:o}):null,s.length>0?t.jsx("div",{css:bf,children:t.jsx("p",{css:yf,"aria-label":`${r} unread message`,children:s})}):null]}):t.jsxs("div",{css:ff,role:"status","aria-live":"polite",children:[o?t.jsx("p",{children:o}):null,t.jsxs("div",{css:xf(l),children:[s.length>0?t.jsx("div",{css:vf,children:t.jsx("p",{css:mf,"aria-label":`${r} unread message`,children:s})}):null,e&&!r?t.jsx("div",{css:gf,"aria-hidden":!0}):null,t.jsx(I,{color:"currentColor",height:"16px",width:"16px"})]})]})},exports.BaseMap=({title:e,caption:n,additionalSettings:o,options:i,onOptionSelected:a,maxHeight:s="400px",maxWidth:l="260px"})=>t.jsx("div",{css:fn(s,l),children:t.jsxs("div",{className:"ds-base-map-scroll-content",children:[t.jsxs("div",{css:xn,children:[t.jsx("h2",{className:"ds-base-map-header-title",children:e}),t.jsx("p",{className:"ds-base-map-header-caption",children:n})]}),t.jsxs("div",{css:gn,children:[o?t.jsx("div",{css:vn,children:o.map((e=>t.jsxs("div",{children:[t.jsx(je,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?t.jsx("div",{css:mn,children:e.children}):null]},e.label)))}):null,i?t.jsx("div",{css:bn,children:i.map((e=>{return t.jsxs("div",{css:yn(e.active),role:"button",onClick:()=>a?.(e),tabIndex:0,onKeyDown:t=>{"Enter"===t.key&&a?.(e)},children:[t.jsx("div",{css:(n=e.imageUrl,r.css`
|
|
3453
|
+
`,Ff={pauseOnPageIdle:!0,offsets:"24px"},Zf={"top-start":e.createToaster({placement:"top-start",...Ff}),"top-end":e.createToaster({placement:"top-end",...Ff}),"bottom-start":e.createToaster({placement:"bottom-start",...Ff}),"bottom-end":e.createToaster({placement:"bottom-end",...Ff})};exports.AnalysisWidget=({children:r,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l})=>{const c="analysis-widget-item",[u,d]=n.useState(a),p=`analysis-widget-header-${c}`;return t.jsx(e.Box,{as:"section","aria-labelledby":p,css:Qi,children:t.jsx(e.Accordion.Root,{multiple:!0,value:s?void 0:[c],defaultValue:a?[c]:[],children:t.jsxs(e.Accordion.Item,{css:ta,value:c,children:[o&&t.jsx(e.Accordion.ItemTrigger,{id:p,role:"button","aria-expanded":u,tabIndex:0,css:ea,pointerEvents:s?"auto":"none",onClick:s?()=>{d(!u)}: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(At,{variant:"info-grey",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},icon:e?.icon},e.label))),s&&t.jsx(e.Accordion.ItemIndicator,{height:"16px",display:"flex",children:t.jsx(k,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),t.jsxs("div",{className:u?"item-content-open":"item-content-closed","aria-hidden":!u,children:[r,i&&t.jsx(e.Box,{css:na,children:i})]})]})})})},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:ff,role:"status","aria-live":"polite",children:[t.jsxs("div",{css:xf(),children:[t.jsx(I,{color:"currentColor",height:"16px",width:"16px"}),!e||r||o?null:t.jsx("div",{css:gf,"aria-hidden":!0})]}),o?t.jsx("p",{children:o}):null,s.length>0?t.jsx("div",{css:bf,children:t.jsx("p",{css:yf,"aria-label":`${r} unread message`,children:s})}):null]}):t.jsxs("div",{css:ff,role:"status","aria-live":"polite",children:[o?t.jsx("p",{children:o}):null,t.jsxs("div",{css:xf(l),children:[s.length>0?t.jsx("div",{css:vf,children:t.jsx("p",{css:mf,"aria-label":`${r} unread message`,children:s})}):null,e&&!r?t.jsx("div",{css:gf,"aria-hidden":!0}):null,t.jsx(I,{color:"currentColor",height:"16px",width:"16px"})]})]})},exports.BaseMap=({title:e,caption:n,additionalSettings:o,options:i,onOptionSelected:a,maxHeight:s="400px",maxWidth:l="260px"})=>t.jsx("div",{css:fn(s,l),children:t.jsxs("div",{className:"ds-base-map-scroll-content",children:[t.jsxs("div",{css:xn,children:[t.jsx("h2",{className:"ds-base-map-header-title",children:e}),t.jsx("p",{className:"ds-base-map-header-caption",children:n})]}),t.jsxs("div",{css:gn,children:[o?t.jsx("div",{css:vn,children:o.map((e=>t.jsxs("div",{children:[t.jsx(je,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?t.jsx("div",{css:mn,children:e.children}):null]},e.label)))}):null,i?t.jsx("div",{css:bn,children:i.map((e=>{return t.jsxs("div",{css:yn(e.active),role:"button",onClick:()=>a?.(e),tabIndex:0,onKeyDown:t=>{"Enter"===t.key&&a?.(e)},children:[t.jsx("div",{css:(n=e.imageUrl,r.css`
|
|
3455
3454
|
height: 32px;
|
|
3456
3455
|
width: 32px;
|
|
3457
3456
|
border: 1px solid ${p("neutral",300)};
|
package/dist/index.d.ts
CHANGED
|
@@ -614,7 +614,7 @@ declare const ExtendableCard: ({ children, header, footer }: ExtendableCardProps
|
|
|
614
614
|
|
|
615
615
|
interface AnalysisWidgetProps {
|
|
616
616
|
children: React__default.ReactNode;
|
|
617
|
-
header
|
|
617
|
+
header?: React__default.ReactNode;
|
|
618
618
|
footer?: React__default.ReactNode;
|
|
619
619
|
expanded?: boolean;
|
|
620
620
|
collapsible?: boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -2217,7 +2217,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2217
2217
|
&:disabled {
|
|
2218
2218
|
background-color: ${ge("neutral",200)};
|
|
2219
2219
|
}
|
|
2220
|
-
`,il=({id:e,label:t,caption:n,icon:i,value:a,variant:l="data",onItemClick:s,isExpanded:c=!1,ariaLabel:d,disabled:u=!1})=>{const p="navigation"===l&&!!s,h=p?O.button:O.div;return H(h,{id:e,css:"data"===l?nl:rl,onClick:p?s:void 0,tabIndex:p?0:void 0,onKeyDown:e=>{p&&("Enter"!==e.key&&" "!==e.key||s?.())},role:p?"button":void 0,"aria-expanded":p?c:void 0,"aria-label":d||("data"===l&&a?`${t}, ${a}`:t),disabled:u,children:[H(R,{gap:3,flex:"1",overflow:"hidden",children:[i
|
|
2220
|
+
`,il=({id:e,label:t,caption:n,icon:i,value:a,variant:l="data",onItemClick:s,isExpanded:c=!1,ariaLabel:d,disabled:u=!1})=>{const p="navigation"===l&&!!s,h=p?O.button:O.div;return H(h,{id:e,css:"data"===l?nl:rl,onClick:p?s:void 0,tabIndex:p?0:void 0,onKeyDown:e=>{p&&("Enter"!==e.key&&" "!==e.key||s?.())},role:p?"button":void 0,"aria-expanded":p?c:void 0,"aria-label":d||("data"===l&&a?`${t}, ${a}`:t),disabled:u,children:[H(R,{gap:3,flex:"1",overflow:"hidden",children:[i,H(r,{flex:"1",minWidth:0,children:[B(L,{fontWeight:"navigation"===l?"700":"400",css:Ja(u),children:t}),n&&B(L,{css:Qa,children:n})]})]}),"data"===l&&a&&B(L,{css:el,children:a}),"navigation"===l&&B(o,{as:Re,boxSize:4,"aria-hidden":"true",css:tl(u)})]})},ol=({items:e,noBorder:t})=>B(r,{css:Ka(t),children:e.map((e=>B(il,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick},e.id??e.label)))}),al=oe`
|
|
2221
2221
|
svg {
|
|
2222
2222
|
path {
|
|
2223
2223
|
fill: ${ge("primary",500)};
|
|
@@ -2317,7 +2317,6 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2317
2317
|
}
|
|
2318
2318
|
`,$l=({children:e,header:t,footer:n})=>B(r,{css:wl,children:B(S.Root,{multiple:!0,children:H(S.Item,{value:"extendable-card-item",children:[H(S.ItemTrigger,{css:Cl,alignItems:"center",children:[B(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:t}),B(S.ItemIndicator,{children:B(Oe,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),H(S.ItemContent,{children:[e,n]})]})})}),kl=oe`
|
|
2319
2319
|
border: 1px solid ${ge("neutral",300)};
|
|
2320
|
-
border-radius: 8px;
|
|
2321
2320
|
`,Sl=oe`
|
|
2322
2321
|
padding: 16px;
|
|
2323
2322
|
cursor: pointer;
|
|
@@ -2357,7 +2356,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2357
2356
|
}
|
|
2358
2357
|
`,Ol=oe`
|
|
2359
2358
|
border-top: 1px solid ${ge("neutral",300)};
|
|
2360
|
-
`,Rl=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a})=>{const l="analysis-widget-item",[s,c]=G(i),d=`analysis-widget-header-${l}`;return B(r,{as:"section","aria-labelledby":d,css:kl,children:B(S.Root,{multiple:!0,value:o?void 0:[l],defaultValue:i?[l]:[],children:H(S.Item,{css:El,value:l,children:[B(S.ItemTrigger,{id:d,role:"button","aria-expanded":s,tabIndex:0,css:Sl,pointerEvents:o?"auto":"none",onClick:o?()=>{c(!s)}:void 0,children:H(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",children:[t,a&&a.map((e=>B(Xn,{variant:"info-grey",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},icon:e?.icon},e.label))),o&&B(S.ItemIndicator,{height:"16px",display:"flex",children:B(Oe,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),H("div",{className:s?"item-content-open":"item-content-closed","aria-hidden":!s,children:[e,n&&B(r,{css:Ol,children:n})]})]})})})};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pl(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 Tl,_l={exports:{}},Ml={},Dl={exports:{}},Nl={exports:{}},Vl={};var jl,Il,Al,zl,Hl,Bl,Fl,Zl,Wl,ql,Gl,Ul,Xl,Yl={};
|
|
2359
|
+
`,Rl=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a})=>{const l="analysis-widget-item",[s,c]=G(i),d=`analysis-widget-header-${l}`;return B(r,{as:"section","aria-labelledby":d,css:kl,children:B(S.Root,{multiple:!0,value:o?void 0:[l],defaultValue:i?[l]:[],children:H(S.Item,{css:El,value:l,children:[t&&B(S.ItemTrigger,{id:d,role:"button","aria-expanded":s,tabIndex:0,css:Sl,pointerEvents:o?"auto":"none",onClick:o?()=>{c(!s)}:void 0,children:H(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,a&&a.map((e=>B(Xn,{variant:"info-grey",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},icon:e?.icon},e.label))),o&&B(S.ItemIndicator,{height:"16px",display:"flex",children:B(Oe,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),H("div",{className:s?"item-content-open":"item-content-closed","aria-hidden":!s,children:[e,n&&B(r,{css:Ol,children:n})]})]})})})};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pl(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 Tl,_l={exports:{}},Ml={},Dl={exports:{}},Nl={exports:{}},Vl={};var jl,Il,Al,zl,Hl,Bl,Fl,Zl,Wl,ql,Gl,Ul,Xl,Yl={};
|
|
2361
2360
|
/** @license React v16.13.1
|
|
2362
2361
|
* react-is.development.js
|
|
2363
2362
|
*
|