h2o-library 1.7.1 → 1.8.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.
@@ -22,5 +22,6 @@ export interface BarChartProps {
22
22
  wrapLabels?: boolean;
23
23
  onXAxisTickClick?: (value: string | number) => void;
24
24
  onYAxisTickClick?: (value: string | number) => void;
25
+ onBarClick?: (dataPoint: BarChartDataPoint, index: number, dataKey: string) => void;
25
26
  }
26
- export declare const BarChart: ({ data, bars, layout, orientation, showGrid, showLegend, height, rotateLabels, wrapLabels, onXAxisTickClick, onYAxisTickClick, }: BarChartProps) => React.JSX.Element;
27
+ export declare const BarChart: ({ data, bars, layout, orientation, showGrid, showLegend, height, rotateLabels, wrapLabels, onXAxisTickClick, onYAxisTickClick, onBarClick, }: BarChartProps) => React.JSX.Element;
@@ -16,5 +16,6 @@ export interface HeatmapChartProps {
16
16
  showPercentageInTooltip?: boolean;
17
17
  onRowClick?: (row: string) => void;
18
18
  onColumnClick?: (column: string) => void;
19
+ onCellClick?: (row: string, column: string, cellData: HeatmapDataPoint) => void;
19
20
  }
20
- export declare const HeatmapChart: ({ data, showPercentage, height, showValue, showPercentageInTooltip, onRowClick, onColumnClick, }: HeatmapChartProps) => React.JSX.Element;
21
+ export declare const HeatmapChart: ({ data, showPercentage, height, showValue, showPercentageInTooltip, onRowClick, onColumnClick, onCellClick, }: HeatmapChartProps) => React.JSX.Element;
@@ -21,5 +21,6 @@ export interface LineChartProps {
21
21
  showXValue?: boolean;
22
22
  onXAxisTickClick?: (value: string | number) => void;
23
23
  onYAxisTickClick?: (value: string | number) => void;
24
+ onDataPointClick?: (point: LineChartDataPoint, index: number, dataKey: string) => void;
24
25
  }
25
- export declare const LineChart: ({ data, lines, showGrid, showLegend, showGradient, height, showXValue, onXAxisTickClick, onYAxisTickClick, }: LineChartProps) => React.JSX.Element;
26
+ export declare const LineChart: ({ data, lines, showGrid, showLegend, showGradient, height, showXValue, onXAxisTickClick, onYAxisTickClick, onDataPointClick, }: LineChartProps) => React.JSX.Element;
@@ -12,5 +12,6 @@ export interface PieChartProps {
12
12
  height?: number;
13
13
  showLabels?: boolean;
14
14
  showPercentageInTooltip?: boolean;
15
+ onSliceClick?: (dataPoint: PieChartDataPoint, index: number) => void;
15
16
  }
16
- export declare const PieChart: ({ data, variant, showLegend, height, showLabels, showPercentageInTooltip, }: PieChartProps) => React.JSX.Element;
17
+ export declare const PieChart: ({ data, variant, showLegend, height, showLabels, showPercentageInTooltip, onSliceClick, }: PieChartProps) => React.JSX.Element;
@@ -35,5 +35,6 @@ export interface ExpandableTableProps<T extends Record<string, any> & Expandable
35
35
  selectedRows?: T[];
36
36
  setSelectedRows?: (rows: T[]) => void;
37
37
  rowKey?: keyof T;
38
+ onRowClick?: (row: T, rowIndex: number) => void;
38
39
  }
39
- export declare function ExpandableTable<T extends Record<string, any> & ExpandableRow>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, maxHeight, containerClassName, selectedRows, setSelectedRows, rowKey, }: ExpandableTableProps<T>): React.JSX.Element;
40
+ export declare function ExpandableTable<T extends Record<string, any> & ExpandableRow>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, maxHeight, containerClassName, selectedRows, setSelectedRows, rowKey, onRowClick, }: ExpandableTableProps<T>): React.JSX.Element;
@@ -3,7 +3,8 @@ import { IconType, TooltipPosition } from "../../types";
3
3
  export interface IconProps extends React.SVGProps<SVGSVGElement> {
4
4
  icon: IconType;
5
5
  size?: number;
6
- tooltip?: string;
6
+ tooltip?: string | React.ReactNode;
7
7
  tooltipPosition?: TooltipPosition;
8
+ tooltipVariant?: "dark" | "light";
8
9
  }
