@popmenu/audio-player 0.28.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.
package/build/index.js CHANGED
@@ -171,111 +171,111 @@ var classnames$1 = {exports: {}};
171
171
 
172
172
  var classNames$1 = classnames$1.exports;
173
173
 
174
- var _path$1m;
174
+ var _path$h;
175
175
 
176
- function _extends$1r() { _extends$1r = 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$1r.apply(this, arguments); }
176
+ function _extends$A() { _extends$A = 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$A.apply(this, arguments); }
177
177
 
178
178
  function SvgPause(props) {
179
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1r({
179
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
180
180
  viewBox: "0 0 16 16",
181
+ fill: "none",
181
182
  strokeLinecap: "round",
182
183
  strokeLinejoin: "round",
183
- stroke: "currentColor",
184
184
  width: "1em",
185
- height: "1em",
186
- fill: "none"
187
- }, props), _path$1m || (_path$1m = /*#__PURE__*/React__namespace.createElement("path", {
188
- d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z"
185
+ height: "1em"
186
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
187
+ d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z",
188
+ stroke: "currentColor"
189
189
  })));
190
190
  }
191
191
 
192
- var _path$1k;
192
+ var _path$g;
193
193
 
194
- 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); }
194
+ function _extends$z() { _extends$z = 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$z.apply(this, arguments); }
195
195
 
196
196
  function SvgPlay(props) {
197
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({
197
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
198
198
  viewBox: "0 0 16 16",
199
+ fill: "none",
199
200
  strokeLinecap: "round",
200
201
  strokeLinejoin: "round",
201
- stroke: "currentColor",
202
202
  width: "1em",
203
- height: "1em",
204
- fill: "none"
205
- }, props), _path$1k || (_path$1k = /*#__PURE__*/React__namespace.createElement("path", {
206
- d: "M3.333 2l9.334 6-9.334 6V2z"
203
+ height: "1em"
204
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
205
+ d: "M3.333 2l9.334 6-9.334 6V2z",
206
+ stroke: "currentColor"
207
207
  })));
208
208
  }
209
209
 
210
- var _path$17;
210
+ var _path$e;
211
211
 
212
- 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); }
212
+ function _extends$w() { _extends$w = 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$w.apply(this, arguments); }
213
213
 
214
214
  function SvgVolumeDown(props) {
215
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1c({
215
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
216
216
  viewBox: "0 0 16 16",
217
+ fill: "none",
217
218
  strokeLinecap: "round",
218
219
  strokeLinejoin: "round",
219
- stroke: "currentColor",
220
220
  width: "1em",
221
- height: "1em",
222
- fill: "none"
223
- }, props), _path$17 || (_path$17 = /*#__PURE__*/React__namespace.createElement("path", {
224
- d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714"
221
+ height: "1em"
222
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
223
+ d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714",
224
+ stroke: "currentColor"
225
225
  })));
226
226
  }
227
227
 
228
- var _path$16;
228
+ var _path$d;
229
229
 
230
- function _extends$1b() { _extends$1b = 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$1b.apply(this, arguments); }
230
+ function _extends$v() { _extends$v = 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$v.apply(this, arguments); }
231
231
 
232
232
  function SvgVolumeMute(props) {
233
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1b({
233
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
234
234
  viewBox: "0 0 16 16",
235
+ fill: "none",
235
236
  strokeLinecap: "round",
236
237
  strokeLinejoin: "round",
237
- stroke: "currentColor",
238
238
  width: "1em",
239
- height: "1em",
240
- fill: "none"
241
- }, props), _path$16 || (_path$16 = /*#__PURE__*/React__namespace.createElement("path", {
242
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
239
+ height: "1em"
240
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
241
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z",
242
+ stroke: "currentColor"
243
243
  })));
244
244
  }
245
245
 
246
- var _path$15;
246
+ var _path$c;
247
247
 
248
- function _extends$1a() { _extends$1a = 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$1a.apply(this, arguments); }
248
+ function _extends$u() { _extends$u = 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$u.apply(this, arguments); }
249
249
 
