@opengeoweb/theme 2.2.0 → 2.2.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.
package/index.esm.js CHANGED
@@ -72,6 +72,24 @@ function _nonIterableRest() {
72
72
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
73
73
  }
74
74
 
75
+ /* *
76
+ * Licensed under the Apache License, Version 2.0 (the "License");
77
+ * you may not use this file except in compliance with the License.
78
+ * You may obtain a copy of the License at
79
+ *
80
+ * http://www.apache.org/licenses/LICENSE-2.0
81
+ *
82
+ * Unless required by applicable law or agreed to in writing, software
83
+ * distributed under the License is distributed on an "AS IS" BASIS,
84
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
85
+ * See the License for the specific language governing permissions and
86
+ * limitations under the License.
87
+ *
88
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
89
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
90
+ * */
91
+ var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed'];
92
+
75
93
  var buttonStyle = function buttonStyle(button) {
76
94
  return {
77
95
  // default styling
@@ -127,32 +145,14 @@ var toggleButtonStyle = function toggleButtonStyle(buttonVariants) {
127
145
  }, {});
128
146
  };
129
147
  var buttonVariants = function buttonVariants(buttons) {
130
- return [{
131
- props: {
132
- variant: 'primary'
133
- },
134
- style: buttonStyle(buttons.primary)
135
- }, {
136
- props: {
137
- variant: 'secondary'
138
- },
139
- style: buttonStyle(buttons.secondary)
140
- }, {
141
- props: {
142
- variant: 'tertiary'
143
- },
144
- style: buttonStyle(buttons.tertiary)
145
- }, {
146
- props: {
147
- variant: 'flat'
148
- },
149
- style: buttonStyle(buttons.flat)
150
- }, {
151
- props: {
152
- variant: 'tool'
153
- },
154
- style: buttonStyle(buttons.tool)
155
- }];
148
+ return gwButtonVariants.map(function (variant) {
149
+ return {
150
+ props: {
151
+ variant: variant
152
+ },
153
+ style: buttonStyle(buttons[variant])
154
+ };
155
+ });
156
156
  };
157
157
 
158
158
  var hex2rgba = function hex2rgba(hex) {
@@ -694,23 +694,35 @@ var colors$1 = {
694
694
  borderColor: 'transparent'
695
695
  }
696
696
  },
697
- primaryMouseover: {
698
- fill: '#1047B0'
699
- },
700
- primaryActive: {
701
- fill: '#186DFF'
702
- },
703
- flatMouseover: {
704
- fill: '#E3E4E7'
697
+ boxed: {
698
+ "default": {
699
+ fill: 'transparent',
700
+ color: '#575F7A',
701
+ borderColor: '#575f7a'
702
+ },
703
+ mouseOver: {
704
+ fill: '#E3E4E7',
705
+ color: '#575F7A',
706
+ borderColor: '#575f7a'
707
+ },
708
+ active: {
709
+ fill: '#186DFF',
710
+ color: '#FFFFFF',
711
+ borderColor: 'transparent'
712
+ },
713
+ activeMouseOver: {
714
+ fill: '#1047B0',
715
+ color: '#FFFFFF',
716
+ borderColor: 'transparent'
717
+ },
718
+ disabled: {
719
+ fill: 'transparent',
720
+ color: '#707070',
721
+ borderColor: 'transparent'
722
+ }
705
723
  },
706
724
  focusDefault: {
707
725
  outline: 'solid 2px #419cfe'
708
- },
709
- disabled: {
710
- fill: '#E8E5E5'
711
- },
712
- surfaceIconDefault: {
713
- fill: '#F5F5F5'
714
726
  }
715
727
  },
716
728
  typographyAndIcons: {
@@ -1227,6 +1239,14 @@ var GWTheme = createTheme$1({
1227
1239
  maxWidth: '1280px'
1228
1240
  }
1229
1241
  }
1242
+ },
1243
+ MuiButton: {
1244
+ variants: buttonVariants(geowebColors.buttons)
1245
+ },
1246
+ MuiToggleButton: {
1247
+ styleOverrides: {
1248
+ root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
1249
+ }
1230
1250
  }
1231
1251
  }
1232
1252
  });
@@ -1412,23 +1432,35 @@ var colors = {
1412
1432
  borderColor: 'transparent'
1413
1433
  }
1414
1434
  },
