cozy-ui 68.0.0 → 68.1.1
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/package.json +1 -1
- package/react/Banner/Readme.md +24 -15
- package/react/Banner/index.jsx +13 -4
- package/react/Viewer/Footer/BottomSheetContent.jsx +1 -0
- package/react/Viewer/Footer/DownloadButton.jsx +5 -4
- package/react/Viewer/Footer/FooterActionButtons.jsx +2 -0
- package/react/Viewer/Footer/FooterContent.jsx +13 -10
- package/react/Viewer/Footer/ForwardButton.jsx +5 -4
- package/react/Viewer/Panel/Certifications.jsx +1 -1
- package/react/Viewer/Panel/PanelContent.jsx +1 -1
- package/react/Viewer/Panel/Qualification.jsx +5 -5
- package/react/Viewer/Panel/QualificationListItemText.jsx +0 -1
- package/react/Viewer/controls.styl +1 -1
- package/react/__snapshots__/examples.spec.jsx.snap +1 -1
- package/transpiled/react/Banner/index.js +9 -4
- package/transpiled/react/Viewer/Footer/BottomSheetContent.js +1 -0
- package/transpiled/react/Viewer/Footer/DownloadButton.js +7 -4
- package/transpiled/react/Viewer/Footer/FooterActionButtons.js +1 -0
- package/transpiled/react/Viewer/Footer/FooterContent.js +4 -4
- package/transpiled/react/Viewer/Footer/ForwardButton.js +7 -4
- package/transpiled/react/Viewer/Panel/Certifications.js +1 -1
- package/transpiled/react/Viewer/Panel/PanelContent.js +1 -1
- package/transpiled/react/Viewer/Panel/Qualification.js +7 -5
- package/transpiled/react/Viewer/Panel/QualificationListItemText.js +0 -1
- package/transpiled/react/stylesheet.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [68.1.1](https://github.com/cozy/cozy-ui/compare/v68.1.0...v68.1.1) (2022-05-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Do not crash if the component does not find the child ([57f296b](https://github.com/cozy/cozy-ui/commit/57f296b))
|
|
7
|
+
* The name "FooterActionButtons" does not exist in the build version ([2d13777](https://github.com/cozy/cozy-ui/commit/2d13777))
|
|
8
|
+
|
|
9
|
+
# [68.1.0](https://github.com/cozy/cozy-ui/compare/v68.0.1...v68.1.0) (2022-05-24)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* Update the Viewer buttons to use the new cozy-ui Buttons ([5fa2868](https://github.com/cozy/cozy-ui/commit/5fa2868))
|
|
15
|
+
* **Banner:** Add disableIconStyles props ([fb6d274](https://github.com/cozy/cozy-ui/commit/fb6d274))
|
|
16
|
+
|
|
17
|
+
## [68.0.1](https://github.com/cozy/cozy-ui/compare/v68.0.0...v68.0.1) (2022-05-24)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Style of Viewer ([d6cfb28](https://github.com/cozy/cozy-ui/commit/d6cfb28))
|
|
23
|
+
|
|
1
24
|
# [68.0.0](https://github.com/cozy/cozy-ui/compare/v67.0.4...v68.0.0) (2022-05-24)
|
|
2
25
|
|
|
3
26
|
|
package/package.json
CHANGED
package/react/Banner/Readme.md
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
### Banner
|
|
2
2
|
|
|
3
3
|
```jsx
|
|
4
|
-
import Variants from 'cozy-ui/docs/components/Variants'
|
|
5
|
-
import palette from 'cozy-ui/transpiled/react/palette'
|
|
4
|
+
import Variants from 'cozy-ui/docs/components/Variants'
|
|
5
|
+
import palette from 'cozy-ui/transpiled/react/palette'
|
|
6
6
|
|
|
7
|
-
import Banner from 'cozy-ui/transpiled/react/Banner'
|
|
8
|
-
import Button from 'cozy-ui/transpiled/react/Button'
|
|
9
|
-
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
10
|
-
import DeviceLaptopIcon from 'cozy-ui/transpiled/react/Icons/DeviceLaptop'
|
|
11
|
-
import DownloadIcon from 'cozy-ui/transpiled/react/Icons/Download'
|
|
7
|
+
import Banner from 'cozy-ui/transpiled/react/Banner'
|
|
8
|
+
import Button from 'cozy-ui/transpiled/react/Button'
|
|
9
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
10
|
+
import DeviceLaptopIcon from 'cozy-ui/transpiled/react/Icons/DeviceLaptop'
|
|
11
|
+
import DownloadIcon from 'cozy-ui/transpiled/react/Icons/Download'
|
|
12
12
|
|
|
13
|
-
const shortText = 'Get Cozy Drive for Desktop and synchronise your files safely to make them accessible at all times.'
|
|
14
|
-
const longText = 'You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text.'
|
|
15
|
-
const buttonOne = <Button theme="text" icon={DownloadIcon} label="Download" onClick={() => alert('Clicked!')}
|
|
16
|
-
const buttonTwo = <Button theme="text" label="No, thanks!"
|
|
17
|
-
const icon = <Icon icon={DeviceLaptopIcon}
|
|
13
|
+
const shortText = 'Get Cozy Drive for Desktop and synchronise your files safely to make them accessible at all times.'
|
|
14
|
+
const longText = 'You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text. You have lost connection to the internet. This app is offline. And this is a long text to show how it reacts, with, well, a long text.'
|
|
15
|
+
const buttonOne = <Button theme="text" icon={DownloadIcon} label="Download" onClick={() => alert('Clicked!')} />
|
|
16
|
+
const buttonTwo = <Button theme="text" label="No, thanks!" />
|
|
17
|
+
const icon = <Icon icon={DeviceLaptopIcon} size={16} />
|
|
18
18
|
|
|
19
|
-
const initialVariants = [
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const initialVariants = [{
|
|
20
|
+
icon: true,
|
|
21
|
+
longText: false,
|
|
22
|
+
buttonOne: true,
|
|
23
|
+
buttonTwo: true,
|
|
24
|
+
inline: true,
|
|
25
|
+
backgroundColor: true,
|
|
26
|
+
disableIconStyles: false
|
|
27
|
+
}]
|
|
28
|
+
|
|
29
|
+
;
|
|
22
30
|
|
|
23
31
|
<Variants initialVariants={initialVariants}>
|
|
24
32
|
{variant => (
|
|
@@ -31,6 +39,7 @@ const initialVariants = [
|
|
|
31
39
|
buttonOne={variant.buttonOne && buttonOne}
|
|
32
40
|
buttonTwo={variant.buttonTwo && buttonTwo}
|
|
33
41
|
inline={variant.inline}
|
|
42
|
+
disableIconStyles={variant.disableIconStyles}
|
|
34
43
|
/>
|
|
35
44
|
)}
|
|
36
45
|
</Variants>
|
package/react/Banner/index.jsx
CHANGED
|
@@ -19,7 +19,8 @@ const Banner = ({
|
|
|
19
19
|
text,
|
|
20
20
|
buttonOne,
|
|
21
21
|
buttonTwo,
|
|
22
|
-
inline
|
|
22
|
+
inline,
|
|
23
|
+
disableIconStyles
|
|
23
24
|
}) => {
|
|
24
25
|
const position = {
|
|
25
26
|
row: [8, 4],
|
|
@@ -40,12 +41,18 @@ const Banner = ({
|
|
|
40
41
|
item
|
|
41
42
|
xs={12}
|
|
42
43
|
lg={size[0]}
|
|
43
|
-
alignItems=
|
|
44
|
+
alignItems={disableIconStyles ? 'flex-start' : 'center'}
|
|
44
45
|
wrap="nowrap"
|
|
45
46
|
>
|
|
46
47
|
{icon && (
|
|
47
48
|
<Grid item>
|
|
48
|
-
<div
|
|
49
|
+
<div
|
|
50
|
+
className={cx({
|
|
51
|
+
[styles['c-banner-icon']]: !disableIconStyles
|
|
52
|
+
})}
|
|
53
|
+
>
|
|
54
|
+
{icon}
|
|
55
|
+
</div>
|
|
49
56
|
</Grid>
|
|
50
57
|
)}
|
|
51
58
|
<Grid item className={styles['c-banner-text']}>
|
|
@@ -87,7 +94,9 @@ Banner.propTypes = {
|
|
|
87
94
|
/** Button to be displayed in second, the right one */
|
|
88
95
|
buttonTwo: PropTypes.node,
|
|
89
96
|
/** Show banner on one line (only desktop) */
|
|
90
|
-
inline: PropTypes.bool
|
|
97
|
+
inline: PropTypes.bool,
|
|
98
|
+
/** Disables the styles of the wrapper around the icon */
|
|
99
|
+
disableIconWrapper: PropTypes.bool
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
export default Banner
|
|
@@ -11,6 +11,7 @@ const BottomSheetContent = ({ file, contactsFullname }) => {
|
|
|
11
11
|
return panelBlocks.map((PanelBlock, index) => (
|
|
12
12
|
<BottomSheetItem
|
|
13
13
|
key={index}
|
|
14
|
+
disableGutters
|
|
14
15
|
disableElevation={index === panelBlocks.length - 1}
|
|
15
16
|
>
|
|
16
17
|
<PanelBlock file={file} contactsFullname={contactsFullname} />
|
|
@@ -3,8 +3,9 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
|
|
4
4
|
import { useClient } from 'cozy-client'
|
|
5
5
|
|
|
6
|
+
import Icon from '../../Icon'
|
|
6
7
|
import DownloadIcon from '../../Icons/Download'
|
|
7
|
-
import Button from '../../
|
|
8
|
+
import Button from '../../Buttons'
|
|
8
9
|
import Alerter from '../../Alerter'
|
|
9
10
|
import { withViewerLocales } from '../withViewerLocales'
|
|
10
11
|
|
|
@@ -21,9 +22,9 @@ const DownloadButton = ({ file, t }) => {
|
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<Button
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
icon={DownloadIcon}
|
|
25
|
+
fullWidth
|
|
26
|
+
variant="secondary"
|
|
27
|
+
startIcon={<Icon icon={DownloadIcon} />}
|
|
27
28
|
label={t('Viewer.download')}
|
|
28
29
|
onClick={() => handleClick(file)}
|
|
29
30
|
/>
|
|
@@ -9,6 +9,8 @@ const FooterActionButtons = ({ children, file }) => {
|
|
|
9
9
|
return mapToAllChildren(children, child => cloneElement(child, { file }))
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
FooterActionButtons.displayName = 'FooterActionButtons'
|
|
13
|
+
|
|
12
14
|
FooterActionButtons.propTypes = {
|
|
13
15
|
children: PropTypes.oneOfType([
|
|
14
16
|
PropTypes.node,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, Children, cloneElement } from 'react'
|
|
1
|
+
import React, { useMemo, Children, cloneElement, isValidElement } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles'
|
|
4
4
|
|
|
@@ -27,16 +27,19 @@ const FooterContent = ({ file, toolbarRef, children }) => {
|
|
|
27
27
|
|
|
28
28
|
const { contactName, isLoadingContacts } = useReferencedContactName(file)
|
|
29
29
|
|
|
30
|
-
const FooterActionButtons =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const FooterActionButtons =
|
|
31
|
+
Children.toArray(children).find(child => {
|
|
32
|
+
return (
|
|
33
|
+
child.type.name === 'FooterActionButtons' ||
|
|
34
|
+
child.type.displayName === 'FooterActionButtons'
|
|
35
|
+
)
|
|
36
|
+
}) || null
|
|
36
37
|
|
|
37
|
-
const FooterActionButtonsWithFile =
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const FooterActionButtonsWithFile = isValidElement(FooterActionButtons)
|
|
39
|
+
? cloneElement(FooterActionButtons, {
|
|
40
|
+
file
|
|
41
|
+
})
|
|
42
|
+
: null
|
|
40
43
|
|
|
41
44
|
// We have to wait for the Contact request to finish before rendering `BottomSheet`, because it doesn't handle async well.
|
|
42
45
|
if (isValidForPanel({ file }) && !isLoadingContacts) {
|
|
@@ -5,9 +5,10 @@ import { useClient, useCapabilities, models } from 'cozy-client'
|
|
|
5
5
|
import { isIOS, isMobileApp } from 'cozy-device-helper'
|
|
6
6
|
|
|
7
7
|
import { useI18n } from '../../I18n'
|
|
8
|
-
import
|
|
8
|
+
import Icon from '../../Icon'
|
|
9
9
|
import ReplyIcon from '../../Icons/Reply'
|
|
10
10
|
import ShareIosIcon from '../../Icons/ShareIos'
|
|
11
|
+
import Button from '../../Buttons'
|
|
11
12
|
import Alerter from '../../Alerter'
|
|
12
13
|
import { withViewerLocales } from '../withViewerLocales'
|
|
13
14
|
import { exportFilesNative } from './helpers'
|
|
@@ -48,10 +49,10 @@ const ForwardButton = ({ file }) => {
|
|
|
48
49
|
|
|
49
50
|
return (
|
|
50
51
|
<Button
|
|
51
|
-
|
|
52
|
+
fullWidth
|
|
53
|
+
variant="secondary"
|
|
54
|
+
startIcon={<Icon icon={ForwardIcon} />}
|
|
52
55
|
data-testid="openFileButton"
|
|
53
|
-
theme="secondary"
|
|
54
|
-
icon={ForwardIcon}
|
|
55
56
|
label={t('Viewer.actions.forward')}
|
|
56
57
|
onClick={() => onFileOpen(file)}
|
|
57
58
|
/>
|
|
@@ -11,7 +11,7 @@ import { withViewerLocales } from '../withViewerLocales'
|
|
|
11
11
|
|
|
12
12
|
const Certification = ({ icon, title, caption }) => {
|
|
13
13
|
return (
|
|
14
|
-
<div className=
|
|
14
|
+
<div className={'u-ph-2 u-pv-1'}>
|
|
15
15
|
<Media className="u-mb-half" align="top">
|
|
16
16
|
<Img className="u-mr-half">
|
|
17
17
|
<Icon icon={icon} />
|
|
@@ -26,9 +26,9 @@ const Qualification = ({ file = {}, contactsFullname, t, f, lang }) => {
|
|
|
26
26
|
} = metadata
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<List>
|
|
29
|
+
<List className={'u-pv-1'}>
|
|
30
30
|
{datetime && (
|
|
31
|
-
<ListItem className={'u-ph-
|
|
31
|
+
<ListItem className={'u-ph-2'}>
|
|
32
32
|
<QualificationListItemText
|
|
33
33
|
primary={t(
|
|
34
34
|
`Viewer.panel.qualification.date.title.${
|
|
@@ -42,14 +42,14 @@ const Qualification = ({ file = {}, contactsFullname, t, f, lang }) => {
|
|
|
42
42
|
</ListItem>
|
|
43
43
|
)}
|
|
44
44
|
{contactsFullname && (
|
|
45
|
-
<ListItem className={'u-ph-
|
|
45
|
+
<ListItem className={'u-ph-2'}>
|
|
46
46
|
<QualificationListItemText
|
|
47
47
|
primary={t('Viewer.panel.qualification.identity')}
|
|
48
48
|
secondary={contactsFullname}
|
|
49
49
|
/>
|
|
50
50
|
</ListItem>
|
|
51
51
|
)}
|
|
52
|
-
<ListItem className={'u-ph-
|
|
52
|
+
<ListItem className={'u-ph-2'}>
|
|
53
53
|
<QualificationListItemText
|
|
54
54
|
primary={t('Viewer.panel.qualification.label.title')}
|
|
55
55
|
secondary={
|
|
@@ -59,7 +59,7 @@ const Qualification = ({ file = {}, contactsFullname, t, f, lang }) => {
|
|
|
59
59
|
}
|
|
60
60
|
/>
|
|
61
61
|
</ListItem>
|
|
62
|
-
<ListItem className={'u-ph-
|
|
62
|
+
<ListItem className={'u-ph-2'}>
|
|
63
63
|
<QualificationListItemText
|
|
64
64
|
primary={t('Viewer.panel.qualification.qualification')}
|
|
65
65
|
secondary={scannerT(`Scan.items.${qualification.label}`)}
|
|
@@ -7,7 +7,6 @@ import Typography from '../../Typography'
|
|
|
7
7
|
const QualificationListItemText = ({ primary, secondary }) => {
|
|
8
8
|
return (
|
|
9
9
|
<ListItemText
|
|
10
|
-
className={'u-pv-0'}
|
|
11
10
|
disableTypography
|
|
12
11
|
primary={<Typography variant={'caption'}>{primary}</Typography>}
|
|
13
12
|
secondary={<Typography variant={'body1'}>{secondary}</Typography>}
|
|
@@ -112,7 +112,7 @@ exports[`Badge should render examples: Badge 2`] = `"<div><span class=\\"MuiBadg
|
|
|
112
112
|
exports[`Banner should render examples: Banner 1`] = `
|
|
113
113
|
"<div>
|
|
114
114
|
<div class=\\"MuiPaper-root u-p-1 u-mb-1 MuiPaper-elevation1\\">
|
|
115
|
-
<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\\">ICON</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\\">LONGTEXT</span></label><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\\">BUTTONONE</span></label><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\\">BUTTONTWO</span></label><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\\">INLINE</span></label><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\\">BACKGROUNDCOLOR</span></label>
|
|
115
|
+
<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\\">ICON</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\\">LONGTEXT</span></label><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\\">BUTTONONE</span></label><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\\">BUTTONTWO</span></label><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\\">INLINE</span></label><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\\">BACKGROUNDCOLOR</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\\">DISABLEICONSTYLES</span></label>
|
|
116
116
|
</div>
|
|
117
117
|
<div class=\\"MuiPaper-root MuiPaper-elevation0\\">
|
|
118
118
|
<div class=\\"styles__c-banner-wrapper___3KlaG\\">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -22,7 +23,8 @@ var Banner = function Banner(_ref) {
|
|
|
22
23
|
text = _ref.text,
|
|
23
24
|
buttonOne = _ref.buttonOne,
|
|
24
25
|
buttonTwo = _ref.buttonTwo,
|
|
25
|
-
inline = _ref.inline
|
|
26
|
+
inline = _ref.inline,
|
|
27
|
+
disableIconStyles = _ref.disableIconStyles;
|
|
26
28
|
var position = {
|
|
27
29
|
row: [8, 4],
|
|
28
30
|
column: [12, 12]
|
|
@@ -44,12 +46,12 @@ var Banner = function Banner(_ref) {
|
|
|
44
46
|
item: true,
|
|
45
47
|
xs: 12,
|
|
46
48
|
lg: size[0],
|
|
47
|
-
alignItems:
|
|
49
|
+
alignItems: disableIconStyles ? 'flex-start' : 'center',
|
|
48
50
|
wrap: "nowrap"
|
|
49
51
|
}, icon && /*#__PURE__*/React.createElement(Grid, {
|
|
50
52
|
item: true
|
|
51
53
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: styles['c-banner-icon']
|
|
54
|
+
className: cx(_defineProperty({}, styles['c-banner-icon'], !disableIconStyles))
|
|
53
55
|
}, icon)), /*#__PURE__*/React.createElement(Grid, {
|
|
54
56
|
item: true,
|
|
55
57
|
className: styles['c-banner-text']
|
|
@@ -85,6 +87,9 @@ Banner.propTypes = {
|
|
|
85
87
|
buttonTwo: PropTypes.node,
|
|
86
88
|
|
|
87
89
|
/** Show banner on one line (only desktop) */
|
|
88
|
-
inline: PropTypes.bool
|
|
90
|
+
inline: PropTypes.bool,
|
|
91
|
+
|
|
92
|
+
/** Disables the styles of the wrapper around the icon */
|
|
93
|
+
disableIconWrapper: PropTypes.bool
|
|
89
94
|
};
|
|
90
95
|
export default Banner;
|
|
@@ -13,6 +13,7 @@ var BottomSheetContent = function BottomSheetContent(_ref) {
|
|
|
13
13
|
return panelBlocks.map(function (PanelBlock, index) {
|
|
14
14
|
return /*#__PURE__*/React.createElement(BottomSheetItem, {
|
|
15
15
|
key: index,
|
|
16
|
+
disableGutters: true,
|
|
16
17
|
disableElevation: index === panelBlocks.length - 1
|
|
17
18
|
}, /*#__PURE__*/React.createElement(PanelBlock, {
|
|
18
19
|
file: file,
|
|
@@ -3,8 +3,9 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClient } from 'cozy-client';
|
|
6
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
6
7
|
import DownloadIcon from "cozy-ui/transpiled/react/Icons/Download";
|
|
7
|
-
import Button from "cozy-ui/transpiled/react/
|
|
8
|
+
import Button from "cozy-ui/transpiled/react/Buttons";
|
|
8
9
|
import Alerter from "cozy-ui/transpiled/react/Alerter";
|
|
9
10
|
import { withViewerLocales } from "cozy-ui/transpiled/react/Viewer/withViewerLocales";
|
|
10
11
|
|
|
@@ -46,9 +47,11 @@ var DownloadButton = function DownloadButton(_ref) {
|
|
|
46
47
|
}();
|
|
47
48
|
|
|
48
49
|
return /*#__PURE__*/React.createElement(Button, {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
fullWidth: true,
|
|
51
|
+
variant: "secondary",
|
|
52
|
+
startIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
icon: DownloadIcon
|
|
54
|
+
}),
|
|
52
55
|
label: t('Viewer.download'),
|
|
53
56
|
onClick: function onClick() {
|
|
54
57
|
return handleClick(file);
|
|
@@ -13,6 +13,7 @@ var FooterActionButtons = function FooterActionButtons(_ref) {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
FooterActionButtons.displayName = 'FooterActionButtons';
|
|
16
17
|
FooterActionButtons.propTypes = {
|
|
17
18
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
18
19
|
file: PropTypes.object
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, Children, cloneElement } from 'react';
|
|
1
|
+
import React, { useMemo, Children, cloneElement, isValidElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
import BottomSheet, { BottomSheetHeader } from "cozy-ui/transpiled/react/BottomSheet";
|
|
@@ -36,10 +36,10 @@ var FooterContent = function FooterContent(_ref) {
|
|
|
36
36
|
|
|
37
37
|
var FooterActionButtons = Children.toArray(children).find(function (child) {
|
|
38
38
|
return child.type.name === 'FooterActionButtons' || child.type.displayName === 'FooterActionButtons';
|
|
39
|
-
});
|
|
40
|
-
var FooterActionButtonsWithFile = /*#__PURE__*/cloneElement(FooterActionButtons, {
|
|
39
|
+
}) || null;
|
|
40
|
+
var FooterActionButtonsWithFile = /*#__PURE__*/isValidElement(FooterActionButtons) ? /*#__PURE__*/cloneElement(FooterActionButtons, {
|
|
41
41
|
file: file
|
|
42
|
-
}); // We have to wait for the Contact request to finish before rendering `BottomSheet`, because it doesn't handle async well.
|
|
42
|
+
}) : null; // We have to wait for the Contact request to finish before rendering `BottomSheet`, because it doesn't handle async well.
|
|
43
43
|
|
|
44
44
|
if (isValidForPanel({
|
|
45
45
|
file: file
|
|
@@ -5,9 +5,10 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { useClient, useCapabilities, models } from 'cozy-client';
|
|
6
6
|
import { isIOS, isMobileApp } from 'cozy-device-helper';
|
|
7
7
|
import { useI18n } from "cozy-ui/transpiled/react/I18n";
|
|
8
|
-
import
|
|
8
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
9
9
|
import ReplyIcon from "cozy-ui/transpiled/react/Icons/Reply";
|
|
10
10
|
import ShareIosIcon from "cozy-ui/transpiled/react/Icons/ShareIos";
|
|
11
|
+
import Button from "cozy-ui/transpiled/react/Buttons";
|
|
11
12
|
import Alerter from "cozy-ui/transpiled/react/Alerter";
|
|
12
13
|
import { withViewerLocales } from "cozy-ui/transpiled/react/Viewer/withViewerLocales";
|
|
13
14
|
import { exportFilesNative } from "cozy-ui/transpiled/react/Viewer/Footer/helpers";
|
|
@@ -99,10 +100,12 @@ var ForwardButton = function ForwardButton(_ref) {
|
|
|
99
100
|
}();
|
|
100
101
|
|
|
101
102
|
return /*#__PURE__*/React.createElement(Button, {
|
|
102
|
-
|
|
103
|
+
fullWidth: true,
|
|
104
|
+
variant: "secondary",
|
|
105
|
+
startIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
106
|
+
icon: ForwardIcon
|
|
107
|
+
}),
|
|
103
108
|
"data-testid": "openFileButton",
|
|
104
|
-
theme: "secondary",
|
|
105
|
-
icon: ForwardIcon,
|
|
106
109
|
label: t('Viewer.actions.forward'),
|
|
107
110
|
onClick: function onClick() {
|
|
108
111
|
return onFileOpen(file);
|
|
@@ -13,7 +13,7 @@ var Certification = function Certification(_ref) {
|
|
|
13
13
|
title = _ref.title,
|
|
14
14
|
caption = _ref.caption;
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className:
|
|
16
|
+
className: 'u-ph-2 u-pv-1'
|
|
17
17
|
}, /*#__PURE__*/React.createElement(Media, {
|
|
18
18
|
className: "u-mb-half",
|
|
19
19
|
align: "top"
|
|
@@ -33,7 +33,7 @@ var PanelContent = function PanelContent(_ref) {
|
|
|
33
33
|
square: true
|
|
34
34
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
35
35
|
variant: "h4",
|
|
36
|
-
className: 'u-pv-1
|
|
36
|
+
className: 'u-pv-1'
|
|
37
37
|
}, /*#__PURE__*/React.createElement(PanelBlock, {
|
|
38
38
|
file: file
|
|
39
39
|
})));
|
|
@@ -23,23 +23,25 @@ var Qualification = function Qualification(_ref) {
|
|
|
23
23
|
pageLabel = metadata.page,
|
|
24
24
|
datetime = metadata.datetime,
|
|
25
25
|
datetimeLabel = metadata.datetimeLabel;
|
|
26
|
-
return /*#__PURE__*/React.createElement(List,
|
|
27
|
-
className: 'u-
|
|
26
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
27
|
+
className: 'u-pv-1'
|
|
28
|
+
}, datetime && /*#__PURE__*/React.createElement(ListItem, {
|
|
29
|
+
className: 'u-ph-2'
|
|
28
30
|
}, /*#__PURE__*/React.createElement(QualificationListItemText, {
|
|
29
31
|
primary: t("Viewer.panel.qualification.date.title.".concat(datetimeLabel === 'datetime' || datetimeLabel === undefined ? 'addedOn' : datetimeLabel)),
|
|
30
32
|
secondary: f(datetime, 'DD/MM/YYYY')
|
|
31
33
|
})), contactsFullname && /*#__PURE__*/React.createElement(ListItem, {
|
|
32
|
-
className: 'u-ph-
|
|
34
|
+
className: 'u-ph-2'
|
|
33
35
|
}, /*#__PURE__*/React.createElement(QualificationListItemText, {
|
|
34
36
|
primary: t('Viewer.panel.qualification.identity'),
|
|
35
37
|
secondary: contactsFullname
|
|
36
38
|
})), /*#__PURE__*/React.createElement(ListItem, {
|
|
37
|
-
className: 'u-ph-
|
|
39
|
+
className: 'u-ph-2'
|
|
38
40
|
}, /*#__PURE__*/React.createElement(QualificationListItemText, {
|
|
39
41
|
primary: t('Viewer.panel.qualification.label.title'),
|
|
40
42
|
secondary: pageLabel ? t("Viewer.panel.qualification.label.".concat(pageLabel)) : filename
|
|
41
43
|
})), /*#__PURE__*/React.createElement(ListItem, {
|
|
42
|
-
className: 'u-ph-
|
|
44
|
+
className: 'u-ph-2'
|
|
43
45
|
}, /*#__PURE__*/React.createElement(QualificationListItemText, {
|
|
44
46
|
primary: t('Viewer.panel.qualification.qualification'),
|
|
45
47
|
secondary: scannerT("Scan.items.".concat(qualification.label))
|
|
@@ -7,7 +7,6 @@ var QualificationListItemText = function QualificationListItemText(_ref) {
|
|
|
7
7
|
var primary = _ref.primary,
|
|
8
8
|
secondary = _ref.secondary;
|
|
9
9
|
return /*#__PURE__*/React.createElement(ListItemText, {
|
|
10
|
-
className: 'u-pv-0',
|
|
11
10
|
disableTypography: true,
|
|
12
11
|
primary: /*#__PURE__*/React.createElement(Typography, {
|
|
13
12
|
variant: 'caption'
|