@popmenu/admin-ui 0.19.2 → 0.21.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/build/components/Alert/AlertProps.d.ts +3 -0
- package/build/components/AlertDialog/AlertDialogProps.d.ts +1 -0
- package/build/components/Dialog/index.d.ts +1 -0
- package/build/components/DialogActions/DialogActions.d.ts +3 -0
- package/build/components/DialogActions/index.d.ts +2 -0
- package/build/components/DialogContent/index.d.ts +1 -0
- package/build/components/DialogTitle/index.d.ts +1 -0
- package/build/components/Toast/ToastProps.d.ts +4 -0
- package/build/components/index.d.ts +4 -0
- package/build/index.es.js +127 -172
- package/build/index.es.js.map +1 -1
- package/build/index.js +146 -171
- package/build/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dialog, DialogProps } from '@popmenu/common-ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DialogContent, DialogContentProps } from '@popmenu/common-ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DialogTitle, DialogTitleProps } from '@popmenu/common-ui';
|
|
@@ -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
|
}
|
|
@@ -9,3 +9,7 @@ export { default as FullScreenStepper, FullScreenStepperProps, FullScreenStepper
|
|
|
9
9
|
export { default as FullScreenStepperContent } from './FullScreenStepperContent';
|
|
10
10
|
export { default as SelectableCard, SelectableCardProps } from './SelectableCard';
|
|
11
11
|
export { default as Toast, ToastProps } from './Toast';
|
|
12
|
+
export { DialogTitle, DialogTitleProps } from './DialogTitle';
|
|
13
|
+
export { DialogActions, DialogActionsProps } from './DialogActions';
|
|
14
|
+
export { Dialog, DialogProps } from './Dialog';
|
|
15
|
+
export { DialogContent, DialogContentProps } from './DialogContent';
|
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';
|
|
@@ -22,15 +22,15 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
|
22
22
|
import '@material-ui/core/Chip';
|
|
23
23
|
import '@material-ui/core/Collapse';
|
|
24
24
|
import Dialog from '@material-ui/core/Dialog';
|
|
25
|
-
|
|
26
|
-
import '@material-ui/core/
|
|
27
|
-
|
|
25
|
+
export { default as Dialog } from '@material-ui/core/Dialog';
|
|
26
|
+
import CommonDialogActions from '@material-ui/core/DialogActions';
|
|
27
|
+
export { default as DialogContent } from '@material-ui/core/DialogContent';
|
|
28
|
+
export { default as DialogTitle } from '@material-ui/core/DialogTitle';
|
|
28
29
|
import '@material-ui/core/Drawer';
|
|
29
30
|
import '@material-ui/core/FormControl';
|
|
30
31
|
import '@material-ui/core/Grid';
|
|
31
32
|
import '@material-ui/core/InputAdornment';
|
|
32
33
|
import '@material-ui/core/LinearProgress';
|
|
33
|
-
import MuiLink from '@material-ui/core/Link';
|
|
34
34
|
import '@material-ui/core/List';
|
|
35
35
|
import '@material-ui/core/ListItem';
|
|
36
36
|
import '@material-ui/core/ListItemIcon';
|
|
@@ -176,41 +176,23 @@ function __rest(s, e) {
|
|
|
176
176
|
return t;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
var
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
});
|
|
179
|
+
var _path$3k;
|
|
180
|
+
|
|
181
|
+
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); }
|
|
182
|
+
|
|
183
|
+
function SvgUser(props) {
|
|
184
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3B({
|
|
185
|
+
viewBox: "0 0 16 16",
|
|
186
|
+
strokeLinecap: "round",
|
|
187
|
+
strokeLinejoin: "round",
|
|
188
|
+
stroke: "currentColor",
|
|
189
|
+
width: "1em",
|
|
190
|
+
height: "1em",
|
|
191
|
+
fill: "none"
|
|
192
|
+
}, props), _path$3k || (_path$3k = /*#__PURE__*/React.createElement("path", {
|
|
193
|
+
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"
|
|
194
|
+
})));
|
|
195
|
+
}
|
|
214
196
|
|
|
215
197
|
var classnames = {exports: {}};
|
|
216
198
|
|
|
@@ -272,6 +254,42 @@ var classnames = {exports: {}};
|
|
|
272
254
|
|
|
273
255
|
var classNames = classnames.exports;
|
|
274
256
|
|
|
257
|
+
var useIconStyles = makeStyles(function (_a) {
|
|
258
|
+
var spacing = _a.spacing, palette = _a.palette;
|
|
259
|
+
var getFontSize = function (_a) {
|
|
260
|
+
var size = _a.size;
|
|
261
|
+
var sizes = {
|
|
262
|
+
inherit: 'inherit',
|
|
263
|
+
small: spacing(1.5),
|
|
264
|
+
medium: spacing(2),
|
|
265
|
+
large: spacing(2.5),
|
|
266
|
+
'extra-large': spacing(3),
|
|
267
|
+
};
|
|
268
|
+
return size ? sizes[size] : 'inherit';
|
|
269
|
+
};
|
|
270
|
+
var getColor = function (props) {
|
|
271
|
+
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
272
|
+
var value = 'inherit';
|
|
273
|
+
if (props.color) {
|
|
274
|
+
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
275
|
+
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
276
|
+
value = palette[color][variant];
|
|
277
|
+
}
|
|
278
|
+
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
279
|
+
value = props.color;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return value;
|
|
283
|
+
};
|
|
284
|
+
return {
|
|
285
|
+
root: {
|
|
286
|
+
color: getColor,
|
|
287
|
+
fontSize: getFontSize,
|
|
288
|
+
strokeWidth: '1.3px',
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
});
|
|
292
|
+
|
|
275
293
|
var iconStaticClassName = 'pop-icon';
|
|
276
294
|
var Icon = function (props) {
|
|
277
295
|
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
@@ -324,7 +342,7 @@ var Typography = forwardRef(function (props, ref) {
|
|
|
324
342
|
});
|
|
325
343
|
Typography.displayName = 'Typography';
|
|
326
344
|
|
|
327
|
-
var useStyles$1 = makeStyles(function (_a) {
|
|
345
|
+
var useStyles$1$1 = makeStyles(function (_a) {
|
|
328
346
|
var spacing = _a.spacing;
|
|
329
347
|
return ({
|
|
330
348
|
root: {
|
|
@@ -338,7 +356,7 @@ var useStyles$1 = makeStyles(function (_a) {
|
|
|
338
356
|
});
|
|
339
357
|
var Paper = forwardRef(function (props, ref) {
|
|
340
358
|
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
341
|
-
var classes = useStyles$1(props);
|
|
359
|
+
var classes = useStyles$1$1(props);
|
|
342
360
|
return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
343
361
|
});
|
|
344
362
|
Paper.displayName = 'Paper';
|
|
@@ -393,18 +411,9 @@ var LoadingStatus;
|
|
|
393
411
|
LoadingStatus["LOADED"] = "LOADED";
|
|
394
412
|
LoadingStatus["PENDING"] = "PENDING";
|
|
395
413
|
})(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
414
|
var useImgProps = function (avatarProps) {
|
|
402
415
|
var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
403
|
-
var imgProps = __assign(__assign({}, avatarProps.imgProps), {
|
|
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) {
|
|
416
|
+
var imgProps = __assign(__assign({}, avatarProps.imgProps), { onLoad: function (event) {
|
|
408
417
|
var _a, _b;
|
|
409
418
|
setLoaded(LoadingStatus.LOADED);
|
|
410
419
|
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
@@ -431,97 +440,49 @@ var getAvatarFontSize = function (props) {
|
|
|
431
440
|
large: '1.25rem',
|
|
432
441
|
'extra-large': '3.5rem',
|
|
433
442
|
};
|
|
434
|
-
return fontSizes[props.size
|
|
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;
|
|
443
|
+
return fontSizes[props.size];
|
|
443
444
|
};
|
|
444
445
|
var useAvatarStyles = makeStyles$1(function (theme) { return ({
|
|
445
|
-
root: {
|
|
446
|
-
width:
|
|
447
|
-
height:
|
|
448
|
-
fontSize:
|
|
449
|
-
backgroundColor:
|
|
450
|
-
color:
|
|
451
|
-
objectFit:
|
|
452
|
-
},
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
},
|
|
446
|
+
root: function (props) { return ({
|
|
447
|
+
width: getAvatarDimensions(theme, props),
|
|
448
|
+
height: getAvatarDimensions(theme, props),
|
|
449
|
+
fontSize: getAvatarFontSize(props),
|
|
450
|
+
backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
|
|
451
|
+
color: theme.palette.getContrastText(props.background),
|
|
452
|
+
objectFit: props.fit,
|
|
453
|
+
}); },
|
|
454
|
+
fallback: function (props) { return ({
|
|
455
|
+
fontSize: getAvatarDimensions(theme, props),
|
|
456
|
+
strokeWidth: 1,
|
|
457
|
+
}); },
|
|
458
458
|
}); });
|
|
459
459
|
|
|
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
460
|
var Avatar = forwardRef(function (props, ref) {
|
|
513
|
-
var children = props.children,
|
|
514
|
-
var
|
|
461
|
+
var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest(props, ["children", "src", "alt", "fallback"]);
|
|
462
|
+
var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
|
|
515
463
|
var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
|
|
516
|
-
var
|
|
517
|
-
var
|
|
518
|
-
|
|
464
|
+
var displayAltTextFallback = src && alt;
|
|
465
|
+
var displayNoFallback = fallback === 'none';
|
|
466
|
+
var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
|
|
467
|
+
var Fallback;
|
|
468
|
+
if (displayAltTextFallback) {
|
|
469
|
+
Fallback = null;
|
|
470
|
+
}
|
|
471
|
+
else if (displayNoFallback) {
|
|
472
|
+
Fallback = ' ';
|
|
473
|
+
}
|
|
474
|
+
else if (displayCustomFallback) {
|
|
475
|
+
Fallback = fallback;
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
Fallback = React__default.createElement(Icon, { icon: SvgUser, className: classes.fallback });
|
|
479
|
+
}
|
|
480
|
+
return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
|
|
519
481
|
});
|
|
520
482
|
Avatar.defaultProps = {
|
|
521
483
|
size: 'medium',
|
|
522
484
|
fit: 'cover',
|
|
523
485
|
background: '#E0E0E0',
|
|
524
|
-
silhouette: 'neutral',
|
|
525
486
|
};
|
|
526
487
|
Avatar.displayName = 'Avatar';
|
|
527
488
|
|
|
@@ -620,42 +581,21 @@ makeStyles(function (theme) { return ({
|
|
|
620
581
|
},
|
|
621
582
|
}); });
|
|
622
583
|
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
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
|
-
});
|
|
584
|
+
var useLinkStyles = makeStyles$1(function (theme) { return ({
|
|
585
|
+
root: function (props) {
|
|
586
|
+
var _a;
|
|
587
|
+
return (__assign(__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
|
|
588
|
+
alignSelf: 'center',
|
|
589
|
+
}, _a)));
|
|
590
|
+
},
|
|
591
|
+
}); });
|
|
651
592
|
|
|
652
593
|
var Link = forwardRef(function (props, ref) {
|
|
653
|
-
var children = props.children
|
|
594
|
+
var children = props.children, muiProps = __rest(props, ["children"]);
|
|
654
595
|
var classes = useLinkStyles(props);
|
|
655
|
-
return (React__default.createElement(
|
|
596
|
+
return (React__default.createElement(Link$1, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
|
|
656
597
|
});
|
|
657
598
|
Link.defaultProps = {
|
|
658
|
-
color: 'info',
|
|
659
599
|
variant: 'body1',
|
|
660
600
|
};
|
|
661
601
|
Link.displayName = 'Link';
|
|
@@ -899,6 +839,9 @@ var useAlertStyles = makeStyles$1(function (theme) { return ({
|
|
|
899
839
|
borderLeft: theme.spacing(1) + "px solid",
|
|
900
840
|
color: theme.palette.text.primary,
|
|
901
841
|
},
|
|
842
|
+
icon: {
|
|
843
|
+
alignSelf: 'start',
|
|
844
|
+
},
|
|
902
845
|
}); });
|
|
903
846
|
|
|
904
847
|
var severityIcons$1 = {
|
|
@@ -913,9 +856,9 @@ var Alert = forwardRef(function (props, ref) {
|
|
|
913
856
|
var validLink = link && link.href && link.text && { href: link.href, children: link.text };
|
|
914
857
|
var Action = (React__default.createElement(React__default.Fragment, null,
|
|
915
858
|
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));
|
|
859
|
+
onClose && (React__default.createElement(IconButton, { onClick: onClose },
|
|
860
|
+
React__default.createElement(Icon, { icon: SvgX })))));
|
|
861
|
+
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
862
|
});
|
|
920
863
|
Alert.displayName = 'Alert';
|
|
921
864
|
|
|
@@ -1099,7 +1042,6 @@ var useAlertDialogStyles = makeStyles$1(function (theme) { return ({
|
|
|
1099
1042
|
card: {
|
|
1100
1043
|
borderRadius: theme.spacing(0.75),
|
|
1101
1044
|
borderTop: function (props) { return theme.spacing(1.25) + "px solid " + theme.palette[props.severity || 'info'].main; },
|
|
1102
|
-
width: '500px',
|
|
1103
1045
|
},
|
|
1104
1046
|
cardActions: {
|
|
1105
1047
|
background: theme.palette.grey[100],
|
|
@@ -1122,7 +1064,7 @@ var severityIcons = {
|
|
|
1122
1064
|
var AlertDialog = forwardRef(function (props, ref) {
|
|
1123
1065
|
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
1066
|
var classes = useAlertDialogStyles(props);
|
|
1125
|
-
return (React__default.createElement(Dialog, __assign$1({ ref: ref, classes: { paper: classes.root } }, DialogProps),
|
|
1067
|
+
return (React__default.createElement(Dialog, __assign$1({ ref: ref, classes: { paper: classes.root }, maxWidth: "sm", fullWidth: true }, DialogProps),
|
|
1126
1068
|
React__default.createElement(Card, { classes: { root: classes.card }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": labelId, "aria-describedby": descriptionId },
|
|
1127
1069
|
React__default.createElement(IconButton, { className: classes.cancelIcon, onClick: onClose },
|
|
1128
1070
|
React__default.createElement(Icon, { icon: SvgX })),
|
|
@@ -1132,7 +1074,7 @@ var AlertDialog = forwardRef(function (props, ref) {
|
|
|
1132
1074
|
React__default.createElement(Box, { pl: 2, pr: 3 }, children))),
|
|
1133
1075
|
React__default.createElement(CardActions, { classes: { root: classes.cardActions } },
|
|
1134
1076
|
React__default.createElement(Button, { onClick: onCancel, variant: "ghost" }, "Cancel"),
|
|
1135
|
-
React__default.createElement(Button, { onClick: onProceed, variant:
|
|
1077
|
+
React__default.createElement(Button, { onClick: onProceed, variant: severity }, proceedButtonText)))));
|
|
1136
1078
|
});
|
|
1137
1079
|
AlertDialog.displayName = 'AlertDialog';
|
|
1138
1080
|
|
|
@@ -1287,14 +1229,14 @@ var StepperActionsPreviousButton = function (props) {
|
|
|
1287
1229
|
return displayPreviousButton ? (React__default.createElement(Button, __assign$1({ variant: "tertiary", disabled: stepCursor === 1 }, augmentedPreviousButtonProps), previousButtonText || 'previous')) : null;
|
|
1288
1230
|
};
|
|
1289
1231
|
|
|
1290
|
-
var useStyles = makeStyles$1({
|
|
1232
|
+
var useStyles$1 = makeStyles$1({
|
|
1291
1233
|
root: {
|
|
1292
1234
|
fontStyle: 'italic',
|
|
1293
1235
|
},
|
|
1294
1236
|
});
|
|
1295
1237
|
var StepperActionsStatusText = function (props) {
|
|
1296
1238
|
var statusText = props.statusText;
|
|
1297
|
-
var classes = useStyles(props);
|
|
1239
|
+
var classes = useStyles$1(props);
|
|
1298
1240
|
return statusText ? (React__default.createElement(Typography, { classes: { root: classes.root }, variant: "body2" }, statusText)) : null;
|
|
1299
1241
|
};
|
|
1300
1242
|
|
|
@@ -1580,6 +1522,19 @@ Toast.defaultProps = {
|
|
|
1580
1522
|
};
|
|
1581
1523
|
Toast.displayName = 'Toast';
|
|
1582
1524
|
|
|
1525
|
+
var useStyles = makeStyles(function (_a) {
|
|
1526
|
+
var palette = _a.palette;
|
|
1527
|
+
return ({
|
|
1528
|
+
root: {
|
|
1529
|
+
background: palette.grey['100'],
|
|
1530
|
+
},
|
|
1531
|
+
});
|
|
1532
|
+
});
|
|
1533
|
+
var DialogActions = function (props) {
|
|
1534
|
+
var classes = useStyles(props);
|
|
1535
|
+
return React__default.createElement(CommonDialogActions, __assign$1({ classes: classes }, props));
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1583
1538
|
var useFullScreenStepperContext = function () { return useContext(FullScreenStepperContext); };
|
|
1584
1539
|
|
|
1585
1540
|
/**
|
|
@@ -1844,5 +1799,5 @@ var adminLight = createTheme(adminLightOptions);
|
|
|
1844
1799
|
var adminDarkOptions = __assign$1(__assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Dark', palette: __assign$1(__assign$1({}, basePalette), adminDarkPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography }, adminDarkPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps), adminOverrides);
|
|
1845
1800
|
var adminDark = createTheme(adminDarkOptions);
|
|
1846
1801
|
|
|
1847
|
-
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, SelectableCard, Toast, adminDark, adminDarkOptions, adminLight, adminLightOptions, useFullScreenStepperContext, useSelectableCard };
|
|
1802
|
+
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, DialogActions, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, SelectableCard, Toast, adminDark, adminDarkOptions, adminLight, adminLightOptions, useFullScreenStepperContext, useSelectableCard };
|
|
1848
1803
|
//# sourceMappingURL=index.es.js.map
|