cozy-ui 65.1.1 → 66.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 +27 -0
- package/package.json +3 -3
- package/react/Badge/Readme.md +1 -1
- package/react/Badge/index.jsx +18 -2
- package/react/BottomSheet/BottomSheet.jsx +5 -3
- package/react/ContactPicker/Readme.md +2 -2
- package/react/ContactsListModal/Readme.md +2 -2
- package/react/Dialog/index.jsx +3 -3
- package/react/MuiCozyTheme/makeOverrides.js +4 -4
- package/react/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +18 -18
- package/react/SquareAppIcon/index.jsx +2 -2
- package/react/Viewer/Readme.md +3 -3
- package/react/Viewer/index.jsx +1 -1
- package/react/__snapshots__/examples.spec.jsx.snap +2 -2
- package/transpiled/react/Badge/index.js +9 -4
- package/transpiled/react/BottomSheet/BottomSheet.js +3 -3
- package/transpiled/react/Dialog/index.js +3 -3
- package/transpiled/react/MuiCozyTheme/makeOverrides.js +4 -4
- package/transpiled/react/SquareAppIcon/index.js +2 -2
- package/transpiled/react/Viewer/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# [66.0.0](https://github.com/cozy/cozy-ui/compare/v65.1.3...v66.0.0) (2022-05-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Upgrade cozy-device-helper API ([45b22fa](https://github.com/cozy/cozy-ui/commit/45b22fa))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* This will use a more robust CDH API.
|
|
12
|
+
In order to support the update, it is need to upgrade CDH to >=2.0.0
|
|
13
|
+
|
|
14
|
+
## [65.1.3](https://github.com/cozy/cozy-ui/compare/v65.1.2...v65.1.3) (2022-04-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Export toolbarPropsPropType correctly ([ccf994f](https://github.com/cozy/cozy-ui/commit/ccf994f))
|
|
20
|
+
|
|
21
|
+
## [65.1.2](https://github.com/cozy/cozy-ui/compare/v65.1.1...v65.1.2) (2022-04-29)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* Use `circular | rectangular` on Badge overlap ([ae374ff](https://github.com/cozy/cozy-ui/commit/ae374ff))
|
|
27
|
+
|
|
1
28
|
## [65.1.1](https://github.com/cozy/cozy-ui/compare/v65.1.0...v65.1.1) (2022-04-29)
|
|
2
29
|
|
|
3
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "66.0.0",
|
|
4
4
|
"description": "Cozy apps UI SDK",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"commitlint-config-cozy": "0.6.0",
|
|
92
92
|
"copyfiles": "2.4.1",
|
|
93
93
|
"cozy-client": "28.2.0",
|
|
94
|
-
"cozy-device-helper": "
|
|
94
|
+
"cozy-device-helper": "2.0.0",
|
|
95
95
|
"cozy-doctypes": "^1.69.0",
|
|
96
96
|
"cozy-harvest-lib": "^6.7.3",
|
|
97
97
|
"cozy-intent": "1.16.1",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"peerDependencies": {
|
|
177
177
|
"@material-ui/core": ">=4.12",
|
|
178
178
|
"cozy-client": ">=28.1.0",
|
|
179
|
-
"cozy-device-helper": "^
|
|
179
|
+
"cozy-device-helper": "^2.0.0",
|
|
180
180
|
"cozy-doctypes": "^1.69.0",
|
|
181
181
|
"cozy-harvest-lib": "^6.7.3",
|
|
182
182
|
"cozy-intent": ">=1.3.0",
|
package/react/Badge/Readme.md
CHANGED
|
@@ -33,7 +33,7 @@ const initialVariants = [
|
|
|
33
33
|
horizontal: variant.left ? "left" : "right",
|
|
34
34
|
}}
|
|
35
35
|
withBorder={variant.withBorder}
|
|
36
|
-
overlap={variant.overlap ? "
|
|
36
|
+
overlap={variant.overlap ? "circular" : "rectangular"}
|
|
37
37
|
>
|
|
38
38
|
<Icon
|
|
39
39
|
icon={CircleFilledIcon}
|
package/react/Badge/index.jsx
CHANGED
|
@@ -3,19 +3,35 @@ import cx from 'classnames'
|
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
4
|
import MuiBadge from '@material-ui/core/Badge'
|
|
5
5
|
|
|
6
|
-
const Badge = ({
|
|
6
|
+
const Badge = ({
|
|
7
|
+
classes = {},
|
|
8
|
+
size,
|
|
9
|
+
withBorder,
|
|
10
|
+
overlap: overlapProp,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
7
13
|
const sizeClasses = {
|
|
8
14
|
small: 'badgeSizeSmall',
|
|
9
15
|
medium: 'badgeSizeMedium',
|
|
10
16
|
large: 'badgeSizeLarge'
|
|
11
17
|
}
|
|
12
18
|
|
|
19
|
+
// due to deprecated prop circle and rectangle
|
|
20
|
+
// https://github.com/mui/material-ui/releases/tag/v4.12.4
|
|
21
|
+
const overlap =
|
|
22
|
+
overlapProp === 'circle'
|
|
23
|
+
? 'circular'
|
|
24
|
+
: overlapProp === 'rectangle'
|
|
25
|
+
? 'rectangular'
|
|
26
|
+
: overlapProp
|
|
27
|
+
|
|
13
28
|
return (
|
|
14
29
|
<MuiBadge
|
|
15
30
|
classes={{
|
|
16
31
|
badge: cx(sizeClasses[size], withBorder ? 'badgeBorder' : null),
|
|
17
32
|
...classes
|
|
18
33
|
}}
|
|
34
|
+
overlap={overlap}
|
|
19
35
|
{...props}
|
|
20
36
|
/>
|
|
21
37
|
)
|
|
@@ -37,7 +53,7 @@ Badge.defaultProps = {
|
|
|
37
53
|
size: 'medium',
|
|
38
54
|
showZero: true,
|
|
39
55
|
withBorder: true,
|
|
40
|
-
overlap: '
|
|
56
|
+
overlap: 'circular'
|
|
41
57
|
}
|
|
42
58
|
|
|
43
59
|
export default Badge
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, useMemo } from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { BottomSheet as MuiBottomSheet } from 'mui-bottom-sheet'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getFlagshipMetadata } from 'cozy-device-helper'
|
|
6
6
|
|
|
7
7
|
import Stack from 'cozy-ui/transpiled/react/Stack'
|
|
8
8
|
import Paper from 'cozy-ui/transpiled/react/Paper'
|
|
@@ -112,7 +112,7 @@ const BottomSheet = ({ toolbarProps, settings, children }) => {
|
|
|
112
112
|
headerRef.current.offsetHeight +
|
|
113
113
|
actionButtonsHeight +
|
|
114
114
|
actionButtonsBottomMargin +
|
|
115
|
-
(
|
|
115
|
+
(getFlagshipMetadata().navbarHeight || 0)
|
|
116
116
|
|
|
117
117
|
// Used so that the bottomSheet can be opened to the top,
|
|
118
118
|
// without stopping at the content height
|
|
@@ -154,7 +154,9 @@ const BottomSheet = ({ toolbarProps, settings, children }) => {
|
|
|
154
154
|
|
|
155
155
|
return (
|
|
156
156
|
<>
|
|
157
|
-
{
|
|
157
|
+
{getFlagshipMetadata().immersive && (
|
|
158
|
+
<span style={styles.flagshipImmersive} />
|
|
159
|
+
)}
|
|
158
160
|
|
|
159
161
|
<MuiBottomSheet
|
|
160
162
|
peekHeights={peekHeights}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
⚠️ The app must have `POST` permission on `io.cozy.contacts` doctype to use `ContactPicker`.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
⚠️ Since this component use `ContactsListModal`, it does a request to fetch all contacts, it should be wrapped in a CozyProvider.
|
|
4
4
|
|
|
5
5
|
Also, to take advantage of realtime updates of the contacts, the CozyClient passed to the provider should have a realtime plugin initialized. The component will work without realtime initialized, but the list will not always be up-to-date.
|
|
6
6
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A filterable list of contacts shown in a modal.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
⚠️ The app must have `POST` permission on `io.cozy.contacts` doctype to use `ContactsListModal`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
⚠️ Since this component does a request to fetch all contacts, it should be wrapped in a CozyProvider.
|
|
8
8
|
|
|
9
9
|
Also, to take advantage of realtime updates of the contacts, the CozyClient passed to the provider should have a realtime plugin initialized. The component will work without realtime initialized, but the list will not always be up-to-date.
|
|
10
10
|
|
package/react/Dialog/index.jsx
CHANGED
|
@@ -3,7 +3,7 @@ import { RemoveScroll } from 'react-remove-scroll'
|
|
|
3
3
|
import { default as MUIDialog } from '@material-ui/core/Dialog'
|
|
4
4
|
import { useTheme } from '@material-ui/core'
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { getFlagshipMetadata } from 'cozy-device-helper'
|
|
7
7
|
|
|
8
8
|
import useBreakpoints from '../hooks/useBreakpoints'
|
|
9
9
|
import { useCozyTheme } from '../CozyTheme'
|
|
@@ -49,13 +49,13 @@ const Dialog = props => {
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
bottomBackground: theme.palette.background[sidebar ? 'default' : 'paper'],
|
|
52
|
-
bottomTheme:
|
|
52
|
+
bottomTheme: getFlagshipMetadata().immersive ? 'light' : 'dark',
|
|
53
53
|
bottomOverlay: 'transparent',
|
|
54
54
|
topOverlay: 'transparent',
|
|
55
55
|
topBackground:
|
|
56
56
|
cozBar && getComputedStyle(cozBar).getPropertyValue('background-color'),
|
|
57
57
|
topTheme:
|
|
58
|
-
|
|
58
|
+
getFlagshipMetadata().immersive ||
|
|
59
59
|
(cozBar && cozBar.classList.contains('coz-theme-primary'))
|
|
60
60
|
? 'light'
|
|
61
61
|
: 'dark'
|
|
@@ -697,16 +697,16 @@ const makeOverrides = theme => ({
|
|
|
697
697
|
fontSize: '.5rem'
|
|
698
698
|
}
|
|
699
699
|
},
|
|
700
|
-
|
|
700
|
+
anchorOriginTopRightRectangular: {
|
|
701
701
|
transform: 'scale(1) translate(37%, -37%)'
|
|
702
702
|
},
|
|
703
|
-
|
|
703
|
+
anchorOriginBottomRightRectangular: {
|
|
704
704
|
transform: 'scale(1) translate(37%, 37%)'
|
|
705
705
|
},
|
|
706
|
-
|
|
706
|
+
anchorOriginBottomLeftRectangular: {
|
|
707
707
|
transform: 'scale(1) translate(-37%, 37%)'
|
|
708
708
|
},
|
|
709
|
-
|
|
709
|
+
anchorOriginTopLeftRectangular: {
|
|
710
710
|
transform: 'scale(1) translate(-37%, -37%)'
|
|
711
711
|
},
|
|
712
712
|
dot: {
|
|
@@ -27,11 +27,11 @@ exports[`SquareAppIcon component should render an app correctly with the app nam
|
|
|
27
27
|
</svg>
|
|
28
28
|
</div>
|
|
29
29
|
<span
|
|
30
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
30
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
31
31
|
/>
|
|
32
32
|
</span>
|
|
33
33
|
<span
|
|
34
|
-
class="MuiBadge-badge Component-qualifier-12 MuiBadge-
|
|
34
|
+
class="MuiBadge-badge Component-qualifier-12 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
35
35
|
/>
|
|
36
36
|
</span>
|
|
37
37
|
<h6
|
|
@@ -69,11 +69,11 @@ exports[`SquareAppIcon component should render an app correctly with the given n
|
|
|
69
69
|
</svg>
|
|
70
70
|
</div>
|
|
71
71
|
<span
|
|
72
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
72
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
73
73
|
/>
|
|
74
74
|
</span>
|
|
75
75
|
<span
|
|
76
|
-
class="MuiBadge-badge Component-qualifier-6 MuiBadge-
|
|
76
|
+
class="MuiBadge-badge Component-qualifier-6 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
77
77
|
/>
|
|
78
78
|
</span>
|
|
79
79
|
<h6
|
|
@@ -111,11 +111,11 @@ exports[`SquareAppIcon component should render an app with the app slug if no na
|
|
|
111
111
|
</svg>
|
|
112
112
|
</div>
|
|
113
113
|
<span
|
|
114
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
114
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
115
115
|
/>
|
|
116
116
|
</span>
|
|
117
117
|
<span
|
|
118
|
-
class="MuiBadge-badge Component-qualifier-18 MuiBadge-
|
|
118
|
+
class="MuiBadge-badge Component-qualifier-18 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
119
119
|
/>
|
|
120
120
|
</span>
|
|
121
121
|
<h6
|
|
@@ -160,11 +160,11 @@ exports[`SquareAppIcon component should render correctly an app in add state 1`]
|
|
|
160
160
|
</svg>
|
|
161
161
|
</div>
|
|
162
162
|
<span
|
|
163
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
163
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
164
164
|
/>
|
|
165
165
|
</span>
|
|
166
166
|
<span
|
|
167
|
-
class="MuiBadge-badge Component-qualifier-42 MuiBadge-
|
|
167
|
+
class="MuiBadge-badge Component-qualifier-42 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
168
168
|
/>
|
|
169
169
|
</span>
|
|
170
170
|
<h6
|
|
@@ -200,7 +200,7 @@ exports[`SquareAppIcon component should render correctly an app in error state 1
|
|
|
200
200
|
</svg>
|
|
201
201
|
</div>
|
|
202
202
|
<span
|
|
203
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
203
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular MuiBadge-colorError"
|
|
204
204
|
>
|
|
205
205
|
<svg
|
|
206
206
|
class="makeStyles-errorIcon-34 styles__icon___23x3R"
|
|
@@ -216,7 +216,7 @@ exports[`SquareAppIcon component should render correctly an app in error state 1
|
|
|
216
216
|
</span>
|
|
217
217
|
</span>
|
|
218
218
|
<span
|
|
219
|
-
class="MuiBadge-badge Component-qualifier-36 MuiBadge-
|
|
219
|
+
class="MuiBadge-badge Component-qualifier-36 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
220
220
|
/>
|
|
221
221
|
</span>
|
|
222
222
|
<h6
|
|
@@ -254,11 +254,11 @@ exports[`SquareAppIcon component should render correctly an app in ghost state 1
|
|
|
254
254
|
</svg>
|
|
255
255
|
</div>
|
|
256
256
|
<span
|
|
257
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
257
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
258
258
|
/>
|
|
259
259
|
</span>
|
|
260
260
|
<span
|
|
261
|
-
class="MuiBadge-badge Component-qualifier-30 MuiBadge-
|
|
261
|
+
class="MuiBadge-badge Component-qualifier-30 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
262
262
|
/>
|
|
263
263
|
</span>
|
|
264
264
|
<h6
|
|
@@ -296,11 +296,11 @@ exports[`SquareAppIcon component should render correctly an app in maintenance s
|
|
|
296
296
|
</svg>
|
|
297
297
|
</div>
|
|
298
298
|
<span
|
|
299
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
299
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
300
300
|
/>
|
|
301
301
|
</span>
|
|
302
302
|
<span
|
|
303
|
-
class="MuiBadge-badge Component-qualifier-24 MuiBadge-
|
|
303
|
+
class="MuiBadge-badge Component-qualifier-24 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
304
304
|
/>
|
|
305
305
|
</span>
|
|
306
306
|
<h6
|
|
@@ -329,11 +329,11 @@ exports[`SquareAppIcon component should render correctly an app in shortcut stat
|
|
|
329
329
|
S
|
|
330
330
|
</h2>
|
|
331
331
|
<span
|
|
332
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
332
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
333
333
|
/>
|
|
334
334
|
</span>
|
|
335
335
|
<span
|
|
336
|
-
class="MuiBadge-badge Component-qualifier-48 MuiBadge-
|
|
336
|
+
class="MuiBadge-badge Component-qualifier-48 MuiBadge-anchorOriginBottomRightRectangular"
|
|
337
337
|
>
|
|
338
338
|
<svg
|
|
339
339
|
class="styles__icon___23x3R"
|
|
@@ -384,11 +384,11 @@ exports[`SquareAppIcon component should render correctly an app with custom cont
|
|
|
384
384
|
</svg>
|
|
385
385
|
</div>
|
|
386
386
|
<span
|
|
387
|
-
class="MuiBadge-badge badgeSizeLarge MuiBadge-
|
|
387
|
+
class="MuiBadge-badge badgeSizeLarge MuiBadge-anchorOriginTopRightRectangular"
|
|
388
388
|
/>
|
|
389
389
|
</span>
|
|
390
390
|
<span
|
|
391
|
-
class="MuiBadge-badge Component-qualifier-54 MuiBadge-
|
|
391
|
+
class="MuiBadge-badge Component-qualifier-54 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
392
392
|
/>
|
|
393
393
|
</span>
|
|
394
394
|
<h6
|
|
@@ -78,7 +78,7 @@ export const SquareAppIcon = ({
|
|
|
78
78
|
badgeContent={
|
|
79
79
|
variant === 'shortcut' ? <Icon size="10" icon={iconOut} /> : null
|
|
80
80
|
}
|
|
81
|
-
overlap="
|
|
81
|
+
overlap="rectangular"
|
|
82
82
|
invisible={variant !== 'shortcut'}
|
|
83
83
|
>
|
|
84
84
|
<Badge
|
|
@@ -107,7 +107,7 @@ export const SquareAppIcon = ({
|
|
|
107
107
|
color={variant === 'error' ? 'error' : undefined}
|
|
108
108
|
withBorder={false}
|
|
109
109
|
size="large"
|
|
110
|
-
overlap="
|
|
110
|
+
overlap="rectangular"
|
|
111
111
|
style={
|
|
112
112
|
variant === 'shortcut'
|
|
113
113
|
? { backgroundColor: nameToColor(name) }
|
package/react/Viewer/Readme.md
CHANGED
|
@@ -4,7 +4,7 @@ Once rendered, the `Viewer` will take up all the available space in it's contain
|
|
|
4
4
|
|
|
5
5
|
The `Viewer` can display an **information panel** to show additional information about the current file (e.g. whether a file is certified).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
⚠️ Important :
|
|
8
8
|
|
|
9
9
|
* To have the panels, the app need to have [cozy-harvest-lib](https://github.com/cozy/cozy-libs/tree/master/packages/cozy-harvest-lib) installed
|
|
10
10
|
|
|
@@ -80,7 +80,7 @@ const files = [
|
|
|
80
80
|
mime: 'text/plain',
|
|
81
81
|
encrypted: true
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
{
|
|
85
85
|
_id: 'image',
|
|
86
86
|
class: 'image',
|
|
@@ -208,6 +208,6 @@ The `Viewer` can be used only in a `React` Application. You can't use it with `P
|
|
|
208
208
|
|
|
209
209
|
### Special case: client-side encrypted files
|
|
210
210
|
|
|
211
|
-
When a file is client-side encrypted, it is not possible to get the download link from the server anymore.
|
|
211
|
+
When a file is client-side encrypted, it is not possible to get the download link from the server anymore.
|
|
212
212
|
Hence, an additional `currentURL` prop must be eventually given to the `<Viewer>`. This URL is the decrypted
|
|
213
213
|
file, asynchronously provided by the app.
|
package/react/Viewer/index.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import ViewerContainer from './ViewerContainer'
|
|
|
2
2
|
|
|
3
3
|
export { default as Viewer } from './Viewer'
|
|
4
4
|
export { default as ViewerContainer } from './ViewerContainer'
|
|
5
|
-
export
|
|
5
|
+
export * as toolbarPropsPropType from './proptypes'
|
|
6
6
|
export {
|
|
7
7
|
default as ViewerWithCustomPanelAndFooter
|
|
8
8
|
} from './ViewerWithCustomPanelAndFooter'
|
|
@@ -103,11 +103,11 @@ exports[`Badge should render examples: Badge 1`] = `
|
|
|
103
103
|
"<div>
|
|
104
104
|
<div class=\\"MuiPaper-root u-p-1 u-mb-1 MuiPaper-elevation1\\">
|
|
105
105
|
<h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5\\">Variant selector</h5><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-checked-2 Mui-checked MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\" checked=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">OVERLAP</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">ERROR</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">DOT</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">WITHBORDER</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LEFT</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">BOTTOM</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">SMALL</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">LARGE</span></label>
|
|
106
|
-
</div><span class=\\"MuiBadge-root u-m-half\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" style=\\"fill: var(--slateGrey);\\" width=\\"24\\" height=\\"24\\"><circle cx=\\"8\\" cy=\\"8\\" r=\\"8\\" fill-rule=\\"evenodd\\"></circle></svg><span class=\\"MuiBadge-badge badgeSizeMedium MuiBadge-
|
|
106
|
+
</div><span class=\\"MuiBadge-root u-m-half\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" style=\\"fill: var(--slateGrey);\\" width=\\"24\\" height=\\"24\\"><circle cx=\\"8\\" cy=\\"8\\" r=\\"8\\" fill-rule=\\"evenodd\\"></circle></svg><span class=\\"MuiBadge-badge badgeSizeMedium MuiBadge-anchorOriginTopRightCircular MuiBadge-colorPrimary\\">4</span></span>
|
|
107
107
|
</div>"
|
|
108
108
|
`;
|
|
109
109
|
|
|
110
|
-
exports[`Badge should render examples: Badge 2`] = `"<div><span class=\\"MuiBadge-root\\"><div class=\\"styles__c-avatar___PpDI- styles__c-avatar--text___2dvna\\" style=\\"background-color: rgb(127, 107, 238); --circleSize: 32px;\\"><span class=\\"styles__c-avatar-initials___310qC\\">CD</span></div><span class=\\"MuiBadge-badge Component-qualifier-5 MuiBadge-
|
|
110
|
+
exports[`Badge should render examples: Badge 2`] = `"<div><span class=\\"MuiBadge-root\\"><div class=\\"styles__c-avatar___PpDI- styles__c-avatar--text___2dvna\\" style=\\"background-color: rgb(127, 107, 238); --circleSize: 32px;\\"><span class=\\"styles__c-avatar-initials___310qC\\">CD</span></div><span class=\\"MuiBadge-badge Component-qualifier-5 MuiBadge-anchorOriginBottomRightCircular\\"><span class=\\"MuiBadge-root\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"10\\" height=\\"10\\"><path fill-rule=\\"evenodd\\" d=\\"M9.259 4.045a1.043 1.043 0 11-1.475-1.474L9.44.915a3.126 3.126 0 014.417-.002l1.23 1.23a3.126 3.126 0 01-.007 4.422l-3.612 3.612c-1.6 1.6-4.244 1.65-5.77.124a1.043 1.043 0 111.475-1.474c.699.698 2.023.673 2.82-.125l3.613-3.612a1.04 1.04 0 00.006-1.473l-1.23-1.23a1.04 1.04 0 00-1.468.003L9.26 4.045zm-2.518 7.91a1.043 1.043 0 011.475 1.474L6.56 15.085a3.126 3.126 0 01-4.417.002l-1.23-1.23a3.126 3.126 0 01.006-4.422l3.613-3.612c1.6-1.6 4.243-1.65 5.77-.124a1.043 1.043 0 01-1.475 1.474c-.7-.698-2.023-.673-2.82.125L2.393 10.91a1.04 1.04 0 00-.007 1.473l1.23 1.23a1.04 1.04 0 001.469-.003l1.655-1.655z\\"></path></svg><span class=\\"MuiBadge-badge badgeSizeSmall badgeBorder MuiBadge-anchorOriginTopRightCircular MuiBadge-colorError MuiBadge-dot\\"></span></span></span></span></div>"`;
|
|
111
111
|
|
|
112
112
|
exports[`Banner should render examples: Banner 1`] = `
|
|
113
113
|
"<div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["classes", "size", "withBorder"];
|
|
4
|
+
var _excluded = ["classes", "size", "withBorder", "overlap"];
|
|
5
5
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
|
|
@@ -17,17 +17,22 @@ var Badge = function Badge(_ref) {
|
|
|
17
17
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
18
18
|
size = _ref.size,
|
|
19
19
|
withBorder = _ref.withBorder,
|
|
20
|
+
overlapProp = _ref.overlap,
|
|
20
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
22
|
|
|
22
23
|
var sizeClasses = {
|
|
23
24
|
small: 'badgeSizeSmall',
|
|
24
25
|
medium: 'badgeSizeMedium',
|
|
25
26
|
large: 'badgeSizeLarge'
|
|
26
|
-
};
|
|
27
|
+
}; // due to deprecated prop circle and rectangle
|
|
28
|
+
// https://github.com/mui/material-ui/releases/tag/v4.12.4
|
|
29
|
+
|
|
30
|
+
var overlap = overlapProp === 'circle' ? 'circular' : overlapProp === 'rectangle' ? 'rectangular' : overlapProp;
|
|
27
31
|
return /*#__PURE__*/React.createElement(MuiBadge, _extends({
|
|
28
32
|
classes: _objectSpread({
|
|
29
33
|
badge: cx(sizeClasses[size], withBorder ? 'badgeBorder' : null)
|
|
30
|
-
}, classes)
|
|
34
|
+
}, classes),
|
|
35
|
+
overlap: overlap
|
|
31
36
|
}, props));
|
|
32
37
|
};
|
|
33
38
|
|
|
@@ -49,6 +54,6 @@ Badge.defaultProps = {
|
|
|
49
54
|
size: 'medium',
|
|
50
55
|
showZero: true,
|
|
51
56
|
withBorder: true,
|
|
52
|
-
overlap: '
|
|
57
|
+
overlap: 'circular'
|
|
53
58
|
};
|
|
54
59
|
export default Badge;
|
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { BottomSheet as MuiBottomSheet } from 'mui-bottom-sheet';
|
|
11
|
-
import {
|
|
11
|
+
import { getFlagshipMetadata } from 'cozy-device-helper';
|
|
12
12
|
import Stack from 'cozy-ui/transpiled/react/Stack';
|
|
13
13
|
import Paper from 'cozy-ui/transpiled/react/Paper';
|
|
14
14
|
|
|
@@ -126,7 +126,7 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
126
126
|
var computedMediumHeight = mediumHeight || Math.round(maxHeight * mediumHeightRatio);
|
|
127
127
|
var actionButtonsHeight = headerContent ? parseFloat(getComputedStyle(headerContent).getPropertyValue('height')) : 0;
|
|
128
128
|
var actionButtonsBottomMargin = headerContent ? parseFloat(getComputedStyle(headerContent).getPropertyValue('padding-bottom')) : 0;
|
|
129
|
-
var minHeight = headerRef.current.offsetHeight + actionButtonsHeight + actionButtonsBottomMargin + (
|
|
129
|
+
var minHeight = headerRef.current.offsetHeight + actionButtonsHeight + actionButtonsBottomMargin + (getFlagshipMetadata().navbarHeight || 0); // Used so that the bottomSheet can be opened to the top,
|
|
130
130
|
// without stopping at the content height
|
|
131
131
|
|
|
132
132
|
var bottomSpacerHeight = maxHeight - innerContentRef.current.offsetHeight;
|
|
@@ -157,7 +157,7 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
157
157
|
|
|
158
158
|
return child;
|
|
159
159
|
});
|
|
160
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
160
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, getFlagshipMetadata().immersive && /*#__PURE__*/React.createElement("span", {
|
|
161
161
|
style: styles.flagshipImmersive
|
|
162
162
|
}), /*#__PURE__*/React.createElement(MuiBottomSheet, {
|
|
163
163
|
peekHeights: peekHeights,
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { RemoveScroll } from 'react-remove-scroll';
|
|
4
4
|
import { default as MUIDialog } from '@material-ui/core/Dialog';
|
|
5
5
|
import { useTheme } from '@material-ui/core';
|
|
6
|
-
import {
|
|
6
|
+
import { getFlagshipMetadata } from 'cozy-device-helper';
|
|
7
7
|
import useBreakpoints from "cozy-ui/transpiled/react/hooks/useBreakpoints";
|
|
8
8
|
import { useCozyTheme } from "cozy-ui/transpiled/react/CozyTheme";
|
|
9
9
|
var themesStyles = {
|
|
@@ -45,11 +45,11 @@ var Dialog = function Dialog(props) {
|
|
|
45
45
|
topTheme: 'light'
|
|
46
46
|
}, {
|
|
47
47
|
bottomBackground: theme.palette.background[sidebar ? 'default' : 'paper'],
|
|
48
|
-
bottomTheme:
|
|
48
|
+
bottomTheme: getFlagshipMetadata().immersive ? 'light' : 'dark',
|
|
49
49
|
bottomOverlay: 'transparent',
|
|
50
50
|
topOverlay: 'transparent',
|
|
51
51
|
topBackground: cozBar && getComputedStyle(cozBar).getPropertyValue('background-color'),
|
|
52
|
-
topTheme:
|
|
52
|
+
topTheme: getFlagshipMetadata().immersive || cozBar && cozBar.classList.contains('coz-theme-primary') ? 'light' : 'dark'
|
|
53
53
|
}, 'cozy-ui/Dialog');
|
|
54
54
|
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(MUIDialog, _extends({
|
|
55
55
|
className: themesStyles["CozyTheme--".concat(cozyTheme)]
|
|
@@ -637,16 +637,16 @@ var makeOverrides = function makeOverrides(theme) {
|
|
|
637
637
|
fontSize: '.5rem'
|
|
638
638
|
}
|
|
639
639
|
},
|
|
640
|
-
|
|
640
|
+
anchorOriginTopRightRectangular: {
|
|
641
641
|
transform: 'scale(1) translate(37%, -37%)'
|
|
642
642
|
},
|
|
643
|
-
|
|
643
|
+
anchorOriginBottomRightRectangular: {
|
|
644
644
|
transform: 'scale(1) translate(37%, 37%)'
|
|
645
645
|
},
|
|
646
|
-
|
|
646
|
+
anchorOriginBottomLeftRectangular: {
|
|
647
647
|
transform: 'scale(1) translate(-37%, 37%)'
|
|
648
648
|
},
|
|
649
|
-
|
|
649
|
+
anchorOriginTopLeftRectangular: {
|
|
650
650
|
transform: 'scale(1) translate(-37%, -37%)'
|
|
651
651
|
},
|
|
652
652
|
dot: {
|
|
@@ -92,7 +92,7 @@ export var SquareAppIcon = function SquareAppIcon(_ref) {
|
|
|
92
92
|
size: "10",
|
|
93
93
|
icon: iconOut
|
|
94
94
|
}) : null,
|
|
95
|
-
overlap: "
|
|
95
|
+
overlap: "rectangular",
|
|
96
96
|
invisible: variant !== 'shortcut'
|
|
97
97
|
}, /*#__PURE__*/React.createElement(Badge, {
|
|
98
98
|
className: cx(styles['SquareAppIcon-wrapper'], styles["SquareAppIcon-wrapper-".concat(variant)], (_cx = {}, _defineProperty(_cx, "".concat(styles['SquareAppIcon-wrapper-fx']), ['ghost', 'add'].includes(variant)), _defineProperty(_cx, classes.shadow, !['add', 'ghost'].includes(variant)), _cx)),
|
|
@@ -104,7 +104,7 @@ export var SquareAppIcon = function SquareAppIcon(_ref) {
|
|
|
104
104
|
color: variant === 'error' ? 'error' : undefined,
|
|
105
105
|
withBorder: false,
|
|
106
106
|
size: "large",
|
|
107
|
-
overlap: "
|
|
107
|
+
overlap: "rectangular",
|
|
108
108
|
style: variant === 'shortcut' ? {
|
|
109
109
|
backgroundColor: nameToColor(name)
|
|
110
110
|
} : null
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ViewerContainer from "cozy-ui/transpiled/react/Viewer/ViewerContainer";
|
|
2
2
|
export { default as Viewer } from './Viewer';
|
|
3
3
|
export { default as ViewerContainer } from './ViewerContainer';
|
|
4
|
-
|
|
4
|
+
import * as _toolbarPropsPropType from "cozy-ui/transpiled/react/Viewer/proptypes";
|
|
5
|
+
export { _toolbarPropsPropType as toolbarPropsPropType };
|
|
5
6
|
export { default as ViewerWithCustomPanelAndFooter } from './ViewerWithCustomPanelAndFooter';
|
|
6
7
|
export default ViewerContainer;
|