cozy-ui-plus 4.4.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@4.4.1...cozy-ui-plus@4.5.0) (2026-02-02)
7
+
8
+ ### Features
9
+
10
+ - **cozy-ui-plus:** Add `disable` prop on ContactCell ([2249927](https://github.com/cozy/cozy-libs/commit/22499270ab1b110cb4e01cf83297fd69d33f5d3b))
11
+
6
12
  ## [4.4.1](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@4.4.0...cozy-ui-plus@4.4.1) (2026-01-29)
7
13
 
8
14
  **Note:** Version bump only for package cozy-ui-plus
@@ -17,11 +17,13 @@ var Cell = function Cell(_ref) {
17
17
  var row = _ref.row,
18
18
  column = _ref.column,
19
19
  cell = _ref.cell,
20
- actions = _ref.actions;
20
+ actions = _ref.actions,
21
+ disable = _ref.disable;
21
22
 
22
23
  if (column.id === 'fullname') {
23
24
  return /*#__PURE__*/_react.default.createElement(_ContactIdentity.default, {
24
25
  contact: row,
26
+ disable: disable,
25
27
  noWrapper: true
26
28
  });
27
29
  }
@@ -9,6 +9,8 @@ exports.default = void 0;
9
9
 
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
 
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
12
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
15
 
14
16
  var _react = _interopRequireDefault(require("react"));
@@ -50,18 +52,24 @@ var MyselfMarker = function MyselfMarker() {
50
52
  };
51
53
 
52
54
  var ContactIdentity = function ContactIdentity(_ref) {
53
- var contact = _ref.contact;
55
+ var contact = _ref.contact,
56
+ disable = _ref.disable;
54
57
  var isMyself = !!contact.me;
55
58
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Avatar.default, {
59
+ className: (0, _classnames.default)({
60
+ 'u-o-60': disable
61
+ }),
56
62
  display: "inline",
57
63
  size: "s"
58
64
  }, (0, _contact.getInitials)(contact)), /*#__PURE__*/_react.default.createElement(_ContactName.default, {
59
- contact: contact
65
+ contact: contact,
66
+ disable: disable
60
67
  }), isMyself && /*#__PURE__*/_react.default.createElement(MyselfMarker, null));
61
68
  };
62
69
 
63
70
  ContactIdentity.propTypes = {
64
- contact: _propTypes.default.object.isRequired
71
+ contact: _propTypes.default.object.isRequired,
72
+ disable: _propTypes.default.bool
65
73
  };
66
74
 
67
75
  var ContactIdentityWrapper = function ContactIdentityWrapper(_ref2) {
@@ -20,7 +20,8 @@ var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typog
20
20
  var ContactName = function ContactName(_ref) {
21
21
  var _contact$name;
22
22
 
23
- var contact = _ref.contact;
23
+ var contact = _ref.contact,
24
+ disable = _ref.disable;
24
25
  var familyName = (_contact$name = contact.name) === null || _contact$name === void 0 ? void 0 : _contact$name.familyName;
25
26
  var displayName = (0, _contact.getDisplayName)(contact);
26
27
  var namesToDisplay = displayName === null || displayName === void 0 ? void 0 : displayName.split(' ');
@@ -29,7 +30,8 @@ var ContactName = function ContactName(_ref) {
29
30
  ,
30
31
  className: "u-ml-1",
31
32
  noWrap: true,
32
- display: "inline"
33
+ display: "inline",
34
+ color: disable ? 'textSecondary' : 'textPrimary'
33
35
  }, namesToDisplay === null || namesToDisplay === void 0 ? void 0 : namesToDisplay.map(function (name, index) {
34
36
  var isLastItem = index === namesToDisplay.length - 1;
35
37
  return /*#__PURE__*/_react.default.createElement("span", {
@@ -42,7 +44,8 @@ var ContactName = function ContactName(_ref) {
42
44
  };
43
45
 
44
46
  ContactName.propTypes = {
45
- contact: _propTypes.default.object.isRequired
47
+ contact: _propTypes.default.object.isRequired,
48
+ disable: _propTypes.default.bool
46
49
  };
47
50
  var _default = ContactName;
48
51
  exports.default = _default;
@@ -1,8 +1,9 @@
1
- declare const _default: React.MemoExoticComponent<({ row, column, cell, actions }: {
1
+ declare const _default: React.MemoExoticComponent<({ row, column, cell, actions, disable }: {
2
2
  row: any;
3
3
  column: any;
4
4
  cell: any;
5
5
  actions: any;
6
+ disable: any;
6
7
  }) => any>;
7
8
  export default _default;
8
9
  import React from 'react';
@@ -1,10 +1,12 @@
1
1
  export default ContactName;
2
- declare function ContactName({ contact }: {
2
+ declare function ContactName({ contact, disable }: {
3
3
  contact: any;
4
+ disable: any;
4
5
  }): JSX.Element;
5
6
  declare namespace ContactName {
6
7
  namespace propTypes {
7
8
  let contact: PropTypes.Validator<object>;
9
+ let disable: PropTypes.Requireable<boolean>;
8
10
  }
9
11
  }
10
12
  import PropTypes from 'prop-types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui-plus",
3
- "version": "4.4.1",
3
+ "version": "4.5.0",
4
4
  "description": "Cozy-ui-plus is an extension of cozy-ui and provides components based on cozy-client",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -74,5 +74,5 @@
74
74
  "react-dom": "^16 || ^17 || ^18",
75
75
  "twake-i18n": ">=0.3.0"
76
76
  },
77
- "gitHead": "80ec928bcefb30b6ea6ed778fbd71e3417c2efa6"
77
+ "gitHead": "61e7d0678b71327a91c8b527edda7e06994ab43d"
78
78
  }
@@ -4,9 +4,9 @@ import ActionsMenuButton from 'cozy-ui/transpiled/react/ActionsMenu/ActionsMenuB
4
4
 
5
5
  import ContactIdentity from './Contacts/ContactIdentity'
6
6
 
7
- const Cell = ({ row, column, cell, actions }) => {
7
+ const Cell = ({ row, column, cell, actions, disable }) => {
8
8
  if (column.id === 'fullname') {
9
- return <ContactIdentity contact={row} noWrapper />
9
+ return <ContactIdentity contact={row} disable={disable} noWrapper />
10
10
  }
11
11
 
12
12
  if (column.id === 'actions') {
@@ -1,3 +1,4 @@
1
+ import cx from 'classnames'
1
2
  import PropTypes from 'prop-types'
2
3
  import React from 'react'
3
4
  import { useI18n, useExtendI18n } from 'twake-i18n'
@@ -17,22 +18,23 @@ const MyselfMarker = () => {
17
18
  return <span className={`${styles['contact-myself']}`}>({t('me')})</span>
18
19
  }
19
20
 
20
- const ContactIdentity = ({ contact }) => {
21
+ const ContactIdentity = ({ contact, disable }) => {
21
22
  const isMyself = !!contact.me
22
23
 
23
24
  return (
24
25
  <>
25
- <Avatar display="inline" size="s">
26
+ <Avatar className={cx({ 'u-o-60': disable })} display="inline" size="s">
26
27
  {getInitials(contact)}
27
28
  </Avatar>
28
- <ContactName contact={contact} />
29
+ <ContactName contact={contact} disable={disable} />
29
30
  {isMyself && <MyselfMarker />}
30
31
  </>
31
32
  )
32
33
  }
33
34
 
34
35
  ContactIdentity.propTypes = {
35
- contact: PropTypes.object.isRequired
36
+ contact: PropTypes.object.isRequired,
37
+ disable: PropTypes.bool
36
38
  }
37
39
 
38
40
  const ContactIdentityWrapper = ({ noWrapper, ...props }) => {
@@ -5,7 +5,7 @@ import React from 'react'
5
5
  import { getDisplayName } from 'cozy-client/dist/models/contact'
6
6
  import Typography from 'cozy-ui/transpiled/react/Typography'
7
7
 
8
- const ContactName = ({ contact }) => {
8
+ const ContactName = ({ contact, disable }) => {
9
9
  const familyName = contact.name?.familyName
10
10
  const displayName = getDisplayName(contact)
11
11
  const namesToDisplay = displayName?.split(' ')
@@ -16,6 +16,7 @@ const ContactName = ({ contact }) => {
16
16
  className="u-ml-1"
17
17
  noWrap
18
18
  display="inline"
19
+ color={disable ? 'textSecondary' : 'textPrimary'}
19
20
  >
20
21
  {namesToDisplay?.map((name, index) => {
21
22
  const isLastItem = index === namesToDisplay.length - 1
@@ -37,7 +38,8 @@ const ContactName = ({ contact }) => {
37
38
  }
38
39
 
39
40
  ContactName.propTypes = {
40
- contact: PropTypes.object.isRequired
41
+ contact: PropTypes.object.isRequired,
42
+ disable: PropTypes.bool
41
43
  }
42
44
 
43
45
  export default ContactName