@opengeoweb/shared 2.3.0 → 2.5.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.
Files changed (27) hide show
  1. package/index.esm.js +327 -146
  2. package/index.umd.js +332 -133
  3. package/lib/components/AlertBanner/AlertBanner.d.ts +1 -0
  4. package/lib/components/AlertBanner/AlertBanner.stories.d.ts +9 -1
  5. package/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +10 -2
  6. package/lib/components/Manager/EnableButton/EnableButton.d.ts +8 -0
  7. package/lib/components/{DraggableDialog/DraggableDialog.spec.d.ts → Manager/EnableButton/EnableButton.spec.d.ts} +0 -0
  8. package/lib/components/Manager/EnableButton/EnableButton.stories.d.ts +13 -0
  9. package/lib/components/Manager/EnableButton/index.d.ts +1 -0
  10. package/lib/components/Manager/ManagerButton/ManagerButton.d.ts +13 -0
  11. package/lib/components/Manager/ManagerButton/ManagerButton.spec.d.ts +1 -0
  12. package/lib/components/Manager/ManagerButton/ManagerButton.stories.d.ts +13 -0
  13. package/lib/components/Manager/ManagerButton/index.d.ts +1 -0
  14. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.d.ts +8 -0
  15. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.spec.d.ts +1 -0
  16. package/lib/components/Manager/ManagerDeleteButton/ManagerDeleteButton.stories.d.ts +13 -0
  17. package/lib/components/Manager/ManagerDeleteButton/index.d.ts +1 -0
  18. package/lib/components/Manager/index.d.ts +4 -0
  19. package/lib/components/Manager/styles.d.ts +5 -0
  20. package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +6 -0
  21. package/lib/components/ToolContainer/index.d.ts +1 -0
  22. package/lib/components/components.stories.d.ts +0 -1
  23. package/lib/components/index.d.ts +1 -1
  24. package/package.json +3 -3
  25. package/lib/components/DraggableDialog/DraggableDialog.d.ts +0 -16
  26. package/lib/components/DraggableDialog/DraggableDialog.stories.d.ts +0 -6
  27. package/lib/components/DraggableDialog/index.d.ts +0 -1
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('@mui/styles/makeStyles'), require('@mui/icons-material'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('react-draggable'), require('re-resizable'), require('@opengeoweb/theme'), require('lodash'), require('@mui/styles/withStyles'), require('@mui/styles/createStyles'), require('@mui/icons-material/MoreVert')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/styles/makeStyles', '@mui/icons-material', 'react-hook-form', '@opengeoweb/form-fields', 'react-draggable', 're-resizable', '@opengeoweb/theme', 'lodash', '@mui/styles/withStyles', '@mui/styles/createStyles', '@mui/icons-material/MoreVert'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.makeStyles, global.iconsMaterial, global.reactHookForm, global.formFields, global.Draggable, global.reResizable, global.theme, global.lodash, global.withStyles, global.createStyles, global.MoreVertIcon));
5
- })(this, (function (exports, React, material, makeStyles, iconsMaterial, reactHookForm, formFields, Draggable, reResizable, theme, lodash, withStyles, createStyles, MoreVertIcon) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/icons-material/Close'), require('react-hook-form'), require('@opengeoweb/form-fields'), require('@mui/styles/makeStyles'), require('react-draggable'), require('re-resizable'), require('@opengeoweb/theme'), require('@mui/icons-material'), require('lodash'), require('@mui/styles/withStyles'), require('@mui/icons-material/MoreVert'), require('@mui/styles/createStyles')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/icons-material/Close', 'react-hook-form', '@opengeoweb/form-fields', '@mui/styles/makeStyles', 'react-draggable', 're-resizable', '@opengeoweb/theme', '@mui/icons-material', 'lodash', '@mui/styles/withStyles', '@mui/icons-material/MoreVert', '@mui/styles/createStyles'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Shared = {}, global.React, global.material, global.Close, global.reactHookForm, global.formFields, global.makeStyles, global.Draggable, global.reResizable, global.theme, global.iconsMaterial, global.lodash, global.withStyles, global.MoreVertIcon, global.createStyles));
5
+ })(this, (function (exports, React, material, Close, reactHookForm, formFields, makeStyles, Draggable, reResizable, theme, iconsMaterial, lodash, withStyles, MoreVertIcon, createStyles) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -26,11 +26,12 @@
26
26
 
27
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
28
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
+ var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
29
30
  var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
30
31
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
31
32
  var withStyles__default = /*#__PURE__*/_interopDefaultLegacy(withStyles);
32
- var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
33
33
  var MoreVertIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreVertIcon);
34
+ var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
34
35
 
35
36
  /*! *****************************************************************************
36
37
  Copyright (c) Microsoft Corporation.
@@ -160,20 +161,6 @@
160
161
  }, content));
161
162
  };
162
163
 
163
- var useStyles$b = makeStyles__default["default"](function () {
164
- return {
165
- dialogHeader: {
166
- zIndex: 1,
167
- padding: '8px 20px',
168
- display: 'flex',
169
- justifyContent: 'space-between',
170
- alignItems: 'center'
171
- },
172
- dialogContent: {
173
- padding: '40px 20px 0px 20px !important'
174
- }
175
- };
176
- });
177
164
  var ConfirmationDialog = function ConfirmationDialog(_a) {
178
165
  var open = _a.open,
179
166
  title = _a.title,
@@ -189,8 +176,6 @@
189
176
  content = _e === void 0 ? null : _e,
190
177
  other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
191
178
 
192
- var classes = useStyles$b();
193
-
194
179
  other.catchOnCancel;
195
180
  var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
196
181
 
@@ -198,14 +183,33 @@
198
183
  return /*#__PURE__*/React__namespace.createElement(material.Dialog, __assign({
199
184
  "data-testid": "confirmationDialog",
200
185
  open: open,
201
- maxWidth: "sm",
202
- fullWidth: true,
186
+ PaperProps: {
187
+ sx: {
188
+ width: '560px',
189
+ margin: 2.5
190
+ }
191
+ },
203
192
  // fix for briefly showing default options when closing dialog
204
193
  transitionDuration: 0
205
194
  }, rest), /*#__PURE__*/React__namespace.createElement(material.DialogTitle, {
206
- className: classes.dialogHeader
195
+ sx: {
196
+ zIndex: 1,
197
+ padding: 2,
198
+ display: 'flex',
199
+ justifyContent: 'space-between',
200
+ alignItems: 'center'
201
+ }
207
202
  }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
208
- variant: "h5",
203
+ sx: {
204
+ fontSize: {
205
+ xs: '16px',
206
+ sm: '34px'
207
+ },
208
+ fontWeight: {
209
+ xs: 500,
210
+ sm: 400
211
+ }
212
+ },
209
213
  "data-testid": "confirmationDialog-title",
210
214
  component: "span"
211
215
  }, title), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
@@ -215,23 +219,51 @@
215
219
  return onClose('CLOSED');
216
220
  },
217
221
  size: "small"
218
- }, /*#__PURE__*/React__namespace.createElement(iconsMaterial.Close, null))), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
219
- className: classes.dialogContent
222
+ }, /*#__PURE__*/React__namespace.createElement(Close__default["default"], null))), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
223
+ sx: {
224
+ padding: '8px 16px'
225
+ }
220
226
  }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
221
227
  variant: "body1"
222
- }, description), content), /*#__PURE__*/React__namespace.createElement(material.DialogActions, null, /*#__PURE__*/React__namespace.createElement(material.Button, {
223
- "data-testid": "conformationDialog-cancel",
224
- color: "secondary",
225
- variant: "outlined",
228
+ }, description), content), /*#__PURE__*/React__namespace.createElement(material.DialogActions, {
229
+ sx: {
230
+ padding: 2,
231
+ flexDirection: {
232
+ xs: 'column',
233
+ sm: 'row'
234
+ }
235
+ }
236
+ }, /*#__PURE__*/React__namespace.createElement(material.Button, {
237
+ "data-testid": "confirmationDialog-cancel",
238
+ variant: "tertiary",
239
+ sx: {
240
+ width: {
241
+ xs: '100%',
242
+ sm: '150px'
243
+ }
244
+ },
226
245
  onClick: function onClick() {
227
246
  return onClose('CANCELLED');
228
247
  },
229
248
  autoFocus: true,
230
249
  disableRipple: true
231
250
  }, cancelLabel), /*#__PURE__*/React__namespace.createElement(material.Button, {
232
- "data-testid": "conformationDialog-confirm",
233
- color: "secondary",
234
- variant: "contained",
251
+ "data-testid": "confirmationDialog-confirm",
252
+ variant: "primary",
253
+ sx: {
254
+ width: {
255
+ xs: '100%',
256
+ sm: '150px'
257
+ },
258
+ marginLeft: {
259
+ xs: '0px!important',
260
+ sm: '8px!important'
261
+ },
262
+ marginTop: {
263
+ xs: 2,
264
+ sm: 0
265
+ }
266
+ },
235
267
  onClick: onSubmit
236
268
  }, confirmLabel)));
