@opengeoweb/theme 1.0.2 → 2.1.1

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.
Files changed (46) hide show
  1. package/README.md +459 -63
  2. package/index.d.ts +1 -1
  3. package/lib/components/Theme/ThemeContext.d.ts +17 -0
  4. package/{theme.test.d.ts → lib/components/Theme/ThemeContext.spec.d.ts} +1 -1
  5. package/lib/components/Theme/darkTheme.d.ts +3 -0
  6. package/{theme.d.ts → lib/components/Theme/gwTheme.d.ts} +7 -7
  7. package/lib/components/Theme/index.d.ts +5 -0
  8. package/lib/components/Theme/lightTheme.d.ts +3 -0
  9. package/lib/components/Theme/types.d.ts +121 -0
  10. package/lib/components/Theme/utils.d.ts +7 -0
  11. package/lib/components/Theme/utils.spec.d.ts +1 -0
  12. package/lib/stories/Backdrop.stories.d.ts +8 -0
  13. package/lib/stories/Card.stories.d.ts +3 -0
  14. package/lib/stories/Colors.stories.d.ts +7 -0
  15. package/lib/stories/Elevation.stories.d.ts +3 -0
  16. package/lib/stories/FormElements.stories.d.ts +4 -0
  17. package/lib/stories/List.stories.d.ts +3 -0
  18. package/lib/stories/Slider.stories.d.ts +3 -0
  19. package/lib/stories/StoryWrapper.d.ts +9 -0
  20. package/lib/stories/Table.stories.d.ts +3 -0
  21. package/lib/stories/Tabs.stories.d.ts +8 -0
  22. package/lib/stories/Tooltip.stories.d.ts +7 -0
  23. package/lib/stories/Typography.stories.d.ts +4 -0
  24. package/lib/stories/index.stories.d.ts +15 -0
  25. package/lib/stories/snapshots/Backdrop.stories.d.ts +17 -0
  26. package/lib/stories/snapshots/Card.stories.d.ts +17 -0
  27. package/lib/stories/snapshots/Colors.stories.d.ts +17 -0
  28. package/lib/stories/snapshots/Elevation.stories.d.ts +17 -0
  29. package/lib/stories/snapshots/FormElements.stories.d.ts +7 -0
  30. package/lib/stories/snapshots/List.stories.d.ts +7 -0
  31. package/lib/stories/snapshots/Slider.stories.d.ts +7 -0
  32. package/lib/stories/snapshots/Table.stories.d.ts +17 -0
  33. package/lib/stories/snapshots/Tabs.stories.d.ts +7 -0
  34. package/lib/stories/snapshots/Tooltip.stories.d.ts +17 -0
  35. package/lib/stories/snapshots/Typography.stories.d.ts +7 -0
  36. package/lib/storyshots/Storyshots.spec.d.ts +1 -0
  37. package/package.json +11 -121
  38. package/theme.esm.js +1247 -0
  39. package/theme.umd.js +1226 -0
  40. package/AUTHORS +0 -14
  41. package/LICENCE +0 -13
  42. package/index.js +0 -13
  43. package/theme.js +0 -189
  44. package/theme.stories.d.ts +0 -7
  45. package/theme.stories.js +0 -120
  46. package/theme.test.js +0 -44
