cozy-ui 113.7.1 → 113.9.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.
Files changed (43) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +15 -0
  3. package/assets/icons/ui/number.svg +1 -0
  4. package/jest.config.js +1 -2
  5. package/package.json +2 -8
  6. package/react/AppSections/components/AppsSection.spec.jsx +10 -19
  7. package/react/AppSections/index.spec.jsx +98 -77
  8. package/react/ContactsList/ContactRow.spec.js +28 -53
  9. package/react/DateMonthPicker/index.spec.jsx +17 -45
  10. package/react/Field/index.spec.js +28 -5
  11. package/react/Figure/Figure.spec.jsx +9 -4
  12. package/react/Figure/__snapshots__/Figure.spec.jsx.snap +289 -225
  13. package/react/FileInput/index.jsx +1 -0
  14. package/react/FileInput/index.spec.jsx +16 -38
  15. package/react/Icon/Readme.md +5 -1
  16. package/react/Icons/Number.jsx +16 -0
  17. package/react/Popup/index.spec.jsx +90 -41
  18. package/react/QualificationIconStack/Readme.md +14 -0
  19. package/react/QualificationIconStack/index.jsx +132 -0
  20. package/react/deprecated/ViewStack/example.jsx +1 -1
  21. package/react/hooks/useClientErrors.spec.jsx +16 -24
  22. package/react/providers/I18n/index.spec.jsx +13 -5
  23. package/react/providers/I18n/withLocales.spec.jsx +4 -4
  24. package/transpiled/react/FileInput/index.js +2 -1
  25. package/transpiled/react/Icon/icons-sprite.js +1 -1
  26. package/transpiled/react/Icons/Number.js +15 -0
  27. package/transpiled/react/QualificationIconStack/index.js +132 -0
  28. package/transpiled/react/deprecated/ViewStack/example.js +1 -1
  29. package/react/AppSections/__snapshots__/index.spec.jsx.snap +0 -1843
  30. package/react/AppSections/components/__snapshots__/AppsSection.spec.jsx.snap +0 -41
  31. package/react/ContactsList/__snapshots__/ContactRow.spec.js.snap +0 -69
  32. package/react/FileInput/__snapshots__/index.spec.jsx.snap +0 -86
  33. package/react/Input/__snapshots__/index.spec.jsx.snap +0 -11
  34. package/react/Input/index.spec.jsx +0 -12
  35. package/react/__snapshots__/examples.spec.jsx.snap +0 -3720
  36. package/react/deprecated/ActionMenu/__snapshots__/index.spec.jsx.snap +0 -157
  37. package/react/deprecated/ActionMenu/index.spec.jsx +0 -115
  38. package/react/deprecated/Alerter/__snapshots__/alerter.spec.js.snap +0 -88
  39. package/react/deprecated/Alerter/alerter.spec.js +0 -78
  40. package/react/deprecated/InfosCarrousel/index.spec.jsx +0 -71
  41. package/react/deprecated/Modal/index.spec.jsx +0 -70
  42. package/react/deprecated/ViewStack/index.spec.jsx +0 -64
  43. package/react/examples.spec.jsx +0 -67
