@foris/avocado-suite 0.9.0 → 0.10.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. package/dist/avocado-suite/src/components/DataTable/DataTable.d.ts +8 -0
  2. package/dist/avocado-suite/src/components/DataTable/components/DataTableAction/DataTableAction.d.ts +28 -0
  3. package/dist/avocado-suite/src/components/DataTable/components/DataTableAction/DataTableActionsGroup.d.ts +10 -0
  4. package/dist/avocado-suite/src/components/DataTable/components/DataTableContent/DataTableContent.d.ts +71 -0
  5. package/dist/avocado-suite/src/components/DataTable/components/DataTableHeader/DataTableHeader.d.ts +20 -0
  6. package/dist/avocado-suite/src/components/DataTable/components/DataTableRow/DataTableRow.d.ts +16 -0
  7. package/dist/avocado-suite/src/components/DataTable/components/DataTableRow/DataTableRowAccordion.d.ts +18 -0
  8. package/dist/avocado-suite/src/components/DataTable/utils/dataTableUtil.d.ts +18 -0
  9. package/dist/avocado-suite/src/components/Pill/Pill.d.ts +23 -0
  10. package/dist/avocado-suite/src/components/Pill/Pill.test.d.ts +1 -0
  11. package/dist/avocado-suite/src/components/card-notification/CardNotification.d.ts +25 -0
  12. package/dist/avocado-suite/src/components/card-notification/CardNotification.test.d.ts +0 -0
  13. package/dist/avocado-suite/src/components/donut/Donut.d.ts +17 -0
  14. package/dist/avocado-suite/src/components/donut/donut-labels/DonutLabels.d.ts +9 -0
  15. package/dist/avocado-suite/src/components/donut/donut-legend/DonutLegend.d.ts +13 -0
  16. package/dist/avocado-suite/src/index.d.ts +7 -1
  17. package/dist/avocado-suite.es.js +4279 -3502
  18. package/dist/avocado-suite.umd.js +22 -22
  19. package/dist/style.css +1 -1
  20. package/package.json +3 -3
