@popmenu/admin-ui 0.40.4 → 0.42.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/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, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, ButtonBase, List as List$1, ListItem, ListItemAvatar, ListItemText, Chip, ListItemSecondaryAction, IconButton as IconButton$1 } from '@material-ui/core';
4
+ import { makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, useTheme as useTheme$1, ButtonBase, List as List$1, ListItem, ListItemAvatar, ListItemText, Chip, ListItemSecondaryAction, IconButton as IconButton$1 } from '@material-ui/core';
5
5
  import '@material-ui/core/AppBar';
6
6
  import MuiAvatar from '@material-ui/core/Avatar';
7
7
  import { makeStyles as makeStyles$1, useTheme, lighten } from '@material-ui/core/styles';
@@ -176,19 +176,19 @@ function __rest(s, e) {
176
176
  return t;
177
177
  }
178
178
 
179
- var _path$I;
179
+ var _path$2$1;
180
180
 
181
- function _extends$1m() { _extends$1m = 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$1m.apply(this, arguments); }
181
+ function _extends$2$1() { _extends$2$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$2$1.apply(this, arguments); }
182
182
 
183
183
  function SvgUser(props) {
184
- return /*#__PURE__*/React.createElement("svg", _extends$1m({
184
+ return /*#__PURE__*/React.createElement("svg", _extends$2$1({
185
185
  viewBox: "0 0 16 16",
186
186
  fill: "none",
187
187
  strokeLinecap: "round",
188
188
  strokeLinejoin: "round",
189
189
  width: "1em",
190
190
  height: "1em"
191
- }, props), _path$I || (_path$I = /*#__PURE__*/React.createElement("path", {
191
+ }, props), _path$2$1 || (_path$2$1 = /*#__PURE__*/React.createElement("path", {
192
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
193
  stroke: "currentColor"
194
194
  })));
@@ -421,6 +421,79 @@ var Checkbox = forwardRef(function (props, ref) {
421
421
  });
422
422
  Checkbox.displayName = 'Checkbox';
423
423
 
424
+ var getBackground$1 = function (theme) { return function (props) {
425
+ var variant = props.variant, severity = props.severity;
426
+ var background;
427
+ var backgrounds = {
428
+ outlined: 'none',
429
+ error: 'error.main',
430
+ warning: 'warning.main',
431
+ info: 'info.light',
432
+ success: 'success.light',
433
+ };
434
+ if (variant === 'outlined') {
435
+ background = backgrounds[variant];
436
+ }
437
+ else if (severity) {
438
+ var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
439
+ background = theme.palette[color][colorVariant];
440
+ }
441
+ return background;
442
+ }; };
443
+ var getColor$1 = function (theme) { return function (props) {
444
+ var variant = props.variant, severity = props.severity;
445
+ var textColor;
446
+ if (variant === 'outlined' && severity) {
447
+ var textColors = {
448
+ error: theme.palette.error.main,
449
+ info: theme.palette.info.main,
450
+ warning: theme.palette.warning.dark,
451
+ success: theme.palette.success.dark,
452
+ };
453
+ textColor = textColors[severity];
454
+ }
455
+ else if (variant === 'outlined' && !severity) {
456
+ textColor = theme.palette.grey[700];
457
+ }
458
+ else if ((variant === 'default' || variant === undefined) && severity) {
459
+ var textColors = {
460
+ error: theme.palette.common.white,
461
+ info: theme.palette.secondary.main,
462
+ warning: theme.palette.secondary.main,
463
+ success: theme.palette.secondary.main,
464
+ };
465
+ textColor = textColors[severity];
466
+ }
467
+ return textColor;
468
+ }; };
469
+ var getBorder = function (theme) { return function (props) {
470
+ var variant = props.variant, severity = props.severity;
471
+ var borderColor;
472
+ if (variant === 'outlined' && severity) {
473
+ var borderColors = {
474
+ error: theme.palette.error.main,
475
+ info: theme.palette.info.main,
476
+ warning: theme.palette.warning.dark,
477
+ success: theme.palette.success.dark,
478
+ };
479
+ borderColor = borderColors[severity];
480
+ }
481
+ return borderColor;
482
+ }; };
483
+ makeStyles$1(function (theme) { return ({
484
+ root: {
485
+ background: getBackground$1(theme),
486
+ color: getColor$1(theme),
487
+ borderColor: getBorder(theme),
488
+ borderRadius: theme.spacing(0.5),
489
+ },
490
+ icon: {
491
+ color: 'inherit',
492
+ height: theme.spacing(2),
493
+ width: theme.spacing(2),
494
+ },
495
+ }); });
496
+
424
497
  var defaultTypographyProps = {
425
498
  variant: 'body1',
426
499
  };
@@ -758,19 +831,19 @@ makeStyles(function (theme) { return ({
758
831
  },
759
832
  }); });
760
833
 
761
- var _g$S;
834
+ var _g$1;
762
835
 
763
- 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); }
836
+ function _extends$6() { _extends$6 = 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$6.apply(this, arguments); }
764
837
 
765
838
  function SvgCheckCircle(props) {
766
- return /*#__PURE__*/React.createElement("svg", _extends$1$({
839
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
767
840
  viewBox: "0 0 16 16",
768
841
  fill: "none",
769
842
  strokeLinecap: "round",
770
843
  strokeLinejoin: "round",
771
844
  width: "1em",
772
845
  height: "1em"
773
- }, props), _g$S || (_g$S = /*#__PURE__*/React.createElement("g", {
846
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
774
847
  stroke: "currentColor"
775
848
  }, /*#__PURE__*/React.createElement("path", {
776
849
  d: "M14.667 7.387V8a6.667 6.667 0 11-3.954-6.093"
@@ -779,37 +852,37 @@ function SvgCheckCircle(props) {
779
852
  }))));
780
853
  }
781
854
 
782
- var _path$17;
855
+ var _path$4;
783
856
 
784
- function _extends$1Z() { _extends$1Z = 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$1Z.apply(this, arguments); }
857
+ function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
785
858
 
786
859
  function SvgX(props) {
787
- return /*#__PURE__*/React.createElement("svg", _extends$1Z({
860
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
788
861
  viewBox: "0 0 16 16",
789
862
  fill: "none",
790
863
  strokeLinecap: "round",
791
864
  strokeLinejoin: "round",
792
865
  width: "1em",
793
866
  height: "1em"
794
- }, props), _path$17 || (_path$17 = /*#__PURE__*/React.createElement("path", {
867
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
795
868
  d: "M12 4l-8 8m0-8l8 8",
796
869
  stroke: "currentColor"
797
870
  })));
798
871
  }
799
872
 
800
- var _g$N;
873
+ var _g;
801
874
 
802
- function _extends$1P() { _extends$1P = 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$1P.apply(this, arguments); }
875
+ function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
803
876
 
804
877
  function SvgHelp(props) {
805
- return /*#__PURE__*/React.createElement("svg", _extends$1P({
878
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
806
879
  viewBox: "0 0 16 16",
807
880
  fill: "none",
808
881
  strokeLinecap: "round",
809
882
  strokeLinejoin: "round",
810
883
  width: "1em",
811
884
  height: "1em"
812
- }, props), _g$N || (_g$N = /*#__PURE__*/React.createElement("g", {
885
+ }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
813
886
  stroke: "currentColor"
814
887
  }, /*#__PURE__*/React.createElement("path", {
815
888
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z"
@@ -818,73 +891,73 @@ function SvgHelp(props) {
818
891
  }))));
819
892
  }
820
893
 
821
- var _path$10;
894
+ var _path$3;
822
895
 
823
- function _extends$1N() { _extends$1N = 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$1N.apply(this, arguments); }
896
+ function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
824
897
 
825
898
  function SvgInfo(props) {
826
- return /*#__PURE__*/React.createElement("svg", _extends$1N({
899
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
827
900
  viewBox: "0 0 16 16",
828
901
  fill: "none",
829
902
  strokeLinecap: "round",
830
903
  strokeLinejoin: "round",
831
904
  width: "1em",
832
905
  height: "1em"
833
- }, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
906
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
834
907
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-4V8m0-2.667h.007",
835
908
  stroke: "currentColor"
836
909
  })));
837
910
  }
838
911
 
839
- var _path$F;
912
+ var _path$2;
840
913
 
841
- function _extends$1i() { _extends$1i = 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$1i.apply(this, arguments); }
914
+ 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); }
842
915
 
