@digital-ai/dot-components 1.1.0 → 1.1.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/dot-components.esm.js +643 -2726
- package/dot-components.umd.js +918 -3003
- package/lib/components/auto-complete/AutoComplete.d.ts +11 -1
- package/lib/components/badge/Badge.d.ts +14 -0
- package/lib/components/badge/Badge.styles.d.ts +3 -0
- package/lib/components/button/Button.d.ts +2 -2
- package/lib/components/icon/Icon.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/menu/Menu.d.ts +4 -1
- package/lib/components/split-button/SplitButton.styles.d.ts +1 -1
- package/lib/components/table/Table.stories.data.d.ts +17 -5
- package/lib/components/table/Table.styles.d.ts +2 -0
- package/lib/components/table/TableCell.d.ts +2 -1
- package/lib/components/table/TableRow.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ChangeEvent, Ref } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
+
export interface ActionItem {
|
|
4
|
+
/** The icon to display on the button */
|
|
5
|
+
iconId: string;
|
|
6
|
+
/** Event callback */
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
/** Text displayed */
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
3
11
|
export declare type autoCompleteSize = 'medium' | 'small';
|
|
4
12
|
export declare type AutoCompleteValue = string | string[] | AutoCompleteOption | AutoCompleteOption[];
|
|
5
13
|
export interface AutoCompleteOption {
|
|
@@ -9,6 +17,8 @@ export interface AutoCompleteOption {
|
|
|
9
17
|
}
|
|
10
18
|
export declare const parseAutoCompleteValue: (value: AutoCompleteValue) => string;
|
|
11
19
|
export interface AutoCompleteProps extends CommonProps {
|
|
20
|
+
/** Action button as the last element on the menu **/
|
|
21
|
+
actionItem?: ActionItem;
|
|
12
22
|
/** This prop helps users to fill forms faster */
|
|
13
23
|
autoFocus?: boolean;
|
|
14
24
|
/** default option that is selected */
|
|
@@ -42,4 +52,4 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
42
52
|
/** value if this is a controlled component */
|
|
43
53
|
value?: AutoCompleteValue;
|
|
44
54
|
}
|
|
45
|
-
export declare const DotAutoComplete: ({ ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, error, freesolo, group, helperText, inputId, inputRef, label, multiple, onChange, options, placeholder, size, value, }: AutoCompleteProps) => JSX.Element;
|
|
55
|
+
export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, error, freesolo, group, helperText, inputId, inputRef, label, multiple, onChange, options, placeholder, size, value, }: AutoCompleteProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '../CommonProps';
|
|
3
|
+
export declare type BadgeOverlap = 'circle' | 'rectangle' | 'circular' | 'rectangular';
|
|
4
|
+
export interface BadgeProps extends CommonProps {
|
|
5
|
+
/** custom color code for the badge */
|
|
6
|
+
badgeColor?: string;
|
|
7
|
+
/** component which will be wrapped with the badge */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** if true, the badge will be completely hidden*/
|
|
10
|
+
invisible?: boolean;
|
|
11
|
+
/** outline shape of the child component */
|
|
12
|
+
overlap?: BadgeOverlap;
|
|
13
|
+
}
|
|
14
|
+
export declare const DotBadge: ({ ariaLabel, badgeColor, children, className, "data-testid": dataTestId, invisible, overlap, }: BadgeProps) => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BadgeProps } from './Badge';
|
|
2
|
+
export declare const rootClassName = "dot-badge";
|
|
3
|
+
export declare const StyledBadge: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").BadgeTypeMap<{}, "div">>, any, BadgeProps, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseButtonProps } from '../BaseButtonProps';
|
|
3
3
|
export interface ButtonProps extends BaseButtonProps {
|
|
4
4
|
/** The text for the button. Button text should be in sentence case. */
|
|
@@ -9,4 +9,4 @@ export interface ButtonProps extends BaseButtonProps {
|
|
|
9
9
|
startIcon?: ReactNode;
|
|
10
10
|
}
|
|
11
11
|
/** This component wraps the Button component from @material-ui. */
|
|
12
|
-
export declare const DotButton:
|
|
12
|
+
export declare const DotButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
|
-
export declare type IconFontSize = 'inherit' | 'default' | 'small';
|
|
3
|
+
export declare type IconFontSize = 'inherit' | 'default' | 'small' | 'medium';
|
|
4
4
|
export interface IconProps extends CommonProps {
|
|
5
5
|
/** Determines the size of the icon and spacing around it */
|
|
6
6
|
fontSize?: IconFontSize;
|
|
@@ -5,6 +5,7 @@ export { DotAppToolbar, AppToolbarProps } from './app-toolbar/AppToolbar';
|
|
|
5
5
|
export { AutoCompleteOption, DotAutoComplete, AutoCompleteValue, parseAutoCompleteValue, } from './auto-complete/AutoComplete';
|
|
6
6
|
export { AvatarProps, DotAvatar } from './avatar/Avatar';
|
|
7
7
|
export { DotAvatarGroup } from './avatar-group/AvatarGroup';
|
|
8
|
+
export { DotBadge } from './badge/Badge';
|
|
8
9
|
export { BreadcrumbItem, DotBreadcrumbs } from './breadcrumbs/Breadcrumbs';
|
|
9
10
|
export { DotButton } from './button/Button';
|
|
10
11
|
export { DotButtonToggle } from './button-toggle/ButtonToggle';
|
|
@@ -4,10 +4,13 @@ export declare type PopperPlacement = 'bottom-end' | 'bottom-start' | 'bottom' |
|
|
|
4
4
|
export interface MenuProps extends CommonProps {
|
|
5
5
|
/** Element that menu is attached to */
|
|
6
6
|
anchorEl?: Element;
|
|
7
|
+
/** If true, compact vertical padding designed for keyboard and mouse input is used for the list and list items. **/
|
|
8
|
+
dense?: boolean;
|
|
7
9
|
/** Disable the portal behavior. If true, children stay within parent DOM hierarchy. */
|
|
8
10
|
disablePortal?: boolean;
|
|
9
11
|
/** Unique ID that ties a particular menu to a specific element */
|
|
10
12
|
id: string;
|
|
13
|
+
maxVisibleItems?: number;
|
|
11
14
|
/** Array of items to be displayed inside the menu */
|
|
12
15
|
menuItems: Array<MenuItemProps>;
|
|
13
16
|
/** Determines the placement of the menu */
|
|
@@ -29,4 +32,4 @@ export interface MenuItemProps {
|
|
|
29
32
|
/** A key that can be used to determine which item was clicked */
|
|
30
33
|
key?: string;
|
|
31
34
|
}
|
|
32
|
-
export declare const DotMenu: ({ anchorEl, ariaLabel, className, "data-testid": dataTestId, disablePortal, id, menuItems, menuPlacement, onLeave, onSelect, open, }: MenuProps) => JSX.Element;
|
|
35
|
+
export declare const DotMenu: ({ anchorEl, ariaLabel, className, "data-testid": dataTestId, dense, disablePortal, id, maxVisibleItems, menuItems, menuPlacement, onLeave, onSelect, open, }: MenuProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const rootClassName = "dot-split-button-group";
|
|
3
3
|
export declare const StyledSplitButtonGroup: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ButtonGroupTypeMap<{}, "div">>, any, {}, never>;
|
|
4
|
-
export declare const StyledMenu: import("styled-components").StyledComponent<({ anchorEl, ariaLabel, className, "data-testid": dataTestId, disablePortal, id, menuItems, menuPlacement, onLeave, onSelect, open, }: import("../menu/Menu").MenuProps) => JSX.Element, any, {}, never>;
|
|
4
|
+
export declare const StyledMenu: import("styled-components").StyledComponent<({ anchorEl, ariaLabel, className, "data-testid": dataTestId, dense, disablePortal, id, maxVisibleItems, menuItems, menuPlacement, onLeave, onSelect, open, }: import("../menu/Menu").MenuProps) => JSX.Element, any, {}, never>;
|
|
@@ -22,11 +22,11 @@ export declare const defaultColumns: ({
|
|
|
22
22
|
sortable?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
id: string;
|
|
25
|
+
label: string;
|
|
25
26
|
sortable: boolean;
|
|
26
|
-
width
|
|
27
|
-
align: string;
|
|
28
|
-
label?: undefined;
|
|
27
|
+
width?: undefined;
|
|
29
28
|
truncate?: undefined;
|
|
29
|
+
align?: undefined;
|
|
30
30
|
})[];
|
|
31
31
|
export declare const defaultData: ({
|
|
32
32
|
id: string;
|
|
@@ -35,7 +35,13 @@ export declare const defaultData: ({
|
|
|
35
35
|
title: string;
|
|
36
36
|
hometown: string;
|
|
37
37
|
fans: number;
|
|
38
|
-
delete:
|
|
38
|
+
delete: {
|
|
39
|
+
actions: {
|
|
40
|
+
children: JSX.Element;
|
|
41
|
+
key: string;
|
|
42
|
+
onclick: () => void;
|
|
43
|
+
}[];
|
|
44
|
+
}[];
|
|
39
45
|
};
|
|
40
46
|
} | {
|
|
41
47
|
id: string;
|
|
@@ -43,7 +49,13 @@ export declare const defaultData: ({
|
|
|
43
49
|
title: string;
|
|
44
50
|
hometown: string;
|
|
45
51
|
fans: number;
|
|
46
|
-
delete:
|
|
52
|
+
delete: {
|
|
53
|
+
actions: {
|
|
54
|
+
children: JSX.Element;
|
|
55
|
+
key: string;
|
|
56
|
+
onclick: () => void;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
47
59
|
};
|
|
48
60
|
selected?: undefined;
|
|
49
61
|
})[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Paper } from '@material-ui/core';
|
|
2
3
|
export declare const rootClassName = "dot-table";
|
|
3
4
|
export declare const StyledPaper: import("styled-components").StyledComponent<typeof Paper, any, {}, never>;
|
|
4
5
|
export declare const StyledTableContainer: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TableContainerTypeMap<{}, "div">>, any, {}, never>;
|
|
6
|
+
export declare const StyledMenu: import("styled-components").StyledComponent<({ anchorEl, ariaLabel, className, "data-testid": dataTestId, dense, disablePortal, id, maxVisibleItems, menuItems, menuPlacement, onLeave, onSelect, open, }: import("../menu/Menu").MenuProps) => JSX.Element, any, {}, never>;
|
|
@@ -7,8 +7,9 @@ export interface CellProps extends CommonProps {
|
|
|
7
7
|
id?: string;
|
|
8
8
|
noWrap?: boolean;
|
|
9
9
|
value?: any;
|
|
10
|
+
onActionMenuTrigger?: (el: HTMLElement, menuItem: []) => void;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* A wrapper component around the TableCell component from @material-ui.
|
|
13
14
|
*/
|
|
14
|
-
export declare const DotBodyCell: ({ ariaLabel, align, className, colspan, "data-testid": dataTestId,
|
|
15
|
+
export declare const DotBodyCell: ({ ariaLabel, align, className, colspan, "data-testid": dataTestId, noWrap, value, onActionMenuTrigger, }: CellProps) => JSX.Element;
|
|
@@ -11,6 +11,8 @@ export interface RowProps extends CommonProps {
|
|
|
11
11
|
columns: Array<DotColumnHeader>;
|
|
12
12
|
/** The table body row data */
|
|
13
13
|
data: TableRowProps;
|
|
14
|
+
/** Event callback of action button of menu */
|
|
15
|
+
onActionMenuTrigger: (el: HTMLElement, menuItem: []) => void;
|
|
14
16
|
/** Event callback */
|
|
15
17
|
onClick?: (event: MouseEvent, id: string) => void;
|
|
16
18
|
/** if the row is selected */
|
|
@@ -20,5 +22,5 @@ export interface RowProps extends CommonProps {
|
|
|
20
22
|
* A wrapper component around the TableRow component from @material-ui. This component can be used
|
|
21
23
|
* for manipulating data prior to displaying the data inside the table
|
|
22
24
|
*/
|
|
23
|
-
export declare const DotTableRow: ({ columns, data, onClick, selected }: RowProps) => JSX.Element;
|
|
25
|
+
export declare const DotTableRow: ({ columns, data, onActionMenuTrigger, onClick, selected, }: RowProps) => JSX.Element;
|
|
24
26
|
export declare const EmptyDotRow: ({ cols, message, }: EmptyRowProps) => JSX.Element;
|