@@ -28,7 +28,7 @@ import {
2828 type AvailableChartColorsKeys ,
2929} from "@/lib/chartUtils" ;
3030import { useOnWindowResize } from "@/hooks/useOnWindowsResize" ;
31- import { cx } from "@/lib /utils" ;
31+ import { cn } from "@/utils /utils" ;
3232
3333//#region Legend
3434
@@ -48,7 +48,7 @@ const LegendItem = ({
4848 const hasOnValueChange = ! ! onClick ;
4949 return (
5050 < li
51- className = { cx (
51+ className = { cn (
5252 // base
5353 "group inline-flex flex-nowrap items-center gap-1.5 rounded-sm px-2 py-1 whitespace-nowrap transition" ,
5454 hasOnValueChange
@@ -61,15 +61,15 @@ const LegendItem = ({
6161 } }
6262 >
6363 < span
64- className = { cx (
64+ className = { cn (
6565 "h-[3px] w-3.5 shrink-0 rounded-full" ,
6666 getColorClassName ( color , "bg" ) ,
6767 activeLegend && activeLegend !== name ? "opacity-40" : "opacity-100"
6868 ) }
6969 aria-hidden = { true }
7070 />
7171 < p
72- className = { cx (
72+ className = { cn (
7373 // base
7474 "truncate text-xs whitespace-nowrap" ,
7575 // text color
@@ -117,7 +117,7 @@ const ScrollButton = ({ icon, onClick, disabled }: ScrollButtonProps) => {
117117 return (
118118 < button
119119 type = "button"
120- className = { cx (
120+ className = { cn (
121121 // base
122122 "group inline-flex size-5 items-center truncate rounded-sm transition" ,
123123 disabled
@@ -254,13 +254,13 @@ const Legend = React.forwardRef<HTMLOListElement, LegendProps>((props, ref) => {
254254 return (
255255 < ol
256256 ref = { ref }
257- className = { cx ( "relative overflow-hidden" , className ) }
257+ className = { cn ( "relative overflow-hidden" , className ) }
258258 { ...other }
259259 >
260260 < div
261261 ref = { scrollableRef }
262262 tabIndex = { 0 }
263- className = { cx (
263+ className = { cn (
264264 "flex h-full" ,
265265 enableLegendSlider
266266 ? hasScroll ?. right || hasScroll ?. left
@@ -282,7 +282,7 @@ const Legend = React.forwardRef<HTMLOListElement, LegendProps>((props, ref) => {
282282 { enableLegendSlider && ( hasScroll ?. right || hasScroll ?. left ) ? (
283283 < >
284284 < div
285- className = { cx (
285+ className = { cn (
286286 // base
287287 "absolute top-0 right-0 bottom-0 flex h-full items-center justify-center pr-1" ,
288288 // background color
@@ -341,7 +341,7 @@ const ChartLegend = (
341341 < div
342342 ref = { legendRef }
343343 style = { { paddingLeft : paddingLeft } }
344- className = { cx (
344+ className = { cn (
345345 "flex items-center" ,
346346 { "justify-center" : legendPosition === "center" } ,
347347 { "justify-start" : legendPosition === "left" } ,
@@ -391,7 +391,7 @@ const ChartTooltip = ({
391391 const legendPayload = payload . filter ( ( item : any ) => item . type !== "none" ) ;
392392 return (
393393 < div
394- className = { cx (
394+ className = { cn (
395395 // base
396396 "rounded-md border text-sm shadow-md" ,
397397 // border color
@@ -400,9 +400,9 @@ const ChartTooltip = ({
400400 "bg-white dark:bg-gray-950"
401401 ) }
402402 >
403- < div className = { cx ( "border-b border-inherit px-4 py-2" ) } >
403+ < div className = { cn ( "border-b border-inherit px-4 py-2" ) } >
404404 < p
405- className = { cx (
405+ className = { cn (
406406 // base
407407 "font-medium" ,
408408 // text color
@@ -412,7 +412,7 @@ const ChartTooltip = ({
412412 { label }
413413 </ p >
414414 </ div >
415- < div className = { cx ( "space-y-1 px-4 py-2" ) } >
415+ < div className = { cn ( "space-y-1 px-4 py-2" ) } >
416416 { legendPayload . map ( ( { value, category, color } , index ) => (
417417 < div
418418 key = { `id-${ index } ` }
@@ -421,13 +421,13 @@ const ChartTooltip = ({
421421 < div className = "flex items-center space-x-2" >
422422 < span
423423 aria-hidden = "true"
424- className = { cx (
424+ className = { cn (
425425 "h-[3px] w-3.5 shrink-0 rounded-full" ,
426426 getColorClassName ( color , "bg" )
427427 ) }
428428 />
429429 < p
430- className = { cx (
430+ className = { cn (
431431 // base
432432 "text-right whitespace-nowrap" ,
433433 // text color
@@ -438,7 +438,7 @@ const ChartTooltip = ({
438438 </ p >
439439 </ div >
440440 < p
441- className = { cx (
441+ className = { cn (
442442 // base
443443 "text-right font-medium whitespace-nowrap tabular-nums" ,
444444 // text color
@@ -600,7 +600,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
600600 return (
601601 < div
602602 ref = { ref }
603- className = { cx ( "h-80 w-full" , className ) }
603+ className = { cn ( "h-80 w-full" , className ) }
604604 tremor-id = "tremor-raw"
605605 { ...other }
606606 >
@@ -625,7 +625,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
625625 >
626626 { showGridLines ? (
627627 < CartesianGrid
628- className = { cx ( "stroke-gray-200 stroke-1 dark:stroke-gray-800" ) }
628+ className = { cn ( "stroke-gray-200 stroke-1 dark:stroke-gray-800" ) }
629629 horizontal = { true }
630630 vertical = { false }
631631 />
@@ -643,7 +643,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
643643 }
644644 fill = ""
645645 stroke = ""
646- className = { cx (
646+ className = { cn (
647647 // base
648648 "text-xs" ,
649649 // text fill
@@ -673,7 +673,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
673673 tick = { { transform : "translate(-3, 0)" } }
674674 fill = ""
675675 stroke = ""
676- className = { cx (
676+ className = { cn (
677677 // base
678678 "text-xs" ,
679679 // text fill
@@ -767,7 +767,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
767767 ) : null }
768768 { categories . map ( ( category ) => (
769769 < Line
770- className = { cx (
770+ className = { cn (
771771 getColorClassName (
772772 categoryColors . get ( category ) as AvailableChartColorsKeys ,
773773 "stroke"
@@ -790,7 +790,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
790790 } = props ;
791791 return (
792792 < Dot
793- className = { cx (
793+ className = { cn (
794794 "stroke-white dark:stroke-gray-950" ,
795795 onValueChange ? "cursor-pointer" : "" ,
796796 getColorClassName (
@@ -844,7 +844,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
844844 strokeLinecap = { strokeLinecap }
845845 strokeLinejoin = { strokeLinejoin }
846846 strokeWidth = { strokeWidth }
847- className = { cx (
847+ className = { cn (
848848 "stroke-white dark:stroke-gray-950" ,
849849 onValueChange ? "cursor-pointer" : "" ,
850850 getColorClassName (
@@ -875,7 +875,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
875875 { onValueChange
876876 ? categories . map ( ( category ) => (
877877 < Line
878- className = { cx ( "cursor-pointer" ) }
878+ className = { cn ( "cursor-pointer" ) }
879879 strokeOpacity = { 0 }
880880 key = { category }
881881 name = { category }
0 commit comments