@opengeoweb/shared 3.0.0 → 4.1.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.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@opengeoweb/theme'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('@mui/styles/makeStyles'), require('react-draggable'), require('re-resizable'), require('lodash'), require('@mui/styles/createStyles')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', '@mui/styles/makeStyles', 'react-draggable', 're-resizable', 'lodash', '@mui/styles/createStyles'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.makeStyles, global.Draggable, global.reResizable, global.lodash, global.createStyles));
5
- })(this, (function (exports, React, material, theme, reactHookForm, formFields, makeStyles, Draggable, reResizable, lodash, createStyles) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@opengeoweb/theme'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('react-draggable'), require('re-resizable'), require('lodash')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@opengeoweb/theme', 'react-hook-form', '@opengeoweb/form-fields', 'react-draggable', 're-resizable', 'lodash'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.theme, global.reactHookForm, global.formFields, global.Draggable, global.reResizable, global.lodash));
5
+ })(this, (function (exports, React, material, theme, reactHookForm, formFields, Draggable, reResizable, lodash) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -26,9 +26,7 @@
26
26
 
27
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
28
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
- var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
30
29
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
31
- var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
32
30
 
33
31
  /*! *****************************************************************************
34
32
  Copyright (c) Microsoft Corporation.
@@ -664,7 +662,7 @@
664
662
  }
665
663
  },
666
664
  '& .MuiAlert-icon': {
667
- margin: '-3px 10px 0px 0px',
665
+ marginTop: '-3px',
668
666
  padding: '0px'
669
667
  }
670
668
  } : {
@@ -685,13 +683,15 @@
685
683
  fontWeight: 'normal',
686
684
  marginTop: '0px!important',
687
685
  paddingTop: '0px!important',
688
- marginBottom: '0px!important'
686
+ marginBottom: '0px!important',
687
+ lineHeight: isCompact ? '18px' : '24px'
689
688
  }
690
689
  }, title), info && /*#__PURE__*/React__namespace.createElement(material.Box, {
691
690
  sx: {
692
691
  fontSize: '16px',
693
692
  marginTop: 1,
694
- wordBreak: 'break-word'
693
+ wordBreak: 'break-word',
694
+ lineHeight: '22px'
695
695
  }
696
696
  }, info), actionButtonProps && /*#__PURE__*/React__namespace.createElement(material.Button, {
697
697
  variant: "flat",
@@ -722,28 +722,23 @@
722
722
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
723
723
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
724
724
  * */
725
- var useStyles$5 = makeStyles__default["default"](function () {
726
- return {
727
- wrapper: {
725
+
726
+ var AppLayout = function AppLayout(_a) {
727
+ var header = _a.header,
728
+ children = _a.children;
729
+ return /*#__PURE__*/React__default["default"].createElement(material.Box, {
730
+ sx: {
728
731
  height: '100vh',
729
732
  display: 'flex',
730
733
  flexDirection: 'column'
731
734
  },
732
- main: {
735
+ "data-testid": "appLayout"
736
+ }, header, /*#__PURE__*/React__default["default"].createElement(material.Box, {
737
+ component: "main",
738
+ sx: {
733
739
  flex: 1,
734
740
  position: 'relative'
735
741
  }
736
- };
737
- });
738
-
739
- var AppLayout = function AppLayout(_a) {
740
- var header = _a.header,
741
- children = _a.children;
742
- var classes = useStyles$5();
743
- return /*#__PURE__*/React__default["default"].createElement("div", {
744
- className: classes.wrapper
745
- }, header, /*#__PURE__*/React__default["default"].createElement("main", {
746
- className: classes.main
747
742
  }, children));
748
743
  };
749
744
 
@@ -760,10 +755,10 @@
760
755
  * See the License for the specific language governing permissions and
761
756
  * limitations under the License.
762
757
  *
763
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
764
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
758
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
759
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
765
760
  * */
766
- var styles$4 = {
761
+ var styles$5 = {
767
762
  header: function header(theme) {
768
763
  var _a;
769
764
 
@@ -772,21 +767,24 @@
772
767
  backgroundColor: theme.palette.geowebColors.brand.brand,
773
768
  color: theme.palette.common.white,
774
769
  boxShadow: theme.shadows[1],
775
- zIndex: 1000
776
- }, _a[theme.breakpoints.down('sm')] = {
777
- padding: '0 8px'
778
- }, _a[theme.breakpoints.up('sm')] = {
770
+ zIndex: 1000,
771
+ padding: '0 16px'
772
+ }, _a[theme.breakpoints.up('md')] = {
779
773
  padding: '0 24px'
780
774
  }, _a;
781
775
  },
782
776
  title: {
783
- marginLeft: 1,
784
- fontSize: '1.25rem',
785
- fontWeight: 400,
777
+ fontSize: '20px',
778
+ fontWeight: 500,
779
+ fontStretch: 'normal',
780
+ fontStyle: 'normal',
781
+ lineHeight: 'normal',
782
+ letterSpacing: '0.15px',
786
783
  overflow: 'hidden',
787
784
  whiteSpace: 'nowrap',
788
785
  textOverflow: 'ellipsis',
789
- letterSpacing: '0.15px'
786
+ color: 'geowebColors.typographyAndIcons.text',
787
+ marginLeft: 1
790
788
  },
791
789
  container: {
792
790
  height: '100%'
@@ -800,34 +798,42 @@
800
798
  title = _b === void 0 ? 'GeoWeb' : _b;
801
799
  return /*#__PURE__*/React__default["default"].createElement(material.Box, {
802
800
  component: "header",
803
- sx: styles$4.header
801
+ sx: styles$5.header
804
802
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
805
- sx: styles$4.container,
803
+ sx: styles$5.container,
806
804
  container: true,
807
805
  alignItems: "center"
808
806
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
809
807
  item: true,
810
- xs: 1,
811
- sm: 3
812
- }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
813
- container: true,
814
- justifyContent: "flex-start"
815
- }, menu)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
816
- item: true,
817
- xs: 10,
808
+ xs: 6,
818
809
  sm: 6
819
810
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
820
811
  container: true,
821
- justifyContent: "center",
822
812
  alignItems: "center",
823
- wrap: "nowrap"
824
- }, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, null), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
813
+ wrap: "nowrap",
814
+ sx: {
815
+ button: {
816
+ marginLeft: 4,
817
+ color: 'geowebColors.typographyAndIcons.text'
818
+ }
819
+ }
820
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
821
+ sx: {
822
+ display: 'flex'
823
+ }
824
+ }, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, {
825
+ style: {
826
+ position: 'relative',
827
+ top: '-1px',
828
+ right: '-1px'
829
+ }
830
+ })), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
825
831
  variant: "h1",
826
- sx: styles$4.title
827
- }, title))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
832
+ sx: styles$5.title
833
+ }, title), menu)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
828
834
  item: true,