237
269
  };
@@ -507,7 +539,8 @@
507
539
  title: {
508
540
  fontSize: '14px',
509
541
  fontWeight: 'normal',
510
- marginTop: '0px!important'
542
+ marginTop: '0px!important',
543
+ paddingTop: '0px!important'
511
544
  },
512
545
  info: {
513
546
  fontSize: '16px'
@@ -524,8 +557,7 @@
524
557
  fill: "transparent"
525
558
  }), /*#__PURE__*/React__namespace.createElement("path", {
526
559
  d: "M12 4c4.418 0 8 3.581 8 8 0 4.418-3.582 8-8 8s-8-3.582-8-8c0-4.419 3.582-8 8-8zm1.052 6H10v1.613h.949v3.774H10V17h4v-1.613h-.948V10zM11.99 6c-.837 0-1.491.654-1.491 1.49 0 .837.654 1.51 1.49 1.51.837 0 1.51-.673 1.51-1.51 0-.836-.673-1.49-1.51-1.49z",
527
- transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)",
528
- fill: "#0062E6"
560
+ transform: "translate(-946.000000, -368.000000) translate(930.000000, 356.000000) translate(16.000000, 12.000000)"
529
561
  }));
530
562
 
531
563
  case 'success':
@@ -535,8 +567,7 @@
535
567
  fill: "transparent"
536
568
  }), /*#__PURE__*/React__namespace.createElement("path", {
537
569
  d: "M16.51 10.034l-5.633 5.633-3.387-3.386c-.369-.37-.369-.973 0-1.343.36-.357.983-.357 1.342 0l2.045 2.046 4.292-4.291c.357-.357.983-.359 1.342 0 .368.369.368.97 0 1.341M12 4C7.582 4 4 7.582 4 12s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8",
538
- transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)",
539
- fill: "#72BB23"
570
+ transform: "translate(-96.000000, -368.000000) translate(80.000000, 356.000000) translate(16.000000, 12.000000)"
540
571
  }));
541
572
 
542
573
  case 'warning':
@@ -546,8 +577,7 @@
546
577
  fill: "transparent"
547
578
  }), /*#__PURE__*/React__namespace.createElement("path", {
548
579
  d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
549
- transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)",
550
- fill: "#FFA800"
580
+ transform: "translate(-521.000000, -368.000000) translate(505.000000, 356.000000) translate(16.000000, 12.000000)"
551
581
  }));
552
582
 
553
583
  case 'error':
@@ -558,8 +588,7 @@
558
588
  fill: "transparent"
559
589
  }), /*#__PURE__*/React__namespace.createElement("path", {
560
590
  d: "M12.862 16.72c-.22.226-.507.339-.86.339-.364 0-.662-.113-.894-.34-.232-.226-.347-.52-.347-.885 0-.32.118-.59.356-.81.236-.22.531-.331.884-.331.332 0 .613.11.845.33.232.222.347.491.347.811 0 .365-.11.66-.33.886zm.216-9.805l-.134 6.669H11.06l-.15-6.67h2.169zM12 4.5c-4.141 0-7.5 3.359-7.5 7.501s3.359 7.5 7.5 7.5c4.142 0 7.5-3.358 7.5-7.5C19.5 7.86 16.142 4.5 12 4.5z",
561
- transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)",
562
- fill: "#C00000"
591
+ transform: "translate(-1371.000000, -368.000000) translate(1355.000000, 356.000000) translate(16.000000, 12.000000)"
563
592
  }));
564
593
  }
565
594
  };
@@ -571,12 +600,31 @@
571
600
  _c = _a.info,
572
601
  info = _c === void 0 ? '' : _c,
573
602
  _d = _a.dataTestId,
574
- dataTestId = _d === void 0 ? 'alert-banner' : _d;
603
+ dataTestId = _d === void 0 ? 'alert-banner' : _d,
604
+ _e = _a.isCompact,
605
+ isCompact = _e === void 0 ? false : _e;
575
606
  var classes = useStyles$a();
