cozy-ui 146.5.0 → 146.5.1
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 +8 -0
- package/assets/icons/illus/empty-members-illustration.svg +1 -0
- package/package.json +1 -1
- package/react/Icons/EmptyMembersIllustration.jsx +15 -0
- package/react/MemberAutocomplete/Readme.md +24 -0
- package/react/MemberList/EmptyMembers.jsx +2 -2
- package/react/MemberRow/MemberOrGroupAvatar.jsx +14 -4
- package/transpiled/react/Icons/EmptyMembersIllustration.d.ts +2 -0
- package/transpiled/react/Icons/EmptyMembersIllustration.js +15 -0
- package/transpiled/react/MemberList/EmptyMembers.js +4 -5
- package/transpiled/react/MemberRow/MemberOrGroupAvatar.d.ts +3 -1
- package/transpiled/react/MemberRow/MemberOrGroupAvatar.js +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [146.5.1](https://github.com/cozy/cozy-ui/compare/v146.5.0...v146.5.1) (2026-11-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **MemberAutocomplete:** Give the chip avatars the chip styles ([1cb1300](https://github.com/cozy/cozy-ui/commit/1cb1300))
|
|
7
|
+
* **MemberList:** Use the mockup illustration in the empty state ([ecccbbd](https://github.com/cozy/cozy-ui/commit/ecccbbd))
|
|
8
|
+
|
|
1
9
|
# [146.5.0](https://github.com/cozy/cozy-ui/compare/v146.4.0...v146.5.0) (2026-11-04)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="59" height="37" viewBox="0 0 59 37" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.59 22.783c.182-.274.37-.544.57-.807l.408-.536-.478-.279a10.822 10.822 0 0 0-5.449-1.46C4.774 19.702 0 24.352 0 30.067v3.185c0 .59.494 1.069 1.101 1.069h11.907v-3.012c0-.347.015-.714.048-1.154l.017-.212c.033-.384.081-.767.143-1.147l.01-.05c.068-.407.153-.81.254-1.21.1-.394.216-.782.347-1.166l-.47-.155.498.072c.26-.749.576-1.477.947-2.177l.081-.153c.174-.32.36-.634.555-.941l.152-.232Zm-4.949-5.728c3.103 0 5.628-2.458 5.628-5.479 0-3.02-2.525-5.478-5.628-5.478s-5.627 2.457-5.627 5.479c0 3.02 2.524 5.478 5.627 5.478m33.654 13.297c-.01-.149-.02-.297-.035-.446-.01-.099-.024-.197-.036-.296a12.178 12.178 0 0 0-.051-.394c-.016-.102-.035-.203-.052-.304a14.777 14.777 0 0 0-.07-.382c-.02-.098-.043-.196-.065-.294a13.065 13.065 0 0 0-.091-.385l-.074-.273c-.038-.135-.076-.27-.118-.403l-.078-.24a15.208 15.208 0 0 0-.15-.43c-.024-.068-.049-.134-.074-.2a12.983 12.983 0 0 0-.256-.619 14.777 14.777 0 0 0-.233-.503c-.018-.034-.034-.07-.051-.104-.09-.181-.185-.36-.284-.538l-.03-.057a14.061 14.061 0 0 0-.34-.571l-.005-.011c-2.577-4.123-7.236-6.882-12.545-6.882a14.807 14.807 0 0 0-11.29 5.174l-.06.07a14.64 14.64 0 0 0-.752.977c-.034.049-.069.097-.102.146-.087.129-.173.258-.257.39-.041.065-.084.13-.124.196-.069.111-.134.225-.2.337-.05.088-.102.174-.15.263-.046.083-.088.168-.133.252-.062.119-.125.236-.184.357l-.011.024a14.081 14.081 0 0 0-1.155 3.472l-.04.212a14.116 14.116 0 0 0-.103.7c-.016.123-.031.245-.043.369-.013.126-.02.252-.03.378-.007.096-.016.191-.02.287-.011.227-.018.455-.018.684v4.48c0 .668.564 1.212 1.256 1.212h26.835c.692 0 1.255-.544 1.255-1.213v-4.479c0-.236-.006-.471-.018-.704-.004-.084-.013-.168-.018-.252Zm-14.98-16.418c3.948 0 7.16-3.126 7.16-6.967 0-3.841-3.212-6.967-7.16-6.967-3.95 0-7.16 3.126-7.16 6.967 0 3.841 3.211 6.967 7.16 6.967Zm18.866 5.03c-2.088 0-4.115.593-5.86 1.715l-.462.296.35.42a15.717 15.717 0 0 1 1.999 3.07l.024.05c.1.205.197.412.29.625l.036.08c.088.205.171.412.265.657l.019.046c.176.472.33.952.459 1.44l.029.118c.05.193.096.388.138.584l.05.252a14.119 14.119 0 0 1 .19 1.21c.011.096.023.19.032.286.016.165.028.33.038.496l.017.249c.012.249.02.498.02.75v2.274h11.907c.607 0 1.1-.48 1.1-1.07v-3.184c0-5.714-4.774-10.363-10.641-10.363m0-2.391c3.103 0 5.627-2.458 5.627-5.479 0-3.02-2.524-5.478-5.627-5.478-3.103 0-5.627 2.458-5.627 5.478 0 3.021 2.524 5.479 5.627 5.479Z" fill="#DCEDFD"/></svg>
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/illus/empty-members-illustration.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgEmptyMembersIllustration(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 59 37" fill="none" {...props}>
|
|
7
|
+
<path
|
|
8
|
+
d="M15.59 22.783c.182-.274.37-.544.57-.807l.408-.536-.478-.279a10.822 10.822 0 00-5.449-1.46C4.774 19.702 0 24.352 0 30.067v3.185c0 .59.494 1.069 1.101 1.069h11.907v-3.012c0-.347.015-.714.048-1.154l.017-.212c.033-.384.081-.767.143-1.147l.01-.05a15.11 15.11 0 01.601-2.376l-.47-.155.498.072c.26-.749.576-1.477.947-2.177l.081-.153c.174-.32.36-.634.555-.941l.152-.232zm-4.949-5.728c3.103 0 5.628-2.458 5.628-5.479 0-3.02-2.525-5.478-5.628-5.478s-5.627 2.457-5.627 5.479c0 3.02 2.524 5.478 5.627 5.478m33.654 13.297c-.01-.149-.02-.297-.035-.446-.01-.099-.024-.197-.036-.296a12.178 12.178 0 00-.051-.394c-.016-.102-.035-.203-.052-.304a14.777 14.777 0 00-.07-.382c-.02-.098-.043-.196-.065-.294a13.065 13.065 0 00-.091-.385l-.074-.273c-.038-.135-.076-.27-.118-.403l-.078-.24a15.208 15.208 0 00-.15-.43c-.024-.068-.049-.134-.074-.2a12.983 12.983 0 00-.256-.619 14.777 14.777 0 00-.233-.503c-.018-.034-.034-.07-.051-.104-.09-.181-.185-.36-.284-.538l-.03-.057a14.061 14.061 0 00-.34-.571l-.005-.011c-2.577-4.123-7.236-6.882-12.545-6.882a14.807 14.807 0 00-11.29 5.174l-.06.07a14.64 14.64 0 00-.752.977c-.034.049-.069.097-.102.146-.087.129-.173.258-.257.39-.041.065-.084.13-.124.196-.069.111-.134.225-.2.337-.05.088-.102.174-.15.263-.046.083-.088.168-.133.252-.062.119-.125.236-.184.357l-.011.024a14.081 14.081 0 00-1.155 3.472l-.04.212a14.116 14.116 0 00-.103.7c-.016.123-.031.245-.043.369-.013.126-.02.252-.03.378-.007.096-.016.191-.02.287-.011.227-.018.455-.018.684v4.48c0 .668.564 1.212 1.256 1.212h26.835c.692 0 1.255-.544 1.255-1.213v-4.479c0-.236-.006-.471-.018-.704-.004-.084-.013-.168-.018-.252zm-14.98-16.418c3.948 0 7.16-3.126 7.16-6.967 0-3.841-3.212-6.967-7.16-6.967-3.95 0-7.16 3.126-7.16 6.967 0 3.841 3.211 6.967 7.16 6.967zm18.866 5.03c-2.088 0-4.115.593-5.86 1.715l-.462.296.35.42a15.717 15.717 0 011.999 3.07l.024.05c.1.205.197.412.29.625l.036.08c.088.205.171.412.265.657l.019.046c.176.472.33.952.459 1.44l.029.118c.05.193.096.388.138.584l.05.252a14.119 14.119 0 01.19 1.21c.011.096.023.19.032.286.016.165.028.33.038.496l.017.249c.012.249.02.498.02.75v2.274h11.907c.607 0 1.1-.48 1.1-1.07v-3.184c0-5.714-4.774-10.363-10.641-10.363m0-2.391c3.103 0 5.627-2.458 5.627-5.479 0-3.02-2.524-5.478-5.627-5.478-3.103 0-5.627 2.458-5.627 5.478 0 3.021 2.524 5.479 5.627 5.479z"
|
|
9
|
+
fill="#DCEDFD"
|
|
10
|
+
/>
|
|
11
|
+
</svg>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default SvgEmptyMembersIllustration
|
|
@@ -63,3 +63,27 @@ initialState = { members: [], role: 'readWrite' }
|
|
|
63
63
|
</Variants>
|
|
64
64
|
</DemoProvider>
|
|
65
65
|
```
|
|
66
|
+
|
|
67
|
+
### With picked members
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
71
|
+
import MemberAutocomplete from 'cozy-ui/transpiled/react/MemberAutocomplete'
|
|
72
|
+
|
|
73
|
+
const members = [
|
|
74
|
+
{ id: 'alice', name: 'Alice Wonderland', subtitle: 'alice@cozy.cc', email: 'alice@cozy.cc', initials: 'AW' },
|
|
75
|
+
{ id: 'bob', name: 'Bob Sponge', subtitle: 'bob@cozy.cc', email: 'bob@cozy.cc', initials: 'BS' },
|
|
76
|
+
{ id: 'family', name: 'Family', subtitle: '3 members', isGroup: true, color: '#FF7F1B' }
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
;
|
|
80
|
+
|
|
81
|
+
<DemoProvider>
|
|
82
|
+
<MemberAutocomplete
|
|
83
|
+
value={members}
|
|
84
|
+
title="Add people"
|
|
85
|
+
onChange={() => {}}
|
|
86
|
+
onSubmit={() => {}}
|
|
87
|
+
/>
|
|
88
|
+
</DemoProvider>
|
|
89
|
+
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Icon, Team } from '@linagora/twake-icons'
|
|
2
1
|
import cx from 'classnames'
|
|
3
2
|
import React from 'react'
|
|
4
3
|
import { useI18n, useExtendI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import { locales } from './locales'
|
|
6
|
+
import EmptyMembersIllustration from '../Icons/EmptyMembersIllustration'
|
|
7
7
|
import Typography from '../Typography'
|
|
8
8
|
import useBreakpoints from '../providers/Breakpoints'
|
|
9
9
|
import { alpha, makeStyles } from '../styles'
|
|
@@ -31,7 +31,7 @@ const EmptyMembers = () => {
|
|
|
31
31
|
classes.root
|
|
32
32
|
)}
|
|
33
33
|
>
|
|
34
|
-
<
|
|
34
|
+
<EmptyMembersIllustration width={59} height={37} />
|
|
35
35
|
<Typography variant="body2" className="u-mt-half">
|
|
36
36
|
{t('MemberList.empty.title')}
|
|
37
37
|
</Typography>
|
|
@@ -5,17 +5,27 @@ import MemberAvatar from './MemberAvatar'
|
|
|
5
5
|
import MemberGroupAvatar from './MemberGroupAvatar'
|
|
6
6
|
import { memberPropType } from './propTypes'
|
|
7
7
|
|
|
8
|
-
const MemberOrGroupAvatar = ({ member, size }) => {
|
|
8
|
+
const MemberOrGroupAvatar = ({ member, size, className }) => {
|
|
9
9
|
const { avatarUrl, initials, color, isGroup } = member
|
|
10
10
|
|
|
11
|
-
if (isGroup)
|
|
11
|
+
if (isGroup) {
|
|
12
|
+
return <MemberGroupAvatar size={size} color={color} className={className} />
|
|
13
|
+
}
|
|
12
14
|
|
|
13
|
-
return
|
|
15
|
+
return (
|
|
16
|
+
<MemberAvatar
|
|
17
|
+
size={size}
|
|
18
|
+
initials={initials}
|
|
19
|
+
avatarUrl={avatarUrl}
|
|
20
|
+
className={className}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
MemberOrGroupAvatar.propTypes = {
|
|
17
26
|
member: memberPropType.isRequired,
|
|
18
|
-
size: PropTypes.string.isRequired
|
|
27
|
+
size: PropTypes.string.isRequired,
|
|
28
|
+
className: PropTypes.string
|
|
19
29
|
}
|
|
20
30
|
|
|
21
31
|
export default MemberOrGroupAvatar
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/illus/empty-members-illustration.svg` to regenerate;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function SvgEmptyMembersIllustration(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 59 37",
|
|
8
|
+
fill: "none"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
d: "M15.59 22.783c.182-.274.37-.544.57-.807l.408-.536-.478-.279a10.822 10.822 0 00-5.449-1.46C4.774 19.702 0 24.352 0 30.067v3.185c0 .59.494 1.069 1.101 1.069h11.907v-3.012c0-.347.015-.714.048-1.154l.017-.212c.033-.384.081-.767.143-1.147l.01-.05a15.11 15.11 0 01.601-2.376l-.47-.155.498.072c.26-.749.576-1.477.947-2.177l.081-.153c.174-.32.36-.634.555-.941l.152-.232zm-4.949-5.728c3.103 0 5.628-2.458 5.628-5.479 0-3.02-2.525-5.478-5.628-5.478s-5.627 2.457-5.627 5.479c0 3.02 2.524 5.478 5.627 5.478m33.654 13.297c-.01-.149-.02-.297-.035-.446-.01-.099-.024-.197-.036-.296a12.178 12.178 0 00-.051-.394c-.016-.102-.035-.203-.052-.304a14.777 14.777 0 00-.07-.382c-.02-.098-.043-.196-.065-.294a13.065 13.065 0 00-.091-.385l-.074-.273c-.038-.135-.076-.27-.118-.403l-.078-.24a15.208 15.208 0 00-.15-.43c-.024-.068-.049-.134-.074-.2a12.983 12.983 0 00-.256-.619 14.777 14.777 0 00-.233-.503c-.018-.034-.034-.07-.051-.104-.09-.181-.185-.36-.284-.538l-.03-.057a14.061 14.061 0 00-.34-.571l-.005-.011c-2.577-4.123-7.236-6.882-12.545-6.882a14.807 14.807 0 00-11.29 5.174l-.06.07a14.64 14.64 0 00-.752.977c-.034.049-.069.097-.102.146-.087.129-.173.258-.257.39-.041.065-.084.13-.124.196-.069.111-.134.225-.2.337-.05.088-.102.174-.15.263-.046.083-.088.168-.133.252-.062.119-.125.236-.184.357l-.011.024a14.081 14.081 0 00-1.155 3.472l-.04.212a14.116 14.116 0 00-.103.7c-.016.123-.031.245-.043.369-.013.126-.02.252-.03.378-.007.096-.016.191-.02.287-.011.227-.018.455-.018.684v4.48c0 .668.564 1.212 1.256 1.212h26.835c.692 0 1.255-.544 1.255-1.213v-4.479c0-.236-.006-.471-.018-.704-.004-.084-.013-.168-.018-.252zm-14.98-16.418c3.948 0 7.16-3.126 7.16-6.967 0-3.841-3.212-6.967-7.16-6.967-3.95 0-7.16 3.126-7.16 6.967 0 3.841 3.211 6.967 7.16 6.967zm18.866 5.03c-2.088 0-4.115.593-5.86 1.715l-.462.296.35.42a15.717 15.717 0 011.999 3.07l.024.05c.1.205.197.412.29.625l.036.08c.088.205.171.412.265.657l.019.046c.176.472.33.952.459 1.44l.029.118c.05.193.096.388.138.584l.05.252a14.119 14.119 0 01.19 1.21c.011.096.023.19.032.286.016.165.028.33.038.496l.017.249c.012.249.02.498.02.75v2.274h11.907c.607 0 1.1-.48 1.1-1.07v-3.184c0-5.714-4.774-10.363-10.641-10.363m0-2.391c3.103 0 5.627-2.458 5.627-5.479 0-3.02-2.524-5.478-5.627-5.478-3.103 0-5.627 2.458-5.627 5.478 0 3.021 2.524 5.479 5.627 5.479z",
|
|
11
|
+
fill: "#DCEDFD"
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default SvgEmptyMembersIllustration;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Icon, Team } from '@linagora/twake-icons';
|
|
2
1
|
import cx from 'classnames';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { useI18n, useExtendI18n } from 'twake-i18n';
|
|
5
4
|
import { locales } from "cozy-ui/transpiled/react/MemberList/locales";
|
|
5
|
+
import EmptyMembersIllustration from "cozy-ui/transpiled/react/Icons/EmptyMembersIllustration";
|
|
6
6
|
import Typography from "cozy-ui/transpiled/react/Typography";
|
|
7
7
|
import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
8
8
|
import { alpha, makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
@@ -26,10 +26,9 @@ var EmptyMembers = function EmptyMembers() {
|
|
|
26
26
|
var classes = useStyles();
|
|
27
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
28
|
className: cx('u-flex u-flex-column u-flex-items-center u-pv-2 u-ph-1 u-bdrs-6', isMobile ? 'u-mh-1' : 'u-mh-2', classes.root)
|
|
29
|
-
}, /*#__PURE__*/React.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
color: "var(--primaryColorLight)"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(EmptyMembersIllustration, {
|
|
30
|
+
width: 59,
|
|
31
|
+
height: 37
|
|
33
32
|
}), /*#__PURE__*/React.createElement(Typography, {
|
|
34
33
|
variant: "body2",
|
|
35
34
|
className: "u-mt-half"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export default MemberOrGroupAvatar;
|
|
2
|
-
declare function MemberOrGroupAvatar({ member, size }: {
|
|
2
|
+
declare function MemberOrGroupAvatar({ member, size, className }: {
|
|
3
3
|
member: any;
|
|
4
4
|
size: any;
|
|
5
|
+
className: any;
|
|
5
6
|
}): JSX.Element;
|
|
6
7
|
declare namespace MemberOrGroupAvatar {
|
|
7
8
|
namespace propTypes {
|
|
@@ -34,6 +35,7 @@ declare namespace MemberOrGroupAvatar {
|
|
|
34
35
|
data: PropTypes.Requireable<any>;
|
|
35
36
|
}>>;
|
|
36
37
|
const size: PropTypes.Validator<string>;
|
|
38
|
+
const className: PropTypes.Requireable<string>;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
import PropTypes from "prop-types";
|
|
@@ -6,24 +6,32 @@ import { memberPropType } from "cozy-ui/transpiled/react/MemberRow/propTypes";
|
|
|
6
6
|
|
|
7
7
|
var MemberOrGroupAvatar = function MemberOrGroupAvatar(_ref) {
|
|
8
8
|
var member = _ref.member,
|
|
9
|
-
size = _ref.size
|
|
9
|
+
size = _ref.size,
|
|
10
|
+
className = _ref.className;
|
|
10
11
|
var avatarUrl = member.avatarUrl,
|
|
11
12
|
initials = member.initials,
|
|
12
13
|
color = member.color,
|
|
13
14
|
isGroup = member.isGroup;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
|
|
16
|
+
if (isGroup) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(MemberGroupAvatar, {
|
|
18
|
+
size: size,
|
|
19
|
+
color: color,
|
|
20
|
+
className: className
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
return /*#__PURE__*/React.createElement(MemberAvatar, {
|
|
19
25
|
size: size,
|
|
20
26
|
initials: initials,
|
|
21
|
-
avatarUrl: avatarUrl
|
|
27
|
+
avatarUrl: avatarUrl,
|
|
28
|
+
className: className
|
|
22
29
|
});
|
|
23
30
|
};
|
|
24
31
|
|
|
25
32
|
MemberOrGroupAvatar.propTypes = {
|
|
26
33
|
member: memberPropType.isRequired,
|
|
27
|
-
size: PropTypes.string.isRequired
|
|
34
|
+
size: PropTypes.string.isRequired,
|
|
35
|
+
className: PropTypes.string
|
|
28
36
|
};
|
|
29
37
|
export default MemberOrGroupAvatar;
|