@@ -0,0 +1,8 @@
1
+ declare const DataTable: {
2
+ Action: import("react").FC<import("./components/DataTableAction/DataTableAction").IDataTableAction>;
3
+ ActionsGroup: import("react").FC<import("./components/DataTableAction/DataTableActionsGroup").IDataTableActionsGroup>;
4
+ Content: import("react").FC<import("./components/DataTableContent/DataTableContent").IDataTableContent>;
5
+ Header: import("react").FC<import("./components/DataTableHeader/DataTableHeader").IDataTableHeader>;
6
+ Row: import("react").FC<import("./components/DataTableRow/DataTableRow").IDataTableRow>;
7
+ };
8
+ export default DataTable;
@@ -0,0 +1,28 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { IconTypes } from '../../../../../../avocado-icons/src/types/icons.type.ts';
3
+ import IconSize from '../../../../../../avocado-icons/src/types/size.enum';
4
+ export type DataTableActionPosition = 'left' | 'right';
5
+ export type DataTableActionType = 'primary' | 'success' | 'warning' | 'danger';
6
+ export interface IDataTableAction {
7
+ /** replace icon with another element */
8
+ children?: ReactNode | string;
9
+ /** overwrite children classnames */
10
+ classname?: {
11
+ aside?: string;
12
+ icon?: string;
13
+ };
14
+ /** disabled state */
15
+ disabled?: boolean;
16
+ /** icon value */
17
+ icon?: IconTypes;
18
+ /** icon size */
19
+ iconSize?: keyof typeof IconSize;
20
+ /** position value */
21
+ position: DataTableActionPosition;
22
+ /** type value */
23
+ type?: DataTableActionType;
24
+ /** option to action in anchor*/
25
+ onClick?: () => void;
26
+ }
27
+ declare const DataTableAction: FC<IDataTableAction>;
28
+ export default DataTableAction;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import DataTableAction from './DataTableAction';
3
+ export interface IDataTableActionsGroup {
4
+ /** actions */
5
+ children: React.ReactElement<typeof DataTableAction> | React.ReactElement<typeof DataTableAction>[];
6
+ /** overwrite className */
7
+ className?: string;
8
+ }
9
+ declare const DataTableActionsGroup: React.FC<IDataTableActionsGroup>;
10
+ export default DataTableActionsGroup;
@@ -0,0 +1,71 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import DataTableAction from '../DataTableAction/DataTableAction';
3
+ import DataTableActionsGroup from '../DataTableAction/DataTableActionsGroup';
4
+ export type DataTableContentType = 'accordion' | 'regular';
5
+ export type DataTableSubContentStyle = 'inheritance' | 'custom';
6
+ export interface IColumn {
7
+ accessor: string;
8
+ header: string;
9
+ position: number;
10
+ styles?: CSSProperties;
11
+ renderCell?: (value: any) => void;
12
+ tooltip?: boolean | string;
13
+ }
14
+ export interface IResponsiveStylesOptions {
15
+ maxWidth?: string;
16
+ minWidth?: string;
17
+ padding?: string;
18
+ width?: string;
19
+ textAlign?: 'left' | 'right' | 'center';
20
+ }
21
+ export interface IResponsiveOptions {
22
+ position?: number;
23
+ styles?: IResponsiveStylesOptions;
24
+ }
25
+ export interface IColumnResponsive {
26
+ allDevices?: IResponsiveOptions;
27
+ desktop?: IResponsiveOptions;
28
+ mobile?: IResponsiveOptions;
29
+ }
30
+ export interface IDataTableContentColumn {
31
+ /** This string is used to build the data model for your column. */
32
+ accessor: string;
33
+ /** Column's name */
34
+ header: string;
35
+ /** The responsive configuration for the column. */
36
+ responsive?: IColumnResponsive;
37
+ /** This function (or component) is primarily used for formatting the column value */
38
+ renderCell?: (value: any) => void;
39
+ /** Tooltip to display the cell content or an extra value. */
40
+ tooltip?: boolean | string;
41
+ }
42
+ export interface IDataTableContentActions {
43
+ /** Column's name */
44
+ header?: React.ReactNode | string;
45
+ /** Column's visibility */
46
+ visibility: boolean;
47
+ /** This function (or component) is primarily used for formatting the column value */
48
+ renderComponent: (value: any) => React.ReactElement<typeof DataTableAction> | React.ReactElement<typeof DataTableActionsGroup> | null;
49
+ }
50
+ export interface IDataTableContent {
51
+ /** overwrite className */
52
+ className?: string;
53
+ /** The columns configuration for the table. */
54
+ columns: IDataTableContentColumn[];
55
+ /** The data that you want to display on the table. */
56
+ data: any[];
57
+ /** Left action or actions on the table */
58
+ leftActions?: IDataTableContentActions;
59
+ /** Right action or actions on the table */
60
+ rightActions?: IDataTableContentActions;
61
+ /** content type: regular | accordion */
62
+ contentType?: DataTableContentType;
63
+ /** key to render sub data */
64
+ keyBody?: string;
65
+ /** style of sub content: inheritance | custom */
66
+ styleBody?: DataTableSubContentStyle;
67
+ /** event to render each sub row */
68
+ renderBody?: (body: any) => any;
69
+ }
70
+ declare const DataTableContent: React.FC<IDataTableContent>;
71
+ export default DataTableContent;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { DataTableContentType, DataTableSubContentStyle, IDataTableContentActions, IDataTableContentColumn } from '../DataTableContent/DataTableContent';
3
+ export interface IDataTableHeader {
4
+ /** overwrite className */
5
+ className?: string;
6
+ /** The columns configuration for the table. */
7
+ columns: IDataTableContentColumn[];
8
+ /** content type: regular | accordion */
9
+ contentType?: DataTableContentType;
10
+ /** Check if is mobile device */
11
+ isMobile?: boolean;
12
+ /** Left action or actions on the table */
13
+ leftActions?: IDataTableContentActions;
14
+ /** Right action or actions on the table */
15
+ rightActions?: IDataTableContentActions;
16
+ /** style of sub content: inheritance | custom */
17
+ styleBody?: DataTableSubContentStyle;
18
+ }
19
+ declare const DataTableHeader: React.FC<IDataTableHeader>;
20
+ export default DataTableHeader;
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ import { IColumn, IDataTableContentActions } from '../DataTableContent/DataTableContent';
3
+ export interface IDataTableRow {
4
+ /** The columns parsed for the table. */
5
+ columns: IColumn[][];
6
+ /** The data that you want to display on the table. */
7
+ data: any;
8
+ /** Check if is mobile device */
9
+ isMobile?: boolean;
10
+ /** Left action or actions on the table */
11
+ leftActions?: IDataTableContentActions;
12
+ /** Right action or actions on the table */
13
+ rightActions?: IDataTableContentActions;
14
+ }
15
+ declare const DataTableRow: FC<IDataTableRow>;
16
+ export default DataTableRow;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { DataTableSubContentStyle } from '../DataTableContent/DataTableContent';
3
+ export interface IDataTableRowAccordion {
4
+ /** The columns parsed for the table. */
5
+ columns: any[];
6
+ /** The data that you want to display on the table. */
7
+ data: any;
8
+ /** Check if is mobile device */
9
+ isMobile?: boolean;
10
+ /** key to render sub data */
11
+ keyBody?: string;
12
+ /** style of sub content: inheritance | custom */
13
+ styleBody?: DataTableSubContentStyle;
14
+ /** event to render each sub row */
15
+ renderBody?: (body: any) => any;
16
+ }
17
+ declare const DataTableRowAccordion: React.FC<IDataTableRowAccordion>;
18
+ export default DataTableRowAccordion;
@@ -0,0 +1,18 @@
1
+ import { IDataTableContentColumn, IResponsiveOptions, IResponsiveStylesOptions } from '../components/DataTableContent/DataTableContent';
2
+ export declare const getStyles: (options?: IResponsiveOptions) => {
3
+ maxWidth: string;
4
+ minWidth: string;
5
+ padding: string;
6
+ textAlign: "center" | "left" | "right";
7
+ width: string;
8
+ };
9
+ export declare const parseColumn: (column: IDataTableContentColumn, index: number) => {
10
+ accessor: string;
11
+ header: string;
12
+ renderCell?: ((value: any) => void) | undefined;
13
+ tooltip?: string | boolean | undefined;
14
+ position: number;
15
+ styles: IResponsiveStylesOptions;
16
+ };
17
+ export declare const verifyActionComponent: (element: any) => any;
18
+ export declare const verifyActionsGroupComponent: (element: any) => any;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { IconTypes } from '../../../../../../../../avocado-icons/src/types/icons.type';
3
+ import { Color } from '../../../../../../../../avocado-icons/src/types/color.enum';
4
+ export interface PillProps {
5
+ /** Optional Icon name */
6
+ icon?: IconTypes;
7
+ /** Overwrite icon original color */
8
+ iconColor?: `${Color}`;
9
+ /** Icon filled state */
10
+ iconFilled?: boolean;
11
+ /** Overwrite pill original color */
12
+ color?: `${Color}`;
13
+ /** Overwrite pill original text color */
14
+ textColor?: `${Color}`;
15
+ /** Controls pill outlined state */
16
+ outlined?: boolean;
17
+ /** content pill */
18
+ children: React.ReactNode | string;
19
+ /** overwrite className */
20
+ className?: string;
21
+ }
22
+ declare const Pill: React.FC<PillProps>;
23
+ export default Pill;
@@ -0,0 +1,25 @@
1
+ declare enum NotificationState {
2
+ Warning = "warning",
3
+ Error = "error",
4
+ Info = "info",
5
+ Success = "success"
6
+ }
7
+ interface CardNotificationProps {
8
+ /** State or variant of the notification */
9
+ state: `${NotificationState}`;
10
+ /** Outlined variant */
11
+ outlined?: boolean;
12
+ /** Overwrite className */
13
+ className?: string;
14
+ /** Title of the notification */
15
+ title: string;
16
+ /** Description of the notification */
17
+ description?: string;
18
+ /** Action of the notification */
19
+ action?: {
20
+ text: string;
21
+ onClick: () => void;
22
+ };
23
+ }
24
+ declare const CardNotification: ({ state, outlined, title, description, action, className, }: CardNotificationProps) => JSX.Element;
25
+ export default CardNotification;
@@ -0,0 +1,17 @@
1
+ export interface IDonutItem {
2
+ name: string;
3
+ percentage: number;
4
+ value: number;
5
+ }
6
+ export interface IDonut {
7
+ /** overwrite className */
8
+ className?: string;
9
+ /** data */
10
+ data: IDonutItem[];
11
+ /** height */
12
+ height?: string;
13
+ /** width */
14
+ width?: string;
15
+ }
16
+ declare const Donut: ({ className, data, height, width, }: IDonut) => JSX.Element;
17
+ export default Donut;
@@ -0,0 +1,9 @@
1
+ import { IDonutItem } from '../Donut';
2
+ export interface IDonutLabels {
3
+ /** overwrite className */
4
+ className?: string;
5
+ /** data */
6
+ data: IDonutItem[];
7
+ }
8
+ declare const DonutLabels: ({ className, data }: IDonutLabels) => JSX.Element;
9
+ export default DonutLabels;
@@ -0,0 +1,13 @@
1
+ import { IDonutItem } from '../Donut';
2
+ export interface IDonutLegend {
3
+ /** overwrite className */
4
+ className?: string;
5
+ /** data */
6
+ data: IDonutItem[];
7
+ /** Overwrite total label */
8
+ totalLabel?: string;
9
+ /** Show or not the total label */
10
+ showTotal?: boolean;
11
+ }
12
+ declare const DonutLegend: ({ className, data, totalLabel, showTotal, }: IDonutLegend) => JSX.Element;
13
+ export default DonutLegend;
@@ -22,4 +22,10 @@ import Text from './components/text/Text';
22
22
  import TextField from './components/text-field/TextField';
23
23
  import Timer from './components/timer/Timer';
24
24
  import Tooltip from './components/tooltip/Tooltip';
25
- export { Box, Breadcrumbs, Button, Card, Checkbox, Divider, Heading, Link, Menu, Pager, Processing, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Tag, Text, TextField, ThemeProvider, Timer, Tooltip, };
25
+ import DataTable from './components/DataTable/DataTable';
26
+ import CardNotification from './components/card-notification/CardNotification';
27
+ import Pill from './components/Pill/Pill';
28
+ import Donut from './components/donut/Donut';
29
+ import DonutLabels from './components/donut/donut-labels/DonutLabels';
30
+ import DonutLegend from './components/donut/donut-legend/DonutLegend';
31
+ export { Box, Breadcrumbs, Button, Card, Checkbox, Divider, Heading, Link, Menu, Pager, Processing, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Tag, Text, TextField, ThemeProvider, Timer, Tooltip, DataTable, CardNotification, Pill, Donut, DonutLabels, DonutLegend, };