@apipass/design-system 5.1.0 → 5.3.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/charts.index.cjs +1 -1
- package/dist/lib/charts.index.js +10 -4
- package/dist/lib/charts.index.js.map +1 -1
- package/dist/lib/embedded-styles.js +2 -2
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/charts/BarChart/BarChart.cjs +2 -0
- package/dist/lib/ui/components/charts/BarChart/BarChart.cjs.map +1 -0
- package/dist/lib/ui/components/charts/BarChart/BarChart.js +79 -0
- package/dist/lib/ui/components/charts/BarChart/BarChart.js.map +1 -0
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs +2 -0
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs.map +1 -0
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js +166 -0
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js.map +1 -0
- package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.cjs +2 -0
- package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.cjs.map +1 -0
- package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.js +99 -0
- package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.js.map +1 -0
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs +2 -0
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs.map +1 -0
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js +47 -0
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js.map +1 -0
- package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.cjs +2 -0
- package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.cjs.map +1 -0
- package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.js +34 -0
- package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.js.map +1 -0
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs.map +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js +63 -45
- package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js.map +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs.map +1 -1
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js +31 -41
- package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js.map +1 -1
- package/dist/types/charts.index.d.ts +3 -0
- package/dist/types/ui/components/charts/BarChart/BarChart.d.ts +18 -0
- package/dist/types/ui/components/charts/BarChart/bar-chart-option.d.ts +34 -0
- package/dist/types/ui/components/charts/ChartColorPicker/ChartColorPicker.d.ts +18 -0
- package/dist/types/ui/components/charts/ChartLegend/ChartLegend.d.ts +21 -0
- package/dist/types/ui/components/charts/ChartLegend/use-chart-legend.d.ts +14 -0
- package/dist/types/ui/components/charts/TimeSeriesChart/TimeSeriesChart.d.ts +4 -1
- package/dist/types/ui/components/charts/TimeSeriesChart/time-series-option.d.ts +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import "./chart-color-picker.css";
|
|
3
|
+
export interface ChartColorPickerLabels {
|
|
4
|
+
palette: string;
|
|
5
|
+
colorOption: (position: number) => string;
|
|
6
|
+
automaticColor: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChartColorPickerProps {
|
|
9
|
+
colorToken?: string;
|
|
10
|
+
onChange: (colorToken: string | null) => void;
|
|
11
|
+
isResettable?: boolean;
|
|
12
|
+
labels?: Partial<ChartColorPickerLabels>;
|
|
13
|
+
triggerLabel: string;
|
|
14
|
+
triggerClassName?: string;
|
|
15
|
+
triggerStyle?: React.CSSProperties;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare function ChartColorPicker({ colorToken, onChange, isResettable, labels, triggerLabel, triggerClassName, triggerStyle, children, }: ChartColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type ChartColorPickerLabels } from "../ChartColorPicker/ChartColorPicker";
|
|
3
|
+
import "./chart-legend.css";
|
|
4
|
+
export interface ChartLegendItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
color: string;
|
|
8
|
+
isHidden: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ChartLegendLabels extends ChartColorPickerLabels {
|
|
11
|
+
toggleSeries: (seriesName: string) => string;
|
|
12
|
+
chooseColor: (seriesName: string) => string;
|
|
13
|
+
}
|
|
14
|
+
export type ChartLegendProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "onToggle"> & {
|
|
15
|
+
items: ChartLegendItem[];
|
|
16
|
+
onToggle: (seriesId: string) => void;
|
|
17
|
+
onColorChange?: (seriesId: string, colorToken: string | null) => void;
|
|
18
|
+
colorTokensBySeriesId?: Record<string, string>;
|
|
19
|
+
labels?: Partial<ChartLegendLabels>;
|
|
20
|
+
};
|
|
21
|
+
export declare function ChartLegend({ items, onToggle, onColorChange, colorTokensBySeriesId, labels, className, ...props }: ChartLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartLegendItem } from "./ChartLegend";
|
|
2
|
+
export interface ChartLegendSeries {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
colorToken?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChartLegendState {
|
|
8
|
+
items: ChartLegendItem[];
|
|
9
|
+
colorsBySeriesId: Record<string, string>;
|
|
10
|
+
colorTokensBySeriesId: Record<string, string>;
|
|
11
|
+
hiddenSeriesIds: Set<string>;
|
|
12
|
+
toggleSeries: (seriesId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useChartLegend(series: ChartLegendSeries[], paletteColors: string[], resolveSeriesColor: (token: string) => string | undefined): ChartLegendState;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type ChartLegendLabels } from "../ChartLegend/ChartLegend";
|
|
2
3
|
import { type TimeSeriesData, type TimeSeriesDisplayType, type TimeSeriesLegendMode, type TimeSeriesLineOptions, type TimeSeriesYAxisOptions } from "./time-series-option";
|
|
3
4
|
import "./time-series-chart.css";
|
|
4
5
|
export type { TimeSeriesData, TimeSeriesDisplayType, TimeSeriesLegendMode, TimeSeriesLineOptions, TimeSeriesLineStyle, TimeSeriesLineWidth, TimeSeriesPoint, TimeSeriesYAxisOptions, } from "./time-series-option";
|
|
@@ -11,5 +12,7 @@ export type TimeSeriesChartProps = Omit<ComponentPropsWithoutRef<"div">, "childr
|
|
|
11
12
|
showSymbols?: boolean;
|
|
12
13
|
showValueLabels?: boolean;
|
|
13
14
|
valueFormatter?: (value: number) => string;
|
|
15
|
+
onSeriesColorChange?: (seriesId: string, colorToken: string | null) => void;
|
|
16
|
+
legendLabels?: Partial<ChartLegendLabels>;
|
|
14
17
|
};
|
|
15
|
-
export declare function TimeSeriesChart({ series, displayType, legend, line, yAxis, showSymbols, showValueLabels, valueFormatter, className, ...props }: TimeSeriesChartProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function TimeSeriesChart({ series, displayType, legend, line, yAxis, showSymbols, showValueLabels, valueFormatter, onSeriesColorChange, legendLabels, className, ...props }: TimeSeriesChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,6 @@ export interface TimeSeriesYAxisOptions {
|
|
|
27
27
|
export interface TimeSeriesOptionInput {
|
|
28
28
|
series: TimeSeriesData[];
|
|
29
29
|
displayType: TimeSeriesDisplayType;
|
|
30
|
-
legend: TimeSeriesLegendMode;
|
|
31
30
|
line: TimeSeriesLineOptions;
|
|
32
31
|
yAxis: TimeSeriesYAxisOptions;
|
|
33
32
|
theme: ChartTheme;
|