@opengeoweb/shared 2.4.0 → 2.4.1

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
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, Alert, AlertTitle, SvgIcon, Grid, useTheme, Link, Avatar, Paper, ClickAwayListener, MenuList, MenuItem, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Tooltip, Menu, ListItemIcon, Checkbox } from '@mui/material';
4
- import makeStyles from '@mui/styles/makeStyles';
5
- import { Close, DragIndicator, Delete } from '@mui/icons-material';
4
+ import Close from '@mui/icons-material/Close';
6
5
  import { useFormContext } from 'react-hook-form';
7
6
  import { isEmpty, errorMessages } from '@opengeoweb/form-fields';
7
+ import makeStyles from '@mui/styles/makeStyles';
8
8
  import Draggable from 'react-draggable';
9
9
  import { Resizable } from 're-resizable';
10
10
  import { useThemeContext } from '@opengeoweb/theme';
11
+ import { DragIndicator, Close as Close$1, Delete } from '@mui/icons-material';
11
12
  import { throttle } from 'lodash';
12
13
  import withStyles from '@mui/styles/withStyles';
13
14
  import MoreVertIcon from '@mui/icons-material/MoreVert';
@@ -103,20 +104,6 @@ function __rest(s, e) {
103
104
  return t;
104
105
  }
105
106
 
106
- var useStyles$b = makeStyles(function () {
107
- return {
108
- dialogHeader: {
109
- zIndex: 1,
110
- padding: '8px 20px',
111
- display: 'flex',
112
- justifyContent: 'space-between',
113
- alignItems: 'center'
114
- },
115
- dialogContent: {
116
- padding: '40px 20px 0px 20px !important'
117
- }
118
- };
119
- });
120
107
  var ConfirmationDialog = function ConfirmationDialog(_a) {
121
108
  var open = _a.open,
122
109
  title = _a.title,
@@ -132,8 +119,6 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
132
119
  content = _a$content === void 0 ? null : _a$content,
133
120
  other = __rest(_a, ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content"]);
134
121
 
135
- var classes = useStyles$b();
136
-
137
122
  other.catchOnCancel;
138
123
  var rest = __rest(other, ["catchOnCancel"]); // remove unwanted props
139
124
 
@@ -141,14 +126,33 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
141
126
  return /*#__PURE__*/React.createElement(Dialog, Object.assign({
142
127
  "data-testid": "confirmationDialog",
143
128
  open: open,
144
- maxWidth: "sm",
145
- fullWidth: true,
129
+ PaperProps: {
130
+ sx: {
131
+ width: '560px',
132
+ margin: 2.5
133
+ }
134
+ },
146
135
  // fix for briefly showing default options when closing dialog
147
136
  transitionDuration: 0
148
137
  }, rest), /*#__PURE__*/React.createElement(DialogTitle, {
149
- className: classes.dialogHeader
138
+ sx: {
139
+ zIndex: 1,
140
+ padding: 2,
141
+ display: 'flex',
142
+ justifyContent: 'space-between',
143
+ alignItems: 'center'
144
+ }
150
145
  }, /*#__PURE__*/React.createElement(Typography, {
151
- variant: "h5",
146
+ sx: {
147
+ fontSize: {
148
+ xs: '16px',
149
+ sm: '34px'
150
+ },
151
+ fontWeight: {
152
+ xs: 500,
153
+ sm: 400
154
+ }
155
+ },
152
156
  "data-testid": "confirmationDialog-title",
153
157
  component: "span"
154
158
  }, title), /*#__PURE__*/React.createElement(IconButton, {
@@ -159,22 +163,50 @@ var ConfirmationDialog = function ConfirmationDialog(_a) {
159
163
  },
160
164
  size: "small"
161
165
  }, /*#__PURE__*/React.createElement(Close, null))), /*#__PURE__*/React.createElement(DialogContent, {
162
- className: classes.dialogContent
166
+ sx: {
167
+ padding: '8px 16px'
168
+ }
163
169
  }, /*#__PURE__*/React.createElement(Typography, {
164
170
  variant: "body1"
165
- }, description), content), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button, {
166
- "data-testid": "conformationDialog-cancel",
167
- color: "secondary",
168
- variant: "outlined",
171
+ }, description), content), /*#__PURE__*/React.createElement(DialogActions, {
172
+ sx: {
173
+ padding: 2,
174
+ flexDirection: {
175
+ xs: 'column',
176
+ sm: 'row'
177
+ }
178
+ }
179
+ }, /*#__PURE__*/React.createElement(Button, {
180
+ "data-testid": "confirmationDialog-cancel",
181
+ variant: "tertiary",
182
+ sx: {
183
+ width: {
184
+ xs: '100%',
185
+ sm: '150px'
186
+ }
187
+ },
169
188
  onClick: function onClick() {
170
189
  return onClose('CANCELLED');
171
190
  },
172
191
  autoFocus: true,
173
192
  disableRipple: true
174
193
  }, cancelLabel), /*#__PURE__*/React.createElement(Button, {
175
- "data-testid": "conformationDialog-confirm",
176
- color: "secondary",
177
- variant: "contained",
194
+ "data-testid": "confirmationDialog-confirm",
195
+ variant: "primary",
196
+ sx: {
197
+ width: {
198
+ xs: '100%',
199
+ sm: '150px'
200
+ },
201
+ marginLeft: {
202
+ xs: '0px!important',
203
+ sm: '8px!important'
204
+ },
205
+ marginTop: {
206
+ xs: 2,
207
+ sm: 0
208
+ }
209
+ },
178
210
  onClick: onSubmit
179
211
  }, confirmLabel)));
