@digital-ai/dot-components 1.5.4 → 1.6.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 (34) hide show
  1. package/CHANGE_LOG.md +87 -41
  2. package/dot-components.esm.js +575 -358
  3. package/dot-components.umd.js +618 -402
  4. package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
  5. package/lib/components/auto-complete/AutoComplete.d.ts +3 -1
  6. package/lib/components/breadcrumbs/Breadcrumbs.data.d.ts +2 -0
  7. package/lib/components/drawer/Drawer.d.ts +11 -1
  8. package/lib/components/drawer/DrawerBody.d.ts +9 -0
  9. package/lib/components/drawer/DrawerBody.styles.d.ts +2 -0
  10. package/lib/components/drawer/DrawerFooter.d.ts +6 -0
  11. package/lib/components/drawer/DrawerFooter.styles.d.ts +2 -0
  12. package/lib/components/drawer/DrawerHeader.d.ts +8 -0
  13. package/lib/components/drawer/DrawerHeader.styles.d.ts +2 -0
  14. package/lib/components/helpers.d.ts +1 -0
  15. package/lib/components/index.d.ts +4 -3
  16. package/lib/components/list/NestedList.styles.d.ts +1 -1
  17. package/lib/components/menu/Menu.d.ts +0 -3
  18. package/lib/components/menu/Menu.stories.styles.d.ts +2 -0
  19. package/lib/components/menu/utils/constants.d.ts +3 -0
  20. package/lib/components/menu/utils/helpers.d.ts +8 -1
  21. package/lib/components/table/Table.d.ts +10 -3
  22. package/lib/components/table/Table.stories.data.d.ts +34 -2
  23. package/lib/components/table/TableBody.d.ts +4 -2
  24. package/lib/components/table/TableBody.styles.d.ts +2 -0
  25. package/lib/components/table/TableCell.d.ts +6 -4
  26. package/lib/components/table/TableCell.styles.d.ts +3 -0
  27. package/lib/components/table/TableHeader.d.ts +8 -35
  28. package/lib/components/table/TableHeaderCell.d.ts +38 -0
  29. package/lib/components/table/TableHeaderCell.styles.d.ts +3 -0
  30. package/lib/components/table/TablePagination.d.ts +6 -4
  31. package/lib/components/table/TablePagination.styles.d.ts +5 -2
  32. package/lib/components/table/TableRow.d.ts +6 -2
  33. package/lib/components/table/utils/helpers.d.ts +7 -0
  34. package/package.json +1 -1
@@ -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>;
@@ -49,9 +49,11 @@ export interface AutoCompleteProps extends CommonProps {
49
49
  options?: Array<AutoCompleteOption>;
50
50
  /** Placeholder text always displayed inside the input field */
51
51
  placeholder?: string;
52
+ /** If true, the input will be required and label will display accordingly */
53
+ required?: boolean;
52
54
  /** Determines the padding within the input field 'medium' or 'small' */
53
55
  size?: autoCompleteSize;
54
56
  /** value if this is a controlled component */
55
57
  value?: AutoCompleteValue;
56
58
  }
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;
59
+ 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, required, size, value, }: AutoCompleteProps) => JSX.Element;
@@ -1,2 +1,4 @@
1
1
  import { BreadcrumbItem } from '../breadcrumbs/Breadcrumbs';
2
+ export declare const defaultStorybookItems: BreadcrumbItem[];
2
3
  export declare const mockBreadcrumbItems: BreadcrumbItem[];
4
+ 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,7 +7,7 @@ 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
13
  export type { InputSelectProps } from './input-form-fields/InputSelect';
@@ -20,8 +20,9 @@ export type { RadioGroupProps } from './radio/RadioGroup';
20
20
  export type { BackItemProps, SidebarProps } from './sidebar/Sidebar';
21
21
  export type { SwitchProps } from './switch/Switch';
22
22
  export type { TableRowProps } from './table/Table';
23
- export type { DotColumnHeader } from './table/TableHeader';
24
- export type { Order } from './table/TableBody';
23
+ export type { TextAlignment } from './table/TableCell';
24
+ export type { DotColumnHeader, Order } from './table/TableHeader';
25
+ export type { SortDirection } from './table/TableHeaderCell';
25
26
  export type { TableDataWithPagination } from './table/TableDataWithPagination';
26
27
  export type { RowsPerPageOption } from './table/TablePagination';
