@carto/ps-react-ui 2.2.2 → 2.2.3

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 CHANGED
@@ -1,4 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),E=require("@mui/material");var te={exports:{}},B={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var we;function lr(){if(we)return B;we=1;var n=P,o=Symbol.for("react.element"),f=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,b=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function C(R,d,m){var g,w={},h=null,T=null;m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),d.ref!==void 0&&(T=d.ref);for(g in d)u.call(d,g)&&!S.hasOwnProperty(g)&&(w[g]=d[g]);if(R&&R.defaultProps)for(g in d=R.defaultProps,d)w[g]===void 0&&(w[g]=d[g]);return{$$typeof:o,type:R,key:h,ref:T,props:w,_owner:b.current}}return B.Fragment=f,B.jsx=C,B.jsxs=C,B}var Y={};/**
2
10
  * @license React
3
11
  * react-jsx-runtime.development.js
4
12
  *
@@ -6,7 +14,7 @@
6
14
  *
7
15
  * This source code is licensed under the MIT license found in the
8
16
  * LICENSE file in the root directory of this source tree.
9
- */var we;function lr(){return we||(we=1,process.env.NODE_ENV!=="production"&&function(){var n=P,o=Symbol.for("react.element"),f=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),R=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),k=Symbol.iterator,j="@@iterator";function J(e){if(e===null||typeof e!="object")return null;var r=k&&e[k]||e[j];return typeof r=="function"?r:null}var I=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];Pe("error",e,t)}}function Pe(e,r,t){{var a=I.ReactDebugCurrentFrame,l=a.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var c=t.map(function(s){return String(s)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var ke=!1,Fe=!1,Ae=!1,De=!1,Ie=!1,ne;ne=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===S||Ie||e===b||e===m||e===g||De||e===T||ke||Fe||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===h||e.$$typeof===w||e.$$typeof===C||e.$$typeof===R||e.$$typeof===d||e.$$typeof===ne||e.getModuleId!==void 0))}function We(e,r,t){var a=e.displayName;if(a)return a;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function ae(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case f:return"Portal";case S:return"Profiler";case b:return"StrictMode";case m:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return ae(r)+".Consumer";case C:var t=e;return ae(t._context)+".Provider";case d:return We(e,e.render,"ForwardRef");case w:var a=e.displayName||null;return a!==null?a:F(e.type)||"Memo";case h:{var l=e,c=l._payload,s=l._init;try{return F(s(c))}catch{return null}}}return null}var D=Object.assign,M=0,oe,ie,se,ue,le,ce,fe;function de(){}de.__reactDisabledLog=!0;function Me(){{if(M===0){oe=console.log,ie=console.info,se=console.warn,ue=console.error,le=console.group,ce=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Le(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:oe}),info:D({},e,{value:ie}),warn:D({},e,{value:se}),error:D({},e,{value:ue}),group:D({},e,{value:le}),groupCollapsed:D({},e,{value:ce}),groupEnd:D({},e,{value:fe})})}M<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=I.ReactCurrentDispatcher,K;function V(e,r,t){{if(K===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);K=a&&a[1]||""}return`
17
+ */var je;function cr(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var n=P,o=Symbol.for("react.element"),f=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),R=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),k=Symbol.iterator,j="@@iterator";function J(e){if(e===null||typeof e!="object")return null;var r=k&&e[k]||e[j];return typeof r=="function"?r:null}var I=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];Pe("error",e,t)}}function Pe(e,r,t){{var a=I.ReactDebugCurrentFrame,l=a.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var c=t.map(function(s){return String(s)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var ke=!1,Fe=!1,Ae=!1,De=!1,Ie=!1,ne;ne=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===S||Ie||e===b||e===m||e===g||De||e===T||ke||Fe||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===h||e.$$typeof===w||e.$$typeof===C||e.$$typeof===R||e.$$typeof===d||e.$$typeof===ne||e.getModuleId!==void 0))}function We(e,r,t){var a=e.displayName;if(a)return a;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function ae(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case f:return"Portal";case S:return"Profiler";case b:return"StrictMode";case m:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return ae(r)+".Consumer";case C:var t=e;return ae(t._context)+".Provider";case d:return We(e,e.render,"ForwardRef");case w:var a=e.displayName||null;return a!==null?a:F(e.type)||"Memo";case h:{var l=e,c=l._payload,s=l._init;try{return F(s(c))}catch{return null}}}return null}var D=Object.assign,M=0,oe,ie,se,ue,le,ce,fe;function de(){}de.__reactDisabledLog=!0;function Me(){{if(M===0){oe=console.log,ie=console.info,se=console.warn,ue=console.error,le=console.group,ce=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Le(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:oe}),info:D({},e,{value:ie}),warn:D({},e,{value:se}),error:D({},e,{value:ue}),group:D({},e,{value:le}),groupCollapsed:D({},e,{value:ce}),groupEnd:D({},e,{value:fe})})}M<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=I.ReactCurrentDispatcher,K;function V(e,r,t){{if(K===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);K=a&&a[1]||""}return`
10
18
  `+K+e}}var X=!1,N;{var Be=typeof WeakMap=="function"?WeakMap:Map;N=new Be}function ve(e,r){if(!e||X)return"";{var t=N.get(e);if(t!==void 0)return t}var a;X=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=G.current,G.current=null,Me();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(A){a=A}Reflect.construct(e,[],s)}else{try{s.call()}catch(A){a=A}e.call(s.prototype)}}else{try{throw Error()}catch(A){a=A}e()}}catch(A){if(A&&a&&typeof A.stack=="string"){for(var i=A.stack.split(`
11
19
  `),x=a.stack.split(`
12
20
  `),v=i.length-1,p=x.length-1;v>=1&&p>=0&&i[v]!==x[p];)p--;for(;v>=1&&p>=0;v--,p--)if(i[v]!==x[p]){if(v!==1||p!==1)do if(v--,p--,p<0||i[v]!==x[p]){var O=`
@@ -16,12 +24,4 @@ Check the render method of \``+e+"`."}return""}}function rr(e){{if(e!==void 0){v
16
24
 
17
25
  Check your code at `+r+":"+t+"."}return""}}var _e={};function tr(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
18
26
 
19
- Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(_e[t])return;_e[t]=!0;var a="";e&&e._owner&&e._owner!==Q.current&&(a=" It was passed a child from "+F(e._owner.type)+"."),$(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),$(null)}}function Te(e,r){{if(typeof e!="object")return;if(H(e))for(var t=0;t<e.length;t++){var a=e[t];re(a)&&xe(a,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var l=J(e);if(typeof l=="function"&&l!==e.entries)for(var c=l.call(e),s;!(s=c.next()).done;)re(s.value)&&xe(s.value,r)}}}function nr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===w))t=r.propTypes;else return;if(t){var a=F(r);Ne(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var l=F(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){$(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),$(null);break}}e.ref!==null&&($(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}function Se(e,r,t,a,l,c){{var s=$e(e);if(!s){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=rr(l);x?i+=x:i+=Re();var v;e===null?v="null":H(e)?v="array":e!==void 0&&e.$$typeof===o?(v="<"+(F(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,i)}var p=er(e,r,t,l,c);if(p==null)return p;if(s){var O=r.children;if(O!==void 0)if(a)if(H(O)){for(var W=0;W<O.length;W++)Te(O[W],e);Object.freeze&&Object.freeze(O)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(O,e)}return e===u?ar(p):nr(p),p}}function or(e,r,t){return Se(e,r,t,!0)}function ir(e,r,t){return Se(e,r,t,!1)}var sr=ir,ur=or;B.Fragment=u,B.jsx=sr,B.jsxs=ur}()),B}var Y={};/**
20
- * @license React
21
- * react-jsx-runtime.production.min.js
22
- *
23
- * Copyright (c) Facebook, Inc. and its affiliates.
24
- *
25
- * This source code is licensed under the MIT license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */var je;function cr(){if(je)return Y;je=1;var n=P,o=Symbol.for("react.element"),f=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,b=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function C(R,d,m){var g,w={},h=null,T=null;m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),d.ref!==void 0&&(T=d.ref);for(g in d)u.call(d,g)&&!S.hasOwnProperty(g)&&(w[g]=d[g]);if(R&&R.defaultProps)for(g in d=R.defaultProps,d)w[g]===void 0&&(w[g]=d[g]);return{$$typeof:o,type:R,key:h,ref:T,props:w,_owner:b.current}}return Y.Fragment=f,Y.jsx=C,Y.jsxs=C,Y}process.env.NODE_ENV==="production"?te.exports=cr():te.exports=lr();var y=te.exports;const fr={box:{marginLeft:({spacing:n})=>n(1)}};function dr({items:n,itemsToShow:o=10,label:f,ListProps:u,texts:{showMore:b="View all",showLess:S="Collapse list"}={},unit:C,formatter:R,onRowClick:d}){const[m,g]=P.useState(!0),w=()=>{g(!m)},h=j=>R?R(j):j,T=P.useMemo(()=>{const j=m?o:n.length;return n.slice(0,j)},[n,o,m]),k=n.length>o;return y.jsxs(E.Box,{width:"100%",height:"auto",children:[f&&y.jsx(E.Typography,{variant:"caption",color:"textSecondary",gutterBottom:!0,children:f}),y.jsx(E.List,{...u,component:"ul",children:T.map(j=>y.jsxs(E.ListItemButton,{divider:!0,onClick:J=>d?.(J,j),children:[y.jsx(E.ListItemText,{primary:j.name}),y.jsx(vr,{value:h(j.value),unit:C})]},j.id))}),k&&y.jsx(E.Button,{variant:"text",color:"primary",size:"small",onClick:w,children:m?b:S})]})}function vr({value:n,unit:o}){return y.jsx(E.Box,{sx:fr.box,children:y.jsxs(E.Typography,{variant:"body2",align:"right",noWrap:!0,children:[o," ",n]})})}const pr={contentBox:{paddingBottom:2,paddingX:2}},hr=E.styled(E.Box,{shouldForwardProp:n=>n!=="scrollMarginTop"})(({scrollMarginTop:n})=>({height:"auto",scrollMarginTop:n,width:"100%"})),gr=E.styled(E.Box,{shouldForwardProp:n=>n!=="scrollMarginTop"})(({scrollMarginTop:n,theme:{spacing:o,palette:f}})=>({alignItems:"center",backgroundColor:f.grey[100],display:"flex",height:o(3),justifyContent:"center",position:"sticky",top:n,width:"100%",zIndex:1}));function yr({title:n,id:o,anchor:f=!1,scrollMarginTop:u=0,children:b,BoxProps:S}){return y.jsxs(hr,{scrollMarginTop:u,id:o,"data-anchor":f,...S,children:[y.jsx(gr,{scrollMarginTop:u,children:y.jsx(E.Typography,{variant:"caption",children:n})}),y.jsx(E.Box,{sx:pr.contentBox,children:y.jsx(y.Fragment,{children:b})})]})}const br={tabsWrapper:{backgroundColor:({palette:n})=>n.background.paper,left:0,position:"sticky",top:0,width:"100%",zIndex:2,"& .MuiTab-root:last-of-type":{marginRight:0},"& .MuiTab-textColorPrimary":{color:({palette:n})=>n.text.primary,"&.Mui-selected":{color:({palette:n})=>n.primary.main}},"& .MuiTabs-indicator.colorPrimary":{backgroundColor:({palette:n})=>n.primary.main}}};function mr({children:n,anchor:o,TabsProps:f,variant:u="standard",onChange:b}){const S=(C,R)=>{C.preventDefault(),b?.(R)};return y.jsx(E.Box,{sx:br.tabsWrapper,children:y.jsx(E.Tabs,{indicatorColor:"primary",textColor:"primary","aria-label":"Explore sections",...f,value:o,variant:u,onChange:S,children:n})})}function Oe(n){var o,f,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var b=n.length;for(o=0;o<b;o++)n[o]&&(f=Oe(n[o]))&&(u&&(u+=" "),u+=f)}else for(f in n)n[f]&&(u&&(u+=" "),u+=f);return u}function Er(){for(var n,o,f=0,u="",b=arguments.length;f<b;f++)(n=arguments[f])&&(o=Oe(n))&&(u&&(u+=" "),u+=o);return u}const Rr={box:{borderRadius:({spacing:n})=>`0 0 ${n(.5)} ${n(.5)}`,flex:1,height:"100%",margin:"0 auto",maxWidth:({breakpoints:n})=>n.values.lg,overflow:"auto",position:"relative",width:"100%"}};function _r({children:n,currentAnchor:o,BoxProps:f,className:u,timeout:b=50,onChange:S}){const C=P.useRef(null),R=P.useRef([]),d=P.useRef(0),m=P.useRef(o);P.useEffect(()=>{const h=Array.from(C.current?.querySelectorAll('[data-anchor="true"]')||[]);if(R.current=[...h].reverse(),!R.current.length)throw new Error('initialization of ScrollToAnchor: Missing sections with data-anchor="true" attribute.')},[]),P.useEffect(()=>{const h=T=>{const k=C.current?.querySelector(`#${T}`);if(!k){console.warn(`Warning: navigation of ScrollToAnchor: the section you want to navigate to does not exist. To create it add the #${T} id property to an element.`);return}if(k){k.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});const j=setInterval(()=>{k.offsetTop===d.current&&(m.current=T,clearInterval(j))},b)}};o!==m.current&&h(o)},[o,b]);const g=P.useCallback(()=>{const T=R.current.find(k=>d.current>=k.offsetTop)?.id||"";m.current!==T&&(m.current=T,S(T))},[S]),w=P.useCallback(h=>{h.stopPropagation(),d.current=h.currentTarget.scrollTop,o===m.current&&requestAnimationFrame(()=>g())},[o,g]);return y.jsx(E.Box,{ref:C,sx:Rr.box,...f,className:Er(u),"data-scroller":!0,onScroll:h=>w(h),children:n})}function xr(n){return n.map(o=>{const f=o,u=String(o);return{value:f,label:u}})}exports.ListData=dr;exports.ScrollToAnchor=_r;exports.SectionContainer=yr;exports.TabsToAnchor=mr;exports.createSelectOptionsFromArray=xr;
27
+ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(_e[t])return;_e[t]=!0;var a="";e&&e._owner&&e._owner!==Q.current&&(a=" It was passed a child from "+F(e._owner.type)+"."),$(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),$(null)}}function Te(e,r){{if(typeof e!="object")return;if(H(e))for(var t=0;t<e.length;t++){var a=e[t];re(a)&&xe(a,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var l=J(e);if(typeof l=="function"&&l!==e.entries)for(var c=l.call(e),s;!(s=c.next()).done;)re(s.value)&&xe(s.value,r)}}}function nr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===w))t=r.propTypes;else return;if(t){var a=F(r);Ne(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var l=F(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){$(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),$(null);break}}e.ref!==null&&($(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}function Se(e,r,t,a,l,c){{var s=$e(e);if(!s){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=rr(l);x?i+=x:i+=Re();var v;e===null?v="null":H(e)?v="array":e!==void 0&&e.$$typeof===o?(v="<"+(F(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,i)}var p=er(e,r,t,l,c);if(p==null)return p;if(s){var O=r.children;if(O!==void 0)if(a)if(H(O)){for(var W=0;W<O.length;W++)Te(O[W],e);Object.freeze&&Object.freeze(O)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(O,e)}return e===u?ar(p):nr(p),p}}function or(e,r,t){return Se(e,r,t,!0)}function ir(e,r,t){return Se(e,r,t,!1)}var sr=ir,ur=or;Y.Fragment=u,Y.jsx=sr,Y.jsxs=ur}()),Y}process.env.NODE_ENV==="production"?te.exports=lr():te.exports=cr();var y=te.exports;const fr={box:{marginLeft:({spacing:n})=>n(1)}};function dr({items:n,itemsToShow:o=10,label:f,ListProps:u,texts:{showMore:b="View all",showLess:S="Collapse list"}={},unit:C,formatter:R,onRowClick:d}){const[m,g]=P.useState(!0),w=()=>{g(!m)},h=j=>R?R(j):j,T=P.useMemo(()=>{const j=m?o:n.length;return n.slice(0,j)},[n,o,m]),k=n.length>o;return y.jsxs(E.Box,{width:"100%",height:"auto",children:[f&&y.jsx(E.Typography,{variant:"caption",color:"textSecondary",gutterBottom:!0,children:f}),y.jsx(E.List,{...u,component:"ul",children:T.map(j=>y.jsxs(E.ListItemButton,{divider:!0,onClick:J=>d?.(J,j),children:[y.jsx(E.ListItemText,{primary:j.name}),y.jsx(vr,{value:h(j.value),unit:C})]},j.id))}),k&&y.jsx(E.Button,{variant:"text",color:"primary",size:"small",onClick:w,children:m?b:S})]})}function vr({value:n,unit:o}){return y.jsx(E.Box,{sx:fr.box,children:y.jsxs(E.Typography,{variant:"body2",align:"right",noWrap:!0,children:[o," ",n]})})}const pr={contentBox:{paddingBottom:2,paddingX:2}},hr=E.styled(E.Box,{shouldForwardProp:n=>n!=="scrollMarginTop"})(({scrollMarginTop:n})=>({height:"auto",scrollMarginTop:n,width:"100%"})),gr=E.styled(E.Box,{shouldForwardProp:n=>n!=="scrollMarginTop"})(({scrollMarginTop:n,theme:{spacing:o,palette:f}})=>({alignItems:"center",backgroundColor:f.grey[100],display:"flex",height:o(3),justifyContent:"center",position:"sticky",top:n,width:"100%",zIndex:1}));function yr({title:n,id:o,anchor:f=!1,scrollMarginTop:u=0,children:b,BoxProps:S}){return y.jsxs(hr,{scrollMarginTop:u,id:o,"data-anchor":f,...S,children:[y.jsx(gr,{scrollMarginTop:u,children:y.jsx(E.Typography,{variant:"caption",children:n})}),y.jsx(E.Box,{sx:pr.contentBox,children:y.jsx(y.Fragment,{children:b})})]})}const br={tabsWrapper:{backgroundColor:({palette:n})=>n.background.paper,left:0,position:"sticky",top:0,width:"100%",zIndex:2,"& .MuiTab-root:last-of-type":{marginRight:0},"& .MuiTab-textColorPrimary":{color:({palette:n})=>n.text.primary,"&.Mui-selected":{color:({palette:n})=>n.primary.main}},"& .MuiTabs-indicator.colorPrimary":{backgroundColor:({palette:n})=>n.primary.main}}};function mr({children:n,anchor:o,TabsProps:f,variant:u="standard",onChange:b}){const S=(C,R)=>{C.preventDefault(),b?.(R)};return y.jsx(E.Box,{sx:br.tabsWrapper,children:y.jsx(E.Tabs,{indicatorColor:"primary",textColor:"primary","aria-label":"Explore sections",...f,value:o,variant:u,onChange:S,children:n})})}function Oe(n){var o,f,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var b=n.length;for(o=0;o<b;o++)n[o]&&(f=Oe(n[o]))&&(u&&(u+=" "),u+=f)}else for(f in n)n[f]&&(u&&(u+=" "),u+=f);return u}function Er(){for(var n,o,f=0,u="",b=arguments.length;f<b;f++)(n=arguments[f])&&(o=Oe(n))&&(u&&(u+=" "),u+=o);return u}const Rr={box:{borderRadius:({spacing:n})=>`0 0 ${n(.5)} ${n(.5)}`,flex:1,height:"100%",margin:"0 auto",maxWidth:({breakpoints:n})=>n.values.lg,overflow:"auto",position:"relative",width:"100%"}};function _r({children:n,currentAnchor:o,BoxProps:f,className:u,timeout:b=50,onChange:S}){const C=P.useRef(null),R=P.useRef([]),d=P.useRef(0),m=P.useRef(o);P.useEffect(()=>{const h=Array.from(C.current?.querySelectorAll('[data-anchor="true"]')||[]);if(R.current=[...h].reverse(),!R.current.length)throw new Error('initialization of ScrollToAnchor: Missing sections with data-anchor="true" attribute.')},[]),P.useEffect(()=>{const h=T=>{const k=C.current?.querySelector(`#${T}`);if(!k){console.warn(`Warning: navigation of ScrollToAnchor: the section you want to navigate to does not exist. To create it add the #${T} id property to an element.`);return}if(k){k.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});const j=setInterval(()=>{k.offsetTop===d.current&&(m.current=T,clearInterval(j))},b)}};o!==m.current&&h(o)},[o,b]);const g=P.useCallback(()=>{const T=R.current.find(k=>d.current>=k.offsetTop)?.id||"";m.current!==T&&(m.current=T,S(T))},[S]),w=P.useCallback(h=>{h.stopPropagation(),d.current=h.currentTarget.scrollTop,o===m.current&&requestAnimationFrame(()=>g())},[o,g]);return y.jsx(E.Box,{ref:C,sx:Rr.box,...f,className:Er(u),"data-scroller":!0,onScroll:h=>w(h),children:n})}function xr(n){return n.map(o=>{const f=o,u=String(o);return{value:f,label:u}})}exports.ListData=dr;exports.ScrollToAnchor=_r;exports.SectionContainer=yr;exports.TabsToAnchor=mr;exports.createSelectOptionsFromArray=xr;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { Box as D, Typography as ne, List as gr, ListItemButton as yr, ListItemT
3
3
  var te = { exports: {} }, L = {};
4
4
  /**
5
5
  * @license React
6
- * react-jsx-runtime.development.js
6
+ * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
@@ -12,7 +12,35 @@ var te = { exports: {} }, L = {};
12
12
  */
13
13
  var Pe;
14
14
  function Rr() {
15
- return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
15
+ if (Pe)
16
+ return L;
17
+ Pe = 1;
18
+ var n = Fe, o = Symbol.for("react.element"), f = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, m = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function C(E, d, b) {
20
+ var g, S = {}, h = null, x = null;
21
+ b !== void 0 && (h = "" + b), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (x = d.ref);
22
+ for (g in d)
23
+ u.call(d, g) && !T.hasOwnProperty(g) && (S[g] = d[g]);
24
+ if (E && E.defaultProps)
25
+ for (g in d = E.defaultProps, d)
26
+ S[g] === void 0 && (S[g] = d[g]);
27
+ return { $$typeof: o, type: E, key: h, ref: x, props: S, _owner: m.current };
28
+ }
29
+ return L.Fragment = f, L.jsx = C, L.jsxs = C, L;
30
+ }
31
+ var Y = {};
32
+ /**
33
+ * @license React
34
+ * react-jsx-runtime.development.js
35
+ *
36
+ * Copyright (c) Facebook, Inc. and its affiliates.
37
+ *
38
+ * This source code is licensed under the MIT license found in the
39
+ * LICENSE file in the root directory of this source tree.
40
+ */
41
+ var ke;
42
+ function _r() {
43
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
16
44
  var n = Fe, o = Symbol.for("react.element"), f = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), E = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), O = Symbol.iterator, w = "@@iterator";
