cozy-ui 146.2.0 → 146.2.2

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
@@ -1,3 +1,18 @@
1
+ ## [146.2.2](https://github.com/cozy/cozy-ui/compare/v146.2.1...v146.2.2) (2026-11-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **MuiCozyTheme:** Readable label on a primary Fab in dark mode ([804e3d6](https://github.com/cozy/cozy-ui/commit/804e3d6))
7
+
8
+ ## [146.2.1](https://github.com/cozy/cozy-ui/compare/v146.2.0...v146.2.1) (2026-11-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **MemberRoleMenuHeader:** Register its locales ([396d6b4](https://github.com/cozy/cozy-ui/commit/396d6b4))
14
+ * **MemberRoleMenu:** Show the mobile header only with a member ([59b5d17](https://github.com/cozy/cozy-ui/commit/59b5d17))
15
+
1
16
  # [146.2.0](https://github.com/cozy/cozy-ui/compare/v146.1.0...v146.2.0) (2026-11-02)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "146.2.0",
3
+ "version": "146.2.2",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "engines": {
6
6
  "node": "24.x"
@@ -17,6 +17,7 @@ const MemberRoleMenu = ({ member, value, roles, onChange }) => {
17
17
  const [isMenuDisplayed, setMenuDisplayed] = useState(false)
18
18
 
19
19
  const label = roles.find(role => role.value === value)?.label
20
+ const isHeaderShown = isMobile && member !== undefined
20
21
 
21
22
  const handleRoleClick = role => {
22
23
  if (role.value !== value) onChange(role.value)
@@ -44,7 +45,7 @@ const MemberRoleMenu = ({ member, value, roles, onChange }) => {
44
45
  onClose={() => setMenuDisplayed(false)}
45
46
  >
46
47
  {/* The header renders nothing on desktop but would still take the initial focus of the menu */}
47
- {isMobile && <MemberRoleMenuHeader member={member} />}
48
+ {isHeaderShown && <MemberRoleMenuHeader member={member} />}
48
49
  {roles.map(role => (
49
50
  <ActionsMenuItem
50
51
  key={role.value}
@@ -62,7 +63,8 @@ const MemberRoleMenu = ({ member, value, roles, onChange }) => {
62
63
  }
63
64
 
64
65
  MemberRoleMenu.propTypes = {
65
- member: memberPropType.isRequired,
66
+ /** Member shown in the header of the menu on mobile */
67
+ member: memberPropType,
66
68
  value: PropTypes.string.isRequired,
67
69
  roles: rolesPropType.isRequired,
68
70
  onChange: PropTypes.func.isRequired
@@ -1,14 +1,16 @@
1
1
  import React from 'react'
2
- import { useI18n } from 'twake-i18n'
2
+ import { useI18n, useExtendI18n } from 'twake-i18n'
3
3
 
4
4
  import MemberAvatar from './MemberAvatar'
5
5
  import MemberGroupAvatar from './MemberGroupAvatar'
6
+ import { locales } from './locales'
6
7
  import { memberPropType } from './propTypes'
7
8
  import ActionsMenuMobileHeader from '../ActionsMenu/ActionsMenuMobileHeader'
8
9
  import ListItemIcon from '../ListItemIcon'
9
10
  import ListItemText from '../ListItemText'
10
11
 
11
12
  const MemberRoleMenuHeader = ({ member }) => {
13
+ useExtendI18n(locales)
12
14
  const { t } = useI18n()
13
15
  const { name, avatarUrl, initials, color, isGroup, isCurrentUser } = member
14
16
 
@@ -14,6 +14,11 @@ export const makeDarkOverrides = theme => {
14
14
  root: {
15
15
  backgroundColor: alpha(theme.palette.common.black, 0.5)
16
16
  }
17
+ },
18
+ MuiFab: {
19
+ primary: {
20
+ color: theme.palette.primary.contrastText
21
+ }
17
22
  }
18
23
  })
19
24
 
@@ -7,39 +7,14 @@ declare function MemberRoleMenu({ member, value, roles, onChange }: {
7
7
  }): JSX.Element;
8
8
  declare namespace MemberRoleMenu {
9
9
  namespace propTypes {
10
- const member: PropTypes.Validator<PropTypes.InferProps<{
11
- id: PropTypes.Validator<string>;
12
- name: PropTypes.Requireable<string>;
13
- subtitle: PropTypes.Requireable<PropTypes.ReactNodeLike>;
14
- avatarUrl: PropTypes.Requireable<string>;
15
- initials: PropTypes.Requireable<string>;
16
- color: PropTypes.Requireable<string>;
17
- isGroup: PropTypes.Requireable<boolean>;
18
- isOwner: PropTypes.Requireable<boolean>;
19
- isCurrentUser: PropTypes.Requireable<boolean>;
20
- role: PropTypes.Requireable<string>;
21
- roles: PropTypes.Requireable<(PropTypes.InferProps<{
22
- value: PropTypes.Validator<string>;
23
- label: PropTypes.Validator<string>;
24
- }> | null)[]>;
25
- canChangeRole: PropTypes.Requireable<boolean>;
26
- canRemove: PropTypes.Requireable<boolean>;
27
- removeIcon: PropTypes.Requireable<object>;
28
- removeLabel: PropTypes.Requireable<string>;
29
- action: PropTypes.Requireable<PropTypes.InferProps<{
30
- label: PropTypes.Validator<string>;
31
- onClick: PropTypes.Validator<(...args: any[]) => any>;
32
- }>>;
33
- isPending: PropTypes.Requireable<boolean>;
34
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
35
- data: PropTypes.Requireable<any>;
36
- }>>;
37
- const value: PropTypes.Validator<string>;
38
- const roles: PropTypes.Validator<(PropTypes.InferProps<{
10
+ export { memberPropType as member };
11
+ export const value: PropTypes.Validator<string>;
12
+ export const roles: PropTypes.Validator<(PropTypes.InferProps<{
39
13
  value: PropTypes.Validator<string>;
40
14
  label: PropTypes.Validator<string>;
41
15
  }> | null)[]>;
42
- const onChange: PropTypes.Validator<(...args: any[]) => any>;
16
+ export const onChange: PropTypes.Validator<(...args: any[]) => any>;
43
17
  }
44
18
  }
19
+ import { memberPropType } from "./propTypes";
45
20
  import PropTypes from "prop-types";
@@ -32,6 +32,7 @@ var MemberRoleMenu = function MemberRoleMenu(_ref) {
32
32
  var label = (_roles$find = roles.find(function (role) {
33
33
  return role.value === value;
34
34
  })) === null || _roles$find === void 0 ? void 0 : _roles$find.label;
35
+ var isHeaderShown = isMobile && member !== undefined;
35
36
 
36
37
  var handleRoleClick = function handleRoleClick(role) {
37
38
  if (role.value !== value) onChange(role.value);
@@ -62,7 +63,7 @@ var MemberRoleMenu = function MemberRoleMenu(_ref) {
62
63
  onClose: function onClose() {
63
64
  return setMenuDisplayed(false);
64
65
  }
65
- }, isMobile && /*#__PURE__*/React.createElement(MemberRoleMenuHeader, {
66
+ }, isHeaderShown && /*#__PURE__*/React.createElement(MemberRoleMenuHeader, {
66
67
  member: member
67
68
  }), roles.map(function (role) {
68
69
  return /*#__PURE__*/React.createElement(ActionsMenuItem, {
@@ -79,7 +80,8 @@ var MemberRoleMenu = function MemberRoleMenu(_ref) {
79
80
  };
80
81
 
81
82
  MemberRoleMenu.propTypes = {
82
- member: memberPropType.isRequired,
83
+ /** Member shown in the header of the menu on mobile */
84
+ member: memberPropType,
83
85
  value: PropTypes.string.isRequired,
84
86
  roles: rolesPropType.isRequired,
85
87
  onChange: PropTypes.func.isRequired
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import { useI18n } from 'twake-i18n';
2
+ import { useI18n, useExtendI18n } from 'twake-i18n';
3
3
  import MemberAvatar from "cozy-ui/transpiled/react/MemberRow/MemberAvatar";
4
4
  import MemberGroupAvatar from "cozy-ui/transpiled/react/MemberRow/MemberGroupAvatar";
5
+ import { locales } from "cozy-ui/transpiled/react/MemberRow/locales";
5
6
  import { memberPropType } from "cozy-ui/transpiled/react/MemberRow/propTypes";
6
7
  import ActionsMenuMobileHeader from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuMobileHeader";
7
8
  import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
@@ -9,6 +10,7 @@ import ListItemText from "cozy-ui/transpiled/react/ListItemText";
9
10
 
10
11
  var MemberRoleMenuHeader = function MemberRoleMenuHeader(_ref) {
11
12
  var member = _ref.member;
13
+ useExtendI18n(locales);
12
14
 
13
15
  var _useI18n = useI18n(),
14
16
  t = _useI18n.t;
@@ -1777,4 +1777,9 @@ export function makeDarkOverrides(theme: any): {
1777
1777
  backgroundColor: string;
1778
1778
  };
1779
1779
  };
1780
+ MuiFab: {
1781
+ primary: {
1782
+ color: any;
1783
+ };
1784
+ };
1780
1785
  };
@@ -13,6 +13,11 @@ export var makeDarkOverrides = function makeDarkOverrides(theme) {
13
13
  root: {
14
14
  backgroundColor: alpha(theme.palette.common.black, 0.5)
15
15
  }
16
+ },
17
+ MuiFab: {
18
+ primary: {
19
+ color: theme.palette.primary.contrastText
20
+ }
16
21
  }
17
22
  };
18
23
  };