csv-charts-ai 1.10.0 → 1.11.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.
package/dist/charts.d.ts CHANGED
@@ -66,4 +66,44 @@ declare function ChartThemeProvider({ theme, children, }: {
66
66
  }): react_jsx_runtime.JSX.Element;
67
67
  declare function useChartTheme(): ChartTheme;
68
68
 
69
- export { ChartConfig, ChartDisplay, type ChartDisplayProps, ChartTheme, ChartThemeProvider, ChartToolbar, ChartType, SingleChart, type SingleChartProps, SortOrder, TabularData, useChartTheme };
69
+ /** Props accepted by every chart icon component. */
70
+ interface ChartIconProps {
71
+ className?: string;
72
+ }
73
+ /** A React component that renders an icon. */
74
+ type ChartIcon = React.ComponentType<ChartIconProps>;
75
+ /** The full set of icons used by chart components. */
76
+ interface ChartIconSet {
77
+ RefreshCw: ChartIcon;
78
+ Download: ChartIcon;
79
+ SortAsc: ChartIcon;
80
+ SortDesc: ChartIcon;
81
+ RotateCcw: ChartIcon;
82
+ TrendingUp: ChartIcon;
83
+ Filter: ChartIcon;
84
+ ImageIcon: ChartIcon;
85
+ }
86
+ declare const defaultIcons: ChartIconSet;
87
+ /**
88
+ * Provide a custom icon set to chart components.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * import { ChartIconProvider } from "csv-charts-ai/charts";
93
+ * import { RefreshCw, Download, ... } from "lucide-react";
94
+ *
95
+ * const lucideIcons = { RefreshCw, Download, SortAsc, SortDesc, RotateCcw, TrendingUp, Filter, ImageIcon: Image };
96
+ *
97
+ * <ChartIconProvider icons={lucideIcons}>
98
+ * <ChartDisplay data={data} charts={charts} />
99
+ * </ChartIconProvider>
100
+ * ```
101
+ */
102
+ declare function ChartIconProvider({ icons, children, }: {
103
+ icons: Partial<ChartIconSet>;
104
+ children: React.ReactNode;
105
+ }): react_jsx_runtime.JSX.Element;
106
+ /** Get the current icon set from context. */
107
+ declare function useChartIcons(): ChartIconSet;
108
+
109
+ export { ChartConfig, ChartDisplay, type ChartDisplayProps, type ChartIcon, type ChartIconProps, ChartIconProvider, type ChartIconSet, ChartTheme, ChartThemeProvider, ChartToolbar, ChartType, SingleChart, type SingleChartProps, SortOrder, TabularData, defaultIcons, useChartIcons, useChartTheme };