@expcat/tigercat-react 0.1.8 → 0.2.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/{chunk-TBIEWDY5.js → chunk-36RRHNZD.js} +13 -2
- package/dist/chunk-3CDAG4HD.mjs +151 -0
- package/dist/chunk-3QFHVAZT.js +68 -0
- package/dist/{chunk-ALP3KYYY.mjs → chunk-3XKBDV2Q.mjs} +5 -5
- package/dist/chunk-42UKIFFQ.js +278 -0
- package/dist/{chunk-K7ZMB2TH.mjs → chunk-5XKYWZZZ.mjs} +16 -22
- package/dist/chunk-677VSTPW.mjs +65 -0
- package/dist/chunk-6DYS4PJT.mjs +99 -0
- package/dist/chunk-6PBNFLM7.js +95 -0
- package/dist/{chunk-DCRVIDMY.mjs → chunk-6ZC7H22S.mjs} +1 -1
- package/dist/{chunk-WSCSDSV7.mjs → chunk-7IKJBQQV.mjs} +27 -5
- package/dist/{chunk-OTRGVENC.js → chunk-7SLNHUGJ.js} +1 -1
- package/dist/chunk-A2UW5OKX.mjs +415 -0
- package/dist/{chunk-NOOPXNR4.mjs → chunk-AGUPZEUL.mjs} +2 -3
- package/dist/chunk-AX5XRD2Q.js +35 -0
- package/dist/{chunk-BJU5N7WU.mjs → chunk-BAPR7UUR.mjs} +7 -7
- package/dist/chunk-CBALIFPW.mjs +275 -0
- package/dist/{chunk-BIWO5KB4.mjs → chunk-CJJ56NVL.mjs} +2 -2
- package/dist/{chunk-ENR3RIMM.js → chunk-DGBYGBLR.js} +72 -59
- package/dist/chunk-DUWAV47E.js +42 -0
- package/dist/chunk-E5GD3H7L.js +94 -0
- package/dist/chunk-EJLJYOO7.js +367 -0
- package/dist/{chunk-FQ6UHRAO.js → chunk-GQMYCYZ4.js} +6 -27
- package/dist/{chunk-G6FSHN2I.mjs → chunk-GW4EWT2K.mjs} +45 -31
- package/dist/{chunk-AQQRWISY.js → chunk-GXTBCX3M.js} +1 -1
- package/dist/{chunk-HQXZVTP4.mjs → chunk-HGF2EL25.mjs} +74 -61
- package/dist/{chunk-R5BQHZWB.js → chunk-HRYBEBZC.js} +15 -21
- package/dist/{chunk-PAD2DX5M.mjs → chunk-IIVRVCCP.mjs} +6 -24
- package/dist/chunk-IS467WAO.mjs +39 -0
- package/dist/{chunk-CTAMMQBC.mjs → chunk-IS7YOBR7.mjs} +16 -13
- package/dist/{chunk-ADOPAXPG.mjs → chunk-JI7SFMUT.mjs} +2 -2
- package/dist/chunk-KBGURVTD.mjs +282 -0
- package/dist/{chunk-O3EUFIOS.mjs → chunk-KELLYJZY.mjs} +36 -30
- package/dist/{chunk-XZDJ5FRB.js → chunk-KPZTGRNA.js} +5 -23
- package/dist/chunk-KQZ4F7FZ.js +153 -0
- package/dist/{chunk-XDKXL2BP.mjs → chunk-KV4LLPAY.mjs} +14 -3
- package/dist/{chunk-LNKI6HQ3.js → chunk-LIJLFLYE.js} +27 -5
- package/dist/chunk-LVC43YX2.mjs +72 -0
- package/dist/chunk-LZNG2HGC.mjs +227 -0
- package/dist/chunk-M375I56K.js +75 -0
- package/dist/{chunk-7OLWGHUR.mjs → chunk-MF3H7WWW.mjs} +13 -2
- package/dist/chunk-N32MAX4A.js +230 -0
- package/dist/{chunk-YYKJ63LD.mjs → chunk-NMDNLB3C.mjs} +7 -28
- package/dist/{chunk-77D7VQMG.js → chunk-OD2NNQD2.js} +2 -2
- package/dist/chunk-OONM7FO7.js +418 -0
- package/dist/{chunk-Q5Q7FG4U.js → chunk-OZLGNWET.js} +7 -7
- package/dist/{chunk-LAZGEMA2.mjs → chunk-P4EFJIXU.mjs} +1 -1
- package/dist/chunk-QI6WAP6Y.js +285 -0
- package/dist/{chunk-WK5HN4OH.js → chunk-QY6I7LU5.js} +43 -29
- package/dist/{chunk-KSW5JDIV.js → chunk-R7TOQU3U.js} +1 -1
- package/dist/chunk-RQSQXQN6.mjs +91 -0
- package/dist/chunk-SDLMB34Y.mjs +32 -0
- package/dist/chunk-UG3I4PCY.js +102 -0
- package/dist/chunk-VBSK4TGO.mjs +364 -0
- package/dist/{chunk-DZJUFU55.js → chunk-VXHBQTZS.js} +14 -11
- package/dist/chunk-WLIFEALE.mjs +111 -0
- package/dist/{chunk-AQ6DHCP6.js → chunk-XRFK2IXM.js} +4 -4
- package/dist/{chunk-5FRENLDC.js → chunk-Y2JOJ4D6.js} +14 -3
- package/dist/chunk-YER7IQF4.mjs +429 -0
- package/dist/{chunk-NI2WNZRT.js → chunk-YESS6YKC.js} +1 -2
- package/dist/chunk-Z6F67MJE.mjs +92 -0
- package/dist/{chunk-QORSSZX4.js → chunk-ZPFZMXA6.js} +34 -28
- package/dist/chunk-ZUUG3WOL.js +432 -0
- package/dist/chunk-ZYPEO2KY.js +115 -0
- package/dist/components/AreaChart.d.mts +19 -0
- package/dist/components/AreaChart.d.ts +19 -0
- package/dist/components/AreaChart.js +23 -0
- package/dist/components/AreaChart.mjs +8 -0
- package/dist/components/BarChart.d.mts +16 -0
- package/dist/components/BarChart.d.ts +16 -0
- package/dist/components/BarChart.js +23 -0
- package/dist/components/BarChart.mjs +8 -0
- package/dist/components/ChartAxis.d.mts +10 -0
- package/dist/components/ChartAxis.d.ts +10 -0
- package/dist/components/ChartAxis.js +16 -0
- package/dist/components/ChartAxis.mjs +1 -0
- package/dist/components/ChartCanvas.d.mts +9 -0
- package/dist/components/ChartCanvas.d.ts +9 -0
- package/dist/components/ChartCanvas.js +16 -0
- package/dist/components/ChartCanvas.mjs +1 -0
- package/dist/components/ChartGrid.d.mts +11 -0
- package/dist/components/ChartGrid.d.ts +11 -0
- package/dist/components/ChartGrid.js +16 -0
- package/dist/components/ChartGrid.mjs +1 -0
- package/dist/components/ChartLegend.d.mts +17 -0
- package/dist/components/ChartLegend.d.ts +17 -0
- package/dist/components/ChartLegend.js +16 -0
- package/dist/components/ChartLegend.mjs +1 -0
- package/dist/components/ChartSeries.d.mts +18 -0
- package/dist/components/ChartSeries.d.ts +18 -0
- package/dist/components/ChartSeries.js +16 -0
- package/dist/components/ChartSeries.mjs +1 -0
- package/dist/components/ChartTooltip.d.mts +12 -0
- package/dist/components/ChartTooltip.d.ts +12 -0
- package/dist/components/ChartTooltip.js +16 -0
- package/dist/components/ChartTooltip.mjs +1 -0
- package/dist/components/DonutChart.d.mts +14 -0
- package/dist/components/DonutChart.d.ts +14 -0
- package/dist/components/DonutChart.js +21 -0
- package/dist/components/DonutChart.mjs +6 -0
- package/dist/components/Drawer.js +3 -3
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.d.mts +12 -2
- package/dist/components/Dropdown.d.ts +12 -2
- package/dist/components/Dropdown.js +4 -4
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/DropdownItem.js +4 -4
- package/dist/components/DropdownItem.mjs +3 -3
- package/dist/components/Icon.js +2 -2
- package/dist/components/Icon.mjs +1 -1
- package/dist/components/LineChart.d.mts +19 -0
- package/dist/components/LineChart.d.ts +19 -0
- package/dist/components/LineChart.js +23 -0
- package/dist/components/LineChart.mjs +8 -0
- package/dist/components/List.js +3 -3
- package/dist/components/List.mjs +2 -2
- package/dist/components/Message.js +4 -4
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Modal.js +3 -3
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/Notification.js +4 -4
- package/dist/components/Notification.mjs +1 -1
- package/dist/components/Pagination.d.mts +5 -1
- package/dist/components/Pagination.d.ts +5 -1
- package/dist/components/Pagination.js +3 -3
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.d.mts +14 -0
- package/dist/components/PieChart.d.ts +14 -0
- package/dist/components/PieChart.js +20 -0
- package/dist/components/PieChart.mjs +5 -0
- package/dist/components/Popconfirm.d.mts +12 -2
- package/dist/components/Popconfirm.d.ts +12 -2
- package/dist/components/Popconfirm.js +3 -2
- package/dist/components/Popconfirm.mjs +2 -1
- package/dist/components/Popover.d.mts +12 -2
- package/dist/components/Popover.d.ts +12 -2
- package/dist/components/Popover.js +3 -2
- package/dist/components/Popover.mjs +2 -1
- package/dist/components/RadarChart.d.mts +20 -0
- package/dist/components/RadarChart.d.ts +20 -0
- package/dist/components/RadarChart.js +20 -0
- package/dist/components/RadarChart.mjs +5 -0
- package/dist/components/ScatterChart.d.mts +32 -0
- package/dist/components/ScatterChart.d.ts +32 -0
- package/dist/components/ScatterChart.js +23 -0
- package/dist/components/ScatterChart.mjs +8 -0
- package/dist/components/Select.js +2 -2
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Slider.js +2 -2
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Space.js +2 -2
- package/dist/components/Space.mjs +1 -1
- package/dist/components/Steps.js +3 -3
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +2 -2
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/components/Tooltip.d.mts +12 -2
- package/dist/components/Tooltip.d.ts +12 -2
- package/dist/components/Tooltip.js +3 -2
- package/dist/components/Tooltip.mjs +2 -1
- package/dist/index.d.mts +97 -1
- package/dist/index.d.ts +97 -1
- package/dist/index.js +178 -108
- package/dist/index.mjs +41 -27
- package/package.json +2 -2
- package/dist/chunk-NEULKOYJ.js +0 -48
- package/dist/chunk-ZO4XVOHU.mjs +0 -45
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TooltipProps as TooltipProps$1 } from '@expcat/tigercat-core';
|
|
2
|
+
import { TooltipProps as TooltipProps$1, FloatingPlacement } from '@expcat/tigercat-core';
|
|
3
3
|
|
|
4
|
-
type TooltipProps = Omit<TooltipProps$1, 'content' | 'style'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style' | 'content'> & {
|
|
4
|
+
type TooltipProps = Omit<TooltipProps$1, 'content' | 'style' | 'placement'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style' | 'content'> & {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
content?: React.ReactNode;
|
|
7
7
|
/** @deprecated Use `content` (supports ReactNode). */
|
|
8
8
|
contentContent?: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: React.CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* Tooltip placement relative to trigger
|
|
13
|
+
* @default 'top'
|
|
14
|
+
*/
|
|
15
|
+
placement?: FloatingPlacement;
|
|
16
|
+
/**
|
|
17
|
+
* Offset distance from trigger (in pixels)
|
|
18
|
+
* @default 8
|
|
19
|
+
*/
|
|
20
|
+
offset?: number;
|
|
11
21
|
onVisibleChange?: (visible: boolean) => void;
|
|
12
22
|
};
|
|
13
23
|
declare const Tooltip: React.FC<TooltipProps>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQY6I7LU5_js = require('../chunk-QY6I7LU5.js');
|
|
4
|
+
require('../chunk-ZYPEO2KY.js');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
Object.defineProperty(exports, "Tooltip", {
|
|
8
9
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkQY6I7LU5_js.Tooltip; }
|
|
10
11
|
});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Tooltip } from '../chunk-
|
|
1
|
+
export { Tooltip } from '../chunk-GW4EWT2K.mjs';
|
|
2
|
+
import '../chunk-WLIFEALE.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartLegendPosition, ChartLegendItem } from '@expcat/tigercat-core';
|
|
1
2
|
export * from '@expcat/tigercat-core';
|
|
2
3
|
export { ConfigProvider, useTigerConfig } from './components/ConfigProvider.mjs';
|
|
3
4
|
export { Button, ButtonProps } from './components/Button.mjs';
|
|
@@ -63,9 +64,104 @@ export { Loading, LoadingProps } from './components/Loading.mjs';
|
|
|
63
64
|
export { Popconfirm, PopconfirmProps } from './components/Popconfirm.mjs';
|
|
64
65
|
export { Popover, PopoverProps } from './components/Popover.mjs';
|
|
65
66
|
export { Tooltip, TooltipProps } from './components/Tooltip.mjs';
|
|
67
|
+
export { default as ChartCanvas, ChartCanvasProps } from './components/ChartCanvas.mjs';
|
|
68
|
+
export { default as ChartAxis, ChartAxisProps } from './components/ChartAxis.mjs';
|
|
69
|
+
export { default as ChartGrid, ChartGridProps } from './components/ChartGrid.mjs';
|
|
70
|
+
export { default as ChartSeries, ChartSeriesProps } from './components/ChartSeries.mjs';
|
|
71
|
+
export { default as BarChart, BarChartProps } from './components/BarChart.mjs';
|
|
72
|
+
export { default as ScatterChart, ScatterChartProps } from './components/ScatterChart.mjs';
|
|
73
|
+
export { default as PieChart, PieChartProps } from './components/PieChart.mjs';
|
|
74
|
+
export { default as DonutChart, DonutChartProps } from './components/DonutChart.mjs';
|
|
75
|
+
export { default as RadarChart, RadarChartProps } from './components/RadarChart.mjs';
|
|
76
|
+
export { default as LineChart, LineChartProps } from './components/LineChart.mjs';
|
|
77
|
+
export { default as AreaChart, AreaChartProps } from './components/AreaChart.mjs';
|
|
78
|
+
export { default as ChartLegend, ChartLegendProps } from './components/ChartLegend.mjs';
|
|
79
|
+
export { default as ChartTooltip, ChartTooltipProps } from './components/ChartTooltip.mjs';
|
|
66
80
|
import 'react';
|
|
67
81
|
import 'react/jsx-runtime';
|
|
68
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Options for useChartInteraction hook
|
|
85
|
+
*/
|
|
86
|
+
interface UseChartInteractionOptions<T = unknown> {
|
|
87
|
+
/** Enable hover highlight */
|
|
88
|
+
hoverable: boolean;
|
|
89
|
+
/** Controlled hovered index from props */
|
|
90
|
+
hoveredIndexProp?: number | null;
|
|
91
|
+
/** Enable click selection */
|
|
92
|
+
selectable: boolean;
|
|
93
|
+
/** Controlled selected index from props */
|
|
94
|
+
selectedIndexProp?: number | null;
|
|
95
|
+
/** Opacity for active element */
|
|
96
|
+
activeOpacity: number;
|
|
97
|
+
/** Opacity for inactive elements */
|
|
98
|
+
inactiveOpacity: number;
|
|
99
|
+
/** Legend position for wrapper classes */
|
|
100
|
+
legendPosition?: ChartLegendPosition;
|
|
101
|
+
/** Callback when hover changes */
|
|
102
|
+
onHoveredIndexChange?: (index: number | null) => void;
|
|
103
|
+
/** Callback when selection changes */
|
|
104
|
+
onSelectedIndexChange?: (index: number | null) => void;
|
|
105
|
+
/** Get data item by index */
|
|
106
|
+
getData?: (index: number) => T | undefined;
|
|
107
|
+
/** Custom callbacks */
|
|
108
|
+
callbacks?: {
|
|
109
|
+
onHover?: (index: number | null, datum: T | null) => void;
|
|
110
|
+
onClick?: (index: number, datum: T) => void;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Return type for useChartInteraction
|
|
115
|
+
*/
|
|
116
|
+
interface UseChartInteractionReturn {
|
|
117
|
+
/** Local hovered index state */
|
|
118
|
+
localHoveredIndex: number | null;
|
|
119
|
+
/** Local selected index state */
|
|
120
|
+
localSelectedIndex: number | null;
|
|
121
|
+
/** Tooltip position state */
|
|
122
|
+
tooltipPosition: {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
};
|
|
126
|
+
/** Resolved hovered index (controlled or uncontrolled) */
|
|
127
|
+
resolvedHoveredIndex: number | null;
|
|
128
|
+
/** Resolved selected index (controlled or uncontrolled) */
|
|
129
|
+
resolvedSelectedIndex: number | null;
|
|
130
|
+
/** Current active index for highlighting */
|
|
131
|
+
activeIndex: number | null;
|
|
132
|
+
/** Get element opacity based on active state */
|
|
133
|
+
getElementOpacity: (index: number) => number | undefined;
|
|
134
|
+
/** Handle mouse enter on chart element */
|
|
135
|
+
handleMouseEnter: (index: number, event: React.MouseEvent) => void;
|
|
136
|
+
/** Handle mouse move for tooltip */
|
|
137
|
+
handleMouseMove: (event: React.MouseEvent) => void;
|
|
138
|
+
/** Handle mouse leave */
|
|
139
|
+
handleMouseLeave: () => void;
|
|
140
|
+
/** Handle click on chart element */
|
|
141
|
+
handleClick: (index: number) => void;
|
|
142
|
+
/** Handle keydown for accessibility */
|
|
143
|
+
handleKeyDown: (event: React.KeyboardEvent, index: number) => void;
|
|
144
|
+
/** Handle legend item click */
|
|
145
|
+
handleLegendClick: (index: number) => void;
|
|
146
|
+
/** Handle legend item hover */
|
|
147
|
+
handleLegendHover: (index: number) => void;
|
|
148
|
+
/** Handle legend item leave */
|
|
149
|
+
handleLegendLeave: () => void;
|
|
150
|
+
/** Wrapper classes for legend layout */
|
|
151
|
+
wrapperClasses: string;
|
|
152
|
+
/** Create legend items from data */
|
|
153
|
+
createLegendItems: (items: Array<{
|
|
154
|
+
label?: string;
|
|
155
|
+
color?: string;
|
|
156
|
+
x?: unknown;
|
|
157
|
+
}>, palette: string[], labelFormatter?: (item: unknown, index: number) => string) => ChartLegendItem[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Hook for chart interaction state and handlers
|
|
161
|
+
* Extracts common interaction logic from high-level chart components
|
|
162
|
+
*/
|
|
163
|
+
declare function useChartInteraction<T = unknown>(options: UseChartInteractionOptions<T>): UseChartInteractionReturn;
|
|
164
|
+
|
|
69
165
|
/**
|
|
70
166
|
* Tigercat React
|
|
71
167
|
*
|
|
@@ -74,4 +170,4 @@ import 'react/jsx-runtime';
|
|
|
74
170
|
|
|
75
171
|
declare const version = "0.0.1";
|
|
76
172
|
|
|
77
|
-
export { version };
|
|
173
|
+
export { type UseChartInteractionOptions, type UseChartInteractionReturn, useChartInteraction, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartLegendPosition, ChartLegendItem } from '@expcat/tigercat-core';
|
|
1
2
|
export * from '@expcat/tigercat-core';
|
|
2
3
|
export { ConfigProvider, useTigerConfig } from './components/ConfigProvider.js';
|
|
3
4
|
export { Button, ButtonProps } from './components/Button.js';
|
|
@@ -63,9 +64,104 @@ export { Loading, LoadingProps } from './components/Loading.js';
|
|
|
63
64
|
export { Popconfirm, PopconfirmProps } from './components/Popconfirm.js';
|
|
64
65
|
export { Popover, PopoverProps } from './components/Popover.js';
|
|
65
66
|
export { Tooltip, TooltipProps } from './components/Tooltip.js';
|
|
67
|
+
export { default as ChartCanvas, ChartCanvasProps } from './components/ChartCanvas.js';
|
|
68
|
+
export { default as ChartAxis, ChartAxisProps } from './components/ChartAxis.js';
|
|
69
|
+
export { default as ChartGrid, ChartGridProps } from './components/ChartGrid.js';
|
|
70
|
+
export { default as ChartSeries, ChartSeriesProps } from './components/ChartSeries.js';
|
|
71
|
+
export { default as BarChart, BarChartProps } from './components/BarChart.js';
|
|
72
|
+
export { default as ScatterChart, ScatterChartProps } from './components/ScatterChart.js';
|
|
73
|
+
export { default as PieChart, PieChartProps } from './components/PieChart.js';
|
|
74
|
+
export { default as DonutChart, DonutChartProps } from './components/DonutChart.js';
|
|
75
|
+
export { default as RadarChart, RadarChartProps } from './components/RadarChart.js';
|
|
76
|
+
export { default as LineChart, LineChartProps } from './components/LineChart.js';
|
|
77
|
+
export { default as AreaChart, AreaChartProps } from './components/AreaChart.js';
|
|
78
|
+
export { default as ChartLegend, ChartLegendProps } from './components/ChartLegend.js';
|
|
79
|
+
export { default as ChartTooltip, ChartTooltipProps } from './components/ChartTooltip.js';
|
|
66
80
|
import 'react';
|
|
67
81
|
import 'react/jsx-runtime';
|
|
68
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Options for useChartInteraction hook
|
|
85
|
+
*/
|
|
86
|
+
interface UseChartInteractionOptions<T = unknown> {
|
|
87
|
+
/** Enable hover highlight */
|
|
88
|
+
hoverable: boolean;
|
|
89
|
+
/** Controlled hovered index from props */
|
|
90
|
+
hoveredIndexProp?: number | null;
|
|
91
|
+
/** Enable click selection */
|
|
92
|
+
selectable: boolean;
|
|
93
|
+
/** Controlled selected index from props */
|
|
94
|
+
selectedIndexProp?: number | null;
|
|
95
|
+
/** Opacity for active element */
|
|
96
|
+
activeOpacity: number;
|
|
97
|
+
/** Opacity for inactive elements */
|
|
98
|
+
inactiveOpacity: number;
|
|
99
|
+
/** Legend position for wrapper classes */
|
|
100
|
+
legendPosition?: ChartLegendPosition;
|
|
101
|
+
/** Callback when hover changes */
|
|
102
|
+
onHoveredIndexChange?: (index: number | null) => void;
|
|
103
|
+
/** Callback when selection changes */
|
|
104
|
+
onSelectedIndexChange?: (index: number | null) => void;
|
|
105
|
+
/** Get data item by index */
|
|
106
|
+
getData?: (index: number) => T | undefined;
|
|
107
|
+
/** Custom callbacks */
|
|
108
|
+
callbacks?: {
|
|
109
|
+
onHover?: (index: number | null, datum: T | null) => void;
|
|
110
|
+
onClick?: (index: number, datum: T) => void;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Return type for useChartInteraction
|
|
115
|
+
*/
|
|
116
|
+
interface UseChartInteractionReturn {
|
|
117
|
+
/** Local hovered index state */
|
|
118
|
+
localHoveredIndex: number | null;
|
|
119
|
+
/** Local selected index state */
|
|
120
|
+
localSelectedIndex: number | null;
|
|
121
|
+
/** Tooltip position state */
|
|
122
|
+
tooltipPosition: {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
};
|
|
126
|
+
/** Resolved hovered index (controlled or uncontrolled) */
|
|
127
|
+
resolvedHoveredIndex: number | null;
|
|
128
|
+
/** Resolved selected index (controlled or uncontrolled) */
|
|
129
|
+
resolvedSelectedIndex: number | null;
|
|
130
|
+
/** Current active index for highlighting */
|
|
131
|
+
activeIndex: number | null;
|
|
132
|
+
/** Get element opacity based on active state */
|
|
133
|
+
getElementOpacity: (index: number) => number | undefined;
|
|
134
|
+
/** Handle mouse enter on chart element */
|
|
135
|
+
handleMouseEnter: (index: number, event: React.MouseEvent) => void;
|
|
136
|
+
/** Handle mouse move for tooltip */
|
|
137
|
+
handleMouseMove: (event: React.MouseEvent) => void;
|
|
138
|
+
/** Handle mouse leave */
|
|
139
|
+
handleMouseLeave: () => void;
|
|
140
|
+
/** Handle click on chart element */
|
|
141
|
+
handleClick: (index: number) => void;
|
|
142
|
+
/** Handle keydown for accessibility */
|
|
143
|
+
handleKeyDown: (event: React.KeyboardEvent, index: number) => void;
|
|
144
|
+
/** Handle legend item click */
|
|
145
|
+
handleLegendClick: (index: number) => void;
|
|
146
|
+
/** Handle legend item hover */
|
|
147
|
+
handleLegendHover: (index: number) => void;
|
|
148
|
+
/** Handle legend item leave */
|
|
149
|
+
handleLegendLeave: () => void;
|
|
150
|
+
/** Wrapper classes for legend layout */
|
|
151
|
+
wrapperClasses: string;
|
|
152
|
+
/** Create legend items from data */
|
|
153
|
+
createLegendItems: (items: Array<{
|
|
154
|
+
label?: string;
|
|
155
|
+
color?: string;
|
|
156
|
+
x?: unknown;
|
|
157
|
+
}>, palette: string[], labelFormatter?: (item: unknown, index: number) => string) => ChartLegendItem[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Hook for chart interaction state and handlers
|
|
161
|
+
* Extracts common interaction logic from high-level chart components
|
|
162
|
+
*/
|
|
163
|
+
declare function useChartInteraction<T = unknown>(options: UseChartInteractionOptions<T>): UseChartInteractionReturn;
|
|
164
|
+
|
|
69
165
|
/**
|
|
70
166
|
* Tigercat React
|
|
71
167
|
*
|
|
@@ -74,4 +170,4 @@ import 'react/jsx-runtime';
|
|
|
74
170
|
|
|
75
171
|
declare const version = "0.0.1";
|
|
76
172
|
|
|
77
|
-
export { version };
|
|
173
|
+
export { type UseChartInteractionOptions, type UseChartInteractionReturn, useChartInteraction, version };
|