829
- xs: 1,
830
- sm: 3,
835
+ xs: 6,
836
+ sm: 6,
831
837
  container: true,
832
838
  justifyContent: "flex-end"
833
839
  }, userMenu)));
@@ -1036,17 +1042,13 @@
1036
1042
  return ErrorBoundary;
1037
1043
  }(React__namespace.Component);
1038
1044
 
1039
- var styles$3 = {
1045
+ var styles$4 = {
1040
1046
  small: {
1041
1047
  height: 16,
1042
1048
  width: 16,
1043
1049
  fontSize: '0.5rem'
1044
1050
  },
1045
- large: {
1046
- height: 32,
1047
- width: 32,
1048
- fontSize: '0.938rem'
1049
- }
1051
+ large: {}
1050
1052
  };
1051
1053
 
1052
1054
  var Avatar = function Avatar(_a) {
@@ -1055,13 +1057,7 @@
1055
1057
  size = _b === void 0 ? 'large' : _b;
1056
1058
  return /*#__PURE__*/React__namespace.createElement(material.Avatar, {
1057
1059
  "data-testid": "avatar",
1058
- sx: __assign(__assign({}, styles$3[size]), {
1059
- fontWeight: 500,
1060
- color: 'geowebColors.brand.brand',
1061
- backgroundColor: 'common.white',
1062
- border: '0.1px solid',
1063
- borderColor: 'geowebColors.brand.brand'
1064
- })
1060
+ sx: __assign({}, styles$4[size])
1065
1061
  }, children);
1066
1062
  };
1067
1063
 
@@ -1081,7 +1077,7 @@
1081
1077
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1082
1078
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1083
1079
  * */
1084
- var styles$2 = {
1080
+ var styles$3 = {
1085
1081
  container: {
1086
1082
  position: 'absolute',
1087
1083
  top: 38,
@@ -1101,8 +1097,13 @@
1101
1097
  }
1102
1098
  },
1103
1099
  button: {
1104
- color: 'common.white',
1105
- padding: 0
1100
+ padding: 0,
1101
+ border: 'none',
1102
+ background: 'transparent',
1103
+ '&:hover': {
1104
+ border: 'none',
1105
+ background: 'transparent'
1106
+ }
1106
1107
  }
1107
1108
  };
1108
1109
 
@@ -1122,16 +1123,16 @@
1122
1123
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
1123
1124
  "data-testid": "userButton",
1124
1125
  onClick: onToggle,
1125
- sx: styles$2.button,
1126
+ sx: styles$3.button,
1126
1127
  size: "large"
1127
1128
  }, /*#__PURE__*/React__default["default"].createElement(Avatar, null, initials)), isOpen && /*#__PURE__*/React__default["default"].createElement(material.Paper, {
1128
- sx: styles$2.container,
1129
+ sx: styles$3.container,
1129
1130
  "data-testid": "userMenu"
1130
1131
  }, /*#__PURE__*/React__default["default"].createElement(material.ClickAwayListener, {
1131
1132
  onClickAway: onClose,
1132
1133
  mouseEvent: "onMouseDown"
1133
1134
  }, /*#__PURE__*/React__default["default"].createElement(material.MenuList, {
1134
- sx: styles$2.userMenu,
1135
+ sx: styles$3.userMenu,
1135
1136
  variant: "menu"
1136
1137
  }, children))));
