cozy-ui 133.0.1 → 134.1.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 +41 -5
- package/assets/icons/ui/planet.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsBar/index.jsx +3 -2
- package/react/BottomSheet/BottomSheet.jsx +4 -2
- package/react/CozyDialogs/SpecificDialogs/Readme.md +0 -58
- package/react/Icon/Readme.md +3 -1
- package/react/Icons/Planet.jsx +12 -0
- package/react/providers/CozyTheme/index.jsx +12 -23
- package/transpiled/react/ActionsBar/index.js +5 -1
- package/transpiled/react/BottomSheet/BottomSheet.js +2 -0
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/Planet.d.ts +2 -0
- package/transpiled/react/Icons/Planet.js +13 -0
- package/transpiled/react/providers/CozyTheme/index.d.ts +3 -4
- package/transpiled/react/providers/CozyTheme/index.js +16 -15
|
@@ -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/planet.svg` to regenerate;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function SvgPlanet(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 16 16"
|
|
8
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
d: "M7.992 0C3.576 0 0 3.584 0 8s3.576 8 7.992 8C12.416 16 16 12.416 16 8s-3.584-8-8.008-8zm5.544 4.8h-2.36c-.256-1-.624-1.96-1.104-2.848A6.424 6.424 0 0113.536 4.8zM8 1.632A11.27 11.27 0 019.528 4.8H6.472A11.27 11.27 0 018 1.632zM1.808 9.6A6.594 6.594 0 011.6 8c0-.552.08-1.088.208-1.6h2.704A13.212 13.212 0 004.4 8c0 .544.048 1.072.112 1.6H1.808zm.656 1.6h2.36c.256 1 .624 1.96 1.104 2.848A6.39 6.39 0 012.464 11.2zm2.36-6.4h-2.36a6.39 6.39 0 013.464-2.848A12.52 12.52 0 004.824 4.8zM8 14.368A11.27 11.27 0 016.472 11.2h3.056A11.27 11.27 0 018 14.368zM9.872 9.6H6.128A11.77 11.77 0 016 8c0-.544.056-1.08.128-1.6h3.744C9.944 6.92 10 7.456 10 8s-.056 1.072-.128 1.6zm.2 4.448a12.52 12.52 0 001.104-2.848h2.36a6.424 6.424 0 01-3.464 2.848zM11.488 9.6c.064-.528.112-1.056.112-1.6s-.048-1.072-.112-1.6h2.704c.128.512.208 1.048.208 1.6s-.08 1.088-.208 1.6h-2.704z"
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default SvgPlanet;
|
|
@@ -3,22 +3,21 @@ export function useCozyTheme(): {
|
|
|
3
3
|
type: 'light' | 'dark';
|
|
4
4
|
variant: 'normal' | 'inverted';
|
|
5
5
|
isLight: boolean;
|
|
6
|
-
name: 'Twake' | 'Cozy';
|
|
7
6
|
};
|
|
8
7
|
export default CozyTheme;
|
|
9
8
|
import React from "react";
|
|
10
|
-
declare function CozyTheme({ variant, className, ignoreItself,
|
|
9
|
+
declare function CozyTheme({ type, variant, className, ignoreItself, children }: {
|
|
10
|
+
type: any;
|
|
11
11
|
variant: any;
|
|
12
12
|
className: any;
|
|
13
13
|
ignoreItself: any;
|
|
14
|
-
settingsThemeType: any;
|
|
15
14
|
children: any;
|
|
16
15
|
}): JSX.Element;
|
|
17
16
|
declare namespace CozyTheme {
|
|
18
17
|
namespace propTypes {
|
|
18
|
+
const type: PropTypes.Requireable<string>;
|
|
19
19
|
const variant: PropTypes.Requireable<string>;
|
|
20
20
|
const ignoreItself: PropTypes.Requireable<boolean>;
|
|
21
|
-
const settingsThemeType: PropTypes.Requireable<string>;
|
|
22
21
|
const className: PropTypes.Requireable<string>;
|
|
23
22
|
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
23
|
}
|
|
@@ -7,7 +7,7 @@ import MuiCozyTheme from "cozy-ui/transpiled/react/MuiCozyTheme";
|
|
|
7
7
|
import useMediaQuery from "cozy-ui/transpiled/react/hooks/useMediaQuery";
|
|
8
8
|
export var CozyThemeContext = /*#__PURE__*/createContext();
|
|
9
9
|
/**
|
|
10
|
-
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean
|
|
10
|
+
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean }}
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export var useCozyTheme = function useCozyTheme() {
|
|
@@ -28,41 +28,42 @@ export var useCozyTheme = function useCozyTheme() {
|
|
|
28
28
|
var CozyTheme = function CozyTheme(_ref) {
|
|
29
29
|
var _cx;
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var type = _ref.type,
|
|
32
|
+
variant = _ref.variant,
|
|
32
33
|
className = _ref.className,
|
|
33
34
|
ignoreItself = _ref.ignoreItself,
|
|
34
|
-
settingsThemeType = _ref.settingsThemeType,
|
|
35
35
|
children = _ref.children;
|
|
36
36
|
var uiThemeType = localStorage.getItem('ui-theme-type'); // use only for cozy-ui documentation and argos screenshots
|
|
37
37
|
|
|
38
38
|
var uiThemeVariant = localStorage.getItem('ui-theme-variant'); // use only for cozy-ui documentation and argos screenshots
|
|
39
39
|
|
|
40
40
|
var deviceThemeType = useMediaQuery('(prefers-color-scheme: dark)') ? 'dark' : 'light';
|
|
41
|
-
var filteredSettingsThemeType = ['light', 'dark'].includes(
|
|
42
|
-
|
|
43
|
-
var
|
|
41
|
+
var filteredSettingsThemeType = ['light', 'dark'].includes(type) ? type : undefined;
|
|
42
|
+
|
|
43
|
+
var _type = uiThemeType || filteredSettingsThemeType || deviceThemeType;
|
|
44
|
+
|
|
45
|
+
var _variant = uiThemeVariant || variant;
|
|
46
|
+
|
|
44
47
|
return /*#__PURE__*/React.createElement(CozyThemeContext.Provider, {
|
|
45
48
|
value: {
|
|
46
|
-
type:
|
|
47
|
-
variant:
|
|
48
|
-
isLight:
|
|
49
|
+
type: _type,
|
|
50
|
+
variant: _variant,
|
|
51
|
+
isLight: _type === 'light'
|
|
49
52
|
}
|
|
50
53
|
}, /*#__PURE__*/React.createElement(MuiCozyTheme, {
|
|
51
|
-
type:
|
|
52
|
-
variant:
|
|
54
|
+
type: _type,
|
|
55
|
+
variant: _variant
|
|
53
56
|
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: cx(className, (_cx = {}, _defineProperty(_cx, "TwakeTheme--".concat(
|
|
57
|
+
className: cx(className, (_cx = {}, _defineProperty(_cx, "TwakeTheme--".concat(_type, "-").concat(_variant), Boolean(_variant)), _defineProperty(_cx, 'u-dc', ignoreItself), _cx))
|
|
55
58
|
}, children)));
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
CozyTheme.propTypes = {
|
|
62
|
+
type: PropTypes.oneOf(['light', 'dark', 'auto']),
|
|
59
63
|
variant: PropTypes.oneOf(['normal', 'inverted']),
|
|
60
64
|
|
|
61
65
|
/** Causes this element's children to appear as if they were direct children of the element's parent, ignoring the element itself. */
|
|
62
66
|
ignoreItself: PropTypes.bool,
|
|
63
|
-
|
|
64
|
-
/** Theme type from io.cozy.settings.instance */
|
|
65
|
-
settingsThemeType: PropTypes.oneOf(['light', 'dark', 'auto']),
|
|
66
67
|
className: PropTypes.string,
|
|
67
68
|
children: PropTypes.node
|
|
68
69
|
};
|