cozy-ui 125.1.0 → 126.0.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,16 @@
1
+ # [126.0.0](https://github.com/cozy/cozy-ui/compare/v125.1.0...v126.0.0) (2025-06-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add new QualificationIcon and use it in QualificationModal ([65cadc4](https://github.com/cozy/cozy-ui/commit/65cadc4))
7
+ * Remove QualificationIconStack component ([d520f80](https://github.com/cozy/cozy-ui/commit/d520f80))
8
+
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * You must replace `QualificationIconStack` by `QualificationIcon`
13
+
1
14
  # [125.1.0](https://github.com/cozy/cozy-ui/compare/v125.0.0...v125.1.0) (2025-06-11)
2
15
 
3
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "125.1.0",
3
+ "version": "126.0.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -0,0 +1,14 @@
1
+ ```jsx
2
+ import QualificationIcon from 'cozy-ui/transpiled/react/QualificationIcon'
3
+
4
+ ;
5
+
6
+ <>
7
+ <QualificationIcon className="u-mr-1" />
8
+ <QualificationIcon className="u-mr-1" qualification="isp_invoice" />
9
+ <QualificationIcon className="u-mr-1" qualification="phone_invoice" />
10
+ <QualificationIcon className="u-mr-1" qualification="family_record_book" />
11
+ <QualificationIcon className="u-mr-1" theme="identity" />
12
+ <QualificationIcon theme="transport" />
13
+ </>
14
+ ```
@@ -4,7 +4,6 @@ import React from 'react'
4
4
  import { getIconByLabel } from 'cozy-client/dist/models/document/qualification'
5
5
 
6
6
  import Icon from '../Icon'
7
- import IconStack from '../IconStack'
8
7
  import BankIcon from '../Icons/Bank'
9
8
  import BankCheckIcon from '../Icons/BankCheck'
10
9
  import BenefitIcon from '../Icons/Benefit'
@@ -16,8 +15,6 @@ import DotsIcon from '../Icons/Dots'
16
15
  import EmailIcon from '../Icons/Email'
17
16
  import EuroIcon from '../Icons/Euro'
18
17
  import ExchangeIcon from '../Icons/Exchange'
19
- import FileDuotoneIcon from '../Icons/FileDuotone'
20
- import FileTypeNoteIcon from '../Icons/FileTypeNote'
21
18
  import FitnessIcon from '../Icons/Fitness'
22
19
  import GlobeIcon from '../Icons/Globe'
23
20
  import GouvIcon from '../Icons/Gouv'
@@ -27,6 +24,7 @@ import ImageIcon from '../Icons/Image'
27
24
  import JusticeIcon from '../Icons/Justice'
28
25
  import LaudryIcon from '../Icons/Laudry'
29
26
  import LightningIcon from '../Icons/Lightning'
27
+ import NoteIcon from '../Icons/Note'
30
28
  import PeopleIcon from '../Icons/People'
31
29
  import PlaneIcon from '../Icons/Plane'
32
30
  import RemboursementIcon from '../Icons/Remboursement'
@@ -39,20 +37,6 @@ import TelephoneIcon from '../Icons/Telephone'
39
37
  import WaterIcon from '../Icons/Water'
40
38
  import WorkIcon from '../Icons/Work'
41
39
 
42
- // this is a copy of FileDuotone without the flap and with a white background
43
- function FileDuotoneWhite(props) {
44
- return (
45
- <svg viewBox="0 0 26 32" {...props}>
46
- <g fillRule="evenodd">
47
- <path
48
- d="M0 2.002C0 .896.89 0 1.997 0H19l7 7v22.996A2 2 0 0124.003 32H1.997A1.995 1.995 0 010 29.998C.048 16 0 16 0 2.002z"
49
- fill="#ffffff"
50
- />
51
- </g>
52
- </svg>
53
- )
54
- }
55
-
56
40
  const IconByLabel = {
57
41
  'bank-check': BankCheckIcon,
58
42
  bank: BankIcon,
@@ -65,7 +49,7 @@ const IconByLabel = {
65
49
  email: EmailIcon,
66
50
  euro: EuroIcon,
67
51
  exchange: ExchangeIcon,
68
- 'file-type-note': FileTypeNoteIcon,
52
+ 'file-type-note': NoteIcon,
69
53
  fitness: FitnessIcon,
70
54
  globe: GlobeIcon,
71
55
  gouv: GouvIcon,
@@ -101,32 +85,21 @@ const themeIconByLabel = {
101
85
  others: 'dots'
102
86
  }
103
87
 
104
- const QualificationIconStack = ({ theme, qualification, ...props }) => {
105
- const ForegroundIcon = qualification
88
+ const QualificationIcon = ({ theme, qualification, ...props }) => {
89
+ const _Icon = qualification
106
90
  ? IconByLabel[getIconByLabel(qualification)]
107
91
  : theme
108
92
  ? IconByLabel[themeIconByLabel[theme]]
109
93
  : null
110
94
 
111
- return (
112
- <IconStack
113
- {...props}
114
- backgroundIcon={
115
- <>
116
- <Icon className="u-pos-absolute" icon={FileDuotoneWhite} size={32} />
117
- <Icon icon={FileDuotoneIcon} color="#E049BF" size={32} />
118
- </>
119
- }
120
- foregroundIcon={<Icon icon={ForegroundIcon} color="#E049BF" size={16} />}
121
- />
122
- )
95
+ return <Icon icon={_Icon} color="#E049BF" size={16} {...props} />
123
96
  }
124
97
 
125
- QualificationIconStack.propTypes = {
98
+ QualificationIcon.propTypes = {
126
99
  /** The name of the qualification (isp\_invoice, family\_record\_book, etc.) */
127
100
  qualification: PropTypes.string,
128
101
  /** The name of the qualification theme (indentity, family, etc.) */
129
102
  theme: PropTypes.string
130
103
  }
131
104
 
132
- export default QualificationIconStack
105
+ export default QualificationIcon
@@ -5,8 +5,8 @@ import { isQualificationNote } from 'cozy-client/dist/models/document/documentTy
5
5
  import { getBoundT } from 'cozy-client/dist/models/document/locales'
6
6
 
7
7
  import Icon from '../Icon'
8
- import FileTypeNoteIcon from '../Icons/FileTypeNote'
9
- import QualificationIconStack from '../QualificationIconStack'
8
+ import NoteIcon from '../Icons/Note'
9
+ import QualificationIcon from '../QualificationIcon'
10
10
 
11
11
  export const makeOptions = lang => {
12
12
  const qualifT = getBoundT(lang)
@@ -16,20 +16,20 @@ export const makeOptions = lang => {
16
16
  {
17
17
  id: 'none',
18
18
  title: qualifT('Scan.themes.none'),
19
- icon: <QualificationIconStack />
19
+ icon: <QualificationIcon />
20
20
  },
21
21
  ...themesList.map(theme => ({
22
22
  id: theme.id,
23
23
  title: qualifT(`Scan.themes.${theme.label}`),
24
- icon: <QualificationIconStack theme={theme.label} />,
24
+ icon: <QualificationIcon theme={theme.label} />,
25
25
  children: theme.items.map(item => ({
26
26
  id: item.label,
27
27
  item,
28
28
  title: qualifT(`Scan.items.${item.label}`),
29
29
  icon: isQualificationNote(item) ? (
30
- <Icon icon={FileTypeNoteIcon} size={64} />
30
+ <Icon icon={NoteIcon} color="#E049BF" size={16} />
31
31
  ) : (
32
- <QualificationIconStack qualification={item.label} />
32
+ <QualificationIcon qualification={item.label} />
33
33
  )
34
34
  }))
35
35
  }))
package/react/index.js CHANGED
@@ -125,7 +125,7 @@ export { default as Thumbnail } from './Thumbnail'
125
125
  export { default as ButtonBase } from './ButtonBase'
126
126
  export { default as QualificationGrid } from './QualificationGrid'
127
127
  export { default as QualificationItem } from './QualificationItem'
128
- export { default as QualificationIconStack } from './QualificationIconStack'
128
+ export { default as QualificationIcon } from './QualificationIcon'
129
129
  export { default as QualificationModal } from './QualificationModal'
130
130
  export { default as Timeline } from './Timeline'
131
131
  export { default as TimelineConnector } from './TimelineConnector'
@@ -1,10 +1,10 @@
1
- export default QualificationIconStack;
2
- declare function QualificationIconStack({ theme, qualification, ...props }: {
1
+ export default QualificationIcon;
2
+ declare function QualificationIcon({ theme, qualification, ...props }: {
3
3
  [x: string]: any;
4
4
  theme: any;
5
5
  qualification: any;
6
6
  }): JSX.Element;
7
- declare namespace QualificationIconStack {
7
+ declare namespace QualificationIcon {
8
8
  namespace propTypes {
9
9
  const qualification: PropTypes.Requireable<string>;
10
10
  const theme: PropTypes.Requireable<string>;
@@ -1,11 +1,10 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["theme", "qualification"];
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import { getIconByLabel } from 'cozy-client/dist/models/document/qualification';
7
7
  import Icon from "cozy-ui/transpiled/react/Icon";
8
- import IconStack from "cozy-ui/transpiled/react/IconStack";
9
8
  import BankIcon from "cozy-ui/transpiled/react/Icons/Bank";
10
9
  import BankCheckIcon from "cozy-ui/transpiled/react/Icons/BankCheck";
11
10
  import BenefitIcon from "cozy-ui/transpiled/react/Icons/Benefit";
@@ -17,8 +16,6 @@ import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
17
16
  import EmailIcon from "cozy-ui/transpiled/react/Icons/Email";
18
17
  import EuroIcon from "cozy-ui/transpiled/react/Icons/Euro";
19
18
  import ExchangeIcon from "cozy-ui/transpiled/react/Icons/Exchange";
20
- import FileDuotoneIcon from "cozy-ui/transpiled/react/Icons/FileDuotone";
21
- import FileTypeNoteIcon from "cozy-ui/transpiled/react/Icons/FileTypeNote";
22
19
  import FitnessIcon from "cozy-ui/transpiled/react/Icons/Fitness";
23
20
  import GlobeIcon from "cozy-ui/transpiled/react/Icons/Globe";
24
21
  import GouvIcon from "cozy-ui/transpiled/react/Icons/Gouv";
@@ -28,6 +25,7 @@ import ImageIcon from "cozy-ui/transpiled/react/Icons/Image";
28
25
  import JusticeIcon from "cozy-ui/transpiled/react/Icons/Justice";
29
26
  import LaudryIcon from "cozy-ui/transpiled/react/Icons/Laudry";
30
27
  import LightningIcon from "cozy-ui/transpiled/react/Icons/Lightning";
28
+ import NoteIcon from "cozy-ui/transpiled/react/Icons/Note";
31
29
  import PeopleIcon from "cozy-ui/transpiled/react/Icons/People";
32
30
  import PlaneIcon from "cozy-ui/transpiled/react/Icons/Plane";
33
31
  import RemboursementIcon from "cozy-ui/transpiled/react/Icons/Remboursement";
@@ -38,19 +36,7 @@ import TeamIcon from "cozy-ui/transpiled/react/Icons/Team";
38
36
  import TelecomIcon from "cozy-ui/transpiled/react/Icons/Telecom";
39
37
  import TelephoneIcon from "cozy-ui/transpiled/react/Icons/Telephone";
40
38
  import WaterIcon from "cozy-ui/transpiled/react/Icons/Water";
41
- import WorkIcon from "cozy-ui/transpiled/react/Icons/Work"; // this is a copy of FileDuotone without the flap and with a white background
42
-
43
- function FileDuotoneWhite(props) {
44
- return /*#__PURE__*/React.createElement("svg", _extends({
45
- viewBox: "0 0 26 32"
46
- }, props), /*#__PURE__*/React.createElement("g", {
47
- fillRule: "evenodd"
48
- }, /*#__PURE__*/React.createElement("path", {
49
- d: "M0 2.002C0 .896.89 0 1.997 0H19l7 7v22.996A2 2 0 0124.003 32H1.997A1.995 1.995 0 010 29.998C.048 16 0 16 0 2.002z",
50
- fill: "#ffffff"
51
- })));
52
- }
53
-
39
+ import WorkIcon from "cozy-ui/transpiled/react/Icons/Work";
54
40
  var IconByLabel = {
55
41
  'bank-check': BankCheckIcon,
56
42
  bank: BankIcon,
@@ -63,7 +49,7 @@ var IconByLabel = {
63
49
  email: EmailIcon,
64
50
  euro: EuroIcon,
65
51
  exchange: ExchangeIcon,
66
- 'file-type-note': FileTypeNoteIcon,
52
+ 'file-type-note': NoteIcon,
67
53
  fitness: FitnessIcon,
68
54
  globe: GlobeIcon,
69
55
  gouv: GouvIcon,
@@ -98,35 +84,25 @@ var themeIconByLabel = {
98
84
  others: 'dots'
99
85
  };
100
86
 
101
- var QualificationIconStack = function QualificationIconStack(_ref) {
87
+ var QualificationIcon = function QualificationIcon(_ref) {
102
88
  var theme = _ref.theme,
103
89
  qualification = _ref.qualification,
104
90
  props = _objectWithoutProperties(_ref, _excluded);
105
91
 
106
- var ForegroundIcon = qualification ? IconByLabel[getIconByLabel(qualification)] : theme ? IconByLabel[themeIconByLabel[theme]] : null;
107
- return /*#__PURE__*/React.createElement(IconStack, _extends({}, props, {
108
- backgroundIcon: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
109
- className: "u-pos-absolute",
110
- icon: FileDuotoneWhite,
111
- size: 32
112
- }), /*#__PURE__*/React.createElement(Icon, {
113
- icon: FileDuotoneIcon,
114
- color: "#E049BF",
115
- size: 32
116
- })),
117
- foregroundIcon: /*#__PURE__*/React.createElement(Icon, {
118
- icon: ForegroundIcon,
119
- color: "#E049BF",
120
- size: 16
121
- })
122
- }));
92
+ var _Icon = qualification ? IconByLabel[getIconByLabel(qualification)] : theme ? IconByLabel[themeIconByLabel[theme]] : null;
93
+
94
+ return /*#__PURE__*/React.createElement(Icon, _extends({
95
+ icon: _Icon,
96
+ color: "#E049BF",
97
+ size: 16
98
+ }, props));
123
99
  };
124
100
 
125
- QualificationIconStack.propTypes = {
101
+ QualificationIcon.propTypes = {
126
102
  /** The name of the qualification (isp\_invoice, family\_record\_book, etc.) */
127
103
  qualification: PropTypes.string,
128
104
 
129
105
  /** The name of the qualification theme (indentity, family, etc.) */
130
106
  theme: PropTypes.string
131
107
  };
132
- export default QualificationIconStack;
108
+ export default QualificationIcon;
@@ -4,20 +4,20 @@ import { themesList } from 'cozy-client/dist/models/document/documentTypeData';
4
4
  import { isQualificationNote } from 'cozy-client/dist/models/document/documentTypeDataHelpers';
5
5
  import { getBoundT } from 'cozy-client/dist/models/document/locales';
6
6
  import Icon from "cozy-ui/transpiled/react/Icon";
7
- import FileTypeNoteIcon from "cozy-ui/transpiled/react/Icons/FileTypeNote";
8
- import QualificationIconStack from "cozy-ui/transpiled/react/QualificationIconStack";
7
+ import NoteIcon from "cozy-ui/transpiled/react/Icons/Note";
8
+ import QualificationIcon from "cozy-ui/transpiled/react/QualificationIcon";
9
9
  export var makeOptions = function makeOptions(lang) {
10
10
  var qualifT = getBoundT(lang);
11
11
  return {
12
12
  children: [{
13
13
  id: 'none',
14
14
  title: qualifT('Scan.themes.none'),
15
- icon: /*#__PURE__*/React.createElement(QualificationIconStack, null)
15
+ icon: /*#__PURE__*/React.createElement(QualificationIcon, null)
16
16
  }].concat(_toConsumableArray(themesList.map(function (theme) {
17
17
  return {
18
18
  id: theme.id,
19
19
  title: qualifT("Scan.themes.".concat(theme.label)),
20
- icon: /*#__PURE__*/React.createElement(QualificationIconStack, {
20
+ icon: /*#__PURE__*/React.createElement(QualificationIcon, {
21
21
  theme: theme.label
22
22
  }),
23
23
  children: theme.items.map(function (item) {
@@ -26,9 +26,10 @@ export var makeOptions = function makeOptions(lang) {
26
26
  item: item,
27
27
  title: qualifT("Scan.items.".concat(item.label)),
28
28
  icon: isQualificationNote(item) ? /*#__PURE__*/React.createElement(Icon, {
29
- icon: FileTypeNoteIcon,
30
- size: 64
31
- }) : /*#__PURE__*/React.createElement(QualificationIconStack, {
29
+ icon: NoteIcon,
30
+ color: "#E049BF",
31
+ size: 16
32
+ }) : /*#__PURE__*/React.createElement(QualificationIcon, {
32
33
  qualification: item.label
33
34
  })
34
35
  };
@@ -84,7 +84,7 @@ export { default as Thumbnail } from "./Thumbnail";
84
84
  export { default as ButtonBase } from "./ButtonBase";
85
85
  export { default as QualificationGrid } from "./QualificationGrid";
86
86
  export { default as QualificationItem } from "./QualificationItem";
87
- export { default as QualificationIconStack } from "./QualificationIconStack";
87
+ export { default as QualificationIcon } from "./QualificationIcon";
88
88
  export { default as QualificationModal } from "./QualificationModal";
89
89
  export { default as Timeline } from "./Timeline";
90
90
  export { default as TimelineConnector } from "./TimelineConnector";
@@ -98,7 +98,7 @@ export { default as Thumbnail } from './Thumbnail';
98
98
  export { default as ButtonBase } from './ButtonBase';
99
99
  export { default as QualificationGrid } from './QualificationGrid';
100
100
  export { default as QualificationItem } from './QualificationItem';
101
- export { default as QualificationIconStack } from './QualificationIconStack';
101
+ export { default as QualificationIcon } from './QualificationIcon';
102
102
  export { default as QualificationModal } from './QualificationModal';
103
103
  export { default as Timeline } from './Timeline';
104
104
  export { default as TimelineConnector } from './TimelineConnector';
@@ -1,14 +0,0 @@
1
- ```jsx
2
- import QualificationIconStack from 'cozy-ui/transpiled/react/QualificationIconStack'
3
-
4
- ;
5
-
6
- <>
7
- <QualificationIconStack className="u-mr-1" />
8
- <QualificationIconStack className="u-mr-1" qualification="isp_invoice" />
9
- <QualificationIconStack className="u-mr-1" qualification="phone_invoice" />
10
- <QualificationIconStack className="u-mr-1" qualification="family_record_book" />
11
- <QualificationIconStack className="u-mr-1" theme="identity" />
12
- <QualificationIconStack theme="transport" />
13
- </>
14
- ```