843
916
  function SvgError(props) {
844
- return /*#__PURE__*/React.createElement("svg", _extends$1i({
917
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
845
918
  viewBox: "0 0 16 16",
846
919
  fill: "none",
847
920
  strokeLinecap: "round",
848
921
  strokeLinejoin: "round",
849
922
  width: "1em",
850
923
  height: "1em"
851
- }, props), _path$F || (_path$F = /*#__PURE__*/React.createElement("path", {
924
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
852
925
  d: "M5.24 1.333h5.52l3.907 3.907v5.52l-3.907 3.907H5.24L1.333 10.76V5.24L5.24 1.333zm2.76 4V8m0 2.666h.008",
853
926
  stroke: "currentColor"
854
927
  })));
855
928
  }
856
929
 
857
- var _path$E;
930
+ var _path$1;
858
931
 
859
- function _extends$1h() { _extends$1h = 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$1h.apply(this, arguments); }
932
+ 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); }
860
933
 
861
934
  function SvgWarning(props) {
862
- return /*#__PURE__*/React.createElement("svg", _extends$1h({
935
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
863
936
  viewBox: "0 0 16 16",
864
937
  fill: "none",
865
938
  strokeLinecap: "round",
866
939
  strokeLinejoin: "round",
867
940
  width: "1em",
868
941
  height: "1em"
869
- }, props), _path$E || (_path$E = /*#__PURE__*/React.createElement("path", {
942
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
870
943
  d: "M6.86 2.573L1.213 12a1.334 1.334 0 001.14 2h11.294a1.332 1.332 0 001.14-2L9.14 2.573a1.333 1.333 0 00-2.28 0v0zM8 6v2.667m0 2.667h.007",
871
944
  stroke: "currentColor"
872
945
  })));
873
946
  }
