cozy-ui-plus 12.3.14 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.json +3 -3
  3. package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +0 -62
  4. package/dist/ListItem/ExpandedAttributes/helpers.js +0 -263
  5. package/dist/ListItem/ExpandedAttributes/index.js +0 -90
  6. package/dist/ListItem/ListItemBase/Renaming/RenameDialog.js +0 -52
  7. package/dist/ListItem/ListItemBase/Renaming/RenameInput.js +0 -319
  8. package/dist/ListItem/ListItemBase/Renaming/helpers.js +0 -73
  9. package/dist/ListItem/ListItemBase/index.js +0 -151
  10. package/dist/ListItem/ListItemByDoc/index.js +0 -109
  11. package/dist/ListItem/ListItemContact/helpers.js +0 -39
  12. package/dist/ListItem/ListItemContact/index.js +0 -85
  13. package/dist/ListItem/ListItemContact/useActions.js +0 -28
  14. package/dist/ListItem/ListItemFile/ExpirationAnnotation.js +0 -54
  15. package/dist/ListItem/ListItemFile/ItemIcon.js +0 -64
  16. package/dist/ListItem/ListItemFile/PrimaryText.js +0 -47
  17. package/dist/ListItem/ListItemFile/SecondaryText.js +0 -41
  18. package/dist/ListItem/ListItemFile/index.js +0 -96
  19. package/dist/ListItem/hoc/withListItemLocales.js +0 -320
  20. package/dist/Qualification/QualificationGrid/helpers.js +0 -16
  21. package/dist/Qualification/QualificationGrid/index.js +0 -118
  22. package/dist/Qualification/QualificationGrid/locales/withLocales.js +0 -80
  23. package/dist/Qualification/QualificationItem/index.js +0 -76
  24. package/dist/providers/Intent/index.js +0 -130
  25. package/dist/src/ListItem/ExpandedAttributes/ExpandedAttribute.d.ts +0 -14
  26. package/dist/src/ListItem/ExpandedAttributes/helpers.d.ts +0 -43
  27. package/dist/src/ListItem/ExpandedAttributes/helpers.spec.d.ts +0 -1
  28. package/dist/src/ListItem/ExpandedAttributes/index.d.ts +0 -2
  29. package/dist/src/ListItem/ListItemBase/Renaming/RenameDialog.d.ts +0 -2
  30. package/dist/src/ListItem/ListItemBase/Renaming/RenameInput.d.ts +0 -12
  31. package/dist/src/ListItem/ListItemBase/Renaming/helpers.d.ts +0 -1
  32. package/dist/src/ListItem/ListItemBase/index.d.ts +0 -2
  33. package/dist/src/ListItem/ListItemByDoc/index.d.ts +0 -46
  34. package/dist/src/ListItem/ListItemContact/helpers.d.ts +0 -1
  35. package/dist/src/ListItem/ListItemContact/helpers.spec.d.ts +0 -1
  36. package/dist/src/ListItem/ListItemContact/index.d.ts +0 -35
  37. package/dist/src/ListItem/ListItemContact/useActions.d.ts +0 -2
  38. package/dist/src/ListItem/ListItemFile/ExpirationAnnotation.d.ts +0 -2
  39. package/dist/src/ListItem/ListItemFile/ItemIcon.d.ts +0 -12
  40. package/dist/src/ListItem/ListItemFile/PrimaryText.d.ts +0 -12
  41. package/dist/src/ListItem/ListItemFile/SecondaryText.d.ts +0 -12
  42. package/dist/src/ListItem/ListItemFile/index.d.ts +0 -37
  43. package/dist/src/ListItem/hoc/withListItemLocales.d.ts +0 -12
  44. package/dist/src/Qualification/QualificationGrid/helpers.d.ts +0 -1
  45. package/dist/src/Qualification/QualificationGrid/index.d.ts +0 -2
  46. package/dist/src/Qualification/QualificationGrid/locales/withLocales.d.ts +0 -12
  47. package/dist/src/Qualification/QualificationItem/index.d.ts +0 -17
  48. package/dist/src/providers/Intent/index.d.ts +0 -9
  49. package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +0 -39
  50. package/src/ListItem/ExpandedAttributes/helpers.js +0 -214
  51. package/src/ListItem/ExpandedAttributes/helpers.spec.js +0 -175
  52. package/src/ListItem/ExpandedAttributes/index.jsx +0 -62
  53. package/src/ListItem/ListItemBase/Renaming/RenameDialog.jsx +0 -38
  54. package/src/ListItem/ListItemBase/Renaming/RenameInput.jsx +0 -134
  55. package/src/ListItem/ListItemBase/Renaming/helpers.js +0 -35
  56. package/src/ListItem/ListItemBase/index.jsx +0 -115
  57. package/src/ListItem/ListItemByDoc/index.jsx +0 -103
  58. package/src/ListItem/ListItemContact/helpers.js +0 -28
  59. package/src/ListItem/ListItemContact/helpers.spec.js +0 -41
  60. package/src/ListItem/ListItemContact/index.jsx +0 -67
  61. package/src/ListItem/ListItemContact/useActions.jsx +0 -22
  62. package/src/ListItem/ListItemFile/ExpirationAnnotation.jsx +0 -39
  63. package/src/ListItem/ListItemFile/ItemIcon.jsx +0 -55
  64. package/src/ListItem/ListItemFile/PrimaryText.jsx +0 -38
  65. package/src/ListItem/ListItemFile/SecondaryText.jsx +0 -36
  66. package/src/ListItem/ListItemFile/index.jsx +0 -75
  67. package/src/ListItem/Readme.md +0 -211
  68. package/src/ListItem/hoc/withListItemLocales.jsx +0 -15
  69. package/src/ListItem/locales/en.json +0 -75
  70. package/src/ListItem/locales/fr.json +0 -75
  71. package/src/ListItem/locales/ru.json +0 -75
  72. package/src/ListItem/locales/vi.json +0 -75
  73. package/src/Qualification/QualificationGrid/Readme.md +0 -26
  74. package/src/Qualification/QualificationGrid/helpers.js +0 -4
  75. package/src/Qualification/QualificationGrid/index.jsx +0 -93
  76. package/src/Qualification/QualificationGrid/locales/en.json +0 -15
  77. package/src/Qualification/QualificationGrid/locales/fr.json +0 -15
  78. package/src/Qualification/QualificationGrid/locales/ru.json +0 -15
  79. package/src/Qualification/QualificationGrid/locales/vi.json +0 -15
  80. package/src/Qualification/QualificationGrid/locales/withLocales.jsx +0 -15
  81. package/src/Qualification/QualificationItem/Readme.md +0 -8
  82. package/src/Qualification/QualificationItem/index.jsx +0 -63
  83. package/src/providers/Intent/index.jsx +0 -83