1415
- primaryMouseover: {
1416
- fill: '#1047B0'
1417
- },
1418
- primaryActive: {
1419
- fill: '#186DFF'
1420
- },
1421
- flatMouseover: {
1422
- fill: '#494949'
1435
+ boxed: {
1436
+ "default": {
1437
+ fill: 'transparent',
1438
+ color: '#E5E5E5',
1439
+ borderColor: '#e5e5e5'
1440
+ },
1441
+ mouseOver: {
1442
+ fill: '#494949',
1443
+ color: '#E5E5E5',
1444
+ borderColor: '#e5e5e5'
1445
+ },
1446
+ active: {
1447
+ fill: '#186DFF',
1448
+ color: '#FFFFFF',
1449
+ borderColor: 'transparent'
1450
+ },
1451
+ activeMouseOver: {
1452
+ fill: '#1047B0',
1453
+ color: '#FFFFFF',
1454
+ borderColor: 'transparent'
1455
+ },
1456
+ disabled: {
1457
+ fill: 'transparent',
1458
+ color: '#B0B0B0',
1459
+ borderColor: 'transparent'
1460
+ }
1423
1461
  },
1424
1462
  focusDefault: {
1425
1463
  outline: 'solid 2px #419cfe'
1426
- },
1427
- disabled: {
1428
- fill: '#303030'
1429
- },
1430
- surfaceIconDefault: {
1431
- fill: '#2B2B2B'
1432
1464
  }
1433
1465
  },
1434
1466
  typographyAndIcons: {
@@ -1715,4 +1747,4 @@ var ThemeWrapperOldTheme = function ThemeWrapperOldTheme(_a) {
1715
1747
  }, props), children);
1716
1748
  };
1717
1749
 
1718
- export { GWTheme, ThemeContext, ThemeProvider, ThemeWrapper, ThemeWrapperOldTheme, darkTheme, lightTheme, useThemeContext };
1750
+ export { GWTheme, ThemeContext, ThemeProvider, ThemeWrapper, ThemeWrapperOldTheme, darkTheme, gwButtonVariants, lightTheme, useThemeContext };
package/index.umd.js CHANGED
@@ -79,6 +79,24 @@
79
79
  return ar;
80
80
  }
81
81
 
82
+ /* *
83
+ * Licensed under the Apache License, Version 2.0 (the "License");
84
+ * you may not use this file except in compliance with the License.
85
+ * You may obtain a copy of the License at
86
+ *
87
+ * http://www.apache.org/licenses/LICENSE-2.0
88
+ *
89
+ * Unless required by applicable law or agreed to in writing, software
90
+ * distributed under the License is distributed on an "AS IS" BASIS,
91
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92
+ * See the License for the specific language governing permissions and
93
+ * limitations under the License.
94
+ *
95
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
96
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
97
+ * */
98
+ var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed'];
99
+
82
100
  var buttonStyle = function buttonStyle(button) {
83
101
  return {
84
102
  // default styling
@@ -136,32 +154,14 @@
136
154
  }, {});
137
155
  };
138
156
  var buttonVariants = function buttonVariants(buttons) {
139
- return [{
140
- props: {
141
- variant: 'primary'
142
- },
143
- style: buttonStyle(buttons.primary)
144
- }, {
145
- props: {
146
- variant: 'secondary'
147
- },
148
- style: buttonStyle(buttons.secondary)
149
- }, {
150
- props: {
151
- variant: 'tertiary'
152
- },
153
- style: buttonStyle(buttons.tertiary)
154
- }, {
155
- props: {
156
- variant: 'flat'
157
- },
158
- style: buttonStyle(buttons.flat)
159
- }, {
160
- props: {
161
- variant: 'tool'
162
- },
163
- style: buttonStyle(buttons.tool)
164
- }];
157
+ return gwButtonVariants.map(function (variant) {
158
+ return {
159
+ props: {
160
+ variant: variant
161
+ },
162
+ style: buttonStyle(buttons[variant])
163
+ };
164
+ });
165
165
  };
166
166
 
167
167
  var hex2rgba = function hex2rgba(hex, alpha) {
@@ -708,23 +708,35 @@
708
708
  borderColor: 'transparent'
709
709
  }
710
710
  },
711
- primaryMouseover: {
712
- fill: '#1047B0'
713
- },
714
- primaryActive: {
715
- fill: '#186DFF'
716
- },
717
- flatMouseover: {
718
- fill: '#E3E4E7'
711
+ boxed: {
712
+ "default": {
713
+ fill: 'transparent',
714
+ color: '#575F7A',
715
+ borderColor: '#575f7a'
716
+ },
717
+ mouseOver: {
718
+ fill: '#E3E4E7',
719
+ color: '#575F7A',
720
+ borderColor: '#575f7a'
721
+ },
722
+ active: {
723
+ fill: '#186DFF',
724
+ color: '#FFFFFF',
725
+ borderColor: 'transparent'
726
+ },
727
+ activeMouseOver: {
728
+ fill: '#1047B0',
729
+ color: '#FFFFFF',
730
+ borderColor: 'transparent'
731
+ },
732
+ disabled: {
733
+ fill: 'transparent',
734
+ color: '#707070',
735
+ borderColor: 'transparent'
736
+ }
719
737
  },
720
738
  focusDefault: {
721
739
  outline: 'solid 2px #419cfe'
722
- },
723
- disabled: {
724
- fill: '#E8E5E5'
725
- },
726
- surfaceIconDefault: {
727
- fill: '#F5F5F5'
728
740
  }
729
741
  },