250
250
  function SvgVolumeOff(props) {
251
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
251
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
252
252
  viewBox: "0 0 16 16",
253
+ fill: "none",
253
254
  strokeLinecap: "round",
254
255
  strokeLinejoin: "round",
255
- stroke: "currentColor",
256
256
  width: "1em",
257
- height: "1em",
258
- fill: "none"
259
- }, props), _path$15 || (_path$15 = /*#__PURE__*/React__namespace.createElement("path", {
260
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
257
+ height: "1em"
258
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
259
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4",
260
+ stroke: "currentColor"
261
261
  })));
262
262
  }
263
263
 
264
- var _path$14;
264
+ var _path$b;
265
265
 
266
- 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); }
266
+ function _extends$t() { _extends$t = 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$t.apply(this, arguments); }
267
267
 
268
268
  function SvgVolumeUp(props) {
269
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
269
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
270
270
  viewBox: "0 0 16 16",
271
+ fill: "none",
271
272
  strokeLinecap: "round",
272
273
  strokeLinejoin: "round",
273
- stroke: "currentColor",
274
274
  width: "1em",
275
- height: "1em",
276
- fill: "none"
277
- }, props), _path$14 || (_path$14 = /*#__PURE__*/React__namespace.createElement("path", {
278
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
275
+ height: "1em"
276
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
277
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713",
278
+ stroke: "currentColor"
279
279
  })));
280
280
  }
281
281
 
@@ -317,21 +317,21 @@ function __rest(s, e) {
317
317
  return t;
318
318
  }
319
319
 
320
- var _path$2Q;
320
+ var _path$D;
321
321
 
322
- function _extends$35() { _extends$35 = 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$35.apply(this, arguments); }
322
+ 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); }
323
323
 
324
324
  function SvgUser(props) {
325
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$35({
325
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$16({
326
326
  viewBox: "0 0 16 16",
327
+ fill: "none",
327
328
  strokeLinecap: "round",
328
329
  strokeLinejoin: "round",
329
- stroke: "currentColor",
330
330
  width: "1em",
331
- height: "1em",
332
- fill: "none"
333
- }, props), _path$2Q || (_path$2Q = /*#__PURE__*/React__namespace.createElement("path", {
334
- 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"
331
+ height: "1em"
332
+ }, props), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
333
+ 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",
334
+ stroke: "currentColor"
335
335
  })));
336
336
  }
337
337
 
@@ -562,48 +562,35 @@ var Checkbox = React.forwardRef(function (props, ref) {
562
562
  });
563
563
  Checkbox.displayName = 'Checkbox';
564
564
 
565
+ var defaultTypographyProps = {
566
+ variant: 'body1',
567
+ };
568
+
565
569
  var weights = {
566
570
  regular: 400,
571
+ medium: 500,
567
572
  'semi-bold': 600,
568
573
  bold: 700,
569
574
  };
