@apipass/design-system 1.21.0 → 1.23.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/lib/embedded-styles.js +1 -1
- package/dist/lib/lib.index.cjs +1 -1
- package/dist/lib/lib.index.js +195 -191
- package/dist/lib/lib.index.js.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/Widget/Widget.cjs +1 -1
- package/dist/lib/ui/components/Widget/Widget.cjs.map +1 -1
- package/dist/lib/ui/components/Widget/Widget.js +73 -27
- package/dist/lib/ui/components/Widget/Widget.js.map +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs +2 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs.map +1 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js +61 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js.map +1 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs +2 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs.map +1 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js +93 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js.map +1 -0
- package/dist/lib/ui/components/charts/chart-palette.cjs +2 -0
- package/dist/lib/ui/components/charts/chart-palette.cjs.map +1 -0
- package/dist/lib/ui/components/charts/chart-palette.js +16 -0
- package/dist/lib/ui/components/charts/chart-palette.js.map +1 -0
- package/dist/lib/ui/components/charts/chart-theme.cjs +2 -0
- package/dist/lib/ui/components/charts/chart-theme.cjs.map +1 -0
- package/dist/lib/ui/components/charts/chart-theme.js +35 -0
- package/dist/lib/ui/components/charts/chart-theme.js.map +1 -0
- package/dist/lib/ui/components/charts/echarts-modules.cjs +2 -0
- package/dist/lib/ui/components/charts/echarts-modules.cjs.map +1 -0
- package/dist/lib/ui/components/charts/echarts-modules.js +19 -0
- package/dist/lib/ui/components/charts/echarts-modules.js.map +1 -0
- package/dist/lib/ui/components/charts/useChartInstance.cjs +2 -0
- package/dist/lib/ui/components/charts/useChartInstance.cjs.map +1 -0
- package/dist/lib/ui/components/charts/useChartInstance.js +32 -0
- package/dist/lib/ui/components/charts/useChartInstance.js.map +1 -0
- package/dist/types/ui/components/Widget/Widget.d.ts +16 -1
- package/dist/types/ui/components/charts/TimeSeriesChart/TimeSeriesChart.d.ts +15 -0
- package/dist/types/ui/components/charts/TimeSeriesChart/time-series-option.d.ts +39 -0
- package/dist/types/ui/components/charts/chart-palette.d.ts +1 -0
- package/dist/types/ui/components/charts/chart-theme.d.ts +11 -0
- package/dist/types/ui/components/charts/echarts-modules.d.ts +3 -0
- package/dist/types/ui/components/charts/useChartInstance.d.ts +10 -0
- package/dist/types/ui/components/index.d.ts +2 -0
- package/package.json +6 -1
|
@@ -7,7 +7,22 @@ type WidgetDescriptionProps = {
|
|
|
7
7
|
description: ReactNode;
|
|
8
8
|
descriptionButtonLabel: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type WidgetCollapseProps = {
|
|
11
|
+
isCollapsible?: false;
|
|
12
|
+
collapseButtonLabel?: undefined;
|
|
13
|
+
expandButtonLabel?: undefined;
|
|
14
|
+
collapsed?: undefined;
|
|
15
|
+
defaultCollapsed?: undefined;
|
|
16
|
+
onCollapsedChange?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
isCollapsible: true;
|
|
19
|
+
collapseButtonLabel: string;
|
|
20
|
+
expandButtonLabel: string;
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
defaultCollapsed?: boolean;
|
|
23
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
24
|
+
};
|
|
25
|
+
export type WidgetProps = Omit<ComponentPropsWithoutRef<"div">, "title"> & WidgetDescriptionProps & WidgetCollapseProps & {
|
|
11
26
|
title: ReactNode;
|
|
12
27
|
headerActions?: ReactNode;
|
|
13
28
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type TimeSeriesData, type TimeSeriesDisplayType, type TimeSeriesLegendMode, type TimeSeriesLineOptions, type TimeSeriesYAxisOptions } from "./time-series-option";
|
|
3
|
+
import "./time-series-chart.css";
|
|
4
|
+
export type { TimeSeriesData, TimeSeriesDisplayType, TimeSeriesLegendMode, TimeSeriesLineOptions, TimeSeriesLineStyle, TimeSeriesLineWidth, TimeSeriesPoint, TimeSeriesYAxisOptions, } from "./time-series-option";
|
|
5
|
+
export type TimeSeriesChartProps = Omit<ComponentPropsWithoutRef<"div">, "children"> & {
|
|
6
|
+
series: TimeSeriesData[];
|
|
7
|
+
displayType?: TimeSeriesDisplayType;
|
|
8
|
+
legend?: TimeSeriesLegendMode;
|
|
9
|
+
line?: TimeSeriesLineOptions;
|
|
10
|
+
yAxis?: TimeSeriesYAxisOptions;
|
|
11
|
+
showSymbols?: boolean;
|
|
12
|
+
showValueLabels?: boolean;
|
|
13
|
+
valueFormatter?: (value: number) => string;
|
|
14
|
+
};
|
|
15
|
+
export declare function TimeSeriesChart({ series, displayType, legend, line, yAxis, showSymbols, showValueLabels, valueFormatter, className, ...props }: TimeSeriesChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ChartTheme } from "../chart-theme";
|
|
2
|
+
export interface TimeSeriesPoint {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
value: number | null;
|
|
5
|
+
}
|
|
6
|
+
export interface TimeSeriesData {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
points: TimeSeriesPoint[];
|
|
10
|
+
colorToken?: string;
|
|
11
|
+
}
|
|
12
|
+
export type TimeSeriesDisplayType = "line" | "bar" | "area";
|
|
13
|
+
export type TimeSeriesLineStyle = "solid" | "dashed" | "dotted";
|
|
14
|
+
export type TimeSeriesLineWidth = "thin" | "normal" | "thick";
|
|
15
|
+
export interface TimeSeriesLineOptions {
|
|
16
|
+
style?: TimeSeriesLineStyle;
|
|
17
|
+
width?: TimeSeriesLineWidth;
|
|
18
|
+
}
|
|
19
|
+
export type TimeSeriesLegendMode = "inline" | "none";
|
|
20
|
+
export type TimeSeriesAxisScale = "linear" | "log";
|
|
21
|
+
export interface TimeSeriesYAxisOptions {
|
|
22
|
+
scale?: TimeSeriesAxisScale;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
includeZero?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface TimeSeriesOptionInput {
|
|
28
|
+
series: TimeSeriesData[];
|
|
29
|
+
displayType: TimeSeriesDisplayType;
|
|
30
|
+
legend: TimeSeriesLegendMode;
|
|
31
|
+
line: TimeSeriesLineOptions;
|
|
32
|
+
yAxis: TimeSeriesYAxisOptions;
|
|
33
|
+
theme: ChartTheme;
|
|
34
|
+
showSymbols: boolean;
|
|
35
|
+
showValueLabels: boolean;
|
|
36
|
+
seriesColorOverrides: Record<string, string>;
|
|
37
|
+
valueFormatter?: (value: number) => string;
|
|
38
|
+
}
|
|
39
|
+
export declare function buildTimeSeriesOption(input: TimeSeriesOptionInput): Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHART_SERIES_COLOR_TOKENS: string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ChartTheme {
|
|
2
|
+
seriesColors: string[];
|
|
3
|
+
axisLineColor: string;
|
|
4
|
+
splitLineColor: string;
|
|
5
|
+
labelColor: string;
|
|
6
|
+
tooltipBackgroundColor: string;
|
|
7
|
+
tooltipBorderColor: string;
|
|
8
|
+
fontFamily: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveColorToken(element: HTMLElement, token: string): string | undefined;
|
|
11
|
+
export declare function readChartTheme(element: HTMLElement): ChartTheme;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type ChartTheme } from "./chart-theme";
|
|
3
|
+
import { echarts } from "./echarts-modules";
|
|
4
|
+
export interface ChartInstance {
|
|
5
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
6
|
+
chart: echarts.ECharts | null;
|
|
7
|
+
theme: ChartTheme | null;
|
|
8
|
+
resolveSeriesColor: (token: string) => string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function useChartInstance(): ChartInstance;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./Breadcrumb/Breadcrumb";
|
|
2
2
|
export * from "./Card/Card";
|
|
3
|
+
export * from "./charts/chart-palette";
|
|
4
|
+
export * from "./charts/TimeSeriesChart/TimeSeriesChart";
|
|
3
5
|
export * from "./ConfirmDialog/ConfirmDialog";
|
|
4
6
|
export * from "./DataTable/DataTable";
|
|
5
7
|
export * from "./FormModal/FormModal";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "APIPass React Design System",
|
|
6
6
|
"sideEffects": [
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@monaco-editor/react": ">=4.0.0",
|
|
60
|
+
"echarts": ">=5.5.0",
|
|
60
61
|
"react": ">=18.0.0",
|
|
61
62
|
"react-aria-components": ">=1.10.0",
|
|
62
63
|
"react-dom": ">=18.0.0"
|
|
@@ -64,6 +65,9 @@
|
|
|
64
65
|
"peerDependenciesMeta": {
|
|
65
66
|
"@monaco-editor/react": {
|
|
66
67
|
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"echarts": {
|
|
70
|
+
"optional": true
|
|
67
71
|
}
|
|
68
72
|
},
|
|
69
73
|
"dependencies": {
|
|
@@ -87,6 +91,7 @@
|
|
|
87
91
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
88
92
|
"@typescript-eslint/parser": "^6.0.0",
|
|
89
93
|
"@vitejs/plugin-react": "^4.0.3",
|
|
94
|
+
"echarts": "^5.6.0",
|
|
90
95
|
"eslint": "^8.45.0",
|
|
91
96
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
92
97
|
"eslint-plugin-react-refresh": "^0.4.3",
|