@popmenu/audio-player
Advanced tools
Comparing version 0.27.0 to 0.28.0
@@ -135,8 +135,8 @@ import * as React from 'react'; | ||
var _path$1l; | ||
var _path$1m; | ||
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); } | ||
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); } | ||
function SvgPause(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1p({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1r({ | ||
viewBox: "0 0 16 16", | ||
@@ -149,3 +149,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$1l || (_path$1l = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$1m || (_path$1m = /*#__PURE__*/React.createElement("path", { | ||
d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z" | ||
@@ -155,8 +155,8 @@ }))); | ||
var _path$1j; | ||
var _path$1k; | ||
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); } | ||
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); } | ||
function SvgPlay(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1n({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1p({ | ||
viewBox: "0 0 16 16", | ||
@@ -169,3 +169,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$1j || (_path$1j = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$1k || (_path$1k = /*#__PURE__*/React.createElement("path", { | ||
d: "M3.333 2l9.334 6-9.334 6V2z" | ||
@@ -175,8 +175,8 @@ }))); | ||
var _path$16; | ||
var _path$17; | ||
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); } | ||
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); } | ||
function SvgVolumeDown(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1a({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1c({ | ||
viewBox: "0 0 16 16", | ||
@@ -189,3 +189,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$16 || (_path$16 = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$17 || (_path$17 = /*#__PURE__*/React.createElement("path", { | ||
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714" | ||
@@ -195,8 +195,8 @@ }))); | ||
var _path$15; | ||
var _path$16; | ||
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); } | ||
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); } | ||
function SvgVolumeMute(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$19({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1b({ | ||
viewBox: "0 0 16 16", | ||
@@ -209,3 +209,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$15 || (_path$15 = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$16 || (_path$16 = /*#__PURE__*/React.createElement("path", { | ||
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z" | ||
@@ -215,8 +215,8 @@ }))); | ||
var _path$14; | ||
var _path$15; | ||
function _extends$18() { _extends$18 = 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$18.apply(this, arguments); } | ||
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); } | ||
function SvgVolumeOff(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$18({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1a({ | ||
viewBox: "0 0 16 16", | ||
@@ -229,3 +229,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$14 || (_path$14 = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$15 || (_path$15 = /*#__PURE__*/React.createElement("path", { | ||
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4" | ||
@@ -235,8 +235,8 @@ }))); | ||
var _path$13; | ||
var _path$14; | ||
function _extends$17() { _extends$17 = 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$17.apply(this, arguments); } | ||
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); } | ||
function SvgVolumeUp(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$17({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$19({ | ||
viewBox: "0 0 16 16", | ||
@@ -249,3 +249,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$13 || (_path$13 = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$14 || (_path$14 = /*#__PURE__*/React.createElement("path", { | ||
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" | ||
@@ -293,8 +293,8 @@ }))); | ||
var _path$2P; | ||
var _path$2Q; | ||
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); } | ||
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); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$33({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$35({ | ||
viewBox: "0 0 16 16", | ||
@@ -307,3 +307,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$2P || (_path$2P = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$2Q || (_path$2Q = /*#__PURE__*/React.createElement("path", { | ||
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" | ||
@@ -540,25 +540,104 @@ }))); | ||
var useTypographyStyles = makeStyles$1(function () { return ({ | ||
root: function (_a) { | ||
var _b; | ||
var weight = _a.weight; | ||
return (__assign((_b = {}, _b["& ." + iconStaticClassName] = { | ||
position: 'relative', | ||
top: '0.125em', | ||
padding: '0 0.125em', | ||
boxSizing: 'content-box', | ||
}, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 }))); | ||
}, | ||
caption: { | ||
display: 'inline', | ||
}, | ||
overline: { | ||
display: 'inline', | ||
}, | ||
}); }); | ||
var weights = { | ||
regular: 400, | ||
'semi-bold': 600, | ||
bold: 700, | ||
}; | ||
var getColor = function (theme, props) { | ||
var color = props.color; | ||
if (color === undefined) { | ||
return undefined; | ||
} | ||
if (['white', 'black'].includes(color)) { | ||
return theme.palette.common[color]; | ||
} | ||
if (color.match(/^grey\.\d{3}/)) { | ||
var scale = color.split('.')[1]; | ||
return theme.palette.grey[scale] || theme.palette.grey[900]; | ||
} | ||
if ([ | ||
'primary.light', | ||
'primary.dark', | ||
'secondary.light', | ||
'secondary', | ||
'secondary.dark', | ||
'info.light', | ||
'info.dark', | ||
'success.light', | ||
'success.dark', | ||
'error.light', | ||
'error.dark', | ||
'warning.light', | ||
'warning.dark', | ||
].includes(color)) { | ||
var _a = color.split('.'), paletteKey = _a[0], variant = _a[1]; | ||
return theme.palette[paletteKey][variant]; | ||
} | ||
if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) { | ||
return theme.palette[color].main; | ||
} | ||
if (['textPrimary', 'textSecondary'].includes(color)) { | ||
return theme.palette.text[color.slice(4).toLowerCase()]; | ||
} | ||
return undefined; | ||
}; | ||
var useTypographyStyles = makeStyles$1(function (theme) { | ||
var _a; | ||
return ({ | ||
root: (_a = {}, | ||
_a["& ." + iconStaticClassName] = { | ||
position: 'relative', | ||
top: '0.125em', | ||
padding: '0 0.125em', | ||
boxSizing: 'content-box', | ||
}, | ||
_a.fontFamily = theme.typography.fontFamily, | ||
_a.fontWeight = function (_a) { | ||
var variant = _a.variant, weight = _a.weight; | ||
return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight); | ||
}, | ||
_a.fontSize = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].fontSize; | ||
}, | ||
_a.lineHeight = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].lineHeight; | ||
}, | ||
_a.textTransform = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].textTransform; | ||
}, | ||
_a.color = function (props) { return getColor(theme, props); }, | ||
_a), | ||
caption: { | ||
display: 'inline', | ||
}, | ||
overline: { | ||
display: 'inline', | ||
}, | ||
}); | ||
}); | ||
var variantMap = { | ||
h1: 'h1', | ||
h2: 'h2', | ||
h3: 'h3', | ||
h4: 'h4', | ||
h5: 'h5', | ||
h6: 'h6', | ||
h7: 'h6', | ||
body1: 'p', | ||
body2: 'p', | ||
subtitle1: 'h6', | ||
subtitle2: 'h6', | ||
caption: 'span', | ||
overline: 'span', | ||
}; | ||
var Typography = forwardRef(function (props, ref) { | ||
props.weight; var restProps = __rest(props, ["weight"]); | ||
props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]); | ||
var classes = useTypographyStyles(props); | ||
return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes }, restProps)); | ||
var component = variantMap[variant]; | ||
return React__default.createElement(Typography$1, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" })); | ||
}); | ||
@@ -1038,5 +1117,5 @@ Typography.displayName = 'Typography'; | ||
React__default.createElement(Box, null, | ||
React__default.createElement(IconButton, { classes: { root: classes.playbackToggle }, "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback }, | ||
React__default.createElement(IconButton, __assign$1({}, (classes.playbackToggle && { classes: { root: classes.playbackToggle } }), { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback }), | ||
React__default.createElement(Icon, { icon: PlaybackIcon })), | ||
React__default.createElement(IconButton, { classes: { root: classes.volumeToggle }, "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple }, | ||
React__default.createElement(IconButton, __assign$1({}, (classes.volumeToggle && { classes: { root: classes.volumeToggle } }), { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple }), | ||
React__default.createElement(Icon, { icon: VolumeIcon }), | ||
@@ -1052,6 +1131,6 @@ React__default.createElement(Popper, { onClick: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setDisableRipple(true); }, onMouseLeave: function () { return setDisableRipple(false); }, open: state.volumeControls === VOLUME_CONTROL_STATES.SHOW, anchorEl: function () { return volumeRef.current; }, transition: true, placement: "top", className: classNames$1([classes.volumeSlider]) }, function (_a) { | ||
React__default.createElement(Box, { flexBasis: 60, flexShrink: 0 }, | ||
React__default.createElement(Typography, { classes: { root: classes.playbackText } }, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))), | ||
React__default.createElement(Slider, { classes: { root: classes.playbackSlider }, color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }), | ||
React__default.createElement(Typography, __assign$1({}, (classes.playbackText && { classes: { root: classes.playbackText } })), formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))), | ||
React__default.createElement(Slider, __assign$1({}, (classes.playbackSlider && { classes: { root: classes.playbackSlider } }), { color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE })), | ||
React__default.createElement(Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" }, | ||
React__default.createElement(Typography, { classes: { root: classes.lengthText } }, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0)))))); | ||
React__default.createElement(Typography, __assign$1({}, (classes.lengthText && { classes: { root: classes.lengthText } })), formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0)))))); | ||
}; | ||
@@ -1058,0 +1137,0 @@ |
@@ -174,8 +174,8 @@ 'use strict'; | ||
var _path$1l; | ||
var _path$1m; | ||
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); } | ||
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); } | ||
function SvgPause(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1r({ | ||
viewBox: "0 0 16 16", | ||
@@ -188,3 +188,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$1l || (_path$1l = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$1m || (_path$1m = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z" | ||
@@ -194,8 +194,8 @@ }))); | ||
var _path$1j; | ||
var _path$1k; | ||
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); } | ||
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); } | ||
function SvgPlay(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1n({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({ | ||
viewBox: "0 0 16 16", | ||
@@ -208,3 +208,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$1j || (_path$1j = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$1k || (_path$1k = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M3.333 2l9.334 6-9.334 6V2z" | ||
@@ -214,8 +214,8 @@ }))); | ||
var _path$16; | ||
var _path$17; | ||
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); } | ||
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); } | ||
function SvgVolumeDown(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1c({ | ||
viewBox: "0 0 16 16", | ||
@@ -228,3 +228,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$16 || (_path$16 = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$17 || (_path$17 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714" | ||
@@ -234,8 +234,8 @@ }))); | ||
var _path$15; | ||
var _path$16; | ||
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); } | ||
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); } | ||
function SvgVolumeMute(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1b({ | ||
viewBox: "0 0 16 16", | ||
@@ -248,3 +248,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$15 || (_path$15 = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$16 || (_path$16 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z" | ||
@@ -254,8 +254,8 @@ }))); | ||
var _path$14; | ||
var _path$15; | ||
function _extends$18() { _extends$18 = 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$18.apply(this, arguments); } | ||
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); } | ||
function SvgVolumeOff(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({ | ||
viewBox: "0 0 16 16", | ||
@@ -268,3 +268,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$14 || (_path$14 = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$15 || (_path$15 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4" | ||
@@ -274,8 +274,8 @@ }))); | ||
var _path$13; | ||
var _path$14; | ||
function _extends$17() { _extends$17 = 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$17.apply(this, arguments); } | ||
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); } | ||
function SvgVolumeUp(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$17({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({ | ||
viewBox: "0 0 16 16", | ||
@@ -288,3 +288,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$13 || (_path$13 = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$14 || (_path$14 = /*#__PURE__*/React__namespace.createElement("path", { | ||
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" | ||
@@ -332,8 +332,8 @@ }))); | ||
var _path$2P; | ||
var _path$2Q; | ||
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); } | ||
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); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$33({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$35({ | ||
viewBox: "0 0 16 16", | ||
@@ -346,3 +346,3 @@ strokeLinecap: "round", | ||
fill: "none" | ||
}, props), _path$2P || (_path$2P = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$2Q || (_path$2Q = /*#__PURE__*/React__namespace.createElement("path", { | ||
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" | ||
@@ -579,25 +579,104 @@ }))); | ||
var useTypographyStyles = styles.makeStyles(function () { return ({ | ||
root: function (_a) { | ||
var _b; | ||
var weight = _a.weight; | ||
return (__assign((_b = {}, _b["& ." + iconStaticClassName] = { | ||
position: 'relative', | ||
top: '0.125em', | ||
padding: '0 0.125em', | ||
boxSizing: 'content-box', | ||
}, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 }))); | ||
}, | ||
caption: { | ||
display: 'inline', | ||
}, | ||
overline: { | ||
display: 'inline', | ||
}, | ||
}); }); | ||
var weights = { | ||
regular: 400, | ||
'semi-bold': 600, | ||
bold: 700, | ||
}; | ||
var getColor = function (theme, props) { | ||
var color = props.color; | ||
if (color === undefined) { | ||
return undefined; | ||
} | ||
if (['white', 'black'].includes(color)) { | ||
return theme.palette.common[color]; | ||
} | ||
if (color.match(/^grey\.\d{3}/)) { | ||
var scale = color.split('.')[1]; | ||
return theme.palette.grey[scale] || theme.palette.grey[900]; | ||
} | ||
if ([ | ||
'primary.light', | ||
'primary.dark', | ||
'secondary.light', | ||
'secondary', | ||
'secondary.dark', | ||
'info.light', | ||
'info.dark', | ||
'success.light', | ||
'success.dark', | ||
'error.light', | ||
'error.dark', | ||
'warning.light', | ||
'warning.dark', | ||
].includes(color)) { | ||
var _a = color.split('.'), paletteKey = _a[0], variant = _a[1]; | ||
return theme.palette[paletteKey][variant]; | ||
} | ||
if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) { | ||
return theme.palette[color].main; | ||
} | ||
if (['textPrimary', 'textSecondary'].includes(color)) { | ||
return theme.palette.text[color.slice(4).toLowerCase()]; | ||
} | ||
return undefined; | ||
}; | ||
var useTypographyStyles = styles.makeStyles(function (theme) { | ||
var _a; | ||
return ({ | ||
root: (_a = {}, | ||
_a["& ." + iconStaticClassName] = { | ||
position: 'relative', | ||
top: '0.125em', | ||
padding: '0 0.125em', | ||
boxSizing: 'content-box', | ||
}, | ||
_a.fontFamily = theme.typography.fontFamily, | ||
_a.fontWeight = function (_a) { | ||
var variant = _a.variant, weight = _a.weight; | ||
return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight); | ||
}, | ||
_a.fontSize = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].fontSize; | ||
}, | ||
_a.lineHeight = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].lineHeight; | ||
}, | ||
_a.textTransform = function (_a) { | ||
var variant = _a.variant; | ||
return theme.typography[variant || 'body1'].textTransform; | ||
}, | ||
_a.color = function (props) { return getColor(theme, props); }, | ||
_a), | ||
caption: { | ||
display: 'inline', | ||
}, | ||
overline: { | ||
display: 'inline', | ||
}, | ||
}); | ||
}); | ||
var variantMap = { | ||
h1: 'h1', | ||
h2: 'h2', | ||
h3: 'h3', | ||
h4: 'h4', | ||
h5: 'h5', | ||
h6: 'h6', | ||
h7: 'h6', | ||
body1: 'p', | ||
body2: 'p', | ||
subtitle1: 'h6', | ||
subtitle2: 'h6', | ||
caption: 'span', | ||
overline: 'span', | ||
}; | ||
var Typography = React.forwardRef(function (props, ref) { | ||
props.weight; var restProps = __rest(props, ["weight"]); | ||
props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]); | ||
var classes = useTypographyStyles(props); | ||
return React__default['default'].createElement(core.Typography, __assign({ ref: ref, classes: classes }, restProps)); | ||
var component = variantMap[variant]; | ||
return React__default['default'].createElement(core.Typography, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" })); | ||
}); | ||
@@ -1077,5 +1156,5 @@ Typography.displayName = 'Typography'; | ||
React__default['default'].createElement(core.Box, null, | ||
React__default['default'].createElement(IconButton, { classes: { root: classes.playbackToggle }, "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback }, | ||
React__default['default'].createElement(IconButton, __assign$1({}, (classes.playbackToggle && { classes: { root: classes.playbackToggle } }), { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback }), | ||
React__default['default'].createElement(Icon, { icon: PlaybackIcon })), | ||
React__default['default'].createElement(IconButton, { classes: { root: classes.volumeToggle }, "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple }, | ||
React__default['default'].createElement(IconButton, __assign$1({}, (classes.volumeToggle && { classes: { root: classes.volumeToggle } }), { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple }), | ||
React__default['default'].createElement(Icon, { icon: VolumeIcon }), | ||
@@ -1091,6 +1170,6 @@ React__default['default'].createElement(core.Popper, { onClick: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setDisableRipple(true); }, onMouseLeave: function () { return setDisableRipple(false); }, open: state.volumeControls === VOLUME_CONTROL_STATES.SHOW, anchorEl: function () { return volumeRef.current; }, transition: true, placement: "top", className: classNames$1([classes.volumeSlider]) }, function (_a) { | ||
React__default['default'].createElement(core.Box, { flexBasis: 60, flexShrink: 0 }, | ||
React__default['default'].createElement(Typography, { classes: { root: classes.playbackText } }, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))), | ||
React__default['default'].createElement(core.Slider, { classes: { root: classes.playbackSlider }, color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }), | ||
React__default['default'].createElement(Typography, __assign$1({}, (classes.playbackText && { classes: { root: classes.playbackText } })), formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))), | ||
React__default['default'].createElement(core.Slider, __assign$1({}, (classes.playbackSlider && { classes: { root: classes.playbackSlider } }), { color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE })), | ||
React__default['default'].createElement(core.Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" }, | ||
React__default['default'].createElement(Typography, { classes: { root: classes.lengthText } }, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0)))))); | ||
React__default['default'].createElement(Typography, __assign$1({}, (classes.lengthText && { classes: { root: classes.lengthText } })), formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0)))))); | ||
}; | ||
@@ -1097,0 +1176,0 @@ |
{ | ||
"name": "@popmenu/audio-player", | ||
"version": "0.27.0", | ||
"version": "0.28.0", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "author": "Popmenu Design System Team", | ||
"sideEffects": false, | ||
"gitHead": "9c8e2dc9096eeaa8be6eee8112bc5330d2c7ffcc" | ||
"gitHead": "e94e8b2bf58e7c2767c320311051c6f50aaa8c5f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
888741
2241