h2o-library 1.5.9 → 1.6.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.
@@ -36,3 +36,4 @@ export * from "./src/chart-stat";
36
36
  export * from "./src/date-range-picker";
37
37
  export * from "./src/legend";
38
38
  export * from "./src/chart";
39
+ export * from "./src/expandable-table";
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { SortDirection } from "./table";
3
+ export interface ExpandableTableColumn<T> {
4
+ key: string;
5
+ label: string;
6
+ sortable?: boolean;
7
+ minWidth?: string;
8
+ maxWidth?: string;
9
+ width?: string;
10
+ render?: (value: any, row: T) => React.ReactNode;
11
+ }
12
+ export interface ExpandableRow {
13
+ expandableContent?: React.ReactNode;
14
+ }
15
+ export interface ExpandableTableProps<T extends Record<string, any> & ExpandableRow> {
16
+ columns: ExpandableTableColumn<T>[];
17
+ data: T[];
18
+ isLoading?: boolean;
19
+ className?: string;
20
+ containerClassName?: string;
21
+ rowHeight?: string;
22
+ sortKey?: string;
23
+ sortDirection?: SortDirection;
24
+ currentPage?: number;
25
+ totalPages?: number;
26
+ perPage?: number;
27
+ perPageOptions?: {
28
+ label: string;
29
+ value: string;
30
+ }[];
31
+ onSort?: (key: string, direction: SortDirection) => void;
32
+ onPageChange?: (page: number) => void;
33
+ onPerPageChange?: (perPage: string) => void;
34
+ maxHeight?: string;
35
+ selectedRows?: T[];
36
+ setSelectedRows?: (rows: T[]) => void;
37
+ rowKey?: keyof T;
38
+ }
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;
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/date-range-picker.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/compact-multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";@import "./src/multi-menu.css";@import "./src/charts.css";@import "./src/chart.css";@import "./src/legend.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/date-range-picker.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/compact-multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";@import "./src/multi-menu.css";@import "./src/charts.css";@import "./src/chart.css";@import "./src/legend.css";@import "./src/expandable-table.css";
@@ -65,7 +65,7 @@
65
65
  .heatmap-col-tooltip {
66
66
  width: 100%;
67
67
  min-width: 0;
68
- display: flex;
68
+ display: block;
69
69
  }
70
70
 
71
71
  .heatmap-col-header {
@@ -75,19 +75,24 @@
75
75
  overflow: hidden;
76
76
  text-overflow: ellipsis;
77
77
  white-space: nowrap;
78
+ max-width: 100%;
79
+ display: block;
80
+ }
81
+
82
+ .heatmap-row-tooltip {
78
83
  width: 100%;
79
- flex: 1;
80
84
  min-width: 0;
85
+ display: block;
81
86
  }
82
87
 
83
88
  .heatmap-row-header {
84
89
  padding: 0.5rem;
85
90
  font-weight: 500;
86
- display: flex;
87
- align-items: center;
88
91
  overflow: hidden;
89
92
  text-overflow: ellipsis;
90
93
  white-space: nowrap;
94
+ max-width: 100%;
95
+ display: block;
91
96
  }
92
97
 