1137
1138
  };
@@ -1199,22 +1200,17 @@
1199
1200
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1200
1201
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1201
1202
  * */
1202
- var useStyles$4 = makeStyles__default["default"](function (theme) {
1203
- return {
1204
- footer: {
1205
- boxShadow: theme.shadows[1],
1206
- background: theme.palette.geowebColors.background.surface,
1203
+
1204
+ var ToolFooter = function ToolFooter() {
1205
+ return /*#__PURE__*/React__default["default"].createElement(material.Box, {
1206
+ component: "footer",
1207
+ sx: {
1208
+ boxShadow: 1,
1209
+ backgroundColor: 'geowebColors.background.surface',
1207
1210
  textAlign: 'right',
1208
1211
  height: 18,
1209
1212
  zIndex: 1
1210
1213
  }
1211
- };
1212
- }); // drag handles will be handled by DraggableResizable/Resizable
1213
-
1214
- var ToolFooter = function ToolFooter() {
1215
- var classes = useStyles$4();
1216
- return /*#__PURE__*/React__default["default"].createElement("footer", {
1217
- className: classes.footer
1218
1214
  });
1219
1215
  };
1220
1216
 
@@ -1231,8 +1227,8 @@
1231
1227
  * See the License for the specific language governing permissions and
1232
1228
  * limitations under the License.
1233
1229
  *
1234
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1235
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
1230
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1231
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1236
1232
  * */
1237
1233
 
1238
1234
  var getStyle = function getStyle(size) {
@@ -1391,7 +1387,7 @@
1391
1387
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1392
1388
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1393
1389
  * */
1394
- var styles$1 = {
1390
+ var styles$2 = {
1395
1391
  container: {
1396
1392
  overflow: 'hidden',
1397
1393
  borderRadius: 0,
@@ -1432,7 +1428,7 @@
1432
1428
 
1433
1429
  return /*#__PURE__*/React__default["default"].createElement(material.Paper, __assign({
1434
1430
  elevation: elevation,
1435
- sx: styles$1.container
1431
+ sx: styles$2.container
1436
1432
  }, props), /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, null, /*#__PURE__*/React__default["default"].createElement(ToolHeader, {
1437
1433
  title: title,
1438
1434
  size: size,
@@ -1441,7 +1437,7 @@
1441
1437
  className: headerClassName,
1442
1438
  leftComponent: leftComponent
1443
1439
  })), /*#__PURE__*/React__default["default"].createElement(material.Box, {
1444
- sx: styles$1.content,
1440
+ sx: styles$2.content,
1445
1441
  style: {
1446
1442
  maxHeight: maxHeight
1447
1443
  }
@@ -1633,91 +1629,63 @@
1633
1629
  }, children)))) : null;
1634
1630
  };
1635
1631
 
1636
- /* *
1637
- * Licensed under the Apache License, Version 2.0 (the "License");
1638
- * you may not use this file except in compliance with the License.
1639
- * You may obtain a copy of the License at
1640
- *
1641
- * http://www.apache.org/licenses/LICENSE-2.0
1642
- *
1643
- * Unless required by applicable law or agreed to in writing, software
1644
- * distributed under the License is distributed on an "AS IS" BASIS,
1645
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1646
- * See the License for the specific language governing permissions and
1647
- * limitations under the License.
1648
- *
1649
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1650
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
1651
- * */
1652
- var useStyles$3 = makeStyles__default["default"](function (theme) {
1653
- return {
1654
- icon: {
1655
- backgroundColor: theme.palette.geowebColors.textInputField["default"].rgba,
1656
- width: 40,
1657
- height: 40,
1658
- display: 'inline-flex',
1659
- verticalAlign: 'middle',
1660
- alignItems: 'center',
1661
- borderRadius: theme.shape.borderRadius,
1662
- '&>span': {
1663
- textAlign: 'center',
1664
- fontSize: 14,
1665
- fontWeight: 500,
1666
- display: 'flex',
1667
- margin: 'auto',
1668
- letterSpacing: 0.25
1669
- }
1670
- },
1671
- segment: {
1672
- margin: '0 2px',
1673
- verticalAlign: 'middle',
1674
- fontSize: 14,
1675
- fontWeight: 500,
1676
- letterSpacing: 0.25
1677
- },
1678
- connect: {
1679
- fontSize: 18
1680
- },
1681
- divider: {
1682
- margin: '0 6px',
1683
- fontSize: 18
1684
- }
1685
- };
1686
- });
1632
+ var segmentStyle = {
1633
+ margin: '0 2px',
1634
+ verticalAlign: 'middle',
1635
+ fontSize: 14,
1636
+ fontWeight: 500,
1637
+ letterSpacing: 0.25,
1638
+ justifyContent: 'center'
1639
+ };
1640
+ var styles$1 = {
1641
+ icon: __assign(__assign({}, segmentStyle), {
1642
+ backgroundColor: 'geowebColors.textInputField.default.rgba',
1643
+ width: 40,
1644
+ height: 40,
1645
+ display: 'inline-flex',
1646
+ alignItems: 'center',
1647
+ borderRadius: 1
1648
+ }),
1649
+ connect: __assign(__assign({}, segmentStyle), {
1650
+ fontSize: 18
1651
+ }),
1652
+ divider: __assign(__assign({}, segmentStyle), {
1653
+ margin: '0 6px',
1654
+ fontSize: 18
1655
+ })
1656
+ };
1687
1657
 
1688
1658
  var ShortCutSegment = function ShortCutSegment(_a) {
1689
1659
  var _b = _a.type,
1690
1660
  type = _b === void 0 ? 'text' : _b,
1691
1661
  children = _a.children;
1692
- var classes = useStyles$3();
1693
1662
 
1694
1663
  if (type === 'divider') {
1695
1664
  return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1665
+ sx: styles$1.divider,
1696
1666
  "data-testid": "segment-divider",
1697
- className: classes.segment + " " + classes.divider,
1698
1667
  component: "span"
1699
1668
  }, children);
1700
1669
  }
1701
1670
 
1702
1671
  if (type === 'icon') {
1703
- return /*#__PURE__*/React__default["default"].createElement("span", {
1672
+ return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1673
+ sx: styles$1.icon,
1704
1674
  "data-testid": "segment-icon",
1705
- className: classes.segment + " " + classes.icon
1706
- }, /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1707
1675
  component: "span"
1708
- }, children));
1676
+ }, children);
1709
1677
  }