@@ -0,0 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/number.svg` to regenerate;
3
+ import React from 'react';
4
+
5
+ function SvgNumber(props) {
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ viewBox: "0 0 16 16"
8
+ }, props), /*#__PURE__*/React.createElement("path", {
9
+ fillRule: "evenodd",
10
+ clipRule: "evenodd",
11
+ d: "M4 12V4h-.452l-.117.024-2.73 1.177v1.883l1.323-.54V12H4zm11.245-7.363C14.8 4.21 14.192 4 13.44 4c-.437 0-.84.096-1.204.29a2.155 2.155 0 00-.864.816c-.17.29-.27.61-.298.957l-.021.527h2.08v-.318l.004-.09a.507.507 0 01.11-.28.276.276 0 01.233-.11c.111 0 .184.035.248.116.077.097.12.252.12.472 0 .24-.045.418-.128.54-.05.073-.118.111-.232.123l-.09.005h-.994v1.757h1.021l.08.004c.301.03.434.238.434.742 0 .228-.05.395-.144.512-.08.1-.178.144-.325.144-.108 0-.188-.04-.265-.137a.647.647 0 01-.132-.337l-.023-.431H11v.318l.007.206c.04.607.265 1.116.673 1.513.453.44 1.042.661 1.75.661.751 0 1.374-.22 1.85-.663.48-.446.72-1.04.72-1.762 0-.447-.098-.843-.296-1.182l-.094-.145-.107-.134a1.798 1.798 0 00-.252-.235l-.008-.006.014-.01.128-.133c.082-.092.157-.192.225-.3a2 2 0 00.305-1.07c0-.714-.222-1.296-.67-1.723zm-5.83-.007C8.996 4.208 8.417 4 7.696 4c-.475 0-.907.118-1.289.354a2.37 2.37 0 00-.888.99 2.98 2.98 0 00-.3 1.123L5.2 7.03h2.05v-.322l.004-.157c.015-.25.066-.44.146-.568.077-.122.157-.17.271-.17.096 0 .152.033.204.12.076.127.12.323.12.59 0 .192-.049.397-.148.618-.085.19-.211.41-.378.66L7.331 8 5.33 10.57V12h4.87v-1.815H8.05l.573-.824.185-.226c.417-.519.722-.98.906-1.374.215-.462.323-.923.323-1.38 0-.739-.205-1.328-.623-1.751z"
12
+ }));
13
+ }
14
+
15
+ export default SvgNumber;
@@ -0,0 +1,132 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ var _excluded = ["theme", "qualification"];
4
+ import PropTypes from 'prop-types';
5
+ import React from 'react';
6
+ import { getIconByLabel } from 'cozy-client/dist/models/document/qualification';
7
+ import Icon from "cozy-ui/transpiled/react/Icon";
8
+ import IconStack from "cozy-ui/transpiled/react/IconStack";
9
+ import BankIcon from "cozy-ui/transpiled/react/Icons/Bank";
10
+ import BankCheckIcon from "cozy-ui/transpiled/react/Icons/BankCheck";
11
+ import BenefitIcon from "cozy-ui/transpiled/react/Icons/Benefit";
12
+ import BillIcon from "cozy-ui/transpiled/react/Icons/Bill";
13
+ import CarIcon from "cozy-ui/transpiled/react/Icons/Car";
14
+ import ChessIcon from "cozy-ui/transpiled/react/Icons/Chess";
15
+ import ChildIcon from "cozy-ui/transpiled/react/Icons/Child";
16
+ import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
17
+ import EmailIcon from "cozy-ui/transpiled/react/Icons/Email";
18
+ import EuroIcon from "cozy-ui/transpiled/react/Icons/Euro";
19
+ 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
+ import FitnessIcon from "cozy-ui/transpiled/react/Icons/Fitness";
23
+ import GlobeIcon from "cozy-ui/transpiled/react/Icons/Globe";
24
+ import GouvIcon from "cozy-ui/transpiled/react/Icons/Gouv";
25
+ import HeartIcon from "cozy-ui/transpiled/react/Icons/Heart";
26
+ import HomeIcon from "cozy-ui/transpiled/react/Icons/Home";
27
+ import ImageIcon from "cozy-ui/transpiled/react/Icons/Image";
28
+ import JusticeIcon from "cozy-ui/transpiled/react/Icons/Justice";
29
+ import LaudryIcon from "cozy-ui/transpiled/react/Icons/Laudry";
30
+ import LightningIcon from "cozy-ui/transpiled/react/Icons/Lightning";
31
+ import PeopleIcon from "cozy-ui/transpiled/react/Icons/People";
32
+ import PlaneIcon from "cozy-ui/transpiled/react/Icons/Plane";
33
+ import RemboursementIcon from "cozy-ui/transpiled/react/Icons/Remboursement";
34
+ import RestaurantIcon from "cozy-ui/transpiled/react/Icons/Restaurant";
35
+ import SchoolIcon from "cozy-ui/transpiled/react/Icons/School";
36
+ import ShopIcon from "cozy-ui/transpiled/react/Icons/Shop";
37
+ import TeamIcon from "cozy-ui/transpiled/react/Icons/Team";
38
+ import TelecomIcon from "cozy-ui/transpiled/react/Icons/Telecom";
39
+ import TelephoneIcon from "cozy-ui/transpiled/react/Icons/Telephone";
40
+ 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
+
54
+ var IconByLabel = {
55
+ 'bank-check': BankCheckIcon,
56
+ bank: BankIcon,
57
+ benefit: BenefitIcon,
58
+ bill: BillIcon,
59
+ car: CarIcon,
60
+ chess: ChessIcon,
61
+ child: ChildIcon,
62
+ dots: DotsIcon,
63
+ email: EmailIcon,
64
+ euro: EuroIcon,
65
+ exchange: ExchangeIcon,
66
+ 'file-type-note': FileTypeNoteIcon,
67
+ fitness: FitnessIcon,
68
+ globe: GlobeIcon,
69
+ gouv: GouvIcon,
70
+ heart: HeartIcon,
71
+ home: HomeIcon,
72
+ image: ImageIcon,
73
+ justice: JusticeIcon,
74
+ laudry: LaudryIcon,
75
+ lightning: LightningIcon,
76
+ people: PeopleIcon,
77
+ plane: PlaneIcon,
78
+ remboursement: RemboursementIcon,
79
+ restaurant: RestaurantIcon,
80
+ school: SchoolIcon,
81
+ shop: ShopIcon,
82
+ team: TeamIcon,
83
+ telecom: TelecomIcon,
84
+ telephone: TelephoneIcon,
85
+ water: WaterIcon,
86
+ work: WorkIcon
87
+ };
88
+ var themeIconByLabel = {
89
+ identity: 'people',
90
+ family: 'team',
91
+ work_study: 'work',
92
+ health: 'heart',
93
+ home: 'home',
94
+ transport: 'car',
95
+ activity: 'chess',
96
+ finance: 'bank',
97
+ invoice: 'bill',
98
+ others: 'dots'
99
+ };
100
+
101
+ var QualificationIconStack = function QualificationIconStack(_ref) {
102
+ var theme = _ref.theme,
103
+ qualification = _ref.qualification,
104
+ props = _objectWithoutProperties(_ref, _excluded);
105
+
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
+ }));
123
+ };
124
+
125
+ QualificationIconStack.propTypes = {
126
+ /** The name of the qualification (isp\_invoice, family\_record\_book, etc.) */
127
+ qualification: PropTypes.string,
128
+
129
+ /** The name of the qualification theme (indentity, family, etc.) */
130
+ theme: PropTypes.string
131
+ };
132
+ export default QualificationIconStack;
@@ -34,7 +34,7 @@ var Slide = function Slide(_ref2) {
34
34
  return stackPop();
35
35
 
36
36
  case 2:
37
- // No alerts during enzyme tests
37
+ // No alerts during tests
38
38
  if (number === 2 && !global.mount) {
39
39
  alert('You went back to the first slide');
40
40
  }