9
- export declare const Icon: ({ icon, size, tooltip, tooltipPosition, ...props }: IconProps) => JSX.Element;
10
+ export declare const Icon: ({ icon, size, tooltip, tooltipPosition, tooltipVariant, ...props }: IconProps) => JSX.Element;
@@ -3,7 +3,9 @@ import { TooltipPosition } from "../../types";
3
3
  type BaseProps = {
4
4
  position?: TooltipPosition;
5
5
  className?: string;
6
+ contentClassName?: string;
6
7
  children: React.ReactNode;
8
+ variant?: "dark" | "light";
7
9
  };
8
10
  type TextTooltip = BaseProps & {
9
11
  text: string;
@@ -15,6 +15,19 @@
15
15
  text-align: center;
16
16
  }
17
17
 
18
+ /* Pointer cursor on slices when clickable */
19
+ .pie-chart-clickable path,
20
+ .pie-chart-clickable .recharts-pie-sector {
21
+ cursor: pointer;
22
+ }
23
+
24
+ /* Remove focus outline on pie slices after click */
25
+ .pie-chart-container path:focus,
26
+ .pie-chart-container .recharts-pie-sector:focus,
27
+ .pie-chart-container .recharts-layer path:focus {
28
+ outline: none;
29
+ }
30
+
18
31
  .stat-chart-container {
19
32
  font-family: sans-serif;
20
33
  text-align: center;
@@ -31,12 +31,26 @@
31
31
  color: hsl(var(--primary));
32
32
  }
33
33
 