576
607
  return /*#__PURE__*/React__namespace.createElement(material.Alert, {
577
608
  "data-testid": dataTestId,
578
609
  severity: severity,
579
- icon: getIcon(severity)
610
+ icon: getIcon(severity),
611
+ sx: isCompact ? {
612
+ height: '32px',
613
+ boxSizing: 'border-box',
614
+ '& .MuiAlert-message': {
615
+ padding: '0px',
616
+ whiteSpace: 'nowrap',
617
+ overflow: 'hidden',
618
+ textOverflow: 'ellipsis',
619
+ '& .MuiTypography-root': {
620
+ display: 'inline'
621
+ }
622
+ },
623
+ '& .MuiAlert-icon': {
624
+ margin: '-3px 10px 0px 0px',
625
+ padding: '0px'
626
+ }
627
+ } : {}
580
628
  }, /*#__PURE__*/React__namespace.createElement(material.AlertTitle, {
581
629
  className: classes.title
582
630
  }, title), info && /*#__PURE__*/React__namespace.createElement("div", {
@@ -1195,7 +1243,7 @@
1195
1243
  boxShadow: 1,
1196
1244
  backgroundColor: 'geowebColors.background.surface',
1197
1245
  padding: styles.padding,
1198
- zIndex: 1,
1246
+ zIndex: 2,
1199
1247
  cursor: isDraggable ? 'move' : null
1200
1248
  }
1201
1249
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
@@ -1277,7 +1325,6 @@
1277
1325
  content: {
1278
1326
  flex: 1,
1279
1327
  overflowY: 'auto',
1280
- zIndex: 2,
1281
1328
  position: 'relative'
1282
1329
  }
1283
1330
  };
@@ -1339,6 +1386,19 @@
1339
1386
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1340
1387
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1341
1388
  * */
1389
+
1390
+ var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
1391
+ var width = window.innerWidth * 0.85;
1392
+ var height = window.innerHeight * 0.85;
1393
+ var top = window.innerHeight * 0.15 / 2;
1394
+ var left = window.innerWidth * 0.15 / 2;
1395
+ return {
1396
+ width: width,
1397
+ height: height,
1398
+ top: top,
1399
+ left: left
1400
+ };
1401
+ };
1342
1402
  var BASE_Z_INDEX = 100;
1343
1403
 
1344
1404
  var DraggableComponent = function DraggableComponent(_a) {
@@ -1470,6 +1530,7 @@
1470
1530
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1471
1531
  style: __assign({
1472
1532
  position: 'absolute',
1533
+ pointerEvents: 'all',
1473
1534
  zIndex: zIndex
1474
1535
  }, startPosition),
1475
1536
  ref: nodeRef
@@ -1767,11 +1828,11 @@
1767
1828
  }, /*#__PURE__*/React__default["default"].createElement(ArrowRightIcon, null))),
1768
1829
  descriptionMac: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1769
1830
  type: "icon"
1770
- }, /*#__PURE__*/React__default["default"].createElement(OptionIcon, null)), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1831
+ }, "Ctrl"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1771
1832
  type: "connect"
1772
1833
  }, "+"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1773
1834
  type: "icon"
1774
- }, /*#__PURE__*/React__default["default"].createElement(CommandIcon, null)), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1835
+ }, /*#__PURE__*/React__default["default"].createElement(OptionIcon, null)), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1775
1836
  type: "connect"
1776
1837
  }, "+"), /*#__PURE__*/React__default["default"].createElement(ShortCutSegment, {
1777
1838
  type: "icon"
@@ -2216,85 +2277,6 @@
2216
2277
  }, props));
2217
2278
  };
2218
2279
 