@@ -1,15 +0,0 @@
1
- {
2
- "themes": {
3
- "activity": "Loisirs",
4
- "family": "Famille",
5
- "finance": "Finances",
6
- "health": "Santé",
7
- "home": "Logement",
8
- "identity": "Identité",
9
- "invoice": "Factures",
10
- "others": "Autres",
11
- "transport": "Transport",
12
- "undefined": "Indéfini",
13
- "work_study": "Travail"
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "themes": {
3
- "activity": "Деятельность",
4
- "family": "Семья",
5
- "finance": "Финансы",
6
- "health": "Здоровье",
7
- "home": "Дом",
8
- "identity": "Личность",
9
- "invoice": "Счет",
10
- "others": "Прочее",
11
- "transport": "Транспорт",
12
- "undefined": "Не определено",
13
- "work_study": "Работа"
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "themes": {
3
- "activity": "Hoạt động",
4
- "family": "Gia đình",
5
- "finance": "Tài chính",
6
- "health": "Sức khỏe",
7
- "home": "Nhà",
8
- "identity": "Danh tính",
9
- "invoice": "Hóa đơn",
10
- "others": "Khác",
11
- "transport": "Giao thông",
12
- "undefined": "Chưa xác định",
13
- "work_study": "Công việc"
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- import { withOnlyLocales } from 'twake-i18n'
2
-
3
- import en from './en.json'
4
- import fr from './fr.json'
5
- import ru from './ru.json'
6
- import vi from './vi.json'
7
-
8
- export const locales = {
9
- en,
10
- fr,
11
- ru,
12
- vi
13
- }
14
-
15
- export default withOnlyLocales(locales)
@@ -1,8 +0,0 @@
1
- ```jsx
2
- import QualificationItem from 'cozy-ui/transpiled/react/QualificationItem'
3
- import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People'
4
-
5
- ;
6
-
7
- <QualificationItem icon={PeopleIcon} label="People" />
8
- ```
@@ -1,63 +0,0 @@
1
- import { Icon, FileDuotone } from '@linagora/twake-icons'
2
- import PropTypes from 'prop-types'
3
- import React from 'react'
4
-
5
- import ButtonBase from 'cozy-ui/transpiled/react/ButtonBase'
6
- import Typography from 'cozy-ui/transpiled/react/Typography'
7
- import { makeStyles } from 'cozy-ui/transpiled/react/styles'
8
-
9
- const useStyles = makeStyles({
10
- item: {
11
- display: 'flex',
12
- flexDirection: 'column',
13
- width: '100%',
14
- height: 84,
15
- marginBottom: 8,
16
- borderRadius: 4,
17
- borderColor: ({ isSelected }) =>
18
- isSelected ? 'var(--primaryColor)' : 'var(--borderMainColor)',
19
- border: '1px solid'
20
- }
21
- })
22
-
23
- const QualificationItem = ({ icon, label, isSelected, onClick, ...props }) => {
24
- const styles = useStyles({ isSelected })
25
-
26
- return (
27
- <ButtonBase {...props} className={styles.item} onClick={onClick}>
28
- <div className="u-mb-half">
29
- {icon ? (
30
- <Icon
31
- icon={icon}
32
- color={
33
- isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
34
- }
35
- />
36
- ) : (
37
- <Icon
38
- icon={FileDuotone}
39
- size="32"
40
- color={
41
- isSelected ? 'var(--primaryColor)' : 'var(--secondaryTextColor)'
42
- }
43
- />
44
- )}
45
- </div>
46
- <Typography variant="caption">{label}</Typography>
47
- </ButtonBase>
48
- )
49
- }
50
-
51
- QualificationItem.propTypes = {
52
- icon: PropTypes.oneOfType([
53
- PropTypes.string,
54
- PropTypes.node,
55
- PropTypes.object,
56
- PropTypes.func
57
- ]),
58
- label: PropTypes.string,
59
- isSelected: PropTypes.bool,
60
- onClick: PropTypes.func
61
- }
62
-
63
- export default QualificationItem
@@ -1,83 +0,0 @@
1
- import React, {
2
- useEffect,
3
- useMemo,
4
- useState,
5
- createContext,
6
- useContext
7
- } from 'react'
8
-
9
- import { useClient } from 'cozy-client'
10
- import Backdrop from 'cozy-ui/transpiled/react/Backdrop'
11
- import Spinner from 'cozy-ui/transpiled/react/Spinner'
12
-
13
- export const IntentContext = createContext()
14
-
15
- export const useIntent = () => {
16
- const context = useContext(IntentContext)
17
-
18
- if (!context) {
19
- throw new Error('useIntent must be used within a IntentProvider')
20
- }
21
- return context
22
- }
23
-
24
- const IntentProvider = ({ intentId, componentsProps, children }) => {
25
- const client = useClient()
26
- const [state, setState] = useState({
27
- service: null,
28
- intent: null,
29
- data: null
30
- })
31
-
32
- const value = useMemo(
33
- () => ({
34
- service: state.service,
35
- intent: state.intent,
36
- data: state.data
37
- }),
38
- [state]
39
- )
40
-
41
- useEffect(() => {
42
- const startService = async () => {
43
- let service
44
-
45
- try {
46
- service = await client.intents.createService(intentId, window)
47
- const intent = service.getIntent()
48
- const data = service.getData()
49
-
50
- setState({
51
- service,
52
- intent,
53
- data
54
- })
55
- } catch (error) {
56
- service.throw(error)
57
- }
58
- }
59
-
60
- if (!state.service) {
61
- startService()
62
- }
63
- }, [client, intentId, state.service])
64
-
65
- if (!state.service) {
66
- return (
67
- <Backdrop open {...componentsProps?.backdrop}>
68
- <Spinner
69
- className="u-m-0"
70
- size="xxlarge"
71
- middle
72
- {...componentsProps?.spinner}
73
- />
74
- </Backdrop>
75
- )
76
- }
77
-
78
- return (
79
- <IntentContext.Provider value={value}>{children}</IntentContext.Provider>
80
- )
81
- }
82
-
83
- export default IntentProvider