@digital-ai/dot-components 1.0.7 → 1.0.11

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 (58) hide show
  1. package/README.md +7 -5
  2. package/dot-components.esm.js +6195 -3776
  3. package/dot-components.umd.js +6218 -3673
  4. package/lib/components/CommonProps.d.ts +2 -0
  5. package/lib/components/accordion/Accordion.d.ts +1 -1
  6. package/lib/components/action-toolbar/ActionToolbar.d.ts +1 -1
  7. package/lib/components/alert-banner/AlertBanner.d.ts +1 -1
  8. package/lib/components/app-toolbar/AppToolbar.d.ts +5 -2
  9. package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
  10. package/lib/components/auto-complete/AutoComplete.d.ts +1 -1
  11. package/lib/components/avatar/Avatar.d.ts +2 -2
  12. package/lib/components/avatar-group/AvatarGroup.d.ts +1 -1
  13. package/lib/components/breadcrumbs/Breadcrumbs.d.ts +6 -2
  14. package/lib/components/button/Button.d.ts +1 -1
  15. package/lib/components/button/IconButton.d.ts +1 -1
  16. package/lib/components/button-toggle/ButtonToggle.d.ts +0 -2
  17. package/lib/components/card/Card.d.ts +2 -1
  18. package/lib/components/card/CardContent.d.ts +2 -1
  19. package/lib/components/card/CardFooter.d.ts +2 -1
  20. package/lib/components/card/CardHeader.d.ts +1 -1
  21. package/lib/components/checkbox/Checkbox.d.ts +0 -2
  22. package/lib/components/checkbox/CheckboxGroup.d.ts +1 -1
  23. package/lib/components/chip/Chip.d.ts +1 -1
  24. package/lib/components/compareSize.d.ts +1 -0
  25. package/lib/components/confirmation-dialog/ConfirmationDialog.d.ts +1 -1
  26. package/lib/components/dialog/Dialog.d.ts +1 -1
  27. package/lib/components/drawer/Drawer.d.ts +1 -1
  28. package/lib/components/empty-state/EmptyState.d.ts +1 -1
  29. package/lib/components/form/Form.d.ts +3 -1
  30. package/lib/components/form-group/FormGroup.d.ts +0 -2
  31. package/lib/components/helpers.d.ts +3 -0
  32. package/lib/components/icon/Icon.d.ts +1 -1
  33. package/lib/components/index.d.ts +5 -4
  34. package/lib/components/inline-edit/InlineEdit.d.ts +1 -1
  35. package/lib/components/input-form-fields/InputSelect.d.ts +1 -1
  36. package/lib/components/link/Link.d.ts +1 -1
  37. package/lib/components/list/List.d.ts +1 -3
  38. package/lib/components/list/List.styles.d.ts +4 -4
  39. package/lib/components/menu/Menu.d.ts +3 -1
  40. package/lib/components/navigation-rail/NavigationRail.d.ts +3 -1
  41. package/lib/components/pill/Pill.d.ts +1 -1
  42. package/lib/components/progress/Progress.d.ts +1 -1
  43. package/lib/components/radio/RadioButton.d.ts +1 -1
  44. package/lib/components/radio/RadioGroup.d.ts +0 -2
  45. package/lib/components/sidebar/Sidebar.d.ts +1 -1
  46. package/lib/components/skeleton/Skeleton.d.ts +1 -1
  47. package/lib/components/snackbar/Snackbar.d.ts +1 -1
  48. package/lib/components/split-button/SplitButton.styles.d.ts +1 -1
  49. package/lib/components/switch/Switch.d.ts +0 -2
  50. package/lib/components/table/Table.d.ts +3 -2
  51. package/lib/components/table/Table.stories.data.d.ts +20 -2
  52. package/lib/components/table/TableBody.d.ts +1 -3
  53. package/lib/components/table/TableCell.d.ts +6 -3
  54. package/lib/components/table/TableHeader.d.ts +11 -2
  55. package/lib/components/table/TablePagination.d.ts +1 -1
  56. package/lib/components/typography/Typography.d.ts +1 -1
  57. package/lib/theme-provider/ThemeProvider.d.ts +2 -38
  58. package/package.json +3 -6
@@ -4,8 +4,6 @@ export declare type SwitchColor = 'default' | 'primary' | 'secondary';
4
4
  export declare type SwitchSize = 'medium' | 'small';
5
5
  export declare type SwitchLabelPlacement = 'bottom' | 'end' | 'start' | 'top';
