cozy-sharing 23.1.0 → 24.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [24.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@23.2.0...cozy-sharing@24.0.0) (2025-03-12)
7
+
8
+ ### Features
9
+
10
+ - **Sharing:** Adjust switch position ([4c72e95](https://github.com/cozy/cozy-libs/commit/4c72e95916a5dc3f3ce24e71196ac50d4c232610))
11
+ - **Sharing:** Upgrade cozy-ui ([9bf395a](https://github.com/cozy/cozy-libs/commit/9bf395a1db38f213a30dc9346578f592a33f7228))
12
+
13
+ ### BREAKING CHANGES
14
+
15
+ - **Sharing:** You must have `cozy-ui >= 119.2.0`
16
+
17
+ # [23.2.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@23.1.0...cozy-sharing@23.2.0) (2025-03-12)
18
+
19
+ ### Features
20
+
21
+ - Replace sprite icons by svgr ([a7f2d16](https://github.com/cozy/cozy-libs/commit/a7f2d16cd1f3471c9aefe18b0403483f74fc26a5))
22
+
6
23
  # [23.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@23.0.0...cozy-sharing@23.1.0) (2025-03-11)
7
24
 
8
25
  ### Features
@@ -4,12 +4,14 @@ import React from 'react';
4
4
  import Box from 'cozy-ui/transpiled/react/Box';
5
5
  import DatePicker from 'cozy-ui/transpiled/react/DatePicker';
6
6
  import Icon from 'cozy-ui/transpiled/react/Icon';
7
+ import CalendarIcon from 'cozy-ui/transpiled/react/Icons/Calendar';
7
8
  import List from 'cozy-ui/transpiled/react/List';
8
9
  import ListItem from 'cozy-ui/transpiled/react/ListItem';
9
10
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
10
11
  import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction';
11
12
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
12
13
  import Switch from 'cozy-ui/transpiled/react/Switch';
14
+ import { isTwakeTheme } from 'cozy-ui/transpiled/react/helpers/isTwakeTheme';
13
15
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
14
16
  export var BoxDate = function BoxDate(_ref) {
15
17
  var onChange = _ref.onChange,
@@ -43,11 +45,11 @@ export var BoxDate = function BoxDate(_ref) {
43
45
  return handleDateToggle(!toggle);
44
46
  }
45
47
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
46
- icon: "calendar"
48
+ icon: CalendarIcon
47
49
  })), /*#__PURE__*/React.createElement(ListItemText, {
48
50
  primary: t('BoxDate.text')
49
51
  }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(Switch, {
50
- edge: "end",
52
+ edge: isTwakeTheme() ? 'start' : 'end',
51
53
  color: "primary",
52
54
  checked: toggle,
53
55
  onChange: handleDateToggle
@@ -6,6 +6,8 @@ import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu';
6
6
  import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions';
7
7
  import Box from 'cozy-ui/transpiled/react/Box';
8
8
  import Icon from 'cozy-ui/transpiled/react/Icon';
9
+ import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom';
10
+ import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People';
9
11
  import List from 'cozy-ui/transpiled/react/List';
10
12
  import ListItem from 'cozy-ui/transpiled/react/ListItem';
11
13
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
@@ -55,14 +57,14 @@ export var BoxEditingRights = function BoxEditingRights(_ref) {
55
57
  ellipsis: false,
56
58
  onClick: toggleMenuDisplayed
57
59
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
58
- icon: "people"
60
+ icon: PeopleIcon
59
61
  })), /*#__PURE__*/React.createElement(ListItemText, {
60
62
  primary: t('BoxEditingRights.text'),
61
63
  secondary: textSecondary
62
64
  }), /*#__PURE__*/React.createElement(ListItemIcon, {
63
65
  className: "u-mr-half"
64
66
  }, /*#__PURE__*/React.createElement(Icon, {
65
- icon: "bottom"
67
+ icon: BottomIcon
66
68
  }))))), /*#__PURE__*/React.createElement(ActionsMenu, {
67
69
  ref: buttonRef,
68
70
  open: isMenuDisplayed,
@@ -7,6 +7,8 @@ import React, { useState } from 'react';
7
7
  import Box from 'cozy-ui/transpiled/react/Box';
8
8
  import Icon from 'cozy-ui/transpiled/react/Icon';
9
9
  import IconButton from 'cozy-ui/transpiled/react/IconButton';
10
+ import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy';
11
+ import PasswordIcon from 'cozy-ui/transpiled/react/Icons/Password';
10
12
  import List from 'cozy-ui/transpiled/react/List';
11
13
  import ListItem from 'cozy-ui/transpiled/react/ListItem';
12
14
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
@@ -14,6 +16,7 @@ import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryA
14
16
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
15
17
  import Switch from 'cozy-ui/transpiled/react/Switch';
16
18
  import TextField from 'cozy-ui/transpiled/react/TextField';
19
+ import { isTwakeTheme } from 'cozy-ui/transpiled/react/helpers/isTwakeTheme';
17
20
  import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
18
21
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
19
22
  import { copyToClipboard } from './helpers';
@@ -106,11 +109,11 @@ export var BoxPassword = function BoxPassword(_ref) {
106
109
  return handlePasswordToggle(!toggle);
107
110
  }
108
111
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
109
- icon: "password"
112
+ icon: PasswordIcon
110
113
  })), /*#__PURE__*/React.createElement(ListItemText, {
111
114
  primary: t('BoxPassword.text')
112
115
  }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(Switch, {
113
- edge: "end",
116
+ edge: isTwakeTheme() ? 'start' : 'end',
114
117
  color: "primary",
115
118
  checked: toggle,
116
119
  onChange: handlePasswordToggle
@@ -139,7 +142,7 @@ export var BoxPassword = function BoxPassword(_ref) {
139
142
  endAdornment: /*#__PURE__*/React.createElement(IconButton, {
140
143
  onClick: handleCopy
141
144
  }, /*#__PURE__*/React.createElement(Icon, {
142
- icon: "copy"
145
+ icon: CopyIcon
143
146
  }))
144
147
  },
145
148
  inputProps: inputProps
@@ -8,6 +8,7 @@ import { generateWebLink, useClient } from 'cozy-client';
8
8
  import Button from 'cozy-ui/transpiled/react/Buttons';
9
9
  import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
10
10
  import Icon from 'cozy-ui/transpiled/react/Icon';
11
+ import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash';
11
12
  import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert';
12
13
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
13
14
  import { ShareRestrictionContentModal } from './ShareRestrictionContentModal';
@@ -238,7 +239,7 @@ export var ShareRestrictionModal = function ShareRestrictionModal(_ref) {
238
239
  variant: "secondary",
239
240
  color: "error",
240
241
  startIcon: /*#__PURE__*/React.createElement(Icon, {
241
- icon: "trash"
242
+ icon: TrashIcon
242
243
  }),
243
244
  onClick: handleRevokeLink,
244
245
  busy: loading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "23.1.0",
3
+ "version": "24.0.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -58,7 +58,7 @@
58
58
  "cozy-device-helper": "^3.7.1",
59
59
  "cozy-intent": "^2.30.0",
60
60
  "cozy-minilog": "^3.10.0",
61
- "cozy-ui": "^119.0.1",
61
+ "cozy-ui": "^119.2.0",
62
62
  "jest": "26.6.3",
63
63
  "jest-environment-jsdom": "26.6.2",
64
64
  "react": "16.12.0",
@@ -71,7 +71,7 @@
71
71
  "cozy-device-helper": ">=3.7.1",
72
72
  "cozy-intent": ">=2.29.1",
73
73
  "cozy-minilog": ">=3.9.1",
74
- "cozy-ui": ">=119.0.1",
74
+ "cozy-ui": ">=119.2.0",
75
75
  "prop-types": "^15.7.2",
76
76
  "react": "^16.12.0",
77
77
  "react-router": "^5.0.1"
@@ -79,5 +79,5 @@
79
79
  "sideEffects": [
80
80
  "*.css"
81
81
  ],
82
- "gitHead": "f83732db828dad35ba70c744c91f8081d26254f2"
82
+ "gitHead": "57dd9ed354ce3321933b2e2321349f4d90d07cba"
83
83
  }
@@ -5,12 +5,14 @@ import React from 'react'
5
5
  import Box from 'cozy-ui/transpiled/react/Box'
6
6
  import DatePicker from 'cozy-ui/transpiled/react/DatePicker'
7
7
  import Icon from 'cozy-ui/transpiled/react/Icon'
8
+ import CalendarIcon from 'cozy-ui/transpiled/react/Icons/Calendar'
8
9
  import List from 'cozy-ui/transpiled/react/List'
9
10
  import ListItem from 'cozy-ui/transpiled/react/ListItem'
10
11
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
11
12
  import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
12
13
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
13
14
  import Switch from 'cozy-ui/transpiled/react/Switch'
15
+ import { isTwakeTheme } from 'cozy-ui/transpiled/react/helpers/isTwakeTheme'
14
16
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
15
17
 
16
18
  export const BoxDate = ({ onChange, date, toggle, onToggle }) => {
@@ -32,12 +34,12 @@ export const BoxDate = ({ onChange, date, toggle, onToggle }) => {
32
34
  onClick={() => handleDateToggle(!toggle)}
33
35
  >
34
36
  <ListItemIcon>
35
- <Icon icon="calendar" />
37
+ <Icon icon={CalendarIcon} />
36
38
  </ListItemIcon>
37
39
  <ListItemText primary={t('BoxDate.text')} />
38
40
  <ListItemSecondaryAction>
39
41
  <Switch
40
- edge="end"
42
+ edge={isTwakeTheme() ? 'start' : 'end'}
41
43
  color="primary"
42
44
  checked={toggle}
43
45
  onChange={handleDateToggle}
@@ -6,6 +6,8 @@ import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
6
6
  import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
7
7
  import Box from 'cozy-ui/transpiled/react/Box'
8
8
  import Icon from 'cozy-ui/transpiled/react/Icon'
9
+ import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom'
10
+ import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People'
9
11
  import List from 'cozy-ui/transpiled/react/List'
10
12
  import ListItem from 'cozy-ui/transpiled/react/ListItem'
11
13
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
@@ -55,14 +57,14 @@ export const BoxEditingRights = ({ file, editingRights, setEditingRights }) => {
55
57
  onClick={toggleMenuDisplayed}
56
58
  >
57
59
  <ListItemIcon>
58
- <Icon icon="people" />
60
+ <Icon icon={PeopleIcon} />
59
61
  </ListItemIcon>
60
62
  <ListItemText
61
63
  primary={t('BoxEditingRights.text')}
62
64
  secondary={textSecondary}
63
65
  />
64
66
  <ListItemIcon className="u-mr-half">
65
- <Icon icon="bottom" />
67
+ <Icon icon={BottomIcon} />
66
68
  </ListItemIcon>
67
69
  </ListItem>
68
70
  </List>
@@ -4,6 +4,8 @@ import React, { useState } from 'react'
4
4
  import Box from 'cozy-ui/transpiled/react/Box'
5
5
  import Icon from 'cozy-ui/transpiled/react/Icon'
6
6
  import IconButton from 'cozy-ui/transpiled/react/IconButton'
7
+ import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy'
8
+ import PasswordIcon from 'cozy-ui/transpiled/react/Icons/Password'
7
9
  import List from 'cozy-ui/transpiled/react/List'
8
10
  import ListItem from 'cozy-ui/transpiled/react/ListItem'
9
11
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
@@ -11,6 +13,7 @@ import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryA
11
13
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
12
14
  import Switch from 'cozy-ui/transpiled/react/Switch'
13
15
  import TextField from 'cozy-ui/transpiled/react/TextField'
16
+ import { isTwakeTheme } from 'cozy-ui/transpiled/react/helpers/isTwakeTheme'
14
17
  import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
15
18
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
16
19
 
@@ -67,12 +70,12 @@ export const BoxPassword = ({
67
70
  onClick={() => handlePasswordToggle(!toggle)}
68
71
  >
69
72
  <ListItemIcon>
70
- <Icon icon="password" />
73
+ <Icon icon={PasswordIcon} />
71
74
  </ListItemIcon>
72
75
  <ListItemText primary={t('BoxPassword.text')} />
73
76
  <ListItemSecondaryAction>
74
77
  <Switch
75
- edge="end"
78
+ edge={isTwakeTheme() ? 'start' : 'end'}
76
79
  color="primary"
77
80
  checked={toggle}
78
81
  onChange={handlePasswordToggle}
@@ -104,7 +107,7 @@ export const BoxPassword = ({
104
107
  InputProps={{
105
108
  endAdornment: (
106
109
  <IconButton onClick={handleCopy}>
107
- <Icon icon="copy" />
110
+ <Icon icon={CopyIcon} />
108
111
  </IconButton>
109
112
  )
110
113
  }}
@@ -6,6 +6,7 @@ import { generateWebLink, useClient } from 'cozy-client'
6
6
  import Button from 'cozy-ui/transpiled/react/Buttons'
7
7
  import { ConfirmDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
8
8
  import Icon from 'cozy-ui/transpiled/react/Icon'
9
+ import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
9
10
  import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
10
11
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
11
12
 
@@ -163,7 +164,7 @@ export const ShareRestrictionModal = ({ file, onClose }) => {
163
164
  label={t('Share.permissionLink.deactivate')}
164
165
  variant="secondary"
165
166
  color="error"
166
- startIcon={<Icon icon="trash" />}
167
+ startIcon={<Icon icon={TrashIcon} />}
167
168
  onClick={handleRevokeLink}
168
169
  busy={loading}
169
170
  />