@opengeoweb/theme 3.0.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 +10 -11
- package/package.json +2 -3
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
|
|
101
|
+
const styles = {
|
|
102
102
|
button: {
|
|
103
|
-
border:
|
|
103
|
+
border: 'geowebColors.buttons.flatMouseOver.border',
|
|
104
104
|
'&:hover': {
|
|
105
|
-
backgroundColor:
|
|
105
|
+
backgroundColor: 'geowebColors.buttons.flatMouseOver.fill',
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
|
-
}
|
|
108
|
+
};
|
|
109
109
|
|
|
110
110
|
const MyButton: React.FC = () => {
|
|
111
|
-
|
|
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
|
|
329
|
+
const styles = {
|
|
331
330
|
header: {
|
|
332
|
-
boxShadow:
|
|
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
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/theme",
|
|
3
|
-
"version": "
|
|
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
|
}
|