cozy-ui 126.5.0 → 127.0.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 (63) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/package.json +1 -1
  3. package/react/ActionsMenu/index.jsx +10 -0
  4. package/react/Avatar/index.jsx +6 -0
  5. package/react/Checkbox/Readme.md +12 -0
  6. package/react/Checkbox/index.jsx +25 -3
  7. package/react/ContactsList/ContactRow.jsx +1 -1
  8. package/react/ContactsList/Contacts/ContactIdentity.jsx +34 -15
  9. package/react/ContactsList/Contacts/ContactName.jsx +22 -18
  10. package/react/ContactsList/locales/withContactsListLocales.jsx +1 -1
  11. package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +50 -25
  12. package/react/Table/Readme.md +39 -1
  13. package/react/Table/Virtualized/Cell.jsx +8 -6
  14. package/react/Table/Virtualized/Dnd/TableRow.jsx +14 -6
  15. package/react/Table/Virtualized/Dnd/index.jsx +35 -0
  16. package/react/Table/Virtualized/Dnd/virtuosoComponents.jsx +25 -0
  17. package/react/Table/Virtualized/FixedHeaderContent.jsx +7 -1
  18. package/react/Table/Virtualized/RowContent.jsx +19 -4
  19. package/react/Table/Virtualized/TableRow.jsx +20 -0
  20. package/react/Table/Virtualized/helpers.js +4 -2
  21. package/react/Table/Virtualized/index.jsx +13 -30
  22. package/react/Table/Virtualized/virtuosoComponents.jsx +23 -49
  23. package/react/TableContainer/index.js +16 -1
  24. package/react/utils/index.js +1 -0
  25. package/transpiled/react/ActionsMenu/index.js +13 -2
  26. package/transpiled/react/Avatar/index.d.ts +5 -1
  27. package/transpiled/react/Avatar/index.js +13 -5
  28. package/transpiled/react/Checkbox/index.d.ts +6 -0
  29. package/transpiled/react/Checkbox/index.js +18 -5
  30. package/transpiled/react/ContactsList/ContactRow.js +1 -1
  31. package/transpiled/react/ContactsList/Contacts/ContactIdentity.d.ts +7 -7
  32. package/transpiled/react/ContactsList/Contacts/ContactIdentity.js +39 -22
  33. package/transpiled/react/ContactsList/Contacts/ContactName.d.ts +3 -9
  34. package/transpiled/react/ContactsList/Contacts/ContactName.js +12 -13
  35. package/transpiled/react/ContactsList/locales/withContactsListLocales.d.ts +6 -0
  36. package/transpiled/react/ContactsList/locales/withContactsListLocales.js +1 -1
  37. package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +46 -21
  38. package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +46 -21
  39. package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +46 -21
  40. package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +46 -21
  41. package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +50 -25
  42. package/transpiled/react/Table/Virtualized/Cell.d.ts +2 -1
  43. package/transpiled/react/Table/Virtualized/Cell.js +24 -17
  44. package/transpiled/react/Table/Virtualized/Dnd/TableRow.d.ts +1 -3
  45. package/transpiled/react/Table/Virtualized/Dnd/TableRow.js +9 -7
  46. package/transpiled/react/Table/Virtualized/Dnd/index.d.ts +7 -0
  47. package/transpiled/react/Table/Virtualized/Dnd/index.js +47 -0
  48. package/transpiled/react/Table/Virtualized/Dnd/virtuosoComponents.d.ts +14 -0
  49. package/transpiled/react/Table/Virtualized/Dnd/virtuosoComponents.js +39 -0
  50. package/transpiled/react/Table/Virtualized/FixedHeaderContent.d.ts +2 -2
  51. package/transpiled/react/Table/Virtualized/FixedHeaderContent.js +7 -1
  52. package/transpiled/react/Table/Virtualized/RowContent.d.ts +3 -2
  53. package/transpiled/react/Table/Virtualized/RowContent.js +13 -4
  54. package/transpiled/react/Table/Virtualized/TableRow.d.ts +3 -0
  55. package/transpiled/react/Table/Virtualized/TableRow.js +21 -0
  56. package/transpiled/react/Table/Virtualized/helpers.js +4 -2
  57. package/transpiled/react/Table/Virtualized/index.d.ts +3 -2
  58. package/transpiled/react/Table/Virtualized/index.js +17 -38
  59. package/transpiled/react/Table/Virtualized/virtuosoComponents.js +37 -65
  60. package/transpiled/react/TableContainer/index.d.ts +2 -1
  61. package/transpiled/react/TableContainer/index.js +20 -1
  62. package/transpiled/react/utils/index.d.ts +1 -0
  63. package/transpiled/react/utils/index.js +1 -0