27
28
  export type { TabProps } from './tabs/Tabs';
@@ -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 {};
@@ -1,8 +1,9 @@
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
+ export declare const TABLE_TYPOGRAPHY_VARIANT = "body1";
6
7
  export interface TableRowProps extends CommonProps {
7
8
  /** row identifier that will be passed to onRowClick callback */
8
9
  id?: string;
@@ -12,6 +13,8 @@ export interface TableRowProps extends CommonProps {
12
13
  selected?: boolean;
13
14
  }
14
15
  export interface TableProps extends CommonProps {
16
+ /** Typography variant which will be used for table body cell values **/
17
+ bodyTypography?: TypographyVariant;
15
18
  /** The table header columns */
16
19
  columns: Array<DotColumnHeader>;
17
20
  /** Total number of items for paginated table.
@@ -24,6 +27,10 @@ export interface TableProps extends CommonProps {
24
27
  data: Array<TableRowProps>;
25
28
  /** Message that is shown if data is empty */
26
29
  emptyMessage?: string;
30
+ /** Typography variant which will be used for table pagination **/
31
+ footerTypography?: TypographyVariant;
32
+ /** Typography variant which will be used for table header cell values **/
33
+ headerTypography?: TypographyVariant;
27
34
  /** Table is loading */
28
35
  loading?: boolean;
29
36
  /** Maximum height of table container */
@@ -54,4 +61,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
54
61
  * A wrapper component around the Table component from @material-ui. This component can be used for
55
62
  * creating a common structure for tables in the system.
56
63
  */
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;
64
+ export declare const DotTable: ({ ariaLabel, bodyTypography, className, columns, count, data, "data-testid": dataTestId, emptyMessage, footerTypography, headerTypography, loading, maxHeight, 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,7 @@ 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
6
  export interface TableBodyProps extends CommonProps {
7
7
  /** The table column headers */
8
8
  columns: Array<DotColumnHeader>;
@@ -12,9 +12,11 @@ export interface TableBodyProps extends CommonProps {
12
12
  emptyMessage?: string;
13
13
  /** Row click event callback */
14
14
  onRowClick?: (event: MouseEvent, id: string) => void;
15
+ /** Typography variant which will be used for body cell values **/
16
+ typography: TypographyVariant;
15
17
  }
16
18
  /**
17
19
  * A wrapper component around the TableBody component from @material-ui. This component can be used
18
20
  * to determine the functionality of the table.
19
21
  */
20
- export declare const DotTableBody: ({ columns, data, emptyMessage, onRowClick, }: TableBodyProps) => JSX.Element;
22
+ export declare const DotTableBody: ({ columns, data, emptyMessage, 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>;
@@ -1,16 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- export declare type textAlignment = 'center' | 'inherit' | 'justify' | 'left' | 'right';
3
+ import { TypographyVariant } from '../typography/Typography';
4
+ export declare type TextAlignment = 'center' | 'inherit' | 'justify' | 'left' | 'right';
4
5
  export interface CellProps extends CommonProps {
5
- align?: textAlignment;
6
+ align?: TextAlignment;
6
7
  cellKey?: string;
7
8
  colspan?: number;
8
9
  id?: string;
9
10
  noWrap?: boolean;
10
11
  onActionMenuTrigger?: (el: HTMLElement, menuItem: Array<ReactNode>) => void;
11
- value?: any;
12
+ typography: TypographyVariant;
13
+ value?: unknown;
12
14
  }
13
15
  /**
14
16
  * A wrapper component around the TableCell component from @material-ui.
15
17
  */
16
- export declare const DotBodyCell: ({ ariaLabel, align, cellKey, className, colspan, "data-testid": dataTestId, noWrap, value, onActionMenuTrigger, }: CellProps) => JSX.Element;
18
+ export declare const DotBodyCell: ({ ariaLabel, align, cellKey, className, colspan, "data-testid": dataTestId, noWrap, onActionMenuTrigger, typography, value, }: CellProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-td";
3
+ export declare const StyledTableCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -1,54 +1,27 @@
1
- import { MouseEvent, ReactNode } from 'react';
2
- import { Order } from './TableBody';
3
- import { textAlignment } from './TableCell';
1
+ /// <reference types="react" />
2
+ import { TextAlignment } from './TableCell';
3
+ import { TypographyVariant } from '../typography/Typography';
4
4
  export interface DotColumnHeader {
5
- align?: textAlignment;
5
+ align?: TextAlignment;
6
6
  id: string;
7
7
  label?: string;
8
8
  sortable?: boolean;
9
9
  truncate?: boolean;
10
10
  width?: string;
11
11
  }
12
+ export declare type Order = 'asc' | 'desc';
12
13
  export interface HeaderProps {
13
14
  columns: Array<DotColumnHeader>;
15
+ hasActionColumn: boolean;
14
16
  onRequestSort: (property: string) => void;
15
17
  order?: Order;
16
18
  /** The ID of the column that you are sorting by */
17
19
  orderBy?: string;
18
20
  sortable: boolean;
19
- }
20
- export interface HeaderCellProps {
21
- /** Allows to align cell text left, right, center */
22
- align?: textAlignment;
23
- /** Click event function to handle sorting */
24
- createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
25
- /** The Id of table cell */
26
- id?: string;
27
- /** The order of data which is being sorted by */
28
- order?: Order;
29
- /** The ID of the column that you are sorting by */
30
- orderBy?: string;
31
- /** Determines sorting order of ascending or desceding */
32
- sortDirection?: 'desc' | 'asc' | undefined;
33
- /** Determines if sorting is enabled */
34
- sortable?: boolean;
35
- /**Allows table cell text truncated and displays in only one line */
36
- truncate?: boolean;
37
- /** The UID of the cell, if not provided then a randomly generated hash will be created using
38
- * CreateUUID() */
39
- uid: string;
40
- /** The value of header cell*/
41
- value?: ReactNode;
42
- /** The width of the column */
43
- width?: string;
21
+ typography: TypographyVariant;
44
22
  }
45
23
  /**
46
24
  * A wrapper component around the TableHead component from @material-ui. This component can be used
47
25
  * to determine the functionality of the table header.
48
26
  */
49
- export declare const DotHeaderRow: ({ columns, onRequestSort, order, orderBy, sortable, }: HeaderProps) => JSX.Element;
50
- /**
51
- * A wrapper component around the TableCell component from @material-ui. This component should only
52
- * be used inside of DotHeaderRow.
53
- */
54
- export declare const DotHeaderCell: ({ align, createSortHandler, id, order, orderBy, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => JSX.Element;
27
+ export declare const DotHeaderRow: ({ columns, hasActionColumn, onRequestSort, order, orderBy, sortable, typography, }: HeaderProps) => JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { TextAlignment } from './TableCell';
3
+ import { Order } from './TableHeader';
4
+ import { TypographyVariant } from '../typography/Typography';
5
+ export declare type SortDirection = 'asc' | 'desc';
6
+ export interface HeaderCellProps {
7
+ /** Allows cell text alignment: left, right, center */
8
+ align?: TextAlignment;
9
+ /** Click event function to handle sorting */
10
+ createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
11
+ /** The Id of table cell */
12
+ id?: string;
13
+ /** If true, specific alignment will be applicable for this cell */
14
+ isInActionColumn: boolean;
15
+ /** The order of data which is being sorted by */
16
+ order?: Order;
17
+ /** The ID of the column that you are sorting by */
18
+ orderBy?: string;
19
+ /** Determines sorting order of ascending or descending */
20
+ sortDirection?: SortDirection;
21
+ /** Determines if sorting is enabled */
22
+ sortable?: boolean;
23
+ /**Allows table cell text truncated and displays in only one line */
24
+ truncate?: boolean;
25
+ /** Typography variant which will be used for header cell values **/
26
+ typography: TypographyVariant;
27
+ /** The UID of the cell */
28
+ uid: string;
29
+ /** The value of header cell*/
30
+ value?: ReactNode;
31
+ /** The width of the column */
32
+ width?: string;
33
+ }
34
+ /**
35
+ * A wrapper component around the TableCell component from @material-ui. This component should only
36
+ * be used inside DotHeaderRow.
37
+ */
38
+ export declare const DotHeaderCell: ({ align, typography, createSortHandler, id, isInActionColumn, order, orderBy, sortable, sortDirection, uid, value, width, }: HeaderCellProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TableCell } from '@material-ui/core';
2
+ export declare const rootClassName = "dot-th";
3
+ export declare const StyledTableHeaderCell: import("styled-components").StyledComponent<typeof TableCell, any, {}, never>;
@@ -1,7 +1,8 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { CommonProps } from '../CommonProps';
3
- declare const rowsPerPageOptions: readonly [10, 25, 50, 100, 150, 200];
4
- export declare type RowsPerPageOption = typeof rowsPerPageOptions[number];
3
+ import { TypographyVariant } from '../typography/Typography';
4
+ export declare const ROWS_PER_PAGE_OPTIONS: readonly [10, 25, 50, 100, 150, 200];
5
+ export declare type RowsPerPageOption = typeof ROWS_PER_PAGE_OPTIONS[number];
5
6
  export interface TablePaginationProps extends CommonProps {
6
7
  /** Total number of rows (-1 if unknown) */
7
8
  count: number;
@@ -13,7 +14,8 @@ export interface TablePaginationProps extends CommonProps {
13
14
  page?: number;
14
15
  /** The number of rows per page */
15
16
  rowsPerPage?: RowsPerPageOption;
17
+ /** Typography variant which will be used for pagination text */
18
+ typography: TypographyVariant;
16
19
  }
17
20
  /** This component wraps the TablePagination component from @material-ui. */
18
- export declare const DotTablePagination: ({ ariaLabel, className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, }: TablePaginationProps) => JSX.Element;
19
- export {};
21
+ export declare const DotTablePagination: ({ ariaLabel, className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, typography, }: TablePaginationProps) => JSX.Element;
@@ -1,3 +1,6 @@
1
- /// <reference types="react" />
1
+ import { TypographyVariant } from '../typography/Typography';
2
2
  export declare const rootClassName = "dot-table-pagination";
3
- export declare const StyledTablePagination: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").TablePaginationTypeMap<{}, import("react").ComponentType<Pick<import("@material-ui/core").TableCellProps, "align" | "colSpan" | "headers" | "rowSpan" | "scope" | "abbr" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "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" | "height" | "width" | "valign" | "padding" | "size" | "sortDirection" | "variant" | "innerRef" | "ref">>>>;
3
+ export interface StyledTablePaginationProps {
4
+ typography: TypographyVariant;
5
+ }
6
+ export declare const StyledTablePagination: import("styled-components").StyledComponent<"div", any, StyledTablePaginationProps, never>;
@@ -2,9 +2,11 @@ import { MouseEvent, ReactNode } from 'react';
2
2
  import { DotColumnHeader } from './TableHeader';
3
3
  import { CommonProps } from '../CommonProps';
4
4
  import { TableRowProps } from './Table';
5
+ import { TypographyVariant } from '../typography/Typography';
5
6
  export interface EmptyRowProps {
6
7
  cols: number;
7
8
  message?: string;
9
+ typography: TypographyVariant;
8
10
  }
9
11
  export interface RowProps extends CommonProps {
10
12
  /** The table column headers */
@@ -19,10 +21,12 @@ export interface RowProps extends CommonProps {
19
21
  rowKey: string;
20
22
  /** if the row is selected */
21
23
  selected?: boolean;
24
+ /** Typography variant which will be used for body cell values **/
25
+ typography: TypographyVariant;
22
26
  }
23
27
  /**
24
28
  * A wrapper component around the TableRow component from @material-ui. This component can be used
25
29
  * for manipulating data prior to displaying the data inside the table
26
30
  */
27
- export declare const DotTableRow: ({ columns, className, data, onActionMenuTrigger, onClick, rowKey, selected, }: RowProps) => JSX.Element;
28
- export declare const EmptyDotRow: ({ cols, message, }: EmptyRowProps) => JSX.Element;
31
+ export declare const DotTableRow: ({ columns, className, data, onActionMenuTrigger, onClick, rowKey, selected, typography, }: RowProps) => JSX.Element;
32
+ export declare const EmptyDotRow: ({ cols, message, typography, }: EmptyRowProps) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { TypographyVariant } from '../../typography/Typography';
3
+ import { TableRowProps } from '../Table';
4
+ import { DotColumnHeader } from '../TableHeader';
5
+ export declare const getFormattedTableCellValue: (value: unknown, typographyVariant: TypographyVariant) => ReactNode;
6
+ export declare const getContainerMaxHeightStyle: (stickyHeader?: boolean, maxHeight?: string) => string;
7
+ export declare const checkIfActionColumnExist: (columns: DotColumnHeader[], tableData: TableRowProps[]) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "1.5.4",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [