cozy-ui 75.5.0 → 75.6.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 +20 -0
- package/assets/icons/ui/face-id.svg +1 -0
- package/package.json +4 -2
- package/react/ActionMenu/ActionMenuEffects.ts +6 -0
- package/react/Icon/Readme.md +2 -0
- package/react/Icon/icons-sprite.js +1 -1
- package/react/Icons/FaceId.jsx +16 -0
- package/react/Modal/ModalEffects.ts +6 -0
- package/react/Viewer/Panel/Qualification.jsx +4 -5
- package/react/Viewer/Panel/QualificationListItemInformation.jsx +13 -2
- package/react/Viewer/Panel/QualificationListItemInformation.spec.jsx +52 -0
- package/react/Viewer/helpers.js +1 -1
- package/react/__snapshots__/examples.spec.jsx.snap +11 -0
- package/scripts/generate-svgr-icon.sh +3 -1
- package/scripts/svgr-template.js +1 -3
- package/transpiled/react/ActionMenu/ActionMenuEffects.d.ts +1 -0
- package/transpiled/react/ActionMenu/ActionMenuEffects.js +4 -0
- package/transpiled/react/Dialog/DialogEffects.d.ts +26 -0
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/FaceId.js +15 -0
- package/transpiled/react/Modal/ModalEffects.d.ts +1 -0
- package/transpiled/react/Modal/ModalEffects.js +4 -0
- package/transpiled/react/Viewer/Panel/Qualification.js +5 -8
- package/transpiled/react/Viewer/Panel/QualificationListItemInformation.js +7 -2
- package/transpiled/react/Viewer/helpers.js +1 -1
- package/transpiled/react/hooks/useSetFlagshipUi/useSetFlagshipUI.d.ts +10 -0
- package/transpiled/react/utils/color.d.ts +2 -0
- package/tsconfig-build.json +14 -0
- package/tsconfig.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [75.6.1](https://github.com/cozy/cozy-ui/compare/v75.6.0...v75.6.1) (2022-09-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Viewer:** Do not use MidEllipsys component if text prop is falsy ([abefe41](https://github.com/cozy/cozy-ui/commit/abefe41))
|
|
7
|
+
|
|
8
|
+
# [75.6.0](https://github.com/cozy/cozy-ui/compare/v75.5.0...v75.6.0) (2022-09-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **Viewer:** Contacts no longer display in the Viewer ([2d3e379](https://github.com/cozy/cozy-ui/commit/2d3e379))
|
|
14
|
+
* **Viewer:** The country name must be limited in size ([8b8fa84](https://github.com/cozy/cozy-ui/commit/8b8fa84))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add FaceId icon ([6571aed](https://github.com/cozy/cozy-ui/commit/6571aed))
|
|
20
|
+
|
|
1
21
|
# [75.5.0](https://github.com/cozy/cozy-ui/compare/v75.4.1...v75.5.0) (2022-09-29)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3a1 1 0 0 1 1-1h2a1 1 0 0 0 0-2H3a3 3 0 0 0-3 3v2a1 1 0 0 0 2 0V3Zm12 0a1 1 0 0 0-1-1h-2a1 1 0 1 1 0-2h2a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V3ZM3 14a1 1 0 0 1-1-1v-2a1 1 0 1 0-2 0v2a3 3 0 0 0 3 3h2a1 1 0 1 0 0-2H3Zm11-1a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3v-2a1 1 0 1 0-2 0v2ZM6 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM7 6a1 1 0 0 1 2 0v2a1 1 0 0 1-2 0V6Zm-1.386 4.21a1 1 0 1 0-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 1 0-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui",
|
|
3
|
-
"version": "75.
|
|
3
|
+
"version": "75.6.1",
|
|
4
4
|
"description": "Cozy apps UI SDK",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"build:doc:config": "copyfiles -u 1 docs/*.md docs/_config.yml build",
|
|
28
28
|
"build:doc:kss": "kss --destination build/styleguide --title 'Cozy-UI Styleguide' --source stylus --builder node_modules/michelangelo/kss_styleguide/custom-template --homepage stylus/styleguide.md --css app.css",
|
|
29
29
|
"build:doc:react": "styleguidist build --config docs/styleguide.config.js",
|
|
30
|
-
"build": "
|
|
30
|
+
"build:types": "tsc -p tsconfig-build.json",
|
|
31
|
+
"build": "yarn build:types && env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx react/ --out-dir transpiled/react --verbose",
|
|
31
32
|
"clean:doc:kss": "rm -rf build/styleguide",
|
|
32
33
|
"deploy:doc": "git-directory-deploy --directory build/ --branch gh-pages",
|
|
33
34
|
"makeSvgr": "scripts/generate-svgr-icon.sh",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"removeEmptyCss": "node scripts/removeEmptyCss.js",
|
|
61
62
|
"optimizeIcons": "svgo -r --folder assets/icons"
|
|
62
63
|
},
|
|
64
|
+
"types": "dist/index.d.ts",
|
|
63
65
|
"sideEffects": [
|
|
64
66
|
"*.css",
|
|
65
67
|
"intersection-observer"
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
|
|
3
|
+
// TODO: remove eslint-disable and @ts-ignore rules
|
|
4
|
+
|
|
1
5
|
import { Theme, useTheme } from '@material-ui/core'
|
|
2
6
|
|
|
3
7
|
import { isFlagshipApp } from 'cozy-device-helper'
|
|
@@ -19,9 +23,11 @@ const useHook = (): void => {
|
|
|
19
23
|
useSetFlagshipUI(
|
|
20
24
|
{
|
|
21
25
|
bottomBackground: theme.palette.background.paper,
|
|
26
|
+
// @ts-ignore
|
|
22
27
|
bottomTheme: 'dark',
|
|
23
28
|
topOverlay: getCssVariableValue('overlay'),
|
|
24
29
|
topBackground: theme.palette.background.paper,
|
|
30
|
+
// @ts-ignore
|
|
25
31
|
topTheme: 'light'
|
|
26
32
|
},
|
|
27
33
|
{
|
package/react/Icon/Readme.md
CHANGED
|
@@ -106,6 +106,7 @@ import Euro from 'cozy-ui/transpiled/react/Icons/Euro'
|
|
|
106
106
|
import Exchange from 'cozy-ui/transpiled/react/Icons/Exchange'
|
|
107
107
|
import Eye from 'cozy-ui/transpiled/react/Icons/Eye'
|
|
108
108
|
import EyeClosed from 'cozy-ui/transpiled/react/Icons/EyeClosed'
|
|
109
|
+
import FaceId from 'cozy-ui/transpiled/react/Icons/FaceId'
|
|
109
110
|
import File from 'cozy-ui/transpiled/react/Icons/File'
|
|
110
111
|
import FileAdd from 'cozy-ui/transpiled/react/Icons/FileAdd'
|
|
111
112
|
import FileDuotone from 'cozy-ui/transpiled/react/Icons/FileDuotone'
|
|
@@ -326,6 +327,7 @@ const icons = [
|
|
|
326
327
|
Exchange,
|
|
327
328
|
Eye,
|
|
328
329
|
EyeClosed,
|
|
330
|
+
FaceId,
|
|
329
331
|
File,
|
|
330
332
|
FileAdd,
|
|
331
333
|
FileDuotone,
|
|
@@ -278,7 +278,7 @@ module.exports = `<svg><defs>
|
|
|
278
278
|
</g>
|
|
279
279
|
</symbol><symbol id="eye" viewBox="0 0 20 20">
|
|
280
280
|
<path fill-rule="evenodd" d="M21,10 C21,10 24,4 30,4 C36,4 39,10 39,10 C39,10 36,16 30,16 C24,16 21,10 21,10 Z M30,14 C32.2091391,14 34,12.2091391 34,10 C34,7.79086089 32.2091391,6 30,6 C27.7908609,6 26,7.79086089 26,10 C26,12.2091391 27.7908609,14 30,14 Z M30,12 C31.1045696,12 32,11.1045696 32,10 C32,8.89543045 31.1045696,8 30,8 C28.8954304,8 28,8.89543045 28,10 C28,11.1045696 28.8954304,12 30,12 Z" transform="translate(-20)"/>
|
|
281
|
-
</symbol><symbol id="file-add" viewBox="0 0 16 16">
|
|
281
|
+
</symbol><symbol id="face-id" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3a1 1 0 0 1 1-1h2a1 1 0 0 0 0-2H3a3 3 0 0 0-3 3v2a1 1 0 0 0 2 0V3Zm12 0a1 1 0 0 0-1-1h-2a1 1 0 1 1 0-2h2a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V3ZM3 14a1 1 0 0 1-1-1v-2a1 1 0 1 0-2 0v2a3 3 0 0 0 3 3h2a1 1 0 1 0 0-2H3Zm11-1a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3v-2a1 1 0 1 0-2 0v2ZM6 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM7 6a1 1 0 0 1 2 0v2a1 1 0 0 1-2 0V6Zm-1.386 4.21a1 1 0 1 0-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 1 0-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79Z"/></symbol><symbol id="file-add" viewBox="0 0 16 16">
|
|
282
282
|
<path fill-rule="evenodd" d="M1 1c0-.552.446-1 .998-1H10v5h5v10.004a1 1 0 0 1-1.007.996H2.007A1.002 1.002 0 0 1 1 15V1zm10 3V0l4 4h-4zM7 6v3H4v2h3v3h2v-3h3V9H9V6H7z"/>
|
|
283
283
|
</symbol><symbol id="file-duotone" viewBox="0 0 26 32">
|
|
284
284
|
<g id="files-colored" fill-rule="evenodd">
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/face-id.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgFaceId(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" {...props}>
|
|
7
|
+
<path
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
|
+
d="M2 3a1 1 0 011-1h2a1 1 0 000-2H3a3 3 0 00-3 3v2a1 1 0 002 0V3zm12 0a1 1 0 00-1-1h-2a1 1 0 110-2h2a3 3 0 013 3v2a1 1 0 11-2 0V3zM3 14a1 1 0 01-1-1v-2a1 1 0 10-2 0v2a3 3 0 003 3h2a1 1 0 100-2H3zm11-1a1 1 0 01-1 1h-2a1 1 0 100 2h2a3 3 0 003-3v-2a1 1 0 10-2 0v2zM6 6a1 1 0 11-2 0 1 1 0 012 0zm5 1a1 1 0 100-2 1 1 0 000 2zM7 6a1 1 0 012 0v2a1 1 0 01-2 0V6zm-1.386 4.21a1 1 0 10-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 10-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79z"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default SvgFaceId
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
|
|
3
|
+
// TODO: remove eslint-disable and @ts-ignore rules
|
|
4
|
+
|
|
1
5
|
import { Theme, useTheme } from '@material-ui/core'
|
|
2
6
|
|
|
3
7
|
import { getFlagshipMetadata, isFlagshipApp } from 'cozy-device-helper'
|
|
@@ -22,8 +26,10 @@ const useHook = (): void => {
|
|
|
22
26
|
useSetFlagshipUI(
|
|
23
27
|
{
|
|
24
28
|
bottomBackground: theme.palette.background.paper,
|
|
29
|
+
// @ts-ignore
|
|
25
30
|
bottomTheme: 'dark',
|
|
26
31
|
topBackground: theme.palette.background.paper,
|
|
32
|
+
// @ts-ignore
|
|
27
33
|
topTheme: 'dark'
|
|
28
34
|
},
|
|
29
35
|
{
|
|
@@ -25,6 +25,9 @@ const makeQualificationListItemComp = metadataName => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (knownOtherMetadataNames.includes(metadataName)) {
|
|
28
|
+
if (metadataName === 'contact') {
|
|
29
|
+
return QualificationListItemContact
|
|
30
|
+
}
|
|
28
31
|
return QualificationListItemOther
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -63,16 +66,12 @@ const Qualification = ({ file = {} }) => {
|
|
|
63
66
|
<List className={'u-pv-1'}>
|
|
64
67
|
{formatedMetadataQualification.map((meta, idx) => {
|
|
65
68
|
const { name } = meta
|
|
66
|
-
|
|
67
|
-
if (name === 'contact') {
|
|
68
|
-
return <QualificationListItemContact key={idx} file={file} />
|
|
69
|
-
}
|
|
70
|
-
|
|
71
69
|
const QualificationListItemComp = makeQualificationListItemComp(name)
|
|
72
70
|
|
|
73
71
|
return (
|
|
74
72
|
<QualificationListItemComp
|
|
75
73
|
key={idx}
|
|
74
|
+
file={file}
|
|
76
75
|
ref={actionBtnRef.current[idx]}
|
|
77
76
|
formatedMetadataQualification={meta}
|
|
78
77
|
toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
|
|
@@ -8,21 +8,32 @@ import Icon from '../../Icon'
|
|
|
8
8
|
import Dots from '../../Icons/Dots'
|
|
9
9
|
import QualificationListItemText from './QualificationListItemText'
|
|
10
10
|
import { useI18n } from '../../I18n'
|
|
11
|
+
import MidEllipsis from '../../MidEllipsis'
|
|
11
12
|
|
|
12
13
|
const QualificationListItemInformation = forwardRef(
|
|
13
14
|
({ formatedMetadataQualification, toggleActionsMenu }, ref) => {
|
|
14
15
|
const { t } = useI18n()
|
|
15
16
|
const { name, value } = formatedMetadataQualification
|
|
16
17
|
|
|
18
|
+
const currentValue = value ? (
|
|
19
|
+
<MidEllipsis text={value} />
|
|
20
|
+
) : (
|
|
21
|
+
t('Viewer.panel.qualification.noInfo')
|
|
22
|
+
)
|
|
23
|
+
|
|
17
24
|
return (
|
|
18
25
|
<ListItem className={'u-pl-2 u-pr-3'}>
|
|
19
26
|
<QualificationListItemText
|
|
20
27
|
primary={t(`Viewer.panel.qualification.information.title.${name}`)}
|
|
21
|
-
secondary={
|
|
28
|
+
secondary={currentValue}
|
|
22
29
|
disabled={!value}
|
|
23
30
|
/>
|
|
24
31
|
<ListItemSecondaryAction>
|
|
25
|
-
<IconButton
|
|
32
|
+
<IconButton
|
|
33
|
+
ref={ref}
|
|
34
|
+
onClick={() => toggleActionsMenu(value)}
|
|
35
|
+
data-testid="toggleActionsMenuBtn"
|
|
36
|
+
>
|
|
26
37
|
<Icon icon={Dots} />
|
|
27
38
|
</IconButton>
|
|
28
39
|
</ListItemSecondaryAction>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react'
|
|
3
|
+
import DemoProvider from '../docs/DemoProvider'
|
|
4
|
+
|
|
5
|
+
import QualificationListItemInformation from './QualificationListItemInformation'
|
|
6
|
+
|
|
7
|
+
const setup = ({
|
|
8
|
+
formatedMetadataQualification = {},
|
|
9
|
+
toggleActionsMenu = jest.fn()
|
|
10
|
+
} = {}) => {
|
|
11
|
+
return render(
|
|
12
|
+
<DemoProvider>
|
|
13
|
+
<QualificationListItemInformation
|
|
14
|
+
formatedMetadataQualification={formatedMetadataQualification}
|
|
15
|
+
toggleActionsMenu={toggleActionsMenu}
|
|
16
|
+
/>
|
|
17
|
+
</DemoProvider>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe('QualificationListItemInformation', () => {
|
|
22
|
+
describe('formatedMetadataQualification', () => {
|
|
23
|
+
it('should display default text if value is falsy', () => {
|
|
24
|
+
const formatedMetadataQualification = { name: 'country', value: '' }
|
|
25
|
+
const { getByText } = setup({ formatedMetadataQualification })
|
|
26
|
+
|
|
27
|
+
expect(getByText('Viewer.panel.qualification.noInfo'))
|
|
28
|
+
})
|
|
29
|
+
it('should display current value if it is truthy', () => {
|
|
30
|
+
const formatedMetadataQualification = { name: 'country', value: 'Italie' }
|
|
31
|
+
const { queryByText } = setup({
|
|
32
|
+
formatedMetadataQualification
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
expect(queryByText('Viewer.panel.qualification.noInfo')).toBeNull()
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
describe('toggleActionsMenu', () => {
|
|
39
|
+
it('should call toggleActionsMenu with current value on click it', () => {
|
|
40
|
+
const formatedMetadataQualification = { name: 'country', value: 'Italie' }
|
|
41
|
+
const toggleActionsMenu = jest.fn()
|
|
42
|
+
const { getByTestId } = setup({
|
|
43
|
+
toggleActionsMenu,
|
|
44
|
+
formatedMetadataQualification
|
|
45
|
+
})
|
|
46
|
+
const toggleActionsMenuBtn = getByTestId('toggleActionsMenuBtn')
|
|
47
|
+
fireEvent.click(toggleActionsMenuBtn)
|
|
48
|
+
|
|
49
|
+
expect(toggleActionsMenu).toBeCalledWith('Italie')
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})
|
package/react/Viewer/helpers.js
CHANGED
|
@@ -75,7 +75,7 @@ const makeMetadataQualification = ({ metadata, knownMetadataName, value }) => {
|
|
|
75
75
|
knownMetadataName
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
if (shouldReturnThisMetadata) {
|
|
78
|
+
if (shouldReturnThisMetadata || knownMetadataName === 'contact') {
|
|
79
79
|
return { name: knownMetadataName, value: value || null }
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -3645,6 +3645,11 @@ exports[`Icon should render examples: Icon 1`] = `
|
|
|
3645
3645
|
</svg>
|
|
3646
3646
|
<p class=\\"MuiTypography-root u-mt-half MuiTypography-body1 MuiTypography-colorTextPrimary\\">EyeClosed</p>
|
|
3647
3647
|
</div>
|
|
3648
|
+
<div class=\\"makeStyles-iconTile-110 u-ta-center u-mb-1\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
3649
|
+
<path fill-rule=\\"evenodd\\" clip-rule=\\"evenodd\\" d=\\"M2 3a1 1 0 011-1h2a1 1 0 000-2H3a3 3 0 00-3 3v2a1 1 0 002 0V3zm12 0a1 1 0 00-1-1h-2a1 1 0 110-2h2a3 3 0 013 3v2a1 1 0 11-2 0V3zM3 14a1 1 0 01-1-1v-2a1 1 0 10-2 0v2a3 3 0 003 3h2a1 1 0 100-2H3zm11-1a1 1 0 01-1 1h-2a1 1 0 100 2h2a3 3 0 003-3v-2a1 1 0 10-2 0v2zM6 6a1 1 0 11-2 0 1 1 0 012 0zm5 1a1 1 0 100-2 1 1 0 000 2zM7 6a1 1 0 012 0v2a1 1 0 01-2 0V6zm-1.386 4.21a1 1 0 10-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 10-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79z\\"></path>
|
|
3650
|
+
</svg>
|
|
3651
|
+
<p class=\\"MuiTypography-root u-mt-half MuiTypography-body1 MuiTypography-colorTextPrimary\\">FaceId</p>
|
|
3652
|
+
</div>
|
|
3648
3653
|
<div class=\\"makeStyles-iconTile-110 u-ta-center u-mb-1\\"><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\">
|
|
3649
3654
|
<defs>
|
|
3650
3655
|
<path id=\\"file_svg__a\\" d=\\"M1 1c0-.552.446-1 .998-1H10v5h5v10.004a1 1 0 01-1.007.996H2.007A1.002 1.002 0 011 15V1zm10 3V0l4 4h-4z\\"></path>
|
|
@@ -5117,6 +5122,9 @@ exports[`Icon should render examples: Icon 3`] = `
|
|
|
5117
5122
|
<symbol id=\\"eye\\" viewBox=\\"0 0 20 20\\">
|
|
5118
5123
|
<path fill-rule=\\"evenodd\\" d=\\"M21,10 C21,10 24,4 30,4 C36,4 39,10 39,10 C39,10 36,16 30,16 C24,16 21,10 21,10 Z M30,14 C32.2091391,14 34,12.2091391 34,10 C34,7.79086089 32.2091391,6 30,6 C27.7908609,6 26,7.79086089 26,10 C26,12.2091391 27.7908609,14 30,14 Z M30,12 C31.1045696,12 32,11.1045696 32,10 C32,8.89543045 31.1045696,8 30,8 C28.8954304,8 28,8.89543045 28,10 C28,11.1045696 28.8954304,12 30,12 Z\\" transform=\\"translate(-20)\\"></path>
|
|
5119
5124
|
</symbol>
|
|
5125
|
+
<symbol id=\\"face-id\\" viewBox=\\"0 0 16 16\\">
|
|
5126
|
+
<path fill-rule=\\"evenodd\\" clip-rule=\\"evenodd\\" d=\\"M2 3a1 1 0 0 1 1-1h2a1 1 0 0 0 0-2H3a3 3 0 0 0-3 3v2a1 1 0 0 0 2 0V3Zm12 0a1 1 0 0 0-1-1h-2a1 1 0 1 1 0-2h2a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V3ZM3 14a1 1 0 0 1-1-1v-2a1 1 0 1 0-2 0v2a3 3 0 0 0 3 3h2a1 1 0 1 0 0-2H3Zm11-1a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3v-2a1 1 0 1 0-2 0v2ZM6 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM7 6a1 1 0 0 1 2 0v2a1 1 0 0 1-2 0V6Zm-1.386 4.21a1 1 0 1 0-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 1 0-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79Z\\"></path>
|
|
5127
|
+
</symbol>
|
|
5120
5128
|
<symbol id=\\"file-add\\" viewBox=\\"0 0 16 16\\">
|
|
5121
5129
|
<path fill-rule=\\"evenodd\\" d=\\"M1 1c0-.552.446-1 .998-1H10v5h5v10.004a1 1 0 0 1-1.007.996H2.007A1.002 1.002 0 0 1 1 15V1zm10 3V0l4 4h-4zM7 6v3H4v2h3v3h2v-3h3V9H9V6H7z\\"></path>
|
|
5122
5130
|
</symbol>
|
|
@@ -6686,6 +6694,9 @@ exports[`Icon should render examples: Icon 7`] = `
|
|
|
6686
6694
|
<symbol id=\\"eye\\" viewBox=\\"0 0 20 20\\">
|
|
6687
6695
|
<path fill-rule=\\"evenodd\\" d=\\"M21,10 C21,10 24,4 30,4 C36,4 39,10 39,10 C39,10 36,16 30,16 C24,16 21,10 21,10 Z M30,14 C32.2091391,14 34,12.2091391 34,10 C34,7.79086089 32.2091391,6 30,6 C27.7908609,6 26,7.79086089 26,10 C26,12.2091391 27.7908609,14 30,14 Z M30,12 C31.1045696,12 32,11.1045696 32,10 C32,8.89543045 31.1045696,8 30,8 C28.8954304,8 28,8.89543045 28,10 C28,11.1045696 28.8954304,12 30,12 Z\\" transform=\\"translate(-20)\\"></path>
|
|
6688
6696
|
</symbol>
|
|
6697
|
+
<symbol id=\\"face-id\\" viewBox=\\"0 0 16 16\\">
|
|
6698
|
+
<path fill-rule=\\"evenodd\\" clip-rule=\\"evenodd\\" d=\\"M2 3a1 1 0 0 1 1-1h2a1 1 0 0 0 0-2H3a3 3 0 0 0-3 3v2a1 1 0 0 0 2 0V3Zm12 0a1 1 0 0 0-1-1h-2a1 1 0 1 1 0-2h2a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V3ZM3 14a1 1 0 0 1-1-1v-2a1 1 0 1 0-2 0v2a3 3 0 0 0 3 3h2a1 1 0 1 0 0-2H3Zm11-1a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3v-2a1 1 0 1 0-2 0v2ZM6 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM7 6a1 1 0 0 1 2 0v2a1 1 0 0 1-2 0V6Zm-1.386 4.21a1 1 0 1 0-1.228 1.58C5.364 12.55 6.63 13 8 13c1.369 0 2.636-.45 3.614-1.21a1 1 0 1 0-1.228-1.58C9.765 10.695 8.932 11 8 11c-.932 0-1.765-.306-2.386-.79Z\\"></path>
|
|
6699
|
+
</symbol>
|
|
6689
6700
|
<symbol id=\\"file-add\\" viewBox=\\"0 0 16 16\\">
|
|
6690
6701
|
<path fill-rule=\\"evenodd\\" d=\\"M1 1c0-.552.446-1 .998-1H10v5h5v10.004a1 1 0 0 1-1.007.996H2.007A1.002 1.002 0 0 1 1 15V1zm10 3V0l4 4h-4zM7 6v3H4v2h3v3h2v-3h3V9H9V6H7z\\"></path>
|
|
6691
6702
|
</symbol>
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
|
+
streamEditor=$([[ $(uname -s) == "Linux" ]] && echo sed || echo gsed)
|
|
6
|
+
|
|
5
7
|
createSvgr()
|
|
6
8
|
{
|
|
7
9
|
svgFileFullPath=$1
|
|
8
10
|
svgFilename=`basename $svgFileFullPath`
|
|
9
|
-
jsFilename=`echo $svgFilename |
|
|
11
|
+
jsFilename=`echo $svgFilename | $streamEditor -E 's/^([a-z])/\U\1/g; s/-([a-z])/\U\1/g; s/svg$/jsx/g'`
|
|
10
12
|
jsFileFullPath="react/Icons/${jsFilename}"
|
|
11
13
|
|
|
12
14
|
echo $svgFileFullPath
|
package/scripts/svgr-template.js
CHANGED
|
@@ -8,9 +8,7 @@ function defaultTemplate(
|
|
|
8
8
|
plugins.push('typescript')
|
|
9
9
|
}
|
|
10
10
|
const typeScriptTpl = template.smart({ plugins, preserveComments: true })
|
|
11
|
-
const automaticallyCreatedMention = `// Automatically created, please run \`scripts/generate-svgr-icon.sh ${
|
|
12
|
-
opts.state.filePath
|
|
13
|
-
}\` to regenerate`
|
|
11
|
+
const automaticallyCreatedMention = `// Automatically created, please run \`scripts/generate-svgr-icon.sh ${opts.state.filePath}\` to regenerate`
|
|
14
12
|
|
|
15
13
|
for (let imp of imports) {
|
|
16
14
|
if (imp.source.value !== 'react') {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useActionMenuEffects: () => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
// TODO: remove eslint-disable and @ts-ignore rules
|
|
1
3
|
import { useTheme } from '@material-ui/core';
|
|
2
4
|
import { isFlagshipApp } from 'cozy-device-helper';
|
|
3
5
|
import { getCssVariableValue } from "cozy-ui/transpiled/react/utils/color";
|
|
@@ -12,9 +14,11 @@ var useHook = function useHook() {
|
|
|
12
14
|
var theme = useTheme();
|
|
13
15
|
useSetFlagshipUI({
|
|
14
16
|
bottomBackground: theme.palette.background.paper,
|
|
17
|
+
// @ts-ignore
|
|
15
18
|
bottomTheme: 'dark',
|
|
16
19
|
topOverlay: getCssVariableValue('overlay'),
|
|
17
20
|
topBackground: theme.palette.background.paper,
|
|
21
|
+
// @ts-ignore
|
|
18
22
|
topTheme: 'light'
|
|
19
23
|
}, {
|
|
20
24
|
bottomBackground: getBottomBackground(theme),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Theme } from '@material-ui/core';
|
|
2
|
+
import { FlagshipUI } from '../hooks/useSetFlagshipUi/useSetFlagshipUI';
|
|
3
|
+
interface DialogEffectsOptions {
|
|
4
|
+
cozybar?: Element | null;
|
|
5
|
+
fullscreen?: boolean;
|
|
6
|
+
immersive?: boolean;
|
|
7
|
+
sidebar?: HTMLElement | Element | null;
|
|
8
|
+
rootModal?: HTMLElement | Element | null;
|
|
9
|
+
theme: Theme;
|
|
10
|
+
}
|
|
11
|
+
export declare enum DOMStrings {
|
|
12
|
+
BackgroundDefault = "default",
|
|
13
|
+
BackgroundPaper = "paper",
|
|
14
|
+
CozyBarBackground = "background-color",
|
|
15
|
+
CozyBarClass = ".coz-bar-wrapper",
|
|
16
|
+
CozyBarPrimaryClass = "coz-theme-primary",
|
|
17
|
+
DialogClass = ".MuiPaper-root",
|
|
18
|
+
OverlayActive = "rgba(0, 0, 0, 0.5)",
|
|
19
|
+
OverlayTransparent = "transparent",
|
|
20
|
+
RootModalColor = "color",
|
|
21
|
+
SidebarID = "sidebar"
|
|
22
|
+
}
|
|
23
|
+
export declare const makeOnMount: ({ cozybar, fullscreen, sidebar, rootModal, theme }: DialogEffectsOptions) => FlagshipUI;
|
|
24
|
+
export declare const makeOnUnmount: ({ rootModal, theme, immersive, sidebar, cozybar }: DialogEffectsOptions) => FlagshipUI;
|
|
25
|
+
export declare const useDialogEffects: (fullscreen?: boolean | undefined) => void;
|
|
26
|
+
export {};
|