1710
1678
 
1711
1679
  if (type === 'connect') {
1712
1680
  return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1713
- className: classes.segment + " " + classes.connect,
1681
+ sx: styles$1.connect,
1714
1682
  "data-testid": "segment-connect",
1715
1683
  component: "span"
1716
1684
  }, children);
1717
1685
  }
1718
1686
 
1719
1687
  return /*#__PURE__*/React__default["default"].createElement(material.Typography, {
1720
- className: classes.segment,
1688
+ sx: segmentStyle,
1721
1689
  "data-testid": "segment-text",
1722
1690
  component: "span"
1723
1691
  }, children);
@@ -1861,33 +1829,18 @@
1861
1829
  });
1862
1830
  });
1863
1831
  };
1864
- var useStyles$2 = makeStyles__default["default"](function () {
1865
- return {
1866
- row: {
1867
- minHeight: 56
1868
- },
1869
- title: {
1870
- fontSize: 12,
1871
- fontWeight: 300,
1872
- letterSpacing: 0.4,
1873
- opacity: 0.67
1874
- },
1875
- description: {
1876
- alignItems: 'center'
1877
- }
1878
- };
1879
- });
1880
1832
 
1881
1833
  var ShortcutList = function ShortcutList(_a) {
1882
1834
  var _b = _a.platform,
1883
1835
  platform = _b === void 0 ? 'windows' : _b;
1884
- var classes = useStyles$2();
1885
1836
  var rows = getShortcutList(shortcuts, platform);
1886
1837
  return /*#__PURE__*/React__default["default"].createElement(material.List, {
1887
1838
  "data-testid": "list-" + platform
1888
1839
  }, rows.map(function (row, index) {
1889
1840
  return /*#__PURE__*/React__default["default"].createElement(material.ListItem, {
1890
- className: classes.row,
1841
+ sx: {
1842
+ minHeight: 56
1843
+ },
1891
1844
  divider: index !== rows.length - 1,
1892
1845
  key: row.title
1893
1846
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
@@ -1897,11 +1850,18 @@
1897
1850
  alignItems: "center"
1898
1851
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1899
1852
  item: true,
1900
- className: classes.title
1853
+ sx: {
1854
+ fontSize: 12,
1855
+ fontWeight: 300,
1856
+ letterSpacing: 0.4,
1857
+ opacity: 0.67
1858
+ }
1901
1859
  }, row.title), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
1902
1860
  item: true
1903
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1904
- className: classes.description
1861
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
1862
+ sx: {
1863
+ alignItems: 'center'
1864
+ }
1905
1865
  }, row.description))));
