cozy-ui 127.13.1 → 127.15.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,17 @@
1
+ # [127.15.0](https://github.com/cozy/cozy-ui/compare/v127.14.0...v127.15.0) (2025-08-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * **ActionsMenuButton:** Add component ([cd65a6c](https://github.com/cozy/cozy-ui/commit/cd65a6c))
7
+
8
+ # [127.14.0](https://github.com/cozy/cozy-ui/compare/v127.13.1...v127.14.0) (2025-08-21)
9
+
10
+
11
+ ### Features
12
+
13
+ * **Icons:** Add `AssignAdmin` and `AssignModerator` ([a66dedf](https://github.com/cozy/cozy-ui/commit/a66dedf))
14
+
1
15
  ## [127.13.1](https://github.com/cozy/cozy-ui/compare/v127.13.0...v127.13.1) (2025-08-21)
2
16
 
3
17
 
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M11.2 10.896a.896.896 0 1 0 0-1.792.896.896 0 0 0 0 1.792Z"/><path fill-rule="evenodd" d="M11.2 11.6c-.584 0-1.752.288-1.792.864a2.19 2.19 0 0 0 1.792.936 2.19 2.19 0 0 0 1.792-.936c-.04-.576-1.208-.864-1.792-.864Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12 6.472V2.616L6 0 0 2.616v3.928c0 3.632 2.56 7.032 6 7.856.44-.104.864-.256 1.28-.44A4.778 4.778 0 0 0 11.2 16c2.648 0 4.8-2.152 4.8-4.8a4.798 4.798 0 0 0-4-4.728ZM6.4 11.2c0 .448.064.888.184 1.296a5.27 5.27 0 0 1-.584.24c-2.536-.8-4.4-3.392-4.4-6.192v-2.88L6 1.744l4.4 1.92v2.808a4.798 4.798 0 0 0-4 4.728Zm4.8 3.2a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 1 1 0 6.4Z" clip-rule="evenodd"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16"><path d="M1.6 7.272v-3.76l4.8-1.8 4.8 1.8v2.952c.568.08 1.104.248 1.6.48V2.4L6.4 0 0 2.4v4.872C0 11.312 2.728 15.08 6.4 16c.024-.008.04-.016.064-.016a5.658 5.658 0 0 1-1.4-2.272C3.008 12.424 1.6 9.936 1.6 7.272Z"/><path d="M10.4 8c-2.208 0-4 1.792-4 4s1.792 4 4 4 4-1.792 4-4-1.792-4-4-4Zm2.4 4.4h-2v2H10v-2H8v-.8h2v-2h.8v2h2v.8Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "127.13.1",
3
+ "version": "127.15.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -1,4 +1,5 @@
1
1
  {
2
+ "menu": "Menu",
2
3
  "viewInContacts": "View in Cozy Contacts",
3
4
  "viewInDrive": "Open",
4
5
  "modify": "Modify",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "menu": "Menu",
2
3
  "viewInContacts": "Voir dans Cozy Contacts",
3
4
  "viewInDrive": "Ouvrir",
4
5
  "modify": "Modifier",
@@ -0,0 +1,45 @@
1
+ import React, { useState, useRef } from 'react'
2
+
3
+ import ActionsMenu from '.'
4
+ import { locales } from './Actions/locales/withActionsLocales'
5
+ import Icon from '../Icon'
6
+ import IconButton from '../IconButton'
7
+ import DotsIcon from '../Icons/Dots'
8
+ import ListItemIcon from '../ListItemIcon'
9
+ import { useI18n, useExtendI18n } from '../providers/I18n'
10
+
11
+ const ActionsMenuButton = ({ docs, actions }) => {
12
+ const [showActions, setShowActions] = useState(false)
13
+ const actionsRef = useRef()
14
+ useExtendI18n(locales)
15
+ const { t } = useI18n()
16
+
17
+ return (
18
+ <>
19
+ <ListItemIcon>
20
+ <IconButton
21
+ ref={actionsRef}
22
+ arial-label={t('menu')}
23
+ onClick={() => setShowActions(true)}
24
+ >
25
+ <Icon icon={DotsIcon} />
26
+ </IconButton>
27
+ </ListItemIcon>
28
+ {showActions && (
29
+ <ActionsMenu
30
+ open
31
+ ref={actionsRef}
32
+ docs={docs}
33
+ actions={actions}
34
+ anchorOrigin={{
35
+ vertical: 'bottom',
36
+ horizontal: 'right'
37
+ }}
38
+ onClose={() => setShowActions(false)}
39
+ />
40
+ )}
41
+ </>
42
+ )
43
+ }
44
+
45
+ export default ActionsMenuButton
@@ -1,20 +1,9 @@
1
- import React, { useRef, useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  import ContactIdentity from './Contacts/ContactIdentity'
4
- import { locales } from './locales/withContactsListLocales'
5
- import ActionsMenu from '../ActionsMenu'
6
- import Icon from '../Icon'
7
- import IconButton from '../IconButton'
8
- import DotsIcon from '../Icons/Dots'
9
- import ListItemIcon from '../ListItemIcon'
10
- import { useI18n, useExtendI18n } from '../providers/I18n'
4
+ import ActionsMenuButton from '../ActionsMenu/ActionsMenuButton'
11
5
 
12
6
  const Cell = ({ row, column, cell, actions }) => {
13
- const [showActions, setShowActions] = useState(false)
14
- useExtendI18n(locales)
15
- const { t } = useI18n()
16
- const actionsRef = useRef()
17
-
18
7
  if (column.id === 'fullname') {
19
8
  return <ContactIdentity contact={row} noWrapper />
20
9
  }
@@ -24,32 +13,7 @@ const Cell = ({ row, column, cell, actions }) => {
24
13
  return null
25
14
  }
26
15
 
27
- return (
28
- <>
29
- <ListItemIcon>
30
- <IconButton
31
- ref={actionsRef}
32
- arial-label={t('menu')}
33
- onClick={() => setShowActions(true)}
34
- >
35
- <Icon icon={DotsIcon} />
36
- </IconButton>
37
- </ListItemIcon>
38
- {showActions && (
39
- <ActionsMenu
40
- open
41
- ref={actionsRef}
42
- docs={[row]}
43
- actions={actions}
44
- anchorOrigin={{
45
- vertical: 'bottom',
46
- horizontal: 'right'
47
- }}
48
- onClose={() => setShowActions(false)}
49
- />
50
- )}
51
- </>
52
- )
16
+ return <ActionsMenuButton docs={[row]} actions={actions} />
53
17
  }
54
18
 
55
19
  return cell
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "empty": "EMPTY",
3
3
  "me": "me",
4
- "favorite": "favorites",
5
- "menu": "Menu"
4
+ "favorite": "favorites"
6
5
  }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "empty": "VIDE",
3
3
  "me": "moi",
4
- "favorite": "favoris",
5
- "menu": "Menu"
4
+ "favorite": "favoris"
6
5
  }
@@ -71,6 +71,8 @@ import Answer from 'cozy-ui/transpiled/react/Icons/Answer'
71
71
  import Apple from 'cozy-ui/transpiled/react/Icons/Apple'
72
72
  import Archive from 'cozy-ui/transpiled/react/Icons/Archive'
73
73
  import ArrowUp from 'cozy-ui/transpiled/react/Icons/ArrowUp'
74
+ import AssignAdmin from 'cozy-ui/transpiled/react/Icons/AssignAdmin'
75
+ import AssignModerator from 'cozy-ui/transpiled/react/Icons/AssignModerator'
74
76
  import Assistant from 'cozy-ui/transpiled/react/Icons/Assistant'
75
77
  import Attachment from 'cozy-ui/transpiled/react/Icons/Attachment'
76
78
  import Attention from 'cozy-ui/transpiled/react/Icons/Attention'
@@ -352,6 +354,8 @@ const icons = [
352
354
  Apple,
353
355
  Archive,
354
356
  ArrowUp,
357
+ AssignAdmin,
358
+ AssignModerator,
355
359
  Assistant,
356
360
  Attachment,
357
361
  Attention,
@@ -988,7 +992,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
988
992
 
989
993
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
990
994
  let i = 0
991
- const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
995
+ const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
992
996
  ;
993
997
 
994
998
  <Grid container spacing={2}>
@@ -0,0 +1,22 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/assign-admin.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgAssignAdmin(props) {
5
+ return (
6
+ <svg {...props}>
7
+ <path d="M11.2 10.896a.896.896 0 100-1.792.896.896 0 000 1.792z" />
8
+ <path
9
+ fillRule="evenodd"
10
+ d="M11.2 11.6c-.584 0-1.752.288-1.792.864a2.19 2.19 0 001.792.936 2.19 2.19 0 001.792-.936c-.04-.576-1.208-.864-1.792-.864z"
11
+ clipRule="evenodd"
12
+ />
13
+ <path
14
+ fillRule="evenodd"
15
+ d="M12 6.472V2.616L6 0 0 2.616v3.928c0 3.632 2.56 7.032 6 7.856.44-.104.864-.256 1.28-.44A4.778 4.778 0 0011.2 16c2.648 0 4.8-2.152 4.8-4.8a4.798 4.798 0 00-4-4.728zM6.4 11.2c0 .448.064.888.184 1.296a5.27 5.27 0 01-.584.24c-2.536-.8-4.4-3.392-4.4-6.192v-2.88L6 1.744l4.4 1.92v2.808a4.798 4.798 0 00-4 4.728zm4.8 3.2a3.2 3.2 0 110-6.4 3.2 3.2 0 110 6.4z"
16
+ clipRule="evenodd"
17
+ />
18
+ </svg>
19
+ )
20
+ }
21
+
22
+ export default SvgAssignAdmin
@@ -0,0 +1,13 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/assign-moderator.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgAssignModerator(props) {
5
+ return (
6
+ <svg {...props}>
7
+ <path d="M1.6 7.272v-3.76l4.8-1.8 4.8 1.8v2.952c.568.08 1.104.248 1.6.48V2.4L6.4 0 0 2.4v4.872C0 11.312 2.728 15.08 6.4 16c.024-.008.04-.016.064-.016a5.658 5.658 0 01-1.4-2.272C3.008 12.424 1.6 9.936 1.6 7.272z" />
8
+ <path d="M10.4 8c-2.208 0-4 1.792-4 4s1.792 4 4 4 4-1.792 4-4-1.792-4-4-4zm2.4 4.4h-2v2H10v-2H8v-.8h2v-2h.8v2h2v.8z" />
9
+ </svg>
10
+ )
11
+ }
12
+
13
+ export default SvgAssignModerator
@@ -1,4 +1,5 @@
1
1
  var en = {
2
+ menu: "Menu",
2
3
  viewInContacts: "View in Cozy Contacts",
3
4
  viewInDrive: "Open",
4
5
  modify: "Modify",
@@ -27,6 +28,7 @@ var en = {
27
28
  call: "Call"
28
29
  };
29
30
  var fr = {
31
+ menu: "Menu",
30
32
  viewInContacts: "Voir dans Cozy Contacts",
31
33
  viewInDrive: "Ouvrir",
32
34
  modify: "Modifier",
@@ -0,0 +1,5 @@
1
+ export default ActionsMenuButton;
2
+ declare function ActionsMenuButton({ docs, actions }: {
3
+ docs: any;
4
+ actions: any;
5
+ }): JSX.Element;
@@ -0,0 +1,49 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useState, useRef } from 'react';
3
+ import ActionsMenu from "cozy-ui/transpiled/react/ActionsMenu";
4
+ import { locales } from "cozy-ui/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales";
5
+ import Icon from "cozy-ui/transpiled/react/Icon";
6
+ import IconButton from "cozy-ui/transpiled/react/IconButton";
7
+ import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
8
+ import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
9
+ import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
10
+
11
+ var ActionsMenuButton = function ActionsMenuButton(_ref) {
12
+ var docs = _ref.docs,
13
+ actions = _ref.actions;
14
+
15
+ var _useState = useState(false),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ showActions = _useState2[0],
18
+ setShowActions = _useState2[1];
19
+
20
+ var actionsRef = useRef();
21
+ useExtendI18n(locales);
22
+
23
+ var _useI18n = useI18n(),
24
+ t = _useI18n.t;
25
+
26
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(IconButton, {
27
+ ref: actionsRef,
28
+ "arial-label": t('menu'),
29
+ onClick: function onClick() {
30
+ return setShowActions(true);
31
+ }
32
+ }, /*#__PURE__*/React.createElement(Icon, {
33
+ icon: DotsIcon
34
+ }))), showActions && /*#__PURE__*/React.createElement(ActionsMenu, {
35
+ open: true,
36
+ ref: actionsRef,
37
+ docs: docs,
38
+ actions: actions,
39
+ anchorOrigin: {
40
+ vertical: 'bottom',
41
+ horizontal: 'right'
42
+ },
43
+ onClose: function onClose() {
44
+ return setShowActions(false);
45
+ }
46
+ }));
47
+ };
48
+
49
+ export default ActionsMenuButton;
@@ -1,13 +1,6 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import React, { useRef, useState } from 'react';
1
+ import React from 'react';
3
2
  import ContactIdentity from "cozy-ui/transpiled/react/ContactsList/Contacts/ContactIdentity";
4
- import { locales } from "cozy-ui/transpiled/react/ContactsList/locales/withContactsListLocales";
5
- import ActionsMenu from "cozy-ui/transpiled/react/ActionsMenu";
6
- import Icon from "cozy-ui/transpiled/react/Icon";
7
- import IconButton from "cozy-ui/transpiled/react/IconButton";
8
- import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
9
- import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
10
- import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
3
+ import ActionsMenuButton from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuButton";
11
4
 
12
5
  var Cell = function Cell(_ref) {
13
6
  var row = _ref.row,
@@ -15,18 +8,6 @@ var Cell = function Cell(_ref) {
15
8
  cell = _ref.cell,
16
9
  actions = _ref.actions;
17
10
 
18
- var _useState = useState(false),
19
- _useState2 = _slicedToArray(_useState, 2),
20
- showActions = _useState2[0],
21
- setShowActions = _useState2[1];
22
-
23
- useExtendI18n(locales);
24
-
25
- var _useI18n = useI18n(),
26
- t = _useI18n.t;
27
-
28
- var actionsRef = useRef();
29
-
30
11
  if (column.id === 'fullname') {
31
12
  return /*#__PURE__*/React.createElement(ContactIdentity, {
32
13
  contact: row,
@@ -39,27 +20,10 @@ var Cell = function Cell(_ref) {
39
20
  return null;
40
21
  }
41
22
 
42
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(IconButton, {
43
- ref: actionsRef,
44
- "arial-label": t('menu'),
45
- onClick: function onClick() {
46
- return setShowActions(true);
47
- }
48
- }, /*#__PURE__*/React.createElement(Icon, {
49
- icon: DotsIcon
50
- }))), showActions && /*#__PURE__*/React.createElement(ActionsMenu, {
51
- open: true,
52
- ref: actionsRef,
23
+ return /*#__PURE__*/React.createElement(ActionsMenuButton, {
53
24
  docs: [row],
54
- actions: actions,
55
- anchorOrigin: {
56
- vertical: 'bottom',
57
- horizontal: 'right'
58
- },
59
- onClose: function onClose() {
60
- return setShowActions(false);
61
- }
62
- }));
25
+ actions: actions
26
+ });
63
27
  }
64
28
 
65
29
  return cell;
@@ -1,14 +1,12 @@
1
1
  var en = {
2
2
  empty: "EMPTY",
3
3
  me: "me",
4
- favorite: "favorites",
5
- menu: "Menu"
4
+ favorite: "favorites"
6
5
  };
7
6
  var fr = {
8
7
  empty: "VIDE",
9
8
  me: "moi",
10
- favorite: "favoris",
11
- menu: "Menu"
9
+ favorite: "favoris"
12
10
  };
13
11
  import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
14
12
  export var locales = {