180
212
  };
@@ -1403,7 +1435,7 @@ var ToolHeader = function ToolHeader(_ref) {
1403
1435
  onClick: onClickClose,
1404
1436
  size: "large",
1405
1437
  sx: iconStyle
1406
- }, /*#__PURE__*/React__default.createElement(Close, null)))));
1438
+ }, /*#__PURE__*/React__default.createElement(Close$1, null)))));
1407
1439
  };
1408
1440
 
1409
1441
  /* *
@@ -2733,7 +2765,7 @@ var EnableButton = function EnableButton(_ref) {
2733
2765
  disableFocusRipple: true,
2734
2766
  tabIndex: -1
2735
2767
  }),
2736
- testId: "enableLayer",
2768
+ testId: "enableButton",
2737
2769
  isEnabled: isEnabled
2738
2770
  });
2739
2771
  };
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/icons-material/MoreVert'), require('@mui/styles/createStyles')) :
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/icons-material/MoreVert', '@mui/styles/createStyles'], 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.MoreVertIcon, global.createStyles));
5
- })(this, (function (exports, React, material, makeStyles, iconsMaterial, reactHookForm, formFields, Draggable, reResizable, theme, lodash, withStyles, MoreVertIcon, createStyles) { '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,6 +26,7 @@
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);
@@ -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
  };
@@ -2624,7 +2656,7 @@
2624
2656
  disableFocusRipple: true,
2625
2657
  tabIndex: -1
2626
2658
  }),
2627
- testId: "enableLayer",
2659
+ testId: "enableButton",
2628
2660
  isEnabled: isEnabled
2629
2661
  });
2630
2662
  };
@@ -1,6 +1,14 @@
1
1
  import * as React from 'react';
2
- export declare const ConfirmationDialogExample: () => React.ReactElement;
3
- export declare const ConfirmationDialogSnapshot: {
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ConfirmationDialogCustom: () => React.ReactElement;
7
+ export declare const ConfirmationDialogLight: {
8
+ (): React.ReactElement;
9
+ storyName: string;
10
+ };
11
+ export declare const ConfirmationDialogDark: {
4
12
  (): React.ReactElement;
5
13
  storyName: string;
6
14
  };
@@ -1,5 +1,4 @@
1
1
  export * from './AppHeader/AppHeader.stories';
2
- export * from './ConfirmationDialog/ConfirmationDialog.stories';
3
2
  export * from './ErrorBoundary/ErrorBoundary.stories';
4
3
  declare const _default: {
5
4
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,13 +14,13 @@
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
16
  "@mui/material": "^5.2.8",
17
- "@opengeoweb/theme": "2.4.0",
17
+ "@opengeoweb/theme": "2.4.1",
18
18
  "@mui/styles": "^5.2.3",
19
19
  "@mui/icons-material": "^5.2.5",
20
20
  "react-draggable": "^4.4.3",
21
21
  "re-resizable": "^6.9.0",
22
22
  "lodash": "^4.17.20",
23
- "@opengeoweb/form-fields": "2.4.0",
23
+ "@opengeoweb/form-fields": "2.4.1",
24
24
  "react-hook-form": "^6.12.1",
25
25
  "moment": "^2.29.0",
26
26
  "moment-timezone": "^0.5.31",