@worldresources/wri-design-systems 2.148.10 → 2.148.11
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 +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3532,7 +3532,7 @@ function Zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3532
3532
|
padding: 6px;
|
|
3533
3533
|
`,Gf=r.css`
|
|
3534
3534
|
padding: 6px;
|
|
3535
|
-
`,Uf={pauseOnPageIdle:!0,offsets:"24px"},Xf={"top-start":e.createToaster({placement:"top-start",...Uf}),"top-end":e.createToaster({placement:"top-end",...Uf}),"bottom-start":e.createToaster({placement:"bottom-start",...Uf}),"bottom-end":e.createToaster({placement:"bottom-end",...Uf})};exports.AnalysisWidget=({children:r,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l})=>{const
|
|
3535
|
+
`,Uf={pauseOnPageIdle:!0,offsets:"24px"},Xf={"top-start":e.createToaster({placement:"top-start",...Uf}),"top-end":e.createToaster({placement:"top-end",...Uf}),"bottom-start":e.createToaster({placement:"bottom-start",...Uf}),"bottom-end":e.createToaster({placement:"bottom-end",...Uf})};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:ea,children:t.jsxs(e.Accordion.Root,{multiple:!0,value:s?void 0:[u],defaultValue:a?[u]:[],children:[t.jsxs(e.Accordion.Item,{css:na,value:u,children:[o&&t.jsx(e.Accordion.ItemTrigger,{id:h,role:"button","aria-expanded":d,tabIndex:0,css:ta,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(zt,{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($,{"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:ra,children:i})]})]}),c&&i&&t.jsx(e.Box,{css:ra,children:i})]})})},exports.Avatar=mf,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:bf,role:"status","aria-live":"polite",children:[t.jsxs("div",{css:yf(),children:[t.jsx(N,{color:"currentColor",height:"16px",width:"16px"}),!e||r||o?null:t.jsx("div",{css:wf,"aria-hidden":!0})]}),o?t.jsx("p",{children:o}):null,s.length>0?t.jsx("div",{css:kf,children:t.jsx("p",{css:$f,"aria-label":`${r} unread message`,children:s})}):null]}):t.jsxs("div",{css:bf,role:"status","aria-live":"polite",children:[o?t.jsx("p",{children:o}):null,t.jsxs("div",{css:yf(l),children:[s.length>0?t.jsx("div",{css:Cf,children:t.jsx("p",{css:jf,"aria-label":`${r} unread message`,children:s})}):null,e&&!r?t.jsx("div",{css:wf,"aria-hidden":!0}):null,t.jsx(N,{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:xn(l,c),children:t.jsxs("div",{className:"ds-base-map-scroll-content",children:[t.jsxs("div",{css:gn,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:vn,children:[i?t.jsx("div",{css:mn,children:i.map((e=>t.jsxs("div",{children:[t.jsx(ke,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?t.jsx("div",{css:bn,children:e.children}):null]},e.label)))}):null,a?t.jsx("div",{css:yn,children:a.map((e=>{return t.jsxs("div",{css:wn(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`
|
|
3536
3536
|
height: 32px;
|
|
3537
3537
|
width: 32px;
|
|
3538
3538
|
border: 1px solid ${h("neutral",300)};
|
package/dist/index.d.ts
CHANGED
|
@@ -634,6 +634,7 @@ interface AnalysisWidgetProps {
|
|
|
634
634
|
expanded?: boolean;
|
|
635
635
|
collapsible?: boolean;
|
|
636
636
|
actions?: AnalysisWidgetActionsProps[];
|
|
637
|
+
showFooterOnCollapsed?: boolean;
|
|
637
638
|
}
|
|
638
639
|
interface AnalysisWidgetActionsProps {
|
|
639
640
|
label: string;
|
|
@@ -641,7 +642,7 @@ interface AnalysisWidgetActionsProps {
|
|
|
641
642
|
icon?: React__default.ReactNode;
|
|
642
643
|
}
|
|
643
644
|
|
|
644
|
-
declare const AnalysisWidget: ({ children, header, footer, expanded, collapsible, actions, }: AnalysisWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
645
|
+
declare const AnalysisWidget: ({ children, header, footer, expanded, collapsible, actions, showFooterOnCollapsed, }: AnalysisWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
645
646
|
|
|
646
647
|
type ModalProps = {
|
|
647
648
|
header: React.ReactNode;
|
package/dist/index.esm.js
CHANGED
|
@@ -2384,7 +2384,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as i,Ic
|
|
|
2384
2384
|
}
|
|
2385
2385
|
`,_l=le`
|
|
2386
2386
|
border-top: 1px solid ${xe("neutral",300)};
|
|
2387
|
-
`,Ml=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a})=>{const
|
|
2387
|
+
`,Ml=({children:e,header:t,footer:n,expanded:i=!0,collapsible:o=!0,actions:a,showFooterOnCollapsed:l=!1})=>{const s="analysis-widget-item",[c,d]=X(i),u=`analysis-widget-header-${s}`;return Z(r,{as:"section","aria-labelledby":u,css:Ll,children:F(S.Root,{multiple:!0,value:o?void 0:[s],defaultValue:i?[s]:[],children:[F(S.Item,{css:Pl,value:s,children:[t&&Z(S.ItemTrigger,{id:u,role:"button","aria-expanded":c,tabIndex:0,css:Tl,pointerEvents:o?"auto":"none",onClick:o?()=>{d(!c)}:void 0,children:F(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,a&&a.map((e=>Z(Jn,{variant:"info-grey",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},icon:e?.icon},e.label))),o&&Z(S.ItemIndicator,{height:"16px",display:"flex",children:Z(Te,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),F("div",{className:c?"item-content-open":"item-content-closed","aria-hidden":!c,children:[e,!l&&n&&Z(r,{css:_l,children:n})]})]}),l&&n&&Z(r,{css:_l,children:n})]})})};function Dl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nl(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 jl,Vl={exports:{}},Il={},Al={exports:{}},zl={exports:{}},Hl={};var Bl,Fl,Zl,Wl,ql,Gl,Ul,Xl,Yl,Kl,Jl,Ql,es,ts={};
|
|
2388
2388
|
/** @license React v16.13.1
|
|
2389
2389
|
* react-is.development.js
|
|
2390
2390
|
*
|