@popmenu/admin-ui 0.30.0 → 0.31.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.
@@ -16,7 +16,7 @@ export { DialogContent, DialogContentProps } from './DialogContent';
16
16
  export { Page } from './Page';
17
17
  export { PageBody } from './PageBody';
18
18
  export { PageSection } from './PageSection';
19
- export { SettingsIndexCardGroup } from './SettingsIndexCardGroup';
20
- export { SettingsIndexCard, SettingsIndexCardProps } from './SettingsIndexCard';
21
19
  export { PageSections } from './PageSections';
22
20
  export { PageSectionTitle } from './PageSectionTitle';
21
+ export { SettingsIndexCardGroup } from './SettingsIndexCardGroup';
22
+ export { SettingsIndexCard, SettingsIndexCardProps } from './SettingsIndexCard';
package/build/index.es.js CHANGED
@@ -175,19 +175,19 @@ function __rest(s, e) {
175
175
  return t;
176
176
  }
177
177
 
178
- var _path$23;
178
+ var _path$D;
179
179
 
180
- function _extends$3g() { _extends$3g = 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$3g.apply(this, arguments); }
180
+ function _extends$16() { _extends$16 = 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$16.apply(this, arguments); }
181
181
 
182
182
  function SvgUser(props) {
183
- return /*#__PURE__*/React.createElement("svg", _extends$3g({
183
+ return /*#__PURE__*/React.createElement("svg", _extends$16({
184
184
  viewBox: "0 0 16 16",
185
185
  fill: "none",
186
186
  strokeLinecap: "round",
187
187
  strokeLinejoin: "round",
188
188
  width: "1em",
189
189
  height: "1em"
190
- }, props), _path$23 || (_path$23 = /*#__PURE__*/React.createElement("path", {
190
+ }, props), _path$D || (_path$D = /*#__PURE__*/React.createElement("path", {
191
191
  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",
192
192
  stroke: "currentColor"
193
193
  })));
@@ -420,48 +420,35 @@ var Checkbox = forwardRef(function (props, ref) {
420
420
  });
421
421
  Checkbox.displayName = 'Checkbox';
422
422
 
423
+ var defaultTypographyProps = {
424
+ variant: 'body1',
425
+ };
426
+
423
427
  var weights = {
424
428
  regular: 400,
429
+ medium: 500,
425
430
  'semi-bold': 600,
426
431
  bold: 700,
427
432
  };
428
- var getColor$1 = function (theme, props) {
429
- var color = props.color;
430
- if (color === undefined) {
431
- return undefined;
432
- }
433
- if (['white', 'black'].includes(color)) {
434
- return theme.palette.common[color];
435
- }
436
- if (color.match(/^grey\.\d{3}/)) {
437
- var scale = color.split('.')[1];
438
- return theme.palette.grey[scale] || theme.palette.grey[900];
439
- }
440
- if ([
441
- 'primary.light',
442
- 'primary.dark',
443
- 'secondary.light',
444
- 'secondary',
445
- 'secondary.dark',
446
- 'info.light',
447
- 'info.dark',
448
- 'success.light',
449
- 'success.dark',
450
- 'error.light',
451
- 'error.dark',
452
- 'warning.light',
453
- 'warning.dark',
454
- ].includes(color)) {
455
- var _a = color.split('.'), paletteKey = _a[0], variant = _a[1];
456
- return theme.palette[paletteKey][variant];
457
- }
458
- if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) {
459
- return theme.palette[color].main;
460
- }
461
- if (['textPrimary', 'textSecondary'].includes(color)) {
462
- return theme.palette.text[color.slice(4).toLowerCase()];
433
+ var getCustomColor = function (theme, color) {
434
+ var isCommonColor = color && ['white', 'black'].includes(color);
435
+ var isGreyColor = color && color.match(/^grey\.\d{3}/);
436
+ var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
437
+ var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
438
+ switch (true) {
439
+ case isCommonColor:
440
+ return theme.palette.common[color];
441
+ case Boolean(isGreyColor):
442
+ var scale = color.split('.')[1];
443
+ return theme.palette.grey[scale] || theme.palette.grey[900];
444
+ case Boolean(isSemanticColor):
445
+ var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
446
+ return theme.palette[paletteKey][variant];
447
+ case isTextColor:
448
+ return theme.palette.text[color.slice(4).toLowerCase()];
449
+ default:
450
+ return undefined;
463
451
  }
464
- return undefined;
465
452
  };
466
453
  var useTypographyStyles = makeStyles$1(function (theme) {
467
454
  var _a;
@@ -476,21 +463,24 @@ var useTypographyStyles = makeStyles$1(function (theme) {
476
463
  _a.fontFamily = theme.typography.fontFamily,
477
464
  _a.fontWeight = function (_a) {
478
465
  var variant = _a.variant, weight = _a.weight;
479
- return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight);
466
+ return (weight ? weights[weight] : theme.typography[variant].fontWeight);
480
467
  },
481
468
  _a.fontSize = function (_a) {
482
469
  var variant = _a.variant;
483
- return theme.typography[variant || 'body1'].fontSize;
470
+ return theme.typography[variant].fontSize;
484
471
  },
485
472
  _a.lineHeight = function (_a) {
486
473
  var variant = _a.variant;
487
- return theme.typography[variant || 'body1'].lineHeight;
474
+ return theme.typography[variant].lineHeight;
488
475
  },
489
476
  _a.textTransform = function (_a) {
490
477
  var variant = _a.variant;
491
- return theme.typography[variant || 'body1'].textTransform;
478
+ return theme.typography[variant].textTransform;
479
+ },
480
+ _a.color = function (_a) {
481
+ var color = _a.color, variant = _a.variant;
482
+ return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
492
483
  },
493
- _a.color = function (props) { return getColor$1(theme, props); },
494
484
  _a),
495
485
  caption: {
496
486
  display: 'inline',
@@ -501,29 +491,25 @@ var useTypographyStyles = makeStyles$1(function (theme) {
501
491
  });
502
492
  });
503
493
 
504
- var variantMap = {
505
- h1: 'h1',
506
- h2: 'h2',
507
- h3: 'h3',
508
- h4: 'h4',
509
- h5: 'h5',
510
- h6: 'h6',
511
- h7: 'h6',
512
- body1: 'p',
513
- body2: 'p',
514
- subtitle1: 'h6',
515
- subtitle2: 'h6',
516
- caption: 'span',
517
- overline: 'span',
518
- };
519
-
520
494
  var Typography = forwardRef(function (props, ref) {
521
- props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
522
- var classes = useTypographyStyles(props);
523
- var component = variantMap[variant];
524
- return React__default.createElement(Typography$1, __assign({ component: component, ref: ref, classes: classes }, restProps));
495
+ props.weight; props.color; var restProps = __rest(props, ["weight", "color"]);
496
+ var classes = useTypographyStyles(__assign({}, props));
497
+ var variantMapping = {
498
+ h1: 'h1',
499
+ h2: 'h2',
500
+ h3: 'h3',
501
+ h4: 'h4',
502
+ h5: 'h5',
503
+ h6: 'h6',
504
+ subtitle1: 'p',
505
+ subtitle2: 'p',
506
+ body1: 'p',
507
+ body2: 'p',
508
+ };
509
+ return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes, variantMapping: variantMapping }, restProps));
525
510
  });
526
- Typography.displayName = 'Typography';
511
+ Typography.displayName = 'Typography';
512
+ Typography.defaultProps = defaultTypographyProps;
527
513
 
528
514
  var getFadeStop = function (_a, typographyVariant) {
529
515
  var typography = _a.typography;
@@ -782,19 +768,19 @@ makeStyles(function (theme) { return ({
782
768
  },
783
769
  }); });
784
770
 
785
- var _g$1y;
771
+ var _g$I;
786
772
 
787
- function _extends$4l() { _extends$4l = 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$4l.apply(this, arguments); }
773
+ function _extends$1L() { _extends$1L = 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$1L.apply(this, arguments); }
788
774
 
789
775
  function SvgCheckCircle(props) {
790
- return /*#__PURE__*/React.createElement("svg", _extends$4l({
776
+ return /*#__PURE__*/React.createElement("svg", _extends$1L({
791
777
  viewBox: "0 0 16 16",
792
778
  fill: "none",
793
779
  strokeLinecap: "round",
794
780
  strokeLinejoin: "round",
795
781
  width: "1em",
796
782
  height: "1em"
797
- }, props), _g$1y || (_g$1y = /*#__PURE__*/React.createElement("g", {
783
+ }, props), _g$I || (_g$I = /*#__PURE__*/React.createElement("g", {
798
784
  stroke: "currentColor"
799
785
  }, /*#__PURE__*/React.createElement("path", {
800
786
  d: "M14.667 7.387V8a6.667 6.667 0 11-3.954-6.093"
@@ -803,37 +789,37 @@ function SvgCheckCircle(props) {
803
789
  }))));
804
790
  }
805
791
 
806
- var _path$2O;
792
+ var _path$12;
807
793
 
808
- function _extends$4i() { _extends$4i = 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$4i.apply(this, arguments); }
794
+ function _extends$1J() { _extends$1J = 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$1J.apply(this, arguments); }
809
795
 
810
796
  function SvgX(props) {
811
- return /*#__PURE__*/React.createElement("svg", _extends$4i({
797
+ return /*#__PURE__*/React.createElement("svg", _extends$1J({
812
798
  viewBox: "0 0 16 16",
813
799
  fill: "none",
814
800
  strokeLinecap: "round",
815
801
  strokeLinejoin: "round",
816
802
  width: "1em",
817
803
  height: "1em"
818
- }, props), _path$2O || (_path$2O = /*#__PURE__*/React.createElement("path", {
804
+ }, props), _path$12 || (_path$12 = /*#__PURE__*/React.createElement("path", {
819
805
  d: "M12 4l-8 8m0-8l8 8",
820
806
  stroke: "currentColor"
821
807
  })));
822
808
  }
823
809
 
824
- var _g$1p;
810
+ var _g$D;
825
811
 
826
- function _extends$40() { _extends$40 = 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$40.apply(this, arguments); }
812
+ 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); }
827
813
 
828
814
  function SvgHelp(props) {
829
- return /*#__PURE__*/React.createElement("svg", _extends$40({
815
+ return /*#__PURE__*/React.createElement("svg", _extends$1z({
830
816
  viewBox: "0 0 16 16",
831
817
  fill: "none",
832
818
  strokeLinecap: "round",
833
819
  strokeLinejoin: "round",
834
820
  width: "1em",
835
821
  height: "1em"
836
- }, props), _g$1p || (_g$1p = /*#__PURE__*/React.createElement("g", {
822
+ }, props), _g$D || (_g$D = /*#__PURE__*/React.createElement("g", {
837
823
  stroke: "currentColor"
838
824
  }, /*#__PURE__*/React.createElement("path", {
839
825
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z"
@@ -842,73 +828,73 @@ function SvgHelp(props) {
842
828
  }))));
843
829
  }
844
830
 
845
- var _path$2C;
831
+ var _path$X;
846
832
 
847
- function _extends$3Z() { _extends$3Z = 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$3Z.apply(this, arguments); }
833
+ function _extends$1x() { _extends$1x = 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$1x.apply(this, arguments); }
848
834
 
849
835
  function SvgInfo(props) {
850
- return /*#__PURE__*/React.createElement("svg", _extends$3Z({
836
+ return /*#__PURE__*/React.createElement("svg", _extends$1x({
851
837
  viewBox: "0 0 16 16",
852
838
  fill: "none",
853
839
  strokeLinecap: "round",
854
840
  strokeLinejoin: "round",
855
841
  width: "1em",
856
842
  height: "1em"
857
- }, props), _path$2C || (_path$2C = /*#__PURE__*/React.createElement("path", {
843
+ }, props), _path$X || (_path$X = /*#__PURE__*/React.createElement("path", {
858
844
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-4V8m0-2.667h.007",
859
845
  stroke: "currentColor"
860
846
  })));
861
847
  }
862
848
 
863
- var _path$1W;
849
+ var _path$B;
864
850
 
865
- function _extends$37() { _extends$37 = 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$37.apply(this, arguments); }
851
+ function _extends$13() { _extends$13 = 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$13.apply(this, arguments); }
866
852
 
867
853
  function SvgError(props) {
868
- return /*#__PURE__*/React.createElement("svg", _extends$37({
854
+ return /*#__PURE__*/React.createElement("svg", _extends$13({
869
855
  viewBox: "0 0 16 16",
870
856
  fill: "none",
871
857
  strokeLinecap: "round",
872
858
  strokeLinejoin: "round",
873
859
  width: "1em",
874
860
  height: "1em"
875
- }, props), _path$1W || (_path$1W = /*#__PURE__*/React.createElement("path", {
861
+ }, props), _path$B || (_path$B = /*#__PURE__*/React.createElement("path", {
876
862
  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",
877
863
  stroke: "currentColor"
878
864
  })));
879
865
  }
880
866
 
881
- var _path$1V;
867
+ var _path$A;
882
868
 
883
- function _extends$36() { _extends$36 = 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$36.apply(this, arguments); }
869
+ function _extends$12() { _extends$12 = 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$12.apply(this, arguments); }
884
870
 
885
871
  function SvgWarning(props) {
886
- return /*#__PURE__*/React.createElement("svg", _extends$36({
872
+ return /*#__PURE__*/React.createElement("svg", _extends$12({
887
873
  viewBox: "0 0 16 16",
888
874
  fill: "none",
889
875
  strokeLinecap: "round",
890
876
  strokeLinejoin: "round",
891
877
  width: "1em",
892
878
  height: "1em"
893
- }, props), _path$1V || (_path$1V = /*#__PURE__*/React.createElement("path", {
879
+ }, props), _path$A || (_path$A = /*#__PURE__*/React.createElement("path", {
894
880
  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",
895
881
  stroke: "currentColor"
896
882
  })));
897
883
  }
898
884
 
899
- var _path$M;
885
+ var _path$a;
900
886
 
901
- function _extends$19() { _extends$19 = 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$19.apply(this, arguments); }
887
+ function _extends$o() { _extends$o = 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$o.apply(this, arguments); }
902
888
 
903
889
  function SvgCircle(props) {
904
- return /*#__PURE__*/React.createElement("svg", _extends$19({
890
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
905
891
  viewBox: "0 0 16 16",
906
892
  fill: "none",
907
893
  strokeLinecap: "round",
908
894
  strokeLinejoin: "round",
909
895
  width: "1em",
910
896
  height: "1em"
911
- }, props), _path$M || (_path$M = /*#__PURE__*/React.createElement("path", {
897
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
912
898
  d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z",
913
899
  stroke: "currentColor"
914
900
  })));
@@ -1638,6 +1624,17 @@ var PageSection = function (props) {
1638
1624
  React__default.createElement(CardContent, null, children)));
1639
1625
  };
1640
1626
 
1627
+ var PageSections = function (props) {
1628
+ var children = props.children, restProps = __rest$1(props, ["children"]);
1629
+ return (React__default.createElement(Box, __assign$1({ display: "flex", flexDirection: "column", gridGap: 16 }, restProps), children));
1630
+ };
1631
+
1632
+ var PageSectionTitle = function (props) {
1633
+ var children = props.children, restProps = __rest$1(props, ["children"]);
1634
+ return (React__default.createElement(Box, __assign$1({}, restProps),
1635
+ React__default.createElement(Typography, { gutterBottom: true, variant: "h4" }, children)));
1636
+ };
1637
+
1641
1638
  var SettingsIndexCardGroup = function (props) {
1642
1639
  var children = props.children, restProps = __rest$1(props, ["children"]);
1643
1640
  return (React__default.createElement(Box, __assign$1({ display: "grid", gridGap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))" }, restProps), children));
@@ -1669,22 +1666,11 @@ var SettingsIndexCard = forwardRef(function (props, ref) {
1669
1666
  React__default.createElement(Box, { fontSize: "32px", display: "flex", justifyContent: 'space-between', alignItems: "center", paddingBottom: 2 },
1670
1667
  React__default.createElement(Icon, { icon: Icon$1 || SvgHelp, size: "inherit" }),
1671
1668
  showStatusLabel && (React__default.createElement(Typography, { weight: "semi-bold", variant: "body2", color: statusLabel === null || statusLabel === void 0 ? void 0 : statusLabel.color }, statusLabel === null || statusLabel === void 0 ? void 0 : statusLabel.text))),
1672
- React__default.createElement(Typography, { align: "left", variant: "h7", gutterBottom: true }, title),
1669
+ React__default.createElement(Typography, { align: "left", variant: "h6", gutterBottom: true }, title),
1673
1670
  description && (React__default.createElement(Typography, { align: "left", variant: "body2", color: "grey.700" }, description))))));
1674
1671
  });
1675
1672
  SettingsIndexCard.displayName = 'SettingsIndexCard';
1676
1673
 
1677
- var PageSections = function (props) {
1678
- var children = props.children, restProps = __rest$1(props, ["children"]);
1679
- return (React__default.createElement(Box, __assign$1({ display: "flex", flexDirection: "column", gridGap: 16 }, restProps), children));
1680
- };
1681
-
1682
- var PageSectionTitle = function (props) {
1683
- var children = props.children, restProps = __rest$1(props, ["children"]);
1684
- return (React__default.createElement(Box, __assign$1({}, restProps),
1685
- React__default.createElement(Typography, { gutterBottom: true, variant: "h4" }, children)));
1686
- };
1687
-
1688
1674
  var useFullScreenStepperContext = function () { return useContext(FullScreenStepperContext); };
1689
1675
 
1690
1676
  /**
@@ -1781,6 +1767,12 @@ var adminThemeTypography = {
1781
1767
  fontSize: '0.875rem',
1782
1768
  lineHeight: '1.25rem',
1783
1769
  },
1770
+ subtitle1: {
1771
+ fontWeight: 400,
1772
+ fontSize: '0.75rem',
1773
+ lineHeight: '1.125rem',
1774
+ color: '#9E9E9E',
1775
+ },
1784
1776
  button: {
1785
1777
  fontWeight: 500,
1786
1778
  fontSize: '0.875rem',