@tmf_ciclica/ciclicastorybook 1.2.135 → 1.2.137

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
@@ -84,4 +84,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
84
84
  <strong>${E(ne.key)}</strong><br/>
85
85
  ${ne.xKey}<br/>
86
86
  ${y(Ce)}
87
- `),ce.select(this).style("opacity",.8),f&&f(q,{key:ne.key,value:Ce,data:ne.data})}).on("mousemove",function(q){x&&se&&se.style("top",q.pageY-10+"px").style("left",q.pageX+10+"px")}).on("mouseout",function(){x&&se&&se.style("visibility","hidden"),ce.select(this).style("opacity",1)}),C&&Ye.on("click",function(q,ne){const Ce=ne.value;C(q,{key:ne.key,value:Ce,data:ne.data})}),ee&&ee.length>1){const q=ce.line().x(ne=>ne.x).y(ne=>ne.y).curve(ce.curveMonotoneX);le.append("path").datum(ee).attr("class","line").attr("d",q).attr("fill","none").attr("stroke","#ff6b6b").attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round"),le.selectAll(".line-point").data(ee).enter().append("circle").attr("class","line-point").attr("cx",ne=>ne.x).attr("cy",ne=>ne.y).attr("r",4).attr("fill","#ff6b6b").attr("stroke","white").attr("stroke-width",1)}return()=>{se&&se.remove()}},[e,t,n,r,P,a,m,u,d,h,g,y,v,f,C,w,T,j,b,x,S,A]),l.jsx("div",{ref:z,className:`${gs.svgContainer} ${c}`,style:{width:o,height:i+a.top+a.bottom,overflowX:"auto"},children:l.jsx("svg",{ref:O,className:gs.svg})})};Vi.propTypes={data:s.arrayOf(s.object).isRequired,keys:s.arrayOf(s.string).isRequired,colors:s.oneOfType([s.arrayOf(s.string),s.object]),lineData:s.arrayOf(s.number),width:s.oneOfType([s.string,s.number]),height:s.number,margin:s.shape({top:s.number,right:s.number,bottom:s.number,left:s.number}),className:s.string,showXAxisLabels:s.bool,showYAxisLabels:s.bool,showGrid:s.bool,xAxisTickRotation:s.number,yAxisTickFormat:s.func,barPadding:s.number,animationDuration:s.number,onBarHover:s.func,onBarClick:s.func,title:s.string,xAxisLabel:s.string,yAxisLabel:s.string,stackOrder:s.oneOf(["reverse","ascending","descending","insideOut","none"]),showTooltip:s.bool,reverseKeys:s.bool,minBarSlotWidth:s.number,wrapXAxisLabels:s.bool};const Ef="_externalContainer_1er0i_2",Nf="_externalSintetic_1er0i_9",Of="_titles_1er0i_13",Af="_titleContainer_1er0i_22",Lf="_yearTitles_1er0i_36",Mf="_yearTitle_1er0i_36",Rf="_yearDatas_1er0i_50",Df="_yearDataContainer_1er0i_58",If="_yearDataContent_1er0i_66",Pf="_bigNumber_1er0i_79",Bf="_circle_1er0i_82",Vf="_totalContainer_1er0i_99",Ff="_total_1er0i_99",De={externalContainer:Ef,externalSintetic:Nf,titles:Of,titleContainer:Af,yearTitles:Lf,yearTitle:Mf,yearDatas:Rf,yearDataContainer:Df,yearDataContent:If,bigNumber:Pf,circle:Bf,totalContainer:Vf,total:Ff},zf=e=>{if(e>=1e3||e<=-1e3)return parseInt(e.toFixed());if(e>=100||e<=-100)return parseFloat(e.toFixed(1));if(e>=10||e<=-10)return parseFloat(e.toFixed(2));if(e>0||e<0)return parseFloat(e.toFixed(3));if(e===0)return e},qf=(e,t)=>{let n=0;return t.forEach(r=>{r[e]&&(n+=r[e])}),n},Fi=({data:e,keys:t,colors:n,locales:r,total:o=!1,years:i=!1,activeGraphics:a="ind",units:c={},translate:u,getTotal:d=qf,columnWidth:h=50})=>{const g=u||(m=>m),y=m=>m==="demanda_red"||m==="reduccio_demanda_red"?(c.demanda||"").replace("(","").replace(")",""):c[m]||"";return l.jsxs("div",{className:`${De.externalContainer} ${a==="sin"?De.externalSintetic:""}`,children:[i===!0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{}),l.jsx("div",{className:De.yearTitles,children:e.map((m,v)=>l.jsx("div",{className:De.yearTitle,style:{width:h},children:m.anyo},v))})]}),l.jsx("div",{className:De.titles,children:t.map((m,v)=>l.jsxs("div",{className:De.titleContainer,children:[g(r[m]),a!=="sin"&&l.jsx("span",{className:De.circle,style:{background:n[m]}})]},v))}),o===!0&&l.jsx("div",{className:De.totalContainer,children:t.map((m,v)=>{var f;return l.jsxs("div",{className:`${De.total} ${d(m,e)>9999||d(m,e)<-9999?De.bigNumber:""}`,children:[(f=d(m,e))==null?void 0:f.toLocaleString("es-ES")," ",y(m)]},v)})}),l.jsx("div",{className:De.yearDatas,children:e.map((m,v)=>l.jsx("div",{className:De.yearDataContainer,style:{width:h},children:t.map((f,C)=>{var w,T;return isNaN(m[f])?null:l.jsx("div",{className:`${De.yearDataContent} ${m[f]>9999||m[f]<-9999?De.bigNumber:""}`,children:m[f]<1e4||m[f]>-1e4?(w=zf(m[f]))==null?void 0:w.toLocaleString("es-ES"):(T=m[f])==null?void 0:T.toLocaleString("es-ES")},C)})},v))})]})};Fi.propTypes={data:s.arrayOf(s.shape({anyo:s.oneOfType([s.string,s.number]).isRequired})).isRequired,keys:s.arrayOf(s.string).isRequired,colors:s.objectOf(s.string).isRequired,locales:s.objectOf(s.string).isRequired,total:s.bool,years:s.bool,activeGraphics:s.oneOf(["ind","sin"]),units:s.objectOf(s.string),translate:s.func,getTotal:s.func,columnWidth:s.number};const Wf="_speedGraphic_d1k72_2",Cr={speedGraphic:Wf},zi=({minValue:e=0,maxValue:t=100,value:n=50,title:r=!1,percent:o=!1,unit:i=!1,greenColor:a="#00CF1E",orangeColor:c="#FFAC00",redColor:u="#FF1E37"})=>{n<e&&(n=e),n>t&&(n=t);const d=(n-e)/(t-e),h=270+d*180,g=o?Math.round(d*100):n;return l.jsxs("div",{className:Cr.speedGraphic,children:[l.jsxs("svg",{width:"244",height:"130",viewBox:"0 0 244 130",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M0 122C0 111.944 1.2433 101.927 3.70162 92.1756L26.2619 97.8633C24.2724 105.755 23.2662 113.862 23.2662 122H0Z",fill:a}),l.jsx("path",{d:"M16.3442 61.0012C21.3714 52.2936 27.4557 44.2409 34.4588 37.0263L51.1534 53.2313C45.4859 59.0701 40.5619 65.5871 36.4934 72.6341L16.3442 61.0012Z",fill:a}),l.jsx("path",{d:"M60.9088 16.3976C69.6119 11.3628 78.9041 7.42322 88.5739 4.66843L94.9485 27.0443C87.1228 29.2737 79.6027 32.462 72.5592 36.5367L60.9088 16.3976Z",fill:c}),l.jsx("path",{d:"M121.797 0.000169508C131.851 -0.0165912 141.869 1.20965 151.623 3.65101L145.974 26.2209C138.08 24.2451 129.972 23.2527 121.835 23.2663L121.797 0.000169508Z",fill:c}),l.jsx("path",{d:"M182.623 16.1279C191.348 21.124 199.422 27.1797 206.662 34.157L190.516 50.9092C184.657 45.2625 178.123 40.3617 171.061 36.3183L182.623 16.1279Z",fill:u}),l.jsx("path",{d:"M227.238 60.2836C232.325 68.9568 236.319 78.2255 239.131 87.8788L216.794 94.3859C214.518 86.5735 211.285 79.0725 207.169 72.0533L227.238 60.2836Z",fill:u}),l.jsx("path",{d:"M4.15505 90.4316C6.75674 80.7194 10.5491 71.3662 15.4458 62.5846L35.7663 73.9155C31.8035 81.0224 28.7343 88.5919 26.6288 96.4519L4.15505 90.4316Z",fill:a}),l.jsx("path",{d:"M35.733 35.733C42.8426 28.6233 50.8039 22.4198 59.4357 17.2636L71.3671 37.2375C64.3814 41.4104 57.9384 46.4308 52.1846 52.1846L35.733 35.733Z",fill:a}),l.jsx("path",{d:"M90.3004 4.19027C100.01 1.57776 110.005 0.175523 120.058 0.0154601L120.428 23.2787C112.292 23.4082 104.203 24.543 96.3457 26.6573L90.3004 4.19027Z",fill:c}),l.jsx("path",{d:"M153.423 4.11614C163.138 6.70584 172.496 10.4866 181.284 15.3725L169.978 35.707C162.866 31.7529 155.293 28.6932 147.43 26.5973L153.423 4.11614Z",fill:c}),l.jsx("path",{d:"M239.602 89.538C242.532 100.152 244.011 111.114 244 122.125L220.734 122.101C220.743 113.19 219.546 104.319 217.175 95.7287L239.602 89.538Z",fill:u}),l.jsx("path",{d:"M207.769 35.2376C214.919 42.3062 221.168 50.2316 226.374 58.8336L206.469 70.8798C202.256 63.9183 197.199 57.5043 191.412 51.7837L207.769 35.2376Z",fill:u}),l.jsx("g",{transform:`rotate(${h} 122 122)`,children:l.jsx("path",{id:"aguja",d:"M121 119.5V33",stroke:"#605B56","stroke-width":"2"})})]}),l.jsxs("div",{className:Cr.value,children:[g,o&&"%",i&&i]}),r&&l.jsx("div",{className:Cr.title,children:r})]})};zi.propTypes={minValue:s.number.isRequired,maxValue:s.number.isRequired,value:s.number.isRequired,percent:s.bool,title:s.string,unit:s.string,greenColor:s.string,orangeColor:s.string,redColor:s.string};const _r="#ffffff",Uf="#ffffff";function st(e,t,n,r){const o=(r-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function ys(e,t,n,r,o,i){if(Math.abs(i-o)>=359.99)return n===0?`M ${e-r} ${t} A ${r} ${r} 0 1 1 ${e+r} ${t} A ${r} ${r} 0 1 1 ${e-r} ${t} Z`:[`M ${e-r} ${t} A ${r} ${r} 0 1 1 ${e+r} ${t} A ${r} ${r} 0 1 1 ${e-r} ${t} Z`,`M ${e-n} ${t} A ${n} ${n} 0 1 0 ${e+n} ${t} A ${n} ${n} 0 1 0 ${e-n} ${t} Z`].join(" ");const a=st(e,t,r,o),c=st(e,t,r,i),u=i-o>180?1:0;if(n===0)return`M ${e} ${t} L ${a.x} ${a.y} A ${r} ${r} 0 ${u} 1 ${c.x} ${c.y} Z`;const d=st(e,t,n,i),h=st(e,t,n,o);return[`M ${a.x} ${a.y}`,`A ${r} ${r} 0 ${u} 1 ${c.x} ${c.y}`,`L ${d.x} ${d.y}`,`A ${n} ${n} 0 ${u} 0 ${h.x} ${h.y}`,"Z"].join(" ")}function Zf(e){const t=e.reduce((r,o)=>r+(o.value||0),0);let n=0;return e.map(r=>{const o=r.value/t*360,i=n;return n+=o,{...r,sa:i,ea:n}})}function bs(e,t,n,r,o){const i=n+(r-n)/2,a=st(e,t,o,i);return{tx:a.x-e,ty:a.y-t}}const qi=({type:e="cheese",data:t=[],title:n,size:r=260,donutThickness:o=56,gapWidth:i=3,gapColor:a,backgroundColor:c="transparent",fontColor:u="black",fontColorInside:d="white",containerStyles:h={},alignLeft:g=!1})=>{const[y,m]=_.useState(null),v=r/2,f=r/2,C=r/2-14,w=e==="donut"?C-o:0,T=e==="donut"?C-o/2:C*.62,j=_.useMemo(()=>Zf(t),[t]),b=y!==null?j[y]:null,x=j.some($=>$.ea-$.sa>=359.99),S=a||(c==="transparent"?Uf:c);return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"4px",padding:"0px",background:c,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",...h},children:[l.jsxs("div",{style:{minHeight:"40px",display:"flex",flexDirection:"column",gap:"2px"},children:[n&&l.jsx("h2",{style:{margin:0,color:u,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.5px"},children:n}),l.jsx("div",{style:{height:"22px",display:"flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",opacity:b?1:0},children:b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",background:b.color||_r,flexShrink:0}}),l.jsxs("span",{style:{color:u,fontSize:"14px",fontWeight:"600"},children:[b.title," — ",b.value,"%"]})]})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g?"flex-start":"center",gap:"16px"},children:[l.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,style:{overflow:"visible"},children:[j.map(($,A)=>{const O=y===A,{tx:z,ty:P}=O&&!x?bs(v,f,$.sa,$.ea,10):{tx:0,ty:0};return l.jsx("g",{transform:`translate(${z}, ${P})`,style:{transition:"transform 0.18s ease",pointerEvents:"none"},children:l.jsx("path",{d:ys(v,f,w,C,$.sa,$.ea),fill:$.color||_r,style:{filter:O?"brightness(1.25)":"brightness(1)",transition:"filter 0.18s ease"}})},A)}),!x&&j.map(($,A)=>{const O=st(v,f,C,$.sa),z=e==="cheese"?v:st(v,f,w,$.sa).x,P=e==="cheese"?f:st(v,f,w,$.sa).y;return l.jsx("line",{x1:z,y1:P,x2:O.x,y2:O.y,stroke:S,strokeWidth:i,strokeLinecap:"butt",style:{pointerEvents:"none"}},`gap-${A}`)}),j.map(($,A)=>{if($.ea-$.sa<20)return null;const O=y===A,{tx:z,ty:P}=O&&!x?bs(v,f,$.sa,$.ea,10):{tx:0,ty:0},p=$.sa+($.ea-$.sa)/2,E=st(v,f,T,p);return l.jsxs("text",{x:E.x+z,y:E.y+P,textAnchor:"middle",dominantBaseline:"middle",fill:d,fontSize:"14",fontWeight:"700",fontFamily:"'Segoe UI', sans-serif",pointerEvents:"none",style:{transition:"x 0.18s ease, y 0.18s ease"},children:[$.value,"%"]},`lbl-${A}`)}),j.map(($,A)=>l.jsx("path",{d:ys(v,f,w,C,$.sa,$.ea),fill:"transparent",style:{cursor:"pointer"},onMouseEnter:()=>m(A),onMouseLeave:()=>m(null)},`hit-${A}`))]}),l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px 24px",justifyContent:g?"flex-start":"center"},children:t.map(($,A)=>l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:y===null||y===A?1:.4,transition:"opacity 0.15s"},onMouseEnter:()=>m(A),onMouseLeave:()=>m(null),children:[l.jsx("span",{style:{width:"32px",height:"14px",borderRadius:"3px",background:$.color||_r,flexShrink:0}}),l.jsx("span",{style:{color:u,fontSize:"13px",fontWeight:"400"},children:$.title})]},A))})]})]})};qi.propTypes={type:s.oneOf(["cheese","donut"]),data:s.arrayOf(s.shape({value:s.number.isRequired,title:s.string.isRequired,color:s.string})).isRequired,title:s.string,size:s.number,donutThickness:s.number,gapWidth:s.number,gapColor:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,containerStyles:s.object,alignLeft:s.bool};const vs=["#a8d8cf","#3bbfa0","#5dd4b8","#7ed4c2","#2aa88a"],Wi=({data:e=[],title:t,backgroundColor:n="#0d3d4a",fontColor:r="#ffffff",barHeight:o=52,animated:i=!0,borderRadius:a,containerStyles:c={},fontColorInside:u="white",borderFontColorInside:d,borderFontColorInsideWidth:h=1})=>{const[g,y]=_.useState(i?0:1);_.useEffect(()=>{if(!i)return;const f=requestAnimationFrame(()=>y(1));return()=>cancelAnimationFrame(f)},[i]);const m=Math.max(...e.map(f=>f.value),1),v=a??"6px";return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"0px",background:n,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",minWidth:"420px",...c},children:[t&&l.jsx("h2",{style:{margin:"0 0 20px 0",color:r,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.4px"},children:t}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"18px"},children:e.map((f,C)=>{const w=f.color||vs[C%vs.length],T=f.value/m*100*g;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsx("span",{style:{color:r,fontSize:"14px",fontWeight:"400",opacity:.9},children:f.title}),l.jsxs("div",{style:{position:"relative",height:`${o}px`,background:"transparent",borderRadius:v,overflow:"hidden"},children:[l.jsx("div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${T}%`,background:w,borderRadius:v,transition:i?"width 0.8s cubic-bezier(0.16, 1, 0.3, 1)":"none"}}),l.jsx("span",{style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:u||n,fontSize:"18px",fontWeight:"700",pointerEvents:"none",letterSpacing:"-0.3px",...d?{WebkitTextStroke:`${h}px ${d}`,paintOrder:"stroke fill"}:{}},children:f.value})]})]},C)})})]})};Wi.propTypes={data:s.arrayOf(s.shape({title:s.string.isRequired,value:s.number.isRequired,color:s.string})),title:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,borderFontColorInside:s.string,barHeight:s.number,animated:s.bool,borderRadius:s.oneOfType([s.string,s.number]),containerStyles:s.object};const xs=["#a8d8cf","#3bbfa0","#5dd4b8","#7ed4c2","#2aa88a"],Ui=({data:e=[],title:t,backgroundColor:n="black",fontColor:r="#ffffff",fontColorInside:o="#0d3d4a",borderFontColorInside:i,barWidth:a=52,maxBarHeight:c=200,animated:u=!0,separatorColor:d,containerStyles:h={}})=>{const[g,y]=_.useState(u?0:1);_.useEffect(()=>{if(!u)return;const T=requestAnimationFrame(()=>requestAnimationFrame(()=>y(1)));return()=>cancelAnimationFrame(T)},[u]);const m=Math.max(...e.map(T=>T.value),1),v=d||(r==="#ffffff"?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.15)"),f=12,C=e.length*a+Math.max(0,e.length-1)*f,w={fontSize:"15px",fontWeight:"700",letterSpacing:"-0.3px",lineHeight:1,pointerEvents:"none",whiteSpace:"nowrap",...i?{WebkitTextStroke:`1px ${i}`,paintOrder:"stroke fill"}:{}};return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"0",background:n,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",...h},children:[t&&l.jsx("h2",{style:{margin:"0 0 24px 0",color:r,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.4px"},children:t}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:`${f}px`,width:`${C}px`,height:`${c}px`},children:e.map((T,j)=>{const b=T.color||xs[j%xs.length],x=T.value===0,S=x?0:T.value/m*c*g;return l.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",width:`${a}px`,height:"100%"},children:x?l.jsx("span",{style:{...w,color:o,marginBottom:"6px"},children:T.value}):l.jsx("div",{style:{position:"relative",width:"100%",height:`${S}px`,background:b,borderRadius:"6px 6px 0 0",transition:u?"height 0.85s cubic-bezier(0.16, 1, 0.3, 1)":"none",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"10px"},children:l.jsx("span",{style:{...w,color:o},children:T.value})})},j)})}),l.jsx("div",{style:{width:`${C+24}px`,marginLeft:"-12px",height:"1.5px",background:v,borderRadius:"1px"}}),l.jsx("div",{style:{display:"flex",gap:`${f}px`,width:`${C}px`,marginTop:"10px"},children:e.map((T,j)=>l.jsx("div",{style:{width:`${a}px`,textAlign:"center",color:r,fontSize:"13px",fontWeight:"400",opacity:.8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:T.title},j))})]})]})};Ui.propTypes={data:s.arrayOf(s.shape({title:s.string.isRequired,value:s.number.isRequired,color:s.string})).isRequired,title:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,borderFontColorInside:s.string,barWidth:s.number,maxBarHeight:s.number,animated:s.bool,separatorColor:s.string,containerStyles:s.object};const Hf="_header_13kbt_2",Kf="_leftComponents_13kbt_13",Gf="_centerComponents_13kbt_14",Yf="_rightComponents_13kbt_15",Xf="_componentsContainer_13kbt_32",Ct={header:Hf,leftComponents:Kf,centerComponents:Gf,rightComponents:Yf,componentsContainer:Xf},Zi=({cssProps:e,leftComponents:t=[],centerComponents:n=[],rightComponents:r=[],zIndex:o=10,height:i=60,backgroundColor:a="#605B56",isFooter:c=!1})=>l.jsxs("div",{className:Ct.header,style:{...e,zIndex:o,height:i,backgroundColor:a,top:c?"auto":0,bottom:c?0:"auto"},children:[l.jsx("div",{className:Ct.leftComponents,children:t.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))}),l.jsx("div",{className:Ct.centerComponents,children:n.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))}),l.jsx("div",{className:Ct.rightComponents,children:r.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))})]});Zi.propTypes={leftComponents:s.arrayOf(s.node),centerComponents:s.arrayOf(s.node),rightComponents:s.arrayOf(s.node),cssProps:s.object,zIndex:s.number,height:s.number,backgroundColor:s.string,isFooter:s.bool};const Qf="_sidebar_1kaqu_2",Jf="_open_1kaqu_16",ep="_content_1kaqu_20",tp="_closeButton_1kaqu_25",Nn={sidebar:Qf,open:Jf,content:ep,closeButton:tp},np="data:image/svg+xml,%3csvg%20width='19'%20height='19'%20viewBox='0%200%2019%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%203699'%3e%3cpath%20id='Vector%20223'%20d='M1%201L18.1566%2018.1566'%20stroke='%23605B56'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%20224'%20d='M18.1575%201L1.00083%2018.1566'%20stroke='%23605B56'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e",Hi=({width:e="300px",children:t,showRightBar:n,onCloseBar:r})=>{const o=()=>{r()};return l.jsx("div",{className:`${Nn.sidebar} ${n?Nn.open:""}`,style:{width:n?e:0},children:n&&l.jsxs("div",{className:Nn.content,children:[l.jsx("button",{className:Nn.closeButton,onClick:o,children:l.jsx("img",{src:np,alt:"Close Sidebar"})}),t]})})};Hi.propTypes={width:s.string,children:s.node,showRightBar:s.bool,onCloseBar:s.func};exports.AmbitSelector=$s;exports.BarChart=Br;exports.BurgerMenu=Jr;exports.ButtonsBar=Di;exports.ButtonsList=Es;exports.CategorySelector=Rr;exports.DropdownList=mt;exports.EditAmbit=el;exports.ErrorMessage=Ut;exports.FiltersAmbit=Ds;exports.Form=Pd;exports.GeneralButton=an;exports.Graphic=Is;exports.GraphicLegend=Fi;exports.Groupedbarchart=Bi;exports.HeaderSection=Zi;exports.HorizontalBarChart=Wi;exports.IndicatorsList=Vs;exports.LangSelector=Fs;exports.Legend=zs;exports.ListSelector=ki;exports.Loader=Pi;exports.LogInButton=Si;exports.LogoApp=qs;exports.MapboxMap=Gs;exports.MaplibreMap=Ys;exports.ModalAlert=Ri;exports.PieChart=qi;exports.RadioButtonInput=Mi;exports.RankingSlider=Yr;exports.RightSidebar=Hi;exports.SectionBar=Xs;exports.SelectInput=Li;exports.SpeedGraphic=zi;exports.Stackedbarchart=Vi;exports.StatusText=Qr;exports.Steps=Xr;exports.Switch=Ii;exports.TextInput=Mr;exports.TimeSlider=_i;exports.Tooltip=Je;exports.TopNavMenu=wi;exports.VerticalBarChart=Ui;
87
+ `),ce.select(this).style("opacity",.8),f&&f(q,{key:ne.key,value:Ce,data:ne.data})}).on("mousemove",function(q){x&&se&&se.style("top",q.pageY-10+"px").style("left",q.pageX+10+"px")}).on("mouseout",function(){x&&se&&se.style("visibility","hidden"),ce.select(this).style("opacity",1)}),C&&Ye.on("click",function(q,ne){const Ce=ne.value;C(q,{key:ne.key,value:Ce,data:ne.data})}),ee&&ee.length>1){const q=ce.line().x(ne=>ne.x).y(ne=>ne.y).curve(ce.curveMonotoneX);le.append("path").datum(ee).attr("class","line").attr("d",q).attr("fill","none").attr("stroke","#ff6b6b").attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round"),le.selectAll(".line-point").data(ee).enter().append("circle").attr("class","line-point").attr("cx",ne=>ne.x).attr("cy",ne=>ne.y).attr("r",4).attr("fill","#ff6b6b").attr("stroke","white").attr("stroke-width",1)}return()=>{se&&se.remove()}},[e,t,n,r,P,a,m,u,d,h,g,y,v,f,C,w,T,j,b,x,S,A]),l.jsx("div",{ref:z,className:`${gs.svgContainer} ${c}`,style:{width:o,height:i+a.top+a.bottom,overflowX:"auto"},children:l.jsx("svg",{ref:O,className:gs.svg})})};Vi.propTypes={data:s.arrayOf(s.object).isRequired,keys:s.arrayOf(s.string).isRequired,colors:s.oneOfType([s.arrayOf(s.string),s.object]),lineData:s.arrayOf(s.number),width:s.oneOfType([s.string,s.number]),height:s.number,margin:s.shape({top:s.number,right:s.number,bottom:s.number,left:s.number}),className:s.string,showXAxisLabels:s.bool,showYAxisLabels:s.bool,showGrid:s.bool,xAxisTickRotation:s.number,yAxisTickFormat:s.func,barPadding:s.number,animationDuration:s.number,onBarHover:s.func,onBarClick:s.func,title:s.string,xAxisLabel:s.string,yAxisLabel:s.string,stackOrder:s.oneOf(["reverse","ascending","descending","insideOut","none"]),showTooltip:s.bool,reverseKeys:s.bool,minBarSlotWidth:s.number,wrapXAxisLabels:s.bool};const Ef="_externalContainer_1er0i_2",Nf="_externalSintetic_1er0i_9",Of="_titles_1er0i_13",Af="_titleContainer_1er0i_22",Lf="_yearTitles_1er0i_36",Mf="_yearTitle_1er0i_36",Rf="_yearDatas_1er0i_50",Df="_yearDataContainer_1er0i_58",If="_yearDataContent_1er0i_66",Pf="_bigNumber_1er0i_79",Bf="_circle_1er0i_82",Vf="_totalContainer_1er0i_99",Ff="_total_1er0i_99",De={externalContainer:Ef,externalSintetic:Nf,titles:Of,titleContainer:Af,yearTitles:Lf,yearTitle:Mf,yearDatas:Rf,yearDataContainer:Df,yearDataContent:If,bigNumber:Pf,circle:Bf,totalContainer:Vf,total:Ff},zf=e=>{if(e>=1e3||e<=-1e3)return parseInt(e.toFixed());if(e>=100||e<=-100)return parseFloat(e.toFixed(1));if(e>=10||e<=-10)return parseFloat(e.toFixed(2));if(e>0||e<0)return parseFloat(e.toFixed(3));if(e===0)return e},qf=(e,t)=>{let n=0;return t.forEach(r=>{r[e]&&(n+=r[e])}),n},Fi=({data:e,keys:t,colors:n,locales:r,total:o=!1,years:i=!1,activeGraphics:a="ind",units:c={},translate:u,getTotal:d=qf,columnWidth:h=50})=>{const g=u||(m=>m),y=m=>m==="demanda_red"||m==="reduccio_demanda_red"?(c.demanda||"").replace("(","").replace(")",""):c[m]||"";return l.jsxs("div",{className:`${De.externalContainer} ${a==="sin"?De.externalSintetic:""}`,children:[i===!0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{}),l.jsx("div",{className:De.yearTitles,children:e.map((m,v)=>l.jsx("div",{className:De.yearTitle,style:{width:h},children:m.anyo},v))})]}),l.jsx("div",{className:De.titles,children:t.map((m,v)=>l.jsxs("div",{className:De.titleContainer,children:[g(r[m]),a!=="sin"&&l.jsx("span",{className:De.circle,style:{background:n[m]}})]},v))}),o===!0&&l.jsx("div",{className:De.totalContainer,children:t.map((m,v)=>{var f;return l.jsxs("div",{className:`${De.total} ${d(m,e)>9999||d(m,e)<-9999?De.bigNumber:""}`,children:[(f=d(m,e))==null?void 0:f.toLocaleString("es-ES")," ",y(m)]},v)})}),l.jsx("div",{className:De.yearDatas,children:e.map((m,v)=>l.jsx("div",{className:De.yearDataContainer,style:{width:h},children:t.map((f,C)=>{var w,T;return isNaN(m[f])?null:l.jsx("div",{className:`${De.yearDataContent} ${m[f]>9999||m[f]<-9999?De.bigNumber:""}`,children:m[f]<1e4||m[f]>-1e4?(w=zf(m[f]))==null?void 0:w.toLocaleString("es-ES"):(T=m[f])==null?void 0:T.toLocaleString("es-ES")},C)})},v))})]})};Fi.propTypes={data:s.arrayOf(s.shape({anyo:s.oneOfType([s.string,s.number]).isRequired})).isRequired,keys:s.arrayOf(s.string).isRequired,colors:s.objectOf(s.string).isRequired,locales:s.objectOf(s.string).isRequired,total:s.bool,years:s.bool,activeGraphics:s.oneOf(["ind","sin"]),units:s.objectOf(s.string),translate:s.func,getTotal:s.func,columnWidth:s.number};const Wf="_speedGraphic_d1k72_2",Cr={speedGraphic:Wf},zi=({minValue:e=0,maxValue:t=100,value:n=50,title:r=!1,percent:o=!1,unit:i=!1,greenColor:a="#00CF1E",orangeColor:c="#FFAC00",redColor:u="#FF1E37"})=>{n<e&&(n=e),n>t&&(n=t);const d=(n-e)/(t-e),h=270+d*180,g=o?Math.round(d*100):n;return l.jsxs("div",{className:Cr.speedGraphic,children:[l.jsxs("svg",{width:"244",height:"130",viewBox:"0 0 244 130",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M0 122C0 111.944 1.2433 101.927 3.70162 92.1756L26.2619 97.8633C24.2724 105.755 23.2662 113.862 23.2662 122H0Z",fill:a}),l.jsx("path",{d:"M16.3442 61.0012C21.3714 52.2936 27.4557 44.2409 34.4588 37.0263L51.1534 53.2313C45.4859 59.0701 40.5619 65.5871 36.4934 72.6341L16.3442 61.0012Z",fill:a}),l.jsx("path",{d:"M60.9088 16.3976C69.6119 11.3628 78.9041 7.42322 88.5739 4.66843L94.9485 27.0443C87.1228 29.2737 79.6027 32.462 72.5592 36.5367L60.9088 16.3976Z",fill:c}),l.jsx("path",{d:"M121.797 0.000169508C131.851 -0.0165912 141.869 1.20965 151.623 3.65101L145.974 26.2209C138.08 24.2451 129.972 23.2527 121.835 23.2663L121.797 0.000169508Z",fill:c}),l.jsx("path",{d:"M182.623 16.1279C191.348 21.124 199.422 27.1797 206.662 34.157L190.516 50.9092C184.657 45.2625 178.123 40.3617 171.061 36.3183L182.623 16.1279Z",fill:u}),l.jsx("path",{d:"M227.238 60.2836C232.325 68.9568 236.319 78.2255 239.131 87.8788L216.794 94.3859C214.518 86.5735 211.285 79.0725 207.169 72.0533L227.238 60.2836Z",fill:u}),l.jsx("path",{d:"M4.15505 90.4316C6.75674 80.7194 10.5491 71.3662 15.4458 62.5846L35.7663 73.9155C31.8035 81.0224 28.7343 88.5919 26.6288 96.4519L4.15505 90.4316Z",fill:a}),l.jsx("path",{d:"M35.733 35.733C42.8426 28.6233 50.8039 22.4198 59.4357 17.2636L71.3671 37.2375C64.3814 41.4104 57.9384 46.4308 52.1846 52.1846L35.733 35.733Z",fill:a}),l.jsx("path",{d:"M90.3004 4.19027C100.01 1.57776 110.005 0.175523 120.058 0.0154601L120.428 23.2787C112.292 23.4082 104.203 24.543 96.3457 26.6573L90.3004 4.19027Z",fill:c}),l.jsx("path",{d:"M153.423 4.11614C163.138 6.70584 172.496 10.4866 181.284 15.3725L169.978 35.707C162.866 31.7529 155.293 28.6932 147.43 26.5973L153.423 4.11614Z",fill:c}),l.jsx("path",{d:"M239.602 89.538C242.532 100.152 244.011 111.114 244 122.125L220.734 122.101C220.743 113.19 219.546 104.319 217.175 95.7287L239.602 89.538Z",fill:u}),l.jsx("path",{d:"M207.769 35.2376C214.919 42.3062 221.168 50.2316 226.374 58.8336L206.469 70.8798C202.256 63.9183 197.199 57.5043 191.412 51.7837L207.769 35.2376Z",fill:u}),l.jsx("g",{transform:`rotate(${h} 122 122)`,children:l.jsx("path",{id:"aguja",d:"M121 119.5V33",stroke:"#605B56","stroke-width":"2"})})]}),l.jsxs("div",{className:Cr.value,children:[g,o&&"%",i&&i]}),r&&l.jsx("div",{className:Cr.title,children:r})]})};zi.propTypes={minValue:s.number.isRequired,maxValue:s.number.isRequired,value:s.number.isRequired,percent:s.bool,title:s.string,unit:s.string,greenColor:s.string,orangeColor:s.string,redColor:s.string};const _r="#ffffff",Uf="#ffffff";function st(e,t,n,r){const o=(r-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function ys(e,t,n,r,o,i){if(Math.abs(i-o)>=359.99)return n===0?`M ${e-r} ${t} A ${r} ${r} 0 1 1 ${e+r} ${t} A ${r} ${r} 0 1 1 ${e-r} ${t} Z`:[`M ${e-r} ${t} A ${r} ${r} 0 1 1 ${e+r} ${t} A ${r} ${r} 0 1 1 ${e-r} ${t} Z`,`M ${e-n} ${t} A ${n} ${n} 0 1 0 ${e+n} ${t} A ${n} ${n} 0 1 0 ${e-n} ${t} Z`].join(" ");const a=st(e,t,r,o),c=st(e,t,r,i),u=i-o>180?1:0;if(n===0)return`M ${e} ${t} L ${a.x} ${a.y} A ${r} ${r} 0 ${u} 1 ${c.x} ${c.y} Z`;const d=st(e,t,n,i),h=st(e,t,n,o);return[`M ${a.x} ${a.y}`,`A ${r} ${r} 0 ${u} 1 ${c.x} ${c.y}`,`L ${d.x} ${d.y}`,`A ${n} ${n} 0 ${u} 0 ${h.x} ${h.y}`,"Z"].join(" ")}function Zf(e){const t=e.reduce((r,o)=>r+(o.value||0),0);let n=0;return e.map(r=>{const o=r.value/t*360,i=n;return n+=o,{...r,sa:i,ea:n}})}function bs(e,t,n,r,o){const i=n+(r-n)/2,a=st(e,t,o,i);return{tx:a.x-e,ty:a.y-t}}const qi=({type:e="cheese",data:t=[],title:n,size:r=260,donutThickness:o=56,gapWidth:i=3,gapColor:a,backgroundColor:c="transparent",fontColor:u="black",fontColorInside:d="white",containerStyles:h={},alignLeft:g=!1})=>{const[y,m]=_.useState(null),v=r/2,f=r/2,C=r/2-14,w=e==="donut"?C-o:0,T=e==="donut"?C-o/2:C*.62,j=_.useMemo(()=>Zf(t),[t]),b=y!==null?j[y]:null,x=j.some($=>$.ea-$.sa>=359.99),S=a||(c==="transparent"?Uf:c);return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"4px",padding:"0px",background:c,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",...h},children:[l.jsxs("div",{style:{minHeight:"40px",display:"flex",flexDirection:"column",gap:"2px"},children:[n&&l.jsx("h2",{style:{margin:0,color:u,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.5px"},children:n}),l.jsx("div",{style:{height:"22px",display:"flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",opacity:b?1:0},children:b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",background:b.color||_r,flexShrink:0}}),l.jsxs("span",{style:{color:u,fontSize:"14px",fontWeight:"600"},children:[b.title," — ",b.value,"%"]})]})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g?"flex-start":"center",gap:"16px"},children:[l.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,style:{overflow:"visible"},children:[j.map(($,A)=>{const O=y===A,{tx:z,ty:P}=O&&!x?bs(v,f,$.sa,$.ea,10):{tx:0,ty:0};return l.jsx("g",{transform:`translate(${z}, ${P})`,style:{transition:"transform 0.18s ease",pointerEvents:"none"},children:l.jsx("path",{d:ys(v,f,w,C,$.sa,$.ea),fill:$.color||_r,style:{filter:O?"brightness(1.25)":"brightness(1)",transition:"filter 0.18s ease"}})},A)}),!x&&j.map(($,A)=>{const O=st(v,f,C,$.sa),z=e==="cheese"?v:st(v,f,w,$.sa).x,P=e==="cheese"?f:st(v,f,w,$.sa).y;return l.jsx("line",{x1:z,y1:P,x2:O.x,y2:O.y,stroke:S,strokeWidth:i,strokeLinecap:"butt",style:{pointerEvents:"none"}},`gap-${A}`)}),j.map(($,A)=>{if($.ea-$.sa<20)return null;const O=y===A,{tx:z,ty:P}=O&&!x?bs(v,f,$.sa,$.ea,10):{tx:0,ty:0},p=$.sa+($.ea-$.sa)/2,E=st(v,f,T,p);return l.jsxs("text",{x:E.x+z,y:E.y+P,textAnchor:"middle",dominantBaseline:"middle",fill:d,fontSize:"14",fontWeight:"700",fontFamily:"'Segoe UI', sans-serif",pointerEvents:"none",style:{transition:"x 0.18s ease, y 0.18s ease"},children:[$.value,"%"]},`lbl-${A}`)}),j.map(($,A)=>l.jsx("path",{d:ys(v,f,w,C,$.sa,$.ea),fill:"transparent",style:{cursor:"pointer"},onMouseEnter:()=>m(A),onMouseLeave:()=>m(null)},`hit-${A}`))]}),l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px 24px",justifyContent:g?"flex-start":"center"},children:t.map(($,A)=>l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:y===null||y===A?1:.4,transition:"opacity 0.15s"},onMouseEnter:()=>m(A),onMouseLeave:()=>m(null),children:[l.jsx("span",{style:{width:"32px",height:"14px",borderRadius:"3px",background:$.color||_r,flexShrink:0}}),l.jsx("span",{style:{color:u,fontSize:"13px",fontWeight:"400"},children:$.title})]},A))})]})]})};qi.propTypes={type:s.oneOf(["cheese","donut"]),data:s.arrayOf(s.shape({value:s.number.isRequired,title:s.string.isRequired,color:s.string})).isRequired,title:s.string,size:s.number,donutThickness:s.number,gapWidth:s.number,gapColor:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,containerStyles:s.object,alignLeft:s.bool};const vs=["#a8d8cf","#3bbfa0","#5dd4b8","#7ed4c2","#2aa88a"],Wi=({data:e=[],title:t,backgroundColor:n="#0d3d4a",fontColor:r="#ffffff",barHeight:o=52,animated:i=!0,borderRadius:a,containerStyles:c={},fontColorInside:u="white",borderFontColorInside:d,borderFontColorInsideWidth:h=1})=>{const[g,y]=_.useState(i?0:1);_.useEffect(()=>{if(!i)return;const f=requestAnimationFrame(()=>y(1));return()=>cancelAnimationFrame(f)},[i]);const m=Math.max(...e.map(f=>f.value),1),v=a??"6px";return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"0px",background:n,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",minWidth:"420px",...c},children:[t&&l.jsx("h2",{style:{margin:"0 0 20px 0",color:r,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.4px"},children:t}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"18px"},children:e.map((f,C)=>{const w=f.color||vs[C%vs.length],T=f.value/m*100*g;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsx("span",{style:{color:r,fontSize:"14px",fontWeight:"400",opacity:.9},children:f.title}),l.jsxs("div",{style:{position:"relative",height:`${o}px`,background:"transparent",borderRadius:v,overflow:"hidden"},children:[l.jsx("div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${T}%`,background:w,borderRadius:v,transition:i?"width 0.8s cubic-bezier(0.16, 1, 0.3, 1)":"none"}}),l.jsx("span",{style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:u||n,fontSize:"18px",fontWeight:"700",pointerEvents:"none",letterSpacing:"-0.3px",...d?{WebkitTextStroke:`${h}px ${d}`,paintOrder:"stroke fill"}:{}},children:f.value})]})]},C)})})]})};Wi.propTypes={data:s.arrayOf(s.shape({title:s.string.isRequired,value:s.number.isRequired,color:s.string})),title:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,borderFontColorInside:s.string,barHeight:s.number,animated:s.bool,borderRadius:s.oneOfType([s.string,s.number]),containerStyles:s.object};const xs=["#a8d8cf","#3bbfa0","#5dd4b8","#7ed4c2","#2aa88a"],Ui=({data:e=[],title:t,backgroundColor:n="black",fontColor:r="#ffffff",fontColorInside:o="#0d3d4a",borderFontColorInside:i,barWidth:a=52,maxBarHeight:c=200,animated:u=!0,separatorColor:d,containerStyles:h={},borderFontColorInsideWidth:g=1})=>{const[y,m]=_.useState(u?0:1);_.useEffect(()=>{if(!u)return;const j=requestAnimationFrame(()=>requestAnimationFrame(()=>m(1)));return()=>cancelAnimationFrame(j)},[u]);const v=Math.max(...e.map(j=>j.value),1),f=d||(r==="#ffffff"?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.15)"),C=12,w=e.length*a+Math.max(0,e.length-1)*C,T={fontSize:"15px",fontWeight:"700",letterSpacing:"-0.3px",lineHeight:1,pointerEvents:"none",whiteSpace:"nowrap",...i?{WebkitTextStroke:`${g}px ${i}`,paintOrder:"stroke fill"}:{}};return l.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"0",background:n,borderRadius:"16px",fontFamily:"'Segoe UI', sans-serif",...h},children:[t&&l.jsx("h2",{style:{margin:"0 0 24px 0",color:r,fontSize:"22px",fontWeight:"700",letterSpacing:"-0.4px"},children:t}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:`${C}px`,width:`${w}px`,height:`${c}px`},children:e.map((j,b)=>{const x=j.color||xs[b%xs.length],S=j.value===0,$=S?0:j.value/v*c*y;return l.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",width:`${a}px`,height:"100%"},children:S?l.jsx("span",{style:{...T,color:o,marginBottom:"6px"},children:j.value}):l.jsx("div",{style:{position:"relative",width:"100%",height:`${$}px`,background:x,borderRadius:"6px 6px 0 0",transition:u?"height 0.85s cubic-bezier(0.16, 1, 0.3, 1)":"none",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"10px"},children:l.jsx("span",{style:{...T,color:o},children:j.value})})},b)})}),l.jsx("div",{style:{width:`${w+24}px`,marginLeft:"-12px",height:"1.5px",background:f,borderRadius:"1px"}}),l.jsx("div",{style:{display:"flex",gap:`${C}px`,width:`${w}px`,marginTop:"10px"},children:e.map((j,b)=>l.jsx("div",{style:{width:`${a}px`,textAlign:"center",color:r,fontSize:"13px",fontWeight:"400",opacity:.8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:j.title},b))})]})]})};Ui.propTypes={data:s.arrayOf(s.shape({title:s.string.isRequired,value:s.number.isRequired,color:s.string})).isRequired,title:s.string,backgroundColor:s.string,fontColor:s.string,fontColorInside:s.string,borderFontColorInside:s.string,barWidth:s.number,maxBarHeight:s.number,animated:s.bool,separatorColor:s.string,containerStyles:s.object};const Hf="_header_13kbt_2",Kf="_leftComponents_13kbt_13",Gf="_centerComponents_13kbt_14",Yf="_rightComponents_13kbt_15",Xf="_componentsContainer_13kbt_32",Ct={header:Hf,leftComponents:Kf,centerComponents:Gf,rightComponents:Yf,componentsContainer:Xf},Zi=({cssProps:e,leftComponents:t=[],centerComponents:n=[],rightComponents:r=[],zIndex:o=10,height:i=60,backgroundColor:a="#605B56",isFooter:c=!1})=>l.jsxs("div",{className:Ct.header,style:{...e,zIndex:o,height:i,backgroundColor:a,top:c?"auto":0,bottom:c?0:"auto"},children:[l.jsx("div",{className:Ct.leftComponents,children:t.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))}),l.jsx("div",{className:Ct.centerComponents,children:n.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))}),l.jsx("div",{className:Ct.rightComponents,children:r.map((u,d)=>l.jsx("div",{className:Ct.componentsContainer,children:u},d))})]});Zi.propTypes={leftComponents:s.arrayOf(s.node),centerComponents:s.arrayOf(s.node),rightComponents:s.arrayOf(s.node),cssProps:s.object,zIndex:s.number,height:s.number,backgroundColor:s.string,isFooter:s.bool};const Qf="_sidebar_1kaqu_2",Jf="_open_1kaqu_16",ep="_content_1kaqu_20",tp="_closeButton_1kaqu_25",Nn={sidebar:Qf,open:Jf,content:ep,closeButton:tp},np="data:image/svg+xml,%3csvg%20width='19'%20height='19'%20viewBox='0%200%2019%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%203699'%3e%3cpath%20id='Vector%20223'%20d='M1%201L18.1566%2018.1566'%20stroke='%23605B56'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%20224'%20d='M18.1575%201L1.00083%2018.1566'%20stroke='%23605B56'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e",Hi=({width:e="300px",children:t,showRightBar:n,onCloseBar:r})=>{const o=()=>{r()};return l.jsx("div",{className:`${Nn.sidebar} ${n?Nn.open:""}`,style:{width:n?e:0},children:n&&l.jsxs("div",{className:Nn.content,children:[l.jsx("button",{className:Nn.closeButton,onClick:o,children:l.jsx("img",{src:np,alt:"Close Sidebar"})}),t]})})};Hi.propTypes={width:s.string,children:s.node,showRightBar:s.bool,onCloseBar:s.func};exports.AmbitSelector=$s;exports.BarChart=Br;exports.BurgerMenu=Jr;exports.ButtonsBar=Di;exports.ButtonsList=Es;exports.CategorySelector=Rr;exports.DropdownList=mt;exports.EditAmbit=el;exports.ErrorMessage=Ut;exports.FiltersAmbit=Ds;exports.Form=Pd;exports.GeneralButton=an;exports.Graphic=Is;exports.GraphicLegend=Fi;exports.Groupedbarchart=Bi;exports.HeaderSection=Zi;exports.HorizontalBarChart=Wi;exports.IndicatorsList=Vs;exports.LangSelector=Fs;exports.Legend=zs;exports.ListSelector=ki;exports.Loader=Pi;exports.LogInButton=Si;exports.LogoApp=qs;exports.MapboxMap=Gs;exports.MaplibreMap=Ys;exports.ModalAlert=Ri;exports.PieChart=qi;exports.RadioButtonInput=Mi;exports.RankingSlider=Yr;exports.RightSidebar=Hi;exports.SectionBar=Xs;exports.SelectInput=Li;exports.SpeedGraphic=zi;exports.Stackedbarchart=Vi;exports.StatusText=Qr;exports.Steps=Xr;exports.Switch=Ii;exports.TextInput=Mr;exports.TimeSlider=_i;exports.Tooltip=Je;exports.TopNavMenu=wi;exports.VerticalBarChart=Ui;
package/dist/index.es.js CHANGED
@@ -11901,17 +11901,18 @@ const Ei = [
11901
11901
  maxBarHeight: l = 200,
11902
11902
  animated: c = !0,
11903
11903
  separatorColor: d,
11904
- containerStyles: h = {}
11904
+ containerStyles: h = {},
11905
+ borderFontColorInsideWidth: g = 1
11905
11906
  }) => {
11906
- const [g, y] = de(c ? 0 : 1);
11907
+ const [y, m] = de(c ? 0 : 1);
11907
11908
  ee(() => {
11908
11909
  if (!c) return;
11909
- const S = requestAnimationFrame(
11910
- () => requestAnimationFrame(() => y(1))
11910
+ const $ = requestAnimationFrame(
11911
+ () => requestAnimationFrame(() => m(1))
11911
11912
  );
11912
- return () => cancelAnimationFrame(S);
11913
+ return () => cancelAnimationFrame($);
11913
11914
  }, [c]);
11914
- const m = Math.max(...e.map((S) => S.value), 1), v = d || (r === "#ffffff" ? "rgba(255,255,255,0.25)" : "rgba(0,0,0,0.15)"), f = 12, _ = e.length * a + Math.max(0, e.length - 1) * f, x = {
11915
+ const v = Math.max(...e.map(($) => $.value), 1), f = d || (r === "#ffffff" ? "rgba(255,255,255,0.25)" : "rgba(0,0,0,0.15)"), _ = 12, x = e.length * a + Math.max(0, e.length - 1) * _, S = {
11915
11916
  fontSize: "15px",
11916
11917
  fontWeight: "700",
11917
11918
  letterSpacing: "-0.3px",
@@ -11919,7 +11920,7 @@ const Ei = [
11919
11920
  pointerEvents: "none",
11920
11921
  whiteSpace: "nowrap",
11921
11922
  ...s ? {
11922
- WebkitTextStroke: `1px ${s}`,
11923
+ WebkitTextStroke: `${g}px ${s}`,
11923
11924
  paintOrder: "stroke fill"
11924
11925
  } : {}
11925
11926
  };
@@ -11956,12 +11957,12 @@ const Ei = [
11956
11957
  style: {
11957
11958
  display: "flex",
11958
11959
  alignItems: "flex-end",
11959
- gap: `${f}px`,
11960
- width: `${_}px`,
11960
+ gap: `${_}px`,
11961
+ width: `${x}px`,
11961
11962
  height: `${l}px`
11962
11963
  },
11963
- children: e.map((S, $) => {
11964
- const b = S.color || Ei[$ % Ei.length], C = S.value === 0, w = C ? 0 : S.value / m * l * g;
11964
+ children: e.map(($, b) => {
11965
+ const C = $.color || Ei[b % Ei.length], w = $.value === 0, E = w ? 0 : $.value / v * l * y;
11965
11966
  return /* @__PURE__ */ u(
11966
11967
  "div",
11967
11968
  {
@@ -11973,17 +11974,17 @@ const Ei = [
11973
11974
  width: `${a}px`,
11974
11975
  height: "100%"
11975
11976
  },
11976
- children: C ? (
11977
+ children: w ? (
11977
11978
  // Value sits just above the separator, no bar rendered
11978
11979
  /* @__PURE__ */ u(
11979
11980
  "span",
11980
11981
  {
11981
11982
  style: {
11982
- ...x,
11983
+ ...S,
11983
11984
  color: o,
11984
11985
  marginBottom: "6px"
11985
11986
  },
11986
- children: S.value
11987
+ children: $.value
11987
11988
  }
11988
11989
  )
11989
11990
  ) : /* @__PURE__ */ u(
@@ -11992,8 +11993,8 @@ const Ei = [
11992
11993
  style: {
11993
11994
  position: "relative",
11994
11995
  width: "100%",
11995
- height: `${w}px`,
11996
- background: b,
11996
+ height: `${E}px`,
11997
+ background: C,
11997
11998
  borderRadius: "6px 6px 0 0",
11998
11999
  transition: c ? "height 0.85s cubic-bezier(0.16, 1, 0.3, 1)" : "none",
11999
12000
  display: "flex",
@@ -12001,11 +12002,11 @@ const Ei = [
12001
12002
  justifyContent: "center",
12002
12003
  paddingTop: "10px"
12003
12004
  },
12004
- children: /* @__PURE__ */ u("span", { style: { ...x, color: o }, children: S.value })
12005
+ children: /* @__PURE__ */ u("span", { style: { ...S, color: o }, children: $.value })
12005
12006
  }
12006
12007
  )
12007
12008
  },
12008
- $
12009
+ b
12009
12010
  );
12010
12011
  })
12011
12012
  }
@@ -12014,10 +12015,10 @@ const Ei = [
12014
12015
  "div",
12015
12016
  {
12016
12017
  style: {
12017
- width: `${_ + 24}px`,
12018
+ width: `${x + 24}px`,
12018
12019
  marginLeft: "-12px",
12019
12020
  height: "1.5px",
12020
- background: v,
12021
+ background: f,
12021
12022
  borderRadius: "1px"
12022
12023
  }
12023
12024
  }
@@ -12027,11 +12028,11 @@ const Ei = [
12027
12028
  {
12028
12029
  style: {
12029
12030
  display: "flex",
12030
- gap: `${f}px`,
12031
- width: `${_}px`,
12031
+ gap: `${_}px`,
12032
+ width: `${x}px`,
12032
12033
  marginTop: "10px"
12033
12034
  },
12034
- children: e.map((S, $) => /* @__PURE__ */ u(
12035
+ children: e.map(($, b) => /* @__PURE__ */ u(
12035
12036
  "div",
12036
12037
  {
12037
12038
  style: {
@@ -12045,9 +12046,9 @@ const Ei = [
12045
12046
  overflow: "hidden",
12046
12047
  textOverflow: "ellipsis"
12047
12048
  },
12048
- children: S.title
12049
+ children: $.title
12049
12050
  },
12050
- $
12051
+ b
12051
12052
  ))
12052
12053
  }
12053
12054
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmf_ciclica/ciclicastorybook",
3
- "version": "1.2.135",
3
+ "version": "1.2.137",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",