package/AUTHORS DELETED
@@ -1,14 +0,0 @@
1
- This project belongs to
2
-
3
- * Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4
-
5
- The code has been written by an international team of developers.
6
-
7
- KNMI:
8
- * Ernst de Vreede
9
- * Maarten Plieger
10
- * Rocco Turtolo
11
- * Loes Cornelis
12
- * Belen Torrente Torrente
13
- * Sander de Snaijer
14
- * Tineke van Rijn
package/LICENCE DELETED
@@ -1,13 +0,0 @@
1
- Licensed under the Apache License, Version 2.0 (the "License");
2
- you may not use this file except in compliance with the License.
3
- You may obtain a copy of the License at
4
-
5
- http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
-
13
- Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
package/index.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "GWTheme", {
7
- enumerable: true,
8
- get: function get() {
9
- return _theme.GWTheme;
10
- }
11
- });
12
-
13
- var _theme = require("./theme");
package/theme.js DELETED
@@ -1,189 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.GWTheme = void 0;
7
-
8
- var _core = require("@material-ui/core");
9
-
10
- /* *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- *
23
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24
- * */
25
- var GWTheme = (0, _core.createMuiTheme)({
26
- palette: {
27
- secondary: {
28
- main: '#0075a9'
29
- },
30
- action: {
31
- active: '#ffa800'
32
- }
33
- },
34
- shape: {
35
- borderRadius: 3
36
- },
37
- typography: {
38
- h6: {
39
- fontSize: '16px'
40
- },
41
- subtitle1: {
42
- fontSize: '16px',
43
- fontWeight: 500,
44
- lineHeight: 1.5,
45
- letterSpacing: '0.15px',
46
- opacity: 0.87,
47
- color: '#051039'
48
- },
49
- subtitle2: {
50
- fontSize: '14px',
51
- fontWeight: 500,
52
- lineHeight: 1.71,
53
- letterSpacing: '0.1px',
54
- opacity: 0.87,
55
- color: '#051039'
56
- },
57
- body1: {
58
- fontSize: '16px',
59
- lineHeight: 1.56,
60
- letterSpacing: '0.44px',
61
- color: '#051039'
62
- },
63
- body2: {
64
- fontSize: '14px',
65
- lineHeight: 1.43,
66
- letterSpacing: '0.25px',
67
- color: '#051039'
68
- },
69
- overline: {
70
- textTransform: 'none',
71
- fontSize: '12px',
72
- lineHeight: 1.43,
73
- letterSpacing: '0.25px',
74
- color: '#051039',
75
- opacity: 0.7
76
- },
77
- caption: {
78
- fontSize: '12px',
79
- lineHeight: 1.33,
80
- letterSpacing: '0.4px',
81
- color: '#051039',
82
- opacity: 0.7
83
- },
84
- button: {
85
- fontWeight: 500,
86
- fontSize: '14px',
87
- color: '0075a9'
88
- }
89
- },
90
- overrides: {
91
- MuiIconButton: {
92
- root: {
93
- color: '#0075a9'
94
- }
95
- },
96
- MuiSelect: {
97
- icon: {
98
- color: '#0075a9'
99
- },
100
- select: {
101
- '&:focus': {
102
- backgroundColor: 'rgba(0, 117, 169, 0.05)'
103
- }
104
- }
105
- },
106
- MuiAlert: {
107
- standardWarning: {
108
- border: '1px solid #ff9800',
109
- borderRadius: '0px'
110
- },
111
- action: {
112
- color: '#0075a9'
113
- },
114
- message: {
115
- fontSize: '14px',
116
- lineHeight: 1.43,
117
- letterSpacing: '0.25px',
118
- color: '#051039'
119
- }
120
- },
121
- MuiTabs: {
122
- root: {
123
- backgroundColor: '#ffffff',
124
- minHeight: '30px'
125
- },
126
- scrollButtons: {
127
- width: '20px'
128
- }
129
- },
130
- MuiTab: {
131
- root: {
132
- minHeight: '30px',
133
- textTransform: 'none',
134
- minWidth: '76px',
135
- // 100 minus 24 padding (12 left and 12 right)
136
- '@media (min-width: 600px)': {
137
- minWidth: '76px'
138
- }
139
- },
140
- labelIcon: {
141
- minHeight: '30px'
142
- }
143
- },
144
- MuiListItem: {
145
- root: {
146
- '&$selected': {
147
- backgroundColor: 'rgba(0, 117, 169, 0.15)',
148
- borderLeft: '4px solid #0075a9',
149
- '&:hover': {
150
- backgroundColor: 'rgba(0, 117, 169, 0.10)'
151
- }
152
- }
153
- },
154
- button: {
155
- '&:hover': {
156
- backgroundColor: 'rgba(0, 117, 169, 0.15)'
157
- }
158
- }
159
- },
160
- MuiFormLabel: {
161
- root: {
162
- color: 'rgba(5, 16, 57, 0.7)',
163
- '&$focused': {
164
- color: '#0075a9'
165
- }
166
- }
167
- },
168
- MuiFormControl: {
169
- root: {
170
- backgroundColor: 'rgba(0, 117, 169, 0.05)'
171
- }
172
- },
173
- MuiOutlinedInput: {
174
- root: {
175
- '&$focused $notchedOutline': {
176
- borderColor: '#0075a9'
177
- }
178
- }
179
- },
180
- MuiCardContent: {
181
- root: {
182
- '&:last-child': {
183
- paddingBottom: 0
184
- }
185
- }
186
- }
187
- }
188
- });
189
- exports.GWTheme = GWTheme;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const WithTheme: React.FC<{}>;
7
- export declare const WithoutTheme: React.FC<{}>;
package/theme.stories.js DELETED
@@ -1,120 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.WithoutTheme = exports.WithTheme = exports.default = void 0;
9
-
10
- var React = _interopRequireWildcard(require("react"));
11
-
12
- var _core = require("@material-ui/core");
13
-
14
- var _Notifications = _interopRequireDefault(require("@material-ui/icons/Notifications"));
15
-
16
- var _ = require(".");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
-
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- /* *
25
- * Licensed under the Apache License, Version 2.0 (the "License");
26
- * you may not use this file except in compliance with the License.
27
- * You may obtain a copy of the License at
28
- *
29
- * http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software
32
- * distributed under the License is distributed on an "AS IS" BASIS,
33
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
- * See the License for the specific language governing permissions and
35
- * limitations under the License.
36
- *
37
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
38
- * */
39
- var _default = {
40
- title: 'theme'
41
- };
42
- exports.default = _default;
43
- var useStyles = (0, _core.makeStyles)({
44
- sectionTitle: {
45
- fontSize: 18,
46
- borderBottom: '1px solid black'
47
- }
48
- }); // TODO: this is just a part of all styles, there are more defined in theme.tsx. It would be nice to have a complete overview so we can use it as a styleguide.
49
-
50
- var DemoComponent = function DemoComponent() {
51
- var classes = useStyles();
52
- return /*#__PURE__*/React.createElement(_core.Grid, {
53
- container: true,
54
- spacing: 1
55
- }, /*#__PURE__*/React.createElement(_core.Grid, {
56
- item: true,
57
- xs: 12
58
- }, /*#__PURE__*/React.createElement(_core.Typography, {
59
- variant: "h1",
60
- className: classes.sectionTitle
61
- }, "Typography"), /*#__PURE__*/React.createElement(_core.Typography, {
62
- variant: "h6"
63
- }, "h6"), /*#__PURE__*/React.createElement(_core.Typography, {
64
- variant: "subtitle1"
65
- }, "subtitle1"), /*#__PURE__*/React.createElement(_core.Typography, {
66
- variant: "subtitle2"
67
- }, "subtitle2"), /*#__PURE__*/React.createElement(_core.Typography, {
68
- variant: "body1"
69
- }, "body1"), /*#__PURE__*/React.createElement(_core.Typography, {
70
- variant: "body2"
71
- }, "body2"), /*#__PURE__*/React.createElement(_core.Typography, {
72
- variant: "overline"
73
- }, "overline"), /*#__PURE__*/React.createElement(_core.Typography, {
74
- variant: "caption"
75
- }, "caption"), /*#__PURE__*/React.createElement(_core.Typography, {
76
- variant: "button"
77
- }, "button")), /*#__PURE__*/React.createElement(_core.Grid, {
78
- item: true,
79
- xs: 12
80
- }, /*#__PURE__*/React.createElement(_core.Typography, {
81
- variant: "h1",
82
- className: classes.sectionTitle
83
- }, "Form elements"), /*#__PURE__*/React.createElement(_core.ButtonGroup, null, /*#__PURE__*/React.createElement(_core.Button, {
84
- color: "secondary"
85
- }, "One"), /*#__PURE__*/React.createElement(_core.Button, {
86
- color: "secondary"
87
- }, "Two"), /*#__PURE__*/React.createElement(_core.Button, {
88
- color: "secondary"
89
- }, "Three")), /*#__PURE__*/React.createElement(_core.Tabs, {
90
- indicatorColor: "secondary",
91
- textColor: "secondary",
92
- variant: "scrollable",
93
- scrollButtons: "auto",
94
- value: "ONE"
95
- }, /*#__PURE__*/React.createElement(_core.Tab, {
96
- label: "One",
97
- value: "ONE",
98
- icon: /*#__PURE__*/React.createElement(_Notifications.default, {
99
- fontSize: "small",
100
- color: "action"
101
- })
102
- }), /*#__PURE__*/React.createElement(_core.Tab, {
103
- label: "Two",
104
- value: "TWO"
105
- }))));
106
- };
107
-
108
- var WithTheme = function WithTheme() {
109
- return /*#__PURE__*/React.createElement(_core.ThemeProvider, {
110
- theme: _.GWTheme
111
- }, /*#__PURE__*/React.createElement(DemoComponent, null));
112
- };
113
-
114
- exports.WithTheme = WithTheme;
115
-
116
- var WithoutTheme = function WithoutTheme() {
117
- return /*#__PURE__*/React.createElement(DemoComponent, null);
118
- };
119
-
120
- exports.WithoutTheme = WithoutTheme;
package/theme.test.js DELETED
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- var React = _interopRequireWildcard(require("react"));
6
-
7
- var _core = require("@material-ui/core");
8
-
9
- var _react2 = require("@testing-library/react");
10
-
11
- var _theme = require("./theme");
12
-
13
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
14
-
15
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
-
17
- /* *
18
- * Licensed under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License.
20
- * You may obtain a copy of the License at
21
- *
22
- * http://www.apache.org/licenses/LICENSE-2.0
23
- *
24
- * Unless required by applicable law or agreed to in writing, software
25
- * distributed under the License is distributed on an "AS IS" BASIS,
26
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
- * See the License for the specific language governing permissions and
28
- * limitations under the License.
29
- *
30
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31
- * */
32
- describe('src/theme', function () {
33
- it('should render', function () {
34
- var _render = (0, _react2.render)( /*#__PURE__*/React.createElement(_core.ThemeProvider, {
35
- theme: _theme.GWTheme
36
- }, /*#__PURE__*/React.createElement(_core.Button, {
37
- "data-testid": "test-btn",
38
- color: "secondary"
39
- }, "One"))),
40
- getByTestId = _render.getByTestId;
41
-
42
- expect(getByTestId('test-btn')).toBeTruthy();
43
- });
44
- });