cozy-ui 135.1.0 → 135.3.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 +20 -0
- package/assets/icons/ui/cross-circle.svg +1 -1
- package/assets/icons/ui/shield-clean.svg +1 -0
- package/assets/icons/ui/shield-infected.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsBar/Readme.md +61 -11
- package/react/ActionsBar/ResponsiveAction.jsx +3 -5
- package/react/ActionsBar/index.jsx +98 -71
- package/react/AppBar/index.js +66 -1
- package/react/Icon/Readme.md +5 -1
- package/react/Icons/CrossCircle.jsx +1 -4
- package/react/Icons/ShieldClean.jsx +12 -0
- package/react/Icons/ShieldInfected.jsx +13 -0
- package/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.js +16 -1
- package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +6 -0
- package/transpiled/react/ActionsBar/ResponsiveAction.js +3 -2
- package/transpiled/react/ActionsBar/index.js +37 -24
- package/transpiled/react/AppBar/index.d.ts +3 -2
- package/transpiled/react/AppBar/index.js +53 -1
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/CrossCircle.js +1 -2
- package/transpiled/react/Icons/ShieldClean.d.ts +2 -0
- package/transpiled/react/Icons/ShieldClean.js +13 -0
- package/transpiled/react/Icons/ShieldInfected.d.ts +2 -0
- package/transpiled/react/Icons/ShieldInfected.js +15 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +12 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.js +13 -1
- package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [135.3.0](https://github.com/cozy/cozy-ui/compare/v135.2.0...v135.3.0) (2026-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Remove fill attribute from cross-circle icon ([b949f88](https://github.com/cozy/cozy-ui/commit/b949f88))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Allow to customize icon in ActionsBar ([20788b7](https://github.com/cozy/cozy-ui/commit/20788b7))
|
|
12
|
+
* Allow to set color in ActionsBar and AppBar ([33721f0](https://github.com/cozy/cozy-ui/commit/33721f0))
|
|
13
|
+
|
|
14
|
+
# [135.2.0](https://github.com/cozy/cozy-ui/compare/v135.1.0...v135.2.0) (2026-01-14)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add antivirus icons ([9a906d2](https://github.com/cozy/cozy-ui/commit/9a906d2))
|
|
20
|
+
|
|
1
21
|
# [135.1.0](https://github.com/cozy/cozy-ui/compare/v135.0.0...v135.1.0) (2025-12-15)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.12 12 8 9.12 10.88 12 12 10.88 9.12 8 12 5.12 10.88 4 8 6.88 5.12 4 4 5.12 6.88 8 4 10.88 5.12 12ZM8 16a7.79 7.79 0 0 1-3.12-.63 8.079 8.079 0 0 1-2.54-1.71 8.08 8.08 0 0 1-1.71-2.54A7.79 7.79 0 0 1 0 8c0-1.107.21-2.147.63-3.12.42-.973.99-1.82 1.71-2.54A8.079 8.079 0 0 1 4.88.63 7.79 7.79 0 0 1 8 0a7.79 7.79 0 0 1 3.12.63c.973.42 1.82.99 2.54 1.71s1.29 1.567 1.71 2.54c.42.973.63 2.013.63 3.12a7.79 7.79 0 0 1-.63 3.12 8.08 8.08 0 0 1-1.71 2.54 8.08 8.08 0 0 1-2.54 1.71A7.79 7.79 0 0 1 8 16Z"
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.12 12 8 9.12 10.88 12 12 10.88 9.12 8 12 5.12 10.88 4 8 6.88 5.12 4 4 5.12 6.88 8 4 10.88 5.12 12ZM8 16a7.79 7.79 0 0 1-3.12-.63 8.079 8.079 0 0 1-2.54-1.71 8.08 8.08 0 0 1-1.71-2.54A7.79 7.79 0 0 1 0 8c0-1.107.21-2.147.63-3.12.42-.973.99-1.82 1.71-2.54A8.079 8.079 0 0 1 4.88.63 7.79 7.79 0 0 1 8 0a7.79 7.79 0 0 1 3.12.63c.973.42 1.82.99 2.54 1.71s1.29 1.567 1.71 2.54c.42.973.63 2.013.63 3.12a7.79 7.79 0 0 1-.63 3.12 8.08 8.08 0 0 1-1.71 2.54 8.08 8.08 0 0 1-2.54 1.71A7.79 7.79 0 0 1 8 16Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="15" height="16" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path d="M6.432 15.635c-.092 0-.178-.01-.257-.03a3.27 3.27 0 0 1-.237-.069c-1.782-.593-3.203-1.688-4.266-3.285C.61 10.655.052 8.933 0 7.085v-3.74c0-.33.096-.627.287-.89.191-.265.439-.456.742-.575L5.78.1C5.964.033 6.15 0 6.333 0c.185 0 .37.033.554.099l4.75 1.781c.304.119.551.31.743.574.191.264.287.56.287.89v3.741a7.922 7.922 0 0 1-.04.792 3.683 3.683 0 0 0-.752-.08 4.178 4.178 0 0 0-.831.08 8.356 8.356 0 0 0 .04-.792v-3.74l-4.75-1.781-4.75 1.78v3.741a7.52 7.52 0 0 0 1.345 4.355c.897 1.306 2.032 2.177 3.404 2.612.277-.092.548-.204.812-.336.264-.132.521-.284.772-.456v1.86a4.445 4.445 0 0 1-.406.179c-.139.053-.327.132-.564.238-.08.026-.162.049-.248.069-.085.02-.174.03-.267.03Zm3.74.08a.648.648 0 0 1-.474-.198.648.648 0 0 1-.198-.475v-2.613c0-.185.066-.343.198-.475a.648.648 0 0 1 .475-.198h.119v-.791c0-.436.155-.809.465-1.119.31-.31.683-.465 1.118-.465.435 0 .808.155 1.118.465.31.31.465.683.465 1.119v.791h.12c.184 0 .342.066.474.198.132.132.198.29.198.475v2.613a.648.648 0 0 1-.198.475.648.648 0 0 1-.475.198h-3.404Zm.911-3.959h1.584v-.791a.766.766 0 0 0-.228-.565.766.766 0 0 0-.564-.227.766.766 0 0 0-.564.227.766.766 0 0 0-.228.565v.791Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="13" height="16" viewBox="0 0 13 16" xmlns="http://www.w3.org/2000/svg"><path d="M6.333 0 0 2.375v4.821c0 3.998 2.7 7.727 6.333 8.637 3.634-.91 6.334-4.639 6.334-8.637V2.375L6.333 0Zm4.75 7.196c0 3.167-2.018 6.096-4.75 6.99-2.73-.894-4.75-3.815-4.75-6.99v-3.72l4.75-1.782 4.75 1.781v3.721Z"/><path d="M7.125 9.5H5.542v1.583h1.583V9.5Zm0-5.542H5.542v3.959h1.583V3.958Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
Use same actions as `<ActionsMenu />`.
|
|
2
2
|
|
|
3
|
+
### Demo
|
|
4
|
+
|
|
5
|
+
This demo showcases all ActionsBar features:
|
|
6
|
+
|
|
7
|
+
* **Selection management**: Add/remove selected documents
|
|
8
|
+
* **Color customization**: The `color` prop allows customizing the background color (supports `default`, `inherit`, `primary`, `secondary`, `transparent`, `error`, `warning`, `info`, `success`)
|
|
9
|
+
* **Icon customization**: The `IconComponent` prop allows replacing the entire icon component displayed next to the selection count on desktop. It receives no props and should render a complete React component (defaults to `<Icon icon={CheckCircleIcon} />`)
|
|
10
|
+
|
|
3
11
|
```jsx
|
|
4
12
|
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
5
13
|
import Buttons from 'cozy-ui/transpiled/react/Buttons'
|
|
6
|
-
import TrashIcon from 'cozy-ui/transpiled/react/Icons/Trash'
|
|
7
|
-
import RenameIcon from 'cozy-ui/transpiled/react/Icons/Rename'
|
|
8
|
-
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share'
|
|
9
14
|
import ActionsBar from 'cozy-ui/transpiled/react/ActionsBar'
|
|
15
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
16
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
10
17
|
import { makeActions, modify, emailTo, download, smsTo, call } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_id: 1,
|
|
14
|
-
type: 'file'
|
|
15
|
-
}
|
|
18
|
+
import StarIcon from 'cozy-ui/transpiled/react/Icons/Star'
|
|
19
|
+
import FlagIcon from 'cozy-ui/transpiled/react/Icons/FlagOutlined'
|
|
16
20
|
|
|
17
21
|
const doc = {
|
|
18
22
|
_id: 'id01',
|
|
@@ -21,7 +25,11 @@ const doc = {
|
|
|
21
25
|
email: [{ address: 'johndoe@cozy.cc' }],
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
initialState = {
|
|
28
|
+
initialState = {
|
|
29
|
+
selected: isTesting() ? [doc, doc] : [],
|
|
30
|
+
color: 'default',
|
|
31
|
+
icon: 'default'
|
|
32
|
+
}
|
|
25
33
|
|
|
26
34
|
const addSelected = () => setState(previousState => {
|
|
27
35
|
const arr = previousState.selected
|
|
@@ -37,16 +45,58 @@ const removeSelected = () => setState(previousState => {
|
|
|
37
45
|
|
|
38
46
|
const actions = makeActions([ modify, call, download, smsTo, emailTo ])
|
|
39
47
|
|
|
48
|
+
const colors = ['default', 'inherit', 'primary', 'secondary', 'error', 'warning', 'info', 'success']
|
|
49
|
+
|
|
50
|
+
const StarIconComponent = () => <Icon className="u-mr-1" icon={StarIcon} />
|
|
51
|
+
const FlagIconComponent = () => <Icon className="u-mr-1" icon={FlagIcon} />
|
|
52
|
+
|
|
53
|
+
const icons = {
|
|
54
|
+
default: undefined,
|
|
55
|
+
star: StarIconComponent,
|
|
56
|
+
flag: FlagIconComponent
|
|
57
|
+
}
|
|
58
|
+
|
|
40
59
|
;
|
|
41
60
|
|
|
42
61
|
<DemoProvider>
|
|
43
|
-
<
|
|
44
|
-
|
|
62
|
+
<div className="u-mb-1">
|
|
63
|
+
<Typography variant="subtitle1" className="u-mb-half">Selection</Typography>
|
|
64
|
+
<Buttons label="Add a selected document" className="u-mr-1" onClick={addSelected} />
|
|
65
|
+
<Buttons label="Remove a selected document" onClick={removeSelected} />
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div className="u-mb-1">
|
|
69
|
+
<Typography variant="subtitle1" className="u-mb-half">Color</Typography>
|
|
70
|
+
{colors.map(color => (
|
|
71
|
+
<Buttons
|
|
72
|
+
key={color}
|
|
73
|
+
label={color}
|
|
74
|
+
className="u-mr-half u-mb-half"
|
|
75
|
+
variant={state.color === color ? 'primary' : 'secondary'}
|
|
76
|
+
onClick={() => setState({ color })}
|
|
77
|
+
/>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div className="u-mb-1">
|
|
82
|
+
<Typography variant="subtitle1" className="u-mb-half">Icon (desktop only)</Typography>
|
|
83
|
+
{Object.keys(icons).map(iconName => (
|
|
84
|
+
<Buttons
|
|
85
|
+
key={iconName}
|
|
86
|
+
label={iconName}
|
|
87
|
+
className="u-mr-half"
|
|
88
|
+
variant={state.icon === iconName ? 'primary' : 'secondary'}
|
|
89
|
+
onClick={() => setState({ icon: iconName })}
|
|
90
|
+
/>
|
|
91
|
+
))}
|
|
92
|
+
</div>
|
|
45
93
|
|
|
46
94
|
{state.selected.length > 0 && (
|
|
47
95
|
<ActionsBar
|
|
48
96
|
actions={actions}
|
|
49
97
|
docs={state.selected}
|
|
98
|
+
color={state.color}
|
|
99
|
+
IconComponent={icons[state.icon]}
|
|
50
100
|
onClose={() => setState({selected: []})}
|
|
51
101
|
/>
|
|
52
102
|
)}
|
|
@@ -42,14 +42,12 @@ const ResponsiveAction = forwardRef(({ action, disabled, onClick }, ref) => {
|
|
|
42
42
|
<Button
|
|
43
43
|
ref={ref}
|
|
44
44
|
classes={styles}
|
|
45
|
-
variant="
|
|
45
|
+
variant="text"
|
|
46
|
+
color="inherit"
|
|
46
47
|
startIcon={<Icon icon={action.icon} />}
|
|
47
48
|
label={
|
|
48
49
|
isMobile ? (
|
|
49
|
-
<Typography
|
|
50
|
-
variant="caption"
|
|
51
|
-
color={disabled ? 'inherit' : 'textPrimary'}
|
|
52
|
-
>
|
|
50
|
+
<Typography variant="caption" color="inherit">
|
|
53
51
|
{action.label}
|
|
54
52
|
</Typography>
|
|
55
53
|
) : (
|
|
@@ -19,7 +19,6 @@ import DotsIcon from '../Icons/Dots'
|
|
|
19
19
|
import Toolbar from '../Toolbar'
|
|
20
20
|
import Typography from '../Typography'
|
|
21
21
|
import useBreakpoints from '../providers/Breakpoints'
|
|
22
|
-
import CozyTheme, { useCozyTheme } from '../providers/CozyTheme'
|
|
23
22
|
import { makeStyles } from '../styles'
|
|
24
23
|
|
|
25
24
|
const useStyles = makeStyles({
|
|
@@ -70,17 +69,20 @@ const useStyles = makeStyles({
|
|
|
70
69
|
})
|
|
71
70
|
})
|
|
72
71
|
|
|
73
|
-
const
|
|
72
|
+
const DefaultIcon = () => <Icon className="u-mr-1" icon={CheckCircleIcon} />
|
|
73
|
+
|
|
74
|
+
const SelectedCount = ({ docs, onClose, IconComponent }) => {
|
|
74
75
|
const { isMobile } = useBreakpoints()
|
|
75
76
|
const { t } = useI18n()
|
|
77
|
+
const SelectedIcon = IconComponent || DefaultIcon
|
|
76
78
|
|
|
77
79
|
if (isMobile)
|
|
78
80
|
return (
|
|
79
81
|
<Box
|
|
80
82
|
className="u-flex u-flex-items-center u-h-100 u-pr-1"
|
|
81
83
|
borderRadius="15px 0 0 0"
|
|
82
|
-
bgcolor="
|
|
83
|
-
color="primary
|
|
84
|
+
bgcolor="background.paper"
|
|
85
|
+
color="text.primary"
|
|
84
86
|
>
|
|
85
87
|
<IconButton color="inherit" onClick={onClose}>
|
|
86
88
|
<Icon icon={CrossCircleIcon} />
|
|
@@ -91,12 +93,8 @@ const SelectedCount = ({ docs, onClose }) => {
|
|
|
91
93
|
|
|
92
94
|
return (
|
|
93
95
|
<div className="u-flex u-flex-items-center u-h-100 u-ph-1">
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
icon={CheckCircleIcon}
|
|
97
|
-
color="var(--iconTextColor)"
|
|
98
|
-
/>
|
|
99
|
-
<Typography variant="body1" component="span">
|
|
96
|
+
<SelectedIcon />
|
|
97
|
+
<Typography variant="body1" component="span" color="inherit">
|
|
100
98
|
{t('selected_light', docs.length)}
|
|
101
99
|
</Typography>
|
|
102
100
|
</div>
|
|
@@ -108,10 +106,11 @@ const ActionsBar = ({
|
|
|
108
106
|
docs,
|
|
109
107
|
autoClose,
|
|
110
108
|
maxDesktopActions,
|
|
111
|
-
onClose
|
|
109
|
+
onClose,
|
|
110
|
+
color,
|
|
111
|
+
IconComponent
|
|
112
112
|
}) => {
|
|
113
113
|
const { isMobile } = useBreakpoints()
|
|
114
|
-
const { type } = useCozyTheme()
|
|
115
114
|
const anchorRef = useRef()
|
|
116
115
|
const [showMenu, setShowMenu] = useState(false)
|
|
117
116
|
const styles = useStyles({ isMobile })
|
|
@@ -138,65 +137,75 @@ const ActionsBar = ({
|
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
return (
|
|
141
|
-
<
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<Icon icon={DotsIcon} />
|
|
176
|
-
</IconButton>
|
|
177
|
-
)}
|
|
178
|
-
<ActionsMenu
|
|
179
|
-
ref={anchorRef}
|
|
180
|
-
open={showMenu}
|
|
140
|
+
<AppBar className={styles.appBar} position="fixed" color={color}>
|
|
141
|
+
<Toolbar
|
|
142
|
+
className={styles.toolbar}
|
|
143
|
+
variant={isMobile ? 'regular' : 'dense'}
|
|
144
|
+
disableGutters
|
|
145
|
+
>
|
|
146
|
+
{showDesktopCloseButton && (
|
|
147
|
+
<IconButton
|
|
148
|
+
className={styles.desktopCloseButton}
|
|
149
|
+
onClick={onClose}
|
|
150
|
+
color="inherit"
|
|
151
|
+
>
|
|
152
|
+
<Icon icon={CrossIcon} />
|
|
153
|
+
</IconButton>
|
|
154
|
+
)}
|
|
155
|
+
<SelectedCount
|
|
156
|
+
docs={docs}
|
|
157
|
+
onClose={onClose}
|
|
158
|
+
IconComponent={IconComponent}
|
|
159
|
+
/>
|
|
160
|
+
<div className={styles.actionsContainer}>
|
|
161
|
+
{/* actions displayed in the bar itself */}
|
|
162
|
+
<ActionsItems
|
|
163
|
+
docs={docs}
|
|
164
|
+
component={ResponsiveAction}
|
|
165
|
+
actions={barActions}
|
|
166
|
+
onClick={handleClick}
|
|
167
|
+
/>
|
|
168
|
+
|
|
169
|
+
{/* actions displayed in ActionsMenu */}
|
|
170
|
+
{menuActions.length > 0 && (
|
|
171
|
+
<>
|
|
172
|
+
{isMobile ? (
|
|
173
|
+
<ActionsItems
|
|
181
174
|
docs={docs}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
horizontal: 'left'
|
|
186
|
-
}}
|
|
187
|
-
componentsProps={{
|
|
188
|
-
actionsItems: {
|
|
189
|
-
onClick: handleClick
|
|
190
|
-
}
|
|
191
|
-
}}
|
|
192
|
-
onClose={() => setShowMenu(false)}
|
|
175
|
+
component={ResponsiveAction}
|
|
176
|
+
actions={otherAction}
|
|
177
|
+
onClick={() => setShowMenu(true)}
|
|
193
178
|
/>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
179
|
+
) : (
|
|
180
|
+
<IconButton
|
|
181
|
+
color="inherit"
|
|
182
|
+
ref={anchorRef}
|
|
183
|
+
onClick={() => setShowMenu(true)}
|
|
184
|
+
>
|
|
185
|
+
<Icon icon={DotsIcon} />
|
|
186
|
+
</IconButton>
|
|
187
|
+
)}
|
|
188
|
+
<ActionsMenu
|
|
189
|
+
ref={anchorRef}
|
|
190
|
+
open={showMenu}
|
|
191
|
+
docs={docs}
|
|
192
|
+
actions={menuActions}
|
|
193
|
+
anchorOrigin={{
|
|
194
|
+
vertical: 'bottom',
|
|
195
|
+
horizontal: 'left'
|
|
196
|
+
}}
|
|
197
|
+
componentsProps={{
|
|
198
|
+
actionsItems: {
|
|
199
|
+
onClick: handleClick
|
|
200
|
+
}
|
|
201
|
+
}}
|
|
202
|
+
onClose={() => setShowMenu(false)}
|
|
203
|
+
/>
|
|
204
|
+
</>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
</Toolbar>
|
|
208
|
+
</AppBar>
|
|
200
209
|
)
|
|
201
210
|
}
|
|
202
211
|
|
|
@@ -207,12 +216,30 @@ ActionsBar.propTypes = {
|
|
|
207
216
|
* Only works on desktop since maximum number is forced in mobile
|
|
208
217
|
*/
|
|
209
218
|
maxDesktopActions: PropTypes.number,
|
|
210
|
-
autoClose: PropTypes.bool
|
|
219
|
+
autoClose: PropTypes.bool,
|
|
220
|
+
color: PropTypes.oneOf([
|
|
221
|
+
'default',
|
|
222
|
+
'inherit',
|
|
223
|
+
'primary',
|
|
224
|
+
'secondary',
|
|
225
|
+
'transparent',
|
|
226
|
+
'error',
|
|
227
|
+
'warning',
|
|
228
|
+
'info',
|
|
229
|
+
'success'
|
|
230
|
+
]),
|
|
231
|
+
/**
|
|
232
|
+
* Custom React component to replace the default Icon with CheckCircleIcon
|
|
233
|
+
* displayed next to the selection count on desktop.
|
|
234
|
+
* The component will be rendered as-is, giving full control over the icon styling.
|
|
235
|
+
*/
|
|
236
|
+
IconComponent: PropTypes.elementType
|
|
211
237
|
}
|
|
212
238
|
|
|
213
239
|
ActionsBar.defaultProps = {
|
|
214
240
|
maxDesktopActions: 5,
|
|
215
|
-
autoClose: true
|
|
241
|
+
autoClose: true,
|
|
242
|
+
color: 'default'
|
|
216
243
|
}
|
|
217
244
|
|
|
218
245
|
export default withActionsLocales(ActionsBar)
|
package/react/AppBar/index.js
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
1
|
import MuiAppBar from '@material-ui/core/AppBar'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
import { makeStyles } from '../styles'
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles(theme => ({
|
|
8
|
+
colorError: {
|
|
9
|
+
backgroundColor: theme.palette.error.main,
|
|
10
|
+
color: theme.palette.error.contrastText
|
|
11
|
+
},
|
|
12
|
+
colorWarning: {
|
|
13
|
+
backgroundColor: theme.palette.warning.main,
|
|
14
|
+
color: theme.palette.warning.contrastText
|
|
15
|
+
},
|
|
16
|
+
colorInfo: {
|
|
17
|
+
backgroundColor: theme.palette.info.main,
|
|
18
|
+
color: theme.palette.info.contrastText
|
|
19
|
+
},
|
|
20
|
+
colorSuccess: {
|
|
21
|
+
backgroundColor: theme.palette.success.main,
|
|
22
|
+
color: theme.palette.success.contrastText
|
|
23
|
+
}
|
|
24
|
+
}))
|
|
25
|
+
|
|
26
|
+
const CUSTOM_COLOR_CLASSES = {
|
|
27
|
+
error: 'colorError',
|
|
28
|
+
warning: 'colorWarning',
|
|
29
|
+
info: 'colorInfo',
|
|
30
|
+
success: 'colorSuccess'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const AppBar = React.forwardRef(({ color, className, ...props }, ref) => {
|
|
34
|
+
const styles = useStyles()
|
|
35
|
+
const appBarColor = CUSTOM_COLOR_CLASSES[color] ? 'default' : color
|
|
36
|
+
const customColorClass = CUSTOM_COLOR_CLASSES[color]
|
|
37
|
+
? styles[CUSTOM_COLOR_CLASSES[color]]
|
|
38
|
+
: undefined
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<MuiAppBar
|
|
42
|
+
{...props}
|
|
43
|
+
ref={ref}
|
|
44
|
+
color={appBarColor}
|
|
45
|
+
className={`${className || ''} ${customColorClass || ''}`}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
AppBar.propTypes = {
|
|
51
|
+
color: PropTypes.oneOf([
|
|
52
|
+
'default',
|
|
53
|
+
'inherit',
|
|
54
|
+
'primary',
|
|
55
|
+
'secondary',
|
|
56
|
+
'transparent',
|
|
57
|
+
'error',
|
|
58
|
+
'warning',
|
|
59
|
+
'info',
|
|
60
|
+
'success'
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
AppBar.defaultProps = {
|
|
65
|
+
color: 'default'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default AppBar
|
package/react/Icon/Readme.md
CHANGED
|
@@ -304,6 +304,8 @@ import Setting from 'cozy-ui/transpiled/react/Icons/Setting'
|
|
|
304
304
|
import Share from 'cozy-ui/transpiled/react/Icons/Share'
|
|
305
305
|
import ShareCircle from 'cozy-ui/transpiled/react/Icons/ShareCircle'
|
|
306
306
|
import Shield from 'cozy-ui/transpiled/react/Icons/Shield'
|
|
307
|
+
import ShieldInfected from 'cozy-ui/transpiled/react/Icons/ShieldInfected'
|
|
308
|
+
import ShieldClean from 'cozy-ui/transpiled/react/Icons/ShieldClean'
|
|
307
309
|
import Shop from 'cozy-ui/transpiled/react/Icons/Shop'
|
|
308
310
|
import Sound from 'cozy-ui/transpiled/react/Icons/Sound'
|
|
309
311
|
import Spinner from 'cozy-ui/transpiled/react/Icons/Spinner'
|
|
@@ -592,6 +594,8 @@ const icons = [
|
|
|
592
594
|
Share,
|
|
593
595
|
ShareCircle,
|
|
594
596
|
Shield,
|
|
597
|
+
ShieldInfected,
|
|
598
|
+
ShieldClean,
|
|
595
599
|
Shop,
|
|
596
600
|
Sound,
|
|
597
601
|
Spinner,
|
|
@@ -1006,7 +1010,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
1006
1010
|
|
|
1007
1011
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
1008
1012
|
let i = 0
|
|
1009
|
-
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','database','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','expert','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','matrix','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','planet','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','send','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']
|
|
1013
|
+
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','database','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','expert','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','matrix','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','planet','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','send','server','setting','share-circle','share','shield','shield-infected','shield-clean','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']
|
|
1010
1014
|
;
|
|
1011
1015
|
|
|
1012
1016
|
<Grid container spacing={2}>
|
|
@@ -4,10 +4,7 @@ import React from 'react'
|
|
|
4
4
|
function SvgCrossCircle(props) {
|
|
5
5
|
return (
|
|
6
6
|
<svg viewBox="0 0 16 16" {...props}>
|
|
7
|
-
<path
|
|
8
|
-
d="M5.12 12L8 9.12 10.88 12 12 10.88 9.12 8 12 5.12 10.88 4 8 6.88 5.12 4 4 5.12 6.88 8 4 10.88 5.12 12zM8 16a7.79 7.79 0 01-3.12-.63 8.079 8.079 0 01-2.54-1.71 8.08 8.08 0 01-1.71-2.54A7.79 7.79 0 010 8c0-1.107.21-2.147.63-3.12.42-.973.99-1.82 1.71-2.54A8.079 8.079 0 014.88.63 7.79 7.79 0 018 0a7.79 7.79 0 013.12.63c.973.42 1.82.99 2.54 1.71s1.29 1.567 1.71 2.54c.42.973.63 2.013.63 3.12a7.79 7.79 0 01-.63 3.12 8.08 8.08 0 01-1.71 2.54 8.08 8.08 0 01-2.54 1.71A7.79 7.79 0 018 16z"
|
|
9
|
-
fill="#5F6368"
|
|
10
|
-
/>
|
|
7
|
+
<path d="M5.12 12L8 9.12 10.88 12 12 10.88 9.12 8 12 5.12 10.88 4 8 6.88 5.12 4 4 5.12 6.88 8 4 10.88 5.12 12zM8 16a7.79 7.79 0 01-3.12-.63 8.079 8.079 0 01-2.54-1.71 8.08 8.08 0 01-1.71-2.54A7.79 7.79 0 010 8c0-1.107.21-2.147.63-3.12.42-.973.99-1.82 1.71-2.54A8.079 8.079 0 014.88.63 7.79 7.79 0 018 0a7.79 7.79 0 013.12.63c.973.42 1.82.99 2.54 1.71s1.29 1.567 1.71 2.54c.42.973.63 2.013.63 3.12a7.79 7.79 0 01-.63 3.12 8.08 8.08 0 01-1.71 2.54 8.08 8.08 0 01-2.54 1.71A7.79 7.79 0 018 16z" />
|
|
11
8
|
</svg>
|
|
12
9
|
)
|
|
13
10
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/shield-clean.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgShieldClean(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 15 16" {...props}>
|
|
7
|
+
<path d="M6.432 15.635c-.092 0-.178-.01-.257-.03a3.27 3.27 0 01-.237-.069c-1.782-.593-3.203-1.688-4.266-3.285C.61 10.655.052 8.933 0 7.085v-3.74c0-.33.096-.627.287-.89a1.63 1.63 0 01.742-.575L5.78.1c.184-.067.37-.1.553-.1.185 0 .37.033.554.099l4.75 1.781c.304.119.551.31.743.574.191.264.287.56.287.89v3.741a7.922 7.922 0 01-.04.792 3.683 3.683 0 00-.752-.08 4.178 4.178 0 00-.831.08 8.356 8.356 0 00.04-.792v-3.74l-4.75-1.781-4.75 1.78v3.741a7.52 7.52 0 001.345 4.355c.897 1.306 2.032 2.177 3.404 2.612.277-.092.548-.204.812-.336.264-.132.521-.284.772-.456v1.86a4.445 4.445 0 01-.406.179 11.43 11.43 0 00-.564.238 2.99 2.99 0 01-.248.069c-.085.02-.174.03-.267.03zm3.74.08a.648.648 0 01-.474-.198.648.648 0 01-.198-.475v-2.613c0-.185.066-.343.198-.475a.648.648 0 01.475-.198h.119v-.791c0-.436.155-.809.465-1.119.31-.31.683-.465 1.118-.465.435 0 .808.155 1.118.465.31.31.465.683.465 1.119v.791h.12c.184 0 .342.066.474.198.132.132.198.29.198.475v2.613a.648.648 0 01-.198.475.648.648 0 01-.475.198h-3.404zm.911-3.959h1.584v-.791a.766.766 0 00-.228-.565.766.766 0 00-.564-.227.766.766 0 00-.564.227.766.766 0 00-.228.565v.791z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgShieldClean
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/shield-infected.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgShieldInfected(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 13 16" {...props}>
|
|
7
|
+
<path d="M6.333 0L0 2.375v4.821c0 3.998 2.7 7.727 6.333 8.637 3.634-.91 6.334-4.639 6.334-8.637V2.375L6.333 0zm4.75 7.196c0 3.167-2.018 6.096-4.75 6.99-2.73-.894-4.75-3.815-4.75-6.99v-3.72l4.75-1.782 4.75 1.781v3.721z" />
|
|
8
|
+
<path d="M7.125 9.5H5.542v1.583h1.583V9.5zm0-5.542H5.542v3.959h1.583V3.958z" />
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SvgShieldInfected
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
import merge from 'lodash/merge'
|
|
2
|
+
|
|
1
3
|
import { makeLightNormalOverrides } from './makeLightNormalOverrides'
|
|
2
4
|
|
|
3
5
|
export const makeDarkNormalOverrides = theme => {
|
|
4
|
-
|
|
6
|
+
const makeOverridesForDarkTheme = theme => ({
|
|
7
|
+
MuiAppBar: {
|
|
8
|
+
colorDefault: {
|
|
9
|
+
backgroundColor: theme.palette.primary.main
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const DarkNormalOverrides = merge(
|
|
15
|
+
makeLightNormalOverrides(theme),
|
|
16
|
+
makeOverridesForDarkTheme(theme)
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
return DarkNormalOverrides
|
|
5
20
|
}
|
|
@@ -9,6 +9,12 @@ import {
|
|
|
9
9
|
} from '../helpers'
|
|
10
10
|
|
|
11
11
|
export const makeLightNormalOverrides = theme => ({
|
|
12
|
+
MuiAppBar: {
|
|
13
|
+
colorDefault: {
|
|
14
|
+
backgroundColor: theme.palette.grey.A400,
|
|
15
|
+
color: theme.palette.primary.contrastText
|
|
16
|
+
}
|
|
17
|
+
},
|
|
12
18
|
MuiSelect: {
|
|
13
19
|
iconOutlined: {
|
|
14
20
|
top: 'auto',
|
|
@@ -46,13 +46,14 @@ var ResponsiveAction = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
46
46
|
return /*#__PURE__*/React.createElement(Button, {
|
|
47
47
|
ref: ref,
|
|
48
48
|
classes: styles,
|
|
49
|
-
variant: "
|
|
49
|
+
variant: "text",
|
|
50
|
+
color: "inherit",
|
|
50
51
|
startIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
51
52
|
icon: action.icon
|
|
52
53
|
}),
|
|
53
54
|
label: isMobile ? /*#__PURE__*/React.createElement(Typography, {
|
|
54
55
|
variant: "caption",
|
|
55
|
-
color:
|
|
56
|
+
color: "inherit"
|
|
56
57
|
}, action.label) : action.label,
|
|
57
58
|
disabled: disabled,
|
|
58
59
|
onClick: onClick
|