cozy-ui 111.20.0 → 111.21.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
+ # [111.21.0](https://github.com/cozy/cozy-ui/compare/v111.20.0...v111.21.0) (2024-10-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * **ListItemSkeleton:** Add gutters property to mock ListItem behavior ([01ce10a](https://github.com/cozy/cozy-ui/commit/01ce10a))
7
+
1
8
  # [111.20.0](https://github.com/cozy/cozy-ui/compare/v111.19.0...v111.20.0) (2024-10-17)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "111.20.0",
3
+ "version": "111.21.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -7,10 +7,10 @@ import ListItemIcon from '../ListItemIcon'
7
7
  import ListItemText from '../ListItemText'
8
8
  import Skeleton from '../Skeleton'
9
9
 
10
- const ListItemSkeleton = ({ hasSecondary, divider }) => {
10
+ const ListItemSkeleton = ({ hasSecondary, divider, gutters }) => {
11
11
  return (
12
12
  <>
13
- <ListItem>
13
+ <ListItem gutters={gutters}>
14
14
  <ListItemIcon>
15
15
  <Skeleton
16
16
  className="u-bdrs-4"
@@ -35,7 +35,8 @@ ListItemSkeleton.propTypes = {
35
35
  /** Show secondary line or not */
36
36
  hasSecondary: PropTypes.bool,
37
37
  /** Show divider after the ListItem */
38
- divider: PropTypes.bool
38
+ divider: PropTypes.bool,
39
+ gutters: PropTypes.string
39
40
  }
40
41
 
41
42
  export default ListItemSkeleton
@@ -26,16 +26,25 @@ const initialVariants = [{ hasSecondary: false, withSubheader: false, divider: f
26
26
  import Variants from 'cozy-ui/docs/components/Variants'
27
27
  import ListItemSkeleton from 'cozy-ui/transpiled/react/Skeletons/ListItemSkeleton'
28
28
 
29
- const initialVariants = [{ hasSecondary: false, divider: false }]
29
+ const initialVariants = [{
30
+ hasSecondary: false,
31
+ divider: false,
32
+ disabledGutters: false,
33
+ doubleGutters: false
34
+ }]
30
35
 
31
36
  ;
32
37
 
33
38
  <Variants initialVariants={initialVariants} screenshotAllVariants>
34
- {variant => (
39
+ {variant => {
40
+ const gutters = variant.disabledGutters ? 'disabled' : variant.doubleGutters ? 'double' : 'default'
41
+
42
+ return (
35
43
  <ListItemSkeleton
36
44
  hasSecondary={variant.hasSecondary}
37
45
  divider={variant.divider}
46
+ gutters={gutters}
38
47
  />
39
- )}
48
+ )}}
40
49
  </Variants>
41
50
  ```
@@ -8,8 +8,11 @@ import Skeleton from "cozy-ui/transpiled/react/Skeleton";
8
8
 
9
9
  var ListItemSkeleton = function ListItemSkeleton(_ref) {
10
10
  var hasSecondary = _ref.hasSecondary,
11
- divider = _ref.divider;
12
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Skeleton, {
11
+ divider = _ref.divider,
12
+ gutters = _ref.gutters;
13
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItem, {
14
+ gutters: gutters
15
+ }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Skeleton, {
13
16
  className: "u-bdrs-4",
14
17
  variant: "rect",
15
18
  width: 32,
@@ -31,6 +34,7 @@ ListItemSkeleton.propTypes = {
31
34
  hasSecondary: PropTypes.bool,
32
35
 
33
36
  /** Show divider after the ListItem */
34
- divider: PropTypes.bool
37
+ divider: PropTypes.bool,
38
+ gutters: PropTypes.string
35
39
  };
36
40
  export default ListItemSkeleton;