@razorpay/blade 12.89.0 → 12.90.0

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.
Files changed (26) hide show
  1. package/build/lib/web/development/_virtual/cloneDeep.js +1 -1
  2. package/build/lib/web/development/_virtual/cloneDeep3.js +1 -1
  3. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js +6 -1
  4. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  5. package/build/lib/web/development/components/GenUI/GenUIComponents.web.js +4 -21
  6. package/build/lib/web/development/components/GenUI/GenUIComponents.web.js.map +1 -1
  7. package/build/lib/web/development/components/GenUI/rehypeAnimate.js +2 -15
  8. package/build/lib/web/development/components/GenUI/rehypeAnimate.js.map +1 -1
  9. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  10. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
  11. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
  12. package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  13. package/build/lib/web/production/_virtual/cloneDeep.js +1 -1
  14. package/build/lib/web/production/_virtual/cloneDeep3.js +1 -1
  15. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js +6 -1
  16. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  17. package/build/lib/web/production/components/GenUI/GenUIComponents.web.js +4 -21
  18. package/build/lib/web/production/components/GenUI/GenUIComponents.web.js.map +1 -1
  19. package/build/lib/web/production/components/GenUI/rehypeAnimate.js +2 -15
  20. package/build/lib/web/production/components/GenUI/rehypeAnimate.js.map +1 -1
  21. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  22. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
  23. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
  24. package/build/lib/web/production/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  25. package/build/types/components/index.d.ts +0 -2
  26. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import '../node_modules/es-toolkit/dist/compat/object/cloneDeep.js';
1
+ import '../node_modules/es-toolkit/dist/object/cloneDeep.js';
2
2
  //# sourceMappingURL=cloneDeep.js.map
@@ -1,2 +1,2 @@
1
- import '../node_modules/es-toolkit/dist/object/cloneDeep.js';
1
+ import '../node_modules/es-toolkit/dist/compat/object/cloneDeep.js';
2
2
  //# sourceMappingURL=cloneDeep3.js.map
@@ -515,7 +515,12 @@ var _ChartDonut = function _ChartDonut(_ref3) {
515
515
  fill: "transparent",
516
516
  legendType: "none",
517
517
  tooltipType: "none",
518
- paddingAngle: 1.5,
518
+ paddingAngle: 1.5
519
+ // ToolTip is already disabled here.. need to disable pointer events to prevent the tooltip from being shown when the user hovers over the donut chart in some cases
520
+ ,
521
+ style: {
522
+ pointerEvents: 'none'
523
+ },
519
524
  children: modifiedExternalDonutChildren
520
525
  }))]
