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.
- package/CHANGELOG.md +23 -0
- package/dist/CollectionField/index.js +2 -2
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +49 -20
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +5 -16
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +2 -2
- package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +3 -1
- package/dist/Contacts/AddModal/ContactForm/RemoveButton.js +34 -0
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +3 -1
- package/dist/Contacts/AddModal/ContactForm/helpers.js +12 -2
- package/dist/Contacts/AddModal/ContactForm/index.js +14 -3
- package/dist/ContactsListModal/ContactsListModal.js +2 -6
- package/dist/ContactsListModal/MobileHeader.js +2 -6
- package/dist/Field/index.js +9 -10
- package/dist/ListItem/ListItemFile/ItemIcon.js +11 -4
- package/dist/Qualification/QualificationItem/index.js +10 -14
- package/dist/ShortcutTile/index.js +2 -2
- package/dist/SquareAppIcon/index.js +22 -21
- package/dist/providers/CozyTheme/index.js +0 -3
- package/dist/src/Contacts/AddModal/ContactForm/FieldInput.d.ts +3 -1
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputWrapper.d.ts +2 -1
- package/dist/src/Contacts/AddModal/ContactForm/RemoveButton.d.ts +4 -0
- package/dist/src/providers/CozyTheme/index.d.ts +0 -3
- package/dist/stylesheet.css +0 -25
- package/package.json +4 -4
- package/src/CollectionField/index.jsx +2 -2
- package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +29 -9
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +3 -14
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +5 -3
- package/src/Contacts/AddModal/ContactForm/FieldInputWrapper.jsx +3 -1
- package/src/Contacts/AddModal/ContactForm/RemoveButton.jsx +18 -0
- package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +3 -1
- package/src/Contacts/AddModal/ContactForm/helpers.js +11 -2
- package/src/Contacts/AddModal/ContactForm/helpers.spec.js +62 -0
- package/src/Contacts/AddModal/ContactForm/index.jsx +27 -14
- package/src/ContactsListModal/ContactsListModal.jsx +1 -4
- package/src/ContactsListModal/MobileHeader.jsx +20 -24
- package/src/Field/index.jsx +7 -6
- package/src/ListItem/ListItemFile/ItemIcon.jsx +15 -7
- package/src/Qualification/QualificationItem/index.jsx +11 -16
- package/src/ShortcutTile/index.tsx +1 -1
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +240 -271
- package/src/SquareAppIcon/index.jsx +96 -107
- package/src/providers/CozyTheme/index.jsx +0 -2
- 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
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
package/src/Field/index.jsx
CHANGED
|
@@ -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
|
|
7
|
+
import InputLabel from 'cozy-ui/transpiled/react/InputLabel'
|
|
8
8
|
import SelectBox from 'cozy-ui/transpiled/react/SelectBox'
|
|
9
|
-
import
|
|
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
|
-
<
|
|
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
|
-
|
|
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
|
-
<
|
|
228
|
+
<InputLabel htmlFor={id} {...labelProps}>
|
|
228
229
|
{label}
|
|
229
|
-
</
|
|
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
|
-
<
|
|
25
|
+
<div className="u-flex u-w-2 u-h-2 u-flex-items-center u-flex-justify-center">
|
|
27
26
|
{src ? (
|
|
28
|
-
<img
|
|
27
|
+
<img
|
|
28
|
+
className="u-w-2 u-h-2"
|
|
29
|
+
style={{ objectFit: 'contain' }}
|
|
30
|
+
src={src}
|
|
31
|
+
alt=""
|
|
32
|
+
/>
|
|
29
33
|
) : (
|
|
30
|
-
<Skeleton
|
|
34
|
+
<Skeleton
|
|
35
|
+
className="u-w-100 u-h-100"
|
|
36
|
+
variant="rect"
|
|
37
|
+
animation="wave"
|
|
38
|
+
/>
|
|
31
39
|
)}
|
|
32
|
-
</
|
|
40
|
+
</div>
|
|
33
41
|
)
|
|
34
42
|
}}
|
|
35
43
|
renderFallback={() => (
|
|
36
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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'
|