11'use client' ;
22
3- import { enrichEventWithDetails } from '@ui5/webcomponents-react-base' ;
3+ import { enrichEventWithDetails , useStylesheet } from '@ui5/webcomponents-react-base' ;
44import { clsx } from 'clsx' ;
55import type { CSSProperties } from 'react' ;
66import React , { cloneElement , forwardRef , isValidElement , useCallback , useMemo } from 'react' ;
7- import { createUseStyles } from 'react-jss' ;
87import {
98 Cell ,
109 Label as RechartsLabel ,
@@ -25,15 +24,9 @@ import type { IPolarChartConfig } from '../../interfaces/IPolarChartConfig.js';
2524import { ChartContainer } from '../../internal/ChartContainer.js' ;
2625import { defaultFormatter } from '../../internal/defaults.js' ;
2726import { tooltipContentStyle , tooltipFillOpacity } from '../../internal/staticProps.js' ;
27+ import { classNames , styleData } from './PieChart.module.css.js' ;
2828import { PieChartPlaceholder } from './Placeholder.js' ;
2929
30- const useStyles = createUseStyles (
31- {
32- piechart : { '& g:focus,& path:focus' : { outline : 'none' } }
33- } ,
34- { name : 'PieChartStyles' }
35- ) ;
36-
3730interface MeasureConfig extends Omit < IChartMeasure , 'accessor' | 'label' | 'color' | 'hideDataLabel' > {
3831 /**
3932 * A string containing the path to the dataset key this pie should display.
@@ -114,7 +107,7 @@ const PieChart = forwardRef<HTMLDivElement, PieChartProps>((props, ref) => {
114107 ...rest
115108 } = props ;
116109
117- const classes = useStyles ( ) ;
110+ useStylesheet ( styleData , PieChart . displayName ) ;
118111
119112 const chartConfig = {
120113 margin : { right : 30 , left : 30 , bottom : 30 , top : 30 , ...( props . chartConfig ?. margin ?? { } ) } ,
@@ -286,7 +279,7 @@ const PieChart = forwardRef<HTMLDivElement, PieChartProps>((props, ref) => {
286279 margin = { chartConfig . margin }
287280 className = { clsx (
288281 typeof onDataPointClick === 'function' || typeof onClick === 'function' ? 'has-click-handler' : undefined ,
289- classes . piechart
282+ classNames . piechart
290283 ) }
291284 >
292285 < Pie
0 commit comments