+ {payload.map((entry) => {
+ const key = nameKey
+ ? (entry.dataKey || entry.value)
+ : entry.dataKey || entry.value;
+ const itemConfig = key ? config[key] : undefined;
+ const displayName = itemConfig?.label || entry.value || key;
+ const color =
+ entry.color || (itemConfig?.color ? `var(--color-${key})` : undefined);
+
+ const IconComponent = itemConfig?.icon;
+
+ return (
+
+ {!hideIcon && (
+ IconComponent ? (
+
+ ) : (
+
+ )
+ )}
+ {displayName}
+
+ );
+ })}
+
+ );
+ }
+);
+
+ChartLegendContent.displayName = 'ChartLegendContent';
diff --git a/packages/charts/src/chart-style.tsx b/packages/charts/src/chart-style.tsx
new file mode 100644
index 00000000..a9fcdaeb
--- /dev/null
+++ b/packages/charts/src/chart-style.tsx
@@ -0,0 +1,48 @@
+import React, { useMemo } from 'react';
+import { ChartConfig } from './types';
+
+const THEMES = { light: '', dark: 'html[data-tiny-theme=dark]' } as const;
+
+/**
+ * Generates an inline