cozy-ui 81.0.0 → 81.1.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/react/ActionMenu/index.spec.jsx +1 -1
  4. package/react/Alerter/alerter.spec.js +1 -1
  5. package/react/AppLinker/index.deprecated.spec.jsx +1 -1
  6. package/react/AppLinker/index.spec.jsx +1 -1
  7. package/react/AppLinker/native.js +1 -1
  8. package/react/AppTile/AppTile.spec.jsx +1 -1
  9. package/react/Avatar/index.jsx +1 -0
  10. package/react/Banner/index.spec.jsx +1 -1
  11. package/react/CipherIcon/index.spec.jsx +1 -1
  12. package/react/ContactsList/Contacts/ContactCozy.jsx +4 -1
  13. package/react/ContactsList/Contacts/ContactEmail.jsx +4 -1
  14. package/react/ContactsList/Contacts/ContactIdentity.jsx +1 -0
  15. package/react/ContactsList/Contacts/ContactName.jsx +1 -0
  16. package/react/ContactsList/Contacts/ContactPhone.jsx +4 -1
  17. package/react/ContactsList/__snapshots__/ContactRow.spec.js.snap +6 -0
  18. package/react/ContactsListModal/index.jsx +1 -1
  19. package/react/DateMonthPicker/index.spec.jsx +1 -1
  20. package/react/Field/index.spec.js +1 -1
  21. package/react/FileInput/index.spec.jsx +1 -1
  22. package/react/FilePicker/FilePickerHeader.jsx +1 -1
  23. package/react/I18n/withLocales.jsx +1 -1
  24. package/react/Input/index.spec.jsx +1 -1
  25. package/react/Modal/index.spec.jsx +1 -1
  26. package/react/PieChart/index.spec.jsx +1 -1
  27. package/react/Popup/index.spec.jsx +1 -1
  28. package/react/PushClientButton/index.spec.jsx +1 -1
  29. package/react/Radio/index.spec.jsx +1 -1
  30. package/react/SquareAppIcon/SquareAppIcon.spec.js +1 -1
  31. package/react/UploadQueue/index.spec.jsx +1 -1
  32. package/react/ViewStack/example.jsx +1 -1
  33. package/react/ViewStack/index.spec.jsx +1 -1
  34. package/react/Viewer/Viewer.jsx +1 -1
  35. package/react/Viewer/ViewerExposer.js +1 -1
  36. package/react/Viewer/components/ViewerControls.jsx +1 -1
  37. package/react/__snapshots__/examples.spec.jsx.snap +795 -795
  38. package/react/hooks/useConfirmExit/index.spec.js +1 -1
  39. package/transpiled/react/AppLinker/native.js +1 -1
  40. package/transpiled/react/Avatar/index.js +2 -0
  41. package/transpiled/react/ContactsList/Contacts/ContactCozy.js +2 -0
  42. package/transpiled/react/ContactsList/Contacts/ContactEmail.js +2 -0
  43. package/transpiled/react/ContactsList/Contacts/ContactIdentity.js +2 -0
  44. package/transpiled/react/ContactsList/Contacts/ContactName.js +2 -0
  45. package/transpiled/react/ContactsList/Contacts/ContactPhone.js +2 -0
  46. package/transpiled/react/ContactsListModal/index.js +1 -1
  47. package/transpiled/react/FilePicker/FilePickerHeader.js +1 -1
  48. package/transpiled/react/ViewStack/example.js +1 -1
  49. package/transpiled/react/Viewer/Viewer.js +1 -1
  50. package/transpiled/react/Viewer/ViewerExposer.js +1 -1
  51. package/transpiled/react/Viewer/components/ViewerControls.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [81.1.0](https://github.com/cozy/cozy-ui/compare/v81.0.0...v81.1.0) (2023-02-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * Use bare directories instead of index files in specifiers ([00dd09e](https://github.com/cozy/cozy-ui/commit/00dd09e))
7
+
1
8
  # [81.0.0](https://github.com/cozy/cozy-ui/compare/v80.3.0...v81.0.0) (2023-02-13)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "81.0.0",
3
+ "version": "81.1.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -10,7 +10,7 @@ import Icon from '../Icon'
10
10
  import FileIcon from '../Icons/File'
11
11
  import WarningIcon from '../Icons/Warning'
12
12
 
13
- import ActionMenu, { ActionMenuItem, ActionMenuRadio } from './'
13
+ import ActionMenu, { ActionMenuItem, ActionMenuRadio } from '.'
14
14
 
15
15
  describe('ActionMenu', () => {
16
16
  fixPopperTesting()
@@ -4,7 +4,7 @@
4
4
  import React from 'react'
5
5
  import { shallow } from 'enzyme'
6
6
 
7
- import Alerter from './'
7
+ import Alerter from '.'
8
8
  import Alert from './Alert'
9
9
  import Button from '../Button'
10
10
 
@@ -19,7 +19,7 @@ import {
19
19
  checkApp
20
20
  } from 'cozy-device-helper'
21
21
 
22
- import AppLinker from './index'
22
+ import AppLinker from '.'
23
23
  import { generateUniversalLink } from './native'
24
24
  jest.useFakeTimers()
25
25
 
@@ -11,7 +11,7 @@ import {
11
11
  checkApp
12
12
  } from 'cozy-device-helper'
13
13
 
14
- import AppLinker from './index'
14
+ import AppLinker from '.'
15
15
  import { generateUniversalLink } from './native'
16
16
  jest.useFakeTimers()
17
17
 
@@ -3,7 +3,7 @@ import {
3
3
  ensureFirstSlash
4
4
  } from 'cozy-client'
5
5
 
6
- import { UNIVERSAL_LINK_URL } from './native.config.js'
6
+ import { UNIVERSAL_LINK_URL } from './native.config'
7
7
 
8
8
  export const getUniversalLinkDomain = () => {
9
9
  return UNIVERSAL_LINK_URL
@@ -9,7 +9,7 @@ import CozyClient, { CozyProvider } from 'cozy-client'
9
9
  import en from '../AppSections/locales/en.json'
10
10
  import I18n from '../I18n'
11
11
 
12
- import AppTile from './index'
12
+ import AppTile from '.'
13
13
 
14
14
  const appMock = {
15
15
  slug: 'test',
@@ -55,6 +55,7 @@ export const Avatar = ({
55
55
  const IconToRender = Icon.isProperIcon(icon) ? <Icon icon={icon} /> : icon
56
56
  return (
57
57
  <div
58
+ data-testid="Avatar" // used by a test in cozy-contacts
58
59
  className={cx(
59
60
  styles['c-avatar'],
60
61
  text ? styles['c-avatar--text'] : '',
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { render } from '@testing-library/react'
3
- import Banner from './index'
3
+ import Banner from '.'
4
4
 
5
5
  describe('Grid', () => {
6
6
  it('should render correctly justify content', () => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { fireEvent, render } from '@testing-library/react'
3
- import CipherIcon from './index'
3
+ import CipherIcon from '.'
4
4
 
5
5
  jest.mock('cozy-client', () => ({
6
6
  withClient: Component => {
@@ -5,7 +5,10 @@ import { TableCell } from '../../Table'
5
5
  import styles from '../styles.styl'
6
6
 
7
7
  const ContactCozy = ({ cozyUrl }) => (
8
- <TableCell className={`${styles['contact-cozyurl']} u-ellipsis`}>
8
+ <TableCell
9
+ data-testid="ContactCozy" // used by a test in cozy-contacts
10
+ className={`${styles['contact-cozyurl']} u-ellipsis`}
11
+ >
9
12
  {cozyUrl}
10
13
  </TableCell>
11
14
  )
@@ -5,7 +5,10 @@ import { TableCell } from '../../Table'
5
5
  import styles from '../styles.styl'
6
6
 
7
7
  const ContactEmail = ({ email }) => (
8
- <TableCell className={`${styles['contact-email']} u-ellipsis`}>
8
+ <TableCell
9
+ data-testid="ContactEmail" // used by a test in cozy-contacts
10
+ className={`${styles['contact-email']} u-ellipsis`}
11
+ >
9
12
  {email}
10
13
  </TableCell>
11
14
  )
@@ -20,6 +20,7 @@ const ContactIdentity = ({ contact }) => {
20
20
 
21
21
  return (
22
22
  <TableCell
23
+ data-testid="ContactIdentity" // used by a test in cozy-contacts
23
24
  className={`${
24
25
  styles['contact-identity']
25
26
  } u-flex u-flex-items-center u-ellipsis`}
@@ -9,6 +9,7 @@ const ContactName = ({ displayName, familyName }) => {
9
9
 
10
10
  return (
11
11
  <Typography
12
+ data-testid="ContactName" // used by a test in cozy-contacts
12
13
  className="u-ml-1"
13
14
  variant="body1"
14
15
  noWrap
@@ -5,7 +5,10 @@ import { TableCell } from '../../Table'
5
5
  import styles from '../styles.styl'
6
6
 
7
7
  const ContactPhone = ({ phone }) => (
8
- <TableCell className={`${styles['contact-phone']} u-ellipsis`}>
8
+ <TableCell
9
+ data-testid="ContactPhone" // used by a test in cozy-contacts
10
+ className={`${styles['contact-phone']} u-ellipsis`}
11
+ >
9
12
  {phone}
10
13
  </TableCell>
11
14
  )
@@ -9,9 +9,11 @@ exports[`ContactRow should match the contact snapshot 1`] = `
9
9
  >
10
10
  <div
11
11
  className="styles__TableCell___yJCq7 styles__contact-identity___mL3IJ u-flex u-flex-items-center u-ellipsis"
12
+ data-testid="ContactIdentity"
12
13
  >
13
14
  <div
14
15
  className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
16
+ data-testid="Avatar"
15
17
  style={
16
18
  Object {
17
19
  "--circleSize": "32px",
@@ -28,6 +30,7 @@ exports[`ContactRow should match the contact snapshot 1`] = `
28
30
  </div>
29
31
  <p
30
32
  className="MuiTypography-root u-ml-1 MuiTypography-body1 MuiTypography-colorTextPrimary MuiTypography-noWrap MuiTypography-gutterBottom MuiTypography-displayInline"
33
+ data-testid="ContactName"
31
34
  >
32
35
  <span
33
36
  className=""
@@ -45,16 +48,19 @@ exports[`ContactRow should match the contact snapshot 1`] = `
45
48
  </div>
46
49
  <div
47
50
  className="styles__TableCell___yJCq7 styles__contact-email___3n3q2 u-ellipsis"
51
+ data-testid="ContactEmail"
48
52
  >
49
53
  johndoe@localhost
50
54
  </div>
51
55
  <div
52
56
  className="styles__TableCell___yJCq7 styles__contact-phone___1sA_m u-ellipsis"
57
+ data-testid="ContactPhone"
53
58
  >
54
59
  0123456789
55
60
  </div>
56
61
  <div
57
62
  className="styles__TableCell___yJCq7 styles__contact-cozyurl___3kBp5 u-ellipsis"
63
+ data-testid="ContactCozy"
58
64
  >
59
65
  http://johndoe.mycozy.cloud
60
66
  </div>
@@ -13,7 +13,7 @@ import {
13
13
  useCozyDialog
14
14
  } from '../CozyDialogs'
15
15
  import useRealtime from '../hooks/useRealtime'
16
- import useEventListener from '../hooks/useEventListener.js'
16
+ import useEventListener from '../hooks/useEventListener'
17
17
  import useBreakpoints from '../hooks/useBreakpoints'
18
18
  import Button from '../Buttons'
19
19
  import PlusIcon from '../Icons/Plus'
@@ -1,6 +1,6 @@
1
1
  import { mount } from 'enzyme'
2
2
  import React from 'react'
3
- import DateMonthPicker from './index'
3
+ import DateMonthPicker from '.'
4
4
  import { act } from 'react-dom/test-utils'
5
5
 
6
6
  import I18n from '../I18n'
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import Field from './'
2
+ import Field from '.'
3
3
  import { shallow } from 'enzyme'
4
4
 
5
5
  describe('Field component', () => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import uniqueId from 'lodash/uniqueId'
3
3
 
4
- import FileInput from './index'
4
+ import FileInput from '.'
5
5
 
6
6
  jest.mock('lodash/uniqueId')
7
7
 
@@ -12,7 +12,7 @@ import Previous from '../Icons/Previous'
12
12
 
13
13
  import FilePickerBreadcrumb from './FilePickerBreadcrumb'
14
14
  import { buildCurrentFolderQuery } from './queries'
15
- import { ROOT_DIR_ID } from './index'
15
+ import { ROOT_DIR_ID } from '.'
16
16
 
17
17
  /**
18
18
  * @param {IOCozyFolder} displayedFolder - An io.cozy.files folder
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { I18n, translate } from './'
2
+ import { I18n, translate } from '.'
3
3
  import omit from 'lodash/omit'
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import Input from './index'
3
+ import Input from '.'
4
4
 
5
5
  describe('Input component', () => {
6
6
  it('should support number type', () => {
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { act } from 'react-dom/test-utils'
3
3
  import { useState } from 'react'
4
4
  import { mount } from 'enzyme'
5
- import Modal, { BODY_CLASS } from './index'
5
+ import Modal, { BODY_CLASS } from '.'
6
6
  import { BreakpointsProvider } from '../hooks/useBreakpoints'
7
7
 
8
8
  describe('Modal', () => {
@@ -1,4 +1,4 @@
1
- import { makeOptions, makeData } from './index'
1
+ import { makeOptions, makeData } from '.'
2
2
 
3
3
  describe('makeOptions', () => {
4
4
  it('should return default options', () => {
@@ -3,7 +3,7 @@ import { shallow } from 'enzyme'
3
3
 
4
4
  import { isMobileApp } from 'cozy-device-helper'
5
5
 
6
- import { Popup } from './'
6
+ import { Popup } from '.'
7
7
 
8
8
  jest.mock('cozy-device-helper', () => ({
9
9
  ...jest.requireActual('cozy-device-helper'),
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import { render } from '@testing-library/react'
4
4
 
5
- import PushClientButton from './'
5
+ import PushClientButton from '.'
6
6
 
7
7
  jest.mock('../Icons/DeviceLaptop', () => () => (
8
8
  <div data-testid="device-laptop" />
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
 
3
3
  import { render, fireEvent } from '@testing-library/react'
4
4
 
5
- import Radio from './'
5
+ import Radio from '.'
6
6
  import RadioGroup from '../RadioGroup'
7
7
  import FormControlLabel from '../FormControlLabel'
8
8
 
@@ -8,7 +8,7 @@ import CozyClient, { CozyProvider } from 'cozy-client'
8
8
  import Icon from '../Icon'
9
9
  import CozyIcon from '../Icons/Cozy'
10
10
  import MuiCozyTheme from '../MuiCozyTheme'
11
- import SquareAppIcon from './index'
11
+ import SquareAppIcon from '.'
12
12
 
13
13
  const appMock = {
14
14
  slug: 'test',
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { UploadQueue, formatRemainingTime } from './index'
2
+ import { UploadQueue, formatRemainingTime } from '.'
3
3
  import { render } from '@testing-library/react'
4
4
  import { useI18n } from '../I18n'
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useViewStack } from './index'
2
+ import { useViewStack } from '.'
3
3
  import Button from '../Button'
4
4
 
5
5
  const PaddedParagraph = ({ children }) => (
@@ -2,7 +2,7 @@ import { mount } from 'enzyme'
2
2
  import React from 'react'
3
3
  import { act } from 'react-dom/test-utils'
4
4
  import { Slide } from './example'
5
- import ViewStack from './index'
5
+ import ViewStack from '.'
6
6
  import Button from '../Button'
7
7
  import SwipeableViews from 'react-swipeable-views'
8
8
 
@@ -5,7 +5,7 @@ import { FileDoctype } from '../proptypes'
5
5
 
6
6
  import ViewerControls from './components/ViewerControls'
7
7
  import ViewerByFile from './components/ViewerByFile'
8
- import { toolbarPropsPropType } from './index'
8
+ import { toolbarPropsPropType } from '.'
9
9
 
10
10
  const KEY_CODE_LEFT = 37
11
11
  const KEY_CODE_RIGHT = 39
@@ -1,3 +1,3 @@
1
- import DefaultViewer from './index'
1
+ import DefaultViewer from '.'
2
2
 
3
3
  export default DefaultViewer
@@ -8,7 +8,7 @@ import { withStyles } from '../../styles'
8
8
  import withBreakpoints from '../../helpers/withBreakpoints'
9
9
 
10
10
  import { isValidForPanel } from '../helpers'
11
- import { toolbarPropsPropType } from '../index'
11
+ import { toolbarPropsPropType } from '..'
12
12
  import { infoWidth } from './InformationPanel'
13
13
  import Toolbar from './Toolbar'
14
14
  import Navigation from './Navigation'