@cleen/ui 0.1.201 → 0.1.203
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/index.d.ts +11 -2
- package/dist/charts/index.js +3 -3
- package/dist/index.d.ts +83 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/charts/index.d.ts
CHANGED
|
@@ -128,6 +128,14 @@ type FootballFieldSeriesItem = {
|
|
|
128
128
|
striped?: boolean;
|
|
129
129
|
/** Bar color; falls back to the default range color */
|
|
130
130
|
color?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Renders the row as a single dot marker at this value instead of a
|
|
133
|
+
* low-to-high bar. `[from, to]` still defines the invisible hover area that
|
|
134
|
+
* triggers the tooltip, and `color` colors the dot.
|
|
135
|
+
*/
|
|
136
|
+
point?: number;
|
|
137
|
+
/** Dot diameter in px for a `point` row */
|
|
138
|
+
pointSize?: number;
|
|
131
139
|
};
|
|
132
140
|
type FootballFieldHighlightRange = {
|
|
133
141
|
from: number;
|
|
@@ -159,8 +167,9 @@ interface FootballFieldChartProps extends Omit<ChartProps, 'type' | 'series' | '
|
|
|
159
167
|
/**
|
|
160
168
|
* Football field chart built on ApexCharts horizontal range bars.
|
|
161
169
|
* Each series item renders as a single low-to-high bar on a shared numeric
|
|
162
|
-
* value axis; pass `striped` for a diagonal pattern fill and
|
|
163
|
-
*
|
|
170
|
+
* value axis; pass `striped` for a diagonal pattern fill (stripes and outline
|
|
171
|
+
* darken on hover), `point` to render a row as a single dot marker instead of
|
|
172
|
+
* a bar, and `highlightRange` for a shaded band spanning the full chart height.
|
|
164
173
|
*/
|
|
165
174
|
declare const FootballFieldChart: react.ForwardRefExoticComponent<FootballFieldChartProps & react.RefAttributes<ReactApexChart>>;
|
|
166
175
|
|
package/dist/charts/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cn as Xe}from"@cleen/ui-core";import{forwardRef as Ke}from"react";import{renderToStaticMarkup as Ve}from"react-dom/server";import je from"react-apexcharts";var q={chart:{toolbar:{show:!0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}},animations:{enabled:!0}},dataLabels:{enabled:!1},stroke:{curve:"smooth",width:2},xaxis:{labels:{style:{fontSize:"12px"}}},yaxis:{labels:{style:{fontSize:"12px"}}},legend:{position:"top",horizontalAlign:"left"},tooltip:{enabled:!0,theme:"light"}};import{jsx as le}from"react/jsx-runtime";var Ye="[&_.apexcharts-tooltip]:!cleen-bg-transparent [&_.apexcharts-tooltip]:!cleen-border-0 [&_.apexcharts-tooltip]:!cleen-shadow-none [&_.apexcharts-tooltip]:!cleen-p-0 [&_.apexcharts-tooltip]:!cleen-overflow-visible [&_.apexcharts-tooltip]:!cleen-whitespace-normal",se=Ke(function({type:t="line",series:r,options:n={},width:c="100%",height:b=350,className:g,style:x,renderTooltip:p},k){let N=p?{...n.tooltip,custom:(s=>{let S=p({seriesIndex:s.seriesIndex,dataPointIndex:s.dataPointIndex,series:s.series,w:s.w});return S?Ve(S):""})}:n.tooltip,o={...q,...n,chart:{...q.chart,...n.chart,type:t},...N?{tooltip:N}:{}},T=!!o.tooltip?.custom;return le("div",{className:Xe("cleen",T&&Ye,g),style:x,children:le(je,{options:o,series:r,type:t,width:c,height:b,ref:k})})}),P=se;import{applyDefaults as qe}from"@cleen/ui-core";import{forwardRef as Ze}from"react";var pe={chart:{type:"bar",zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1},fontFamily:"inherit",background:"transparent",parentHeightOffset:0},dataLabels:{enabled:!1},legend:{show:!1}};import{jsx as Qe}from"react/jsx-runtime";var Je=Ze(function({options:t,...r},n){return Qe(P,{type:"bar",ref:n,options:qe(pe,t??{}),...r})});import{applyDefaults as z}from"@cleen/ui-core";import{forwardRef as et,useMemo as M}from"react";import{ColorHelpers as B}from"@cleen/ui-core";var ce={marker:{size:2,fillColor:"rgba(var(--cleen-gray-500))",strokeColor:"rgba(var(--cleen-gray-500))",offsetY:-16,shape:"triangle"},label:{borderWidth:0,offsetY:-20,style:{color:"rgba(var(--cleen-gray-500))",background:"transparent",fontSize:"11px"}}},de={label:{borderColor:"transparent",style:{color:"rgba(var(--cleen-white))",background:"rgba(var(--cleen-primary))"}},fillColor:"rgba(var(--cleen-primary))"},ue={label:{borderWidth:0,offsetY:-15,orientation:"horizontal",style:{color:"rgba(var(--cleen-primary))",background:"transparent",fontSize:"16px",fontWeight:700}},borderColor:"rgba(var(--cleen-primary))"},me={marker:{size:8,fillColor:"rgba(var(--cleen-primary))",strokeColor:"rgba(var(--cleen-white))"}},fe={chart:{zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1}},stroke:{curve:"monotoneCubic",width:2.5},colors:[B.getComputedColor("var(--cleen-error)"),B.getComputedColor("var(--cleen-primary)"),B.getComputedColor("var(--cleen-success)")],fill:{type:"gradient",gradient:{shade:"light",type:"vertical",shadeIntensity:.6,gradientToColors:[B.getComputedColor("var(--cleen-error)")||"",B.getComputedColor("var(--cleen-primary)")||"",B.getComputedColor("var(--cleen-success)")||""],inverseColors:!1,opacityFrom:.95,opacityTo:.6}},yaxis:{show:!1},tooltip:{enabled:!0,x:{formatter:function(e){return`Score: ${typeof e=="string"?Number(e):e}`}},y:{formatter:function(e){return`${Number(e).toFixed(4)}`}}},grid:{show:!1},legend:{show:!1}};var he=(e,t)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:e-3*t,rightSigma:e+2*t,right2Sigma:e+2*t,right:e+3*t}),ge=(e,t,r,n)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:r,rightSigma:e+t,right2Sigma:e+2*t,right:n}),ye=(e,t)=>{let r={};switch(e.type){case"range":r={x:t[e.x],x2:t[e.x2]};break;case"offset":r={x:e.x-e.offset,x2:e.x+e.offset};break;case"region":e.x>=t.left&&e.x<t.left2Sigma?r={x:t.left,x2:t.left2Sigma}:e.x>=t.left2Sigma&&e.x<t.leftSigma?r={x:t.left2Sigma,x2:t.leftSigma}:e.x>=t.leftSigma&&e.x<t.middle?r={x:t.leftSigma,x2:t.middle}:e.x>=t.middle&&e.x<t.rightSigma?r={x:t.middle,x2:t.rightSigma}:e.x>=t.rightSigma&&e.x<t.right2Sigma?r={x:t.rightSigma,x2:t.right2Sigma}:e.x>=t.right2Sigma&&e.x<t.right&&(r={x:t.right2Sigma,x2:t.right});break;default:r={x:e.x,x2:e.x2};break}return r};import{jsx as rt}from"react/jsx-runtime";var tt=et(function({serie:t,labels:r,sigma:n,pointAnnotations:c,rangeAnnotations:b,highlightAnnotations:g,options:x,height:p=360,...k},N){let o=M(()=>t.sort((l,f)=>l.x-f.x),[t]),T=M(()=>{let l=new Map;return t.forEach(f=>l.set(f.x,f.y)),l},[t]),s=o[Math.floor(o.length/2)],S=M(()=>{let{below:l,middle:f,above:y}=t.reduce((u,a)=>(a.x<s.x-2*n?u.below.push(a):a.x>=s.x+2*n?(a.x===s.x+2*n&&u.middle.push(a),u.above.push(a)):(a.x===s.x-2*n&&u.below.push(a),u.middle.push(a)),u),{below:[],middle:[],above:[]});return[{name:r?.below||"Below threshold",data:l},{name:r?.middle||"Middle grounds",data:f},{name:r?.above||"Above threshold",data:y}]},[n,t,r,s]),v=M(()=>{if(!c)return[];let l=he(s.x,n);return Object.entries(c).map(([f,y])=>{let u=l[f];return{x:u,y:T.get(u)||0,...z(ce,y)}})},[c,n,T]),C=M(()=>{if(!b)return[];let l=ge(s.x,n,o[0].x,o[o.length-1].x);return b.map(f=>{let y=ye(f,l);return{...z(de,f),...y}})},[b,n,o]),{highlightPointAnnotations:R,highlightLineAnnotations:i}=M(()=>{if(!g)return{highlightLineAnnotations:[],highlightPointAnnotations:[]};let l=[],f=[],y=({x:a,line:h})=>{f.push(z(ue,{x:a,...h}))},u=({x:a,y:h,point:m})=>{l.push(z(me,{x:a,y:h,...m}))};return g?.forEach(a=>{switch(a.show){case"line":y(a);break;case"point":u(a);break;case"both":y(a),u(a);break;default:break}}),{highlightPointAnnotations:l,highlightLineAnnotations:f}},[g]);return rt(P,{series:S,options:{...z(fe,x),annotations:{...x?.annotations,points:[...v,...R,...x?.annotations?.points||[]],xaxis:[...C,...i,...x?.annotations?.xaxis||[]]}},height:p,ref:N,type:"area",...k})});import{applyDefaults as Ae}from"@cleen/ui-core";import{forwardRef as nt,useMemo as Z}from"react";var xe="rgba(var(--cleen-primary-300))",be="rgba(var(--cleen-primary-500))";var Ce={style:"slantedLines",width:12,height:12,strokeWidth:2},Se={chart:{type:"rangeBar",zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1},fontFamily:"inherit",background:"transparent",parentHeightOffset:0},plotOptions:{bar:{horizontal:!0,barHeight:"50%",rangeBarGroupRows:!0,borderRadius:2}},dataLabels:{enabled:!1},legend:{show:!1},grid:{borderColor:"rgba(var(--cleen-gray-200))",xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},xaxis:{type:"numeric",tickAmount:8,axisBorder:{show:!1},axisTicks:{show:!1},labels:{style:{colors:"rgba(var(--cleen-gray-500))",fontSize:"12px"}}},yaxis:{labels:{style:{colors:"rgba(var(--cleen-gray-700))",fontSize:"12px"}}},tooltip:{enabled:!0,theme:"light"}};import{jsx as J,jsxs as ve}from"react/jsx-runtime";var at=nt(function({series:t,highlightRange:r,classNames:n,styles:c,options:b,height:g=320,formatXValue:x,renderTooltip:p,...k},N){let o=Z(()=>t.map(({category:S,from:v,to:C})=>({name:S,data:[{x:S,y:[v,C]}]})),[t]),T=Z(()=>{let S=p??(v=>{let C=R=>R==null?"":x?.(R)??String(R);return ve("div",{className:"cleen-p-2 cleen-bg-white cleen-border cleen-border-gray-200 cleen-rounded cleen-shadow",children:[J("strong",{className:"cleen-text-gray-900",children:v.category}),J("br",{}),ve("p",{className:"cleen-text-gray-900",children:[C(v.from)," - ",C(v.to)]})]})});return({seriesIndex:v})=>{let C=t[v];return C?S(C):null}},[t,p,x]),s=Z(()=>{let S=t.map(C=>C.color??xe),v=t.map(C=>C.striped?"pattern":"solid");return{colors:S,fill:{type:v,opacity:1,pattern:Ce},xaxis:{labels:{formatter:x}},...r?{annotations:{xaxis:r.map(({from:C,to:R,color:i,opacity:l})=>({x:C,x2:R,fillColor:i??be,opacity:l??.12,borderColor:"transparent"}))}}:{}}},[t,r,x]);return J(P,{type:"rangeBar",ref:N,series:o,options:Ae(Ae(Se,s),b??{}),height:g,className:n?.container,style:c?.container,renderTooltip:T,...k})});import{applyDefaults as it}from"@cleen/ui-core";import{forwardRef as lt}from"react";var ke={chart:{type:"radar",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:2},fill:{opacity:.25},markers:{size:4,colors:"transparent",strokeColors:"transparent"},tooltip:{marker:{show:!1}},legend:{show:!1}};import{jsx as pt}from"react/jsx-runtime";var st=lt(function({options:t,...r},n){return pt(P,{type:"radar",ref:n,options:it(ke,t),...r})});import{applyDefaults as ct,cn as G}from"@cleen/ui-core";import{useId as dt,useMemo as U,useRef as ut,useState as mt}from"react";import{Layer as _e,Tooltip as ft,Rectangle as Te,ResponsiveContainer as ht,Sankey as gt}from"recharts";var I={width:"100%",height:420,nodePadding:24,enableToolbar:!1,enableTooltip:!0,highlightOnHover:!0,dimOnHover:!0,dimOpacity:.2,edgeOpacity:.4,edgeGradientFill:!0,nodeWidth:20,nodeBorderWidth:0,nodeBorderColor:null,align:"justify",fontColor:"rgba(var(--cleen-neutral-800, 38, 38, 38))",tooltipBGColor:"rgba(var(--cleen-white))",tooltipBorderColor:"rgba(var(--cleen-gray-200))"};import{Fragment as Et,jsx as O,jsxs as $}from"react/jsx-runtime";var yt=typeof I.height=="number"?I.height:420,Oe=40,Ne=60,Re=8,xt=8,bt="cleen-min-w-[220px] cleen-max-w-[min(360px,90vw)] cleen-flex cleen-flex-col cleen-gap-2",Q="cleen-m-0 cleen-text-xs cleen-leading-[18px] cleen-whitespace-pre-line cleen-break-words",Ct="cleen-font-semibold",St="cleen-font-medium cleen-text-[13px] cleen-mt-1 cleen-opacity-[0.72]",At="cleen-font-medium cleen-text-[13px] cleen-mt-[6px]";function vt(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=e.trim();if(!t.endsWith("%")&&t!=="auto"){let r=Number.parseFloat(t);if(Number.isFinite(r))return r}}return yt}function we(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e}function kt(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e&&"index"in e&&"name"in e}var Pe=["rgba(var(--cleen-primary, 59, 130, 246))","rgba(var(--cleen-success, 34, 197, 94))","rgba(var(--cleen-warning, 245, 158, 11))","rgba(var(--cleen-error, 239, 68, 68))","rgba(var(--cleen-purple, 147, 51, 234))","rgba(var(--cleen-cyan, 6, 182, 212))","rgba(var(--cleen-orange, 249, 115, 22))","rgba(var(--cleen-pink, 236, 72, 153))","rgba(var(--cleen-teal, 20, 184, 166))","rgba(var(--cleen-indigo, 99, 102, 241))","rgba(var(--cleen-rose, 244, 63, 94))","rgba(var(--cleen-amber, 245, 158, 11))"];function He(e){return e!=null}function Tt(e,t){return[e.source,e.target,e.type??"",e.label??"",e.value,t].join("-").replace(/\s+/g,"_")}function X(e,t){return typeof e=="object"&&e!==null?e.id:t}function Le(e,t){return typeof e=="object"&&e!==null?e.title:t}function ee(e){return typeof e=="object"&&e!==null&&"edgeKey"in e&&"sourceId"in e&&"targetId"in e}function te(e){return typeof e=="object"&&e!==null&&"payload"in e}function Fe(e){if(te(e))return Fe(e.payload);if(ee(e)||kt(e))return e}function re(...e){return e.map(t=>typeof t=="number"?String(t):t?.trim()??"").find(t=>t.length>0)}function Ie(e){let t=re(e);if(t)return/[\p{L}\p{N}]/u.test(t)?t:void 0}function Be(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function D(e){let t=e.match(/^rgba\((var\(.+\)),\s*([0-9]*\.?[0-9]+)\)$/i);if(t)return{color:`rgb(${t[1]})`,opacity:Number.parseFloat(t[2])};let r=e.match(/^rgba\((var\(.+\))\)$/i);if(r)return{color:`rgb(${r[1]})`,opacity:1};let n=e.match(/^rgba\(\s*(\d+\s*,\s*\d+\s*,\s*\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/i);return n?{color:`rgb(${n[1]})`,opacity:Number.parseFloat(n[2])}:{color:e,opacity:1}}function oe(e,t){return D(t??Pe[e%Pe.length])}function Ee(e){return e.length*xt}function Ot(e){let t=new Set,r=new Set([e.id]);for(let n of[...e.sourceLinks??[],...e.targetLinks??[]])t.add(n.edgeKey),r.add(X(n.source,n.sourceId)),r.add(X(n.target,n.targetId));return{activeLinkKeys:t,activeNodeIds:r}}function Nt(e){return{activeLinkKeys:new Set([e.edgeKey]),activeNodeIds:new Set([X(e.source,e.sourceId),X(e.target,e.targetId)])}}function Rt(e,t,r,n,c){return!e||e.activeNodeIds.has(t)?1:n?c??I.dimOpacity??.2:r?.55:1}function wt(e,t,r,n,c,b){return e?e.activeLinkKeys.has(t)?n?Math.max(r,.9):r:c?b??I.dimOpacity??.2:n?Math.min(r,.3):r:r}var Pt=({dimOnHover:e,dimOpacity:t,fontColor:r,x:n,y:c,width:b,height:g,highlightOnHover:x,hoverState:p,index:k,outgoingEdgesById:N,payload:o,stroke:T,strokeWidth:s})=>{if(o===void 0||n===void 0||c===void 0||b===void 0||g===void 0||k===void 0)return null;let S=N?.get(o.id)??[],v=S.length>0,C=oe(k,o.color),R=D(r),i=Rt(p,o.id,x,e,t),l=new Set(S.map(h=>h.color).filter(He)),f=Array.from(l)[0],y=v&&S.length>1&&l.size>1&&l.size===S.length,u=y?S:[],a=u.reduce((h,m)=>h+(m.value??0),0);return $(_e,{children:[y&&a>0?u.map((h,m)=>{let d=u.slice(0,m).reduce((H,F)=>H+(F.value??0),0),A=c+d/a*g,w=(h.value??0)/a*g,L=D(h.color??C.color),E=m===0,_=m===u.length-1;return O(Te,{x:n,y:A,width:b,height:w,fill:L.color,fillOpacity:L.opacity*i,stroke:T,strokeWidth:s,radius:[E?2:0,E?2:0,_?2:0,_?2:0]},`${h.source}-${h.target}-${m}`)}):O(Te,{x:n,y:c,width:b,height:g,fill:v&&l.size===1?D(f??C.color).color:C.color,fillOpacity:(v&&l.size===1?D(f??C.color).opacity:C.opacity)*i,stroke:T,strokeWidth:s,radius:[2,2,2,2]}),O("text",{textAnchor:v?"end":"start",x:v?n-8:n+b+8,y:c+g/2,dy:"0.35em",fontSize:"14",fill:R.color,fillOpacity:R.opacity*i,fontWeight:600,children:o.name})]},`CustomNode${k}`)},Lt=({sourceX:e,targetX:t,sourceY:r,targetY:n,sourceControlX:c,targetControlX:b,linkWidth:g,index:x,payload:p,opacity:k,chartId:N,dimOnHover:o,dimOpacity:T,edgeGradientFill:s,highlightOnHover:S,hoverState:v})=>{if(p===void 0||e===void 0||t===void 0||r===void 0||n===void 0||c===void 0||b===void 0||g===void 0)return null;let C=k??I.edgeOpacity??.4,R=wt(v,p.edgeKey,C,S,o,T),i=p.color?D(p.color):null,l=i??oe(typeof p.source=="object"?p.source.index:0,typeof p.source=="object"?p.source.color:void 0),f=i??oe(typeof p.target=="object"?p.target.index:1,typeof p.target=="object"?p.target.color:void 0),y=Be(`linkGradient-${N}-${p.edgeKey}-${x??p.value}`),u=s!==!1&&i===null;return $(_e,{children:[u?O("defs",{children:$("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[O("stop",{offset:"0%",stopColor:l.color,stopOpacity:l.opacity*R}),O("stop",{offset:"100%",stopColor:f.color,stopOpacity:f.opacity*R})]})}):null,O("path",{d:`
|
|
1
|
+
import{cn as je}from"@cleen/ui-core";import{forwardRef as Ze}from"react";import{renderToStaticMarkup as Ye}from"react-dom/server";import qe from"react-apexcharts";var J={chart:{toolbar:{show:!0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}},animations:{enabled:!0}},dataLabels:{enabled:!1},stroke:{curve:"smooth",width:2},xaxis:{labels:{style:{fontSize:"12px"}}},yaxis:{labels:{style:{fontSize:"12px"}}},legend:{position:"top",horizontalAlign:"left"},tooltip:{enabled:!0,theme:"light"}};import{jsx as de}from"react/jsx-runtime";var Je="[&_.apexcharts-tooltip]:!cleen-bg-transparent [&_.apexcharts-tooltip]:!cleen-border-0 [&_.apexcharts-tooltip]:!cleen-shadow-none [&_.apexcharts-tooltip]:!cleen-p-0 [&_.apexcharts-tooltip]:!cleen-overflow-visible [&_.apexcharts-tooltip]:!cleen-whitespace-normal",ue=Ze(function({type:t="line",series:r,options:n={},width:m="100%",height:b=350,className:y,style:x,renderTooltip:u},S){let k=u?{...n.tooltip,custom:(d=>{let A=u({seriesIndex:d.seriesIndex,dataPointIndex:d.dataPointIndex,series:d.series,w:d.w});return A?Ye(A):""})}:n.tooltip,o={...J,...n,chart:{...J.chart,...n.chart,type:t},...k?{tooltip:k}:{}},T=!!o.tooltip?.custom;return de("div",{className:je("cleen",T&&Je,y),style:x,children:de(qe,{options:o,series:r,type:t,width:m,height:b,ref:S})})}),w=ue;import{applyDefaults as Qe}from"@cleen/ui-core";import{forwardRef as et}from"react";var me={chart:{type:"bar",zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1},fontFamily:"inherit",background:"transparent",parentHeightOffset:0},dataLabels:{enabled:!1},legend:{show:!1}};import{jsx as rt}from"react/jsx-runtime";var tt=et(function({options:t,...r},n){return rt(w,{type:"bar",ref:n,options:Qe(me,t??{}),...r})});import{applyDefaults as G}from"@cleen/ui-core";import{forwardRef as ot,useMemo as $}from"react";import{ColorHelpers as M}from"@cleen/ui-core";var fe={marker:{size:2,fillColor:"rgba(var(--cleen-gray-500))",strokeColor:"rgba(var(--cleen-gray-500))",offsetY:-16,shape:"triangle"},label:{borderWidth:0,offsetY:-20,style:{color:"rgba(var(--cleen-gray-500))",background:"transparent",fontSize:"11px"}}},he={label:{borderColor:"transparent",style:{color:"rgba(var(--cleen-white))",background:"rgba(var(--cleen-primary))"}},fillColor:"rgba(var(--cleen-primary))"},ge={label:{borderWidth:0,offsetY:-15,orientation:"horizontal",style:{color:"rgba(var(--cleen-primary))",background:"transparent",fontSize:"16px",fontWeight:700}},borderColor:"rgba(var(--cleen-primary))"},ye={marker:{size:8,fillColor:"rgba(var(--cleen-primary))",strokeColor:"rgba(var(--cleen-white))"}},xe={chart:{zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1}},stroke:{curve:"monotoneCubic",width:2.5},colors:[M.getComputedColor("var(--cleen-error)"),M.getComputedColor("var(--cleen-primary)"),M.getComputedColor("var(--cleen-success)")],fill:{type:"gradient",gradient:{shade:"light",type:"vertical",shadeIntensity:.6,gradientToColors:[M.getComputedColor("var(--cleen-error)")||"",M.getComputedColor("var(--cleen-primary)")||"",M.getComputedColor("var(--cleen-success)")||""],inverseColors:!1,opacityFrom:.95,opacityTo:.6}},yaxis:{show:!1},tooltip:{enabled:!0,x:{formatter:function(e){return`Score: ${typeof e=="string"?Number(e):e}`}},y:{formatter:function(e){return`${Number(e).toFixed(4)}`}}},grid:{show:!1},legend:{show:!1}};var be=(e,t)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:e-3*t,rightSigma:e+2*t,right2Sigma:e+2*t,right:e+3*t}),Ce=(e,t,r,n)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:r,rightSigma:e+t,right2Sigma:e+2*t,right:n}),Se=(e,t)=>{let r={};switch(e.type){case"range":r={x:t[e.x],x2:t[e.x2]};break;case"offset":r={x:e.x-e.offset,x2:e.x+e.offset};break;case"region":e.x>=t.left&&e.x<t.left2Sigma?r={x:t.left,x2:t.left2Sigma}:e.x>=t.left2Sigma&&e.x<t.leftSigma?r={x:t.left2Sigma,x2:t.leftSigma}:e.x>=t.leftSigma&&e.x<t.middle?r={x:t.leftSigma,x2:t.middle}:e.x>=t.middle&&e.x<t.rightSigma?r={x:t.middle,x2:t.rightSigma}:e.x>=t.rightSigma&&e.x<t.right2Sigma?r={x:t.rightSigma,x2:t.right2Sigma}:e.x>=t.right2Sigma&&e.x<t.right&&(r={x:t.right2Sigma,x2:t.right});break;default:r={x:e.x,x2:e.x2};break}return r};import{jsx as at}from"react/jsx-runtime";var nt=ot(function({serie:t,labels:r,sigma:n,pointAnnotations:m,rangeAnnotations:b,highlightAnnotations:y,options:x,height:u=360,...S},k){let o=$(()=>t.sort((i,s)=>i.x-s.x),[t]),T=$(()=>{let i=new Map;return t.forEach(s=>i.set(s.x,s.y)),i},[t]),d=o[Math.floor(o.length/2)],A=$(()=>{let{below:i,middle:s,above:l}=t.reduce((c,a)=>(a.x<d.x-2*n?c.below.push(a):a.x>=d.x+2*n?(a.x===d.x+2*n&&c.middle.push(a),c.above.push(a)):(a.x===d.x-2*n&&c.below.push(a),c.middle.push(a)),c),{below:[],middle:[],above:[]});return[{name:r?.below||"Below threshold",data:i},{name:r?.middle||"Middle grounds",data:s},{name:r?.above||"Above threshold",data:l}]},[n,t,r,d]),O=$(()=>{if(!m)return[];let i=be(d.x,n);return Object.entries(m).map(([s,l])=>{let c=i[s];return{x:c,y:T.get(c)||0,...G(fe,l)}})},[m,n,T]),R=$(()=>{if(!b)return[];let i=Ce(d.x,n,o[0].x,o[o.length-1].x);return b.map(s=>{let l=Se(s,i);return{...G(he,s),...l}})},[b,n,o]),{highlightPointAnnotations:N,highlightLineAnnotations:p}=$(()=>{if(!y)return{highlightLineAnnotations:[],highlightPointAnnotations:[]};let i=[],s=[],l=({x:a,line:f})=>{s.push(G(ge,{x:a,...f}))},c=({x:a,y:f,point:g})=>{i.push(G(ye,{x:a,y:f,...g}))};return y?.forEach(a=>{switch(a.show){case"line":l(a);break;case"point":c(a);break;case"both":l(a),c(a);break;default:break}}),{highlightPointAnnotations:i,highlightLineAnnotations:s}},[y]);return at(w,{series:A,options:{...G(xe,x),annotations:{...x?.annotations,points:[...O,...N,...x?.annotations?.points||[]],xaxis:[...R,...p,...x?.annotations?.xaxis||[]]}},height:u,ref:k,type:"area",...S})});import{applyDefaults as ke,cn as pt}from"@cleen/ui-core";import{forwardRef as ct,useId as dt,useMemo as te}from"react";var Q="rgba(var(--cleen-primary-300))",Te="rgba(var(--cleen-primary-500))";var ee="rgba(var(--cleen-primary-900))";var Ae={style:"slantedLines",width:12,height:12,strokeWidth:2},ve={chart:{type:"rangeBar",zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1},fontFamily:"inherit",background:"transparent",parentHeightOffset:0},plotOptions:{bar:{horizontal:!0,barHeight:"50%",rangeBarGroupRows:!0,borderRadius:2}},dataLabels:{enabled:!1},legend:{show:!1},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},grid:{borderColor:"rgba(var(--cleen-gray-200))",xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},xaxis:{type:"numeric",tickAmount:8,axisBorder:{show:!1},axisTicks:{show:!1},labels:{style:{colors:"rgba(var(--cleen-gray-500))",fontSize:"12px"}}},yaxis:{labels:{style:{colors:"rgba(var(--cleen-gray-700))",fontSize:"12px"}}},tooltip:{enabled:!0,theme:"light"}};import{Fragment as Oe,jsx as L,jsxs as re}from"react/jsx-runtime";var ut=ct(function({series:t,highlightRange:r,classNames:n,styles:m,options:b,height:y=320,formatXValue:x,renderTooltip:u,...S},k){let o=te(()=>t.map(({category:i,from:s,to:l,point:c,pointSize:a,color:f})=>({name:i,data:[{x:i,y:[s,l],...c!=null?{goals:[{value:c,strokeHeight:0,strokeWidth:a??22,strokeLineCap:"round",strokeColor:f??Q}]}:{}}]})),[t]),T=te(()=>{let i=u??(s=>{let l=c=>c==null?"":x?.(c)??String(c);return re("div",{className:"cleen-p-2 cleen-bg-white cleen-border cleen-border-gray-200 cleen-rounded cleen-shadow",children:[L("strong",{className:"cleen-text-gray-900",children:s.category}),L("br",{}),L("p",{className:"cleen-text-gray-900",children:s.point!=null?l(s.point):`${l(s.from)} - ${l(s.to)}`})]})});return({seriesIndex:s})=>{let l=t[s];return l?i(l):null}},[t,u,x]),d=te(()=>{let i=t.map(l=>l.point!=null?"rgba(0, 0, 0, 0)":l.color??Q),s=t.map(l=>l.striped?"pattern":"solid");return{colors:i,fill:{type:s,opacity:1,pattern:Ae},xaxis:{labels:{formatter:x}},...r?{annotations:{xaxis:r.map(({from:l,to:c,color:a,opacity:f})=>({x:l,x2:c,fillColor:a??Te,opacity:f??.12,borderColor:"transparent"}))}}:{}}},[t,r,x]),O=`cleen-ff-${dt().replace(/[^a-zA-Z0-9]/g,"")}`,R=`${O}-stripes`,N=t.some(i=>i.striped),p=`.${O} .apexcharts-rangebar-area[fill^="url("]:hover{fill:url(#${R});stroke:${ee}}`;return re(Oe,{children:[N&&re(Oe,{children:[L("svg",{"aria-hidden":"true",focusable:"false",style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:L("defs",{children:L("pattern",{id:R,width:12,height:12,patternUnits:"userSpaceOnUse",children:L("line",{x1:0,y1:0,x2:12,y2:12,strokeWidth:2,style:{stroke:ee}})})})}),L("style",{dangerouslySetInnerHTML:{__html:p}})]}),L(w,{type:"rangeBar",ref:k,series:o,options:ke(ke(ve,d),b??{}),height:y,className:pt(O,n?.container),style:m?.container,renderTooltip:T,...S})]})});import{applyDefaults as mt}from"@cleen/ui-core";import{forwardRef as ft}from"react";var Re={chart:{type:"radar",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:2},fill:{opacity:.25},markers:{size:4,colors:"transparent",strokeColors:"transparent"},tooltip:{marker:{show:!1}},legend:{show:!1}};import{jsx as gt}from"react/jsx-runtime";var ht=ft(function({options:t,...r},n){return gt(w,{type:"radar",ref:n,options:mt(Re,t),...r})});import{applyDefaults as yt,cn as W}from"@cleen/ui-core";import{useId as xt,useMemo as X,useRef as bt,useState as Ct}from"react";import{Layer as Be,Tooltip as St,Rectangle as Ne,ResponsiveContainer as Tt,Sankey as At}from"recharts";var E={width:"100%",height:420,nodePadding:24,enableToolbar:!1,enableTooltip:!0,highlightOnHover:!0,dimOnHover:!0,dimOpacity:.2,edgeOpacity:.4,edgeGradientFill:!0,nodeWidth:20,nodeBorderWidth:0,nodeBorderColor:null,align:"justify",fontColor:"rgba(var(--cleen-neutral-800, 38, 38, 38))",tooltipBGColor:"rgba(var(--cleen-white))",tooltipBorderColor:"rgba(var(--cleen-gray-200))"};import{Fragment as Dt,jsx as v,jsxs as z}from"react/jsx-runtime";var vt=typeof E.height=="number"?E.height:420,Pe=40,we=60,Ie=8,kt=8,Ot="cleen-min-w-[220px] cleen-max-w-[min(360px,90vw)] cleen-flex cleen-flex-col cleen-gap-2",oe="cleen-m-0 cleen-text-xs cleen-leading-[18px] cleen-whitespace-pre-line cleen-break-words",Rt="cleen-font-semibold",Nt="cleen-font-medium cleen-text-[13px] cleen-mt-1 cleen-opacity-[0.72]",Pt="cleen-font-medium cleen-text-[13px] cleen-mt-[6px]";function wt(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=e.trim();if(!t.endsWith("%")&&t!=="auto"){let r=Number.parseFloat(t);if(Number.isFinite(r))return r}}return vt}function Le(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e}function It(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e&&"index"in e&&"name"in e}var Ee=["rgba(var(--cleen-primary, 59, 130, 246))","rgba(var(--cleen-success, 34, 197, 94))","rgba(var(--cleen-warning, 245, 158, 11))","rgba(var(--cleen-error, 239, 68, 68))","rgba(var(--cleen-purple, 147, 51, 234))","rgba(var(--cleen-cyan, 6, 182, 212))","rgba(var(--cleen-orange, 249, 115, 22))","rgba(var(--cleen-pink, 236, 72, 153))","rgba(var(--cleen-teal, 20, 184, 166))","rgba(var(--cleen-indigo, 99, 102, 241))","rgba(var(--cleen-rose, 244, 63, 94))","rgba(var(--cleen-amber, 245, 158, 11))"];function Me(e){return e!=null}function Lt(e,t){return[e.source,e.target,e.type??"",e.label??"",e.value,t].join("-").replace(/\s+/g,"_")}function V(e,t){return typeof e=="object"&&e!==null?e.id:t}function _e(e,t){return typeof e=="object"&&e!==null?e.title:t}function ne(e){return typeof e=="object"&&e!==null&&"edgeKey"in e&&"sourceId"in e&&"targetId"in e}function ae(e){return typeof e=="object"&&e!==null&&"payload"in e}function $e(e){if(ae(e))return $e(e.payload);if(ne(e)||It(e))return e}function ie(...e){return e.map(t=>typeof t=="number"?String(t):t?.trim()??"").find(t=>t.length>0)}function He(e){let t=ie(e);if(t)return/[\p{L}\p{N}]/u.test(t)?t:void 0}function De(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function D(e){let t=e.match(/^rgba\((var\(.+\)),\s*([0-9]*\.?[0-9]+)\)$/i);if(t)return{color:`rgb(${t[1]})`,opacity:Number.parseFloat(t[2])};let r=e.match(/^rgba\((var\(.+\))\)$/i);if(r)return{color:`rgb(${r[1]})`,opacity:1};let n=e.match(/^rgba\(\s*(\d+\s*,\s*\d+\s*,\s*\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/i);return n?{color:`rgb(${n[1]})`,opacity:Number.parseFloat(n[2])}:{color:e,opacity:1}}function le(e,t){return D(t??Ee[e%Ee.length])}function Fe(e){return e.length*kt}function Et(e){let t=new Set,r=new Set([e.id]);for(let n of[...e.sourceLinks??[],...e.targetLinks??[]])t.add(n.edgeKey),r.add(V(n.source,n.sourceId)),r.add(V(n.target,n.targetId));return{activeLinkKeys:t,activeNodeIds:r}}function _t(e){return{activeLinkKeys:new Set([e.edgeKey]),activeNodeIds:new Set([V(e.source,e.sourceId),V(e.target,e.targetId)])}}function Ht(e,t,r,n,m){return!e||e.activeNodeIds.has(t)?1:n?m??E.dimOpacity??.2:r?.55:1}function Ft(e,t,r,n,m,b){return e?e.activeLinkKeys.has(t)?n?Math.max(r,.9):r:m?b??E.dimOpacity??.2:n?Math.min(r,.3):r:r}var Bt=({dimOnHover:e,dimOpacity:t,fontColor:r,x:n,y:m,width:b,height:y,highlightOnHover:x,hoverState:u,index:S,outgoingEdgesById:k,payload:o,stroke:T,strokeWidth:d})=>{if(o===void 0||n===void 0||m===void 0||b===void 0||y===void 0||S===void 0)return null;let A=k?.get(o.id)??[],O=A.length>0,R=le(S,o.color),N=D(r),p=Ht(u,o.id,x,e,t),i=new Set(A.map(f=>f.color).filter(Me)),s=Array.from(i)[0],l=O&&A.length>1&&i.size>1&&i.size===A.length,c=l?A:[],a=c.reduce((f,g)=>f+(g.value??0),0);return z(Be,{children:[l&&a>0?c.map((f,g)=>{let h=c.slice(0,g).reduce((F,B)=>F+(B.value??0),0),C=m+h/a*y,P=(f.value??0)/a*y,I=D(f.color??R.color),_=g===0,H=g===c.length-1;return v(Ne,{x:n,y:C,width:b,height:P,fill:I.color,fillOpacity:I.opacity*p,stroke:T,strokeWidth:d,radius:[_?2:0,_?2:0,H?2:0,H?2:0]},`${f.source}-${f.target}-${g}`)}):v(Ne,{x:n,y:m,width:b,height:y,fill:O&&i.size===1?D(s??R.color).color:R.color,fillOpacity:(O&&i.size===1?D(s??R.color).opacity:R.opacity)*p,stroke:T,strokeWidth:d,radius:[2,2,2,2]}),v("text",{textAnchor:O?"end":"start",x:O?n-8:n+b+8,y:m+y/2,dy:"0.35em",fontSize:"14",fill:N.color,fillOpacity:N.opacity*p,fontWeight:600,children:o.name})]},`CustomNode${S}`)},Mt=({sourceX:e,targetX:t,sourceY:r,targetY:n,sourceControlX:m,targetControlX:b,linkWidth:y,index:x,payload:u,opacity:S,chartId:k,dimOnHover:o,dimOpacity:T,edgeGradientFill:d,highlightOnHover:A,hoverState:O})=>{if(u===void 0||e===void 0||t===void 0||r===void 0||n===void 0||m===void 0||b===void 0||y===void 0)return null;let R=S??E.edgeOpacity??.4,N=Ft(O,u.edgeKey,R,A,o,T),p=u.color?D(u.color):null,i=p??le(typeof u.source=="object"?u.source.index:0,typeof u.source=="object"?u.source.color:void 0),s=p??le(typeof u.target=="object"?u.target.index:1,typeof u.target=="object"?u.target.color:void 0),l=De(`linkGradient-${k}-${u.edgeKey}-${x??u.value}`),c=d!==!1&&p===null;return z(Be,{children:[c?v("defs",{children:z("linearGradient",{id:l,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[v("stop",{offset:"0%",stopColor:i.color,stopOpacity:i.opacity*N}),v("stop",{offset:"100%",stopColor:s.color,stopOpacity:s.opacity*N})]})}):null,v("path",{d:`
|
|
2
2
|
M${e},${r}
|
|
3
|
-
C${
|
|
4
|
-
`,stroke:u?`url(#${y})`:l.color,strokeWidth:Math.max(1,g),fill:"none",strokeOpacity:u?1:l.opacity*R,className:"cleen-transition-opacity cleen-duration-300 hover:cleen-opacity-100"})]},`CustomLink${p.edgeKey}`)};function It({data:e,options:t,className:r,style:n,onNodeClick:c,renderTooltip:b}){let g=ut(null),[x,p]=mt(null),k=dt(),N=Be(k),o=ct(I,t),T=vt(o.height),s=o.highlightOnHover||o.dimOnHover,S=U(()=>{let a=e.nodes.map((m,d)=>({...m,index:d,name:m.title})),h=e.edges.map((m,d)=>{let A=e.nodes.findIndex(L=>L.id===m.source),w=e.nodes.findIndex(L=>L.id===m.target);return A<0||w<0?null:{...m,edgeKey:Tt(m,d),originalEdge:m,source:A,sourceId:m.source,target:w,targetId:m.target,value:m.value}}).filter(He);return{nodes:a,links:h}},[e]),v=U(()=>{let a=new Map;for(let h of e.edges){let m=a.get(h.source)??[];m.push(h),a.set(h.source,m)}return a},[e]),C=U(()=>({backgroundColor:o.tooltipBGColor,border:`1px solid ${o.tooltipBorderColor}`,borderRadius:8,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",color:o.fontColor,padding:"10px 12px"}),[o.fontColor,o.tooltipBGColor,o.tooltipBorderColor]),R=U(()=>{let a=new Set(e.edges.map(A=>A.source)),h=new Set(e.edges.map(A=>A.target)),m=e.nodes.reduce((A,w)=>h.has(w.id)?A:Math.max(A,Ee(w.title)),0),d=e.nodes.reduce((A,w)=>a.has(w.id)?A:Math.max(A,Ee(w.title)),0);return{top:Oe,right:Math.max(Ne,d+Re+16),bottom:Oe,left:Math.max(Ne,m+Re+16)}},[e]),i=(a,h)=>{if(s){if(h==="node"&&we(a.payload)){p(Ot(a.payload));return}h==="link"&&ee(a.payload)&&p(Nt(a.payload))}},l=()=>{s&&p(null)},f=()=>{if(typeof window>"u")return;let a=g.current?.querySelector("svg");if(!a)return;let h=new XMLSerializer().serializeToString(a),m=new Blob([h],{type:"image/svg+xml;charset=utf-8"}),d=URL.createObjectURL(m),A=document.createElement("a");A.href=d,A.download="sankey-chart.svg",A.click(),window.setTimeout(()=>URL.revokeObjectURL(d),0)},y=({active:a,payload:h})=>{if(!a||!h?.length)return null;let m=h[0]?.payload,d=Fe(m);if(!d)return null;let A=ee(d),w=te(m)?m.value:h[0]?.value,L=te(m)?m.name:void 0,E=Number(d.value??w??0),_=o.valueFormatter?o.valueFormatter(Number(d.value??w??0),A?d.originalEdge:void 0):`${d.value??w??""}`,H=A?Le(d.source,d.sourceId):"",F=A?Le(d.target,d.targetId):"",j=A?re(d.title,d.label,d.name,d.originalEdge?.title,d.originalEdge?.label,d.originalEdge?.name,Ie(L),H&&F?`${H} \u2192 ${F}`:void 0):re(d.title,Ie(L)),Y=A?`${H} \u2192 ${F}`:"";if(b){let Ue=A?{type:"link",edge:d.originalEdge,sourceNodeId:d.sourceId,sourceNodeTitle:H,targetNodeId:d.targetId,targetNodeTitle:F,value:Number.isFinite(E)?E:0,payload:d.originalEdge}:{type:"node",node:d,value:Number.isFinite(E)?E:0,payload:d},ie=b(Ue);return ie?O(Et,{children:ie}):null}return!j&&!Y&&!_?null:$("div",{className:G(bt),style:C,children:[j?O("p",{className:G(Q,Ct),style:{color:o.fontColor,overflowWrap:"anywhere"},children:j}):null,Y?O("p",{className:G(Q,St),style:{color:o.fontColor,overflowWrap:"anywhere"},children:Y}):null,_?O("p",{className:G(Q,At),style:{color:o.fontColor},children:_}):null]})},u={display:"flex",flexDirection:"column",gap:o.enableToolbar?12:0,width:o.width??"100%",height:T,minHeight:T,...n};return $("div",{className:G("cleen cleen-w-full",r),ref:g,style:u,children:[o.enableToolbar?$("div",{className:"cleen-flex cleen-items-center cleen-justify-end cleen-gap-2",children:[O("button",{type:"button",onClick:()=>p(null),disabled:!x,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray-200))",borderRadius:8,color:o.fontColor,cursor:x?"pointer":"not-allowed",fontSize:13,fontWeight:600,opacity:x?1:.5,padding:"6px 10px"},children:"Reset focus"}),O("button",{type:"button",onClick:f,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray-200))",borderRadius:8,color:o.fontColor,cursor:"pointer",fontSize:13,fontWeight:600,padding:"6px 10px"},children:"Download SVG"})]}):null,O("div",{style:{flex:1,minHeight:0},children:O(ht,{width:"100%",height:"100%",children:O(gt,{data:S,align:o.align,margin:R,node:O(Pt,{dimOnHover:o.dimOnHover,dimOpacity:o.dimOpacity,fontColor:o.fontColor??I.fontColor??"rgba(var(--cleen-neutral-800, 38, 38, 38))",highlightOnHover:o.highlightOnHover,hoverState:x,outgoingEdgesById:v,stroke:o.nodeBorderColor??"transparent",strokeWidth:o.nodeBorderWidth}),nodePadding:o.nodePadding,nodeWidth:o.nodeWidth,link:O(Lt,{chartId:N,dimOnHover:o.dimOnHover,dimOpacity:o.dimOpacity,edgeGradientFill:o.edgeGradientFill,highlightOnHover:o.highlightOnHover,hoverState:x,opacity:o.edgeOpacity}),onClick:(a,h)=>{h==="node"&&c&&we(a.payload)&&c(a.payload)},onMouseEnter:i,onMouseLeave:l,children:o.enableTooltip?O(ft,{content:O(y,{}),cursor:!1,allowEscapeViewBox:{x:!1,y:!0},isAnimationActive:!1,wrapperStyle:{transition:"none"}}):null})})})]})}import{applyDefaults as _t,cn as Ht}from"@cleen/ui-core";import{forwardRef as Ft}from"react";var Me={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},markers:{shape:"square",size:8,strokeWidth:0},grid:{strokeDashArray:8},legend:{show:!0,horizontalAlign:"right",position:"top",labels:{colors:"rgba(var(--cleen-gray-700))"}},yaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray-200))"},labels:{style:{colors:"rgba(var(--cleen-gray-700))"}}},xaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray-200))"},labels:{style:{colors:"rgba(var(--cleen-gray-700))"}}},title:{align:"left",floating:!0,style:{color:"rgba(var(--cleen-black))"}}},De={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:0},fill:{opacity:1},markers:{shape:"circle",size:14,strokeWidth:2,hover:{sizeOffset:0}},grid:{strokeDashArray:0,borderColor:"rgba(var(--cleen-gray-200))",padding:{left:0,right:12},xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},legend:{show:!1},xaxis:{min:0,max:210,tickAmount:4,axisBorder:{show:!1},axisTicks:{show:!1},decimalsInFloat:0,title:{text:"Estimated impact \u2192",style:{color:"rgba(var(--cleen-gray-700))",fontSize:"14px",fontWeight:400}},labels:{style:{colors:"rgba(var(--cleen-gray-700))",fontSize:"14px"},formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}},tooltip:{enabled:!0,theme:"light",x:{formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}}};import{jsx as W,jsxs as $e}from"react/jsx-runtime";var Bt=Ft(function({options:t,variant:r="default",rows:n,className:c,style:b,...g},x){let k=_t(r==="matrix"?De:Me,t);if(r==="matrix"&&n?.length){let N=Math.min(...n.map(s=>s.y)),o=Math.max(...n.map(s=>s.y)),T=Array.isArray(k.yaxis)?{}:k.yaxis??{};return $e("div",{className:Ht("cleen cleen-grid cleen-grid-cols-[156px_minmax(0,1fr)] cleen-items-stretch cleen-gap-3 cleen-w-full",c),style:b,children:[W("div",{className:"cleen-grid cleen-pt-[18px] cleen-pb-[54px]",style:{gridTemplateRows:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map(s=>$e("div",{className:"cleen-flex cleen-flex-col cleen-justify-center cleen-items-end cleen-gap-1 cleen-pr-2",children:[W("span",{className:"cleen-text-[18px] cleen-font-bold cleen-leading-[1.1] cleen-text-[rgba(var(--cleen-black))]",children:s.label}),s.gapsLabel?W("span",{className:"cleen-text-[14px] cleen-leading-[1.2] cleen-text-gray-700",children:s.gapsLabel}):null]},`${s.label}-${s.y}`))}),W(P,{type:"scatter",ref:x,className:"cleen-w-full cleen-h-full",options:{...k,yaxis:{...T,min:N-.5,max:o+.5,tickAmount:Math.max(o-N,1),axisBorder:{...T.axisBorder,show:!1},axisTicks:{...T.axisTicks,show:!1},labels:{...T.labels,show:!1}},annotations:{...k.annotations,yaxis:[...n.map(s=>({y:s.y,borderColor:s.lineColor||"rgba(var(--cleen-gray-200))",strokeDashArray:0})),...k.annotations?.yaxis||[]]}},...g})]})}return W(P,{type:"scatter",ref:x,className:c,style:b,options:k,...g})});import{applyDefaults as Mt}from"@cleen/ui-core";import{forwardRef as Dt,useEffect as Ge,useMemo as We,useRef as K,useState as $t}from"react";var ze={chart:{type:"treemap",zoom:{enabled:!1},toolbar:{show:!1}},legend:{show:!1},dataLabels:{enabled:!0,style:{fontSize:"12px",fontWeight:400}},plotOptions:{treemap:{enableShades:!0,distributed:!1}},title:{align:"left",style:{color:"rgba(var(--cleen-black))"}}};import{jsx as V,jsxs as Gt}from"react/jsx-runtime";var ne=(e,t)=>e.length!==t.length?!1:e.every((r,n)=>{let c=t[n];return Math.round(r.x)===Math.round(c.x)&&Math.round(r.y)===Math.round(c.y)&&Math.round(r.width)===Math.round(c.width)&&Math.round(r.height)===Math.round(c.height)}),zt=Dt(function({options:t,labelLayout:r="apex",renderTileLabel:n,className:c,style:b,...g},x){let p=K(null),[k,N]=$t([]),o=r==="overlay"&&typeof n=="function",T=K(()=>null);T.current=()=>{let i=p.current;if(!i)return null;let l=i.getBoundingClientRect(),f=i.querySelectorAll(".apexcharts-treemap-rect");return f.length?Array.from(f).map((y,u)=>{let a=y.getBoundingClientRect();return{x:a.left-l.left,y:a.top-l.top,width:a.width,height:a.height,dataIndex:u}}):null};let s=K(0),S=K(()=>{});S.current=()=>{cancelAnimationFrame(s.current);let i=0,l=null,f=()=>{let y=T.current();if(y&&l&&ne(l,y)){N(u=>ne(u,y)?u:y);return}y&&(l=y),i<30?(i++,s.current=requestAnimationFrame(f)):y&&N(u=>ne(u,y)?u:y)};s.current=requestAnimationFrame(f)};let v=We(()=>{let i=Mt(ze,t??{});if(!o)return i;let l=i.chart?.events??{},f=y=>(...u)=>{S.current(),y?.(...u)};return{...i,dataLabels:{...i.dataLabels,enabled:!1},chart:{...i.chart,animations:{enabled:!1},events:{...l,mounted:f(l.mounted),updated:f(l.updated)}}}},[t,o]);Ge(()=>{if(o)return S.current(),()=>cancelAnimationFrame(s.current)},[o]),Ge(()=>{if(!o)return;let i=p.current;if(!i||typeof ResizeObserver>"u")return;let l=new ResizeObserver(()=>S.current());return l.observe(i),()=>l.disconnect()},[o]);let C=We(()=>{let i=g.series;return!Array.isArray(i)||i.length===0?[]:(i[0]??{}).data??[]},[g.series]);if(!o)return V(P,{type:"treemap",ref:x,options:v,className:c,style:b,...g});let R={...b,position:"relative"};return Gt("div",{ref:p,className:c,style:R,children:[V(P,{type:"treemap",ref:x,options:v,...g}),k.length>0&&V("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden"},children:k.map(i=>V("div",{style:{position:"absolute",left:i.x,top:i.y,width:i.width,height:i.height},children:n({point:C[i.dataIndex],width:i.width,height:i.height})},i.dataIndex))})]})});import"react";import{jsx as ae,jsxs as Ut}from"react/jsx-runtime";var Wt=({width:e=240,height:t=80,data:r=[12,28,18,30,24,36],className:n="",style:c})=>{let b=Math.max(...r,1),g=r.map((x,p)=>`${p/(r.length-1)*e},${t-x/b*t}`).join(" ");return Ut("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,className:n,style:c,role:"img","aria-label":"Simple line chart",children:[ae("rect",{width:"100%",height:"100%",fill:"transparent"}),ae("polyline",{fill:"none",stroke:"rgba(59,130,246,0.9)",strokeWidth:2,points:g,strokeLinecap:"round",strokeLinejoin:"round"}),ae("polygon",{points:`${g} ${e},${t} 0,${t}`,fill:"rgba(59,130,246,0.08)"})]})};export{Je as BarChart,tt as BellCurve,se as Chart,at as FootballFieldChart,st as RadarChart,It as SankeyChart,Bt as ScatterChart,Wt as SimpleChart,zt as TreemapChart};
|
|
3
|
+
C${m},${r} ${b},${n} ${t},${n}
|
|
4
|
+
`,stroke:c?`url(#${l})`:i.color,strokeWidth:Math.max(1,y),fill:"none",strokeOpacity:c?1:i.opacity*N,className:"cleen-transition-opacity cleen-duration-300 hover:cleen-opacity-100"})]},`CustomLink${u.edgeKey}`)};function $t({data:e,options:t,className:r,style:n,onNodeClick:m,renderTooltip:b}){let y=bt(null),[x,u]=Ct(null),S=xt(),k=De(S),o=yt(E,t),T=wt(o.height),d=o.highlightOnHover||o.dimOnHover,A=X(()=>{let a=e.nodes.map((g,h)=>({...g,index:h,name:g.title})),f=e.edges.map((g,h)=>{let C=e.nodes.findIndex(I=>I.id===g.source),P=e.nodes.findIndex(I=>I.id===g.target);return C<0||P<0?null:{...g,edgeKey:Lt(g,h),originalEdge:g,source:C,sourceId:g.source,target:P,targetId:g.target,value:g.value}}).filter(Me);return{nodes:a,links:f}},[e]),O=X(()=>{let a=new Map;for(let f of e.edges){let g=a.get(f.source)??[];g.push(f),a.set(f.source,g)}return a},[e]),R=X(()=>({backgroundColor:o.tooltipBGColor,border:`1px solid ${o.tooltipBorderColor}`,borderRadius:8,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",color:o.fontColor,padding:"10px 12px"}),[o.fontColor,o.tooltipBGColor,o.tooltipBorderColor]),N=X(()=>{let a=new Set(e.edges.map(C=>C.source)),f=new Set(e.edges.map(C=>C.target)),g=e.nodes.reduce((C,P)=>f.has(P.id)?C:Math.max(C,Fe(P.title)),0),h=e.nodes.reduce((C,P)=>a.has(P.id)?C:Math.max(C,Fe(P.title)),0);return{top:Pe,right:Math.max(we,h+Ie+16),bottom:Pe,left:Math.max(we,g+Ie+16)}},[e]),p=(a,f)=>{if(d){if(f==="node"&&Le(a.payload)){u(Et(a.payload));return}f==="link"&&ne(a.payload)&&u(_t(a.payload))}},i=()=>{d&&u(null)},s=()=>{if(typeof window>"u")return;let a=y.current?.querySelector("svg");if(!a)return;let f=new XMLSerializer().serializeToString(a),g=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(g),C=document.createElement("a");C.href=h,C.download="sankey-chart.svg",C.click(),window.setTimeout(()=>URL.revokeObjectURL(h),0)},l=({active:a,payload:f})=>{if(!a||!f?.length)return null;let g=f[0]?.payload,h=$e(g);if(!h)return null;let C=ne(h),P=ae(g)?g.value:f[0]?.value,I=ae(g)?g.name:void 0,_=Number(h.value??P??0),H=o.valueFormatter?o.valueFormatter(Number(h.value??P??0),C?h.originalEdge:void 0):`${h.value??P??""}`,F=C?_e(h.source,h.sourceId):"",B=C?_e(h.target,h.targetId):"",Y=C?ie(h.title,h.label,h.name,h.originalEdge?.title,h.originalEdge?.label,h.originalEdge?.name,He(I),F&&B?`${F} \u2192 ${B}`:void 0):ie(h.title,He(I)),q=C?`${F} \u2192 ${B}`:"";if(b){let Ve=C?{type:"link",edge:h.originalEdge,sourceNodeId:h.sourceId,sourceNodeTitle:F,targetNodeId:h.targetId,targetNodeTitle:B,value:Number.isFinite(_)?_:0,payload:h.originalEdge}:{type:"node",node:h,value:Number.isFinite(_)?_:0,payload:h},ce=b(Ve);return ce?v(Dt,{children:ce}):null}return!Y&&!q&&!H?null:z("div",{className:W(Ot),style:R,children:[Y?v("p",{className:W(oe,Rt),style:{color:o.fontColor,overflowWrap:"anywhere"},children:Y}):null,q?v("p",{className:W(oe,Nt),style:{color:o.fontColor,overflowWrap:"anywhere"},children:q}):null,H?v("p",{className:W(oe,Pt),style:{color:o.fontColor},children:H}):null]})},c={display:"flex",flexDirection:"column",gap:o.enableToolbar?12:0,width:o.width??"100%",height:T,minHeight:T,...n};return z("div",{className:W("cleen cleen-w-full",r),ref:y,style:c,children:[o.enableToolbar?z("div",{className:"cleen-flex cleen-items-center cleen-justify-end cleen-gap-2",children:[v("button",{type:"button",onClick:()=>u(null),disabled:!x,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray-200))",borderRadius:8,color:o.fontColor,cursor:x?"pointer":"not-allowed",fontSize:13,fontWeight:600,opacity:x?1:.5,padding:"6px 10px"},children:"Reset focus"}),v("button",{type:"button",onClick:s,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray-200))",borderRadius:8,color:o.fontColor,cursor:"pointer",fontSize:13,fontWeight:600,padding:"6px 10px"},children:"Download SVG"})]}):null,v("div",{style:{flex:1,minHeight:0},children:v(Tt,{width:"100%",height:"100%",children:v(At,{data:A,align:o.align,margin:N,node:v(Bt,{dimOnHover:o.dimOnHover,dimOpacity:o.dimOpacity,fontColor:o.fontColor??E.fontColor??"rgba(var(--cleen-neutral-800, 38, 38, 38))",highlightOnHover:o.highlightOnHover,hoverState:x,outgoingEdgesById:O,stroke:o.nodeBorderColor??"transparent",strokeWidth:o.nodeBorderWidth}),nodePadding:o.nodePadding,nodeWidth:o.nodeWidth,link:v(Mt,{chartId:k,dimOnHover:o.dimOnHover,dimOpacity:o.dimOpacity,edgeGradientFill:o.edgeGradientFill,highlightOnHover:o.highlightOnHover,hoverState:x,opacity:o.edgeOpacity}),onClick:(a,f)=>{f==="node"&&m&&Le(a.payload)&&m(a.payload)},onMouseEnter:p,onMouseLeave:i,children:o.enableTooltip?v(St,{content:v(l,{}),cursor:!1,allowEscapeViewBox:{x:!1,y:!0},isAnimationActive:!1,wrapperStyle:{transition:"none"}}):null})})})]})}import{applyDefaults as zt,cn as Gt}from"@cleen/ui-core";import{forwardRef as Wt}from"react";var ze={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},markers:{shape:"square",size:8,strokeWidth:0},grid:{strokeDashArray:8},legend:{show:!0,horizontalAlign:"right",position:"top",labels:{colors:"rgba(var(--cleen-gray-700))"}},yaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray-200))"},labels:{style:{colors:"rgba(var(--cleen-gray-700))"}}},xaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray-200))"},labels:{style:{colors:"rgba(var(--cleen-gray-700))"}}},title:{align:"left",floating:!0,style:{color:"rgba(var(--cleen-black))"}}},Ge={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:0},fill:{opacity:1},markers:{shape:"circle",size:14,strokeWidth:2,hover:{sizeOffset:0}},grid:{strokeDashArray:0,borderColor:"rgba(var(--cleen-gray-200))",padding:{left:0,right:12},xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},legend:{show:!1},xaxis:{min:0,max:210,tickAmount:4,axisBorder:{show:!1},axisTicks:{show:!1},decimalsInFloat:0,title:{text:"Estimated impact \u2192",style:{color:"rgba(var(--cleen-gray-700))",fontSize:"14px",fontWeight:400}},labels:{style:{colors:"rgba(var(--cleen-gray-700))",fontSize:"14px"},formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}},tooltip:{enabled:!0,theme:"light",x:{formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}}};import{jsx as U,jsxs as We}from"react/jsx-runtime";var Ut=Wt(function({options:t,variant:r="default",rows:n,className:m,style:b,...y},x){let S=zt(r==="matrix"?Ge:ze,t);if(r==="matrix"&&n?.length){let k=Math.min(...n.map(d=>d.y)),o=Math.max(...n.map(d=>d.y)),T=Array.isArray(S.yaxis)?{}:S.yaxis??{};return We("div",{className:Gt("cleen cleen-grid cleen-grid-cols-[156px_minmax(0,1fr)] cleen-items-stretch cleen-gap-3 cleen-w-full",m),style:b,children:[U("div",{className:"cleen-grid cleen-pt-[18px] cleen-pb-[54px]",style:{gridTemplateRows:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map(d=>We("div",{className:"cleen-flex cleen-flex-col cleen-justify-center cleen-items-end cleen-gap-1 cleen-pr-2",children:[U("span",{className:"cleen-text-[18px] cleen-font-bold cleen-leading-[1.1] cleen-text-[rgba(var(--cleen-black))]",children:d.label}),d.gapsLabel?U("span",{className:"cleen-text-[14px] cleen-leading-[1.2] cleen-text-gray-700",children:d.gapsLabel}):null]},`${d.label}-${d.y}`))}),U(w,{type:"scatter",ref:x,className:"cleen-w-full cleen-h-full",options:{...S,yaxis:{...T,min:k-.5,max:o+.5,tickAmount:Math.max(o-k,1),axisBorder:{...T.axisBorder,show:!1},axisTicks:{...T.axisTicks,show:!1},labels:{...T.labels,show:!1}},annotations:{...S.annotations,yaxis:[...n.map(d=>({y:d.y,borderColor:d.lineColor||"rgba(var(--cleen-gray-200))",strokeDashArray:0})),...S.annotations?.yaxis||[]]}},...y})]})}return U(w,{type:"scatter",ref:x,className:m,style:b,options:S,...y})});import{applyDefaults as Kt}from"@cleen/ui-core";import{forwardRef as Xt,useEffect as Ke,useMemo as Xe,useRef as j,useState as Vt}from"react";var Ue={chart:{type:"treemap",zoom:{enabled:!1},toolbar:{show:!1}},legend:{show:!1},dataLabels:{enabled:!0,style:{fontSize:"12px",fontWeight:400}},plotOptions:{treemap:{enableShades:!0,distributed:!1}},title:{align:"left",style:{color:"rgba(var(--cleen-black))"}}};import{jsx as Z,jsxs as Zt}from"react/jsx-runtime";var se=(e,t)=>e.length!==t.length?!1:e.every((r,n)=>{let m=t[n];return Math.round(r.x)===Math.round(m.x)&&Math.round(r.y)===Math.round(m.y)&&Math.round(r.width)===Math.round(m.width)&&Math.round(r.height)===Math.round(m.height)}),jt=Xt(function({options:t,labelLayout:r="apex",renderTileLabel:n,className:m,style:b,...y},x){let u=j(null),[S,k]=Vt([]),o=r==="overlay"&&typeof n=="function",T=j(()=>null);T.current=()=>{let p=u.current;if(!p)return null;let i=p.getBoundingClientRect(),s=p.querySelectorAll(".apexcharts-treemap-rect");return s.length?Array.from(s).map((l,c)=>{let a=l.getBoundingClientRect();return{x:a.left-i.left,y:a.top-i.top,width:a.width,height:a.height,dataIndex:c}}):null};let d=j(0),A=j(()=>{});A.current=()=>{cancelAnimationFrame(d.current);let p=0,i=null,s=()=>{let l=T.current();if(l&&i&&se(i,l)){k(c=>se(c,l)?c:l);return}l&&(i=l),p<30?(p++,d.current=requestAnimationFrame(s)):l&&k(c=>se(c,l)?c:l)};d.current=requestAnimationFrame(s)};let O=Xe(()=>{let p=Kt(Ue,t??{});if(!o)return p;let i=p.chart?.events??{},s=l=>(...c)=>{A.current(),l?.(...c)};return{...p,dataLabels:{...p.dataLabels,enabled:!1},chart:{...p.chart,animations:{enabled:!1},events:{...i,mounted:s(i.mounted),updated:s(i.updated)}}}},[t,o]);Ke(()=>{if(o)return A.current(),()=>cancelAnimationFrame(d.current)},[o]),Ke(()=>{if(!o)return;let p=u.current;if(!p||typeof ResizeObserver>"u")return;let i=new ResizeObserver(()=>A.current());return i.observe(p),()=>i.disconnect()},[o]);let R=Xe(()=>{let p=y.series;return!Array.isArray(p)||p.length===0?[]:(p[0]??{}).data??[]},[y.series]);if(!o)return Z(w,{type:"treemap",ref:x,options:O,className:m,style:b,...y});let N={...b,position:"relative"};return Zt("div",{ref:u,className:m,style:N,children:[Z(w,{type:"treemap",ref:x,options:O,...y}),S.length>0&&Z("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden"},children:S.map(p=>Z("div",{style:{position:"absolute",left:p.x,top:p.y,width:p.width,height:p.height},children:n({point:R[p.dataIndex],width:p.width,height:p.height})},p.dataIndex))})]})});import"react";import{jsx as pe,jsxs as qt}from"react/jsx-runtime";var Yt=({width:e=240,height:t=80,data:r=[12,28,18,30,24,36],className:n="",style:m})=>{let b=Math.max(...r,1),y=r.map((x,u)=>`${u/(r.length-1)*e},${t-x/b*t}`).join(" ");return qt("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,className:n,style:m,role:"img","aria-label":"Simple line chart",children:[pe("rect",{width:"100%",height:"100%",fill:"transparent"}),pe("polyline",{fill:"none",stroke:"rgba(59,130,246,0.9)",strokeWidth:2,points:y,strokeLinecap:"round",strokeLinejoin:"round"}),pe("polygon",{points:`${y} ${e},${t} 0,${t}`,fill:"rgba(59,130,246,0.08)"})]})};export{tt as BarChart,nt as BellCurve,ue as Chart,ut as FootballFieldChart,ht as RadarChart,$t as SankeyChart,Ut as ScatterChart,Yt as SimpleChart,jt as TreemapChart};
|
package/dist/index.d.ts
CHANGED
|
@@ -1998,6 +1998,88 @@ interface DropzoneProps extends NativeInputProps {
|
|
|
1998
1998
|
*/
|
|
1999
1999
|
declare const Dropzone: react.ForwardRefExoticComponent<Omit<DropzoneProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
2000
2000
|
|
|
2001
|
+
interface FileUploadTrackerRowProps {
|
|
2002
|
+
fileEntry: FileEntry;
|
|
2003
|
+
labels?: FileUploadTrackerProps['labels'];
|
|
2004
|
+
classNames?: {
|
|
2005
|
+
container?: string;
|
|
2006
|
+
typeBadge?: string;
|
|
2007
|
+
infoContainer?: string;
|
|
2008
|
+
name?: string;
|
|
2009
|
+
progressBar?: ComponentClassnames<ProgressBarProps>;
|
|
2010
|
+
progressText?: string;
|
|
2011
|
+
statusIcon?: string;
|
|
2012
|
+
};
|
|
2013
|
+
styles?: {
|
|
2014
|
+
container?: CSSProperties;
|
|
2015
|
+
typeBadge?: CSSProperties;
|
|
2016
|
+
infoContainer?: CSSProperties;
|
|
2017
|
+
name?: CSSProperties;
|
|
2018
|
+
progressBar?: ComponentStyles<ProgressBarProps>;
|
|
2019
|
+
progressText?: CSSProperties;
|
|
2020
|
+
statusIcon?: CSSProperties;
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
declare const FileUploadTrackerRow: ({ fileEntry, labels, classNames, styles, }: FileUploadTrackerRowProps) => react_jsx_runtime.JSX.Element;
|
|
2024
|
+
|
|
2025
|
+
type NativeDivProps = Omit<ComponentProps<'div'>, 'children' | 'className' | 'style' | 'title'>;
|
|
2026
|
+
interface FileUploadTrackerProps extends NativeDivProps {
|
|
2027
|
+
/** Files to track, either as a list or as the `Map` used by `Dropzone` / `useFileUpload` */
|
|
2028
|
+
files: FileEntry[] | Map<string, FileEntry>;
|
|
2029
|
+
/** Overrides the automatic header title */
|
|
2030
|
+
title?: ReactNode;
|
|
2031
|
+
/** Amount of rows rendered before the list is truncated */
|
|
2032
|
+
maxVisibleFiles?: number;
|
|
2033
|
+
/** Controlled expanded state of the truncated list */
|
|
2034
|
+
isExpanded?: boolean;
|
|
2035
|
+
/** Initial expanded state of the truncated list when uncontrolled */
|
|
2036
|
+
defaultExpanded?: boolean;
|
|
2037
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
2038
|
+
/** Renders the dismiss control in the header when provided */
|
|
2039
|
+
onDismiss?: () => void;
|
|
2040
|
+
labels?: {
|
|
2041
|
+
uploading?: (inProgressCount: number) => ReactNode;
|
|
2042
|
+
completed?: ReactNode;
|
|
2043
|
+
showMore?: (hiddenCount: number) => ReactNode;
|
|
2044
|
+
showLess?: ReactNode;
|
|
2045
|
+
dismiss?: string;
|
|
2046
|
+
contract?: string;
|
|
2047
|
+
uploadProgress?: (progress: number) => ReactNode;
|
|
2048
|
+
};
|
|
2049
|
+
className?: string;
|
|
2050
|
+
style?: CSSProperties;
|
|
2051
|
+
classNames?: {
|
|
2052
|
+
card?: ComponentClassnames<CardProps>;
|
|
2053
|
+
header?: string;
|
|
2054
|
+
headerButtons?: string;
|
|
2055
|
+
title?: string;
|
|
2056
|
+
contractButton?: string;
|
|
2057
|
+
dismissButton?: string;
|
|
2058
|
+
list?: string;
|
|
2059
|
+
row?: FileUploadTrackerRowProps['classNames'];
|
|
2060
|
+
expandButton?: string;
|
|
2061
|
+
};
|
|
2062
|
+
styles?: {
|
|
2063
|
+
card?: ComponentStyles<CardProps>;
|
|
2064
|
+
header?: CSSProperties;
|
|
2065
|
+
headerButtons?: CSSProperties;
|
|
2066
|
+
title?: CSSProperties;
|
|
2067
|
+
contractButton?: CSSProperties;
|
|
2068
|
+
dismissButton?: CSSProperties;
|
|
2069
|
+
list?: CSSProperties;
|
|
2070
|
+
row?: FileUploadTrackerRowProps['styles'];
|
|
2071
|
+
expandButton?: CSSProperties;
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* The `FileUploadTracker` component groups the upload progress of multiple files into a single panel.
|
|
2076
|
+
*
|
|
2077
|
+
* - Accepts the same `FileEntry` shape as `Dropzone` and `useFileUpload`, as a list or a `Map`.
|
|
2078
|
+
* - Renders `null` when there are no files to show.
|
|
2079
|
+
* - Truncates the list past `maxVisibleFiles` with a "+N more" expand control.
|
|
2080
|
+
*/
|
|
2081
|
+
declare const FileUploadTracker: react.ForwardRefExoticComponent<Omit<FileUploadTrackerProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
2082
|
+
|
|
2001
2083
|
interface FilterDrawerNewFilter {
|
|
2002
2084
|
filterName: string;
|
|
2003
2085
|
exposed: boolean;
|
|
@@ -3586,4 +3668,4 @@ type TabsProps = ComponentProps<'div'> & {
|
|
|
3586
3668
|
*/
|
|
3587
3669
|
declare const Tabs: react.ForwardRefExoticComponent<Omit<TabsProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
3588
3670
|
|
|
3589
|
-
export { AdvancedProgressBar, type AdvancedProgressBarProps, AudioPlayback, type AudioPlaybackProps, AudioRecorder, type AudioRecorderProps, Avatar, type AvatarProps, AvatarRow, type AvatarRowProps, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Calendar, CalendarDropdown, type CalendarDropdownProps, type CalendarProps, CanvasButton, Card, CardIcon, type CardIconProps, CardMedia, type CardMediaProps, type Media as CardMediaType, type CardProps, Carousel, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, CleenIcon, CleenNotificationContainer, Collapsible, type CollapsibleProps, type CollapsibleSection, type ColorModel, ColorPicker, type ColorPickerProps, CreditCardInput, type CreditCardInputProps, Divider, type DividerProps, Drawer, type DrawerConfig, DrawerContainer, type DrawerContainerProps, DrawerContentTitle, type DrawerContentTitleItem, type DrawerContentTitleProps, type DrawerProps, Dropdown, type DropdownProps, Dropzone, type DropzoneProps, EditableCard, type EditableCardField, type EditableCardProps, EditableText, EditableTextArea, type EditableTextAreaProps, type EditableTextAreaRef, type EditableTextProps, type EditableTextRef, FilterDrawer, type FilterDrawerFilterCategories, type FilterDrawerNewFilter, type FilterDrawerProps, type FilterDrawerSavedFilter, FormGroup, type FormGroupProps, GroupSelector, type GroupSelectorProps, type GroupSelectorSaveResult, type GroupSelectorThreeDotOption, type SidebarItem$1 as ISidebarItem, IconAlertCircle, IconAlertFeatured, IconAlertOctagon, IconAlertTriangle, IconAlignRight, IconArrowDown, IconArrowLeft, IconArrowLeft2, IconArrowRight, IconArrowToTop, IconArrowUp, IconArrowUpRight, IconArrowUpRightNarrow, IconArrowUpRightSquare, IconAttachment, IconBarChartSquare, IconBold, IconBookmarkCheck, IconBookmarkCheckFill, IconBookmarkX, IconBoxLines, IconBoxText, IconBracketsCheck, IconBracketsEllipses, IconCalendar, IconCertificateHeart, IconCheck, IconCheckCircle, IconCheckCircleBroken, IconCheckFill, IconCheckVerified, IconChevronDown, IconChevronLeft, IconChevronLeftDouble, IconChevronRight, IconChevronRightDouble, IconChevronSelectorVertical, IconChevronUp, IconCircleSwap, IconClockFastForward, IconClockRewind, IconClockRewind2, IconCodeBrowser, IconCodeCircle, IconColors, IconColumnEdit, IconCopy, IconCopy2, IconCopy3, IconCopy4, IconCopy5, IconCopyCheck, IconCube, IconCubeOutline, IconCursorBox, IconDataflow, IconDataflow2, IconDataflow3, IconDelete, IconDollarCircle, IconDotsGrid, IconDotsHorizontal, IconDotsVertical, IconEdit, IconEditable, IconExpand, IconEye, IconEyeHidden, IconEyeHidden2, IconFaceSmile, IconFilter, IconFilter2, IconFlag, IconFlag2, IconFlag3, IconHandShield, IconHash, IconHeadsetMic, IconHeart, IconHouseLine, IconImage, IconImage2, IconImage3, IconImage4, IconImageCheck, IconInfoCircle, IconInfoHexagon, IconItalic, IconLayersMultiple, IconLayersSingle, IconLayout, IconLayout2, IconLayoutColumns, IconLayoutCustom, IconLayoutSequential, IconLayoutStuffed, IconLayoutTile, IconLifeBuoy, IconLightbulb, IconLightning, IconLightning2, IconLightningFast, IconLineChartBar, IconLineChartBreakoutSquare, IconLineChartUp, IconLineChartUp2, IconLines, IconLinesCheck, IconLinesPlay, IconLink, IconLink2, IconLink3, IconLink4, IconLink5, IconListBullet, IconListOrder, IconListOrder2, IconLock, IconLock2, IconLogIn, IconLogOut, IconLogOut2, IconMagicWand, IconMagicWand2, IconMail, IconMessageSquare, IconMessageSquare2, IconMessageXSquare, IconMinusCircle, IconMobile, IconMonitor, IconMonitor2, IconMonitor3, IconMoonCircle, IconName, IconNavigationPointer, IconNotificationBox, IconPCSetup, IconPalette, IconPasscodeLock, IconPencil, IconPercentageCircle, IconPerspective, IconPhoneCall, IconPin, IconPlayCircle, IconPlus, IconPlusCircle, IconPulse, IconQuestionCircle, IconRadioButton, IconRadioButtonActive, IconReceiptCheck, IconRedo, IconRefresh, IconRefresh2, IconRefresh3, IconRepeat, IconRepeat2, IconRetweet, IconRoundChart, IconRoundChart2, IconRoute, IconSave, IconSave2, IconScanDots, IconSearch, IconSend, IconSettings, IconSettings2, IconSettings3, IconShieldLightning, IconShieldPlus, IconShieldRemove, IconShuffle, IconSlashCircle, IconSlashOctagon, IconSocialGlobe, IconSocialLinkedin, IconSocialX, IconSpeedometer, IconStairsRound, IconStar, IconStarHalf, IconStars, IconStars2, IconStrikethrough, IconSuccessFeatured, IconSun, IconSwitchHorizontal, IconTag, IconTarget, IconTarget2, IconTextFormat, IconTextFormat2, IconTextHighlight, IconTranslate, IconTrash, IconTrending, IconUnderline, IconUndo, IconUndo2, IconUploadCloud, IconUser, IconUserEdit, IconUserRight, IconUserSquare, IconUsers, IconUsersUp, IconVolume, IconWrench, IconX, IconXCircle, IconXCircle2, IconXClose, IconXSquare, InfoLabels, type InfoLabelsProps, Input, type InputProps, Label, type LabelProps, Loader, type LoaderProps, Lookup, type LookupOption, type LookupProps, Markdown, type MarkdownProps, Menu, type MenuProps, Modal, type ModalProps, type NotificationProps, Pagination, PaginationGoToPage, type PaginationGoToPageProps, PaginationPageSize, type PaginationPageSizeProps, type PaginationProps, PillBadge, type PillBadgeProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, RadioBoxGroup, type RadioBoxGroupProps, RadioButtonGroup, type RadioButtonGroupProps, Rating, type RatingProps, Select, type SelectProps, Sidebar, SidebarItem, type SidebarItemProps, type SidebarProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonBanner, SkeletonButton, SkeletonCard, SkeletonCard2, SkeletonCard3, SkeletonCardStack, SkeletonChart, type SkeletonComponentProps, SkeletonContentCard, SkeletonDataGrid, SkeletonForm, SkeletonGlowingCard, SkeletonImage, SkeletonInfoCard, SkeletonInput, SkeletonList, SkeletonParagraph, type SkeletonProps, type SkeletonRoundness, SkeletonText, type SkeletonType, SkeletonVideo, SkeletonWidgetCard, SkeletonWrapper, Slider, type SliderProps, SliderRange, type SliderRangeProps, StarRating, type StarRatingProps, Stepper, type StepperProps, Switch, type SwitchProps, type Tab, Tabs, type TabsProps, TextArea, type TextAreaProps, Tooltip, type TooltipProps, parseRgbaString, showNotification };
|
|
3671
|
+
export { AdvancedProgressBar, type AdvancedProgressBarProps, AudioPlayback, type AudioPlaybackProps, AudioRecorder, type AudioRecorderProps, Avatar, type AvatarProps, AvatarRow, type AvatarRowProps, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Calendar, CalendarDropdown, type CalendarDropdownProps, type CalendarProps, CanvasButton, Card, CardIcon, type CardIconProps, CardMedia, type CardMediaProps, type Media as CardMediaType, type CardProps, Carousel, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, CleenIcon, CleenNotificationContainer, Collapsible, type CollapsibleProps, type CollapsibleSection, type ColorModel, ColorPicker, type ColorPickerProps, CreditCardInput, type CreditCardInputProps, Divider, type DividerProps, Drawer, type DrawerConfig, DrawerContainer, type DrawerContainerProps, DrawerContentTitle, type DrawerContentTitleItem, type DrawerContentTitleProps, type DrawerProps, Dropdown, type DropdownProps, Dropzone, type DropzoneProps, EditableCard, type EditableCardField, type EditableCardProps, EditableText, EditableTextArea, type EditableTextAreaProps, type EditableTextAreaRef, type EditableTextProps, type EditableTextRef, FileUploadTracker, type FileUploadTrackerProps, FileUploadTrackerRow, type FileUploadTrackerRowProps, FilterDrawer, type FilterDrawerFilterCategories, type FilterDrawerNewFilter, type FilterDrawerProps, type FilterDrawerSavedFilter, FormGroup, type FormGroupProps, GroupSelector, type GroupSelectorProps, type GroupSelectorSaveResult, type GroupSelectorThreeDotOption, type SidebarItem$1 as ISidebarItem, IconAlertCircle, IconAlertFeatured, IconAlertOctagon, IconAlertTriangle, IconAlignRight, IconArrowDown, IconArrowLeft, IconArrowLeft2, IconArrowRight, IconArrowToTop, IconArrowUp, IconArrowUpRight, IconArrowUpRightNarrow, IconArrowUpRightSquare, IconAttachment, IconBarChartSquare, IconBold, IconBookmarkCheck, IconBookmarkCheckFill, IconBookmarkX, IconBoxLines, IconBoxText, IconBracketsCheck, IconBracketsEllipses, IconCalendar, IconCertificateHeart, IconCheck, IconCheckCircle, IconCheckCircleBroken, IconCheckFill, IconCheckVerified, IconChevronDown, IconChevronLeft, IconChevronLeftDouble, IconChevronRight, IconChevronRightDouble, IconChevronSelectorVertical, IconChevronUp, IconCircleSwap, IconClockFastForward, IconClockRewind, IconClockRewind2, IconCodeBrowser, IconCodeCircle, IconColors, IconColumnEdit, IconCopy, IconCopy2, IconCopy3, IconCopy4, IconCopy5, IconCopyCheck, IconCube, IconCubeOutline, IconCursorBox, IconDataflow, IconDataflow2, IconDataflow3, IconDelete, IconDollarCircle, IconDotsGrid, IconDotsHorizontal, IconDotsVertical, IconEdit, IconEditable, IconExpand, IconEye, IconEyeHidden, IconEyeHidden2, IconFaceSmile, IconFilter, IconFilter2, IconFlag, IconFlag2, IconFlag3, IconHandShield, IconHash, IconHeadsetMic, IconHeart, IconHouseLine, IconImage, IconImage2, IconImage3, IconImage4, IconImageCheck, IconInfoCircle, IconInfoHexagon, IconItalic, IconLayersMultiple, IconLayersSingle, IconLayout, IconLayout2, IconLayoutColumns, IconLayoutCustom, IconLayoutSequential, IconLayoutStuffed, IconLayoutTile, IconLifeBuoy, IconLightbulb, IconLightning, IconLightning2, IconLightningFast, IconLineChartBar, IconLineChartBreakoutSquare, IconLineChartUp, IconLineChartUp2, IconLines, IconLinesCheck, IconLinesPlay, IconLink, IconLink2, IconLink3, IconLink4, IconLink5, IconListBullet, IconListOrder, IconListOrder2, IconLock, IconLock2, IconLogIn, IconLogOut, IconLogOut2, IconMagicWand, IconMagicWand2, IconMail, IconMessageSquare, IconMessageSquare2, IconMessageXSquare, IconMinusCircle, IconMobile, IconMonitor, IconMonitor2, IconMonitor3, IconMoonCircle, IconName, IconNavigationPointer, IconNotificationBox, IconPCSetup, IconPalette, IconPasscodeLock, IconPencil, IconPercentageCircle, IconPerspective, IconPhoneCall, IconPin, IconPlayCircle, IconPlus, IconPlusCircle, IconPulse, IconQuestionCircle, IconRadioButton, IconRadioButtonActive, IconReceiptCheck, IconRedo, IconRefresh, IconRefresh2, IconRefresh3, IconRepeat, IconRepeat2, IconRetweet, IconRoundChart, IconRoundChart2, IconRoute, IconSave, IconSave2, IconScanDots, IconSearch, IconSend, IconSettings, IconSettings2, IconSettings3, IconShieldLightning, IconShieldPlus, IconShieldRemove, IconShuffle, IconSlashCircle, IconSlashOctagon, IconSocialGlobe, IconSocialLinkedin, IconSocialX, IconSpeedometer, IconStairsRound, IconStar, IconStarHalf, IconStars, IconStars2, IconStrikethrough, IconSuccessFeatured, IconSun, IconSwitchHorizontal, IconTag, IconTarget, IconTarget2, IconTextFormat, IconTextFormat2, IconTextHighlight, IconTranslate, IconTrash, IconTrending, IconUnderline, IconUndo, IconUndo2, IconUploadCloud, IconUser, IconUserEdit, IconUserRight, IconUserSquare, IconUsers, IconUsersUp, IconVolume, IconWrench, IconX, IconXCircle, IconXCircle2, IconXClose, IconXSquare, InfoLabels, type InfoLabelsProps, Input, type InputProps, Label, type LabelProps, Loader, type LoaderProps, Lookup, type LookupOption, type LookupProps, Markdown, type MarkdownProps, Menu, type MenuProps, Modal, type ModalProps, type NotificationProps, Pagination, PaginationGoToPage, type PaginationGoToPageProps, PaginationPageSize, type PaginationPageSizeProps, type PaginationProps, PillBadge, type PillBadgeProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, RadioBoxGroup, type RadioBoxGroupProps, RadioButtonGroup, type RadioButtonGroupProps, Rating, type RatingProps, Select, type SelectProps, Sidebar, SidebarItem, type SidebarItemProps, type SidebarProps, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonBanner, SkeletonButton, SkeletonCard, SkeletonCard2, SkeletonCard3, SkeletonCardStack, SkeletonChart, type SkeletonComponentProps, SkeletonContentCard, SkeletonDataGrid, SkeletonForm, SkeletonGlowingCard, SkeletonImage, SkeletonInfoCard, SkeletonInput, SkeletonList, SkeletonParagraph, type SkeletonProps, type SkeletonRoundness, SkeletonText, type SkeletonType, SkeletonVideo, SkeletonWidgetCard, SkeletonWrapper, Slider, type SliderProps, SliderRange, type SliderRangeProps, StarRating, type StarRatingProps, Stepper, type StepperProps, Switch, type SwitchProps, type Tab, Tabs, type TabsProps, TextArea, type TextAreaProps, Tooltip, type TooltipProps, parseRgbaString, showNotification };
|