cozy-ui-plus 8.0.0 → 9.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 +16 -0
- package/dist/AppIcon/index.js +5 -7
- package/dist/AppSections/components/DropdownFilter.js +4 -6
- package/dist/AppTile/index.js +4 -6
- package/dist/CipherIcon/index.js +4 -6
- package/dist/CollectionField/index.js +6 -10
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +4 -8
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +4 -6
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +3 -3
- package/dist/Contacts/AddModal/ContactForm/RemoveButton.js +4 -6
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +14 -36
- package/dist/Contacts/AddModal/types.js +1 -3
- package/dist/Contacts/GroupsSelect/GroupCreation.js +4 -6
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +4 -6
- package/dist/Contacts/Header/ImportDropdown.js +6 -10
- package/dist/Contacts/Header/index.js +4 -6
- package/dist/ContactsListModal/AddContact/AddContactContent.js +4 -6
- package/dist/ContactsListModal/ContactsListModal.js +6 -8
- package/dist/ContactsListModal/MobileHeader.js +4 -6
- package/dist/Dialogs/AuthentificationDialog/index.js +3 -3
- package/dist/FilePicker/FilePickerBodyItem.js +4 -8
- package/dist/FilePicker/FilePickerBreadcrumb.js +4 -6
- package/dist/FilePicker/FilePickerHeader.js +4 -6
- package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +4 -6
- package/dist/ListItem/ListItemBase/index.js +4 -6
- package/dist/ListItem/ListItemContact/index.js +5 -7
- package/dist/ListItem/ListItemFile/ItemIcon.js +4 -8
- package/dist/ListItem/ListItemFile/index.js +3 -3
- package/dist/Paywall/Paywall.js +4 -6
- package/dist/Qualification/QualificationGrid/index.js +12 -30
- package/dist/Qualification/QualificationIcon/index.js +35 -99
- package/dist/Qualification/QualificationItem/index.js +6 -13
- package/dist/Qualification/QualificationModal/helpers.js +4 -6
- package/dist/SquareAppIcon/index.js +10 -20
- package/dist/Storage/StorageButton.js +4 -6
- package/dist/Storage/StorageProgress.js +4 -6
- package/dist/providers/CozyTheme/CozyThemeWithQuery.js +3 -1
- package/dist/src/AppIcon/index.d.ts +9 -10
- package/dist/src/Contacts/AddModal/ContactAddressDialog/index.d.ts +1 -1
- package/dist/src/Contacts/AddModal/types.d.ts +1 -1
- package/jest.config.js +2 -1
- package/package.json +4 -2
- package/src/AppIcon/index.jsx +7 -4
- package/src/AppIcon/index.spec.js +9 -7
- package/src/AppSections/components/DropdownFilter.jsx +2 -3
- package/src/AppTile/index.jsx +2 -3
- package/src/CipherIcon/index.jsx +2 -3
- package/src/CollectionField/index.jsx +3 -7
- package/src/Contacts/AddModal/ContactForm/FieldInputAccordion.jsx +2 -4
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +2 -3
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +1 -1
- package/src/Contacts/AddModal/ContactForm/RemoveButton.jsx +2 -3
- package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +25 -23
- package/src/Contacts/AddModal/types.js +5 -3
- package/src/Contacts/GroupsSelect/GroupCreation.jsx +2 -3
- package/src/Contacts/GroupsSelect/SelectBox/Control.jsx +2 -3
- package/src/Contacts/Header/ImportDropdown.jsx +3 -8
- package/src/Contacts/Header/index.jsx +2 -3
- package/src/ContactsListModal/AddContact/AddContactContent.jsx +2 -3
- package/src/ContactsListModal/ContactsListModal.jsx +3 -4
- package/src/ContactsListModal/MobileHeader.jsx +2 -3
- package/src/Dialogs/AuthentificationDialog/index.jsx +2 -2
- package/src/FilePicker/FilePickerBodyItem.jsx +1 -3
- package/src/FilePicker/FilePickerBreadcrumb.jsx +2 -3
- package/src/FilePicker/FilePickerHeader.jsx +1 -2
- package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +2 -3
- package/src/ListItem/ListItemBase/index.jsx +2 -3
- package/src/ListItem/ListItemContact/index.jsx +3 -4
- package/src/ListItem/ListItemFile/ItemIcon.jsx +2 -4
- package/src/ListItem/ListItemFile/index.jsx +2 -2
- package/src/Paywall/Paywall.jsx +2 -3
- package/src/Qualification/QualificationGrid/index.jsx +22 -20
- package/src/Qualification/QualificationIcon/index.jsx +67 -65
- package/src/Qualification/QualificationItem/index.jsx +8 -4
- package/src/Qualification/QualificationModal/helpers.js +2 -3
- package/src/SquareAppIcon/SquareAppIcon.spec.js +3 -4
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +36 -87
- package/src/SquareAppIcon/index.jsx +12 -10
- package/src/Storage/StorageButton.jsx +2 -3
- package/src/Storage/StorageProgress.jsx +2 -3
- package/src/providers/CozyTheme/CozyThemeWithQuery.jsx +3 -1
- package/test/__mocks__/twake-icons.js +23 -0
|
@@ -11,26 +11,19 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
15
|
+
|
|
14
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
17
|
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
|
17
19
|
|
|
18
20
|
var _ButtonBase = _interopRequireDefault(require("cozy-ui/transpiled/react/ButtonBase"));
|
|
19
21
|
|
|
20
|
-
var _Icon = _interopRequireWildcard(require("cozy-ui/transpiled/react/Icon"));
|
|
21
|
-
|
|
22
|
-
var _FileDuotone = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/FileDuotone"));
|
|
23
|
-
|
|
24
22
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
25
23
|
|
|
26
24
|
var _styles = require("cozy-ui/transpiled/react/styles");
|
|
27
25
|
|
|
28
26
|
var _excluded = ["icon", "label", "isSelected", "onClick"];
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
27
|
var useStyles = (0, _styles.makeStyles)({
|
|
35
28
|
item: {
|
|
36
29
|
display: 'flex',
|
|
@@ -61,11 +54,11 @@ var QualificationItem = function QualificationItem(_ref2) {
|
|
|
61
54
|
onClick: onClick
|
|
62
55
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
63
56
|
className: "u-mb-half"
|
|
64
|
-
}, icon ? /*#__PURE__*/_react.default.createElement(
|
|
57
|
+
}, icon ? /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
65
58
|
icon: icon,
|
|
66
59
|
color: isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
|
|
67
|
-
}) : /*#__PURE__*/_react.default.createElement(
|
|
68
|
-
icon:
|
|
60
|
+
}) : /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
61
|
+
icon: _twakeIcons.FileDuotone,
|
|
69
62
|
size: "32",
|
|
70
63
|
color: isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
|
|
71
64
|
})), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -74,7 +67,7 @@ var QualificationItem = function QualificationItem(_ref2) {
|
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
QualificationItem.propTypes = {
|
|
77
|
-
icon: _propTypes.default.oneOfType([_propTypes.default.node,
|
|
70
|
+
icon: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node, _propTypes.default.object, _propTypes.default.func]),
|
|
78
71
|
label: _propTypes.default.string,
|
|
79
72
|
isSelected: _propTypes.default.bool,
|
|
80
73
|
onClick: _propTypes.default.func
|
|
@@ -9,6 +9,8 @@ exports.searchOptionsFn = exports.makeSearchOptions = exports.makeOptions = void
|
|
|
9
9
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
|
|
12
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
13
|
+
|
|
12
14
|
var _react = _interopRequireDefault(require("react"));
|
|
13
15
|
|
|
14
16
|
var _documentTypeData = require("cozy-client/dist/models/document/documentTypeData");
|
|
@@ -17,10 +19,6 @@ var _documentTypeDataHelpers = require("cozy-client/dist/models/document/documen
|
|
|
17
19
|
|
|
18
20
|
var _locales = require("cozy-client/dist/models/document/locales");
|
|
19
21
|
|
|
20
|
-
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
21
|
-
|
|
22
|
-
var _Note = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Note"));
|
|
23
|
-
|
|
24
22
|
var _QualificationIcon = _interopRequireDefault(require("../QualificationIcon"));
|
|
25
23
|
|
|
26
24
|
var makeOptions = function makeOptions(lang) {
|
|
@@ -42,8 +40,8 @@ var makeOptions = function makeOptions(lang) {
|
|
|
42
40
|
id: item.label,
|
|
43
41
|
item: item,
|
|
44
42
|
title: qualifT("Scan.items.".concat(item.label)),
|
|
45
|
-
icon: (0, _documentTypeDataHelpers.isQualificationNote)(item) ? /*#__PURE__*/_react.default.createElement(
|
|
46
|
-
icon:
|
|
43
|
+
icon: (0, _documentTypeDataHelpers.isQualificationNote)(item) ? /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
44
|
+
icon: _twakeIcons.Note,
|
|
47
45
|
color: "#E049BF",
|
|
48
46
|
size: 16
|
|
49
47
|
}) : /*#__PURE__*/_react.default.createElement(_QualificationIcon.default, {
|
|
@@ -13,6 +13,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
|
|
16
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
17
|
+
|
|
16
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
19
|
|
|
18
20
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
@@ -25,18 +27,6 @@ var _helpers = require("cozy-ui/transpiled/react/Avatar/helpers");
|
|
|
25
27
|
|
|
26
28
|
var _Badge = _interopRequireDefault(require("cozy-ui/transpiled/react/Badge"));
|
|
27
29
|
|
|
28
|
-
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
29
|
-
|
|
30
|
-
var _IconCheckAnimated = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/IconCheckAnimated"));
|
|
31
|
-
|
|
32
|
-
var _IconCrossAnimated = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/IconCrossAnimated"));
|
|
33
|
-
|
|
34
|
-
var _LinkOut = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/LinkOut"));
|
|
35
|
-
|
|
36
|
-
var _Plus = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Plus"));
|
|
37
|
-
|
|
38
|
-
var _WarningCircle = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/WarningCircle"));
|
|
39
|
-
|
|
40
30
|
var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemText"));
|
|
41
31
|
|
|
42
32
|
var _Spinner = _interopRequireDefault(require("cozy-ui/transpiled/react/Spinner"));
|
|
@@ -188,9 +178,9 @@ var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
188
178
|
color: 'var(--iconTextColor)',
|
|
189
179
|
boxShadow: 'var(--shadow3)'
|
|
190
180
|
}
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
192
182
|
size: "10",
|
|
193
|
-
icon:
|
|
183
|
+
icon: _twakeIcons.LinkOut
|
|
194
184
|
})) : null,
|
|
195
185
|
className: (0, _classnames.default)((0, _defineProperty2.default)({}, 'u-mr-1', display === 'detailed')),
|
|
196
186
|
overlap: "rectangular",
|
|
@@ -204,10 +194,10 @@ var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
204
194
|
animationState: animationState
|
|
205
195
|
}), /*#__PURE__*/_react.default.createElement(_Badge.default, {
|
|
206
196
|
className: (0, _classnames.default)(styles["SquareAppIcon-wrapper"], styles["SquareAppIcon-wrapper-".concat(variant)], styles["SquareAppIcon-wrapper--".concat(type)], (_cx3 = {}, (0, _defineProperty2.default)(_cx3, classes.squareAppIconGhost, exceptionVariant.includes(variant)), (0, _defineProperty2.default)(_cx3, classes.shadow, !exceptionVariant.includes(variant)), _cx3)),
|
|
207
|
-
badgeContent: variant === 'error' ? /*#__PURE__*/_react.default.createElement(
|
|
197
|
+
badgeContent: variant === 'error' ? /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
208
198
|
size: 16,
|
|
209
199
|
className: (0, _classnames.default)(classes.errorIcon),
|
|
210
|
-
icon:
|
|
200
|
+
icon: _twakeIcons.WarningCircle
|
|
211
201
|
}) : '',
|
|
212
202
|
color: variant === 'error' ? 'error' : undefined,
|
|
213
203
|
withBorder: false,
|
|
@@ -223,11 +213,11 @@ var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
223
213
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
224
214
|
className: (0, _classnames.default)(styles['onEnd'], (0, _defineProperty2.default)({}, styles['isSuccess'], animationState === 'success'), (0, _defineProperty2.default)({}, styles['isFailed'], animationState === 'failed')),
|
|
225
215
|
onAnimationEnd: handleAnimationEnd
|
|
226
|
-
}, animationState && /*#__PURE__*/_react.default.createElement(
|
|
216
|
+
}, animationState && /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
227
217
|
size: 32,
|
|
228
|
-
icon: animationState === 'success' ?
|
|
229
|
-
})), variant === 'add' ? /*#__PURE__*/_react.default.createElement(
|
|
230
|
-
icon:
|
|
218
|
+
icon: animationState === 'success' ? _twakeIcons.IconCheckAnimated : _twakeIcons.IconCrossAnimated
|
|
219
|
+
})), variant === 'add' ? /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
220
|
+
icon: _twakeIcons.Plus,
|
|
231
221
|
color: "var(--primaryColor)"
|
|
232
222
|
}) : IconContent ? IconContent : /*#__PURE__*/_react.default.createElement("div", {
|
|
233
223
|
className: "u-w-2 u-h-2"
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
11
|
+
|
|
10
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
13
|
|
|
12
14
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -17,10 +19,6 @@ var _instance = require("cozy-client/dist/models/instance");
|
|
|
17
19
|
|
|
18
20
|
var _Buttons = _interopRequireDefault(require("cozy-ui/transpiled/react/Buttons"));
|
|
19
21
|
|
|
20
|
-
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
21
|
-
|
|
22
|
-
var _TwakeWorkplace = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/TwakeWorkplace"));
|
|
23
|
-
|
|
24
22
|
var _twakeI18n = require("twake-i18n");
|
|
25
23
|
|
|
26
24
|
var _locales = require("./locales");
|
|
@@ -37,8 +35,8 @@ var StorageButton = function StorageButton(_ref) {
|
|
|
37
35
|
className: (0, _classnames.default)('u-bdrs-4', className),
|
|
38
36
|
variant: "secondary",
|
|
39
37
|
label: t('Storage.increase'),
|
|
40
|
-
startIcon: /*#__PURE__*/_react.default.createElement(
|
|
41
|
-
icon:
|
|
38
|
+
startIcon: /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
39
|
+
icon: _twakeIcons.TwakeWorkplace,
|
|
42
40
|
size: 22
|
|
43
41
|
}),
|
|
44
42
|
size: "small",
|
|
@@ -7,16 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
14
|
var _cozyClient = require("cozy-client");
|
|
13
15
|
|
|
14
16
|
var _instance = require("cozy-client/dist/models/instance");
|
|
15
17
|
|
|
16
|
-
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
17
|
-
|
|
18
|
-
var _Cloud = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Cloud"));
|
|
19
|
-
|
|
20
18
|
var _LinearProgress = _interopRequireDefault(require("cozy-ui/transpiled/react/LinearProgress"));
|
|
21
19
|
|
|
22
20
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
@@ -46,9 +44,9 @@ var StorageProgress = function StorageProgress() {
|
|
|
46
44
|
|
|
47
45
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
48
46
|
className: "u-flex u-flex-items-center"
|
|
49
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
|
|
50
48
|
className: "u-mr-half",
|
|
51
|
-
icon:
|
|
49
|
+
icon: _twakeIcons.Cloud,
|
|
52
50
|
size: 24,
|
|
53
51
|
color: "var(--iconTextColor)"
|
|
54
52
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -32,8 +32,10 @@ var CozyThemeWithQuery = function CozyThemeWithQuery(props) {
|
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
var _type = props.type || (instance === null || instance === void 0 ? void 0 : instance.colorScheme);
|
|
36
|
+
|
|
35
37
|
return /*#__PURE__*/_react.default.createElement(_CozyTheme.default, (0, _extends2.default)({}, props, {
|
|
36
|
-
type:
|
|
38
|
+
type: _type
|
|
37
39
|
}));
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -16,8 +16,8 @@ export class AppIcon extends React.Component<any, any, any> {
|
|
|
16
16
|
}
|
|
17
17
|
export namespace AppIcon {
|
|
18
18
|
namespace propTypes {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
let alt: PropTypes.Requireable<string>;
|
|
20
|
+
let app: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
21
21
|
name: PropTypes.Requireable<string>;
|
|
22
22
|
slug: PropTypes.Requireable<string>;
|
|
23
23
|
developer: PropTypes.Requireable<object>;
|
|
@@ -28,13 +28,13 @@ export namespace AppIcon {
|
|
|
28
28
|
version: PropTypes.Requireable<string>;
|
|
29
29
|
}>>;
|
|
30
30
|
}>>>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
let fallbackIcon: PropTypes.Requireable<NonNullable<string | object>>;
|
|
32
|
+
let fetchIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
+
let client: PropTypes.Validator<object>;
|
|
34
|
+
let className: PropTypes.Requireable<string>;
|
|
35
|
+
let onReady: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
+
let type: PropTypes.Requireable<string>;
|
|
37
|
+
let priority: PropTypes.Requireable<string>;
|
|
38
38
|
}
|
|
39
39
|
namespace defaultProps {
|
|
40
40
|
let type_1: string;
|
|
@@ -47,4 +47,3 @@ declare const _default: Function;
|
|
|
47
47
|
export default _default;
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import PropTypes from 'prop-types';
|
|
50
|
-
import { iconPropType } from 'cozy-ui/transpiled/react/Icon';
|
|
@@ -10,7 +10,7 @@ declare namespace ContactAddressModal {
|
|
|
10
10
|
let name: PropTypes.Validator<string>;
|
|
11
11
|
let subFields: PropTypes.Validator<PropTypes.InferProps<{
|
|
12
12
|
name: PropTypes.Requireable<string>;
|
|
13
|
-
icon: PropTypes.Requireable<string | object
|
|
13
|
+
icon: PropTypes.Requireable<NonNullable<string | object>>;
|
|
14
14
|
type: PropTypes.Requireable<string>;
|
|
15
15
|
label: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
16
|
name: PropTypes.Requireable<string>;
|
|
@@ -51,7 +51,7 @@ export const labelPropTypes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
|
51
51
|
}>>;
|
|
52
52
|
export const fieldInputAttributesTypes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
53
53
|
name: PropTypes.Requireable<string>;
|
|
54
|
-
icon: PropTypes.Requireable<string | object
|
|
54
|
+
icon: PropTypes.Requireable<NonNullable<string | object>>;
|
|
55
55
|
type: PropTypes.Requireable<string>;
|
|
56
56
|
label: PropTypes.Requireable<PropTypes.InferProps<{
|
|
57
57
|
name: PropTypes.Requireable<string>;
|
package/jest.config.js
CHANGED
|
@@ -11,7 +11,8 @@ module.exports = {
|
|
|
11
11
|
'^cozy-client$': '<rootDir>/node_modules/cozy-client/dist/index',
|
|
12
12
|
'^cozy-client/dist/types$':
|
|
13
13
|
'<rootDir>/node_modules/cozy-client/dist/types.js',
|
|
14
|
-
'^cozy-ui(.*)': '<rootDir>/node_modules/cozy-ui/$1'
|
|
14
|
+
'^cozy-ui(.*)': '<rootDir>/node_modules/cozy-ui/$1',
|
|
15
|
+
'^@linagora/twake-icons$': '<rootDir>/test/__mocks__/twake-icons.js'
|
|
15
16
|
},
|
|
16
17
|
transformIgnorePatterns: ['node_modules/(?!(cozy-ui))'],
|
|
17
18
|
testPathIgnorePatterns: ['node_modules', 'dist'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui-plus",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Cozy-ui-plus is an extension of cozy-ui and provides components based on cozy-client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/cli": "7.16.8",
|
|
26
26
|
"@babel/core": "7.16.12",
|
|
27
|
+
"@linagora/twake-icons": "^2.6.2",
|
|
27
28
|
"@testing-library/jest-dom": "5.17.0",
|
|
28
29
|
"@testing-library/react": "12.1.5",
|
|
29
30
|
"@testing-library/react-hooks": "8.0.1",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"rooks": "7.14.1"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
68
|
+
"@linagora/twake-icons": ">=2.6.2",
|
|
67
69
|
"cozy-client": ">=60.21.3",
|
|
68
70
|
"cozy-device-helper": ">=2.0.0",
|
|
69
71
|
"cozy-intent": ">=2.30.0",
|
|
@@ -74,5 +76,5 @@
|
|
|
74
76
|
"react-dom": "^16 || ^17 || ^18",
|
|
75
77
|
"twake-i18n": ">=0.3.0"
|
|
76
78
|
},
|
|
77
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "1526f0d72beb8a728568c4bccdf7e658b5c9e389"
|
|
78
80
|
}
|
package/src/AppIcon/index.jsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { Icon, Cube } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import React, { Component } from 'react'
|
|
4
5
|
|
|
5
6
|
import { withClient } from 'cozy-client'
|
|
6
|
-
import Icon, { iconPropType } from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
-
import CubeIcon from 'cozy-ui/transpiled/react/Icons/Cube'
|
|
8
7
|
|
|
9
8
|
import styles from './styles.styl'
|
|
10
9
|
import { isShortcutFile } from '../AppSections/helpers'
|
|
@@ -133,7 +132,7 @@ export class AppIcon extends Component {
|
|
|
133
132
|
className
|
|
134
133
|
)}
|
|
135
134
|
height="100%"
|
|
136
|
-
icon={fallbackIcon ||
|
|
135
|
+
icon={fallbackIcon || Cube}
|
|
137
136
|
width="100%"
|
|
138
137
|
color="var(--coolGrey)"
|
|
139
138
|
iconRef={this.props.iconRef}
|
|
@@ -148,7 +147,11 @@ AppIcon.propTypes = {
|
|
|
148
147
|
/** Required if fetchIcon is not provided */
|
|
149
148
|
app: PropTypes.oneOfType([AppDoctype, PropTypes.string]),
|
|
150
149
|
/** Icon to fallback on error (optional), default cube icon */
|
|
151
|
-
fallbackIcon:
|
|
150
|
+
fallbackIcon: PropTypes.oneOfType([
|
|
151
|
+
PropTypes.string,
|
|
152
|
+
PropTypes.object,
|
|
153
|
+
PropTypes.func
|
|
154
|
+
]),
|
|
152
155
|
/** Custom implementation of how to fetch icon */
|
|
153
156
|
fetchIcon: PropTypes.func,
|
|
154
157
|
client: PropTypes.object.isRequired,
|
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
+
import { Icon } from '@linagora/twake-icons'
|
|
5
6
|
import { render, screen } from '@testing-library/react'
|
|
6
7
|
import React from 'react'
|
|
7
8
|
|
|
8
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
9
|
-
|
|
10
9
|
import { AppIcon } from '.'
|
|
11
10
|
|
|
12
|
-
jest.mock('
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
jest.mock('@linagora/twake-icons', () => {
|
|
12
|
+
const React = require('react')
|
|
13
|
+
return {
|
|
14
|
+
__esModule: true,
|
|
15
|
+
Icon: jest.fn(() => <div data-testid="icon-component" />),
|
|
16
|
+
Cube: () => null
|
|
17
|
+
}
|
|
18
|
+
})
|
|
17
19
|
|
|
18
20
|
describe('AppIcon component', () => {
|
|
19
21
|
const app = {}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Icon, Bottom } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import React, { Component } from 'react'
|
|
4
5
|
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
|
-
import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'
|
|
7
6
|
import SelectBox from 'cozy-ui/transpiled/react/SelectBox'
|
|
8
7
|
|
|
9
8
|
import styles from './DropdownFilter.styl'
|
|
@@ -11,7 +10,7 @@ import styles from './DropdownFilter.styl'
|
|
|
11
10
|
const SmallArrow = () => (
|
|
12
11
|
<Icon
|
|
13
12
|
className={cx(styles.DropdownFilter__icon, 'u-mr-1')}
|
|
14
|
-
icon={
|
|
13
|
+
icon={Bottom}
|
|
15
14
|
color="var(--coolGrey)"
|
|
16
15
|
width={16}
|
|
17
16
|
height={16}
|
package/src/AppTile/index.jsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Icon, WrenchCircle } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
|
-
import WrenchCircleIcon from 'cozy-ui/transpiled/react/Icons/WrenchCircle'
|
|
7
6
|
import Tile, {
|
|
8
7
|
TileTitle,
|
|
9
8
|
TileSubtitle,
|
|
@@ -96,7 +95,7 @@ export const AppTile = ({
|
|
|
96
95
|
{isInMaintenanceWithSpecificDisplay && (
|
|
97
96
|
<Icon
|
|
98
97
|
data-testid="icon-maintenance"
|
|
99
|
-
icon={
|
|
98
|
+
icon={WrenchCircle}
|
|
100
99
|
color="var(--coolGrey)"
|
|
101
100
|
className={styles['AppTile-icon-maintenance']}
|
|
102
101
|
/>
|
package/src/CipherIcon/index.jsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { Icon, Keychain } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
5
6
|
import { withClient } from 'cozy-client'
|
|
6
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
-
import KeychainIcon from 'cozy-ui/transpiled/react/Icons/Keychain'
|
|
8
7
|
|
|
9
8
|
import AppIcon from '../AppIcon'
|
|
10
9
|
import { AppDoctype } from '../proptypes'
|
|
@@ -30,7 +29,7 @@ class CipherIcon extends React.PureComponent {
|
|
|
30
29
|
|
|
31
30
|
return (
|
|
32
31
|
<div className={cx('u-dib u-pos-relative', className)} {...rest}>
|
|
33
|
-
<Icon icon={
|
|
32
|
+
<Icon icon={Keychain} size={32} />
|
|
34
33
|
<div className="u-pos-absolute u-right-0 u-bottom-0">
|
|
35
34
|
<AppIcon fetchIcon={this.fetchIcon} className="u-w-1 u-h-1" />
|
|
36
35
|
</div>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { Icon, CrossSmall, Plus } from '@linagora/twake-icons'
|
|
1
2
|
import PropTypes from 'prop-types'
|
|
2
3
|
import React, { useRef } from 'react'
|
|
3
4
|
|
|
4
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
|
-
import CrossSmallIcon from 'cozy-ui/transpiled/react/Icons/CrossSmall'
|
|
6
|
-
import PlusIcon from 'cozy-ui/transpiled/react/Icons/Plus'
|
|
7
5
|
import InputLabel from 'cozy-ui/transpiled/react/InputLabel'
|
|
8
6
|
import Stack from 'cozy-ui/transpiled/react/Stack'
|
|
9
7
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button'
|
|
@@ -89,9 +87,7 @@ const CollectionField = props => {
|
|
|
89
87
|
label={removeButtonLabel}
|
|
90
88
|
iconOnly
|
|
91
89
|
round
|
|
92
|
-
icon={
|
|
93
|
-
<Icon icon={CrossSmallIcon} color="var(--slateGrey)" />
|
|
94
|
-
}
|
|
90
|
+
icon={<Icon icon={CrossSmall} color="var(--slateGrey)" />}
|
|
95
91
|
onClick={() => handleRemove(index)}
|
|
96
92
|
/>
|
|
97
93
|
</div>
|
|
@@ -106,7 +102,7 @@ const CollectionField = props => {
|
|
|
106
102
|
theme="text"
|
|
107
103
|
icon={
|
|
108
104
|
<Icon
|
|
109
|
-
icon={
|
|
105
|
+
icon={Plus}
|
|
110
106
|
className={styles.CollectionField__addBtnIcon}
|
|
111
107
|
/>
|
|
112
108
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { Icon, Dropdown, Dropup } from '@linagora/twake-icons'
|
|
1
2
|
import React, { useState } from 'react'
|
|
2
3
|
|
|
3
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
4
4
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
5
|
-
import DropdownIcon from 'cozy-ui/transpiled/react/Icons/Dropdown'
|
|
6
|
-
import DropupIcon from 'cozy-ui/transpiled/react/Icons/Dropup'
|
|
7
5
|
import { useI18n, useExtendI18n } from 'twake-i18n'
|
|
8
6
|
|
|
9
7
|
import FieldInput from './FieldInput'
|
|
@@ -38,7 +36,7 @@ const FieldInputAccordion = ({
|
|
|
38
36
|
size="medium"
|
|
39
37
|
onClick={() => setShowExtended(v => !v)}
|
|
40
38
|
>
|
|
41
|
-
<Icon icon={showExtended ?
|
|
39
|
+
<Icon icon={showExtended ? Dropup : Dropdown} />
|
|
42
40
|
</IconButton>
|
|
43
41
|
</div>
|
|
44
42
|
{subFields.map(({ name, ...attributes }, index) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { Icon, Plus } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
import { FieldArray } from 'react-final-form-arrays'
|
|
4
5
|
|
|
5
6
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
6
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
-
import PlusIcon from 'cozy-ui/transpiled/react/Icons/Plus'
|
|
8
7
|
import { useI18n, useExtendI18n } from 'twake-i18n'
|
|
9
8
|
|
|
10
9
|
import FieldInput from './FieldInput'
|
|
@@ -63,7 +62,7 @@ const FieldInputArray = ({
|
|
|
63
62
|
})}
|
|
64
63
|
<Button
|
|
65
64
|
variant="text"
|
|
66
|
-
startIcon={<Icon icon={
|
|
65
|
+
startIcon={<Icon icon={Plus} />}
|
|
67
66
|
onClick={() => addField(fields)}
|
|
68
67
|
label={t(`Contacts.AddModal.ContactForm.addLabel.${name}`)}
|
|
69
68
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Icon } from '@linagora/twake-icons'
|
|
1
2
|
import cx from 'classnames'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import React from 'react'
|
|
4
5
|
|
|
5
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
6
|
import { useI18n, useExtendI18n } from 'twake-i18n'
|
|
7
7
|
|
|
8
8
|
import FieldInput from './FieldInput'
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import { Icon, CrossCircle } from '@linagora/twake-icons'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
|
|
3
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
4
4
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
5
|
-
import CrossCircleIcon from 'cozy-ui/transpiled/react/Icons/CrossCircle'
|
|
6
5
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
6
|
|
|
8
7
|
const RemoveButton = ({ onRemove }) => {
|
|
9
8
|
return (
|
|
10
9
|
<ListItemIcon className="u-ml-half">
|
|
11
10
|
<IconButton aria-label="delete" size="medium" onClick={onRemove}>
|
|
12
|
-
<Icon icon={
|
|
11
|
+
<Icon icon={CrossCircle} />
|
|
13
12
|
</IconButton>
|
|
14
13
|
</ListItemIcon>
|
|
15
14
|
)
|