@popmenu/admin-ui 0.19.0 → 0.20.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.
@@ -1,4 +1,5 @@
1
1
  import { AlertProps as CommonAlertProps } from '@popmenu/common-ui';
2
+ import { RefObject } from 'react';
2
3
  export interface AlertProps extends CommonAlertProps {
3
4
  /** Makes the fill the width of its container */
4
5
  fullWidth?: boolean;
@@ -7,4 +8,6 @@ export interface AlertProps extends CommonAlertProps {
7
8
  href: string;
8
9
  text: string;
9
10
  };
11
+ /** @ignore */
12
+ ref?: RefObject<HTMLDivElement>;
10
13
  }
@@ -15,5 +15,6 @@ export interface AlertDialogProps extends DialogProps {
15
15
  proceedButtonText?: string;
16
16
  /** Sets the type of dialog that will be shown. */
17
17
  severity?: 'info' | 'error' | 'warning' | 'success';
18
+ /** @ignore */
18
19
  ref?: (instance: HTMLDivElement) => void | Ref<HTMLDivElement> | null;
19
20
  }
@@ -1,6 +1,10 @@
1
1
  import { SnackbarProps } from '@material-ui/core/Snackbar';
2
2
  import { AlertProps as MuiAlertProps } from '@material-ui/lab/Alert';
3
3
  export interface ToastProps extends SnackbarProps {
4
+ /** Applied to the built in [Alert](?path=/docs/admin-ui-alert--props) Component. */
4
5
  AlertProps: Omit<MuiAlertProps, 'ref'>;
6
+ /** The severity of the Alert. */
5
7
  severity: 'error' | 'warning' | 'info' | 'success';
8
+ /** @ignore */
9
+ ref?: SnackbarProps['ref'];
6
10
  }
package/build/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { createElement, forwardRef, createContext, useState, useContext } from 'react';
3
3
  import CommonAlert from '@material-ui/lab/Alert';
4
- import { makeStyles, Paper as Paper$1, Box } from '@material-ui/core';
4
+ import { makeStyles, Paper as Paper$1, Link as Link$1, Box } from '@material-ui/core';
5
5
  import '@material-ui/core/AppBar';
6
6
  import MuiIconButton from '@material-ui/core/IconButton';
7
7
  import MuiTypography from '@material-ui/core/Typography';
@@ -30,7 +30,6 @@ import '@material-ui/core/FormControl';
30
30
  import '@material-ui/core/Grid';
31
31
  import '@material-ui/core/InputAdornment';
32
32
  import '@material-ui/core/LinearProgress';
33
- import MuiLink from '@material-ui/core/Link';
34
33
  import '@material-ui/core/List';
35
34
  import '@material-ui/core/ListItem';
36
35
  import '@material-ui/core/ListItemIcon';
@@ -176,41 +175,23 @@ function __rest(s, e) {
176
175
  return t;
177
176
  }
178
177
 
179
- var useIconStyles = makeStyles(function (_a) {
180
- var spacing = _a.spacing, palette = _a.palette;
181
- var getFontSize = function (_a) {
182
- var size = _a.size;
183
- var sizes = {
184
- inherit: 'inherit',
185
- small: spacing(1.5),
186
- medium: spacing(2),
187
- large: spacing(2.5),
188
- 'extra-large': spacing(3),
189
- };
190
- return size ? sizes[size] : 'inherit';
191
- };
192
- var getColor = function (props) {
193
- var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
194
- var value = 'inherit';
195
- if (props.color) {
196
- if (semanticColors.includes(props.color.split('.')[0])) {
197
- var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
198
- value = palette[color][variant];
199
- }
200
- else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
201
- value = props.color;
202
- }
203
- }
204
- return value;
205
- };
206
- return {
207
- root: {
208
- color: getColor,
209
- fontSize: getFontSize,
210
- strokeWidth: '1.3px',
211
- },
212
- };
213
- });
178
+ var _path$3k;
179
+
180
+ function _extends$3B() { _extends$3B = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3B.apply(this, arguments); }
181
+
182
+ function SvgUser(props) {
183
+ return /*#__PURE__*/React.createElement("svg", _extends$3B({
184
+ viewBox: "0 0 16 16",
185
+ strokeLinecap: "round",
186
+ strokeLinejoin: "round",
187
+ stroke: "currentColor",
188
+ width: "1em",
189
+ height: "1em",
190
+ fill: "none"
191
+ }, props), _path$3k || (_path$3k = /*#__PURE__*/React.createElement("path", {
192
+ d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z"
193
+ })));
194
+ }
214
195
 