17
45
  function J(e) {
18
46
  if (e === null || typeof e != "object")
@@ -594,38 +622,10 @@ Check the top-level render call using <` + t + ">.");
594
622
  return Se(e, r, t, !1);
595
623
  }
596
624
  var dr = fr, vr = cr;
597
- L.Fragment = u, L.jsx = dr, L.jsxs = vr;
598
- }()), L;
599
- }
600
- var Y = {};
601
- /**
602
- * @license React
603
- * react-jsx-runtime.production.min.js
604
- *
605
- * Copyright (c) Facebook, Inc. and its affiliates.
606
- *
607
- * This source code is licensed under the MIT license found in the
608
- * LICENSE file in the root directory of this source tree.
609
- */
610
- var ke;
611
- function _r() {
612
- if (ke)
613
- return Y;
614
- ke = 1;
615
- var n = Fe, o = Symbol.for("react.element"), f = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, m = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
616
- function C(E, d, b) {
617
- var g, S = {}, h = null, x = null;
618
- b !== void 0 && (h = "" + b), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (x = d.ref);
619
- for (g in d)
620
- u.call(d, g) && !T.hasOwnProperty(g) && (S[g] = d[g]);
621
- if (E && E.defaultProps)
622
- for (g in d = E.defaultProps, d)
623
- S[g] === void 0 && (S[g] = d[g]);
624
- return { $$typeof: o, type: E, key: h, ref: x, props: S, _owner: m.current };
625
- }
626
- return Y.Fragment = f, Y.jsx = C, Y.jsxs = C, Y;
625
+ Y.Fragment = u, Y.jsx = dr, Y.jsxs = vr;
626
+ }()), Y;
627
627
  }
628
- process.env.NODE_ENV === "production" ? te.exports = _r() : te.exports = Rr();
628
+ process.env.NODE_ENV === "production" ? te.exports = Rr() : te.exports = _r();
629
629
  var y = te.exports;
630
630
  const xr = {
631
631
  box: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "CARTO's Professional Service React UI library",
5
5
  "files": [
6
6
  "dist"
@@ -31,22 +31,12 @@
31
31
  "dependencies": {
32
32
  "@emotion/react": "11.11.3",
33
33
  "@emotion/styled": "11.11.0",
34
- "@mui/icons-material": "5.15.3",
35
- "@mui/lab": "5.0.0-alpha.159",
36
- "@mui/material": "5.15.3"
34
+ "@mui/icons-material": "5.15.9",
35
+ "@mui/lab": "5.0.0-alpha.165",
36
+ "@mui/material": "5.15.9"
37
37
  },
38
38
  "devDependencies": {
39
- "@carto/react-ui": "2.3.6",
40
- "@storybook/addon-actions": "7.6.7",
41
- "@storybook/addon-essentials": "7.6.7",
42
- "@storybook/addon-interactions": "7.6.7",
43
- "@storybook/addon-links": "7.6.7",
44
- "@storybook/blocks": "7.6.7",
45
- "@storybook/builder-vite": "7.6.7",
46
- "@storybook/react": "7.6.7",
47
- "@storybook/react-vite": "7.6.7",
48
- "@storybook/testing-library": "0.2.2",
49
- "storybook": "7.6.7"
39
+ "@carto/react-ui": "2.3.10"
50
40
  },
51
41
  "peerDependencies": {
52
42
  "@emotion/react": "11.x",