@@ -0,0 +1,35 @@
1
+ import React, { useState, useMemo } from 'react'
2
+
3
+ import CustomDragLayer from './CustomDrag/CustomDragLayer'
4
+ import virtuosoComponentsDnd from './virtuosoComponents'
5
+ import VirtualizedTable from '../index'
6
+ import virtuosoComponents from '../virtuosoComponents'
7
+
8
+ const _components = { ...virtuosoComponents, ...virtuosoComponentsDnd }
9
+
10
+ const VirtuosoTableDnd = ({ dragProps, context, components, ...props }) => {
11
+ const [itemsInDropProcess, setItemsInDropProcess] = useState([]) // array of Ids, for dragndrop feature
12
+
13
+ const _context = useMemo(
14
+ () => ({
15
+ ...context,
16
+ dragProps,
17
+ itemsInDropProcess,
18
+ setItemsInDropProcess
19
+ }),
20
+ [context, dragProps, itemsInDropProcess]
21
+ )
22
+
23
+ return (
24
+ <>
25
+ <CustomDragLayer dragId={dragProps.dragId} />
26
+ <VirtualizedTable
27
+ components={components || _components}
28
+ context={_context}
29
+ {...props}
30
+ />
31
+ </>
32
+ )
33
+ }
34
+
35
+ export default VirtuosoTableDnd
@@ -0,0 +1,25 @@
1
+ import React, { forwardRef } from 'react'
2
+
3
+ import DnDConfigWrapper from './DnDConfigWrapper'
4
+ import TableRowDnD from './TableRow'
5
+ import TableContainer from '../../../TableContainer'
6
+ import virtuosoComponents from '../virtuosoComponents'
7
+
8
+ /**
9
+ Be aware that context is spread to every components but should not be spread to Table components
10
+ so we desctrure it from props, but don't spread to child to avoid its presence in DOM
11
+ */
12
+ const virtuosoComponentsDnd = {
13
+ ...virtuosoComponents,
14
+ // eslint-disable-next-line no-unused-vars
15
+ Scroller: forwardRef(({ context, ...props }, ref) => (
16
+ <DnDConfigWrapper ref={ref}>
17
+ <TableContainer {...props} ref={ref} />
18
+ </DnDConfigWrapper>
19
+ )),
20
+ TableRow: forwardRef((props, ref) => {
21
+ return <TableRowDnD {...props} ref={ref} />
22
+ })
23
+ }
24
+
25
+ export default virtuosoComponentsDnd
@@ -1,3 +1,4 @@
1
+ import cx from 'classnames'
1
2
  import React from 'react'
2
3
 
3
4
  import TableHeadCell from './HeadCell'