521
526
  });
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.web.js","sources":["../../../../../../../src/components/Charts/DonutChart/DonutChart.web.tsx"],"sourcesContent":["import React, { isValidElement, useMemo, useState, useRef, useEffect } from 'react';\nimport {\n PieChart as RechartsPieChart,\n Pie as RechartsPie,\n Cell as RechartsCell,\n ResponsiveContainer as RechartsResponsiveContainer,\n Label,\n} from 'recharts';\nimport {\n useChartsColorTheme,\n getHighestColorInRange,\n sanitizeString,\n assignDataColorMapping,\n} from '../utils';\nimport { componentId as commonChartComponentId } from '../CommonChartComponents/tokens';\nimport {\n CommonChartComponentsContext,\n useCommonChartComponentsContext,\n} from '../CommonChartComponents';\nimport type { DataColorMapping } from '../CommonChartComponents/types';\nimport type {\n ChartDonutWrapperProps,\n ChartDonutCellProps,\n ChartDonutProps,\n ChartRadius,\n} from './types';\nimport {\n RADIUS_MAPPING,\n BASE_CONTAINER_SIZE,\n START_AND_END_ANGLES,\n componentId,\n LABEL_DISTANCE_FROM_CENTER,\n LABEL_FONT_STYLES,\n} from './tokens';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\n\n// Context to share container dimensions for responsive radius calculation\ntype DonutContainerContextType = {\n containerWidth: number;\n containerHeight: number;\n};\n\nconst DonutContainerContext = React.createContext<DonutContainerContextType>({\n containerWidth: 0,\n containerHeight: 0,\n});\n\n// Helper to calculate scaled radius based on container size\nconst getScaledRadius = (\n baseRadius: number,\n containerSize: number,\n baseContainerSize: number,\n): number => {\n if (containerSize <= 0) return baseRadius;\n // Scale the radius proportionally, but cap it at the base value\n const scaleFactor = Math.min(containerSize / baseContainerSize, 1);\n return Math.round(baseRadius * scaleFactor);\n};\n\n// Cell component\nconst _Cell: React.FC<ChartDonutCellProps> = ({ ...rest }) => {\n return <RechartsCell {...rest} />;\n};\n\nconst ChartDonutCell = assignWithoutSideEffects(_Cell, {\n componentId: componentId.cell,\n});\n\nconst getTranslate = (\n legendLayout: 'horizontal' | 'vertical',\n legendAlignment: 'left' | 'right',\n legendWidth: number,\n legendHeight: number,\n): string => {\n if (legendLayout === 'vertical') {\n return `translate(calc(-50% + ${\n legendAlignment === 'right' ? -legendWidth / 2 : legendWidth / 2\n }px) , calc(-50%))`;\n }\n return `translate(-50%, calc(-50% - ${legendHeight / 2}px))`;\n};\n\n/**\n * Gets the item name from data based on nameKey.\n * nameKey can be a string (used as property key) or a function (called with data item).\n */\nconst getItemName = (\n item: Record<string, unknown> | undefined,\n nameKey: ChartDonutProps['nameKey'],\n): unknown => {\n if (!item) return undefined;\n if (!nameKey) return item.name;\n if (typeof nameKey === 'function') return nameKey(item);\n return item[nameKey];\n};\n\nconst ChartDonutWrapper: React.FC<ChartDonutWrapperProps & TestID & DataAnalyticsAttribute> = ({\n children,\n content,\n testID,\n ...restProps\n}) => {\n const { theme } = useTheme();\n // State to track which data keys are currently selected (visible)\n const [selectedDataKeys, setSelectedDataKeys] = useState<string[] | undefined>(undefined);\n\n const colorTheme = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'categorical';\n }\n return donutChild?.props?.colorTheme || 'categorical';\n }\n return 'categorical';\n }, [children]);\n\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [legendHeight, setLegendHeight] = useState(0);\n const [legendWidth, setLegendWidth] = useState(0);\n const [containerDimensions, setContainerDimensions] = useState({ width: 0, height: 0 });\n const chartRef = useRef<HTMLDivElement>(null);\n const isValuePresentInContent = content && typeof content === 'object' && 'value' in content;\n const isLabelPresentInContent = content && typeof content === 'object' && 'label' in content;\n\n useEffect(() => {\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const legendWrapper = chartRef.current?.querySelector('.recharts-legend-wrapper');\n if (legendWrapper) {\n const height = legendWrapper.getBoundingClientRect().height;\n const width = legendWrapper.getBoundingClientRect().width;\n setLegendHeight(height);\n setLegendWidth(width);\n }\n }\n });\n });\n\n // ResizeObserver to track container dimensions for responsive radius\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n setContainerDimensions({ width, height });\n }\n });\n\n if (chartRef.current) {\n mutationObserver.observe(chartRef.current, { childList: true, subtree: true });\n resizeObserver.observe(chartRef.current);\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n };\n }, []);\n\n const pieChartRadius: ChartRadius = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'medium';\n }\n return donutChild?.props?.radius || 'medium';\n }\n return 'medium';\n }, [children]);\n\n const legendLayout = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'horizontal';\n }\n return legendChild?.props?.layout || 'horizontal';\n }\n return 'horizontal';\n }, [children]);\n\n const legendAlignment = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'right';\n }\n return legendChild?.props?.align || 'right';\n }\n return 'right';\n }, [children]);\n /**\n * We need to check child of ChartDonutWrapper. if they have any custom color we store that.\n * We need these mapping because colors of tooltip & legend is determine based on this\n * recharts do provide a color but it is hex code and we need blade color token .\n */\n\n const dataColorMapping = useMemo(() => {\n const dataColorMapping: DataColorMapping = {};\n if (Array.isArray(children)) {\n children.forEach((child) => {\n if (getComponentId(child) === componentId.chartDonut) {\n const data = (child as React.ReactElement<ChartDonutProps>).props.data;\n const nameKey = (child as React.ReactElement<ChartDonutProps>).props.nameKey;\n // Donut Chart can also have <Cell/> which will come under donutChildren.\n const donutChildren = (child as React.ReactElement<ChartDonutProps>).props.children;\n if (Array.isArray(donutChildren)) {\n donutChildren.forEach((child, index) => {\n const itemName = getItemName(data[index], nameKey);\n if (getComponentId(child) === componentId.cell && itemName) {\n // assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`\n\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: child.props?.color,\n isCustomColor: Boolean(child.props?.color),\n };\n }\n });\n } else {\n // if we don't have cell as child component then we can we directly assign theme colors\n data.forEach((item, index) => {\n const itemName = getItemName(item, nameKey);\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: themeColors[index],\n isCustomColor: false,\n };\n });\n }\n }\n });\n }\n assignDataColorMapping(dataColorMapping, themeColors);\n\n return dataColorMapping;\n }, [children, themeColors]);\n\n return (\n <CommonChartComponentsContext.Provider\n value={{ chartName: 'donut', dataColorMapping, selectedDataKeys, setSelectedDataKeys }}\n >\n <DonutContainerContext.Provider\n value={{\n containerWidth: containerDimensions.width,\n containerHeight: containerDimensions.height,\n }}\n >\n <BaseBox\n ref={chartRef}\n {...metaAttribute({ name: 'donut-chart', testID })}\n {...makeAnalyticsAttribute(restProps)}\n width=\"100%\"\n height=\"100%\"\n {...restProps}\n position={isValidElement(content) ? 'relative' : undefined}\n >\n <RechartsResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart>\n {children}\n {isLabelPresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.muted}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .label as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isValuePresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withText\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.label}\n </Label>\n )}\n {isValuePresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .text as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.heading}\n fontWeight={theme.typography.fonts.weight.bold}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isLabelPresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withLabel\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.value}\n </Label>\n )}\n </RechartsPieChart>\n </RechartsResponsiveContainer>\n\n {isValidElement(content) && (\n <BaseBox\n position=\"absolute\"\n top=\"50%\"\n left=\"50%\"\n transform={getTranslate(legendLayout, legendAlignment, legendWidth, legendHeight)}\n zIndex={10}\n textAlign=\"center\"\n >\n {content}\n </BaseBox>\n )}\n </BaseBox>\n </DonutContainerContext.Provider>\n </CommonChartComponentsContext.Provider>\n );\n};\n\nconst _ChartDonut: React.FC<ChartDonutProps> = ({\n cx = '50%',\n cy = '50%',\n radius = 'medium',\n dataKey,\n nameKey,\n children,\n data,\n colorTheme = 'categorical',\n type = 'circle',\n ...rest\n}) => {\n const baseRadiusConfig = RADIUS_MAPPING[radius];\n const baseContainerSize = BASE_CONTAINER_SIZE[radius];\n const { containerWidth, containerHeight } = React.useContext(DonutContainerContext);\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n const { theme } = useTheme();\n const { selectedDataKeys } = useCommonChartComponentsContext();\n\n // Filter data based on selectedDataKeys and build index mapping in a single pass\n // - filteredData: allows the donut chart to re-render with correct proportions\n // - filteredToOriginalIndexMap: ensures colors remain consistent even when data is filtered\n const { filteredData, filteredToOriginalIndexMap } = useMemo(() => {\n if (!selectedDataKeys) return { filteredData: data, filteredToOriginalIndexMap: null };\n\n const filteredData: typeof data = [];\n const filteredToOriginalIndexMap: Record<number, number> = {};\n\n data.forEach((item, originalIdx) => {\n const itemName = getItemName(item, nameKey);\n if (selectedDataKeys.includes(sanitizeString(itemName as string))) {\n filteredToOriginalIndexMap[filteredData.length] = originalIdx;\n filteredData.push(item);\n }\n });\n\n return { filteredData, filteredToOriginalIndexMap };\n }, [data, nameKey, selectedDataKeys]);\n\n // Calculate responsive radius based on container size\n const containerSize = Math.min(containerWidth, containerHeight);\n const scaledOuterRadius = getScaledRadius(\n baseRadiusConfig.outerRadius,\n containerSize,\n baseContainerSize,\n );\n const scaledInnerRadius = getScaledRadius(\n baseRadiusConfig.innerRadius,\n containerSize,\n baseContainerSize,\n );\n // Stroke inner radius is slightly smaller than outer for the border effect\n const scaledStrokeInnerRadius = scaledOuterRadius - 0.75;\n\n const getCellOpacity = (hoveredIndex: number | null, currentIndex: number): number => {\n if (hoveredIndex === null) return 1;\n if (hoveredIndex === currentIndex) return 1;\n return 0.2;\n };\n\n const modifiedChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n const fill = getIn(theme.colors, child.props.color || themeColors[originalIndex]);\n return (\n <RechartsCell\n {...child.props}\n fill={fill}\n key={filteredIndex}\n opacity={getCellOpacity(hoveredIndex, filteredIndex)}\n strokeWidth={0}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n fill={getIn(theme.colors, themeColors[originalIndex])}\n key={index}\n opacity={getCellOpacity(hoveredIndex, index)}\n strokeWidth={0}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n const modifiedExternalDonutChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n\n const fill = getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: child.props.color || themeColors[originalIndex],\n followIntensityMapping: Boolean(child.props.color),\n }),\n );\n return (\n <RechartsCell\n {...child.props}\n key={`stroke-${filteredIndex}`}\n fill=\"transparent\"\n stroke={fill} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, filteredIndex)}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n key={`stroke-${index}`}\n fill=\"transparent\"\n stroke={getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: themeColors[originalIndex],\n }),\n )} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, index)}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n return (\n <>\n <RechartsPie\n {...rest}\n dataKey={dataKey}\n nameKey={nameKey}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledInnerRadius}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n onMouseEnter={(_, index) => {\n setHoveredIndex(index);\n }}\n onMouseLeave={() => {\n setHoveredIndex(null);\n }}\n paddingAngle={1.5}\n >\n {modifiedChildren}\n </RechartsPie>\n <RechartsPie\n {...rest}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledStrokeInnerRadius}\n dataKey={dataKey}\n nameKey={nameKey}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n fill=\"transparent\"\n legendType=\"none\"\n tooltipType=\"none\"\n paddingAngle={1.5}\n >\n {modifiedExternalDonutChildren}\n </RechartsPie>\n </>\n );\n};\n\nconst ChartDonut = assignWithoutSideEffects(_ChartDonut, {\n componentId: componentId.chartDonut,\n});\n\nexport { ChartDonut, ChartDonutWrapper, ChartDonutCell };\n"],"names":["DonutContainerContext","React","createContext","containerWidth","containerHeight","getScaledRadius","baseRadius","containerSize","baseContainerSize","scaleFactor","Math","min","round","_Cell","_ref","rest","_extends","_objectDestructuringEmpty","_jsx","RechartsCell","_objectSpread","ChartDonutCell","assignWithoutSideEffects","componentId","cell","getTranslate","legendLayout","legendAlignment","legendWidth","legendHeight","concat","getItemName","item","nameKey","undefined","name","ChartDonutWrapper","_ref2","children","content","testID","restProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useState","useState","_useState2","_slicedToArray","selectedDataKeys","setSelectedDataKeys","colorTheme","useMemo","Array","isArray","_donutChild$props","donutChild","find","child","getComponentId","chartDonut","isValidElement","props","themeColors","useChartsColorTheme","chartName","_useState3","_useState4","setLegendHeight","_useState5","_useState6","setLegendWidth","_useState7","width","height","_useState8","containerDimensions","setContainerDimensions","chartRef","useRef","isValuePresentInContent","_typeof","isLabelPresentInContent","useEffect","mutationObserver","MutationObserver","mutations","forEach","mutation","type","_chartRef$current","legendWrapper","current","querySelector","getBoundingClientRect","resizeObserver","ResizeObserver","entries","_iterator","_createForOfIteratorHelper","_step","s","n","done","entry","value","_entry$contentRect","contentRect","err","e","f","observe","childList","subtree","disconnect","pieChartRadius","_donutChild$props2","radius","_legendChild$props","legendChild","commonChartComponentId","chartLegend","layout","_legendChild$props2","align","dataColorMapping","data","donutChildren","index","itemName","_child$props","_child$props2","sanitizeString","colorToken","color","isCustomColor","Boolean","assignDataColorMapping","CommonChartComponentsContext","Provider","_jsxs","BaseBox","ref","metaAttribute","makeAnalyticsAttribute","position","RechartsResponsiveContainer","RechartsPieChart","Label","fill","colors","surface","text","gray","muted","fontSize","typography","fonts","size","LABEL_FONT_STYLES","label","fontFamily","family","fontWeight","weight","medium","letterSpacing","letterSpacings","dy","LABEL_DISTANCE_FROM_CENTER","withText","normal","heading","bold","withLabel","top","left","transform","zIndex","textAlign","_ChartDonut","_ref3","_ref3$cx","cx","_ref3$cy","cy","_ref3$radius","dataKey","_ref3$colorTheme","_ref3$type","_excluded2","baseRadiusConfig","RADIUS_MAPPING","BASE_CONTAINER_SIZE","_React$useContext","useContext","_useState9","_useState0","hoveredIndex","setHoveredIndex","_useTheme2","_useCommonChartCompon","useCommonChartComponentsContext","_useMemo","filteredData","filteredToOriginalIndexMap","originalIdx","includes","length","push","scaledOuterRadius","outerRadius","scaledInnerRadius","innerRadius","scaledStrokeInnerRadius","getCellOpacity","currentIndex","modifiedChildren","filteredChildren","filter","map","filteredIndex","originalIndex","getIn","_createElement","key","opacity","strokeWidth","_","modifiedExternalDonutChildren","getHighestColorInRange","followIntensityMapping","stroke","strokeOpacity","_Fragment","RechartsPie","startAngle","START_AND_END_ANGLES","endAngle","onMouseEnter","onMouseLe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AAC;;;;"}
1
+ {"version":3,"file":"DonutChart.web.js","sources":["../../../../../../../src/components/Charts/DonutChart/DonutChart.web.tsx"],"sourcesContent":["import React, { isValidElement, useMemo, useState, useRef, useEffect } from 'react';\nimport {\n PieChart as RechartsPieChart,\n Pie as RechartsPie,\n Cell as RechartsCell,\n ResponsiveContainer as RechartsResponsiveContainer,\n Label,\n} from 'recharts';\nimport {\n useChartsColorTheme,\n getHighestColorInRange,\n sanitizeString,\n assignDataColorMapping,\n} from '../utils';\nimport { componentId as commonChartComponentId } from '../CommonChartComponents/tokens';\nimport {\n CommonChartComponentsContext,\n useCommonChartComponentsContext,\n} from '../CommonChartComponents';\nimport type { DataColorMapping } from '../CommonChartComponents/types';\nimport type {\n ChartDonutWrapperProps,\n ChartDonutCellProps,\n ChartDonutProps,\n ChartRadius,\n} from './types';\nimport {\n RADIUS_MAPPING,\n BASE_CONTAINER_SIZE,\n START_AND_END_ANGLES,\n componentId,\n LABEL_DISTANCE_FROM_CENTER,\n LABEL_FONT_STYLES,\n} from './tokens';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\n\n// Context to share container dimensions for responsive radius calculation\ntype DonutContainerContextType = {\n containerWidth: number;\n containerHeight: number;\n};\n\nconst DonutContainerContext = React.createContext<DonutContainerContextType>({\n containerWidth: 0,\n containerHeight: 0,\n});\n\n// Helper to calculate scaled radius based on container size\nconst getScaledRadius = (\n baseRadius: number,\n containerSize: number,\n baseContainerSize: number,\n): number => {\n if (containerSize <= 0) return baseRadius;\n // Scale the radius proportionally, but cap it at the base value\n const scaleFactor = Math.min(containerSize / baseContainerSize, 1);\n return Math.round(baseRadius * scaleFactor);\n};\n\n// Cell component\nconst _Cell: React.FC<ChartDonutCellProps> = ({ ...rest }) => {\n return <RechartsCell {...rest} />;\n};\n\nconst ChartDonutCell = assignWithoutSideEffects(_Cell, {\n componentId: componentId.cell,\n});\n\nconst getTranslate = (\n legendLayout: 'horizontal' | 'vertical',\n legendAlignment: 'left' | 'right',\n legendWidth: number,\n legendHeight: number,\n): string => {\n if (legendLayout === 'vertical') {\n return `translate(calc(-50% + ${\n legendAlignment === 'right' ? -legendWidth / 2 : legendWidth / 2\n }px) , calc(-50%))`;\n }\n return `translate(-50%, calc(-50% - ${legendHeight / 2}px))`;\n};\n\n/**\n * Gets the item name from data based on nameKey.\n * nameKey can be a string (used as property key) or a function (called with data item).\n */\nconst getItemName = (\n item: Record<string, unknown> | undefined,\n nameKey: ChartDonutProps['nameKey'],\n): unknown => {\n if (!item) return undefined;\n if (!nameKey) return item.name;\n if (typeof nameKey === 'function') return nameKey(item);\n return item[nameKey];\n};\n\nconst ChartDonutWrapper: React.FC<ChartDonutWrapperProps & TestID & DataAnalyticsAttribute> = ({\n children,\n content,\n testID,\n ...restProps\n}) => {\n const { theme } = useTheme();\n // State to track which data keys are currently selected (visible)\n const [selectedDataKeys, setSelectedDataKeys] = useState<string[] | undefined>(undefined);\n\n const colorTheme = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'categorical';\n }\n return donutChild?.props?.colorTheme || 'categorical';\n }\n return 'categorical';\n }, [children]);\n\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [legendHeight, setLegendHeight] = useState(0);\n const [legendWidth, setLegendWidth] = useState(0);\n const [containerDimensions, setContainerDimensions] = useState({ width: 0, height: 0 });\n const chartRef = useRef<HTMLDivElement>(null);\n const isValuePresentInContent = content && typeof content === 'object' && 'value' in content;\n const isLabelPresentInContent = content && typeof content === 'object' && 'label' in content;\n\n useEffect(() => {\n const mutationObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'childList') {\n const legendWrapper = chartRef.current?.querySelector('.recharts-legend-wrapper');\n if (legendWrapper) {\n const height = legendWrapper.getBoundingClientRect().height;\n const width = legendWrapper.getBoundingClientRect().width;\n setLegendHeight(height);\n setLegendWidth(width);\n }\n }\n });\n });\n\n // ResizeObserver to track container dimensions for responsive radius\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n setContainerDimensions({ width, height });\n }\n });\n\n if (chartRef.current) {\n mutationObserver.observe(chartRef.current, { childList: true, subtree: true });\n resizeObserver.observe(chartRef.current);\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n };\n }, []);\n\n const pieChartRadius: ChartRadius = useMemo(() => {\n if (Array.isArray(children)) {\n const donutChild = children.find((child) => getComponentId(child) === componentId.chartDonut);\n if (!donutChild || !isValidElement(donutChild)) {\n return 'medium';\n }\n return donutChild?.props?.radius || 'medium';\n }\n return 'medium';\n }, [children]);\n\n const legendLayout = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'horizontal';\n }\n return legendChild?.props?.layout || 'horizontal';\n }\n return 'horizontal';\n }, [children]);\n\n const legendAlignment = useMemo(() => {\n if (Array.isArray(children)) {\n const legendChild = children.find(\n (child) => getComponentId(child) === commonChartComponentId.chartLegend,\n );\n if (!legendChild || !isValidElement(legendChild)) {\n return 'right';\n }\n return legendChild?.props?.align || 'right';\n }\n return 'right';\n }, [children]);\n /**\n * We need to check child of ChartDonutWrapper. if they have any custom color we store that.\n * We need these mapping because colors of tooltip & legend is determine based on this\n * recharts do provide a color but it is hex code and we need blade color token .\n */\n\n const dataColorMapping = useMemo(() => {\n const dataColorMapping: DataColorMapping = {};\n if (Array.isArray(children)) {\n children.forEach((child) => {\n if (getComponentId(child) === componentId.chartDonut) {\n const data = (child as React.ReactElement<ChartDonutProps>).props.data;\n const nameKey = (child as React.ReactElement<ChartDonutProps>).props.nameKey;\n // Donut Chart can also have <Cell/> which will come under donutChildren.\n const donutChildren = (child as React.ReactElement<ChartDonutProps>).props.children;\n if (Array.isArray(donutChildren)) {\n donutChildren.forEach((child, index) => {\n const itemName = getItemName(data[index], nameKey);\n if (getComponentId(child) === componentId.cell && itemName) {\n // assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`\n\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: child.props?.color,\n isCustomColor: Boolean(child.props?.color),\n };\n }\n });\n } else {\n // if we don't have cell as child component then we can we directly assign theme colors\n data.forEach((item, index) => {\n const itemName = getItemName(item, nameKey);\n dataColorMapping[sanitizeString(itemName as string)] = {\n colorToken: themeColors[index],\n isCustomColor: false,\n };\n });\n }\n }\n });\n }\n assignDataColorMapping(dataColorMapping, themeColors);\n\n return dataColorMapping;\n }, [children, themeColors]);\n\n return (\n <CommonChartComponentsContext.Provider\n value={{ chartName: 'donut', dataColorMapping, selectedDataKeys, setSelectedDataKeys }}\n >\n <DonutContainerContext.Provider\n value={{\n containerWidth: containerDimensions.width,\n containerHeight: containerDimensions.height,\n }}\n >\n <BaseBox\n ref={chartRef}\n {...metaAttribute({ name: 'donut-chart', testID })}\n {...makeAnalyticsAttribute(restProps)}\n width=\"100%\"\n height=\"100%\"\n {...restProps}\n position={isValidElement(content) ? 'relative' : undefined}\n >\n <RechartsResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart>\n {children}\n {isLabelPresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.muted}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .label as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isValuePresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withText\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.label}\n </Label>\n )}\n {isValuePresentInContent && (\n <Label\n position=\"center\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={\n theme.typography.fonts.size[\n LABEL_FONT_STYLES[pieChartRadius].fontSize\n .text as keyof typeof theme.typography.fonts.size\n ]\n }\n fontFamily={theme.typography.fonts.family.heading}\n fontWeight={theme.typography.fonts.weight.bold}\n letterSpacing={theme.typography.letterSpacings[100]}\n dy={\n isLabelPresentInContent\n ? LABEL_DISTANCE_FROM_CENTER[pieChartRadius].withLabel\n : LABEL_DISTANCE_FROM_CENTER[pieChartRadius].normal\n }\n >\n {content?.value}\n </Label>\n )}\n </RechartsPieChart>\n </RechartsResponsiveContainer>\n\n {isValidElement(content) && (\n <BaseBox\n position=\"absolute\"\n top=\"50%\"\n left=\"50%\"\n transform={getTranslate(legendLayout, legendAlignment, legendWidth, legendHeight)}\n zIndex={10}\n textAlign=\"center\"\n >\n {content}\n </BaseBox>\n )}\n </BaseBox>\n </DonutContainerContext.Provider>\n </CommonChartComponentsContext.Provider>\n );\n};\n\nconst _ChartDonut: React.FC<ChartDonutProps> = ({\n cx = '50%',\n cy = '50%',\n radius = 'medium',\n dataKey,\n nameKey,\n children,\n data,\n colorTheme = 'categorical',\n type = 'circle',\n ...rest\n}) => {\n const baseRadiusConfig = RADIUS_MAPPING[radius];\n const baseContainerSize = BASE_CONTAINER_SIZE[radius];\n const { containerWidth, containerHeight } = React.useContext(DonutContainerContext);\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'donut',\n });\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n const { theme } = useTheme();\n const { selectedDataKeys } = useCommonChartComponentsContext();\n\n // Filter data based on selectedDataKeys and build index mapping in a single pass\n // - filteredData: allows the donut chart to re-render with correct proportions\n // - filteredToOriginalIndexMap: ensures colors remain consistent even when data is filtered\n const { filteredData, filteredToOriginalIndexMap } = useMemo(() => {\n if (!selectedDataKeys) return { filteredData: data, filteredToOriginalIndexMap: null };\n\n const filteredData: typeof data = [];\n const filteredToOriginalIndexMap: Record<number, number> = {};\n\n data.forEach((item, originalIdx) => {\n const itemName = getItemName(item, nameKey);\n if (selectedDataKeys.includes(sanitizeString(itemName as string))) {\n filteredToOriginalIndexMap[filteredData.length] = originalIdx;\n filteredData.push(item);\n }\n });\n\n return { filteredData, filteredToOriginalIndexMap };\n }, [data, nameKey, selectedDataKeys]);\n\n // Calculate responsive radius based on container size\n const containerSize = Math.min(containerWidth, containerHeight);\n const scaledOuterRadius = getScaledRadius(\n baseRadiusConfig.outerRadius,\n containerSize,\n baseContainerSize,\n );\n const scaledInnerRadius = getScaledRadius(\n baseRadiusConfig.innerRadius,\n containerSize,\n baseContainerSize,\n );\n // Stroke inner radius is slightly smaller than outer for the border effect\n const scaledStrokeInnerRadius = scaledOuterRadius - 0.75;\n\n const getCellOpacity = (hoveredIndex: number | null, currentIndex: number): number => {\n if (hoveredIndex === null) return 1;\n if (hoveredIndex === currentIndex) return 1;\n return 0.2;\n };\n\n const modifiedChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n const fill = getIn(theme.colors, child.props.color || themeColors[originalIndex]);\n return (\n <RechartsCell\n {...child.props}\n fill={fill}\n key={filteredIndex}\n opacity={getCellOpacity(hoveredIndex, filteredIndex)}\n strokeWidth={0}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n fill={getIn(theme.colors, themeColors[originalIndex])}\n key={index}\n opacity={getCellOpacity(hoveredIndex, index)}\n strokeWidth={0}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n const modifiedExternalDonutChildren = useMemo(() => {\n if (Array.isArray(children)) {\n // Filter children based on selectedDataKeys to match filtered data\n const filteredChildren = selectedDataKeys\n ? children.filter((child, index) => {\n if (getComponentId(child) !== componentId.cell) return true;\n const itemName = getItemName(data[index], nameKey) as string;\n return selectedDataKeys.includes(sanitizeString(itemName));\n })\n : children;\n\n return filteredChildren.map((child, filteredIndex) => {\n if (getComponentId(child) === componentId.cell) {\n /* \n Why we are not using React.cloneElement ? just use ChartDonutCell no?\n cell can never be custom component in recharts. (as of v3.1.2)\n (https://github.com/recharts/recharts/issues/2788)\n https://github.com/recharts/recharts/discussions/5474\n\n So we have placeholder component ChartDonutCell. which we replaced by RechartsCell internally so dev can see hover effects\n working out of box. \n */\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap\n ? filteredToOriginalIndexMap[filteredIndex]\n : filteredIndex;\n\n const fill = getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: child.props.color || themeColors[originalIndex],\n followIntensityMapping: Boolean(child.props.color),\n }),\n );\n return (\n <RechartsCell\n {...child.props}\n key={`stroke-${filteredIndex}`}\n fill=\"transparent\"\n stroke={fill} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, filteredIndex)}\n />\n );\n } else {\n return child;\n }\n });\n }\n return filteredData?.map((_, index) => {\n // Use original index for color lookup to maintain consistent colors\n const originalIndex = filteredToOriginalIndexMap ? filteredToOriginalIndexMap[index] : index;\n return (\n <RechartsCell\n key={`stroke-${index}`}\n fill=\"transparent\"\n stroke={getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: themeColors[originalIndex],\n }),\n )} // Different stroke color for each cell\n strokeWidth={0.75}\n strokeOpacity={getCellOpacity(hoveredIndex, index)}\n />\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n children,\n data,\n filteredData,\n colorTheme,\n hoveredIndex,\n themeColors,\n selectedDataKeys,\n filteredToOriginalIndexMap,\n nameKey,\n ]);\n\n return (\n <>\n <RechartsPie\n {...rest}\n dataKey={dataKey}\n nameKey={nameKey}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledInnerRadius}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n onMouseEnter={(_, index) => {\n setHoveredIndex(index);\n }}\n onMouseLeave={() => {\n setHoveredIndex(null);\n }}\n paddingAngle={1.5}\n >\n {modifiedChildren}\n </RechartsPie>\n <RechartsPie\n {...rest}\n cx={cx}\n cy={cy}\n outerRadius={scaledOuterRadius}\n innerRadius={scaledStrokeInnerRadius}\n dataKey={dataKey}\n nameKey={nameKey}\n data={filteredData}\n startAngle={START_AND_END_ANGLES[type].startAngle}\n endAngle={START_AND_END_ANGLES[type].endAngle}\n fill=\"transparent\"\n legendType=\"none\"\n tooltipType=\"none\"\n paddingAngle={1.5}\n // ToolTip is already disabled here.. need to disable pointer events to prevent the tooltip from being shown when the user hovers over the donut chart in some cases\n style={{ pointerEvents: 'none' }}\n >\n {modifiedExternalDonutChildren}\n </RechartsPie>\n </>\n );\n};\n\nconst ChartDonut = assignWithoutSideEffects(_ChartDonut, {\n componentId: componentId.chartDonut,\n});\n\nexport { ChartDonut, ChartDonutWrapper, ChartDonutCell };\n"],"names":["DonutContainerContext","React","createContext","containerWidth","containerHeight","getScaledRadius","baseRadius","containerSize","baseContainerSize","scaleFactor","Math","min","round","_Cell","_ref","rest","_extends","_objectDestructuringEmpty","_jsx","RechartsCell","_objectSpread","ChartDonutCell","assignWithoutSideEffects","componentId","cell","getTranslate","legendLayout","legendAlignment","legendWidth","legendHeight","concat","getItemName","item","nameKey","undefined","name","ChartDonutWrapper","_ref2","children","content","testID","restProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useState","useState","_useState2","_slicedToArray","selectedDataKeys","setSelectedDataKeys","colorTheme","useMemo","Array","isArray","_donutChild$props","donutChild","find","child","getComponentId","chartDonut","isValidElement","props","themeColors","useChartsColorTheme","chartName","_useState3","_useState4","setLegendHeight","_useState5","_useState6","setLegendWidth","_useState7","width","height","_useState8","containerDimensions","setContainerDimensions","chartRef","useRef","isValuePresentInContent","_typeof","isLabelPresentInContent","useEffect","mutationObserver","MutationObserver","mutations","forEach","mutation","type","_chartRef$current","legendWrapper","current","querySelector","getBoundingClientRect","resizeObserver","ResizeObserver","entries","_iterator","_createForOfIteratorHelper","_step","s","n","done","entry","value","_entry$contentRect","contentRect","err","e","f","observe","childList","subtree","disconnect","pieChartRadius","_donutChild$props2","radius","_legendChild$props","legendChild","commonChartComponentId","chartLegend","layout","_legendChild$props2","align","dataColorMapping","data","donutChildren","index","itemName","_child$props","_child$props2","sanitizeString","colorToken","color","isCustomColor","Boolean","assignDataColorMapping","CommonChartComponentsContext","Provider","_jsxs","BaseBox","ref","metaAttribute","makeAnalyticsAttribute","position","RechartsResponsiveContainer","RechartsPieChart","Label","fill","colors","surface","text","gray","muted","fontSize","typography","fonts","size","LABEL_FONT_STYLES","label","fontFamily","family","fontWeight","weight","medium","letterSpacing","letterSpacings","dy","LABEL_DISTANCE_FROM_CENTER","withText","normal","heading","bold","withLabel","top","left","transform","zIndex","textAlign","_ChartDonut","_ref3","_ref3$cx","cx","_ref3$cy","cy","_ref3$radius","dataKey","_ref3$colorTheme","_ref3$type","_excluded2","baseRadiusConfig","RADIUS_MAPPING","BASE_CONTAINER_SIZE","_React$useContext","useContext","_useState9","_useState0","hoveredIndex","setHoveredIndex","_useTheme2","_useCommonChartCompon","useCommonChartComponentsContext","_useMemo","filteredData","filteredToOriginalIndexMap","originalIdx","includes","length","push","scaledOuterRadius","outerRadius","scaledInnerRadius","innerRadius","scaledStrokeInnerRadius","getCellOpacity","currentIndex","modifiedChildren","filteredChildren","filter","map","filteredIndex","originalIndex","getIn","_createElement","key","opacity","strokeWidth","_","modifiedExternalDonutChildren","getHighestColorInRange","followIntensityMapping","stroke","strokeOpacity","_Fragment","RechartsPie","startAngle","START_AND_END_ANGLES","endAngle","onMouseEnter","onMouseLeave","paddingAngle","legendType","tooltipType","style","pointerEvents","ChartDonut"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,qBAAqB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAC3EC,EAAAA,cAAc,EAAE,CAAC;AACjBC,EAAAA,eAAe,EAAE,CAAA;AACnB,CAAC,CAAC,CAAA;;AAEF;AACA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CACnBC,UAAkB,EAClBC,aAAqB,EACrBC,iBAAyB,EACd;AACX,EAAA,IAAID,aAAa,IAAI,CAAC,EAAE,OAAOD,UAAU,CAAA;AACzC;EACA,IAAMG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAACJ,aAAa,GAAGC,iBAAiB,EAAE,CAAC,CAAC,CAAA;AAClE,EAAA,OAAOE,IAAI,CAACE,KAAK,CAACN,UAAU,GAAGG,WAAW,CAAC,CAAA;AAC7C,CAAC,CAAA;;AAED;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BG,MAAAA,WAAW,EAAEC,uBAAwB;AACrC3B,MAAAA,OAAO,EAAEA,OAAQ;AACjB5J,MAAAA,OAAO,EAAEA,OAAQ;AACjB+F,MAAAA,IAAI,EAAE8E,YAAa;AACnBgC,MAAAA,UAAU,EAAEC,oBAAoB,CAACpJ,IAAI,CAAC,CAACmJ,UAAW;AAClDE,MAAAA,QAAQ,EAAED,oBAAoB,CAACpJ,IAAI,CAAC,CAACqJ,QAAS;AAC9CzF,MAAAA,IAAI,EAAC,aAAa;AAClB6F,MAAAA,UAAU,EAAC,MAAM;AACjBC,MAAAA,WAAW,EAAC,MAAM;AAClBF,MAAAA,YAAY,EAAE,GAAA;AACd;AAAA;AACAG,MAAAA,KAAK,EAAE;AAAEC,QAAAA,aAAa,EAAE,MAAA;OAAS;AAAAjN,MAAAA,QAAA,EAEhCiM,6BAAAA;AAA6B,KAAA,CACnB,CAAC,CAAA;AAAA,GACd,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,IAAMiB,UAAU,gBAAGlO,wBAAwB,CAACgK,WAAW,EAAE;EACvD/J,WAAW,EAAEA,WAAW,CAACuC,UAAAA;AAC3B,CAAC;;;;"}
@@ -1,8 +1,8 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
1
2
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
5
- import { memo, useRef, useMemo, useLayoutEffect, useState } from 'react';
5
+ import { memo, useMemo, useState } from 'react';
6
6
  import { ErrorBoundary } from 'react-error-boundary';
7
7
  import dayjs from 'dayjs';
8
8
  import { formatNumber } from '@razorpay/i18nify-js';
@@ -298,27 +298,10 @@ var RenderTextComponent = /*#__PURE__*/memo(function (_ref11) {
298
298
  var _useGenUIAnimation = useGenUIAnimation(),
299
299
  isAnimating = _useGenUIAnimation.isAnimating,
300
300
  animateOptions = _useGenUIAnimation.animateOptions;
301
- // Tracks how many words were already animated in the previous render.
302
- // Passed to rehypeAnimate as `skipWords` so only truly new words get spans.
303
- var prevWordCountRef = useRef(0);
304
-
305
- // useMemo reads prevWordCountRef.current (= previous render's count) at
306
- // render time, before useLayoutEffect updates it for the next render.
307
301
  var rehypePlugins = useMemo(function () {
308
302
  if (!isAnimating) return [];
309
- return [createRehypeAnimate(_objectSpread(_objectSpread({}, animateOptions), {}, {
310
- skipWords: prevWordCountRef.current
311
- }))];
312
- // `content` is intentionally listed so the memo re-runs per streaming
313
- // chunk, picking up the latest prevWordCountRef value each time.
314
- // eslint-disable-next-line react-hooks/exhaustive-deps
315
- }, [isAnimating, animateOptions, content]);
316
-
317
- // After each render, record the current word count so the next render
318
- // knows how many words to skip.
319
- useLayoutEffect(function () {
320
- prevWordCountRef.current = content ? content.split(/\s+/).filter(Boolean).length : 0;
321
- }, [content]);
303
+ return [createRehypeAnimate(animateOptions)];
304
+ }, [isAnimating, animateOptions]);
322
305
  if (!content) return null;
323
306
  return /*#__PURE__*/jsxs(Fragment, {
324
307
  children: [isAnimating ? /*#__PURE__*/jsx(TextAnimationStyles, {}) : null, /*#__PURE__*/jsx(ReactMarkdown, {