cozy-ui 121.6.0 → 121.8.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 +25 -0
- package/assets/icons/ui/cloud-rainbow.svg +1 -0
- package/assets/icons/ui/mosaic.svg +1 -0
- package/assets/icons/ui/person-add.svg +1 -0
- package/dist/cozy-ui.min.css +1 -1
- package/dist/cozy-ui.utils.min.css +1 -1
- package/package.json +1 -1
- package/react/Badge/Readme.md +2 -2
- package/react/Icon/Readme.md +7 -1
- package/react/Icons/CloudRainbow.jsx +63 -0
- package/react/Icons/Mosaic.jsx +16 -0
- package/react/Icons/PersonAdd.jsx +12 -0
- 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/themes/light-normal.styl +0 -2
- package/theme/palette_twake.json +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/CloudRainbow.js +66 -0
- package/transpiled/react/Icons/Mosaic.js +15 -0
- package/transpiled/react/Icons/PersonAdd.js +13 -0
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/cloud-rainbow.svg` to regenerate;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function SvgCloudRainbow(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 16 11"
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
d: "M8 1.333a3.669 3.669 0 013.593 2.954l.2 1 1.02.073c1.04.067 1.854.94 1.854 1.973 0 1.1-.9 2-2 2H4a2.666 2.666 0 01-2.667-2.666A2.649 2.649 0 013.707 4.02l.713-.073.333-.634A3.646 3.646 0 018 1.333zM8 0a4.997 4.997 0 00-4.433 2.693A3.996 3.996 0 000 6.667c0 2.206 1.793 4 4 4h8.667A3.335 3.335 0 0016 7.333a3.317 3.317 0 00-3.1-3.306A4.993 4.993 0 008 0z",
|
|
10
|
+
fill: "#fff"
|
|
11
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
d: "M8 1.333a3.669 3.669 0 013.593 2.954l.2 1 1.02.073c1.04.067 1.854.94 1.854 1.973 0 1.1-.9 2-2 2H4a2.666 2.666 0 01-2.667-2.666A2.649 2.649 0 013.707 4.02l.713-.073.333-.634A3.646 3.646 0 018 1.333zM8 0a4.997 4.997 0 00-4.433 2.693A3.996 3.996 0 000 6.667c0 2.206 1.793 4 4 4h8.667A3.335 3.335 0 0016 7.333a3.317 3.317 0 00-3.1-3.306A4.993 4.993 0 008 0z",
|
|
13
|
+
fill: "url(#cloud-rainbow_svg__paint0_linear_11512_6354)"
|
|
14
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M8 1.333a3.669 3.669 0 013.593 2.954l.2 1 1.02.073c1.04.067 1.854.94 1.854 1.973 0 1.1-.9 2-2 2H4a2.666 2.666 0 01-2.667-2.666A2.649 2.649 0 013.707 4.02l.713-.073.333-.634A3.646 3.646 0 018 1.333zM8 0a4.997 4.997 0 00-4.433 2.693A3.996 3.996 0 000 6.667c0 2.206 1.793 4 4 4h8.667A3.335 3.335 0 0016 7.333a3.317 3.317 0 00-3.1-3.306A4.993 4.993 0 008 0z",
|
|
16
|
+
fill: "url(#cloud-rainbow_svg__paint1_linear_11512_6354)"
|
|
17
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
18
|
+
d: "M8 1.333a3.669 3.669 0 013.593 2.954l.2 1 1.02.073c1.04.067 1.854.94 1.854 1.973 0 1.1-.9 2-2 2H4a2.666 2.666 0 01-2.667-2.666A2.649 2.649 0 013.707 4.02l.713-.073.333-.634A3.646 3.646 0 018 1.333zM8 0a4.997 4.997 0 00-4.433 2.693A3.996 3.996 0 000 6.667c0 2.206 1.793 4 4 4h8.667A3.335 3.335 0 0016 7.333a3.317 3.317 0 00-3.1-3.306A4.993 4.993 0 008 0z",
|
|
19
|
+
fill: "url(#cloud-rainbow_svg__paint2_linear_11512_6354)"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
21
|
+
id: "cloud-rainbow_svg__paint0_linear_11512_6354",
|
|
22
|
+
x1: 16,
|
|
23
|
+
y1: 6.222,
|
|
24
|
+
x2: 0,
|
|
25
|
+
y2: 6.222,
|
|
26
|
+
gradientUnits: "userSpaceOnUse"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
28
|
+
offset: 0.13,
|
|
29
|
+
stopColor: "#A033FF"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
31
|
+
offset: 0.61,
|
|
32
|
+
stopColor: "#0094FF"
|
|
33
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
34
|
+
offset: 1,
|
|
35
|
+
stopColor: "#4FB500"
|
|
36
|
+
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
37
|
+
id: "cloud-rainbow_svg__paint1_linear_11512_6354",
|
|
38
|
+
x1: 7.333,
|
|
39
|
+
y1: 3.333,
|
|
40
|
+
x2: 4.833,
|
|
41
|
+
y2: 10.833,
|
|
42
|
+
gradientUnits: "userSpaceOnUse"
|
|
43
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
44
|
+
stopColor: "#FFD600",
|
|
45
|
+
stopOpacity: 0
|
|
46
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
47
|
+
offset: 0.563,
|
|
48
|
+
stopColor: "#FFC700"
|
|
49
|
+
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
50
|
+
id: "cloud-rainbow_svg__paint2_linear_11512_6354",
|
|
51
|
+
x1: 8.667,
|
|
52
|
+
y1: 6.222,
|
|
53
|
+
x2: 12.079,
|
|
54
|
+
y2: 11.642,
|
|
55
|
+
gradientUnits: "userSpaceOnUse"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
57
|
+
offset: 0.03,
|
|
58
|
+
stopColor: "#FF3B30",
|
|
59
|
+
stopOpacity: 0
|
|
60
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
61
|
+
offset: 0.843,
|
|
62
|
+
stopColor: "#E73B2D"
|
|
63
|
+
}))));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default SvgCloudRainbow;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/mosaic.svg` to regenerate;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function SvgMosaic(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 16 16"
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
fillRule: "evenodd",
|
|
10
|
+
clipRule: "evenodd",
|
|
11
|
+
d: "M9.289 1.92l.02-.02.737-.737.02-.02c.241-.24.454-.453.645-.615a2.11 2.11 0 01.718-.426c.418-.136.87-.136 1.288 0 .286.093.515.253.718.426.191.162.404.374.644.615l.02.02.738.737.02.02c.24.241.454.454.615.645.173.203.333.432.426.718.136.419.136.87 0 1.288a2.117 2.117 0 01-.426.718c-.162.191-.374.404-.615.644l-.02.02-.737.738-.02.02c-.241.24-.454.454-.645.615a2.118 2.118 0 01-.718.426c-.418.136-.87.136-1.288 0a2.117 2.117 0 01-.718-.426 10.947 10.947 0 01-.644-.615l-.02-.02-.738-.737-.02-.02c-.24-.241-.454-.454-.615-.645a2.118 2.118 0 01-.426-.718 2.084 2.084 0 010-1.288 2.11 2.11 0 01.426-.718c.161-.191.374-.404.615-.644zm.576 1.657c-.11.129-.126.177-.13.189a.521.521 0 000 .322c.004.012.02.06.13.19.116.136.283.303.55.57l.737.737c.267.267.434.434.57.55.13.11.178.126.19.13a.521.521 0 00.322 0c.011-.004.06-.02.19-.13.136-.116.303-.283.57-.55l.737-.737c.267-.267.434-.434.55-.57.11-.13.126-.178.13-.19a.521.521 0 000-.322c-.004-.012-.02-.06-.13-.19a11.036 11.036 0 00-.55-.57l-.737-.737a10.98 10.98 0 00-.57-.55c-.13-.11-.178-.126-.19-.13a.521.521 0 00-.322 0c-.012.004-.06.02-.19.13a10.98 10.98 0 00-.57.55l-.737.737c-.267.267-.434.434-.55.57zM3.91 7.314h.028c.34 0 .641 0 .89-.02a2.12 2.12 0 00.81-.207c.392-.2.71-.519.91-.91a2.12 2.12 0 00.207-.81c.02-.249.02-.55.02-.89V3.376c0-.34 0-.64-.02-.89a2.119 2.119 0 00-.206-.808 2.085 2.085 0 00-.911-.911 2.118 2.118 0 00-.81-.207c-.249-.02-.55-.02-.89-.02H2.837c-.34 0-.64 0-.89.02a2.12 2.12 0 00-.809.207c-.392.2-.71.519-.91.91a2.118 2.118 0 00-.208.81c-.02.249-.02.55-.02.89v1.101c0 .34 0 .64.02.89.022.265.07.54.207.808.2.392.519.711.911.911.268.137.543.185.809.207.25.02.55.02.89.02H3.91zm1.018-1.62c-.011.006-.057.028-.226.042a11.01 11.01 0 01-.792.015H2.866c-.377 0-.614 0-.792-.015-.169-.014-.215-.036-.226-.042a.521.521 0 01-.228-.228c-.005-.01-.028-.057-.041-.226a10.986 10.986 0 01-.016-.792V3.406c0-.378.001-.614.016-.792.013-.17.036-.216.041-.226a.521.521 0 01.228-.228c.01-.006.057-.028.226-.042.178-.014.415-.015.792-.015H3.91c.377 0 .614 0 .792.015.169.014.215.036.226.042.098.05.178.13.228.228.005.01.027.057.041.226.015.178.015.414.015.792v1.042c0 .378 0 .614-.015.792-.014.17-.036.216-.041.226a.521.521 0 01-.228.228zM3.909 16h.028c.34 0 .642 0 .89-.02a2.12 2.12 0 00.81-.207c.392-.2.71-.519.91-.911.137-.268.186-.543.207-.809.02-.25.02-.55.02-.89v-1.101c0-.34 0-.64-.02-.89a2.119 2.119 0 00-.206-.809 2.085 2.085 0 00-.911-.91 2.117 2.117 0 00-.81-.207c-.248-.02-.55-.02-.89-.02H2.838c-.34 0-.64 0-.89.02-.266.021-.54.07-.809.206-.392.2-.71.52-.91.911a2.118 2.118 0 00-.208.81c-.02.248-.02.55-.02.89v1.099c0 .34 0 .64.02.89.022.266.07.54.207.809.2.392.519.71.911.91.268.137.543.186.809.208.25.02.55.02.89.02H3.91zm1.018-1.62c-.011.005-.057.028-.226.041a10.95 10.95 0 01-.792.016H2.866c-.377 0-.614-.001-.792-.016-.169-.013-.215-.036-.226-.041a.521.521 0 01-.228-.228c-.005-.01-.028-.057-.041-.226a10.985 10.985 0 01-.016-.792V12.09c0-.377.001-.614.016-.792.013-.168.036-.215.041-.226a.521.521 0 01.228-.228c.01-.005.057-.027.226-.041.178-.015.415-.015.792-.015H3.91c.377 0 .614 0 .792.015.169.014.215.036.226.041.098.05.178.13.228.228.005.01.027.057.041.226.015.178.015.415.015.793v1.042c0 .377 0 .614-.015.792-.014.169-.036.215-.041.226a.521.521 0 01-.228.228zM12.594 16h.03c.34 0 .64 0 .89-.02.265-.022.54-.07.808-.207.392-.2.711-.519.911-.911a2.12 2.12 0 00.207-.809c.02-.25.02-.55.02-.89v-1.101c0-.34 0-.64-.02-.89a2.12 2.12 0 00-.207-.809 2.085 2.085 0 00-.91-.91 2.117 2.117 0 00-.81-.207c-.249-.02-.55-.02-.89-.02h-1.101c-.34 0-.64 0-.89.02-.265.021-.54.07-.808.206-.392.2-.711.52-.911.911a2.118 2.118 0 00-.207.81c-.02.248-.02.55-.02.89v1.099c0 .34 0 .64.02.89.022.266.07.54.207.809.2.392.519.71.91.91.269.137.544.186.81.208.249.02.55.02.89.02h1.071zm1.018-1.62c-.01.005-.057.028-.226.041a10.6 10.6 0 01-.792.016h-1.042a10.6 10.6 0 01-.792-.016c-.17-.013-.216-.036-.226-.041a.521.521 0 01-.228-.228c-.006-.01-.028-.057-.042-.226a11.009 11.009 0 01-.015-.792V12.09c0-.377 0-.614.015-.792.014-.168.036-.215.042-.226a.521.521 0 01.228-.228c.01-.005.057-.027.226-.041.178-.015.414-.015.792-.015h1.042c.378 0 .614 0 .792.015.17.014.216.036.226.041.098.05.178.13.228.228.006.01.028.057.042.226.014.178.015.415.015.793v1.042c0 .377 0 .614-.015.792-.014.169-.036.215-.042.226a.521.521 0 01-.228.228z"
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default SvgMosaic;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/person-add.svg` to regenerate;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function SvgPersonAdd(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 16 13"
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
d: "M12.768 5.398h-.905a.753.753 0 01-.553-.222.745.745 0 01-.223-.55.76.76 0 01.223-.554.746.746 0 01.553-.226h.905v-.904c0-.22.073-.404.221-.553a.745.745 0 01.55-.223.76.76 0 01.555.223c.15.149.226.333.226.553v.904h.904c.22 0 .404.074.553.222a.745.745 0 01.223.55.76.76 0 01-.223.554.746.746 0 01-.553.226h-.904v.905a.75.75 0 01-.222.552.745.745 0 01-.55.224.759.759 0 01-.554-.224.746.746 0 01-.226-.552v-.905zm-6.706.825c-.868 0-1.604-.302-2.208-.906-.604-.604-.906-1.34-.906-2.208 0-.868.302-1.603.906-2.205C4.458.3 5.194 0 6.062 0 6.93 0 7.665.301 8.27.904c.604.602.906 1.337.906 2.205 0 .868-.302 1.604-.906 2.208-.604.604-1.34.906-2.208.906zM0 10.753v-.36c0-.383.094-.734.281-1.055.188-.32.446-.576.774-.766.76-.44 1.563-.778 2.409-1.013a9.646 9.646 0 012.598-.353c.893 0 1.762.117 2.607.35.846.234 1.646.57 2.4 1.01.328.191.586.446.773.765.188.32.282.673.282 1.061v.36c0 .471-.166.872-.497 1.203a1.64 1.64 0 01-1.203.497h-8.73c-.472 0-.871-.166-1.2-.497A1.643 1.643 0 010 10.753z"
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SvgPersonAdd;
|
|
@@ -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];
|
|
@@ -824,6 +824,7 @@ export var makeLightNormalOverrides = function makeLightNormalOverrides(theme) {
|
|
|
824
824
|
badge: {
|
|
825
825
|
boxSizing: 'content-box',
|
|
826
826
|
padding: 0,
|
|
827
|
+
borderRadius: '100%',
|
|
827
828
|
'&.badgeBorder': {
|
|
828
829
|
border: "2px solid ".concat(theme.palette.background.paper)
|
|
829
830
|
},
|
|
@@ -7,7 +7,7 @@ import get from 'lodash/get';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
|
|
10
|
-
var
|
|
10
|
+
var stylesCozy = {
|
|
11
11
|
"SquareAppIcon-wrapper": "styles__SquareAppIcon-wrapper___2SEuM",
|
|
12
12
|
"SquareAppIcon-icon-container": "styles__SquareAppIcon-icon-container___39MRl",
|
|
13
13
|
"SquareAppIcon-wrapper-ghost": "styles__SquareAppIcon-wrapper-ghost___1ZALZ",
|
|
@@ -20,6 +20,19 @@ var styles = {
|
|
|
20
20
|
"isSuccess": "styles__isSuccess___I6nFq",
|
|
21
21
|
"end-animation": "styles__end-animation___1O0b3"
|
|
22
22
|
};
|
|
23
|
+
var stylesTwake = {
|
|
24
|
+
"SquareAppIcon-wrapper": "styles_twake__SquareAppIcon-wrapper___4P3Cx",
|
|
25
|
+
"SquareAppIcon-icon-container": "styles_twake__SquareAppIcon-icon-container___grFij",
|
|
26
|
+
"SquareAppIcon-wrapper-ghost": "styles_twake__SquareAppIcon-wrapper-ghost___3xelE",
|
|
27
|
+
"SquareAppIcon-icon-container-normal": "styles_twake__SquareAppIcon-icon-container-normal___1O1bk",
|
|
28
|
+
"SquareAppIcon-wrapper-maintenance": "styles_twake__SquareAppIcon-wrapper-maintenance___hoMUk",
|
|
29
|
+
"SquareAppIcon-wrapper-loading": "styles_twake__SquareAppIcon-wrapper-loading___AoTRM",
|
|
30
|
+
"SquareAppIcon-spinner": "styles_twake__SquareAppIcon-spinner___UOK0n",
|
|
31
|
+
"onEnd": "styles_twake__onEnd___GkZzo",
|
|
32
|
+
"isFailed": "styles_twake__isFailed___CO_WC",
|
|
33
|
+
"isSuccess": "styles_twake__isSuccess___sH4pb",
|
|
34
|
+
"end-animation": "styles_twake__end-animation___26Lyd"
|
|
35
|
+
};
|
|
23
36
|
import AppIcon from "cozy-ui/transpiled/react/AppIcon";
|
|
24
37
|
import Badge from "cozy-ui/transpiled/react/Badge";
|
|
25
38
|
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
@@ -31,17 +44,26 @@ import iconWarning from "cozy-ui/transpiled/react/Icons/WarningCircle";
|
|
|
31
44
|
import InfosBadge from "cozy-ui/transpiled/react/InfosBadge";
|
|
32
45
|
import Spinner from "cozy-ui/transpiled/react/Spinner";
|
|
33
46
|
import Typography from "cozy-ui/transpiled/react/Typography";
|
|
47
|
+
import { isTwakeTheme } from "cozy-ui/transpiled/react/helpers/isTwakeTheme";
|
|
34
48
|
import { nameToColor } from "cozy-ui/transpiled/react/legacy/Avatar/helpers";
|
|
49
|
+
import { useBreakpoints } from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
35
50
|
import CozyTheme, { useCozyTheme } from "cozy-ui/transpiled/react/providers/CozyTheme";
|
|
36
51
|
import { alpha, makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
52
|
+
var styles = isTwakeTheme() ? stylesTwake : stylesCozy;
|
|
53
|
+
|
|
54
|
+
var makeTwakeColor = function makeTwakeColor(theme) {
|
|
55
|
+
return theme.variant === 'inverted' || theme.type === 'dark' ? 'var(--white)' : 'var(--black)';
|
|
56
|
+
};
|
|
57
|
+
|
|
37
58
|
var useStyles = makeStyles(function (theme) {
|
|
38
59
|
return {
|
|
39
60
|
name: _defineProperty({
|
|
40
|
-
color: 'var(--primaryTextColor)',
|
|
61
|
+
color: isTwakeTheme() ? makeTwakeColor(theme) : 'var(--primaryTextColor)',
|
|
62
|
+
textShadow: isTwakeTheme() ? theme.variant === 'inverted' || theme.type === 'dark' ? '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)' : undefined : undefined,
|
|
41
63
|
width: '5.5rem',
|
|
42
64
|
textAlign: 'center',
|
|
43
|
-
fontSize: '0.875rem',
|
|
44
|
-
lineHeight: '1.188rem',
|
|
65
|
+
fontSize: isTwakeTheme() ? undefined : '0.875rem',
|
|
66
|
+
lineHeight: isTwakeTheme() ? undefined : '1.188rem',
|
|
45
67
|
margin: '0.5rem 0.25rem 0 0.25rem',
|
|
46
68
|
lineClamp: '2',
|
|
47
69
|
boxOrient: 'vertical',
|
|
@@ -49,8 +71,8 @@ var useStyles = makeStyles(function (theme) {
|
|
|
49
71
|
height: '2.375rem'
|
|
50
72
|
}, theme.breakpoints.down('sm'), {
|
|
51
73
|
width: '3.75rem',
|
|
52
|
-
fontSize: '0.6875rem',
|
|
53
|
-
lineHeight: '1rem',
|
|
74
|
+
fontSize: isTwakeTheme() ? undefined : '0.6875rem',
|
|
75
|
+
lineHeight: isTwakeTheme() ? undefined : '1rem',
|
|
54
76
|
margin: '0.25rem 0.25rem 0 0.25rem',
|
|
55
77
|
height: '2rem'
|
|
56
78
|
}),
|
|
@@ -66,7 +88,7 @@ var useStyles = makeStyles(function (theme) {
|
|
|
66
88
|
margin: 'auto'
|
|
67
89
|
},
|
|
68
90
|
shadow: {
|
|
69
|
-
boxShadow: theme.shadows[1]
|
|
91
|
+
boxShadow: isTwakeTheme() ? undefined : theme.shadows[1]
|
|
70
92
|
},
|
|
71
93
|
errorIcon: {
|
|
72
94
|
fill: 'var(--errorColor)',
|
|
@@ -79,9 +101,9 @@ var useStyles = makeStyles(function (theme) {
|
|
|
79
101
|
display: 'flex',
|
|
80
102
|
flexDirection: 'column',
|
|
81
103
|
alignItems: 'center',
|
|
82
|
-
|
|
104
|
+
minWidth: '6rem'
|
|
83
105
|
}, theme.breakpoints.down('sm'), {
|
|
84
|
-
|
|
106
|
+
minWidth: '4.25rem'
|
|
85
107
|
}),
|
|
86
108
|
detailedTileWrapper: {
|
|
87
109
|
flexDirection: 'row',
|
|
@@ -122,6 +144,9 @@ export var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
122
144
|
var _useCozyTheme = useCozyTheme(),
|
|
123
145
|
themeVariant = _useCozyTheme.variant;
|
|
124
146
|
|
|
147
|
+
var _useBreakpoints = useBreakpoints(),
|
|
148
|
+
isMobile = _useBreakpoints.isMobile;
|
|
149
|
+
|
|
125
150
|
var classes = useStyles();
|
|
126
151
|
var appName = name || get(appIconProps, 'app.name') || get(appIconProps, 'app') || '';
|
|
127
152
|
var letter = appName[0] || '';
|
|
@@ -142,7 +167,8 @@ export var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
142
167
|
if (curr === 'loading' && (variant === 'default' || variant === undefined)) setAnimationState('success');
|
|
143
168
|
prevVariant.current = variant;
|
|
144
169
|
}, [variant]);
|
|
145
|
-
var
|
|
170
|
+
var exceptionVariant = [isTwakeTheme() ? 'ghost' : 'add', 'ghost'];
|
|
171
|
+
var squareTheme = exceptionVariant.includes(variant) ? themeVariant : 'normal';
|
|
146
172
|
return /*#__PURE__*/React.createElement("div", {
|
|
147
173
|
"data-testid": "square-app-icon",
|
|
148
174
|
className: cx(classes.tileWrapper, _defineProperty({}, classes.detailedTileWrapper, display === 'detailed'))
|
|
@@ -160,9 +186,9 @@ export var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
160
186
|
variant: variant,
|
|
161
187
|
animationState: animationState
|
|
162
188
|
}), /*#__PURE__*/React.createElement(Badge, {
|
|
163
|
-
className: cx(styles['SquareAppIcon-wrapper'], styles["SquareAppIcon-wrapper-".concat(variant)], (_cx3 = {}, _defineProperty(_cx3, classes.squareAppIconGhost,
|
|
189
|
+
className: cx(styles['SquareAppIcon-wrapper'], styles["SquareAppIcon-wrapper-".concat(variant)], (_cx3 = {}, _defineProperty(_cx3, classes.squareAppIconGhost, exceptionVariant.includes(variant)), _defineProperty(_cx3, classes.shadow, !exceptionVariant.includes(variant)), _cx3)),
|
|
164
190
|
badgeContent: variant === 'error' ? /*#__PURE__*/React.createElement(Icon, {
|
|
165
|
-
size:
|
|
191
|
+
size: 16,
|
|
166
192
|
className: cx(classes.errorIcon),
|
|
167
193
|
icon: iconWarning
|
|
168
194
|
}) : '',
|
|
@@ -170,9 +196,7 @@ export var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
170
196
|
withBorder: false,
|
|
171
197
|
size: "large",
|
|
172
198
|
overlap: "rectangular",
|
|
173
|
-
style: variant === 'shortcut' && !IconContent ? {
|
|
174
|
-
backgroundColor: nameToColor(name)
|
|
175
|
-
} : null
|
|
199
|
+
style: variant === 'shortcut' && !IconContent ? _defineProperty({}, isTwakeTheme() ? 'background' : 'backgroundColor', nameToColor(name)) : null
|
|
176
200
|
}, variant === 'shortcut' && !IconContent ? /*#__PURE__*/React.createElement(Typography, {
|
|
177
201
|
className: classes.letter,
|
|
178
202
|
variant: "h2",
|
|
@@ -183,17 +207,19 @@ export var SquareAppIcon = function SquareAppIcon(_ref2) {
|
|
|
183
207
|
className: cx(styles['onEnd'], _defineProperty({}, styles['isSuccess'], animationState === 'success'), _defineProperty({}, styles['isFailed'], animationState === 'failed')),
|
|
184
208
|
onAnimationEnd: handleAnimationEnd
|
|
185
209
|
}, animationState && /*#__PURE__*/React.createElement(Icon, {
|
|
186
|
-
size:
|
|
210
|
+
size: 32,
|
|
187
211
|
icon: animationState === 'success' ? IconCheckAnimated : SvgIconCrossAnimated
|
|
188
212
|
})), variant === 'add' ? /*#__PURE__*/React.createElement(Icon, {
|
|
189
213
|
icon: iconPlus,
|
|
190
214
|
color: "var(--primaryColor)"
|
|
191
|
-
}) : IconContent ? IconContent :
|
|
215
|
+
}) : IconContent ? IconContent : isTwakeTheme() ? /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
className: "u-w-1-half-s u-h-1-half-s u-w-2 u-h-2"
|
|
217
|
+
}, /*#__PURE__*/React.createElement(AppIcon, appIconProps)) : /*#__PURE__*/React.createElement(AppIcon, appIconProps))))), display === 'detailed' ? /*#__PURE__*/React.createElement(ListItemText, {
|
|
192
218
|
primary: appName,
|
|
193
219
|
secondary: description
|
|
194
220
|
}) : /*#__PURE__*/React.createElement(Typography, {
|
|
195
221
|
className: cx(classes.name, _defineProperty({}, classes.nameInverted, themeVariant === 'inverted'), 'u-spacellipsis'),
|
|
196
|
-
variant:
|
|
222
|
+
variant: isTwakeTheme() ? isMobile ? 'overline' : 'h6' : 'h6',
|
|
197
223
|
align: "center"
|
|
198
224
|
}, appName));
|
|
199
225
|
};
|
|
@@ -8,7 +8,7 @@ import DumbCozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme/DumbCozy
|
|
|
8
8
|
import { isRsg } from "cozy-ui/transpiled/react/hooks/useSetFlagshipUi/helpers";
|
|
9
9
|
export var CozyThemeContext = /*#__PURE__*/createContext();
|
|
10
10
|
/**
|
|
11
|
-
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean }}
|
|
11
|
+
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean, name: 'Twake'|'Cozy' }}
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export var useCozyTheme = function useCozyTheme() {
|
|
@@ -19,7 +19,8 @@ export var useCozyTheme = function useCozyTheme() {
|
|
|
19
19
|
return {
|
|
20
20
|
type: 'light',
|
|
21
21
|
variant: 'normal',
|
|
22
|
-
isLight: true
|
|
22
|
+
isLight: true,
|
|
23
|
+
name: 'Cozy'
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
|