h2o-library 1.5.1 → 1.5.2
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/components/index.d.ts +1 -0
- package/dist/components/src/chart.d.ts +29 -0
- package/dist/components/src/table.d.ts +2 -2
- package/dist/css/index.css +1 -1
- package/dist/css/src/chart.css +76 -0
- package/dist/css/src/index.css +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/src/chart.d.ts +29 -0
- package/dist/esm/components/src/table.d.ts +2 -2
- package/dist/esm/css/index.css +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarChartDataPoint } from "./chart-bar";
|
|
3
|
+
import { LineChartDataPoint } from "./chart-line";
|
|
4
|
+
import { PieChartDataPoint } from "./chart-pie";
|
|
5
|
+
import { HeatmapData } from "./chart-heatmap";
|
|
6
|
+
export type ChartKPI = {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
};
|
|
10
|
+
type BaseChartData = {
|
|
11
|
+
bar: BarChartDataPoint[];
|
|
12
|
+
line: LineChartDataPoint[];
|
|
13
|
+
pie: PieChartDataPoint[];
|
|
14
|
+
heatmap: HeatmapData;
|
|
15
|
+
};
|
|
16
|
+
export type ChartType = keyof BaseChartData;
|
|
17
|
+
interface BaseChartProps {
|
|
18
|
+
type: ChartType;
|
|
19
|
+
title?: string;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
kpis?: ChartKPI[];
|
|
23
|
+
height?: number;
|
|
24
|
+
}
|
|
25
|
+
type ChartProps<T extends ChartType> = BaseChartProps & {
|
|
26
|
+
data: BaseChartData[T];
|
|
27
|
+
};
|
|
28
|
+
export declare const Chart: <T extends keyof BaseChartData>({ type, title, tooltip, description, kpis, data, height, }: ChartProps<T>) => React.JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -19,7 +19,6 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
19
19
|
sortKey?: string;
|
|
20
20
|
sortDirection?: SortDirection;
|
|
21
21
|
columnsEditable?: boolean;
|
|
22
|
-
onSort?: (key: string, direction: SortDirection) => void;
|
|
23
22
|
currentPage?: number;
|
|
24
23
|
totalPages?: number;
|
|
25
24
|
perPage?: number;
|
|
@@ -27,11 +26,12 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
27
26
|
label: string;
|
|
28
27
|
value: string;
|
|
29
28
|
}[];
|
|
29
|
+
onSort?: (key: string, direction: SortDirection) => void;
|
|
30
30
|
onPageChange?: (page: number) => void;
|
|
31
31
|
onPerPageChange?: (perPage: string) => void;
|
|
32
|
+
onVisibleColumnsChange?: (keys: string[]) => void;
|
|
32
33
|
maxHeight?: string;
|
|
33
34
|
visibleColumns?: string[];
|
|
34
|
-
onVisibleColumnsChange?: (keys: string[]) => void;
|
|
35
35
|
maxVisibleColumns?: number;
|
|
36
36
|
defaultVisibleColumns?: string[];
|
|
37
37
|
pinnedColumns?: string[];
|
package/dist/css/index.css
CHANGED
|
@@ -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/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";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.chart-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 1.5rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.chart-header {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 1.5rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.chart-title-container {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.5rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.chart-title {
|
|
21
|
+
margin: 0;
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
/* color: hsl(var(--muted-200)); */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.chart-info-icon {
|
|
28
|
+
color: hsl(var(--muted));
|
|
29
|
+
cursor: help;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.chart-metadata {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: 1rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.chart-kpis {
|
|
39
|
+
display: flex;
|
|
40
|
+
gap: 2rem;
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
padding-bottom: 0.5rem;
|
|
43
|
+
border-bottom: 1px solid hsl(var(--muted-50));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.chart-kpi {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 0.25rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.chart-kpi-label {
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
color: hsl(var(--muted-200));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.chart-kpi-value {
|
|
58
|
+
font-size: 1.5rem;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
/* color: hsl(var(--muted-200)); */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.chart-legend {
|
|
64
|
+
padding-top: 0.5rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.chart-header-content {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: 0.25rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.chart-description {
|
|
74
|
+
font-size: 1rem;
|
|
75
|
+
color: hsl(var(--muted-200));
|
|
76
|
+
}
|
package/dist/css/src/index.css
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarChartDataPoint } from "./chart-bar";
|
|
3
|
+
import { LineChartDataPoint } from "./chart-line";
|
|
4
|
+
import { PieChartDataPoint } from "./chart-pie";
|
|
5
|
+
import { HeatmapData } from "./chart-heatmap";
|
|
6
|
+
export type ChartKPI = {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
};
|
|
10
|
+
type BaseChartData = {
|
|
11
|
+
bar: BarChartDataPoint[];
|
|
12
|
+
line: LineChartDataPoint[];
|
|
13
|
+
pie: PieChartDataPoint[];
|
|
14
|
+
heatmap: HeatmapData;
|
|
15
|
+
};
|
|
16
|
+
export type ChartType = keyof BaseChartData;
|
|
17
|
+
interface BaseChartProps {
|
|
18
|
+
type: ChartType;
|
|
19
|
+
title?: string;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
kpis?: ChartKPI[];
|
|
23
|
+
height?: number;
|
|
24
|
+
}
|
|
25
|
+
type ChartProps<T extends ChartType> = BaseChartProps & {
|
|
26
|
+
data: BaseChartData[T];
|
|
27
|
+
};
|
|
28
|
+
export declare const Chart: <T extends keyof BaseChartData>({ type, title, tooltip, description, kpis, data, height, }: ChartProps<T>) => React.JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -19,7 +19,6 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
19
19
|
sortKey?: string;
|
|
20
20
|
sortDirection?: SortDirection;
|
|
21
21
|
columnsEditable?: boolean;
|
|
22
|
-
onSort?: (key: string, direction: SortDirection) => void;
|
|
23
22
|
currentPage?: number;
|
|
24
23
|
totalPages?: number;
|
|
25
24
|
perPage?: number;
|
|
@@ -27,11 +26,12 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
27
26
|
label: string;
|
|
28
27
|
value: string;
|
|
29
28
|
}[];
|
|
29
|
+
onSort?: (key: string, direction: SortDirection) => void;
|
|
30
30
|
onPageChange?: (page: number) => void;
|
|
31
31
|
onPerPageChange?: (perPage: string) => void;
|
|
32
|
+
onVisibleColumnsChange?: (keys: string[]) => void;
|
|
32
33
|
maxHeight?: string;
|
|
33
34
|
visibleColumns?: string[];
|
|
34
|
-
onVisibleColumnsChange?: (keys: string[]) => void;
|
|
35
35
|
maxVisibleColumns?: number;
|
|
36
36
|
defaultVisibleColumns?: string[];
|
|
37
37
|
pinnedColumns?: string[];
|
package/dist/esm/css/index.css
CHANGED
|
@@ -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/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";
|