@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.
@@ -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
- /** The property name of the data value key */
14
- dataKey: string;
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?: 'start' | 'end';
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;
package/build/index.d.ts CHANGED
@@ -628,6 +628,21 @@ declare const Audio: React.ForwardRefExoticComponent<Pick<AudioProps, "width" |
628
628
  type ChartData$1 = {
629
629
  name: string;
630
630
  };
631
+ type StackData = {
632
+ key: string;
633
+ color: string;
634
+ };
635
+ type Default$2 = {
636
+ /** The property name of the data value key */
637
+ dataKey: string;
638
+ stackData?: never;
639
+ };
640
+ type Stacked = {
641
+ dataKey?: never;
642
+ /** Stacks multiple data points within a single bar */
643
+ stackData: StackData[];
644
+ };
645
+ type KeyProps = Default$2 | Stacked;
631
646
  type Props$2 = {
632
647
  /** Width of the chart */
633
648
  width: number;
@@ -635,10 +650,10 @@ type Props$2 = {
635
650
  height: number;
636
651
  /** The chart data array */
637
652
  data: ChartData$1[];
638
- /** The property name of the data value key */
639
- dataKey: string;
640
- } & Margin;
641
- declare const BarChart: ({ width, height, data, dataKey, ...rest }: Props$2) => JSX.Element;
653
+ /** Displays a data legend beneath the chart */
654
+ legend?: boolean;
655
+ } & KeyProps & Margin;
656
+ declare const BarChart: ({ width, height, data, dataKey, legend, stackData, ...rest }: Props$2) => JSX.Element;
642
657
 
643
658
  type OptionItem = {
644
659
  id: number | string;
@@ -1919,7 +1934,7 @@ type MenuItemProps = {
1919
1934
  /** Prevents the Menu Item from being clicked */
1920
1935
  disabled?: boolean;
1921
1936
  /** The flex positioning of the Item contents */
1922
- contentPosition?: 'start' | 'end';
1937
+ contentPosition?: FlexPosition;
1923
1938
  /** The function to be called when the Menu Item is clicked */
1924
1939
  onClick: (event: MouseEvent$1) => void;
1925
1940
  indent?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "files": [
5
5
  "build/**/*"
6
6
  ],