730
742
  typographyAndIcons: {
@@ -1225,6 +1237,14 @@
1225
1237
  maxWidth: '1280px'
1226
1238
  }
1227
1239
  }
1240
+ },
1241
+ MuiButton: {
1242
+ variants: buttonVariants(geowebColors.buttons)
1243
+ },
1244
+ MuiToggleButton: {
1245
+ styleOverrides: {
1246
+ root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
1247
+ }
1228
1248
  }
1229
1249
  }
1230
1250
  });
@@ -1383,23 +1403,35 @@
1383
1403
  borderColor: 'transparent'
1384
1404
  }
1385
1405
  },
1386
- primaryMouseover: {
1387
- fill: '#1047B0'
1388
- },
1389
- primaryActive: {
1390
- fill: '#186DFF'
1391
- },
1392
- flatMouseover: {
1393
- fill: '#494949'
1406
+ boxed: {
1407
+ "default": {
1408
+ fill: 'transparent',
1409
+ color: '#E5E5E5',
1410
+ borderColor: '#e5e5e5'
1411
+ },
1412
+ mouseOver: {
1413
+ fill: '#494949',
1414
+ color: '#E5E5E5',
1415
+ borderColor: '#e5e5e5'
1416
+ },
1417
+ active: {
1418
+ fill: '#186DFF',
1419
+ color: '#FFFFFF',
1420
+ borderColor: 'transparent'
1421
+ },
1422
+ activeMouseOver: {
1423
+ fill: '#1047B0',
1424
+ color: '#FFFFFF',
1425
+ borderColor: 'transparent'
1426
+ },
1427
+ disabled: {
1428
+ fill: 'transparent',
1429
+ color: '#B0B0B0',
1430
+ borderColor: 'transparent'
1431
+ }
1394
1432
  },
1395
1433
  focusDefault: {
1396
1434
  outline: 'solid 2px #419cfe'
1397
- },
1398
- disabled: {
1399
- fill: '#303030'
1400
- },
1401
- surfaceIconDefault: {
1402
- fill: '#2B2B2B'
1403
1435
  }
1404
1436
  },
1405
1437
  typographyAndIcons: {
@@ -1691,6 +1723,7 @@
1691
1723
  exports.ThemeWrapper = ThemeWrapper;
1692
1724
  exports.ThemeWrapperOldTheme = ThemeWrapperOldTheme;
1693
1725
  exports.darkTheme = darkTheme;
1726
+ exports.gwButtonVariants = gwButtonVariants;
1694
1727
  exports.lightTheme = lightTheme;
1695
1728
  exports.useThemeContext = useThemeContext;
1696
1729
 
@@ -2,6 +2,8 @@
2
2
  interface CSSProperties extends React.CSSProperties {
3
3
  rgba?: string;
4
4
  }
5
+ export declare const gwButtonVariants: readonly ["primary", "secondary", "tertiary", "flat", "tool", "boxed"];
6
+ export declare type ButtonVariant = typeof gwButtonVariants[number];
5
7
  export interface ButtonStyle {
6
8
  default: CSSProperties;
7
9
  mouseOver: CSSProperties;
@@ -15,12 +17,8 @@ export interface ButtonStyles {
15
17
  tertiary: ButtonStyle;
16
18
  flat: ButtonStyle;
17
19
  tool: ButtonStyle;
18
- primaryMouseover: CSSProperties;
19
- primaryActive: CSSProperties;
20
- flatMouseover: CSSProperties;
20
+ boxed: ButtonStyle;
21
21
  focusDefault: CSSProperties;
22
- disabled: CSSProperties;
23
- surfaceIconDefault: CSSProperties;
24
22
  }
25
23
  export declare type GeowebColorPalette = {
26
24
  background: {
@@ -137,6 +135,7 @@ declare module '@mui/material/Button' {
137
135
  tertiary: true;
138
136
  flat: true;
139
137
  tool: true;
138
+ boxed: true;
140
139
  }
141
140
  }
142
141
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/theme",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "GeoWeb Theme library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {