cozy-ui-plus 5.3.0 → 6.0.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 +14 -0
- package/dist/CollectionField/index.js +2 -2
- package/dist/ContactsListModal/ContactsListModal.js +2 -6
- package/dist/ContactsListModal/MobileHeader.js +2 -6
- package/dist/Field/index.js +8 -5
- 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/providers/CozyTheme/index.d.ts +0 -3
- package/package.json +9 -9
- package/src/AppLinker/__snapshots__/index.spec.jsx.snap +1 -1
- package/src/AppSections/__snapshots__/search.spec.js.snap +245 -245
- package/src/CollectionField/index.jsx +2 -2
- package/src/Contacts/AddModal/ContactForm/__snapshots__/HasValueCondition.spec.jsx.snap +1 -1
- package/src/ContactsListModal/ContactsListModal.jsx +1 -4
- package/src/ContactsListModal/MobileHeader.jsx +20 -24
- package/src/Field/index.jsx +7 -6
- package/src/Field/index.spec.js +4 -4
- package/src/ListItem/ListItemFile/ItemIcon.jsx +15 -7
- package/src/Paywall/Paywall.spec.jsx +9 -9
- package/src/Qualification/QualificationItem/index.jsx +11 -16
- package/src/ShortcutTile/index.tsx +1 -1
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +241 -271
- package/src/SquareAppIcon/index.jsx +96 -107
- package/src/providers/CozyTheme/index.jsx +0 -2
|
@@ -4,7 +4,7 @@ import React, { useRef } from 'react'
|
|
|
4
4
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
5
5
|
import CrossSmallIcon from 'cozy-ui/transpiled/react/Icons/CrossSmall'
|
|
6
6
|
import PlusIcon from 'cozy-ui/transpiled/react/Icons/Plus'
|
|
7
|
-
import
|
|
7
|
+
import InputLabel from 'cozy-ui/transpiled/react/InputLabel'
|
|
8
8
|
import Stack from 'cozy-ui/transpiled/react/Stack'
|
|
9
9
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button'
|
|
10
10
|
|
|
@@ -70,7 +70,7 @@ const CollectionField = props => {
|
|
|
70
70
|
|
|
71
71
|
return (
|
|
72
72
|
<FieldContainer {...rest}>
|
|
73
|
-
<
|
|
73
|
+
<InputLabel>{label}</InputLabel>
|
|
74
74
|
<Stack>
|
|
75
75
|
{values.length > 0 ? (
|
|
76
76
|
<Stack spacing="s">
|
|
@@ -22,7 +22,6 @@ import AddContactDialog from './AddContact/AddContactDialog'
|
|
|
22
22
|
import ContactsListContent from './ContactsListContent'
|
|
23
23
|
import MobileHeader from './MobileHeader'
|
|
24
24
|
import styles from './styles.styl'
|
|
25
|
-
import CozyTheme from '../providers/CozyTheme'
|
|
26
25
|
|
|
27
26
|
const ContactsListModal = ({
|
|
28
27
|
onItemClick,
|
|
@@ -64,9 +63,7 @@ const ContactsListModal = ({
|
|
|
64
63
|
|
|
65
64
|
return (
|
|
66
65
|
<TopAnchoredDialog {...dialogProps}>
|
|
67
|
-
<
|
|
68
|
-
<DialogCloseButton onClick={dismissAction} />
|
|
69
|
-
</CozyTheme>
|
|
66
|
+
<DialogCloseButton onClick={dismissAction} />
|
|
70
67
|
<DialogTitle
|
|
71
68
|
{...dialogTitleProps}
|
|
72
69
|
className={cx(dialogTitleProps.className, {
|
|
@@ -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'], {
|
package/src/Field/index.spec.js
CHANGED
|
@@ -26,7 +26,7 @@ describe('Field component', () => {
|
|
|
26
26
|
onChange={() => {}}
|
|
27
27
|
/>
|
|
28
28
|
)
|
|
29
|
-
).not.
|
|
29
|
+
).not.toThrow()
|
|
30
30
|
expect(() =>
|
|
31
31
|
render(
|
|
32
32
|
<Field
|
|
@@ -36,7 +36,7 @@ describe('Field component', () => {
|
|
|
36
36
|
onChange={() => {}}
|
|
37
37
|
/>
|
|
38
38
|
)
|
|
39
|
-
).
|
|
39
|
+
).toThrow()
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
it('should expect string type value for all types but select', () => {
|
|
@@ -49,11 +49,11 @@ describe('Field component', () => {
|
|
|
49
49
|
onChange={() => {}}
|
|
50
50
|
/>
|
|
51
51
|
)
|
|
52
|
-
).not.
|
|
52
|
+
).not.toThrow()
|
|
53
53
|
expect(() =>
|
|
54
54
|
render(
|
|
55
55
|
<Field label="mock field" type="text" value={{}} onChange={() => {}} />
|
|
56
56
|
)
|
|
57
|
-
).
|
|
57
|
+
).toThrow()
|
|
58
58
|
})
|
|
59
59
|
})
|
|
@@ -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
|
)
|
|
@@ -80,7 +80,7 @@ describe('Paywall', () => {
|
|
|
80
80
|
name: 'I understand'
|
|
81
81
|
})
|
|
82
82
|
fireEvent.click(actionButton)
|
|
83
|
-
expect(onCloseSpy).
|
|
83
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
84
84
|
})
|
|
85
85
|
|
|
86
86
|
it('should display the default case when there is a premium link but it is not enabled', async () => {
|
|
@@ -94,7 +94,7 @@ describe('Paywall', () => {
|
|
|
94
94
|
name: 'I understand'
|
|
95
95
|
})
|
|
96
96
|
fireEvent.click(actionButton)
|
|
97
|
-
expect(onCloseSpy).
|
|
97
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
it('should display the premium case when the premium link is enabled and available', async () => {
|
|
@@ -109,7 +109,7 @@ describe('Paywall', () => {
|
|
|
109
109
|
name: 'Check our plans'
|
|
110
110
|
})
|
|
111
111
|
fireEvent.click(actionButton)
|
|
112
|
-
expect(openSpy).
|
|
112
|
+
expect(openSpy).toHaveBeenCalledWith(
|
|
113
113
|
'http://mycozy.cloud/cozy/instances/123/premium?lang=en',
|
|
114
114
|
'_self'
|
|
115
115
|
)
|
|
@@ -132,7 +132,7 @@ describe('Paywall', () => {
|
|
|
132
132
|
name: 'I understand'
|
|
133
133
|
})
|
|
134
134
|
fireEvent.click(actionButton)
|
|
135
|
-
expect(onCloseSpy).
|
|
135
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
136
136
|
})
|
|
137
137
|
|
|
138
138
|
it('should display the default case when the premium link is not available in public context', async () => {
|
|
@@ -148,7 +148,7 @@ describe('Paywall', () => {
|
|
|
148
148
|
name: 'I understand'
|
|
149
149
|
})
|
|
150
150
|
fireEvent.click(actionButton)
|
|
151
|
-
expect(onCloseSpy).
|
|
151
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
152
152
|
})
|
|
153
153
|
|
|
154
154
|
describe('on flagship', () => {
|
|
@@ -165,7 +165,7 @@ describe('Paywall', () => {
|
|
|
165
165
|
name: 'I understand'
|
|
166
166
|
})
|
|
167
167
|
fireEvent.click(actionButton)
|
|
168
|
-
expect(onCloseSpy).
|
|
168
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
169
169
|
})
|
|
170
170
|
|
|
171
171
|
it('should display the premium case without an action button to access the premium link when flag flagship.iap.enabled is false', async () => {
|
|
@@ -182,7 +182,7 @@ describe('Paywall', () => {
|
|
|
182
182
|
name: 'I understand'
|
|
183
183
|
})
|
|
184
184
|
fireEvent.click(actionButton)
|
|
185
|
-
expect(onCloseSpy).
|
|
185
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
186
186
|
})
|
|
187
187
|
|
|
188
188
|
it('should display the premium case without an action button to access the premium link when flag flagship.iap.enabled is false and iap is unavailable', async () => {
|
|
@@ -201,7 +201,7 @@ describe('Paywall', () => {
|
|
|
201
201
|
})
|
|
202
202
|
|
|
203
203
|
fireEvent.click(actionButton)
|
|
204
|
-
expect(onCloseSpy).
|
|
204
|
+
expect(onCloseSpy).toHaveBeenCalledTimes(1)
|
|
205
205
|
})
|
|
206
206
|
|
|
207
207
|
it('should display the premium case with an action button to access the premium link when flag flagship.iap.enabled is true and iap is available', async () => {
|
|
@@ -219,7 +219,7 @@ describe('Paywall', () => {
|
|
|
219
219
|
name: 'Check our plans'
|
|
220
220
|
})
|
|
221
221
|
fireEvent.click(actionButton)
|
|
222
|
-
expect(openSpy).
|
|
222
|
+
expect(openSpy).toHaveBeenCalledWith(
|
|
223
223
|
'http://mycozy.cloud/cozy/instances/123/premium?lang=en',
|
|
224
224
|
'_self'
|
|
225
225
|
)
|
|
@@ -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'
|