@apipass/design-system 5.2.0 → 5.4.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.
Files changed (47) hide show
  1. package/dist/lib/charts.index.cjs +1 -1
  2. package/dist/lib/charts.index.js +10 -6
  3. package/dist/lib/charts.index.js.map +1 -1
  4. package/dist/lib/embedded-styles.js +2 -2
  5. package/dist/lib/style.css +1 -1
  6. package/dist/lib/ui/components/charts/BarChart/BarChart.cjs +1 -1
  7. package/dist/lib/ui/components/charts/BarChart/BarChart.cjs.map +1 -1
  8. package/dist/lib/ui/components/charts/BarChart/BarChart.js +66 -48
  9. package/dist/lib/ui/components/charts/BarChart/BarChart.js.map +1 -1
  10. package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs +1 -1
  11. package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs.map +1 -1
  12. package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js +71 -81
  13. package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js.map +1 -1
  14. package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.cjs +2 -0
  15. package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.cjs.map +1 -0
  16. package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.js +99 -0
  17. package/dist/lib/ui/components/charts/ChartColorPicker/ChartColorPicker.js.map +1 -0
  18. package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs +2 -0
  19. package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs.map +1 -0
  20. package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js +47 -0
  21. package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js.map +1 -0
  22. package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.cjs +2 -0
  23. package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.cjs.map +1 -0
  24. package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.js +34 -0
  25. package/dist/lib/ui/components/charts/ChartLegend/use-chart-legend.js.map +1 -0
  26. package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs +1 -1
  27. package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.cjs.map +1 -1
  28. package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js +63 -45
  29. package/dist/lib/ui/components/charts/TimeSeriesChart/TimeSeriesChart.js.map +1 -1
  30. package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs +1 -1
  31. package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.cjs.map +1 -1
  32. package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js +31 -41
  33. package/dist/lib/ui/components/charts/TimeSeriesChart/time-series-option.js.map +1 -1
  34. package/dist/lib/ui/primitives/Table/Table.cjs +1 -1
  35. package/dist/lib/ui/primitives/Table/Table.cjs.map +1 -1
  36. package/dist/lib/ui/primitives/Table/Table.js +68 -52
  37. package/dist/lib/ui/primitives/Table/Table.js.map +1 -1
  38. package/dist/types/charts.index.d.ts +2 -0
  39. package/dist/types/ui/components/charts/BarChart/BarChart.d.ts +4 -1
  40. package/dist/types/ui/components/charts/BarChart/bar-chart-option.d.ts +0 -1
  41. package/dist/types/ui/components/charts/ChartColorPicker/ChartColorPicker.d.ts +18 -0
  42. package/dist/types/ui/components/charts/ChartLegend/ChartLegend.d.ts +21 -0
  43. package/dist/types/ui/components/charts/ChartLegend/use-chart-legend.d.ts +14 -0
  44. package/dist/types/ui/components/charts/TimeSeriesChart/TimeSeriesChart.d.ts +4 -1
  45. package/dist/types/ui/components/charts/TimeSeriesChart/time-series-option.d.ts +0 -1
  46. package/dist/types/ui/primitives/Table/Table.d.ts +2 -1
  47. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { type ComponentPropsWithoutRef } from "react";
2
+ import { type ChartLegendLabels } from "../ChartLegend/ChartLegend";
2
3
  import { type BarChartLegendMode, type BarChartOrientation, type BarChartSeriesData, type BarChartStacking, type BarChartValueAxisOptions, type BarChartValueLabel } from "./bar-chart-option";
3
4
  import "./bar-chart.css";
4
5
  export type { BarChartAxisScale, BarChartLegendMode, BarChartOrientation, BarChartPoint, BarChartSeriesData, BarChartStacking, BarChartValueAxisOptions, BarChartValueLabel, } from "./bar-chart-option";
@@ -11,5 +12,7 @@ export type BarChartProps = Omit<ComponentPropsWithoutRef<"div">, "children"> &
11
12
  legend?: BarChartLegendMode;
12
13
  valueAxis?: BarChartValueAxisOptions;
13
14
  valueFormatter?: (value: number) => string;
15
+ onSeriesColorChange?: (seriesId: string, colorToken: string | null) => void;
16
+ legendLabels?: Partial<ChartLegendLabels>;
14
17
  };
15
- export declare function BarChart({ categories, series, orientation, stacking, valueLabel, legend, valueAxis, valueFormatter, className, ...props }: BarChartProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function BarChart({ categories, series, orientation, stacking, valueLabel, legend, valueAxis, valueFormatter, onSeriesColorChange, legendLabels, className, ...props }: BarChartProps): import("react/jsx-runtime").JSX.Element;
@@ -26,7 +26,6 @@ export interface BarChartOptionInput {
26
26
  orientation: BarChartOrientation;
27
27
  stacking: BarChartStacking;
28
28
  valueLabel: BarChartValueLabel;
29
- legend: BarChartLegendMode;
30
29
  valueAxis: BarChartValueAxisOptions;
31
30
  theme: ChartTheme;
32
31
  seriesColorOverrides: Record<string, string>;
@@ -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;
@@ -6,8 +6,9 @@ export type TableProps = RACTableProps & {
6
6
  dense?: boolean;
7
7
  grid?: boolean;
8
8
  striped?: boolean;
9
+ maxHeight?: number | string;
9
10
  };
10
- export declare function Table({ bleed, dense, grid, striped, className, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Table({ bleed, dense, grid, striped, maxHeight, className, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
11
12
  export type TableColumnProps = RACColumnProps & {
12
13
  align?: TableAlign;
13
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [