cozy-ui 60.11.0 → 60.12.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
+ # [60.12.0](https://github.com/cozy/cozy-ui/compare/v60.11.0...v60.12.0) (2022-02-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * Use new Radio button for FilePicker and NestedSelect ([a602dca](https://github.com/cozy/cozy-ui/commit/a602dca))
7
+
1
8
  # [60.11.0](https://github.com/cozy/cozy-ui/compare/v60.10.1...v60.11.0) (2022-02-02)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "60.11.0",
3
+ "version": "60.12.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -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,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'
@@ -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,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;