215
196
  var classnames = {exports: {}};
216
197
 
@@ -272,6 +253,42 @@ var classnames = {exports: {}};
272
253
 
273
254
  var classNames = classnames.exports;
274
255
 
256
+ var useIconStyles = makeStyles(function (_a) {
257
+ var spacing = _a.spacing, palette = _a.palette;
258
+ var getFontSize = function (_a) {
259
+ var size = _a.size;
260
+ var sizes = {
261
+ inherit: 'inherit',
262
+ small: spacing(1.5),
263
+ medium: spacing(2),
264
+ large: spacing(2.5),
265
+ 'extra-large': spacing(3),
266
+ };
267
+ return size ? sizes[size] : 'inherit';
268
+ };
269
+ var getColor = function (props) {
270
+ var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
271
+ var value = 'inherit';
272
+ if (props.color) {
273
+ if (semanticColors.includes(props.color.split('.')[0])) {
274
+ var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
275
+ value = palette[color][variant];
276
+ }
277
+ else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
278
+ value = props.color;
279
+ }
280
+ }
281
+ return value;
282
+ };
283
+ return {
284
+ root: {
285
+ color: getColor,
286
+ fontSize: getFontSize,
287
+ strokeWidth: '1.3px',
288
+ },
289
+ };
290
+ });
291
+
275
292
  var iconStaticClassName = 'pop-icon';
276
293
  var Icon = function (props) {
277
294
  var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
@@ -393,18 +410,9 @@ var LoadingStatus;
393
410
  LoadingStatus["LOADED"] = "LOADED";
394
411
  LoadingStatus["PENDING"] = "PENDING";
395
412
  })(LoadingStatus || (LoadingStatus = {}));