1906
1866
  }));
1907
1867
  };
@@ -1959,17 +1919,7 @@
1959
1919
  })));
1960
1920
  };
1961
1921
 
1962
- var useStyles$1 = makeStyles__default["default"](function () {
1963
- return {
1964
- backdrop: {
1965
- zIndex: 1
1966
- }
1967
- };
1968
- });
1969
-
1970
1922
  var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
1971
- var classes = useStyles$1();
1972
-
1973
1923
  var _a = __read(React__default["default"].useState(false), 2),
1974
1924
  open = _a[0],
1975
1925
  setOpen = _a[1];
@@ -1993,7 +1943,9 @@
1993
1943
  }, "Cheat sheet"))), /*#__PURE__*/React__default["default"].createElement(material.Backdrop, {
1994
1944
  "data-testid": "cheatsheet-content",
1995
1945
  open: open,
1996
- className: classes.backdrop
1946
+ sx: {
1947
+ zIndex: 1
1948
+ }
1997
1949
  }, /*#__PURE__*/React__default["default"].createElement(DraggableComponent, {
1998
1950
  startSize: {
1999
1951
  width: 700
@@ -2348,14 +2300,14 @@
2348
2300
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
2349
2301
  placement: "top",
2350
2302
  title: tooltipTitle
2351
- }, /*#__PURE__*/React__namespace.createElement(material.Box, null, /*#__PURE__*/React__namespace.createElement(ToolButton, {
2303
+ }, /*#__PURE__*/React__namespace.createElement(ToolButton, {
2352
2304
  active: isOpen,
2353
2305
  sx: buttonSx,
2354
2306
  onClick: handleClick,
2355
2307
  "data-testid": buttonTestId,
2356
2308
  variant: variant,
2357
2309
  id: buttonTestId
2358
- }, /*#__PURE__*/React__namespace.createElement(theme.Options, null)))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
2310
+ }, /*#__PURE__*/React__namespace.createElement(theme.Options, null))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
2359
2311
  anchorEl: anchorEl,
2360
2312
  open: isOpen,
2361
2313
  onClose: handleClose,
@@ -2402,56 +2354,46 @@
2402
2354
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2403
2355
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
2404
2356
  * */
2405
- var useStyles = makeStyles__default["default"](function (theme) {
2406
- return createStyles__default["default"]({
2407
- button: {
2408
- height: 24,
2409
- width: 24,
2410
- borderRadius: 5,
2411
- marginTop: 4,
2412
- color: function color(_a) {
2413
- var isActive = _a.isActive,
2414
- isAccessible = _a.isAccessible,
2415
- isEnabled = _a.isEnabled;
2416
-
2417
- if (!isEnabled) {
2418
- return theme.palette.geowebColors.buttons.flat.disabled.color;
2419
- }
2420
2357
 
2421
- if (isAccessible) {
2422
- return theme.palette.geowebColors.greys.accessible;
2423
- }
2358
+ var makeButtonStyles = function makeButtonStyles(isActive, isEnabled, isAccessible) {
2359
+ return {
2360
+ height: '24px',
2361
+ width: '24px',
2362
+ borderRadius: '5px',
2363
+ marginTop: '4px',
2364
+ color: function color() {
2365
+ if (!isEnabled) {
2366
+ return 'geowebColors.buttons.flat.disabled.color';
2367
+ }
2424
2368
 
2425
- if (isActive) {
2426
- return theme.palette.common.white;
2427
- }
2369
+ if (isAccessible) {
2370
+ return 'geowebColors.greys.accessible';
2371
+ }
2428
2372
 
2429
- return theme.palette.geowebColors.buttons.flat["default"].color;
2430
- },
2431
- backgroundColor: function backgroundColor(_a) {
2432
- var isActive = _a.isActive;
2433
- return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
2434
- },
2435
- '&:focus': {
2436
- backgroundColor: function backgroundColor(_a) {
2437
- var isActive = _a.isActive;
2438
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2439
- },
2440
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
2441
- borderRadius: 0
2442
- },
2443
- '&:hover': {
2444
- backgroundColor: function backgroundColor(_a) {
2445
- var isActive = _a.isActive;
2446
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2447
- }
2373
+ if (isActive) {
2374
+ return 'common.white';
2448
2375
  }
2376
+
2377
+ return 'geowebColors.buttons.flat.default.color';
2449
2378
  },
2450
- popper: {
2451
- pointerEvents: 'none'
2379
+ backgroundColor: function backgroundColor() {
2380
+ return isActive ? 'geowebColors.buttons.primary.active.fill' : 'inherit';
2381
+ },
2382
+ '&:focus': {
2383
+ backgroundColor: function backgroundColor() {
2384
+ return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
2385
+ },
2386
+ outline: 'geowebColors.buttons.focusDefault.outline',
2387
+ borderRadius: 0
2388
+ },
2389
+ '&:hover': {
2390
+ backgroundColor: function backgroundColor() {
2391
+ return isActive ? 'geowebColors.buttons.primary.mouseOver.fill' : 'geowebColors.buttons.flat.mouseOver.fill';
2392
+ }
2452
2393
  }
2453
- });
2454
- });
2394
+ };
2395
+ };
2396
+
2455
2397
  var ManagerButton = function ManagerButton(_a) {
2456
2398
  var _b = _a.tooltipTitle,
2457
2399
  tooltipTitle = _b === void 0 ? '' : _b,
@@ -2465,14 +2407,10 @@
2465
2407
  testId = _a.testId,
2466
2408
  _f = _a.isAccessible,
2467
2409
  isAccessible = _f === void 0 ? false : _f,
2468
- className = _a.className,
2469
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
2410
+ sx = _a.sx,
2411
+ props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "sx"]);
2470
2412
 
2471
- var classes = useStyles({
2472
- isActive: isActive,
2473
- isEnabled: isEnabled,
2474
- isAccessible: isAccessible
2475
- });
2413
+ var buttonStyles = makeButtonStyles(isActive, isEnabled, isAccessible);
2476
2414
 
2477
2415
  var handleClick = function handleClick(event) {
2478
2416
  onClick(event);
@@ -2481,14 +2419,14 @@
2481
2419
  return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
2482
2420
  title: tooltipTitle,
2483
2421
  placement: "top",
2484
- classes: {
2485
- popper: classes.popper
2422
+ sx: {
2423
+ pointerEvents: 'none'
2486
2424
  }
2487
2425
  }, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
2488
2426
  size: "small",
2489
2427
  onClick: handleClick,
2490
2428
  "data-testid": testId,
2491
- className: classes.button + " " + className,
2429
+ sx: __assign(__assign({}, buttonStyles), sx),
2492
2430
  disableFocusRipple: true
2493
2431
  }, props), icon));
2494
2432
  };