@wavv/ui 1.5.6 → 1.6.1
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 +6 -6
- package/build/cjs/types/components/BarChart.d.ts +5 -29
- package/build/cjs/types/components/ChartHelpers.d.ts +25 -3
- package/build/cjs/types/components/LineChart.d.ts +4 -0
- package/build/cjs/types/components/PieChart.d.ts +1 -2
- package/build/cjs/types/components/Table/Body.d.ts +4 -3
- package/build/cjs/types/components/Table/Table.d.ts +2 -2
- package/build/cjs/types/components/types.d.ts +7 -0
- package/build/cjs/types/index.d.ts +1 -0
- package/build/esm/index.js +6 -6
- package/build/esm/types/components/BarChart.d.ts +5 -29
- package/build/esm/types/components/ChartHelpers.d.ts +25 -3
- package/build/esm/types/components/LineChart.d.ts +4 -0
- package/build/esm/types/components/PieChart.d.ts +1 -2
- package/build/esm/types/components/Table/Body.d.ts +4 -3
- package/build/esm/types/components/Table/Table.d.ts +2 -2
- package/build/esm/types/components/types.d.ts +7 -0
- package/build/esm/types/index.d.ts +1 -0
- package/build/index.d.ts +23 -24
- package/package.json +1 -1
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
type ChartData = {
|
|
4
|
-
name: string;
|
|
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;
|
|
2
|
+
import { ChartProps } from './ChartHelpers';
|
|
21
3
|
type Props = {
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/** The chart data array */
|
|
27
|
-
data: ChartData[];
|
|
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;
|
|
4
|
+
/** Stacks multiple data points within a single bar */
|
|
5
|
+
stacked?: boolean;
|
|
6
|
+
} & ChartProps;
|
|
7
|
+
declare const BarChart: ({ data, legend, keys, stacked, ...rest }: Props) => JSX.Element;
|
|
32
8
|
export default BarChart;
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TooltipProps } from 'recharts';
|
|
3
3
|
import { Payload } from 'recharts/types/component/DefaultLegendContent';
|
|
4
|
-
import { Margin } from './types';
|
|
4
|
+
import { Margin, WidthHeight } from './types';
|
|
5
|
+
type ChartData = {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
export type KeyData = {
|
|
9
|
+
key: string;
|
|
10
|
+
color: string;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type ChartProps = {
|
|
14
|
+
/** The chart data array */
|
|
15
|
+
data: ChartData[];
|
|
16
|
+
/** Designates the chart colors corresponding to the chart's data properties */
|
|
17
|
+
keys: KeyData[];
|
|
18
|
+
/** Displays a data legend beneath the chart */
|
|
19
|
+
legend?: boolean;
|
|
20
|
+
/** Allows the chart to grow and shrink (default if no explicit width) */
|
|
21
|
+
responsive?: boolean;
|
|
22
|
+
} & Margin & WidthHeight;
|
|
5
23
|
export declare const ChartStyles: () => JSX.Element;
|
|
6
24
|
export declare const ChartContainer: import("@emotion/styled").StyledComponent<{
|
|
7
25
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
26
|
as?: import("react").ElementType<any> | undefined;
|
|
9
|
-
} & Margin
|
|
27
|
+
} & Margin & import("./types").Width & import("./types").Height & {
|
|
28
|
+
responsive?: boolean | undefined;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
30
|
export declare const TooltipContent: ({ active, payload, label }: TooltipProps<number, string>) => JSX.Element | null;
|
|
11
31
|
export declare const Tooltip: () => JSX.Element;
|
|
12
|
-
export declare const LegendContent: ({ payload }: {
|
|
32
|
+
export declare const LegendContent: ({ payload, toggleData, }: {
|
|
13
33
|
payload?: Payload[] | undefined;
|
|
34
|
+
toggleData?: ((item: Payload) => void) | undefined;
|
|
14
35
|
}) => JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -10,11 +10,10 @@ type Props = {
|
|
|
10
10
|
data: ChartData[];
|
|
11
11
|
/** The width & height of the chart */
|
|
12
12
|
size?: number;
|
|
13
|
-
outerRadius?: number;
|
|
14
13
|
/** The radius of the inner circle */
|
|
15
14
|
innerRadius?: number;
|
|
16
15
|
/** Displays a gray chart if no data is present */
|
|
17
16
|
showWhenEmpty?: boolean;
|
|
18
17
|
} & Margin;
|
|
19
|
-
declare const PieChart: ({ size, data, innerRadius,
|
|
18
|
+
declare const PieChart: ({ size, data, innerRadius, showWhenEmpty, ...rest }: Props) => JSX.Element;
|
|
20
19
|
export default PieChart;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLProps, ReactNode } from 'react';
|
|
2
|
-
import { Height } from '../types';
|
|
2
|
+
import { As, Height, MaxHeight } from '../types';
|
|
3
|
+
type DefaultBodyProps = Omit<HTMLProps<HTMLTableSectionElement>, 'as'> & As;
|
|
3
4
|
type BodyProps = {
|
|
4
5
|
children: ReactNode;
|
|
5
|
-
} & Height &
|
|
6
|
-
declare const Body: ({ children, height }: BodyProps) => JSX.Element;
|
|
6
|
+
} & Height & MaxHeight & DefaultBodyProps;
|
|
7
|
+
declare const Body: ({ children, height, maxHeight, ...rest }: BodyProps) => JSX.Element;
|
|
7
8
|
export default Body;
|
|
@@ -10,9 +10,9 @@ declare const Table: {
|
|
|
10
10
|
sorted?: import("./types").SortDir | undefined;
|
|
11
11
|
sortKey?: string | undefined;
|
|
12
12
|
}) => JSX.Element;
|
|
13
|
-
Body: ({ children, height }: {
|
|
13
|
+
Body: ({ children, height, maxHeight, ...rest }: {
|
|
14
14
|
children: ReactNode;
|
|
15
|
-
} & import("../types").Height & import("react").HTMLProps<HTMLTableSectionElement>) => JSX.Element;
|
|
15
|
+
} & import("../types").Height & import("../types").MaxHeight & Omit<import("react").HTMLProps<HTMLTableSectionElement>, "as"> & import("../types").As) => JSX.Element;
|
|
16
16
|
Row: ({ children, columns, onClick, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
|
|
17
17
|
Column: ({ children, contentPosition, defaultValue, padding, paddingTop, paddingBottom, paddingRight, paddingLeft, }: {
|
|
18
18
|
children?: ReactNode;
|
|
@@ -14,6 +14,12 @@ export type Padding = {
|
|
|
14
14
|
paddingRight?: number | string;
|
|
15
15
|
paddingLeft?: number | string;
|
|
16
16
|
};
|
|
17
|
+
export type MaxWidth = {
|
|
18
|
+
maxWidth?: number | string;
|
|
19
|
+
};
|
|
20
|
+
export type MaxHeight = {
|
|
21
|
+
maxHeight?: number | string;
|
|
22
|
+
};
|
|
17
23
|
export type Width = {
|
|
18
24
|
width?: number | string;
|
|
19
25
|
};
|
|
@@ -21,6 +27,7 @@ export type Height = {
|
|
|
21
27
|
height?: number | string;
|
|
22
28
|
};
|
|
23
29
|
export type WidthHeight = Width & Height;
|
|
30
|
+
export type MaxWidthHeight = MaxWidth & MaxHeight;
|
|
24
31
|
export type MarginPadding = Margin & Padding;
|
|
25
32
|
export type FlexPosition = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
26
33
|
export type As = {
|
|
@@ -16,6 +16,7 @@ export { default as InlineCode } from './components/InlineCode';
|
|
|
16
16
|
export { default as Input } from './components/Input';
|
|
17
17
|
export { default as InputUtils } from './components/InputHelpers';
|
|
18
18
|
export { default as Label } from './components/Label';
|
|
19
|
+
export { default as LineChart } from './components/LineChart';
|
|
19
20
|
export { default as Menu } from './components/Menu';
|
|
20
21
|
export { default as Message } from './components/Message';
|
|
21
22
|
export { default as MessageHr } from './components/MessageHr';
|
package/build/index.d.ts
CHANGED
|
@@ -522,6 +522,9 @@ type Padding = {
|
|
|
522
522
|
paddingRight?: number | string;
|
|
523
523
|
paddingLeft?: number | string;
|
|
524
524
|
};
|
|
525
|
+
type MaxHeight = {
|
|
526
|
+
maxHeight?: number | string;
|
|
527
|
+
};
|
|
525
528
|
type Width = {
|
|
526
529
|
width?: number | string;
|
|
527
530
|
};
|
|
@@ -628,32 +631,27 @@ declare const Audio: React.ForwardRefExoticComponent<Pick<AudioProps, "width" |
|
|
|
628
631
|
type ChartData$1 = {
|
|
629
632
|
name: string;
|
|
630
633
|
};
|
|
631
|
-
type
|
|
634
|
+
type KeyData = {
|
|
632
635
|
key: string;
|
|
633
636
|
color: string;
|
|
637
|
+
hidden?: boolean;
|
|
634
638
|
};
|
|
635
|
-
type
|
|
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;
|
|
646
|
-
type Props$2 = {
|
|
647
|
-
/** Width of the chart */
|
|
648
|
-
width: number;
|
|
649
|
-
/** Height of the chart */
|
|
650
|
-
height: number;
|
|
639
|
+
type ChartProps = {
|
|
651
640
|
/** The chart data array */
|
|
652
641
|
data: ChartData$1[];
|
|
642
|
+
/** Designates the chart colors corresponding to the chart's data properties */
|
|
643
|
+
keys: KeyData[];
|
|
653
644
|
/** Displays a data legend beneath the chart */
|
|
654
645
|
legend?: boolean;
|
|
655
|
-
|
|
656
|
-
|
|
646
|
+
/** Allows the chart to grow and shrink (default if no explicit width) */
|
|
647
|
+
responsive?: boolean;
|
|
648
|
+
} & Margin & WidthHeight;
|
|
649
|
+
|
|
650
|
+
type Props$2 = {
|
|
651
|
+
/** Stacks multiple data points within a single bar */
|
|
652
|
+
stacked?: boolean;
|
|
653
|
+
} & ChartProps;
|
|
654
|
+
declare const BarChart: ({ data, legend, keys, stacked, ...rest }: Props$2) => JSX.Element;
|
|
657
655
|
|
|
658
656
|
type OptionItem = {
|
|
659
657
|
id: number | string;
|
|
@@ -1894,6 +1892,8 @@ type LabelProps = {
|
|
|
1894
1892
|
} & Margin;
|
|
1895
1893
|
declare const Label: ({ children, iconLeft, iconRight, disabled, pill, ...rest }: LabelProps) => JSX.Element;
|
|
1896
1894
|
|
|
1895
|
+
declare const LineChart: ({ data, legend, keys, ...rest }: ChartProps) => JSX.Element;
|
|
1896
|
+
|
|
1897
1897
|
type MenuProps = {
|
|
1898
1898
|
/** Displays the menu as a vertical, stacked menu */
|
|
1899
1899
|
vertical?: boolean;
|
|
@@ -2160,13 +2160,12 @@ type Props$1 = {
|
|
|
2160
2160
|
data: ChartData[];
|
|
2161
2161
|
/** The width & height of the chart */
|
|
2162
2162
|
size?: number;
|
|
2163
|
-
outerRadius?: number;
|
|
2164
2163
|
/** The radius of the inner circle */
|
|
2165
2164
|
innerRadius?: number;
|
|
2166
2165
|
/** Displays a gray chart if no data is present */
|
|
2167
2166
|
showWhenEmpty?: boolean;
|
|
2168
2167
|
} & Margin;
|
|
2169
|
-
declare const PieChart: ({ size, data, innerRadius,
|
|
2168
|
+
declare const PieChart: ({ size, data, innerRadius, showWhenEmpty, ...rest }: Props$1) => JSX.Element;
|
|
2170
2169
|
|
|
2171
2170
|
type CircleProps = ({
|
|
2172
2171
|
circle?: false;
|
|
@@ -2320,9 +2319,9 @@ declare const Table: {
|
|
|
2320
2319
|
sorted?: SortDir | undefined;
|
|
2321
2320
|
sortKey?: string | undefined;
|
|
2322
2321
|
}) => JSX.Element;
|
|
2323
|
-
Body: ({ children, height }: {
|
|
2322
|
+
Body: ({ children, height, maxHeight, ...rest }: {
|
|
2324
2323
|
children: ReactNode;
|
|
2325
|
-
} & Height & React.HTMLProps<HTMLTableSectionElement>) => JSX.Element;
|
|
2324
|
+
} & Height & MaxHeight & Omit<React.HTMLProps<HTMLTableSectionElement>, "as"> & As) => JSX.Element;
|
|
2326
2325
|
Row: ({ children, columns, onClick, ...rest }: TableHeaderRow) => JSX.Element;
|
|
2327
2326
|
Column: ({ children, contentPosition, defaultValue, padding, paddingTop, paddingBottom, paddingRight, paddingLeft, }: {
|
|
2328
2327
|
children?: ReactNode;
|
|
@@ -2415,4 +2414,4 @@ declare const formatDate: (value: Date, option?: TimeSpec | TimeOptions) => stri
|
|
|
2415
2414
|
|
|
2416
2415
|
declare const copyToClipboard: (text: string) => void;
|
|
2417
2416
|
|
|
2418
|
-
export { Accordion, Audio, AudioRef, BarChart, Button, Calendar, Checkbox, Code, Table$1 as DocTable, DraftEditor, DraftEditorRef, Dropdown, OptionItem as DropdownOption, Form, Grid, ITheme, Icon, IconNames, ImageViewer, InlineCode, Input, InputRef, _default as InputUtils, Label, Menu, Message, MessageHr, Modal, MultiSelect, Notification, Options, Pagination, PieChart, Progress, Radio, ResetStyles, ScrollbarStyles, Slider, Spacer, Spinner, Table, ThemeProp, ToastStyles, Toggle, Tooltip, Action as TransferAction, Item as TransferItem, TransferList, Next as TransferNext, copyToClipboard, formatDate, theme, useConfirm, useElementObserver, useEventListener, useOnClickOutside, useSelect, useSelectAll, useWindowSize };
|
|
2417
|
+
export { Accordion, Audio, AudioRef, BarChart, Button, Calendar, Checkbox, Code, Table$1 as DocTable, DraftEditor, DraftEditorRef, Dropdown, OptionItem as DropdownOption, Form, Grid, ITheme, Icon, IconNames, ImageViewer, InlineCode, Input, InputRef, _default as InputUtils, Label, LineChart, Menu, Message, MessageHr, Modal, MultiSelect, Notification, Options, Pagination, PieChart, Progress, Radio, ResetStyles, ScrollbarStyles, Slider, Spacer, Spinner, Table, ThemeProp, ToastStyles, Toggle, Tooltip, Action as TransferAction, Item as TransferItem, TransferList, Next as TransferNext, copyToClipboard, formatDate, theme, useConfirm, useElementObserver, useEventListener, useOnClickOutside, useSelect, useSelectAll, useWindowSize };
|