cozy-ui 111.9.0 → 111.11.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 CHANGED
@@ -1,3 +1,21 @@
1
+ # [111.11.0](https://github.com/cozy/cozy-ui/compare/v111.10.0...v111.11.0) (2024-09-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * Expose `fileToArrayBuffer` from ActionsMenu actions helpers ([72b6e21](https://github.com/cozy/cozy-ui/commit/72b6e21))
7
+
8
+ # [111.10.0](https://github.com/cozy/cozy-ui/compare/v111.9.0...v111.10.0) (2024-09-16)
9
+
10
+
11
+ ### Features
12
+
13
+ * Add secret in GA deploy script ([67e17f2](https://github.com/cozy/cozy-ui/commit/67e17f2))
14
+ * **Badge:** Add `success`, `warning`, `info` colors ([2445e51](https://github.com/cozy/cozy-ui/commit/2445e51))
15
+ * Revert adding token, seems not to be the problem ([4898612](https://github.com/cozy/cozy-ui/commit/4898612))
16
+ * Try to use GITHUB_TOKEN to deploy ([8a18c13](https://github.com/cozy/cozy-ui/commit/8a18c13))
17
+ * Update deploy config to avoid Protected branch update failed error ([5a13cfa](https://github.com/cozy/cozy-ui/commit/5a13cfa))
18
+
1
19
  # [111.9.0](https://github.com/cozy/cozy-ui/compare/v111.8.1...v111.9.0) (2024-09-05)
2
20
 
3
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "111.9.0",
3
+ "version": "111.11.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -137,7 +137,6 @@
137
137
  "prettier": "2.6.0",
138
138
  "pretty": "2.0.0",
139
139
  "prop-types": "15.7.2",
140
- "puppeteer-core": "22.15.0",
141
140
  "react": "16.12.0",
142
141
  "react-dom": "16.12.0",
143
142
  "react-hot-loader": "^4.3.11",
@@ -177,7 +177,7 @@ const addImageToPdf = async (pdfDoc, file) => {
177
177
  * @param {File} file
178
178
  * @returns {Promise<ArrayBuffer>}
179
179
  */
180
- const fileToArrayBuffer = async file => {
180
+ export const fileToArrayBuffer = async file => {
181
181
  if ('arrayBuffer' in file) return await file.arrayBuffer()
182
182
 
183
183
  return new Promise((resolve, reject) => {
@@ -1,6 +1,6 @@
1
- export const generateI18nConfig = (categories?: {
2
- [key: string]: string
3
- }): {
1
+ export const generateI18nConfig = (
2
+ categories?: Record<string, string>
3
+ ): {
4
4
  en: Record<string, string>
5
5
  fr: Record<string, string>
6
6
  } => {
@@ -11,7 +11,7 @@ export const generateI18nConfig = (categories?: {
11
11
  for (const [key, value] of Object.entries(categories)) {
12
12
  // Extract the final part of the path as the display name
13
13
  const displayName =
14
- value?.split('/').pop() ?? ''.replace(/([A-Z])/g, ' $1').trim()
14
+ value.split('/').pop() ?? ''.replace(/([A-Z])/g, ' $1').trim()
15
15
 
16
16
  i18nConfig[`app_categories.${key}`] = displayName
17
17
  }
@@ -13,19 +13,15 @@ import Variants from 'cozy-ui/docs/components/Variants'
13
13
  import CircleFilledIcon from "cozy-ui/transpiled/react/Icons/CircleFilled"
14
14
 
15
15
  const initialVariants = [
16
- { overlap: true, error: false, dot: false, withBorder: false, left: false, bottom: false, small: false, large: false }
16
+ { overlap: true, dot: false, withBorder: false, left: false, bottom: false, small: false, large: false }
17
17
  ]
18
18
 
19
- ;
20
-
21
- <Variants initialVariants={initialVariants} screenshotAllVariants>
22
- {variant => (
19
+ const DemoBadge = ({ variant, ...props }) => {
20
+ return (
23
21
  <Badge
22
+ {...props}
24
23
  className="u-m-half"
25
24
  badgeContent={4}
26
- color={
27
- variant.error ? "error" : variant.secondaryColor ? "secondary" : "primary"
28
- }
29
25
  variant={variant.dot ? "dot" : "standard"}
30
26
  size={variant.large ? "large" : variant.small ? "small" : "medium"}
31
27
  anchorOrigin={{
@@ -41,6 +37,22 @@ const initialVariants = [
41
37
  color="var(--slateGrey)"
42
38
  />
43
39
  </Badge>
40
+ )
41
+ }
42
+
43
+ ;
44
+
45
+ <Variants initialVariants={initialVariants} screenshotAllVariants>
46
+ {variant => (
47
+ <>
48
+ <DemoBadge variant={variant} color="default" />
49
+ <DemoBadge variant={variant} color="primary" />
50
+ <DemoBadge variant={variant} color="secondary" />
51
+ <DemoBadge variant={variant} color="success" />
52
+ <DemoBadge variant={variant} color="error" />
53
+ <DemoBadge variant={variant} color="warning" />
54
+ <DemoBadge variant={variant} color="info" />
55
+ </>
44
56
  )}
45
57
  </Variants>
46
58
  ```
@@ -8,6 +8,7 @@ const Badge = ({
8
8
  size,
9
9
  withBorder,
10
10
  overlap: overlapProp,
11
+ color,
11
12
  ...props
12
13
  }) => {
13
14
  const sizeClasses = {
@@ -28,10 +29,16 @@ const Badge = ({
28
29
  return (
29
30
  <MuiBadge
30
31
  classes={{
31
- badge: cx(sizeClasses[size], withBorder ? 'badgeBorder' : null),
32
+ badge: cx(sizeClasses[size], {
33
+ badgeBorder: !!withBorder,
34
+ colorSuccess: color === 'success',
35
+ colorWarning: color === 'warning',
36
+ colorInfo: color === 'info'
37
+ }),
32
38
  ...classes
33
39
  }}
34
40
  overlap={overlap}
41
+ color={['success', 'warning', 'info'].includes(color) ? 'primary' : color}
35
42
  {...props}
36
43
  />
37
44
  )
@@ -42,6 +49,16 @@ Badge.propTypes = {
42
49
  horizontal: PropTypes.oneOf(['left', 'right']),
43
50
  vertical: PropTypes.oneOf(['bottom', 'top'])
44
51
  }),
52
+ className: PropTypes.string,
53
+ color: PropTypes.oneOf([
54
+ 'default',
55
+ 'success',
56
+ 'warning',
57
+ 'error',
58
+ 'info',
59
+ 'primary',
60
+ 'secondary'
61
+ ]),
45
62
  size: PropTypes.oneOf(['small', 'medium', 'large']),
46
63
  showZero: PropTypes.bool,
47
64
  variant: PropTypes.oneOf(['standard', 'dot']),
@@ -17,12 +17,12 @@ import {
17
17
  import { DialogTitle, DialogContent } from '../Dialog'
18
18
  import Icon from '../Icon'
19
19
  import PlusIcon from '../Icons/Plus'
20
+ import TextField from '../TextField'
20
21
  import useEventListener from '../hooks/useEventListener'
21
22
  import useRealtime from '../hooks/useRealtime'
22
- import CozyTheme from '../providers/CozyTheme'
23
23
  import useBreakpoints from '../providers/Breakpoints'
24
+ import CozyTheme from '../providers/CozyTheme'
24
25
  import { useI18n } from '../providers/I18n'
25
- import TextField from '../TextField'
26
26
 
27
27
  const ContactsListModal = ({
28
28
  onItemClick,
@@ -1,5 +1,5 @@
1
- import '@testing-library/jest-dom'
2
1
  import { Theme } from '@material-ui/core'
2
+ import '@testing-library/jest-dom'
3
3
  import { render } from '@testing-library/react'
4
4
  import React from 'react'
5
5
 
@@ -723,6 +723,20 @@ export const makeLightNormalOverrides = theme => ({
723
723
  fontSize: '.5rem'
724
724
  }
725
725
  },
726
+ colorPrimary: {
727
+ '&.colorSuccess': {
728
+ backgroundColor: theme.palette.success.main,
729
+ color: theme.palette.success.contrastText
730
+ },
731
+ '&.colorWarning': {
732
+ backgroundColor: theme.palette.warning.main,
733
+ color: theme.palette.warning.contrastText
734
+ },
735
+ '&.colorInfo': {
736
+ backgroundColor: theme.palette.info.main,
737
+ color: theme.palette.info.contrastText
738
+ }
739
+ },
726
740
  anchorOriginTopRightRectangular: {
727
741
  transform: 'scale(1) translate(37%, -37%)'
728
742
  },
@@ -356,8 +356,8 @@ exports[`Avatar should render examples: Avatar 1`] = `
356
356
  exports[`Badge should render examples: Badge 1`] = `
357
357
  "<div data-testid=\\"mountNode\\">
358
358
  <div class=\\"MuiPaper-root u-p-1 u-mb-1 MuiPaper-elevation1\\">
359
- <h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">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-label=\\"OVERLAP\\" 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-label=\\"ERROR\\" 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-label=\\"DOT\\" 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-label=\\"WITHBORDER\\" 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-label=\\"LEFT\\" 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-label=\\"BOTTOM\\" 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-label=\\"SMALL\\" 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-label=\\"LARGE\\" 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>
360
- </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>
359
+ <h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">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-label=\\"OVERLAP\\" 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-label=\\"DOT\\" 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-label=\\"WITHBORDER\\" 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-label=\\"LEFT\\" 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-label=\\"BOTTOM\\" 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-label=\\"SMALL\\" 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-label=\\"LARGE\\" 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>
360
+ </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\\">4</span></span><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><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-colorSecondary\\">4</span></span><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 colorSuccess MuiBadge-anchorOriginTopRightCircular MuiBadge-colorPrimary\\">4</span></span><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-colorError\\">4</span></span><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 colorWarning MuiBadge-anchorOriginTopRightCircular MuiBadge-colorPrimary\\">4</span></span><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 colorInfo MuiBadge-anchorOriginTopRightCircular MuiBadge-colorPrimary\\">4</span></span>
361
361
  </div>"
362
362
  `;
363
363
 
@@ -256,7 +256,7 @@ var addImageToPdf = /*#__PURE__*/function () {
256
256
  */
257
257
 
258
258
 
259
- var fileToArrayBuffer = /*#__PURE__*/function () {
259
+ export var fileToArrayBuffer = /*#__PURE__*/function () {
260
260
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(file) {
261
261
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
262
262
  while (1) {
@@ -303,7 +303,6 @@ var fileToArrayBuffer = /*#__PURE__*/function () {
303
303
  * @returns {Promise<void>}
304
304
  */
305
305
 
306
-
307
306
  var addPdfToPdf = /*#__PURE__*/function () {
308
307
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(pdfDoc, file) {
309
308
  var pdfToAdd, document, copiedPages;
@@ -1,6 +1,4 @@
1
- export declare const generateI18nConfig: (categories?: {
2
- [key: string]: string;
3
- } | undefined) => {
1
+ export declare const generateI18nConfig: (categories?: Record<string, string> | undefined) => {
4
2
  en: Record<string, string>;
5
3
  fr: Record<string, string>;
6
4
  };
@@ -10,12 +10,12 @@ export var generateI18nConfig = function generateI18nConfig(categories) {
10
10
  var _value$split$pop;
11
11
 
12
12
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
13
- _key = _Object$entries$_i[0],
13
+ key = _Object$entries$_i[0],
14
14
  value = _Object$entries$_i[1];
15
15
 
16
16
  // Extract the final part of the path as the display name
17
- var displayName = (_value$split$pop = value === null || value === void 0 ? void 0 : value.split('/').pop()) !== null && _value$split$pop !== void 0 ? _value$split$pop : ''.replace(/([A-Z])/g, ' $1').trim();
18
- i18nConfig["app_categories.".concat(_key)] = displayName;
17
+ var displayName = (_value$split$pop = value.split('/').pop()) !== null && _value$split$pop !== void 0 ? _value$split$pop : ''.replace(/([A-Z])/g, ' $1').trim();
18
+ i18nConfig["app_categories.".concat(key)] = displayName;
19
19
  }
20
20
 
21
21
  return {
@@ -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", "overlap"];
4
+ var _excluded = ["classes", "size", "withBorder", "overlap", "color"];
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
 
@@ -18,6 +18,7 @@ var Badge = function Badge(_ref) {
18
18
  size = _ref.size,
19
19
  withBorder = _ref.withBorder,
20
20
  overlapProp = _ref.overlap,
21
+ color = _ref.color,
21
22
  props = _objectWithoutProperties(_ref, _excluded);
22
23
 
23
24
  var sizeClasses = {
@@ -30,9 +31,15 @@ var Badge = function Badge(_ref) {
30
31
  var overlap = overlapProp === 'circle' ? 'circular' : overlapProp === 'rectangle' ? 'rectangular' : overlapProp;
31
32
  return /*#__PURE__*/React.createElement(MuiBadge, _extends({
32
33
  classes: _objectSpread({
33
- badge: cx(sizeClasses[size], withBorder ? 'badgeBorder' : null)
34
+ badge: cx(sizeClasses[size], {
35
+ badgeBorder: !!withBorder,
36
+ colorSuccess: color === 'success',
37
+ colorWarning: color === 'warning',
38
+ colorInfo: color === 'info'
39
+ })
34
40
  }, classes),
35
- overlap: overlap
41
+ overlap: overlap,
42
+ color: ['success', 'warning', 'info'].includes(color) ? 'primary' : color
36
43
  }, props));
37
44
  };
38
45
 
@@ -41,6 +48,8 @@ Badge.propTypes = {
41
48
  horizontal: PropTypes.oneOf(['left', 'right']),
42
49
  vertical: PropTypes.oneOf(['bottom', 'top'])
43
50
  }),
51
+ className: PropTypes.string,
52
+ color: PropTypes.oneOf(['default', 'success', 'warning', 'error', 'info', 'primary', 'secondary']),
44
53
  size: PropTypes.oneOf(['small', 'medium', 'large']),
45
54
  showZero: PropTypes.bool,
46
55
  variant: PropTypes.oneOf(['standard', 'dot']),
@@ -15,12 +15,12 @@ import { TopAnchoredDialog, DialogCloseButton, useCozyDialog } from "cozy-ui/tra
15
15
  import { DialogTitle, DialogContent } from "cozy-ui/transpiled/react/Dialog";
16
16
  import Icon from "cozy-ui/transpiled/react/Icon";
17
17
  import PlusIcon from "cozy-ui/transpiled/react/Icons/Plus";
18
+ import TextField from "cozy-ui/transpiled/react/TextField";
18
19
  import useEventListener from "cozy-ui/transpiled/react/hooks/useEventListener";
19
20
  import useRealtime from "cozy-ui/transpiled/react/hooks/useRealtime";
20
- import CozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme";
21
21
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
22
+ import CozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme";
22
23
  import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
23
- import TextField from "cozy-ui/transpiled/react/TextField";
24
24
 
25
25
  var ContactsListModal = function ContactsListModal(_ref) {
26
26
  var onItemClick = _ref.onItemClick,
@@ -753,6 +753,20 @@ export function makeDarkInvertedOverrides(theme: any): {
753
753
  fontSize: string;
754
754
  };
755
755
  };
756
+ colorPrimary: {
757
+ '&.colorSuccess': {
758
+ backgroundColor: any;
759
+ color: any;
760
+ };
761
+ '&.colorWarning': {
762
+ backgroundColor: any;
763
+ color: any;
764
+ };
765
+ '&.colorInfo': {
766
+ backgroundColor: any;
767
+ color: any;
768
+ };
769
+ };
756
770
  anchorOriginTopRightRectangular: {
757
771
  transform: string;
758
772
  };
@@ -753,6 +753,20 @@ export function makeDarkNormalOverrides(theme: any): {
753
753
  fontSize: string;
754
754
  };
755
755
  };
756
+ colorPrimary: {
757
+ '&.colorSuccess': {
758
+ backgroundColor: any;
759
+ color: any;
760
+ };
761
+ '&.colorWarning': {
762
+ backgroundColor: any;
763
+ color: any;
764
+ };
765
+ '&.colorInfo': {
766
+ backgroundColor: any;
767
+ color: any;
768
+ };
769
+ };
756
770
  anchorOriginTopRightRectangular: {
757
771
  transform: string;
758
772
  };
@@ -753,6 +753,20 @@ export function makeLightInvertedOverrides(theme: any): {
753
753
  fontSize: string;
754
754
  };
755
755
  };
756
+ colorPrimary: {
757
+ '&.colorSuccess': {
758
+ backgroundColor: any;
759
+ color: any;
760
+ };
761
+ '&.colorWarning': {
762
+ backgroundColor: any;
763
+ color: any;
764
+ };
765
+ '&.colorInfo': {
766
+ backgroundColor: any;
767
+ color: any;
768
+ };
769
+ };
756
770
  anchorOriginTopRightRectangular: {
757
771
  transform: string;
758
772
  };
@@ -753,6 +753,20 @@ export function makeLightNormalOverrides(theme: any): {
753
753
  fontSize: string;
754
754
  };
755
755
  };
756
+ colorPrimary: {
757
+ '&.colorSuccess': {
758
+ backgroundColor: any;
759
+ color: any;
760
+ };
761
+ '&.colorWarning': {
762
+ backgroundColor: any;
763
+ color: any;
764
+ };
765
+ '&.colorInfo': {
766
+ backgroundColor: any;
767
+ color: any;
768
+ };
769
+ };
756
770
  anchorOriginTopRightRectangular: {
757
771
  transform: string;
758
772
  };
@@ -667,6 +667,20 @@ export var makeLightNormalOverrides = function makeLightNormalOverrides(theme) {
667
667
  fontSize: '.5rem'
668
668
  }
669
669
  },
670
+ colorPrimary: {
671
+ '&.colorSuccess': {
672
+ backgroundColor: theme.palette.success.main,
673
+ color: theme.palette.success.contrastText
674
+ },
675
+ '&.colorWarning': {
676
+ backgroundColor: theme.palette.warning.main,
677
+ color: theme.palette.warning.contrastText
678
+ },
679
+ '&.colorInfo': {
680
+ backgroundColor: theme.palette.info.main,
681
+ color: theme.palette.info.contrastText
682
+ }
683
+ },
670
684
  anchorOriginTopRightRectangular: {
671
685
  transform: 'scale(1) translate(37%, -37%)'
672
686
  },