tekivex-ui 2.5.12 → 2.5.13

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/charts.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./themes-CMq2vWXj.cjs`),t=require(`./hooks-mivgRljH.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`recharts`);function a(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+`aa`,e.secondary+`aa`,e.info+`aa`,e.success+`aa`]}var o={top:10,right:30,bottom:10,left:0};function s(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:`0 4px 12px rgba(0,0,0,0.15)`,color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}function c({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,smooth:m=!0,xTickFormatter:h,yTickFormatter:g,yDomain:_,ariaLabel:v=`Area chart`}){let y=e.f(),b=a(y),x=s(y),S={fill:y.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":v,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.AreaChart,{data:t,margin:u,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:y.border,vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:c,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:h}),(0,r.jsx)(i.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,domain:_}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:x.cursor}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:y.textMuted,paddingTop:8}}),n.map((e,t)=>{let n=e.color??b[t%b.length];return(0,r.jsx)(i.Area,{type:m?`monotone`:`linear`,dataKey:e.key,name:e.label??e.key,stroke:n,strokeWidth:2,fill:n,fillOpacity:e.fillOpacity??.2,stackId:e.stacked?`stack`:void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},e.key)})]})})})}function l({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,layout:m=`horizontal`,barSize:h,xTickFormatter:g,yTickFormatter:_,ariaLabel:v=`Bar chart`}){let y=e.f(),b=a(y),x=s(y),S={fill:y.textMuted,fontSize:12},C=m===`vertical`;return(0,r.jsx)(`div`,{role:`img`,"aria-label":v,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.BarChart,{data:t,margin:u,layout:m,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:y.border,vertical:C,horizontal:!C}),C?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.YAxis,{dataKey:c,type:`category`,tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,width:100}),(0,r.jsx)(i.XAxis,{type:`number`,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:_})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.XAxis,{dataKey:c,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(i.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:_})]}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:{fill:`${y.surfaceAlt}`}}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:y.textMuted,paddingTop:8}}),n.map((e,t)=>{let n=e.color??b[t%b.length];return(0,r.jsx)(i.Bar,{dataKey:e.key,name:e.label??e.key,fill:n,stackId:e.stackId,maxBarSize:h??40,radius:e.radius??[4,4,0,0]},e.key)})]})})})}function u({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,smooth:m=!0,referenceLines:h=[],xTickFormatter:g,yTickFormatter:_,yDomain:v,connectNulls:y=!1,ariaLabel:b=`Line chart`}){let x=e.f(),S=a(x),C=s(x),w={fill:x.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":b,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.LineChart,{data:t,margin:u,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:x.border,vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:c,tick:w,axisLine:{stroke:x.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(i.YAxis,{tick:w,axisLine:!1,tickLine:!1,tickFormatter:_,domain:v}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:C.contentStyle,labelStyle:C.labelStyle,itemStyle:C.itemStyle,cursor:{stroke:x.border,strokeWidth:1}}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:x.textMuted,paddingTop:8}}),h.map((e,t)=>(0,r.jsx)(i.ReferenceLine,{y:e.y,x:e.x,label:e.label?{value:e.label,fill:x.textMuted,fontSize:11}:void 0,stroke:e.color??x.border,strokeDasharray:e.dashed?`4 4`:void 0},t)),n.map((e,t)=>{let n=e.color??S[t%S.length];return(0,r.jsx)(i.Line,{type:m?`monotone`:`linear`,dataKey:e.key,name:e.label??e.key,stroke:n,strokeWidth:e.strokeWidth??2,strokeDasharray:e.dashed?`6 3`:void 0,dot:e.dot??!1,activeDot:{r:5,strokeWidth:0,fill:n},connectNulls:y},e.key)})]})})})}function d({data:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,showLabels:d=!1,outerRadius:f=`70%`,startAngle:p=90,ariaLabel:m=`Pie chart`}){let h=e.f(),g=t.o(),_=a(h),v=s(h),[y,b]=(0,n.useState)(g);return(0,n.useEffect)(()=>{if(g){b(!0);return}let e=requestAnimationFrame(()=>b(!0));return()=>cancelAnimationFrame(e)},[g]),(0,r.jsx)(`div`,{role:`img`,"aria-label":m,style:{width:`100%`,minWidth:240,height:c,position:`relative`},children:y&&(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,debounce:50,children:(0,r.jsxs)(i.PieChart,{children:[u&&(0,r.jsx)(i.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:h.textMuted}}),(0,r.jsx)(i.Pie,{data:o,dataKey:`value`,nameKey:`name`,outerRadius:f,startAngle:p,endAngle:p-360,label:d?({name:e,percent:t})=>`${e} (${(t*100).toFixed(0)}%)`:void 0,labelLine:d,strokeWidth:2,stroke:h.bg,children:o.map((e,t)=>(0,r.jsx)(i.Cell,{fill:e.color??_[t%_.length]},e.name))})]})})})}function f({data:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,centerLabel:d,centerSublabel:f,innerRadius:p=`55%`,outerRadius:m=`75%`,startAngle:h=90,ariaLabel:g=`Donut chart`}){let _=e.f(),v=t.o(),y=a(_),b=s(_),[x,S]=(0,n.useState)(v);return(0,n.useEffect)(()=>{if(v){S(!0);return}let e=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(e)},[v]),(0,r.jsxs)(`div`,{role:`img`,"aria-label":g,style:{width:`100%`,minWidth:240,height:c,position:`relative`},children:[x&&(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,debounce:50,children:(0,r.jsxs)(i.PieChart,{children:[u&&(0,r.jsx)(i.Tooltip,{contentStyle:b.contentStyle,labelStyle:b.labelStyle,itemStyle:b.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:_.textMuted}}),(0,r.jsx)(i.Pie,{data:o,dataKey:`value`,nameKey:`name`,innerRadius:p,outerRadius:m,startAngle:h,endAngle:h-360,strokeWidth:3,stroke:_.bg,label:!1,labelLine:!1,children:o.map((e,t)=>(0,r.jsx)(i.Cell,{fill:e.color??y[t%y.length]},e.name))}),(d||f)&&(0,r.jsx)(`text`,{})]})}),(d||f)&&(0,r.jsxs)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,marginTop:l?-24:0},children:[d&&(0,r.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:_.text,lineHeight:1},children:d}),f&&(0,r.jsx)(`span`,{style:{fontSize:13,color:_.textMuted,marginTop:4},children:f})]})]})}function p({series:t,height:n=300,margin:c=o,showGrid:l=!0,showLegend:u=!0,showTooltip:d=!0,xTickFormatter:f,yTickFormatter:p,zRange:m=[20,400],ariaLabel:h=`Scatter chart`}){let g=e.f(),_=a(g),v=s(g),y={fill:g.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":h,style:{width:`100%`,height:n},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.ScatterChart,{margin:c,children:[l&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:g.border}),(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`x`,tick:y,axisLine:{stroke:g.border},tickLine:!1,tickFormatter:f}),(0,r.jsx)(i.YAxis,{type:`number`,dataKey:`y`,tick:y,axisLine:!1,tickLine:!1,tickFormatter:p}),(0,r.jsx)(i.ZAxis,{type:`number`,dataKey:`z`,range:m}),d&&(0,r.jsx)(i.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle,cursor:{strokeDasharray:`3 3`}}),u&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:g.textMuted,paddingTop:8}}),t.map((e,t)=>(0,r.jsx)(i.Scatter,{name:e.name,data:e.data,fill:e.color??_[t%_.length],fillOpacity:.8},e.name??t))]})})})}function m({data:t,series:n,angleKey:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,outerRadius:d=`70%`,ariaLabel:f=`Radar chart`}){let p=e.f(),m=a(p),h=s(p);return(0,r.jsx)(`div`,{role:`img`,"aria-label":f,style:{width:`100%`,height:c},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.RadarChart,{data:t,outerRadius:d,children:[(0,r.jsx)(i.PolarGrid,{stroke:p.border}),(0,r.jsx)(i.PolarAngleAxis,{dataKey:o,tick:{fill:p.textMuted,fontSize:12}}),(0,r.jsx)(i.PolarRadiusAxis,{tick:{fill:p.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),u&&(0,r.jsx)(i.Tooltip,{contentStyle:h.contentStyle,labelStyle:h.labelStyle,itemStyle:h.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:p.textMuted}}),n.map((e,t)=>{let n=e.color??m[t%m.length];return(0,r.jsx)(i.Radar,{name:e.label??e.key,dataKey:e.key,stroke:n,fill:n,fillOpacity:e.fillOpacity??.2,strokeWidth:2},e.key)})]})})})}exports.TkxAreaChart=c,exports.TkxBarChart=l,exports.TkxDonutChart=f,exports.TkxLineChart=u,exports.TkxPieChart=d,exports.TkxRadarChart=m,exports.TkxScatterChart=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./themes-CMq2vWXj.cjs`),t=require(`./hooks-mivgRljH.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`recharts`);function a(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+`aa`,e.secondary+`aa`,e.info+`aa`,e.success+`aa`]}var o={top:10,right:30,bottom:10,left:0};function s(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:`0 4px 12px rgba(0,0,0,0.15)`,color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}function c({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,smooth:m=!0,xTickFormatter:h,yTickFormatter:g,yDomain:_,ariaLabel:v=`Area chart`}){let y=e.f(),b=a(y),x=s(y),S={fill:y.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":v,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.AreaChart,{data:t,margin:u,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:y.border,vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:c,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:h}),(0,r.jsx)(i.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,domain:_}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:x.cursor}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:y.textMuted,paddingTop:8}}),n.map((e,t)=>{let n=e.color??b[t%b.length];return(0,r.jsx)(i.Area,{type:m?`monotone`:`linear`,dataKey:e.key,name:e.label??e.key,stroke:n,strokeWidth:2,fill:n,fillOpacity:e.fillOpacity??.2,stackId:e.stacked?`stack`:void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},e.key)})]})})})}function l({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,layout:m=`horizontal`,barSize:h,xTickFormatter:g,yTickFormatter:_,ariaLabel:v=`Bar chart`}){let y=e.f(),b=a(y),x=s(y),S={fill:y.textMuted,fontSize:12},C=m===`vertical`;return(0,r.jsx)(`div`,{role:`img`,"aria-label":v,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.BarChart,{data:t,margin:u,layout:m,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:y.border,vertical:C,horizontal:!C}),C?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.YAxis,{dataKey:c,type:`category`,tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,width:100}),(0,r.jsx)(i.XAxis,{type:`number`,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:_})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.XAxis,{dataKey:c,tick:S,axisLine:{stroke:y.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(i.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:_})]}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:{fill:`${y.surfaceAlt}`}}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:y.textMuted,paddingTop:8}}),n.map((e,t)=>{let n=e.color??b[t%b.length];return(0,r.jsx)(i.Bar,{dataKey:e.key,name:e.label??e.key,fill:n,stackId:e.stackId,maxBarSize:h??40,radius:e.radius??[4,4,0,0]},e.key)})]})})})}function u({data:t,series:n,xKey:c,height:l=300,margin:u=o,showGrid:d=!0,showLegend:f=!0,showTooltip:p=!0,smooth:m=!0,referenceLines:h=[],xTickFormatter:g,yTickFormatter:_,yDomain:v,connectNulls:y=!1,ariaLabel:b=`Line chart`}){let x=e.f(),S=a(x),C=s(x),w={fill:x.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":b,style:{width:`100%`,height:l},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.LineChart,{data:t,margin:u,children:[d&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:x.border,vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:c,tick:w,axisLine:{stroke:x.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(i.YAxis,{tick:w,axisLine:!1,tickLine:!1,tickFormatter:_,domain:v}),p&&(0,r.jsx)(i.Tooltip,{contentStyle:C.contentStyle,labelStyle:C.labelStyle,itemStyle:C.itemStyle,cursor:{stroke:x.border,strokeWidth:1}}),f&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:x.textMuted,paddingTop:8}}),h.map((e,t)=>(0,r.jsx)(i.ReferenceLine,{y:e.y,x:e.x,label:e.label?{value:e.label,fill:x.textMuted,fontSize:11}:void 0,stroke:e.color??x.border,strokeDasharray:e.dashed?`4 4`:void 0},t)),n.map((e,t)=>{let n=e.color??S[t%S.length];return(0,r.jsx)(i.Line,{type:m?`monotone`:`linear`,dataKey:e.key,name:e.label??e.key,stroke:n,strokeWidth:e.strokeWidth??2,strokeDasharray:e.dashed?`6 3`:void 0,dot:e.dot??!1,activeDot:{r:5,strokeWidth:0,fill:n},connectNulls:y},e.key)})]})})})}function d({data:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,showLabels:d=!1,outerRadius:f=`70%`,startAngle:p=90,ariaLabel:m=`Pie chart`}){let h=e.f(),g=t.o(),_=a(h),v=s(h),[y,b]=(0,n.useState)(g);return(0,n.useEffect)(()=>{if(g){b(!0);return}let e=requestAnimationFrame(()=>b(!0));return()=>cancelAnimationFrame(e)},[g]),(0,r.jsx)(`div`,{role:`img`,"aria-label":m,style:{width:`100%`,minWidth:240,height:c,position:`relative`},children:y&&(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,debounce:50,children:(0,r.jsxs)(i.PieChart,{children:[u&&(0,r.jsx)(i.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:h.textMuted}}),(0,r.jsx)(i.Pie,{data:o,dataKey:`value`,nameKey:`name`,outerRadius:f,startAngle:p,endAngle:p-360,label:d?({name:e,percent:t})=>`${e} (${((t??0)*100).toFixed(0)}%)`:void 0,labelLine:d,strokeWidth:2,stroke:h.bg,children:o.map((e,t)=>(0,r.jsx)(i.Cell,{fill:e.color??_[t%_.length]},e.name))})]})})})}function f({data:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,centerLabel:d,centerSublabel:f,innerRadius:p=`55%`,outerRadius:m=`75%`,startAngle:h=90,ariaLabel:g=`Donut chart`}){let _=e.f(),v=t.o(),y=a(_),b=s(_),[x,S]=(0,n.useState)(v);return(0,n.useEffect)(()=>{if(v){S(!0);return}let e=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(e)},[v]),(0,r.jsxs)(`div`,{role:`img`,"aria-label":g,style:{width:`100%`,minWidth:240,height:c,position:`relative`},children:[x&&(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,debounce:50,children:(0,r.jsxs)(i.PieChart,{children:[u&&(0,r.jsx)(i.Tooltip,{contentStyle:b.contentStyle,labelStyle:b.labelStyle,itemStyle:b.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:_.textMuted}}),(0,r.jsx)(i.Pie,{data:o,dataKey:`value`,nameKey:`name`,innerRadius:p,outerRadius:m,startAngle:h,endAngle:h-360,strokeWidth:3,stroke:_.bg,label:!1,labelLine:!1,children:o.map((e,t)=>(0,r.jsx)(i.Cell,{fill:e.color??y[t%y.length]},e.name))}),(d||f)&&(0,r.jsx)(`text`,{})]})}),(d||f)&&(0,r.jsxs)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,marginTop:l?-24:0},children:[d&&(0,r.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:_.text,lineHeight:1},children:d}),f&&(0,r.jsx)(`span`,{style:{fontSize:13,color:_.textMuted,marginTop:4},children:f})]})]})}function p({series:t,height:n=300,margin:c=o,showGrid:l=!0,showLegend:u=!0,showTooltip:d=!0,xTickFormatter:f,yTickFormatter:p,zRange:m=[20,400],ariaLabel:h=`Scatter chart`}){let g=e.f(),_=a(g),v=s(g),y={fill:g.textMuted,fontSize:12};return(0,r.jsx)(`div`,{role:`img`,"aria-label":h,style:{width:`100%`,height:n},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.ScatterChart,{margin:c,children:[l&&(0,r.jsx)(i.CartesianGrid,{strokeDasharray:`3 3`,stroke:g.border}),(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`x`,tick:y,axisLine:{stroke:g.border},tickLine:!1,tickFormatter:f}),(0,r.jsx)(i.YAxis,{type:`number`,dataKey:`y`,tick:y,axisLine:!1,tickLine:!1,tickFormatter:p}),(0,r.jsx)(i.ZAxis,{type:`number`,dataKey:`z`,range:m}),d&&(0,r.jsx)(i.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle,cursor:{strokeDasharray:`3 3`}}),u&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:g.textMuted,paddingTop:8}}),t.map((e,t)=>(0,r.jsx)(i.Scatter,{name:e.name,data:e.data,fill:e.color??_[t%_.length],fillOpacity:.8},e.name??t))]})})})}function m({data:t,series:n,angleKey:o,height:c=300,showLegend:l=!0,showTooltip:u=!0,outerRadius:d=`70%`,ariaLabel:f=`Radar chart`}){let p=e.f(),m=a(p),h=s(p);return(0,r.jsx)(`div`,{role:`img`,"aria-label":f,style:{width:`100%`,height:c},children:(0,r.jsx)(i.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,r.jsxs)(i.RadarChart,{data:t,outerRadius:d,children:[(0,r.jsx)(i.PolarGrid,{stroke:p.border}),(0,r.jsx)(i.PolarAngleAxis,{dataKey:o,tick:{fill:p.textMuted,fontSize:12}}),(0,r.jsx)(i.PolarRadiusAxis,{tick:{fill:p.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),u&&(0,r.jsx)(i.Tooltip,{contentStyle:h.contentStyle,labelStyle:h.labelStyle,itemStyle:h.itemStyle}),l&&(0,r.jsx)(i.Legend,{wrapperStyle:{fontSize:13,color:p.textMuted}}),n.map((e,t)=>{let n=e.color??m[t%m.length];return(0,r.jsx)(i.Radar,{name:e.label??e.key,dataKey:e.key,stroke:n,fill:n,fillOpacity:e.fillOpacity??.2,strokeWidth:2},e.key)})]})})})}exports.TkxAreaChart=c,exports.TkxBarChart=l,exports.TkxDonutChart=f,exports.TkxLineChart=u,exports.TkxPieChart=d,exports.TkxRadarChart=m,exports.TkxScatterChart=p;
package/dist/charts.js CHANGED
@@ -332,7 +332,7 @@ function L({ data: i, height: s = 300, showLegend: c = !0, showTooltip: l = !0,
332
332
  outerRadius: d,
333
333
  startAngle: m,
334
334
  endAngle: m - 360,
335
- label: u ? ({ name: e, percent: t }) => `${e} (${(t * 100).toFixed(0)}%)` : void 0,
335
+ label: u ? ({ name: e, percent: t }) => `${e} (${((t ?? 0) * 100).toFixed(0)}%)` : void 0,
336
336
  labelLine: u,
337
337
  strokeWidth: 2,
338
338
  stroke: v.bg,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tekivex-ui",
3
- "version": "2.5.12",
3
+ "version": "2.5.13",
4
4
  "description": "Production-grade React component library — 70+ components, WCAG 2.1 AAA, WAI-ARIA 1.2, built-in charts, headless primitives, zero-runtime CSS engine, TypeScript-first.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -70,14 +70,13 @@
70
70
  "peerDependencies": {
71
71
  "react": ">=18.0.0",
72
72
  "react-dom": ">=18.0.0",
73
- "recharts": ">=2.0.0"
73
+ "recharts": ">=2.0.0 || >=3.0.0"
74
74
  },
75
75
  "peerDependenciesMeta": {
76
76
  "recharts": {
77
77
  "optional": true
78
78
  }
79
79
  },
80
- "dependencies": {},
81
80
  "devDependencies": {
82
81
  "@testing-library/jest-dom": "^6.6.3",
83
82
  "@testing-library/react": "^16.1.0",
@@ -94,7 +93,7 @@
94
93
  "prettier": "^3.8.3",
95
94
  "react": "^19.2.5",
96
95
  "react-dom": "^19.2.5",
97
- "recharts": "^2.15.4",
96
+ "recharts": "^3.8.1",
98
97
  "typescript": "^5.9.3",
99
98
  "vite": "^8.0.9",
100
99
  "vitest": "^4.1.4"
@@ -81,7 +81,7 @@ export function TkxPieChart({
81
81
  outerRadius={outerRadius}
82
82
  startAngle={startAngle}
83
83
  endAngle={startAngle - 360}
84
- label={showLabels ? ({ name, percent }) => `${name} (${(percent * 100).toFixed(0)}%)` : undefined}
84
+ label={showLabels ? ({ name, percent }) => `${name} (${((percent ?? 0) * 100).toFixed(0)}%)` : undefined}
85
85
  labelLine={showLabels}
86
86
  strokeWidth={2}
87
87
  stroke={theme.bg}