6
6
  export interface SwitchProps extends CommonProps {
7
- /** accessibility label */
8
- ariaLabel?: string;
9
7
  /** determines the default state of the switch */
10
8
  checked?: boolean;
11
9
  /** color options available 'default', 'primary', 'secondary' */
@@ -12,7 +12,6 @@ export interface TableRowProps extends CommonProps {
12
12
  rowData: any;
13
13
  }
14
14
  export interface TableProps extends CommonProps {
15
- ariaLabel: string;
16
15
  /** The table header columns */
17
16
  columns: Array<DotColumnHeader>;
18
17
  /** Total number of items for paginated table.
@@ -37,6 +36,8 @@ export interface TableProps extends CommonProps {
37
36
  onRowClick?: (event: MouseEvent, id: string) => void;
38
37
  /** Update data callback if data is managed by consumer */
39
38
  onUpdateData?: (order: Order, orderBy: string, page: number, rowsPerPage: number) => void;
39
+ /** The zero-based index of the current page for paginated table */
40
+ page?: number;
40
41
  /** Rows per page for paginated table */
41
42
  rowsPerPage?: RowsPerPageOption;
42
43
  /** Table is sortable */
@@ -53,4 +54,4 @@ export declare function stableSort<T>(array: T[], comparator: (order: T, orderBy
53
54
  * A wrapper component around the Table component from @material-ui. This component can be used for
54
55
  * creating a common structure for tables in the system.
55
56
  */
56
- export declare const DotTable: ({ ariaLabel, className, columns, count, data, "data-testid": dataTestId, emptyMessage, loading, maxHeight, order, orderBy, onRowClick, onUpdateData, rowsPerPage, stickyHeader, sortable, toolbar, }: TableProps) => JSX.Element;
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;
@@ -3,6 +3,14 @@ export declare const defaultColumns: ({
3
3
  id: string;
4
4
  label: string;
5
5
  width: string;
6
+ truncate: boolean;
7
+ align?: undefined;
8
+ sortable?: undefined;
9
+ } | {
10
+ id: string;
11
+ label: string;
12
+ width: string;
13
+ truncate?: undefined;
6
14
  align?: undefined;
7
15
  sortable?: undefined;
8
16
  } | {
@@ -10,6 +18,7 @@ export declare const defaultColumns: ({
10
18
  label: string;
11
19
  align: string;
12
20
  width: string;
21
+ truncate?: undefined;
13
22
  sortable?: undefined;
14
23
  } | {
15
24
  id: string;
@@ -17,6 +26,7 @@ export declare const defaultColumns: ({
17
26
  width: string;
18
27
  align: string;
19
28
  label?: undefined;
29
+ truncate?: undefined;
20
30
  })[];
21
31
  export declare const defaultData: ({
22
32
  id: string;
@@ -37,11 +47,19 @@ export declare const defaultData: ({
37
47
  };
38
48
  selected?: undefined;
39
49
  })[];
40
- export declare const paginatedColumns: {
50
+ export declare const paginatedColumns: ({
41
51
  id: string;
42
52
  label: string;
43
53
  width: string;
44
- }[];
54
+ truncate: boolean;
55
+ align?: undefined;
56
+ } | {
57
+ id: string;
58
+ label: string;
59
+ width: string;
60
+ align: string;
61
+ truncate?: undefined;
62
+ })[];
45
63
  export declare const paginatedData: {
46
64
  id: string;
47
65
  rowData: {
@@ -10,8 +10,6 @@ export interface TableBodyProps extends CommonProps {
10
10
  data: Array<TableRowProps>;
11
11
  /** Message to show if no data */
12
12
  emptyMessage?: string;
13
- /** Empty rows to show */
14
- emptyRows?: number;
15
13
  /** Row click event callback */
16
14
  onRowClick?: (event: MouseEvent, id: string) => void;
17
15
  }
@@ -19,4 +17,4 @@ export interface TableBodyProps extends CommonProps {
19
17
  * A wrapper component around the TableBody component from @material-ui. This component can be used
20
18
  * to determine the functionality of the table.
21
19
  */
22
- export declare const DotTableBody: ({ columns, data, emptyMessage, emptyRows, onRowClick, }: TableBodyProps) => JSX.Element;
20
+ export declare const DotTableBody: ({ columns, data, emptyMessage, onRowClick, }: TableBodyProps) => JSX.Element;
@@ -1,11 +1,14 @@
1
1
  /// <reference types="react" />
2
- export interface CellProps {
3
- align?: boolean;
2
+ import { CommonProps } from '../CommonProps';
3
+ export declare type textAlignment = 'center' | 'inherit' | 'justify' | 'left' | 'right';
4
+ export interface CellProps extends CommonProps {
5
+ align?: textAlignment;
4
6
  colspan?: number;
5
7
  id?: string;
8
+ noWrap?: boolean;
6
9
  value?: any;
7
10
  }
8
11
  /**
9
12
  * A wrapper component around the TableCell component from @material-ui.
10
13
  */
11
- export declare const DotBodyCell: ({ align, colspan, id, value, }: CellProps) => JSX.Element;
14
+ export declare const DotBodyCell: ({ ariaLabel, align, className, colspan, "data-testid": dataTestId, id, noWrap, value, }: CellProps) => JSX.Element;
@@ -1,10 +1,12 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
2
  import { Order } from './TableBody';
3
+ import { textAlignment } from './TableCell';
3
4
  export interface DotColumnHeader {
4
- align?: string;
5
+ align?: textAlignment;
5
6
  id: string;
6
7
  label?: string;
7
8
  sortable?: boolean;
9
+ truncate?: boolean;
8
10
  width?: string;
9
11
  }
10
12
  export interface HeaderProps {
@@ -16,8 +18,11 @@ export interface HeaderProps {
16
18
  sortable: boolean;
17
19
  }
18
20
  export interface HeaderCellProps {
19
- align?: boolean;
21
+ /** Allows to align cell text left, right, center */
22
+ align?: textAlignment;
23
+ /** Click event function to handle sorting */
20
24
  createSortHandler?: (property: string) => (event: MouseEvent<unknown>) => void;
25
+ /** The Id of table cell */
21
26
  id?: string;
22
27
  /** The order of data which is being sorted by */
23
28
  order?: Order;
@@ -25,10 +30,14 @@ export interface HeaderCellProps {
25
30
  orderBy?: string;
26
31
  /** Determines if sorting is enabled */
27
32
  sortable?: boolean;
33
+ /** Determines sorting order of ascending or desceding */
28
34
  sortDirection?: 'desc' | 'asc' | undefined;
35
+ /**Allows table cell text truncated and displays in only one line */
36
+ truncate?: boolean;
29
37
  /** The UID of the cell, if not provided then a randomly generated hash will be created using
30
38
  * CreateUUID() */
31
39
  uid: string;
40
+ /** The value of header cell*/
32
41
  value?: ReactNode;
33
42
  /** The width of the column */
34
43
  width?: string;
@@ -15,5 +15,5 @@ export interface TablePaginationProps extends CommonProps {
15
15
  rowsPerPage?: RowsPerPageOption;
16
16
  }
17
17
  /** This component wraps the TablePagination component from @material-ui. */
18
- export declare const DotTablePagination: ({ className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, }: TablePaginationProps) => JSX.Element;
18
+ export declare const DotTablePagination: ({ ariaLabel, className, count, "data-testid": dataTestId, onChangePage, onChangeRowsPerPage, page, rowsPerPage, }: TablePaginationProps) => JSX.Element;
19
19
  export {};
@@ -11,4 +11,4 @@ export interface TypographyProps extends CommonProps {
11
11
  /** Applies the theme typography styles. */
12
12
  variant?: TypographyVariant;
13
13
  }
14
- export declare const DotTypography: ({ className, "data-testid": dataTestId, children, component, noWrap, variant, }: TypographyProps) => JSX.Element;
14
+ export declare const DotTypography: ({ ariaLabel, className, "data-testid": dataTestId, children, component, noWrap, variant, }: TypographyProps) => JSX.Element;
@@ -1,44 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Theme } from '@material-ui/core';
3
+ import { AvatarPaletteColorOptions } from '../../../../../typings/material/index';
3
4
  export declare type ThemeOptions = 'light' | 'dark' | 'agility-light' | 'agility-dark';
4
- export declare const avatarColors: {
5
- default: {
6
- color: string;
7
- backgroundColor: string;
8
- };
9
- green: {
10
- color: string;
11
- backgroundColor: string;
12
- };
13
- blue: {
14
- color: string;
15
- backgroundColor: string;
16
- };
17
- orange: {
18
- color: string;
19
- backgroundColor: string;
20
- };
21
- purple: {
22
- color: string;
23
- backgroundColor: string;
24
- };
25
- yellow: {
26
- color: string;
27
- backgroundColor: string;
28
- };
29
- red: {
30
- color: string;
31
- backgroundColor: string;
32
- };
33
- darkGrey: {
34
- color: string;
35
- backgroundColor: string;
36
- };
37
- lightGrey: {
38
- color: string;
39
- backgroundColor: string;
40
- };
41
- };
5
+ export declare const avatarColors: AvatarPaletteColorOptions;
42
6
  export declare const agilityLightTheme: Theme;
43
7
  export declare const agilityDarkTheme: Theme;
44
8
  export declare const darkTheme: Theme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.11",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -27,13 +27,10 @@
27
27
  "author": "Keith Stewart",
28
28
  "dependencies": {
29
29
  "@material-ui/lab": "4.0.0-alpha.56",
30
- "@material-ui/core": "4.11.4",
30
+ "@material-ui/core": "4.12.3",
31
31
  "styled-components": "^5.2.1"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^16.8.0 || ^17.0.0"
35
- },
36
- "resolutions": {
37
- "@material-ui/system": "4.11.3"
38
35
  }
39
- }
36
+ }