diff --git a/js/packages/react-ui/package.json b/js/packages/react-ui/package.json index ff9a94cc7..37c8ff193 100644 --- a/js/packages/react-ui/package.json +++ b/js/packages/react-ui/package.json @@ -2,7 +2,7 @@ "type": "module", "name": "@crayonai/react-ui", "license": "MIT", - "version": "0.8.3", + "version": "0.8.4", "description": "Component library for Generative UI SDK", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/js/packages/react-ui/src/components/Charts/RadialChart/stories/RadialChart.stories.tsx b/js/packages/react-ui/src/components/Charts/RadialChart/stories/RadialChart.stories.tsx index c0fc1994b..4dbf258c8 100644 --- a/js/packages/react-ui/src/components/Charts/RadialChart/stories/RadialChart.stories.tsx +++ b/js/packages/react-ui/src/components/Charts/RadialChart/stories/RadialChart.stories.tsx @@ -536,9 +536,7 @@ export const LargeDatasetDemo: Story = { Complete breakdown of 15 compensation categories with carousel navigation

- - - +
{ const ITEM_HEIGHT = 36; // Height of each legend item const ITEM_GAP = 2; // Gap between items const LEGEND_ITEM_LIMIT = 6; +const SHOW_MORE_BREAKPOINT = 450; export const StackedLegend = ({ items, @@ -42,7 +43,9 @@ export const StackedLegend = ({ const [showAll, setShowAll] = useState(false); const [isOverflowing, setIsOverflowing] = useState(false); - const isShowMoreLayout = containerWidth !== undefined && items.length > LEGEND_ITEM_LIMIT; + const isShowMoreLayout = + containerWidth !== undefined && + (containerWidth < SHOW_MORE_BREAKPOINT || items.length > LEGEND_ITEM_LIMIT); const handleMouseEnter = (key: string, index: number) => { onItemHover?.(key); @@ -62,7 +65,7 @@ export const StackedLegend = ({ const overflowing = scrollHeight > clientHeight; setIsOverflowing(overflowing); setShowUpButton(scrollTop > 0); - setShowDownButton(scrollTop < scrollHeight - clientHeight - 1); // -1 for rounding errors + setShowDownButton(scrollTop < scrollHeight - clientHeight - 1); } }; @@ -175,7 +178,7 @@ export const StackedLegend = ({
))} - {isShowMoreLayout && !showAll && ( + {isShowMoreLayout && !showAll && items.length > LEGEND_ITEM_LIMIT && (