@wavv/ui 1.5.4 → 1.5.6
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/build/cjs/index.js +2 -2
- package/build/cjs/types/components/BarChart.d.ts +19 -4
- package/build/cjs/types/components/ChartHelpers.d.ts +7 -0
- package/build/cjs/types/components/Menu.d.ts +2 -2
- package/build/esm/index.js +6 -6
- package/build/esm/types/components/BarChart.d.ts +19 -4
- package/build/esm/types/components/ChartHelpers.d.ts +7 -0
- package/build/esm/types/components/Menu.d.ts +2 -2
- package/build/index.d.ts +20 -5
- package/package.json +1 -1
|
@@ -3,6 +3,21 @@ import { Margin } from './types';
|
|
|
3
3
|
type ChartData = {
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
|
+
type StackData = {
|
|
7
|
+
key: string;
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
type Default = {
|
|
11
|
+
/** The property name of the data value key */
|
|
12
|
+
dataKey: string;
|
|
13
|
+
stackData?: never;
|
|
14
|
+
};
|
|
15
|
+
type Stacked = {
|
|
16
|
+
dataKey?: never;
|
|
17
|
+
/** Stacks multiple data points within a single bar */
|
|
18
|
+
stackData: StackData[];
|
|
19
|
+
};
|
|
20
|
+
type KeyProps = Default | Stacked;
|
|
6
21
|
type Props = {
|
|
7
22
|
/** Width of the chart */
|
|
8
23
|
width: number;
|
|
@@ -10,8 +25,8 @@ type Props = {
|
|
|
10
25
|
height: number;
|
|
11
26
|
/** The chart data array */
|
|
12
27
|
data: ChartData[];
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
} & Margin;
|
|
16
|
-
declare const BarChart: ({ width, height, data, dataKey, ...rest }: Props) => JSX.Element;
|
|
28
|
+
/** Displays a data legend beneath the chart */
|
|
29
|
+
legend?: boolean;
|
|
30
|
+
} & KeyProps & Margin;
|
|
31
|
+
declare const BarChart: ({ width, height, data, dataKey, legend, stackData, ...rest }: Props) => JSX.Element;
|
|
17
32
|
export default BarChart;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TooltipProps } from 'recharts';
|
|
3
|
+
import { Payload } from 'recharts/types/component/DefaultLegendContent';
|
|
2
4
|
import { Margin } from './types';
|
|
5
|
+
export declare const ChartStyles: () => JSX.Element;
|
|
3
6
|
export declare const ChartContainer: import("@emotion/styled").StyledComponent<{
|
|
4
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
8
|
as?: import("react").ElementType<any> | undefined;
|
|
6
9
|
} & Margin, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const TooltipContent: ({ active, payload, label }: TooltipProps<number, string>) => JSX.Element | null;
|
|
7
11
|
export declare const Tooltip: () => JSX.Element;
|
|
12
|
+
export declare const LegendContent: ({ payload }: {
|
|
13
|
+
payload?: Payload[] | undefined;
|
|
14
|
+
}) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { Padding, WidthHeight } from './types';
|
|
2
|
+
import { FlexPosition, Padding, WidthHeight } from './types';
|
|
3
3
|
type MenuProps = {
|
|
4
4
|
/** Displays the menu as a vertical, stacked menu */
|
|
5
5
|
vertical?: boolean;
|
|
@@ -40,7 +40,7 @@ type MenuItemProps = {
|
|
|
40
40
|
/** Prevents the Menu Item from being clicked */
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
/** The flex positioning of the Item contents */
|
|
43
|
-
contentPosition?:
|
|
43
|
+
contentPosition?: FlexPosition;
|
|
44
44
|
/** The function to be called when the Menu Item is clicked */
|
|
45
45
|
onClick: (event: MouseEvent) => void;
|
|
46
46
|
indent?: number;
|