@popmenu/table 0.40.3 → 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.js CHANGED
@@ -179,19 +179,19 @@ function __rest(s, e) {
179
179
  return t;
180
180
  }
181
181
 
182
- var _path$I;
182
+ var _path$2$1;
183
183
 
184
- 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); }
184
+ 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); }
185
185
 
186
186
  function SvgUser(props) {
187
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1m({
187
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2$1({
188
188
  viewBox: "0 0 16 16",
189
189
  fill: "none",
190
190
  strokeLinecap: "round",
191
191
  strokeLinejoin: "round",
192
192
  width: "1em",
193
193
  height: "1em"
194
- }, props), _path$I || (_path$I = /*#__PURE__*/React__namespace.createElement("path", {
194
+ }, props), _path$2$1 || (_path$2$1 = /*#__PURE__*/React__namespace.createElement("path", {
195
195
  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",
196
196
  stroke: "currentColor"
197
197
  })));
@@ -424,6 +424,79 @@ var Checkbox = React.forwardRef(function (props, ref) {
424
424
  });
425
425
  Checkbox.displayName = 'Checkbox';
426
426
 
427
+ var getBackground = function (theme) { return function (props) {
428
+ var variant = props.variant, severity = props.severity;
429
+ var background;
430
+ var backgrounds = {
431
+ outlined: 'none',
432
+ error: 'error.main',
433
+ warning: 'warning.main',
434
+ info: 'info.light',
435
+ success: 'success.light',
436
+ };
437
+ if (variant === 'outlined') {
438
+ background = backgrounds[variant];
439
+ }
440
+ else if (severity) {
441
+ var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
442
+ background = theme.palette[color][colorVariant];
443
+ }
444
+ return background;
445
+ }; };
446
+ var getColor = function (theme) { return function (props) {
447
+ var variant = props.variant, severity = props.severity;
448
+ var textColor;
449
+ if (variant === 'outlined' && severity) {
450
+ var textColors = {
451
+ error: theme.palette.error.main,
452
+ info: theme.palette.info.main,
453
+ warning: theme.palette.warning.dark,
454
+ success: theme.palette.success.dark,
455
+ };
456
+ textColor = textColors[severity];
457
+ }
458
+ else if (variant === 'outlined' && !severity) {
459
+ textColor = theme.palette.grey[700];
460
+ }
461
+ else if ((variant === 'default' || variant === undefined) && severity) {
462
+ var textColors = {
463
+ error: theme.palette.common.white,
464
+ info: theme.palette.secondary.main,
465
+ warning: theme.palette.secondary.main,
466
+ success: theme.palette.secondary.main,
467
+ };
468
+ textColor = textColors[severity];
469
+ }
470
+ return textColor;
471
+ }; };
472
+ var getBorder = function (theme) { return function (props) {
473
+ var variant = props.variant, severity = props.severity;
474
+ var borderColor;
475
+ if (variant === 'outlined' && severity) {
476
+ var borderColors = {
477
+ error: theme.palette.error.main,
478
+ info: theme.palette.info.main,
479
+ warning: theme.palette.warning.dark,
480
+ success: theme.palette.success.dark,
481
+ };
482
+ borderColor = borderColors[severity];
483
+ }
484
+ return borderColor;
485
+ }; };
486
+ styles.makeStyles(function (theme) { return ({
487
+ root: {
488
+ background: getBackground(theme),
489
+ color: getColor(theme),
490
+ borderColor: getBorder(theme),
491
+ borderRadius: theme.spacing(0.5),
492
+ },
493
+ icon: {
494
+ color: 'inherit',
495
+ height: theme.spacing(2),
496
+ width: theme.spacing(2),
497
+ },
498
+ }); });
499
+
427
500
  var defaultTypographyProps = {
428
501
  variant: 'body1',
429
502
  };
@@ -770,73 +843,73 @@ var TableHeader = function (props) {
770
843
  return React__default['default'].createElement("thead", __assign$1({}, restProps), children);
771
844
  };
772
845
 
773
- var _path$1m;
846
+ var _path$3;
774
847
 
775
- function _extends$2k() { _extends$2k = 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$2k.apply(this, arguments); }
848
+ 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); }
776
849
 
777
850
  function SvgChevronDown(props) {
778
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2k({
851
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
779
852
  viewBox: "0 0 16 16",
780
853
  fill: "none",
781
854
  strokeLinecap: "round",
782
855
  strokeLinejoin: "round",
783
856
  width: "1em",
784
857
  height: "1em"
785
- }, props), _path$1m || (_path$1m = /*#__PURE__*/React__namespace.createElement("path", {
858
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
786
859
  d: "M4 6l4 4 4-4",
787
860
  stroke: "currentColor"
788
861
  })));
789
862
  }
790
863
 
791
- var _path$1l;
864
+ var _path$2;
792
865
 
793
- function _extends$2j() { _extends$2j = 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$2j.apply(this, arguments); }
866
+ 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); }
794
867
 
795
868
  function SvgChevronUp(props) {
796
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2j({
869
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
797
870
  viewBox: "0 0 16 16",
798
871
  fill: "none",
799
872
  strokeLinecap: "round",
800
873
  strokeLinejoin: "round",
801
874
  width: "1em",
802
875
  height: "1em"
803
- }, props), _path$1l || (_path$1l = /*#__PURE__*/React__namespace.createElement("path", {
876
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
804
877
  d: "M12 10L8 6l-4 4",
805
878
  stroke: "currentColor"
806
879
  })));
807
880
  }
808
881
 
809
- var _path$U;
882
+ var _path$1;
810
883
 
811
- function _extends$1C() { _extends$1C = 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$1C.apply(this, arguments); }
884
+ 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); }
812
885
 
813
886
  function SvgMore(props) {
814
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1C({
887
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
815
888
  viewBox: "0 0 16 16",
816
889
  fill: "none",
817
890
  strokeLinecap: "round",
818
891
  strokeLinejoin: "round",
819
892
  width: "1em",
820
893
  height: "1em"
821
- }, props), _path$U || (_path$U = /*#__PURE__*/React__namespace.createElement("path", {
894
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
822
895
  d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.334A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z",
823
896
  stroke: "currentColor"
824
897
  })));
825
898
  }
826
899
 
827
- var _path$Q;
900
+ var _path;
828
901
 
829
- 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); }
902
+ 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); }
830
903
 
831
904
  function SvgSearch(props) {
832
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1x({
905
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
833
906
  viewBox: "0 0 16 16",
834
907
  fill: "none",
835
908
  strokeLinecap: "round",
836
909
  strokeLinejoin: "round",
837
910
  width: "1em",
838
911
  height: "1em"
839
- }, props), _path$Q || (_path$Q = /*#__PURE__*/React__namespace.createElement("path", {
912
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
840
913
  d: "M7.333 12.667A5.333 5.333 0 107.333 2a5.333 5.333 0 000 10.667zM14 14l-2.9-2.9",
841
914
  stroke: "currentColor"
842
915
  })));