@popmenu/table 0.27.0 → 0.30.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
@@ -137,21 +137,21 @@ function __rest(s, e) {
137
137
  return t;
138
138
  }
139
139
 
140
- var _path$2P;
140
+ var _path$24;
141
141
 
142
- function _extends$33() { _extends$33 = 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$33.apply(this, arguments); }
142
+ function _extends$3i() { _extends$3i = 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$3i.apply(this, arguments); }
143
143
 
144
144
  function SvgUser(props) {
145
- return /*#__PURE__*/React.createElement("svg", _extends$33({
145
+ return /*#__PURE__*/React.createElement("svg", _extends$3i({
146
146
  viewBox: "0 0 16 16",
147
+ fill: "none",
147
148
  strokeLinecap: "round",
148
149
  strokeLinejoin: "round",
149
- stroke: "currentColor",
150
150
  width: "1em",
151
- height: "1em",
152
- fill: "none"
153
- }, props), _path$2P || (_path$2P = /*#__PURE__*/React.createElement("path", {
154
- 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"
151
+ height: "1em"
152
+ }, props), _path$24 || (_path$24 = /*#__PURE__*/React.createElement("path", {
153
+ 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",
154
+ stroke: "currentColor"
155
155
  })));
156
156
  }
157
157
 
@@ -382,29 +382,109 @@ var Checkbox = forwardRef(function (props, ref) {
382
382
  });
383
383
  Checkbox.displayName = 'Checkbox';
384
384
 
385
- var useTypographyStyles = makeStyles$1(function () { return ({
386
- root: function (_a) {
387
- var _b;
388
- var weight = _a.weight;
389
- return (__assign((_b = {}, _b["& ." + iconStaticClassName] = {
390
- position: 'relative',
391
- top: '0.125em',
392
- padding: '0 0.125em',
393
- boxSizing: 'content-box',
394
- }, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 })));
395
- },
396
- caption: {
397
- display: 'inline',
398
- },
399
- overline: {
400
- display: 'inline',
401
- },
402
- }); });
385
+ var weights = {
386
+ regular: 400,
387
+ 'semi-bold': 600,
388
+ bold: 700,
389
+ };
390
+ var getColor = function (theme, props) {
391
+ var color = props.color;
392
+ if (color === undefined) {
393
+ return undefined;
394
+ }
395
+ if (['white', 'black'].includes(color)) {
396
+ return theme.palette.common[color];
397
+ }
398
+ if (color.match(/^grey\.\d{3}/)) {
399
+ var scale = color.split('.')[1];
400
+ return theme.palette.grey[scale] || theme.palette.grey[900];
401
+ }
402
+ if ([
403
+ 'primary.light',
404
+ 'primary.dark',
405
+ 'secondary.light',
406
+ 'secondary',
407
+ 'secondary.dark',
408
+ 'info.light',
409
+ 'info.dark',
410
+ 'success.light',
411
+ 'success.dark',
412
+ 'error.light',
413
+ 'error.dark',
414
+ 'warning.light',
415
+ 'warning.dark',
416
+ ].includes(color)) {
417
+ var _a = color.split('.'), paletteKey = _a[0], variant = _a[1];
418
+ return theme.palette[paletteKey][variant];
419
+ }
420
+ if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) {
421
+ return theme.palette[color].main;
422
+ }
423
+ if (['textPrimary', 'textSecondary'].includes(color)) {
424
+ return theme.palette.text[color.slice(4).toLowerCase()];
425
+ }
426
+ return undefined;
427
+ };
428
+ var useTypographyStyles = makeStyles$1(function (theme) {
429
+ var _a;
430
+ return ({
431
+ root: (_a = {},
432
+ _a["& ." + iconStaticClassName] = {
433
+ position: 'relative',
434
+ top: '0.125em',
435
+ padding: '0 0.125em',
436
+ boxSizing: 'content-box',
437
+ },
438
+ _a.fontFamily = theme.typography.fontFamily,
439
+ _a.fontWeight = function (_a) {
440
+ var variant = _a.variant, weight = _a.weight;
441
+ return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight);
442
+ },
443
+ _a.fontSize = function (_a) {
444
+ var variant = _a.variant;
445
+ return theme.typography[variant || 'body1'].fontSize;
446
+ },
447
+ _a.lineHeight = function (_a) {
448
+ var variant = _a.variant;
449
+ return theme.typography[variant || 'body1'].lineHeight;
450
+ },
451
+ _a.textTransform = function (_a) {
452
+ var variant = _a.variant;
453
+ return theme.typography[variant || 'body1'].textTransform;
454
+ },
455
+ _a.color = function (props) { return getColor(theme, props); },
456
+ _a),
457
+ caption: {
458
+ display: 'inline',
459
+ },
460
+ overline: {
461
+ display: 'inline',
462
+ },
463
+ });
464
+ });
465
+
466
+ var variantMap = {
467
+ h1: 'h1',
468
+ h2: 'h2',
469
+ h3: 'h3',
470
+ h4: 'h4',
471
+ h5: 'h5',
472
+ h6: 'h6',
473
+ h7: 'h6',
474
+ body1: 'p',
475
+ body2: 'p',
476
+ subtitle1: 'h6',
477
+ subtitle2: 'h6',
478
+ caption: 'span',
479
+ overline: 'span',
480
+ };
403
481
 
404
482
  var Typography = forwardRef(function (props, ref) {
405
- props.weight; var restProps = __rest(props, ["weight"]);
406
- var classes = useTypographyStyles(props);
407
- return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes }, restProps));
483
+ props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
484
+ var validatedVariant = Object.keys(variantMap).includes(variant) ? variant : 'body1';
485
+ var classes = useTypographyStyles(__assign(__assign({}, props), { variant: validatedVariant }));
486
+ var component = variantMap[validatedVariant];
487
+ return React__default.createElement(Typography$1, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" }));
408
488
  });