570
- var getColor = function (theme, props) {
571
- var color = props.color;
572
- if (color === undefined) {
573
- return undefined;
574
- }
575
- if (['white', 'black'].includes(color)) {
576
- return theme.palette.common[color];
577
- }
578
- if (color.match(/^grey\.\d{3}/)) {
579
- var scale = color.split('.')[1];
580
- return theme.palette.grey[scale] || theme.palette.grey[900];
581
- }
582
- if ([
583
- 'primary.light',
584
- 'primary.dark',
585
- 'secondary.light',
586
- 'secondary',
587
- 'secondary.dark',
588
- 'info.light',
589
- 'info.dark',
590
- 'success.light',
591
- 'success.dark',
592
- 'error.light',
593
- 'error.dark',
594
- 'warning.light',
595
- 'warning.dark',
596
- ].includes(color)) {
597
- var _a = color.split('.'), paletteKey = _a[0], variant = _a[1];
598
- return theme.palette[paletteKey][variant];
575
+ var getCustomColor = function (theme, color) {
576
+ var isCommonColor = color && ['white', 'black'].includes(color);
577
+ var isGreyColor = color && color.match(/^grey\.\d{3}/);
578
+ var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
579
+ var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
580
+ switch (true) {
581
+ case isCommonColor:
582
+ return theme.palette.common[color];
583
+ case Boolean(isGreyColor):
584
+ var scale = color.split('.')[1];
585
+ return theme.palette.grey[scale] || theme.palette.grey[900];
586
+ case Boolean(isSemanticColor):
587
+ var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
588
+ return theme.palette[paletteKey][variant];
589
+ case isTextColor:
590
+ return theme.palette.text[color.slice(4).toLowerCase()];
591
+ default:
592
+ return undefined;
599
593
  }
600
- if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) {
601
- return theme.palette[color].main;
602
- }
603
- if (['textPrimary', 'textSecondary'].includes(color)) {
604
- return theme.palette.text[color.slice(4).toLowerCase()];
605
- }
606
- return undefined;
607
594
  };
608
595
  var useTypographyStyles = styles.makeStyles(function (theme) {
609
596
  var _a;
@@ -618,21 +605,24 @@ var useTypographyStyles = styles.makeStyles(function (theme) {
618
605
  _a.fontFamily = theme.typography.fontFamily,
619
606
  _a.fontWeight = function (_a) {
620
607
  var variant = _a.variant, weight = _a.weight;
621
- return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight);
608
+ return (weight ? weights[weight] : theme.typography[variant].fontWeight);
622
609
  },
623
610
  _a.fontSize = function (_a) {
624
611
  var variant = _a.variant;
625
- return theme.typography[variant || 'body1'].fontSize;
612
+ return theme.typography[variant].fontSize;
626
613
  },
627
614
  _a.lineHeight = function (_a) {
628
615
  var variant = _a.variant;
629
- return theme.typography[variant || 'body1'].lineHeight;
616
+ return theme.typography[variant].lineHeight;
630
617
  },
631
618
  _a.textTransform = function (_a) {
632
619
  var variant = _a.variant;
633
- return theme.typography[variant || 'body1'].textTransform;
620
+ return theme.typography[variant].textTransform;
621
+ },
622
+ _a.color = function (_a) {
623
+ var color = _a.color, variant = _a.variant;
624
+ return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
634
625
  },
635
- _a.color = function (props) { return getColor(theme, props); },
636
626
  _a),
637
627
  caption: {
638
628
  display: 'inline',
@@ -643,29 +633,25 @@ var useTypographyStyles = styles.makeStyles(function (theme) {
643
633
  });
644
634
  });
645
635
 
646
- var variantMap = {
647
- h1: 'h1',
648
- h2: 'h2',
649
- h3: 'h3',
650
- h4: 'h4',
651
- h5: 'h5',
652
- h6: 'h6',
653
- h7: 'h6',
654
- body1: 'p',
655
- body2: 'p',
656
- subtitle1: 'h6',
657
- subtitle2: 'h6',
658
- caption: 'span',
659
- overline: 'span',
660
- };
661
-
662
636
  var Typography = React.forwardRef(function (props, ref) {
663
- props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
664
- var classes = useTypographyStyles(props);
665
- var component = variantMap[variant];
666
- return React__default['default'].createElement(core.Typography, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" }));
637
+ props.weight; props.color; var restProps = __rest(props, ["weight", "color"]);
638
+ var classes = useTypographyStyles(__assign({}, props));
639
+ var variantMapping = {
640
+ h1: 'h1',
641
+ h2: 'h2',
642
+ h3: 'h3',
643
+ h4: 'h4',
644
+ h5: 'h5',
645
+ h6: 'h6',
646
+ subtitle1: 'p',
647
+ subtitle2: 'p',
648
+ body1: 'p',
649
+ body2: 'p',
650
+ };
651
+ return React__default['default'].createElement(core.Typography, __assign({ ref: ref, classes: classes, variantMapping: variantMapping }, restProps));
667
652
  });
668
- Typography.displayName = 'Typography';
653
+ Typography.displayName = 'Typography';
654
+ Typography.defaultProps = defaultTypographyProps;
669
655
 
670
656
  var getFadeStop = function (_a, typographyVariant) {
671
657
  var typography = _a.typography;