cozy-ui-plus 5.3.1 → 6.1.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 (44) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/CollectionField/index.js +2 -2
  3. package/dist/Contacts/AddModal/ContactForm/FieldInput.js +49 -20
  4. package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +5 -16
  5. package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +2 -2
  6. package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +3 -1
  7. package/dist/Contacts/AddModal/ContactForm/RemoveButton.js +34 -0
  8. package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +3 -1
  9. package/dist/Contacts/AddModal/ContactForm/helpers.js +12 -2
  10. package/dist/Contacts/AddModal/ContactForm/index.js +14 -3
  11. package/dist/ContactsListModal/ContactsListModal.js +2 -6
  12. package/dist/ContactsListModal/MobileHeader.js +2 -6
  13. package/dist/Field/index.js +9 -10
  14. package/dist/ListItem/ListItemFile/ItemIcon.js +11 -4
  15. package/dist/Qualification/QualificationItem/index.js +10 -14
  16. package/dist/ShortcutTile/index.js +2 -2
  17. package/dist/SquareAppIcon/index.js +22 -21
  18. package/dist/providers/CozyTheme/index.js +0 -3
  19. package/dist/src/Contacts/AddModal/ContactForm/FieldInput.d.ts +3 -1
  20. package/dist/src/Contacts/AddModal/ContactForm/FieldInputWrapper.d.ts +2 -1
  21. package/dist/src/Contacts/AddModal/ContactForm/RemoveButton.d.ts +4 -0
  22. package/dist/src/providers/CozyTheme/index.d.ts +0 -3
  23. package/dist/stylesheet.css +0 -25
  24. package/package.json +4 -4
  25. package/src/CollectionField/index.jsx +2 -2
  26. package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +29 -9
  27. package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +3 -14
  28. package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +5 -3
  29. package/src/Contacts/AddModal/ContactForm/FieldInputWrapper.jsx +3 -1
  30. package/src/Contacts/AddModal/ContactForm/RemoveButton.jsx +18 -0
  31. package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +3 -1
  32. package/src/Contacts/AddModal/ContactForm/helpers.js +11 -2
  33. package/src/Contacts/AddModal/ContactForm/helpers.spec.js +62 -0
  34. package/src/Contacts/AddModal/ContactForm/index.jsx +27 -14
  35. package/src/ContactsListModal/ContactsListModal.jsx +1 -4
  36. package/src/ContactsListModal/MobileHeader.jsx +20 -24
  37. package/src/Field/index.jsx +7 -6
  38. package/src/ListItem/ListItemFile/ItemIcon.jsx +15 -7
  39. package/src/Qualification/QualificationItem/index.jsx +11 -16
  40. package/src/ShortcutTile/index.tsx +1 -1
  41. package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +240 -271
  42. package/src/SquareAppIcon/index.jsx +96 -107
  43. package/src/providers/CozyTheme/index.jsx +0 -2
  44. package/src/Contacts/AddModal/ContactForm/styles.styl +0 -2
@@ -7,36 +7,32 @@ import PreviousIcon from 'cozy-ui/transpiled/react/Icons/Previous'
7
7
  import Input from 'cozy-ui/transpiled/react/Input'
8
8
  import Paper from 'cozy-ui/transpiled/react/Paper'
9
9
 
10
- import CozyTheme from '../providers/CozyTheme'
11
-
12
10
  const barStyle = {
13
11
  height: 48
14
12
  }
15
13
 
16
14
  const MobileHeader = ({ filter, placeholder, onChange, onDismiss }) => {
17
15
  return (
18
- <CozyTheme variant="inverted">
19
- <Paper
20
- square
21
- elevation={0}
22
- className="u-flex u-flex-items-center u-pr-3 u-pl-half"
23
- style={barStyle}
24
- >
25
- <IconButton className="u-mr-half" onClick={onDismiss} size="medium">
26
- <Icon icon={PreviousIcon} />
27
- </IconButton>
28
- <Input
29
- type="text"
30
- placeholder={placeholder}
31
- id={placeholder}
32
- value={filter}
33
- onChange={onChange}
34
- autoFocus
35
- fullWidth
36
- disableUnderline
37
- />
38
- </Paper>
39
- </CozyTheme>
16
+ <Paper
17
+ square
18
+ elevation={0}
19
+ className="u-flex u-flex-items-center u-pr-3 u-pl-half"
20
+ style={barStyle}
21
+ >
22
+ <IconButton className="u-mr-half" onClick={onDismiss} size="medium">
23
+ <Icon icon={PreviousIcon} />
24
+ </IconButton>
25
+ <Input
26
+ type="text"
27
+ placeholder={placeholder}
28
+ id={placeholder}
29
+ value={filter}
30
+ onChange={onChange}
31
+ autoFocus
32
+ fullWidth
33
+ disableUnderline
34
+ />
35
+ </Paper>
40
36
  )
41
37
  }
42
38
 
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types'
4
4
  import React, { useState } from 'react'
5
5
 
6
6
  import labelStyles from 'cozy-ui/react/Label/styles.styl'
7
- import Label from 'cozy-ui/transpiled/react/Label'
7
+ import InputLabel from 'cozy-ui/transpiled/react/InputLabel'
8
8
  import SelectBox from 'cozy-ui/transpiled/react/SelectBox'
9
- import Textarea from 'cozy-ui/transpiled/react/Textarea'
9
+ import TextField from 'cozy-ui/transpiled/react/TextField'
10
10
  import Input from 'cozy-ui/transpiled/react/legacy/Input'
