cozy-ui 60.11.0 → 61.1.1

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,36 @@
1
+ ## [61.1.1](https://github.com/cozy/cozy-ui/compare/v61.1.0...v61.1.1) (2022-02-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency handlebars to v4.7.7 [security] ([3df65a0](https://github.com/cozy/cozy-ui/commit/3df65a0))
7
+
8
+ # [61.1.0](https://github.com/cozy/cozy-ui/compare/v61.0.0...v61.1.0) (2022-02-10)
9
+
10
+
11
+ ### Features
12
+
13
+ * **import-cost:** Decrease size of import of date-fns ([9f2dc1f](https://github.com/cozy/cozy-ui/commit/9f2dc1f))
14
+
15
+ # [61.0.0](https://github.com/cozy/cozy-ui/compare/v60.12.0...v61.0.0) (2022-02-09)
16
+
17
+
18
+ ### Features
19
+
20
+ * Upgrade mui to 4.12.3 ([b1b83d8](https://github.com/cozy/cozy-ui/commit/b1b83d8))
21
+
22
+
23
+ ### BREAKING CHANGES
24
+
25
+ * Use must have `@material-ui/core` version `>= 4.12` in your application
26
+
27
+ # [60.12.0](https://github.com/cozy/cozy-ui/compare/v60.11.0...v60.12.0) (2022-02-07)
28
+
29
+
30
+ ### Features
31
+
32
+ * Use new Radio button for FilePicker and NestedSelect ([a602dca](https://github.com/cozy/cozy-ui/commit/a602dca))
33
+
1
34
  # [60.11.0](https://github.com/cozy/cozy-ui/compare/v60.10.1...v60.11.0) (2022-02-02)
2
35
 
3
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "60.11.0",
3
+ "version": "61.1.1",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -70,7 +70,7 @@
70
70
  "@babel/cli": "7.11.5",
71
71
  "@babel/core": "7.11.5",
72
72
  "@cozy/codemods": "^1.9.0",
73
- "@material-ui/core": "4.11.4",
73
+ "@material-ui/core": "4.12.3",
74
74
  "@semantic-release/changelog": "5.0.1",
75
75
  "@semantic-release/git": "7.0.18",
76
76
  "@semantic-release/npm": "5.3.4",
@@ -167,7 +167,7 @@
167
167
  "react-swipeable-views": "^0.13.3"
168
168
  },
169
169
  "peerDependencies": {
170
- "@material-ui/core": "4",
170
+ "@material-ui/core": ">=4.12",
171
171
  "cozy-client": ">=27.5.1",
172
172
  "cozy-device-helper": "^1.16.0",
173
173
  "cozy-doctypes": "^1.69.0",
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import range from 'lodash/range'
4
- import { format } from 'date-fns'
4
+ import format from 'date-fns/format'
5
5
  import cx from 'classnames'
6
6
 
7
7
  import { useI18n } from '../I18n'
@@ -13,7 +13,7 @@ import styles from './styles.styl'
13
13
 
14
14
  const MonthButton = ({ monthNum, onClick, isSelected }) => {
15
15
  const { f } = useI18n()
16
- // We do not care care about year and day since we are creating the date
16
+ // We do not care about year and day since we are creating the date
17
17
  // only to be able to format it into a monthName
18
18
  const d = new Date(2019, monthNum, 15)
19
19
  const handleClick = () => {
@@ -14,7 +14,7 @@ import Icon from '../Icon'
14
14
  import FileTypeText from '../Icons/FileTypeText'
15
15
  import FileTypeFolder from '../Icons/FileTypeFolder'
16
16
  import Checkbox from '../Checkbox'
17
- import Radio from '../Radio'
17
+ import Radio from '../Radios'
18
18
  import { useI18n } from '../I18n'
19
19
 
20
20
  import styles from './styles.styl'
@@ -93,7 +93,6 @@ const FilePickerBodyItem = ({
93
93
  >
94
94
  <Input
95
95
  data-testid={multiple ? 'checkbox-btn' : 'radio-btn'}
96
- gutter={false}
97
96
  onChange={() => {
98
97
  // handled by onClick on the container
99
98
  }}
@@ -119,13 +119,14 @@ describe('FilePickerBodyItem components:', () => {
119
119
  })
120
120
  const radioBtn = getByTestId('radio-btn')
121
121
 
122
- expect(radioBtn.getAttribute('disabled')).toBe('')
122
+ expect(radioBtn.getAttribute('disabled')).toBe(null)
123
123
  })
124
+
124
125
  it('should disable and not display the Radio button if it is a Folder and is not accepted', () => {
125
126
  const { getByTestId } = setup({ file: mockFolder01 })
126
127
  const radioBtn = getByTestId('radio-btn')
127
128
 
128
- expect(radioBtn.getAttribute('disabled')).toBe('')
129
+ expect(radioBtn.getAttribute('disabled')).toBe(null)
129
130
  })
130
131
  })
131
132
  })
@@ -1,4 +1,4 @@
1
- import { fade as alpha } from '@material-ui/core/styles'
1
+ import { alpha } from '@material-ui/core/styles'
2
2
 
3
3
  const SWITCH_BAR_WIDTH = 25
4
4
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { createMuiTheme } from '@material-ui/core/styles'
2
+ import { createTheme } from '@material-ui/core/styles'
3
3
 
4
4
  import { getCssVariableValue } from '../utils/color'
5
5
  import isTesting from '../helpers/isTesting'
@@ -50,7 +50,7 @@ const themesCommonConfig = {
50
50
 
51
51
  export const makeTheme = type => {
52
52
  const palette = makePalette(type)
53
- const theme = createMuiTheme({
53
+ const theme = createTheme({
54
54
  ...themesCommonConfig,
55
55
  typography: makeTypography(palette),
56
56
  palette
@@ -1,9 +1,10 @@
1
1
  import React, { Component } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import { withStyles } from '@material-ui/core'
4
- import Icon from '../Icon'
5
- import UIRadio from '../Radio'
6
4
  import omit from 'lodash/omit'
5
+
6
+ import Icon from '../Icon'
7
+ import Radio from '../Radios'
7
8
  import ListItem from '../MuiCozyTheme/ListItem'
8
9
  import ListItemText from '../ListItemText'
9
10
  import Divider from '../MuiCozyTheme/Divider'
@@ -247,10 +248,6 @@ NestedSelect.propTypes = {
247
248
 
248
249
  export default NestedSelect
249
250
 
250
- export const Radio = ({ ...props }) => (
251
- <UIRadio label="" gutter={false} {...props} />
252
- )
253
-
254
251
  const NestedSelectListItemText = withStyles({
255
252
  root: {
256
253
  padding: '0rem 0.5rem'
@@ -201,7 +201,7 @@ exports[`Banner should render examples: Banner 1`] = `
201
201
  </div>
202
202
  <div class=\\"MuiPaper-root MuiPaper-elevation0\\">
203
203
  <div class=\\"styles__c-banner-wrapper___3KlaG\\">
204
- <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-justify-xs-space-between\\">
204
+ <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-justify-content-xs-space-between\\">
205
205
  <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-wrap-xs-nowrap MuiGrid-align-items-xs-center MuiGrid-grid-xs-12 MuiGrid-grid-lg-8\\">
206
206
  <div class=\\"MuiGrid-root MuiGrid-item\\">
207
207
  <div class=\\"styles__c-banner-icon___1f_LM\\"><svg viewBox=\\"0 0 32 32\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
@@ -216,7 +216,7 @@ exports[`Banner should render examples: Banner 1`] = `
216
216
  <p class=\\"MuiTypography-root MuiTypography-body2\\">Get Cozy Drive for Desktop and synchronise your files safely to make them accessible at all times.</p>
217
217
  </div>
218
218
  </div>
219
- <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-align-items-xs-center MuiGrid-justify-xs-flex-end MuiGrid-grid-xs-12 MuiGrid-grid-lg-4\\">
219
+ <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-align-items-xs-center MuiGrid-justify-content-xs-flex-end MuiGrid-grid-xs-12 MuiGrid-grid-lg-4\\">
220
220
  <div class=\\"MuiGrid-root styles__c-banner-buttons___3sLgG MuiGrid-item\\"><button type=\\"submit\\" class=\\"styles__c-btn___-2Vnj styles__c-btn--text___2Vp-2 styles__c-btn--center___16_Xh\\"><span><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path fill-rule=\\"evenodd\\" d=\\"M7 9.586L5.707 8.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L9 9.586V2a1 1 0 10-2 0v7.586zM1 14h14a1 1 0 110 2H1a1 1 0 110-2z\\"></path></svg><span>Download</span></span></button><button type=\\"submit\\" class=\\"styles__c-btn___-2Vnj styles__c-btn--text___2Vp-2 styles__c-btn--center___16_Xh\\"><span><span>No, thanks!</span></span></button></div>
221
221
  </div>
222
222
  </div>
@@ -7744,7 +7744,7 @@ exports[`ProgressionBanner should render examples: ProgressionBanner 1`] = `
7744
7744
  </div>
7745
7745
  <div class=\\"MuiPaper-root MuiPaper-elevation0\\">
7746
7746
  <div class=\\"styles__c-banner-wrapper___3KlaG Component-banner-18\\">
7747
- <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-justify-xs-space-between\\">
7747
+ <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-justify-content-xs-space-between\\">
7748
7748
  <div class=\\"MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-wrap-xs-nowrap MuiGrid-align-items-xs-center MuiGrid-grid-xs-12 MuiGrid-grid-lg-8\\">
7749
7749
  <div class=\\"MuiGrid-root MuiGrid-item\\">
7750
7750
  <div class=\\"styles__c-banner-icon___1f_LM\\"><svg viewBox=\\"0 0 32 32\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import range from 'lodash/range';
5
- import { format } from 'date-fns';
5
+ import format from 'date-fns/format';
6
6
  import cx from 'classnames';
7
7
  import { useI18n } from "cozy-ui/transpiled/react/I18n";
8
8
  import Icon from "cozy-ui/transpiled/react/Icon";
@@ -23,7 +23,7 @@ var MonthButton = function MonthButton(_ref) {
23
23
  isSelected = _ref.isSelected;
24
24
 
25
25
  var _useI18n = useI18n(),
26
- f = _useI18n.f; // We do not care care about year and day since we are creating the date
26
+ f = _useI18n.f; // We do not care about year and day since we are creating the date
27
27
  // only to be able to format it into a monthName
28
28
 
29
29
 
@@ -12,7 +12,7 @@ import Icon from "cozy-ui/transpiled/react/Icon";
12
12
  import FileTypeText from "cozy-ui/transpiled/react/Icons/FileTypeText";
13
13
  import FileTypeFolder from "cozy-ui/transpiled/react/Icons/FileTypeFolder";
14
14
  import Checkbox from "cozy-ui/transpiled/react/Checkbox";
15
- import Radio from "cozy-ui/transpiled/react/Radio";
15
+ import Radio from "cozy-ui/transpiled/react/Radios";
16
16
  import { useI18n } from "cozy-ui/transpiled/react/I18n";
17
17
  var styles = {
18
18
  "filePickerBreadcrumb-previousPath": "styles__filePickerBreadcrumb-previousPath___3LKJH",
@@ -81,7 +81,6 @@ var FilePickerBodyItem = function FilePickerBodyItem(_ref) {
81
81
  onClick: hasChoice ? handleChoiceClick(file) : undefined
82
82
  }, React.createElement(Input, {
83
83
  "data-testid": multiple ? 'checkbox-btn' : 'radio-btn',
84
- gutter: false,
85
84
  onChange: function onChange() {// handled by onClick on the container
86
85
  },
87
86
  checked: filesIdsSelected.includes(file._id),
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import { fade as alpha } from '@material-ui/core/styles';
3
+ import { alpha } from '@material-ui/core/styles';
4
4
  var SWITCH_BAR_WIDTH = 25;
5
5
  export var makeThemeOverrides = function makeThemeOverrides(theme) {
6
6
  var createOverrides = theme.palette.type === 'dark' ? makeInvertedOverrides : makeOverrides;
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread";
2
2
  import React from 'react';
3
- import { createMuiTheme } from '@material-ui/core/styles';
3
+ import { createTheme } from '@material-ui/core/styles';
4
4
  import { getCssVariableValue } from "cozy-ui/transpiled/react/utils/color";
5
5
  import isTesting from "cozy-ui/transpiled/react/helpers/isTesting";
6
6
  import AccordionExpandIcon from "cozy-ui/transpiled/react/MuiCozyTheme/AccordionExpandIcon";
@@ -55,7 +55,7 @@ var themesCommonConfig = _objectSpread({
55
55
 
56
56
  export var makeTheme = function makeTheme(type) {
57
57
  var palette = makePalette(type);
58
- var theme = createMuiTheme(_objectSpread({}, themesCommonConfig, {
58
+ var theme = createTheme(_objectSpread({}, themesCommonConfig, {
59
59
  typography: makeTypography(palette),
60
60
  palette: palette
61
61
  }));
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
2
  import _toArray from "@babel/runtime/helpers/toArray";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -11,9 +10,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
10
  import React, { Component } from 'react';
12
11
  import PropTypes from 'prop-types';
13
12
  import { withStyles } from '@material-ui/core';
14
- import Icon from "cozy-ui/transpiled/react/Icon";
15
- import UIRadio from "cozy-ui/transpiled/react/Radio";
16
13
  import omit from 'lodash/omit';
14
+ import Icon from "cozy-ui/transpiled/react/Icon";
15
+ import Radio from "cozy-ui/transpiled/react/Radios";
17
16
  import ListItem from "cozy-ui/transpiled/react/MuiCozyTheme/ListItem";
18
17
  import ListItemText from "cozy-ui/transpiled/react/ListItemText";
19
18
  import Divider from "cozy-ui/transpiled/react/MuiCozyTheme/Divider";
@@ -267,14 +266,6 @@ NestedSelect.propTypes = {
267
266
  })
268
267
  };
269
268
  export default NestedSelect;
270
- export var Radio = function Radio(_ref) {
271
- var props = _extends({}, _ref);
272
-
273
- return React.createElement(UIRadio, _extends({
274
- label: "",
275
- gutter: false
276
- }, props));
277
- };
278
269
  var NestedSelectListItemText = withStyles({
279
270
  root: {
280
271
  padding: '0rem 0.5rem'
@@ -292,11 +283,11 @@ var primaryTypographyProps = {
292
283
  className: 'u-ellipsis',
293
284
  variant: 'body1'
294
285
  };
295
- export var ItemRow = function ItemRow(_ref2) {
296
- var item = _ref2.item,
297
- _onClick = _ref2.onClick,
298
- isSelected = _ref2.isSelected,
299
- radioPosition = _ref2.radioPosition;
286
+ export var ItemRow = function ItemRow(_ref) {
287
+ var item = _ref.item,
288
+ _onClick = _ref.onClick,
289
+ isSelected = _ref.isSelected,
290
+ radioPosition = _ref.radioPosition;
300
291
 
301
292
  var _useBreakpoints = useBreakpoints(),
302
293
  isMobile = _useBreakpoints.isMobile;