@@ -25,19 +26,24 @@ const FixedHeaderContent = ({
25
26
  order,
26
27
  orderBy,
27
28
  rowCount,
28
- selectedCount,
29
+ context,
29
30
  onClick,
30
31
  onSelectAllClick
31
32
  }) => {
32
33
  const classes = useStyles()
34
+ const selectedCount = context.selectedItems.length
33
35
 
34
36
  return (
35
37
  <TableRow>
36
38
  <TableCell align="center" padding="checkbox">
37
39
  <Checkbox
40
+ className={cx('virtualizedCheckbox', {
41
+ checked: selectedCount > 0
42
+ })}
38
43
  indeterminate={selectedCount > 0 && selectedCount < rowCount}
39
44
  checked={rowCount > 0 && selectedCount === rowCount}
40
45
  inputProps={{ 'aria-label': 'select all' }}
46
+ size="small"
41
47
  onChange={onSelectAllClick}
42
48
  />
43
49
  </TableCell>
@@ -1,3 +1,4 @@
1
+ import cx from 'classnames'
1
2
  import React from 'react'
2
3
 
3
4
  import Cell from './Cell'
@@ -8,23 +9,37 @@ const RowContent = ({
8
9
  index,
9
10
  row,
10
11
  columns,
11
- isSelectedItem,
12
+ context,
12
13
  children,
13
- onSelectClick
14
+ onSelectClick,
15
+ onClick
14
16
  }) => {
17
+ const selectedCount = context.selectedItems.length
18
+
15
19
  return (
16
20
  <>
17
21
  <TableCell align="center" padding="checkbox">
18
22
  <Checkbox
19
- checked={isSelectedItem(row)}
23
+ className={cx('virtualizedCheckbox', {
24
+ visible: selectedCount > 0,
25
+ checked: context.isSelectedItem(row)
26
+ })}
27
+ checked={context.isSelectedItem(row)}
20
28
  inputProps={{
21
29
  'aria-labelledby': `enhanced-table-checkbox-${index}`
22
30
  }}
31
+ size="small"
23
32
  onChange={() => onSelectClick(row)}
24
33
  />
25
34
  </TableCell>
26
35
  {columns.map(column => (
27
- <Cell key={column.id} row={row} columns={columns} column={column}>
36
+ <Cell
37
+ key={column.id}
38
+ row={row}
39
+ columns={columns}
40
+ column={column}
41
+ onClick={onClick}
42
+ >
28
43
  {children}
29
44
  </Cell>
30
45
  ))}
@@ -0,0 +1,20 @@
1
+ import cx from 'classnames'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ import TableRowClassic from '../../TableRow'
5
+
6
+ const TableRow = forwardRef(({ item, context, className, ...props }, ref) => {
7
+ const isSelected = context?.isSelectedItem(item)
8
+
9
+ return (
10
+ <TableRowClassic
11
+ {...props}
12
+ className={cx(className, 'virtualized')}
13
+ ref={ref}
14
+ selected={isSelected}
15
+ hover
16
+ />
17
+ )
18
+ })
19
+
20
+ export default TableRow
@@ -1,6 +1,8 @@
1
+ import get from 'lodash/get'
2
+
1
3
  const descendingComparator = ({ a, b, order, orderBy, lang }) => {
2
- const aValue = a[orderBy]
3
- const bValue = b[orderBy]
4
+ const aValue = get(a, orderBy, '')
5
+ const bValue = get(b, orderBy, '')
4
6
 
5
7
  if (typeof aValue === 'string') {
6
8
  const isDate = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}/.test(aValue)
@@ -1,7 +1,6 @@
1
1
  import React, { useState, forwardRef } from 'react'
2
2
  import { TableVirtuoso } from 'react-virtuoso'
3
3
 
4
- import CustomDragLayer from './Dnd/CustomDrag/CustomDragLayer'
5
4
  import FixedHeaderContent from './FixedHeaderContent'
6
5
  import RowContent from './RowContent'
7
6
  import { stableSort, getComparator } from './helpers'
@@ -19,7 +18,6 @@ const VirtualizedTable = forwardRef(
19
18
  onSelectAll,
20
19
  isSelectedItem,
21
20
  componentsProps,
22
- dragProps,
23
21
  context,
24
22
  components,
25
23
  ...props
@@ -28,10 +26,14 @@ const VirtualizedTable = forwardRef(
28
26
  ) => {
29
27
  const [order, setOrder] = useState('asc')
30
28
  const [orderBy, setOrderBy] = useState(defaultOrder)
31
- const [itemsInDropProcess, setItemsInDropProcess] = useState([]) // array of Ids, for dragndrop feature
32
29
 
33
30
  const sortedData = stableSort(rows, getComparator(order, orderBy))
34
31
  const data = secondarySort ? secondarySort(sortedData) : sortedData
32
+ const _context = {
33
+ ...context,
34
+ isSelectedItem,
35
+ selectedItems
36
+ }
35
37
 
36
38
  const handleSort = property => {
37
39
  const isAsc = orderBy === property && order === 'asc'
@@ -52,35 +54,29 @@ const VirtualizedTable = forwardRef(
52
54
  {...props}
53
55
  ref={ref}
54
56
  data={data}
55
- context={{
56
- ...context,
57
- isSelectedItem,
58
- selectedItems,
59
- dragProps,
60
- itemsInDropProcess,
61
- setItemsInDropProcess
62
- }}
57
+ context={_context}
63
58
  components={components || virtuosoComponents}
64
59
  fixedHeaderContent={() => (
65
60
  <FixedHeaderContent
66
- {...componentsProps?.FixedHeaderContent}
61
+ {...componentsProps?.fixedHeaderContent}
67
62
  columns={columns}
68
63
  rowCount={rows.length}
69
- selectedCount={selectedItems.length}
64
+ context={_context}
70
65
  order={order}
71
66
  orderBy={orderBy}
72
67
  onClick={handleSort}
73
68
  onSelectAllClick={handleSelectAll}
74
69
  />
75
70
  )}
76
- itemContent={(_index, row) => (
71
+ itemContent={(_index, row, context) => (
77
72
  <RowContent
78
- {...componentsProps?.RowContent}
73
+ {...componentsProps?.rowContent}
79
74
  index={_index}
80
75
  row={row}
81
76
  columns={columns}
82
- isSelectedItem={isSelectedItem}
77
+ context={context}
83
78
  onSelectClick={onSelect}
79
+ onClick={componentsProps?.rowContent?.onClick}
84
80
  >
85
81
  {componentsProps?.rowContent?.children}
86
82
  </RowContent>
@@ -100,17 +96,4 @@ VirtualizedTable.defaultProps = {
100
96
  onSelectAll: () => {}
101
97
  }
102
98
 
103
- const VirtuosoTableWrapper = props => {
104
- if (!props.dragProps?.enabled) {
105
- return <VirtualizedTable {...props} />
106
- } else {
107
- return (
108
- <>
109
- <CustomDragLayer dragId={props.dragProps.dragId} />
110
- <VirtualizedTable {...props} />
111
- </>
112
- )
113
- }
114
- }
115
-
116
- export default VirtuosoTableWrapper
99
+ export default VirtualizedTable
@@ -1,61 +1,35 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import cx from 'classnames'
1
3
  import React, { forwardRef } from 'react'
2
4
 
3
- import DnDConfigWrapper from './Dnd/DnDConfigWrapper'
4
- import TableRowDnD from './Dnd/TableRow'
5
+ import TableRow from './TableRow'
5
6
  import Table from '..'
6
- import Paper from '../../Paper'
7
7
  import TableBody from '../../TableBody'
8
8
  import TableContainer from '../../TableContainer'
9
9
  import TableFooter from '../../TableFooter'
10
10
  import TableHead from '../../TableHead'
11
- import TableRow from '../../TableRow'
12
-
13
- const _TableContainer = forwardRef((props, ref) => (
14
- <TableContainer
15
- {...props}
16
- ref={ref}
17
- component={Paper}
18
- style={{ zIndex: 'var(--zIndex-app)', ...props.style }}
19
- elevation={0}
20
- />
21
- ))
22
- _TableContainer.displayName = '_TableContainer'
23
11
 
12
+ /**
13
+ Be aware that context is spread to every components but should not be spread to Table components
14
+ so we desctrure it from props, but don't spread to child to avoid its presence in DOM
15
+ */
24
16
  const virtuosoComponents = {
25
- Scroller: forwardRef(({ context, ...props }, ref) => {
26
- if (!context.dragProps?.enabled) {
27
- return <_TableContainer {...props} ref={ref} />
28
- } else {
29
- return (
30
- <DnDConfigWrapper ref={ref}>
31
- <_TableContainer {...props} ref={ref} />
32
- </DnDConfigWrapper>
33
- )
34
- }
35
- }),
36
- Table: forwardRef((props, ref) => <Table {...props} ref={ref} />),
37
- TableHead: forwardRef((props, ref) => <TableHead {...props} ref={ref} />),
38
- TableBody: forwardRef((props, ref) => <TableBody {...props} ref={ref} />),
39
- TableFooter: forwardRef((props, ref) => <TableFooter {...props} ref={ref} />),
40
- TableRow: forwardRef(({ item, context, ...props }, ref) => {
41
- const isSelected = context?.isSelectedItem(item)
42
- const isDisabled = context?.itemsInDropProcess.includes(item._id)
43
-
44
- if (!context.dragProps?.enabled) {
45
- return <TableRow {...props} ref={ref} selected={isSelected} hover />
46
- } else {
47
- return (
48
- <TableRowDnD
49
- {...props}
50
- item={item}
51
- context={context}
52
- selected={isSelected}
53
- disabled={isDisabled}
54
- hover
55
- />
56
- )
57
- }
58
- })
17
+ Scroller: forwardRef(({ context, ...props }, ref) => (
18
+ <TableContainer {...props} ref={ref} />
19
+ )),
20
+ Table: forwardRef(({ context, ...props }, ref) => (
21
+ <Table {...props} ref={ref} />
22
+ )),
23
+ TableHead: forwardRef(({ context, className, ...props }, ref) => (
24
+ <TableHead {...props} className={cx(className, 'virtualized')} ref={ref} />
25
+ )),
26
+ TableBody: forwardRef(({ context, ...props }, ref) => (
27
+ <TableBody {...props} ref={ref} />
28
+ )),
29
+ TableFooter: forwardRef(({ context, ...props }, ref) => (
30
+ <TableFooter {...props} ref={ref} />
31
+ )),
32
+ TableRow: forwardRef((props, ref) => <TableRow {...props} ref={ref} />)
59
33
  }
60
34
 
61
35
  export default virtuosoComponents
@@ -1,3 +1,18 @@
1
- import TableContainer from '@material-ui/core/TableContainer'
1
+ import MuiTableContainer from '@material-ui/core/TableContainer'
2
+ import React, { forwardRef } from 'react'
3
+
4
+ import Paper from '../Paper'
5
+
6
+ const TableContainer = forwardRef((props, ref) => {
7
+ return (
8
+ <MuiTableContainer
9
+ {...props}
10
+ ref={ref}
11
+ component={Paper}
12
+ style={{ zIndex: 'var(--zIndex-app)', ...props.style }}
13
+ elevation={0}
14
+ />
15
+ )
16
+ })
2
17
 
3
18
  export default TableContainer
@@ -0,0 +1 @@
1
+ export * from '@material-ui/core/utils'
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["docs", "actions", "anchorOrigin", "children", "componentsProps", "onClose"];
3
+ var _excluded = ["docs", "actions", "anchorOrigin", "children", "componentsProps", "onClose", "autoCloseOnContextMenu"];
4
4
  import PropTypes from 'prop-types';
5
5
  import React, { forwardRef } from 'react';
6
6
  import ActionsItems from "cozy-ui/transpiled/react/ActionsMenu/ActionsItems";
@@ -23,6 +23,7 @@ var ActionsMenu = /*#__PURE__*/forwardRef(function (_ref2, ref) {
23
23
  children = _ref2.children,
24
24
  componentsProps = _ref2.componentsProps,
25
25
  onClose = _ref2.onClose,
26
+ autoCloseOnContextMenu = _ref2.autoCloseOnContextMenu,
26
27
  props = _objectWithoutProperties(_ref2, _excluded);
27
28
 
28
29
  var transformOrigin = useTransformOrigin(anchorOrigin);
@@ -31,7 +32,13 @@ var ActionsMenu = /*#__PURE__*/forwardRef(function (_ref2, ref) {
31
32
  getContentAnchorEl: null,
32
33
  anchorOrigin: anchorOrigin,
33
34
  transformOrigin: transformOrigin,
34
- keepMounted: true,
35
+ keepMounted: true
36
+ }, autoCloseOnContextMenu && {
37
+ onContextMenu: function onContextMenu(ev) {
38
+ ev.preventDefault();
39
+ onClose();
40
+ }
41
+ }, {
35
42
  onClose: onClose
36
43
  }), children, /*#__PURE__*/React.createElement(ActionsItems, _extends({}, componentsProps.actionsItems, {
37
44
  docs: docs,
@@ -44,6 +51,7 @@ ActionsMenu.defaultProps = {
44
51
  horizontal: 'left'
45
52
  },
46
53
  autoClose: true,
54
+ autoCloseOnContextMenu: true,
47
55
  componentsProps: {}
48
56
  };
49
57
  ActionsMenu.propTypes = {
@@ -65,6 +73,9 @@ ActionsMenu.propTypes = {
65
73
  /** Whether the menu should automatically close itself when an item is clicked */
66
74
  autoClose: PropTypes.bool,
67
75
 
76
+ /** Whether the menu should automatically close itself when right-click is triggered */
77
+ autoCloseOnContextMenu: PropTypes.bool,
78
+
68
79
  /* Props passed to components with the same name */
69
80
  componentsProps: PropTypes.shape({
70
81
  /** Props spread to ActionsItems component */
@@ -1,5 +1,5 @@
1
1
  export default Avatar;
2
- declare function Avatar({ className, color, size, border, innerBorder, disabled, ...props }: {
2
+ declare function Avatar({ className, color, size, border, innerBorder, disabled, display, ...props }: {
3
3
  [x: string]: any;
4
4
  className: any;
5
5
  color: any;
@@ -7,15 +7,19 @@ declare function Avatar({ className, color, size, border, innerBorder, disabled,
7
7
  border: any;
8
8
  innerBorder: any;
9
9
  disabled: any;
10
+ display: any;
10
11
  }): JSX.Element;
11
12
  declare namespace Avatar {
12
13
  namespace propTypes {
13
14
  const className: PropTypes.Requireable<string>;
14
15
  const size: PropTypes.Requireable<string | number>;
15
16
  const color: PropTypes.Requireable<string>;
17
+ const display: PropTypes.Requireable<string>;
16
18
  const disabled: PropTypes.Requireable<boolean>;
17
19
  }
18
20
  namespace defaultProps {
21
+ const display_1: string;
22
+ export { display_1 as display };
19
23
  const size_1: string;
20
24
  export { size_1 as size };
21
25
  }
@@ -1,13 +1,15 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["className", "color", "size", "border", "innerBorder", "disabled"];
5
+ var _excluded = ["className", "color", "size", "border", "innerBorder", "disabled", "display"];
5
6
  import AvatarMui from '@material-ui/core/Avatar';
6
7
  import cx from 'classnames';
7
8
  import PropTypes from 'prop-types';
8
9
  import React from 'react';
9
10
  import { colorMapping, supportedColors, nameToColor } from "cozy-ui/transpiled/react/Avatar/helpers";
10
11
  import { makeStyles } from "cozy-ui/transpiled/react/styles";
12
+ import { capitalize } from "cozy-ui/transpiled/react/utils/index";
11
13
  var useStyles = makeStyles(function (theme) {
12
14
  return {
13
15
  colorDefault: {
@@ -24,12 +26,15 @@ var useStyles = makeStyles(function (theme) {
24
26
  });
25
27
 
26
28
  var Avatar = function Avatar(_ref3) {
29
+ var _cx;
30
+
27
31
  var className = _ref3.className,
28
32
  color = _ref3.color,
29
33
  size = _ref3.size,
30
34
  border = _ref3.border,
31
35
  innerBorder = _ref3.innerBorder,
32
36
  disabled = _ref3.disabled,
37
+ display = _ref3.display,
33
38
  props = _objectWithoutProperties(_ref3, _excluded);
34
39
 
35
40
  var defaultColor = typeof props.children === 'string' ? nameToColor(props.children) : undefined;
@@ -38,11 +43,10 @@ var Avatar = function Avatar(_ref3) {
38
43
  });
39
44
  return /*#__PURE__*/React.createElement(AvatarMui, _extends({
40
45
  classes: classes,
41
- className: cx(className, "size-".concat(size), {
46
+ className: cx(className, "size-".concat(size), (_cx = {
42
47
  disabled: !!disabled,
43
- border: !!border,
44
- innerBorder: !!innerBorder
45
- })
48
+ border: !!border
49
+ }, _defineProperty(_cx, "display".concat(capitalize(display)), display !== 'initial'), _defineProperty(_cx, "innerBorder", !!innerBorder), _cx))
46
50
  }, props));
47
51
  };
48
52
 
@@ -50,9 +54,13 @@ Avatar.propTypes = {
50
54
  className: PropTypes.string,
51
55
  size: PropTypes.oneOfType([PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl']), PropTypes.number]),
52
56
  color: PropTypes.oneOf([].concat(_toConsumableArray(supportedColors), ['none'])),
57
+
58
+ /** Controls the display type */
59
+ display: PropTypes.oneOf(['initial', 'inline']),
53
60
  disabled: PropTypes.bool
54
61
  };
55
62
  Avatar.defaultProps = {
63
+ display: 'initial',
56
64
  size: 'm'
57
65
  };
58
66
  export default Avatar;
@@ -13,6 +13,8 @@ declare namespace Checkbox {
13
13
  const error: PropTypes.Requireable<boolean>;
14
14
  const disabled: PropTypes.Requireable<boolean>;
15
15
  const mixed: PropTypes.Requireable<boolean>;
16
+ const disableEffect: PropTypes.Requireable<boolean>;
17
+ const size: PropTypes.Requireable<string>;
16
18
  const label: PropTypes.Requireable<string>;
17
19
  }
18
20
  namespace defaultProps {
@@ -24,6 +26,10 @@ declare namespace Checkbox {
24
26
  export { error_1 as error };
25
27
  const mixed_1: boolean;
26
28
  export { mixed_1 as mixed };
29
+ const disableEffect_1: boolean;
30
+ export { disableEffect_1 as disableEffect };
31
+ const size_1: string;
32
+ export { size_1 as size };
27
33
  const label_1: string;
28
34
  export { label_1 as label };
29
35
  }
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["label", "error", "mixed", "disabled"],
4
+ var _excluded = ["className", "label", "error", "mixed", "disabled", "size", "disableEffect"],
4
5
  _excluded2 = ["className", "label", "onChange", "children"];
5
6
  import MUICheckbox from '@material-ui/core/Checkbox';
6
7
  import FormControlLabel from '@material-ui/core/FormControlLabel';
@@ -13,13 +14,19 @@ import createDepreciationLogger from "cozy-ui/transpiled/react/helpers/createDep
13
14
  var logDepecratedCheckbox = createDepreciationLogger();
14
15
 
15
16
  var DefaultCheckbox = function DefaultCheckbox(_ref) {
16
- var label = _ref.label,
17
+ var _cx;
18
+
19
+ var className = _ref.className,
20
+ label = _ref.label,
17
21
  error = _ref.error,
18
22
  mixed = _ref.mixed,
19
23
  disabled = _ref.disabled,
24
+ size = _ref.size,
25
+ disableEffect = _ref.disableEffect,
20
26
  props = _objectWithoutProperties(_ref, _excluded);
21
27
 
22
28
  return /*#__PURE__*/React.createElement(MUICheckbox, _extends({
29
+ className: cx(className, (_cx = {}, _defineProperty(_cx, 'u-p-0', disableEffect), _defineProperty(_cx, "small", size === 'small'), _cx)),
23
30
  inputProps: {
24
31
  'aria-label': label,
25
32
  'aria-checked': mixed ? 'mixed' : '',
@@ -28,15 +35,17 @@ var DefaultCheckbox = function DefaultCheckbox(_ref) {
28
35
  color: error ? 'secondary' : 'primary',
29
36
  indeterminate: mixed,
30
37
  disabled: disabled,
38
+ size: size,
39
+ disableRipple: disableEffect,
31
40
  checkedIcon: /*#__PURE__*/React.createElement("div", {
32
41
  className: "u-flex u-flex-items-center u-flex-justify-center",
33
42
  style: {
34
- width: 24,
35
- height: 24
43
+ width: size === 'small' ? 20 : 24,
44
+ height: size === 'small' ? 20 : 24
36
45
  }
37
46
  }, /*#__PURE__*/React.createElement(Icon, {
38
47
  icon: CheckSquareIcon,
39
- size: 18
48
+ size: size === 'small' ? 16 : 18
40
49
  }))
41
50
  }, props));
42
51
  };
@@ -78,6 +87,8 @@ Checkbox.propTypes = {
78
87
  error: PropTypes.bool,
79
88
  disabled: PropTypes.bool,
80
89
  mixed: PropTypes.bool,
90
+ disableEffect: PropTypes.bool,
91
+ size: PropTypes.oneOf(['small', 'medium']),
81
92
  label: PropTypes.string
82
93
  };
83
94
  Checkbox.defaultProps = {
@@ -85,6 +96,8 @@ Checkbox.defaultProps = {
85
96
  value: '',
86
97
  error: false,
87
98
  mixed: false,
99
+ disableEffect: false,
100
+ size: 'medium',
88
101
  label: ''
89
102
  };
90
103
  export default Checkbox;
@@ -41,7 +41,7 @@ var ContactRow = function ContactRow(_ref) {
41
41
  divider: divider,
42
42
  gutters: isDesktop ? 'double' : 'default',
43
43
  onClick: function onClick() {
44
- return _onClick(contact);
44
+ return _onClick === null || _onClick === void 0 ? void 0 : _onClick(contact);
45
45
  }
46
46
  }, rest), /*#__PURE__*/React.createElement(ContactIdentity, {
47
47
  contact: contact
@@ -1,10 +1,10 @@
1
- export default ContactIdentity;
2
- declare function ContactIdentity({ contact }: {
3
- contact: any;
1
+ export default ContactIdentityWrapper;
2
+ declare function ContactIdentityWrapper({ noWrapper, ...props }: {
3
+ [x: string]: any;
4
+ noWrapper: any;
4
5
  }): JSX.Element;
5
- declare namespace ContactIdentity {
6
- namespace propTypes {
7
- const contact: PropTypes.Validator<object>;
6
+ declare namespace ContactIdentityWrapper {
7
+ namespace defaultProps {
8
+ const noWrapper: boolean;
8
9
  }
9
10
  }
10
- import PropTypes from "prop-types";