@opengeoweb/theme 2.2.1 → 2.3.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/index.esm.js CHANGED
@@ -90,18 +90,12 @@ function _nonIterableRest() {
90
90
  * */
91
91
  var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed'];
92
92
 
93
- var buttonStyle = function buttonStyle(button) {
93
+ var defaultButtonStyle = function defaultButtonStyle(button) {
94
94
  return {
95
95
  // default styling
96
96
  color: button["default"].color,
97
97
  backgroundColor: button["default"].fill,
98
98
  textTransform: 'capitalize',
99
- padding: '12px 8px',
100
- height: '40px',
101
- borderStyle: 'solid',
102
- borderWidth: '1px',
103
- borderColor: button["default"].borderColor,
104
- borderRadius: '5px',
105
99
  // hover styling
106
100
  '&:hover': {
107
101
  backgroundColor: button.mouseOver.fill,
@@ -121,7 +115,17 @@ var buttonStyle = function buttonStyle(button) {
121
115
  backgroundColor: button.disabled.fill,
122
116
  color: button.disabled.color,
123
117
  borderColor: button.disabled.borderColor
124
- },
118
+ }
119
+ };
120
+ };
121
+ var buttonStyle = function buttonStyle(button) {
122
+ return Object.assign(Object.assign({}, defaultButtonStyle(button)), {
123
+ padding: '12px 8px',
124
+ height: '40px',
125
+ borderStyle: 'solid',
126
+ borderWidth: '1px',
127
+ borderColor: button["default"].borderColor,
128
+ borderRadius: '5px',
125
129
  // size styling
126
130
  '&[class*="sizeSmall"]': {
127
131
  fontSize: '12px',
@@ -135,9 +139,9 @@ var buttonStyle = function buttonStyle(button) {
135
139
  fontSize: '26px'
136
140
  }
137
141
  }
138
- };
142
+ });
139
143
  };
140
- var toggleButtonStyle = function toggleButtonStyle(buttonVariants) {
144
+ var variantsToClassName = function variantsToClassName(buttonVariants) {
141
145
  return buttonVariants.reduce(function (variants, _ref) {
142
146
  var variant = _ref.props.variant,
143
147
  style = _ref.style;
@@ -234,7 +238,13 @@ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
234
238
  },
235
239
  MuiToggleButton: {
236
240
  styleOverrides: {
237
- root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
241
+ root: variantsToClassName(buttonVariants(geowebColors.buttons))
242
+ }
243
+ },
244
+ MuiIconButton: {
245
+ // TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/1926 remove default styling and create CustomIconButton
246
+ styleOverrides: {
247
+ root: defaultButtonStyle(geowebColors.buttons.flat)
238
248
  }
239
249
  },
240
250
  MuiCssBaseline: {
@@ -243,17 +253,16 @@ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
243
253
  MuiMenuItem: {
244
254
  styleOverrides: {
245
255
  root: {
256
+ minHeight: '48px!important',
246
257
  fontSize: '0.875rem',
247
258
  letterSpacing: '0.25px',
248
- ':not(:last-child)&:after': {
249
- content: '""',
250
- position: 'absolute',
251
- width: '100%',
252
- height: 1,
253
- background: geowebColors.greys.accessible,
254
- bottom: 0,
255
- left: 0,
256
- opacity: 0.5
259
+ divider: {
260
+ borderBottomColor: geowebColors.greys.accessibleLight
261
+ },
262
+ li: {
263
+ '&:hover': {
264
+ backgroundColor: geowebColors.tab.mouseOver.rgba
265
+ }
257
266
  },
258
267
  '&.Mui-selected': {
259
268
  background: 'none',
@@ -404,13 +413,23 @@ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
404
413
  styleOverrides: {
405
414
  root: {
406
415
  color: geowebColors.typographyAndIcons.text,
407
- fontSize: '14px'
416
+ fontSize: '14px',
417
+ minHeight: '36px'
408
418
  },
409
419
  divider: {
410
420
  borderBottomColor: hex2rgba(geowebColors.greys.accessible, 0.2)
411
421
  }
412
422
  }
413
423
  },
424
+ MuiListItemIcon: {
425
+ styleOverrides: {
426
+ root: {
427
+ color: geowebColors.typographyAndIcons.icon,
428
+ width: '24px',
429
+ height: '24px'
430
+ }
431
+ }
432
+ },
414
433
  MuiBackdrop: {
415
434
  styleOverrides: {
416
435
  root: {
@@ -479,20 +498,33 @@ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
479
498
  }
480
499
  }
481
500
  },
501
+ MuiTextField: {
502
+ defaultProps: {
503
+ variant: 'filled'
504
+ }
505
+ },
482
506
  MuiFilledInput: {
483
507
  styleOverrides: {
484
508
  root: {
485
509
  backgroundColor: geowebColors.textInputField["default"].rgba,
486
510
  '&.Mui-focused': {
487
- backgroundColor: geowebColors.textInputField.active.rgba
511
+ backgroundColor: geowebColors.textInputField.active.rgba,
512
+ '&:after': {
513
+ borderColor: 'transparent'
514
+ }
488
515
  },
489
516
  '&.Mui-disabled': {
490
517
  backgroundColor: geowebColors.textInputField.disabled.rgba
518
+ },
519
+ '&.Mui-error': {
520
+ '&:after': {
521
+ borderColor: geowebColors.captions.captionError.color
522
+ }
491
523
  }
492
524
  },
493
525
  underline: {
494
526
  '&:after': {
495
- borderBottom: 'transparent'
527
+ borderWidth: '1px'
496
528
  },
497
529
  '&.Mui-disabled:before': {
498
530
  borderBottomStyle: 'solid'
@@ -755,7 +787,8 @@ var colors$1 = {
755
787
  }
756
788
  },
757
789
  greys: {
758
- accessible: '#767676'
790
+ accessible: '#767676',
791
+ accessibleLight: '#C5C5C5'
759
792
  },
760
793
  cards: {
761
794
  cardContainer: '#FFFFFF',
@@ -875,10 +908,6 @@ var colors$1 = {
875
908
  }
876
909
  },
877
910
  layerManager: {
878
- tableRowDefaultIcon: {
879
- fill: '#051039',
880
- opacity: 0.67
881
- },
882
911
  tableRowDefaultText: {
883
912
  color: '#051039',
884
913
  opacity: 0.87,
@@ -892,9 +921,6 @@ var colors$1 = {
892
921
  fill: '#051039',
893
922
  opacity: 0.07
894
923
  },
895
- tableRowDisabledIcon: {
896
- fill: '#767676'
897
- },
898
924
  tableRowDisabledText: {
899
925
  color: '#767676',
900
926
  opacity: 0.87,
@@ -1245,7 +1271,7 @@ var GWTheme = createTheme$1({
1245
1271
  },
1246
1272
  MuiToggleButton: {
1247
1273
  styleOverrides: {
1248
- root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
1274
+ root: variantsToClassName(buttonVariants(geowebColors.buttons))
1249
1275
  }
1250
1276
  }
1251
1277
  }
@@ -1493,7 +1519,8 @@ var colors = {
1493
1519
  }
1494
1520
  },
1495
1521
  greys: {
1496
- accessible: '#A2A2A2'
1522
+ accessible: '#A2A2A2',
1523
+ accessibleLight: '#6F6F6F'
1497
1524
  },
1498
1525
  cards: {
1499
1526
  cardContainer: '#303030',
@@ -1613,10 +1640,6 @@ var colors = {
1613
1640
  }
1614
1641
  },
1615
1642
  layerManager: {
1616
- tableRowDefaultIcon: {
1617
- fill: '#C5C5C5',
1618
- opacity: 1
1619
- },
1620
1643
  tableRowDefaultText: {
1621
1644
  color: '#FFFFFF',
1622
1645
  opacity: 0.87,
@@ -1630,9 +1653,6 @@ var colors = {
1630
1653
  fill: '#000000',
1631
1654
  opacity: 0.15
1632
1655
  },
1633
- tableRowDisabledIcon: {
1634
- fill: '#A2A2A2'
1635
- },
1636
1656
  tableRowDisabledText: {
1637
1657
  color: '#909090',
1638
1658
  opacity: 0.87,
package/index.umd.js CHANGED
@@ -97,18 +97,12 @@
97
97
  * */
98
98
  var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed'];
99
99
 
100
- var buttonStyle = function buttonStyle(button) {
100
+ var defaultButtonStyle = function defaultButtonStyle(button) {
101
101
  return {
102
102
  // default styling
103
103
  color: button["default"].color,
104
104
  backgroundColor: button["default"].fill,
105
105
  textTransform: 'capitalize',
106
- padding: '12px 8px',
107
- height: '40px',
108
- borderStyle: 'solid',
109
- borderWidth: '1px',
110
- borderColor: button["default"].borderColor,
111
- borderRadius: '5px',
112
106
  // hover styling
113
107
  '&:hover': {
114
108
  backgroundColor: button.mouseOver.fill,
@@ -128,7 +122,17 @@
128
122
  backgroundColor: button.disabled.fill,
129
123
  color: button.disabled.color,
130
124
  borderColor: button.disabled.borderColor
131
- },
125
+ }
126
+ };
127
+ };
128
+ var buttonStyle = function buttonStyle(button) {
129
+ return __assign(__assign({}, defaultButtonStyle(button)), {
130
+ padding: '12px 8px',
131
+ height: '40px',
132
+ borderStyle: 'solid',
133
+ borderWidth: '1px',
134
+ borderColor: button["default"].borderColor,
135
+ borderRadius: '5px',
132
136
  // size styling
133
137
  '&[class*="sizeSmall"]': {
134
138
  fontSize: '12px',
@@ -142,9 +146,9 @@
142
146
  fontSize: '26px'
143
147
  }
144
148
  }
145
- };
149
+ });
146
150
  };
147
- var toggleButtonStyle = function toggleButtonStyle(buttonVariants) {
151
+ var variantsToClassName = function variantsToClassName(buttonVariants) {
148
152
  return buttonVariants.reduce(function (variants, _a) {
149
153
  var _b;
150
154
 
@@ -248,7 +252,13 @@
248
252
  },
249
253
  MuiToggleButton: {
250
254
  styleOverrides: {
251
- root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
255
+ root: variantsToClassName(buttonVariants(geowebColors.buttons))
256
+ }
257
+ },
258
+ MuiIconButton: {
259
+ // TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/1926 remove default styling and create CustomIconButton
260
+ styleOverrides: {
261
+ root: defaultButtonStyle(geowebColors.buttons.flat)
252
262
  }
253
263
  },
254
264
  MuiCssBaseline: {
@@ -257,17 +267,16 @@
257
267
  MuiMenuItem: {
258
268
  styleOverrides: {
259
269
  root: {
270
+ minHeight: '48px!important',
260
271
  fontSize: '0.875rem',
261
272
  letterSpacing: '0.25px',
262
- ':not(:last-child)&:after': {
263
- content: '""',
264
- position: 'absolute',
265
- width: '100%',
266
- height: 1,
267
- background: geowebColors.greys.accessible,
268
- bottom: 0,
269
- left: 0,
270
- opacity: 0.5
273
+ divider: {
274
+ borderBottomColor: geowebColors.greys.accessibleLight
275
+ },
276
+ li: {
277
+ '&:hover': {
278
+ backgroundColor: geowebColors.tab.mouseOver.rgba
279
+ }
271
280
  },
272
281
  '&.Mui-selected': {
273
282
  background: 'none',
@@ -418,13 +427,23 @@
418
427
  styleOverrides: {
419
428
  root: {
420
429
  color: geowebColors.typographyAndIcons.text,
421
- fontSize: '14px'
430
+ fontSize: '14px',
431
+ minHeight: '36px'
422
432
  },
423
433
  divider: {
424
434
  borderBottomColor: hex2rgba(geowebColors.greys.accessible, 0.2)
425
435
  }
426
436
  }
427
437
  },
438
+ MuiListItemIcon: {
439
+ styleOverrides: {
440
+ root: {
441
+ color: geowebColors.typographyAndIcons.icon,
442
+ width: '24px',
443
+ height: '24px'
444
+ }
445
+ }
446
+ },
428
447
  MuiBackdrop: {
429
448
  styleOverrides: {
430
449
  root: {
@@ -493,20 +512,33 @@
493
512
  }
494
513
  }
495
514
  },
515
+ MuiTextField: {
516
+ defaultProps: {
517
+ variant: 'filled'
518
+ }
519
+ },
496
520
  MuiFilledInput: {
497
521
  styleOverrides: {
498
522
  root: {
499
523
  backgroundColor: geowebColors.textInputField["default"].rgba,
500
524
  '&.Mui-focused': {
501
- backgroundColor: geowebColors.textInputField.active.rgba
525
+ backgroundColor: geowebColors.textInputField.active.rgba,
526
+ '&:after': {
527
+ borderColor: 'transparent'
528
+ }
502
529
  },
503
530
  '&.Mui-disabled': {
504
531
  backgroundColor: geowebColors.textInputField.disabled.rgba
532
+ },
533
+ '&.Mui-error': {
534
+ '&:after': {
535
+ borderColor: geowebColors.captions.captionError.color
536
+ }
505
537
  }
506
538
  },
507
539
  underline: {
508
540
  '&:after': {
509
- borderBottom: 'transparent'
541
+ borderWidth: '1px'
510
542
  },
511
543
  '&.Mui-disabled:before': {
512
544
  borderBottomStyle: 'solid'
@@ -769,7 +801,8 @@
769
801
  }
770
802
  },
771
803
  greys: {
772
- accessible: '#767676'
804
+ accessible: '#767676',
805
+ accessibleLight: '#C5C5C5'
773
806
  },
774
807
  cards: {
775
808
  cardContainer: '#FFFFFF',
@@ -889,10 +922,6 @@
889
922
  }
890
923
  },
891
924
  layerManager: {
892
- tableRowDefaultIcon: {
893
- fill: '#051039',
894
- opacity: 0.67
895
- },
896
925
  tableRowDefaultText: {
897
926
  color: '#051039',
898
927
  opacity: 0.87,
@@ -906,9 +935,6 @@
906
935
  fill: '#051039',
907
936
  opacity: 0.07
908
937
  },
909
- tableRowDisabledIcon: {
910
- fill: '#767676'
911
- },
912
938
  tableRowDisabledText: {
913
939
  color: '#767676',
914
940
  opacity: 0.87,
@@ -1243,7 +1269,7 @@
1243
1269
  },
1244
1270
  MuiToggleButton: {
1245
1271
  styleOverrides: {
1246
- root: toggleButtonStyle(buttonVariants(geowebColors.buttons))
1272
+ root: variantsToClassName(buttonVariants(geowebColors.buttons))
1247
1273
  }
1248
1274
  }
1249
1275
  }
@@ -1464,7 +1490,8 @@
1464
1490
  }
1465
1491
  },
1466
1492
  greys: {
1467
- accessible: '#A2A2A2'
1493
+ accessible: '#A2A2A2',
1494
+ accessibleLight: '#6F6F6F'
1468
1495
  },
1469
1496
  cards: {
1470
1497
  cardContainer: '#303030',
@@ -1584,10 +1611,6 @@
1584
1611
  }
1585
1612
  },
1586
1613
  layerManager: {
1587
- tableRowDefaultIcon: {
1588
- fill: '#C5C5C5',
1589
- opacity: 1
1590
- },
1591
1614
  tableRowDefaultText: {
1592
1615
  color: '#FFFFFF',
1593
1616
  opacity: 0.87,
@@ -1601,9 +1624,6 @@
1601
1624
  fill: '#000000',
1602
1625
  opacity: 0.15
1603
1626
  },
1604
- tableRowDisabledIcon: {
1605
- fill: '#A2A2A2'
1606
- },
1607
1627
  tableRowDisabledText: {
1608
1628
  color: '#909090',
1609
1629
  opacity: 0.87,
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface StoryHeaderProps {
3
+ title: string;
4
+ }
5
+ export declare const StoryHeader: React.FC<StoryHeaderProps>;
6
+ export default StoryHeader;
@@ -0,0 +1 @@
1
+ export * from './StoryHeader';
@@ -1,5 +1,6 @@
1
- import { ComponentsVariants, CSSInterpolation } from '@mui/material';
1
+ import { ComponentsVariants, CSSInterpolation, CSSObject } from '@mui/material';
2
2
  import { ButtonStyles, ButtonStyle } from './types';
3
+ export declare const defaultButtonStyle: (button: ButtonStyle) => CSSObject;
3
4
  export declare const buttonStyle: (button: ButtonStyle) => CSSInterpolation;
4
- export declare const toggleButtonStyle: (buttonVariants: ComponentsVariants['MuiButton']) => CSSInterpolation;
5
+ export declare const variantsToClassName: (buttonVariants: ComponentsVariants['MuiButton']) => CSSInterpolation;
5
6
  export declare const buttonVariants: (buttons: ButtonStyles) => ComponentsVariants['MuiButton'];
@@ -49,6 +49,7 @@ export declare type GeowebColorPalette = {
49
49
  };
50
50
  greys: {
51
51
  accessible: CSSProperties['color'];
52
+ accessibleLight: CSSProperties['color'];
52
53
  };
53
54
  cards: {
54
55
  cardContainer: CSSProperties['color'];
@@ -98,11 +99,9 @@ export declare type GeowebColorPalette = {
98
99
  drawerOpen: CSSProperties;
99
100
  };
100
101
  layerManager: {
101
- tableRowDefaultIcon: CSSProperties;
102
102
  tableRowDefaultText: CSSProperties;
103
103
  tableRowDefaultCardContainer: CSSProperties;
104
104
  tableRowMouseover: CSSProperties;
105
- tableRowDisabledIcon: CSSProperties;
106
105
  tableRowDisabledText: CSSProperties;
107
106
  tableRowDisabledCardContainer: CSSProperties;
108
107
  };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export declare const IconButtonDemo: React.FC;
3
+ export declare const IconButtons: {
4
+ (): React.ReactElement;
5
+ storyName: string;
6
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare const MenuItemDemo: React.FC;
3
+ export declare const MenuItem: () => React.ReactElement;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export declare const TextFieldDemo: React.FC;
3
+ export declare const TextFields: {
4
+ (): React.ReactElement;
5
+ storyName: string;
6
+ };
@@ -10,6 +10,9 @@ export { Typography, TypographyGWTheme } from './Typography.stories';
10
10
  export { Tooltips } from './Tooltip.stories';
11
11
  export { Buttons } from './Button.stories';
12
12
  export { ToggleButtons } from './ToggleButton.stories';
13
+ export { IconButtons } from './IconButton.stories';
14
+ export { MenuItem } from './MenuItem.stories';
15
+ export { TextFields } from './TextField.stories';
13
16
  export { FormElementsGWTheme, FormElements } from './FormElements.stories';
14
17
  declare const _default: {
15
18
  title: string;
@@ -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 ButtonLight: () => React.ReactElement;
7
+ export declare const ButtonDark: () => 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 MenuItemLight: () => React.ReactElement;
7
+ export declare const MenuItemDark: () => 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 TextFieldLight: () => React.ReactElement;
7
+ export declare const TextFieldDark: () => React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/theme",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "GeoWeb Theme library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,8 +12,8 @@
12
12
  "typings": "./index.d.ts",
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
- "@mui/material": "^5.2.8",
16
15
  "react": "^17.0.2",
16
+ "@mui/material": "^5.2.8",
17
17
  "@mui/styles": "^5.2.3",
18
18
  "@mui/icons-material": "^5.2.5"
19
19
  }