cozy-ui 135.2.0 → 135.4.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/article.svg +1 -0
- package/assets/icons/ui/cross-circle.svg +1 -1
- package/package.json +2 -3
- 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 +3 -1
- package/react/Icons/Article.jsx +12 -0
- package/react/Icons/CrossCircle.jsx +1 -4
- 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/Article.d.ts +2 -0
- package/transpiled/react/Icons/Article.js +14 -0
- package/transpiled/react/Icons/CrossCircle.js +1 -2
- 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.4.0](https://github.com/cozy/cozy-ui/compare/v135.3.0...v135.4.0) (2026-01-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add article icon :sparkles: ([9bd502a](https://github.com/cozy/cozy-ui/commit/9bd502a))
|
|
7
|
+
|
|
8
|
+
# [135.3.0](https://github.com/cozy/cozy-ui/compare/v135.2.0...v135.3.0) (2026-01-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Remove fill attribute from cross-circle icon ([b949f88](https://github.com/cozy/cozy-ui/commit/b949f88))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* Allow to customize icon in ActionsBar ([20788b7](https://github.com/cozy/cozy-ui/commit/20788b7))
|
|
19
|
+
* Allow to set color in ActionsBar and AppBar ([33721f0](https://github.com/cozy/cozy-ui/commit/33721f0))
|
|
20
|
+
|
|
1
21
|
# [135.2.0](https://github.com/cozy/cozy-ui/compare/v135.1.0...v135.2.0) (2026-01-14)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.611 0c1.588 0 2.351.147 3.144.572.72.384 1.289.953 1.673 1.673.425.793.572 1.556.572 3.144v5.222c0 1.588-.147 2.351-.572 3.144a4.032 4.032 0 0 1-1.673 1.673c-.793.425-1.556.572-3.144.572H5.39c-1.588 0-2.351-.147-3.144-.572a4.032 4.032 0 0 1-1.673-1.673C.147 12.962 0 12.2 0 10.611V5.39C0 3.8.147 3.038.572 2.245A4.031 4.031 0 0 1 2.245.572C3.038.147 3.8 0 5.389 0h5.222Zm0 1.455H5.39c-1.368 0-1.905.103-2.458.4-.466.248-.828.61-1.077 1.076-.296.553-.4 1.09-.4 2.458v5.222c0 1.368.104 1.905.4 2.458.25.466.61.828 1.077 1.077.553.296 1.09.4 2.458.4h5.222c1.368 0 1.905-.104 2.458-.4.466-.25.828-.61 1.077-1.077.296-.553.4-1.09.4-2.458V5.39c0-1.368-.104-1.905-.4-2.458a2.577 2.577 0 0 0-1.077-1.077c-.553-.296-1.09-.4-2.458-.4Zm-3.338 9.09a.727.727 0 1 1 0 1.455h-2.91a.727.727 0 1 1 0-1.454h2.91Zm4.363-3.272a.727.727 0 0 1 0 1.454H4.364a.727.727 0 1 1 0-1.454h7.272Zm0-3.273a.727.727 0 0 1 0 1.455H4.364a.727.727 0 0 1 0-1.455h7.272Z" fill="#424244"/></svg>
|
|
@@ -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>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui",
|
|
3
|
-
"version": "135.
|
|
3
|
+
"version": "135.4.0",
|
|
4
4
|
"description": "Cozy apps UI SDK",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -203,6 +203,5 @@
|
|
|
203
203
|
},
|
|
204
204
|
"browserslist": [
|
|
205
205
|
"extends browserslist-config-cozy"
|
|
206
|
-
]
|
|
207
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
206
|
+
]
|
|
208
207
|
}
|
|
@@ -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
|
@@ -71,6 +71,7 @@ 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 Article from 'cozy-ui/transpiled/react/Icons/Article'
|
|
74
75
|
import AssignAdmin from 'cozy-ui/transpiled/react/Icons/AssignAdmin'
|
|
75
76
|
import AssignModerator from 'cozy-ui/transpiled/react/Icons/AssignModerator'
|
|
76
77
|
import Assistant from 'cozy-ui/transpiled/react/Icons/Assistant'
|
|
@@ -361,6 +362,7 @@ const icons = [
|
|
|
361
362
|
Apple,
|
|
362
363
|
Archive,
|
|
363
364
|
ArrowUp,
|
|
365
|
+
Article,
|
|
364
366
|
AssignAdmin,
|
|
365
367
|
AssignModerator,
|
|
366
368
|
Assistant,
|
|
@@ -1010,7 +1012,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
1010
1012
|
|
|
1011
1013
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
1012
1014
|
let i = 0
|
|
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']
|
|
1015
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp', 'article', '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']
|
|
1014
1016
|
;
|
|
1015
1017
|
|
|
1016
1018
|
<Grid container spacing={2}>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/article.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgArticle(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<path d="M10.611 0c1.588 0 2.351.147 3.144.572.72.384 1.289.953 1.673 1.673.425.793.572 1.556.572 3.144v5.222c0 1.588-.147 2.351-.572 3.144a4.032 4.032 0 01-1.673 1.673c-.793.425-1.556.572-3.144.572H5.39c-1.588 0-2.351-.147-3.144-.572a4.032 4.032 0 01-1.673-1.673C.147 12.962 0 12.2 0 10.611V5.39C0 3.8.147 3.038.572 2.245A4.031 4.031 0 012.245.572C3.038.147 3.8 0 5.389 0h5.222zm0 1.455H5.39c-1.368 0-1.905.103-2.458.4a2.57 2.57 0 00-1.077 1.076c-.296.553-.4 1.09-.4 2.458v5.222c0 1.368.104 1.905.4 2.458.25.466.61.828 1.077 1.077.553.296 1.09.4 2.458.4h5.222c1.368 0 1.905-.104 2.458-.4.466-.25.828-.61 1.077-1.077.296-.553.4-1.09.4-2.458V5.39c0-1.368-.104-1.905-.4-2.458a2.577 2.577 0 00-1.077-1.077c-.553-.296-1.09-.4-2.458-.4zm-3.338 9.09a.727.727 0 110 1.455h-2.91a.727.727 0 110-1.454h2.91zm4.363-3.272a.727.727 0 010 1.454H4.364a.727.727 0 110-1.454h7.272zm0-3.273a.727.727 0 010 1.455H4.364a.727.727 0 010-1.455h7.272z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgArticle
|
|
@@ -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
|
}
|
|
@@ -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
|