11
11
 
12
12
  import styles from './styles.styl'
@@ -141,7 +141,8 @@ const Field = props => {
141
141
  )
142
142
  case 'textarea':
143
143
  return (
144
- <Textarea
144
+ <TextField
145
+ multiline
145
146
  autoCapitalize={autoCapitalize}
146
147
  disabled={disabled}
147
148
  id={id}
@@ -151,7 +152,7 @@ const Field = props => {
151
152
  onKeyUp={onKeyUp}
152
153
  onFocus={onFocus}
153
154
  onBlur={onBlur}
154
- readOnly={readOnly}
155
+ inputProps={{ readOnly }}
155
156
  {...controlledProps}
156
157
  />
157
158
  )
@@ -224,9 +225,9 @@ const Field = props => {
224
225
 
225
226
  return (
226
227
  <FieldContainer className={className} variant={variant}>
227
- <Label htmlFor={id} {...labelProps}>
228
+ <InputLabel htmlFor={id} {...labelProps}>
228
229
  {label}
229
- </Label>
230
+ </InputLabel>
230
231
  {side && (
231
232
  <div
232
233
  className={cx(styles['o-side'], labelStyles['c-label'], {
@@ -7,7 +7,6 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
7
7
  import FiletypeNoteIcon from 'cozy-ui/transpiled/react/Icons/FileTypeNote'
8
8
  import FiletypeTextIcon from 'cozy-ui/transpiled/react/Icons/FileTypeText'
9
9
  import Skeleton from 'cozy-ui/transpiled/react/Skeleton'
10
- import Thumbnail from 'cozy-ui/transpiled/react/Thumbnail'
11
10
 
12
11
  import FileImageLoader from '../../FileImageLoader'
13
12
 
@@ -23,19 +22,28 @@ const ItemIcon = ({ icon, file }) => {
23
22
  linkType="tiny"
24
23
  render={src => {
25
24
  return (
26
- <Thumbnail>
25
+ <div className="u-flex u-w-2 u-h-2 u-flex-items-center u-flex-justify-center">
27
26
  {src ? (
28
- <img src={src} alt="" />
27
+ <img
28
+ className="u-w-2 u-h-2"
29
+ style={{ objectFit: 'contain' }}
30
+ src={src}
31
+ alt=""
32
+ />
29
33
  ) : (
30
- <Skeleton variant="rect" animation="wave" />
34
+ <Skeleton
35
+ className="u-w-100 u-h-100"
36
+ variant="rect"
37
+ animation="wave"
38
+ />
31
39
  )}
32
- </Thumbnail>
40
+ </div>
33
41
  )
34
42
  }}
35
43
  renderFallback={() => (
36
- <Thumbnail>
44
+ <div className="u-flex u-w-2 u-h-2 u-flex-items-center u-flex-justify-center">
37
45
  <Icon icon={isNote(file) ? FiletypeNoteIcon : FiletypeTextIcon} />
38
- </Thumbnail>
46
+ </div>
39
47
  )}
40
48
  />
41
49
  )
@@ -3,7 +3,6 @@ import React from 'react'
3
3
 
4
4
  import ButtonBase from 'cozy-ui/transpiled/react/ButtonBase'
5
5
  import Icon, { iconPropType } from 'cozy-ui/transpiled/react/Icon'
6
- import IconStack from 'cozy-ui/transpiled/react/IconStack'
7
6
  import FileDuotoneIcon from 'cozy-ui/transpiled/react/Icons/FileDuotone'
8
7
  import Typography from 'cozy-ui/transpiled/react/Typography'
9
8
  import { makeStyles } from 'cozy-ui/transpiled/react/styles'
@@ -27,19 +26,15 @@ const QualificationItem = ({ icon, label, isSelected, onClick, ...props }) => {
27
26
 
28
27
  return (
29
28
  <ButtonBase {...props} className={styles.item} onClick={onClick}>
30
- <IconStack
31
- className="u-mb-half"
32
- foreground={
33
- icon && (
34
- <Icon
35
- icon={icon}
36
- color={
37
- isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
38
- }
39
- />
40
- )
41
- }
42
- background={
29
+ <div className="u-mb-half">
30
+ {icon ? (
31
+ <Icon
32
+ icon={icon}
33
+ color={
34
+ isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
35
+ }
36
+ />
37
+ ) : (
43
38
  <Icon
44
39
  icon={FileDuotoneIcon}
45
40
  size="32"
@@ -47,8 +42,8 @@ const QualificationItem = ({ icon, label, isSelected, onClick, ...props }) => {
47
42
  isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
48
43
  }
49
44
  />
50
- }
51
- />
45
+ )}
46
+ </div>
52
47
  <Typography variant="caption">{label}</Typography>
53
48
  </ButtonBase>
54
49
  )
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
+ import { nameToColor } from 'cozy-ui/transpiled/react/Avatar/helpers'
3
4
  import { TileIcon } from 'cozy-ui/transpiled/react/Tile'
4
5
  import Typography from 'cozy-ui/transpiled/react/Typography'
5
- import { nameToColor } from 'cozy-ui/transpiled/react/legacy/Avatar/helpers'
6
6
  import { makeStyles } from 'cozy-ui/transpiled/react/styles'
7
7
 
8
8
  import styles from '../AppTile/styles.styl'