874
947
 
875
- var _path$e;
948
+ var _path;
876
949
 
877
- function _extends$B() { _extends$B = 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$B.apply(this, arguments); }
950
+ 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); }
878
951
 
879
952
  function SvgCircle(props) {
880
- return /*#__PURE__*/React.createElement("svg", _extends$B({
953
+ return /*#__PURE__*/React.createElement("svg", _extends({
881
954
  viewBox: "0 0 16 16",
882
955
  fill: "none",
883
956
  strokeLinecap: "round",
884
957
  strokeLinejoin: "round",
885
958
  width: "1em",
886
959
  height: "1em"
887
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
960
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
888
961
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z",
889
962
  stroke: "currentColor"
890
963
  })));
@@ -1638,7 +1711,8 @@ var PageSections = function (props) {
1638
1711
 
1639
1712
  var PageSectionHead = function (props) {
1640
1713
  var children = props.children, restProps = __rest$1(props, ["children"]);
1641
- return (React__default.createElement(Box, __assign$1({ display: "flex", justifyContent: "space-between" }, restProps), children));
1714
+ var theme = useTheme$1();
1715
+ return (React__default.createElement(Box, __assign$1({ fontSize: theme.typography.h5.fontSize, mb: "1em", display: "flex", justifyContent: "space-between" }, restProps), children));
1642
1716
  };
1643
1717
 
1644
1718
  var useStyles$2 = makeStyles(function () { return ({