@digital-ai/dot-components 1.5.4 → 1.7.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.
Files changed (55) hide show
  1. package/CHANGE_LOG.md +166 -40
  2. package/dot-components.esm.js +3468 -3209
  3. package/dot-components.umd.js +1290 -529
  4. package/lib/components/accordion/Accordion.styles.d.ts +0 -1
  5. package/lib/components/app-toolbar/AppToolbar.d.ts +4 -2
  6. package/lib/components/app-toolbar/AppToolbar.stories.data.d.ts +15 -0
  7. package/lib/components/app-toolbar/AppToolbar.stories.styles.d.ts +2 -0
  8. package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
  9. package/lib/components/auto-complete/AutoComplete.d.ts +18 -5
  10. package/lib/components/auto-complete/Autocomplete.stories.data.d.ts +5 -0
  11. package/lib/components/breadcrumbs/Breadcrumbs.d.ts +3 -1
  12. package/lib/components/breadcrumbs/Breadcrumbs.data.d.ts +3 -0
  13. package/lib/components/drawer/Drawer.d.ts +11 -1
  14. package/lib/components/drawer/DrawerBody.d.ts +9 -0
  15. package/lib/components/drawer/DrawerBody.styles.d.ts +2 -0
  16. package/lib/components/drawer/DrawerFooter.d.ts +6 -0
  17. package/lib/components/drawer/DrawerFooter.styles.d.ts +2 -0
  18. package/lib/components/drawer/DrawerHeader.d.ts +8 -0
  19. package/lib/components/drawer/DrawerHeader.styles.d.ts +2 -0
  20. package/lib/components/helpers.d.ts +1 -0
  21. package/lib/components/index.d.ts +4 -10
  22. package/lib/components/input-form-fields/Input.stories.data.d.ts +13 -0
  23. package/lib/components/input-form-fields/InputFormFields.propTypes.d.ts +1 -1
  24. package/lib/components/input-form-fields/InputSelect.d.ts +8 -1
  25. package/lib/components/list/List.stories.data.d.ts +1 -1
  26. package/lib/components/list/ListItem.styles.d.ts +1 -1
  27. package/lib/components/list/NestedList.styles.d.ts +1 -1
  28. package/lib/components/menu/Menu.d.ts +0 -3
  29. package/lib/components/menu/Menu.stories.styles.d.ts +2 -0
  30. package/lib/components/menu/utils/constants.d.ts +3 -0
  31. package/lib/components/menu/utils/helpers.d.ts +8 -1
  32. package/lib/components/sidebar/Sidebar.stories.data.d.ts +90 -0
  33. package/lib/components/table/Table.d.ts +13 -3
  34. package/lib/components/table/Table.stories.data.d.ts +34 -2
  35. package/lib/components/table/TableBody.d.ts +7 -2
  36. package/lib/components/table/TableBody.styles.d.ts +2 -0
  37. package/lib/components/table/TableBodyCheckboxCell.d.ts +8 -0
  38. package/lib/components/table/TableBodyCheckboxCell.styles.d.ts +3 -0
  39. package/lib/components/table/TableCell.d.ts +6 -4
  40. package/lib/components/table/TableCell.styles.d.ts +3 -0
  41. package/lib/components/table/TableHeader.d.ts +10 -35
  42. package/lib/components/table/TableHeaderCell.d.ts +38 -0
  43. package/lib/components/table/TableHeaderCell.styles.d.ts +3 -0
  44. package/lib/components/table/TableHeaderCheckboxCell.d.ts +8 -0
  45. package/lib/components/table/TableHeaderCheckboxCell.styles.d.ts +3 -0
  46. package/lib/components/table/TablePagination.d.ts +6 -4
  47. package/lib/components/table/TablePagination.styles.d.ts +5 -2
  48. package/lib/components/table/TableRow.d.ts +9 -2
  49. package/lib/components/table/TableRow.styles.d.ts +2 -0
  50. package/lib/components/table/TableSelectionToolbar.d.ts +7 -0
  51. package/lib/components/table/TableSelectionToolbar.styles.d.ts +3 -0
  52. package/lib/components/table/index.d.ts +10 -0
  53. package/lib/components/table/utils/helpers.d.ts +9 -0
  54. package/lib/components/table/utils/models.d.ts +21 -0
  55. package/package.json +3 -2
