cozy-ui 138.10.0 → 138.12.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
@@ -1,3 +1,17 @@
1
+ # [138.12.0](https://github.com/cozy/cozy-ui/compare/v138.11.0...v138.12.0) (2026-05-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * Allow to customize background color of ProgressionBanner component ([91b5cee](https://github.com/cozy/cozy-ui/commit/91b5cee))
7
+
8
+ # [138.11.0](https://github.com/cozy/cozy-ui/compare/v138.10.0...v138.11.0) (2026-05-07)
9
+
10
+
11
+ ### Features
12
+
13
+ * **makeAction:** Add props `Component` and `componentProps` ([cebb6de](https://github.com/cozy/cozy-ui/commit/cebb6de))
14
+
1
15
  # [138.10.0](https://github.com/cozy/cozy-ui/compare/v138.9.0...v138.10.0) (2026-05-06)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "138.10.0",
3
+ "version": "138.12.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -5,14 +5,14 @@ import ListItemIcon from '../../ListItemIcon'
5
5
  import ListItemText from '../../ListItemText'
6
6
  import ActionsMenuItem from '../ActionsMenuItem'
7
7
 
8
- const makeComponent = ({ label, icon, name }) => {
8
+ const makeComponent = ({ label, icon, name, componentProps }) => {
9
9
  const Component = forwardRef((props, ref) => {
10
10
  return (
11
11
  <ActionsMenuItem {...props} ref={ref}>
12
12
  <ListItemIcon>
13
- <Icon icon={icon} />
13
+ <Icon icon={icon} {...componentProps?.Icon} />
14
14
  </ListItemIcon>
15
- <ListItemText primary={label} />
15
+ <ListItemText primary={label} {...componentProps?.ListItemText} />
16
16
  </ActionsMenuItem>
17
17
  )
18
18
  })
@@ -28,6 +28,8 @@ export const makeAction = ({
28
28
  icon,
29
29
  disabled,
30
30
  displayCondition,
31
+ Component,
32
+ componentProps,
31
33
  action
32
34
  }) => {
33
35
  return {
@@ -37,6 +39,7 @@ export const makeAction = ({
37
39
  disabled,
38
40
  displayCondition,
39
41
  action,
40
- Component: makeComponent({ label, icon, name })
42
+ componentProps,
43
+ Component: Component || makeComponent({ label, icon, name, componentProps })
41
44
  }
42
45
  }
@@ -12,7 +12,7 @@ import { BreakpointsProvider } from "cozy-ui/transpiled/react/providers/Breakpoi
12
12
  const { progression } = useProgression();
13
13
 
14
14
  const initialVariants = [
15
- { withValue: true, progressBar: true, withButton: false },
15
+ { withValue: true, progressBar: true, withButton: false, customColor: false },
16
16
  ];
17
17
 
18
18
  <BreakpointsProvider>
@@ -21,6 +21,7 @@ const initialVariants = [
21
21
  <ProgressionBanner
22
22
  progressBar={variant.progressBar}
23
23
  value={variant.withValue && progression}
24
+ color={variant.customColor ? 'var(--errorColorLight)': undefined}
24
25
  text={
25
26
  variant.withButton
26
27
  ? "Storage limit nearly reached"
@@ -19,7 +19,7 @@ const styles = () => ({
19
19
  })
20
20
 
21
21
  const ProgressionBanner = withStyles(styles)(
22
- ({ classes, value, text, icon, button, progressBar }) => {
22
+ ({ classes, value, text, icon, button, progressBar, color }) => {
23
23
  const variant = value ? 'determinate' : undefined
24
24
  const { isMobile } = useBreakpoints()
25
25
 
@@ -32,7 +32,7 @@ const ProgressionBanner = withStyles(styles)(
32
32
  <>
33
33
  <Alert
34
34
  icon={_icon}
35
- color="var(--contrastBackgroundColor)"
35
+ color={color}
36
36
  square
37
37
  block={isMobile}
38
38
  action={button}
@@ -63,11 +63,14 @@ ProgressionBanner.propTypes = {
63
63
  /** Button to use in the banner */
64
64
  button: PropTypes.node,
65
65
  /** Progression bar is hidden if set to false (defaults to true) */
66
- progressBar: PropTypes.bool
66
+ progressBar: PropTypes.bool,
67
+ /** Background color of the banner, css color */
68
+ color: PropTypes.string
67
69
  }
68
70
 
69
71
  ProgressionBanner.defaultProps = {
70
- progressBar: true
72
+ progressBar: true,
73
+ color: 'var(--contrastBackgroundColor)'
71
74
  }
72
75
 
73
76
  export default ProgressionBanner
@@ -1,9 +1,11 @@
1
- export function makeAction({ name, label, icon, disabled, displayCondition, action }: {
1
+ export function makeAction({ name, label, icon, disabled, displayCondition, Component, componentProps, action }: {
2
2
  name: any;
3
3
  label: any;
4
4
  icon: any;
5
5
  disabled: any;
6
6
  displayCondition: any;
7
+ Component: any;
8
+ componentProps: any;
7
9
  action: any;
8
10
  }): {
9
11
  name: any;
@@ -12,6 +14,6 @@ export function makeAction({ name, label, icon, disabled, displayCondition, acti
12
14
  disabled: any;
13
15
  displayCondition: any;
14
16
  action: any;
15
- Component: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
17
+ componentProps: any;
18
+ Component: any;
16
19
  };
17
- import React from "react";
@@ -8,15 +8,16 @@ import ActionsMenuItem from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuIte
8
8
  var makeComponent = function makeComponent(_ref) {
9
9
  var label = _ref.label,
10
10
  icon = _ref.icon,
11
- name = _ref.name;
11
+ name = _ref.name,
12
+ componentProps = _ref.componentProps;
12
13
  var Component = /*#__PURE__*/forwardRef(function (props, ref) {
13
14
  return /*#__PURE__*/React.createElement(ActionsMenuItem, _extends({}, props, {
14
15
  ref: ref
15
- }), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
16
+ }), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, _extends({
16
17
  icon: icon
17
- })), /*#__PURE__*/React.createElement(ListItemText, {
18
+ }, componentProps === null || componentProps === void 0 ? void 0 : componentProps.Icon))), /*#__PURE__*/React.createElement(ListItemText, _extends({
18
19
  primary: label
19
- }));
20
+ }, componentProps === null || componentProps === void 0 ? void 0 : componentProps.ListItemText)));
20
21
  });
21
22
  Component.displayName = name;
22
23
  return Component;
@@ -28,6 +29,8 @@ export var makeAction = function makeAction(_ref2) {
28
29
  icon = _ref2.icon,
29
30
  disabled = _ref2.disabled,
30
31
  displayCondition = _ref2.displayCondition,
32
+ Component = _ref2.Component,
33
+ componentProps = _ref2.componentProps,
31
34
  action = _ref2.action;
32
35
  return {
33
36
  name: name,
@@ -36,10 +39,12 @@ export var makeAction = function makeAction(_ref2) {
36
39
  disabled: disabled,
37
40
  displayCondition: displayCondition,
38
41
  action: action,
39
- Component: makeComponent({
42
+ componentProps: componentProps,
43
+ Component: Component || makeComponent({
40
44
  label: label,
41
45
  icon: icon,
42
- name: name
46
+ name: name,
47
+ componentProps: componentProps
43
48
  })
44
49
  };
45
50
  };
@@ -30,7 +30,8 @@ var ProgressionBanner = withStyles(styles)(function (_ref) {
30
30
  text = _ref.text,
31
31
  icon = _ref.icon,
32
32
  button = _ref.button,
33
- progressBar = _ref.progressBar;
33
+ progressBar = _ref.progressBar,
34
+ color = _ref.color;
34
35
  var variant = value ? 'determinate' : undefined;
35
36
 
36
37
  var _useBreakpoints = useBreakpoints(),
@@ -46,7 +47,7 @@ var ProgressionBanner = withStyles(styles)(function (_ref) {
46
47
 
47
48
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Alert, {
48
49
  icon: _icon,
49
- color: "var(--contrastBackgroundColor)",
50
+ color: color,
50
51
  square: true,
51
52
  block: isMobile,
52
53
  action: button
@@ -73,9 +74,13 @@ ProgressionBanner.propTypes = {
73
74
  button: PropTypes.node,
74
75
 
75
76
  /** Progression bar is hidden if set to false (defaults to true) */
76
- progressBar: PropTypes.bool
77
+ progressBar: PropTypes.bool,
78
+
79
+ /** Background color of the banner, css color */
80
+ color: PropTypes.string
77
81
  };
78
82
  ProgressionBanner.defaultProps = {
79
- progressBar: true
83
+ progressBar: true,
84
+ color: 'var(--contrastBackgroundColor)'
80
85
  };
81
86
  export default ProgressionBanner;