2219
- var Z_INDEX_TOP = 600;
2220
- var Z_INDEX_BOTTOM = 550;
2221
- var useStyles = makeStyles__default["default"](function (theme) {
2222
- return createStyles__default["default"]({
2223
- draggableDialog: function draggableDialog(props) {
2224
- return {
2225
- width: props.dialogWidth ? props.dialogWidth : '90%',
2226
- position: 'absolute',
2227
- top: props.dialogTop ? props.dialogTop : '2%',
2228
- left: '5%',
2229
- maxWidth: '90%',
2230
- maxHeight: props.dialogMaxHeight ? props.dialogMaxHeight : '95%',
2231
- display: 'flex',
2232
- flexDirection: 'column',
2233
- overflow: 'hidden',
2234
- zIndex: props.zIndex
2235
- };
2236
- },
2237
- dialogContent: {
2238
- marginTop: '40px',
2239
- overflowY: 'scroll'
2240
- },
2241
- dialogHeader: function dialogHeader(props) {
2242
- return {
2243
- position: 'absolute',
2244
- display: 'flex',
2245
- justifyContent: 'space-between',
2246
- alignItems: 'center',
2247
- boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
2248
- width: '100%',
2249
- backgroundColor: theme.palette.geowebColors.background.surface,
2250
- zIndex: props.zIndex + 10
2251
- };
2252
- },
2253
- iconClose: {
2254
- padding: theme.spacing(1)
2255
- },
2256
- iconDrag: {
2257
- padding: theme.spacing(1)
2258
- }
2259
- });
2260
- });
2261
-
2262
- var DraggableDialog = function DraggableDialog(_a) {
2263
- var handleClose = _a.handleClose,
2264
- title = _a.title,
2265
- children = _a.children,
2266
- _b = _a.dialogStyling,
2267
- dialogStyling = _b === void 0 ? {} : _b,
2268
- _c = _a.zIndex,
2269
- zIndex = _c === void 0 ? Z_INDEX_TOP : _c;
2270
- var classes = useStyles(__assign(__assign({}, dialogStyling), {
2271
- zIndex: zIndex
2272
- }));
2273
- return /*#__PURE__*/React__namespace.createElement(Draggable__default["default"], {
2274
- handle: "strong",
2275
- bounds: "body"
2276
- }, /*#__PURE__*/React__namespace.createElement(material.Paper, {
2277
- "data-testid": title,
2278
- className: classes.draggableDialog,
2279
- elevation: 24
2280
- }, /*#__PURE__*/React__namespace.createElement("div", {
2281
- className: classes.dialogHeader
2282
- }, /*#__PURE__*/React__namespace.createElement("strong", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
2283
- "data-testid": "dragDialog",
2284
- size: "small",
2285
- className: classes.iconDrag
2286
- }, /*#__PURE__*/React__namespace.createElement(iconsMaterial.DragIndicator, null))), /*#__PURE__*/React__namespace.createElement(material.Typography, {
2287
- variant: "subtitle1"
2288
- }, title), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
2289
- "data-testid": "closeDialog",
2290
- size: "small",
2291
- onClick: handleClose,
2292
- className: classes.iconClose
2293
- }, /*#__PURE__*/React__namespace.createElement(iconsMaterial.Close, null))), /*#__PURE__*/React__namespace.createElement("div", {
2294
- className: classes.dialogContent
2295
- }, children)));
2296
- };
2297
-
2298
2280
  /* *
2299
2281
  * Licensed under the Apache License, Version 2.0 (the "License");
2300
2282
  * you may not use this file except in compliance with the License.
@@ -2352,10 +2334,12 @@
2352
2334
  value = _d === void 0 ? 0 : _d,
2353
2335
  _e = _a.sx,
2354
2336
  sx = _e === void 0 ? {} : _e,
2355
- props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
2337
+ _f = _a.variant,
2338
+ variant = _f === void 0 ? 'tool' : _f,
2339
+ props = __rest(_a, ["active", "width", "height", "children", "value", "sx", "variant"]);
2356
2340
 
2357
2341
  return /*#__PURE__*/React__namespace.createElement(CustomToggleButton, __assign({
2358
- variant: "tool",
2342
+ variant: variant,
2359
2343
  disableRipple: true,
2360
2344
  selected: active,
2361
2345
  value: value,
@@ -2465,6 +2449,220 @@
2465
2449
  }), children));
2466
2450
  };
2467
2451
 