396
- /**
397
- * Hook returns [imgProps, loaded]
398
- * ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
399
- * loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
400
- */
401
413
  var useImgProps = function (avatarProps) {
402
414
  var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
403
- var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
404
- var _a, _b;
405
- setLoaded(LoadingStatus.ERROR);
406
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
407
- }, onLoad: function (event) {
415
+ var imgProps = __assign(__assign({}, avatarProps.imgProps), { onLoad: function (event) {
408
416
  var _a, _b;
409
417
  setLoaded(LoadingStatus.LOADED);
410
418
  (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -431,97 +439,49 @@ var getAvatarFontSize = function (props) {
431
439
  large: '1.25rem',
432
440
  'extra-large': '3.5rem',
433
441
  };
434
- return fontSizes[props.size || 'medium'];
435
- };
436
- var getAvatarBackground = function (props) {
437
- var src = props.src, loaded = props.loaded;
438
- var background = props.background;
439
- if (src && loaded === LoadingStatus.LOADED) {
440
- background = 'transparent';
441
- }
442
- return background;
442
+ return fontSizes[props.size];
443
443
  };
444
444
  var useAvatarStyles = makeStyles$1(function (theme) { return ({
445
- root: {
446
- width: function (props) { return getAvatarDimensions(theme, props); },
447
- height: function (props) { return getAvatarDimensions(theme, props); },
448
- fontSize: function (props) { return getAvatarFontSize(props); },
449
- backgroundColor: function (props) { return getAvatarBackground(props); },
450
- color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
451
- objectFit: function (props) { return props.fit; },
452
- },
453
- silhouette: {
454
- '& path': {
455
- fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
456
- },
457
- },
445
+ root: function (props) { return ({
446
+ width: getAvatarDimensions(theme, props),
447
+ height: getAvatarDimensions(theme, props),
448
+ fontSize: getAvatarFontSize(props),
449
+ backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
450
+ color: theme.palette.getContrastText(props.background),
451
+ objectFit: props.fit,
452
+ }); },
453
+ fallback: function (props) { return ({
454
+ fontSize: getAvatarDimensions(theme, props),
455
+ strokeWidth: 1,
456
+ }); },
458
457
  }); });
459
458
 
460
- var _path$2;
461
-
462
- function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
463
-
464
- function SvgSilhouetteFemale(props) {
465
- return /*#__PURE__*/React.createElement("svg", _extends$2({
466
- viewBox: "0 0 300 300",
467
- fill: "none",
468
- xmlns: "http://www.w3.org/2000/svg"
469
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
470
- d: "M179.417 182.917a3.362 3.362 0 00-2.951 1.076 3.461 3.461 0 00-.875 3.021c1.916 10.069 8.368 23.889 28.173 32.493 2.347 1.014 5.972 1.805 10.57 2.799 17.208 3.722 45.986 9.958 53.055 36.333a3.488 3.488 0 001.622 2.11 3.491 3.491 0 002.639.345 3.488 3.488 0 002.109-1.622 3.473 3.473 0 00.345-2.639c-8.173-30.465-40.777-37.527-58.298-41.319-4.056-.882-7.563-1.639-9.278-2.389-11.903-5.167-19.59-12.833-22.924-22.819 33.07 2.458 48.042-10.716 48.702-11.313a3.469 3.469 0 001.121-2.951 3.478 3.478 0 00-1.732-2.639c-19.084-10.903-19.084-48.577-19.084-62.764 0-39.674-26.722-71.125-60.979-71.618-.326-.011-.652-.018-.979-.021h-.007c-34.757.194-63.035 31.68-63.035 70.194 0 14.188 0 51.868-19.083 62.764a3.5 3.5 0 00-1.73 2.769 3.494 3.494 0 001.313 2.988c.959.743 22.14 16.952 48.202 12.028-3.486 9.569-11.07 16.931-22.625 21.951-1.674.73-5.007 1.528-8.868 2.445-17.64 4.194-50.48 12.007-58.702 42.687a3.481 3.481 0 00.348 2.638 3.475 3.475 0 006.368-.839c7.145-26.694 36.229-33.604 53.597-37.743 4.354-1.035 7.791-1.854 10.028-2.82 19.805-8.604 26.25-22.423 28.173-32.493a3.45 3.45 0 00-1.104-3.243 3.457 3.457 0 00-3.347-.722c-18.799 5.917-36.167-2.222-43.757-6.736 18.132-15.181 18.132-50.118 18.132-65.674 0-34.7 25.18-63.076 56.389-63.263l.736.041c30.778.438 53.986 28.236 53.986 64.667 0 15.562 0 50.576 18.208 65.757-6.271 3.583-20.569 9.382-44.458 6.521z",
471
- fill: "#2E3042"
472
- })));
473
- }
474
-
475
- var _path$1;
476
-
477
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
478
-
479
- function SvgSilhouetteMale(props) {
480
- return /*#__PURE__*/React.createElement("svg", _extends$1({
481
- viewBox: "0 0 300 300",
482
- fill: "none",
483
- xmlns: "http://www.w3.org/2000/svg"
484
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
485
- d: "M27.594 261.886a3.513 3.513 0 004.281-2.478c7.204-26.904 36.484-33.877 53.984-38.05 4.386-1.043 7.848-1.869 10.1-2.842 19.935-8.66 26.433-22.592 28.377-32.757a3.493 3.493 0 00-.133-1.81 3.492 3.492 0 00-1.021-1.501c-10.38-8.968-19.137-22.431-24.663-37.917a3.447 3.447 0 00-.72-1.197c-7.31-7.953-11.506-16.361-11.506-23.06 0-3.914 1.475-6.539 4.798-8.52a3.5 3.5 0 001.7-2.857c1.545-35.662 26.922-63.735 58.047-63.917l.749.049c31.279.434 56.495 29.11 57.397 65.275a3.487 3.487 0 001.245 2.584c2.189 1.855 3.211 4.207 3.211 7.4 0 5.607-2.987 12.503-8.401 19.406a3.633 3.633 0 00-.587 1.106c-5.596 17.754-15.64 33.429-27.545 43.02a3.517 3.517 0 00-1.245 3.381c1.945 10.159 8.442 24.083 28.377 32.757 2.357 1.022 6.015 1.821 10.653 2.822 17.325 3.752 46.318 10.046 53.431 36.628a3.503 3.503 0 002.926 2.562 3.494 3.494 0 003.922-3.019 3.52 3.52 0 00-.091-1.363c-8.219-30.713-41.065-37.833-58.705-41.655-4.092-.889-7.625-1.652-9.345-2.408-13.01-5.657-21.026-14.275-23.859-25.658 12.08-10.383 22.187-26.401 27.965-44.365 6.134-7.981 9.505-16.2 9.505-23.221 0-4.684-1.511-8.59-4.504-11.643-1.665-39.232-29.636-70.127-64.35-70.624L150.545 38c-34.085.182-62.175 30.264-64.63 68.818-4.379 3.22-6.603 7.736-6.603 13.47 0 8.282 4.68 18.188 12.87 27.275 5.659 15.563 14.43 29.235 24.873 38.805-2.819 11.426-10.842 20.072-23.88 25.735-1.685.735-5.043 1.541-8.932 2.465-17.773 4.228-50.843 12.104-59.125 43.034a3.501 3.501 0 002.476 4.284z",
486
- fill: "#2E3042"
487
- })));
488
- }
489
-
490
- var _path;
491
-
492
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
493
-
494
- function SvgSilhouetteNeutral(props) {
495
- return /*#__PURE__*/React.createElement("svg", _extends({
496
- viewBox: "0 0 300 300",
497
- fill: "none",
498
- xmlns: "http://www.w3.org/2000/svg"
499
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
500
- fillRule: "evenodd",
501
- clipRule: "evenodd",
502
- d: "M209 121c0 32.585-26.415 59-59 59s-59-26.415-59-59 26.415-59 59-59 59 26.415 59 59zm8 0c0 37.003-29.997 67-67 67s-67-29.997-67-67 29.997-67 67-67 67 29.997 67 67zm35 137.333V284h8v-25.667c0-13.614-5.821-26.671-16.182-36.298C233.456 212.408 219.403 207 204.75 207H94.25c-14.653 0-28.706 5.408-39.068 15.035C44.821 231.662 39 244.719 39 258.333V284h8v-25.667c0-11.295 4.824-22.257 13.628-30.437C69.45 219.698 81.537 215 94.25 215h110.5c12.714 0 24.799 4.698 33.622 12.896 8.804 8.18 13.628 19.142 13.628 30.437z",
503
- fill: "#2E3042"
504
- })));
505
- }
506
-
507
- var silhouettes = {
508
- female: SvgSilhouetteFemale,
509
- male: SvgSilhouetteMale,
510
- neutral: SvgSilhouetteNeutral,
511
- };
512
459
  var Avatar = forwardRef(function (props, ref) {
513
- var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
514
- var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
460
+ var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest(props, ["children", "src", "alt", "fallback"]);
461
+ var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
515
462
  var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
516
- var Silhouette = silhouettes[silhouette];
517
- var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
518
- return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
463
+ var displayAltTextFallback = src && alt;
464
+ var displayNoFallback = fallback === 'none';
465
+ var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
466
+ var Fallback;
467
+ if (displayAltTextFallback) {
468
+ Fallback = null;
469
+ }
470
+ else if (displayNoFallback) {
471
+ Fallback = ' ';
472
+ }
473
+ else if (displayCustomFallback) {
474
+ Fallback = fallback;
475
+ }
476
+ else {
477
+ Fallback = React__default.createElement(Icon, { icon: SvgUser, className: classes.fallback });
478
+ }
479
+ return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
519
480
  });
520
481
  Avatar.defaultProps = {
521
482
  size: 'medium',
522
483
  fit: 'cover',
523
484
  background: '#E0E0E0',
524
- silhouette: 'neutral',
525
485
  };
526
486
  Avatar.displayName = 'Avatar';
527
487
 
@@ -620,42 +580,21 @@ makeStyles(function (theme) { return ({
620
580
  },
621
581
  }); });