409
489
  Typography.displayName = 'Typography';
410
490
 
@@ -674,75 +754,75 @@ var TableHeader = function (props) {
674
754
  return React__default.createElement("thead", __assign$1({}, restProps), children);
675
755
  };
676
756
 
677
- var _path$4x;
757
+ var _path$39;
678
758
 
679
- function _extends$4N() { _extends$4N = 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$4N.apply(this, arguments); }
759
+ function _extends$50() { _extends$50 = 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$50.apply(this, arguments); }
680
760
 
681
761
  function SvgChevronDown(props) {
682
- return /*#__PURE__*/React.createElement("svg", _extends$4N({
762
+ return /*#__PURE__*/React.createElement("svg", _extends$50({
683
763
  viewBox: "0 0 16 16",
764
+ fill: "none",
684
765
  strokeLinecap: "round",
685
766
  strokeLinejoin: "round",
686
- stroke: "currentColor",
687
767
  width: "1em",
688
- height: "1em",
689
- fill: "none"
690
- }, props), _path$4x || (_path$4x = /*#__PURE__*/React.createElement("path", {
691
- d: "M4 6l4 4 4-4"
768
+ height: "1em"
769
+ }, props), _path$39 || (_path$39 = /*#__PURE__*/React.createElement("path", {
770
+ d: "M4 6l4 4 4-4",
771
+ stroke: "currentColor"
692
772
  })));
693
773
  }
694
774
 
695
- var _path$4w;
775
+ var _path$38;
696
776
 
697
- function _extends$4M() { _extends$4M = 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$4M.apply(this, arguments); }
777
+ 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); }
698
778
 
699
779
  function SvgChevronUp(props) {
700
- return /*#__PURE__*/React.createElement("svg", _extends$4M({
780
+ return /*#__PURE__*/React.createElement("svg", _extends$4$({
701
781
  viewBox: "0 0 16 16",
782
+ fill: "none",
702
783
  strokeLinecap: "round",
703
784
  strokeLinejoin: "round",
704
- stroke: "currentColor",
705
785
  width: "1em",
706
- height: "1em",
707
- fill: "none"
708
- }, props), _path$4w || (_path$4w = /*#__PURE__*/React.createElement("path", {
709
- d: "M12 10L8 6l-4 4"
786
+ height: "1em"
787
+ }, props), _path$38 || (_path$38 = /*#__PURE__*/React.createElement("path", {
788
+ d: "M12 10L8 6l-4 4",
789
+ stroke: "currentColor"
710
790
  })));
711
791
  }
712
792
 
713
- var _path$3d;
793
+ var _path$2o;
714
794
 
715
- function _extends$3t() { _extends$3t = 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$3t.apply(this, arguments); }
795
+ function _extends$3I() { _extends$3I = 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$3I.apply(this, arguments); }
716
796
 
717
797
  function SvgMore(props) {
718
- return /*#__PURE__*/React.createElement("svg", _extends$3t({
798
+ return /*#__PURE__*/React.createElement("svg", _extends$3I({
719
799
  viewBox: "0 0 16 16",
800
+ fill: "none",
720
801
  strokeLinecap: "round",
721
802
  strokeLinejoin: "round",
722
- stroke: "currentColor",
723
803
  width: "1em",
724
- height: "1em",
725
- fill: "none"
726
- }, props), _path$3d || (_path$3d = /*#__PURE__*/React.createElement("path", {
727
- 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"
804
+ height: "1em"
805
+ }, props), _path$2o || (_path$2o = /*#__PURE__*/React.createElement("path", {
806
+ 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",
807
+ stroke: "currentColor"
728
808
  })));
729
809
  }
730
810
 
731
- var _path$33;
811
+ var _path$2f;
732
812
 
733
- function _extends$3j() { _extends$3j = 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$3j.apply(this, arguments); }
813
+ function _extends$3y() { _extends$3y = 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$3y.apply(this, arguments); }
734
814
 
735
815
  function SvgSearch(props) {
736
- return /*#__PURE__*/React.createElement("svg", _extends$3j({
816
+ return /*#__PURE__*/React.createElement("svg", _extends$3y({
737
817
  viewBox: "0 0 16 16",
818
+ fill: "none",
738
819
  strokeLinecap: "round",
739
820
  strokeLinejoin: "round",
740
- stroke: "currentColor",
741
821
  width: "1em",
742
- height: "1em",
743
- fill: "none"
744
- }, props), _path$33 || (_path$33 = /*#__PURE__*/React.createElement("path", {
745
- d: "M7.333 12.667A5.333 5.333 0 107.333 2a5.333 5.333 0 000 10.667zM14 14l-2.9-2.9"
822
+ height: "1em"
823
+ }, props), _path$2f || (_path$2f = /*#__PURE__*/React.createElement("path", {
824
+ d: "M7.333 12.667A5.333 5.333 0 107.333 2a5.333 5.333 0 000 10.667zM14 14l-2.9-2.9",
825
+ stroke: "currentColor"
746
826
  })));
747
827
  }
748
828