@@ -2,5 +2,4 @@ import { Accordion } from '@material-ui/core';
2
2
  export declare const rootClassName = "dot-accordion";
3
3
  export declare const summaryClassName = "dot-accordion-summary";
4
4
  export declare const detailClassName = "dot-accordion-details";
5
- export declare const actionsClassName = "dot-accordion-actions";
6
5
  export declare const StyledAccordion: import("styled-components").StyledComponent<typeof Accordion, any, {}, never>;
@@ -15,7 +15,9 @@ export interface AppToolbarProps extends CommonProps {
15
15
  borderColor?: string;
16
16
  /** JSX Element that is displayed between the logo and right nav */
17
17
  children?: ReactNode;
18
- /** Allow to display custom logo */
18
+ /** If true, main menu will close when item is clicked, if false it will prevent menu closing */
19
+ closeMenuOnItemClick?: boolean;
20
+ /** Allow displaying custom logo */
19
21
  customLogo?: ReactNode;
20
22
  /** If true, the spacing and height will be shorter */
21
23
  dense?: boolean;
@@ -30,4 +32,4 @@ export interface AppToolbarProps extends CommonProps {
30
32
  /** URL of the page the primary logo link will go to */
31
33
  primaryLogoHref?: string;
32
34
  }
33
- export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
35
+ export declare const DotAppToolbar: ({ appName, appLogo, appLogoSmall, ariaLabel, avatar, borderColor, children, className, closeMenuOnItemClick, customLogo, "data-testid": dataTestId, dense, navItems, mainMenu, mainMenuItems, mainMenuWidth, primaryLogoHref, }: AppToolbarProps) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { History } from 'history';
3
+ import { ListItemProps } from '../list';
4
+ export declare const defaultMainMenuItems: Array<ListItemProps>;
5
+ export declare const defaultNavItems: ({
6
+ iconId: string;
7
+ tooltip: string;
8
+ onClick?: undefined;
9
+ } | {
10
+ iconId: string;
11
+ onClick: () => void;
12
+ tooltip: string;
13
+ })[];
14
+ export declare const getMenuNavigationItems: (history: History) => Array<ListItemProps>;
15
+ export declare const MenuNavigationRoutes: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const customMenuCloseClassName = "dot-custom-menu-close-story";
2
+ export declare const StyledWithCustomMenuClose: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const rootClassName = "dot-app-toolbar";
3
3
  export declare const denseClassName = "dense";
4
- export declare const StyledMainMenu: import("styled-components").StyledComponent<({ anchor, ariaLabel, className, children, "data-testid": dataTestId, height, ModalProps, onClose, open, PaperProps, variant, width, }: import("../drawer/Drawer").DrawerProps) => JSX.Element, any, {}, never>;
4
+ export declare const StyledMainMenu: import("styled-components").StyledComponent<({ anchor, ariaLabel, className, children, "data-testid": dataTestId, drawerBodyProps, drawerFooterProps, drawerHeaderProps, height, ModalProps, onClose, open, PaperProps, variant, width, }: import("../drawer/Drawer").DrawerProps) => JSX.Element, any, {}, never>;
5
5
  export declare const StyledAppToolbar: import("styled-components").StyledComponent<"header", any, {}, never>;
@@ -1,12 +1,13 @@
1
- import { ChangeEvent, Ref } from 'react';
1
+ import { ChangeEvent, ReactNode, Ref } from 'react';
2
+ import { AutocompleteCloseReason } from '@material-ui/lab';
2
3
  import { CommonProps } from '../CommonProps';
3
4
  export interface ActionItem {
4
5
  /** The icon to display on the button */
5
6
  iconId: string;
6
7
  /** Event callback */
7
8
  onClick: () => void;
8
- /** Text displayed */
9
- text: string;
9
+ /** Text/Node displayed */
10
+ text: string | ReactNode;
10
11
  }
11
12
  export declare type autoCompleteSize = 'medium' | 'small';
12
13
  export declare type AutoCompleteValue = string | string[] | AutoCompleteOption | AutoCompleteOption[];
@@ -41,17 +42,29 @@ export interface AutoCompleteProps extends CommonProps {
41
42
  inputRef?: Ref<HTMLInputElement>;
42
43
  /** Label displayed above the input field */
43
44
  label?: string;
45
+ /** If true, the component will be in a loading state. */
46
+ loading?: boolean;
44
47
  /** If true, will allow the user to select multiple options */
45
48
  multiple?: boolean;
46
- /** A function that should be executed when the value of the input changes */
49
+ /** A function that should be executed when the autocomplete value changes */
47
50
  onChange?: (event: ChangeEvent<unknown>, value: AutoCompleteValue, reason: string) => void;
51
+ /** Callback fired when the popup requests to be closed. Use in controlled mode. */
52
+ onClose?: (event: ChangeEvent, reason: AutocompleteCloseReason) => void;
53
+ /** A function that should be executed each time when the input value changes */
54
+ onInputChange?: (event: ChangeEvent<unknown>, value: string, reason: string) => void;
55
+ /** Callback fired when the popup requests to be opened. Use in controlled mode. */
56
+ onOpen?: (event: ChangeEvent) => void;
57
+ /** Controls the popup's open state. */
58
+ open?: boolean;
48
59
  /** pre-defined options available to the user */
49
60
  options?: Array<AutoCompleteOption>;
50
61
  /** Placeholder text always displayed inside the input field */
51
62
  placeholder?: string;
63
+ /** If true, the input will be required and label will display accordingly */
64
+ required?: boolean;
52
65
  /** Determines the padding within the input field 'medium' or 'small' */
53
66
  size?: autoCompleteSize;
54
67
  /** value if this is a controlled component */
55
68
  value?: AutoCompleteValue;
56
69
  }
57
- export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, disablePortal, error, freesolo, group, helperText, inputId, inputRef, label, multiple, onChange, options, placeholder, size, value, }: AutoCompleteProps) => JSX.Element;
70
+ export declare const DotAutoComplete: ({ actionItem, ariaLabel, autoFocus, className, "data-testid": dataTestId, defaultValue, disabled, disablePortal, error, freesolo, group, helperText, inputId, inputRef, label, loading, multiple, onChange, onClose, onInputChange, onOpen, open, options, placeholder, required, size, value, }: AutoCompleteProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const movies: {
2
+ group: string;
3
+ title: string;
4
+ error: boolean;
5
+ }[];
@@ -4,6 +4,8 @@ import { LinkUnderline } from '../link/Link';
4
4
  export declare type BreadcrumbItem = {
5
5
  /** Defines a string value that labels the current element **/
6
6
  ariaLabel?: string;
7
+ /** If the number of characters is exceeded then an ellipsis should be used to truncate the text */
8
+ characterLimit?: number;
7
9
  /** link the breadcrumb goes to */
8
10
  href?: string;
9
11
  onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
@@ -19,7 +21,7 @@ export interface BreadcrumbProps extends CommonProps {
19
21
  items: Array<BreadcrumbItem>;
20
22
  /** determines the maximum number of items to display */
21
23
  maxItems?: number;
22
- /** minimum width before `maxItems` will be adjusted */
24
+ /** DEPRECATED, DO NOT USE */
23
25
  minWidth?: number;
24
26
  }
25
27
  export declare const DotBreadcrumbs: ({ className, "data-testid": dataTestId, expansionMenu, items, maxItems, minWidth, }: BreadcrumbProps) => JSX.Element;
@@ -1,2 +1,5 @@
1
1
  import { BreadcrumbItem } from '../breadcrumbs/Breadcrumbs';
2
+ export declare const defaultStorybookItems: BreadcrumbItem[];
3
+ export declare const characterLimitBreadcrumbItems: BreadcrumbItem[];
2
4
  export declare const mockBreadcrumbItems: BreadcrumbItem[];
5
+ export declare const mockLongBreadcrumbItems: BreadcrumbItem[];
@@ -9,6 +9,10 @@ export declare type DrawerModalProps = {
9
9
  export declare type DrawerPaperProps = {
10
10
  style?: CSSProperties;
11
11
  };
12
+ export interface DrawerSection extends CommonProps {
13
+ /** nested child component of drawer section */
14
+ children: ReactNode;
15
+ }
12
16
  export interface DrawerProps extends CommonProps {
13
17
  /** Props applied to the Modal element. */
14
18
  ModalProps?: DrawerModalProps;
@@ -18,6 +22,12 @@ export interface DrawerProps extends CommonProps {
18
22
  anchor?: DrawerAnchor;
19
23
  /** string or JSX element that is displayed inside the drawer */
20
24
  children?: ReactNode;
25
+ /** Props applied to drawer body */
26
+ drawerBodyProps?: DrawerSection;
27
+ /** Props applied to drawer footer */
28
+ drawerFooterProps?: DrawerSection;
29
+ /** Props applied to drawer header */
30
+ drawerHeaderProps?: DrawerSection;
21
31
  /** The height of the drawer when anchor is 'top' or 'bottom' */
22
32
  height?: string;
23
33
  /** Callback fired when the component requests to be closed. */
@@ -29,4 +39,4 @@ export interface DrawerProps extends CommonProps {
29
39
  /** The width of the drawer when anchor is 'left' or 'right' */
30
40
  width?: string;
31
41
  }
32
- export declare const DotDrawer: ({ anchor, ariaLabel, className, children, "data-testid": dataTestId, height, ModalProps, onClose, open, PaperProps, variant, width, }: DrawerProps) => JSX.Element;
42
+ export declare const DotDrawer: ({ anchor, ariaLabel, className, children, "data-testid": dataTestId, drawerBodyProps, drawerFooterProps, drawerHeaderProps, height, ModalProps, onClose, open, PaperProps, variant, width, }: DrawerProps) => JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface DrawerBodyProps extends CommonProps {
4
+ children: ReactNode;
5
+ headerExists: boolean;
6
+ onClose: (event: MouseEvent | KeyboardEvent) => void;
7
+ variant: string;
8
+ }
9
+ export declare const DotDrawerBody: ({ ariaLabel, children, className, "data-testid": dataTestId, headerExists, onClose, variant, }: DrawerBodyProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-drawer-body";
2
+ export declare const StyleDrawerBody: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface DrawerFooterProps extends CommonProps {
4
+ children: ReactNode;
5
+ }
6
+ export declare const DotDrawerFooter: ({ ariaLabel, children, className, "data-testid": dataTestId, }: DrawerFooterProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-drawer-footer";
2
+ export declare const StyleDrawerFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface DrawerHeaderProps extends CommonProps {
4
+ children: ReactNode;
5
+ onClose: (event: MouseEvent | KeyboardEvent) => void;
6
+ variant: string;
7
+ }
8
+ export declare const DotDrawerHeader: ({ ariaLabel, children, className, "data-testid": dataTestId, onClose, variant, }: DrawerHeaderProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-drawer-header";
2
+ export declare const StyleDrawerHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -2,3 +2,4 @@ import { AvatarColor } from './avatar/Avatar';
2
2
  export declare const calculateNumberFromText: (text: string) => number;
3
3
  export declare const getAvatarColorForInputText: (value: string) => AvatarColor;
4
4
  export declare const isString: (str: unknown) => boolean;
5
+ export declare const isNumber: (num: unknown) => boolean;
@@ -7,10 +7,10 @@ export type { CheckboxProps } from './checkbox/Checkbox';
7
7
  export type { CheckboxGroupProps } from './checkbox/CheckboxGroup';
8
8
  export type { SubmitButtonProps } from './dialog/Dialog';
9
9
  export type { DynamicFormProps } from './dynamic-form/DynamicForm';
10
- export type { ControlClickHandler, DynamicFormConfig, DynamicFormControl, DynamicFormOutputData, DynamicFormState, FieldValidation, DynamicFormSectionProps, } from './dynamic-form/models';
10
+ export type { ConditionFunction, ControlClickHandler, DisabledConditionFunction, DisabledControlCondition, DynamicFormConfig, DynamicFormControl, DynamicFormControlProps, DynamicFormControlType, DynamicFormOutputData, DynamicFormSectionProps, DynamicFormState, DynamicFormStateItem, FieldValidation, } from './dynamic-form/models';
11
11
  export type { IconButtonProps } from './button/IconButton';
12
12
  export type { InputTextProps } from './input-form-fields/InputText';
13
- export type { InputSelectProps } from './input-form-fields/InputSelect';
13
+ export type { InputSelectProps, InputSelectOption } from './input-form-fields/InputSelect';
14
14
  export type { LinkUnderline } from './link/Link';
15
15
  export type { ListItemProps } from './list';
16
16
  export type { MenuItemProps } from './menu/Menu';
@@ -19,11 +19,7 @@ export type { RadioButtonProps } from './radio/RadioButton';
19
19
  export type { RadioGroupProps } from './radio/RadioGroup';
20
20
  export type { BackItemProps, SidebarProps } from './sidebar/Sidebar';
21
21
  export type { SwitchProps } from './switch/Switch';
22
- export type { TableRowProps } from './table/Table';
23
- export type { DotColumnHeader } from './table/TableHeader';
24
- export type { Order } from './table/TableBody';
25
- export type { TableDataWithPagination } from './table/TableDataWithPagination';
26
- export type { RowsPerPageOption } from './table/TablePagination';
22
+ export type { DotColumnHeader, MultiSelect, Order, RowSelectionChangeHandler, RowsPerPageOption, TableDataWithPagination, TableRowProps, TableRowSelectChangeHandler, TextAlignment, SortDirection, } from './table';
27
23
  export type { TabProps } from './tabs/Tabs';
28
24
  export type { TypographyVariant } from './typography/Typography';
29
25
  export type { ProgressButtonProps } from './progress-button/ProgressButton';
@@ -76,10 +72,8 @@ export { DotSnackbarContainer, DotSnackbarProvider, useDotSnackbarContext, } fro
76
72
  export { DotSplitButton } from './split-button/SplitButton';
77
73
  export { DotProgressButton } from './progress-button/ProgressButton';
78
74
  export { DotSwitch } from './switch/Switch';
79
- export { DotTable } from './table/Table';
75
+ export { DotHeaderRow, DotTable, DotTablePagination } from './table';
80
76
  export { DotTooltip } from './tooltip/Tooltip';
81
- export { DotHeaderRow } from './table/TableHeader';
82
- export { DotTablePagination } from './table/TablePagination';
83
77
  export { DotTabs } from './tabs/Tabs';
84
78
  export { DotTypography } from './typography/Typography';
85
79
  export { DotFileUpload } from './file-upload/FileUpload';
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare const helperTextArgType: {
3
+ options: string[];
4
+ mapping: (string | JSX.Element)[];
5
+ control: {
6
+ type: string;
7
+ labels: {
8
+ 0: string;
9
+ 1: string;
10
+ 2: string;
11
+ };
12
+ };
13
+ };
@@ -15,7 +15,7 @@ export interface InputProps extends CommonProps {
15
15
  /** If true, the input will take up the full width of its container */
16
16
  fullWidth?: boolean;
17
17
  /** The helper text content. */
18
- helperText?: string;
18
+ helperText?: ReactNode;
19
19
  /**
20
20
  * id to identify the element, also used to create label "for" and helper text id attribute
21
21
  * values while it's optional, it is considered required for accessiblity best practice.
@@ -1,10 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from './InputFormFields.propTypes';
3
+ export declare type OptionType = string | InputSelectOption;
4
+ export interface InputSelectOption {
5
+ /** options that appears in dropdown */
6
+ option: string;
7
+ /** value of input field when option is selected */
8
+ value?: string;
9
+ }
3
10
  export interface InputSelectProps extends InputProps {
4
11
  /** default value of select field */
5
12
  defaultValue?: string;
6
13
  /** options of select dropdown */
7
- options: Array<string>;
14
+ options: Array<OptionType>;
8
15
  /** value of input field */
9
16
  value?: string;
10
17
  }
@@ -1,3 +1,3 @@
1
- import { ListItemProps } from './ListItem';
1
+ import { ListItemProps } from './utils/models';
2
2
  export declare const mockHref = "/?path=/story/components-list--default";
3
3
  export declare const mockListItems: Array<ListItemProps>;
@@ -37,6 +37,6 @@ export declare const StyledListItem: import("@material-ui/core/OverridableCompon
37
37
  button: true;
38
38
  }, "div">>> & Pick<Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof import("react").AnchorHTMLAttributes<HTMLAnchorElement>> & {
39
39
  ref?: import("react").Ref<HTMLAnchorElement>;
40
- }, "slot" | "title" | "type" | "ref" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy">) => JSX.Element) & import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
40
+ }, "slot" | "title" | "type" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy">) => JSX.Element) & import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").ExtendButtonBaseTypeMap<import("@material-ui/core").ListItemTypeMap<{
41
41
  button: true;
42
42
  }, "div">>>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledDotDrawer: import("styled-components").StyledComponent<({ anchor, ariaLabel, className, children, "data-testid": dataTestId, height, ModalProps, onClose, open, PaperProps, variant, width, }: import("../drawer/Drawer").DrawerProps) => JSX.Element, any, {}, never>;
2
+ export declare const StyledDotDrawer: import("styled-components").StyledComponent<({ anchor, ariaLabel, className, children, "data-testid": dataTestId, drawerBodyProps, drawerFooterProps, drawerHeaderProps, height, ModalProps, onClose, open, PaperProps, variant, width, }: import("../drawer/Drawer").DrawerProps) => JSX.Element, any, {}, never>;
@@ -1,8 +1,5 @@
1
1
  import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- export declare const MENU_ITEM_HEIGHT_NORMAL = 33;
4
- export declare const MENU_ITEM_HEIGHT_DENSE = 28;
5
- export declare const DEFAULT_MAX_VISIBLE_ITEMS = 7;
6
3
  export declare type PopperPlacement = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
7
4
  export interface MenuProps extends CommonProps {
8
5
  /** Element that menu is attached to */
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-menu-wrapper";
2
+ export declare const StyledMenuWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,3 @@
1
+ export declare const MENU_ITEM_HEIGHT_NORMAL = 33;
2
+ export declare const MENU_ITEM_HEIGHT_DENSE = 28;
3
+ export declare const DEFAULT_MAX_VISIBLE_ITEMS = 7;
@@ -1,5 +1,12 @@
1
1
  import { MenuItemProps } from '../Menu';
2
+ interface MaxHeightCalculationArgs {
3
+ isDense: boolean;
4
+ maxVisibleItems?: number;
5
+ menuItemHeight?: number | string;
6
+ menuItems: MenuItemProps[];
7
+ }
2
8
  export declare const getDefaultItemHeight: (isDense: boolean) => 28 | 33;
3
9
  export declare const calculateItemHeight: (isDense: boolean, customItemHeight?: number, menuItemHeight?: number | string) => number | string;
4
10
  export declare const getNumberOfVisibleItems: (numberOfItems: number, maxVisibleItems?: number) => number;
5
- export declare const calculateMaxHeight: (isDense: boolean, menuItems: MenuItemProps[], menuItemHeight?: number | string) => number | string;
11
+ export declare const calculateMaxHeight: ({ isDense, maxVisibleItems, menuItems, menuItemHeight, }: MaxHeightCalculationArgs) => number | string;
12
+ export {};
@@ -0,0 +1,90 @@
1
+ import { MouseEvent } from 'react';
2
+ import { ListItemProps } from '../list/utils/models';
3
+ export declare const getNavigationItems: (isSelected: (key: number) => boolean, handleClick: (key: number) => void) => ({
4
+ startIconId: string;
5
+ onClick: import("@storybook/addon-actions").HandlerFunction;
6
+ items: ({
7
+ text: string;
8
+ divider: boolean;
9
+ onClick?: undefined;
10
+ selected?: undefined;
11
+ child?: undefined;
12
+ } | {
13
+ onClick: (_event: MouseEvent) => void;
14
+ selected: boolean;
15
+ text: string;
16
+ divider?: undefined;
17
+ child?: undefined;
18
+ } | {
19
+ child: JSX.Element;
20
+ text?: undefined;
21
+ divider?: undefined;
22
+ onClick?: undefined;
23
+ selected?: undefined;
24
+ })[];
25
+ text: string;
26
+ endIconId?: undefined;
27
+ selected?: undefined;
28
+ divider?: undefined;
29
+ } | {
30
+ items: ({
31
+ text: string;
32
+ divider: boolean;
33
+ startIconId?: undefined;
34
+ onClick?: undefined;
35
+ selected?: undefined;
36
+ } | {
37
+ startIconId: string;
38
+ onClick: (_event: MouseEvent) => void;
39
+ selected: boolean;
40
+ text: string;
41
+ divider?: undefined;
42
+ })[];
43
+ text: string;
44
+ startIconId?: undefined;
45
+ onClick?: undefined;
46
+ endIconId?: undefined;
47
+ selected?: undefined;
48
+ divider?: undefined;
49
+ } | {
50
+ endIconId: string;
51
+ startIconId: string;
52
+ onClick: (_event: MouseEvent) => void;
53
+ selected: boolean;
54
+ text: string;
55
+ items?: undefined;
56
+ divider?: undefined;
57
+ } | {
58
+ text: string;
59
+ divider: boolean;
60
+ startIconId?: undefined;
61
+ onClick?: undefined;
62
+ items?: undefined;
63
+ endIconId?: undefined;
64
+ selected?: undefined;
65
+ } | {
66
+ startIconId: string;
67
+ onClick: (_event: MouseEvent) => void;
68
+ selected: boolean;
69
+ text: string;
70
+ items?: undefined;
71
+ endIconId?: undefined;
72
+ divider?: undefined;
73
+ } | {
74
+ divider: boolean;
75
+ startIconId?: undefined;
76
+ onClick?: undefined;
77
+ items?: undefined;
78
+ text?: undefined;
79
+ endIconId?: undefined;
80
+ selected?: undefined;
81
+ })[];
82
+ export declare const routerNavigationItems: Array<ListItemProps>;
83
+ interface SidebarPageTitleProps {
84
+ description?: string;
85
+ iconId: string;
86
+ title: string;
87
+ }
88
+ export declare const SidebarPageTitle: ({ description, title, iconId, }: SidebarPageTitleProps) => JSX.Element;
89
+ export declare const SidebarStoryRoutes: () => JSX.Element;
90
+ export {};
@@ -1,8 +1,10 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- import { Order } from './TableBody';
4
- import { DotColumnHeader } from './TableHeader';
3
+ import { DotColumnHeader, Order } from './TableHeader';
5
4
  import { RowsPerPageOption } from './TablePagination';
5
+ import { TypographyVariant } from '../typography/Typography';
6
+ import { MultiSelect } from './utils/models';
7
+ export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
6
8
  export interface TableRowProps extends CommonProps {
7
9
  /** row identifier that will be passed to onRowClick callback */
8
10
  id?: string;
@@ -12,6 +14,8 @@ export interface TableRowProps extends CommonProps {
12
14
  selected?: boolean;
13
15
  }
14
16
  export interface TableProps extends CommonProps {
17
+ /** Typography variant which will be used for table body cell values **/
18
+ bodyTypography?: TypographyVariant;
15
19
  /** The table header columns */
16
20
  columns: Array<DotColumnHeader>;
17
21
  /** Total number of items for paginated table.
@@ -24,10 +28,16 @@ export interface TableProps extends CommonProps {
24
28
  data: Array<TableRowProps>;
25
29
  /** Message that is shown if data is empty */
26
30
  emptyMessage?: string;
31
+ /** Typography variant which will be used for table pagination **/
32
+ footerTypography?: TypographyVariant;
33
+ /** Typography variant which will be used for table header cell values **/
34
+ headerTypography?: TypographyVariant;
27
35
  /** Table is loading */
28
36
  loading?: boolean;
29
37
  /** Maximum height of table container */
30
38
  maxHeight?: string;
39
+ /** Optional multi-select checkbox object **/
40
+ multiSelect?: MultiSelect;
31
41
  /** Row click event callback */
32
42
  onRowClick?: (event: MouseEvent, id: string) => void;
33
43
  /** Update data callback if data is managed by consumer */
@@ -54,4 +64,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
54
64
  * A wrapper component around the Table component from @material-ui. This component can be used for
55
65
  * creating a common structure for tables in the system.
56
66
  */
57
- export declare const DotTable: ({ ariaLabel, className, columns, count, data, "data-testid": dataTestId, emptyMessage, loading, maxHeight, order, orderBy, onRowClick, onUpdateData, page, rowsPerPage, stickyHeader, sortable, toolbar, }: TableProps) => JSX.Element;
67
+ export declare const DotTable: ({ ariaLabel, bodyTypography, className, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, loading, maxHeight, multiSelect, order, orderBy, onRowClick, onUpdateData, page, rowsPerPage, stickyHeader, sortable, toolbar, }: TableProps) => JSX.Element;
@@ -1,4 +1,36 @@
1
1
  /// <reference types="react" />
2
+ import { TextAlignment } from './TableCell';
3
+ export declare const actionMenuColumns: ({
4
+ id: string;
5
+ label: string;
6
+ width: string;
7
+ truncate: boolean;
8
+ sortable?: undefined;
9
+ } | {
10
+ id: string;
11
+ label: string;
12
+ width: string;
13
+ truncate?: undefined;
14
+ sortable?: undefined;
15
+ } | {
16
+ id: string;
17
+ label: string;
18
+ sortable: boolean;
19
+ width?: undefined;
20
+ truncate?: undefined;
21
+ })[];
22
+ export declare const dataWithActionMenu: {
23
+ id: string;
24
+ rowData: {
25
+ title: string;
26
+ hometown: string;
27
+ action: {
28
+ children: JSX.Element;
29
+ iconId: string;
30
+ key: string;
31
+ }[];
32
+ };
33
+ }[];
2
34
  export declare const defaultColumns: ({
3
35
  id: string;
4
36
  label: string;
@@ -16,7 +48,7 @@ export declare const defaultColumns: ({
16
48
  } | {
17
49
  id: string;
18
50
  label: string;
19
- align: string;
51
+ align: TextAlignment;
20
52
  width: string;
21
53
  truncate?: undefined;
22
54
  sortable?: undefined;
@@ -77,7 +109,7 @@ export declare const paginatedColumns: ({
77
109
  id: string;
78
110
  label: string;
79
111
  width: string;
80
- align: string;
112
+ align: TextAlignment;
81
113
  truncate?: undefined;
82
114
  })[];
83
115
  export declare const paginatedData: {
@@ -2,7 +2,8 @@ import { MouseEvent } from 'react';
2
2
  import { DotColumnHeader } from './TableHeader';
3
3
  import { TableRowProps } from './Table';
4
4
  import { CommonProps } from '../CommonProps';
5
- export declare type Order = 'asc' | 'desc';
5
+ import { TypographyVariant } from '../typography/Typography';
6
+ import { MultiSelectBody } from './utils/models';
6
7
  export interface TableBodyProps extends CommonProps {
7
8
  /** The table column headers */
8
9
  columns: Array<DotColumnHeader>;
@@ -10,11 +11,15 @@ export interface TableBodyProps extends CommonProps {
10
11
  data: Array<TableRowProps>;
11
12
  /** Message to show if no data */
12
13
  emptyMessage?: string;
14
+ /** Optional multi-select checkbox body object **/
15
+ multiSelectBody?: MultiSelectBody;
13
16
  /** Row click event callback */
14
17
  onRowClick?: (event: MouseEvent, id: string) => void;
18
+ /** Typography variant which will be used for body cell values **/
19
+ typography: TypographyVariant;
15
20
  }
16
21
  /**
17
22
  * A wrapper component around the TableBody component from @material-ui. This component can be used
18
23
  * to determine the functionality of the table.
19
24
  */
20
- export declare const DotTableBody: ({ columns, data, emptyMessage, onRowClick, }: TableBodyProps) => JSX.Element;
25
+ export declare const DotTableBody: ({ columns, data, emptyMessage, multiSelectBody, onRowClick, typography, }: TableBodyProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const rootClassName = "dot-tbody";
2
+ export declare const StyledTableBody: import("styled-components").StyledComponent<import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TableBodyTypeMap<{}, "tbody">>, any, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { ReactElement } from 'react';
2
+ import { CommonProps } from '../CommonProps';
3
+ export interface DotBodyCheckboxCellProps extends CommonProps {
4
+ isChecked: boolean;
5
+ onChange: (isChecked: boolean, rowId: string) => void;
6
+ rowId: string;
7
+ }
8
+ export declare const DotBodyCheckboxCell: ({ ariaLabel, className, "data-testid": dataTestId, isChecked, onChange, rowId, }: DotBodyCheckboxCellProps) => ReactElement;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-td-checkbox";
3
+ export declare const StyledTableBodyCheckboxCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;