@opengeoweb/theme 2.14.0 → 4.0.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/README.md CHANGED
@@ -95,21 +95,20 @@ export const Wrapper: React.FC = () => (
95
95
 
96
96
  > **note** make sure to use the ThemeProvider in unit tests too, as they will fail otherwise
97
97
 
98
- 2. Use the style/color in your component. The theme palette can be found as `geowebColor` property inside the `theme.palette` of the MUI Theme
98
+ 2. Use the style/color in your component. You can do this directly by passing an style object as `sx` props or create an object with styles which could be handy if you need to reuse styles. The theme palette can be found as `geowebColor` property inside the `theme.palette` of the MUI Theme
99
99
 
100
100
  ```javascript
101
- const useStyles = makeStyles((theme: Theme) => ({
101
+ const styles = {
102
102
  button: {
103
- border: theme.palette.geowebColors.buttons.flatMouseOver.border,
103
+ border: 'geowebColors.buttons.flatMouseOver.border',
104
104
  '&:hover': {
105
- backgroundColor: theme.palette.geowebColors.buttons.flatMouseOver.fill,
105
+ backgroundColor: 'geowebColors.buttons.flatMouseOver.fill',
106
106
  },
107
107
  },
108
- }));
108
+ };
109
109
 
110
110
  const MyButton: React.FC = () => {
111
- const classes = useStyles();
112
- return <Button className={classes.button}>content</Button>;
111
+ return <Button sx={styles.button}>content</Button>;
113
112
  };
114
113
  ```
115
114
 
@@ -327,11 +326,11 @@ Contains demo stories with MUI components. Every story is build with the `StoryW
327
326
  - The **Elevation** shows all elevations we currently have. These can be used for defining `box-shadow` for elements. If you want to use the elevation in code:
328
327
 
329
328
  ```javascript
330
- const useStyles = makeStyles((theme: Theme) => ({
329
+ const styles = {
331
330
  header: {
332
- boxShadow: theme.shadows[1], // elevation_01
331
+ boxShadow: 1, // elevation_01
333
332
  },
334
- }));
333
+ };
335
334
  ```
336
335
 
337
336
  - The rest of the stories are for showing the MUI elements without any styling, other then the given theme styling.
@@ -449,7 +448,7 @@ This footer is only used for when the wrapper is resizable. Therefore it would m
449
448
 
450
449
  - do follow design names, if you feel the name has too much repeat in it or can be changed, ask [Didier](https://gitlab.com/didier.dezanet)! Same for missing colors .
451
450
  - do add links to design in code
452
- - do create shared components that are used in knmi-geoweb and reference application in the `shared` lib
451
+ - do create shared components that are used in opengeoweb application in the `shared` lib
453
452
  - do add a ThemeProvider for components with a new theme styling. Otherwise unit tests will break
454
453
  - do discuss the library and the usage of it. If you think it can be approved please let us know!
455
454
 
package/index.esm.js CHANGED
@@ -1237,6 +1237,46 @@ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
1237
1237
  }
1238
1238
  }
1239
1239
  }
1240
+ },
1241
+ MuiSwitch: {
1242
+ styleOverrides: {
1243
+ switchBase: {
1244
+ color: geowebColors.customSwitch.thumb,
1245
+ '&.Mui-checked': {
1246
+ color: geowebColors.customSwitch.thumb
1247
+ },
1248
+ '&.Mui-disabled': {
1249
+ color: geowebColors.customSwitch.thumbDisabled
1250
+ },
1251
+ '&.Mui-checked.Mui-disabled': {
1252
+ color: geowebColors.customSwitch.thumbDisabled
1253
+ },
1254
+ '&.Mui-checked+.MuiSwitch-track': {
1255
+ backgroundColor: geowebColors.customSwitch.trackActive
1256
+ },
1257
+ '&.Mui-disabled+.MuiSwitch-track': {
1258
+ backgroundColor: geowebColors.customSwitch.track
1259
+ },
1260
+ '&.Mui-checked.Mui-disabled+.MuiSwitch-track': {
1261
+ backgroundColor: geowebColors.customSwitch.trackActive
1262
+ }
1263
+ },
1264
+ track: {
1265
+ backgroundColor: geowebColors.customSwitch.track,
1266
+ opacity: '1 !important'
1267
+ }
1268
+ }
1269
+ },
1270
+ MuiSnackbarContent: {
1271
+ styleOverrides: {
1272
+ root: {
1273
+ backgroundColor: geowebColors.snackbar.background,
1274
+ color: geowebColors.snackbar.text,
1275
+ fontSize: '16px',
1276
+ letterSpacing: '0.44px',
1277
+ borderRadius: '2px'
1278
+ }
1279
+ }
1240
1280
  }
1241
1281
  }
1242
1282
  });
@@ -1577,9 +1617,13 @@ var colors$1 = {
1577
1617
  thumb: '#F8F9F9',
1578
1618
  thumbDisabled: '#CCCCCC',
1579
1619
  mark: '#FFFFFF',
1580
- markDisabled: '#FFFFFF',
1581
- switchTrack: '#72BB23',
1582
- switchTrackDisabled: '#767676'
1620
+ markDisabled: '#FFFFFF'
1621
+ },
1622
+ customSwitch: {
1623
+ thumb: '#F8F9F9',
1624
+ thumbDisabled: '#F5F5F5',
1625
+ track: '#707070',
1626
+ trackActive: '#186DFF'
1583
1627
  },
1584
1628
  syncGroups: {
1585
1629
  drawerOpen: {
@@ -1658,6 +1702,12 @@ var colors$1 = {
1658
1702
  fill: '#DFF2FD',
1659
1703
  border: '1px solid #0062E6'
1660
1704
  }
1705
+ },
1706
+ snackbar: {
1707
+ background: '#051039',
1708
+ text: '#FFFFFF',
1709
+ action: '#98e1f1',
1710
+ actionHover: '#494949'
1661
1711
  }
1662
1712
  }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/609bb6a5287bd1abe0de39a7
1663
1713
 
@@ -2313,9 +2363,13 @@ var colors = {
2313
2363
  thumb: '#F8F9F9',
2314
2364
  thumbDisabled: '#5E5E5E',
2315
2365
  mark: '#FFFFFF',
2316
- markDisabled: '#303030',
2317
- switchTrack: '#72BB23',
2318
- switchTrackDisabled: '#E8E5E5'
2366
+ markDisabled: '#303030'
2367
+ },
2368
+ customSwitch: {
2369
+ thumb: '#F8F9F9',
2370
+ thumbDisabled: '#F5F5F5',
2371
+ track: '#BDBDBD',
2372
+ trackActive: '#488BFD'
2319
2373
  },
2320
2374
  syncGroups: {
2321
2375
  drawerOpen: {
@@ -2394,6 +2448,12 @@ var colors = {
2394
2448
  fill: 'rgba(24, 109, 255, 0.25)',
2395
2449
  border: '1px solid #186DFF'
2396
2450
  }
2451
+ },
2452
+ snackbar: {
2453
+ background: '#051039',
2454
+ text: '#FFFFFF',
2455
+ action: '#98e1f1',
2456
+ actionHover: '#494949'
2397
2457
  }
2398
2458
  }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/6093e694124ecf3886de76d4
2399
2459
 
package/index.umd.js CHANGED
@@ -1224,6 +1224,46 @@
1224
1224
  }
1225
1225
  }
1226
1226
  }
1227
+ },
1228
+ MuiSwitch: {
1229
+ styleOverrides: {
1230
+ switchBase: {
1231
+ color: geowebColors.customSwitch.thumb,
1232
+ '&.Mui-checked': {
1233
+ color: geowebColors.customSwitch.thumb
1234
+ },
1235
+ '&.Mui-disabled': {
1236
+ color: geowebColors.customSwitch.thumbDisabled
1237
+ },
1238
+ '&.Mui-checked.Mui-disabled': {
1239
+ color: geowebColors.customSwitch.thumbDisabled
1240
+ },
1241
+ '&.Mui-checked+.MuiSwitch-track': {
1242
+ backgroundColor: geowebColors.customSwitch.trackActive
1243
+ },
1244
+ '&.Mui-disabled+.MuiSwitch-track': {
1245
+ backgroundColor: geowebColors.customSwitch.track
1246
+ },
1247
+ '&.Mui-checked.Mui-disabled+.MuiSwitch-track': {
1248
+ backgroundColor: geowebColors.customSwitch.trackActive
1249
+ }
1250
+ },
1251
+ track: {
1252
+ backgroundColor: geowebColors.customSwitch.track,
1253
+ opacity: '1 !important'
1254
+ }
1255
+ }
1256
+ },
1257
+ MuiSnackbarContent: {
1258
+ styleOverrides: {
1259
+ root: {
1260
+ backgroundColor: geowebColors.snackbar.background,
1261
+ color: geowebColors.snackbar.text,
1262
+ fontSize: '16px',
1263
+ letterSpacing: '0.44px',
1264
+ borderRadius: '2px'
1265
+ }
1266
+ }
1227
1267
  }
1228
1268
  }
1229
1269
  });
@@ -1564,9 +1604,13 @@
1564
1604
  thumb: '#F8F9F9',
1565
1605
  thumbDisabled: '#CCCCCC',
1566
1606
  mark: '#FFFFFF',
1567
- markDisabled: '#FFFFFF',
1568
- switchTrack: '#72BB23',
1569
- switchTrackDisabled: '#767676'
1607
+ markDisabled: '#FFFFFF'
1608
+ },
1609
+ customSwitch: {
1610
+ thumb: '#F8F9F9',
1611
+ thumbDisabled: '#F5F5F5',
1612
+ track: '#707070',
1613
+ trackActive: '#186DFF'
1570
1614
  },
1571
1615
  syncGroups: {
1572
1616
  drawerOpen: {
@@ -1645,6 +1689,12 @@
1645
1689
  fill: '#DFF2FD',
1646
1690
  border: '1px solid #0062E6'
1647
1691
  }
1692
+ },
1693
+ snackbar: {
1694
+ background: '#051039',
1695
+ text: '#FFFFFF',
1696
+ action: '#98e1f1',
1697
+ actionHover: '#494949'
1648
1698
  }
1649
1699
  }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/609bb6a5287bd1abe0de39a7
1650
1700
 
@@ -2284,9 +2334,13 @@
2284
2334
  thumb: '#F8F9F9',
2285
2335
  thumbDisabled: '#5E5E5E',
2286
2336
  mark: '#FFFFFF',
2287
- markDisabled: '#303030',
2288
- switchTrack: '#72BB23',
2289
- switchTrackDisabled: '#E8E5E5'
2337
+ markDisabled: '#303030'
2338
+ },
2339
+ customSwitch: {
2340
+ thumb: '#F8F9F9',
2341
+ thumbDisabled: '#F5F5F5',
2342
+ track: '#BDBDBD',
2343
+ trackActive: '#488BFD'
2290
2344
  },
2291
2345
  syncGroups: {
2292
2346
  drawerOpen: {
@@ -2365,6 +2419,12 @@
2365
2419
  fill: 'rgba(24, 109, 255, 0.25)',
2366
2420
  border: '1px solid #186DFF'
2367
2421
  }
2422
+ },
2423
+ snackbar: {
2424
+ background: '#051039',
2425
+ text: '#FFFFFF',
2426
+ action: '#98e1f1',
2427
+ actionHover: '#494949'
2368
2428
  }
2369
2429
  }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/6093e694124ecf3886de76d4
2370
2430
 
@@ -98,8 +98,12 @@ export declare type GeowebColorPalette = {
98
98
  thumbDisabled: CSSProperties['color'];
99
99
  mark: CSSProperties['color'];
100
100
  markDisabled: CSSProperties['color'];
101
- switchTrack: CSSProperties['color'];
102
- switchTrackDisabled: CSSProperties['color'];
101
+ };
102
+ customSwitch: {
103
+ thumb: CSSProperties['color'];
104
+ thumbDisabled: CSSProperties['color'];
105
+ track: CSSProperties['color'];
106
+ trackActive: CSSProperties['color'];
103
107
  };
104
108
  syncGroups: {
105
109
  drawerOpen: CSSProperties;
@@ -131,6 +135,12 @@ export declare type GeowebColorPalette = {
131
135
  notification: CSSProperties['color'];
132
136
  notificationOutline: CSSProperties;
133
137
  };
138
+ snackbar: {
139
+ background: CSSProperties['color'];
140
+ text: CSSProperties['color'];
141
+ action: CSSProperties['color'];
142
+ actionHover: CSSProperties['color'];
143
+ };
134
144
  };
135
145
  export declare type Elevations = {
136
146
  [id: string]: string;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface SnackbarDemoProps {
3
+ open?: boolean;
4
+ handleClose?: () => void;
5
+ }
6
+ export declare const SnackbarDemo: React.FC<SnackbarDemoProps>;
7
+ export declare const Snackbar: React.FC;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare const SwitchDemo: React.FC;
3
+ export declare const Switch: React.FC;
@@ -16,6 +16,8 @@ export { TextFields } from './TextField.stories';
16
16
  export { Breakpoints } from './Breakpoints.stories';
17
17
  export { Icons } from './Icons.stories';
18
18
  export { FormElementsGWTheme, FormElements } from './FormElements.stories';
19
+ export { Switch } from './Switch.stories';
20
+ export { Snackbar } from './Snackbar.stories';
19
21
  declare const _default: {
20
22
  title: string;
21
23
  };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const SnackbarLight: () => React.ReactElement;
7
+ export declare const SnackbarDark: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const SwitchLight: () => React.ReactElement;
7
+ export declare const SwitchDark: () => React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/theme",
3
- "version": "2.14.0",
3
+ "version": "4.0.0",
4
4
  "description": "GeoWeb Theme library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,7 +13,6 @@
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
- "@mui/material": "^5.2.8",
17
- "@mui/styles": "^5.2.3"
16
+ "@mui/material": "^5.2.8"
18
17
  }
19
18
  }