@youwen/ai-design-system
Version:
Enterprise AI-driven design system with comprehensive design tokens
19 lines (18 loc) • 19.2 kB
JavaScript
;const t=require("react/jsx-runtime"),L=require("react"),G=require("class-variance-authority"),K=require("clsx"),Q=require("tailwind-merge");function Y(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(r,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return r.default=o,Object.freeze(r)}const O=Y(L);function D(...o){return Q.twMerge(K.clsx(o))}const R=G.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"w-24 h-24",md:"w-48 h-48",lg:"w-64 h-64",xl:"w-80 h-80"}},defaultVariants:{size:"md"}}),S=O.forwardRef(({value:o,maxValue:r=100,size:e=195,strokeWidth:s=12,showLabel:$=!0,labelFormat:a="value/max",customLabel:v,color:c,trackColor:i="rgba(255, 255, 255, 0.1)",showOuterBorder:f=!0,animated:d=!0,className:n,...b},F)=>{const g=(e-s)/2,h=Math.min(Math.max(0,o),r)/r*100,y=()=>{switch(a){case"percent":return`${Math.round(h)}%`;case"value":return`${o}`;case"value/max":return`${o}/${r}`;case"custom":return v||"";default:return`${o}/${r}`}};return t.jsxs("div",{ref:F,className:D(R({className:n})),style:{position:"relative",width:`${e}px`,height:`${e}px`},...b,children:[t.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,style:{transform:"rotate(-90deg)"},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"donutGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#7898FF",stopOpacity:"0.3"}),t.jsx("stop",{offset:"82%",stopColor:"#7AE4FF"}),t.jsx("stop",{offset:"82.02%",stopColor:"transparent"}),t.jsx("stop",{offset:"100%",stopColor:"#7898FF",stopOpacity:"0.01"})]})}),f&&t.jsx("circle",{cx:e/2,cy:e/2,r:e/2-.5,fill:"none",stroke:"rgba(255, 255, 255, 1)",strokeWidth:"1"}),t.jsx("circle",{cx:e/2,cy:e/2,r:g,fill:"none",stroke:i,strokeWidth:s,style:{transition:d?"stroke-dashoffset 0.5s ease":"none"}}),t.jsxs("mask",{id:"progressMask",children:[t.jsx("rect",{x:"0",y:"0",width:e,height:e,fill:"black"}),t.jsx("path",{d:`
M ${e/2} ${e/2}
L ${e/2} ${s/2}
A ${g} ${g} 0 ${h>50?1:0} 1
${e/2+g*Math.sin(h/100*2*Math.PI)}
${e/2-g*Math.cos(h/100*2*Math.PI)}
Z
`,fill:"white"})]}),t.jsx("foreignObject",{x:"0",y:"0",width:e,height:e,mask:"url(#progressMask)",children:t.jsx("div",{style:{width:"100%",height:"100%",background:`conic-gradient(from 0deg at 50% 50%,
rgba(120, 152, 255, 0.3) 0deg,
#7AE4FF 295deg,
transparent 295.2deg,
rgba(120, 152, 255, 0.01) 360deg)`,borderRadius:"50%",position:"relative"},children:t.jsx("div",{style:{position:"absolute",top:s,left:s,right:s,bottom:s,backgroundColor:"hsl(var(--background))",borderRadius:"50%"}})})})]}),$&&t.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},className:"select-none",children:[t.jsx("div",{style:{color:"hsl(var(--foreground))",fontSize:"24px",fontWeight:500},children:y()}),a==="percent"&&t.jsx("div",{style:{color:"hsl(var(--muted-foreground))",fontSize:"14px",marginTop:"4px"},children:"完成率"})]})]})});S.displayName="FigmaDonutChart";const I=G.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"w-32 h-32",md:"w-40 h-40",lg:"w-48 h-48",xl:"w-56 h-56"}},defaultVariants:{size:"md"}});function N(o){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:{r:0,g:0,b:0}}const V=O.forwardRef(({layers:o=[{value:295,strokeWidth:12,gradient:{startColor:"#7898FF",startOpacity:.3,endColor:"#7AE4FF",endOpacity:1}},{value:235,strokeWidth:10,gradient:{startColor:"#67D75E",startOpacity:.4,endColor:"#059669",endOpacity:1}}],size:r=195,centerText:e,showOuterBorder:s=!0,className:$,...a},v)=>{const c=i=>{let f=0;for(let d=0;d<i;d++)f+=o[d].strokeWidth+1;return f};return t.jsxs("div",{ref:v,className:D(I({className:$})),style:{position:"relative",width:`${r}px`,height:`${r}px`},...a,children:[o.map((i,f)=>{const d=c(f),{r:n,g:b,b:F}=N(i.gradient.startColor),{r:g,g:p,b:h}=N(i.gradient.endColor);return t.jsx("div",{style:{position:"absolute",top:`${d}px`,left:`${d}px`,width:`${r-d*2}px`,height:`${r-d*2}px`,borderRadius:"50%",background:`conic-gradient(
from -90deg,
rgba(${n}, ${b}, ${F}, ${i.gradient.startOpacity||.3}) 0deg,
rgba(${g}, ${p}, ${h}, ${i.gradient.endOpacity||1}) ${i.value}deg,
transparent ${i.value+.5}deg,
transparent 360deg
)`},children:t.jsx("div",{style:{position:"absolute",top:`${i.strokeWidth}px`,left:`${i.strokeWidth}px`,right:`${i.strokeWidth}px`,bottom:`${i.strokeWidth}px`,backgroundColor:"hsl(var(--background))",borderRadius:"50%"}})},f)}),s&&t.jsx("div",{style:{position:"absolute",top:0,left:0,width:`${r}px`,height:`${r}px`,border:"1px solid rgba(255, 255, 255, 1)",borderRadius:"50%",pointerEvents:"none"}}),e&&t.jsx("div",{style:{position:"absolute",top:"10px",right:"30px",color:"rgba(255, 255, 255, 0.3)",fontSize:"10px",fontWeight:400,lineHeight:1},className:"select-none",children:e})]})});V.displayName="FigmaMultiLayerDonut";const E=G.cva("relative inline-block",{variants:{size:{sm:"w-64 h-32",md:"w-96 h-40",lg:"w-[430px] h-48",xl:"w-[500px] h-56"}},defaultVariants:{size:"lg"}}),T=O.forwardRef(({data:o,lines:r=[],indicators:e,yAxisLabels:s=["35","30","25","20","15"],xAxisLabels:$=["00:00","04:00","08:00","12:00","16:00","20:00"],size:a={width:430,height:166},showGrid:v=!0,indicatorSize:c={width:335,height:7},className:i,...f},d)=>{const p=a.width-30-40,h=a.height-20-20,y=l=>l.map((m,w)=>`${w===0?"M":"L"} ${m.x} ${m.y}`).join(" ");return t.jsxs("div",{ref:d,className:D(E({className:i})),style:{display:"flex",flexDirection:"column",gap:"10px"},...f,children:[e&&e.length>0&&t.jsx("div",{style:{width:`${c.width}px`,height:`${c.height}px`,background:"rgba(255, 255, 255, 0.1)",borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center"},children:e.map((l,m)=>t.jsx("div",{style:{height:"100%",width:`${l.width}%`,background:l.color}},m))}),t.jsx("div",{style:{position:"relative",width:`${a.width}px`,height:`${a.height}px`},children:t.jsxs("svg",{width:a.width,height:a.height,viewBox:`0 0 ${a.width} ${a.height}`,style:{width:"100%",height:"100%"},children:[t.jsxs("defs",{children:[r.map(l=>l.gradient&&t.jsx("linearGradient",{id:l.gradient.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:l.gradient.stops.map((m,w)=>t.jsx("stop",{offset:m.offset,stopColor:m.color,stopOpacity:m.opacity??1},w))},l.gradient.id)),v&&t.jsxs("linearGradient",{id:"gridGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[t.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"0"}),t.jsx("stop",{offset:"4.7369%",stopColor:"#FAFAFA",stopOpacity:"1"}),t.jsx("stop",{offset:"100%",stopColor:"#999999",stopOpacity:"1"})]})]}),v&&s.map((l,m)=>{const w=20+m*h/(s.length-1);return t.jsxs("g",{children:[t.jsx("line",{x1:30,y1:w,x2:a.width-40,y2:w,stroke:"url(#gridGradient)",strokeWidth:"1",strokeDasharray:"0.1 4",strokeLinecap:"round",opacity:"0.2"}),t.jsx("text",{x:30-10,y:w,fill:"rgba(255, 255, 255, 0.4)",fontSize:"12",textAnchor:"end",dominantBaseline:"middle",children:l})]},m)}),$.map((l,m)=>{const w=30+m*p/($.length-1);return t.jsx("text",{x:w,y:a.height-5,fill:"rgba(255, 255, 255, 0.4)",fontSize:"12",textAnchor:"middle",dominantBaseline:"hanging",children:l},m)}),r.map((l,m)=>t.jsx("path",{d:y(l.points),fill:"none",stroke:l.gradient?`url(#${l.gradient.id})`:"#6BB5FF",strokeWidth:l.strokeWidth||2,strokeDasharray:l.dashArray,strokeLinecap:"round",strokeLinejoin:"round"},m)),o&&o.map((l,m)=>t.jsxs("g",{children:[t.jsx("circle",{cx:l.position.x,cy:l.position.y,r:"4",fill:"#6BB5FF",stroke:"hsl(var(--background))",strokeWidth:"2"}),t.jsx("text",{x:l.position.x,y:l.position.y-12,fill:"hsl(var(--foreground))",fontSize:"11",textAnchor:"middle",dominantBaseline:"middle",children:l.label}),t.jsx("text",{x:l.position.x,y:l.position.y-22,fill:"hsl(var(--muted-foreground))",fontSize:"10",textAnchor:"middle",dominantBaseline:"middle",children:l.value})]},m))]})})]})});T.displayName="FigmaPredictiveChart";const H=G.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"w-24 h-24",md:"w-30 h-30",lg:"w-36 h-36",xl:"w-40 h-40"}},defaultVariants:{size:"md"}}),q=O.forwardRef(({value:o=65,size:r=120,showPercentage:e=!0,showIndicator:s=!0,className:$,...a},v)=>{const c=r/2,i=45,f=8,d=2*Math.PI*i,n=Math.min(Math.max(0,o),100),b=d,F=d-n/100*d,g=n/100*360-90,p=c+i*Math.cos(g*Math.PI/180),h=c+i*Math.sin(g*Math.PI/180);return t.jsx("div",{ref:v,className:D(H({className:$})),style:{width:`${r}px`,height:`${r}px`},...a,children:t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"progressGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FFB800"}),t.jsx("stop",{offset:"100%",stopColor:"#D97706"})]}),t.jsxs("linearGradient",{id:"backgroundTrack",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0.1)"}),t.jsx("stop",{offset:"100%",stopColor:"rgba(255, 255, 255, 0.05)"})]}),t.jsxs("radialGradient",{id:"indicatorGradient",cx:"50%",cy:"50%",r:"50%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FFFFFF"}),t.jsx("stop",{offset:"70%",stopColor:"#FFB800"}),t.jsx("stop",{offset:"100%",stopColor:"#D97706"})]})]}),t.jsx("circle",{cx:c,cy:c,r:i,fill:"none",stroke:"url(#backgroundTrack)",strokeWidth:f}),t.jsx("circle",{cx:c,cy:c,r:i,fill:"none",stroke:"url(#progressGradient)",strokeWidth:f,strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:F,transform:`rotate(-90 ${c} ${c})`,className:"transition-all duration-700 ease-out"}),s&&n>0&&t.jsxs("g",{children:[t.jsx("circle",{cx:p,cy:h,r:"6",fill:"url(#indicatorGradient)",stroke:"rgba(255, 255, 255, 0.3)",strokeWidth:"1",className:"transition-all duration-700 ease-out"}),t.jsx("circle",{cx:p,cy:h,r:"3",fill:"#FFFFFF",className:"transition-all duration-700 ease-out"})]}),e&&t.jsxs("g",{children:[t.jsxs("text",{x:c,y:c-2,textAnchor:"middle",dominantBaseline:"middle",fontSize:"18",fontWeight:"700",fill:"currentColor",className:"select-none",children:[Math.round(n),"%"]}),t.jsx("text",{x:c,y:c+12,textAnchor:"middle",dominantBaseline:"middle",fontSize:"10",fill:"rgba(128, 128, 128, 0.7)",className:"select-none",children:"进度"})]})]})})});q.displayName="FigmaPercentageDonut";const X=(...o)=>o.filter(Boolean).join(" ");G.cva("relative",{variants:{size:{sm:"w-32 h-32",md:"w-48 h-48",lg:"w-64 h-64"}},defaultVariants:{size:"md"}});function z({value:o,maxValue:r=100,size:e=195,strokeWidth:s=12,showLabel:$=!0,labelFormat:a="value/max",customLabel:v,color:c,trackColor:i="rgba(255, 255, 255, 0.1)",showOuterBorder:f=!0,animated:d=!0,multiLayers:n,className:b,style:F}){const g=(e-s)/2,p=2*Math.PI*g,y=Math.min(Math.max(0,o),r)/r*100,l=p-y/100*p,m=()=>{switch(a){case"percent":return`${Math.round(y)}%`;case"value":return`${o}`;case"value/max":return`${o}/${r}`;case"custom":return v||"";default:return`${o}/${r}`}};return t.jsxs("div",{className:X("relative",b),style:{width:`${e}px`,height:`${e}px`,...F},children:[t.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,className:"transform -rotate-90",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"donutGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#6BB5FF",stopOpacity:"0.3"}),t.jsx("stop",{offset:"82%",stopColor:"#4F46E5"}),t.jsx("stop",{offset:"82.02%",stopColor:"transparent"}),t.jsx("stop",{offset:"100%",stopColor:"#6BB5FF",stopOpacity:"0.01"})]})}),f&&t.jsx("circle",{cx:e/2,cy:e/2,r:e/2-.5,fill:"none",stroke:"rgba(255, 255, 255, 1)",strokeWidth:"1"}),t.jsx("circle",{cx:e/2,cy:e/2,r:g,fill:"none",stroke:i,strokeWidth:s}),t.jsx("circle",{cx:e/2,cy:e/2,r:g,fill:"none",stroke:"url(#donutGradient)",strokeWidth:s,strokeLinecap:"round",strokeDasharray:p,strokeDashoffset:l,className:d?"transition-all duration-500 ease-out":""})]}),$&&t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[t.jsx("div",{className:"text-2xl font-medium text-foreground",children:m()}),a==="percent"&&t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"完成率"})]})]})}const tt=(...o)=>o.filter(Boolean).join(" ");G.cva("relative",{variants:{size:{sm:"w-32 h-32",md:"w-44 h-44",lg:"w-64 h-64"}},defaultVariants:{size:"md"}});function W(o){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:{r:0,g:0,b:0}}function rt(o,r,e,s,$,a=0){const v=A(o,r,e,$),c=A(o,r,e,s),i=$-s<=180?"0":"1";if(a>0){const f=A(o,r,a,$),d=A(o,r,a,s);return["M",v.x,v.y,"A",e,e,0,i,0,c.x,c.y,"L",d.x,d.y,"A",a,a,0,i,1,f.x,f.y,"Z"].join(" ")}else return["M",o,r,"L",v.x,v.y,"A",e,e,0,i,0,c.x,c.y,"Z"].join(" ")}function A(o,r,e,s){const $=(s-90)*Math.PI/180;return{x:o+e*Math.cos($),y:r+e*Math.sin($)}}function et({data:o,size:r=170,innerRadius:e=0,showOuterBorder:s=!0,className:$,style:a}){const v=o.reduce((n,b)=>n+b.value,0);let c=0;const i=o.map((n,b)=>{const F=c,g=n.value/v*360,p=c+g;return c=p,{...n,startAngle:F,endAngle:p,angle:g,index:b}}),f=r/2,d=r/2-2;return t.jsx("div",{className:tt("relative",$),style:{width:`${r}px`,height:`${r}px`,...a},children:t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[t.jsx("defs",{children:i.map(n=>{let b,F,g,p;n.gradient?(b=n.gradient.startColor,F=n.gradient.endColor,g=n.gradient.startOpacity||1,p=n.gradient.endOpacity||1):n.color?(b=n.color,F=n.color,g=1,p=1):(b="#6BB5FF",F="#4F46E5",g=1,p=1);const h=W(b),y=W(F);return t.jsx(L.Fragment,{children:t.jsxs("linearGradient",{id:`pieAngularGradient-${n.index}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%",gradientTransform:`rotate(${n.startAngle+n.angle/2} 0.5 0.5)`,children:[t.jsx("stop",{offset:"0%",stopColor:`rgba(${h.r}, ${h.g}, ${h.b}, ${g*.8})`}),t.jsx("stop",{offset:"50%",stopColor:`rgba(${h.r}, ${h.g}, ${h.b}, ${g})`}),t.jsx("stop",{offset:"100%",stopColor:`rgba(${y.r}, ${y.g}, ${y.b}, ${p})`})]})},n.index)})}),i.map(n=>t.jsx("path",{d:rt(f,f,d,n.startAngle,n.endAngle,e),fill:`url(#pieAngularGradient-${n.index})`,stroke:"rgba(255, 255, 255, 0.1)",strokeWidth:"1"},n.index)),s&&t.jsx("circle",{cx:f,cy:f,r:d,fill:"none",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"1"})]})})}const ot=(...o)=>o.filter(Boolean).join(" ");G.cva("relative",{variants:{size:{sm:"w-32 h-32",md:"w-48 h-48",lg:"w-64 h-64"}},defaultVariants:{size:"md"}});function nt({type:o="line",data:r,width:e=195,height:s=195,showGrid:$=!0,gridLines:a=4,yAxisLabels:v,xAxisLabels:c,showDots:i=!0,showValues:f=!1,lineColor:d="#6BB5FF",lineThickness:n=2,barColor:b="#6BB5FF",className:F,style:g}){const p={top:20,right:20,bottom:20,left:40},h=e-p.left-p.right,y=s-p.top-p.bottom,l=Math.max(...r),m=Math.min(...r,0),w=l-m,M=r.map((j,x)=>{const u=x/(r.length-1)*h,C=y-(j-m)/w*y;return{x:u,y:C,value:j}}),_=()=>o==="area"?`${M.reduce((x,u,C)=>C===0?`M ${u.x} ${u.y}`:`${x} L ${u.x} ${u.y}`,"")} L ${M[M.length-1].x} ${y} L 0 ${y} Z`:M.reduce((j,x,u)=>{if(u===0)return`M ${x.x} ${x.y}`;const C=M[u-1],k=C.x+(x.x-C.x)/2,B=k;return`${j} C ${k} ${C.y}, ${B} ${x.y}, ${x.x} ${x.y}`},""),Z=()=>t.jsxs(t.Fragment,{children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"lineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[t.jsx("stop",{offset:"0%",stopColor:"#6BB5FF"}),t.jsx("stop",{offset:"100%",stopColor:"#4F46E5"})]}),o==="area"&&t.jsxs("linearGradient",{id:"areaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:d,stopOpacity:"0.3"}),t.jsx("stop",{offset:"100%",stopColor:d,stopOpacity:"0"})]})]}),t.jsx("path",{d:_(),fill:o==="area"?"url(#areaGradient)":"none",stroke:o==="area"?"none":d,strokeWidth:o==="area"?0:n,strokeLinecap:"round",strokeLinejoin:"round"}),i&&o!=="area"&&M.map((j,x)=>t.jsx("circle",{cx:j.x,cy:j.y,r:"4",fill:"#ffffff",stroke:d,strokeWidth:"2"},x)),f&&M.map((j,x)=>t.jsx("text",{x:j.x,y:j.y-10,textAnchor:"middle",fontSize:"11",fill:"currentColor",fontWeight:"500",children:j.value},x))]}),U=()=>{const j=h/r.length*.7,x=h/r.length*.3;return t.jsxs(t.Fragment,{children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"barVerticalGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#6BB5FF"}),t.jsx("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:"0"})]})}),M.map((u,C)=>{const k=(u.value-m)/w*y,B=C*(j+x),P=y-k;return t.jsxs("g",{children:[t.jsx("rect",{x:B,y:P,width:j,height:k,fill:"url(#barVerticalGradient)",opacity:"0.8",rx:"2"}),f&&t.jsx("text",{x:B+j/2,y:P-5,textAnchor:"middle",fontSize:"12",fontWeight:"500",fill:"currentColor",children:u.value})]},C)})]})},J=()=>{const j=y/r.length*.7,x=y/r.length*.3;return t.jsxs(t.Fragment,{children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"barGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[t.jsx("stop",{offset:"0%",stopColor:"#6BB5FF"}),t.jsx("stop",{offset:"100%",stopColor:"#4F46E5"})]})}),M.map((u,C)=>{const k=u.value/l*h,B=C*(j+x);return t.jsxs("g",{children:[t.jsx("rect",{x:0,y:B,width:k,height:j,fill:"url(#barGradient)",rx:"2",className:"transition-all duration-300 hover:opacity-100 hover:brightness-110",style:{opacity:C%2===0?1:.7}}),f&&t.jsx("text",{x:k+5,y:B+j/2,textAnchor:"start",dominantBaseline:"middle",fontSize:"11",fill:"currentColor",fontWeight:"500",children:u.value})]},C)}),c&&c.map((u,C)=>{const k=C/(c.length-1)*h;return t.jsx("text",{x:k,y:y+15,textAnchor:"middle",fontSize:"12",fill:"currentColor",children:u},C)})]})};return t.jsx("div",{className:ot("relative",F),style:{width:`${e}px`,height:`${s}px`,...g},children:t.jsxs("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"gridLineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FAFAFA"}),t.jsx("stop",{offset:"100%",stopColor:"#ffffff"})]})}),t.jsxs("g",{transform:`translate(${p.left}, ${p.top})`,children:[$&&o!=="horizontal-bar"&&Array.from({length:a+1}).map((j,x)=>{const u=x/a*y;return t.jsx("line",{x1:"0",y1:u,x2:h,y2:u,stroke:"url(#gridLineGradient)",strokeWidth:"1",strokeDasharray:"0.1 4",strokeLinecap:"round",opacity:"0.3"},x)}),$&&o==="horizontal-bar"&&Array.from({length:a+1}).map((j,x)=>{const u=x/a*h;return t.jsx("line",{x1:u,y1:"0",x2:u,y2:y,stroke:"rgba(0,0,0,0.1)",strokeWidth:"1"},x)}),v&&o!=="horizontal-bar"&&v.map((j,x)=>{const u=x/(v.length-1)*y;return t.jsx("text",{x:"-10",y:u,textAnchor:"end",dominantBaseline:"middle",fontSize:"12",fill:"currentColor",children:j},x)}),o==="bar"?U():o==="horizontal-bar"?J():Z()]})]})})}exports.DonutChart=z;exports.FigmaDonutChart=S;exports.FigmaMultiLayerDonut=V;exports.FigmaPercentageDonut=q;exports.FigmaPredictiveChart=T;exports.MiniChart=nt;exports.PieChart=et;exports.cn=D;exports.figmaDonutChartVariants=R;exports.figmaMultiLayerDonutVariants=I;exports.figmaPercentageDonutVariants=H;exports.figmaPredictiveChartVariants=E;