93
98
  .heatmap-cell {
@@ -0,0 +1,73 @@
1
+ .expandable-table .expand-column {
2
+ width: 48px;
3
+ padding: 0 !important;
4
+ text-align: center;
5
+ }
6
+
7
+ .expandable-table .expand-button {
8
+ background: none;
9
+ border: none;
10
+ padding: 8px;
11
+ cursor: pointer;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ color: hsl(var(--muted));
16
+ transition: all 0.2s ease-in-out;
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+
21
+ .expandable-table .expand-button:hover {
22
+ color: hsl(var(--primary));
23
+ }
24
+
25
+ .expandable-table .expand-button svg {
26
+ transition: transform 0.2s ease-in-out;
27
+ }
28
+
29
+ .expandable-table .expand-button svg.expanded {
30
+ transform: rotate(90deg);
31
+ color: hsl(var(--primary));
32
+ }
33
+
34
+ .expandable-table tr.expanded-row {
35
+ border: 1px solid hsl(var(--primary));
36
+ }
37
+
38
+ .expandable-table .expandable-row {
39
+ border: 1px solid hsl(var(--primary));
40
+ }
41
+
42
+ .expandable-table tr.expanded-row .expand-button {
43
+ color: hsl(var(--primary));
44
+ }
45
+
46
+ .expandable-table .expandable-content {
47
+ padding: 1rem;
48
+ }
49
+
50
+ /* Animation for expanding/collapsing rows */
51
+ .expandable-table .expandable-row {
52
+ transition: all 0.3s ease-in-out;
53
+ }
54
+
55
+ .expandable-table .expandable-row td {
56
+ padding: 0;
57
+ border-bottom: none;
58
+ }
59
+
60
+ .expandable-table .expandable-content {
61
+ animation: slideDown 0.3s ease-in-out;
62
+ }
63
+
64
+ @keyframes slideDown {
65
+ from {
66
+ opacity: 0;
67
+ transform: translateY(-10px);
68
+ }
69
+ to {
70
+ opacity: 1;
71
+ transform: translateY(0);
72
+ }
73
+ }
@@ -63,3 +63,4 @@
63
63
  @import "./src/charts.css";
64
64
  @import "./src/chart.css";
65
65
  @import "./src/legend.css";
66
+ @import "./src/expandable-table.css";
@@ -36,3 +36,4 @@ export * from "./src/chart-stat";
36
36
  export * from "./src/date-range-picker";
37
37
  export * from "./src/legend";
38
38
  export * from "./src/chart";
39
+ export * from "./src/expandable-table";
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { SortDirection } from "./table";
3
+ export interface ExpandableTableColumn<T> {
4
+ key: string;
5
+ label: string;
6
+ sortable?: boolean;
7
+ minWidth?: string;
8
+ maxWidth?: string;
9
+ width?: string;
10
+ render?: (value: any, row: T) => React.ReactNode;
11
+ }
12
+ export interface ExpandableRow {
13
+ expandableContent?: React.ReactNode;
14
+ }
15
+ export interface ExpandableTableProps<T extends Record<string, any> & ExpandableRow> {
16
+ columns: ExpandableTableColumn<T>[];
17
+ data: T[];
18
+ isLoading?: boolean;
19
+ className?: string;
20
+ containerClassName?: string;
21
+ rowHeight?: string;
22
+ sortKey?: string;
23
+ sortDirection?: SortDirection;
24
+ currentPage?: number;
25
+ totalPages?: number;
26
+ perPage?: number;
27
+ perPageOptions?: {
28
+ label: string;
29
+ value: string;
30
+ }[];
31
+ onSort?: (key: string, direction: SortDirection) => void;
32
+ onPageChange?: (page: number) => void;
33
+ onPerPageChange?: (perPage: string) => void;
34
+ maxHeight?: string;
35
+ selectedRows?: T[];
36
+ setSelectedRows?: (rows: T[]) => void;
37
+ rowKey?: keyof T;
38
+ }
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;
@@ -1 +1 @@
1
- :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/date-range-picker.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/compact-multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";@import "./src/multi-menu.css";@import "./src/charts.css";@import "./src/chart.css";@import "./src/legend.css";
1
+ :root{--primary-disabled:225 100% 88%;--primary-muted:221 100% 95%;--primary:225 91% 59%;--primary-200:225 100% 43%;--primary-300:225 91% 40%;--primary-400:225 91% 18%;--success-bg:143 26% 86%;--success:130 35% 46%;--success-200:130 76% 26%;--success-300:130 100% 18%;--warning-bg:45 100% 84%;--warning:45 100% 61%;--warning-200:45 100% 45%;--warning-300:45 100% 32%;--destructive-bg:357 100% 92%;--destructive:0 83% 60%;--destructive-200:0 100% 42%;--destructive-300:0 100% 29%;--muted-25:0 0 98%;--muted-50:0 0 96%;--muted:0 0 80%;--muted-200:0 0 67%;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--radius-full:9999px}@import "./src/accordion.css";@import "./src/button.css";@import "./src/calendar.css";@import "./src/checkbox.css";@import "./src/content-switch.css";@import "./src/date-range-picker.css";@import "./src/dropdown.css";@import "./src/input.css";@import "./src/modal.css";@import "./src/multi-select.css";@import "./src/compact-multi-select.css";@import "./src/popover.css";@import "./src/radio.css";@import "./src/search.css";@import "./src/side-panel.css";@import "./src/status.css";@import "./src/tabs.css";@import "./src/tag.css";@import "./src/textarea.css";@import "./src/toggle.css";@import "./src/tooltip.css";@import "./src/pagination.css";@import "./src/table.css";@import "./src/toast.css";@import "./src/month-calendar.css";@import "./src/loader.css";@import "./src/message.css";@import "./src/multi-menu.css";@import "./src/charts.css";@import "./src/chart.css";@import "./src/legend.css";@import "./src/expandable-table.css";