34
- .expandable-table tr.expanded-row {
35
- border: 1px solid hsl(var(--primary));
34
+ /* Row immediately before an expanded row: bottom border primary (forms top edge of expanded block) */
35
+ .expandable-table tbody tr:has(+ tr.expanded-row) td {
36
+ border-bottom-color: hsl(var(--primary));
36
37
  }
37
38
 
38
- .expandable-table .expandable-row {
39
- border: 1px solid hsl(var(--primary));
39
+ /* Expanded main row: no vertical borders between cells; only outer left/right and top/bottom */
40
+ .expandable-table tr.expanded-row td {
41
+ border-bottom: 1px solid hsl(var(--primary));
42
+ border-left: none;
43
+ border-right: none;
44
+ }
45
+ .expandable-table tr.expanded-row td:first-child {
46
+ border-left: 1px solid hsl(var(--primary));
47
+ }
48
+ .expandable-table tr.expanded-row td:last-child {
49
+ border-right: 1px solid hsl(var(--primary));
50
+ }
51
+ /* Top border primary (below header when first row, or below previous row) */
52
+ .expandable-table tbody tr.expanded-row td {
53
+ border-top: 1px solid hsl(var(--primary));
40
54
  }
41
55
 
42
56
  .expandable-table tr.expanded-row .expand-button {
@@ -47,16 +61,21 @@
47
61
  padding: 1rem;
48
62
  }
49
63
 
64
+ /* Expandable content row: primary border on all sides (divider above + bottom/left/right) */
65
+ .expandable-table .expandable-row td {
66
+ padding: 0;
67
+ border: 1px solid hsl(var(--primary));
68
+ }
69
+ /* When expandable content row is last in table, keep bottom border (table.css removes it otherwise) */
70
+ .expandable-table tbody tr.expandable-row:last-child td {
71
+ border-bottom: 1px solid hsl(var(--primary));
72
+ }
73
+
50
74
  /* Animation for expanding/collapsing rows */
51
75
  .expandable-table .expandable-row {
52
76
  transition: all 0.3s ease-in-out;
53
77
  }
54
78
 
55
- .expandable-table .expandable-row td {
56
- padding: 0;
57
- border-bottom: none;
58
- }
59
-
60
79
  .expandable-table .expandable-content {
61
80
  animation: slideDown 0.3s ease-in-out;
62
81
  }
@@ -5,8 +5,6 @@
5
5
 
6
6
  .tooltip-box {
7
7
  position: fixed;
8
- background-color: #1f2937;
9
- color: #ffffff;
10
8
  padding: 0.5rem 0.75rem;
11
9
  border-radius: 6px;
12
10
  font-size: 0.8125rem;
@@ -19,6 +17,19 @@
19
17
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
20
18
  }
21
19
 
20
+ /* Dark variant (default) */
21
+ .tooltip-box--dark {
22
+ background-color: #1f2937;
23
+ color: #ffffff;
24
+ }
25
+
26
+ /* Light variant */
27
+ .tooltip-box--light {
28
+ background-color: #ffffff;
29
+ color: #1f2937;
30
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
31
+ }
32
+
22
33
  /* Arrow */
23
34
  .tooltip-box::after {
24
35
  content: "";
@@ -36,33 +47,53 @@
36
47
  }
37
48
 
38
49
  /* Position: Top - Arrow at bottom */
50
+ .tooltip-box--dark[data-position="top"]::after {
51
+ border-top-color: #1f2937;
52
+ }
53
+ .tooltip-box--light[data-position="top"]::after {
54
+ border-top-color: #ffffff;
55
+ }
39
56
  .tooltip-box[data-position="top"]::after {
40
57
  top: 100%;
41
58
  left: 50%;
42
59
  transform: translateX(-50%);
43
- border-top-color: #1f2937;
44
60
  }
45
61
 
46
62
  /* Position: Bottom - Arrow at top */
63
+ .tooltip-box--dark[data-position="bottom"]::after {
64
+ border-bottom-color: #1f2937;
65
+ }
66
+ .tooltip-box--light[data-position="bottom"]::after {
67
+ border-bottom-color: #ffffff;
68
+ }
47
69
  .tooltip-box[data-position="bottom"]::after {
48
70
  bottom: 100%;
49
71
  left: 50%;
50
72
  transform: translateX(-50%);
51
- border-bottom-color: #1f2937;
52
73
  }
53
74
 
54
75
  /* Position: Left - Arrow at right */
76
+ .tooltip-box--dark[data-position="left"]::after {
77
+ border-left-color: #1f2937;
78
+ }
79
+ .tooltip-box--light[data-position="left"]::after {
80
+ border-left-color: #ffffff;
81
+ }
55
82
  .tooltip-box[data-position="left"]::after {
56
83
  left: 100%;
57
84
  top: 50%;
58
85
  transform: translateY(-50%);
59
- border-left-color: #1f2937;
60
86
  }
61
87
 
62
88
  /* Position: Right - Arrow at left */
89
+ .tooltip-box--dark[data-position="right"]::after {
90
+ border-right-color: #1f2937;
91
+ }
92
+ .tooltip-box--light[data-position="right"]::after {
93
+ border-right-color: #ffffff;
94
+ }
63
95
  .tooltip-box[data-position="right"]::after {
64
96
  right: 100%;
65
97
  top: 50%;
66
98
  transform: translateY(-50%);
67
- border-right-color: #1f2937;
68
99
  }
@@ -22,5 +22,6 @@ export interface BarChartProps {
22
22
  wrapLabels?: boolean;
23
23
  onXAxisTickClick?: (value: string | number) => void;
24
24
  onYAxisTickClick?: (value: string | number) => void;
25
+ onBarClick?: (dataPoint: BarChartDataPoint, index: number, dataKey: string) => void;
25
26
  }
26
- export declare const BarChart: ({ data, bars, layout, orientation, showGrid, showLegend, height, rotateLabels, wrapLabels, onXAxisTickClick, onYAxisTickClick, }: BarChartProps) => React.JSX.Element;
27
+ export declare const BarChart: ({ data, bars, layout, orientation, showGrid, showLegend, height, rotateLabels, wrapLabels, onXAxisTickClick, onYAxisTickClick, onBarClick, }: BarChartProps) => React.JSX.Element;
@@ -16,5 +16,6 @@ export interface HeatmapChartProps {
16
16
  showPercentageInTooltip?: boolean;
17
17
  onRowClick?: (row: string) => void;
18
18
  onColumnClick?: (column: string) => void;
19
+ onCellClick?: (row: string, column: string, cellData: HeatmapDataPoint) => void;
19
20
  }
20
- export declare const HeatmapChart: ({ data, showPercentage, height, showValue, showPercentageInTooltip, onRowClick, onColumnClick, }: HeatmapChartProps) => React.JSX.Element;
21
+ export declare const HeatmapChart: ({ data, showPercentage, height, showValue, showPercentageInTooltip, onRowClick, onColumnClick, onCellClick, }: HeatmapChartProps) => React.JSX.Element;
@@ -21,5 +21,6 @@ export interface LineChartProps {
21
21
  showXValue?: boolean;
22
22
  onXAxisTickClick?: (value: string | number) => void;
23
23
  onYAxisTickClick?: (value: string | number) => void;
24
+ onDataPointClick?: (point: LineChartDataPoint, index: number, dataKey: string) => void;
24
25
  }
25
- export declare const LineChart: ({ data, lines, showGrid, showLegend, showGradient, height, showXValue, onXAxisTickClick, onYAxisTickClick, }: LineChartProps) => React.JSX.Element;
26
+ export declare const LineChart: ({ data, lines, showGrid, showLegend, showGradient, height, showXValue, onXAxisTickClick, onYAxisTickClick, onDataPointClick, }: LineChartProps) => React.JSX.Element;
@@ -12,5 +12,6 @@ export interface PieChartProps {
12
12
  height?: number;
13
13
  showLabels?: boolean;
14
14
  showPercentageInTooltip?: boolean;
15
+ onSliceClick?: (dataPoint: PieChartDataPoint, index: number) => void;
15
16
  }
16
- export declare const PieChart: ({ data, variant, showLegend, height, showLabels, showPercentageInTooltip, }: PieChartProps) => React.JSX.Element;
17
+ export declare const PieChart: ({ data, variant, showLegend, height, showLabels, showPercentageInTooltip, onSliceClick, }: PieChartProps) => React.JSX.Element;
@@ -35,5 +35,6 @@ export interface ExpandableTableProps<T extends Record<string, any> & Expandable
35
35
  selectedRows?: T[];
36
36
  setSelectedRows?: (rows: T[]) => void;
37
37
  rowKey?: keyof T;
38
+ onRowClick?: (row: T, rowIndex: number) => void;
38
39
  }
39
- export declare function ExpandableTable<T extends Record<string, any> & ExpandableRow>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, maxHeight, containerClassName, selectedRows, setSelectedRows, rowKey, }: ExpandableTableProps<T>): React.JSX.Element;
40
+ export declare function ExpandableTable<T extends Record<string, any> & ExpandableRow>({ columns, data, isLoading, className, rowHeight, sortKey, sortDirection, onSort, currentPage, totalPages, perPage, perPageOptions, onPageChange, onPerPageChange, maxHeight, containerClassName, selectedRows, setSelectedRows, rowKey, onRowClick, }: ExpandableTableProps<T>): React.JSX.Element;
@@ -3,7 +3,8 @@ import { IconType, TooltipPosition } from "../../types";
3
3
  export interface IconProps extends React.SVGProps<SVGSVGElement> {
4
4
  icon: IconType;
5
5
  size?: number;
6
- tooltip?: string;
6
+ tooltip?: string | React.ReactNode;
7
7
  tooltipPosition?: TooltipPosition;
8
+ tooltipVariant?: "dark" | "light";
8
9
  }
9
- export declare const Icon: ({ icon, size, tooltip, tooltipPosition, ...props }: IconProps) => JSX.Element;
10
+ export declare const Icon: ({ icon, size, tooltip, tooltipPosition, tooltipVariant, ...props }: IconProps) => JSX.Element;
@@ -3,7 +3,9 @@ import { TooltipPosition } from "../../types";
3
3
  type BaseProps = {
4
4
  position?: TooltipPosition;
5
5
  className?: string;
6
+ contentClassName?: string;
6
7
  children: React.ReactNode;
8
+ variant?: "dark" | "light";
7
9
  };
8
10
  type TextTooltip = BaseProps & {
9
11
  text: string;