cozy-ui 128.5.0 → 128.6.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,10 @@
1
+ # [128.6.0](https://github.com/cozy/cozy-ui/compare/v128.5.0...v128.6.0) (2025-09-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * **DropdownText:** add color prop for Typography and update README example ([f5006b0](https://github.com/cozy/cozy-ui/commit/f5006b0))
7
+
1
8
  # [128.5.0](https://github.com/cozy/cozy-ui/compare/v128.4.0...v128.5.0) (2025-09-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "128.5.0",
3
+ "version": "128.6.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -22,7 +22,7 @@ const variants = [
22
22
 
23
23
  <>
24
24
  <Grid container>
25
- <Grid item xs={6}>
25
+ <Grid item xs={6} sm={3} sd={2}>
26
26
  Default
27
27
  {variants.map((variant, index) => (
28
28
  <div key={index} className='u-mb-1'>
@@ -32,7 +32,7 @@ const variants = [
32
32
  </div>
33
33
  ))}
34
34
  </Grid>
35
- <Grid item xs={6}>
35
+ <Grid item xs={6} sm={3} sd={2}>
36
36
  Disabled
37
37
  {variants.map((variant, index) => (
38
38
  <div key={index} className='u-mb-1'>
@@ -42,7 +42,29 @@ const variants = [
42
42
  </div>
43
43
  ))}
44
44
  </Grid>
45
+ <Grid item xs={6} sm={3} sd={2}>
46
+ Color primary
47
+ {variants.map((variant, index) => (
48
+ <div key={index} className='u-mb-1'>
49
+ <DropdownText variant={variant} color="primary">
50
+ {variant}
51
+ </DropdownText>
52
+ </div>
53
+ ))}
54
+ </Grid>
55
+ <Grid item xs={6} sm={3} sd={2}>
56
+ Color error
57
+ {variants.map((variant, index) => (
58
+ <div key={index} className='u-mb-1'>
59
+ <DropdownText variant={variant} color="error">
60
+ {variant}
61
+ </DropdownText>
62
+ </div>
63
+ ))}
64
+ </Grid>
45
65
  </Grid>
66
+
67
+ <p>
46
68
  <div style={{ border: '1px dashed var(--borderMainColor)', marginBottom: '1rem' }}>
47
69
  <DropdownText>
48
70
  This is a long text without ellipsis without restrictive container
@@ -68,5 +90,6 @@ const variants = [
68
90
  Space between text and icon
69
91
  </DropdownText>
70
92
  </div>
93
+ </p>
71
94
  </>
72
95
  ```
@@ -16,14 +16,14 @@ const useStyles = makeStyles(theme => ({
16
16
  },
17
17
  typography: {
18
18
  color: ({ disabled }) =>
19
- theme.palette.text[disabled ? 'disabled' : 'primary']
19
+ disabled ? theme.palette.text.disabled : undefined
20
20
  },
21
21
  endIcon: {
22
22
  display: 'flex',
23
23
  marginLeft: '5px',
24
24
  marginTop: ({ variant }) => (variant === 'body1' ? '3px' : undefined),
25
25
  color: ({ disabled }) =>
26
- theme.palette.text[disabled ? 'disabled' : 'primary']
26
+ disabled ? theme.palette.text.disabled : undefined
27
27
  }
28
28
  }))
29
29
 
@@ -48,7 +48,7 @@ const DropdownText = forwardRef(
48
48
  variant = 'body1',
49
49
  disabled = false,
50
50
  noWrap = false,
51
- color = 'primary',
51
+ color = 'initial',
52
52
  children,
53
53
  innerTextProps,
54
54
  innerIconContainerProps,
@@ -57,11 +57,12 @@ const DropdownText = forwardRef(
57
57
  },
58
58
  ref
59
59
  ) => {
60
- const styles = useStyles({ spaceBetween, disabled, color, variant })
60
+ const styles = useStyles({ spaceBetween, disabled, variant })
61
61
 
62
62
  return (
63
63
  <div ref={ref} className={styles.container} {...props}>
64
64
  <Typography
65
+ color={color}
65
66
  classes={{ root: styles.typography }}
66
67
  variant={variant}
67
68
  noWrap={noWrap}
@@ -70,6 +71,7 @@ const DropdownText = forwardRef(
70
71
  {children}
71
72
  </Typography>
72
73
  <Typography
74
+ color={color}
73
75
  classes={{ root: styles.endIcon }}
74
76
  {...innerIconContainerProps}
75
77
  >
@@ -85,6 +87,8 @@ const DropdownText = forwardRef(
85
87
  )
86
88
 
87
89
  DropdownText.propTypes = {
90
+ /** Color used by Typography component */
91
+ color: PropTypes.string,
88
92
  /** Whether there is a space between the label and the icon */
89
93
  spaceBetween: PropTypes.bool,
90
94
  /** Variant used by Typography component */
@@ -21,7 +21,7 @@ var useStyles = makeStyles(function (theme) {
21
21
  typography: {
22
22
  color: function color(_ref2) {
23
23
  var disabled = _ref2.disabled;
24
- return theme.palette.text[disabled ? 'disabled' : 'primary'];
24
+ return disabled ? theme.palette.text.disabled : undefined;
25
25
  }
26
26
  },
27
27
  endIcon: {
@@ -33,7 +33,7 @@ var useStyles = makeStyles(function (theme) {
33
33
  },
34
34
  color: function color(_ref4) {
35
35
  var disabled = _ref4.disabled;
36
- return theme.palette.text[disabled ? 'disabled' : 'primary'];
36
+ return disabled ? theme.palette.text.disabled : undefined;
37
37
  }
38
38
  }
39
39
  };
@@ -61,7 +61,7 @@ var DropdownText = /*#__PURE__*/forwardRef(function (_ref5, ref) {
61
61
  _ref5$noWrap = _ref5.noWrap,
62
62
  noWrap = _ref5$noWrap === void 0 ? false : _ref5$noWrap,
63
63
  _ref5$color = _ref5.color,
64
- color = _ref5$color === void 0 ? 'primary' : _ref5$color,
64
+ color = _ref5$color === void 0 ? 'initial' : _ref5$color,
65
65
  children = _ref5.children,
66
66
  innerTextProps = _ref5.innerTextProps,
67
67
  innerIconContainerProps = _ref5.innerIconContainerProps,
@@ -71,19 +71,20 @@ var DropdownText = /*#__PURE__*/forwardRef(function (_ref5, ref) {
71
71
  var styles = useStyles({
72
72
  spaceBetween: spaceBetween,
73
73
  disabled: disabled,
74
- color: color,
75
74
  variant: variant
76
75
  });
77
76
  return /*#__PURE__*/React.createElement("div", _extends({
78
77
  ref: ref,
79
78
  className: styles.container
80
79
  }, props), /*#__PURE__*/React.createElement(Typography, _extends({
80
+ color: color,
81
81
  classes: {
82
82
  root: styles.typography
83
83
  },
84
84
  variant: variant,
85
85
  noWrap: noWrap
86
86
  }, innerTextProps), children), /*#__PURE__*/React.createElement(Typography, _extends({
87
+ color: color,
87
88
  classes: {
88
89
  root: styles.endIcon
89
90
  }
@@ -93,6 +94,9 @@ var DropdownText = /*#__PURE__*/forwardRef(function (_ref5, ref) {
93
94
  }, innerIconProps))));
94
95
  });
95
96
  DropdownText.propTypes = {
97
+ /** Color used by Typography component */
98
+ color: PropTypes.string,
99
+
96
100
  /** Whether there is a space between the label and the icon */
97
101
  spaceBetween: PropTypes.bool,
98
102