cozy-ui 121.7.0 → 121.9.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 +26 -0
- package/dist/cozy-ui.min.css +2 -2
- package/dist/cozy-ui.utils.min.css +1 -1
- package/package.json +1 -1
- package/react/Badge/Readme.md +2 -2
- package/react/InfosBadge/index.jsx +12 -9
- package/react/MuiCozyTheme/makeTheme.jsx +2 -0
- package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +1 -0
- package/react/SquareAppIcon/Readme.md +9 -7
- package/react/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +9 -9
- package/react/SquareAppIcon/index.jsx +42 -18
- package/react/SquareAppIcon/styles.styl +7 -1
- package/react/SquareAppIcon/styles_twake.styl +136 -0
- package/react/Typography/Readme.md +1 -0
- package/react/providers/CozyTheme/DumbCozyTheme.jsx +1 -0
- package/react/providers/CozyTheme/index.jsx +7 -2
- package/stylus/settings/shadows.styl +3 -0
- package/stylus/settings/themes/light-normal.styl +0 -2
- package/stylus/utilities/bgcolor.styl +3 -0
- package/stylus/utilities/elevation.styl +3 -0
- package/theme/palette_twake.json +1 -1
- package/transpiled/react/InfosBadge/index.js +19 -21
- package/transpiled/react/MuiCozyTheme/makeTheme.js +2 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeDarkInvertedOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeDarkNormalOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeLightInvertedOverrides.d.ts +1 -0
- package/transpiled/react/MuiCozyTheme/overrides/twake/makeLightNormalOverrides.d.ts +1 -0
- package/transpiled/react/SquareAppIcon/index.js +44 -18
- package/transpiled/react/providers/CozyTheme/DumbCozyTheme.js +1 -0
- package/transpiled/react/providers/CozyTheme/index.d.ts +1 -0
- package/transpiled/react/providers/CozyTheme/index.js +3 -2
- package/transpiled/react/stylesheet.css +1 -1
|
@@ -7,6 +7,7 @@ import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon'
|
|
|
7
7
|
import CozyIcon from 'cozy-ui/transpiled/react/Icons/Cozy'
|
|
8
8
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
9
9
|
import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'
|
|
10
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
11
|
import cloudWallpaper from '../../docs/cloud-wallpaper.jpg'
|
|
11
12
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
12
13
|
|
|
@@ -18,7 +19,7 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
18
19
|
|
|
19
20
|
;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
<BreakpointsProvider>
|
|
22
23
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
|
|
23
24
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
24
25
|
<Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
|
|
@@ -44,10 +45,10 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
44
45
|
<SquareAppIcon name="Shortcut" variant="shortcut" hideShortcutBadge={isShortcutBadgeHide} />
|
|
45
46
|
</Grid>
|
|
46
47
|
<Grid item>
|
|
47
|
-
<SquareAppIcon IconContent={<Icon icon={CozyIcon} size=
|
|
48
|
+
<SquareAppIcon IconContent={<Icon icon={CozyIcon} size={isTwakeTheme() ? 32 : 48} />} name="Loading" variant={isLoading ? 'loading' : 'default'} />
|
|
48
49
|
</Grid>
|
|
49
50
|
<Grid item>
|
|
50
|
-
<SquareAppIcon IconContent={<Icon icon={CozyIcon} size=
|
|
51
|
+
<SquareAppIcon IconContent={<Icon icon={CozyIcon} size={isTwakeTheme() ? 32 : 48} />} name="Loading" variant={isError ? 'error' : 'loading'} />
|
|
51
52
|
</Grid>
|
|
52
53
|
<Grid item>
|
|
53
54
|
<SquareAppIcon name="Shortcut" variant="shortcut" IconContent={<img
|
|
@@ -63,7 +64,7 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
63
64
|
/>} hideShortcutBadge={isShortcutBadgeHide} />
|
|
64
65
|
</Grid>
|
|
65
66
|
<Grid item>
|
|
66
|
-
<SquareAppIcon name="Custom Icon" IconContent={<Icon icon={CozyIcon} size=
|
|
67
|
+
<SquareAppIcon name="Custom Icon" IconContent={<Icon icon={CozyIcon} size={isTwakeTheme() ? 32 : 48} />} />
|
|
67
68
|
</Grid>
|
|
68
69
|
<Grid item>
|
|
69
70
|
<SquareAppIcon name="Icon Grid" IconContent={(
|
|
@@ -84,7 +85,7 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
84
85
|
)} />
|
|
85
86
|
</Grid>
|
|
86
87
|
</Grid>
|
|
87
|
-
|
|
88
|
+
</BreakpointsProvider>
|
|
88
89
|
```
|
|
89
90
|
|
|
90
91
|
### Using the "detailed" display mode
|
|
@@ -98,6 +99,7 @@ import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon'
|
|
|
98
99
|
import CozyIcon from 'cozy-ui/transpiled/react/Icons/Cozy'
|
|
99
100
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
100
101
|
import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'
|
|
102
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
101
103
|
import cloudWallpaper from '../../docs/cloud-wallpaper.jpg'
|
|
102
104
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
103
105
|
|
|
@@ -109,7 +111,7 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
109
111
|
|
|
110
112
|
;
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
<BreakpointsProvider>
|
|
113
115
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
|
|
114
116
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
115
117
|
<Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
|
|
@@ -179,5 +181,5 @@ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
|
179
181
|
IconContent={<Icon icon={CozyIcon} size="48" />} />
|
|
180
182
|
</Grid>
|
|
181
183
|
</Grid>
|
|
182
|
-
|
|
184
|
+
</BreakpointsProvider>
|
|
183
185
|
```
|
|
@@ -37,7 +37,7 @@ exports[`SquareAppIcon component should render an app correctly with the app nam
|
|
|
37
37
|
/>
|
|
38
38
|
</span>
|
|
39
39
|
<span
|
|
40
|
-
class="MuiBadge-badge-43
|
|
40
|
+
class="MuiBadge-badge-43 makeStyles-qualifier-41 MuiBadge-anchorOriginBottomRightRectangular-51 MuiBadge-invisible-64"
|
|
41
41
|
/>
|
|
42
42
|
</span>
|
|
43
43
|
</div>
|
|
@@ -86,7 +86,7 @@ exports[`SquareAppIcon component should render an app correctly with the given n
|
|
|
86
86
|
/>
|
|
87
87
|
</span>
|
|
88
88
|
<span
|
|
89
|
-
class="MuiBadge-badge-11
|
|
89
|
+
class="MuiBadge-badge-11 makeStyles-qualifier-9 MuiBadge-anchorOriginBottomRightRectangular-19 MuiBadge-invisible-32"
|
|
90
90
|
/>
|
|
91
91
|
</span>
|
|
92
92
|
</div>
|
|
@@ -135,7 +135,7 @@ exports[`SquareAppIcon component should render an app with the app slug if no na
|
|
|
135
135
|
/>
|
|
136
136
|
</span>
|
|
137
137
|
<span
|
|
138
|
-
class="MuiBadge-badge-75
|
|
138
|
+
class="MuiBadge-badge-75 makeStyles-qualifier-73 MuiBadge-anchorOriginBottomRightRectangular-83 MuiBadge-invisible-96"
|
|
139
139
|
/>
|
|
140
140
|
</span>
|
|
141
141
|
</div>
|
|
@@ -191,7 +191,7 @@ exports[`SquareAppIcon component should render correctly an app in add state 1`]
|
|
|
191
191
|
/>
|
|
192
192
|
</span>
|
|
193
193
|
<span
|
|
194
|
-
class="MuiBadge-badge-203
|
|
194
|
+
class="MuiBadge-badge-203 makeStyles-qualifier-201 MuiBadge-anchorOriginBottomRightRectangular-211 MuiBadge-invisible-224"
|
|
195
195
|
/>
|
|
196
196
|
</span>
|
|
197
197
|
</div>
|
|
@@ -250,7 +250,7 @@ exports[`SquareAppIcon component should render correctly an app in error state 1
|
|
|
250
250
|
</span>
|
|
251
251
|
</span>
|
|
252
252
|
<span
|
|
253
|
-
class="MuiBadge-badge-171
|
|
253
|
+
class="MuiBadge-badge-171 makeStyles-qualifier-169 MuiBadge-anchorOriginBottomRightRectangular-179 MuiBadge-invisible-192"
|
|
254
254
|
/>
|
|
255
255
|
</span>
|
|
256
256
|
</div>
|
|
@@ -299,7 +299,7 @@ exports[`SquareAppIcon component should render correctly an app in ghost state 1
|
|
|
299
299
|
/>
|
|
300
300
|
</span>
|
|
301
301
|
<span
|
|
302
|
-
class="MuiBadge-badge-139
|
|
302
|
+
class="MuiBadge-badge-139 makeStyles-qualifier-137 MuiBadge-anchorOriginBottomRightRectangular-147 MuiBadge-invisible-160"
|
|
303
303
|
/>
|
|
304
304
|
</span>
|
|
305
305
|
</div>
|
|
@@ -348,7 +348,7 @@ exports[`SquareAppIcon component should render correctly an app in maintenance s
|
|
|
348
348
|
/>
|
|
349
349
|
</span>
|
|
350
350
|
<span
|
|
351
|
-
class="MuiBadge-badge-107
|
|
351
|
+
class="MuiBadge-badge-107 makeStyles-qualifier-105 MuiBadge-anchorOriginBottomRightRectangular-115 MuiBadge-invisible-128"
|
|
352
352
|
/>
|
|
353
353
|
</span>
|
|
354
354
|
</div>
|
|
@@ -385,7 +385,7 @@ exports[`SquareAppIcon component should render correctly an app in shortcut stat
|
|
|
385
385
|
/>
|
|
386
386
|
</span>
|
|
387
387
|
<span
|
|
388
|
-
class="MuiBadge-badge-235
|
|
388
|
+
class="MuiBadge-badge-235 makeStyles-qualifier-233 MuiBadge-anchorOriginBottomRightRectangular-243"
|
|
389
389
|
>
|
|
390
390
|
<svg
|
|
391
391
|
class="styles__icon___23x3R"
|
|
@@ -447,7 +447,7 @@ exports[`SquareAppIcon component should render correctly an app with custom cont
|
|
|
447
447
|
/>
|
|
448
448
|
</span>
|
|
449
449
|
<span
|
|
450
|
-
class="MuiBadge-badge-329
|
|
450
|
+
class="MuiBadge-badge-329 makeStyles-qualifier-327 MuiBadge-anchorOriginBottomRightRectangular-337 MuiBadge-invisible-350"
|
|
451
451
|
/>
|
|
452
452
|
</span>
|
|
453
453
|
</div>
|
|
@@ -5,7 +5,8 @@ import React, { useEffect, useState } from 'react'
|
|
|
5
5
|
|
|
6
6
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import stylesCozy from './styles.styl'
|
|
9
|
+
import stylesTwake from './styles_twake.styl'
|
|
9
10
|
import AppIcon from '../AppIcon'
|
|
10
11
|
import Badge from '../Badge'
|
|
11
12
|
import Icon from '../Icon'
|
|
@@ -17,17 +18,31 @@ import iconWarning from '../Icons/WarningCircle'
|
|
|
17
18
|
import InfosBadge from '../InfosBadge'
|
|
18
19
|
import Spinner from '../Spinner'
|
|
19
20
|
import Typography from '../Typography'
|
|
21
|
+
import { isTwakeTheme } from '../helpers/isTwakeTheme'
|
|
20
22
|
import { nameToColor } from '../legacy/Avatar/helpers'
|
|
23
|
+
import { useBreakpoints } from '../providers/Breakpoints'
|
|
21
24
|
import CozyTheme, { useCozyTheme } from '../providers/CozyTheme'
|
|
22
25
|
import { alpha, makeStyles } from '../styles'
|
|
23
26
|
|
|
27
|
+
const styles = isTwakeTheme() ? stylesTwake : stylesCozy
|
|
28
|
+
|
|
29
|
+
const makeTwakeColor = theme =>
|
|
30
|
+
theme.variant === 'inverted' || theme.type === 'dark'
|
|
31
|
+
? 'var(--white)'
|
|
32
|
+
: 'var(--black)'
|
|
33
|
+
|
|
24
34
|
const useStyles = makeStyles(theme => ({
|
|
25
35
|
name: {
|
|
26
|
-
color: 'var(--primaryTextColor)',
|
|
36
|
+
color: isTwakeTheme() ? makeTwakeColor(theme) : 'var(--primaryTextColor)',
|
|
37
|
+
textShadow: isTwakeTheme()
|
|
38
|
+
? theme.variant === 'inverted' || theme.type === 'dark'
|
|
39
|
+
? '0px 0px 10px rgba(0, 0, 0, 0.10), 0px 0px 2px rgba(0, 0, 0, 0.20), 0.5px 0.5px 1px rgba(0, 0, 0, 0.50)'
|
|
40
|
+
: undefined
|
|
41
|
+
: undefined,
|
|
27
42
|
width: '5.5rem',
|
|
28
43
|
textAlign: 'center',
|
|
29
|
-
fontSize: '0.875rem',
|
|
30
|
-
lineHeight: '1.188rem',
|
|
44
|
+
fontSize: isTwakeTheme() ? undefined : '0.875rem',
|
|
45
|
+
lineHeight: isTwakeTheme() ? undefined : '1.188rem',
|
|
31
46
|
margin: '0.5rem 0.25rem 0 0.25rem',
|
|
32
47
|
lineClamp: '2',
|
|
33
48
|
boxOrient: 'vertical',
|
|
@@ -35,8 +50,8 @@ const useStyles = makeStyles(theme => ({
|
|
|
35
50
|
height: '2.375rem',
|
|
36
51
|
[theme.breakpoints.down('sm')]: {
|
|
37
52
|
width: '3.75rem',
|
|
38
|
-
fontSize: '0.6875rem',
|
|
39
|
-
lineHeight: '1rem',
|
|
53
|
+
fontSize: isTwakeTheme() ? undefined : '0.6875rem',
|
|
54
|
+
lineHeight: isTwakeTheme() ? undefined : '1rem',
|
|
40
55
|
margin: '0.25rem 0.25rem 0 0.25rem',
|
|
41
56
|
height: '2rem'
|
|
42
57
|
}
|
|
@@ -59,7 +74,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
59
74
|
margin: 'auto'
|
|
60
75
|
},
|
|
61
76
|
shadow: {
|
|
62
|
-
boxShadow: theme.shadows[1]
|
|
77
|
+
boxShadow: isTwakeTheme() ? undefined : theme.shadows[1]
|
|
63
78
|
},
|
|
64
79
|
errorIcon: {
|
|
65
80
|
fill: 'var(--errorColor)',
|
|
@@ -71,9 +86,9 @@ const useStyles = makeStyles(theme => ({
|
|
|
71
86
|
display: 'flex',
|
|
72
87
|
flexDirection: 'column',
|
|
73
88
|
alignItems: 'center',
|
|
74
|
-
|
|
89
|
+
minWidth: '6rem',
|
|
75
90
|
[theme.breakpoints.down('sm')]: {
|
|
76
|
-
|
|
91
|
+
minWidth: '4.25rem'
|
|
77
92
|
}
|
|
78
93
|
},
|
|
79
94
|
detailedTileWrapper: {
|
|
@@ -104,6 +119,7 @@ export const SquareAppIcon = ({
|
|
|
104
119
|
...appIconProps
|
|
105
120
|
}) => {
|
|
106
121
|
const { variant: themeVariant } = useCozyTheme()
|
|
122
|
+
const { isMobile } = useBreakpoints()
|
|
107
123
|
const classes = useStyles()
|
|
108
124
|
const appName =
|
|
109
125
|
name || get(appIconProps, 'app.name') || get(appIconProps, 'app') || ''
|
|
@@ -126,7 +142,9 @@ export const SquareAppIcon = ({
|
|
|
126
142
|
prevVariant.current = variant
|
|
127
143
|
}, [variant])
|
|
128
144
|
|
|
129
|
-
const
|
|
145
|
+
const exceptionVariant = [isTwakeTheme() ? 'ghost' : 'add', 'ghost']
|
|
146
|
+
|
|
147
|
+
const squareTheme = exceptionVariant.includes(variant)
|
|
130
148
|
? themeVariant
|
|
131
149
|
: 'normal'
|
|
132
150
|
|
|
@@ -157,16 +175,15 @@ export const SquareAppIcon = ({
|
|
|
157
175
|
styles['SquareAppIcon-wrapper'],
|
|
158
176
|
styles[`SquareAppIcon-wrapper-${variant}`],
|
|
159
177
|
{
|
|
160
|
-
[classes.squareAppIconGhost]:
|
|
161
|
-
variant
|
|
162
|
-
)
|
|
163
|
-
[classes.shadow]: !['add', 'ghost'].includes(variant)
|
|
178
|
+
[classes.squareAppIconGhost]:
|
|
179
|
+
exceptionVariant.includes(variant),
|
|
180
|
+
[classes.shadow]: !exceptionVariant.includes(variant)
|
|
164
181
|
}
|
|
165
182
|
)}
|
|
166
183
|
badgeContent={
|
|
167
184
|
variant === 'error' ? (
|
|
168
185
|
<Icon
|
|
169
|
-
size=
|
|
186
|
+
size={16}
|
|
170
187
|
className={cx(classes.errorIcon)}
|
|
171
188
|
icon={iconWarning}
|
|
172
189
|
/>
|
|
@@ -180,7 +197,10 @@ export const SquareAppIcon = ({
|
|
|
180
197
|
overlap="rectangular"
|
|
181
198
|
style={
|
|
182
199
|
variant === 'shortcut' && !IconContent
|
|
183
|
-
? {
|
|
200
|
+
? {
|
|
201
|
+
[isTwakeTheme() ? 'background' : 'backgroundColor']:
|
|
202
|
+
nameToColor(name)
|
|
203
|
+
}
|
|
184
204
|
: null
|
|
185
205
|
}
|
|
186
206
|
>
|
|
@@ -209,7 +229,7 @@ export const SquareAppIcon = ({
|
|
|
209
229
|
>
|
|
210
230
|
{animationState && (
|
|
211
231
|
<Icon
|
|
212
|
-
size=
|
|
232
|
+
size={32}
|
|
213
233
|
icon={
|
|
214
234
|
animationState === 'success'
|
|
215
235
|
? IconCheckAnimated
|
|
@@ -223,6 +243,10 @@ export const SquareAppIcon = ({
|
|
|
223
243
|
<Icon icon={iconPlus} color="var(--primaryColor)" />
|
|
224
244
|
) : IconContent ? (
|
|
225
245
|
IconContent
|
|
246
|
+
) : isTwakeTheme() ? (
|
|
247
|
+
<div className="u-w-1-half-s u-h-1-half-s u-w-2 u-h-2">
|
|
248
|
+
<AppIcon {...appIconProps} />
|
|
249
|
+
</div>
|
|
226
250
|
) : (
|
|
227
251
|
<AppIcon {...appIconProps} />
|
|
228
252
|
)}
|
|
@@ -240,7 +264,7 @@ export const SquareAppIcon = ({
|
|
|
240
264
|
{ [classes.nameInverted]: themeVariant === 'inverted' },
|
|
241
265
|
'u-spacellipsis'
|
|
242
266
|
)}
|
|
243
|
-
variant=
|
|
267
|
+
variant={isTwakeTheme() ? (isMobile ? 'overline' : 'h6') : 'h6'}
|
|
244
268
|
align="center"
|
|
245
269
|
>
|
|
246
270
|
{appName}
|
|
@@ -5,7 +5,6 @@ $iconSize = constants['iconSize']
|
|
|
5
5
|
$iconPadding = constants['iconPadding']
|
|
6
6
|
$mobileIconSize = constants['mobileIconSize']
|
|
7
7
|
$mobileIconPadding = constants['mobileIconPadding']
|
|
8
|
-
$color = constants['color'] // hard-coded color, because the component is currently only used in the Home
|
|
9
8
|
|
|
10
9
|
.SquareAppIcon-wrapper
|
|
11
10
|
box-sizing border-box
|
|
@@ -26,30 +25,37 @@ $color = constants['color'] // hard-coded color, because the component is curren
|
|
|
26
25
|
padding $iconPadding
|
|
27
26
|
border-radius rem(12)
|
|
28
27
|
width 100%
|
|
28
|
+
|
|
29
29
|
+small-screen()
|
|
30
30
|
padding $mobileIconPadding
|
|
31
|
+
|
|
31
32
|
svg, img
|
|
32
33
|
width 100%
|
|
33
34
|
|
|
34
35
|
.SquareAppIcon-wrapper-ghost
|
|
35
36
|
.SquareAppIcon-icon-container
|
|
36
37
|
mix-blend-mode screen
|
|
38
|
+
|
|
37
39
|
svg, img
|
|
38
40
|
filter saturate(0%)
|
|
41
|
+
|
|
39
42
|
.SquareAppIcon-icon-container-normal
|
|
40
43
|
mix-blend-mode luminosity
|
|
44
|
+
|
|
41
45
|
svg, img
|
|
42
46
|
opacity .5
|
|
43
47
|
|
|
44
48
|
.SquareAppIcon-wrapper-maintenance
|
|
45
49
|
.SquareAppIcon-icon-container
|
|
46
50
|
mix-blend-mode luminosity
|
|
51
|
+
|
|
47
52
|
svg, img
|
|
48
53
|
opacity .5
|
|
49
54
|
|
|
50
55
|
.SquareAppIcon-wrapper-loading
|
|
51
56
|
border-radius 50%
|
|
52
57
|
transform scale(0.875)
|
|
58
|
+
|
|
53
59
|
+small-screen()
|
|
54
60
|
transform scale(0.8334)
|
|
55
61
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
@require 'settings/breakpoints.styl'
|
|
2
|
+
constants=json('constants.json', { hash: true })
|
|
3
|
+
|
|
4
|
+
$iconSize = constants['iconSize']
|
|
5
|
+
$iconPadding = constants['iconPadding']
|
|
6
|
+
$mobileIconSize = constants['mobileIconSize']
|
|
7
|
+
$mobileIconPadding = constants['mobileIconPadding']
|
|
8
|
+
|
|
9
|
+
.SquareAppIcon-wrapper
|
|
10
|
+
box-sizing border-box
|
|
11
|
+
background linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.09) 100%), rgba(255, 251, 254, 0.80) // we don't want to be theme responsive
|
|
12
|
+
border-radius 100%
|
|
13
|
+
height $iconSize
|
|
14
|
+
width $iconSize
|
|
15
|
+
transition transform 300ms, border-radius 300ms
|
|
16
|
+
|
|
17
|
+
+small-screen()
|
|
18
|
+
height $mobileIconSize
|
|
19
|
+
width $mobileIconSize
|
|
20
|
+
|
|
21
|
+
.SquareAppIcon-icon-container
|
|
22
|
+
display flex
|
|
23
|
+
align-items center
|
|
24
|
+
justify-content center
|
|
25
|
+
padding $iconPadding
|
|
26
|
+
border-radius 100%
|
|
27
|
+
width 100%
|
|
28
|
+
|
|
29
|
+
+small-screen()
|
|
30
|
+
padding $mobileIconPadding
|
|
31
|
+
|
|
32
|
+
svg, img
|
|
33
|
+
width 100%
|
|
34
|
+
|
|
35
|
+
.SquareAppIcon-wrapper-ghost
|
|
36
|
+
.SquareAppIcon-icon-container
|
|
37
|
+
mix-blend-mode screen
|
|
38
|
+
|
|
39
|
+
svg, img
|
|
40
|
+
filter saturate(0%)
|
|
41
|
+
|
|
42
|
+
.SquareAppIcon-icon-container-normal
|
|
43
|
+
mix-blend-mode luminosity
|
|
44
|
+
|
|
45
|
+
svg, img
|
|
46
|
+
opacity .5
|
|
47
|
+
|
|
48
|
+
.SquareAppIcon-wrapper-maintenance
|
|
49
|
+
.SquareAppIcon-icon-container
|
|
50
|
+
mix-blend-mode luminosity
|
|
51
|
+
|
|
52
|
+
svg, img
|
|
53
|
+
opacity .5
|
|
54
|
+
|
|
55
|
+
.SquareAppIcon-wrapper-loading
|
|
56
|
+
border-radius 50%
|
|
57
|
+
transform scale(0.875)
|
|
58
|
+
|
|
59
|
+
+small-screen()
|
|
60
|
+
transform scale(0.8334)
|
|
61
|
+
|
|
62
|
+
.SquareAppIcon-spinner
|
|
63
|
+
margin 0 !important
|
|
64
|
+
|
|
65
|
+
svg
|
|
66
|
+
position absolute
|
|
67
|
+
height 100%
|
|
68
|
+
width 100%
|
|
69
|
+
|
|
70
|
+
animation-duration = 1.50s
|
|
71
|
+
icon-duration = 0.2s
|
|
72
|
+
icon-start = 0.2s
|
|
73
|
+
border-radius-start = 50%
|
|
74
|
+
border-radius-end = 100%
|
|
75
|
+
opacity-start = 0
|
|
76
|
+
opacity-end = 1
|
|
77
|
+
|
|
78
|
+
.onEnd
|
|
79
|
+
align-items center
|
|
80
|
+
border-radius border-radius-start
|
|
81
|
+
display flex
|
|
82
|
+
height 100%
|
|
83
|
+
opacity opacity-start
|
|
84
|
+
position absolute
|
|
85
|
+
width 100%
|
|
86
|
+
z-index 1
|
|
87
|
+
|
|
88
|
+
svg
|
|
89
|
+
fill transparent !important
|
|
90
|
+
|
|
91
|
+
path
|
|
92
|
+
animation-duration icon-duration !important
|
|
93
|
+
|
|
94
|
+
path:first-of-type
|
|
95
|
+
animation-delay icon-start !important
|
|
96
|
+
|
|
97
|
+
// The second path is a part of the cross,
|
|
98
|
+
// since it has its own hardcoded animation delay we need to add it again (.16s)
|
|
99
|
+
path+path
|
|
100
|
+
animation-delay icon-start + .16s !important
|
|
101
|
+
|
|
102
|
+
*
|
|
103
|
+
stroke var(--white) !important
|
|
104
|
+
|
|
105
|
+
.onEnd.isFailed
|
|
106
|
+
--animationColor var(--errorColor)
|
|
107
|
+
|
|
108
|
+
.onEnd.isSuccess
|
|
109
|
+
--animationColor var(--successColor)
|
|
110
|
+
|
|
111
|
+
.isSuccess
|
|
112
|
+
.isFailed
|
|
113
|
+
animation end-animation animation-duration forwards
|
|
114
|
+
|
|
115
|
+
@keyframes end-animation {
|
|
116
|
+
0% {
|
|
117
|
+
background-color transparent
|
|
118
|
+
border-radius border-radius-start
|
|
119
|
+
opacity opacity-start
|
|
120
|
+
}
|
|
121
|
+
13.33% {
|
|
122
|
+
background-color var(--animationColor)
|
|
123
|
+
border-radius border-radius-end
|
|
124
|
+
opacity opacity-end
|
|
125
|
+
}
|
|
126
|
+
66.67% {
|
|
127
|
+
background-color var(--animationColor)
|
|
128
|
+
border-radius border-radius-end
|
|
129
|
+
opacity opacity-end
|
|
130
|
+
}
|
|
131
|
+
100% {
|
|
132
|
+
border-radius border-radius-end
|
|
133
|
+
opacity opacity-start
|
|
134
|
+
background-color transparent
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -10,7 +10,7 @@ import { isRsg } from '../../hooks/useSetFlagshipUi/helpers'
|
|
|
10
10
|
export const CozyThemeContext = createContext()
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean }}
|
|
13
|
+
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean, name: 'Twake'|'Cozy' }}
|
|
14
14
|
*/
|
|
15
15
|
export const useCozyTheme = () => {
|
|
16
16
|
const context = useContext(CozyThemeContext)
|
|
@@ -21,7 +21,12 @@ export const useCozyTheme = () => {
|
|
|
21
21
|
'`CozyThemeContext` is missing. `useCozyTheme()` must be used within a `<CozyTheme>`. `light normal` is returned as fallback value.'
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
type: 'light',
|
|
26
|
+
variant: 'normal',
|
|
27
|
+
isLight: true,
|
|
28
|
+
name: 'Cozy'
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
return context
|
|
@@ -243,8 +243,6 @@ html,
|
|
|
243
243
|
--shadow25 0px 1px 4px alpha($shadowColor, 0.04)
|
|
244
244
|
|
|
245
245
|
.TwakeTheme--light-normal
|
|
246
|
-
--primaryFont Inter
|
|
247
|
-
|
|
248
246
|
--primaryColorLightest paletteTwake.Primary['100']
|
|
249
247
|
--primaryColorLight paletteTwake.Primary['200']
|
|
250
248
|
--primaryColor paletteTwake.Primary['600']
|
package/theme/palette_twake.json
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["classes"]
|
|
4
|
-
_excluded2 = ["qualifier"];
|
|
3
|
+
var _excluded = ["classes"];
|
|
5
4
|
import cx from 'classnames';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
import Badge from "cozy-ui/transpiled/react/Badge";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
7
|
+
import { isTwakeTheme } from "cozy-ui/transpiled/react/helpers/isTwakeTheme";
|
|
8
|
+
import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
9
|
+
var useStyles = makeStyles({
|
|
10
|
+
qualifier: {
|
|
11
|
+
height: isTwakeTheme() ? '24px' : '1.125rem',
|
|
12
|
+
// compensation of the specific border size
|
|
13
|
+
minWidth: isTwakeTheme() ? '24px' : '1.125rem',
|
|
14
|
+
backgroundColor: 'var(--paperBackgroundColor)',
|
|
15
|
+
color: 'var(--iconTextColor)',
|
|
16
|
+
border: isTwakeTheme() ? undefined : '1px solid var(--borderMainColor)',
|
|
17
|
+
boxShadow: isTwakeTheme() ? 'var(--shadow3)' : undefined
|
|
18
|
+
}
|
|
19
|
+
});
|
|
22
20
|
|
|
23
|
-
var InfosBadge =
|
|
21
|
+
var InfosBadge = function InfosBadge(_ref) {
|
|
24
22
|
var classes = _ref.classes,
|
|
25
23
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
24
|
|
|
27
|
-
var
|
|
28
|
-
customClasses = _objectWithoutProperties(classes, _excluded2);
|
|
25
|
+
var _classes = useStyles();
|
|
29
26
|
|
|
30
27
|
return /*#__PURE__*/React.createElement(Badge, _extends({
|
|
31
28
|
classes: {
|
|
32
|
-
badge: cx(qualifier,
|
|
29
|
+
badge: cx(_classes.qualifier, classes)
|
|
33
30
|
},
|
|
34
31
|
anchorOrigin: {
|
|
35
32
|
vertical: 'bottom',
|
|
36
33
|
horizontal: 'right'
|
|
37
34
|
}
|
|
38
35
|
}, props));
|
|
39
|
-
}
|
|
36
|
+
};
|
|
37
|
+
|
|
40
38
|
export default InfosBadge;
|
|
@@ -80,6 +80,8 @@ export var makeTheme = function makeTheme(type, variant) {
|
|
|
80
80
|
var theme = createTheme(_objectSpread(_objectSpread({}, themesCommonConfig), {}, {
|
|
81
81
|
typography: uiThemeName === 'Cozy' ? makeTypography(palette) : makeTwakeTypography(),
|
|
82
82
|
shadows: makeShadows(type, variant),
|
|
83
|
+
type: type,
|
|
84
|
+
variant: variant,
|
|
83
85
|
palette: palette
|
|
84
86
|
}));
|
|
85
87
|
var overrides = uiThemeName === 'Cozy' ? makeOverridesByTheme(theme)[type][variant] : makeTwakeOverridesByTheme(theme)[type][variant];
|