622
582
 
623
- var getLinkColor = function (_a, _b) {
624
- var palette = _a.palette;
625
- var _c = _b.color, color = _c === void 0 ? 'info' : _c;
626
- var resolved;
627
- if (['primary', 'secondary', 'info', 'error'].includes(color)) {
628
- resolved = palette[color].main;
629
- }
630
- else if (['textPrimary', 'textSecondary'].includes(color)) {
631
- resolved = palette.text[color.substring(4).toLowerCase()];
632
- }
633
- else if (color === 'inherit') {
634
- resolved = color;
635
- }
636
- return resolved;
637
- };
638
- var useLinkStyles = makeStyles$1(function (theme) {
639
- var _a;
640
- return ({
641
- root: (_a = {
642
- display: 'flex',
643
- color: function (props) { return getLinkColor(theme, props); }
644
- },
645
- _a["& ." + iconStaticClassName] = {
646
- alignSelf: 'center',
647
- },
648
- _a),
649
- });
650
- });
583
+ var useLinkStyles = makeStyles$1(function (theme) { return ({
584
+ root: function (props) {
585
+ var _a;
586
+ return (__assign(__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
587
+ alignSelf: 'center',
588
+ }, _a)));
589
+ },
590
+ }); });
651
591
 
652
592
  var Link = forwardRef(function (props, ref) {
653
- var children = props.children; props.color; var muiProps = __rest(props, ["children", "color"]);
593
+ var children = props.children, muiProps = __rest(props, ["children"]);
654
594
  var classes = useLinkStyles(props);
655
- return (React__default.createElement(MuiLink, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
595
+ return (React__default.createElement(Link$1, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
656
596
  });
657
597
  Link.defaultProps = {
658
- color: 'info',
659
598
  variant: 'body1',
660
599
  };
661
600
  Link.displayName = 'Link';
@@ -899,6 +838,9 @@ var useAlertStyles = makeStyles$1(function (theme) { return ({
899
838
  borderLeft: theme.spacing(1) + "px solid",
900
839
  color: theme.palette.text.primary,
901
840
  },
841
+ icon: {
842
+ alignSelf: 'start',
843
+ },
902
844
  }); });
903
845
 
904
846
  var severityIcons$1 = {
@@ -913,9 +855,9 @@ var Alert = forwardRef(function (props, ref) {
913
855
  var validLink = link && link.href && link.text && { href: link.href, children: link.text };
914
856
  var Action = (React__default.createElement(React__default.Fragment, null,
915
857
  validLink && React__default.createElement(Link, __assign$1({}, validLink)),
916
- React__default.createElement(IconButton, { onClick: onClose },
917
- React__default.createElement(Icon, { icon: SvgX }))));
918
- return (React__default.createElement(CommonAlert, __assign$1({ ref: ref, classes: classes, icon: React__default.createElement(Icon, { icon: severityIcons$1[severity] }), action: Action, variant: variant, severity: severity }, muiProps), children));
858
+ onClose && (React__default.createElement(IconButton, { onClick: onClose },
859
+ React__default.createElement(Icon, { icon: SvgX })))));
860
+ return (React__default.createElement(CommonAlert, __assign$1({ ref: ref, classes: classes, icon: React__default.createElement(Icon, { icon: severityIcons$1[severity], size: "extra-large" }), action: Action, variant: variant, severity: severity }, muiProps), children));
919
861
  });
920
862
  Alert.displayName = 'Alert';
921
863
 
@@ -1099,7 +1041,6 @@ var useAlertDialogStyles = makeStyles$1(function (theme) { return ({
1099
1041
  card: {
1100
1042
  borderRadius: theme.spacing(0.75),
1101
1043
  borderTop: function (props) { return theme.spacing(1.25) + "px solid " + theme.palette[props.severity || 'info'].main; },
1102
- width: '500px',
1103
1044
  },
1104
1045
  cardActions: {
1105
1046
  background: theme.palette.grey[100],
@@ -1122,7 +1063,7 @@ var severityIcons = {
1122
1063
  var AlertDialog = forwardRef(function (props, ref) {
1123
1064
  var children = props.children, labelId = props.labelId, descriptionId = props.descriptionId, _a = props.severity, severity = _a === void 0 ? 'info' : _a, _b = props.proceedButtonText, proceedButtonText = _b === void 0 ? 'proceed' : _b, onClose = props.onClose, onCancel = props.onCancel, onProceed = props.onProceed, DialogProps = __rest$1(props, ["children", "labelId", "descriptionId", "severity", "proceedButtonText", "onClose", "onCancel", "onProceed"]);
1124
1065
  var classes = useAlertDialogStyles(props);
1125
- return (React__default.createElement(Dialog, __assign$1({ ref: ref, classes: { paper: classes.root } }, DialogProps),
1066
+ return (React__default.createElement(Dialog, __assign$1({ ref: ref, classes: { paper: classes.root }, maxWidth: "sm", fullWidth: true }, DialogProps),
1126
1067
  React__default.createElement(Card, { classes: { root: classes.card }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": labelId, "aria-describedby": descriptionId },
1127
1068
  React__default.createElement(IconButton, { className: classes.cancelIcon, onClick: onClose },
1128
1069
  React__default.createElement(Icon, { icon: SvgX })),
@@ -1132,7 +1073,7 @@ var AlertDialog = forwardRef(function (props, ref) {
1132
1073
  React__default.createElement(Box, { pl: 2, pr: 3 }, children))),
1133
1074
  React__default.createElement(CardActions, { classes: { root: classes.cardActions } },
1134
1075
  React__default.createElement(Button, { onClick: onCancel, variant: "ghost" }, "Cancel"),
1135
- React__default.createElement(Button, { onClick: onProceed, variant: "ghost" }, proceedButtonText)))));
1076
+ React__default.createElement(Button, { onClick: onProceed, variant: severity }, proceedButtonText)))));
1136
1077
  });
1137
1078
  AlertDialog.displayName = 'AlertDialog';
1138
1079