cozy-ui 107.1.0 → 107.2.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
+ # [107.2.0](https://github.com/cozy/cozy-ui/compare/v107.1.0...v107.2.0) (2024-05-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **IconStack:** The `foregroundIcon` container is not useful ([1895af7](https://github.com/cozy/cozy-ui/commit/1895af7))
7
+
1
8
  # [107.1.0](https://github.com/cozy/cozy-ui/compare/v107.0.0...v107.1.0) (2024-05-29)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "107.1.0",
3
+ "version": "107.2.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -1,5 +1,6 @@
1
1
  import React from 'react'
2
2
  import classNames from 'classnames'
3
+ import PropTypes from 'prop-types'
3
4
 
4
5
  import migrateProps from '../helpers/migrateProps'
5
6
  import styles from './styles.styl'
@@ -16,19 +17,35 @@ const IconStack = ({
16
17
  className={classNames(styles['IconStack-wrapper'], backgroundClassName)}
17
18
  >
18
19
  {backgroundIcon}
19
- <div
20
- style={{ marginTop: offset?.vertical, marginLeft: offset?.horizontal }}
21
- className={classNames(
22
- styles['IconStack-foregroundIcon'],
23
- foregroundClassName
24
- )}
25
- >
26
- {foregroundIcon}
27
- </div>
20
+ {foregroundIcon && (
21
+ <div
22
+ style={{
23
+ marginTop: offset?.vertical,
24
+ marginLeft: offset?.horizontal
25
+ }}
26
+ className={classNames(
27
+ styles['IconStack-foregroundIcon'],
28
+ foregroundClassName
29
+ )}
30
+ >
31
+ {foregroundIcon}
32
+ </div>
33
+ )}
28
34
  </div>
29
35
  )
30
36
  }
31
37
 
38
+ IconStack.propTypes = {
39
+ backgroundClassName: PropTypes.string,
40
+ foregroundClassName: PropTypes.string,
41
+ backgroundIcon: PropTypes.node,
42
+ foregroundIcon: PropTypes.node,
43
+ offset: PropTypes.shape({
44
+ vertical: PropTypes.string,
45
+ horizontal: PropTypes.string
46
+ })
47
+ }
48
+
32
49
  export default migrateProps([
33
50
  { src: 'className', dest: 'backgroundClassName' },
34
51
  { src: 'background', dest: 'backgroundIcon' },
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
+ import PropTypes from 'prop-types';
3
4
  import migrateProps from "cozy-ui/transpiled/react/helpers/migrateProps";
4
5
  var styles = {
5
6
  "IconStack-wrapper": "styles__IconStack-wrapper___10dhG",
@@ -14,7 +15,7 @@ var IconStack = function IconStack(_ref) {
14
15
  offset = _ref.offset;
15
16
  return /*#__PURE__*/React.createElement("div", {
16
17
  className: classNames(styles['IconStack-wrapper'], backgroundClassName)
17
- }, backgroundIcon, /*#__PURE__*/React.createElement("div", {
18
+ }, backgroundIcon, foregroundIcon && /*#__PURE__*/React.createElement("div", {
18
19
  style: {
19
20
  marginTop: offset === null || offset === void 0 ? void 0 : offset.vertical,
20
21
  marginLeft: offset === null || offset === void 0 ? void 0 : offset.horizontal
@@ -23,6 +24,16 @@ var IconStack = function IconStack(_ref) {
23
24
  }, foregroundIcon));
24
25
  };
25
26
 
27
+ IconStack.propTypes = {
28
+ backgroundClassName: PropTypes.string,
29
+ foregroundClassName: PropTypes.string,
30
+ backgroundIcon: PropTypes.node,
31
+ foregroundIcon: PropTypes.node,
32
+ offset: PropTypes.shape({
33
+ vertical: PropTypes.string,
34
+ horizontal: PropTypes.string
35
+ })
36
+ };
26
37
  export default migrateProps([{
27
38
  src: 'className',
28
39
  dest: 'backgroundClassName'