2452
+ /* *
2453
+ * Licensed under the Apache License, Version 2.0 (the "License");
2454
+ * you may not use this file except in compliance with the License.
2455
+ * You may obtain a copy of the License at
2456
+ *
2457
+ * http://www.apache.org/licenses/LICENSE-2.0
2458
+ *
2459
+ * Unless required by applicable law or agreed to in writing, software
2460
+ * distributed under the License is distributed on an "AS IS" BASIS,
2461
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2462
+ * See the License for the specific language governing permissions and
2463
+ * limitations under the License.
2464
+ *
2465
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2466
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2467
+ * */
2468
+ var useStyles = makeStyles__default["default"](function (theme) {
2469
+ return createStyles__default["default"]({
2470
+ button: {
2471
+ height: 28,
2472
+ width: 28,
2473
+ borderRadius: 5,
2474
+ marginTop: 2,
2475
+ color: function color(_a) {
2476
+ var isActive = _a.isActive,
2477
+ isAccessible = _a.isAccessible,
2478
+ isEnabled = _a.isEnabled;
2479
+
2480
+ if (!isEnabled) {
2481
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
2482
+ }
2483
+
2484
+ if (isAccessible) {
2485
+ return theme.palette.geowebColors.greys.accessible;
2486
+ }
2487
+
2488
+ if (isActive) {
2489
+ return theme.palette.common.white;
2490
+ }
2491
+
2492
+ return theme.palette.geowebColors.buttons.flat["default"].color;
2493
+ },
2494
+ backgroundColor: function backgroundColor(_a) {
2495
+ var isActive = _a.isActive;
2496
+ return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
2497
+ },
2498
+ '&:focus': {
2499
+ backgroundColor: function backgroundColor(_a) {
2500
+ var isActive = _a.isActive;
2501
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2502
+ },
2503
+ outline: theme.palette.geowebColors.buttons.focusDefault.outline,
2504
+ borderRadius: 0
2505
+ },
2506
+ '&:hover': {
2507
+ backgroundColor: function backgroundColor(_a) {
2508
+ var isActive = _a.isActive;
2509
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
2510
+ }
2511
+ }
2512
+ },
2513
+ popper: {
2514
+ pointerEvents: 'none'
2515
+ }
2516
+ });
2517
+ });
2518
+ var ManagerButton = function ManagerButton(_a) {
2519
+ var _b = _a.tooltipTitle,
2520
+ tooltipTitle = _b === void 0 ? '' : _b,
2521
+ _c = _a.onClick,
2522
+ onClick = _c === void 0 ? function () {} : _c,
2523
+ _d = _a.isActive,
2524
+ isActive = _d === void 0 ? false : _d,
2525
+ _e = _a.isEnabled,
2526
+ isEnabled = _e === void 0 ? true : _e,
2527
+ icon = _a.icon,
2528
+ testId = _a.testId,
2529
+ _f = _a.isAccessible,
2530
+ isAccessible = _f === void 0 ? false : _f,
2531
+ className = _a.className,
2532
+ props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
2533
+
2534
+ var classes = useStyles({
2535
+ isActive: isActive,
2536
+ isEnabled: isEnabled,
2537
+ isAccessible: isAccessible
2538
+ });
2539
+
2540
+ var handleClick = function handleClick(event) {
2541
+ onClick(event);
2542
+ };
2543
+
2544
+ return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
2545
+ title: tooltipTitle,
2546
+ placement: "top",
2547
+ classes: {
2548
+ popper: classes.popper
2549
+ }
2550
+ }, /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({
2551
+ size: "small",
2552
+ onClick: handleClick,
2553
+ "data-testid": testId,
2554
+ className: classes.button + " " + className,
2555
+ disableFocusRipple: true
2556
+ }, props), icon));
2557
+ };
2558
+
2559
+ /* *
2560
+ * Licensed under the Apache License, Version 2.0 (the "License");
2561
+ * you may not use this file except in compliance with the License.
2562
+ * You may obtain a copy of the License at
2563
+ *
2564
+ * http://www.apache.org/licenses/LICENSE-2.0
2565
+ *
2566
+ * Unless required by applicable law or agreed to in writing, software
2567
+ * distributed under the License is distributed on an "AS IS" BASIS,
2568
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2569
+ * See the License for the specific language governing permissions and
2570
+ * limitations under the License.
2571
+ *
2572
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2573
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2574
+ * */
2575
+ var ManagerDeleteButton = function ManagerDeleteButton(_a) {
2576
+ var tooltipTitle = _a.tooltipTitle,
2577
+ onClickDelete = _a.onClickDelete,
2578
+ _b = _a.isEnabled,
2579
+ isEnabled = _b === void 0 ? true : _b;
2580
+ return /*#__PURE__*/React__namespace.createElement(ManagerButton, {
2581
+ tooltipTitle: tooltipTitle,
2582
+ onClick: onClickDelete,
2583
+ icon: /*#__PURE__*/React__namespace.createElement(iconsMaterial.Delete, {
2584
+ sx: {
2585
+ width: 20,
2586
+ height: 20
2587
+ }
2588
+ }),
2589
+ testId: "deleteButton",
2590
+ isEnabled: isEnabled
2591
+ });
2592
+ };
2593
+
2594
+ /* *
2595
+ * Licensed under the Apache License, Version 2.0 (the "License");
2596
+ * you may not use this file except in compliance with the License.
2597
+ * You may obtain a copy of the License at
2598
+ *
2599
+ * http://www.apache.org/licenses/LICENSE-2.0
2600
+ *
2601
+ * Unless required by applicable law or agreed to in writing, software
2602
+ * distributed under the License is distributed on an "AS IS" BASIS,
2603
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2604
+ * See the License for the specific language governing permissions and
2605
+ * limitations under the License.
2606
+ *
2607
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2608
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
2609
+ * */
2610
+ var EnableButton = function EnableButton(_a) {
2611
+ var isEnabled = _a.isEnabled,
2612
+ title = _a.title,
2613
+ onChangeEnableLayer = _a.onChangeEnableLayer;
2614
+
2615
+ var onClick = function onClick() {
2616
+ onChangeEnableLayer(!isEnabled);
2617
+ };
2618
+
2619
+ var visibilityIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
2620
+ width: 24,
2621
+ height: 24,
2622
+ fill: "transparent"
2623
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2624
+ d: "M14.4980749,15.8618431 C15.8661433,15.0851043 16.779689,13.6936347 16.779689,12.1014551 C16.779689,10.5092755 15.8661433,9.11870594 14.4980749,8.34106705 C17.6257313,9.18620931 19.3529176,11.4300215 19.8092405,12.1014551 C19.3529176,12.7719886 17.6266313,15.0167008 14.4980749,15.8618431 L14.4980749,15.8618431 Z M4.18985949,12.1014551 C4.64618231,11.4300215 6.37336867,9.18710936 9.49922496,8.3419671 C8.13295665,9.11870594 7.21851093,10.5101755 7.21851093,12.1014551 C7.21851093,13.6936347 8.13295665,15.0842042 9.49922496,15.8618431 C6.37336867,15.0167008 4.64618231,12.7728886 4.18985949,12.1014551 L4.18985949,12.1014551 Z M11.99955,13.8583429 C10.9950998,13.8583429 10.180559,13.0717036 10.180559,12.1014551 C10.180559,11.1312066 10.9950998,10.3445672 11.99955,10.3445672 C13.0031002,10.3445672 13.8176409,11.1312066 13.8176409,12.1014551 C13.8176409,13.0717036 13.0031002,13.8583429 11.99955,13.8583429 L11.99955,13.8583429 Z M20.7983899,11.7666383 C20.6813841,11.5713286 17.8696435,7 11.99955,7 C6.12945647,7 3.31681584,11.5713286 3.19980999,11.7666383 L3,12.1014551 L3.19980999,12.4362718 C3.31681584,12.6306815 6.12945647,17.2020101 11.99955,17.2020101 C17.8696435,17.2020101 20.6813841,12.6306815 20.7983899,12.4362718 L21,12.1014551 L20.7983899,11.7666383 Z"
2625
+ }));
2626
+ var visibilityOffIcon = /*#__PURE__*/React__namespace.createElement(material.SvgIcon, {
2627
+ style: {
2628
+ marginTop: 2
2629
+ }
2630
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
2631
+ width: 24,
2632
+ height: 24,
2633
+ fill: "transparent"
2634
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2635
+ d: "M12 15.309c-.755 0-1.45-.088-2.092-.236l.798-.797c.41.124.844.192 1.294.192 2.453 0 4.442-1.988 4.442-4.44 0-.495-.085-.907-.234-1.255l.03-.03c1.72.906 2.781 2.167 3.218 2.766-.724.992-3.151 3.8-7.456 3.8zm-7.456-3.8c.442-.607 1.522-1.89 3.276-2.796-.166.36-.261.79-.261 1.315 0 1.228.499 2.34 1.305 3.144l-1.102 1.104c-1.72-.906-2.78-2.169-3.218-2.767zm5.646-3.524c.818 0 1.482.665 1.482 1.483 0 .818-.664 1.481-1.482 1.481s-1.482-.663-1.482-1.481c0-.818.664-1.483 1.482-1.483zm10.608 3.19c-.073-.125-1.245-2.026-3.603-3.388l2.009-2.01c.406-.406.406-1.065 0-1.473-.407-.405-1.066-.405-1.473 0l-2.58 2.582c-.93-.295-1.98-.478-3.151-.478-5.87 0-8.681 4.57-8.798 4.766L3 11.51l.202.335c.073.124 1.244 2.025 3.603 3.387l-2.009 2.01c-.406.406-.406 1.065 0 1.472.204.203.47.305.737.305.266 0 .532-.102.736-.305l2.58-2.58c.93.293 1.98.476 3.151.476 5.87 0 8.681-4.57 8.798-4.765l.202-.335-.202-.335z"
2636
+ }));
2637
+ return /*#__PURE__*/React__namespace.createElement(ManagerButton, {
2638
+ tooltipTitle: title,
2639
+ onClick: onClick,
2640
+ icon: /*#__PURE__*/React__namespace.createElement(material.Checkbox, {
2641
+ sx: {
2642
+ color: 'inherit',
2643
+ padding: 0.5,
2644
+ borderRadius: 1.25,
2645
+ '&.Mui-focusVisible': {
2646
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
2647
+ },
2648
+ '&:hover': {
2649
+ backgroundColor: 'transparent!important'
2650
+ },
2651
+ '&.Mui-checked': {
2652
+ color: 'inherit'
2653
+ }
2654
+ },
2655
+ icon: visibilityOffIcon,
2656
+ checkedIcon: visibilityIcon,
2657
+ checked: isEnabled,
2658
+ disableFocusRipple: true,
2659
+ tabIndex: -1
2660
+ }),
2661
+ testId: "enableButton",
2662
+ isEnabled: isEnabled
2663
+ });
2664
+ };
2665
+
2468
2666
  /* *
2469
2667
  * Licensed under the Apache License, Version 2.0 (the "License");
2470
2668
  * you may not use this file except in compliance with the License.
@@ -2507,9 +2705,11 @@
2507
2705
  exports.CustomSlider = CustomSlider;
2508
2706
  exports.CustomToggleButton = CustomToggleButton;
2509
2707
  exports.Draggable = DraggableComponent$1;
2510
- exports.DraggableDialog = DraggableDialog;
2708
+ exports.EnableButton = EnableButton;
2511
2709
  exports.ErrorBoundary = ErrorBoundary;
2512
2710
  exports.HIDDEN_INPUT_HELPER_IS_DRAFT = HIDDEN_INPUT_HELPER_IS_DRAFT;
2711
+ exports.ManagerButton = ManagerButton;
2712
+ exports.ManagerDeleteButton = ManagerDeleteButton;
2513
2713
  exports.Resizable = ResizeComponent;
2514
2714
  exports.StatusTag = StatusTag;
2515
2715
  exports.ToggleMenu = ToggleMenu;
@@ -2521,8 +2721,7 @@
2521
2721
  exports.UserMenu = UserMenu;
2522
2722
  exports.UserMenuItemCheatSheet = UserMenuItemCheatSheet;
2523
2723
  exports.UserMenuItemTheme = MenuItemTheme;
2524
- exports.Z_INDEX_BOTTOM = Z_INDEX_BOTTOM;
2525
- exports.Z_INDEX_TOP = Z_INDEX_TOP;
2724
+ exports.calculateDialogSizeAndPosition = calculateDialogSizeAndPosition;
2526
2725
  exports.getAxiosErrorMessage = getAxiosErrorMessage;
2527
2726
  exports.getInitials = getInitials;
2528
2727
  exports.isAxiosError = isAxiosError;
@@ -5,6 +5,7 @@ interface AlertBannerProps {
5
5
  severity?: AlertColor;
6
6
  info?: string | React.ReactElement;
7
7
  dataTestId?: string;
8
+ isCompact?: boolean;
8
9
  }
9
10
  declare const AlertBanner: React.FC<AlertBannerProps>;
10
11
  export default AlertBanner;
@@ -3,7 +3,15 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const AlertBanners: {
6
+ export declare const AlertBannersGWTheme: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const AlertBannersLight: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
14
+ export declare const AlertBannersDark: {
7
15
  (): React.ReactElement;
8
16
  storyName: string;
9
17
  };