@digital-ai/dot-components 1.9.0 → 1.11.0
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/CHANGE_LOG.md +76 -0
- package/fonts/dot.woff +0 -0
- package/fonts/selection.json +244 -221
- package/index.esm.js +90 -28
- package/index.umd.js +120 -54
- package/lib/components/auto-complete/AutoComplete.d.ts +16 -4
- package/lib/components/auto-complete/AutoComplete.stories.styles.d.ts +4 -0
- package/lib/components/auto-complete/Autocomplete.stories.data.d.ts +19 -1
- package/lib/components/auto-complete/index.d.ts +3 -0
- package/lib/components/badge/Badge.d.ts +7 -1
- package/lib/components/badge/index.d.ts +1 -0
- package/lib/components/index.d.ts +4 -4
- package/lib/components/list/List.d.ts +1 -1
- package/lib/components/list/List.stories.data.d.ts +1 -0
- package/lib/components/list/utils/models.d.ts +4 -0
- package/lib/components/menu/Menu.d.ts +2 -0
- package/lib/components/menu/Menu.stories.data.d.ts +5 -1
- package/lib/components/menu/Menu.stories.styles.d.ts +2 -0
- package/lib/components/menu/Menu.styles.d.ts +6 -1
- package/lib/components/sidebar/Sidebar.stories.data.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEvent, ReactNode, Ref } from 'react';
|
|
2
|
-
import { AutocompleteCloseReason } from '@material-ui/lab';
|
|
2
|
+
import { AutocompleteCloseReason, AutocompleteGetTagProps, AutocompleteRenderOptionState } from '@material-ui/lab';
|
|
3
3
|
import { CommonProps } from '../CommonProps';
|
|
4
4
|
export declare const DEFAULT_ACTION_ITEM_TEXT = "Add new item";
|
|
5
5
|
export interface ActionItem {
|
|
@@ -19,7 +19,11 @@ export interface AutoCompleteOption {
|
|
|
19
19
|
group?: string;
|
|
20
20
|
title: string;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* AutoCompleteOption can be extended for the use case when customizing
|
|
24
|
+
* autocomplete option rendering by using `renderOption` prop.
|
|
25
|
+
*/
|
|
26
|
+
export interface AutoCompleteProps<T extends AutoCompleteOption = AutoCompleteOption> extends CommonProps {
|
|
23
27
|
/** Action button as the last element on the menu **/
|
|
24
28
|
actionItem?: ActionItem;
|
|
25
29
|
/** This prop helps users to fill forms faster */
|
|
@@ -34,6 +38,8 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
34
38
|
disabled?: boolean;
|
|
35
39
|
/** If true, the input will be displayed in an error state. */
|
|
36
40
|
error?: boolean;
|
|
41
|
+
/** If `true`, hide the selected options from the list box. */
|
|
42
|
+
filterSelectedOptions?: boolean;
|
|
37
43
|
/** If true, any arbitrary value can be typed in the field */
|
|
38
44
|
freesolo?: boolean;
|
|
39
45
|
/** If true, options will be grouped by category */
|
|
@@ -48,6 +54,8 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
48
54
|
label?: string;
|
|
49
55
|
/** If true, the component will be in a loading state. */
|
|
50
56
|
loading?: boolean;
|
|
57
|
+
/** Maximum height of Popper's <ul> element */
|
|
58
|
+
maxHeight?: number | string;
|
|
51
59
|
/** If true, will allow the user to select multiple options */
|
|
52
60
|
multiple?: boolean;
|
|
53
61
|
/** A function that should be executed when the autocomplete value changes */
|
|
@@ -61,9 +69,13 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
61
69
|
/** Controls the popup's open state. */
|
|
62
70
|
open?: boolean;
|
|
63
71
|
/** pre-defined options available to the user */
|
|
64
|
-
options?: Array<
|
|
72
|
+
options?: Array<T>;
|
|
65
73
|
/** Placeholder text always displayed inside the input field */
|
|
66
74
|
placeholder?: string;
|
|
75
|
+
/** Render the option, use `getOptionLabel` by default. */
|
|
76
|
+
renderOption?: (option: T, state: AutocompleteRenderOptionState) => ReactNode;
|
|
77
|
+
/** Render the selected value. */
|
|
78
|
+
renderTags?: (value: T[], getTagProps: AutocompleteGetTagProps) => ReactNode;
|
|
67
79
|
/** If true, the input will be required and label will display accordingly */
|
|
68
80
|
required?: boolean;
|
|
69
81
|
/** Determines the padding within the input field 'medium' or 'small' */
|
|
@@ -71,4 +83,4 @@ export interface AutoCompleteProps extends CommonProps {
|
|
|
71
83
|
/** value if this is a controlled component */
|
|
72
84
|
value?: AutoCompleteValue;
|
|
73
85
|
}
|
|
74
|
-
export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, error, freesolo, group, helperText, inputId, inputRef, label, loading, multiple, onChange, onClose, onInputChange, onOpen, open, options, placeholder, required, size, value, }: AutoCompleteProps) => JSX.Element;
|
|
86
|
+
export declare const DotAutoComplete: <T extends AutoCompleteOption>({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, dense, disabled, disablePortal, error, filterSelectedOptions, freesolo, group, helperText, inputId, inputRef, label, loading, maxHeight, multiple, onChange, onClose, onInputChange, onOpen, open, options, placeholder, renderOption, renderTags, required, size, value, }: AutoCompleteProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const selectedAutocompleteClassName = "dot-selected-autocomplete-items";
|
|
2
|
+
export declare const autocompleteWithoutChipsClassName = "dot-autocomplete-without-chips";
|
|
3
|
+
export declare const StyledSelectedAutocompleteItems: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledAutocompleteWithoutChips: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { ActionItem, AutoCompleteOption, AutoCompleteProps, AutoCompleteValue } from './AutoComplete';
|
|
3
|
+
import { CommonProps } from '../CommonProps';
|
|
2
4
|
export declare const movies: {
|
|
3
5
|
group: string;
|
|
4
6
|
title: string;
|
|
@@ -19,3 +21,19 @@ export declare const actionItemArgType: {
|
|
|
19
21
|
};
|
|
20
22
|
defaultValue: string;
|
|
21
23
|
};
|
|
24
|
+
export interface AutoCompleteWithRenderOption extends AutoCompleteOption {
|
|
25
|
+
imageUrl: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const fullNameOptions: AutoCompleteWithRenderOption[];
|
|
28
|
+
export interface SelectedAutocompleteItemsProps extends CommonProps {
|
|
29
|
+
onItemRemove: (optionTitle: string) => void;
|
|
30
|
+
selectedOptions: AutoCompleteOption[];
|
|
31
|
+
}
|
|
32
|
+
export declare const SelectedAutocompleteItems: ({ className, onItemRemove, selectedOptions, }: SelectedAutocompleteItemsProps) => JSX.Element;
|
|
33
|
+
export interface AutocompleteWithoutChipsProps extends CommonProps {
|
|
34
|
+
onChange: (event: ChangeEvent, currentlySelectedOptions: AutoCompleteValue) => void;
|
|
35
|
+
onItemRemove: (optionTitle: string) => void;
|
|
36
|
+
selectedOptions: AutoCompleteOption[];
|
|
37
|
+
storyArgs: AutoCompleteProps;
|
|
38
|
+
}
|
|
39
|
+
export declare const AutocompleteWithoutChips: ({ className, onChange, onItemRemove, selectedOptions, storyArgs, }: AutocompleteWithoutChipsProps) => JSX.Element;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CommonProps } from '../CommonProps';
|
|
3
3
|
export declare type BadgeOverlap = 'circular' | 'rectangular';
|
|
4
|
+
export declare type BadgeVariant = 'standard' | 'dot';
|
|
4
5
|
export interface BadgeProps extends CommonProps {
|
|
5
6
|
/** custom color code for the badge */
|
|
6
7
|
badgeColor?: string;
|
|
8
|
+
/** the number rendered within the badge */
|
|
9
|
+
badgeContent?: number;
|
|
7
10
|
/** component which will be wrapped with the badge */
|
|
8
11
|
children: ReactNode;
|
|
9
12
|
/** if true, the badge will be completely hidden*/
|
|
10
13
|
invisible?: boolean;
|
|
14
|
+
/** max count to show */
|
|
15
|
+
max?: number;
|
|
11
16
|
/** outline shape of the child component */
|
|
12
17
|
overlap?: BadgeOverlap;
|
|
18
|
+
variant?: BadgeVariant;
|
|
13
19
|
}
|
|
14
|
-
export declare const DotBadge: ({ ariaLabel, badgeColor, children, className, "data-testid": dataTestId, invisible, overlap, }: BadgeProps) => JSX.Element;
|
|
20
|
+
export declare const DotBadge: ({ ariaLabel, badgeColor, badgeContent, children, className, "data-testid": dataTestId, invisible, max, overlap, variant, }: BadgeProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Badge';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { AppToolbarProps } from './app-toolbar/AppToolbar';
|
|
2
|
-
export type { AutoCompleteOption, AutoCompleteProps, AutoCompleteValue, } from './auto-complete
|
|
2
|
+
export type { AutoCompleteOption, AutoCompleteProps, AutoCompleteValue, AutocompleteRenderOptionState, } from './auto-complete';
|
|
3
3
|
export type { AvatarProps } from './avatar/Avatar';
|
|
4
4
|
export type { BreadcrumbItem } from './breadcrumbs/Breadcrumbs';
|
|
5
5
|
export type { ButtonProps } from './button/Button';
|
|
@@ -26,15 +26,16 @@ export type { TypographyVariant } from './typography/Typography';
|
|
|
26
26
|
export type { ProgressButtonProps } from './progress-button/ProgressButton';
|
|
27
27
|
export type { PopperPlacementType } from './popper';
|
|
28
28
|
export type { DividerOrientation, DividerProps, DividerVariant, } from './divider';
|
|
29
|
+
export type { BadgeProps, BadgeOverlap, BadgeVariant } from './badge';
|
|
29
30
|
export { DotAccordion } from './accordion/Accordion';
|
|
30
31
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
31
32
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
32
33
|
export { DotAppLogo } from './app-logo/AppLogo';
|
|
33
34
|
export { DotAppToolbar } from './app-toolbar/AppToolbar';
|
|
34
|
-
export { DotAutoComplete } from './auto-complete
|
|
35
|
+
export { DotAutoComplete, parseAutoCompleteValue } from './auto-complete';
|
|
35
36
|
export { DotAvatar } from './avatar/Avatar';
|
|
36
37
|
export { DotAvatarGroup } from './avatar-group/AvatarGroup';
|
|
37
|
-
export { DotBadge } from './badge
|
|
38
|
+
export { DotBadge } from './badge';
|
|
38
39
|
export { DotBreadcrumbs } from './breadcrumbs/Breadcrumbs';
|
|
39
40
|
export { DotButton } from './button/Button';
|
|
40
41
|
export { DotButtonToggle } from './button-toggle';
|
|
@@ -80,6 +81,5 @@ export { DotTooltip } from './tooltip/Tooltip';
|
|
|
80
81
|
export { DotTabs } from './tabs/Tabs';
|
|
81
82
|
export { DotTypography } from './typography/Typography';
|
|
82
83
|
export { DotFileUpload } from './file-upload/FileUpload';
|
|
83
|
-
export { parseAutoCompleteValue } from './auto-complete/utils/helpers';
|
|
84
84
|
export { DotDivider } from './divider';
|
|
85
85
|
export { DotPopper } from './popper';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ListItemProps, ListProps, NestedListProps } from './utils/models';
|
|
3
3
|
export declare const DotList: ({ ariaLabel, children, className, component, "data-testid": dataTestId, dense, disablePadding, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, width, }: ListProps) => JSX.Element;
|
|
4
|
-
export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIconId, target, text, title, tooltip, }: ListItemProps) => JSX.Element;
|
|
4
|
+
export declare const DotListItem: ({ ariaLabel, className, component, "data-testid": dataTestId, divider, endIcon, endIconId, href, isOpened, onClick, onMenuLeave, index, items, menuPlacement, nestedDrawerLeftSpacing, nestedListType, primaryText, secondaryText, selected, startIcon, startIconId, target, text, title, tooltip, }: ListItemProps) => JSX.Element;
|
|
5
5
|
export declare const NestedList: ({ ariaLabel, anchorEl, items, menuPlacement, nestedDrawerLeftSpacing, onMenuLeave, open, parentItemIndex, type, }: NestedListProps) => JSX.Element;
|
|
@@ -31,6 +31,8 @@ export interface ListItemProps extends CommonProps {
|
|
|
31
31
|
/** If true, a 1px light border is added to the bottom of the list item. */
|
|
32
32
|
divider?: boolean;
|
|
33
33
|
/** If provided, the icon ID which is displayed at the end of the list item */
|
|
34
|
+
endIcon?: ReactNode;
|
|
35
|
+
/** DEPRECATED, DO NOT USE */
|
|
34
36
|
endIconId?: string;
|
|
35
37
|
/** If provided, the list item will be rendered as a link */
|
|
36
38
|
href?: string;
|
|
@@ -56,6 +58,8 @@ export interface ListItemProps extends CommonProps {
|
|
|
56
58
|
/** Selected list item */
|
|
57
59
|
selected?: boolean;
|
|
58
60
|
/** If provided, the icon ID which is displayed on the front of the list item */
|
|
61
|
+
startIcon?: ReactNode;
|
|
62
|
+
/** DEPRECATED, DO NOT USE */
|
|
59
63
|
startIconId?: string;
|
|
60
64
|
/** where to open the link */
|
|
61
65
|
target?: LinkTarget;
|
|
@@ -36,6 +36,8 @@ export interface MenuItemProps {
|
|
|
36
36
|
children?: ReactNode;
|
|
37
37
|
/** Space delimited CSS classes to be attributed to the menu item */
|
|
38
38
|
classes?: string;
|
|
39
|
+
/** If true, the item will be displayed in a disabled state. */
|
|
40
|
+
disabled?: boolean;
|
|
39
41
|
/** If true, a 1px light border is added to the bottom of the menu item. */
|
|
40
42
|
divider?: boolean;
|
|
41
43
|
/** Used to set custom item height (in pixels). This value has priority over "menuItemHeight" prop. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
2
|
import { MenuItemProps } from '../menu/Menu';
|
|
3
3
|
export declare const defaultMenuItems: ({
|
|
4
4
|
children: JSX.Element;
|
|
@@ -22,3 +22,7 @@ export declare const tableMenuItems: ({
|
|
|
22
22
|
key: string;
|
|
23
23
|
})[];
|
|
24
24
|
export declare const customHeightMenuItems: MenuItemProps[];
|
|
25
|
+
export interface MenuTableArgs {
|
|
26
|
+
onIconButtonClick: (event: MouseEvent<HTMLButtonElement>, menuId: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const MenuTable: ({ onIconButtonClick }: MenuTableArgs) => JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const rootClassName = "dot-menu-wrapper";
|
|
2
2
|
export declare const multiLevelClassName = "dot-multi-level-menu";
|
|
3
|
+
export declare const menuTableClassName = "dot-menu-table";
|
|
3
4
|
export declare const StyledMenuWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const StyledMultiLevelMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const StyledMenuTable: import("styled-components").StyledComponent<"table", any, {}, never>;
|
|
@@ -2,4 +2,9 @@ import { Popper } from '@material-ui/core';
|
|
|
2
2
|
export declare const flyoutMenuClassName = "dot-flyout-menu";
|
|
3
3
|
export declare const rootClassName = "dot-menu";
|
|
4
4
|
export declare const popperClassName = "dot-popper";
|
|
5
|
-
|
|
5
|
+
interface StyledPopperArgs {
|
|
6
|
+
$maxHeight?: number | string;
|
|
7
|
+
}
|
|
8
|
+
export declare const getListMaxHeight: (maxHeight: string | number) => string;
|
|
9
|
+
export declare const StyledPopper: import("styled-components").StyledComponent<typeof Popper, any, StyledPopperArgs, never>;
|
|
10
|
+
export {};
|
|
@@ -41,8 +41,8 @@ export declare const getNavigationItems: (isSelected: (key: number) => boolean,
|
|
|
41
41
|
text: string;
|
|
42
42
|
divider?: undefined;
|
|
43
43
|
})[];
|
|
44
|
+
startIconId: string;
|
|
44
45
|
text: string;
|
|
45
|
-
startIconId?: undefined;
|
|
46
46
|
onClick?: undefined;
|
|
47
47
|
endIconId?: undefined;
|
|
48
48
|
selected?: undefined;
|